Skip to main content
cngx-src documentation

CngxChartRenderer

Interface

projects/common/chart/renderer/chart-renderer.ts

Import#

import { CngxChartRenderer } from '@cngx/common/chart'

Description#

A rendering backend for <cngx-chart>. Both backends compose against the same LayerGeometry surface the layer atoms publish, so a single chart-authoring API drives either one with no consumer change.

The SVG backend is a passthrough (layer atoms self-render); the Canvas backend paints the geometries onto a <canvas> 2D context.

Index#

Instance Properties#

mode#"svg" | "canvas"
Readonly

Which backend this instance is.

Methods#

destroy#void

Detach and release resources.

invalidateColorCache#void
Optional

Drop any cached theme colors (called on layout/theming reflow). Optional.

mount#void
mount(host: HTMLElement, ctx: CngxChartContext)

Attach to the chart host (insert a <canvas>, wire teardown, ...).

@paramhostHTMLElement
paint#void
paint(geometries: unknown)

Paint the current layer geometries. Called on every geometry emission.

@paramgeometriesunknown