Skip to content

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

Closed
@bpostlethwaite

Description

@bpostlethwaite

@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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions