@visactor/react-vchart 1.9.0-alpha.0 → 1.9.0-alpha.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/cjs/VChart.d.ts +3 -1
- package/cjs/VChart.js +11 -3
- package/cjs/VChart.js.map +1 -1
- package/cjs/VChartSimple.d.ts +6 -0
- package/cjs/VChartSimple.js +10 -0
- package/cjs/VChartSimple.js.map +1 -0
- package/cjs/charts/AreaChart.d.ts +3 -1
- package/cjs/charts/AreaChart.js +11 -2
- package/cjs/charts/AreaChart.js.map +1 -1
- package/cjs/charts/BarChart.d.ts +3 -1
- package/cjs/charts/BarChart.js +11 -2
- package/cjs/charts/BarChart.js.map +1 -1
- package/cjs/charts/BaseChart.d.ts +5 -3
- package/cjs/charts/BaseChart.js +35 -43
- package/cjs/charts/BaseChart.js.map +1 -1
- package/cjs/charts/BoxPlotChart.d.ts +2 -0
- package/cjs/charts/BoxPlotChart.js +11 -2
- package/cjs/charts/BoxPlotChart.js.map +1 -1
- package/cjs/charts/CircularProgressChart.d.ts +2 -0
- package/cjs/charts/CircularProgressChart.js +11 -2
- package/cjs/charts/CircularProgressChart.js.map +1 -1
- package/cjs/charts/CommonChart.d.ts +2 -0
- package/cjs/charts/CommonChart.js +11 -2
- package/cjs/charts/CommonChart.js.map +1 -1
- package/cjs/charts/FunnelChart.d.ts +2 -0
- package/cjs/charts/FunnelChart.js +11 -2
- package/cjs/charts/FunnelChart.js.map +1 -1
- package/cjs/charts/HistogramChart.d.ts +2 -0
- package/cjs/charts/HistogramChart.js +11 -2
- package/cjs/charts/HistogramChart.js.map +1 -1
- package/cjs/charts/LineChart.d.ts +3 -1
- package/cjs/charts/LineChart.js +11 -2
- package/cjs/charts/LineChart.js.map +1 -1
- package/cjs/charts/LinearProgressChart.d.ts +2 -0
- package/cjs/charts/LinearProgressChart.js +11 -2
- package/cjs/charts/LinearProgressChart.js.map +1 -1
- package/cjs/charts/MapChart.d.ts +3 -1
- package/cjs/charts/MapChart.js +11 -2
- package/cjs/charts/MapChart.js.map +1 -1
- package/cjs/charts/PieChart.d.ts +3 -1
- package/cjs/charts/PieChart.js +11 -2
- package/cjs/charts/PieChart.js.map +1 -1
- package/cjs/charts/RadarChart.d.ts +3 -1
- package/cjs/charts/RadarChart.js +11 -2
- package/cjs/charts/RadarChart.js.map +1 -1
- package/cjs/charts/RangeColumnChart.d.ts +3 -1
- package/cjs/charts/RangeColumnChart.js +11 -2
- package/cjs/charts/RangeColumnChart.js.map +1 -1
- package/cjs/charts/RoseChart.d.ts +3 -1
- package/cjs/charts/RoseChart.js +11 -3
- package/cjs/charts/RoseChart.js.map +1 -1
- package/cjs/charts/ScatterChart.d.ts +3 -1
- package/cjs/charts/ScatterChart.js +12 -2
- package/cjs/charts/ScatterChart.js.map +1 -1
- package/cjs/charts/SequenceChart.d.ts +3 -1
- package/cjs/charts/SequenceChart.js +11 -2
- package/cjs/charts/SequenceChart.js.map +1 -1
- package/cjs/charts/WordCloudChart.d.ts +3 -1
- package/cjs/charts/WordCloudChart.js +11 -2
- package/cjs/charts/WordCloudChart.js.map +1 -1
- package/cjs/charts/index.js.map +1 -1
- package/cjs/components/Axis.js.map +1 -1
- package/cjs/components/BaseComponent.js.map +1 -1
- package/cjs/components/Brush.js.map +1 -1
- package/cjs/components/Crosshair.js.map +1 -1
- package/cjs/components/DataZoom.js.map +1 -1
- package/cjs/components/Indicator.js.map +1 -1
- package/cjs/components/Legend.js.map +1 -1
- package/cjs/components/Mark.js +1 -1
- package/cjs/components/Mark.js.map +1 -1
- package/cjs/components/MarkArea.js.map +1 -1
- package/cjs/components/MarkLine.js.map +1 -1
- package/cjs/components/MarkPoint.js.map +1 -1
- package/cjs/components/Player.js.map +1 -1
- package/cjs/components/Region.js +1 -2
- package/cjs/components/Region.js.map +1 -1
- package/cjs/components/ScrollBar.js +2 -1
- package/cjs/components/ScrollBar.js.map +1 -1
- package/cjs/components/Title.js.map +1 -1
- package/cjs/components/Tooltip.js.map +1 -1
- package/cjs/components/index.js.map +1 -1
- package/cjs/constants.js.map +1 -1
- package/cjs/containers/withContainer.js.map +1 -1
- package/cjs/context/chart.d.ts +2 -2
- package/cjs/context/chart.js.map +1 -1
- package/cjs/context/stage.d.ts +2 -2
- package/cjs/context/stage.js.map +1 -1
- package/cjs/context/view.js.map +1 -1
- package/cjs/eventsUtils.d.ts +2 -0
- package/cjs/eventsUtils.js +2 -1
- package/cjs/eventsUtils.js.map +1 -1
- package/cjs/index.d.ts +3 -3
- package/cjs/index.js +3 -10
- package/cjs/index.js.map +1 -1
- package/cjs/series/Area.d.ts +1 -1
- package/cjs/series/Area.js.map +1 -1
- package/cjs/series/Bar.d.ts +1 -1
- package/cjs/series/Bar.js.map +1 -1
- package/cjs/series/BaseSeries.js.map +1 -1
- package/cjs/series/BoxPlot.d.ts +1 -1
- package/cjs/series/BoxPlot.js.map +1 -1
- package/cjs/series/CircularProgress.d.ts +1 -1
- package/cjs/series/CircularProgress.js.map +1 -1
- package/cjs/series/Dot.d.ts +1 -1
- package/cjs/series/Dot.js.map +1 -1
- package/cjs/series/Funnel.d.ts +1 -1
- package/cjs/series/Funnel.js.map +1 -1
- package/cjs/series/Line.d.ts +1 -1
- package/cjs/series/Line.js.map +1 -1
- package/cjs/series/LinearProgress.d.ts +1 -1
- package/cjs/series/LinearProgress.js +1 -2
- package/cjs/series/LinearProgress.js.map +1 -1
- package/cjs/series/Link.d.ts +1 -1
- package/cjs/series/Link.js +2 -1
- package/cjs/series/Link.js.map +1 -1
- package/cjs/series/Map.d.ts +1 -1
- package/cjs/series/Map.js.map +1 -1
- package/cjs/series/Pie.d.ts +1 -1
- package/cjs/series/Pie.js.map +1 -1
- package/cjs/series/Radar.d.ts +1 -1
- package/cjs/series/Radar.js.map +1 -1
- package/cjs/series/RangeColumn.d.ts +1 -1
- package/cjs/series/RangeColumn.js.map +1 -1
- package/cjs/series/Rose.d.ts +1 -1
- package/cjs/series/Rose.js.map +1 -1
- package/cjs/series/Scatter.d.ts +1 -1
- package/cjs/series/Scatter.js.map +1 -1
- package/cjs/series/Series.d.ts +1 -1
- package/cjs/series/Series.js +1 -1
- package/cjs/series/Series.js.map +1 -1
- package/cjs/series/WordCloud.d.ts +1 -1
- package/cjs/series/WordCloud.js.map +1 -1
- package/cjs/series/index.js.map +1 -1
- package/cjs/util.js.map +1 -1
- package/esm/VChart.d.ts +3 -1
- package/esm/VChart.js +7 -1
- package/esm/VChart.js.map +1 -1
- package/esm/VChartSimple.d.ts +6 -0
- package/esm/VChartSimple.js +4 -0
- package/esm/VChartSimple.js.map +1 -0
- package/esm/charts/AreaChart.d.ts +3 -1
- package/esm/charts/AreaChart.js +6 -1
- package/esm/charts/AreaChart.js.map +1 -1
- package/esm/charts/BarChart.d.ts +3 -1
- package/esm/charts/BarChart.js +6 -1
- package/esm/charts/BarChart.js.map +1 -1
- package/esm/charts/BaseChart.d.ts +5 -3
- package/esm/charts/BaseChart.js +34 -44
- package/esm/charts/BaseChart.js.map +1 -1
- package/esm/charts/BoxPlotChart.d.ts +2 -0
- package/esm/charts/BoxPlotChart.js +6 -1
- package/esm/charts/BoxPlotChart.js.map +1 -1
- package/esm/charts/CircularProgressChart.d.ts +2 -0
- package/esm/charts/CircularProgressChart.js +6 -1
- package/esm/charts/CircularProgressChart.js.map +1 -1
- package/esm/charts/CommonChart.d.ts +2 -0
- package/esm/charts/CommonChart.js +6 -1
- package/esm/charts/CommonChart.js.map +1 -1
- package/esm/charts/FunnelChart.d.ts +2 -0
- package/esm/charts/FunnelChart.js +6 -1
- package/esm/charts/FunnelChart.js.map +1 -1
- package/esm/charts/HistogramChart.d.ts +2 -0
- package/esm/charts/HistogramChart.js +6 -1
- package/esm/charts/HistogramChart.js.map +1 -1
- package/esm/charts/LineChart.d.ts +3 -1
- package/esm/charts/LineChart.js +6 -1
- package/esm/charts/LineChart.js.map +1 -1
- package/esm/charts/LinearProgressChart.d.ts +2 -0
- package/esm/charts/LinearProgressChart.js +6 -1
- package/esm/charts/LinearProgressChart.js.map +1 -1
- package/esm/charts/MapChart.d.ts +3 -1
- package/esm/charts/MapChart.js +6 -1
- package/esm/charts/MapChart.js.map +1 -1
- package/esm/charts/PieChart.d.ts +3 -1
- package/esm/charts/PieChart.js +6 -1
- package/esm/charts/PieChart.js.map +1 -1
- package/esm/charts/RadarChart.d.ts +3 -1
- package/esm/charts/RadarChart.js +6 -1
- package/esm/charts/RadarChart.js.map +1 -1
- package/esm/charts/RangeColumnChart.d.ts +3 -1
- package/esm/charts/RangeColumnChart.js +6 -1
- package/esm/charts/RangeColumnChart.js.map +1 -1
- package/esm/charts/RoseChart.d.ts +3 -1
- package/esm/charts/RoseChart.js +6 -2
- package/esm/charts/RoseChart.js.map +1 -1
- package/esm/charts/ScatterChart.d.ts +3 -1
- package/esm/charts/ScatterChart.js +7 -1
- package/esm/charts/ScatterChart.js.map +1 -1
- package/esm/charts/SequenceChart.d.ts +3 -1
- package/esm/charts/SequenceChart.js +6 -1
- package/esm/charts/SequenceChart.js.map +1 -1
- package/esm/charts/WordCloudChart.d.ts +3 -1
- package/esm/charts/WordCloudChart.js +6 -1
- package/esm/charts/WordCloudChart.js.map +1 -1
- package/esm/charts/index.js.map +1 -1
- package/esm/components/Axis.js.map +1 -1
- package/esm/components/BaseComponent.js.map +1 -1
- package/esm/components/Brush.js.map +1 -1
- package/esm/components/Crosshair.js.map +1 -1
- package/esm/components/DataZoom.js.map +1 -1
- package/esm/components/Indicator.js.map +1 -1
- package/esm/components/Legend.js.map +1 -1
- package/esm/components/Mark.js +1 -1
- package/esm/components/Mark.js.map +1 -1
- package/esm/components/MarkArea.js.map +1 -1
- package/esm/components/MarkLine.js.map +1 -1
- package/esm/components/MarkPoint.js.map +1 -1
- package/esm/components/Player.js.map +1 -1
- package/esm/components/Region.js +1 -2
- package/esm/components/Region.js.map +1 -1
- package/esm/components/ScrollBar.js +2 -1
- package/esm/components/ScrollBar.js.map +1 -1
- package/esm/components/Title.js.map +1 -1
- package/esm/components/Tooltip.js.map +1 -1
- package/esm/components/index.js.map +1 -1
- package/esm/constants.js.map +1 -1
- package/esm/containers/withContainer.js.map +1 -1
- package/esm/context/chart.d.ts +2 -2
- package/esm/context/chart.js.map +1 -1
- package/esm/context/stage.d.ts +2 -2
- package/esm/context/stage.js.map +1 -1
- package/esm/context/view.js.map +1 -1
- package/esm/eventsUtils.d.ts +2 -0
- package/esm/eventsUtils.js +2 -1
- package/esm/eventsUtils.js.map +1 -1
- package/esm/index.d.ts +3 -3
- package/esm/index.js +2 -2
- package/esm/index.js.map +1 -1
- package/esm/series/Area.d.ts +1 -1
- package/esm/series/Area.js.map +1 -1
- package/esm/series/Bar.d.ts +1 -1
- package/esm/series/Bar.js.map +1 -1
- package/esm/series/BaseSeries.js.map +1 -1
- package/esm/series/BoxPlot.d.ts +1 -1
- package/esm/series/BoxPlot.js.map +1 -1
- package/esm/series/CircularProgress.d.ts +1 -1
- package/esm/series/CircularProgress.js.map +1 -1
- package/esm/series/Dot.d.ts +1 -1
- package/esm/series/Dot.js.map +1 -1
- package/esm/series/Funnel.d.ts +1 -1
- package/esm/series/Funnel.js.map +1 -1
- package/esm/series/Line.d.ts +1 -1
- package/esm/series/Line.js.map +1 -1
- package/esm/series/LinearProgress.d.ts +1 -1
- package/esm/series/LinearProgress.js +1 -2
- package/esm/series/LinearProgress.js.map +1 -1
- package/esm/series/Link.d.ts +1 -1
- package/esm/series/Link.js +2 -1
- package/esm/series/Link.js.map +1 -1
- package/esm/series/Map.d.ts +1 -1
- package/esm/series/Map.js.map +1 -1
- package/esm/series/Pie.d.ts +1 -1
- package/esm/series/Pie.js.map +1 -1
- package/esm/series/Radar.d.ts +1 -1
- package/esm/series/Radar.js.map +1 -1
- package/esm/series/RangeColumn.d.ts +1 -1
- package/esm/series/RangeColumn.js.map +1 -1
- package/esm/series/Rose.d.ts +1 -1
- package/esm/series/Rose.js.map +1 -1
- package/esm/series/Scatter.d.ts +1 -1
- package/esm/series/Scatter.js.map +1 -1
- package/esm/series/Series.d.ts +1 -1
- package/esm/series/Series.js +1 -1
- package/esm/series/Series.js.map +1 -1
- package/esm/series/WordCloud.d.ts +1 -1
- package/esm/series/WordCloud.js.map +1 -1
- package/esm/series/index.js.map +1 -1
- package/esm/util.js.map +1 -1
- package/package.json +9 -8
package/cjs/VChart.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { BaseChartProps } from './charts/BaseChart';
|
|
2
|
-
|
|
2
|
+
import VChartCore from '@visactor/vchart';
|
|
3
|
+
export { VChartCore };
|
|
4
|
+
export type VChartProps = Omit<BaseChartProps, 'container' | 'data' | 'width' | 'height' | 'type'>;
|
|
3
5
|
export declare const VChart: import("react").ForwardRefExoticComponent<VChartProps & import("./containers/withContainer").ContainerProps & import("react").RefAttributes<any>>;
|
package/cjs/VChart.js
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var __importDefault = this && this.__importDefault || function(mod) {
|
|
4
|
+
return mod && mod.__esModule ? mod : {
|
|
5
|
+
default: mod
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
|
|
3
9
|
Object.defineProperty(exports, "__esModule", {
|
|
4
10
|
value: !0
|
|
5
|
-
}), exports.VChart = void 0;
|
|
11
|
+
}), exports.VChart = exports.VChartCore = void 0;
|
|
6
12
|
|
|
7
|
-
const BaseChart_1 = require("./charts/BaseChart");
|
|
13
|
+
const BaseChart_1 = require("./charts/BaseChart"), vchart_1 = __importDefault(require("@visactor/vchart"));
|
|
8
14
|
|
|
9
|
-
exports.VChart = (0, BaseChart_1.createChart)("VChart"
|
|
15
|
+
exports.VChartCore = vchart_1.default, exports.VChart = (0, BaseChart_1.createChart)("VChart", {
|
|
16
|
+
vchartConstrouctor: vchart_1.default
|
|
17
|
+
});
|
package/cjs/VChart.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["VChart.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/VChart.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAAiE;AAEjE,8DAA0C;AACjC,qBADF,gBAAU,CACE;AAIN,QAAA,MAAM,GAAG,IAAA,uBAAW,EAAc,QAAQ,EAAE;IACvD,kBAAkB,EAAE,gBAAU;CAC/B,CAAC,CAAC","file":"VChart.js","sourcesContent":["import { BaseChartProps, createChart } from './charts/BaseChart';\nimport type { IVChartConstructor } from '@visactor/vchart';\nimport VChartCore from '@visactor/vchart';\nexport { VChartCore };\n\nexport type VChartProps = Omit<BaseChartProps, 'container' | 'data' | 'width' | 'height' | 'type'>;\n\nexport const VChart = createChart<VChartProps>('VChart', {\n vchartConstrouctor: VChartCore\n});\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { IVChartConstructor } from '@visactor/vchart';
|
|
2
|
+
import { BaseChartProps } from './charts/BaseChart';
|
|
3
|
+
export type VChartSimpleProps = Omit<BaseChartProps, 'container' | 'data' | 'width' | 'height' | 'vchartConstrouctor'>;
|
|
4
|
+
export declare const VChartSimple: import("react").ForwardRefExoticComponent<VChartSimpleProps & {
|
|
5
|
+
vchartConstrouctor: IVChartConstructor;
|
|
6
|
+
} & import("./containers/withContainer").ContainerProps & import("react").RefAttributes<any>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
}), exports.VChartSimple = void 0;
|
|
6
|
+
|
|
7
|
+
const BaseChart_1 = require("./charts/BaseChart");
|
|
8
|
+
|
|
9
|
+
exports.VChartSimple = (0, BaseChart_1.createChart)("VChartSimple");
|
|
10
|
+
//# sourceMappingURL=VChartSimple.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/VChartSimple.tsx"],"names":[],"mappings":";;;AACA,kDAAiE;AAIpD,QAAA,YAAY,GAAG,IAAA,uBAAW,EAAiE,cAAc,CAAC,CAAC","file":"VChartSimple.js","sourcesContent":["import type { IVChartConstructor } from '@visactor/vchart';\nimport { BaseChartProps, createChart } from './charts/BaseChart';\n\nexport type VChartSimpleProps = Omit<BaseChartProps, 'container' | 'data' | 'width' | 'height' | 'vchartConstrouctor'>;\n\nexport const VChartSimple = createChart<VChartSimpleProps & { vchartConstrouctor: IVChartConstructor }>('VChartSimple');\n"]}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { IAreaChartSpec } from '@visactor/vchart';
|
|
2
|
+
import type { IAreaChartSpec } from '@visactor/vchart';
|
|
3
3
|
import { BaseChartProps } from './BaseChart';
|
|
4
4
|
export interface AreaChartProps extends Omit<BaseChartProps, 'spec' | 'container' | 'type'>, Omit<IAreaChartSpec, 'type'> {
|
|
5
5
|
}
|
|
6
6
|
export declare const AreaChart: React.ForwardRefExoticComponent<AreaChartProps & {
|
|
7
7
|
children?: React.ReactNode;
|
|
8
|
+
} & {
|
|
9
|
+
type: 'area';
|
|
8
10
|
} & import("../containers/withContainer").ContainerProps & React.RefAttributes<any>>;
|
package/cjs/charts/AreaChart.js
CHANGED
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var __importDefault = this && this.__importDefault || function(mod) {
|
|
4
|
+
return mod && mod.__esModule ? mod : {
|
|
5
|
+
default: mod
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
|
|
3
9
|
Object.defineProperty(exports, "__esModule", {
|
|
4
10
|
value: !0
|
|
5
11
|
}), exports.AreaChart = void 0;
|
|
6
12
|
|
|
7
|
-
const BaseChart_1 = require("./BaseChart");
|
|
13
|
+
const vchart_1 = __importDefault(require("@visactor/vchart")), BaseChart_1 = require("./BaseChart");
|
|
8
14
|
|
|
9
|
-
exports.AreaChart = (0, BaseChart_1.createChart)("AreaChart",
|
|
15
|
+
exports.AreaChart = (0, BaseChart_1.createChart)("AreaChart", {
|
|
16
|
+
type: "area",
|
|
17
|
+
vchartConstrouctor: vchart_1.default
|
|
18
|
+
});
|
|
10
19
|
//# sourceMappingURL=AreaChart.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["charts/AreaChart.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/charts/AreaChart.tsx"],"names":[],"mappings":";;;;;;AAEA,8DAAqD;AACrD,2CAA0D;AAM7C,QAAA,SAAS,GAAG,IAAA,uBAAW,EAA6D,WAAW,EAAE;IAC5G,IAAI,EAAE,MAAM;IACZ,kBAAkB,EAAE,gBAAM;CAC3B,CAAC,CAAC","file":"AreaChart.js","sourcesContent":["import React from 'react';\nimport type { IAreaChartSpec } from '@visactor/vchart';\nimport { default as VChart } from '@visactor/vchart';\nimport { BaseChartProps, createChart } from './BaseChart';\n\nexport interface AreaChartProps\n extends Omit<BaseChartProps, 'spec' | 'container' | 'type'>,\n Omit<IAreaChartSpec, 'type'> {}\n\nexport const AreaChart = createChart<React.PropsWithChildren<AreaChartProps> & { type: 'area' }>('AreaChart', {\n type: 'area',\n vchartConstrouctor: VChart\n});\n"]}
|
package/cjs/charts/BarChart.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { IBarChartSpec } from '@visactor/vchart';
|
|
2
|
+
import type { IBarChartSpec } from '@visactor/vchart';
|
|
3
3
|
import { BaseChartProps } from './BaseChart';
|
|
4
4
|
export interface BarChartProps extends Omit<BaseChartProps, 'spec' | 'container' | 'type'>, Omit<IBarChartSpec, 'type'> {
|
|
5
5
|
}
|
|
6
6
|
export declare const BarChart: React.ForwardRefExoticComponent<BarChartProps & {
|
|
7
7
|
children?: React.ReactNode;
|
|
8
|
+
} & {
|
|
9
|
+
type: 'bar';
|
|
8
10
|
} & import("../containers/withContainer").ContainerProps & React.RefAttributes<any>>;
|
package/cjs/charts/BarChart.js
CHANGED
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var __importDefault = this && this.__importDefault || function(mod) {
|
|
4
|
+
return mod && mod.__esModule ? mod : {
|
|
5
|
+
default: mod
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
|
|
3
9
|
Object.defineProperty(exports, "__esModule", {
|
|
4
10
|
value: !0
|
|
5
11
|
}), exports.BarChart = void 0;
|
|
6
12
|
|
|
7
|
-
const BaseChart_1 = require("./BaseChart");
|
|
13
|
+
const vchart_1 = __importDefault(require("@visactor/vchart")), BaseChart_1 = require("./BaseChart");
|
|
8
14
|
|
|
9
|
-
exports.BarChart = (0, BaseChart_1.createChart)("BarChart",
|
|
15
|
+
exports.BarChart = (0, BaseChart_1.createChart)("BarChart", {
|
|
16
|
+
type: "bar",
|
|
17
|
+
vchartConstrouctor: vchart_1.default
|
|
18
|
+
});
|
|
10
19
|
//# sourceMappingURL=BarChart.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["charts/BarChart.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/charts/BarChart.tsx"],"names":[],"mappings":";;;;;;AAEA,8DAAqD;AACrD,2CAA0D;AAQ7C,QAAA,QAAQ,GAAG,IAAA,uBAAW,EAA2D,UAAU,EAAE;IACxG,IAAI,EAAE,KAAK;IACX,kBAAkB,EAAE,gBAAM;CAC3B,CAAC,CAAC","file":"BarChart.js","sourcesContent":["import React from 'react';\nimport type { IBarChartSpec } from '@visactor/vchart';\nimport { default as VChart } from '@visactor/vchart';\nimport { BaseChartProps, createChart } from './BaseChart';\n\nexport interface BarChartProps\n extends Omit<BaseChartProps, 'spec' | 'container' | 'type'>,\n Omit<IBarChartSpec, 'type'> {\n //\n}\n\nexport const BarChart = createChart<React.PropsWithChildren<BarChartProps> & { type: 'bar' }>('BarChart', {\n type: 'bar',\n vchartConstrouctor: VChart\n});\n"]}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { IVChart, IData, IInitOption, ISpec, IVChartConstructor } from '@visactor/vchart';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { ContainerProps } from '../containers/withContainer';
|
|
4
4
|
import { EventsProps, LegendEventProps, ScrollBarEventProps, BrushEventProps, DataZoomEventProps, PlayerEventProps, DimensionEventProps, HierarchyEventProps, ChartLifeCycleEventProps } from '../eventsUtils';
|
|
5
5
|
export type ChartOptions = Omit<IInitOption, 'dom'>;
|
|
6
6
|
export interface BaseChartProps extends EventsProps, LegendEventProps, ScrollBarEventProps, BrushEventProps, DataZoomEventProps, PlayerEventProps, DimensionEventProps, HierarchyEventProps, ChartLifeCycleEventProps {
|
|
7
|
+
vchartConstrouctor?: IVChartConstructor;
|
|
7
8
|
type?: string;
|
|
8
9
|
container?: HTMLDivElement;
|
|
9
10
|
spec?: ISpec;
|
|
@@ -12,9 +13,10 @@ export interface BaseChartProps extends EventsProps, LegendEventProps, ScrollBar
|
|
|
12
13
|
height?: number;
|
|
13
14
|
options?: ChartOptions;
|
|
14
15
|
skipFunctionDiff?: boolean;
|
|
15
|
-
onReady?: (instance:
|
|
16
|
+
onReady?: (instance: IVChart, isInitial: boolean) => void;
|
|
16
17
|
onError?: (err: Error) => void;
|
|
18
|
+
useSyncRender?: boolean;
|
|
17
19
|
}
|
|
18
20
|
type Props = React.PropsWithChildren<BaseChartProps>;
|
|
19
|
-
export declare const createChart: <T extends Props>(componentName: string,
|
|
21
|
+
export declare const createChart: <T extends Props>(componentName: string, defaultProps?: Partial<T>, callback?: (props: T, defaultProps?: Partial<T>) => T) => React.ForwardRefExoticComponent<React.PropsWithoutRef<T & ContainerProps> & React.RefAttributes<any>>;
|
|
20
22
|
export {};
|
package/cjs/charts/BaseChart.js
CHANGED
|
@@ -33,61 +33,56 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
33
33
|
value: !0
|
|
34
34
|
}), exports.createChart = void 0;
|
|
35
35
|
|
|
36
|
-
const
|
|
36
|
+
const react_1 = __importStar(require("react")), withContainer_1 = __importDefault(require("../containers/withContainer")), chart_1 = __importDefault(require("../context/chart")), vutils_1 = require("@visactor/vutils"), view_1 = __importDefault(require("../context/view")), util_1 = require("../util"), constants_1 = require("../constants"), eventsUtils_1 = require("../eventsUtils"), notSpecKeys = [ ...constants_1.REACT_PRIVATE_PROPS, ...eventsUtils_1.CHART_EVENTS_KEYS, "skipFunctionDiff", "onError", "onReady", "spec", "container", "options" ], BaseChart = react_1.default.forwardRef(((props, ref) => {
|
|
37
37
|
const [updateId, setUpdateId] = (0, react_1.useState)(0), chartContext = (0, react_1.useRef)({
|
|
38
38
|
specFromChildren: {}
|
|
39
39
|
});
|
|
40
|
-
(0, react_1.useImperativeHandle)(ref, (() =>
|
|
40
|
+
(0, react_1.useImperativeHandle)(ref, (() => {
|
|
41
|
+
var _a;
|
|
42
|
+
return null === (_a = chartContext.current) || void 0 === _a ? void 0 : _a.chart;
|
|
43
|
+
}));
|
|
41
44
|
const hasSpec = !!props.spec, [view, setView] = (0, react_1.useState)(null), isUnmount = (0,
|
|
42
|
-
react_1.useRef)(!1), prevSpec = (0, react_1.useRef)((0, vutils_1.pickWithout)(props, notSpecKeys)), eventsBinded = react_1.default.useRef(null), skipFunctionDiff = !!props.skipFunctionDiff, parseSpec = props =>
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
react_1.useRef)(!1), prevSpec = (0, react_1.useRef)((0, vutils_1.pickWithout)(props, notSpecKeys)), eventsBinded = react_1.default.useRef(null), skipFunctionDiff = !!props.skipFunctionDiff, parseSpec = props => {
|
|
46
|
+
var _a;
|
|
47
|
+
return hasSpec && props.spec ? props.spec : Object.assign(Object.assign({}, prevSpec.current), null === (_a = chartContext.current) || void 0 === _a ? void 0 : _a.specFromChildren);
|
|
48
|
+
}, handleChartRender = () => {
|
|
49
|
+
if (!isUnmount.current) {
|
|
50
|
+
if (!chartContext.current || !chartContext.current.chart) return;
|
|
51
|
+
(0, eventsUtils_1.bindEventsToChart)(chartContext.current.chart, props, eventsBinded.current, eventsUtils_1.CHART_EVENTS);
|
|
52
|
+
const newView = chartContext.current.chart.getCompiler().getVGrammarView();
|
|
53
|
+
setUpdateId(updateId + 1), props.onReady && props.onReady(chartContext.current.chart, 0 === updateId),
|
|
54
|
+
setView(newView);
|
|
55
|
+
}
|
|
47
56
|
};
|
|
48
57
|
return (0, react_1.useEffect)((() => {
|
|
49
|
-
|
|
50
|
-
|
|
58
|
+
var _a;
|
|
59
|
+
if (!(null === (_a = chartContext.current) || void 0 === _a ? void 0 : _a.chart)) return (props => {
|
|
60
|
+
const cs = new props.vchartConstrouctor(parseSpec(props), Object.assign(Object.assign({}, props.options), {
|
|
61
|
+
onError: props.onError,
|
|
51
62
|
autoFit: !0,
|
|
52
63
|
dom: props.container
|
|
53
64
|
}));
|
|
54
65
|
chartContext.current = Object.assign(Object.assign({}, chartContext.current), {
|
|
55
66
|
chart: cs
|
|
56
67
|
});
|
|
57
|
-
})(props), (()
|
|
58
|
-
|
|
59
|
-
const renderPromise = chartContext.current.chart.renderAsync().then(handleChartRender);
|
|
60
|
-
props.onError && renderPromise.catch(props.onError);
|
|
61
|
-
}
|
|
62
|
-
})(), (0, eventsUtils_1.bindEventsToChart)(chartContext.current.chart, props, null, eventsUtils_1.CHART_EVENTS),
|
|
68
|
+
})(props), chartContext.current.chart && (chartContext.current.chart.renderSync(),
|
|
69
|
+
handleChartRender()), (0, eventsUtils_1.bindEventsToChart)(chartContext.current.chart, props, null, eventsUtils_1.CHART_EVENTS),
|
|
63
70
|
chartContext.current = Object.assign(Object.assign({}, chartContext.current), {
|
|
64
71
|
isChildrenUpdated: !1
|
|
65
72
|
}), void (eventsBinded.current = props);
|
|
66
|
-
if (hasSpec) {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
morph: !1,
|
|
73
|
-
enableExitAnimation: !1
|
|
74
|
-
}).then(handleChartRender);
|
|
75
|
-
props.onError && updatePromise.catch(props.onError);
|
|
76
|
-
}
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
73
|
+
if (hasSpec) return void ((0, vutils_1.isEqual)(eventsBinded.current.spec, props.spec, {
|
|
74
|
+
skipFunction: skipFunctionDiff
|
|
75
|
+
}) || (eventsBinded.current = props, chartContext.current.chart.updateSpecSync(parseSpec(props), void 0, {
|
|
76
|
+
morph: !1,
|
|
77
|
+
enableExitAnimation: !1
|
|
78
|
+
}), handleChartRender()));
|
|
79
79
|
const newSpec = (0, vutils_1.pickWithout)(props, notSpecKeys);
|
|
80
|
-
|
|
80
|
+
(0, vutils_1.isEqual)(newSpec, prevSpec.current, {
|
|
81
81
|
skipFunction: skipFunctionDiff
|
|
82
|
-
}) || chartContext.current.
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
enableExitAnimation: !1
|
|
87
|
-
}).then(handleChartRender);
|
|
88
|
-
props.onError && updatePromise.catch(props.onError);
|
|
89
|
-
}
|
|
90
|
-
chartContext.current = Object.assign(Object.assign({}, chartContext.current), {
|
|
82
|
+
}) && !chartContext.current.isChildrenUpdated || (prevSpec.current = newSpec, chartContext.current.chart.updateSpecSync(parseSpec(props), void 0, {
|
|
83
|
+
morph: !1,
|
|
84
|
+
enableExitAnimation: !1
|
|
85
|
+
}), handleChartRender()), chartContext.current = Object.assign(Object.assign({}, chartContext.current), {
|
|
91
86
|
isChildrenUpdated: !1
|
|
92
87
|
});
|
|
93
88
|
}), [ props ]), (0, react_1.useEffect)((() => () => {
|
|
@@ -105,11 +100,8 @@ const vchart_1 = __importDefault(require("@visactor/vchart")), react_1 = __impor
|
|
|
105
100
|
updateId: updateId
|
|
106
101
|
}));
|
|
107
102
|
}))));
|
|
108
|
-
})), createChart = (componentName,
|
|
109
|
-
const Com = (0, withContainer_1.default)(BaseChart, componentName, (props => (props
|
|
110
|
-
callback ? callback(props) : type ? Object.assign(Object.assign({}, props), {
|
|
111
|
-
type: type
|
|
112
|
-
}) : props)));
|
|
103
|
+
})), createChart = (componentName, defaultProps, callback) => {
|
|
104
|
+
const Com = (0, withContainer_1.default)(BaseChart, componentName, (props => callback ? callback(props, defaultProps) : defaultProps ? Object.assign(props, defaultProps) : props));
|
|
113
105
|
return Com.displayName = componentName, Com;
|
|
114
106
|
};
|
|
115
107
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["charts/BaseChart.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8DAAqE;AACrE,+CAAgF;AAChF,gFAA4E;AAC5E,6DAAsE;AAEtE,6CAAwD;AACxD,2DAA0C;AAC1C,kCAAkC;AAClC,4CAAmD;AAEnD,gDAawB;AAuCxB,MAAM,WAAW,GAAG;IAClB,GAAG,+BAAmB;IACtB,GAAG,+BAAiB;IACpB,kBAAkB;IAClB,SAAS;IACT,SAAS;IACT,MAAM;IACN,WAAW;IACX,SAAS;CACV,CAAC;AAEF,MAAM,SAAS,GAAoB,eAAK,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACjE,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,IAAA,gBAAQ,EAAS,CAAC,CAAC,CAAC;IACpD,MAAM,YAAY,GAAG,IAAA,cAAM,EAAmB;QAC5C,gBAAgB,EAAE,EAAE;KACrB,CAAC,CAAC;IACH,IAAA,2BAAmB,EAAC,GAAG,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC3D,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC;IAC7B,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,IAAA,gBAAQ,EAAQ,IAAI,CAAC,CAAC;IAC9C,MAAM,SAAS,GAAG,IAAA,cAAM,EAAU,KAAK,CAAC,CAAC;IACzC,MAAM,QAAQ,GAAG,IAAA,cAAM,EAAC,IAAA,oBAAW,EAAC,KAAK,EAAE,W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ACpD,8BAAC,cAAW,CAAC,QAAQ,IAAC,KAAK,EAAE,IAAI,IAC9B,IAAA,cAAO,EAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;;YAC5C,OAAO,CACL,8BAAC,eAAK,CAAC,QAAQ,IAAC,GAAG,EAAE,MAAA,MAAA,MAAC,KAAa,aAAb,KAAK,uBAAL,KAAK,CAAU,KAAK,0CAAE,EAAE,mCAAK,KAAa,aAAb,KAAK,uBAAL,KAAK,CAAU,EAAE,mCAAI,SAAS,KAAK,EAAE,IACrF,eAAK,CAAC,YAAY,CAAC,KAAqB,EAAE;gBACzC,QAAQ,EAAE,QAAQ;aACnB,CAAC,CACa,CAClB,CAAC;QACJ,CAAC,CAAC,CACmB,CACG,CAC7B,CAAC;AACJ,CAAC,CAAC,CAAC;AAEI,MAAM,WAAW,GAAG,CAAkB,aAAqB,EAAE,IAAa,EAAE,QAA0B,EAAE,EAAE;IAC/G,MAAM,GAAG,GAAG,IAAA,uBAAa,EAAoB,SAAgB,EAAE,aAAa,EAAE,CAAC,KAAQ,EAAE,EAAE;QACzF,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC;QAElB,IAAI,QAAQ,EAAE;YACZ,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC;SACxB;QAED,IAAI,IAAI,EAAE;YACR,uCAAY,KAAK,KAAE,IAAI,IAAG;SAC3B;QACD,OAAO,KAAK,CAAC;IACf,CAAC,CAAC,CAAC;IACH,GAAG,CAAC,WAAW,GAAG,aAAa,CAAC;IAChC,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AAfW,QAAA,WAAW,eAetB","file":"BaseChart.js","sourcesContent":["import VChart, { IData, IInitOption, ISpec } from '@visactor/vchart';\nimport React, { useState, useEffect, useRef, useImperativeHandle } from 'react';\nimport withContainer, { ContainerProps } from '../containers/withContainer';\nimport RootChartContext, { ChartContextType } from '../context/chart';\nimport type { IView } from '@visactor/vgrammar-core';\nimport { isEqual, pickWithout } from '@visactor/vutils';\nimport ViewContext from '../context/view';\nimport { toArray } from '../util';\nimport { REACT_PRIVATE_PROPS } from '../constants';\nimport { IMarkElement } from '../components';\nimport {\n bindEventsToChart,\n EventsProps,\n CHART_EVENTS_KEYS,\n CHART_EVENTS,\n LegendEventProps,\n ScrollBarEventProps,\n BrushEventProps,\n DataZoomEventProps,\n PlayerEventProps,\n DimensionEventProps,\n HierarchyEventProps,\n ChartLifeCycleEventProps\n} from '../eventsUtils';\n\nexport type ChartOptions = Omit<IInitOption, 'dom'>;\n\nexport interface BaseChartProps\n extends EventsProps,\n LegendEventProps,\n ScrollBarEventProps,\n BrushEventProps,\n DataZoomEventProps,\n PlayerEventProps,\n DimensionEventProps,\n HierarchyEventProps,\n ChartLifeCycleEventProps {\n type?: string;\n /** 上层container */\n container?: HTMLDivElement;\n /**\n * used only by <VChart />\n */\n spec?: ISpec;\n /** 数据 */\n data?: IData;\n /** 画布宽度 */\n width?: number;\n /** 画布高度 */\n height?: number;\n /** 图表配置 */\n options?: ChartOptions;\n /** skip function diff when component update */\n skipFunctionDiff?: boolean;\n /** 图表渲染完成事件 */\n onReady?: (instance: VChart, isInitial: boolean) => void;\n /** throw error when chart run into an error */\n onError?: (err: Error) => void;\n}\n\ntype Props = React.PropsWithChildren<BaseChartProps>;\n\nconst notSpecKeys = [\n ...REACT_PRIVATE_PROPS,\n ...CHART_EVENTS_KEYS,\n 'skipFunctionDiff',\n 'onError',\n 'onReady',\n 'spec',\n 'container',\n 'options'\n];\n\nconst BaseChart: React.FC<Props> = React.forwardRef((props, ref) => {\n const [updateId, setUpdateId] = useState<number>(0);\n const chartContext = useRef<ChartContextType>({\n specFromChildren: {}\n });\n useImperativeHandle(ref, () => chartContext.current.chart);\n const hasSpec = !!props.spec;\n const [view, setView] = useState<IView>(null);\n const isUnmount = useRef<boolean>(false);\n const prevSpec = useRef(pickWithout(props, notSpecKeys));\n const eventsBinded = React.useRef<BaseChartProps>(null);\n const skipFunctionDiff = !!props.skipFunctionDiff;\n\n const parseSpec = (props: Props) => {\n if (hasSpec && props.spec) {\n return props.spec;\n }\n\n return {\n ...prevSpec.current,\n ...chartContext.current.specFromChildren\n };\n };\n\n const createChart = (props: Props) => {\n const cs = new VChart(parseSpec(props), {\n ...props.options,\n autoFit: true,\n dom: props.container\n });\n chartContext.current = { ...chartContext.current, chart: cs };\n };\n\n const handleChartRender = () => {\n // rebind events after render\n bindEventsToChart(chartContext.current.chart, props, eventsBinded.current, CHART_EVENTS);\n\n const newView = chartContext.current.chart.getCompiler().getVGrammarView();\n if (!isUnmount.current) {\n setUpdateId(updateId + 1);\n if (props.onReady) {\n props.onReady(chartContext.current.chart, updateId === 0);\n }\n }\n setView(newView);\n };\n\n const renderChart = () => {\n if (chartContext.current.chart) {\n // eslint-disable-next-line promise/catch-or-return\n const renderPromise = chartContext.current.chart.renderAsync().then(handleChartRender);\n\n if (props.onError) {\n renderPromise.catch(props.onError);\n }\n }\n };\n\n useEffect(() => {\n if (!chartContext.current.chart) {\n createChart(props);\n renderChart();\n bindEventsToChart(chartContext.current.chart, props, null, CHART_EVENTS);\n chartContext.current = {\n ...chartContext.current,\n isChildrenUpdated: false\n };\n eventsBinded.current = props;\n return;\n }\n\n if (hasSpec) {\n if (!isEqual(eventsBinded.current.spec, props.spec, { skipFunction: skipFunctionDiff })) {\n eventsBinded.current = props;\n // eslint-disable-next-line promise/catch-or-return\n const updatePromise = chartContext.current.chart\n .updateSpec(parseSpec(props), undefined, { morph: false, enableExitAnimation: false }) // morph临时关掉\n .then(handleChartRender);\n\n if (props.onError) {\n updatePromise.catch(props.onError);\n }\n }\n return;\n }\n\n const newSpec = pickWithout(props, notSpecKeys);\n\n if (\n !isEqual(newSpec, prevSpec.current, { skipFunction: skipFunctionDiff }) ||\n chartContext.current.isChildrenUpdated\n ) {\n prevSpec.current = newSpec;\n // eslint-disable-next-line promise/catch-or-return\n const updatePromise = chartContext.current.chart\n .updateSpec(parseSpec(props), undefined, { morph: false, enableExitAnimation: false }) // morph临时关掉\n .then(handleChartRender);\n\n if (props.onError) {\n updatePromise.catch(props.onError);\n }\n }\n chartContext.current = {\n ...chartContext.current,\n isChildrenUpdated: false\n };\n }, [props]);\n\n useEffect(() => {\n return () => {\n if (chartContext) {\n if (chartContext.current.chart) {\n chartContext.current.chart.release();\n }\n chartContext.current = null;\n }\n isUnmount.current = true;\n };\n }, []);\n\n return (\n <RootChartContext.Provider value={chartContext.current}>\n <ViewContext.Provider value={view}>\n {toArray(props.children).map((child, index) => {\n return (\n <React.Fragment key={(child as any)?.props?.id ?? (child as any)?.id ?? `child-${index}`}>\n {React.cloneElement(child as IMarkElement, {\n updateId: updateId\n })}\n </React.Fragment>\n );\n })}\n </ViewContext.Provider>\n </RootChartContext.Provider>\n );\n});\n\nexport const createChart = <T extends Props>(componentName: string, type?: string, callback?: (props: T) => T) => {\n const Com = withContainer<ContainerProps, T>(BaseChart as any, componentName, (props: T) => {\n props.type = type;\n\n if (callback) {\n return callback(props);\n }\n\n if (type) {\n return { ...props, type };\n }\n return props;\n });\n Com.displayName = componentName;\n return Com;\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/charts/BaseChart.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,+CAAgF;AAChF,gFAA4E;AAC5E,6DAAsE;AAEtE,6CAAwD;AACxD,2DAA0C;AAC1C,kCAAkC;AAClC,4CAAmD;AAEnD,gDAawB;AA+CxB,MAAM,WAAW,GAAG;IAClB,GAAG,+BAAmB;IACtB,GAAG,+BAAiB;IACpB,kBAAkB;IAClB,SAAS;IACT,SAAS;IACT,MAAM;IACN,WAAW;IACX,SAAS;CACV,CAAC;AAEF,MAAM,SAAS,GAAoB,eAAK,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACjE,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,IAAA,gBAAQ,EAAS,CAAC,CAAC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CAAC;IACH,GAAG,CAAC,WAAW,GAAG,aAAa,CAAC;IAChC,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AAjBW,QAAA,WAAW,eAiBtB","file":"BaseChart.js","sourcesContent":["import type { IVChart, IData, IInitOption, ISpec, IVChartConstructor } from '@visactor/vchart';\nimport React, { useState, useEffect, useRef, useImperativeHandle } from 'react';\nimport withContainer, { ContainerProps } from '../containers/withContainer';\nimport RootChartContext, { ChartContextType } from '../context/chart';\nimport type { IView } from '@visactor/vgrammar-core';\nimport { isEqual, pickWithout } from '@visactor/vutils';\nimport ViewContext from '../context/view';\nimport { toArray } from '../util';\nimport { REACT_PRIVATE_PROPS } from '../constants';\nimport { IMarkElement } from '../components';\nimport {\n bindEventsToChart,\n EventsProps,\n CHART_EVENTS_KEYS,\n CHART_EVENTS,\n LegendEventProps,\n ScrollBarEventProps,\n BrushEventProps,\n DataZoomEventProps,\n PlayerEventProps,\n DimensionEventProps,\n HierarchyEventProps,\n ChartLifeCycleEventProps\n} from '../eventsUtils';\n\nexport type ChartOptions = Omit<IInitOption, 'dom'>;\n\nexport interface BaseChartProps\n extends EventsProps,\n LegendEventProps,\n ScrollBarEventProps,\n BrushEventProps,\n DataZoomEventProps,\n PlayerEventProps,\n DimensionEventProps,\n HierarchyEventProps,\n ChartLifeCycleEventProps {\n vchartConstrouctor?: IVChartConstructor;\n type?: string;\n /** 上层container */\n container?: HTMLDivElement;\n /**\n * used only by <VChart />\n */\n spec?: ISpec;\n /** 数据 */\n data?: IData;\n /** 画布宽度 */\n width?: number;\n /** 画布高度 */\n height?: number;\n /** 图表配置 */\n options?: ChartOptions;\n /** skip function diff when component update */\n skipFunctionDiff?: boolean;\n /** 图表渲染完成事件 */\n onReady?: (instance: IVChart, isInitial: boolean) => void;\n /** throw error when chart run into an error */\n onError?: (err: Error) => void;\n /**\n * use sync render\n *\n * @since 1.8.3\n * @deprecated 1.9.0\n **/\n useSyncRender?: boolean;\n}\n\ntype Props = React.PropsWithChildren<BaseChartProps>;\n\nconst notSpecKeys = [\n ...REACT_PRIVATE_PROPS,\n ...CHART_EVENTS_KEYS,\n 'skipFunctionDiff',\n 'onError',\n 'onReady',\n 'spec',\n 'container',\n 'options'\n];\n\nconst BaseChart: React.FC<Props> = React.forwardRef((props, ref) => {\n const [updateId, setUpdateId] = useState<number>(0);\n const chartContext = useRef<ChartContextType>({\n specFromChildren: {}\n });\n useImperativeHandle(ref, () => chartContext.current?.chart);\n const hasSpec = !!props.spec;\n const [view, setView] = useState<IView>(null);\n const isUnmount = useRef<boolean>(false);\n const prevSpec = useRef(pickWithout(props, notSpecKeys));\n const eventsBinded = React.useRef<BaseChartProps>(null);\n const skipFunctionDiff = !!props.skipFunctionDiff;\n\n const parseSpec = (props: Props) => {\n if (hasSpec && props.spec) {\n return props.spec;\n }\n\n return {\n ...prevSpec.current,\n ...chartContext.current?.specFromChildren\n };\n };\n\n const createChart = (props: Props) => {\n const cs = new props.vchartConstrouctor(parseSpec(props), {\n ...props.options,\n onError: props.onError,\n autoFit: true,\n dom: props.container\n });\n chartContext.current = { ...chartContext.current, chart: cs };\n };\n\n const handleChartRender = () => {\n // rebind events after render\n if (!isUnmount.current) {\n if (!chartContext.current || !chartContext.current.chart) {\n return;\n }\n\n bindEventsToChart(chartContext.current.chart, props, eventsBinded.current, CHART_EVENTS);\n\n const newView = chartContext.current.chart.getCompiler().getVGrammarView();\n\n setUpdateId(updateId + 1);\n if (props.onReady) {\n props.onReady(chartContext.current.chart, updateId === 0);\n }\n setView(newView);\n }\n };\n\n const renderChart = () => {\n if (chartContext.current.chart) {\n chartContext.current.chart.renderSync();\n handleChartRender();\n }\n };\n\n useEffect(() => {\n if (!chartContext.current?.chart) {\n createChart(props);\n renderChart();\n bindEventsToChart(chartContext.current.chart, props, null, CHART_EVENTS);\n chartContext.current = {\n ...chartContext.current,\n isChildrenUpdated: false\n };\n eventsBinded.current = props;\n return;\n }\n\n if (hasSpec) {\n if (!isEqual(eventsBinded.current.spec, props.spec, { skipFunction: skipFunctionDiff })) {\n eventsBinded.current = props;\n chartContext.current.chart.updateSpecSync(parseSpec(props), undefined, {\n morph: false,\n enableExitAnimation: false\n });\n handleChartRender();\n }\n return;\n }\n\n const newSpec = pickWithout(props, notSpecKeys);\n\n if (\n !isEqual(newSpec, prevSpec.current, { skipFunction: skipFunctionDiff }) ||\n chartContext.current.isChildrenUpdated\n ) {\n prevSpec.current = newSpec;\n\n chartContext.current.chart.updateSpecSync(parseSpec(props), undefined, {\n morph: false,\n enableExitAnimation: false\n });\n handleChartRender();\n }\n chartContext.current = {\n ...chartContext.current,\n isChildrenUpdated: false\n };\n }, [props]);\n\n useEffect(() => {\n return () => {\n if (chartContext) {\n if (chartContext.current.chart) {\n chartContext.current.chart.release();\n }\n chartContext.current = null;\n }\n isUnmount.current = true;\n };\n }, []);\n\n return (\n <RootChartContext.Provider value={chartContext.current}>\n <ViewContext.Provider value={view}>\n {toArray(props.children).map((child, index) => {\n return (\n <React.Fragment key={(child as any)?.props?.id ?? (child as any)?.id ?? `child-${index}`}>\n {React.cloneElement(child as IMarkElement, {\n updateId: updateId\n })}\n </React.Fragment>\n );\n })}\n </ViewContext.Provider>\n </RootChartContext.Provider>\n );\n});\n\nexport const createChart = <T extends Props>(\n componentName: string,\n defaultProps?: Partial<T>,\n callback?: (props: T, defaultProps?: Partial<T>) => T\n) => {\n const Com = withContainer<ContainerProps, T>(BaseChart as any, componentName, (props: T) => {\n if (callback) {\n return callback(props, defaultProps);\n }\n\n if (defaultProps) {\n return Object.assign(props, defaultProps);\n }\n return props;\n });\n Com.displayName = componentName;\n return Com;\n};\n"]}
|
|
@@ -5,4 +5,6 @@ export interface BoxPlotChartProps extends Omit<BaseChartProps, 'spec' | 'contai
|
|
|
5
5
|
}
|
|
6
6
|
export declare const BoxPlotChart: React.ForwardRefExoticComponent<BoxPlotChartProps & {
|
|
7
7
|
children?: React.ReactNode;
|
|
8
|
+
} & {
|
|
9
|
+
type: 'boxPlot';
|
|
8
10
|
} & import("../containers/withContainer").ContainerProps & React.RefAttributes<any>>;
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var __importDefault = this && this.__importDefault || function(mod) {
|
|
4
|
+
return mod && mod.__esModule ? mod : {
|
|
5
|
+
default: mod
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
|
|
3
9
|
Object.defineProperty(exports, "__esModule", {
|
|
4
10
|
value: !0
|
|
5
11
|
}), exports.BoxPlotChart = void 0;
|
|
6
12
|
|
|
7
|
-
const BaseChart_1 = require("./BaseChart");
|
|
13
|
+
const vchart_1 = __importDefault(require("@visactor/vchart")), BaseChart_1 = require("./BaseChart");
|
|
8
14
|
|
|
9
|
-
exports.BoxPlotChart = (0, BaseChart_1.createChart)("BoxPlotChart",
|
|
15
|
+
exports.BoxPlotChart = (0, BaseChart_1.createChart)("BoxPlotChart", {
|
|
16
|
+
type: "boxPlot",
|
|
17
|
+
vchartConstrouctor: vchart_1.default
|
|
18
|
+
});
|
|
10
19
|
//# sourceMappingURL=BoxPlotChart.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["charts/BoxPlotChart.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/charts/BoxPlotChart.tsx"],"names":[],"mappings":";;;;;;AAEA,8DAAqD;AACrD,2CAA0D;AAM7C,QAAA,YAAY,GAAG,IAAA,uBAAW,EACrC,cAAc,EACd;IACE,IAAI,EAAE,SAAS;IACf,kBAAkB,EAAE,gBAAM;CAC3B,CACF,CAAC","file":"BoxPlotChart.js","sourcesContent":["import React from 'react';\nimport { IBoxPlotChartSpec } from '@visactor/vchart';\nimport { default as VChart } from '@visactor/vchart';\nimport { BaseChartProps, createChart } from './BaseChart';\n\nexport interface BoxPlotChartProps\n extends Omit<BaseChartProps, 'spec' | 'container' | 'type'>,\n Omit<IBoxPlotChartSpec, 'type'> {}\n\nexport const BoxPlotChart = createChart<React.PropsWithChildren<BoxPlotChartProps> & { type: 'boxPlot' }>(\n 'BoxPlotChart',\n {\n type: 'boxPlot',\n vchartConstrouctor: VChart\n }\n);\n"]}
|
|
@@ -5,4 +5,6 @@ export interface CircularProgressChartProps extends Omit<BaseChartProps, 'spec'
|
|
|
5
5
|
}
|
|
6
6
|
export declare const CircularProgressChart: React.ForwardRefExoticComponent<CircularProgressChartProps & {
|
|
7
7
|
children?: React.ReactNode;
|
|
8
|
+
} & {
|
|
9
|
+
type: 'circularProgress';
|
|
8
10
|
} & import("../containers/withContainer").ContainerProps & React.RefAttributes<any>>;
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var __importDefault = this && this.__importDefault || function(mod) {
|
|
4
|
+
return mod && mod.__esModule ? mod : {
|
|
5
|
+
default: mod
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
|
|
3
9
|
Object.defineProperty(exports, "__esModule", {
|
|
4
10
|
value: !0
|
|
5
11
|
}), exports.CircularProgressChart = void 0;
|
|
6
12
|
|
|
7
|
-
const BaseChart_1 = require("./BaseChart");
|
|
13
|
+
const vchart_1 = __importDefault(require("@visactor/vchart")), BaseChart_1 = require("./BaseChart");
|
|
8
14
|
|
|
9
|
-
exports.CircularProgressChart = (0, BaseChart_1.createChart)("CircularProgressChart",
|
|
15
|
+
exports.CircularProgressChart = (0, BaseChart_1.createChart)("CircularProgressChart", {
|
|
16
|
+
type: "circularProgress",
|
|
17
|
+
vchartConstrouctor: vchart_1.default
|
|
18
|
+
});
|
|
10
19
|
//# sourceMappingURL=CircularProgressChart.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["charts/CircularProgressChart.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/charts/CircularProgressChart.tsx"],"names":[],"mappings":";;;;;;AAEA,8DAAqD;AACrD,2CAA0D;AAM7C,QAAA,qBAAqB,GAAG,IAAA,uBAAW,EAE9C,uBAAuB,EAAE;IACzB,IAAI,EAAE,kBAAkB;IACxB,kBAAkB,EAAE,gBAAM;CAC3B,CAAC,CAAC","file":"CircularProgressChart.js","sourcesContent":["import React from 'react';\nimport { ICircularProgressChartSpec } from '@visactor/vchart';\nimport { default as VChart } from '@visactor/vchart';\nimport { BaseChartProps, createChart } from './BaseChart';\n\nexport interface CircularProgressChartProps\n extends Omit<BaseChartProps, 'spec' | 'container' | 'type'>,\n Omit<ICircularProgressChartSpec, 'type'> {}\n\nexport const CircularProgressChart = createChart<\n React.PropsWithChildren<CircularProgressChartProps> & { type: 'circularProgress' }\n>('CircularProgressChart', {\n type: 'circularProgress',\n vchartConstrouctor: VChart\n});\n"]}
|
|
@@ -5,4 +5,6 @@ export interface CommonChartProps extends Omit<BaseChartProps, 'spec' | 'contain
|
|
|
5
5
|
}
|
|
6
6
|
export declare const CommonChart: React.ForwardRefExoticComponent<CommonChartProps & {
|
|
7
7
|
children?: React.ReactNode;
|
|
8
|
+
} & {
|
|
9
|
+
type: 'common';
|
|
8
10
|
} & import("../containers/withContainer").ContainerProps & React.RefAttributes<any>>;
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var __importDefault = this && this.__importDefault || function(mod) {
|
|
4
|
+
return mod && mod.__esModule ? mod : {
|
|
5
|
+
default: mod
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
|
|
3
9
|
Object.defineProperty(exports, "__esModule", {
|
|
4
10
|
value: !0
|
|
5
11
|
}), exports.CommonChart = void 0;
|
|
6
12
|
|
|
7
|
-
const BaseChart_1 = require("./BaseChart");
|
|
13
|
+
const vchart_1 = __importDefault(require("@visactor/vchart")), BaseChart_1 = require("./BaseChart");
|
|
8
14
|
|
|
9
|
-
exports.CommonChart = (0, BaseChart_1.createChart)("CommonChart",
|
|
15
|
+
exports.CommonChart = (0, BaseChart_1.createChart)("CommonChart", {
|
|
16
|
+
type: "common",
|
|
17
|
+
vchartConstrouctor: vchart_1.default
|
|
18
|
+
});
|
|
10
19
|
//# sourceMappingURL=CommonChart.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["charts/CommonChart.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/charts/CommonChart.tsx"],"names":[],"mappings":";;;;;;AAEA,8DAAqD;AACrD,2CAA0D;AAM7C,QAAA,WAAW,GAAG,IAAA,uBAAW,EAAiE,aAAa,EAAE;IACpH,IAAI,EAAE,QAAQ;IACd,kBAAkB,EAAE,gBAAM;CAC3B,CAAC,CAAC","file":"CommonChart.js","sourcesContent":["import React from 'react';\nimport { ICommonChartSpec } from '@visactor/vchart';\nimport { default as VChart } from '@visactor/vchart';\nimport { BaseChartProps, createChart } from './BaseChart';\n\nexport interface CommonChartProps\n extends Omit<BaseChartProps, 'spec' | 'container' | 'type'>,\n Omit<ICommonChartSpec, 'type'> {}\n\nexport const CommonChart = createChart<React.PropsWithChildren<CommonChartProps> & { type: 'common' }>('CommonChart', {\n type: 'common',\n vchartConstrouctor: VChart\n});\n"]}
|
|
@@ -5,4 +5,6 @@ export interface FunnelChartProps extends Omit<BaseChartProps, 'spec' | 'contain
|
|
|
5
5
|
}
|
|
6
6
|
export declare const FunnelChart: React.ForwardRefExoticComponent<FunnelChartProps & {
|
|
7
7
|
children?: React.ReactNode;
|
|
8
|
+
} & {
|
|
9
|
+
type: 'funnel';
|
|
8
10
|
} & import("../containers/withContainer").ContainerProps & React.RefAttributes<any>>;
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var __importDefault = this && this.__importDefault || function(mod) {
|
|
4
|
+
return mod && mod.__esModule ? mod : {
|
|
5
|
+
default: mod
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
|
|
3
9
|
Object.defineProperty(exports, "__esModule", {
|
|
4
10
|
value: !0
|
|
5
11
|
}), exports.FunnelChart = void 0;
|
|
6
12
|
|
|
7
|
-
const BaseChart_1 = require("./BaseChart");
|
|
13
|
+
const vchart_1 = __importDefault(require("@visactor/vchart")), BaseChart_1 = require("./BaseChart");
|
|
8
14
|
|
|
9
|
-
exports.FunnelChart = (0, BaseChart_1.createChart)("FunnelChart",
|
|
15
|
+
exports.FunnelChart = (0, BaseChart_1.createChart)("FunnelChart", {
|
|
16
|
+
type: "funnel",
|
|
17
|
+
vchartConstrouctor: vchart_1.default
|
|
18
|
+
});
|
|
10
19
|
//# sourceMappingURL=FunnelChart.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["charts/FunnelChart.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/charts/FunnelChart.tsx"],"names":[],"mappings":";;;;;;AAEA,8DAAqD;AACrD,2CAA0D;AAM7C,QAAA,WAAW,GAAG,IAAA,uBAAW,EAAiE,aAAa,EAAE;IACpH,IAAI,EAAE,QAAQ;IACd,kBAAkB,EAAE,gBAAM;CAC3B,CAAC,CAAC","file":"FunnelChart.js","sourcesContent":["import React from 'react';\nimport { IFunnelChartSpec } from '@visactor/vchart';\nimport { default as VChart } from '@visactor/vchart';\nimport { BaseChartProps, createChart } from './BaseChart';\n\nexport interface FunnelChartProps\n extends Omit<BaseChartProps, 'spec' | 'container' | 'type'>,\n Omit<IFunnelChartSpec, 'type'> {}\n\nexport const FunnelChart = createChart<React.PropsWithChildren<FunnelChartProps> & { type: 'funnel' }>('FunnelChart', {\n type: 'funnel',\n vchartConstrouctor: VChart\n});\n"]}
|
|
@@ -5,4 +5,6 @@ export interface HistogramChartProps extends Omit<BaseChartProps, 'spec' | 'cont
|
|
|
5
5
|
}
|
|
6
6
|
export declare const HistogramChart: React.ForwardRefExoticComponent<HistogramChartProps & {
|
|
7
7
|
children?: React.ReactNode;
|
|
8
|
+
} & {
|
|
9
|
+
type: 'histogram';
|
|
8
10
|
} & import("../containers/withContainer").ContainerProps & React.RefAttributes<any>>;
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var __importDefault = this && this.__importDefault || function(mod) {
|
|
4
|
+
return mod && mod.__esModule ? mod : {
|
|
5
|
+
default: mod
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
|
|
3
9
|
Object.defineProperty(exports, "__esModule", {
|
|
4
10
|
value: !0
|
|
5
11
|
}), exports.HistogramChart = void 0;
|
|
6
12
|
|
|
7
|
-
const BaseChart_1 = require("./BaseChart");
|
|
13
|
+
const vchart_1 = __importDefault(require("@visactor/vchart")), BaseChart_1 = require("./BaseChart");
|
|
8
14
|
|
|
9
|
-
exports.HistogramChart = (0, BaseChart_1.createChart)("HistogramChart",
|
|
15
|
+
exports.HistogramChart = (0, BaseChart_1.createChart)("HistogramChart", {
|
|
16
|
+
type: "histogram",
|
|
17
|
+
vchartConstrouctor: vchart_1.default
|
|
18
|
+
});
|
|
10
19
|
//# sourceMappingURL=HistogramChart.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["charts/HistogramChart.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/charts/HistogramChart.tsx"],"names":[],"mappings":";;;;;;AAEA,8DAAqD;AACrD,2CAA0D;AAM7C,QAAA,cAAc,GAAG,IAAA,uBAAW,EACvC,gBAAgB,EAChB;IACE,IAAI,EAAE,WAAW;IACjB,kBAAkB,EAAE,gBAAM;CAC3B,CACF,CAAC","file":"HistogramChart.js","sourcesContent":["import React from 'react';\nimport { IHistogramChartSpec } from '@visactor/vchart';\nimport { default as VChart } from '@visactor/vchart';\nimport { BaseChartProps, createChart } from './BaseChart';\n\nexport interface HistogramChartProps\n extends Omit<BaseChartProps, 'spec' | 'container' | 'type'>,\n Omit<IHistogramChartSpec, 'type'> {}\n\nexport const HistogramChart = createChart<React.PropsWithChildren<HistogramChartProps> & { type: 'histogram' }>(\n 'HistogramChart',\n {\n type: 'histogram',\n vchartConstrouctor: VChart\n }\n);\n"]}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ILineChartSpec } from '@visactor/vchart';
|
|
2
|
+
import type { ILineChartSpec } from '@visactor/vchart';
|
|
3
3
|
import { BaseChartProps } from './BaseChart';
|
|
4
4
|
export interface LineChartProps extends Omit<BaseChartProps, 'spec' | 'container' | 'type'>, Omit<ILineChartSpec, 'type'> {
|
|
5
5
|
}
|
|
6
6
|
export declare const LineChart: React.ForwardRefExoticComponent<LineChartProps & {
|
|
7
7
|
children?: React.ReactNode;
|
|
8
|
+
} & {
|
|
9
|
+
type: 'line';
|
|
8
10
|
} & import("../containers/withContainer").ContainerProps & React.RefAttributes<any>>;
|
package/cjs/charts/LineChart.js
CHANGED
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var __importDefault = this && this.__importDefault || function(mod) {
|
|
4
|
+
return mod && mod.__esModule ? mod : {
|
|
5
|
+
default: mod
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
|
|
3
9
|
Object.defineProperty(exports, "__esModule", {
|
|
4
10
|
value: !0
|
|
5
11
|
}), exports.LineChart = void 0;
|
|
6
12
|
|
|
7
|
-
const BaseChart_1 = require("./BaseChart");
|
|
13
|
+
const vchart_1 = __importDefault(require("@visactor/vchart")), BaseChart_1 = require("./BaseChart");
|
|
8
14
|
|
|
9
|
-
exports.LineChart = (0, BaseChart_1.createChart)("LineChart",
|
|
15
|
+
exports.LineChart = (0, BaseChart_1.createChart)("LineChart", {
|
|
16
|
+
type: "line",
|
|
17
|
+
vchartConstrouctor: vchart_1.default
|
|
18
|
+
});
|
|
10
19
|
//# sourceMappingURL=LineChart.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["charts/LineChart.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/charts/LineChart.tsx"],"names":[],"mappings":";;;;;;AAEA,8DAAqD;AACrD,2CAA0D;AAM7C,QAAA,SAAS,GAAG,IAAA,uBAAW,EAA6D,WAAW,EAAE;IAC5G,IAAI,EAAE,MAAM;IACZ,kBAAkB,EAAE,gBAAM;CAC3B,CAAC,CAAC","file":"LineChart.js","sourcesContent":["import React from 'react';\nimport type { ILineChartSpec } from '@visactor/vchart';\nimport { default as VChart } from '@visactor/vchart';\nimport { BaseChartProps, createChart } from './BaseChart';\n\nexport interface LineChartProps\n extends Omit<BaseChartProps, 'spec' | 'container' | 'type'>,\n Omit<ILineChartSpec, 'type'> {}\n\nexport const LineChart = createChart<React.PropsWithChildren<LineChartProps> & { type: 'line' }>('LineChart', {\n type: 'line',\n vchartConstrouctor: VChart\n});\n"]}
|
|
@@ -5,4 +5,6 @@ export interface LinearProgressChartProps extends Omit<BaseChartProps, 'spec' |
|
|
|
5
5
|
}
|
|
6
6
|
export declare const LinearProgressChart: React.ForwardRefExoticComponent<LinearProgressChartProps & {
|
|
7
7
|
children?: React.ReactNode;
|
|
8
|
+
} & {
|
|
9
|
+
type: 'linearProgress';
|
|
8
10
|
} & import("../containers/withContainer").ContainerProps & React.RefAttributes<any>>;
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var __importDefault = this && this.__importDefault || function(mod) {
|
|
4
|
+
return mod && mod.__esModule ? mod : {
|
|
5
|
+
default: mod
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
|
|
3
9
|
Object.defineProperty(exports, "__esModule", {
|
|
4
10
|
value: !0
|
|
5
11
|
}), exports.LinearProgressChart = void 0;
|
|
6
12
|
|
|
7
|
-
const BaseChart_1 = require("./BaseChart");
|
|
13
|
+
const vchart_1 = __importDefault(require("@visactor/vchart")), BaseChart_1 = require("./BaseChart");
|
|
8
14
|
|
|
9
|
-
exports.LinearProgressChart = (0, BaseChart_1.createChart)("LinearProgressChart",
|
|
15
|
+
exports.LinearProgressChart = (0, BaseChart_1.createChart)("LinearProgressChart", {
|
|
16
|
+
type: "linearProgress",
|
|
17
|
+
vchartConstrouctor: vchart_1.default
|
|
18
|
+
});
|
|
10
19
|
//# sourceMappingURL=LinearProgressChart.js.map
|