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.
Description
Validate config values in
setPlotContextagainstconfigAttributesand callLib.warnon a mismatch.Why should this change be made?
src/plot_api/plot_config.jssaysvalTypeandvaluesare documentation only, so a bad config value lands in_contextin 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
dfltoutside its ownvalues.Scope
src/plot_api/plot_api.js- insetPlotContext, runLib.validate(value, attr)per key and warn on falsevalType: 'any'attributes.Lib.validateaccepts anything for them.