Description
Replace valType: 'any' on config.modeBarButtonsToRemove with an enumerated list of the button names it accepts.
Why should this change be made?
Its description sends readers to ./components/modebar/buttons.js. The names are already derived as foreButtons in src/components/modebar/constants.js, and layout.modebar.remove interpolates that constant into its own description.
This publishes the 48 names for every language port, and lets the type generator derive the union that ModeBarDefaultButtons in src/types/core/layout.d.ts maintains by hand. Config options are never coerced, so no runtime behavior changes.
Scope
- Update
src/plot_api/plot_config.js with new info
- Update
tasks/generate_schema_types.mjs to handle the new type generation
- Remove the hand written info from
src/types/core/layout.d.ts
Description
Replace
valType: 'any'onconfig.modeBarButtonsToRemovewith an enumerated list of the button names it accepts.Why should this change be made?
Its description sends readers to
./components/modebar/buttons.js. The names are already derived asforeButtonsinsrc/components/modebar/constants.js, andlayout.modebar.removeinterpolates that constant into its own description.This publishes the 48 names for every language port, and lets the type generator derive the union that
ModeBarDefaultButtonsinsrc/types/core/layout.d.tsmaintains by hand. Config options are never coerced, so no runtime behavior changes.Scope
src/plot_api/plot_config.jswith new infotasks/generate_schema_types.mjsto handle the new type generationsrc/types/core/layout.d.ts