-
-
Notifications
You must be signed in to change notification settings - Fork 114
Version bump 1391 #566
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
Version bump 1391 #566
Conversation
| } | ||
| if ( | ||
| isNumeric(payload.transformIndex) && | ||
| payload.traceIndex < graphDiv.data.length |
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.
i'm not sure I understand this line: payload.traceIndex < graphDiv.data.length
before we used to loop and find the trace in data that matched our transform index. how is this replaced now with the line above?
do we not need to loop, like we used to but have the comparison be:
if (payload.transformIndex === graphDiv._fullData[i].index) in place of if (graphDiv.data[i].uid === payload.traceUid)
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.
I figure we looped in order to find the UID, now we go by index. Why did we loop in the first place, when we could just do graphDiv.data.find(...)?..
And perhaps we don't need the line that you mentioned either. I just put it there defensively.
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.
payload.transformIndex, indicates a _fullData index?
indexes are not 1:1, an index in data could have a different index in _fullData
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.
plz check the discussion in plotly_js slack:
nicolas [13:40]
we're trying to match up from data not fullData
etienne [13:41]
fullData[i]._fullInput.index will be the index in gd.data
nicolas [13:42]
ok so we might be able to go from if (trace.uid === fullData[i]._fullInput._input.uid) {
to if (theIndex === fullData[i]._fullInput._input.index) {
assuming theIndex is the position of trace in the data array?
etienne [13:44]
yeah, that should work
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.
ok sure, yes them it looks like you don't need that conditional,
thanks!
| let fullTrace = {}; | ||
| for (let i = 0; i < fullData.length; i++) { | ||
| if (trace.uid === fullData[i]._fullInput._input.uid) { | ||
| if (traceIndexes[0] === fullData[i]._fullInput.index) { |
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.
should this be traceIndexes[i] ?
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.
There's a traceIndexes array for each trace, presumably to identify traces that you get when you split or something like that? So seems like traceIndex[0] always points to THE trace. Or am I misunderstanding something?
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.
traceIndexes is an array of either:
- one single trace (like [0])
- or an array of traces ([[0, 1]]).
It will be an array when we're dealing with grouped traces, like in the accordions that allow you to style multiple traces at once.
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.
💃
i'll recheck on my fits integration branch that this works ok for fits, but in principle, I am ok with this change
plotly.js version bump to 1.39.1
Since plotly.js no longer copies UID from
_fullDatatodata, we can't rely on UID to identify traces and from now on have to usefullData[i]._fullInput.index, which will correspond to index indata.