@validationcloud/fractal-ui 1.58.0 → 1.60.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/dist/charts.d.ts +4 -2
- package/dist/charts.js +22 -21
- package/dist/components/echarts-renderer/chart-theme.d.ts +6 -0
- package/dist/components/echarts-renderer/chart-theme.js +8 -0
- package/dist/components/echarts-renderer/echarts-renderer.d.ts +3 -8
- package/dist/components/echarts-renderer/echarts-renderer.js +15 -8
- package/dist/components/echarts-renderer/echarts-theme-option.d.ts +4 -4
- package/dist/components/echarts-renderer/formatters/formatter-functions.d.ts +22 -0
- package/dist/components/echarts-renderer/formatters/formatter-functions.js +41 -0
- package/dist/components/echarts-renderer/formatters/formatter-tokens.d.ts +63 -0
- package/dist/components/echarts-renderer/formatters/formatter-tokens.js +45 -0
- package/dist/components/echarts-renderer/formatters/replace-formatter-tokens.d.ts +26 -0
- package/dist/components/echarts-renderer/formatters/replace-formatter-tokens.js +70 -0
- package/dist/components/echarts-renderer/formatters/replace-formatter-tokens.test.d.ts +1 -0
- package/dist/components/echarts-renderer/mavrik-theme-horizontal.json.d.ts +26 -37
- package/dist/components/echarts-renderer/mavrik-theme-horizontal.json.js +34 -32
- package/dist/components/echarts-renderer/mavrik-theme.d.ts +4 -493
- package/dist/components/echarts-renderer/mavrik-theme.js +12 -19
- package/dist/components/echarts-renderer/mavrik-theme.json.d.ts +26 -37
- package/dist/components/echarts-renderer/mavrik-theme.json.js +34 -32
- package/dist/components/echarts-renderer/merge-theme-graphic-into-options.d.ts +9 -0
- package/dist/components/echarts-renderer/merge-theme-graphic-into-options.js +10 -0
- package/dist/components/echarts-renderer/use-chart-instance.d.ts +2 -5
- package/dist/components/echarts-renderer/use-chart-instance.js +47 -43
- package/dist/lib/render-chart-to-image.d.ts +4 -9
- package/dist/lib/render-chart-to-image.js +55 -44
- package/dist/lib/render-mavrik-chart-to-image.d.ts +1 -2
- package/dist/lib/render-mavrik-chart-to-image.js +15 -17
- package/dist/lib/render-mavrik-chart-to-image.test.d.ts +1 -0
- package/dist/server.d.ts +1 -0
- package/dist/server.js +9 -4
- package/package.json +1 -1
- package/dist/assets/vc-logo.svg.js +0 -4
- package/dist/components/echarts-renderer/echarts-theme-option.js +0 -9
- package/dist/components/echarts-renderer/watermark-graphic.d.ts +0 -12
- package/dist/components/echarts-renderer/watermark-graphic.js +0 -25
|
@@ -1,35 +1,37 @@
|
|
|
1
|
-
const o = [{ type: "linear", x: 0, y: 0, x2: 0, y2: 1, colorStops: [{ offset: 0, color: "#C14E64" }, { offset: 1, color: "#DF687D" }] }, { type: "linear", x: 0, y: 0, x2: 0, y2: 1, colorStops: [{ offset: 0, color: "#FFFFFF" }, { offset: 1, color: "#FFFFFF" }] }, { type: "linear", x: 0, y: 0, x2: 0, y2: 1, colorStops: [{ offset: 0, color: "#1E6FDA" }, { offset: 1, color: "#3F8CFF" }] }], e = "#242731", t = { fontFamily: "Poppins, sans-serif", fontWeight: 500 }, l = { top: 32, left: 32, textStyle: { color: "#FFFFFF", fontSize: 16, fontWeight: 600 }, subtextStyle: { color: "#A7A9AD" } }, r = { itemStyle: { borderWidth: 1 }, lineStyle: { width: 2 }, areaStyle: { opacity: 0.15 }, showSymbol: !1, symbolSize: 5, symbol: "circle", smooth: !1, sampling: "lttb" }, a = { barGap: "25%", barCategoryGap: "25%" }, i = { axisLine: { show: !0, lineStyle: { color: "#3A3D46", type: "dashed" } }, axisTick: { show: !1 }, axisLabel: { show: !0, color: "#A7A9AD", hideOverlap: !0 }, nameLocation: "middle", nameTextStyle: { color: "#A7A9AD", fontSize: 11, fontWeight: 400 }, splitLine: { show: !1 } }, s = { axisLine: { show: !1 }, axisTick: { show: !1 }, axisLabel: { show: !0, color: "#A7A9AD", hideOverlap: !0 }, nameLocation: "middle", nameTextStyle: { color: "#A7A9AD", fontSize: 11, fontWeight: 400 }, splitLine: { show: !0, lineStyle: { color: ["#3A3D46"], type: "dashed" } } }, n = { axisLine: { show: !1 }, axisTick: { show: !1 }, axisLabel: { show: !0, color: "#A7A9AD", hideOverlap: !0 }, nameLocation: "middle", nameTextStyle: { color: "#A7A9AD", fontSize: 11, fontWeight: 400 }, splitLine: { show: !0, lineStyle: { color: ["#3A3D46"], type: "dashed" } } }, c = { axisLine: { show: !0, lineStyle: { color: "#3A3D46" } }, axisTick: { show: !1 }, axisLabel: { show: !0, color: "#A7A9AD", hideOverlap: !0 }, nameLocation: "middle", nameTextStyle: { color: "#A7A9AD", fontSize: 11, fontWeight: 400 }, splitLine: { show: !1 } }, d = { top: 82, left: "auto", right: 32, icon: "circle", itemGap: 22, itemWidth: 12, itemHeight: 12, textStyle: { color: "#A7A9AD", fontSize: 11 } }, h = { top: 132, left: 32, right: 32, bottom: 32, outerBoundsMode: "same", outerBoundsContain: "axisLabel" }, A = { backgroundColor: "rgba(36, 39, 49, 0)", borderColor: "#3A3D46", borderRadius: 4, dataBackground: { lineStyle: { color: "#606060", width: 1 }, areaStyle: { color: "rgba(96, 96, 96, 0.3)" } }, selectedDataBackground: { lineStyle: { color: "#b36674", width: 1 }, areaStyle: { color: "rgba(164, 91, 105, 0.5)" } }, fillerColor: "rgba(82, 45, 52, 0.35)", handleStyle: { color: "#C14E64", borderColor: "#C14E64" }, moveHandleStyle: { color: "#b36674" }, brushStyle: { color: "rgba(95, 58, 65, 0.2)" }, emphasis: { handleStyle: { color: "rgb(209, 123, 140)", borderColor: "rgb(209, 123, 140)" } }, handleSize: "100%", textStyle: { color: "#A7A9AD" } }, f = { label: { color: "#A7A9AD" }, emphasis: { label: { color: "#FFFFFF" } } }, y = { backgroundColor: "transparent", padding: 10, borderRadius: 8, borderColor: "#50525A", borderWidth: 1, textStyle: { color: "#FCFCFC", fontFamily: "Poppins, sans-serif", fontSize: 11, fontStyle: "normal", fontWeight: 500 }, extraCssText: "letter-spacing: 0.22px; box-shadow: 0 14px 11px -4px rgba(0, 0, 0, 0.30), 0 -4px 4px 0 rgba(0, 0, 0, 0.04) inset; background: radial-gradient(ellipse at 25% 0%, rgba(217, 217, 217, 0.12) 0%, transparent 60%), #1A1D1F;" }, p = {
|
|
2
|
-
color:
|
|
3
|
-
backgroundColor:
|
|
4
|
-
textStyle:
|
|
5
|
-
title:
|
|
6
|
-
line:
|
|
7
|
-
bar:
|
|
8
|
-
categoryAxis:
|
|
9
|
-
valueAxis:
|
|
10
|
-
logAxis:
|
|
11
|
-
timeAxis:
|
|
12
|
-
legend:
|
|
13
|
-
grid:
|
|
14
|
-
dataZoom:
|
|
15
|
-
markPoint:
|
|
16
|
-
tooltip:
|
|
1
|
+
const M = [{ type: "linear", x: 0, y: 0, x2: 0, y2: 1, colorStops: [{ offset: 0, color: "#C14E64" }, { offset: 1, color: "#DE7385" }] }, "#00BBFA", "#0072B2", "#E69F00", "#D66119", "#56B4E9", "#45B26B", "#F0E442", "#FF99BF", "#8277D8"], L = "#1A1D1F", N = { fontFamily: "Poppins, sans-serif", fontWeight: 500 }, j = { top: 32, left: 32, textStyle: { color: "#FFFFFF", fontSize: 16, fontWeight: 600 }, subtextStyle: { color: "#A7A9AD" } }, D = { itemStyle: { borderWidth: 1 }, lineStyle: { width: 2 }, areaStyle: { opacity: 0.15 }, showSymbol: !1, symbolSize: 5, symbol: "circle", smooth: !1, sampling: "lttb" }, A = { barGap: "25%", barCategoryGap: "25%" }, g = { axisLine: { show: !0, lineStyle: { color: "#3A3D46", type: "dashed" } }, axisTick: { show: !1 }, axisLabel: { show: !0, color: "#A7A9AD", hideOverlap: !0 }, nameLocation: "middle", nameTextStyle: { color: "#A7A9AD", fontSize: 11, fontWeight: 400 }, splitLine: { show: !1 } }, I = { axisLine: { show: !1 }, axisTick: { show: !1 }, axisLabel: { show: !0, color: "#A7A9AD", hideOverlap: !0 }, nameLocation: "middle", nameTextStyle: { color: "#A7A9AD", fontSize: 11, fontWeight: 400 }, splitLine: { show: !0, lineStyle: { color: ["#3A3D46"], type: "dashed" } } }, u = { axisLine: { show: !1 }, axisTick: { show: !1 }, axisLabel: { show: !0, color: "#A7A9AD", hideOverlap: !0 }, nameLocation: "middle", nameTextStyle: { color: "#A7A9AD", fontSize: 11, fontWeight: 400 }, splitLine: { show: !0, lineStyle: { color: ["#3A3D46"], type: "dashed" } } }, t = { axisLine: { show: !0, lineStyle: { color: "#3A3D46" } }, axisTick: { show: !1 }, axisLabel: { show: !0, color: "#A7A9AD", hideOverlap: !0 }, nameLocation: "middle", nameTextStyle: { color: "#A7A9AD", fontSize: 11, fontWeight: 400 }, splitLine: { show: !1 } }, T = { top: 82, left: "auto", right: 32, icon: "circle", itemGap: 22, itemWidth: 12, itemHeight: 12, textStyle: { color: "#A7A9AD", fontSize: 11 } }, y = { top: 132, left: 32, right: 32, bottom: 32, outerBoundsMode: "same", outerBoundsContain: "axisLabel" }, S = { backgroundColor: "rgba(26, 29, 31, 0)", borderColor: "#3A3D46", borderRadius: 4, dataBackground: { lineStyle: { color: "#606060", width: 1 }, areaStyle: { color: "rgba(96, 96, 96, 0.3)" } }, selectedDataBackground: { lineStyle: { color: "#b36674", width: 1 }, areaStyle: { color: "rgba(164, 91, 105, 0.5)" } }, fillerColor: "rgba(82, 45, 52, 0.35)", handleStyle: { color: "#C14E64", borderColor: "#C14E64" }, moveHandleStyle: { color: "#b36674" }, brushStyle: { color: "rgba(95, 58, 65, 0.2)" }, emphasis: { handleStyle: { color: "rgb(209, 123, 140)", borderColor: "rgb(209, 123, 140)" } }, handleSize: "100%", textStyle: { color: "#A7A9AD" } }, z = { label: { color: "#A7A9AD" }, emphasis: { label: { color: "#FFFFFF" } } }, i = { confine: !0, backgroundColor: "transparent", padding: 10, borderRadius: 8, borderColor: "#50525A", borderWidth: 1, textStyle: { color: "#FCFCFC", fontFamily: "Poppins, sans-serif", fontSize: 11, fontStyle: "normal", fontWeight: 500 }, extraCssText: "letter-spacing: 0.22px; box-shadow: 0 14px 11px -4px rgba(0, 0, 0, 0.30), 0 -4px 4px 0 rgba(0, 0, 0, 0.04) inset; background: radial-gradient(ellipse at 25% 0%, rgba(217, 217, 217, 0.12) 0%, transparent 60%), #1A1D1F;" }, x = { type: "image", id: "fractal-watermark", left: "center", top: "middle", style: { image: "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMTAiIGhlaWdodD0iMjQiIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAyMTAgMjQiPgogIDxnIGZpbGw9IiNhN2E5YWQiIGZpbGwtb3BhY2l0eT0iMC4zIj4KICAgIDxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTMzLjczMyAxLjg2OGgtMjEuNjdDNi40MzggMS44NjggMS44NzggNi40MDQgMS44NzggMTJzNC41NiAxMC4xMzIgMTAuMTg1IDEwLjEzMmgyMS42N2M1LjYyNSAwIDEwLjE4NS00LjUzNiAxMC4xODUtMTAuMTMyUzM5LjM1OCAxLjg2OCAzMy43MzMgMS44NjhNMCAxMmMwIDYuNjI3IDUuNCAxMiAxMi4wNjMgMTJoMjEuNjdjNi42NjIgMCAxMi4wNjMtNS4zNzMgMTIuMDYzLTEycy01LjQtMTItMTIuMDYzLTEyaC0yMS42N0M1LjQwMSAwIDAgNS4zNzMgMCAxMiIgY2xpcC1ydWxlPSJldmVub2RkIi8+CiAgICA8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zMy43MzQgNS4xNzRoLTIxLjY3QzguMjczIDUuMTc0IDUuMiA4LjIzIDUuMiAxMnMzLjA3MyA2LjgyNiA2Ljg2MyA2LjgyNmgyMS42N2MzLjc5IDAgNi44NjItMy4wNTYgNi44NjItNi44MjZzLTMuMDcyLTYuODI2LTYuODYyLTYuODI2TTMuMzIzIDEyYzAgNC44MDIgMy45MTIgOC42OTUgOC43NCA4LjY5NWgyMS42N2M0LjgyNyAwIDguNzQtMy44OTMgOC43NC04LjY5NXMtMy45MTMtOC42OTUtOC43NC04LjY5NWgtMjEuNjdjLTQuODI4IDAtOC43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Ljk4IDAgMS4xMTEuNDk5IDEuOTkxYTMuOCAzLjggMCAwIDAgMS4zNjMgMS40MDFxLjg2LjUxIDEuOTQzLjUxIi8+CiAgPC9nPgo8L3N2Zz4=", width: 210, height: 24 }, z: 100, silent: !0 }, C = {
|
|
2
|
+
color: M,
|
|
3
|
+
backgroundColor: L,
|
|
4
|
+
textStyle: N,
|
|
5
|
+
title: j,
|
|
6
|
+
line: D,
|
|
7
|
+
bar: A,
|
|
8
|
+
categoryAxis: g,
|
|
9
|
+
valueAxis: I,
|
|
10
|
+
logAxis: u,
|
|
11
|
+
timeAxis: t,
|
|
12
|
+
legend: T,
|
|
13
|
+
grid: y,
|
|
14
|
+
dataZoom: S,
|
|
15
|
+
markPoint: z,
|
|
16
|
+
tooltip: i,
|
|
17
|
+
graphic: x
|
|
17
18
|
};
|
|
18
19
|
export {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
20
|
+
L as backgroundColor,
|
|
21
|
+
A as bar,
|
|
22
|
+
g as categoryAxis,
|
|
23
|
+
M as color,
|
|
24
|
+
S as dataZoom,
|
|
25
|
+
C as default,
|
|
26
|
+
x as graphic,
|
|
27
|
+
y as grid,
|
|
28
|
+
T as legend,
|
|
29
|
+
D as line,
|
|
30
|
+
u as logAxis,
|
|
31
|
+
z as markPoint,
|
|
32
|
+
N as textStyle,
|
|
33
|
+
t as timeAxis,
|
|
34
|
+
j as title,
|
|
35
|
+
i as tooltip,
|
|
36
|
+
I as valueAxis
|
|
35
37
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { GraphicComponentOption } from 'echarts';
|
|
2
|
+
/**
|
|
3
|
+
* Merges theme-provided `graphic` into the chart options while preserving any
|
|
4
|
+
* existing `options.graphic`. Always returns `graphic` as an array so callers
|
|
5
|
+
* can safely use `replaceMerge: ['graphic']` and avoid stale graphics.
|
|
6
|
+
*/
|
|
7
|
+
export declare function mergeThemeGraphicIntoOptions<TOptions extends {
|
|
8
|
+
graphic?: GraphicComponentOption | GraphicComponentOption[];
|
|
9
|
+
}>(options: TOptions, themeGraphic: GraphicComponentOption | GraphicComponentOption[] | undefined): TOptions;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
function g(r, a) {
|
|
2
|
+
const c = r.graphic === void 0 ? [] : Array.isArray(r.graphic) ? r.graphic : [r.graphic], i = a === void 0 ? [] : Array.isArray(a) ? a : [a];
|
|
3
|
+
return {
|
|
4
|
+
...r,
|
|
5
|
+
graphic: [...c, ...i]
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
g as mergeThemeGraphicIntoOptions
|
|
10
|
+
};
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { EChartsOption } from 'echarts';
|
|
2
|
-
import {
|
|
2
|
+
import { ChartTheme } from './chart-theme';
|
|
3
3
|
export type UseChartInstanceProps = {
|
|
4
4
|
options: EChartsOption;
|
|
5
|
-
theme?:
|
|
6
|
-
name: string;
|
|
7
|
-
config: EChartsThemeOption;
|
|
8
|
-
};
|
|
5
|
+
theme?: ChartTheme;
|
|
9
6
|
};
|
|
10
7
|
export type UseChartInstanceReturn = {
|
|
11
8
|
containerRef: React.RefObject<HTMLDivElement | null>;
|
|
@@ -1,63 +1,67 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useRef as d, useState as
|
|
3
|
-
import { calculateTitleLayout as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
import { useRef as d, useState as T, useEffect as I, useCallback as S } from "react";
|
|
3
|
+
import { calculateTitleLayout as m } from "./calculate-title-layout.js";
|
|
4
|
+
import { replaceFormatterTokens as O } from "./formatters/replace-formatter-tokens.js";
|
|
5
|
+
import { mergeThemeGraphicIntoOptions as R } from "./merge-theme-graphic-into-options.js";
|
|
6
|
+
import { sanitizeChartOptions as w } from "./sanitize-chart-options.js";
|
|
7
|
+
const W = /* @__PURE__ */ new Set();
|
|
8
|
+
function L({ options: o, theme: t }) {
|
|
9
|
+
const n = d(null), c = d(null), y = d(o), C = d(t?.config), z = d(t?.config.graphic), [b, v] = T(!1);
|
|
10
|
+
y.current = o, C.current = t?.config, z.current = t?.config.graphic, I(() => {
|
|
11
|
+
const s = n.current;
|
|
11
12
|
if (!s) return;
|
|
12
|
-
let
|
|
13
|
-
const
|
|
14
|
-
const a =
|
|
13
|
+
let r = !0, e;
|
|
14
|
+
const f = new ResizeObserver((i) => {
|
|
15
|
+
const a = i[0], u = c.current;
|
|
15
16
|
if (!a || !u) return;
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
const p = a.contentRect.width, g = w(y.current), l = O(g), h = m(l, p, C.current);
|
|
18
|
+
u.setOption(R(h, z.current), {
|
|
19
|
+
replaceMerge: ["graphic"]
|
|
20
|
+
}), u.resize();
|
|
20
21
|
});
|
|
21
|
-
return
|
|
22
|
+
return f.observe(s), (async () => {
|
|
22
23
|
try {
|
|
23
|
-
const
|
|
24
|
-
if (!
|
|
25
|
-
t && !
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
const i = await import("echarts");
|
|
25
|
+
if (!r || !n.current) return;
|
|
26
|
+
if (t && !W.has(t.name)) {
|
|
27
|
+
const { graphic: h, ...F } = t.config;
|
|
28
|
+
i.registerTheme(t.name, F), W.add(t.name);
|
|
29
|
+
}
|
|
30
|
+
const a = i.getInstanceByDom(n.current);
|
|
31
|
+
a && a.dispose(), e = i.init(n.current, t?.name, {
|
|
28
32
|
renderer: "svg"
|
|
29
|
-
}), c.current =
|
|
30
|
-
const u =
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
} catch (
|
|
35
|
-
console.error("Failed to load echarts",
|
|
33
|
+
}), c.current = e;
|
|
34
|
+
const u = n.current.clientWidth, p = w(o), g = O(p), l = m(g, u, t?.config);
|
|
35
|
+
e.setOption(R(l, t?.config.graphic), {
|
|
36
|
+
replaceMerge: ["graphic"]
|
|
37
|
+
}), e.resize(), v(!0);
|
|
38
|
+
} catch (i) {
|
|
39
|
+
console.error("Failed to load echarts", i);
|
|
36
40
|
}
|
|
37
41
|
})(), () => {
|
|
38
|
-
|
|
42
|
+
r = !1, f.disconnect(), e && e.dispose(), c.current = null, v(!1);
|
|
39
43
|
};
|
|
40
|
-
}, [t,
|
|
41
|
-
if (!
|
|
42
|
-
const s =
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}, [
|
|
47
|
-
const
|
|
44
|
+
}, [t, o]), I(() => {
|
|
45
|
+
if (!b || !c.current || !n.current) return;
|
|
46
|
+
const s = n.current.clientWidth, r = w(o), e = O(r), f = m(e, s, t?.config);
|
|
47
|
+
c.current.setOption(R(f, t?.config.graphic), {
|
|
48
|
+
replaceMerge: ["graphic"]
|
|
49
|
+
});
|
|
50
|
+
}, [b, o, t?.config, t?.config.graphic]);
|
|
51
|
+
const k = S(async () => {
|
|
48
52
|
if (!c.current) return;
|
|
49
53
|
const s = c.current.getDataURL({
|
|
50
54
|
type: "png",
|
|
51
55
|
pixelRatio: 2,
|
|
52
56
|
backgroundColor: "#fff"
|
|
53
|
-
}),
|
|
54
|
-
|
|
57
|
+
}), r = document.createElement("a");
|
|
58
|
+
r.download = `chart-${(/* @__PURE__ */ new Date()).toISOString()}.png`, r.href = s, document.body.appendChild(r), r.click(), document.body.removeChild(r);
|
|
55
59
|
}, []);
|
|
56
60
|
return {
|
|
57
|
-
containerRef:
|
|
58
|
-
downloadChart:
|
|
61
|
+
containerRef: n,
|
|
62
|
+
downloadChart: k
|
|
59
63
|
};
|
|
60
64
|
}
|
|
61
65
|
export {
|
|
62
|
-
|
|
66
|
+
L as useChartInstance
|
|
63
67
|
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { ChartTheme } from '../components/echarts-renderer/chart-theme';
|
|
2
|
+
import { EChartsThemeOption } from '../components/echarts-renderer/echarts-theme-option';
|
|
1
3
|
/** Font family registration for server-side chart rendering */
|
|
2
4
|
export interface FontRegistration {
|
|
3
5
|
/** Font family name (e.g., 'Poppins', 'Inter') */
|
|
@@ -7,19 +9,12 @@ export interface FontRegistration {
|
|
|
7
9
|
}
|
|
8
10
|
export interface RenderChartToImageOptions {
|
|
9
11
|
option: unknown;
|
|
10
|
-
theme?:
|
|
12
|
+
theme?: EChartsThemeOption | ChartTheme;
|
|
11
13
|
/**
|
|
12
14
|
* Fonts to register before rendering. Each font family is registered once
|
|
13
15
|
* and cached for subsequent renders.
|
|
14
16
|
*/
|
|
15
17
|
fonts?: FontRegistration[];
|
|
16
|
-
/**
|
|
17
|
-
* Adds Validation Cloud watermark graphic to the chart option before rendering.
|
|
18
|
-
*
|
|
19
|
-
* Note: The default is `false` because some server-side image backends can be
|
|
20
|
-
* inconsistent when decoding SVG images.
|
|
21
|
-
*/
|
|
22
|
-
includeWatermark?: boolean;
|
|
23
18
|
width?: number;
|
|
24
19
|
height?: number;
|
|
25
20
|
devicePixelRatio?: number;
|
|
@@ -44,4 +39,4 @@ export interface RenderChartToImageOptions {
|
|
|
44
39
|
* });
|
|
45
40
|
* ```
|
|
46
41
|
*/
|
|
47
|
-
export declare function renderChartToImage({ option, theme, fonts,
|
|
42
|
+
export declare function renderChartToImage({ option, theme, fonts, width, height, devicePixelRatio, }: RenderChartToImageOptions): Buffer;
|
|
@@ -1,31 +1,33 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { randomUUID as
|
|
3
|
-
import { writeFileSync as
|
|
4
|
-
import { tmpdir as
|
|
5
|
-
import
|
|
6
|
-
import { Image as
|
|
7
|
-
import { calculateTitleLayout as
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import * as h from "echarts";
|
|
2
|
+
import { randomUUID as y } from "node:crypto";
|
|
3
|
+
import { writeFileSync as F, mkdtempSync as O } from "node:fs";
|
|
4
|
+
import { tmpdir as j } from "node:os";
|
|
5
|
+
import T from "node:path";
|
|
6
|
+
import { Image as C, Canvas as I, FontLibrary as S } from "skia-canvas";
|
|
7
|
+
import { calculateTitleLayout as w } from "../components/echarts-renderer/calculate-title-layout.js";
|
|
8
|
+
import { isChartTheme as $ } from "../components/echarts-renderer/chart-theme.js";
|
|
9
|
+
import { replaceFormatterTokens as A } from "../components/echarts-renderer/formatters/replace-formatter-tokens.js";
|
|
10
|
+
import { mergeThemeGraphicIntoOptions as D } from "../components/echarts-renderer/merge-theme-graphic-into-options.js";
|
|
11
|
+
globalThis.Image = C;
|
|
12
|
+
const d = /* @__PURE__ */ new Set();
|
|
13
|
+
let l;
|
|
14
|
+
function E() {
|
|
15
|
+
return l || (l = O(T.join(j(), "chart-fonts-"))), l;
|
|
14
16
|
}
|
|
15
|
-
function
|
|
16
|
-
for (const t of
|
|
17
|
-
if (!
|
|
17
|
+
function G(e) {
|
|
18
|
+
for (const t of e)
|
|
19
|
+
if (!d.has(t.family))
|
|
18
20
|
try {
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
return
|
|
21
|
+
const r = E(), n = t.data.map((c, m) => {
|
|
22
|
+
const o = T.join(r, `${t.family}-${String(m)}.ttf`);
|
|
23
|
+
return F(o, c), o;
|
|
22
24
|
});
|
|
23
|
-
S.use(t.family,
|
|
24
|
-
} catch (
|
|
25
|
-
console.warn(`Failed to register ${t.family} fonts, charts will use fallback font:`,
|
|
25
|
+
S.use(t.family, n), d.add(t.family);
|
|
26
|
+
} catch (r) {
|
|
27
|
+
console.warn(`Failed to register ${t.family} fonts, charts will use fallback font:`, r);
|
|
26
28
|
}
|
|
27
29
|
}
|
|
28
|
-
const
|
|
30
|
+
const N = /* @__PURE__ */ new Set([
|
|
29
31
|
"aria",
|
|
30
32
|
// Tries to set DOM attributes which node-canvas doesn't implement
|
|
31
33
|
"toolbox",
|
|
@@ -37,39 +39,48 @@ const D = /* @__PURE__ */ new Set([
|
|
|
37
39
|
"axisPointer"
|
|
38
40
|
// Crosshair on hover
|
|
39
41
|
]);
|
|
40
|
-
function
|
|
41
|
-
if (!
|
|
42
|
+
function P(e) {
|
|
43
|
+
if (!e || typeof e != "object" || Array.isArray(e))
|
|
42
44
|
return { animation: !1 };
|
|
43
45
|
const t = Object.fromEntries(
|
|
44
|
-
Object.entries(
|
|
46
|
+
Object.entries(e).filter(([r]) => !N.has(r))
|
|
45
47
|
);
|
|
46
48
|
return t.animation = !1, t;
|
|
47
49
|
}
|
|
48
|
-
function
|
|
49
|
-
option:
|
|
50
|
+
function V({
|
|
51
|
+
option: e,
|
|
50
52
|
theme: t,
|
|
51
|
-
fonts:
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
devicePixelRatio: a = 2
|
|
53
|
+
fonts: r,
|
|
54
|
+
width: n = 800,
|
|
55
|
+
height: c = 600,
|
|
56
|
+
devicePixelRatio: m = 2
|
|
56
57
|
}) {
|
|
57
|
-
|
|
58
|
-
let
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
r?.length && G(r);
|
|
59
|
+
let o, i, f;
|
|
60
|
+
const a = t;
|
|
61
|
+
if (a && typeof a == "object")
|
|
62
|
+
if ($(a)) {
|
|
63
|
+
o = `theme-${y()}`, i = a.config, f = i.graphic;
|
|
64
|
+
const { graphic: p, ...s } = i;
|
|
65
|
+
h.registerTheme(o, s);
|
|
66
|
+
} else {
|
|
67
|
+
o = `theme-${y()}`, i = a, f = i.graphic;
|
|
68
|
+
const { graphic: p, ...s } = i;
|
|
69
|
+
h.registerTheme(o, s);
|
|
70
|
+
}
|
|
71
|
+
const g = new I(n, c), u = h.init(g, o, {
|
|
61
72
|
renderer: "canvas",
|
|
62
|
-
devicePixelRatio:
|
|
63
|
-
width:
|
|
64
|
-
height:
|
|
73
|
+
devicePixelRatio: m,
|
|
74
|
+
width: n,
|
|
75
|
+
height: c
|
|
65
76
|
});
|
|
66
77
|
try {
|
|
67
|
-
const
|
|
68
|
-
return
|
|
78
|
+
const p = P(e), s = A(p), b = w(s, n, i);
|
|
79
|
+
return u.setOption(D(b, f), { replaceMerge: ["graphic"] }), g.toBufferSync("png");
|
|
69
80
|
} finally {
|
|
70
|
-
|
|
81
|
+
u.dispose();
|
|
71
82
|
}
|
|
72
83
|
}
|
|
73
84
|
export {
|
|
74
|
-
|
|
85
|
+
V as renderChartToImage
|
|
75
86
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { EChartsOption } from 'echarts';
|
|
2
2
|
export interface RenderMavrikChartToImageOptions {
|
|
3
3
|
option: EChartsOption;
|
|
4
|
-
includeWatermark?: boolean;
|
|
5
4
|
width?: number;
|
|
6
5
|
height?: number;
|
|
7
6
|
devicePixelRatio?: number;
|
|
@@ -31,4 +30,4 @@ export interface RenderMavrikChartToImageOptions {
|
|
|
31
30
|
* });
|
|
32
31
|
* ```
|
|
33
32
|
*/
|
|
34
|
-
export declare function renderMavrikChartToImage({ option,
|
|
33
|
+
export declare function renderMavrikChartToImage({ option, width, height, devicePixelRatio, }: RenderMavrikChartToImageOptions): Buffer;
|
|
@@ -1,28 +1,26 @@
|
|
|
1
|
-
import { selectMavrikTheme as
|
|
2
|
-
import { PoppinsRegular as
|
|
1
|
+
import { selectMavrikTheme as t } from "../components/echarts-renderer/mavrik-theme.js";
|
|
2
|
+
import { PoppinsRegular as n, PoppinsMedium as p, PoppinsSemiBold as a, PoppinsBold as s } from "./font-data.js";
|
|
3
3
|
import { renderChartToImage as P } from "./render-chart-to-image.js";
|
|
4
|
-
const
|
|
4
|
+
const f = {
|
|
5
5
|
family: "Poppins",
|
|
6
|
-
data: [p, a, s
|
|
6
|
+
data: [n, p, a, s]
|
|
7
7
|
};
|
|
8
|
-
function
|
|
8
|
+
function l({
|
|
9
9
|
option: e,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
devicePixelRatio: m = 2
|
|
10
|
+
width: o = 800,
|
|
11
|
+
height: r = 600,
|
|
12
|
+
devicePixelRatio: i = 2
|
|
14
13
|
}) {
|
|
15
|
-
const
|
|
14
|
+
const m = t(e);
|
|
16
15
|
return P({
|
|
17
16
|
option: e,
|
|
18
|
-
theme:
|
|
19
|
-
fonts: [
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
devicePixelRatio: m
|
|
17
|
+
theme: m.config,
|
|
18
|
+
fonts: [f],
|
|
19
|
+
width: o,
|
|
20
|
+
height: r,
|
|
21
|
+
devicePixelRatio: i
|
|
24
22
|
});
|
|
25
23
|
}
|
|
26
24
|
export {
|
|
27
|
-
|
|
25
|
+
l as renderMavrikChartToImage
|
|
28
26
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/server.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { renderChartToImage, type RenderChartToImageOptions } from './lib/render-chart-to-image';
|
|
2
2
|
export { renderMavrikChartToImage, type RenderMavrikChartToImageOptions } from './lib/render-mavrik-chart-to-image';
|
|
3
3
|
export { sanitizeChartOptionsForStaticRendering } from './components/echarts-renderer/sanitize-chart-options-for-static-rendering';
|
|
4
|
+
export { PoppinsRegular, PoppinsMedium, PoppinsSemiBold, PoppinsBold } from './lib/font-data';
|
package/dist/server.js
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
import { renderChartToImage as
|
|
2
|
-
import { renderMavrikChartToImage as
|
|
1
|
+
import { renderChartToImage as e } from "./lib/render-chart-to-image.js";
|
|
2
|
+
import { renderMavrikChartToImage as i } from "./lib/render-mavrik-chart-to-image.js";
|
|
3
3
|
import { sanitizeChartOptionsForStaticRendering as n } from "./components/echarts-renderer/sanitize-chart-options-for-static-rendering.js";
|
|
4
|
+
import { PoppinsBold as m, PoppinsMedium as d, PoppinsRegular as s, PoppinsSemiBold as f } from "./lib/font-data.js";
|
|
4
5
|
export {
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
m as PoppinsBold,
|
|
7
|
+
d as PoppinsMedium,
|
|
8
|
+
s as PoppinsRegular,
|
|
9
|
+
f as PoppinsSemiBold,
|
|
10
|
+
e as renderChartToImage,
|
|
11
|
+
i as renderMavrikChartToImage,
|
|
7
12
|
n as sanitizeChartOptionsForStaticRendering
|
|
8
13
|
};
|
package/package.json
CHANGED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
const a = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='210'%20height='24'%20fill='none'%20viewBox='0%200%20210%2024'%3e%3cg%20fill='%23a7a9ad'%20fill-opacity='0.3'%3e%3cpath%20fill-rule='evenodd'%20d='M33.733%201.868h-21.67C6.438%201.868%201.878%206.404%201.878%2012s4.56%2010.132%2010.185%2010.132h21.67c5.625%200%2010.185-4.536%2010.185-10.132S39.358%201.868%2033.733%201.868M0%2012c0%206.627%205.4%2012%2012.063%2012h21.67c6.662%200%2012.063-5.373%2012.063-12s-5.4-12-12.063-12h-21.67C5.401%200%200%205.373%200%2012'%20clip-rule='evenodd'/%3e%3cpath%20fill-rule='evenodd'%20d='M33.734%205.174h-21.67C8.273%205.174%205.2%208.23%205.2%2012s3.073%206.826%206.863%206.826h21.67c3.79%200%206.862-3.056%206.862-6.826s-3.072-6.826-6.862-6.826M3.323%2012c0%204.802%203.912%208.695%208.74%208.695h21.67c4.827%200%208.74-3.893%208.74-8.695s-3.913-8.695-8.74-8.695h-21.67c-4.828%200-8.74%203.893-8.74%208.695'%20clip-rule='evenodd'/%3e%3cpath%20fill-rule='evenodd'%20d='M33.733%208.48h-21.67A3.53%203.53%200%200%200%208.523%2012a3.53%203.53%200%200%200%203.54%203.521h21.67a3.53%203.53%200%200%200%203.54-3.52%203.53%203.53%200%200%200-3.54-3.522M6.646%2012c0%202.976%202.425%205.39%205.417%205.39h21.67c2.992%200%205.418-2.414%205.418-5.39s-2.426-5.39-5.418-5.39h-21.67c-2.992%200-5.417%202.414-5.417%205.39'%20clip-rule='evenodd'/%3e%3cpath%20d='M58.45%2020.695h-2.77L48.592%203.327h2.7l5.773%2014.542%205.773-14.542h2.7zM73.986%2020.695h-2.06l-.14-1.482q-.64.81-1.617%201.262-.978.45-2.165.451-1.246%200-2.223-.486a3.86%203.86%200%200%201-1.537-1.332%203.4%203.4%200%200%201-.559-1.922q0-1.134.606-1.991.605-.868%201.653-1.355%201.047-.498%202.386-.498.838%200%201.699.197a6.6%206.6%200%200%201%201.571.556v-.429q0-.844-.442-1.447a2.7%202.7%200%200%200-1.187-.938%204.1%204.1%200%200%200-1.653-.324q-.802%200-1.641.278-.826.277-1.56.857l-.721-1.934a9.3%209.3%200%200%201%202.2-.95%208.3%208.3%200%200%201%202.257-.323q1.583%200%202.724.625a4.35%204.35%200%200%201%201.78%201.783q.63%201.146.63%202.71zm-5.517-1.783q.827%200%201.525-.336a2.93%202.93%200%200%200%201.129-.973q.442-.636.477-1.482v-.162a4.7%204.7%200%200%200-1.338-.683%204.6%204.6%200%200%200-1.502-.255q-1.176%200-1.955.556-.78.555-.78%201.424%200%20.544.314.984.326.43.873.683.56.244%201.257.244M77.988%2020.695h-2.54V2.864h2.54zM80.666%205.758q-.548%200-.92-.382a1.28%201.28%200%200%201-.373-.926q0-.545.373-.915.372-.382.92-.382.56%200%20.932.382.385.37.385.915t-.385.926q-.373.382-.932.382m1.188%2014.937h-2.388V9.116h2.388zM95.628%2020.695H93.52l-.128-1.656a5.7%205.7%200%200%201-1.909%201.39q-1.106.497-2.432.497-1.677%200-3.003-.787a5.7%205.7%200%200%201-2.095-2.154q-.757-1.365-.757-3.08%200-1.724.757-3.08a5.7%205.7%200%200%201%202.095-2.153q1.326-.787%203.003-.787%201.257%200%202.328.451a5.5%205.5%200%200%201%201.862%201.262V3.327h2.386zm-6.18-1.9q1.059%200%201.908-.486a3.75%203.75%200%200%200%201.374-1.32q.512-.833.512-1.898v-.394q0-1.065-.512-1.899a3.66%203.66%200%200%200-1.374-1.308q-.85-.475-1.908-.475-1.083%200-1.944.51a3.7%203.7%200%200%200-1.362%201.389q-.5.869-.5%201.98t.5%201.991a3.8%203.8%200%200%200%201.362%201.401q.861.51%201.944.51M107.269%2020.695h-2.061l-.139-1.482q-.64.81-1.618%201.262-.978.45-2.165.451-1.245%200-2.223-.486a3.86%203.86%200%200%201-1.536-1.332%203.4%203.4%200%200%201-.56-1.922q0-1.134.606-1.991.605-.868%201.653-1.355%201.047-.498%202.386-.498a7.6%207.6%200%200%201%201.699.197%206.6%206.6%200%200%201%201.571.556v-.429q0-.844-.442-1.447a2.7%202.7%200%200%200-1.187-.938%204.1%204.1%200%200%200-1.653-.324%205.166%205.166%200%200%200-3.2%201.135l-.722-1.934a9.3%209.3%200%200%201%202.2-.95%208.3%208.3%200%200%201%202.258-.323q1.583%200%202.723.625a4.35%204.35%200%200%201%201.781%201.783q.629%201.146.629%202.71zm-5.517-1.783q.826%200%201.524-.336a2.9%202.9%200%200%200%201.129-.973q.442-.636.477-1.482v-.162a4.6%204.6%200%200%200-1.338-.683%204.6%204.6%200%200%200-1.502-.255q-1.175%200-1.955.556-.78.555-.78%201.424%200%20.544.314.984.327.43.873.683.56.244%201.258.244M116.424%2020.405q-1.221.521-2.362.521t-2.002-.486a3.5%203.5%200%200%201-1.339-1.366q-.477-.892-.477-2.05v-5.789h-2.037V9.116h2.153V6.222h2.27v2.894h3.399v2.119h-3.399v5.35q0%201.018.547%201.62.558.59%201.432.59.734%200%201.455-.44zM118.58%205.758q-.548%200-.92-.382a1.28%201.28%200%200%201-.373-.926q0-.545.373-.915.372-.382.92-.382.56%200%20.932.382.385.37.385.915t-.385.926a1.25%201.25%200%200%201-.932.382m1.188%2014.937h-2.388V9.116h2.388zM127.257%2020.926q-1.746%200-3.143-.787a5.85%205.85%200%200%201-2.2-2.142q-.803-1.366-.803-3.092%200-1.713.803-3.068a5.8%205.8%200%200%201%202.2-2.153q1.397-.8%203.143-.8%201.757%200%203.142.8a5.76%205.76%200%200%201%202.177%202.153q.803%201.355.803%203.068%200%201.725-.803%203.092a5.8%205.8%200%200%201-2.177%202.142q-1.385.787-3.142.787m-.012-2.13q1.06%200%201.886-.51a3.7%203.7%200%200%200%201.315-1.39q.489-.88.489-2.002%200-1.1-.489-1.969a3.6%203.6%200%200%200-1.315-1.389q-.827-.52-1.886-.52-1.047%200-1.885.52a3.7%203.7%200%200%200-1.327%201.39q-.477.868-.477%201.968%200%201.123.477%202.003a3.8%203.8%200%200%200%201.327%201.39q.837.509%201.885.509M145.816%2020.695h-2.386v-6.287q0-1.54-.849-2.455-.839-.915-2.258-.915-1.466%200-2.363.973-.896.972-.896%202.582v6.102h-2.386V9.116h2.013l.082%201.864a4.25%204.25%200%200%201%201.676-1.551q1.035-.544%202.432-.544%202.294%200%203.609%201.377%201.326%201.379%201.326%203.798zM166.178%2018.483a8.7%208.7%200%200%201-2.888%201.887q-1.664.672-3.631.672t-3.632-.672a8.7%208.7%200%200%201-2.898-1.887%208.9%208.9%200%200%201-1.908-2.871q-.676-1.656-.676-3.601%200-1.957.676-3.601a8.7%208.7%200%200%201%201.908-2.872%208.7%208.7%200%200%201%202.898-1.887q1.665-.671%203.632-.671%201.955%200%203.619.683%201.677.671%202.875%201.864l-1.78%201.806a6.2%206.2%200%200%200-2.094-1.54q-1.212-.567-2.654-.567-1.397%200-2.573.51a6%206%200%200%200-2.049%201.423%206.6%206.6%200%200%200-1.361%202.154q-.478%201.239-.478%202.698t.478%202.698a6.7%206.7%200%200%200%201.361%202.165%206.2%206.2%200%200%200%202.049%201.424q1.175.498%202.573.498%201.442%200%202.654-.556a6.2%206.2%200%200%200%202.083-1.552zM170.092%2020.695h-2.54V2.864h2.54zM177.534%2020.926q-1.745%200-3.143-.787a5.84%205.84%200%200%201-2.199-2.142q-.803-1.366-.803-3.092%200-1.713.803-3.068a5.8%205.8%200%200%201%202.199-2.153q1.398-.8%203.143-.8%201.758%200%203.142.8a5.75%205.75%200%200%201%202.176%202.153q.804%201.355.803%203.068%200%201.725-.803%203.092a5.8%205.8%200%200%201-2.176%202.142q-1.384.787-3.142.787m-.013-2.13q1.06%200%201.887-.51a3.7%203.7%200%200%200%201.315-1.39q.488-.88.488-2.002%200-1.1-.488-1.969a3.6%203.6%200%200%200-1.315-1.389q-.827-.52-1.887-.52a3.5%203.5%200%200%200-1.885.52%203.7%203.7%200%200%200-1.326%201.39q-.477.868-.477%201.968%200%201.123.477%202.003a3.8%203.8%200%200%200%201.326%201.39%203.56%203.56%200%200%200%201.885.509M196.1%2020.695h-2.026l-.082-1.864q-.64%201.018-1.676%201.563-1.025.532-2.433.532-2.28%200-3.607-1.378-1.316-1.39-1.316-3.797V9.116h2.387v6.287q0%201.54.837%202.455.84.915%202.258.915%201.468%200%202.364-.973.907-.984.907-2.582V9.116h2.387zM209.84%2020.695h-2.106l-.129-1.656a5.7%205.7%200%200%201-1.908%201.39q-1.105.497-2.433.497-1.676%200-3.002-.787a5.7%205.7%200%200%201-2.096-2.154q-.756-1.365-.756-3.08%200-1.724.756-3.08a5.7%205.7%200%200%201%202.096-2.153q1.326-.787%203.002-.787%201.257%200%202.329.451a5.5%205.5%200%200%201%201.862%201.262V3.327h2.385zm-6.18-1.9q1.059%200%201.908-.486a3.74%203.74%200%200%200%201.374-1.32q.512-.833.513-1.898v-.394q0-1.065-.513-1.899a3.65%203.65%200%200%200-1.374-1.308q-.849-.475-1.908-.475-1.082%200-1.943.51a3.7%203.7%200%200%200-1.363%201.389q-.5.869-.499%201.98%200%201.111.499%201.991a3.8%203.8%200%200%200%201.363%201.401q.86.51%201.943.51'/%3e%3c/g%3e%3c/svg%3e";
|
|
2
|
-
export {
|
|
3
|
-
a as default
|
|
4
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { GraphicComponentOption } from 'echarts';
|
|
2
|
-
/**
|
|
3
|
-
* Watermark graphic element for ECharts charts.
|
|
4
|
-
* This is applied via setOption(), not via theme (themes don't properly merge graphic components).
|
|
5
|
-
*/
|
|
6
|
-
export declare const WATERMARK_GRAPHIC: GraphicComponentOption;
|
|
7
|
-
/**
|
|
8
|
-
* Merges watermark graphic into existing ECharts options.
|
|
9
|
-
*/
|
|
10
|
-
export declare function addWatermarkToOptions<T extends {
|
|
11
|
-
graphic?: GraphicComponentOption | GraphicComponentOption[];
|
|
12
|
-
}>(options: T): T;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import o from "../../assets/vc-logo.svg.js";
|
|
2
|
-
const a = 210, c = 24, i = {
|
|
3
|
-
type: "image",
|
|
4
|
-
left: "center",
|
|
5
|
-
top: "middle",
|
|
6
|
-
style: {
|
|
7
|
-
image: o,
|
|
8
|
-
width: a,
|
|
9
|
-
height: c
|
|
10
|
-
},
|
|
11
|
-
z: 100,
|
|
12
|
-
silent: !0
|
|
13
|
-
};
|
|
14
|
-
function s(r) {
|
|
15
|
-
const e = r.graphic;
|
|
16
|
-
let t;
|
|
17
|
-
return e === void 0 ? t = i : Array.isArray(e) ? t = [...e, i] : t = [e, i], {
|
|
18
|
-
...r,
|
|
19
|
-
graphic: t
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
export {
|
|
23
|
-
i as WATERMARK_GRAPHIC,
|
|
24
|
-
s as addWatermarkToOptions
|
|
25
|
-
};
|