Skip to content

[CHORE]: Warn on config values that do not match the schema #8064

Description

@camdecoster

Description

Validate config values in setPlotContext against configAttributes and call Lib.warn on a mismatch.

Why should this change be made?

src/plot_api/plot_config.js says valType and values are documentation only, so a bad config value lands in _context in silence and fails somewhere else later.

Full coercion would replace bad values with defaults, which silently changes charts that work today. A warning gives the diagnostic benefit with no behavior change, and the hit rate tells us whether coercion is worth it later.

The metadata supports it: every typed config attribute is self-consistent, with no dflt outside its own values.

Scope

  • src/plot_api/plot_api.js - in setPlotContext, run Lib.validate(value, attr) per key and warn on false
  • Skip the valType: 'any' attributes. Lib.validate accepts anything for them.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3backlogchoreTrack maintenance work (dependency bumps, build/CI, internal refactors, docs, etc.)plotly-internalsize: 3taskone-off task

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions