-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Trace Module Functionality #180
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 12 commits
7e41625
b716568
d639a93
356d0af
7a22cff
2ac3605
6e53762
46b83d8
23519f0
71db785
06640b4
4507ec5
6bd4c5b
b4793c1
48b3803
5a2da5c
4fe8440
e46373e
a7fda91
43156a3
03232e0
28def12
f831b66
4994256
6dd9a41
823ae72
75dc282
b8864eb
5f26169
a693bb2
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 |
---|---|---|
|
@@ -45,3 +45,22 @@ exports.Queue = Plotly.Queue; | |
|
||
// export d3 used in the bundle | ||
exports.d3 = require('d3'); | ||
|
||
Plotly.register({ | ||
traces: { | ||
bar: require('./traces/bar'), | ||
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. Nice! Bringing @bpostlethwaite and @alexcjohnson for some thoughts on the API:
// this might be sufficient
Plotly.register([require('plotly.js/bar'), require('plotly.js/box')]);
// or even where we would loop over the argument object
Plotly.register(require('plotly.js/bar'), require('plotly.js/box')); Granted, passing an object with key 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. The trace modules have 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'd go for the simplest form (loop over arguments). Another reason: you're not using the keys of this object - which is good, because we don't want users making their own names for the trace types, this should come from the module itself. But then why bother having an object with keys? Re: components - either behind the scenes, or just make a different function like 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. +1 for loop over arguments. 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. 👍 simplest 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. What makes a component registerable? How can users do Plotly.register(myComponent) if we want users to be able to do that in the future an object notation may be necessary so we can allow certain requirements to be turned on/off during the registration process. 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.
Maybe we could store another meta property in the trace modules? e.g. var PlotlyBar = require('plotly.js/lib/bar');
console.log(PlotlyBar.moduleType); // => 'trace' and down the road, registerable component modules could have Moreover, 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.
Wouldn't @mdtusz that said, I'm ok with
I'd vote for a single 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'll add a Do we want to get rid of the 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. Let's get rid of the |
||
box: require('./traces/box'), | ||
heatmap: require('./traces/heatmap'), | ||
histogram: require('./traces/histogram'), | ||
histogram2d: require('./traces/histogram2d'), | ||
histogram2dcontour: require('./traces/histogram2dcontour'), | ||
pie: require('./traces/pie'), | ||
contour: require('./traces/contour'), | ||
scatter3d: require('./traces/scatter3d'), | ||
surface: require('./traces/surface'), | ||
mesh3d: require('./traces/mesh3d'), | ||
scattergeo: require('./traces/scattergeo'), | ||
choropleth: require('./traces/choropleth'), | ||
scattergl: require('./traces/scattergl') | ||
} | ||
}); |
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.
Let's require in
pie/style_one.js
directly, so that once we split outPie
from the core, legend won't bundle all ofPie
into its module.