Skip to content

Interface: StyleRule ​

A serializable style rule (plan E8.5): per-point attributes ('marker.color', 'marker.size', 'text', … — any arrayOk attribute of the trace) set on the points matching when. Later rules win over earlier ones; points no rule matches keep the trace's own value.

Example ​

ts
{ when: { y: { gt: 10 } }, set: { 'marker.color': 'gold', 'marker.size': 14 } }

Properties ​

PropertyModifierTypeDescription
setreadonlyReadonly<Record<string, StyleValue>>Attribute strings of per-point (arrayOk) attributes and the value to give them.
when?readonlyStyleConditionWhich points the rule applies to. Omitted: every point.

Released under the MIT License.