Class
TopologyHtmlRenderer
ChartForgeX.Topology
Renders topology charts into simple HTML wrappers with inline SVG.
Inheritance
- object
- TopologyHtmlRenderer
Constructors
public TopologyHtmlRenderer() #Methods
public static string? AutoThemeStyleSheet(TopologyChart chart, TopologyRenderOptions? options = null) #Builds the scoped stylesheet that lets a ThemeMode.Auto topology follow the viewer's colour scheme, or returns null for an explicit mode or when the options carry their own SVG colour variables.
Parameters
- chart ChartForgeX.Topology.TopologyChart
- The topology the fragment is rendered from.
- options ChartForgeX.Topology.TopologyRenderOptions? = null
- The same render options passed to the fragment.
Returns
string? Plain CSS for the fragment root's data-cfx-auto-theme scope, or null.public string RenderFragment(TopologyChart chart, TopologyRenderOptions? options = null) #Renders an embeddable HTML fragment.
Parameters
- chart ChartForgeX.Topology.TopologyChart
- The topology chart.
- options ChartForgeX.Topology.TopologyRenderOptions? = null
- Optional render options.
Returns
string An HTML fragment.public string RenderFragmentWithoutAssets(TopologyChart chart, TopologyRenderOptions? options = null) #Renders an embeddable HTML fragment without renderer-owned stylesheet or script assets.
Parameters
- chart ChartForgeX.Topology.TopologyChart
- The topology chart.
- options ChartForgeX.Topology.TopologyRenderOptions? = null
- Optional render options.
Returns
string An HTML fragment that expects the caller to register topology HTML assets.public string RenderPage(TopologyChart chart, TopologyRenderOptions? options = null) #Renders a complete static HTML page containing one topology chart.
Parameters
- chart ChartForgeX.Topology.TopologyChart
- The topology chart.
- options ChartForgeX.Topology.TopologyRenderOptions? = null
- Optional render options.
Returns
string A complete HTML page.public static string StyleSheet(TopologyRenderOptions? options = null, VisualTheme? theme = null, ThemeMode mode = Light) #Builds the renderer-owned stylesheet used by topology HTML fragments.
Parameters
- options ChartForgeX.Topology.TopologyRenderOptions? = null
- Optional render options whose CSS prefix should be honored.
- theme ChartForgeX.Themes.VisualTheme? = null
- Optional topology theme whose font family should be used.
- mode ChartForgeX.ThemeMode = Light
- The explicit palette mode for the host surface.
Returns
string CSS ready to register once in a host document.Examples
var css = ChartFontAssets.StyleSheet + TopologyHtmlRenderer.StyleSheet(options, theme);
var fragment = renderer.RenderFragmentWithoutAssets(chart, options);
// Register css once outside the asset-free fragments.