You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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, ...).
In the course of #1403 I made some circular deps involving Lib. In the short term I'm fixing these by breaking up Lib and just requiring the pieces I need, but longer term perhaps the right solution is to only allow things in Lib that do not require code from elsewhere in plotly.js. That would make it safe to import Lib anywhere, without forcing us to break it into a million little files. Would be a bit of an effort though...
Activity
etpinard commentedon Feb 17, 2017
The World Calendar push of #1220 added a new circular dependency pattern to
src/:as
src/registry.jsrequiresLibfor andsrc/lib/dates.jsrequiresRegistryto use the calendars component methods.To solve this, we can either:
lib/dates.jsa component module (as one could argue thatsrc/lib/files should have to use the registry)registry.jsinstead of requiring the wholeLibmodulebump MAX_ALLOWED_CIRCULAR_DEPS to 18
alexcjohnson commentedon Feb 22, 2017
In the course of #1403 I made some circular deps involving
Lib. In the short term I'm fixing these by breaking upLiband just requiring the pieces I need, but longer term perhaps the right solution is to only allow things inLibthat do notrequirecode from elsewhere in plotly.js. That would make it safe to importLibanywhere, without forcing us to break it into a million little files. Would be a bit of an effort though...etpinard commentedon Nov 17, 2017
Refer to PR #2032 for the most up-to-date findings.