@react-fabric/chart 1.0.0-beta.61 → 1.0.0-beta.63
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/css/_chart.css +7 -6
- package/dist/cjs/charts/ActivityMap.js +1 -1
- package/dist/cjs/charts/CountSeries.js +1 -1
- package/dist/cjs/charts/DataSeries.js +1 -1
- package/dist/cjs/charts/MapSeries.js +1 -1
- package/dist/cjs/charts/TimeSeries.js +1 -1
- package/dist/cjs/charts/TimeSlider.js +1 -1
- package/dist/cjs/charts/WordBubble.js +1 -1
- package/dist/cjs/theme/index.js +5 -5
- package/dist/cjs/types/utils.js +3 -3
- package/dist/cjs/wrapper/ChartContainer.js +2 -2
- package/dist/cjs/wrapper/ChartToolbar.js +1 -1
- package/dist/esm/charts/ActivityMap.js +1 -1
- package/dist/esm/charts/CountSeries.js +1 -1
- package/dist/esm/charts/DataSeries.js +1 -1
- package/dist/esm/charts/MapSeries.js +1 -1
- package/dist/esm/charts/TimeSeries.js +1 -1
- package/dist/esm/charts/TimeSlider.js +1 -1
- package/dist/esm/charts/WordBubble.js +1 -1
- package/dist/esm/theme/index.js +5 -5
- package/dist/esm/types/utils.js +3 -3
- package/dist/esm/wrapper/ChartContainer.js +2 -2
- package/dist/esm/wrapper/ChartToolbar.js +1 -1
- package/dist/types/charts/ActivityMap.d.ts +1 -1
- package/dist/types/charts/CountSeries.d.ts +1 -1
- package/dist/types/charts/DataSeries.d.ts +1 -1
- package/dist/types/charts/Generic.d.ts +1 -1
- package/dist/types/charts/MapSeries.d.ts +1 -1
- package/dist/types/charts/TimeSeries.d.ts +1 -1
- package/dist/types/charts/TimeSlider.d.ts +1 -1
- package/dist/types/charts/WordBubble.d.ts +1 -1
- package/dist/types/wrapper/ChartWrapper.d.ts +2 -2
- package/package.json +11 -11
- package/src/charts/ActivityMap.tsx +1 -1
- package/src/charts/CountSeries.tsx +1 -1
- package/src/charts/DataSeries.tsx +1 -1
- package/src/charts/Generic.tsx +1 -1
- package/src/charts/MapSeries.tsx +1 -1
- package/src/charts/TimeSeries.tsx +1 -1
- package/src/charts/TimeSlider.tsx +1 -1
- package/src/charts/WordBubble.tsx +1 -1
- package/src/theme/index.ts +5 -5
- package/src/types/utils.ts +3 -3
- package/src/wrapper/ChartContainer.tsx +5 -6
- package/src/wrapper/ChartToolbar.tsx +2 -2
- package/src/wrapper/ChartWrapper.tsx +5 -1
package/css/_chart.css
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
|
-
.
|
|
24
|
+
.fabric-chartContainer {
|
|
25
25
|
& > div:last-child:not(:first-child) > :last-child {
|
|
26
26
|
top: 0;
|
|
27
27
|
right: unset !important;
|
|
@@ -38,16 +38,17 @@
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
.
|
|
41
|
+
.fabric-chartToolbar {
|
|
42
42
|
input[type="range"] {
|
|
43
43
|
position: relative;
|
|
44
44
|
|
|
45
45
|
overflow: hidden;
|
|
46
46
|
|
|
47
|
+
border-radius: 999px;
|
|
48
|
+
|
|
47
49
|
color: var(--color-primary-500);
|
|
48
50
|
|
|
49
51
|
appearance: none;
|
|
50
|
-
border-radius: 999px;
|
|
51
52
|
|
|
52
53
|
&::-webkit-slider-thumb {
|
|
53
54
|
cursor: pointer;
|
|
@@ -56,6 +57,8 @@
|
|
|
56
57
|
|
|
57
58
|
width: 1rem;
|
|
58
59
|
height: 1rem;
|
|
60
|
+
border: 1px solid var(--color-tint-50);
|
|
61
|
+
border-radius: 0.5rem;
|
|
59
62
|
|
|
60
63
|
appearance: none;
|
|
61
64
|
opacity: 0.7;
|
|
@@ -71,8 +74,6 @@
|
|
|
71
74
|
calc(100% + 1px) calc(100% + 1px)
|
|
72
75
|
);
|
|
73
76
|
filter: brightness(100%);
|
|
74
|
-
border: 1px solid var(--color-tint-50);
|
|
75
|
-
border-radius: 0.5rem;
|
|
76
77
|
box-shadow: calc(-100vmax - 1rem) 0 0 100vmax currentColor;
|
|
77
78
|
|
|
78
79
|
&:hover {
|
|
@@ -82,9 +83,9 @@
|
|
|
82
83
|
|
|
83
84
|
&&::-webkit-slider-runnable-track {
|
|
84
85
|
height: 1rem;
|
|
86
|
+
border-radius: 99px;
|
|
85
87
|
background: linear-gradient(var(--color-tint-100) 0 0) scroll no-repeat
|
|
86
88
|
center / 100% 0.25rem;
|
|
87
|
-
border-radius: 99px;
|
|
88
89
|
}
|
|
89
90
|
}
|
|
90
91
|
}
|
|
@@ -188,7 +188,7 @@ ActivityMapChart.displayName = "ActivityMapChart";
|
|
|
188
188
|
* and customize the color palette used in the chart.
|
|
189
189
|
*
|
|
190
190
|
* @param {ActivityMapProps} props - The properties for the ActivityMap component.
|
|
191
|
-
* @returns {
|
|
191
|
+
* @returns {React.ReactElement} The rendered ActivityMap component.
|
|
192
192
|
*
|
|
193
193
|
* @example
|
|
194
194
|
* ```jsx
|
|
@@ -155,7 +155,7 @@ CountSeriesChart.displayName = "CountSeriesChart";
|
|
|
155
155
|
* It allows users to switch between different types of visualizations and customize the color palette used in the chart.
|
|
156
156
|
*
|
|
157
157
|
* @param {CountSeriesProps} props - The properties for the CountSeries component.
|
|
158
|
-
* @returns {
|
|
158
|
+
* @returns {React.ReactElement} The rendered CountSeries component.
|
|
159
159
|
*
|
|
160
160
|
* @example
|
|
161
161
|
* ```jsx
|
|
@@ -182,7 +182,7 @@ DataSeriesChart.displayName = "DataSeriesChart";
|
|
|
182
182
|
* It allows users to click on data points to trigger custom actions.
|
|
183
183
|
*
|
|
184
184
|
* @param {DataSeriesProps} props - The properties for the DataSeries component.
|
|
185
|
-
* @returns {
|
|
185
|
+
* @returns {React.ReactElement} The rendered DataSeries component.
|
|
186
186
|
*
|
|
187
187
|
* @example
|
|
188
188
|
* ```jsx
|
|
@@ -210,7 +210,7 @@ MapSeriesChart.displayName = "MapSeriesChart";
|
|
|
210
210
|
* It supports zooming and switching between map and column views.
|
|
211
211
|
*
|
|
212
212
|
* @param {MapSeriesProps} props - The properties for the MapSeries component.
|
|
213
|
-
* @returns {
|
|
213
|
+
* @returns {React.ReactElement} The rendered MapSeries component.
|
|
214
214
|
*
|
|
215
215
|
* @example
|
|
216
216
|
* ```jsx
|
|
@@ -210,7 +210,7 @@ TimeSeriesChart.displayName = "TimeSeriesChart";
|
|
|
210
210
|
* It also allows for interaction through click and brush events.
|
|
211
211
|
*
|
|
212
212
|
* @param {TimeSeriesProps} props - The properties for the TimeSeries component.
|
|
213
|
-
* @returns {
|
|
213
|
+
* @returns {React.ReactElement} The rendered TimeSeries component.
|
|
214
214
|
*
|
|
215
215
|
* @example
|
|
216
216
|
* ```jsx
|
|
@@ -190,7 +190,7 @@ TimeSliderChart.displayName = "TimeSliderChart";
|
|
|
190
190
|
* and it emits an event when the range is changed.
|
|
191
191
|
*
|
|
192
192
|
* @param {TimeSliderProps} props - The properties for the TimeSlider component.
|
|
193
|
-
* @returns {
|
|
193
|
+
* @returns {React.ReactElement} The rendered TimeSlider component.
|
|
194
194
|
*
|
|
195
195
|
* @example
|
|
196
196
|
* ```jsx
|
|
@@ -81,7 +81,7 @@ WordBubbleChart.displayName = "WordBubbleChart";
|
|
|
81
81
|
* It also supports exporting the chart and displays an empty state when no data is available.
|
|
82
82
|
*
|
|
83
83
|
* @param {WordBubbleProps} props - The properties for the WordBubble component.
|
|
84
|
-
* @returns {
|
|
84
|
+
* @returns {React.ReactElement} The rendered WordBubble component.
|
|
85
85
|
*
|
|
86
86
|
* @example
|
|
87
87
|
* ```jsx
|
package/dist/cjs/theme/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
4
4
|
var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
|
|
5
|
-
var
|
|
5
|
+
var chroma = require('chroma-js');
|
|
6
6
|
var darkBase = require('./darkBase.js');
|
|
7
7
|
var lightBase = require('./lightBase.js');
|
|
8
8
|
var palettes = require('./palettes.js');
|
|
@@ -14,8 +14,8 @@ var makePaletteSequence = function makePaletteSequence(colors) {
|
|
|
14
14
|
};
|
|
15
15
|
var registerTheme = function registerTheme(echarts, key, colors, heatmap) {
|
|
16
16
|
var base = colors[0];
|
|
17
|
-
var handles =
|
|
18
|
-
var window =
|
|
17
|
+
var handles = chroma.mix(base, "#f1f5f9", 0.15, "lab").hex();
|
|
18
|
+
var window = chroma(base).alpha(0.1).hex();
|
|
19
19
|
echarts.registerTheme("".concat(key), _objectSpread(_objectSpread({}, lightBase.LightThemeBase), {}, {
|
|
20
20
|
dataZoom: _objectSpread(_objectSpread({}, lightBase.LightThemeBase.dataZoom), {}, {
|
|
21
21
|
fillerColor: window,
|
|
@@ -24,7 +24,7 @@ var registerTheme = function registerTheme(echarts, key, colors, heatmap) {
|
|
|
24
24
|
color: base
|
|
25
25
|
},
|
|
26
26
|
lineStyle: {
|
|
27
|
-
color:
|
|
27
|
+
color: chroma.mix(base, "#0f172a", 0.35, "lab").hex()
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
30
|
handleColor: base,
|
|
@@ -58,7 +58,7 @@ var registerTheme = function registerTheme(echarts, key, colors, heatmap) {
|
|
|
58
58
|
fillerColor: window,
|
|
59
59
|
selectedDataBackground: {
|
|
60
60
|
areaStyle: {
|
|
61
|
-
color:
|
|
61
|
+
color: chroma.mix(base, "#f1f5f9", 0.35, "lab").hex()
|
|
62
62
|
},
|
|
63
63
|
lineStyle: {
|
|
64
64
|
color: base
|
package/dist/cjs/types/utils.js
CHANGED
|
@@ -27,7 +27,7 @@ var seriesRenderer = function seriesRenderer(opt) {
|
|
|
27
27
|
var radar = (_opt$radar = opt.radar) === null || _opt$radar === void 0 ? void 0 : _opt$radar[0];
|
|
28
28
|
var axis = ((_opt$xAxis3 = opt.xAxis) === null || _opt$xAxis3 === void 0 ? void 0 : _opt$xAxis3[0].type) !== "value" ? (_opt$xAxis4 = opt.xAxis) === null || _opt$xAxis4 === void 0 ? void 0 : _opt$xAxis4[0] : (_opt$yAxis2 = opt.yAxis) === null || _opt$yAxis2 === void 0 ? void 0 : _opt$yAxis2[0];
|
|
29
29
|
var series = opt.series;
|
|
30
|
-
var table = ['<table class="border-separate border-spacing-1 mx-auto table-fixed min-w-full"><thead><tr class="sticky top-0 bg-
|
|
30
|
+
var table = ['<table class="border-separate border-spacing-1 mx-auto table-fixed min-w-full"><thead><tr class="sticky top-0 bg-default"><th></th>'];
|
|
31
31
|
table.push.apply(table, _toConsumableArray(series.map(function (s) {
|
|
32
32
|
var _s$name3;
|
|
33
33
|
return "<th class=\"truncate\">".concat((_s$name3 = s.name) !== null && _s$name3 !== void 0 ? _s$name3 : s.id, "</th>");
|
|
@@ -59,7 +59,7 @@ var seriesRenderer = function seriesRenderer(opt) {
|
|
|
59
59
|
};
|
|
60
60
|
var timeSeriesRenderer = function timeSeriesRenderer(opt) {
|
|
61
61
|
var series = opt.series;
|
|
62
|
-
var table = ['<table class="border-separate border-spacing-1 mx-auto table-fixed min-w-full"><thead><tr class="sticky top-0 bg-
|
|
62
|
+
var table = ['<table class="border-separate border-spacing-1 mx-auto table-fixed min-w-full"><thead><tr class="sticky top-0 bg-default"><th></th>'];
|
|
63
63
|
table.push.apply(table, _toConsumableArray(series.map(function (s) {
|
|
64
64
|
var _s$name4;
|
|
65
65
|
return "<th>".concat((_s$name4 = s.name) !== null && _s$name4 !== void 0 ? _s$name4 : s.id, "</th>");
|
|
@@ -79,7 +79,7 @@ var timeSeriesRenderer = function timeSeriesRenderer(opt) {
|
|
|
79
79
|
var activityRenderer = function activityRenderer(opt) {
|
|
80
80
|
var axis = opt.xAxis[0];
|
|
81
81
|
var series = opt.series;
|
|
82
|
-
var table = ['<table class="border-separate border-spacing-1 mx-auto table-fixed min-w-full"><thead><tr><th class="sticky top-0 bg-
|
|
82
|
+
var table = ['<table class="border-separate border-spacing-1 mx-auto table-fixed min-w-full"><thead><tr><th class="sticky top-0 bg-default"></th>'];
|
|
83
83
|
table.push.apply(table, _toConsumableArray(series.map(function (s) {
|
|
84
84
|
var _s$name5;
|
|
85
85
|
return "<th>".concat((_s$name5 = s.name) !== null && _s$name5 !== void 0 ? _s$name5 : s.id, "</th>");
|
|
@@ -159,9 +159,9 @@ var ChartContainer = /*#__PURE__*/react.memo(function (_ref2) {
|
|
|
159
159
|
})]
|
|
160
160
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
161
161
|
ref: containerRef,
|
|
162
|
-
className: classNames("
|
|
162
|
+
className: classNames("fabric-chartContainer", "overflow-hidden area-content")
|
|
163
163
|
}), isEmpty && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
164
|
-
className: "absolute inset-0 bg-
|
|
164
|
+
className: "absolute inset-0 bg-default grid place-content-center",
|
|
165
165
|
children: /*#__PURE__*/jsxRuntime.jsx(core.EmptyContent, {
|
|
166
166
|
icon: emptyIcon !== null && emptyIcon !== void 0 ? emptyIcon : "icon-[mdi--chart-line]",
|
|
167
167
|
message: "Empty chart"
|
|
@@ -29,7 +29,7 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
29
29
|
var ChartToolbar = function ChartToolbar(_ref) {
|
|
30
30
|
var children = _ref.children;
|
|
31
31
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
32
|
-
className: classNames("flex flex-nowrap items-center justify-end bg-
|
|
32
|
+
className: classNames("flex flex-nowrap items-center justify-end bg-default area-head", "fabric-chartToolbar empty:hidden"),
|
|
33
33
|
children: children
|
|
34
34
|
});
|
|
35
35
|
};
|
|
@@ -188,7 +188,7 @@ ActivityMapChart.displayName = "ActivityMapChart";
|
|
|
188
188
|
* and customize the color palette used in the chart.
|
|
189
189
|
*
|
|
190
190
|
* @param {ActivityMapProps} props - The properties for the ActivityMap component.
|
|
191
|
-
* @returns {
|
|
191
|
+
* @returns {React.ReactElement} The rendered ActivityMap component.
|
|
192
192
|
*
|
|
193
193
|
* @example
|
|
194
194
|
* ```jsx
|
|
@@ -155,7 +155,7 @@ CountSeriesChart.displayName = "CountSeriesChart";
|
|
|
155
155
|
* It allows users to switch between different types of visualizations and customize the color palette used in the chart.
|
|
156
156
|
*
|
|
157
157
|
* @param {CountSeriesProps} props - The properties for the CountSeries component.
|
|
158
|
-
* @returns {
|
|
158
|
+
* @returns {React.ReactElement} The rendered CountSeries component.
|
|
159
159
|
*
|
|
160
160
|
* @example
|
|
161
161
|
* ```jsx
|
|
@@ -182,7 +182,7 @@ DataSeriesChart.displayName = "DataSeriesChart";
|
|
|
182
182
|
* It allows users to click on data points to trigger custom actions.
|
|
183
183
|
*
|
|
184
184
|
* @param {DataSeriesProps} props - The properties for the DataSeries component.
|
|
185
|
-
* @returns {
|
|
185
|
+
* @returns {React.ReactElement} The rendered DataSeries component.
|
|
186
186
|
*
|
|
187
187
|
* @example
|
|
188
188
|
* ```jsx
|
|
@@ -191,7 +191,7 @@ MapSeriesChart.displayName = "MapSeriesChart";
|
|
|
191
191
|
* It supports zooming and switching between map and column views.
|
|
192
192
|
*
|
|
193
193
|
* @param {MapSeriesProps} props - The properties for the MapSeries component.
|
|
194
|
-
* @returns {
|
|
194
|
+
* @returns {React.ReactElement} The rendered MapSeries component.
|
|
195
195
|
*
|
|
196
196
|
* @example
|
|
197
197
|
* ```jsx
|
|
@@ -210,7 +210,7 @@ TimeSeriesChart.displayName = "TimeSeriesChart";
|
|
|
210
210
|
* It also allows for interaction through click and brush events.
|
|
211
211
|
*
|
|
212
212
|
* @param {TimeSeriesProps} props - The properties for the TimeSeries component.
|
|
213
|
-
* @returns {
|
|
213
|
+
* @returns {React.ReactElement} The rendered TimeSeries component.
|
|
214
214
|
*
|
|
215
215
|
* @example
|
|
216
216
|
* ```jsx
|
|
@@ -190,7 +190,7 @@ TimeSliderChart.displayName = "TimeSliderChart";
|
|
|
190
190
|
* and it emits an event when the range is changed.
|
|
191
191
|
*
|
|
192
192
|
* @param {TimeSliderProps} props - The properties for the TimeSlider component.
|
|
193
|
-
* @returns {
|
|
193
|
+
* @returns {React.ReactElement} The rendered TimeSlider component.
|
|
194
194
|
*
|
|
195
195
|
* @example
|
|
196
196
|
* ```jsx
|
|
@@ -81,7 +81,7 @@ WordBubbleChart.displayName = "WordBubbleChart";
|
|
|
81
81
|
* It also supports exporting the chart and displays an empty state when no data is available.
|
|
82
82
|
*
|
|
83
83
|
* @param {WordBubbleProps} props - The properties for the WordBubble component.
|
|
84
|
-
* @returns {
|
|
84
|
+
* @returns {React.ReactElement} The rendered WordBubble component.
|
|
85
85
|
*
|
|
86
86
|
* @example
|
|
87
87
|
* ```jsx
|
package/dist/esm/theme/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
4
4
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
5
|
-
import
|
|
5
|
+
import chroma from 'chroma-js';
|
|
6
6
|
import { DarkThemeBase } from './darkBase.js';
|
|
7
7
|
import { LightThemeBase } from './lightBase.js';
|
|
8
8
|
import { ChartPalette } from './palettes.js';
|
|
@@ -14,8 +14,8 @@ var makePaletteSequence = function makePaletteSequence(colors) {
|
|
|
14
14
|
};
|
|
15
15
|
var registerTheme = function registerTheme(echarts, key, colors, heatmap) {
|
|
16
16
|
var base = colors[0];
|
|
17
|
-
var handles =
|
|
18
|
-
var window =
|
|
17
|
+
var handles = chroma.mix(base, "#f1f5f9", 0.15, "lab").hex();
|
|
18
|
+
var window = chroma(base).alpha(0.1).hex();
|
|
19
19
|
echarts.registerTheme("".concat(key), _objectSpread(_objectSpread({}, LightThemeBase), {}, {
|
|
20
20
|
dataZoom: _objectSpread(_objectSpread({}, LightThemeBase.dataZoom), {}, {
|
|
21
21
|
fillerColor: window,
|
|
@@ -24,7 +24,7 @@ var registerTheme = function registerTheme(echarts, key, colors, heatmap) {
|
|
|
24
24
|
color: base
|
|
25
25
|
},
|
|
26
26
|
lineStyle: {
|
|
27
|
-
color:
|
|
27
|
+
color: chroma.mix(base, "#0f172a", 0.35, "lab").hex()
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
30
|
handleColor: base,
|
|
@@ -58,7 +58,7 @@ var registerTheme = function registerTheme(echarts, key, colors, heatmap) {
|
|
|
58
58
|
fillerColor: window,
|
|
59
59
|
selectedDataBackground: {
|
|
60
60
|
areaStyle: {
|
|
61
|
-
color:
|
|
61
|
+
color: chroma.mix(base, "#f1f5f9", 0.35, "lab").hex()
|
|
62
62
|
},
|
|
63
63
|
lineStyle: {
|
|
64
64
|
color: base
|
package/dist/esm/types/utils.js
CHANGED
|
@@ -27,7 +27,7 @@ var seriesRenderer = function seriesRenderer(opt) {
|
|
|
27
27
|
var radar = (_opt$radar = opt.radar) === null || _opt$radar === void 0 ? void 0 : _opt$radar[0];
|
|
28
28
|
var axis = ((_opt$xAxis3 = opt.xAxis) === null || _opt$xAxis3 === void 0 ? void 0 : _opt$xAxis3[0].type) !== "value" ? (_opt$xAxis4 = opt.xAxis) === null || _opt$xAxis4 === void 0 ? void 0 : _opt$xAxis4[0] : (_opt$yAxis2 = opt.yAxis) === null || _opt$yAxis2 === void 0 ? void 0 : _opt$yAxis2[0];
|
|
29
29
|
var series = opt.series;
|
|
30
|
-
var table = ['<table class="border-separate border-spacing-1 mx-auto table-fixed min-w-full"><thead><tr class="sticky top-0 bg-
|
|
30
|
+
var table = ['<table class="border-separate border-spacing-1 mx-auto table-fixed min-w-full"><thead><tr class="sticky top-0 bg-default"><th></th>'];
|
|
31
31
|
table.push.apply(table, _toConsumableArray(series.map(function (s) {
|
|
32
32
|
var _s$name3;
|
|
33
33
|
return "<th class=\"truncate\">".concat((_s$name3 = s.name) !== null && _s$name3 !== void 0 ? _s$name3 : s.id, "</th>");
|
|
@@ -59,7 +59,7 @@ var seriesRenderer = function seriesRenderer(opt) {
|
|
|
59
59
|
};
|
|
60
60
|
var timeSeriesRenderer = function timeSeriesRenderer(opt) {
|
|
61
61
|
var series = opt.series;
|
|
62
|
-
var table = ['<table class="border-separate border-spacing-1 mx-auto table-fixed min-w-full"><thead><tr class="sticky top-0 bg-
|
|
62
|
+
var table = ['<table class="border-separate border-spacing-1 mx-auto table-fixed min-w-full"><thead><tr class="sticky top-0 bg-default"><th></th>'];
|
|
63
63
|
table.push.apply(table, _toConsumableArray(series.map(function (s) {
|
|
64
64
|
var _s$name4;
|
|
65
65
|
return "<th>".concat((_s$name4 = s.name) !== null && _s$name4 !== void 0 ? _s$name4 : s.id, "</th>");
|
|
@@ -79,7 +79,7 @@ var timeSeriesRenderer = function timeSeriesRenderer(opt) {
|
|
|
79
79
|
var activityRenderer = function activityRenderer(opt) {
|
|
80
80
|
var axis = opt.xAxis[0];
|
|
81
81
|
var series = opt.series;
|
|
82
|
-
var table = ['<table class="border-separate border-spacing-1 mx-auto table-fixed min-w-full"><thead><tr><th class="sticky top-0 bg-
|
|
82
|
+
var table = ['<table class="border-separate border-spacing-1 mx-auto table-fixed min-w-full"><thead><tr><th class="sticky top-0 bg-default"></th>'];
|
|
83
83
|
table.push.apply(table, _toConsumableArray(series.map(function (s) {
|
|
84
84
|
var _s$name5;
|
|
85
85
|
return "<th>".concat((_s$name5 = s.name) !== null && _s$name5 !== void 0 ? _s$name5 : s.id, "</th>");
|
|
@@ -140,9 +140,9 @@ var ChartContainer = /*#__PURE__*/memo(function (_ref2) {
|
|
|
140
140
|
})]
|
|
141
141
|
}), /*#__PURE__*/jsx("div", {
|
|
142
142
|
ref: containerRef,
|
|
143
|
-
className: classNames("
|
|
143
|
+
className: classNames("fabric-chartContainer", "overflow-hidden area-content")
|
|
144
144
|
}), isEmpty && /*#__PURE__*/jsx("div", {
|
|
145
|
-
className: "absolute inset-0 bg-
|
|
145
|
+
className: "absolute inset-0 bg-default grid place-content-center",
|
|
146
146
|
children: /*#__PURE__*/jsx(EmptyContent, {
|
|
147
147
|
icon: emptyIcon !== null && emptyIcon !== void 0 ? emptyIcon : "icon-[mdi--chart-line]",
|
|
148
148
|
message: "Empty chart"
|
|
@@ -29,7 +29,7 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
29
29
|
var ChartToolbar = function ChartToolbar(_ref) {
|
|
30
30
|
var children = _ref.children;
|
|
31
31
|
return /*#__PURE__*/jsx("div", {
|
|
32
|
-
className: classNames("flex flex-nowrap items-center justify-end bg-
|
|
32
|
+
className: classNames("flex flex-nowrap items-center justify-end bg-default area-head", "fabric-chartToolbar empty:hidden"),
|
|
33
33
|
children: children
|
|
34
34
|
});
|
|
35
35
|
};
|
|
@@ -22,7 +22,7 @@ export interface ActivityMapProps extends BaseChart {
|
|
|
22
22
|
* and customize the color palette used in the chart.
|
|
23
23
|
*
|
|
24
24
|
* @param {ActivityMapProps} props - The properties for the ActivityMap component.
|
|
25
|
-
* @returns {
|
|
25
|
+
* @returns {React.ReactElement} The rendered ActivityMap component.
|
|
26
26
|
*
|
|
27
27
|
* @example
|
|
28
28
|
* ```jsx
|
|
@@ -12,7 +12,7 @@ export interface CountSeriesProps extends BaseChart, CountType {
|
|
|
12
12
|
* It allows users to switch between different types of visualizations and customize the color palette used in the chart.
|
|
13
13
|
*
|
|
14
14
|
* @param {CountSeriesProps} props - The properties for the CountSeries component.
|
|
15
|
-
* @returns {
|
|
15
|
+
* @returns {React.ReactElement} The rendered CountSeries component.
|
|
16
16
|
*
|
|
17
17
|
* @example
|
|
18
18
|
* ```jsx
|
|
@@ -13,7 +13,7 @@ export interface DataSeriesProps extends BaseChart, SeriesType {
|
|
|
13
13
|
* It allows users to click on data points to trigger custom actions.
|
|
14
14
|
*
|
|
15
15
|
* @param {DataSeriesProps} props - The properties for the DataSeries component.
|
|
16
|
-
* @returns {
|
|
16
|
+
* @returns {React.ReactElement} The rendered DataSeries component.
|
|
17
17
|
*
|
|
18
18
|
* @example
|
|
19
19
|
* ```jsx
|
|
@@ -4,7 +4,7 @@ import { type Theme } from "../types";
|
|
|
4
4
|
export interface GenericProps extends Omit<EChartsOption, "title"> {
|
|
5
5
|
chartRef?: Ref<EChartsType>;
|
|
6
6
|
title?: string;
|
|
7
|
-
actions?:
|
|
7
|
+
actions?: React.ReactElement;
|
|
8
8
|
/**
|
|
9
9
|
* The theme to be applied to the chart.
|
|
10
10
|
* This can be one of the predefined themes or a custom theme object.
|
|
@@ -14,7 +14,7 @@ export interface MapSeriesProps extends BaseChart {
|
|
|
14
14
|
* It supports zooming and switching between map and column views.
|
|
15
15
|
*
|
|
16
16
|
* @param {MapSeriesProps} props - The properties for the MapSeries component.
|
|
17
|
-
* @returns {
|
|
17
|
+
* @returns {React.ReactElement} The rendered MapSeries component.
|
|
18
18
|
*
|
|
19
19
|
* @example
|
|
20
20
|
* ```jsx
|
|
@@ -17,7 +17,7 @@ export interface TimeSeriesProps extends BaseChart, TimeSeriesType {
|
|
|
17
17
|
* It also allows for interaction through click and brush events.
|
|
18
18
|
*
|
|
19
19
|
* @param {TimeSeriesProps} props - The properties for the TimeSeries component.
|
|
20
|
-
* @returns {
|
|
20
|
+
* @returns {React.ReactElement} The rendered TimeSeries component.
|
|
21
21
|
*
|
|
22
22
|
* @example
|
|
23
23
|
* ```jsx
|
|
@@ -18,7 +18,7 @@ export interface TimeSliderProps extends BaseChart {
|
|
|
18
18
|
* and it emits an event when the range is changed.
|
|
19
19
|
*
|
|
20
20
|
* @param {TimeSliderProps} props - The properties for the TimeSlider component.
|
|
21
|
-
* @returns {
|
|
21
|
+
* @returns {React.ReactElement} The rendered TimeSlider component.
|
|
22
22
|
*
|
|
23
23
|
* @example
|
|
24
24
|
* ```jsx
|
|
@@ -15,7 +15,7 @@ export interface WordBubbleProps extends Omit<BaseChart, "theme"> {
|
|
|
15
15
|
* It also supports exporting the chart and displays an empty state when no data is available.
|
|
16
16
|
*
|
|
17
17
|
* @param {WordBubbleProps} props - The properties for the WordBubble component.
|
|
18
|
-
* @returns {
|
|
18
|
+
* @returns {React.ReactElement} The rendered WordBubble component.
|
|
19
19
|
*
|
|
20
20
|
* @example
|
|
21
21
|
* ```jsx
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-fabric/chart",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.63",
|
|
4
4
|
"description": "RUF: Charting package",
|
|
5
5
|
"author": "Adarsh Pastakia <adarshpastakia@outlook.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,23 +35,23 @@
|
|
|
35
35
|
"watch": "npm-run-all -p watch:rollup watch:dts"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@react-fabric/core": "^1.0.0-beta.
|
|
39
|
-
"@react-fabric/utilities": "^1.0.0-beta.
|
|
38
|
+
"@react-fabric/core": "^1.0.0-beta.63",
|
|
39
|
+
"@react-fabric/utilities": "^1.0.0-beta.63",
|
|
40
|
+
"chroma-js": "~3.2.0",
|
|
40
41
|
"classnames": "~2.5.1",
|
|
41
|
-
"color": "~5.0.2",
|
|
42
42
|
"date-fns": "~4.1.0",
|
|
43
43
|
"echarts": "~6.0.0",
|
|
44
44
|
"echarts-wordcloud": "~2.1.0"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"i18next": "~25.
|
|
48
|
-
"react": "~19.2.
|
|
49
|
-
"react-dom": "~19.2.
|
|
50
|
-
"react-i18next": "~16.
|
|
47
|
+
"i18next": "~25.8.18",
|
|
48
|
+
"react": "~19.2.4",
|
|
49
|
+
"react-dom": "~19.2.4",
|
|
50
|
+
"react-i18next": "~16.5.8"
|
|
51
51
|
},
|
|
52
52
|
"engines": {
|
|
53
|
-
"node": ">=18.
|
|
54
|
-
"npm": ">=8.
|
|
53
|
+
"node": ">=22.18.0",
|
|
54
|
+
"npm": ">=10.8.0"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "6e0652b15c6384fbc316842862572e21299a5466"
|
|
57
57
|
}
|
|
@@ -315,7 +315,7 @@ ActivityMapChart.displayName = "ActivityMapChart";
|
|
|
315
315
|
* and customize the color palette used in the chart.
|
|
316
316
|
*
|
|
317
317
|
* @param {ActivityMapProps} props - The properties for the ActivityMap component.
|
|
318
|
-
* @returns {
|
|
318
|
+
* @returns {React.ReactElement} The rendered ActivityMap component.
|
|
319
319
|
*
|
|
320
320
|
* @example
|
|
321
321
|
* ```jsx
|
|
@@ -196,7 +196,7 @@ CountSeriesChart.displayName = "CountSeriesChart";
|
|
|
196
196
|
* It allows users to switch between different types of visualizations and customize the color palette used in the chart.
|
|
197
197
|
*
|
|
198
198
|
* @param {CountSeriesProps} props - The properties for the CountSeries component.
|
|
199
|
-
* @returns {
|
|
199
|
+
* @returns {React.ReactElement} The rendered CountSeries component.
|
|
200
200
|
*
|
|
201
201
|
* @example
|
|
202
202
|
* ```jsx
|
|
@@ -248,7 +248,7 @@ DataSeriesChart.displayName = "DataSeriesChart";
|
|
|
248
248
|
* It allows users to click on data points to trigger custom actions.
|
|
249
249
|
*
|
|
250
250
|
* @param {DataSeriesProps} props - The properties for the DataSeries component.
|
|
251
|
-
* @returns {
|
|
251
|
+
* @returns {React.ReactElement} The rendered DataSeries component.
|
|
252
252
|
*
|
|
253
253
|
* @example
|
|
254
254
|
* ```jsx
|
package/src/charts/Generic.tsx
CHANGED
package/src/charts/MapSeries.tsx
CHANGED
|
@@ -218,7 +218,7 @@ MapSeriesChart.displayName = "MapSeriesChart";
|
|
|
218
218
|
* It supports zooming and switching between map and column views.
|
|
219
219
|
*
|
|
220
220
|
* @param {MapSeriesProps} props - The properties for the MapSeries component.
|
|
221
|
-
* @returns {
|
|
221
|
+
* @returns {React.ReactElement} The rendered MapSeries component.
|
|
222
222
|
*
|
|
223
223
|
* @example
|
|
224
224
|
* ```jsx
|
|
@@ -246,7 +246,7 @@ TimeSeriesChart.displayName = "TimeSeriesChart";
|
|
|
246
246
|
* It also allows for interaction through click and brush events.
|
|
247
247
|
*
|
|
248
248
|
* @param {TimeSeriesProps} props - The properties for the TimeSeries component.
|
|
249
|
-
* @returns {
|
|
249
|
+
* @returns {React.ReactElement} The rendered TimeSeries component.
|
|
250
250
|
*
|
|
251
251
|
* @example
|
|
252
252
|
* ```jsx
|
|
@@ -236,7 +236,7 @@ TimeSliderChart.displayName = "TimeSliderChart";
|
|
|
236
236
|
* and it emits an event when the range is changed.
|
|
237
237
|
*
|
|
238
238
|
* @param {TimeSliderProps} props - The properties for the TimeSlider component.
|
|
239
|
-
* @returns {
|
|
239
|
+
* @returns {React.ReactElement} The rendered TimeSlider component.
|
|
240
240
|
*
|
|
241
241
|
* @example
|
|
242
242
|
* ```jsx
|
|
@@ -109,7 +109,7 @@ WordBubbleChart.displayName = "WordBubbleChart";
|
|
|
109
109
|
* It also supports exporting the chart and displays an empty state when no data is available.
|
|
110
110
|
*
|
|
111
111
|
* @param {WordBubbleProps} props - The properties for the WordBubble component.
|
|
112
|
-
* @returns {
|
|
112
|
+
* @returns {React.ReactElement} The rendered WordBubble component.
|
|
113
113
|
*
|
|
114
114
|
* @example
|
|
115
115
|
* ```jsx
|
package/src/theme/index.ts
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
|
-
import
|
|
24
|
+
import chroma from "chroma-js";
|
|
25
25
|
import { DarkThemeBase } from "./darkBase";
|
|
26
26
|
import { LightThemeBase } from "./lightBase";
|
|
27
27
|
import { ChartPalette } from "./palettes";
|
|
@@ -37,8 +37,8 @@ export const registerTheme = (
|
|
|
37
37
|
heatmap: string[],
|
|
38
38
|
) => {
|
|
39
39
|
const base = colors[0];
|
|
40
|
-
const handles =
|
|
41
|
-
const window =
|
|
40
|
+
const handles = chroma.mix(base, "#f1f5f9", 0.15, "lab").hex();
|
|
41
|
+
const window = chroma(base).alpha(0.1).hex();
|
|
42
42
|
echarts.registerTheme(`${key}`, {
|
|
43
43
|
...LightThemeBase,
|
|
44
44
|
dataZoom: {
|
|
@@ -49,7 +49,7 @@ export const registerTheme = (
|
|
|
49
49
|
color: base,
|
|
50
50
|
},
|
|
51
51
|
lineStyle: {
|
|
52
|
-
color:
|
|
52
|
+
color: chroma.mix(base, "#0f172a", 0.35, "lab").hex(),
|
|
53
53
|
},
|
|
54
54
|
},
|
|
55
55
|
handleColor: base,
|
|
@@ -83,7 +83,7 @@ export const registerTheme = (
|
|
|
83
83
|
fillerColor: window,
|
|
84
84
|
selectedDataBackground: {
|
|
85
85
|
areaStyle: {
|
|
86
|
-
color:
|
|
86
|
+
color: chroma.mix(base, "#f1f5f9", 0.35, "lab").hex(),
|
|
87
87
|
},
|
|
88
88
|
lineStyle: { color: base },
|
|
89
89
|
},
|
package/src/types/utils.ts
CHANGED
|
@@ -73,7 +73,7 @@ export const seriesRenderer = (opt: KeyValue) => {
|
|
|
73
73
|
opt.xAxis?.[0].type !== "value" ? opt.xAxis?.[0] : opt.yAxis?.[0];
|
|
74
74
|
const series = opt.series;
|
|
75
75
|
const table = [
|
|
76
|
-
'<table class="border-separate border-spacing-1 mx-auto table-fixed min-w-full"><thead><tr class="sticky top-0 bg-
|
|
76
|
+
'<table class="border-separate border-spacing-1 mx-auto table-fixed min-w-full"><thead><tr class="sticky top-0 bg-default"><th></th>',
|
|
77
77
|
];
|
|
78
78
|
table.push(
|
|
79
79
|
...series.map((s: Series) => `<th class="truncate">${s.name ?? s.id}</th>`),
|
|
@@ -110,7 +110,7 @@ export const seriesRenderer = (opt: KeyValue) => {
|
|
|
110
110
|
export const timeSeriesRenderer = (opt: KeyValue) => {
|
|
111
111
|
const series = opt.series;
|
|
112
112
|
const table = [
|
|
113
|
-
'<table class="border-separate border-spacing-1 mx-auto table-fixed min-w-full"><thead><tr class="sticky top-0 bg-
|
|
113
|
+
'<table class="border-separate border-spacing-1 mx-auto table-fixed min-w-full"><thead><tr class="sticky top-0 bg-default"><th></th>',
|
|
114
114
|
];
|
|
115
115
|
table.push(...series.map((s: Series) => `<th>${s.name ?? s.id}</th>`));
|
|
116
116
|
table.push("</tr></thead><tbody class='bg-alternate'>");
|
|
@@ -131,7 +131,7 @@ export const activityRenderer = (opt: KeyValue) => {
|
|
|
131
131
|
const axis = opt.xAxis[0];
|
|
132
132
|
const series = opt.series;
|
|
133
133
|
const table = [
|
|
134
|
-
'<table class="border-separate border-spacing-1 mx-auto table-fixed min-w-full"><thead><tr><th class="sticky top-0 bg-
|
|
134
|
+
'<table class="border-separate border-spacing-1 mx-auto table-fixed min-w-full"><thead><tr><th class="sticky top-0 bg-default"></th>',
|
|
135
135
|
];
|
|
136
136
|
table.push(...series.map((s: Series) => `<th>${s.name ?? s.id}</th>`));
|
|
137
137
|
table.push("</tr></thead><tbody class='bg-alternate'>");
|
|
@@ -121,10 +121,9 @@ export const ChartContainer = memo(
|
|
|
121
121
|
[chartRef],
|
|
122
122
|
);
|
|
123
123
|
|
|
124
|
-
const chartTheme = useMemo(
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
);
|
|
124
|
+
const chartTheme = useMemo(() => {
|
|
125
|
+
return isDark ? `${theme}_dark` : theme;
|
|
126
|
+
}, [theme, isDark]);
|
|
128
127
|
|
|
129
128
|
useEffect(() => {
|
|
130
129
|
if (containerRef.current) {
|
|
@@ -203,12 +202,12 @@ export const ChartContainer = memo(
|
|
|
203
202
|
<div
|
|
204
203
|
ref={containerRef}
|
|
205
204
|
className={classNames(
|
|
206
|
-
"
|
|
205
|
+
"fabric-chartContainer",
|
|
207
206
|
"overflow-hidden area-content",
|
|
208
207
|
)}
|
|
209
208
|
/>
|
|
210
209
|
{isEmpty && (
|
|
211
|
-
<div className="absolute inset-0 bg-
|
|
210
|
+
<div className="absolute inset-0 bg-default grid place-content-center">
|
|
212
211
|
<EmptyContent
|
|
213
212
|
icon={emptyIcon ?? "icon-[mdi--chart-line]"}
|
|
214
213
|
message="Empty chart"
|
|
@@ -29,8 +29,8 @@ export const ChartToolbar: FC<ChildrenProp> = ({ children }) => {
|
|
|
29
29
|
return (
|
|
30
30
|
<div
|
|
31
31
|
className={classNames(
|
|
32
|
-
"flex flex-nowrap items-center justify-end bg-
|
|
33
|
-
"
|
|
32
|
+
"flex flex-nowrap items-center justify-end bg-default area-head",
|
|
33
|
+
"fabric-chartToolbar empty:hidden",
|
|
34
34
|
)}
|
|
35
35
|
>
|
|
36
36
|
{children}
|
|
@@ -34,7 +34,11 @@ const Error: FC<{ error?: string }> = ({ error = "" }) => {
|
|
|
34
34
|
);
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
-
export const ChartWrapper = ({
|
|
37
|
+
export const ChartWrapper = ({
|
|
38
|
+
children,
|
|
39
|
+
}: {
|
|
40
|
+
children?: React.ReactElement;
|
|
41
|
+
}) => {
|
|
38
42
|
return (
|
|
39
43
|
<div
|
|
40
44
|
className="grid overflow-hidden area-content relative"
|