@visactor/react-vchart 0.0.1-alpha.0
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/README.md +23 -0
- package/cjs/VChart.d.ts +3 -0
- package/cjs/VChart.js +9 -0
- package/cjs/VChart.js.map +1 -0
- package/cjs/charts/AreaChart.d.ts +5 -0
- package/cjs/charts/AreaChart.js +10 -0
- package/cjs/charts/AreaChart.js.map +1 -0
- package/cjs/charts/BarChart.d.ts +5 -0
- package/cjs/charts/BarChart.js +10 -0
- package/cjs/charts/BarChart.js.map +1 -0
- package/cjs/charts/BaseChart.d.ts +18 -0
- package/cjs/charts/BaseChart.js +94 -0
- package/cjs/charts/BaseChart.js.map +1 -0
- package/cjs/charts/BoxPlotChart.d.ts +5 -0
- package/cjs/charts/BoxPlotChart.js +10 -0
- package/cjs/charts/BoxPlotChart.js.map +1 -0
- package/cjs/charts/CircularProgressChart.d.ts +5 -0
- package/cjs/charts/CircularProgressChart.js +10 -0
- package/cjs/charts/CircularProgressChart.js.map +1 -0
- package/cjs/charts/CommonChart.d.ts +5 -0
- package/cjs/charts/CommonChart.js +10 -0
- package/cjs/charts/CommonChart.js.map +1 -0
- package/cjs/charts/FunnelChart.d.ts +5 -0
- package/cjs/charts/FunnelChart.js +10 -0
- package/cjs/charts/FunnelChart.js.map +1 -0
- package/cjs/charts/HistogramChart.d.ts +5 -0
- package/cjs/charts/HistogramChart.js +10 -0
- package/cjs/charts/HistogramChart.js.map +1 -0
- package/cjs/charts/LineChart.d.ts +5 -0
- package/cjs/charts/LineChart.js +10 -0
- package/cjs/charts/LineChart.js.map +1 -0
- package/cjs/charts/LinearProgressChart.d.ts +5 -0
- package/cjs/charts/LinearProgressChart.js +9 -0
- package/cjs/charts/LinearProgressChart.js.map +1 -0
- package/cjs/charts/MapChart.d.ts +5 -0
- package/cjs/charts/MapChart.js +10 -0
- package/cjs/charts/MapChart.js.map +1 -0
- package/cjs/charts/PieChart.d.ts +5 -0
- package/cjs/charts/PieChart.js +10 -0
- package/cjs/charts/PieChart.js.map +1 -0
- package/cjs/charts/RadarChart.d.ts +5 -0
- package/cjs/charts/RadarChart.js +10 -0
- package/cjs/charts/RadarChart.js.map +1 -0
- package/cjs/charts/RangeColumnChart.d.ts +5 -0
- package/cjs/charts/RangeColumnChart.js +10 -0
- package/cjs/charts/RangeColumnChart.js.map +1 -0
- package/cjs/charts/RoseChart.d.ts +5 -0
- package/cjs/charts/RoseChart.js +10 -0
- package/cjs/charts/RoseChart.js.map +1 -0
- package/cjs/charts/ScatterChart.d.ts +5 -0
- package/cjs/charts/ScatterChart.js +10 -0
- package/cjs/charts/ScatterChart.js.map +1 -0
- package/cjs/charts/SequenceChart.d.ts +5 -0
- package/cjs/charts/SequenceChart.js +10 -0
- package/cjs/charts/SequenceChart.js.map +1 -0
- package/cjs/charts/WordCloudChart.d.ts +5 -0
- package/cjs/charts/WordCloudChart.js +10 -0
- package/cjs/charts/WordCloudChart.js.map +1 -0
- package/cjs/charts/index.d.ts +16 -0
- package/cjs/charts/index.js +150 -0
- package/cjs/charts/index.js.map +1 -0
- package/cjs/components/Axis.d.ts +5 -0
- package/cjs/components/Axis.js +10 -0
- package/cjs/components/Axis.js.map +1 -0
- package/cjs/components/BaseComponent.d.ts +9 -0
- package/cjs/components/BaseComponent.js +76 -0
- package/cjs/components/BaseComponent.js.map +1 -0
- package/cjs/components/Legend.d.ts +9 -0
- package/cjs/components/Legend.js +10 -0
- package/cjs/components/Legend.js.map +1 -0
- package/cjs/components/Mark.d.ts +14 -0
- package/cjs/components/Mark.js +68 -0
- package/cjs/components/Mark.js.map +1 -0
- package/cjs/components/Region.d.ts +5 -0
- package/cjs/components/Region.js +10 -0
- package/cjs/components/Region.js.map +1 -0
- package/cjs/components/index.d.ts +4 -0
- package/cjs/components/index.js +22 -0
- package/cjs/components/index.js.map +1 -0
- package/cjs/constants.d.ts +1 -0
- package/cjs/constants.js +6 -0
- package/cjs/constants.js.map +1 -0
- package/cjs/containers/withContainer.d.ts +8 -0
- package/cjs/containers/withContainer.js +64 -0
- package/cjs/containers/withContainer.js.map +1 -0
- package/cjs/context/chart.d.ts +10 -0
- package/cjs/context/chart.js +25 -0
- package/cjs/context/chart.js.map +1 -0
- package/cjs/context/stage.d.ts +4 -0
- package/cjs/context/stage.js +24 -0
- package/cjs/context/stage.js.map +1 -0
- package/cjs/context/view.d.ts +5 -0
- package/cjs/context/view.js +24 -0
- package/cjs/context/view.js.map +1 -0
- package/cjs/eventsUtils.d.ts +155 -0
- package/cjs/eventsUtils.js +84 -0
- package/cjs/eventsUtils.js.map +1 -0
- package/cjs/index.d.ts +6 -0
- package/cjs/index.js +38 -0
- package/cjs/index.js.map +1 -0
- package/cjs/series/Area.d.ts +6 -0
- package/cjs/series/Area.js +10 -0
- package/cjs/series/Area.js.map +1 -0
- package/cjs/series/Bar.d.ts +6 -0
- package/cjs/series/Bar.js +10 -0
- package/cjs/series/Bar.js.map +1 -0
- package/cjs/series/BaseSeries.d.ts +8 -0
- package/cjs/series/BaseSeries.js +77 -0
- package/cjs/series/BaseSeries.js.map +1 -0
- package/cjs/series/BoxPlot.d.ts +6 -0
- package/cjs/series/BoxPlot.js +10 -0
- package/cjs/series/BoxPlot.js.map +1 -0
- package/cjs/series/CircularProgress.d.ts +6 -0
- package/cjs/series/CircularProgress.js +10 -0
- package/cjs/series/CircularProgress.js.map +1 -0
- package/cjs/series/Dot.d.ts +6 -0
- package/cjs/series/Dot.js +10 -0
- package/cjs/series/Dot.js.map +1 -0
- package/cjs/series/Funnel.d.ts +6 -0
- package/cjs/series/Funnel.js +10 -0
- package/cjs/series/Funnel.js.map +1 -0
- package/cjs/series/Line.d.ts +6 -0
- package/cjs/series/Line.js +9 -0
- package/cjs/series/Line.js.map +1 -0
- package/cjs/series/LinearProgress.d.ts +6 -0
- package/cjs/series/LinearProgress.js +10 -0
- package/cjs/series/LinearProgress.js.map +1 -0
- package/cjs/series/Link.d.ts +6 -0
- package/cjs/series/Link.js +10 -0
- package/cjs/series/Link.js.map +1 -0
- package/cjs/series/Map.d.ts +6 -0
- package/cjs/series/Map.js +10 -0
- package/cjs/series/Map.js.map +1 -0
- package/cjs/series/Pie.d.ts +6 -0
- package/cjs/series/Pie.js +10 -0
- package/cjs/series/Pie.js.map +1 -0
- package/cjs/series/Radar.d.ts +6 -0
- package/cjs/series/Radar.js +10 -0
- package/cjs/series/Radar.js.map +1 -0
- package/cjs/series/RangeColumn.d.ts +6 -0
- package/cjs/series/RangeColumn.js +10 -0
- package/cjs/series/RangeColumn.js.map +1 -0
- package/cjs/series/Rose.d.ts +6 -0
- package/cjs/series/Rose.js +10 -0
- package/cjs/series/Rose.js.map +1 -0
- package/cjs/series/Scatter.d.ts +6 -0
- package/cjs/series/Scatter.js +10 -0
- package/cjs/series/Scatter.js.map +1 -0
- package/cjs/series/Series.d.ts +7 -0
- package/cjs/series/Series.js +10 -0
- package/cjs/series/Series.js.map +1 -0
- package/cjs/series/WordCloud.d.ts +6 -0
- package/cjs/series/WordCloud.js +10 -0
- package/cjs/series/WordCloud.js.map +1 -0
- package/cjs/series/index.d.ts +17 -0
- package/cjs/series/index.js +29 -0
- package/cjs/series/index.js.map +1 -0
- package/cjs/util.d.ts +7 -0
- package/cjs/util.js +57 -0
- package/cjs/util.js.map +1 -0
- package/esm/VChart.d.ts +3 -0
- package/esm/VChart.js +3 -0
- package/esm/VChart.js.map +1 -0
- package/esm/charts/AreaChart.d.ts +5 -0
- package/esm/charts/AreaChart.js +4 -0
- package/esm/charts/AreaChart.js.map +1 -0
- package/esm/charts/BarChart.d.ts +5 -0
- package/esm/charts/BarChart.js +4 -0
- package/esm/charts/BarChart.js.map +1 -0
- package/esm/charts/BaseChart.d.ts +18 -0
- package/esm/charts/BaseChart.js +75 -0
- package/esm/charts/BaseChart.js.map +1 -0
- package/esm/charts/BoxPlotChart.d.ts +5 -0
- package/esm/charts/BoxPlotChart.js +4 -0
- package/esm/charts/BoxPlotChart.js.map +1 -0
- package/esm/charts/CircularProgressChart.d.ts +5 -0
- package/esm/charts/CircularProgressChart.js +4 -0
- package/esm/charts/CircularProgressChart.js.map +1 -0
- package/esm/charts/CommonChart.d.ts +5 -0
- package/esm/charts/CommonChart.js +4 -0
- package/esm/charts/CommonChart.js.map +1 -0
- package/esm/charts/FunnelChart.d.ts +5 -0
- package/esm/charts/FunnelChart.js +4 -0
- package/esm/charts/FunnelChart.js.map +1 -0
- package/esm/charts/HistogramChart.d.ts +5 -0
- package/esm/charts/HistogramChart.js +4 -0
- package/esm/charts/HistogramChart.js.map +1 -0
- package/esm/charts/LineChart.d.ts +5 -0
- package/esm/charts/LineChart.js +4 -0
- package/esm/charts/LineChart.js.map +1 -0
- package/esm/charts/LinearProgressChart.d.ts +5 -0
- package/esm/charts/LinearProgressChart.js +3 -0
- package/esm/charts/LinearProgressChart.js.map +1 -0
- package/esm/charts/MapChart.d.ts +5 -0
- package/esm/charts/MapChart.js +4 -0
- package/esm/charts/MapChart.js.map +1 -0
- package/esm/charts/PieChart.d.ts +5 -0
- package/esm/charts/PieChart.js +4 -0
- package/esm/charts/PieChart.js.map +1 -0
- package/esm/charts/RadarChart.d.ts +5 -0
- package/esm/charts/RadarChart.js +4 -0
- package/esm/charts/RadarChart.js.map +1 -0
- package/esm/charts/RangeColumnChart.d.ts +5 -0
- package/esm/charts/RangeColumnChart.js +4 -0
- package/esm/charts/RangeColumnChart.js.map +1 -0
- package/esm/charts/RoseChart.d.ts +5 -0
- package/esm/charts/RoseChart.js +4 -0
- package/esm/charts/RoseChart.js.map +1 -0
- package/esm/charts/ScatterChart.d.ts +5 -0
- package/esm/charts/ScatterChart.js +4 -0
- package/esm/charts/ScatterChart.js.map +1 -0
- package/esm/charts/SequenceChart.d.ts +5 -0
- package/esm/charts/SequenceChart.js +4 -0
- package/esm/charts/SequenceChart.js.map +1 -0
- package/esm/charts/WordCloudChart.d.ts +5 -0
- package/esm/charts/WordCloudChart.js +4 -0
- package/esm/charts/WordCloudChart.js.map +1 -0
- package/esm/charts/index.d.ts +16 -0
- package/esm/charts/index.js +32 -0
- package/esm/charts/index.js.map +1 -0
- package/esm/components/Axis.d.ts +5 -0
- package/esm/components/Axis.js +4 -0
- package/esm/components/Axis.js.map +1 -0
- package/esm/components/BaseComponent.d.ts +9 -0
- package/esm/components/BaseComponent.js +47 -0
- package/esm/components/BaseComponent.js.map +1 -0
- package/esm/components/Legend.d.ts +9 -0
- package/esm/components/Legend.js +6 -0
- package/esm/components/Legend.js.map +1 -0
- package/esm/components/Mark.d.ts +14 -0
- package/esm/components/Mark.js +40 -0
- package/esm/components/Mark.js.map +1 -0
- package/esm/components/Region.d.ts +5 -0
- package/esm/components/Region.js +4 -0
- package/esm/components/Region.js.map +1 -0
- package/esm/components/index.d.ts +4 -0
- package/esm/components/index.js +8 -0
- package/esm/components/index.js.map +1 -0
- package/esm/constants.d.ts +1 -0
- package/esm/constants.js +2 -0
- package/esm/constants.js.map +1 -0
- package/esm/containers/withContainer.d.ts +8 -0
- package/esm/containers/withContainer.js +33 -0
- package/esm/containers/withContainer.js.map +1 -0
- package/esm/context/chart.d.ts +10 -0
- package/esm/context/chart.js +16 -0
- package/esm/context/chart.js.map +1 -0
- package/esm/context/stage.d.ts +4 -0
- package/esm/context/stage.js +16 -0
- package/esm/context/stage.js.map +1 -0
- package/esm/context/view.d.ts +5 -0
- package/esm/context/view.js +16 -0
- package/esm/context/view.js.map +1 -0
- package/esm/eventsUtils.d.ts +155 -0
- package/esm/eventsUtils.js +82 -0
- package/esm/eventsUtils.js.map +1 -0
- package/esm/index.d.ts +6 -0
- package/esm/index.js +11 -0
- package/esm/index.js.map +1 -0
- package/esm/series/Area.d.ts +6 -0
- package/esm/series/Area.js +4 -0
- package/esm/series/Area.js.map +1 -0
- package/esm/series/Bar.d.ts +6 -0
- package/esm/series/Bar.js +4 -0
- package/esm/series/Bar.js.map +1 -0
- package/esm/series/BaseSeries.d.ts +8 -0
- package/esm/series/BaseSeries.js +72 -0
- package/esm/series/BaseSeries.js.map +1 -0
- package/esm/series/BoxPlot.d.ts +6 -0
- package/esm/series/BoxPlot.js +4 -0
- package/esm/series/BoxPlot.js.map +1 -0
- package/esm/series/CircularProgress.d.ts +6 -0
- package/esm/series/CircularProgress.js +4 -0
- package/esm/series/CircularProgress.js.map +1 -0
- package/esm/series/Dot.d.ts +6 -0
- package/esm/series/Dot.js +4 -0
- package/esm/series/Dot.js.map +1 -0
- package/esm/series/Funnel.d.ts +6 -0
- package/esm/series/Funnel.js +4 -0
- package/esm/series/Funnel.js.map +1 -0
- package/esm/series/Line.d.ts +6 -0
- package/esm/series/Line.js +3 -0
- package/esm/series/Line.js.map +1 -0
- package/esm/series/LinearProgress.d.ts +6 -0
- package/esm/series/LinearProgress.js +4 -0
- package/esm/series/LinearProgress.js.map +1 -0
- package/esm/series/Link.d.ts +6 -0
- package/esm/series/Link.js +4 -0
- package/esm/series/Link.js.map +1 -0
- package/esm/series/Map.d.ts +6 -0
- package/esm/series/Map.js +4 -0
- package/esm/series/Map.js.map +1 -0
- package/esm/series/Pie.d.ts +6 -0
- package/esm/series/Pie.js +4 -0
- package/esm/series/Pie.js.map +1 -0
- package/esm/series/Radar.d.ts +6 -0
- package/esm/series/Radar.js +4 -0
- package/esm/series/Radar.js.map +1 -0
- package/esm/series/RangeColumn.d.ts +6 -0
- package/esm/series/RangeColumn.js +4 -0
- package/esm/series/RangeColumn.js.map +1 -0
- package/esm/series/Rose.d.ts +6 -0
- package/esm/series/Rose.js +4 -0
- package/esm/series/Rose.js.map +1 -0
- package/esm/series/Scatter.d.ts +6 -0
- package/esm/series/Scatter.js +4 -0
- package/esm/series/Scatter.js.map +1 -0
- package/esm/series/Series.d.ts +7 -0
- package/esm/series/Series.js +4 -0
- package/esm/series/Series.js.map +1 -0
- package/esm/series/WordCloud.d.ts +6 -0
- package/esm/series/WordCloud.js +4 -0
- package/esm/series/WordCloud.js.map +1 -0
- package/esm/series/index.d.ts +17 -0
- package/esm/series/index.js +34 -0
- package/esm/series/index.js.map +1 -0
- package/esm/util.d.ts +7 -0
- package/esm/util.js +36 -0
- package/esm/util.js.map +1 -0
- package/package.json +79 -0
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
}), exports.CommonChart = exports.RangeColumnChart = exports.LinearProgressChart = exports.CircularProgressChart = exports.BoxPlotChart = exports.FunnelChart = exports.WordCloudChart = exports.HistogramChart = exports.MapChart = exports.RadarChart = exports.RoseChart = exports.PieChart = exports.ScatterChart = exports.LineChart = exports.BarChart = exports.AreaChart = void 0;
|
|
6
|
+
|
|
7
|
+
var AreaChart_1 = require("./AreaChart");
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, "AreaChart", {
|
|
10
|
+
enumerable: !0,
|
|
11
|
+
get: function() {
|
|
12
|
+
return AreaChart_1.AreaChart;
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
var BarChart_1 = require("./BarChart");
|
|
17
|
+
|
|
18
|
+
Object.defineProperty(exports, "BarChart", {
|
|
19
|
+
enumerable: !0,
|
|
20
|
+
get: function() {
|
|
21
|
+
return BarChart_1.BarChart;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
var LineChart_1 = require("./LineChart");
|
|
26
|
+
|
|
27
|
+
Object.defineProperty(exports, "LineChart", {
|
|
28
|
+
enumerable: !0,
|
|
29
|
+
get: function() {
|
|
30
|
+
return LineChart_1.LineChart;
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
var ScatterChart_1 = require("./ScatterChart");
|
|
35
|
+
|
|
36
|
+
Object.defineProperty(exports, "ScatterChart", {
|
|
37
|
+
enumerable: !0,
|
|
38
|
+
get: function() {
|
|
39
|
+
return ScatterChart_1.ScatterChart;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
var PieChart_1 = require("./PieChart");
|
|
44
|
+
|
|
45
|
+
Object.defineProperty(exports, "PieChart", {
|
|
46
|
+
enumerable: !0,
|
|
47
|
+
get: function() {
|
|
48
|
+
return PieChart_1.PieChart;
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
var RoseChart_1 = require("./RoseChart");
|
|
53
|
+
|
|
54
|
+
Object.defineProperty(exports, "RoseChart", {
|
|
55
|
+
enumerable: !0,
|
|
56
|
+
get: function() {
|
|
57
|
+
return RoseChart_1.RoseChart;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
var RadarChart_1 = require("./RadarChart");
|
|
62
|
+
|
|
63
|
+
Object.defineProperty(exports, "RadarChart", {
|
|
64
|
+
enumerable: !0,
|
|
65
|
+
get: function() {
|
|
66
|
+
return RadarChart_1.RadarChart;
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
var MapChart_1 = require("./MapChart");
|
|
71
|
+
|
|
72
|
+
Object.defineProperty(exports, "MapChart", {
|
|
73
|
+
enumerable: !0,
|
|
74
|
+
get: function() {
|
|
75
|
+
return MapChart_1.MapChart;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
var HistogramChart_1 = require("./HistogramChart");
|
|
80
|
+
|
|
81
|
+
Object.defineProperty(exports, "HistogramChart", {
|
|
82
|
+
enumerable: !0,
|
|
83
|
+
get: function() {
|
|
84
|
+
return HistogramChart_1.HistogramChart;
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
var WordCloudChart_1 = require("./WordCloudChart");
|
|
89
|
+
|
|
90
|
+
Object.defineProperty(exports, "WordCloudChart", {
|
|
91
|
+
enumerable: !0,
|
|
92
|
+
get: function() {
|
|
93
|
+
return WordCloudChart_1.WordCloudChart;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
var FunnelChart_1 = require("./FunnelChart");
|
|
98
|
+
|
|
99
|
+
Object.defineProperty(exports, "FunnelChart", {
|
|
100
|
+
enumerable: !0,
|
|
101
|
+
get: function() {
|
|
102
|
+
return FunnelChart_1.FunnelChart;
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
var BoxPlotChart_1 = require("./BoxPlotChart");
|
|
107
|
+
|
|
108
|
+
Object.defineProperty(exports, "BoxPlotChart", {
|
|
109
|
+
enumerable: !0,
|
|
110
|
+
get: function() {
|
|
111
|
+
return BoxPlotChart_1.BoxPlotChart;
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
var CircularProgressChart_1 = require("./CircularProgressChart");
|
|
116
|
+
|
|
117
|
+
Object.defineProperty(exports, "CircularProgressChart", {
|
|
118
|
+
enumerable: !0,
|
|
119
|
+
get: function() {
|
|
120
|
+
return CircularProgressChart_1.CircularProgressChart;
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
var LinearProgressChart_1 = require("./LinearProgressChart");
|
|
125
|
+
|
|
126
|
+
Object.defineProperty(exports, "LinearProgressChart", {
|
|
127
|
+
enumerable: !0,
|
|
128
|
+
get: function() {
|
|
129
|
+
return LinearProgressChart_1.LinearProgressChart;
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
var RangeColumnChart_1 = require("./RangeColumnChart");
|
|
134
|
+
|
|
135
|
+
Object.defineProperty(exports, "RangeColumnChart", {
|
|
136
|
+
enumerable: !0,
|
|
137
|
+
get: function() {
|
|
138
|
+
return RangeColumnChart_1.RangeColumnChart;
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
var CommonChart_1 = require("./CommonChart");
|
|
143
|
+
|
|
144
|
+
Object.defineProperty(exports, "CommonChart", {
|
|
145
|
+
enumerable: !0,
|
|
146
|
+
get: function() {
|
|
147
|
+
return CommonChart_1.CommonChart;
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["charts/index.ts"],"names":[],"mappings":";;;AAAA,yCAAuC;AAA9B,sGAAA,SAAS,OAAA;AAClB,uCAAqC;AAA5B,oGAAA,QAAQ,OAAA;AACjB,yCAAuC;AAA9B,sGAAA,SAAS,OAAA;AAClB,+CAA6C;AAApC,4GAAA,YAAY,OAAA;AAErB,uCAAqC;AAA5B,oGAAA,QAAQ,OAAA;AACjB,yCAAuC;AAA9B,sGAAA,SAAS,OAAA;AAElB,2CAAyC;AAAhC,wGAAA,UAAU,OAAA;AAEnB,uCAAqC;AAA5B,oGAAA,QAAQ,OAAA;AACjB,mDAAiD;AAAxC,gHAAA,cAAc,OAAA;AACvB,mDAAiD;AAAxC,gHAAA,cAAc,OAAA;AACvB,6CAA2C;AAAlC,0GAAA,WAAW,OAAA;AACpB,+CAA6C;AAApC,4GAAA,YAAY,OAAA;AAErB,iEAA+D;AAAtD,8HAAA,qBAAqB,OAAA;AAC9B,6DAA2D;AAAlD,0HAAA,mBAAmB,OAAA;AAC5B,uDAAqD;AAA5C,oHAAA,gBAAgB,OAAA;AAEzB,6CAA2C;AAAlC,0GAAA,WAAW,OAAA","file":"index.js","sourcesContent":["export { AreaChart } from './AreaChart'\nexport { BarChart } from './BarChart'\nexport { LineChart } from './LineChart'\nexport { ScatterChart } from './ScatterChart'\n\nexport { PieChart } from './PieChart'\nexport { RoseChart } from './RoseChart'\n\nexport { RadarChart } from './RadarChart'\n\nexport { MapChart } from './MapChart'\nexport { HistogramChart } from './HistogramChart'\nexport { WordCloudChart } from './WordCloudChart'\nexport { FunnelChart } from './FunnelChart'\nexport { BoxPlotChart } from './BoxPlotChart'\n\nexport { CircularProgressChart } from './CircularProgressChart'\nexport { LinearProgressChart } from './LinearProgressChart'\nexport { RangeColumnChart } from './RangeColumnChart'\n\nexport { CommonChart } from './CommonChart'"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
}), exports.Axis = void 0;
|
|
6
|
+
|
|
7
|
+
const BaseComponent_1 = require("./BaseComponent");
|
|
8
|
+
|
|
9
|
+
exports.Axis = (0, BaseComponent_1.createComponent)("Axis", "axes");
|
|
10
|
+
//# sourceMappingURL=Axis.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["components/Axis.tsx"],"names":[],"mappings":";;;AAAA,mDAAkD;AAMrC,QAAA,IAAI,GAAG,IAAA,+BAAe,EAAC,MAAM,EAAE,MAAM,CAAC,CAAC","file":"Axis.js","sourcesContent":["import { createComponent } from \"./BaseComponent\";\n\nexport interface AxisProps {\n //\n}\n\nexport const Axis = createComponent(\"Axis\", \"axes\");\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface BaseComponentProps {
|
|
3
|
+
id?: string | number;
|
|
4
|
+
}
|
|
5
|
+
type ComponentProps = BaseComponentProps & {
|
|
6
|
+
updateId?: number;
|
|
7
|
+
};
|
|
8
|
+
export declare const createComponent: <T extends ComponentProps>(componentName: string, specName: string, supportedEvents?: Record<string, string> | null, isSingle?: boolean) => React.FC<T>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
4
|
+
void 0 === k2 && (k2 = k);
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
desc && !("get" in desc ? !m.__esModule : desc.writable || desc.configurable) || (desc = {
|
|
7
|
+
enumerable: !0,
|
|
8
|
+
get: function() {
|
|
9
|
+
return m[k];
|
|
10
|
+
}
|
|
11
|
+
}), Object.defineProperty(o, k2, desc);
|
|
12
|
+
} : function(o, m, k, k2) {
|
|
13
|
+
void 0 === k2 && (k2 = k), o[k2] = m[k];
|
|
14
|
+
}), __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", {
|
|
16
|
+
enumerable: !0,
|
|
17
|
+
value: v
|
|
18
|
+
});
|
|
19
|
+
} : function(o, v) {
|
|
20
|
+
o.default = v;
|
|
21
|
+
}), __importStar = this && this.__importStar || function(mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (null != mod) for (var k in mod) "default" !== k && Object.prototype.hasOwnProperty.call(mod, k) && __createBinding(result, mod, k);
|
|
25
|
+
return __setModuleDefault(result, mod), result;
|
|
26
|
+
}, __importDefault = this && this.__importDefault || function(mod) {
|
|
27
|
+
return mod && mod.__esModule ? mod : {
|
|
28
|
+
default: mod
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
Object.defineProperty(exports, "__esModule", {
|
|
33
|
+
value: !0
|
|
34
|
+
}), exports.createComponent = void 0;
|
|
35
|
+
|
|
36
|
+
const react_1 = __importStar(require("react")), vutils_1 = require("@visactor/vutils"), chart_1 = __importDefault(require("../context/chart")), eventsUtils_1 = require("../eventsUtils"), util_1 = require("../util"), createComponent = (componentName, specName, supportedEvents, isSingle) => {
|
|
37
|
+
const ignoreKeys = [ "id", "updateId" ], notSpecKeys = supportedEvents ? Object.keys(supportedEvents).concat(ignoreKeys) : ignoreKeys, Comp = props => {
|
|
38
|
+
const context = (0, react_1.useContext)(chart_1.default), id = react_1.default.useRef((0,
|
|
39
|
+
vutils_1.isNil)(props.id) ? (0, util_1.uid)(specName) : props.id), eventsBinded = react_1.default.useRef(null), updateId = react_1.default.useRef(props.updateId), componentSpec = (0,
|
|
40
|
+
vutils_1.pickWithout)(props, notSpecKeys);
|
|
41
|
+
return !!supportedEvents && (0, eventsUtils_1.bindEventsToChart)(context.chart, props, eventsBinded.current, supportedEvents) && (eventsBinded.current = props),
|
|
42
|
+
props.updateId !== updateId.current ? updateId.current = props.updateId : updateToContext(context, id.current, specName, isSingle, componentSpec),
|
|
43
|
+
(0, react_1.useEffect)((() => () => {
|
|
44
|
+
supportedEvents && (0, eventsUtils_1.bindEventsToChart)(context.chart, null, eventsBinded.current, supportedEvents),
|
|
45
|
+
deleteToContext(context, id.current, specName, isSingle);
|
|
46
|
+
}), []), null;
|
|
47
|
+
};
|
|
48
|
+
return Comp.displayName = componentName, Comp;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
exports.createComponent = createComponent;
|
|
52
|
+
|
|
53
|
+
const updateToContext = (context, id, specName, isSingle, props) => {
|
|
54
|
+
if (context.specFromChildren) {
|
|
55
|
+
if (isSingle) context.specFromChildren[specName] = Object.assign({}, props); else {
|
|
56
|
+
context.specFromChildren[specName] || (context.specFromChildren[specName] = []);
|
|
57
|
+
const comps = context.specFromChildren[specName], index = comps.findIndex((entry => entry.id === id));
|
|
58
|
+
index >= 0 ? comps[index] = Object.assign({
|
|
59
|
+
id: id
|
|
60
|
+
}, props) : context.specFromChildren[specName].push(Object.assign({
|
|
61
|
+
id: id
|
|
62
|
+
}, props));
|
|
63
|
+
}
|
|
64
|
+
context.isChildrenUpdated = !0;
|
|
65
|
+
}
|
|
66
|
+
}, deleteToContext = (context, id, specName, isSingle) => {
|
|
67
|
+
var _a;
|
|
68
|
+
if (context.specFromChildren) if (isSingle) context.specFromChildren[specName] = null; else {
|
|
69
|
+
const comps = null !== (_a = context.specFromChildren[specName]) && void 0 !== _a ? _a : [], index = comps.findIndex((entry => entry.id === id));
|
|
70
|
+
if (index >= 0) {
|
|
71
|
+
const newComps = comps.slice(0, index - 1).concat(comps.slice(index + 1));
|
|
72
|
+
context.specFromChildren[specName] = newComps, context.isChildrenUpdated = !0;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
//# sourceMappingURL=BaseComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["components/BaseComponent.tsx"],"names":[],"mappings":"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","file":"BaseComponent.js","sourcesContent":["import React, { useContext, useEffect } from \"react\";\nimport { isNil, pickWithout } from \"@visactor/vutils\";\n\nimport RootChartContext, { ChartContextType } from \"../context/chart\";\nimport { bindEventsToChart } from \"../eventsUtils\";\nimport { uid } from \"../util\";\n\nexport interface BaseComponentProps {\n id?: string | number;\n}\n\ntype ComponentProps = BaseComponentProps & { updateId?: number };\n\nexport const createComponent = <T extends ComponentProps>(\n componentName: string,\n specName: string,\n supportedEvents?: Record<string, string> | null,\n isSingle?: boolean\n) => {\n const ignoreKeys = [\"id\", \"updateId\"];\n const notSpecKeys = supportedEvents\n ? Object.keys(supportedEvents).concat(ignoreKeys)\n : ignoreKeys;\n\n const Comp: React.FC<T> = (props: T) => {\n const context = useContext(RootChartContext);\n const id = React.useRef<string | number>(\n isNil(props.id) ? uid(specName) : props.id\n );\n\n const eventsBinded = React.useRef<T>(null);\n const updateId = React.useRef<number>(props.updateId);\n\n const componentSpec: Partial<T> = pickWithout<T>(props, notSpecKeys);\n const hasPrevEventsBinded =\n !!supportedEvents &&\n bindEventsToChart(\n context.chart,\n props,\n eventsBinded.current,\n supportedEvents\n );\n if (hasPrevEventsBinded) {\n eventsBinded.current = props;\n }\n\n if (props.updateId !== updateId.current) {\n updateId.current = props.updateId;\n } else {\n updateToContext(context, id.current, specName, isSingle, componentSpec);\n }\n\n useEffect(() => {\n return () => {\n !!supportedEvents &&\n bindEventsToChart(\n context.chart,\n null,\n eventsBinded.current,\n supportedEvents\n );\n deleteToContext(context, id.current, specName, isSingle);\n };\n }, []);\n\n return null;\n };\n\n Comp.displayName = componentName;\n return Comp;\n};\n\nconst updateToContext = (\n context: ChartContextType,\n id: string | number,\n specName: string,\n isSingle: boolean,\n props: Partial<ComponentProps>\n) => {\n if (!context.specFromChildren) {\n return;\n }\n\n if (isSingle) {\n context.specFromChildren[specName] = { ...props };\n } else {\n if (!context.specFromChildren[specName]) {\n context.specFromChildren[specName] = [];\n }\n\n const comps = context.specFromChildren[specName];\n const index = comps.findIndex((entry: any) => entry.id === id);\n\n if (index >= 0) {\n comps[index] = {\n id,\n ...props,\n };\n } else {\n context.specFromChildren[specName].push({\n id,\n ...props,\n });\n }\n }\n context.isChildrenUpdated = true;\n};\n\nconst deleteToContext = (\n context: ChartContextType,\n id: string | number,\n specName: string,\n isSingle: boolean\n) => {\n if (!context.specFromChildren) {\n return;\n }\n\n if (isSingle) {\n context.specFromChildren[specName] = null;\n } else {\n const comps = context.specFromChildren[specName] ?? [];\n const index = comps.findIndex((entry: any) => entry.id === id);\n\n if (index >= 0) {\n const newComps = comps.slice(0, index - 1).concat(comps.slice(index + 1));\n\n context.specFromChildren[specName] = newComps;\n context.isChildrenUpdated = true;\n }\n }\n};\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseComponentProps } from './BaseComponent';
|
|
2
|
+
export interface LegendProps extends BaseComponentProps {
|
|
3
|
+
onLegendItemHover: (e: any) => void;
|
|
4
|
+
onLegendItemUnHover: (e: any) => void;
|
|
5
|
+
onLegendItemClick: (e: any) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const Legend: import("react").FC<BaseComponentProps & {
|
|
8
|
+
updateId?: number;
|
|
9
|
+
}>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
}), exports.Legend = void 0;
|
|
6
|
+
|
|
7
|
+
const eventsUtils_1 = require("../eventsUtils"), BaseComponent_1 = require("./BaseComponent");
|
|
8
|
+
|
|
9
|
+
exports.Legend = (0, BaseComponent_1.createComponent)("Legend", "legends", eventsUtils_1.LEGEND_CUSTOMIZED_EVENTS);
|
|
10
|
+
//# sourceMappingURL=Legend.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["components/Legend.tsx"],"names":[],"mappings":";;;AACA,gDAA0D;AAC1D,mDAAsE;AAQzD,QAAA,MAAM,GAAG,IAAA,+BAAe,EAAC,QAAQ,EAAE,SAAS,EAAE,sCAAwB,CAAC,CAAC","file":"Legend.js","sourcesContent":["// import type { IDiscreteLegendSpec } from '@visactor/vchart'\nimport { LEGEND_CUSTOMIZED_EVENTS } from '../eventsUtils';\nimport { BaseComponentProps, createComponent } from './BaseComponent';\n\nexport interface LegendProps extends BaseComponentProps {\n onLegendItemHover: (e: any) => void;\n onLegendItemUnHover: (e: any) => void;\n onLegendItemClick: (e: any) => void;\n}\n\nexport const Legend = createComponent('Legend', 'legends', LEGEND_CUSTOMIZED_EVENTS);\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { MarkSpec } from '@visactor/vgrammar';
|
|
3
|
+
export interface MarkProps extends Omit<MarkSpec, 'name'> {
|
|
4
|
+
id?: string | number;
|
|
5
|
+
glyphType?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface IMarkElement extends React.ReactElement<Props, React.JSXElementConstructor<Props>> {
|
|
8
|
+
id: string | number;
|
|
9
|
+
}
|
|
10
|
+
type Props = MarkProps & {
|
|
11
|
+
updateId: number;
|
|
12
|
+
};
|
|
13
|
+
export declare const Mark: React.FC<Props>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
4
|
+
void 0 === k2 && (k2 = k);
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
desc && !("get" in desc ? !m.__esModule : desc.writable || desc.configurable) || (desc = {
|
|
7
|
+
enumerable: !0,
|
|
8
|
+
get: function() {
|
|
9
|
+
return m[k];
|
|
10
|
+
}
|
|
11
|
+
}), Object.defineProperty(o, k2, desc);
|
|
12
|
+
} : function(o, m, k, k2) {
|
|
13
|
+
void 0 === k2 && (k2 = k), o[k2] = m[k];
|
|
14
|
+
}), __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", {
|
|
16
|
+
enumerable: !0,
|
|
17
|
+
value: v
|
|
18
|
+
});
|
|
19
|
+
} : function(o, v) {
|
|
20
|
+
o.default = v;
|
|
21
|
+
}), __importStar = this && this.__importStar || function(mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (null != mod) for (var k in mod) "default" !== k && Object.prototype.hasOwnProperty.call(mod, k) && __createBinding(result, mod, k);
|
|
25
|
+
return __setModuleDefault(result, mod), result;
|
|
26
|
+
}, __rest = this && this.__rest || function(s, e) {
|
|
27
|
+
var t = {};
|
|
28
|
+
for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
|
|
29
|
+
if (null != s && "function" == typeof Object.getOwnPropertySymbols) {
|
|
30
|
+
var i = 0;
|
|
31
|
+
for (p = Object.getOwnPropertySymbols(s); i < p.length; i++) e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]) && (t[p[i]] = s[p[i]]);
|
|
32
|
+
}
|
|
33
|
+
return t;
|
|
34
|
+
}, __importDefault = this && this.__importDefault || function(mod) {
|
|
35
|
+
return mod && mod.__esModule ? mod : {
|
|
36
|
+
default: mod
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
Object.defineProperty(exports, "__esModule", {
|
|
41
|
+
value: !0
|
|
42
|
+
}), exports.Mark = void 0;
|
|
43
|
+
|
|
44
|
+
const react_1 = __importStar(require("react")), vutils_1 = require("@visactor/vutils"), view_1 = __importDefault(require("../context/view")), util_1 = require("../util"), Mark = props => {
|
|
45
|
+
const context = (0, react_1.useContext)(view_1.default), id = react_1.default.useRef((0,
|
|
46
|
+
vutils_1.isNil)(props.id) ? (0, util_1.uid)("mark") : props.id);
|
|
47
|
+
return context && addOrUpdateMark(context, id.current, props), (0, react_1.useEffect)((() => () => {
|
|
48
|
+
context && removeMark(context, id.current);
|
|
49
|
+
}), []), null;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
exports.Mark = Mark;
|
|
53
|
+
|
|
54
|
+
const addOrUpdateMark = (view, id, props) => {
|
|
55
|
+
var _a;
|
|
56
|
+
if (!view.renderer) return;
|
|
57
|
+
let mark = view.getMarkById(id);
|
|
58
|
+
const {group: group, glyphType: glyphType, updateId: updateId} = props, others = __rest(props, [ "group", "glyphType", "updateId" ]);
|
|
59
|
+
mark || (mark = view.mark(props.type, null !== (_a = props.group) && void 0 !== _a ? _a : view.rootMark, props.glyphType ? {
|
|
60
|
+
glyphType: props.glyphType
|
|
61
|
+
} : null).name(id)), mark.parse(others), view.runAsync();
|
|
62
|
+
}, removeMark = (view, id) => {
|
|
63
|
+
if (view.renderer) {
|
|
64
|
+
view.getMarkById(id);
|
|
65
|
+
view.removeGrammar(id);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=Mark.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["components/Mark.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAqD;AACrD,6CAAyC;AAGzC,2DAA0C;AAC1C,kCAA8B;AAavB,MAAM,IAAI,GAAoB,CAAC,KAAY,EAAE,EAAE;IACpD,MAAM,OAAO,GAAG,IAAA,kBAAU,EAAC,cAAW,CAAC,CAAC;IACxC,MAAM,EAAE,GAAG,eAAK,CAAC,MAAM,CAAkB,IAAA,cAAK,EAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAA,UAAG,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAEnF,IAAI,OAAO,EAAE;QACX,eAAe,CAAC,OAAO,EAAE,EAAE,CAAC,OAAiB,EAAE,KAAK,CAAC,CAAC;KACvD;IAED,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,OAAO,GAAG,EAAE;YACV,IAAI,OAAO,EAAE;gBACX,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,OAAiB,CAAC,CAAC;aAC3C;QACH,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAjBW,QAAA,IAAI,QAiBf;AAEF,MAAM,eAAe,GAAG,CAAC,IAAW,EAAE,EAAU,EAAE,KAAY,EAAE,EAAE;;IAChE,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;QAElB,OAAO;KACR;IAED,IAAI,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;IAChC,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,KAAgB,KAAK,EAAhB,MAAM,UAAK,KAAK,EAAjD,kCAAyC,CAAQ,CAAC;IACxD,IAAI,CAAC,IAAI,EAAE;QACT,IAAI,GAAI,IAAY;aACjB,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,MAAA,KAAK,CAAC,KAAK,mCAAI,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;aACvG,IAAI,CAAC,EAAE,CAAC,CAAC;KACb;IAED,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACnB,IAAI,CAAC,QAAQ,EAAE,CAAC;AAClB,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG,CAAC,IAAW,EAAE,EAAU,EAAE,EAAE;IAC7C,IAAI,IAAI,CAAC,QAAQ,EAAE;QACjB,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;QACjC,IAAY,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;KACjC;AACH,CAAC,CAAC","file":"Mark.js","sourcesContent":["import React, { useContext, useEffect } from 'react';\nimport { isNil } from '@visactor/vutils';\nimport type { IView, MarkSpec } from '@visactor/vgrammar';\n\nimport ViewContext from '../context/view';\nimport { uid } from '../util';\n\nexport interface MarkProps extends Omit<MarkSpec, 'name'> {\n id?: string | number;\n glyphType?: string;\n}\n\nexport interface IMarkElement extends React.ReactElement<Props, React.JSXElementConstructor<Props>> {\n id: string | number;\n}\n\ntype Props = MarkProps & { updateId: number };\n\nexport const Mark: React.FC<Props> = (props: Props) => {\n const context = useContext(ViewContext);\n const id = React.useRef<string | number>(isNil(props.id) ? uid('mark') : props.id);\n\n if (context) {\n addOrUpdateMark(context, id.current as string, props);\n }\n\n useEffect(() => {\n return () => {\n if (context) {\n removeMark(context, id.current as string);\n }\n };\n }, []);\n\n return null;\n};\n\nconst addOrUpdateMark = (view: IView, id: string, props: Props) => {\n if (!view.renderer) {\n // view has been released\n return;\n }\n\n let mark = view.getMarkById(id);\n const { group, glyphType, updateId, ...others } = props;\n if (!mark) {\n mark = (view as any)\n .mark(props.type, props.group ?? view.rootMark, props.glyphType ? { glyphType: props.glyphType } : null)\n .name(id);\n }\n\n mark.parse(others);\n view.runAsync();\n};\n\nconst removeMark = (view: IView, id: string) => {\n if (view.renderer) {\n const mark = view.getMarkById(id);\n (view as any).removeGrammar(id);\n }\n};\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
}), exports.Region = void 0;
|
|
6
|
+
|
|
7
|
+
const BaseComponent_1 = require("./BaseComponent");
|
|
8
|
+
|
|
9
|
+
exports.Region = (0, BaseComponent_1.createComponent)("Region", "region");
|
|
10
|
+
//# sourceMappingURL=Region.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["components/Region.tsx"],"names":[],"mappings":";;;AACA,mDAAkD;AAMrC,QAAA,MAAM,GAAG,IAAA,+BAAe,EAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC","file":"Region.js","sourcesContent":["// import type { IRegionSpec } from '@visactor/vchart'\nimport { createComponent } from './BaseComponent';\n\nexport interface RegionProps {\n //\n}\n\nexport const Region = createComponent('Region', 'region');\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
4
|
+
void 0 === k2 && (k2 = k);
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
desc && !("get" in desc ? !m.__esModule : desc.writable || desc.configurable) || (desc = {
|
|
7
|
+
enumerable: !0,
|
|
8
|
+
get: function() {
|
|
9
|
+
return m[k];
|
|
10
|
+
}
|
|
11
|
+
}), Object.defineProperty(o, k2, desc);
|
|
12
|
+
} : function(o, m, k, k2) {
|
|
13
|
+
void 0 === k2 && (k2 = k), o[k2] = m[k];
|
|
14
|
+
}), __exportStar = this && this.__exportStar || function(m, exports) {
|
|
15
|
+
for (var p in m) "default" === p || Object.prototype.hasOwnProperty.call(exports, p) || __createBinding(exports, m, p);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
Object.defineProperty(exports, "__esModule", {
|
|
19
|
+
value: !0
|
|
20
|
+
}), __exportStar(require("./Axis"), exports), __exportStar(require("./Mark"), exports),
|
|
21
|
+
__exportStar(require("./Region"), exports), __exportStar(require("./Legend"), exports);
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["components/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB;AACvB,yCAAuB;AACvB,2CAAyB;AACzB,2CAAyB","file":"index.js","sourcesContent":["export * from './Axis';\nexport * from './Mark';\nexport * from './Region';\nexport * from './Legend';"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const REACT_PRIVATE_PROPS: string[];
|
package/cjs/constants.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,mBAAmB,GAAG,CAAC,UAAU,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC","file":"constants.js","sourcesContent":["export const REACT_PRIVATE_PROPS = [\"children\", \"hooks\", \"ref\"];\n\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface ContainerProps {
|
|
3
|
+
style?: React.CSSProperties;
|
|
4
|
+
className?: string;
|
|
5
|
+
width?: number | string;
|
|
6
|
+
height?: number | string;
|
|
7
|
+
}
|
|
8
|
+
export default function withContainer<Props extends ContainerProps, CompProps>(Comp: typeof React.Component<any, CompProps>, name?: string, getProps?: (props: any) => CompProps): React.ForwardRefExoticComponent<React.PropsWithoutRef<Props> & React.RefAttributes<any>>;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
4
|
+
void 0 === k2 && (k2 = k);
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
desc && !("get" in desc ? !m.__esModule : desc.writable || desc.configurable) || (desc = {
|
|
7
|
+
enumerable: !0,
|
|
8
|
+
get: function() {
|
|
9
|
+
return m[k];
|
|
10
|
+
}
|
|
11
|
+
}), Object.defineProperty(o, k2, desc);
|
|
12
|
+
} : function(o, m, k, k2) {
|
|
13
|
+
void 0 === k2 && (k2 = k), o[k2] = m[k];
|
|
14
|
+
}), __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", {
|
|
16
|
+
enumerable: !0,
|
|
17
|
+
value: v
|
|
18
|
+
});
|
|
19
|
+
} : function(o, v) {
|
|
20
|
+
o.default = v;
|
|
21
|
+
}), __importStar = this && this.__importStar || function(mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (null != mod) for (var k in mod) "default" !== k && Object.prototype.hasOwnProperty.call(mod, k) && __createBinding(result, mod, k);
|
|
25
|
+
return __setModuleDefault(result, mod), result;
|
|
26
|
+
}, __rest = this && this.__rest || function(s, e) {
|
|
27
|
+
var t = {};
|
|
28
|
+
for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
|
|
29
|
+
if (null != s && "function" == typeof Object.getOwnPropertySymbols) {
|
|
30
|
+
var i = 0;
|
|
31
|
+
for (p = Object.getOwnPropertySymbols(s); i < p.length; i++) e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]) && (t[p[i]] = s[p[i]]);
|
|
32
|
+
}
|
|
33
|
+
return t;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
Object.defineProperty(exports, "__esModule", {
|
|
37
|
+
value: !0
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const react_1 = __importStar(require("react"));
|
|
41
|
+
|
|
42
|
+
function withContainer(Comp, name = "ChartContainer", getProps) {
|
|
43
|
+
const Cls = react_1.default.forwardRef(((props, ref) => {
|
|
44
|
+
const container = (0, react_1.useRef)(), [inited, setInited] = (0, react_1.useState)(!1), {className: className, style: style, width: width} = props, options = __rest(props, [ "className", "style", "width" ]);
|
|
45
|
+
return (0, react_1.useLayoutEffect)((() => {
|
|
46
|
+
setInited(!0);
|
|
47
|
+
}), []), react_1.default.createElement("div", {
|
|
48
|
+
ref: container,
|
|
49
|
+
className: className,
|
|
50
|
+
style: Object.assign({
|
|
51
|
+
position: "relative",
|
|
52
|
+
height: props.height || "100%",
|
|
53
|
+
width: props.width || "100%"
|
|
54
|
+
}, style)
|
|
55
|
+
}, inited ? react_1.default.createElement(Comp, Object.assign({
|
|
56
|
+
ref: ref,
|
|
57
|
+
container: container.current
|
|
58
|
+
}, getProps ? getProps(options) : options)) : react_1.default.createElement(react_1.default.Fragment, null));
|
|
59
|
+
}));
|
|
60
|
+
return Cls.displayName = name || Comp.name, Cls;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
exports.default = withContainer;
|
|
64
|
+
//# sourceMappingURL=withContainer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["containers/withContainer.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiE;AASjE,SAAwB,aAAa,CACnC,IAA4C,EAC5C,OAAe,gBAAgB,EAC/B,QAAoC;IAEpC,MAAM,GAAG,GAAG,eAAK,CAAC,UAAU,CAAa,CAAC,KAAY,EAAE,GAAG,EAAE,EAAE;QAC7D,MAAM,SAAS,GAAG,IAAA,cAAM,GAAE,CAAC;QAC3B,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;QAC5C,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,KAAiB,KAAK,EAAjB,OAAO,UAAK,KAAK,EAA/C,+BAAuC,CAAQ,CAAC;QAEtD,IAAA,uBAAe,EAAC,GAAG,EAAE;YACnB,SAAS,CAAC,IAAI,CAAC,CAAC;QAClB,CAAC,EAAE,EAAE,CAAC,CAAC;QAEP,OAAO,CACL,uCACE,GAAG,EAAE,SAAS,EACd,SAAS,EAAE,SAAS,EACpB,KAAK,kBACH,QAAQ,EAAE,UAAU,EACpB,MAAM,EAAE,KAAK,CAAC,MAAM,IAAI,MAAM,EAC9B,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,MAAM,IACzB,KAAK,KAGT,MAAM,CAAC,CAAC,CAAC,CACR,8BAAC,IAAI,kBACH,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,SAAS,CAAC,OAAO,IACxB,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAE,OAAqB,CAAC,EAC3D,CACH,CAAC,CAAC,CAAC,CACF,6DAAK,CACN,CACG,CACP,CAAC;IACJ,CAAC,CAAC,CAAC;IACH,GAAG,CAAC,WAAW,GAAG,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC;IACpC,OAAO,GAAG,CAAC;AACb,CAAC;AAvCD,gCAuCC","file":"withContainer.js","sourcesContent":["import React, { useRef, useState, useLayoutEffect } from \"react\";\n\nexport interface ContainerProps {\n style?: React.CSSProperties;\n className?: string;\n width?: number | string;\n height?: number | string;\n}\n\nexport default function withContainer<Props extends ContainerProps, CompProps>(\n Comp: typeof React.Component<any, CompProps>,\n name: string = \"ChartContainer\",\n getProps?: (props: any) => CompProps\n) {\n const Cls = React.forwardRef<any, Props>((props: Props, ref) => {\n const container = useRef();\n const [inited, setInited] = useState(false);\n const { className, style, width, ...options } = props;\n\n useLayoutEffect(() => {\n setInited(true);\n }, []);\n\n return (\n <div\n ref={container}\n className={className}\n style={{\n position: \"relative\",\n height: props.height || \"100%\",\n width: props.width || \"100%\",\n ...style,\n }}\n >\n {inited ? (\n <Comp\n ref={ref}\n container={container.current}\n {...(getProps ? getProps(options) : (options as CompProps))}\n />\n ) : (\n <></>\n )}\n </div>\n );\n });\n Cls.displayName = name || Comp.name;\n return Cls;\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type VChart from '@visactor/vchart';
|
|
3
|
+
export interface ChartContextType {
|
|
4
|
+
chart?: VChart;
|
|
5
|
+
specFromChildren: any;
|
|
6
|
+
isChildrenUpdated?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare const ChartContext: React.Context<ChartContextType>;
|
|
9
|
+
export declare function withChartInstance<T>(Component: typeof React.Component): React.ForwardRefExoticComponent<React.PropsWithoutRef<T> & React.RefAttributes<any>>;
|
|
10
|
+
export default ChartContext;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __importDefault = this && this.__importDefault || function(mod) {
|
|
4
|
+
return mod && mod.__esModule ? mod : {
|
|
5
|
+
default: mod
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, "__esModule", {
|
|
10
|
+
value: !0
|
|
11
|
+
}), exports.withChartInstance = void 0;
|
|
12
|
+
|
|
13
|
+
const react_1 = __importDefault(require("react")), ChartContext = react_1.default.createContext(null);
|
|
14
|
+
|
|
15
|
+
function withChartInstance(Component) {
|
|
16
|
+
const Com = react_1.default.forwardRef(((props, ref) => react_1.default.createElement(ChartContext.Consumer, null, (ctx => react_1.default.createElement(Component, Object.assign({
|
|
17
|
+
ref: ref,
|
|
18
|
+
chart: ctx.chart
|
|
19
|
+
}, props))))));
|
|
20
|
+
return Com.displayName = Component.name, Com;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
ChartContext.displayName = "ChartContext", exports.withChartInstance = withChartInstance,
|
|
24
|
+
exports.default = ChartContext;
|
|
25
|
+
//# sourceMappingURL=chart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["context/chart.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAS1B,MAAM,YAAY,GAAG,eAAK,CAAC,aAAa,CAAmB,IAAI,CAAC,CAAC;AACjE,YAAY,CAAC,WAAW,GAAG,cAAc,CAAC;AAE1C,SAAgB,iBAAiB,CAAI,SAAiC;IACpE,MAAM,GAAG,GAAG,eAAK,CAAC,UAAU,CAAS,CAAC,KAAQ,EAAE,GAAG,EAAE,EAAE;QACrD,OAAO,CACL,8BAAC,YAAY,CAAC,QAAQ,QACnB,CAAC,GAAqB,EAAE,EAAE,CAAC,8BAAC,SAAS,kBAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,IAAM,KAAK,EAAI,CAC1D,CACzB,CAAC;IACJ,CAAC,CAAC,CAAC;IACH,GAAG,CAAC,WAAW,GAAG,SAAS,CAAC,IAAI,CAAC;IACjC,OAAO,GAAG,CAAC;AACb,CAAC;AAVD,8CAUC;AAED,kBAAe,YAAY,CAAC","file":"chart.js","sourcesContent":["import React from 'react';\nimport type VChart from '@visactor/vchart';\n\nexport interface ChartContextType {\n chart?: VChart;\n specFromChildren: any;\n isChildrenUpdated?: boolean;\n}\n\nconst ChartContext = React.createContext<ChartContextType>(null);\nChartContext.displayName = 'ChartContext';\n\nexport function withChartInstance<T>(Component: typeof React.Component) {\n const Com = React.forwardRef<any, T>((props: T, ref) => {\n return (\n <ChartContext.Consumer>\n {(ctx: ChartContextType) => <Component ref={ref} chart={ctx.chart} {...props} />}\n </ChartContext.Consumer>\n );\n });\n Com.displayName = Component.name;\n return Com;\n}\n\nexport default ChartContext;\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __importDefault = this && this.__importDefault || function(mod) {
|
|
4
|
+
return mod && mod.__esModule ? mod : {
|
|
5
|
+
default: mod
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, "__esModule", {
|
|
10
|
+
value: !0
|
|
11
|
+
}), exports.withStage = void 0;
|
|
12
|
+
|
|
13
|
+
const react_1 = __importDefault(require("react")), StageContext = react_1.default.createContext(null);
|
|
14
|
+
|
|
15
|
+
function withStage(Component) {
|
|
16
|
+
const Com = react_1.default.forwardRef(((props, ref) => react_1.default.createElement(StageContext.Consumer, null, (ctx => react_1.default.createElement(Component, Object.assign({
|
|
17
|
+
ref: ref,
|
|
18
|
+
stage: ctx
|
|
19
|
+
}, props))))));
|
|
20
|
+
return Com.displayName = Component.name, Com;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
StageContext.displayName = "StageContext", exports.withStage = withStage, exports.default = StageContext;
|
|
24
|
+
//# sourceMappingURL=stage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["context/stage.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAG1B,MAAM,YAAY,GAAG,eAAK,CAAC,aAAa,CAAQ,IAAI,CAAC,CAAC;AACtD,YAAY,CAAC,WAAW,GAAG,cAAc,CAAC;AAE1C,SAAgB,SAAS,CAAI,SAAiC;IAC5D,MAAM,GAAG,GAAG,eAAK,CAAC,UAAU,CAAS,CAAC,KAAQ,EAAE,GAAG,EAAE,EAAE;QACrD,OAAO,8BAAC,YAAY,CAAC,QAAQ,QAAE,GAAG,CAAC,EAAE,CAAC,8BAAC,SAAS,kBAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,IAAM,KAAK,EAAI,CAAyB,CAAC;IAChH,CAAC,CAAC,CAAC;IACH,GAAG,CAAC,WAAW,GAAG,SAAS,CAAC,IAAI,CAAC;IACjC,OAAO,GAAG,CAAC;AACb,CAAC;AAND,8BAMC;AAED,kBAAe,YAAY,CAAC","file":"stage.js","sourcesContent":["import React from 'react';\nimport type { Stage } from '@visactor/vrender';\n\nconst StageContext = React.createContext<Stage>(null);\nStageContext.displayName = 'StageContext';\n\nexport function withStage<T>(Component: typeof React.Component) {\n const Com = React.forwardRef<any, T>((props: T, ref) => {\n return <StageContext.Consumer>{ctx => <Component ref={ref} stage={ctx} {...props} />}</StageContext.Consumer>;\n });\n Com.displayName = Component.name;\n return Com;\n}\n\nexport default StageContext;\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { IView } from "@visactor/vgrammar";
|
|
3
|
+
declare const ViewContext: React.Context<IView>;
|
|
4
|
+
export declare function withView<T>(Component: typeof React.Component): React.ForwardRefExoticComponent<React.PropsWithoutRef<T> & React.RefAttributes<any>>;
|
|
5
|
+
export default ViewContext;
|