@rokkit/chart 1.0.0-next.155 → 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.
- package/package.json +1 -1
- package/LICENSE +0 -21
- package/dist/Plot/index.d.ts +0 -9
- package/dist/PlotState.svelte.d.ts +0 -75
- package/dist/crossfilter/createCrossFilter.svelte.d.ts +0 -13
- package/dist/elements/index.d.ts +0 -6
- package/dist/geoms/lib/areas.d.ts +0 -52
- package/dist/geoms/lib/bars.d.ts +0 -3
- package/dist/index.d.ts +0 -56
- package/dist/lib/brewer.d.ts +0 -9
- package/dist/lib/brewing/BoxBrewer.svelte.d.ts +0 -8
- package/dist/lib/brewing/CartesianBrewer.svelte.d.ts +0 -8
- package/dist/lib/brewing/PieBrewer.svelte.d.ts +0 -8
- package/dist/lib/brewing/QuartileBrewer.svelte.d.ts +0 -9
- package/dist/lib/brewing/ViolinBrewer.svelte.d.ts +0 -8
- package/dist/lib/brewing/axes.svelte.d.ts +0 -66
- package/dist/lib/brewing/bars.svelte.d.ts +0 -56
- package/dist/lib/brewing/brewer.svelte.d.ts +0 -114
- package/dist/lib/brewing/colors.d.ts +0 -26
- package/dist/lib/brewing/dimensions.svelte.d.ts +0 -35
- package/dist/lib/brewing/index.svelte.d.ts +0 -118
- package/dist/lib/brewing/legends.svelte.d.ts +0 -48
- package/dist/lib/brewing/marks/arcs.d.ts +0 -17
- package/dist/lib/brewing/marks/areas.d.ts +0 -31
- package/dist/lib/brewing/marks/bars.d.ts +0 -1
- package/dist/lib/brewing/marks/boxes.d.ts +0 -24
- package/dist/lib/brewing/marks/lines.d.ts +0 -24
- package/dist/lib/brewing/marks/points.d.ts +0 -55
- package/dist/lib/brewing/marks/violins.d.ts +0 -20
- package/dist/lib/brewing/patterns.d.ts +0 -14
- package/dist/lib/brewing/scales.d.ts +0 -28
- package/dist/lib/brewing/scales.svelte.d.ts +0 -24
- package/dist/lib/brewing/stats.d.ts +0 -23
- package/dist/lib/brewing/symbols.d.ts +0 -7
- package/dist/lib/brewing/types.d.ts +0 -162
- package/dist/lib/chart.d.ts +0 -38
- package/dist/lib/context.d.ts +0 -13
- package/dist/lib/grid.d.ts +0 -72
- package/dist/lib/keyboard-nav.d.ts +0 -15
- package/dist/lib/plot/chartProps.d.ts +0 -177
- package/dist/lib/plot/crossfilter.d.ts +0 -13
- package/dist/lib/plot/facet.d.ts +0 -24
- package/dist/lib/plot/frames.d.ts +0 -47
- package/dist/lib/plot/helpers.d.ts +0 -3
- package/dist/lib/plot/preset.d.ts +0 -29
- package/dist/lib/plot/scales.d.ts +0 -5
- package/dist/lib/plot/stat.d.ts +0 -32
- package/dist/lib/plot/types.d.ts +0 -89
- package/dist/lib/preset.d.ts +0 -30
- package/dist/lib/scales.svelte.d.ts +0 -35
- package/dist/lib/swatch.d.ts +0 -12
- package/dist/lib/ticks.d.ts +0 -36
- package/dist/lib/utils.d.ts +0 -61
- package/dist/lib/xscale.d.ts +0 -11
- package/dist/patterns/index.d.ts +0 -4
- package/dist/patterns/patterns.d.ts +0 -72
- package/dist/patterns/scale.d.ts +0 -30
- package/dist/symbols/constants/index.d.ts +0 -1
- package/dist/symbols/index.d.ts +0 -5
- package/src/patterns/README.md +0 -3
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Main class that manages chart state and provides access to all brewing functions
|
|
3
|
-
*/
|
|
4
|
-
export class ChartBrewer {
|
|
5
|
-
/**
|
|
6
|
-
* Creates a new ChartBrewer instance
|
|
7
|
-
*
|
|
8
|
-
* @param {Object} options Configuration options
|
|
9
|
-
*/
|
|
10
|
-
constructor(options?: Object);
|
|
11
|
-
/**
|
|
12
|
-
* Sets the data for the chart
|
|
13
|
-
*
|
|
14
|
-
* @param {Array} data Data array
|
|
15
|
-
* @returns {ChartBrewer} this for method chaining
|
|
16
|
-
*/
|
|
17
|
-
setData(data: any[]): ChartBrewer;
|
|
18
|
-
/**
|
|
19
|
-
* Sets the field mappings for axes and color
|
|
20
|
-
*
|
|
21
|
-
* @param {Object} fields Field mappings
|
|
22
|
-
* @returns {ChartBrewer} this for method chaining
|
|
23
|
-
*/
|
|
24
|
-
setFields({ x, y, color }: Object): ChartBrewer;
|
|
25
|
-
/**
|
|
26
|
-
* Sets the dimensions of the chart
|
|
27
|
-
*
|
|
28
|
-
* @param {Object} dimensions Chart dimensions
|
|
29
|
-
* @returns {ChartBrewer} this for method chaining
|
|
30
|
-
*/
|
|
31
|
-
setDimensions({ width, height, margin }: Object): ChartBrewer;
|
|
32
|
-
/**
|
|
33
|
-
* Creates scales based on data and dimensions
|
|
34
|
-
*
|
|
35
|
-
* @returns {ChartBrewer} this for method chaining
|
|
36
|
-
*/
|
|
37
|
-
createScales(): ChartBrewer;
|
|
38
|
-
/**
|
|
39
|
-
* Creates bar data for rendering
|
|
40
|
-
*
|
|
41
|
-
* @returns {Array} Data for rendering bars
|
|
42
|
-
*/
|
|
43
|
-
createBars(): any[];
|
|
44
|
-
/**
|
|
45
|
-
* Creates x-axis tick data for rendering
|
|
46
|
-
*
|
|
47
|
-
* @param {Object} options Axis options
|
|
48
|
-
* @returns {Object} Axis rendering data
|
|
49
|
-
*/
|
|
50
|
-
createXAxis(options?: Object): Object;
|
|
51
|
-
/**
|
|
52
|
-
* Creates y-axis tick data for rendering
|
|
53
|
-
*
|
|
54
|
-
* @param {Object} options Axis options
|
|
55
|
-
* @returns {Object} Axis rendering data
|
|
56
|
-
*/
|
|
57
|
-
createYAxis(options?: Object): Object;
|
|
58
|
-
/**
|
|
59
|
-
* Creates grid line data for rendering
|
|
60
|
-
*
|
|
61
|
-
* @param {Object} options Grid options
|
|
62
|
-
* @returns {Object} Grid rendering data
|
|
63
|
-
*/
|
|
64
|
-
createGrid(options?: Object): Object;
|
|
65
|
-
/**
|
|
66
|
-
* Creates legend data for rendering
|
|
67
|
-
*
|
|
68
|
-
* @param {Object} options Legend options
|
|
69
|
-
* @returns {Object} Legend rendering data
|
|
70
|
-
*/
|
|
71
|
-
createLegend(options?: Object): Object;
|
|
72
|
-
/**
|
|
73
|
-
* Gets all chart dimensions
|
|
74
|
-
*
|
|
75
|
-
* @returns {Object} Chart dimensions
|
|
76
|
-
*/
|
|
77
|
-
getDimensions(): Object;
|
|
78
|
-
/**
|
|
79
|
-
* Gets all chart scales
|
|
80
|
-
*
|
|
81
|
-
* @returns {Object} Chart scales
|
|
82
|
-
*/
|
|
83
|
-
getScales(): Object;
|
|
84
|
-
/**
|
|
85
|
-
* Gets the animation duration
|
|
86
|
-
*
|
|
87
|
-
* @returns {number} Animation duration in ms
|
|
88
|
-
*/
|
|
89
|
-
getAnimationDuration(): number;
|
|
90
|
-
/**
|
|
91
|
-
* Gets the data being used
|
|
92
|
-
*
|
|
93
|
-
* @returns {Array} Chart data
|
|
94
|
-
*/
|
|
95
|
-
getData(): any[];
|
|
96
|
-
/**
|
|
97
|
-
* Gets the fields configuration
|
|
98
|
-
*
|
|
99
|
-
* @returns {Object} Fields configuration
|
|
100
|
-
*/
|
|
101
|
-
getFields(): Object;
|
|
102
|
-
#private;
|
|
103
|
-
}
|
|
104
|
-
import { createDimensions } from './dimensions.svelte.js';
|
|
105
|
-
import { updateDimensions } from './dimensions.svelte.js';
|
|
106
|
-
import { createScales } from './scales.svelte.js';
|
|
107
|
-
import { getOrigin } from './scales.svelte.js';
|
|
108
|
-
import { createBars } from './bars.svelte.js';
|
|
109
|
-
import { filterBars } from './bars.svelte.js';
|
|
110
|
-
import { createGroupedBars } from './bars.svelte.js';
|
|
111
|
-
import { createXAxis } from './axes.svelte.js';
|
|
112
|
-
import { createYAxis } from './axes.svelte.js';
|
|
113
|
-
import { createGrid } from './axes.svelte.js';
|
|
114
|
-
import { createTickAttributes } from './axes.svelte.js';
|
|
115
|
-
import { createLegend } from './legends.svelte.js';
|
|
116
|
-
import { filterByLegend } from './legends.svelte.js';
|
|
117
|
-
import { createLegendItemAttributes } from './legends.svelte.js';
|
|
118
|
-
export { createDimensions, updateDimensions, createScales, getOrigin, createBars, filterBars, createGroupedBars, createXAxis, createYAxis, createGrid, createTickAttributes, createLegend, filterByLegend, createLegendItemAttributes };
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Creates legend data for rendering
|
|
3
|
-
*
|
|
4
|
-
* @param {Array} data - Chart data
|
|
5
|
-
* @param {Object} fields - Field mappings
|
|
6
|
-
* @param {string} fields.color - Color field
|
|
7
|
-
* @param {Object} scales - Chart scales
|
|
8
|
-
* @param {Function} scales.color - Color scale
|
|
9
|
-
* @param {Object} options - Legend options including dimensions
|
|
10
|
-
* @param {Object} options.dimensions - Chart dimensions
|
|
11
|
-
* @param {string} [options.title=''] - Legend title
|
|
12
|
-
* @param {string} [options.align='right'] - Legend alignment ('left', 'center', or 'right')
|
|
13
|
-
* @param {string} [options.shape='rect'] - Legend marker shape ('rect' or 'circle')
|
|
14
|
-
* @param {number} [options.markerSize=10] - Size of legend markers
|
|
15
|
-
* @returns {LegendData} Legend rendering data
|
|
16
|
-
*/
|
|
17
|
-
export function createLegend(data: any[], fields: {
|
|
18
|
-
color: string;
|
|
19
|
-
}, scales: {
|
|
20
|
-
color: Function;
|
|
21
|
-
}, options: {
|
|
22
|
-
dimensions: Object;
|
|
23
|
-
title?: string | undefined;
|
|
24
|
-
align?: string | undefined;
|
|
25
|
-
shape?: string | undefined;
|
|
26
|
-
markerSize?: number | undefined;
|
|
27
|
-
}): LegendData;
|
|
28
|
-
/**
|
|
29
|
-
* Filter data based on legend selection
|
|
30
|
-
*
|
|
31
|
-
* @param {Array} data - Chart data
|
|
32
|
-
* @param {string} colorField - Field used for color mapping
|
|
33
|
-
* @param {Array} selectedValues - Selected legend values
|
|
34
|
-
* @returns {Array} Filtered data
|
|
35
|
-
*/
|
|
36
|
-
export function filterByLegend(data: any[], colorField: string, selectedValues: any[]): any[];
|
|
37
|
-
/**
|
|
38
|
-
* Create attributes for legend items
|
|
39
|
-
*
|
|
40
|
-
* @param {LegendItem} item - Legend item
|
|
41
|
-
* @returns {Object} Attributes for the legend item
|
|
42
|
-
*/
|
|
43
|
-
export function createLegendItemAttributes(item: LegendItem): Object;
|
|
44
|
-
export type LegendItem = import("./types").LegendItem;
|
|
45
|
-
export type LegendData = import("./types").LegendData;
|
|
46
|
-
export type ScaleFields = import("./types").ScaleFields;
|
|
47
|
-
export type ChartScales = import("./types").ChartScales;
|
|
48
|
-
export type ChartDimensions = import("./types").ChartDimensions;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Builds arc geometry for pie/donut charts.
|
|
3
|
-
* @param {Object[]} data
|
|
4
|
-
* @param {{ color: string, y: string, pattern?: string }} channels
|
|
5
|
-
* @param {Map} colors
|
|
6
|
-
* @param {number} width
|
|
7
|
-
* @param {number} height
|
|
8
|
-
* @param {{ innerRadius?: number }} opts
|
|
9
|
-
* @param {Map<unknown, string>} [patterns]
|
|
10
|
-
*/
|
|
11
|
-
export function buildArcs(data: Object[], channels: {
|
|
12
|
-
color: string;
|
|
13
|
-
y: string;
|
|
14
|
-
pattern?: string;
|
|
15
|
-
}, colors: Map<any, any>, width: number, height: number, opts?: {
|
|
16
|
-
innerRadius?: number;
|
|
17
|
-
}, patterns?: Map<unknown, string>): any;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @param {Object[]} data
|
|
3
|
-
* @param {{ x: string, y: string, fill?: string, pattern?: string }} channels
|
|
4
|
-
* `fill` is the primary aesthetic — drives grouping and interior color.
|
|
5
|
-
* @param {Function} xScale
|
|
6
|
-
* @param {Function} yScale
|
|
7
|
-
* @param {Map} colors
|
|
8
|
-
* @param {'linear'|'smooth'|'step'} [curve]
|
|
9
|
-
* @param {Map} [patternMap]
|
|
10
|
-
*/
|
|
11
|
-
export function buildAreas(data: Object[], channels: {
|
|
12
|
-
x: string;
|
|
13
|
-
y: string;
|
|
14
|
-
fill?: string;
|
|
15
|
-
pattern?: string;
|
|
16
|
-
}, xScale: Function, yScale: Function, colors: Map<any, any>, curve?: "linear" | "smooth" | "step", patternMap?: Map<any, any>): {
|
|
17
|
-
d: any;
|
|
18
|
-
fill: any;
|
|
19
|
-
stroke: string;
|
|
20
|
-
key: any;
|
|
21
|
-
colorKey: any;
|
|
22
|
-
patternKey: any;
|
|
23
|
-
patternId: string | null;
|
|
24
|
-
}[] | {
|
|
25
|
-
d: any;
|
|
26
|
-
fill: any;
|
|
27
|
-
stroke: string;
|
|
28
|
-
colorKey: null;
|
|
29
|
-
patternKey: null;
|
|
30
|
-
patternId: null;
|
|
31
|
-
}[];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export function buildBars(data: any, channels: any, xScale: any, yScale: any, colors: any, patternMap: any): any;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Builds box geometry for box plot charts.
|
|
3
|
-
* Input data rows must already contain { q1, median, q3, iqr_min, iqr_max } —
|
|
4
|
-
* computed by applyBoxStat before reaching this function.
|
|
5
|
-
*
|
|
6
|
-
* When `fill` differs from `x`, boxes are sub-grouped within each x-band
|
|
7
|
-
* (one narrower box per fill value per x category, like grouped bars).
|
|
8
|
-
* Box body uses the lighter fill shade; whiskers and median use the darker stroke shade.
|
|
9
|
-
*
|
|
10
|
-
* @param {Object[]} data - Pre-aggregated rows with quartile fields
|
|
11
|
-
* @param {{ x: string, fill?: string }} channels
|
|
12
|
-
* `fill` drives the box and whisker color (defaults to x-field).
|
|
13
|
-
* @param {import('d3-scale').ScaleBand} xScale
|
|
14
|
-
* @param {import('d3-scale').ScaleLinear} yScale
|
|
15
|
-
* @param {Map<unknown, {fill:string, stroke:string}>} colors
|
|
16
|
-
* @returns {Array}
|
|
17
|
-
*/
|
|
18
|
-
export function buildBoxes(data: Object[], channels: {
|
|
19
|
-
x: string;
|
|
20
|
-
fill?: string;
|
|
21
|
-
}, xScale: any, yScale: any, colors: Map<unknown, {
|
|
22
|
-
fill: string;
|
|
23
|
-
stroke: string;
|
|
24
|
-
}>): any[];
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @param {Object[]} data
|
|
3
|
-
* @param {{ x: string, y: string, color?: string }} channels
|
|
4
|
-
* @param {Function} xScale
|
|
5
|
-
* @param {Function} yScale
|
|
6
|
-
* @param {Map} colors
|
|
7
|
-
* @param {'linear'|'smooth'|'step'} [curve]
|
|
8
|
-
* @returns {{ d: string, fill: string, stroke: string, points: {x:number, y:number, data:Object}[], key?: unknown }[]}
|
|
9
|
-
*/
|
|
10
|
-
export function buildLines(data: Object[], channels: {
|
|
11
|
-
x: string;
|
|
12
|
-
y: string;
|
|
13
|
-
color?: string;
|
|
14
|
-
}, xScale: Function, yScale: Function, colors: Map<any, any>, curve?: "linear" | "smooth" | "step"): {
|
|
15
|
-
d: string;
|
|
16
|
-
fill: string;
|
|
17
|
-
stroke: string;
|
|
18
|
-
points: {
|
|
19
|
-
x: number;
|
|
20
|
-
y: number;
|
|
21
|
-
data: Object;
|
|
22
|
-
}[];
|
|
23
|
-
key?: unknown;
|
|
24
|
-
}[];
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Returns a Map assigning shape names to distinct values, cycling through available shapes.
|
|
3
|
-
* @param {unknown[]} values
|
|
4
|
-
* @param {typeof defaultPreset} preset
|
|
5
|
-
* @returns {Map<unknown, string>}
|
|
6
|
-
*/
|
|
7
|
-
export function assignSymbols(values: unknown[], preset?: typeof defaultPreset): Map<unknown, string>;
|
|
8
|
-
/**
|
|
9
|
-
* Builds an SVG path string for a given shape name and radius.
|
|
10
|
-
* @param {string} shapeName
|
|
11
|
-
* @param {number} r
|
|
12
|
-
* @returns {string}
|
|
13
|
-
*/
|
|
14
|
-
export function buildSymbolPath(shapeName: string, r: number): string;
|
|
15
|
-
/**
|
|
16
|
-
* Returns a stable pseudo-random offset for a given index.
|
|
17
|
-
* Uses a linear congruential generator seeded by index — no external dependency,
|
|
18
|
-
* stable across re-renders.
|
|
19
|
-
* @param {number} i - row index (seed)
|
|
20
|
-
* @param {number} range - total spread (jitter is ±range/2)
|
|
21
|
-
* @returns {number}
|
|
22
|
-
*/
|
|
23
|
-
export function jitterOffset(i: number, range: number): number;
|
|
24
|
-
/**
|
|
25
|
-
* Builds point geometry for scatter/bubble charts.
|
|
26
|
-
* @param {Object[]} data
|
|
27
|
-
* @param {{ x: string, y: string, color?: string, size?: string, symbol?: string }} channels
|
|
28
|
-
* @param {Function} xScale
|
|
29
|
-
* @param {Function} yScale
|
|
30
|
-
* @param {Map} colors
|
|
31
|
-
* @param {Function|null} sizeScale
|
|
32
|
-
* @param {Map<unknown, string>|null} symbolMap — maps symbol field value → shape name
|
|
33
|
-
* @param {number} defaultRadius
|
|
34
|
-
* @param {{ width?: number, height?: number }|null} jitter
|
|
35
|
-
*/
|
|
36
|
-
export function buildPoints(data: Object[], channels: {
|
|
37
|
-
x: string;
|
|
38
|
-
y: string;
|
|
39
|
-
color?: string;
|
|
40
|
-
size?: string;
|
|
41
|
-
symbol?: string;
|
|
42
|
-
}, xScale: Function, yScale: Function, colors: Map<any, any>, sizeScale: Function | null, symbolMap: Map<unknown, string> | null, defaultRadius?: number, jitter?: {
|
|
43
|
-
width?: number;
|
|
44
|
-
height?: number;
|
|
45
|
-
} | null): {
|
|
46
|
-
data: Object;
|
|
47
|
-
cx: any;
|
|
48
|
-
cy: any;
|
|
49
|
-
r: any;
|
|
50
|
-
fill: any;
|
|
51
|
-
stroke: any;
|
|
52
|
-
symbolPath: string | null;
|
|
53
|
-
key: any;
|
|
54
|
-
}[];
|
|
55
|
-
import { defaultPreset } from '../../preset.js';
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Builds a closed violin shape path for each group.
|
|
3
|
-
* Input rows must have { q1, median, q3, iqr_min, iqr_max } from applyBoxStat.
|
|
4
|
-
*
|
|
5
|
-
* When `fill` differs from `x`, violins are sub-grouped within each x-band
|
|
6
|
-
* (one narrower violin per fill value per x category, like grouped bars).
|
|
7
|
-
* Violin body uses the lighter fill shade; outline uses the darker stroke shade.
|
|
8
|
-
*
|
|
9
|
-
* @param {Object[]} data
|
|
10
|
-
* @param {{ x: string, fill?: string }} channels
|
|
11
|
-
* `fill` drives violin interior and outline (defaults to x-field).
|
|
12
|
-
* @param {import('d3-scale').ScaleBand} xScale
|
|
13
|
-
* @param {import('d3-scale').ScaleLinear} yScale
|
|
14
|
-
* @param {Map} colors
|
|
15
|
-
* @returns {Array}
|
|
16
|
-
*/
|
|
17
|
-
export function buildViolins(data: Object[], channels: {
|
|
18
|
-
x: string;
|
|
19
|
-
fill?: string;
|
|
20
|
-
}, xScale: any, yScale: any, colors: Map<any, any>): any[];
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Converts a data key to a safe SVG element ID for pattern references.
|
|
3
|
-
* Spaces and non-word characters are replaced to avoid broken url(#...) refs.
|
|
4
|
-
* @param {unknown} key
|
|
5
|
-
* @returns {string}
|
|
6
|
-
*/
|
|
7
|
-
export function toPatternId(key: unknown): string;
|
|
8
|
-
/**
|
|
9
|
-
* Assigns patterns from PATTERN_ORDER to an array of distinct values.
|
|
10
|
-
* @param {unknown[]} values
|
|
11
|
-
* @returns {Map<unknown, string>}
|
|
12
|
-
*/
|
|
13
|
-
export function assignPatterns(values: unknown[]): Map<unknown, string>;
|
|
14
|
-
export const PATTERN_ORDER: string[];
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Builds an x scale (band for categorical, linear for numeric).
|
|
3
|
-
* @param {Object[]} data
|
|
4
|
-
* @param {string} field
|
|
5
|
-
* @param {number} width - inner width (pixels)
|
|
6
|
-
* @param {{ padding?: number }} opts
|
|
7
|
-
*/
|
|
8
|
-
export function buildXScale(data: Object[], field: string, width: number, opts?: {
|
|
9
|
-
padding?: number;
|
|
10
|
-
}): any;
|
|
11
|
-
/**
|
|
12
|
-
* Builds a y linear scale from 0 to max, extended by any layer overrides.
|
|
13
|
-
* @param {Object[]} data
|
|
14
|
-
* @param {string} field
|
|
15
|
-
* @param {number} height - inner height (pixels)
|
|
16
|
-
* @param {Array<{data?: Object[], y?: string}>} layers
|
|
17
|
-
*/
|
|
18
|
-
export function buildYScale(data: Object[], field: string, height: number, layers?: Array<{
|
|
19
|
-
data?: Object[];
|
|
20
|
-
y?: string;
|
|
21
|
-
}>): any;
|
|
22
|
-
/**
|
|
23
|
-
* Builds a sqrt scale for bubble/point size.
|
|
24
|
-
* @param {Object[]} data
|
|
25
|
-
* @param {string} field
|
|
26
|
-
* @param {number} maxRadius
|
|
27
|
-
*/
|
|
28
|
-
export function buildSizeScale(data: Object[], field: string, maxRadius?: number): any;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Creates scales based on data, fields, and dimensions
|
|
3
|
-
*
|
|
4
|
-
* @param {Array} data - Chart data
|
|
5
|
-
* @param {ScaleFields} fields - Field mappings
|
|
6
|
-
* @param {Object} dimensions - Chart dimensions
|
|
7
|
-
* @param {Object} options - Scale options
|
|
8
|
-
* @param {number} [options.padding=0.2] - Padding for band scales
|
|
9
|
-
* @returns {ChartScales} Chart scales
|
|
10
|
-
*/
|
|
11
|
-
export function createScales(data: any[], fields: ScaleFields, dimensions: Object, options?: {
|
|
12
|
-
padding?: number | undefined;
|
|
13
|
-
}): ChartScales;
|
|
14
|
-
/**
|
|
15
|
-
* Gets the origin coordinates for the axes
|
|
16
|
-
*
|
|
17
|
-
* @param {ChartScales} scales - Chart scales
|
|
18
|
-
* @param {Object} dimensions - Chart dimensions
|
|
19
|
-
* @returns {Object} Origin coordinates
|
|
20
|
-
*/
|
|
21
|
-
export function getOrigin(scales: ChartScales, dimensions: Object): Object;
|
|
22
|
-
export type ChartScales = import("./types").ChartScales;
|
|
23
|
-
export type ScaleFields = import("./types").ScaleFields;
|
|
24
|
-
export type ChartDimensions = import("./types").ChartDimensions;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Computes box plot quartile statistics grouped by x (and optionally color).
|
|
3
|
-
* Output rows have { q1, median, q3, iqr_min, iqr_max } replacing the raw y values.
|
|
4
|
-
*
|
|
5
|
-
* @param {Object[]} data
|
|
6
|
-
* @param {{ x?: string, y?: string, color?: string }} channels
|
|
7
|
-
* @returns {Object[]}
|
|
8
|
-
*/
|
|
9
|
-
export function applyBoxStat(data: Object[], channels: {
|
|
10
|
-
x?: string;
|
|
11
|
-
y?: string;
|
|
12
|
-
color?: string;
|
|
13
|
-
}): Object[];
|
|
14
|
-
export function applyAggregate(data: any, { by, value, stat }: {
|
|
15
|
-
by: any;
|
|
16
|
-
value: any;
|
|
17
|
-
stat: any;
|
|
18
|
-
}): any;
|
|
19
|
-
/**
|
|
20
|
-
* Built-in reduction functions. Each receives an array of numeric values.
|
|
21
|
-
* @type {Record<string, (values: number[]) => number>}
|
|
22
|
-
*/
|
|
23
|
-
export const STAT_FNS: Record<string, (values: number[]) => number>;
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
export type ChartMargin = {
|
|
2
|
-
/**
|
|
3
|
-
* - Top margin
|
|
4
|
-
*/
|
|
5
|
-
top: number;
|
|
6
|
-
/**
|
|
7
|
-
* - Right margin
|
|
8
|
-
*/
|
|
9
|
-
right: number;
|
|
10
|
-
/**
|
|
11
|
-
* - Bottom margin
|
|
12
|
-
*/
|
|
13
|
-
bottom: number;
|
|
14
|
-
/**
|
|
15
|
-
* - Left margin
|
|
16
|
-
*/
|
|
17
|
-
left: number;
|
|
18
|
-
};
|
|
19
|
-
export type ChartDimensions = {
|
|
20
|
-
/**
|
|
21
|
-
* - Total chart width
|
|
22
|
-
*/
|
|
23
|
-
width: number;
|
|
24
|
-
/**
|
|
25
|
-
* - Total chart height
|
|
26
|
-
*/
|
|
27
|
-
height: number;
|
|
28
|
-
/**
|
|
29
|
-
* - Chart margins
|
|
30
|
-
*/
|
|
31
|
-
margin: ChartMargin;
|
|
32
|
-
/**
|
|
33
|
-
* - Chart width without margins
|
|
34
|
-
*/
|
|
35
|
-
innerWidth: number;
|
|
36
|
-
/**
|
|
37
|
-
* - Chart height without margins
|
|
38
|
-
*/
|
|
39
|
-
innerHeight: number;
|
|
40
|
-
};
|
|
41
|
-
export type ChartScales = {
|
|
42
|
-
/**
|
|
43
|
-
* - X-axis scale function
|
|
44
|
-
*/
|
|
45
|
-
x: Function;
|
|
46
|
-
/**
|
|
47
|
-
* - Y-axis scale function
|
|
48
|
-
*/
|
|
49
|
-
y: Function;
|
|
50
|
-
/**
|
|
51
|
-
* - Color scale function
|
|
52
|
-
*/
|
|
53
|
-
color: Function;
|
|
54
|
-
};
|
|
55
|
-
export type ScaleFields = {
|
|
56
|
-
/**
|
|
57
|
-
* - X-axis field
|
|
58
|
-
*/
|
|
59
|
-
x: string;
|
|
60
|
-
/**
|
|
61
|
-
* - Y-axis field
|
|
62
|
-
*/
|
|
63
|
-
y: string;
|
|
64
|
-
/**
|
|
65
|
-
* - Color field
|
|
66
|
-
*/
|
|
67
|
-
color: string;
|
|
68
|
-
};
|
|
69
|
-
export type TickData = {
|
|
70
|
-
/**
|
|
71
|
-
* - Tick value
|
|
72
|
-
*/
|
|
73
|
-
value: any;
|
|
74
|
-
/**
|
|
75
|
-
* - Tick position in pixels
|
|
76
|
-
*/
|
|
77
|
-
position: number;
|
|
78
|
-
/**
|
|
79
|
-
* - Formatted tick label
|
|
80
|
-
*/
|
|
81
|
-
formattedValue: string;
|
|
82
|
-
};
|
|
83
|
-
export type AxisData = {
|
|
84
|
-
/**
|
|
85
|
-
* - Tick data
|
|
86
|
-
*/
|
|
87
|
-
ticks: TickData[];
|
|
88
|
-
/**
|
|
89
|
-
* - Axis label
|
|
90
|
-
*/
|
|
91
|
-
label: string;
|
|
92
|
-
/**
|
|
93
|
-
* - SVG transform attribute value
|
|
94
|
-
*/
|
|
95
|
-
transform: string;
|
|
96
|
-
/**
|
|
97
|
-
* - SVG transform for the label
|
|
98
|
-
*/
|
|
99
|
-
labelTransform: string;
|
|
100
|
-
};
|
|
101
|
-
export type BarData = {
|
|
102
|
-
/**
|
|
103
|
-
* - Original data point
|
|
104
|
-
*/
|
|
105
|
-
data: Object;
|
|
106
|
-
/**
|
|
107
|
-
* - X position
|
|
108
|
-
*/
|
|
109
|
-
x: number;
|
|
110
|
-
/**
|
|
111
|
-
* - Y position
|
|
112
|
-
*/
|
|
113
|
-
y: number;
|
|
114
|
-
/**
|
|
115
|
-
* - Width of the bar
|
|
116
|
-
*/
|
|
117
|
-
width: number;
|
|
118
|
-
/**
|
|
119
|
-
* - Height of the bar
|
|
120
|
-
*/
|
|
121
|
-
height: number;
|
|
122
|
-
/**
|
|
123
|
-
* - Color of the bar
|
|
124
|
-
*/
|
|
125
|
-
color: string;
|
|
126
|
-
};
|
|
127
|
-
export type LegendItem = {
|
|
128
|
-
/**
|
|
129
|
-
* - Legend item value
|
|
130
|
-
*/
|
|
131
|
-
value: any;
|
|
132
|
-
/**
|
|
133
|
-
* - Item color
|
|
134
|
-
*/
|
|
135
|
-
color: string;
|
|
136
|
-
/**
|
|
137
|
-
* - Y position
|
|
138
|
-
*/
|
|
139
|
-
y: number;
|
|
140
|
-
/**
|
|
141
|
-
* - Shape type ('rect' or 'circle')
|
|
142
|
-
*/
|
|
143
|
-
shape: string;
|
|
144
|
-
/**
|
|
145
|
-
* - Size of the marker
|
|
146
|
-
*/
|
|
147
|
-
markerSize: number;
|
|
148
|
-
};
|
|
149
|
-
export type LegendData = {
|
|
150
|
-
/**
|
|
151
|
-
* - Legend items
|
|
152
|
-
*/
|
|
153
|
-
items: LegendItem[];
|
|
154
|
-
/**
|
|
155
|
-
* - Legend title
|
|
156
|
-
*/
|
|
157
|
-
title: string;
|
|
158
|
-
/**
|
|
159
|
-
* - SVG transform attribute value
|
|
160
|
-
*/
|
|
161
|
-
transform: string;
|
|
162
|
-
};
|
package/dist/lib/chart.d.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
export function chart(data: any, aes: any): Chart;
|
|
2
|
-
declare class Chart {
|
|
3
|
-
constructor(data: any, opts: any);
|
|
4
|
-
width: number | undefined;
|
|
5
|
-
height: number | undefined;
|
|
6
|
-
flipCoords: any;
|
|
7
|
-
x: any;
|
|
8
|
-
y: any;
|
|
9
|
-
value: any;
|
|
10
|
-
valueLabel: any;
|
|
11
|
-
valueFormat: any;
|
|
12
|
-
fill: any;
|
|
13
|
-
color: any;
|
|
14
|
-
shape: any;
|
|
15
|
-
padding(value: any): this;
|
|
16
|
-
spacing: number | undefined;
|
|
17
|
-
margin(value: any): this;
|
|
18
|
-
stat: any;
|
|
19
|
-
domain: any;
|
|
20
|
-
data: any;
|
|
21
|
-
refresh(): this;
|
|
22
|
-
range: {
|
|
23
|
-
x: any[];
|
|
24
|
-
y: any[];
|
|
25
|
-
} | undefined;
|
|
26
|
-
origin: {
|
|
27
|
-
x: any;
|
|
28
|
-
y: any;
|
|
29
|
-
} | undefined;
|
|
30
|
-
scale: {
|
|
31
|
-
x: any;
|
|
32
|
-
y: any;
|
|
33
|
-
} | undefined;
|
|
34
|
-
aggregate(value: any, stat: any): void;
|
|
35
|
-
ticks(axis: any, count: any, fontSize?: number): any;
|
|
36
|
-
#private;
|
|
37
|
-
}
|
|
38
|
-
export {};
|
package/dist/lib/context.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Creates chart context and provides it to child components
|
|
3
|
-
*
|
|
4
|
-
* @param {Object} options Initial chart options
|
|
5
|
-
* @returns {Object} Chart context with all stores and methods
|
|
6
|
-
*/
|
|
7
|
-
export function createChartContext(options?: Object): Object;
|
|
8
|
-
/**
|
|
9
|
-
* Gets chart context provided by parent component
|
|
10
|
-
*
|
|
11
|
-
* @returns {Object} Chart context
|
|
12
|
-
*/
|
|
13
|
-
export function getChartContext(): Object;
|