mstefaniuk / graph-viz-d3-js

Graphviz web D3.js renderer
MIT License
313 stars 38 forks source link

Fixed panning when outzoomed by correcting zoom overlay #41

Closed magjac closed 7 years ago

magjac commented 7 years ago

From https://bl.ocks.org/mbostock/4e3925cdc804db257a86fdef3a032a45:

The zoom behavior is applied to an invisible rect overlaying the SVG element; this ensures that it receives input, and that the pointer coordinates are not affected by the zoom behavior’s transform.

There were several problems:

  1. The overlay rect was a child of the g that was transformed.
  2. The zoom behavior was not attached to the rect, but to the g.
  3. The rect was not positioned correctly after applying fixes for 1 and 2.
coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 97.63% when pulling 663eee76ff0bf2d43d073ddf9fb170338e87cbaf on magjac:master into d07d793aab5507f7bb6329aa1ff08d76a71a4015 on mstefaniuk:master.

mstefaniuk commented 7 years ago

Do you plan to add any test for that fix?

magjac commented 7 years ago

No, I have too little knowledge and too little time. Sorry.

mstefaniuk commented 7 years ago

Thank you very much for your support.