Record Class CanvasChartStyleConfig
- Record Components:
style- the raw ECharts theme object, in the shapeecharts.registerThemeconsumes. Stored verbatim so no rendering path has to reshape it.themes- the Perspective session theme names this style claims.previewBackgroundColor- the CSS color for the backdrop behind the style drawer's preview pane in the Gateway web UI, so an author can check contrast. Held outsidestyleso it cannot leak into the ECharts theme;nullleaves the preview on its default backdrop.
Each style is its own gateway-scoped resource under RESOURCE_TYPE, shared by every
project on the gateway. The resource name is the style's display name and the resource's
documentation is its author-facing description, so neither is a field here.
A style is reachable by resource name — what a page author's chartStyle property names
directly — and by themes() membership, which is how a session's plain theme
property finds one. Resolution needs the resource collection, so it lives gateway-side in
CanvasChartStyleManager; only the bundled content lives here, in ChartStyleUtil.
The bundled light and dark styles are non-overridable resources in the
platform's system collection, so the configuration framework itself rejects any edit to
them. To depart from one, copy it under a new name and assign the copy the theme.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classReads and writes one style'sconfig.json. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCanvasChartStyleConfig(com.inductiveautomation.ignition.common.gson.JsonObject style, List<String> themes, @Nullable String previewBackgroundColor) Normalizes the non-@Nullablefields so no caller has to null-check them. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@Nullable StringReturns the value of thepreviewBackgroundColorrecord component.com.inductiveautomation.ignition.common.gson.JsonObjectstyle()Returns the value of thestylerecord component.themes()Returns the value of thethemesrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
RESOURCE_TYPE
-
-
Constructor Details
-
CanvasChartStyleConfig
public CanvasChartStyleConfig(com.inductiveautomation.ignition.common.gson.JsonObject style, List<String> themes, @Nullable String previewBackgroundColor) Normalizes the non-@Nullablefields so no caller has to null-check them. Gson populates records reflectively and leaves a field null when the JSON omits it, so this runs on every decode, not just on the constructor calls in this codebase.
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
style
-
themes
-
previewBackgroundColor
Returns the value of thepreviewBackgroundColorrecord component.- Returns:
- the value of the
previewBackgroundColorrecord component
-