Skip to content

Efficient deep copy of graph_objs without validation #1078

Closed
@jonmmease

Description

@jonmmease

Consider the following:

fig1 = go.Figure(...)
fig2 = go.Figure(fig1)

Right now, the construction of fig2 involves the re-validation of all of the properties in fig1. But this is unnecessarily since the properties are guaranteed to be valid in fig1.

Also consider this case:

go.Figure(data=[go.Scatter(marker=go.scatter.Marker(...))])

Here, go.Scatter should not rerun the marker validation logic, and go.Figure should not rerun the scatter trace validation logic.

We should have a fast performance path for these cases that just performs a deepcopy on the raw dict and splices that into a new object, without any additional validation.

See https://community.plot.ly/t/how-to-copy-figure-or-trace-object-deepcopy-no-longer-working/12166

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