Skip to content

Conversation

mdtusz
Copy link
Contributor

@mdtusz mdtusz commented Jan 19, 2016

Some slight changes so that the plot modules will be loaded along with their respective traces.

This will allow us to slim down the bundle size even more in the case where only a few traces (e.g. no gl) are needed.

@@ -41,7 +41,7 @@ plots.fontWeight = 'normal';
*/
plots.register = function(_module, thisType, categoriesIn, meta) {
if(modules[thisType]) {
console.warn('type ' + thisType + ' already registered');
console.log('type ' + thisType + ' already registered');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bringing in @bpostlethwaite and @alexcjohnson

Should we warn (or spit out a console.log) when users register the same plot module twice?

I'd vote for doing nothing at all.

@mdtusz If I'm no mistaken, every time a user registers two or more trace modules that rely on the same plot module e.g.

var PlotlyBar = require('plotly.js/lib/bar');
var PlotlyBox = require('plotly.js/lib/box');

Plotly.register([PlotlyBar, PlotlyBox]);

would split out a log.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fyi I switched log --> warn out of (perhaps bad) habit, from when I had a project that needed to support ie8 😦

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh boy. No way plotly.js works in ie8

@etpinard etpinard added this to the Modular plotly.js milestone Jan 19, 2016
@mdtusz
Copy link
Contributor Author

mdtusz commented Jan 20, 2016

How are we feeling on this one @etpinard?

@etpinard
Copy link
Contributor

💃 let's merge this in.

We can revisit the log vs warn issue later.

mdtusz added a commit that referenced this pull request Jan 20, 2016
@mdtusz mdtusz merged commit 58e86d9 into master Jan 20, 2016
@mdtusz mdtusz deleted the subplot-registration branch January 20, 2016 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants