Skip to content

De-circularize plotly.js require statements #236

Closed
@etpinard

Description

@etpinard

@mdtusz

Latest list of circular dependencies:

  • Plots < --- > Annotations
  • Plots < --- > Legend
  • Plots < --- > Axes (the only Plots calls in axes.js are traceIs)
  • Plots < --- > plotApi
  • plotApi < --- > Annotations
  • plotApi < --- > Shapes
  • plotApi < --- > Titles
  • plotApi < --- > Fx
  • plotApit < --- > Legend

Possible partial solutions:

  • Make a component registry and register the components (e.g. Annotations, Shapes, Titles, Fx, Legend), so plot_api.js doesn't have to require the full component modules (similar to trace and subplot modules). Blocking: we'll need a centralized api for the component module, e.g. all component modules should have a draw method and possible and init method.
  • Use a more OO pattern (in the long term). Attach relayout and restyle to a plot object so that files requiring plot_api.js (e.g Annotations, Shapes and Fx) can use gd.relayout() instead of plotApi.relayout(gd, ...).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions