@validationcloud/fractal-ui 1.77.0 → 1.79.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -0
- package/dist/charts.d.ts +2 -0
- package/dist/charts.js +29 -20
- package/dist/components/dropdown-menu/dropdown-menu.js +34 -26
- package/dist/components/echarts-renderer/geo/africa-countries.json.d.ts +2463 -0
- package/dist/components/echarts-renderer/geo/africa-countries.json.js +9 -0
- package/dist/components/echarts-renderer/geo/americas-countries.json.d.ts +4160 -0
- package/dist/components/echarts-renderer/geo/americas-countries.json.js +9 -0
- package/dist/components/echarts-renderer/geo/asia-countries.json.d.ts +4297 -0
- package/dist/components/echarts-renderer/geo/asia-countries.json.js +9 -0
- package/dist/components/echarts-renderer/geo/europe-countries.json.d.ts +2486 -0
- package/dist/components/echarts-renderer/geo/europe-countries.json.js +9 -0
- package/dist/components/echarts-renderer/geo/us-states.json.d.ts +1338 -0
- package/dist/components/echarts-renderer/geo/us-states.json.js +9 -0
- package/dist/components/echarts-renderer/geo/world-continents.json.d.ts +10639 -0
- package/dist/components/echarts-renderer/geo/world-continents.json.js +9 -0
- package/dist/components/echarts-renderer/geo/world-countries.json.d.ts +14549 -0
- package/dist/components/echarts-renderer/geo/world-countries.json.js +9 -0
- package/dist/components/echarts-renderer/geo/world-regions.json.d.ts +10621 -0
- package/dist/components/echarts-renderer/geo/world-regions.json.js +9 -0
- package/dist/components/echarts-renderer/map-centers.d.ts +1 -0
- package/dist/components/echarts-renderer/map-centers.js +13 -0
- package/dist/components/echarts-renderer/map-style.d.ts +12 -0
- package/dist/components/echarts-renderer/map-style.js +12 -0
- package/dist/components/echarts-renderer/mavrik-theme-horizontal.json.d.ts +36 -0
- package/dist/components/echarts-renderer/mavrik-theme-horizontal.json.js +26 -22
- package/dist/components/echarts-renderer/mavrik-theme.json.d.ts +36 -0
- package/dist/components/echarts-renderer/mavrik-theme.json.js +26 -22
- package/dist/components/echarts-renderer/natural-earth-projection.d.ts +29 -0
- package/dist/components/echarts-renderer/natural-earth-projection.js +64 -0
- package/dist/components/echarts-renderer/register-map.d.ts +24 -0
- package/dist/components/echarts-renderer/register-map.js +62 -0
- package/dist/components/echarts-renderer/sanitize-chart-options.d.ts +2 -2
- package/dist/components/echarts-renderer/sanitize-chart-options.js +28 -5
- package/dist/components/echarts-renderer/use-chart-instance.js +38 -36
- package/dist/hooks/use-scroll-to-bottom.d.ts +4 -3
- package/dist/lib/render-chart-to-image.js +72 -43
- package/dist/maps.json +438 -0
- package/package.json +22 -4
package/README.md
CHANGED
|
@@ -23,6 +23,26 @@ Add styles to your global stylesheet (requires Tailwind 4):
|
|
|
23
23
|
@import '@validationcloud/fractal-ui/tailwind.css';
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
+
## ECharts Maps
|
|
27
|
+
|
|
28
|
+
The package bundles GeoJSON maps (world, continents, regions, and per-continent breakdowns) and lazy-loads them automatically when you use `EChartsRenderer` with `type: 'map'`. Import map utilities from `@validationcloud/fractal-ui/charts`. Install `echarts` as a peer dependency.
|
|
29
|
+
|
|
30
|
+
A machine-readable catalog of all available maps, their descriptions, and region names is published at `@validationcloud/fractal-ui/maps.json`. From non-JS environments you can fetch it directly from unpkg:
|
|
31
|
+
|
|
32
|
+
```sh
|
|
33
|
+
curl -L https://unpkg.com/@validationcloud/fractal-ui/dist/maps.json
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Adding A New Map
|
|
37
|
+
|
|
38
|
+
To add another generated map to this package:
|
|
39
|
+
|
|
40
|
+
1. Add a new `MapDefinition` entry in `scripts/generate-maps.ts` with a `fileName`, `description`, and `buildRegions` implementation.
|
|
41
|
+
2. Update `src/components/echarts-renderer/register-map.ts` so the new map name points at its generated GeoJSON file.
|
|
42
|
+
3. Update `src/components/echarts-renderer/natural-earth-projection.ts` if the new map needs world-style projection handling or custom Lambert parameters.
|
|
43
|
+
4. Run `pnpm generate:maps` to regenerate the GeoJSON assets, map centers, map styles, and `src/maps.json`.
|
|
44
|
+
5. Add or update a Storybook example so the new map can be verified visually.
|
|
45
|
+
|
|
26
46
|
## Development
|
|
27
47
|
|
|
28
48
|
Requires Node.js 22.14.0+ and pnpm.
|
package/dist/charts.d.ts
CHANGED
|
@@ -8,3 +8,5 @@ export { hasHorizontalBars } from './components/echarts-renderer/detect-horizont
|
|
|
8
8
|
export { sanitizeChartOptionsForStaticRendering } from './components/echarts-renderer/sanitize-chart-options-for-static-rendering';
|
|
9
9
|
export { FormatterToken, isFormatterToken } from './components/echarts-renderer/formatters/formatter-tokens';
|
|
10
10
|
export { replaceFormatterTokens } from './components/echarts-renderer/formatters/replace-formatter-tokens';
|
|
11
|
+
export { createLambertProjection, createMapProjection, createNaturalEarthProjection, naturalEarthProjection, } from './components/echarts-renderer/natural-earth-projection';
|
|
12
|
+
export { MAP_ITEM_STYLE, MAP_EMPHASIS_ITEM_STYLE, MAP_VISUAL_MAP_COLORS, } from './components/echarts-renderer/map-style';
|
package/dist/charts.js
CHANGED
|
@@ -1,26 +1,35 @@
|
|
|
1
1
|
import { EChartsRenderer as e } from "./components/echarts-renderer/echarts-renderer.js";
|
|
2
2
|
import { isChartTheme as a } from "./components/echarts-renderer/chart-theme.js";
|
|
3
|
-
import { EChartsChartOption as
|
|
4
|
-
import { useChartInstance as
|
|
5
|
-
import { MavrikChart as
|
|
6
|
-
import { MAVRIK_THEME as
|
|
7
|
-
import { hasHorizontalBars as
|
|
8
|
-
import { sanitizeChartOptionsForStaticRendering as
|
|
9
|
-
import { FormatterToken as
|
|
10
|
-
import { replaceFormatterTokens as
|
|
3
|
+
import { EChartsChartOption as n, isEChartsChartOption as i } from "./components/echarts-renderer/echarts-chart-option.js";
|
|
4
|
+
import { useChartInstance as h } from "./components/echarts-renderer/use-chart-instance.js";
|
|
5
|
+
import { MavrikChart as E } from "./components/echarts-renderer/mavrik-chart.js";
|
|
6
|
+
import { MAVRIK_THEME as f, MAVRIK_THEME_HORIZONTAL as x, selectMavrikTheme as T } from "./components/echarts-renderer/mavrik-theme.js";
|
|
7
|
+
import { hasHorizontalBars as _ } from "./components/echarts-renderer/detect-horizontal-bars.js";
|
|
8
|
+
import { sanitizeChartOptionsForStaticRendering as A } from "./components/echarts-renderer/sanitize-chart-options-for-static-rendering.js";
|
|
9
|
+
import { FormatterToken as I, isFormatterToken as O } from "./components/echarts-renderer/formatters/formatter-tokens.js";
|
|
10
|
+
import { replaceFormatterTokens as L } from "./components/echarts-renderer/formatters/replace-formatter-tokens.js";
|
|
11
|
+
import { createLambertProjection as k, createMapProjection as l, createNaturalEarthProjection as H, naturalEarthProjection as j } from "./components/echarts-renderer/natural-earth-projection.js";
|
|
12
|
+
import { MAP_EMPHASIS_ITEM_STYLE as u, MAP_ITEM_STYLE as V, MAP_VISUAL_MAP_COLORS as d } from "./components/echarts-renderer/map-style.js";
|
|
11
13
|
export {
|
|
12
|
-
|
|
14
|
+
n as EChartsChartOption,
|
|
13
15
|
e as EChartsRenderer,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
I as FormatterToken,
|
|
17
|
+
u as MAP_EMPHASIS_ITEM_STYLE,
|
|
18
|
+
V as MAP_ITEM_STYLE,
|
|
19
|
+
d as MAP_VISUAL_MAP_COLORS,
|
|
20
|
+
f as MAVRIK_THEME,
|
|
21
|
+
x as MAVRIK_THEME_HORIZONTAL,
|
|
22
|
+
E as MavrikChart,
|
|
23
|
+
k as createLambertProjection,
|
|
24
|
+
l as createMapProjection,
|
|
25
|
+
H as createNaturalEarthProjection,
|
|
26
|
+
_ as hasHorizontalBars,
|
|
19
27
|
a as isChartTheme,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
28
|
+
i as isEChartsChartOption,
|
|
29
|
+
O as isFormatterToken,
|
|
30
|
+
j as naturalEarthProjection,
|
|
31
|
+
L as replaceFormatterTokens,
|
|
32
|
+
A as sanitizeChartOptionsForStaticRendering,
|
|
33
|
+
T as selectMavrikTheme,
|
|
34
|
+
h as useChartInstance
|
|
26
35
|
};
|
|
@@ -31,34 +31,42 @@ function w({
|
|
|
31
31
|
}) {
|
|
32
32
|
return /* @__PURE__ */ u(t.Root, { ...c, children: [
|
|
33
33
|
/* @__PURE__ */ e(t.Trigger, { className: s("", a), asChild: !0, disabled: d, children: o }),
|
|
34
|
-
/* @__PURE__ */ e(t.Portal, { children: /* @__PURE__ */ e(
|
|
35
|
-
|
|
34
|
+
/* @__PURE__ */ e(t.Portal, { children: /* @__PURE__ */ e(
|
|
35
|
+
n.Root,
|
|
36
36
|
{
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
37
|
+
type: "hover",
|
|
38
|
+
style: { "--scrollbar-size": "10px" },
|
|
39
|
+
asChild: !0,
|
|
40
|
+
children: /* @__PURE__ */ u(
|
|
41
|
+
t.Content,
|
|
42
|
+
{
|
|
43
|
+
onCloseAutoFocus: (h) => {
|
|
44
|
+
h.preventDefault();
|
|
45
|
+
},
|
|
46
|
+
className: s(
|
|
47
|
+
"max-h-(--radix-dropdown-menu-content-available-height) overflow-hidden rounded-lg shadow-[0px_8px_20px_2px_rgba(0,0,0,0.40)]",
|
|
48
|
+
r === "bg-neutral-60" && "bg-neutral-60",
|
|
49
|
+
r === "bg-neutral-80" && "bg-neutral-80",
|
|
50
|
+
i
|
|
51
|
+
),
|
|
52
|
+
align: "end",
|
|
53
|
+
sideOffset: 8,
|
|
54
|
+
collisionPadding: 8,
|
|
55
|
+
children: [
|
|
56
|
+
/* @__PURE__ */ e(n.Viewport, { className: "max-h-(--radix-dropdown-menu-content-available-height) p-1", children: l }),
|
|
57
|
+
/* @__PURE__ */ e(
|
|
58
|
+
n.Scrollbar,
|
|
59
|
+
{
|
|
60
|
+
className: "hover:bg-neutral-60 flex w-(--scrollbar-size) touch-none px-0.5 py-4 transition-all select-none hover:px-0",
|
|
61
|
+
orientation: "vertical",
|
|
62
|
+
children: /* @__PURE__ */ e(n.Thumb, { className: "bg-neutral-10/50 hover:bg-neutral-10 flex-1 rounded-(--scrollbar-size) transition-colors" })
|
|
63
|
+
}
|
|
64
|
+
)
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
)
|
|
60
68
|
}
|
|
61
|
-
) })
|
|
69
|
+
) })
|
|
62
70
|
] });
|
|
63
71
|
}
|
|
64
72
|
export {
|