Skip to content

Make Plotly.plot agnostic to plot modules #160

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

Merged
merged 17 commits into from
Jan 6, 2016
Merged

Make Plotly.plot agnostic to plot modules #160

merged 17 commits into from
Jan 6, 2016

Conversation

etpinard
Copy link
Contributor

@etpinard etpinard commented Jan 5, 2016

Checks off a few bullet items in #41 (comment)

Not sure, if it's worth merging before @mdtusz 's module registry lands (ref #157), but here's a glimpse of things to come.

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

etpinard commented Jan 5, 2016

In short:

This PR makes the plot_api.js file agnostic to the geo, gl3d and gl2d plotting routines. This is a required step towards modularity.


exports.supplyLayoutDefaults = require('./layout/defaults');

exports.plot = function plotGeo(gd) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

e.g. the geo plotting routine accessed in Plotly.plot via the plots registry.

@mdtusz mdtusz changed the title Make Plotly.plot anognictic to plot modules Make Plotly.plot agnostic to plot modules Jan 5, 2016
exports.Scene2D = require('./plots/gl2d/scene2d');

var Geo = require('./plots/geo');
Plots.registerSubplot(Geo);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

one step towards modularity. This register step will taken out of the core module and added on-demand by users.

@mdtusz
Copy link
Contributor

mdtusz commented Jan 5, 2016

I can't see anything that looks out of place, but I'd like to give it another read through tomorrow (and dig deeper into the existing way of doing things). Looks like we're moving in the right direction though 👍

- assume that if fullLayout._has[] is set, the corresponding
  plot module has been registered. If not the case, this will result
  in an error.
  instead of relying an a hard-coded list.
@etpinard
Copy link
Contributor Author

etpinard commented Jan 6, 2016

@mdtusz one last look?

@etpinard etpinard mentioned this pull request Jan 6, 2016
},
fullLayout
);

Copy link
Contributor

Choose a reason for hiding this comment

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

What's the style preference here - to have the ); aligned with the initial code (scene) or on the end of fullLayout?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

aliged with the initial code (scene)

looks better to my eyes. But I have no strong opinion.

@mdtusz
Copy link
Contributor

mdtusz commented Jan 6, 2016

💃 after minor style things.

etpinard added a commit that referenced this pull request Jan 6, 2016
Make Plotly.plot agnostic to plot modules
@etpinard etpinard merged commit 4145990 into master Jan 6, 2016
@etpinard etpinard deleted the plot-index branch January 6, 2016 23:55
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