@rokkit/chart 1.0.0-next.158 → 1.0.0-next.159

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.
Files changed (60) hide show
  1. package/package.json +1 -1
  2. package/LICENSE +0 -21
  3. package/dist/Plot/index.d.ts +0 -9
  4. package/dist/PlotState.svelte.d.ts +0 -75
  5. package/dist/crossfilter/createCrossFilter.svelte.d.ts +0 -13
  6. package/dist/elements/index.d.ts +0 -6
  7. package/dist/geoms/lib/areas.d.ts +0 -52
  8. package/dist/geoms/lib/bars.d.ts +0 -3
  9. package/dist/index.d.ts +0 -56
  10. package/dist/lib/brewer.d.ts +0 -9
  11. package/dist/lib/brewing/BoxBrewer.svelte.d.ts +0 -8
  12. package/dist/lib/brewing/CartesianBrewer.svelte.d.ts +0 -8
  13. package/dist/lib/brewing/PieBrewer.svelte.d.ts +0 -8
  14. package/dist/lib/brewing/QuartileBrewer.svelte.d.ts +0 -9
  15. package/dist/lib/brewing/ViolinBrewer.svelte.d.ts +0 -8
  16. package/dist/lib/brewing/axes.svelte.d.ts +0 -66
  17. package/dist/lib/brewing/bars.svelte.d.ts +0 -56
  18. package/dist/lib/brewing/brewer.svelte.d.ts +0 -114
  19. package/dist/lib/brewing/colors.d.ts +0 -26
  20. package/dist/lib/brewing/dimensions.svelte.d.ts +0 -35
  21. package/dist/lib/brewing/index.svelte.d.ts +0 -118
  22. package/dist/lib/brewing/legends.svelte.d.ts +0 -48
  23. package/dist/lib/brewing/marks/arcs.d.ts +0 -17
  24. package/dist/lib/brewing/marks/areas.d.ts +0 -31
  25. package/dist/lib/brewing/marks/bars.d.ts +0 -1
  26. package/dist/lib/brewing/marks/boxes.d.ts +0 -24
  27. package/dist/lib/brewing/marks/lines.d.ts +0 -24
  28. package/dist/lib/brewing/marks/points.d.ts +0 -55
  29. package/dist/lib/brewing/marks/violins.d.ts +0 -20
  30. package/dist/lib/brewing/patterns.d.ts +0 -14
  31. package/dist/lib/brewing/scales.d.ts +0 -28
  32. package/dist/lib/brewing/scales.svelte.d.ts +0 -24
  33. package/dist/lib/brewing/stats.d.ts +0 -23
  34. package/dist/lib/brewing/symbols.d.ts +0 -7
  35. package/dist/lib/brewing/types.d.ts +0 -162
  36. package/dist/lib/chart.d.ts +0 -38
  37. package/dist/lib/context.d.ts +0 -13
  38. package/dist/lib/grid.d.ts +0 -72
  39. package/dist/lib/keyboard-nav.d.ts +0 -15
  40. package/dist/lib/plot/chartProps.d.ts +0 -177
  41. package/dist/lib/plot/crossfilter.d.ts +0 -13
  42. package/dist/lib/plot/facet.d.ts +0 -24
  43. package/dist/lib/plot/frames.d.ts +0 -47
  44. package/dist/lib/plot/helpers.d.ts +0 -3
  45. package/dist/lib/plot/preset.d.ts +0 -29
  46. package/dist/lib/plot/scales.d.ts +0 -5
  47. package/dist/lib/plot/stat.d.ts +0 -32
  48. package/dist/lib/plot/types.d.ts +0 -89
  49. package/dist/lib/preset.d.ts +0 -30
  50. package/dist/lib/scales.svelte.d.ts +0 -35
  51. package/dist/lib/swatch.d.ts +0 -12
  52. package/dist/lib/ticks.d.ts +0 -36
  53. package/dist/lib/utils.d.ts +0 -61
  54. package/dist/lib/xscale.d.ts +0 -11
  55. package/dist/patterns/index.d.ts +0 -4
  56. package/dist/patterns/patterns.d.ts +0 -72
  57. package/dist/patterns/scale.d.ts +0 -30
  58. package/dist/symbols/constants/index.d.ts +0 -1
  59. package/dist/symbols/index.d.ts +0 -5
  60. package/src/patterns/README.md +0 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rokkit/chart",
3
- "version": "1.0.0-next.158",
3
+ "version": "1.0.0-next.159",
4
4
  "type": "module",
5
5
  "description": "Data-driven chart components",
6
6
  "repository": {
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Jerry Thomas
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
@@ -1,9 +0,0 @@
1
- export { default as Root } from "./Root.svelte";
2
- export { default as Axis } from "./Axis.svelte";
3
- export { default as Bar } from "./Bar.svelte";
4
- export { default as Legend } from "./Legend.svelte";
5
- export { default as Grid } from "./Grid.svelte";
6
- export { default as Line } from "./Line.svelte";
7
- export { default as Area } from "./Area.svelte";
8
- export { default as Point } from "./Point.svelte";
9
- export { default as Arc } from "./Arc.svelte";
@@ -1,75 +0,0 @@
1
- export class PlotState {
2
- constructor(config?: {});
3
- axisOrigin: undefined[];
4
- orientation: string;
5
- colorScaleType: any;
6
- xScale: any;
7
- yScale: any;
8
- colors: Map<unknown, {
9
- fill: string;
10
- stroke: string;
11
- }> | Map<null, {
12
- fill: any;
13
- stroke: any;
14
- }>;
15
- patterns: Map<unknown, string> | SvelteMap<any, any>;
16
- symbols: Map<unknown, string> | SvelteMap<any, any>;
17
- colorField: any;
18
- patternField: any;
19
- symbolField: any;
20
- geomTypes: SvelteSet<any>;
21
- xAxisY: any;
22
- yAxisX: any;
23
- update(config: any): void;
24
- registerGeom(config: any): string;
25
- updateGeom(id: any, config: any): void;
26
- unregisterGeom(id: any): void;
27
- geomData(id: any): any[];
28
- label(field: any): any;
29
- format(field: any): any;
30
- tooltip(): any;
31
- geomComponent(type: any): any;
32
- preset(): {
33
- colors: any;
34
- patterns: any;
35
- symbols: any;
36
- };
37
- get margin(): {
38
- top: number;
39
- right: number;
40
- bottom: number;
41
- left: number;
42
- };
43
- get innerWidth(): number;
44
- get innerHeight(): number;
45
- get mode(): string;
46
- get chartPreset(): {
47
- colors: string[];
48
- shades: {
49
- light: {
50
- fill: string;
51
- stroke: string;
52
- };
53
- dark: {
54
- fill: string;
55
- stroke: string;
56
- };
57
- };
58
- opacity: {
59
- area: number;
60
- box: number;
61
- violin: number;
62
- point: number;
63
- };
64
- patterns: string[];
65
- symbols: string[];
66
- };
67
- get hovered(): null;
68
- setHovered(data: any): void;
69
- clearHovered(): void;
70
- applyZoom(transform: any): void;
71
- resetZoom(): void;
72
- #private;
73
- }
74
- import { SvelteMap } from 'svelte/reactivity';
75
- import { SvelteSet } from 'svelte/reactivity';
@@ -1,13 +0,0 @@
1
- export function createCrossFilter(): {
2
- /** @readonly — reactive Map of current filter state */
3
- readonly filters: SvelteMap<any, any>;
4
- /** @readonly — increments on every mutation; read inside $effect to react to any filter change */
5
- readonly version: number;
6
- isFiltered: (dimension: string) => boolean;
7
- isDimmed: (dimension: string, value: unknown) => boolean;
8
- toggleCategorical: (dimension: string, value: unknown) => void;
9
- setRange: (dimension: string, range: [number, number]) => void;
10
- clearFilter: (dimension: string) => void;
11
- clearAll: () => void;
12
- };
13
- import { SvelteMap } from 'svelte/reactivity';
@@ -1,6 +0,0 @@
1
- export { default as Bar } from "./Bar.svelte";
2
- export { default as ColorRamp } from "./ColorRamp.svelte";
3
- export { default as ContinuousLegend } from "./ContinuousLegend.svelte";
4
- export { default as Label } from "./Label.svelte";
5
- export { default as DefinePatterns } from "./DefinePatterns.svelte";
6
- export { default as SymbolGrid } from "./SymbolGrid.svelte";
@@ -1,52 +0,0 @@
1
- /**
2
- * Builds area path geometry for multi-series area charts.
3
- *
4
- * @param {Object[]} data
5
- * @param {{ x: string, y: string, color?: string }} channels
6
- * @param {Function} xScale
7
- * @param {Function} yScale
8
- * @param {Map<unknown, {fill: string, stroke: string}>} colors
9
- * @param {'linear'|'smooth'|'step'} [curve]
10
- * @param {Map<unknown, string>} [patterns]
11
- * @returns {{ d: string, fill: string, stroke: string, key: unknown, patternId: string|null }[]}
12
- */
13
- export function buildAreas(data: Object[], channels: {
14
- x: string;
15
- y: string;
16
- color?: string;
17
- }, xScale: Function, yScale: Function, colors: Map<unknown, {
18
- fill: string;
19
- stroke: string;
20
- }>, curve?: "linear" | "smooth" | "step", patterns?: Map<unknown, string>): {
21
- d: string;
22
- fill: string;
23
- stroke: string;
24
- key: unknown;
25
- patternId: string | null;
26
- }[];
27
- /**
28
- * Builds stacked area paths using d3 stack layout.
29
- *
30
- * @param {Object[]} data
31
- * @param {{ x: string, y: string, color: string }} channels
32
- * @param {Function} xScale
33
- * @param {Function} yScale
34
- * @param {Map<unknown, {fill: string, stroke: string}>} colors
35
- * @param {'linear'|'smooth'|'step'} [curve]
36
- * @param {Map<unknown, string>} [patterns]
37
- * @returns {{ d: string, fill: string, stroke: string, key: unknown, patternId: string|null }[]}
38
- */
39
- export function buildStackedAreas(data: Object[], channels: {
40
- x: string;
41
- y: string;
42
- color: string;
43
- }, xScale: Function, yScale: Function, colors: Map<unknown, {
44
- fill: string;
45
- stroke: string;
46
- }>, curve?: "linear" | "smooth" | "step", patterns?: Map<unknown, string>): {
47
- d: string;
48
- fill: string;
49
- stroke: string;
50
- key: unknown;
51
- patternId: string | null;
52
- }[];
@@ -1,3 +0,0 @@
1
- export function buildGroupedBars(data: any, channels: any, xScale: any, yScale: any, colors: any, innerHeight: any, patterns: any): any;
2
- export function buildStackedBars(data: any, channels: any, xScale: any, yScale: any, colors: any, innerHeight: any, patterns: any): any;
3
- export function buildHorizontalBars(data: any, channels: any, xScale: any, yScale: any, colors: any, _innerHeight: any): any;
package/dist/index.d.ts DELETED
@@ -1,56 +0,0 @@
1
- export namespace Plot {
2
- export { Root };
3
- export { Axis };
4
- export { Bar };
5
- export { Grid };
6
- export { Legend };
7
- export { Line };
8
- export { Area };
9
- export { Point };
10
- export { Arc };
11
- }
12
- export namespace PlotLayers { }
13
- export { default as PlotChart } from "./Plot.svelte";
14
- export { default as ChartProvider } from "./ChartProvider.svelte";
15
- export { default as FacetPlot } from "./FacetPlot.svelte";
16
- export { default as AnimatedPlot } from "./AnimatedPlot.svelte";
17
- export { default as GeomBar } from "./geoms/Bar.svelte";
18
- export { default as GeomLine } from "./geoms/Line.svelte";
19
- export { default as GeomArea } from "./geoms/Area.svelte";
20
- export { default as GeomPoint } from "./geoms/Point.svelte";
21
- export { default as GeomArc } from "./geoms/Arc.svelte";
22
- export { default as GeomBox } from "./geoms/Box.svelte";
23
- export { default as GeomViolin } from "./geoms/Violin.svelte";
24
- export { default as Chart } from "./Chart.svelte";
25
- export { default as Sparkline } from "./Sparkline.svelte";
26
- export { default as BarChart } from "./charts/BarChart.svelte";
27
- export { default as LineChart } from "./charts/LineChart.svelte";
28
- export { default as AreaChart } from "./charts/AreaChart.svelte";
29
- export { default as PieChart } from "./charts/PieChart.svelte";
30
- export { default as ScatterPlot } from "./charts/ScatterPlot.svelte";
31
- export { default as BoxPlot } from "./charts/BoxPlot.svelte";
32
- export { default as ViolinPlot } from "./charts/ViolinPlot.svelte";
33
- export { default as BubbleChart } from "./charts/BubbleChart.svelte";
34
- export { PlotState } from "./PlotState.svelte.js";
35
- export { ChartBrewer } from "./lib/brewing/index.svelte.js";
36
- export * from "./lib/brewing/index.svelte.js";
37
- export { CartesianBrewer } from "./lib/brewing/CartesianBrewer.svelte.js";
38
- export { PieBrewer } from "./lib/brewing/PieBrewer.svelte.js";
39
- export { QuartileBrewer } from "./lib/brewing/QuartileBrewer.svelte.js";
40
- export { BoxBrewer } from "./lib/brewing/BoxBrewer.svelte.js";
41
- export { ViolinBrewer } from "./lib/brewing/ViolinBrewer.svelte.js";
42
- export { createCrossFilter } from "./crossfilter/createCrossFilter.svelte.js";
43
- export { default as CrossFilter } from "./crossfilter/CrossFilter.svelte";
44
- export { default as FilterBar } from "./crossfilter/FilterBar.svelte";
45
- export { default as FilterSlider } from "./crossfilter/FilterSlider.svelte";
46
- export { default as FilterHistogram } from "./crossfilter/FilterHistogram.svelte";
47
- import Root from './Plot/Root.svelte';
48
- import Axis from './Plot/Axis.svelte';
49
- import Bar from './Plot/Bar.svelte';
50
- import Grid from './Plot/Grid.svelte';
51
- import Legend from './Plot/Legend.svelte';
52
- import Line from './Plot/Line.svelte';
53
- import Area from './Plot/Area.svelte';
54
- import Point from './Plot/Point.svelte';
55
- import Arc from './Plot/Arc.svelte';
56
- export { createChartPreset, defaultPreset } from "./lib/preset.js";
@@ -1,9 +0,0 @@
1
- /**
2
- * Get fill patterns for a set of values
3
- *
4
- * @param {Array} values - Array of values
5
- * @param {Object} swatch - Object with keys for color, gray, and pattern
6
- * @param {Boolean} gray - Boolean to determine if gray or color
7
- * @returns {Object} - Object with keys for pattern and color
8
- */
9
- export function getFillPatterns(values: any[], swatch: Object, gray?: boolean): Object;
@@ -1,8 +0,0 @@
1
- /**
2
- * Brewer for box plots.
3
- * fill = box interior color, color = whisker/outline stroke.
4
- */
5
- export class BoxBrewer extends QuartileBrewer {
6
- boxes: any[];
7
- }
8
- import { QuartileBrewer } from './QuartileBrewer.svelte.js';
@@ -1,8 +0,0 @@
1
- /**
2
- * Brewer for cartesian charts (Bar, Line, Area).
3
- * Groups by x (and fill/color if set) and applies the given stat.
4
- */
5
- export class CartesianBrewer extends ChartBrewer {
6
- transform(data: any, channels: any, stat: any): any;
7
- }
8
- import { ChartBrewer } from './brewer.svelte.js';
@@ -1,8 +0,0 @@
1
- /**
2
- * Brewer for pie charts. Always aggregates by the label field.
3
- * 'identity' is not meaningful for pie charts — falls back to 'sum'.
4
- */
5
- export class PieBrewer extends ChartBrewer {
6
- transform(data: any, channels: any, stat: any): any;
7
- }
8
- import { ChartBrewer } from './brewer.svelte.js';
@@ -1,9 +0,0 @@
1
- /**
2
- * Shared base for box and violin plots.
3
- * Groups by x + fill (primary) or x + color (fallback) and computes quartile statistics.
4
- * Subclasses add their mark-specific $derived (boxes, violins, etc.).
5
- */
6
- export class QuartileBrewer extends ChartBrewer {
7
- transform(data: any, channels: any): any;
8
- }
9
- import { ChartBrewer } from './brewer.svelte.js';
@@ -1,8 +0,0 @@
1
- /**
2
- * Brewer for violin plots.
3
- * fill = violin body color, color = outline stroke.
4
- */
5
- export class ViolinBrewer extends QuartileBrewer {
6
- violins: any[];
7
- }
8
- import { QuartileBrewer } from './QuartileBrewer.svelte.js';
@@ -1,66 +0,0 @@
1
- /**
2
- * Creates x-axis tick data for rendering
3
- *
4
- * @param {Object} scales - Chart scales
5
- * @param {Function} scales.x - X-axis scale
6
- * @param {Object} dimensions - Chart dimensions
7
- * @param {Object} options - Axis options
8
- * @param {number} [options.tickCount] - Number of ticks to show
9
- * @param {Function} [options.tickFormat] - Tick formatting function
10
- * @param {string} [options.label] - Axis label
11
- * @returns {AxisData} Axis rendering data
12
- */
13
- export function createXAxis(scales: {
14
- x: Function;
15
- }, dimensions: Object, options: {
16
- tickCount?: number | undefined;
17
- tickFormat?: Function | undefined;
18
- label?: string | undefined;
19
- }): AxisData;
20
- /**
21
- * Creates y-axis tick data for rendering
22
- *
23
- * @param {Object} scales - Chart scales
24
- * @param {Function} scales.y - Y-axis scale
25
- * @param {Object} dimensions - Chart dimensions
26
- * @param {Object} options - Axis options
27
- * @param {number} [options.tickCount] - Number of ticks to show
28
- * @param {Function} [options.tickFormat] - Tick formatting function
29
- * @param {string} [options.label] - Axis label
30
- * @returns {AxisData} Axis rendering data
31
- */
32
- export function createYAxis(scales: {
33
- y: Function;
34
- }, dimensions: Object, options: {
35
- tickCount?: number | undefined;
36
- tickFormat?: Function | undefined;
37
- label?: string | undefined;
38
- }): AxisData;
39
- /**
40
- * Creates grid line data for rendering
41
- *
42
- * @param {Object} scales - Chart scales
43
- * @param {Object} dimensions - Chart dimensions
44
- * @param {Object} options - Grid options
45
- * @param {string} [options.direction='both'] - Grid direction ('x', 'y', or 'both')
46
- * @param {number} [options.xTickCount] - Number of x-axis ticks
47
- * @param {number} [options.yTickCount] - Number of y-axis ticks
48
- * @returns {Object} Grid rendering data
49
- */
50
- export function createGrid(scales: Object, dimensions: Object, options: {
51
- direction?: string | undefined;
52
- xTickCount?: number | undefined;
53
- yTickCount?: number | undefined;
54
- }): Object;
55
- /**
56
- * Creates DOM attributes for a tick element
57
- *
58
- * @param {TickData} tick - Tick data
59
- * @param {string} axis - Axis type ('x' or 'y')
60
- * @returns {Object} Attributes for the tick
61
- */
62
- export function createTickAttributes(tick: TickData, axis: string): Object;
63
- export type TickData = import("./types").TickData;
64
- export type AxisData = import("./types").AxisData;
65
- export type ChartScales = import("./types").ChartScales;
66
- export type ChartDimensions = import("./types").ChartDimensions;
@@ -1,56 +0,0 @@
1
- /**
2
- * Creates bar data for rendering
3
- *
4
- * @param {Array} data - Chart data
5
- * @param {Object} fields - Field mappings
6
- * @param {string} fields.x - X-axis field
7
- * @param {string} fields.y - Y-axis field
8
- * @param {string} fields.color - Color field (optional)
9
- * @param {Object} scales - Chart scales
10
- * @param {Function} scales.x - X-axis scale
11
- * @param {Function} scales.y - Y-axis scale
12
- * @param {Function} scales.color - Color scale
13
- * @param {Object} options - Options including dimensions and defaultColor
14
- * @param {Object} options.dimensions - Chart dimensions
15
- * @param {string} [options.defaultColor='#4682b4'] - Default color if no color scale
16
- * @returns {BarData[]} Bar data for rendering
17
- */
18
- export function createBars(data: any[], fields: {
19
- x: string;
20
- y: string;
21
- color: string;
22
- }, scales: {
23
- x: Function;
24
- y: Function;
25
- color: Function;
26
- }, options: {
27
- dimensions: Object;
28
- defaultColor?: string | undefined;
29
- }): BarData[];
30
- /**
31
- * Filter bars based on a selection criteria
32
- *
33
- * @param {BarData[]} bars - Bar data array
34
- * @param {Object} selection - Selection criteria
35
- * @returns {BarData[]} Filtered bars
36
- */
37
- export function filterBars(bars: BarData[], selection: Object): BarData[];
38
- /**
39
- * Creates a grouped bars layout
40
- *
41
- * @param {Array} data - Chart data
42
- * @param {Object} fields - Field mappings
43
- * @param {Object} scales - Chart scales
44
- * @param {Object} options - Options including dimensions and padding
45
- * @param {Object} options.dimensions - Chart dimensions
46
- * @param {number} [options.padding=0.1] - Padding between bars in a group
47
- * @returns {Object} Grouped bar data
48
- */
49
- export function createGroupedBars(data: any[], fields: Object, scales: Object, options: {
50
- dimensions: Object;
51
- padding?: number | undefined;
52
- }): Object;
53
- export type BarData = import("./types").BarData;
54
- export type ScaleFields = import("./types").ScaleFields;
55
- export type ChartScales = import("./types").ChartScales;
56
- export type ChartDimensions = import("./types").ChartDimensions;
@@ -1,114 +0,0 @@
1
- export function buildLegendGroups(channels: any, colorMap: any, patternMap: any, symbolMap: any): {
2
- field: any;
3
- items: any;
4
- }[];
5
- export class ChartBrewer {
6
- /**
7
- * Override in subclasses to apply stat aggregation.
8
- * @param {Object[]} data
9
- * @param {Object} channels
10
- * @param {string|Function} stat
11
- * @returns {Object[]}
12
- */
13
- transform(data: Object[], _channels: any, _stat: any): Object[];
14
- /** Aggregated data — all derived marks read this, not #rawData */
15
- processedData: Object[];
16
- /** Exposes channels to subclasses for use in their own $derived properties */
17
- get channels(): {};
18
- /** @type {Map<unknown, {fill:string,stroke:string}>} */
19
- colorMap: Map<unknown, {
20
- fill: string;
21
- stroke: string;
22
- }>;
23
- /** @type {Map<unknown, string>} */
24
- patternMap: Map<unknown, string>;
25
- /**
26
- * Unified pattern defs for ChartPatternDefs.
27
- * When fill and pattern map the same field, pattern key = color key (simple case).
28
- * When they differ, each unique (fillKey, patternKey) pair gets its own pattern def
29
- * so bars/areas can have distinct colors per region AND distinct textures per category.
30
- * @type {Array<{ id: string, name: string, fill: string, stroke: string }>}
31
- */
32
- patternDefs: Array<{
33
- id: string;
34
- name: string;
35
- fill: string;
36
- stroke: string;
37
- }>;
38
- /** @type {Map<unknown, string>} */
39
- symbolMap: Map<unknown, string>;
40
- get innerWidth(): number;
41
- get innerHeight(): number;
42
- xScale: any;
43
- yScale: any;
44
- sizeScale: any;
45
- bars: any;
46
- lines: {
47
- d: string;
48
- fill: string;
49
- stroke: string;
50
- points: {
51
- x: number;
52
- y: number;
53
- data: Object;
54
- }[];
55
- key?: unknown;
56
- }[];
57
- areas: {
58
- d: any;
59
- fill: any;
60
- stroke: string;
61
- key: any;
62
- colorKey: any;
63
- patternKey: any;
64
- patternId: string | null;
65
- }[] | {
66
- d: any;
67
- fill: any;
68
- stroke: string;
69
- colorKey: null;
70
- patternKey: null;
71
- patternId: null;
72
- }[];
73
- arcs: any;
74
- points: {
75
- data: Object;
76
- cx: any;
77
- cy: any;
78
- r: any;
79
- fill: any;
80
- stroke: any;
81
- symbolPath: string | null;
82
- key: any;
83
- }[];
84
- legendGroups: {
85
- field: any;
86
- items: any;
87
- }[];
88
- get margin(): {
89
- top: number;
90
- right: number;
91
- bottom: number;
92
- left: number;
93
- };
94
- get width(): number;
95
- get height(): number;
96
- get mode(): string;
97
- /**
98
- * @param {{ data?: Object[], channels?: Object, width?: number, height?: number, mode?: string, margin?: Object, layers?: Object[], curve?: string, stat?: string|Function }} opts
99
- * Supported channel keys: `x`, `y`, `fill`, `color`, `pattern`, `symbol`, `size`, `label`.
100
- * `frame` is reserved for future animation use (no-op).
101
- */
102
- update(opts?: {
103
- data?: Object[];
104
- channels?: Object;
105
- width?: number;
106
- height?: number;
107
- mode?: string;
108
- margin?: Object;
109
- layers?: Object[];
110
- curve?: string;
111
- stat?: string | Function;
112
- }): void;
113
- #private;
114
- }
@@ -1,26 +0,0 @@
1
- /**
2
- * Returns true if the value looks like a CSS color literal (not a field name).
3
- * Supports hex (#rgb, #rrggbb, #rrggbbaa), and functional notations (rgb, hsl, oklch, etc.).
4
- * @param {unknown} value
5
- * @returns {boolean}
6
- */
7
- export function isLiteralColor(value: unknown): boolean;
8
- /**
9
- * Extracts distinct values for a given field from the data array.
10
- * @param {Object[]} data
11
- * @param {string|null} field
12
- * @returns {unknown[]}
13
- */
14
- export function distinct(data: Object[], field: string | null): unknown[];
15
- /**
16
- * Assigns palette colors to an array of distinct values.
17
- * @param {unknown[]} values
18
- * @param {'light'|'dark'} mode
19
- * @param {typeof defaultPreset} preset
20
- * @returns {Map<unknown, {fill: string, stroke: string}>}
21
- */
22
- export function assignColors(values: unknown[], mode?: "light" | "dark", preset?: typeof defaultPreset): Map<unknown, {
23
- fill: string;
24
- stroke: string;
25
- }>;
26
- import { defaultPreset } from '../preset.js';
@@ -1,35 +0,0 @@
1
- /**
2
- * Creates chart dimensions based on width, height and margins
3
- *
4
- * @param {number} width - Total chart width
5
- * @param {number} height - Total chart height
6
- * @param {ChartMargin} margin - Chart margins
7
- * @returns {ChartDimensions} Chart dimensions
8
- */
9
- export function createDimensions(width?: number, height?: number, margin?: ChartMargin): ChartDimensions;
10
- /**
11
- * Updates existing dimensions with new values
12
- *
13
- * @param {ChartDimensions} dimensions - Current dimensions
14
- * @param {Object} updates - Values to update
15
- * @param {number} [updates.width] - New width
16
- * @param {number} [updates.height] - New height
17
- * @param {ChartMargin} [updates.margin] - New margin
18
- * @returns {ChartDimensions} Updated dimensions
19
- */
20
- export function updateDimensions(dimensions: ChartDimensions, updates?: {
21
- width?: number | undefined;
22
- height?: number | undefined;
23
- margin?: import("./types.js").ChartMargin | undefined;
24
- }): ChartDimensions;
25
- /**
26
- * @typedef {import('./types').ChartMargin} ChartMargin
27
- * @typedef {import('./types').ChartDimensions} ChartDimensions
28
- */
29
- /**
30
- * Default chart margin
31
- * @type {ChartMargin}
32
- */
33
- export const DEFAULT_MARGIN: ChartMargin;
34
- export type ChartMargin = import("./types").ChartMargin;
35
- export type ChartDimensions = import("./types").ChartDimensions;