@vuu-ui/vuu-chart 4.0.0-alpha.9 → 4.0.0-beta.2
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 +12 -11
- package/types/Chart.d.ts +2 -2
- package/types/src/Chart.d.ts +0 -28
- package/types/src/ChartSeries.d.ts +0 -32
- package/types/src/DataRowMovingWindow.d.ts +0 -23
- package/types/src/chart-types.d.ts +0 -42
- package/types/src/chartTooltip.d.ts +0 -12
- package/types/src/index.d.ts +0 -5
- package/types/src/useChartContextMenu.d.ts +0 -16
- package/types/src/useChartOptions.d.ts +0 -28
- package/types/src/useChartSelection.d.ts +0 -14
package/package.json
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "4.0.0-
|
|
2
|
+
"version": "4.0.0-beta.2",
|
|
3
3
|
"description": "support for apache echarts using vuu data",
|
|
4
4
|
"main": "./src/index.js",
|
|
5
|
-
"type": "module",
|
|
6
5
|
"license": "Apache-2.0",
|
|
7
6
|
"scripts": {
|
|
8
7
|
"build:dev": "node ../../scripts/run-build.mjs",
|
|
@@ -10,19 +9,19 @@
|
|
|
10
9
|
"type-defs": "node ../../scripts/build-type-defs.mjs"
|
|
11
10
|
},
|
|
12
11
|
"devDependencies": {
|
|
13
|
-
"@vuu-ui/vuu-data-types": "4.0.0-
|
|
14
|
-
"@vuu-ui/vuu-protocol-types": "4.0.0-
|
|
15
|
-
"@vuu-ui/vuu-data-local": "4.0.0-
|
|
12
|
+
"@vuu-ui/vuu-data-types": "4.0.0-beta.2",
|
|
13
|
+
"@vuu-ui/vuu-protocol-types": "4.0.0-beta.2",
|
|
14
|
+
"@vuu-ui/vuu-data-local": "4.0.0-beta.2"
|
|
16
15
|
},
|
|
17
16
|
"dependencies": {
|
|
18
|
-
"@salt-ds/styles": "0.
|
|
19
|
-
"@salt-ds/window": "0.1.
|
|
20
|
-
"@vuu-ui/vuu-context-menu": "4.0.0-
|
|
21
|
-
"@vuu-ui/vuu-utils": "4.0.0-
|
|
22
|
-
"clsx": "^2.0.0"
|
|
17
|
+
"@salt-ds/styles": "0.4.1",
|
|
18
|
+
"@salt-ds/window": "0.1.2",
|
|
19
|
+
"@vuu-ui/vuu-context-menu": "4.0.0-beta.2",
|
|
20
|
+
"@vuu-ui/vuu-utils": "4.0.0-beta.2",
|
|
21
|
+
"clsx": "^2.0.0",
|
|
22
|
+
"echarts": "6.1.0"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"echarts": "6.0.0",
|
|
26
25
|
"react": "^19.2.3",
|
|
27
26
|
"react-dom": "^19.2.3"
|
|
28
27
|
},
|
|
@@ -34,10 +33,12 @@
|
|
|
34
33
|
"exports": {
|
|
35
34
|
".": {
|
|
36
35
|
"import": "./src/index.js",
|
|
36
|
+
"default": "./src/index.js",
|
|
37
37
|
"types": "./types/index.d.ts"
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
"module": "./src/index.js",
|
|
41
41
|
"name": "@vuu-ui/vuu-chart",
|
|
42
|
+
"type": "module",
|
|
42
43
|
"types": "types/index.d.ts"
|
|
43
44
|
}
|
package/types/Chart.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ChartOptionsProps } from "./useChartOptions";
|
|
2
2
|
import { type MeasuredContainerProps } from "@vuu-ui/vuu-ui-controls";
|
|
3
3
|
type OptionSettings = {
|
|
4
4
|
notMerge: boolean;
|
|
@@ -24,5 +24,5 @@ export interface ChartProps extends ChartOptionsProps, Omit<MeasuredContainerPro
|
|
|
24
24
|
palette?: string[];
|
|
25
25
|
showTooltip?: boolean;
|
|
26
26
|
}
|
|
27
|
-
export declare const Chart: ({ categoryColumnName, chartSettings, className, config, dataExclusions, dataSource, height, optionSettings, palette, resizeStrategy, showTooltip, style, seriesColumnNames, width, ...htmlAttributes }: ChartProps) => import("react").JSX.Element;
|
|
27
|
+
export declare const Chart: ({ categoryColumnName, chartSettings, className, config, dataExclusions, dataSource, height, optionSettings, palette, resizeStrategy, showTooltip, style, seriesColumnNames, width, ...htmlAttributes }: ChartProps) => import("react/jsx-runtime").JSX.Element;
|
|
28
28
|
export {};
|
package/types/src/Chart.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { ChartOptionsProps } from "./useChartOptions";
|
|
2
|
-
import { type MeasuredContainerProps } from "@vuu-ui/vuu-ui-controls";
|
|
3
|
-
type OptionSettings = {
|
|
4
|
-
notMerge: boolean;
|
|
5
|
-
};
|
|
6
|
-
type ChartSettings = {
|
|
7
|
-
/**
|
|
8
|
-
* Default value will be svg
|
|
9
|
-
*/
|
|
10
|
-
renderer: "svg" | "canvas";
|
|
11
|
-
/**
|
|
12
|
-
* Enlarges 'click zone' around interactive elements.
|
|
13
|
-
* Default value true;
|
|
14
|
-
*/
|
|
15
|
-
useCoarsePointer: boolean;
|
|
16
|
-
};
|
|
17
|
-
export interface ChartProps extends ChartOptionsProps, Omit<MeasuredContainerProps, "children" | "onResize"> {
|
|
18
|
-
chartSettings?: Partial<ChartSettings>;
|
|
19
|
-
optionSettings?: OptionSettings;
|
|
20
|
-
/**
|
|
21
|
-
* An array of color values that will be assigned, in the order given
|
|
22
|
-
* to rendered series.
|
|
23
|
-
*/
|
|
24
|
-
palette?: string[];
|
|
25
|
-
showTooltip?: boolean;
|
|
26
|
-
}
|
|
27
|
-
export declare const Chart: ({ categoryColumnName, chartSettings, className, config, dataExclusions, dataSource, height, optionSettings, palette, resizeStrategy, showTooltip, style, seriesColumnNames, width, ...htmlAttributes }: ChartProps) => import("react").JSX.Element;
|
|
28
|
-
export {};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { DataSource, DataSourceRow, DataSourceSubscribeCallback } from "@vuu-ui/vuu-data-types";
|
|
2
|
-
import { EventEmitter } from "@vuu-ui/vuu-utils";
|
|
3
|
-
import { Series } from "./chart-types";
|
|
4
|
-
import { ChartConfig, DataExclusionOptions } from "./useChartOptions";
|
|
5
|
-
export type DataSourceValue = {
|
|
6
|
-
key: string;
|
|
7
|
-
readonly row: DataSourceRow;
|
|
8
|
-
value: number | null;
|
|
9
|
-
};
|
|
10
|
-
export type ChartEvents = {
|
|
11
|
-
update: () => void;
|
|
12
|
-
};
|
|
13
|
-
export interface ChartSeriesConstructorProps {
|
|
14
|
-
dataExclusions?: DataExclusionOptions;
|
|
15
|
-
dataSource: DataSource;
|
|
16
|
-
config: ChartConfig;
|
|
17
|
-
palette: string[];
|
|
18
|
-
}
|
|
19
|
-
export declare class ChartSeries extends EventEmitter<ChartEvents> {
|
|
20
|
-
#private;
|
|
21
|
-
handleData: DataSourceSubscribeCallback;
|
|
22
|
-
buildCategoriesAndSeries(): void;
|
|
23
|
-
constructor({ config, dataExclusions, dataSource, palette, }: ChartSeriesConstructorProps);
|
|
24
|
-
get palette(): (string | undefined)[];
|
|
25
|
-
get categoryColumn(): string;
|
|
26
|
-
set categoryColumn(categoryColumn: string);
|
|
27
|
-
get seriesColumnNames(): string[];
|
|
28
|
-
set seriesColumnNames(seriesColumnNames: string[]);
|
|
29
|
-
get categories(): string[];
|
|
30
|
-
get series(): Series[];
|
|
31
|
-
private getCategoriesAndSeries;
|
|
32
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { DataSourceRow } from "@vuu-ui/vuu-data-types";
|
|
2
|
-
import { VuuRange } from "@vuu-ui/vuu-protocol-types";
|
|
3
|
-
import { WindowRange } from "@vuu-ui/vuu-utils";
|
|
4
|
-
export declare class MovingDataRowWindow {
|
|
5
|
-
#private;
|
|
6
|
-
data: DataSourceRow[];
|
|
7
|
-
rowCount: number;
|
|
8
|
-
constructor({ from, to }: VuuRange);
|
|
9
|
-
setRowCount: (rowCount: number) => void;
|
|
10
|
-
add(data: DataSourceRow): void;
|
|
11
|
-
getAtIndex(index: number): DataSourceRow | undefined;
|
|
12
|
-
getByKey(key: string): DataSourceRow | undefined;
|
|
13
|
-
isWithinRange(index: number): boolean;
|
|
14
|
-
setRange({ from, to }: VuuRange): void;
|
|
15
|
-
get hasData(): boolean;
|
|
16
|
-
/**
|
|
17
|
-
* This will throw if there is no data. Check `hasData` first
|
|
18
|
-
* to guard against this, if not certain.
|
|
19
|
-
*/
|
|
20
|
-
get firstRow(): DataSourceRow;
|
|
21
|
-
get range(): WindowRange;
|
|
22
|
-
get hasAllRowsWithinRange(): boolean;
|
|
23
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { DataSourceValue } from "./ChartSeries";
|
|
2
|
-
export declare const defaultItemColorFunction: ItemColorFunction;
|
|
3
|
-
export type EChartsCallbackParams = {
|
|
4
|
-
color: string;
|
|
5
|
-
data: DataSourceValue;
|
|
6
|
-
dataIndex: number;
|
|
7
|
-
name: string;
|
|
8
|
-
/**
|
|
9
|
-
* This is the Vuu column name
|
|
10
|
-
*/
|
|
11
|
-
seriesName: string;
|
|
12
|
-
};
|
|
13
|
-
export type SymbolSizeFunction = (value: number, params: EChartsCallbackParams) => number | [number, number];
|
|
14
|
-
export type SymbolSize = number | [number, number] | SymbolSizeFunction;
|
|
15
|
-
export type SymbolType = "emptyCircle" | "circle" | `path://${string}`;
|
|
16
|
-
export type ItemColorFunction = (params: EChartsCallbackParams) => string;
|
|
17
|
-
export interface SeriesBase {
|
|
18
|
-
data: DataSourceValue[];
|
|
19
|
-
id: string;
|
|
20
|
-
itemStyle?: {
|
|
21
|
-
borderColor?: string;
|
|
22
|
-
color: string | ItemColorFunction;
|
|
23
|
-
borderWidth?: number;
|
|
24
|
-
};
|
|
25
|
-
label: string;
|
|
26
|
-
name: string;
|
|
27
|
-
symbol?: SymbolType;
|
|
28
|
-
symbolSize: SymbolSize;
|
|
29
|
-
}
|
|
30
|
-
export interface LineSeries extends SeriesBase {
|
|
31
|
-
connectNulls?: boolean;
|
|
32
|
-
lineStyle: {
|
|
33
|
-
color?: string;
|
|
34
|
-
width: number;
|
|
35
|
-
};
|
|
36
|
-
type: "line";
|
|
37
|
-
}
|
|
38
|
-
export interface ScatterSeries extends SeriesBase {
|
|
39
|
-
type: "scatter";
|
|
40
|
-
}
|
|
41
|
-
export type Series = LineSeries | ScatterSeries;
|
|
42
|
-
export type ChartSelectionModel = "none" | "single" | "single-no-deselect" | "extended";
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { DataSourceValue } from "./ChartSeries";
|
|
2
|
-
export interface TooltipParams {
|
|
3
|
-
axisValueLabel: string;
|
|
4
|
-
color: string;
|
|
5
|
-
componentType: string;
|
|
6
|
-
componentSubType: string;
|
|
7
|
-
data: DataSourceValue;
|
|
8
|
-
seriesName: string;
|
|
9
|
-
seriesType: 'line' | 'scatter';
|
|
10
|
-
value: number;
|
|
11
|
-
}
|
|
12
|
-
export declare const chartTooltip: (params: TooltipParams[]) => string | undefined;
|
package/types/src/index.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { Chart, type ChartProps } from "./Chart";
|
|
2
|
-
export type { ItemColorFunction, LineSeries as Series } from './chart-types';
|
|
3
|
-
export { ChartSeries, type DataSourceValue } from "./ChartSeries";
|
|
4
|
-
export type { ChartContextMenuOptions, ChartMenuLocation } from "./useChartContextMenu";
|
|
5
|
-
export type { ChartConfig, DataExclusionOptions } from './useChartOptions';
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { DataSourceRow } from "@vuu-ui/vuu-data-types";
|
|
2
|
-
import { ECElementEvent } from "echarts";
|
|
3
|
-
import { ColumnMap } from "@vuu-ui/vuu-utils";
|
|
4
|
-
export type ChartMenuLocation = "canvas" | "series";
|
|
5
|
-
export type ChartContextMenuOptions = {
|
|
6
|
-
column: string;
|
|
7
|
-
columnMap: ColumnMap;
|
|
8
|
-
row: DataSourceRow;
|
|
9
|
-
};
|
|
10
|
-
interface ChartContextMenuHookProps {
|
|
11
|
-
allowContextMenu?: boolean;
|
|
12
|
-
categoryColumnName?: string;
|
|
13
|
-
columnMap: ColumnMap;
|
|
14
|
-
}
|
|
15
|
-
export declare const useChartContextMenu: ({ columnMap, }: ChartContextMenuHookProps) => ({ data, event, seriesName }: ECElementEvent) => void;
|
|
16
|
-
export {};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { DataSource, DataSourceRow } from "@vuu-ui/vuu-data-types";
|
|
2
|
-
import { ColumnMap } from "@vuu-ui/vuu-utils";
|
|
3
|
-
import { type EChartsCoreOption } from "echarts";
|
|
4
|
-
import type { ChartSelectionModel, ItemColorFunction, SymbolSize, SymbolSizeFunction, SymbolType } from "./chart-types";
|
|
5
|
-
export interface ChartConfig {
|
|
6
|
-
itemColorFunction?: ItemColorFunction;
|
|
7
|
-
selectionModel?: ChartSelectionModel;
|
|
8
|
-
symbolSize?: SymbolSize;
|
|
9
|
-
}
|
|
10
|
-
export interface DataExclusionOptions {
|
|
11
|
-
isExcludedData: (row: DataSourceRow, columnMap: ColumnMap, column: string) => boolean;
|
|
12
|
-
/**
|
|
13
|
-
* An embedded SVG path. If provided, will be used to render excluded values.
|
|
14
|
-
*/
|
|
15
|
-
symbol?: SymbolType;
|
|
16
|
-
}
|
|
17
|
-
export interface ChartOptionsProps {
|
|
18
|
-
categoryColumnName: string;
|
|
19
|
-
config: ChartConfig;
|
|
20
|
-
dataExclusions?: DataExclusionOptions;
|
|
21
|
-
dataSource: DataSource;
|
|
22
|
-
itemColorFunction?: ItemColorFunction;
|
|
23
|
-
palette?: string[];
|
|
24
|
-
seriesColumnNames: string[];
|
|
25
|
-
showTooltip?: boolean;
|
|
26
|
-
symbolSizeFunction?: SymbolSizeFunction;
|
|
27
|
-
}
|
|
28
|
-
export declare const useChartOptions: ({ categoryColumnName, config, dataExclusions, dataSource, itemColorFunction, palette, seriesColumnNames, showTooltip, symbolSizeFunction: symbolSize, }: ChartOptionsProps) => EChartsCoreOption;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ECElementEvent } from "echarts";
|
|
2
|
-
import { ChartSelectionModel, ItemColorFunction, SymbolSizeFunction } from "./chart-types";
|
|
3
|
-
interface ChartSelectionHookProps {
|
|
4
|
-
selectionModel?: ChartSelectionModel;
|
|
5
|
-
categoryColumnName: string;
|
|
6
|
-
}
|
|
7
|
-
export declare const useChartSelection: (_props: ChartSelectionHookProps) => {
|
|
8
|
-
onClick: ({ data, event, seriesName: column }: ECElementEvent) => void;
|
|
9
|
-
onMouseOver: ({ data, seriesName }: ECElementEvent) => void;
|
|
10
|
-
onMouseOut: () => void;
|
|
11
|
-
itemColorFunction: ItemColorFunction;
|
|
12
|
-
symbolSizeFunction: SymbolSizeFunction;
|
|
13
|
-
};
|
|
14
|
-
export {};
|