Skip to content

Consistently either mutate or replace data and layout? #1492

Closed
@druvisc

Description

@druvisc

http://codepen.io/anon/pen/vxWRry

The graphDiv.data looks like it 'should be', the trouble is with the passed in data array. At the first addTraces call the data array gets mutated and the trace gets added at the end of the array, not at the specified index, and further addTraces calls don't even further mutate the array.

This is very confusing and I'd say it's a bug one way or another (mutating the passed in data array or not continuing to do so after the first addTraces call, even if the addTraces index gets ignored). Should be clear that there's only one 'source of truth' so either the graphDiv.data should be accessed or the developer should keep tabs on the traces himself.

Currently the functionality for my use (Angular2 and input binding) is broken and I'll have to resort to to Plotly.redraw.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions