-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Implement scatter cliponaxis: false
#1824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- N.B. dflt and current behavior has `cliponaxis: true`.
- with nested <g.scatterlayer> to implement `cliponaxis: false` - apply on ax._offset values to this new layer, but don't attach clip path!
- factor out markers/text nodes renderer out plotOne - add plotOneNoClip which draw markers, text nodes and errorbars in the plotnoclip layer - always draw lines and fills in regular (clipped) plot layer!
- use in Drawing.translatePoint to clear out-of-range markers/text nodes when `cliponaxis: false`
- mock plotinfo.plotnoclip before calling scatter/plot.js - override isPtWithinRange methods for ternary
re: attribute name: Since this applies only to markers I'd put it in the |
Yeah, I thought about that, but didn't think it would be a big deal. Guess I was wrong.
I guess you didn't see the part about text nodes and error bars. |
That too, I didn't think this would be a big deal. I suspect 99% of the use cases for |
I'm glad that you guys are doing such a thorough job in considering the edge cases. By the way, for scientific plots my intuition would be the opposite of yours: 99% of the use cases will not want the symbols to be truncated by the axis boundaries irrespective of the zoom. A survey of our users (all scientists admittedly) found that not a single one of them could come up with a use case where symbol truncation was a desirable feature. Based on this response our current plan is hardwire |
Ah right, sorry. Text should work this way for sure, so the attribute doesn't belong in I'm not sure about error bars though (apologies for not noticing the comments on this last week) - my gut reaction is to not include them outside the clip area, since (unlike markers and text) their ends correspond to actual axis values, so if the axis value at the end of an error bar is not displayed, then the bar should not be displayed either. I suppose you could argue that the caps should not be clipped, in the direction perpendicular to the errors, but that's adding a whole other layer of complexity for what seems like little benefit. |
That's not what I meant. I was referring to interacting by panning or via the zoom box on a |
Closing this thing. 😡 |
Resolves #1385
In brief, this PR adds a new layer to each cartesian and ternary (and eventually geo) subplot where the clipping
<rect>
isn't applied. Instead, points (i.e. markers, text nodes and error bars) are removed if their (x,y) or (a,b,c) coordinates are outside the subplot's current axis range box as discussed in #1385 (comment).Note that, line and fills are never plotted in the
noclip
layer. This fact led to some non-trivial changes inscatter/plot.js
. I would enjoy a thorough review from @alexcjohnson and @rreusser there. That said, as the scatterternary module reusesscatter/plot.js
, implement thecliponaxis: false
behavior was pretty DRY 🌴.TODO:
Maybes:
cliponaxis: false
forscattergeo
(might leave this for another PR)cc @geocosmite