Skip to main content
cngx-src documentation

PathBuilder

Interface

projects/common/chart/path/path-builder.ts

Import#

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

Description#

Single-slot LRU cache around an SVG d-attribute builder. Returned by createPathBuilder; consumed by the <cngx-line> / <cngx-area> family.

Index#

Methods#

build#string
build(data: unknown, xScale: ScaleFn, yScale: ScaleFn<number>)

Build the SVG d attribute for the given data + scales. Same (data, xScale, yScale) triple by reference returns the cached string without re-running the O(n) point projection.

@paramdataunknown
@paramxScaleScaleFn
@paramyScaleScaleFn
rebuildCount#number

Number of times the internal point-projection + path-string concatenation has run since this builder was constructed. Exposed for the compute-guard isolated spec; not part of the public chart API.