@react-fabric/chart 1.0.0-beta.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.
Files changed (88) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +10 -0
  3. package/dist/cjs/charts/ActivityMap.js +183 -0
  4. package/dist/cjs/charts/CountSeries.js +156 -0
  5. package/dist/cjs/charts/DataSeries.js +185 -0
  6. package/dist/cjs/charts/Generic.js +90 -0
  7. package/dist/cjs/charts/MapSeries.js +215 -0
  8. package/dist/cjs/charts/TimeSeries.js +213 -0
  9. package/dist/cjs/charts/TimeSlider.js +194 -0
  10. package/dist/cjs/charts/WordBubble.js +80 -0
  11. package/dist/cjs/index.js +23 -0
  12. package/dist/cjs/theme/darkBase.js +418 -0
  13. package/dist/cjs/theme/index.js +98 -0
  14. package/dist/cjs/theme/lightBase.js +415 -0
  15. package/dist/cjs/theme/palettes.js +113 -0
  16. package/dist/cjs/types/charts.js +56 -0
  17. package/dist/cjs/types/utils.js +104 -0
  18. package/dist/cjs/types/world.svg.js +5 -0
  19. package/dist/cjs/wrapper/Chart.module.css +1 -0
  20. package/dist/cjs/wrapper/ChartContainer.js +171 -0
  21. package/dist/cjs/wrapper/ChartToolbar.js +38 -0
  22. package/dist/cjs/wrapper/ChartWrapper.js +57 -0
  23. package/dist/cjs/wrapper/PaletteSelect.js +146 -0
  24. package/dist/esm/charts/ActivityMap.js +183 -0
  25. package/dist/esm/charts/CountSeries.js +156 -0
  26. package/dist/esm/charts/DataSeries.js +185 -0
  27. package/dist/esm/charts/Generic.js +90 -0
  28. package/dist/esm/charts/MapSeries.js +196 -0
  29. package/dist/esm/charts/TimeSeries.js +213 -0
  30. package/dist/esm/charts/TimeSlider.js +194 -0
  31. package/dist/esm/charts/WordBubble.js +80 -0
  32. package/dist/esm/index.js +11 -0
  33. package/dist/esm/theme/darkBase.js +418 -0
  34. package/dist/esm/theme/index.js +97 -0
  35. package/dist/esm/theme/lightBase.js +415 -0
  36. package/dist/esm/theme/palettes.js +113 -0
  37. package/dist/esm/types/charts.js +35 -0
  38. package/dist/esm/types/utils.js +101 -0
  39. package/dist/esm/types/world.svg.js +5 -0
  40. package/dist/esm/wrapper/Chart.module.css +1 -0
  41. package/dist/esm/wrapper/ChartContainer.js +152 -0
  42. package/dist/esm/wrapper/ChartToolbar.js +38 -0
  43. package/dist/esm/wrapper/ChartWrapper.js +57 -0
  44. package/dist/esm/wrapper/PaletteSelect.js +146 -0
  45. package/dist/types/charts/ActivityMap.d.ts +21 -0
  46. package/dist/types/charts/CountSeries.d.ts +10 -0
  47. package/dist/types/charts/DataSeries.d.ts +13 -0
  48. package/dist/types/charts/Generic.d.ts +56 -0
  49. package/dist/types/charts/MapSeries.d.ts +9 -0
  50. package/dist/types/charts/TimeSeries.d.ts +17 -0
  51. package/dist/types/charts/TimeSlider.d.ts +16 -0
  52. package/dist/types/charts/WordBubble.d.ts +9 -0
  53. package/dist/types/index.d.ts +9 -0
  54. package/dist/types/theme/darkBase.d.ts +391 -0
  55. package/dist/types/theme/index.d.ts +2 -0
  56. package/dist/types/theme/lightBase.d.ts +388 -0
  57. package/dist/types/theme/palettes.d.ts +45 -0
  58. package/dist/types/types/charts.d.ts +3 -0
  59. package/dist/types/types/index.d.ts +36 -0
  60. package/dist/types/types/utils.d.ts +4 -0
  61. package/dist/types/types/world.svg.d.ts +2 -0
  62. package/dist/types/wrapper/ChartContainer.d.ts +20 -0
  63. package/dist/types/wrapper/ChartToolbar.d.ts +3 -0
  64. package/dist/types/wrapper/ChartWrapper.d.ts +5 -0
  65. package/dist/types/wrapper/PaletteSelect.d.ts +1 -0
  66. package/package.json +58 -0
  67. package/src/charts/ActivityMap.tsx +295 -0
  68. package/src/charts/CountSeries.tsx +186 -0
  69. package/src/charts/DataSeries.tsx +228 -0
  70. package/src/charts/Generic.tsx +190 -0
  71. package/src/charts/MapSeries.tsx +217 -0
  72. package/src/charts/TimeSeries.tsx +236 -0
  73. package/src/charts/TimeSlider.tsx +235 -0
  74. package/src/charts/WordBubble.tsx +105 -0
  75. package/src/index.ts +32 -0
  76. package/src/theme/darkBase.ts +400 -0
  77. package/src/theme/index.ts +122 -0
  78. package/src/theme/lightBase.ts +397 -0
  79. package/src/theme/palettes.ts +589 -0
  80. package/src/types/charts.ts +32 -0
  81. package/src/types/index.ts +61 -0
  82. package/src/types/utils.ts +151 -0
  83. package/src/types/world.svg.ts +467 -0
  84. package/src/wrapper/Chart.module.css +90 -0
  85. package/src/wrapper/ChartContainer.tsx +217 -0
  86. package/src/wrapper/ChartToolbar.tsx +40 -0
  87. package/src/wrapper/ChartWrapper.tsx +46 -0
  88. package/src/wrapper/PaletteSelect.tsx +139 -0
@@ -0,0 +1,90 @@
1
+ /*
2
+ * React Fabric
3
+ * @version: 1.0.0
4
+ *
5
+ *
6
+ * The MIT License (MIT)
7
+ * Copyright (c) 2024 Adarsh Pastakia
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
10
+ * and associated documentation files (the "Software"), to deal in the Software without restriction,
11
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
12
+ * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
13
+ * subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in all copies or substantial
16
+ * portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
19
+ * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ */
23
+
24
+ .chartContainer {
25
+ & > div:last-child:not(:first-child) > :last-child {
26
+ top: 0;
27
+ right: unset !important;
28
+ bottom: unset !important;
29
+ left: unset !important;
30
+ inset-inline-end: 0 !important;
31
+
32
+ padding: 0.5rem;
33
+
34
+ & > div {
35
+ float: unset !important;
36
+ margin: 0 !important;
37
+ }
38
+ }
39
+ }
40
+
41
+ .chartToolbar {
42
+ input[type="range"] {
43
+ position: relative;
44
+
45
+ overflow: hidden;
46
+
47
+ color: theme(colors.primary.500);
48
+
49
+ appearance: none;
50
+ border-radius: 999px;
51
+
52
+ &::-webkit-slider-thumb {
53
+ cursor: pointer;
54
+
55
+ position: relative;
56
+
57
+ width: 1rem;
58
+ height: 1rem;
59
+
60
+ appearance: none;
61
+ opacity: 0.7;
62
+ background: theme(colors.primary.500);
63
+ clip-path: polygon(
64
+ 100% -1px,
65
+ 0.125rem -1px,
66
+ 0 0.375rem,
67
+ -100vmax 0.375rem,
68
+ -100vmax 0.625rem,
69
+ 0 0.625rem,
70
+ 0.125rem 100%,
71
+ calc(100% + 1px) calc(100% + 1px)
72
+ );
73
+ filter: brightness(100%);
74
+ border: 1px solid theme(colors.tint.50);
75
+ border-radius: 0.5rem;
76
+ box-shadow: calc(-100vmax - 1rem) 0 0 100vmax currentColor;
77
+
78
+ &:hover {
79
+ background: theme(colors.primary.600);
80
+ }
81
+ }
82
+
83
+ &&::-webkit-slider-runnable-track {
84
+ height: 1rem;
85
+ background: linear-gradient(theme(colors.tint.100) 0 0) scroll no-repeat
86
+ center / 100% 0.25rem;
87
+ border-radius: 99px;
88
+ }
89
+ }
90
+ }
@@ -0,0 +1,217 @@
1
+ /*
2
+ * React Fabric
3
+ * @version: 1.0.0
4
+ *
5
+ *
6
+ * The MIT License (MIT)
7
+ * Copyright (c) 2024 Adarsh Pastakia
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
10
+ * and associated documentation files (the "Software"), to deal in the Software without restriction,
11
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
12
+ * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
13
+ * subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in all copies or substantial
16
+ * portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
19
+ * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ */
23
+
24
+ import {
25
+ Button,
26
+ CoreIcons,
27
+ EmptyContent,
28
+ Title,
29
+ useIsDark,
30
+ useResizeObserver,
31
+ } from "@react-fabric/core";
32
+ import { type SizeObject } from "@react-fabric/core/dist/types/types";
33
+ import classNames from "classnames";
34
+ import { type EChartOption, type EChartsType } from "echarts";
35
+ import "echarts-wordcloud";
36
+ import {
37
+ Fragment,
38
+ memo,
39
+ useCallback,
40
+ useEffect,
41
+ useImperativeHandle,
42
+ useMemo,
43
+ useState,
44
+ type RefObject,
45
+ } from "react";
46
+ import { type Theme } from "../types";
47
+ import echarts from "../types/charts";
48
+ import classes from "./Chart.module.css";
49
+ import { ChartToolbar } from "./ChartToolbar";
50
+
51
+ const defaultOptions = {
52
+ grid: {
53
+ top: 32,
54
+ left: 64,
55
+ right: 32,
56
+ bottom: 72,
57
+ },
58
+ tooltip: {
59
+ trigger: "item",
60
+ confine: true,
61
+ position: "top",
62
+ } as AnyObject,
63
+ legend: {
64
+ type: "scroll",
65
+ bottom: 0,
66
+ } as AnyObject,
67
+ };
68
+ const toolboxOptions = (renderer: AnyObject) => ({
69
+ show: true,
70
+ feature: {
71
+ dataView: {
72
+ show: true,
73
+ readOnly: true,
74
+ textareaBorderColor: "transparent",
75
+ backgroundColor: "var(--fabric-bg)",
76
+ textareaColor: "var(--fabric-bg)",
77
+ textColor: "inherit",
78
+ optionToContent: renderer,
79
+ },
80
+ },
81
+ });
82
+
83
+ export const ChartContainer = memo(
84
+ ({
85
+ theme = "default",
86
+ title,
87
+ options,
88
+ children,
89
+ onResize,
90
+ onClick,
91
+ onExport,
92
+ isEmpty,
93
+ emptyIcon,
94
+ chartRef: _ref,
95
+ dataTableRenderer,
96
+ }: {
97
+ title?: string;
98
+ theme?: Theme;
99
+ isEmpty?: boolean;
100
+ emptyIcon?: string;
101
+ options: EChartOption;
102
+ children?: AnyObject;
103
+ chartRef?: RefObject<EChartsType>;
104
+ onClick?: (event: AnyObject) => void;
105
+ onExport?: (event: AnyObject) => void;
106
+ dataTableRenderer?: (opt: KeyValue) => string;
107
+ onResize?: (size: { width: number; height: number }) => void;
108
+ }) => {
109
+ const [chartRef, setChartRef] = useState<EChartsType>();
110
+ const isDark = useIsDark();
111
+
112
+ const handleResize = useCallback(
113
+ (size: SizeObject) => {
114
+ onResize?.(size);
115
+ chartRef?.resize(size);
116
+ },
117
+ [chartRef],
118
+ );
119
+ const containerRef = useResizeObserver(handleResize);
120
+
121
+ useImperativeHandle<EChartsType | undefined, EChartsType | undefined>(
122
+ _ref,
123
+ () => chartRef,
124
+ [chartRef],
125
+ );
126
+
127
+ const chartTheme = useMemo(
128
+ () => (isDark ? `${theme}_dark` : theme),
129
+ [theme, isDark],
130
+ );
131
+
132
+ useEffect(() => {
133
+ if (containerRef.current) {
134
+ const { offsetWidth: width, offsetHeight: height } =
135
+ containerRef.current;
136
+ const chartRef = echarts.init(containerRef.current, chartTheme);
137
+ chartRef.resize({ width, height });
138
+ onResize?.({ width, height });
139
+ setChartRef(chartRef);
140
+
141
+ return () => {
142
+ chartRef.dispose();
143
+ };
144
+ }
145
+ }, [chartTheme]);
146
+
147
+ useEffect(() => {
148
+ const chart = chartRef;
149
+ if (chart) {
150
+ onClick != null && chart.on("click", onClick);
151
+ return () => {
152
+ !chart.isDisposed() && chart.off("click");
153
+ };
154
+ }
155
+ }, [chartRef, onClick]);
156
+
157
+ const toolbox = useMemo(
158
+ () => toolboxOptions(dataTableRenderer),
159
+ [dataTableRenderer],
160
+ );
161
+
162
+ useEffect(() => {
163
+ chartRef?.setOption(
164
+ {
165
+ ...defaultOptions,
166
+ toolbox,
167
+ ...options,
168
+ },
169
+ true,
170
+ );
171
+ }, [options, chartRef]);
172
+
173
+ const handleExport = useCallback(() => {
174
+ const image = chartRef?.getDataURL({
175
+ type: "png",
176
+ excludeComponents: ["toolbox"],
177
+ });
178
+ onExport?.({ image, title });
179
+ }, [chartRef, onExport, title]);
180
+
181
+ return (
182
+ <Fragment>
183
+ <ChartToolbar>
184
+ {title && (
185
+ <Title className="flex-fill px-2 py-1 text-dimmed">{title}</Title>
186
+ )}
187
+ {children}
188
+ {onExport && (
189
+ <Button
190
+ size="sm"
191
+ variant="link"
192
+ icon={CoreIcons.exporter}
193
+ onClick={handleExport}
194
+ aria-label="export"
195
+ />
196
+ )}
197
+ </ChartToolbar>
198
+ <div
199
+ ref={containerRef}
200
+ className={classNames(
201
+ classes.chartContainer,
202
+ "overflow-hidden area-content",
203
+ )}
204
+ />
205
+ {isEmpty && (
206
+ <div className="absolute inset-0 bg-base grid place-content-center">
207
+ <EmptyContent
208
+ icon={emptyIcon ?? CoreIcons.chartLine}
209
+ message="Empty chart"
210
+ />
211
+ </div>
212
+ )}
213
+ </Fragment>
214
+ );
215
+ },
216
+ );
217
+ ChartContainer.displayName = "ChartContainer";
@@ -0,0 +1,40 @@
1
+ /*
2
+ * React Fabric
3
+ * @version: 1.0.0
4
+ *
5
+ *
6
+ * The MIT License (MIT)
7
+ * Copyright (c) 2024 Adarsh Pastakia
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
10
+ * and associated documentation files (the "Software"), to deal in the Software without restriction,
11
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
12
+ * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
13
+ * subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in all copies or substantial
16
+ * portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
19
+ * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ */
23
+
24
+ import { type ChildrenProp } from "@react-fabric/core/dist/types/types";
25
+ import classNames from "classnames";
26
+ import { type FC } from "react";
27
+ import classes from "./Chart.module.css";
28
+
29
+ export const ChartToolbar: FC<ChildrenProp> = ({ children }) => {
30
+ return (
31
+ <div
32
+ className={classNames(
33
+ "flex flex-nowrap items-center justify-end bg-base area-head",
34
+ classes.chartToolbar,
35
+ )}
36
+ >
37
+ {children}
38
+ </div>
39
+ );
40
+ };
@@ -0,0 +1,46 @@
1
+ /*
2
+ * React Fabric
3
+ * @version: 1.0.0
4
+ *
5
+ *
6
+ * The MIT License (MIT)
7
+ * Copyright (c) 2024 Adarsh Pastakia
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
10
+ * and associated documentation files (the "Software"), to deal in the Software without restriction,
11
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
12
+ * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
13
+ * subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in all copies or substantial
16
+ * portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
19
+ * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ */
23
+
24
+ import { ErrorBoundary } from "@react-fabric/core";
25
+ import "echarts-wordcloud";
26
+ import { type FC } from "react";
27
+
28
+ const Error: FC<{ error?: string }> = ({ error = "" }) => {
29
+ return (
30
+ <div className="text-sm">
31
+ <span className="bg-danger text-white py-1 px-2 mx-2 rounded">Error</span>
32
+ <span>{error}</span>
33
+ </div>
34
+ );
35
+ };
36
+
37
+ export const ChartWrapper = ({ children }: { children?: JSX.Element }) => {
38
+ return (
39
+ <div
40
+ className="grid overflow-hidden area-content relative"
41
+ style={{ gridTemplate: `"head" auto "content" 1fr / 1fr` }}
42
+ >
43
+ <ErrorBoundary errorElement={Error}>{children}</ErrorBoundary>
44
+ </div>
45
+ );
46
+ };
@@ -0,0 +1,139 @@
1
+ /*
2
+ * React Fabric
3
+ * @version: 1.0.0
4
+ *
5
+ *
6
+ * The MIT License (MIT)
7
+ * Copyright (c) 2024 Adarsh Pastakia
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
10
+ * and associated documentation files (the "Software"), to deal in the Software without restriction,
11
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
12
+ * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
13
+ * subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in all copies or substantial
16
+ * portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
19
+ * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ */
23
+
24
+ import {
25
+ Button,
26
+ CoreIcons,
27
+ Dropdown,
28
+ Menu,
29
+ MenuItem,
30
+ } from "@react-fabric/core";
31
+ import { ChartPalette } from "../theme/palettes";
32
+
33
+ const PaletteMap = ({ colors = [], label = "" }: KeyValue): AnyObject => (
34
+ <div className="flex items-center">
35
+ {colors.slice(0, 8).map((c: string) => (
36
+ <div
37
+ key={c}
38
+ className="inline-block rounded-full outline w-3 h-3 mx-px"
39
+ style={{ backgroundColor: c }}
40
+ />
41
+ ))}
42
+ <div className="text-xs text-muted px-2">{label}</div>
43
+ </div>
44
+ );
45
+
46
+ export const PaletteSelect = ({
47
+ onClick,
48
+ theme = "default",
49
+ defaultTheme = "default",
50
+ }: KeyValue) => {
51
+ return (
52
+ <Dropdown>
53
+ <Button
54
+ icon={CoreIcons.palette}
55
+ aria-label="palette"
56
+ size="sm"
57
+ variant="link"
58
+ />
59
+ <Menu onClick={onClick}>
60
+ <MenuItem
61
+ id={defaultTheme}
62
+ icon={theme === defaultTheme ? "◉" : "◯"}
63
+ label={PaletteMap({ label: "Default", colors: ChartPalette.Default })}
64
+ />
65
+ <MenuItem
66
+ id="qualitative"
67
+ icon={theme === "qualitative" ? "◉" : "◯"}
68
+ label={PaletteMap({
69
+ label: "Qualitative",
70
+ colors: ChartPalette.Qualitative,
71
+ })}
72
+ />
73
+ <MenuItem
74
+ id="diverging"
75
+ icon={theme === "diverging" ? "◉" : "◯"}
76
+ label={PaletteMap({
77
+ label: "Diverging",
78
+ colors: ChartPalette.Diverging,
79
+ })}
80
+ />
81
+ <MenuItem
82
+ id="sequential"
83
+ icon={theme === "sequential" ? "◉" : "◯"}
84
+ label={PaletteMap({
85
+ label: "Sequential",
86
+ colors: ChartPalette.Sequential,
87
+ })}
88
+ />
89
+ <MenuItem
90
+ id="spectral"
91
+ icon={theme === "spectral" ? "◉" : "◯"}
92
+ label={PaletteMap({
93
+ label: "Spectral",
94
+ colors: ChartPalette.Spectral,
95
+ })}
96
+ />
97
+ <MenuItem
98
+ id="uber"
99
+ icon={theme === "uber" ? "◉" : "◯"}
100
+ label={PaletteMap({
101
+ label: "Uber Pool",
102
+ colors: ChartPalette.UberPool,
103
+ })}
104
+ />
105
+ <MenuItem
106
+ id="fireice"
107
+ icon={theme === "fireice" ? "◉" : "◯"}
108
+ label={PaletteMap({
109
+ label: "Fire Ice",
110
+ colors: ChartPalette.FireIce,
111
+ })}
112
+ />
113
+ <MenuItem
114
+ id="warming"
115
+ icon={theme === "warming" ? "◉" : "◯"}
116
+ label={PaletteMap({
117
+ label: "Global Warming",
118
+ colors: ChartPalette.GlobalWarming,
119
+ })}
120
+ />
121
+ <MenuItem
122
+ id="sunrise"
123
+ icon={theme === "sunrise" ? "◉" : "◯"}
124
+ label={PaletteMap({ label: "Sunrise", colors: ChartPalette.Sunrise })}
125
+ />
126
+ <MenuItem
127
+ id="ocean"
128
+ icon={theme === "ocean" ? "◉" : "◯"}
129
+ label={PaletteMap({ label: "Ocean", colors: ChartPalette.Ocean })}
130
+ />
131
+ <MenuItem
132
+ id="wine"
133
+ icon={theme === "wine" ? "◉" : "◯"}
134
+ label={PaletteMap({ label: "Wine", colors: ChartPalette.Wine })}
135
+ />
136
+ </Menu>
137
+ </Dropdown>
138
+ );
139
+ };