-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Selection re-ordering for scatter traces with ids
#1709
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
Changes from all commits
cbcec26
83234b5
c8c3197
5fa1e97
9c35675
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -419,17 +419,20 @@ function plotOne(gd, idx, plotinfo, cdscatter, cdscatterAll, element, transition | |
var enter = join.enter().append('path') | ||
.classed('point', true); | ||
|
||
enter.call(Drawing.pointStyle, trace) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @n-riesco thanks very much 🎉 Your solution appears to work: My only concern now is how this interacts with animations. I think the reason why I'm thinking instead, we could keep those Thoughts? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the point you make about animations is important. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @etpinard
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
.call(Drawing.translatePoints, xa, ya, trace); | ||
|
||
if(hasTransition) { | ||
enter.style('opacity', 0).transition() | ||
enter | ||
.call(Drawing.pointStyle, trace) | ||
.call(Drawing.translatePoints, xa, ya, trace) | ||
.style('opacity', 0) | ||
.transition() | ||
.style('opacity', 1); | ||
} | ||
|
||
var markerScale = showMarkers && Drawing.tryColorscale(trace.marker, ''); | ||
var lineScale = showMarkers && Drawing.tryColorscale(trace.marker, 'line'); | ||
|
||
join.order(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why do we need There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. one for marker nodes, one for text nodes There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah right - didn't notice |
||
|
||
join.each(function(d) { | ||
var el = d3.select(this); | ||
var sel = transition(el); | ||
|
@@ -441,6 +444,8 @@ function plotOne(gd, idx, plotinfo, cdscatter, cdscatterAll, element, transition | |
if(trace.customdata) { | ||
el.classed('plotly-customdata', d.data !== null && d.data !== undefined); | ||
} | ||
} else { | ||
sel.remove(); | ||
} | ||
}); | ||
|
||
|
@@ -460,6 +465,8 @@ function plotOne(gd, idx, plotinfo, cdscatter, cdscatterAll, element, transition | |
// it gets converted to mathjax | ||
join.enter().append('g').classed('textpoint', true).append('text'); | ||
|
||
join.order(); | ||
|
||
join.each(function(d) { | ||
var g = d3.select(this); | ||
var sel = transition(g.select('text')); | ||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To my surprise,
Drawing.translatePoint
is called only inscatter/plot.js
andbox/plot.js
:Note that this patch does not affect the
box/plot.js
logic where points with non-numeric positions are filtered out of the data bind.