-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add global transforms config option #852
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
- so that transform can use fullTrace._input, index and _expandedIndex
- transform options can be specified using the config arg or globally using Plotly.setPlotConfig() - global transforms are applied to all traces and are supplied before all other trace transforms.
filtersrc: 'x' | ||
}, '- trace second'); | ||
}); | ||
|
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 great!
What do you think about one additional test that ensures transforms have access to fullTrace._input
user data? Just in case someone other than yourself decides to refactor one day and accidentally breaks a bunch of userspace transforms.
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.
good call
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.
done in 6af72d0
looks great, one 🐅 question but otherwise 💃 |
- Plots.supplyDefaults({data: [], layout: {}}) should work always!
expect(dataOut[0]._input).toBe(dataIn[0]); | ||
expect(opts.transform).toBe(transformOut); | ||
expect(opts.fullTrace._input).toBe(dataIn[0]); | ||
expect(opts.layout).toBe(layout); |
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.
👍
so that users can now set transform globally for all traces going through
Plotly.plot
.Example:
cc @bpostlethwaite