eigenhombre / i3d3

D3-based plotting and histogramming library
25 stars 5 forks source link

Issue 6520: implement panning and zooming #6

Closed eigenhombre closed 10 years ago

eigenhombre commented 10 years ago

@mrocklin @mfrere , this rather extensive reworking supports panning and zooming à la http://bl.ocks.org/eigenhombre/7362945/52070c225cb7d656a7608ebe9d38e8e754b0e9ca

Comments welcome. I have one or two more tweaks I'd like to try and get in; then I will merge either tomorrow or Monday.

One thing I don't like is that you can zoom out endlessly until the graph disappears. A refinement would be to restrict to the original x / y extents (i.e. you can zoom out only after you've zoomed in). This is apparently not easy to implement w/ the current D3.js but I may try anyway when the opportunity presents itself.

mfrere commented 10 years ago

Overall very nice. After playing with it for a couple minutes, here's what I can say: -I can't see the X-axis label -I agree, zooming out should be limited to the original graph size, but this should be the case for panning as well imo. -Your example is pretty smooth with Chrome, but much less in Firefox (under ubuntu). It's better on JohnK's computer but still very stuttery. This might be due to a high amount of svg rendered in the example. Could you make another example with less data, so I can see if there's a difference?

I don't know if this helps, but here are a couple d3 examples with/without the same symptoms.

This example has the same issue: http://bl.ocks.org/mbostock/4015254

These 2 are smooth: http://bl.ocks.org/anonymous/4473078 http://bl.ocks.org/mbostock/3892919

mfrere commented 10 years ago

with a little more research, it seems that Firefox is overall slower in terms of drawing svgs

http://bl.ocks.org/stepheneb/1296930 I get 60-70 total time for this one in ffox, compared to 10-25 for chrome

http://bl.ocks.org/mbostock/2647924 ~10 fps for ffox, ~60 fps for chrome

This does not necessarily mean that this the problem we're facing with i3d3 as we don't really push d3 to the limit as they do in these examples, but it's still good to keep in mind. I really hope this slowness will be solved in a future version of ffox.

eigenhombre commented 10 years ago

Really good to know, thanks for doing the research.

On Nov 8, 2013, at 1:45 PM, mfrere notifications@github.com wrote:

with a little more research, it seems that Firefox is overall slower in terms of drawing svgs

http://bl.ocks.org/stepheneb/1296930 I get 60-70 total time for this one in ffox, compared to 10-25 for chrome

http://bl.ocks.org/mbostock/2647924 ~10 fps for ffox, ~60 fps for chrome

This does not necessarily mean that this the problem we're facing with i3d3 as we don't really push d3 to the limit as they do in these examples, but it's still good to keep in mind. I really hope this slowness will be solved in a future version of ffox.

— Reply to this email directly or view it on GitHub.

eigenhombre commented 10 years ago

Merging this now, but comments welcome any time.