Skip to content
ChartForgeX
Class

VisualSvgOptions

ChartForgeX.Rendering

Namespace
ChartForgeX.Rendering
Assembly
ChartForgeX
Modifiers
sealed

Controls safe SVG host integration and explicit captured-effect representation without repeating layout.

Inheritance

  • object
  • VisualSvgOptions

Usage

Explore 12 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.

Accepted by parameters 4

Constructors

public VisualSvgOptions(string? idScope = null, SvgColorVariables? colorVariables = null, VisualSvgLinkTarget linkTarget = SameContext, bool responsive = false, VisualSvgEffectProfile effectProfile = Baked, VisualRenderOptions? effectRasterOptions = null) #

Creates a detached SVG export policy.

Parameters

idScope string? = null optional
Unique host namespace; null uses a deterministic content namespace.
colorVariables ChartForgeX.Themes.SvgColorVariables? = null optional
Host CSS properties with resolved static fallback colors. The mapping is copied.
linkTarget ChartForgeX.Rendering.VisualSvgLinkTarget = SameContext optional
Whether safe scene links use the current browsing context or a new protected context.
responsive bool = false optional
Baked native effect pixels, or supported typed native SVG effects on retained vectors.
effectProfile ChartForgeX.Rendering.VisualSvgEffectProfile = Baked optional
Existing native raster options for baked effects; unused by native SVG filter math.
effectRasterOptions ChartForgeX.Rendering.VisualRenderOptions? = null optional
Whether inline SVG shrinks to its host width while preserving the logical viewport and aspect ratio.

Methods

public VisualSvgOptions WithCompactMarkup(bool enabled = true) #

Returns a policy that writes a compact static SVG, retaining the other export settings.

Parameters

enabled bool = true optional
Whether to write compact markup.

Returns

VisualSvgOptions An independent export policy.
public VisualSvgOptions WithEnhanceHooks(bool enabled = true, bool includeData = false) #

Returns a policy that writes the hooks a page-level enhance runtime needs, retaining the other export settings.

Parameters

enabled bool = true optional
Whether to write the hooks.
includeData bool = false optional
Whether to add a <metadata data-cfx-enhance-data> JSON island with series names, colours and X-sorted points. It is inert text: the SVG stays script-free.

Returns

VisualSvgOptions An independent export policy.
public VisualSvgOptions WithFluidWidth(bool enabled = true) #

Returns a script-free, horizontally fluid SVG policy retaining the other export settings.

Parameters

enabled bool = true optional
Whether to fill the host width at the prepared logical height.

Returns

VisualSvgOptions An independent export policy.
public VisualSvgOptions WithFontVariables(string? familyVariable = null, string? sizeVariable = null) #

Lets browser SVG text use page custom properties for font family and/or size, with page inheritance as fallback.

Parameters

familyVariable string? = null optional
A validated custom property such as --body-font; null inherits the page family.
sizeVariable string? = null optional
A validated custom property such as --chart-font-size; null inherits the page size.

Returns

VisualSvgOptions An independent export policy retaining the other settings.

Exceptions

  • ArgumentException – Neither property was supplied, or a property name is invalid.
public VisualSvgOptions WithInheritedFonts() #

Lets browser SVG text inherit the embedding page's font family and size.

Returns

VisualSvgOptions An independent export policy retaining the other settings.
public VisualSvgOptions WithoutProductFonts() #

Omits bundled product font styles from SVG embedded in a host that supplies the fonts.

Returns

VisualSvgOptions An independent export policy retaining all other settings.
public VisualSvgOptions WithPatternTiles(bool enabled = true) #

Returns an export policy with native user-space pattern tiles, retaining the other host settings.

Parameters

enabled bool = true optional
Whether to use tiles. Static exports keep individual native lines by default.

Returns

VisualSvgOptions An independent export policy.
public VisualSvgOptions WithSharedDesignRoles(VisualTheme? theme = null, ThemeMode mode = Light) #

Follows the shared design roles that CanopyX and HtmlForgeX pages define: colours are written as the --hfx-* role properties (see SvgColorVariables.SharedRoles) with this theme's colours as fallbacks, and text uses var(--hfx-font-sans, inherit) while keeping its prepared sizes.

Parameters

theme ChartForgeX.Themes.VisualTheme? = null optional
The theme the visual was prepared with; null uses VisualTheme.Graphite.
mode ChartForgeX.ThemeMode = Light optional
The mode the visual was prepared in.

Returns

VisualSvgOptions An independent export policy retaining the other settings.

Properties

public bool CompactMarkup { get; } #

Gets whether the SVG leaves out what only scripts read.

public bool PatternTiles { get; } #

Gets whether native hatch marks serialize as user-space SVG tiles instead of individual clipped lines.

public VisualSvgEffectProfile EffectProfile { get; } #

Gets how retained typed scene effects lower. Explicit captured images remain images.

public VisualRenderOptions? EffectRasterOptions { get; } #

Gets immutable density/coverage/cap options for baked effects; null resolves native defaults only when needed.

public string? IdScope { get; private set; } #

Gets the host ID namespace, or null for a deterministic content namespace.

public SvgColorVariables? ColorVariables { get; } #

Gets an independent copy of the host color mapping.

public VisualSvgLinkTarget LinkTarget { get; } #

Gets the safe link target policy.

public bool Responsive { get; } #

Gets whether the SVG carries self-contained responsive sizing for inline hosts.

public bool EnhanceHooks { get; } #

Gets whether the SVG carries the root and legend hooks the optional enhance runtime reads.

public bool EnhanceData { get; } #

Gets whether the SVG also carries a compact JSON data island for shared-X tooltips and large key sets.

public bool FluidWidth { get; } #

Gets whether horizontal positions fill the host while height, text and marker sizes remain in CSS pixels.