API Reference
VisualTheme
A paired immutable theme shared by charts, diagrams and future composition packages.
Inheritance
- Object
- VisualTheme
Usage
Explore 6 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 5
- Property VisualRenderContext.Theme
- Method VisualTheme.FromJson
- Method VisualTheme.FromThemeJson
- Method VisualTheme.Graphite
- Method VisualTheme.WithTypography
Accepted by parameters 1
- Constructor VisualRenderContext.VisualRenderContext
Constructors
public VisualTheme(VisualDesignTokens light, VisualDesignTokens dark, VisualTypography? typography = null, Double spacing = 12, Double seriesStrokeWidth = 2, Double markerRadius = 3, Double areaOpacity = 0.18, Double barRadius = 3, Double gridStrokeWidth = 1, Double axisStrokeWidth = 1, Double cardRadius = 3, Double cardShadowOpacity = 0, ChartColor? cardShadowColor = null, Double gaugeStrokeWidth = 14, Double gaugeBandWidth = 4) #Creates a paired theme from independent token snapshots and geometry settings.
Parameters
- light ChartForgeX.Themes.VisualDesignTokens
- dark ChartForgeX.Themes.VisualDesignTokens
- typography ChartForgeX.Themes.VisualTypography? = null
- spacing System.Double = 12
- seriesStrokeWidth System.Double = 2
- markerRadius System.Double = 3
- areaOpacity System.Double = 0.18
- barRadius System.Double = 3
- gridStrokeWidth System.Double = 1
- axisStrokeWidth System.Double = 1
- cardRadius System.Double = 3
- cardShadowOpacity System.Double = 0
- cardShadowColor ChartForgeX.Primitives.ChartColor? = null
- gaugeStrokeWidth System.Double = 14
- gaugeBandWidth System.Double = 4
Methods
public static VisualTheme FromJson(String json, VisualTypography? typography = null) #VisualThemeCreates a paired theme from the generated HtmlForgeX chart token document.
Parameters
- json System.String
- typography ChartForgeX.Themes.VisualTypography? = null
public static VisualTheme FromThemeJson(String json) #VisualThemeLoads a version 1 paired theme, including canonical palettes, typography and geometry.
Parameters
- json System.String
- The case-sensitive versioned theme document, at most one MiB of characters.
Returns
An immutable theme snapshot.
Exceptions
ArgumentException– The document is malformed, unsupported, incomplete or outside input limits.
public static VisualTheme Graphite() #VisualThemeGets the Graphite layout preset with the canonical HtmlForgeX light/dark colors.
public VisualThemeColors Resolve(VisualThemeMode mode) #VisualThemeColorsResolves the selected immutable color snapshot.
Parameters
- mode ChartForgeX.Themes.VisualThemeMode
public String ToThemeJson() #StringExports the complete paired color, typography and geometry theme using schemaVersion 1.
Returns
A deterministic JSON document suitable for VisualTheme.FromThemeJson.
public VisualTheme WithTypography(VisualTypography typography) #VisualThemeCreates an independent paired theme with the supplied typography and the same colors, geometry and effects.
Parameters
- typography ChartForgeX.Themes.VisualTypography
- The complete font scale to use for the new theme.
Inherited Methods
public virtual Boolean Equals(Object? obj) #BooleanParameters
- obj Object?
Properties
public VisualTypography Typography { get; } #Gets the typography scale.
public Double Spacing { get; } #Gets the standard layout gap.
public Double SeriesStrokeWidth { get; } #Gets the default data-line width.
public Double MarkerRadius { get; } #Gets the default point radius.
public Double AreaOpacity { get; } #Gets the area fill opacity.
public Double BarRadius { get; } #Gets the bar corner radius.
public Double CardRadius { get; } #Gets the shared outer card corner radius, independent of plot and data mark radii.
public Double CardShadowOpacity { get; } #Gets the shared card shadow opacity. Zero keeps the default flat surface.
public ChartColor CardShadowColor { get; } #Gets the shared card shadow color, including its authored alpha.
public Double GridStrokeWidth { get; } #Gets the guide width.
public Double AxisStrokeWidth { get; } #Gets the axis width.
public Double GaugeStrokeWidth { get; } #Gets the gauge track and value stroke width.
public Double GaugeBandWidth { get; } #Gets the gauge threshold band width.