@c2n/chart 0.0.7
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/LICENSE +21 -0
- package/README.md +81 -0
- package/dist/area-chart.js +29 -0
- package/dist/bar-chart.js +65 -0
- package/dist/chart-adapter.js +0 -0
- package/dist/chart-base-C4-1TyKq.js +666 -0
- package/dist/chart-base.js +2 -0
- package/dist/chart-data.js +286 -0
- package/dist/chart-series-BnpHO3lm.js +83 -0
- package/dist/chart-series.js +2 -0
- package/dist/chart-theme.js +151 -0
- package/dist/chart-types.js +8 -0
- package/dist/chart.js +13 -0
- package/dist/echarts-chart-base-LogCQN10.js +228 -0
- package/dist/echarts-chart-base.js +2 -0
- package/dist/line-chart.js +31 -0
- package/dist/pie-chart.js +100 -0
- package/dist/sparkline.js +79 -0
- package/dist/uplot-chart-base-BWr0zJE2.js +253 -0
- package/dist/uplot-chart-base.js +2 -0
- package/dist/uplot-paths-ChKohvIX.js +95 -0
- package/package.json +146 -0
- package/react.d.ts +34 -0
- package/react.js +3 -0
- package/types/src/area-chart.d.ts +36 -0
- package/types/src/area-chart.d.ts.map +1 -0
- package/types/src/bar-chart.d.ts +46 -0
- package/types/src/bar-chart.d.ts.map +1 -0
- package/types/src/chart-adapter.d.ts +67 -0
- package/types/src/chart-adapter.d.ts.map +1 -0
- package/types/src/chart-base.d.ts +265 -0
- package/types/src/chart-base.d.ts.map +1 -0
- package/types/src/chart-data.d.ts +43 -0
- package/types/src/chart-data.d.ts.map +1 -0
- package/types/src/chart-series.d.ts +51 -0
- package/types/src/chart-series.d.ts.map +1 -0
- package/types/src/chart-theme.d.ts +64 -0
- package/types/src/chart-theme.d.ts.map +1 -0
- package/types/src/chart-types.d.ts +162 -0
- package/types/src/chart-types.d.ts.map +1 -0
- package/types/src/chart.d.ts +27 -0
- package/types/src/chart.d.ts.map +1 -0
- package/types/src/echarts-chart-base.d.ts +28 -0
- package/types/src/echarts-chart-base.d.ts.map +1 -0
- package/types/src/engines/echarts-adapter.d.ts +17 -0
- package/types/src/engines/echarts-adapter.d.ts.map +1 -0
- package/types/src/engines/echarts-loader.d.ts +16 -0
- package/types/src/engines/echarts-loader.d.ts.map +1 -0
- package/types/src/engines/uplot-adapter.d.ts +4 -0
- package/types/src/engines/uplot-adapter.d.ts.map +1 -0
- package/types/src/engines/uplot-loader.d.ts +20 -0
- package/types/src/engines/uplot-loader.d.ts.map +1 -0
- package/types/src/engines/uplot-paths.d.ts +25 -0
- package/types/src/engines/uplot-paths.d.ts.map +1 -0
- package/types/src/line-chart.d.ts +40 -0
- package/types/src/line-chart.d.ts.map +1 -0
- package/types/src/pie-chart.d.ts +59 -0
- package/types/src/pie-chart.d.ts.map +1 -0
- package/types/src/sparkline.d.ts +56 -0
- package/types/src/sparkline.d.ts.map +1 -0
- package/types/src/uplot-chart-base.d.ts +50 -0
- package/types/src/uplot-chart-base.d.ts.map +1 -0
- package/vue.d.ts +134 -0
- package/vue.js +3 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chart.d.ts","sourceRoot":"","sources":["../../src/chart.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,iBAAiB,CAAA;AACxB,OAAO,iBAAiB,CAAA;AACxB,OAAO,gBAAgB,CAAA;AACvB,OAAO,gBAAgB,CAAA;AACvB,OAAO,gBAAgB,CAAA;AACvB,OAAO,mBAAmB,CAAA;AAE1B,OAAO,EAAE,SAAS,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/D,OAAO,EAAE,cAAc,EAAE,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AACpE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AACvF,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,YAAY,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAA;AACpG,YAAY,EAAE,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC7F,YAAY,EACV,WAAW,EACX,kBAAkB,EAClB,eAAe,EACf,UAAU,EACV,UAAU,EACV,qBAAqB,EACrB,qBAAqB,EACrB,QAAQ,EACR,iBAAiB,EACjB,4BAA4B,EAC5B,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ChartBase } from './chart-base.js';
|
|
2
|
+
import type { ChartAdapter, ChartBuildContext } from './chart-adapter.js';
|
|
3
|
+
import type { EchartsFeature } from './engines/echarts-loader.js';
|
|
4
|
+
import type { ChartFrame } from './chart-types.js';
|
|
5
|
+
/**
|
|
6
|
+
* The ECharts half of the hierarchy. A concrete chart declares the engine modules it needs and how one
|
|
7
|
+
* series is configured; everything else — theme, text styles, the disabled built-in tooltip and legend —
|
|
8
|
+
* is settled here.
|
|
9
|
+
*
|
|
10
|
+
* Defines no tag and is never registered.
|
|
11
|
+
*/
|
|
12
|
+
export declare abstract class EchartsChartBase extends ChartBase {
|
|
13
|
+
protected readonly engineName: "echarts";
|
|
14
|
+
/** Which ECharts renderer to use. SVG prints and scales crisply; canvas is faster with many marks. */
|
|
15
|
+
renderer: 'canvas' | 'svg';
|
|
16
|
+
/** The ECharts modules this chart type needs registered. Keeps the rest of the library unloaded. */
|
|
17
|
+
protected abstract readonly features: readonly EchartsFeature[];
|
|
18
|
+
/** The option object for one series. */
|
|
19
|
+
protected abstract seriesOption(index: number, context: ChartBuildContext): Record<string, unknown>;
|
|
20
|
+
/** Grid and axes for a cartesian chart. The pie and gauge charts override this to contribute neither. */
|
|
21
|
+
protected coordinateSystem(context: ChartBuildContext): Record<string, unknown>;
|
|
22
|
+
protected createAdapter(): Promise<ChartAdapter>;
|
|
23
|
+
protected projectData(frame: ChartFrame, context: ChartBuildContext): unknown;
|
|
24
|
+
/** Cartesian charts want `[x, y]` pairs; the labelled ones want `{ name, value }`. */
|
|
25
|
+
protected dataShape(_context: ChartBuildContext): 'pairs' | 'values' | 'named';
|
|
26
|
+
protected buildOptions(context: ChartBuildContext): unknown;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=echarts-chart-base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"echarts-chart-base.d.ts","sourceRoot":"","sources":["../../src/echarts-chart-base.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAEzE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AACjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD;;;;;;GAMG;AACH,8BAAsB,gBAAiB,SAAQ,SAAS;IACtD,mBAA4B,UAAU,EAAG,SAAS,CAAS;IAE3D,sGAAsG;IAC1E,QAAQ,EAAE,QAAQ,GAAG,KAAK,CAAW;IAEjE,oGAAoG;IACpG,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,EAAE,SAAS,cAAc,EAAE,CAAA;IAE/D,wCAAwC;IACxC,SAAS,CAAC,QAAQ,CAAC,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAEnG,yGAAyG;IACzG,SAAS,CAAC,gBAAgB,CAAC,OAAO,EAAE,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;cAW5D,aAAa,IAAI,OAAO,CAAC,YAAY,CAAC;cAMtC,WAAW,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO;IAItF,sFAAsF;IACtF,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE,iBAAiB,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO;cAI3D,YAAY,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO;CAsBrE"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ECharts behind the {@link ChartAdapter} contract.
|
|
3
|
+
*
|
|
4
|
+
* The split the interface asks for maps cleanly here: `setOption` with `notMerge: false` merges, so
|
|
5
|
+
* `setData` can send a *series-data-only* option object and ECharts skips normalising everything else.
|
|
6
|
+
* `lazyUpdate` coalesces bursts into the next frame, and `silent` stops a programmatic update firing the
|
|
7
|
+
* event storm a user interaction would.
|
|
8
|
+
*/
|
|
9
|
+
import type { EChartsCoreOption } from 'echarts/core';
|
|
10
|
+
import { type EchartsFeature } from './echarts-loader.js';
|
|
11
|
+
import type { ChartAdapter } from '../chart-adapter.js';
|
|
12
|
+
/** The option shape the element builds; `series` is the only part `setData` replaces. */
|
|
13
|
+
export interface EchartsOptions extends EChartsCoreOption {
|
|
14
|
+
series?: Record<string, unknown>[];
|
|
15
|
+
}
|
|
16
|
+
export declare function createEchartsAdapter(features: readonly EchartsFeature[], renderer: 'canvas' | 'svg'): Promise<ChartAdapter<EchartsOptions, unknown[]>>;
|
|
17
|
+
//# sourceMappingURL=echarts-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"echarts-adapter.d.ts","sourceRoot":"","sources":["../../../src/engines/echarts-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAW,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAC9D,OAAO,EAAe,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACtE,OAAO,KAAK,EAAE,YAAY,EAAsB,MAAM,qBAAqB,CAAA;AAE3E,yFAAyF;AACzF,MAAM,WAAW,cAAe,SAAQ,iBAAiB;IACvD,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;CACnC;AAED,wBAAsB,oBAAoB,CAAC,QAAQ,EAAE,SAAS,cAAc,EAAE,EAAE,QAAQ,EAAE,QAAQ,GAAG,KAAK,GAAG,OAAO,CAAC,YAAY,CAAC,cAAc,EAAE,OAAO,EAAE,CAAC,CAAC,CA6F5J"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lazy, tree-shaken access to ECharts.
|
|
3
|
+
*
|
|
4
|
+
* ECharts is large, so only the pieces a given chart type needs are registered: a page showing a gauge
|
|
5
|
+
* never evaluates the pie code. Every specifier below is **static** — a computed `import(name)` would
|
|
6
|
+
* defeat the bundler's module graph and pull the whole library back in.
|
|
7
|
+
*/
|
|
8
|
+
import type * as echarts from 'echarts/core';
|
|
9
|
+
/** A registerable ECharts module, keyed by the chart type or component that needs it. */
|
|
10
|
+
export type EchartsFeature = 'pie' | 'gauge' | 'scatter' | 'heatmap' | 'candlestick' | 'bar' | 'line' | 'grid' | 'legend' | 'tooltip' | 'visualMap' | 'dataZoom';
|
|
11
|
+
/**
|
|
12
|
+
* Loads `echarts/core`, registers `features` and the chosen renderer, and returns the core namespace.
|
|
13
|
+
* Registration is idempotent and deduped, so calling this per element is cheap after the first.
|
|
14
|
+
*/
|
|
15
|
+
export declare function loadECharts(features: readonly EchartsFeature[], renderer: 'canvas' | 'svg'): Promise<typeof echarts>;
|
|
16
|
+
//# sourceMappingURL=echarts-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"echarts-loader.d.ts","sourceRoot":"","sources":["../../../src/engines/echarts-loader.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,KAAK,OAAO,MAAM,cAAc,CAAA;AAE5C,yFAAyF;AACzF,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,aAAa,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,CAAA;AAuBhK;;;GAGG;AACH,wBAAsB,WAAW,CAAC,QAAQ,EAAE,SAAS,cAAc,EAAE,EAAE,QAAQ,EAAE,QAAQ,GAAG,KAAK,GAAG,OAAO,CAAC,OAAO,OAAO,CAAC,CA0B1H"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uplot-adapter.d.ts","sourceRoot":"","sources":["../../../src/engines/uplot-adapter.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAEjD,OAAO,KAAK,EAAE,YAAY,EAAsB,MAAM,qBAAqB,CAAA;AAE3E,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,YAAY,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC,CAkGtF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lazy access to uPlot.
|
|
3
|
+
*
|
|
4
|
+
* The library is never imported by an element file, only from inside this function — so importing
|
|
5
|
+
* `c2-line-chart` pulls in no engine, nothing runs at module scope, and the module is safe to evaluate
|
|
6
|
+
* during SSR. `uplot` is a peer dependency and stays external at build time.
|
|
7
|
+
*/
|
|
8
|
+
import type uPlot from 'uplot';
|
|
9
|
+
/**
|
|
10
|
+
* Loads uPlot once per page. Ten sparklines mounting at the same time share one request and one module
|
|
11
|
+
* evaluation, because every caller awaits the same promise.
|
|
12
|
+
*/
|
|
13
|
+
export declare function loadUplot(): Promise<typeof uPlot>;
|
|
14
|
+
/**
|
|
15
|
+
* The module, for callers that cannot await it — the path builders, which are read while an option object
|
|
16
|
+
* is being built. `undefined` until the load resolves; every chart builds its options from inside an
|
|
17
|
+
* adapter that already awaited {@link loadUplot}, so by then this is set.
|
|
18
|
+
*/
|
|
19
|
+
export declare function loadedUplot(): typeof uPlot | undefined;
|
|
20
|
+
//# sourceMappingURL=uplot-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uplot-loader.d.ts","sourceRoot":"","sources":["../../../src/engines/uplot-loader.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAK9B;;;GAGG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAAC,OAAO,KAAK,CAAC,CAOjD;AAED;;;;GAIG;AACH,wBAAgB,WAAW,IAAI,OAAO,KAAK,GAAG,SAAS,CAEtD"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Series } from 'uplot';
|
|
2
|
+
export type ChartCurve = 'linear' | 'smooth' | 'step';
|
|
3
|
+
/**
|
|
4
|
+
* The path builder for a curve, or `undefined` for `linear` — uPlot's default is already a straight line,
|
|
5
|
+
* and passing `undefined` keeps the fastest path.
|
|
6
|
+
*/
|
|
7
|
+
export declare function linePaths(curve: ChartCurve): Series.PathBuilder | undefined;
|
|
8
|
+
/**
|
|
9
|
+
* Applies an alpha to a resolved colour, for the fill under an area series.
|
|
10
|
+
*
|
|
11
|
+
* The theme controller always hands back a computed `rgb(…)` or `rgba(…)`, so this only has to handle those
|
|
12
|
+
* two plus a hex literal a consumer may have set directly on a series.
|
|
13
|
+
*/
|
|
14
|
+
export declare function withAlpha(color: string, alpha: number): string;
|
|
15
|
+
/**
|
|
16
|
+
* The bars path builder for one series of a chart: `width` is the share of the band the whole group takes
|
|
17
|
+
* and `gap` the share of each bar's slot given up to the gutter between grouped bars. Memoised on all four
|
|
18
|
+
* arguments, since uPlot wants one builder reused rather than a fresh one per option rebuild.
|
|
19
|
+
*
|
|
20
|
+
* uPlot draws every series' bars on the same x, so a second series would sit exactly on top of the first.
|
|
21
|
+
* Grouping is therefore ours to do: `disp` gives uPlot an explicit left edge and width per bar — in data
|
|
22
|
+
* units, which is what it reads when no `unit` is set — placing each series in its own slot of the band.
|
|
23
|
+
*/
|
|
24
|
+
export declare function barPaths(width: number, gap: number, index: number, count: number): Series.PathBuilder | undefined;
|
|
25
|
+
//# sourceMappingURL=uplot-paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uplot-paths.d.ts","sourceRoot":"","sources":["../../../src/engines/uplot-paths.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAGnC,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAA;AAIrD;;;GAGG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAAC,WAAW,GAAG,SAAS,CAa3E;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAa9D;AAOD;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,WAAW,GAAG,SAAS,CAyBjH"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { TypedAddEventListener, TypedRemoveEventListener } from '@c2n/core/event-helper.js';
|
|
2
|
+
import { UplotChartBase, type UplotSeriesStyle } from './uplot-chart-base.js';
|
|
3
|
+
import type { ChartEventMap } from './chart-base.js';
|
|
4
|
+
import type { ChartBuildContext } from './chart-adapter.js';
|
|
5
|
+
import type { ChartSeriesConfig } from './chart-types.js';
|
|
6
|
+
import './chart-series.js';
|
|
7
|
+
export interface LineChart {
|
|
8
|
+
addEventListener: TypedAddEventListener<LineChart, ChartEventMap>;
|
|
9
|
+
removeEventListener: TypedRemoveEventListener<LineChart, ChartEventMap>;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* A line chart over a time or numeric x axis, drawn on canvas by uPlot.
|
|
13
|
+
*
|
|
14
|
+
* Series are declared as `c2-chart-series` children — the same authoring shape as `c2-table`'s columns —
|
|
15
|
+
* or through the `series` property. With neither, one line is drawn per numeric key of the first row.
|
|
16
|
+
*
|
|
17
|
+
* ```html
|
|
18
|
+
* <c2-line-chart x-type="time" x-field="t" legend="bottom" data='[{ "t": 1704067200000, "cpu": 12 }]'>
|
|
19
|
+
* <c2-chart-series field="cpu" label="CPU"></c2-chart-series>
|
|
20
|
+
* </c2-line-chart>
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* Realtime feeds should call `appendPoint()` rather than reassigning `data`: it writes into the frame's
|
|
24
|
+
* spare capacity and redraws without a Lit update.
|
|
25
|
+
*
|
|
26
|
+
* @tag c2-line-chart
|
|
27
|
+
*/
|
|
28
|
+
export declare class LineChart extends UplotChartBase {
|
|
29
|
+
/** Interpolation between points. */
|
|
30
|
+
curve: 'linear' | 'smooth' | 'step';
|
|
31
|
+
/** When point markers are drawn. `auto` lets uPlot show them once points are far enough apart. */
|
|
32
|
+
points: 'auto' | 'always' | 'none';
|
|
33
|
+
protected seriesStyle(series: ChartSeriesConfig, index: number, context: ChartBuildContext): UplotSeriesStyle;
|
|
34
|
+
}
|
|
35
|
+
declare global {
|
|
36
|
+
interface HTMLElementTagNameMap {
|
|
37
|
+
'c2-line-chart': LineChart;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=line-chart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"line-chart.d.ts","sourceRoot":"","sources":["../../src/line-chart.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAA;AAChG,OAAO,EAAE,cAAc,EAAE,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAE7E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AACpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACzD,OAAO,mBAAmB,CAAA;AAE1B,MAAM,WAAW,SAAS;IACxB,gBAAgB,EAAE,qBAAqB,CAAC,SAAS,EAAE,aAAa,CAAC,CAAA;IACjE,mBAAmB,EAAE,wBAAwB,CAAC,SAAS,EAAE,aAAa,CAAC,CAAA;CACxE;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,qBACa,SAAU,SAAQ,cAAc;IAC3C,oCAAoC;IACR,KAAK,EAAE,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAW;IAE1E,kGAAkG;IACtE,MAAM,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAS;cAEpD,WAAW,CAAC,MAAM,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,GAAG,gBAAgB;CAavH;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,eAAe,EAAE,SAAS,CAAA;KAC3B;CACF"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { TypedAddEventListener, TypedRemoveEventListener } from '@c2n/core/event-helper.js';
|
|
2
|
+
import { EchartsChartBase } from './echarts-chart-base.js';
|
|
3
|
+
import type { ChartLegendItem } from './chart-base.js';
|
|
4
|
+
import type { ChartEventMap } from './chart-base.js';
|
|
5
|
+
import type { ChartBuildContext } from './chart-adapter.js';
|
|
6
|
+
import type { EchartsFeature } from './engines/echarts-loader.js';
|
|
7
|
+
import './chart-series.js';
|
|
8
|
+
export interface PieChart {
|
|
9
|
+
addEventListener: TypedAddEventListener<PieChart, ChartEventMap>;
|
|
10
|
+
removeEventListener: TypedRemoveEventListener<PieChart, ChartEventMap>;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* A pie or donut chart, drawn by ECharts. `label-field` names each slice and the single series supplies
|
|
14
|
+
* its value, so one row is one slice.
|
|
15
|
+
*
|
|
16
|
+
* ```html
|
|
17
|
+
* <c2-pie-chart label-field="channel" inner-radius="0.6" legend="end"
|
|
18
|
+
* data='[{ "channel": "Direct", "revenue": 4200 }, { "channel": "Search", "revenue": 3100 }]'>
|
|
19
|
+
* <c2-chart-series field="revenue"></c2-chart-series>
|
|
20
|
+
* </c2-pie-chart>
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @tag c2-pie-chart
|
|
24
|
+
*
|
|
25
|
+
* @cssproperty {border} [--c2-chart__slice--border=2px solid #ffffff] - Border drawn between adjacent slices.
|
|
26
|
+
*/
|
|
27
|
+
export declare class PieChart extends EchartsChartBase {
|
|
28
|
+
protected readonly features: readonly EchartsFeature[];
|
|
29
|
+
/** Hole in the middle, from 0 (a full pie) to 1. Anything above 0 makes it a donut. */
|
|
30
|
+
innerRadius: number;
|
|
31
|
+
/** Outer edge as a share of the available box, from 0 to 1. */
|
|
32
|
+
outerRadius: number;
|
|
33
|
+
/** Angle the first slice starts at, in degrees, counter-clockwise from three o'clock. */
|
|
34
|
+
startAngle: number;
|
|
35
|
+
/** Where the slice labels are drawn, or `none` to leave them off. */
|
|
36
|
+
labels: 'none' | 'inside' | 'outside';
|
|
37
|
+
/** Orders the slices by value rather than keeping the data order. */
|
|
38
|
+
sort: 'none' | 'asc' | 'desc';
|
|
39
|
+
constructor();
|
|
40
|
+
/** Slices the reader has switched off from the legend, by label. */
|
|
41
|
+
private hiddenSlices;
|
|
42
|
+
/** A pie has no grid and no axes at all: contributing them would draw an empty cartesian frame. */
|
|
43
|
+
protected coordinateSystem(): Record<string, unknown>;
|
|
44
|
+
/**
|
|
45
|
+
* A pie's legend is its slices, not its series: there is only ever one series, so the inherited legend
|
|
46
|
+
* would render a single entry ("Revenue") above a four-slice donut.
|
|
47
|
+
*/
|
|
48
|
+
protected legendItems(): ChartLegendItem[];
|
|
49
|
+
/** Shows or hides one slice, as the legend does. ECharts selects by name, which is the slice's label. */
|
|
50
|
+
setSliceVisible(label: string, visible: boolean): void;
|
|
51
|
+
protected dataShape(): 'pairs' | 'values' | 'named';
|
|
52
|
+
protected seriesOption(_index: number, context: ChartBuildContext): Record<string, unknown>;
|
|
53
|
+
}
|
|
54
|
+
declare global {
|
|
55
|
+
interface HTMLElementTagNameMap {
|
|
56
|
+
'c2-pie-chart': PieChart;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=pie-chart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pie-chart.d.ts","sourceRoot":"","sources":["../../src/pie-chart.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAA;AAChG,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AACpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AACjE,OAAO,mBAAmB,CAAA;AAE1B,MAAM,WAAW,QAAQ;IACvB,gBAAgB,EAAE,qBAAqB,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAA;IAChE,mBAAmB,EAAE,wBAAwB,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAA;CACvE;AAED;;;;;;;;;;;;;;GAcG;AACH,qBACa,QAAS,SAAQ,gBAAgB;IAC5C,mBAA4B,QAAQ,EAAE,SAAS,cAAc,EAAE,CAAU;IAEzE,uFAAuF;IAChC,WAAW,SAAI;IAEtE,+DAA+D;IACR,WAAW,SAAO;IAEzE,yFAAyF;IACnC,UAAU,SAAK;IAErE,qEAAqE;IACzC,MAAM,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAS;IAE1E,qEAAqE;IACzC,IAAI,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM,CAAS;;IASlE,oEAAoE;IAC3D,OAAO,CAAC,YAAY,CAAoB;IAEjD,mGAAmG;cAChF,gBAAgB,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAI9D;;;OAGG;cACgB,WAAW,IAAI,eAAe,EAAE;IAenD,yGAAyG;IACzG,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI;cAQnC,SAAS,IAAI,OAAO,GAAG,QAAQ,GAAG,OAAO;cAIzC,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAoBrG;AAYD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,cAAc,EAAE,QAAQ,CAAA;KACzB;CACF"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { TypedAddEventListener, TypedRemoveEventListener } from '@c2n/core/event-helper.js';
|
|
2
|
+
import type { Options } from 'uplot';
|
|
3
|
+
import { UplotChartBase, type UplotSeriesStyle } from './uplot-chart-base.js';
|
|
4
|
+
import type { ChartEventMap } from './chart-base.js';
|
|
5
|
+
import type { ChartBuildContext } from './chart-adapter.js';
|
|
6
|
+
import type { ChartSeriesConfig } from './chart-types.js';
|
|
7
|
+
export interface Sparkline {
|
|
8
|
+
addEventListener: TypedAddEventListener<Sparkline, ChartEventMap>;
|
|
9
|
+
removeEventListener: TypedRemoveEventListener<Sparkline, ChartEventMap>;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* A chromeless trend line sized for a table cell, a list row or the `trend` slot of a `c2-stat`: no axes,
|
|
13
|
+
* no grid, no legend and no tooltip, so the whole box is the data.
|
|
14
|
+
*
|
|
15
|
+
* It takes the bare `number[]` shape as well as rows, which is usually all a cell has:
|
|
16
|
+
*
|
|
17
|
+
* ```html
|
|
18
|
+
* <c2-sparkline data="[3, 5, 4, 8, 6, 11]" tone="auto"></c2-sparkline>
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* uPlot is what makes a sparkline per row affordable — the engine loads once for the page, and each
|
|
22
|
+
* instance is a single canvas.
|
|
23
|
+
*
|
|
24
|
+
* @tag c2-sparkline
|
|
25
|
+
*
|
|
26
|
+
* @cssproperty {color} [--c2-chart__tone-positive--color=#16a34a] - Stroke when `tone` resolves to positive.
|
|
27
|
+
* @cssproperty {color} [--c2-chart__tone-negative--color=#dc2626] - Stroke when `tone` resolves to negative.
|
|
28
|
+
*/
|
|
29
|
+
export declare class Sparkline extends UplotChartBase {
|
|
30
|
+
static styles: import("lit").CSSResult[];
|
|
31
|
+
/** How the line is drawn. */
|
|
32
|
+
type: 'line' | 'area';
|
|
33
|
+
/**
|
|
34
|
+
* Colours the line by direction. `auto` compares the last value with the first and uses the positive or
|
|
35
|
+
* negative tone; `neutral` keeps the palette colour.
|
|
36
|
+
*/
|
|
37
|
+
tone: 'auto' | 'positive' | 'negative' | 'neutral';
|
|
38
|
+
constructor();
|
|
39
|
+
protected seriesStyle(series: ChartSeriesConfig, index: number, context: ChartBuildContext): UplotSeriesStyle;
|
|
40
|
+
/**
|
|
41
|
+
* Strips every remaining pixel of chrome, so the line fills the whole box.
|
|
42
|
+
*
|
|
43
|
+
* The axes are left alone on purpose: `this.axes = 'none'` already builds them with `show: false`, which
|
|
44
|
+
* is what makes uPlot skip both the axis element and its gutter. Handing it `axes: []` would do the
|
|
45
|
+
* opposite — uPlot fills a short array back up to two axes with its own defaults, which are *visible* —
|
|
46
|
+
* and a 120x32 sparkline would spend 52px of its width on a y axis it never asked for.
|
|
47
|
+
*/
|
|
48
|
+
protected decorateOptions(options: Options, _context: ChartBuildContext): Options;
|
|
49
|
+
private resolveTone;
|
|
50
|
+
}
|
|
51
|
+
declare global {
|
|
52
|
+
interface HTMLElementTagNameMap {
|
|
53
|
+
'c2-sparkline': Sparkline;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=sparkline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sparkline.d.ts","sourceRoot":"","sources":["../../src/sparkline.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAA;AAChG,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAEpC,OAAO,EAAE,cAAc,EAAE,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAE7E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AACpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAEzD,MAAM,WAAW,SAAS;IACxB,gBAAgB,EAAE,qBAAqB,CAAC,SAAS,EAAE,aAAa,CAAC,CAAA;IACjE,mBAAmB,EAAE,wBAAwB,CAAC,SAAS,EAAE,aAAa,CAAC,CAAA;CACxE;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,qBACa,SAAU,SAAQ,cAAc;IAC3C,OAAgB,MAAM,4BAgBrB;IAED,6BAA6B;IACD,IAAI,EAAE,MAAM,GAAG,MAAM,CAAS;IAE1D;;;OAGG;IACyB,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,CAAY;;cAavE,WAAW,CAAC,MAAM,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,GAAG,gBAAgB;IAWtH;;;;;;;OAOG;cACgB,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,iBAAiB,GAAG,OAAO;IAI1F,OAAO,CAAC,WAAW;CAcpB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,cAAc,EAAE,SAAS,CAAA;KAC1B;CACF"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { Options, Series } from 'uplot';
|
|
2
|
+
import { ChartBase } from './chart-base.js';
|
|
3
|
+
import type { ChartAdapter, ChartBuildContext } from './chart-adapter.js';
|
|
4
|
+
import type { ChartFrame, ChartSeriesConfig } from './chart-types.js';
|
|
5
|
+
/** The per-series drawing options a concrete uPlot chart contributes. */
|
|
6
|
+
export type UplotSeriesStyle = Omit<Series, 'label' | 'show'>;
|
|
7
|
+
/**
|
|
8
|
+
* The uPlot half of the hierarchy: the cartesian presentation shared by the line, area, bar and sparkline
|
|
9
|
+
* charts, and the option object built from it. A concrete chart supplies only {@link seriesStyle}, which
|
|
10
|
+
* is what makes a new uPlot chart type roughly ten lines.
|
|
11
|
+
*
|
|
12
|
+
* Defines no tag and is never registered.
|
|
13
|
+
*
|
|
14
|
+
* @cssproperty {color} [--c2-chart__axis-line--color=#e4e4e7] - Colour of the axis rules uPlot draws at the plot edges.
|
|
15
|
+
*/
|
|
16
|
+
export declare abstract class UplotChartBase extends ChartBase {
|
|
17
|
+
protected readonly engineName: "uplot";
|
|
18
|
+
/**
|
|
19
|
+
* Which grid lines are drawn. A string rather than a boolean because a boolean attribute reads as `true`
|
|
20
|
+
* whenever it is present — `grid="false"` in markup would turn the grid *on*, and there would be no way to
|
|
21
|
+
* turn it off from HTML at all. `y` (the default) draws the horizontal lines, matching `axes`' shape.
|
|
22
|
+
*/
|
|
23
|
+
grid: 'both' | 'x' | 'y' | 'none';
|
|
24
|
+
/** Which axes are drawn. */
|
|
25
|
+
axes: 'both' | 'x' | 'y' | 'none';
|
|
26
|
+
/** Lower bound of the y scale. Auto-ranged when unset. */
|
|
27
|
+
yMin?: number;
|
|
28
|
+
/** Upper bound of the y scale. Auto-ranged when unset. */
|
|
29
|
+
yMax?: number;
|
|
30
|
+
/** Lets the user drag horizontally to zoom the x scale. */
|
|
31
|
+
zoom: boolean;
|
|
32
|
+
/** The cursor crosshair. */
|
|
33
|
+
cursor: 'x' | 'none';
|
|
34
|
+
/** How one series of this chart type is drawn. The only thing a concrete uPlot chart must supply. */
|
|
35
|
+
protected abstract seriesStyle(series: ChartSeriesConfig, index: number, context: ChartBuildContext): UplotSeriesStyle;
|
|
36
|
+
/** Last chance to adjust the finished option object; the sparkline strips its chrome here. */
|
|
37
|
+
protected decorateOptions(options: Options, _context: ChartBuildContext): Options;
|
|
38
|
+
protected createAdapter(): Promise<ChartAdapter>;
|
|
39
|
+
protected projectData(frame: ChartFrame): unknown;
|
|
40
|
+
protected buildOptions(context: ChartBuildContext): unknown;
|
|
41
|
+
/** A fixed y range when either bound is set, otherwise uPlot's own auto-ranging. */
|
|
42
|
+
private yRange;
|
|
43
|
+
/**
|
|
44
|
+
* Axis tick labels are terser than the tooltip's. The unit comes from the span the chart covers, because a
|
|
45
|
+
* fixed date format repeats itself once the engine picks sub-day increments: an hour of samples would label
|
|
46
|
+
* every tick "Jan 1".
|
|
47
|
+
*/
|
|
48
|
+
protected formatAxisX(value: number): string;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=uplot-chart-base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uplot-chart-base.d.ts","sourceRoot":"","sources":["../../src/uplot-chart-base.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAqB,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAEzE,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAQrE,yEAAyE;AACzE,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAAC,CAAA;AAE7D;;;;;;;;GAQG;AACH,8BAAsB,cAAe,SAAQ,SAAS;IACpD,mBAA4B,UAAU,EAAG,OAAO,CAAS;IAEzD;;;;OAIG;IACyB,IAAI,EAAE,MAAM,GAAG,GAAG,GAAG,GAAG,GAAG,MAAM,CAAM;IAEnE,4BAA4B;IACA,IAAI,EAAE,MAAM,GAAG,GAAG,GAAG,GAAG,GAAG,MAAM,CAAS;IAEtE,0DAA0D;IACV,IAAI,CAAC,EAAE,MAAM,CAAA;IAE7D,0DAA0D;IACV,IAAI,CAAC,EAAE,MAAM,CAAA;IAE7D,2DAA2D;IAC9B,IAAI,UAAQ;IAEzC,4BAA4B;IACA,MAAM,EAAE,GAAG,GAAG,MAAM,CAAM;IAEtD,qGAAqG;IACrG,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,MAAM,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,GAAG,gBAAgB;IAEtH,8FAA8F;IAC9F,SAAS,CAAC,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,iBAAiB,GAAG,OAAO;cAI9D,aAAa,IAAI,OAAO,CAAC,YAAY,CAAC;cAItC,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO;cAIvC,YAAY,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO;IAyDpE,oFAAoF;IACpF,OAAO,CAAC,MAAM;IAKd;;;;OAIG;IACH,SAAS,CAAC,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;CAO7C"}
|
package/vue.d.ts
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
// GENERATED by @c2n/framework-types. Do not edit by hand.
|
|
2
|
+
//
|
|
3
|
+
// Vue template types for the custom elements of @c2n/chart. Import once, anywhere in the program:
|
|
4
|
+
//
|
|
5
|
+
// import '@c2n/chart/vue'
|
|
6
|
+
//
|
|
7
|
+
// Tell the compiler about the tags as well, or every c2-* tag is resolved as a Vue component and renders
|
|
8
|
+
// nothing: template.compilerOptions.isCustomElement = (tag) => tag.startsWith('c2-') in vite.config.ts.
|
|
9
|
+
|
|
10
|
+
import type { DefineComponent, HTMLAttributes } from 'vue'
|
|
11
|
+
import type { AreaChart, AreaChartEventMap } from '@c2n/chart/area-chart.js'
|
|
12
|
+
import type { BarChart, BarChartEventMap } from '@c2n/chart/bar-chart.js'
|
|
13
|
+
import type { ChartSeries, ChartSeriesEventMap } from '@c2n/chart/chart-series.js'
|
|
14
|
+
import type { LineChart, LineChartEventMap } from '@c2n/chart/line-chart.js'
|
|
15
|
+
import type { PieChart, PieChartEventMap } from '@c2n/chart/pie-chart.js'
|
|
16
|
+
import type { Sparkline, SparklineEventMap } from '@c2n/chart/sparkline.js'
|
|
17
|
+
|
|
18
|
+
/** The element's own public properties, plus every attribute Vue understands on a host element. */
|
|
19
|
+
type C2Props<T> = Partial<Omit<T, keyof HTMLElement>> & HTMLAttributes
|
|
20
|
+
|
|
21
|
+
declare module 'vue' {
|
|
22
|
+
interface GlobalComponents {
|
|
23
|
+
'c2-area-chart': DefineComponent<
|
|
24
|
+
C2Props<AreaChart> & {
|
|
25
|
+
'fill-opacity'?: unknown
|
|
26
|
+
'y-min'?: unknown
|
|
27
|
+
'y-max'?: unknown
|
|
28
|
+
'x-field'?: unknown
|
|
29
|
+
'label-field'?: unknown
|
|
30
|
+
'x-type'?: unknown
|
|
31
|
+
'empty-message'?: unknown
|
|
32
|
+
'max-points'?: unknown
|
|
33
|
+
'lazy-render'?: unknown
|
|
34
|
+
onSeriesToggle?: (event: AreaChartEventMap['series-toggle']) => void
|
|
35
|
+
onRangeChange?: (event: AreaChartEventMap['range-change']) => void
|
|
36
|
+
onChartReady?: (event: AreaChartEventMap['chart-ready']) => void
|
|
37
|
+
onChartError?: (event: AreaChartEventMap['chart-error']) => void
|
|
38
|
+
onPointHover?: (event: AreaChartEventMap['point-hover']) => void
|
|
39
|
+
onPointClick?: (event: AreaChartEventMap['point-click']) => void
|
|
40
|
+
}
|
|
41
|
+
>
|
|
42
|
+
'c2-bar-chart': DefineComponent<
|
|
43
|
+
C2Props<BarChart> & {
|
|
44
|
+
'bar-width'?: unknown
|
|
45
|
+
'bar-gap'?: unknown
|
|
46
|
+
'y-min'?: unknown
|
|
47
|
+
'y-max'?: unknown
|
|
48
|
+
'x-field'?: unknown
|
|
49
|
+
'label-field'?: unknown
|
|
50
|
+
'x-type'?: unknown
|
|
51
|
+
'empty-message'?: unknown
|
|
52
|
+
'max-points'?: unknown
|
|
53
|
+
'lazy-render'?: unknown
|
|
54
|
+
onSeriesToggle?: (event: BarChartEventMap['series-toggle']) => void
|
|
55
|
+
onRangeChange?: (event: BarChartEventMap['range-change']) => void
|
|
56
|
+
onChartReady?: (event: BarChartEventMap['chart-ready']) => void
|
|
57
|
+
onChartError?: (event: BarChartEventMap['chart-error']) => void
|
|
58
|
+
onPointHover?: (event: BarChartEventMap['point-hover']) => void
|
|
59
|
+
onPointClick?: (event: BarChartEventMap['point-click']) => void
|
|
60
|
+
}
|
|
61
|
+
>
|
|
62
|
+
'c2-chart-series': DefineComponent<
|
|
63
|
+
C2Props<ChartSeries> & {
|
|
64
|
+
'line-width'?: unknown
|
|
65
|
+
'span-gaps'?: unknown
|
|
66
|
+
onSERIES_CHANGE_EVENT?: (event: ChartSeriesEventMap['SERIES_CHANGE_EVENT']) => void
|
|
67
|
+
}
|
|
68
|
+
>
|
|
69
|
+
'c2-line-chart': DefineComponent<
|
|
70
|
+
C2Props<LineChart> & {
|
|
71
|
+
'y-min'?: unknown
|
|
72
|
+
'y-max'?: unknown
|
|
73
|
+
'x-field'?: unknown
|
|
74
|
+
'label-field'?: unknown
|
|
75
|
+
'x-type'?: unknown
|
|
76
|
+
'empty-message'?: unknown
|
|
77
|
+
'max-points'?: unknown
|
|
78
|
+
'lazy-render'?: unknown
|
|
79
|
+
onSeriesToggle?: (event: LineChartEventMap['series-toggle']) => void
|
|
80
|
+
onRangeChange?: (event: LineChartEventMap['range-change']) => void
|
|
81
|
+
onChartReady?: (event: LineChartEventMap['chart-ready']) => void
|
|
82
|
+
onChartError?: (event: LineChartEventMap['chart-error']) => void
|
|
83
|
+
onPointHover?: (event: LineChartEventMap['point-hover']) => void
|
|
84
|
+
onPointClick?: (event: LineChartEventMap['point-click']) => void
|
|
85
|
+
}
|
|
86
|
+
>
|
|
87
|
+
'c2-pie-chart': DefineComponent<
|
|
88
|
+
C2Props<PieChart> & {
|
|
89
|
+
'inner-radius'?: unknown
|
|
90
|
+
'outer-radius'?: unknown
|
|
91
|
+
'start-angle'?: unknown
|
|
92
|
+
'x-field'?: unknown
|
|
93
|
+
'label-field'?: unknown
|
|
94
|
+
'x-type'?: unknown
|
|
95
|
+
'empty-message'?: unknown
|
|
96
|
+
'max-points'?: unknown
|
|
97
|
+
'lazy-render'?: unknown
|
|
98
|
+
onSeriesToggle?: (event: PieChartEventMap['series-toggle']) => void
|
|
99
|
+
onRangeChange?: (event: PieChartEventMap['range-change']) => void
|
|
100
|
+
onChartReady?: (event: PieChartEventMap['chart-ready']) => void
|
|
101
|
+
onChartError?: (event: PieChartEventMap['chart-error']) => void
|
|
102
|
+
onPointHover?: (event: PieChartEventMap['point-hover']) => void
|
|
103
|
+
onPointClick?: (event: PieChartEventMap['point-click']) => void
|
|
104
|
+
}
|
|
105
|
+
>
|
|
106
|
+
'c2-sparkline': DefineComponent<
|
|
107
|
+
C2Props<Sparkline> & {
|
|
108
|
+
'y-min'?: unknown
|
|
109
|
+
'y-max'?: unknown
|
|
110
|
+
'x-field'?: unknown
|
|
111
|
+
'label-field'?: unknown
|
|
112
|
+
'x-type'?: unknown
|
|
113
|
+
'empty-message'?: unknown
|
|
114
|
+
'max-points'?: unknown
|
|
115
|
+
'lazy-render'?: unknown
|
|
116
|
+
onSeriesToggle?: (event: SparklineEventMap['series-toggle']) => void
|
|
117
|
+
onRangeChange?: (event: SparklineEventMap['range-change']) => void
|
|
118
|
+
onChartReady?: (event: SparklineEventMap['chart-ready']) => void
|
|
119
|
+
onChartError?: (event: SparklineEventMap['chart-error']) => void
|
|
120
|
+
onPointHover?: (event: SparklineEventMap['point-hover']) => void
|
|
121
|
+
onPointClick?: (event: SparklineEventMap['point-click']) => void
|
|
122
|
+
}
|
|
123
|
+
>
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
declare module '@vue/runtime-dom' {
|
|
128
|
+
interface HTMLAttributes {
|
|
129
|
+
/** Vue's own definition omits it, and slotting a plain element into a component needs it. */
|
|
130
|
+
slot?: string
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export {}
|
package/vue.js
ADDED