@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, ...).
@mdtusz
Latest list of circular dependencies:
Plotscalls inaxes.jsaretraceIs)Possible partial solutions:
plot_api.jsdoesn'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 adrawmethod and possible andinitmethod.relayoutandrestyleto a plot object so that files requiringplot_api.js(e.g Annotations, Shapes and Fx) can usegd.relayout()instead ofplotApi.relayout(gd, ...).