@react-fabric/chart 1.0.0-beta.51 → 1.0.0-beta.53

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.
Files changed (61) hide show
  1. package/dist/cjs/charts/ActivityMap.js +43 -13
  2. package/dist/cjs/charts/CountSeries.js +32 -4
  3. package/dist/cjs/charts/DataSeries.js +33 -5
  4. package/dist/cjs/charts/Generic.js +29 -5
  5. package/dist/cjs/charts/MapSeries.js +27 -3
  6. package/dist/cjs/charts/TimeSeries.js +31 -5
  7. package/dist/cjs/charts/TimeSlider.js +21 -1
  8. package/dist/cjs/charts/WordBubble.js +31 -1
  9. package/dist/cjs/theme/darkBase.js +0 -5
  10. package/dist/cjs/theme/index.js +38 -18
  11. package/dist/cjs/theme/lightBase.js +0 -5
  12. package/dist/cjs/theme/palettes.js +27 -27
  13. package/dist/cjs/types/charts.js +2 -2
  14. package/dist/cjs/wrapper/ChartContainer.js +2 -1
  15. package/dist/cjs/wrapper/ChartToolbar.js +1 -1
  16. package/dist/esm/charts/ActivityMap.js +43 -13
  17. package/dist/esm/charts/CountSeries.js +32 -4
  18. package/dist/esm/charts/DataSeries.js +33 -5
  19. package/dist/esm/charts/Generic.js +31 -7
  20. package/dist/esm/charts/MapSeries.js +27 -3
  21. package/dist/esm/charts/TimeSeries.js +31 -5
  22. package/dist/esm/charts/TimeSlider.js +21 -1
  23. package/dist/esm/charts/WordBubble.js +31 -1
  24. package/dist/esm/theme/darkBase.js +0 -5
  25. package/dist/esm/theme/index.js +38 -18
  26. package/dist/esm/theme/lightBase.js +0 -5
  27. package/dist/esm/theme/palettes.js +27 -27
  28. package/dist/esm/types/charts.js +2 -2
  29. package/dist/esm/wrapper/ChartContainer.js +2 -1
  30. package/dist/esm/wrapper/ChartToolbar.js +1 -1
  31. package/dist/types/charts/ActivityMap.d.ts +22 -1
  32. package/dist/types/charts/CountSeries.d.ts +27 -1
  33. package/dist/types/charts/DataSeries.d.ts +26 -1
  34. package/dist/types/charts/Generic.d.ts +13 -0
  35. package/dist/types/charts/MapSeries.d.ts +24 -1
  36. package/dist/types/charts/TimeSeries.d.ts +24 -1
  37. package/dist/types/charts/TimeSlider.d.ts +21 -1
  38. package/dist/types/charts/WordBubble.d.ts +25 -1
  39. package/dist/types/theme/darkBase.d.ts +0 -5
  40. package/dist/types/theme/index.d.ts +1 -1
  41. package/dist/types/theme/lightBase.d.ts +0 -5
  42. package/dist/types/types/charts.d.ts +1 -1
  43. package/dist/types/types/index.d.ts +3 -1
  44. package/dist/types/types/world.svg.d.ts +1 -1
  45. package/package.json +4 -4
  46. package/src/charts/ActivityMap.tsx +75 -37
  47. package/src/charts/CountSeries.tsx +58 -26
  48. package/src/charts/DataSeries.tsx +86 -54
  49. package/src/charts/Generic.tsx +24 -4
  50. package/src/charts/MapSeries.tsx +50 -18
  51. package/src/charts/TimeSeries.tsx +64 -34
  52. package/src/charts/TimeSlider.tsx +21 -1
  53. package/src/charts/WordBubble.tsx +31 -1
  54. package/src/theme/darkBase.ts +0 -5
  55. package/src/theme/index.ts +94 -20
  56. package/src/theme/lightBase.ts +0 -5
  57. package/src/theme/palettes.ts +1 -52
  58. package/src/types/charts.ts +6 -2
  59. package/src/types/index.ts +6 -1
  60. package/src/wrapper/ChartContainer.tsx +1 -0
  61. package/src/wrapper/ChartToolbar.tsx +1 -1
@@ -37,33 +37,33 @@ var GlobalWarming = ["#FFC300", "#E57F00", "#CB4600", "#B21800", "#98000A", "#7F
37
37
  var Sunrise = ["#194266", "#355C7D", "#63617F", "#916681", "#C06C84", "#D28389", "#E59A8F", "#F8B195"];
38
38
  var Ocean = ["#37535E", "#3A748A", "#4B9A95", "#5EAB8B", "#73BC84", "#92CC8B", "#BEDDA5", "#E5EEc1"];
39
39
  var Wine = ["#2C1E3D", "#50315E", "#764476", "#9A5B88", "#B77495", "#CF91A3", "#E0B1B3", "#EDD1CA"];
40
- var Spectral = ["#9e0142", "#d53e4f", "#f46d43", "#fdae61", "#fee08b", "#ffffbf", "#e6f598", "#abdda4", "#66c2a5", "#3288bd", "#5e4fa2"];
41
- var PurpleBlueYellow = ["#2B1E3E", "#383C65", "#3E5F7E", "#49838A", "#5EA28D", "#82BB92", "#AECEA1", "#D6DEBF"];
42
- var YellowGreen = ["#ffffe5", "#f7fcb9", "#d9f0a3", "#addd8e", "#78c679", "#41ab5d", "#238443", "#006837", "#004529"];
43
- var YellowGreenBlue = ["#ffffd9", "#edf8b1", "#c7e9b4", "#7fcdbb", "#41b6c4", "#1d91c0", "#225ea8", "#253494", "#081d58"];
44
- var GreenBlue = ["#f7fcf0", "#e0f3db", "#ccebc5", "#a8ddb5", "#7bccc4", "#4eb3d3", "#2b8cbe", "#0868ac", "#084081"];
45
- var BlueGreen = ["#f7fcfd", "#e5f5f9", "#ccece6", "#99d8c9", "#66c2a4", "#41ae76", "#238b45", "#006d2c", "#00441b"];
46
- var PurpleBlueGreen = ["#fff7fb", "#ece2f0", "#d0d1e6", "#a6bddb", "#67a9cf", "#3690c0", "#02818a", "#016c59", "#014636"];
47
- var PurpleBlue = ["#fff7fb", "#ece7f2", "#d0d1e6", "#a6bddb", "#74a9cf", "#3690c0", "#0570b0", "#045a8d", "#023858"];
48
- var BluePurple = ["#f7fcfd", "#e0ecf4", "#bfd3e6", "#9ebcda", "#8c96c6", "#8c6bb1", "#88419d", "#810f7c", "#4d004b"];
49
- var RedPurple = ["#fff7f3", "#fde0dd", "#fcc5c0", "#fa9fb5", "#f768a1", "#dd3497", "#ae017e", "#7a0177", "#49006a"];
50
- var PurpleRed = ["#f7f4f9", "#e7e1ef", "#d4b9da", "#c994c7", "#df65b0", "#e7298a", "#ce1256", "#980043", "#67001f"];
51
- var OrangeRed = ["#fff7ec", "#fee8c8", "#fdd49e", "#fdbb84", "#fc8d59", "#ef6548", "#d7301f", "#b30000", "#7f0000"];
52
- var YellowOrangeRed = ["#ffffcc", "#ffeda0", "#fed976", "#feb24c", "#fd8d3c", "#fc4e2a", "#e31a1c", "#bd0026", "#800026"];
53
- var YellowOrangeBrown = ["#ffffe5", "#fff7bc", "#fee391", "#fec44f", "#fe9929", "#ec7014", "#cc4c02", "#993404", "#662506"];
54
- var Purple = ["#fcfbfd", "#efedf5", "#dadaeb", "#bcbddc", "#9e9ac8", "#807dba", "#6a51a3", "#54278f", "#3f007d"];
55
- var Blue = ["#f7fbff", "#deebf7", "#c6dbef", "#9ecae1", "#6baed6", "#4292c6", "#2171b5", "#08519c", "#08306b"];
56
- var Green = ["#f7fcf5", "#e5f5e0", "#c7e9c0", "#a1d99b", "#74c476", "#41ab5d", "#238b45", "#006d2c", "#00441b"];
57
- var Orange = ["#fff5eb", "#fee6ce", "#fdd0a2", "#fdae6b", "#fd8d3c", "#f16913", "#d94801", "#a63603", "#7f2704"];
58
- var Red = ["#fff5f0", "#fee0d2", "#fcbba1", "#fc9272", "#fb6a4a", "#ef3b2c", "#cb181d", "#a50f15", "#67000d"];
59
- var Grey = ["#ffffff", "#f0f0f0", "#d9d9d9", "#bdbdbd", "#969696", "#737373", "#525252", "#252525", "#000000"];
60
- var OrangePurple = ["#7f3b08", "#b35806", "#e08214", "#fdb863", "#fee0b6", "#f7f7f7", "#d8daeb", "#b2abd2", "#8073ac", "#542788", "#2d004b"];
61
- var BrownGreen = ["#543005", "#8c510a", "#bf812d", "#dfc27d", "#f6e8c3", "#f5f5f5", "#c7eae5", "#80cdc1", "#35978f", "#01665e", "#003c30"];
62
- var PurpleGreen = ["#40004b", "#762a83", "#9970ab", "#c2a5cf", "#e7d4e8", "#f7f7f7", "#d9f0d3", "#a6dba0", "#5aae61", "#1b7837", "#00441b"];
63
- var PinkGreen = ["#8e0152", "#c51b7d", "#de77ae", "#f1b6da", "#fde0ef", "#f7f7f7", "#e6f5d0", "#b8e186", "#7fbc41", "#4d9221", "#276419"];
64
- var RedBlue = ["#67001f", "#b2182b", "#d6604d", "#f4a582", "#fddbc7", "#f7f7f7", "#d1e5f0", "#92c5de", "#4393c3", "#2166ac", "#053061"];
65
- var RedGray = ["#67001f", "#b2182b", "#d6604d", "#f4a582", "#fddbc7", "#ffffff", "#e0e0e0", "#bababa", "#878787", "#4d4d4d", "#1a1a1a"];
66
- var RedYellowBlue = ["#a50026", "#d73027", "#f46d43", "#fdae61", "#fee090", "#ffffbf", "#e0f3f8", "#abd9e9", "#74add1", "#4575b4", "#313695"];
40
+ var Spectral = ["#9e0142", "#d53e4f", "#f46d43", "#fdae61", "#fee08b", "#ffffbf", "#e6f598", "#abdda4", "#66c2a5", "#3288bd", "#134F74"];
41
+ var PurpleBlueYellow = ["#2B1E3E", "#383C65", "#3E5F7E", "#49838A", "#5EA28D", "#82BB92", "#AECEA1"];
42
+ var YellowGreen = ["#d9f0a3", "#addd8e", "#78c679", "#41ab5d", "#238443", "#006837", "#004529"];
43
+ var YellowGreenBlue = ["#c7e9b4", "#7fcdbb", "#41b6c4", "#1d91c0", "#225ea8", "#253494", "#081d58"];
44
+ var GreenBlue = ["#ccebc5", "#a8ddb5", "#7bccc4", "#4eb3d3", "#2b8cbe", "#0868ac", "#084081"];
45
+ var BlueGreen = ["#ccece6", "#99d8c9", "#66c2a4", "#41ae76", "#238b45", "#006d2c", "#00441b"];
46
+ var PurpleBlueGreen = ["#d0d1e6", "#a6bddb", "#67a9cf", "#3690c0", "#02818a", "#016c59", "#014636"];
47
+ var PurpleBlue = ["#d0d1e6", "#a6bddb", "#74a9cf", "#3690c0", "#0570b0", "#045a8d", "#023858"];
48
+ var BluePurple = ["#bfd3e6", "#9ebcda", "#8c96c6", "#8c6bb1", "#88419d", "#810f7c", "#4d004b"];
49
+ var RedPurple = ["#fcc5c0", "#fa9fb5", "#f768a1", "#dd3497", "#ae017e", "#7a0177", "#49006a"];
50
+ var PurpleRed = ["#d4b9da", "#c994c7", "#df65b0", "#e7298a", "#ce1256", "#980043", "#67001f"];
51
+ var OrangeRed = ["#fdd49e", "#fdbb84", "#fc8d59", "#ef6548", "#d7301f", "#b30000", "#7f0000"];
52
+ var YellowOrangeRed = ["#fed976", "#feb24c", "#fd8d3c", "#fc4e2a", "#e31a1c", "#bd0026", "#800026"];
53
+ var YellowOrangeBrown = ["#fee391", "#fec44f", "#fe9929", "#ec7014", "#cc4c02", "#993404", "#662506"];
54
+ var Purple = ["#dadaeb", "#bcbddc", "#9e9ac8", "#807dba", "#6a51a3", "#54278f", "#3f007d"];
55
+ var Blue = ["#c6dbef", "#9ecae1", "#6baed6", "#4292c6", "#2171b5", "#08519c", "#08306b"];
56
+ var Green = ["#c7e9c0", "#a1d99b", "#74c476", "#41ab5d", "#238b45", "#006d2c", "#00441b"];
57
+ var Orange = ["#fdd0a2", "#fdae6b", "#fd8d3c", "#f16913", "#d94801", "#a63603", "#7f2704"];
58
+ var Red = ["#fcbba1", "#fc9272", "#fb6a4a", "#ef3b2c", "#cb181d", "#a50f15", "#67000d"];
59
+ var Grey = ["#d9d9d9", "#bdbdbd", "#969696", "#737373", "#525252", "#252525", "#000000"];
60
+ var OrangePurple = ["#7f3b08", "#b35806", "#e08214", "#fdb863", "#fee0b6", "#b2abd2", "#8073ac", "#542788", "#2d004b"];
61
+ var BrownGreen = ["#543005", "#8c510a", "#bf812d", "#dfc27d", "#f6e8c3", "#80cdc1", "#35978f", "#01665e", "#003c30"];
62
+ var PurpleGreen = ["#40004b", "#762a83", "#9970ab", "#c2a5cf", "#d9f0d3", "#a6dba0", "#5aae61", "#1b7837", "#00441b"];
63
+ var PinkGreen = ["#8e0152", "#c51b7d", "#de77ae", "#f1b6da", "#e6f5d0", "#b8e186", "#7fbc41", "#4d9221", "#276419"];
64
+ var RedBlue = ["#67001f", "#b2182b", "#d6604d", "#f4a582", "#fddbc7", "#92c5de", "#4393c3", "#2166ac", "#053061"];
65
+ var RedGray = ["#67001f", "#b2182b", "#d6604d", "#f4a582", "#fddbc7", "#bababa", "#878787", "#4d4d4d", "#1a1a1a"];
66
+ var RedYellowBlue = ["#a50026", "#d73027", "#f46d43", "#fdae61", "#fee090", "#abd9e9", "#74add1", "#4575b4", "#313695"];
67
67
  var RedYellowGreen = ["#a50026", "#d73027", "#f46d43", "#fdae61", "#fee08b", "#ffffbf", "#d9ef8b", "#a6d96a", "#66bd63", "#1a9850", "#006837"];
68
68
  var ChartPalette = {
69
69
  Default: Default,
@@ -48,8 +48,8 @@ var echarts__namespace = /*#__PURE__*/_interopNamespaceDefault(echarts);
48
48
  */
49
49
 
50
50
  index.registerThemes(echarts__namespace);
51
- var registerTheme = function registerTheme(key, colors) {
52
- index.registerTheme(echarts__namespace, key, colors);
51
+ var registerTheme = function registerTheme(key, colors, heatmap) {
52
+ index.registerTheme(echarts__namespace, key, colors, heatmap);
53
53
  };
54
54
 
55
55
  exports.default = echarts__namespace;
@@ -42,7 +42,8 @@ var defaultOptions = {
42
42
  tooltip: {
43
43
  trigger: "item",
44
44
  confine: true,
45
- position: "top"
45
+ position: "top",
46
+ appendToBody: true
46
47
  },
47
48
  legend: {
48
49
  type: "scroll",
@@ -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-base area-head", "rf-chartToolbar"),
32
+ className: classNames("flex flex-nowrap items-center justify-end bg-base area-head", "rf-chartToolbar empty:hidden"),
33
33
  children: children
34
34
  });
35
35
  };
@@ -6,7 +6,6 @@ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
6
6
  import { useMemoDebugger, CoreIcons, ToggleButtonGroup, Button, Divider } from '@react-fabric/core';
7
7
  import { isEmpty, isArray } from '@react-fabric/utilities';
8
8
  import { memo, useRef, useState, useEffect } from 'react';
9
- import { ChartPalette } from '../theme/palettes.js';
10
9
  import { activityRenderer } from '../types/utils.js';
11
10
  import { ChartContainer } from '../wrapper/ChartContainer.js';
12
11
  import { ChartWrapper } from '../wrapper/ChartWrapper.js';
@@ -33,6 +32,8 @@ var ActivityMapChart = /*#__PURE__*/memo(function (_ref) {
33
32
  heatmapPalette = _ref.heatmapPalette,
34
33
  highLabels = _ref.highLabels,
35
34
  lowLabels = _ref.lowLabels,
35
+ showThemeSelector = _ref.showThemeSelector,
36
+ showTypeSelector = _ref.showTypeSelector,
36
37
  _ref$time = _ref.time,
37
38
  time = _ref$time === void 0 ? "day-hour" : _ref$time,
38
39
  _ref$type = _ref.type,
@@ -85,7 +86,7 @@ var ActivityMapChart = /*#__PURE__*/memo(function (_ref) {
85
86
  return t + p[2];
86
87
  }, 0);
87
88
  return {
88
- id: index,
89
+ id: "".concat(index),
89
90
  name: defaultMap.high[index],
90
91
  type: type,
91
92
  symbolSize: function symbolSize(dataItem) {
@@ -103,19 +104,26 @@ var ActivityMapChart = /*#__PURE__*/memo(function (_ref) {
103
104
  });
104
105
  options.grid = {
105
106
  top: 32,
106
- bottom: 128
107
+ bottom: 64
108
+ };
109
+ options.legend = {
110
+ show: false
107
111
  };
108
- options.visualMap = {
112
+ options.visualMap = [{
109
113
  type: "piecewise",
110
114
  min: 1,
111
115
  show: type === "heatmap",
112
- color: heatmapPalette !== null && heatmapPalette !== void 0 ? heatmapPalette : _toConsumableArray(ChartPalette.Heatmap),
113
116
  max: Math.max.apply(Math, _toConsumableArray(dataPoints)),
114
- calculable: true,
117
+ // calculable: true,inRange:
115
118
  orient: "horizontal",
116
119
  left: "center",
117
- bottom: 48
118
- };
120
+ bottom: 4
121
+ }];
122
+ if (heatmapPalette) {
123
+ options.visualMap[0].inRange = {
124
+ color: heatmapPalette
125
+ };
126
+ }
119
127
  }
120
128
  return _objectSpread({
121
129
  grid: {
@@ -126,12 +134,13 @@ var ActivityMapChart = /*#__PURE__*/memo(function (_ref) {
126
134
  trigger: "item",
127
135
  confine: true,
128
136
  position: "top",
137
+ appendToBody: true,
129
138
  valueFormatter: function valueFormatter(c) {
130
139
  return isArray(c) ? c[2] : c;
131
140
  }
132
141
  }
133
142
  }, options);
134
- }, [data, title, type], "ActivityChart options");
143
+ }, [data, title, type, heatmapPalette], "ActivityChart options");
135
144
  return /*#__PURE__*/jsxs(ChartContainer, {
136
145
  title: title,
137
146
  onExport: onExport,
@@ -144,7 +153,7 @@ var ActivityMapChart = /*#__PURE__*/memo(function (_ref) {
144
153
  onClick: function onClick(e) {
145
154
  return _onClick === null || _onClick === void 0 ? void 0 : _onClick(e.seriesIndex, e.dataIndex);
146
155
  },
147
- children: [/*#__PURE__*/jsxs(ToggleButtonGroup, {
156
+ children: [showTypeSelector && /*#__PURE__*/jsxs(ToggleButtonGroup, {
148
157
  value: type,
149
158
  onChange: setType,
150
159
  children: [/*#__PURE__*/jsx(Button, {
@@ -160,9 +169,9 @@ var ActivityMapChart = /*#__PURE__*/memo(function (_ref) {
160
169
  "aria-label": "heatmap",
161
170
  icon: CoreIcons.chartActivityCalendar
162
171
  })]
163
- }), /*#__PURE__*/jsx(Divider, {
172
+ }), showTypeSelector && showThemeSelector && /*#__PURE__*/jsx(Divider, {
164
173
  vertical: true
165
- }), /*#__PURE__*/jsx(PaletteSelect, {
174
+ }), showThemeSelector && /*#__PURE__*/jsx(PaletteSelect, {
166
175
  theme: theme,
167
176
  onClick: setTheme,
168
177
  defaultTheme: "activity"
@@ -172,7 +181,28 @@ var ActivityMapChart = /*#__PURE__*/memo(function (_ref) {
172
181
  ActivityMapChart.displayName = "ActivityMapChart";
173
182
 
174
183
  /**
175
- * Chart showing activity map
184
+ * ActivityMap component renders a chart that visualizes activity data
185
+ * over time, using either a scatter plot or a heatmap.
186
+ * It allows users to switch between different types of visualizations
187
+ * and customize the color palette used in the chart.
188
+ *
189
+ * @param {ActivityMapProps} props - The properties for the ActivityMap component.
190
+ * @returns {JSX.Element} The rendered ActivityMap component.
191
+ *
192
+ * @example
193
+ * ```jsx
194
+ * <ActivityMap
195
+ * data={activityData}
196
+ * time="day-hour"
197
+ * type="heatmap"
198
+ * heatmapPalette={["#f0f8ff", "#faebd7", "#00ffff", "#7fffd4"]}
199
+ * highLabels={["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]}
200
+ * lowLabels={["12a", "1a", "2a", "3a", "4a", "5a", "6a", "7a", "8a", "9a", "10a", "11a", "12p", "1p", "2p", "3p", "4p", "5p", "6p", "7p", "8p", "9p", "10p", "11p"]}
201
+ * onClick={(highIndex, lowIndex) => console.log(`Clicked on: ${highIndex}, ${lowIndex}`)}
202
+ * />
203
+ * ```
204
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/charts-activitymap--docs} for more details on the properties.
205
+ * @see {@link https://echarts.apache.org/en/option.html#series-scatter} for more details on the ECharts scatter series.
176
206
  */
177
207
  var ActivityMap = function ActivityMap(props) {
178
208
  return /*#__PURE__*/jsx(ChartWrapper, {
@@ -20,6 +20,8 @@ var CountSeriesChart = /*#__PURE__*/memo(function (_ref) {
20
20
  chartTheme = _ref.theme,
21
21
  _ref$type = _ref.type,
22
22
  chartType = _ref$type === void 0 ? "pie" : _ref$type,
23
+ showThemeSelector = _ref.showThemeSelector,
24
+ showTypeSelector = _ref.showTypeSelector,
23
25
  _onClick = _ref.onClick;
24
26
  var chartRef = useRef(null);
25
27
  var _useState = useState(chartType),
@@ -112,7 +114,7 @@ var CountSeriesChart = /*#__PURE__*/memo(function (_ref) {
112
114
  var _e$data$id;
113
115
  return _onClick === null || _onClick === void 0 ? void 0 : _onClick((_e$data$id = e.data.id) !== null && _e$data$id !== void 0 ? _e$data$id : e.seriesId);
114
116
  },
115
- children: [/*#__PURE__*/jsxs(ToggleButtonGroup, {
117
+ children: [showTypeSelector && /*#__PURE__*/jsxs(ToggleButtonGroup, {
116
118
  value: type,
117
119
  onChange: setType,
118
120
  children: [/*#__PURE__*/jsx(Button, {
@@ -134,9 +136,9 @@ var CountSeriesChart = /*#__PURE__*/memo(function (_ref) {
134
136
  "aria-label": "bar",
135
137
  icon: CoreIcons.chartBar
136
138
  })]
137
- }), /*#__PURE__*/jsx(Divider, {
139
+ }), showTypeSelector && showThemeSelector && /*#__PURE__*/jsx(Divider, {
138
140
  vertical: true
139
- }), /*#__PURE__*/jsx(PaletteSelect, {
141
+ }), showThemeSelector && /*#__PURE__*/jsx(PaletteSelect, {
140
142
  theme: theme,
141
143
  onClick: setTheme
142
144
  })]
@@ -145,7 +147,33 @@ var CountSeriesChart = /*#__PURE__*/memo(function (_ref) {
145
147
  CountSeriesChart.displayName = "CountSeriesChart";
146
148
 
147
149
  /**
148
- * Chart to display simple data count series
150
+ * CountSeries component renders a chart that displays counts of items in various formats.
151
+ * It supports pie, bar, and column charts.
152
+ * It can be used to visualize the distribution of counts across different categories.
153
+ * It allows users to switch between different types of visualizations and customize the color palette used in the chart.
154
+ *
155
+ * @param {CountSeriesProps} props - The properties for the CountSeries component.
156
+ * @returns {JSX.Element} The rendered CountSeries component.
157
+ *
158
+ * @example
159
+ * ```jsx
160
+ * <CountSeries
161
+ * data={[
162
+ * { id: "A", label: "Category A", count: 10 },
163
+ * { id: "B", label: "Category B", count: 20 },
164
+ * { id: "C", label: "Category C", count: 30 },
165
+ * ]}
166
+ * title="Count Distribution"
167
+ * onExport={() => console.log("Exporting chart data")}
168
+ * theme="light"
169
+ * type="pie"
170
+ * onClick={(key) => console.log("Clicked on:", key)}
171
+ * />
172
+ * ```
173
+ *
174
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/charts-countseries--docs} for more details on the properties.
175
+ * @see {@link https://echarts.apache.org/en/option.html#series-pie} for more details on the ECharts pie series options.
176
+ * @see {@link https://echarts.apache.org/en/option.html#series-bar} for more details on the ECharts bar series options.
149
177
  */
150
178
  var CountSeries = function CountSeries(props) {
151
179
  return /*#__PURE__*/jsx(ChartWrapper, {
@@ -20,6 +20,8 @@ var DataSeriesChart = /*#__PURE__*/memo(function (_ref) {
20
20
  categoryAxisName = _ref.categoryAxisName,
21
21
  valueAxisName = _ref.valueAxisName,
22
22
  title = _ref.title,
23
+ showThemeSelector = _ref.showThemeSelector,
24
+ showTypeSelector = _ref.showTypeSelector,
23
25
  chartTheme = _ref.theme,
24
26
  _ref$type = _ref.type,
25
27
  chartType = _ref$type === void 0 ? "column" : _ref$type,
@@ -98,7 +100,8 @@ var DataSeriesChart = /*#__PURE__*/memo(function (_ref) {
98
100
  tooltip: {
99
101
  trigger: _type === "radar" ? "item" : "axis",
100
102
  confine: true,
101
- position: "top"
103
+ position: "top",
104
+ appendToBody: true
102
105
  }
103
106
  };
104
107
  }, [data, type, categories, categoryAxisName, valueAxisName], "DataChart options");
@@ -117,7 +120,7 @@ var DataSeriesChart = /*#__PURE__*/memo(function (_ref) {
117
120
  series: e.seriesId
118
121
  });
119
122
  },
120
- children: [/*#__PURE__*/jsxs(ToggleButtonGroup, {
123
+ children: [showTypeSelector && /*#__PURE__*/jsxs(ToggleButtonGroup, {
121
124
  value: type,
122
125
  onChange: setType,
123
126
  children: [/*#__PURE__*/jsx(Button, {
@@ -163,9 +166,9 @@ var DataSeriesChart = /*#__PURE__*/memo(function (_ref) {
163
166
  "aria-label": "bar-stacked",
164
167
  value: "bar-stacked"
165
168
  })]
166
- }), /*#__PURE__*/jsx(Divider, {
169
+ }), showTypeSelector && showThemeSelector && /*#__PURE__*/jsx(Divider, {
167
170
  vertical: true
168
- }), /*#__PURE__*/jsx(PaletteSelect, {
171
+ }), showThemeSelector && /*#__PURE__*/jsx(PaletteSelect, {
169
172
  theme: theme,
170
173
  onClick: setTheme
171
174
  })]
@@ -174,7 +177,32 @@ var DataSeriesChart = /*#__PURE__*/memo(function (_ref) {
174
177
  DataSeriesChart.displayName = "DataSeriesChart";
175
178
 
176
179
  /**
177
- * Chart to display simple data category series
180
+ * DataSeries component renders a chart for visualizing data series.
181
+ * It supports various chart types such as column, line, bar, radar, and stacked variants.
182
+ * It allows users to click on data points to trigger custom actions.
183
+ *
184
+ * @param {DataSeriesProps} props - The properties for the DataSeries component.
185
+ * @returns {JSX.Element} The rendered DataSeries component.
186
+ *
187
+ * @example
188
+ * ```jsx
189
+ * <DataSeries
190
+ * data={[{ id: "1", label: "Series 1", values: [10, 20, 30] }]}
191
+ * categories={["Category 1", "Category 2", "Category 3"]}
192
+ * categoryAxisName="Categories"
193
+ * valueAxisName="Values"
194
+ * title="Data Series Example"
195
+ * type="column"
196
+ * onClick={(data) => console.log("Clicked data:", data)}
197
+ * onExport={() => console.log("Exporting chart data")}
198
+ * theme="light"
199
+ * />
200
+ * ```
201
+ *
202
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/charts-dataseries--docs} for more details on the properties.
203
+ * @see {@link https://echarts.apache.org/en/option.html#series-bar} for ECharts bar series options.
204
+ * @see {@link https://echarts.apache.org/en/option.html#series-line} for ECharts line series options.
205
+ * @see {@link https://echarts.apache.org/en/option.html#series-radar} for ECharts radar series options.
178
206
  */
179
207
  var DataSeries = function DataSeries(props) {
180
208
  return /*#__PURE__*/jsx(ChartWrapper, {
@@ -1,13 +1,15 @@
1
1
  'use client';
2
2
 
3
3
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
4
+ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
4
5
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
5
- import { memo, useRef, useImperativeHandle, useEffect } from 'react';
6
+ import { memo, useRef, useState, useImperativeHandle, useEffect } from 'react';
6
7
  import { ChartContainer } from '../wrapper/ChartContainer.js';
7
8
  import { ChartWrapper } from '../wrapper/ChartWrapper.js';
8
- import { jsx } from 'react/jsx-runtime';
9
+ import { PaletteSelect } from '../wrapper/PaletteSelect.js';
10
+ import { jsxs, jsx } from 'react/jsx-runtime';
9
11
 
10
- var _excluded = ["chartRef", "onBrush", "onBrushEnd", "onBrushSelected", "dataTableRenderer", "onClick", "onRendered", "actions", "title", "theme"];
12
+ var _excluded = ["chartRef", "onBrush", "onBrushEnd", "onBrushSelected", "dataTableRenderer", "onClick", "onRendered", "showThemeSelector", "actions", "title", "theme"];
11
13
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
12
14
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
13
15
  var GenericChartBase = /*#__PURE__*/memo(function (_ref2) {
@@ -18,11 +20,16 @@ var GenericChartBase = /*#__PURE__*/memo(function (_ref2) {
18
20
  dataTableRenderer = _ref2.dataTableRenderer,
19
21
  onClick = _ref2.onClick,
20
22
  onRendered = _ref2.onRendered,
23
+ showThemeSelector = _ref2.showThemeSelector,
21
24
  actions = _ref2.actions,
22
25
  title = _ref2.title,
23
- theme = _ref2.theme,
26
+ chartTheme = _ref2.theme,
24
27
  options = _objectWithoutProperties(_ref2, _excluded);
25
28
  var chartRef = useRef(null);
29
+ var _useState = useState(chartTheme),
30
+ _useState2 = _slicedToArray(_useState, 2),
31
+ theme = _useState2[0],
32
+ setTheme = _useState2[1];
26
33
  useImperativeHandle(_ref, function () {
27
34
  return chartRef.current;
28
35
  }, [chartRef.current]);
@@ -71,16 +78,33 @@ var GenericChartBase = /*#__PURE__*/memo(function (_ref2) {
71
78
  };
72
79
  }
73
80
  }, [chartRef.current, onBrushSelected]);
74
- return /*#__PURE__*/jsx(ChartContainer, {
75
- theme: theme,
81
+ return /*#__PURE__*/jsxs(ChartContainer, {
76
82
  options: options,
77
83
  chartRef: chartRef,
84
+ theme: theme,
78
85
  title: title,
79
86
  dataTableRenderer: dataTableRenderer,
80
- children: actions
87
+ children: [actions, showThemeSelector && /*#__PURE__*/jsx(PaletteSelect, {
88
+ theme: theme,
89
+ onClick: setTheme
90
+ })]
81
91
  });
82
92
  });
83
93
  GenericChartBase.displayName = "GenericChart";
94
+
95
+ /**
96
+ * GenericChart component renders a generic chart using ECharts.
97
+ * It accepts various chart options and configurations, allowing for flexible chart rendering.
98
+ * It supports click events, brush events, and custom actions.
99
+ * It can be used to create a wide range of chart types by passing the appropriate ECharts options.
100
+ *
101
+ * @param props - The properties for the GenericChart component, including chart options, event handlers, and custom actions.
102
+ * @returns A React functional component that renders the chart within a ChartWrapper.
103
+ *
104
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/charts-genericchart--docs} for more details on the properties.
105
+ * @see {@link https://echarts.apache.org/en/option.html} for ECharts options documentation.
106
+ * @see {@link https://echarts.apache.org/en/api.html#echartsInstance} for ECharts instance methods and properties.
107
+ */
84
108
  var GenericChart = function GenericChart(props) {
85
109
  return /*#__PURE__*/jsx(ChartWrapper, {
86
110
  children: /*#__PURE__*/jsx(GenericChartBase, _objectSpread({}, props))
@@ -23,7 +23,8 @@ var MapSeriesChart = /*#__PURE__*/memo(function (_ref) {
23
23
  var data = _ref.data,
24
24
  onExport = _ref.onExport;
25
25
  _ref.theme;
26
- var title = _ref.title,
26
+ var showTypeSelector = _ref.showTypeSelector,
27
+ title = _ref.title,
27
28
  _onClick = _ref.onClick;
28
29
  var chartRef = useRef(null);
29
30
  var _useState = useState("map"),
@@ -163,7 +164,7 @@ var MapSeriesChart = /*#__PURE__*/memo(function (_ref) {
163
164
  onChange: function onChange(e) {
164
165
  return setZoom(e.target.valueAsNumber);
165
166
  }
166
- }), /*#__PURE__*/jsxs(ToggleButtonGroup, {
167
+ }), showTypeSelector && /*#__PURE__*/jsxs(ToggleButtonGroup, {
167
168
  value: type,
168
169
  onChange: setType,
169
170
  children: [/*#__PURE__*/jsx(Button, {
@@ -185,7 +186,30 @@ var MapSeriesChart = /*#__PURE__*/memo(function (_ref) {
185
186
  MapSeriesChart.displayName = "MapSeriesChart";
186
187
 
187
188
  /**
188
- * Chart to display simple map data series
189
+ * MapSeries component renders a map chart using ECharts.
190
+ * It displays data on a world map, allowing users to visualize counts or other metrics by country.
191
+ * It supports zooming and switching between map and column views.
192
+ *
193
+ * @param {MapSeriesProps} props - The properties for the MapSeries component.
194
+ * @returns {JSX.Element} The rendered MapSeries component.
195
+ *
196
+ * @example
197
+ * ```jsx
198
+ * <MapSeries
199
+ * data={[
200
+ * { id: "US", label: "United States", count: 100 },
201
+ * { id: "IN", label: "India", count: 200 },
202
+ * { id: "CN", label: "China", count: 300 },
203
+ * ]}
204
+ * onExport={() => console.log("Exporting chart")}
205
+ * title="World Map Series"
206
+ * onClick={(key) => console.log("Clicked country:", key)}
207
+ * theme="light"
208
+ * />
209
+ * ```
210
+ *
211
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/charts-mapseries--docs} for more details on the properties.
212
+ * @see {@link https://echarts.apache.org/en/option.html#series-map} for ECharts map series options documentation.
189
213
  */
190
214
  var MapSeries = function MapSeries(props) {
191
215
  return /*#__PURE__*/jsx(ChartWrapper, {
@@ -19,6 +19,8 @@ var TimeSeriesChart = /*#__PURE__*/memo(function (_ref) {
19
19
  categoryAxisName = _ref.categoryAxisName,
20
20
  valueAxisName = _ref.valueAxisName,
21
21
  title = _ref.title,
22
+ showThemeSelector = _ref.showThemeSelector,
23
+ showTypeSelector = _ref.showTypeSelector,
22
24
  chartTheme = _ref.theme,
23
25
  _ref$type = _ref.type,
24
26
  chartType = _ref$type === void 0 ? "column" : _ref$type,
@@ -144,7 +146,8 @@ var TimeSeriesChart = /*#__PURE__*/memo(function (_ref) {
144
146
  tooltip: {
145
147
  trigger: "axis",
146
148
  confine: true,
147
- position: "top"
149
+ position: "top",
150
+ appendToBody: true
148
151
  }
149
152
  };
150
153
  }, [data, type, categoryAxisName, valueAxisName], "TimeChart options");
@@ -163,7 +166,7 @@ var TimeSeriesChart = /*#__PURE__*/memo(function (_ref) {
163
166
  series: e.seriesId
164
167
  });
165
168
  },
166
- children: [/*#__PURE__*/jsxs(ToggleButtonGroup, {
169
+ children: [showTypeSelector && /*#__PURE__*/jsxs(ToggleButtonGroup, {
167
170
  value: type,
168
171
  onChange: setType,
169
172
  children: [/*#__PURE__*/jsx(Button, {
@@ -191,9 +194,9 @@ var TimeSeriesChart = /*#__PURE__*/memo(function (_ref) {
191
194
  value: "column-stacked",
192
195
  "aria-label": "column-stacked"
193
196
  })]
194
- }), /*#__PURE__*/jsx(Divider, {
197
+ }), showTypeSelector && showThemeSelector && /*#__PURE__*/jsx(Divider, {
195
198
  vertical: true
196
- }), /*#__PURE__*/jsx(PaletteSelect, {
199
+ }), showThemeSelector && /*#__PURE__*/jsx(PaletteSelect, {
197
200
  theme: theme,
198
201
  onClick: setTheme
199
202
  })]
@@ -202,7 +205,30 @@ var TimeSeriesChart = /*#__PURE__*/memo(function (_ref) {
202
205
  TimeSeriesChart.displayName = "TimeSeriesChart";
203
206
 
204
207
  /**
205
- * Chart to display simple data time series
208
+ * TimeSeries component renders a time series chart using the provided data and options.
209
+ * It supports different chart types such as line, column, and stacked variants.
210
+ * It also allows for interaction through click and brush events.
211
+ *
212
+ * @param {TimeSeriesProps} props - The properties for the TimeSeries component.
213
+ * @returns {JSX.Element} The rendered TimeSeries component.
214
+ *
215
+ * @example
216
+ * ```jsx
217
+ * <TimeSeries
218
+ * data={data}
219
+ * onExport={handleExport}
220
+ * categoryAxisName="Time"
221
+ * valueAxisName="Value"
222
+ * title="Time Series Chart"
223
+ * type="line"
224
+ * onClick={(data) => console.log(data)}
225
+ * onBrush={(range) => console.log(range)}
226
+ * />
227
+ * ```
228
+ *
229
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/charts-timeseries--docs} for more details on the properties.
230
+ * @see {@link https://echarts.apache.org/en/option.html#series-line} for more details on the ECharts line series options.
231
+ * @see {@link https://echarts.apache.org/en/option.html#series-bar} for more details on the ECharts bar series options.
206
232
  */
207
233
  var TimeSeries = function TimeSeries(props) {
208
234
  return /*#__PURE__*/jsx(ChartWrapper, {
@@ -184,7 +184,27 @@ var TimeSliderChart = /*#__PURE__*/memo(function (_ref) {
184
184
  TimeSliderChart.displayName = "TimeSliderChart";
185
185
 
186
186
  /**
187
- * Chart to display time scale data with zoom and brush */
187
+ * TimeSlider component renders a time slider chart.
188
+ * It allows users to visualize time-based data and interactively select a range.
189
+ * The chart supports brushing to select a specific time range,
190
+ * and it emits an event when the range is changed.
191
+ *
192
+ * @param {TimeSliderProps} props - The properties for the TimeSlider component.
193
+ * @returns {JSX.Element} The rendered TimeSlider component.
194
+ *
195
+ * @example
196
+ * ```jsx
197
+ * <TimeSlider
198
+ * data={data}
199
+ * range={{ start: new Date("2023-01-01"), end: new Date("2023-12-31") }}
200
+ * onBrush={(range) => console.log("Selected range:", range)}
201
+ * />
202
+ * ```
203
+ *
204
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/charts-timeslider--docs} for more details on the properties.
205
+ * @see {@link https://echarts.apache.org/en/option.html#dataZoom} for more details on the ECharts dataZoom feature.
206
+ * @see {@link https://echarts.apache.org/en/option.html#series-line} for more details on the ECharts line series.
207
+ */
188
208
  var TimeSlider = function TimeSlider(props) {
189
209
  return /*#__PURE__*/jsx(ChartWrapper, {
190
210
  children: /*#__PURE__*/jsx(TimeSliderChart, _objectSpread({}, props))
@@ -23,6 +23,12 @@ var WordBubbleChart = /*#__PURE__*/memo(function (_ref) {
23
23
  var palette = isDark ? ChartPalette.CloudDark : ChartPalette.CloudLight;
24
24
  return {
25
25
  legend: undefined,
26
+ tooltip: {
27
+ trigger: "axis",
28
+ confine: true,
29
+ position: "top",
30
+ appendToBody: true
31
+ },
26
32
  series: [{
27
33
  name: title,
28
34
  type: "wordCloud",
@@ -69,7 +75,31 @@ var WordBubbleChart = /*#__PURE__*/memo(function (_ref) {
69
75
  WordBubbleChart.displayName = "WordBubbleChart";
70
76
 
71
77
  /**
72
- * Chart to display simple word cloud
78
+ * WordBubble component renders a word cloud chart using ECharts.
79
+ * It displays words with sizes proportional to their frequency in the data.
80
+ * Users can click on words to trigger an action, such as filtering or navigating.
81
+ * It also supports exporting the chart and displays an empty state when no data is available.
82
+ *
83
+ * @param {WordBubbleProps} props - The properties for the WordBubble component.
84
+ * @returns {JSX.Element} The rendered WordBubble component.
85
+ *
86
+ * @example
87
+ * ```jsx
88
+ * <WordBubble
89
+ * data={[
90
+ * { id: "1", label: "Word One", count: 10 },
91
+ * { id: "2", label: "Word Two", count: 20 },
92
+ * { id: "3", label: "Word Three", count: 30 },
93
+ * ]}
94
+ * title="Word Frequency"
95
+ * onExport={() => console.log("Exporting chart...")}
96
+ * onClick={(key) => console.log("Clicked word:", key)}
97
+ * theme="light"
98
+ * />
99
+ * ```
100
+ *
101
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/charts-wordbubble--docs} for the properties that can be passed to this component.
102
+ * @see {@link https://github.com/ecomfe/echarts-wordcloud} for the underlying chart implementation.
73
103
  */
74
104
  var WordBubble = function WordBubble(props) {
75
105
  return /*#__PURE__*/jsx(ChartWrapper, {
@@ -309,11 +309,6 @@ var DarkThemeBase = {
309
309
  }
310
310
  }
311
311
  },
312
- visualMap: {
313
- textStyle: {
314
- color: "#eee"
315
- }
316
- },
317
312
  toolbox: {
318
313
  iconStyle: {
319
314
  borderColor: "#999999"