CngxChartContext
projects/common/chart/chart/chart-context.ts
Referenced by#
Import#
import { CngxChartContext } from '@cngx/common/chart'
Description#
Reactive context published by <cngx-chart> to its content children.
Layer atoms ([cngxLine], [cngxBar], ...) and [cngxAxis] inject
CNGX_CHART_CONTEXT to read the parent chart's scales,
dimensions, data length, and data array without needing a direct
reference to the parent class. Token is non-generic at the DI
boundary; layer atoms call data<T>() to narrow the array to their
own <T> - the single boundary cast lives inside CngxChart's
data<U>() method, not at every consumer site.
Index#
Methods
Instance Properties#
SignalSignalThe plot rectangle inside the viewBox, after the room the projected
axes need for their decoration. The chart's own scale ranges and
[cngxAxis]'s line placement both read this single derivation, so
ticks always line up with marks. A chart without axes gets the full
box.
SignalSVG-output gate (default true). Layer atoms wrap their own
<svg:path> / <svg:rect> / <svg:circle> emission behind
@if (ctx.renderSvg()). The chart shell drives this false only
when Canvas mode is active - an atom asks "should I render my own
SVG?", never "what mode am I in?".
Methods#
T[]Generic-aware data accessor. Reads the chart's reactive data
array; the consumer's <T> parameter narrows the returned type
without a per-call cast at the consumer site. The chart performs
one boundary cast in its implementation.