@opendata-ai/openchart-vanilla 6.20.0 → 6.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +18 -7
- package/dist/index.js +462 -439
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/renderers/annotations.ts +212 -0
- package/src/renderers/axes.ts +164 -0
- package/src/renderers/brand.ts +75 -0
- package/src/renderers/chrome.ts +96 -0
- package/src/renderers/legend.ts +131 -0
- package/src/renderers/marks.ts +427 -0
- package/src/renderers/svg-dom.ts +66 -0
- package/src/svg-renderer.ts +61 -1190
package/dist/index.d.ts
CHANGED
|
@@ -285,14 +285,13 @@ interface SankeyInstance {
|
|
|
285
285
|
declare function createSankey(container: HTMLElement, spec: SankeySpec, options?: SankeyMountOptions): SankeyInstance;
|
|
286
286
|
|
|
287
287
|
/**
|
|
288
|
-
*
|
|
289
|
-
*
|
|
290
|
-
* Creates an <svg> element with viewBox matching layout dimensions,
|
|
291
|
-
* renders chrome (title/subtitle/source), axes, marks, annotations,
|
|
292
|
-
* and legend. All styling via inline SVG attributes from layout data.
|
|
288
|
+
* Mark rendering: dispatches to per-mark-type sub-renderers (line, area, rect,
|
|
289
|
+
* arc, point, text, rule, tick).
|
|
293
290
|
*
|
|
294
|
-
* Mark
|
|
295
|
-
*
|
|
291
|
+
* Mark renderers read module-level animation and gradient state so their
|
|
292
|
+
* signatures stay `(mark, index) => SVGElement`. Callers must invoke
|
|
293
|
+
* `setMarkRenderState()` before `renderMarks()` and `resetMarkRenderState()`
|
|
294
|
+
* after.
|
|
296
295
|
*/
|
|
297
296
|
|
|
298
297
|
type MarkRenderer<T extends Mark> = (mark: T, index: number) => SVGElement;
|
|
@@ -301,6 +300,18 @@ type MarkRenderer<T extends Mark> = (mark: T, index: number) => SVGElement;
|
|
|
301
300
|
* Built-in renderers are registered below for all chart types.
|
|
302
301
|
*/
|
|
303
302
|
declare function registerMarkRenderer<T extends Mark>(type: T['type'], renderer: MarkRenderer<T>): void;
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* SVG renderer: converts a ChartLayout into SVG DOM elements.
|
|
306
|
+
*
|
|
307
|
+
* Creates an <svg> element with viewBox matching layout dimensions,
|
|
308
|
+
* renders chrome (title/subtitle/source), axes, marks, annotations,
|
|
309
|
+
* and legend. All styling via inline SVG attributes from layout data.
|
|
310
|
+
*
|
|
311
|
+
* This file is the orchestrator only. Each rendering concern lives in its
|
|
312
|
+
* own module under `./renderers/`.
|
|
313
|
+
*/
|
|
314
|
+
|
|
304
315
|
/**
|
|
305
316
|
* Render a compiled ChartLayout into an SVG element and append it to a container.
|
|
306
317
|
*
|