CngxLine
projects/common/chart/layers/line.component.ts
Import#
import { CngxLine } from '@cngx/common/chart'
Description#
Line layer atom. Renders a single SVG <path> connecting the data
points projected through the parent chart's scales. Reads scales
from CNGX_CHART_CONTEXT, NOT from a parent class.
Attribute-selector on <svg:g> - the host element IS the SVG group.
Element selectors create XHTML-namespaced custom elements inside
SVG, which break layout for the namespaced children. Apply this
directive on an <svg:g> host instead.
The d string is cascade-guarded with string equality on its
computed so downstream effects only re-run when the path
geometry actually changes. The createPathBuilder cache provides
the compute guard - same (data, xScale, yScale) triple by
reference skips the per-datapoint projection work.
A single-point series draws no visible path (M x y has no length),
so a series shorter than two points paints a point marker instead of
nothing. [points] controls this: 'auto' (default) marks only the
one-datum case, 'always' marks every datum, 'never' suppresses it.
Metadata#
Providers#
CNGX_CHART_LAYER- useExisting
CngxLine
Relationships
Index#
Inputs#
LineYAccessor(d: T) => Number(d)readonly T[] | undefined"auto" | "always" | "never"Point-marker mode. 'auto' (default) draws a marker only when the
resolved series has exactly one datum - the frame a warming buffer
passes through on every reload, which paints nothing otherwise.
'always' marks every datum; 'never' suppresses markers.
'auto'LineXAccessor | undefined