-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Filter fixes #1062
Filter fixes #1062
Conversation
- so that findArrayAttributes can track arrayOk attribute within transforms containers.
- use auto-typed axis data-to-calc method to filter by target array
var transform = transforms[i]; | ||
|
||
stack = ['transforms[' + i + ']']; | ||
exports.crawl(transform._module.attributes, callback, 1); |
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.
Loop through transform container found in the trace, use the transform module attributes declaration to determine which attributes are data_array
or arrayOk
.
}] | ||
})]); | ||
|
||
expect(out[0].x).toEqual([-1, 1, 2]); | ||
expect(out[0].y).toEqual([2, 2, 3]); | ||
expect(out[0].ids).toEqual(['n1', 'p1', 'p2']); | ||
}); | ||
|
||
describe('filters should handle array *target* values', function() { |
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.
@chriddyp please review the lines ⏬
thank you.
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.
looks good!
layout: {} | ||
}; | ||
|
||
Plots.supplyDefaults(mockGd); |
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.
Oh and by the way @bpostlethwaite transform attribute are already part of the plot schema: |
👍! 💃 from me! |
- for the Array.isArray(target) case
b66ff67
to
14fd327
Compare
After first being released in
v1.18.0
, we come to the conclusion that filter transforms are incompatible with plot.ly's webapp data references.So, we have no choice but to 🔪 the
filtersrc
attribute and rename it'target'
. A backward-compatible block has been tocleanData
.Moreover, to allow filtering about arbitrary columns of data, we now allow
'target'
to be an arbitrary array of data - which required a few patches to theLib.findArrayAttributes
.cc @rreusser @bpostlethwaite @chriddyp