Skip to content

graphDiv masks hidden dependencies and complicates state management #355

Closed
@vdh

Description

@vdh

@nicolaskruchten So to expand upon my concerns expressed in plotly/plotly.js#2389

react-plotly.js-editor has these special _fullData, _fullLayout, and _context properties as hidden dependencies drawn out from the graphDiv prop. I can't seem to find documentation on them, and the underscores seems to hint that they're supposed to be private internal variables to Plotly. It's implied that graphDiv is just supposed to be a wrapper for { data, layout }, but the source code and examples seem to say otherwise.

But since it's all hidden away inside this DOM Element wrapper, it's never fully explained in the docs that there's something special going on, and it's very unclear how to properly handle the separation of state management (like Redux, which should not be concerning itself with passing around a DOM element), and the behind-the-scenes integration between PlotlyEditor and the Plot / PlotComponent.

Maybe you'd prefer to always keep graphDiv as a required prop for the editor for the sake of tight integration, but data and layout (and any other relevant state information) should be separated out into dedicated props.

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