HtmlEnhanceAssets
ChartForgeX.Interactivity.Html
The lightweight enhance runtime for static ChartForgeX SVG exported with VisualSvgOptions.WithEnhanceHooks: page-wide states, tooltips, keyboard focus, legend toggles, linked views and the behaviour registry. It upgrades the SVG in place and never re-renders it.
Inheritance
- object
- HtmlEnhanceAssets
Remarks
The script bundle is cfx-shared.js, cfx-enhance.js, cfx-enhance.behaviours.js and cfx-link.js; the stylesheet is cfx-states.css and cfx-enhance.css. Include it once per document, inline with HtmlEnhanceAssets.InlineMarkup or HtmlEnhanceDocument, or as shared files with HtmlEnhanceAssets.ReferenceMarkup. See docs/enhance.md.
Methods
public static IReadOnlyList<HtmlAssetFile> Files() #Returns the files a bundle writes with HtmlInteractiveAssetFiles.WriteTo.
Returns
IReadOnlyList<HtmlAssetFile>public static string InlineMarkup(string? nonce = null) #Returns an inline <style> and <script> pair. Emit it once per document.
Parameters
- nonce string? = null
- An optional CSP nonce for both elements.
Returns
string HTML markup.public static string Module(string name) #Gets one source module by file name, for hosts that bundle the parts themselves.
Parameters
- name string
- One of the module names listed in the remarks of HtmlEnhanceAssets.
Returns
string The module text.public static string ReferenceMarkup(HtmlAssetReferences assets, string? nonce = null) #Returns a stylesheet link and a deferred script element that reference the shared files.
Parameters
- assets ChartForgeX.Interactivity.Html.HtmlAssetReferences
- Where the bundle's asset files are served from.
- nonce string? = null
- An optional CSP nonce for the script element.
Returns
string HTML markup.Inherited Methods
Properties
public static string Script { get; } #Gets the complete enhance script: shared parts, core runtime, built-in behaviours and the linked-views helper.
public static string Style { get; } #Gets the complete enhance stylesheet: interaction states, tooltip and legend affordances.
public static HtmlAssetFile ScriptFile { get; } #Gets the script as a content-addressed shared file.
public static HtmlAssetFile StyleFile { get; } #Gets the stylesheet as a content-addressed shared file.