@vuu-ui/vuu-chart 4.1.0 → 5.0.0-alpha.1

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 CHANGED
@@ -1,24 +1,24 @@
1
1
  {
2
- "version": "4.1.0",
2
+ "version": "5.0.0-alpha.1",
3
3
  "description": "support for apache echarts using vuu data",
4
4
  "main": "./src/index.js",
5
+ "type": "module",
5
6
  "license": "Apache-2.0",
6
7
  "scripts": {
7
- "build:dev": "node ../../scripts/run-build.mjs",
8
8
  "build": "node ../../scripts/run-build-rslib.ts",
9
9
  "type-defs": "node ../../scripts/build-type-defs.mjs"
10
10
  },
11
11
  "devDependencies": {
12
- "@vuu-ui/vuu-data-types": "4.1.0",
13
- "@vuu-ui/vuu-protocol-types": "4.1.0",
14
- "@vuu-ui/vuu-data-local": "4.1.0"
12
+ "@vuu-ui/vuu-data-types": "5.0.0-alpha.1",
13
+ "@vuu-ui/vuu-protocol-types": "5.0.0-alpha.1",
14
+ "@vuu-ui/vuu-data-local": "5.0.0-alpha.1"
15
15
  },
16
16
  "dependencies": {
17
17
  "@salt-ds/styles": "0.4.2",
18
18
  "@salt-ds/window": "0.1.2",
19
- "@vuu-ui/vuu-context-menu": "4.1.0",
20
- "@vuu-ui/vuu-ui-controls": "4.1.0",
21
- "@vuu-ui/vuu-utils": "4.1.0",
19
+ "@vuu-ui/vuu-context-menu": "5.0.0-alpha.1",
20
+ "@vuu-ui/vuu-ui-controls": "5.0.0-alpha.1",
21
+ "@vuu-ui/vuu-utils": "5.0.0-alpha.1",
22
22
  "clsx": "^2.0.0",
23
23
  "echarts": "6.1.0"
24
24
  },
@@ -33,13 +33,12 @@
33
33
  ],
34
34
  "exports": {
35
35
  ".": {
36
+ "types": "./types/index.d.ts",
36
37
  "import": "./src/index.js",
37
- "default": "./src/index.js",
38
- "types": "./types/index.d.ts"
38
+ "default": "./src/index.js"
39
39
  }
40
40
  },
41
41
  "module": "./src/index.js",
42
42
  "name": "@vuu-ui/vuu-chart",
43
- "type": "module",
44
43
  "types": "types/index.d.ts"
45
44
  }
@@ -120,13 +120,13 @@ export declare const markLineOption: (defs: MarkLineDef[] | undefined, theme: Ch
120
120
  animation: boolean;
121
121
  data: {
122
122
  [x: string]: string | number | {
123
+ position?: undefined;
123
124
  color: string;
124
125
  type: "dashed" | "dotted" | "solid";
125
126
  width: number;
126
127
  backgroundColor?: undefined;
127
128
  padding?: undefined;
128
129
  borderRadius?: undefined;
129
- position?: undefined;
130
130
  formatter?: undefined;
131
131
  } | {
132
132
  type?: undefined;
@@ -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;
@@ -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 {};