Skip to content

Exposing (and augmenting) Plotly.Axes.list #2152

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

Closed
bpostlethwaite opened this issue Nov 11, 2017 · 2 comments
Closed

Exposing (and augmenting) Plotly.Axes.list #2152

bpostlethwaite opened this issue Nov 11, 2017 · 2 comments

Comments

@bpostlethwaite
Copy link
Member

@alexcjohnson it is possible to require Axes.list statically but without tree shaking you end up including a lot of extra plotly.js bytes in the bundle https://github.com/plotly/plotly.js/blob/master/src/plots/cartesian/axis_ids.js#L11-L15

In the Plotly.react model we are asking the user to update gd.data and gd.layout in their application code. As such it might be useful to expose some logic that can wrap intricacies such as

if(keys[i].indexOf('allaxes') === 0) {
for(j = 0; j < axes.length; j++) {
var scene = axes[j]._id.substr(1),
axisAttr = (scene.indexOf('scene') !== -1) ? (scene + '.') : '',
newkey = keys[i].replace('allaxes', axisAttr + axes[j]._name);
if(!aobj[newkey]) aobj[newkey] = aobj[keys[i]];
}
delete aobj[keys[i]];
}

I'll update this issue with suggestions once I implement some more of the Axes update code in the App I am working on.

@alexcjohnson
Copy link
Collaborator

The reorganization I'm doing as part of #2125 will simplify Axes.list substantially, so requiring it directly may become viable, but we can discuss that when I get that PR up, might not even be necessary at that point. I'm sure @etpinard would approve if we can avoid exposing innards like that!

@etpinard
Copy link
Contributor

etpinard commented May 8, 2019

Closing (for now).

@etpinard etpinard closed this as completed May 8, 2019
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

No branches or pull requests

3 participants