@idux/charts-core 1.1.0 → 1.2.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/CHANGELOG.md +10 -0
- package/README.md +84 -0
- package/README.zh.md +84 -0
- package/dist/index.js +141 -131
- package/dist/index.umd.cjs +2 -2
- package/dist/themes/index.d.ts +1 -0
- package/dist/themes/seer.d.ts +1 -0
- package/dist/themes/token.d.ts +4 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @idux/charts-core
|
|
2
2
|
|
|
3
|
+
## 1.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 879376a: Add CHART_THEME_TOKEN for reactive application-wide chart themes, with explicit per-chart themes taking precedence.
|
|
8
|
+
|
|
9
|
+
Use a dark loading mask for dark chart themes while retaining explicit loading overrides.
|
|
10
|
+
|
|
11
|
+
Let chart tooltips inherit theme surfaces, retaining the light Seer background.
|
|
12
|
+
|
|
3
13
|
## 1.1.0
|
|
4
14
|
|
|
5
15
|
### Minor Changes
|
package/README.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# @idux/charts-core
|
|
2
|
+
|
|
3
|
+
English | [简体中文](README.zh.md)
|
|
4
|
+
|
|
5
|
+
The foundation of iDux Charts: the generic `IxChart` component, chart lifecycle composables, themes, types, and utilities. Use it for direct ECharts options or custom chart components.
|
|
6
|
+
|
|
7
|
+
For the unified entry point and shared tooltip styles, use [`@idux/charts`](https://github.com/IDuxFE/idux-charts/blob/main/packages/charts/README.md).
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @idux/charts-core echarts
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Supports Vue 2 (including Vue 2.6) and Vue 3. Use in an existing Vue project with peer dependencies Vue `^2.6.0 || ^3.2.5` and ECharts `^5.4.3 || ^6.0.0`. Vue 2.6 also requires `@vue/composition-api >=1.6.2` and plugin registration before creating the application.
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install @vue/composition-api
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
// Vue 2.6
|
|
23
|
+
import Vue from 'vue'
|
|
24
|
+
import VueCompositionAPI from '@vue/composition-api'
|
|
25
|
+
|
|
26
|
+
Vue.use(VueCompositionAPI)
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Quick start
|
|
30
|
+
|
|
31
|
+
This example uses Vue 3 `<script setup>` with a locally imported component. The container must have a nonzero width and height.
|
|
32
|
+
|
|
33
|
+
```vue
|
|
34
|
+
<script setup lang="ts">
|
|
35
|
+
import { use } from 'echarts/core'
|
|
36
|
+
import { LineChart } from 'echarts/charts'
|
|
37
|
+
import { IxChart, type ChartProps } from '@idux/charts-core'
|
|
38
|
+
|
|
39
|
+
use([LineChart])
|
|
40
|
+
|
|
41
|
+
const option: ChartProps = {
|
|
42
|
+
xAxis: { type: 'category', data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'] },
|
|
43
|
+
yAxis: { type: 'value' },
|
|
44
|
+
series: [{ type: 'line', data: [123, 324, 156, 244, 188] }],
|
|
45
|
+
}
|
|
46
|
+
</script>
|
|
47
|
+
|
|
48
|
+
<template>
|
|
49
|
+
<div style="height: 320px">
|
|
50
|
+
<IxChart v-bind="option" />
|
|
51
|
+
</div>
|
|
52
|
+
</template>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
`IxChart` takes ECharts options directly through `v-bind`, rather than a separate `option` prop. It registers the SVG renderer, Grid, Legend, Tooltip, Title, DataZoom, LabelLayout, and UniversalTransition. Register custom series or additional components with `use` from `echarts/core`. For Canvas, also register `CanvasRenderer` and pass `initOption: { renderer: 'canvas' }`.
|
|
56
|
+
|
|
57
|
+
## Core API
|
|
58
|
+
|
|
59
|
+
- `IxChart`: supports `autoResize` (enabled by default), `loading`, `theme`, `group`, `initOption`, `setOptionOpts`, and `onReady`.
|
|
60
|
+
- `useChart(options, listeners?)`: manages initialization, reactive updates, events, resizing, and disposal. Call it in component `setup`; it returns `containerRef` and `chartRef`.
|
|
61
|
+
- `seerTheme`: the built-in theme, registered as the default theme `seer`.
|
|
62
|
+
- `useTooltipsFormatter`, `useReactiveAttrs`, `createInstall`, and `withChartProps`: helpers for custom charts.
|
|
63
|
+
- `ChartProps`, `ChartPublicProps`, and `ChartOption`: public configuration types.
|
|
64
|
+
|
|
65
|
+
This package does not ship a separate CSS file. Shared HTML tooltip styles are provided by `@idux/charts/dist/style.css`.
|
|
66
|
+
|
|
67
|
+
## Application themes
|
|
68
|
+
|
|
69
|
+
Use `CHART_THEME_TOKEN` to provide an application-wide theme name/object or a reactive ref. Explicit `theme` props override it; otherwise charts fall back to `seer`. Changing the inherited theme recreates the chart, following the existing theme lifecycle. For generated plot labels and graphics, also configure `PLOT_THEME_TOKEN` from `@idux/charts-plots` (or `@idux/charts`).
|
|
70
|
+
|
|
71
|
+
## TypeScript
|
|
72
|
+
|
|
73
|
+
`*ChartProps` types describe chart configuration and allow extension fields. `*ChartPublicProps` expose named public properties while preserving their types and optionality for component type adapters. See the [repository README](https://github.com/IDuxFE/idux-charts/blob/main/README.md#typescript-prop-types) for adapter details.
|
|
74
|
+
|
|
75
|
+
## Documentation
|
|
76
|
+
|
|
77
|
+
- [iDux Charts](https://charts.idux.site)
|
|
78
|
+
- [Configuration guide](https://github.com/IDuxFE/idux-charts/blob/main/packages/site/src/0-guide/GettingStarted.page.md)
|
|
79
|
+
- [Vue 2 / Vue 3 playgrounds](https://github.com/IDuxFE/idux-charts/blob/main/playgrounds/README.md)
|
|
80
|
+
- [Repository and development](https://github.com/IDuxFE/idux-charts/blob/main/README.md)
|
|
81
|
+
|
|
82
|
+
## License
|
|
83
|
+
|
|
84
|
+
MIT © 2023-present IDuxFE
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# @idux/charts-core
|
|
2
|
+
|
|
3
|
+
[English](README.md) | 简体中文
|
|
4
|
+
|
|
5
|
+
iDux Charts 的基础层,提供通用 `IxChart`、图表生命周期组合式函数、主题、类型及工具,适合直接使用 ECharts 配置或开发自定义图表组件。
|
|
6
|
+
|
|
7
|
+
如需统一入口及共享提示框样式,可使用 [`@idux/charts`](https://github.com/IDuxFE/idux-charts/blob/main/packages/charts/README.zh.md)。
|
|
8
|
+
|
|
9
|
+
## 安装
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @idux/charts-core echarts
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
支持 Vue 2(含 Vue 2.6)和 Vue 3。在已有 Vue 项目中使用,依赖版本为 Vue `^2.6.0 || ^3.2.5` 和 ECharts `^5.4.3 || ^6.0.0`。Vue 2.6 还需安装 `@vue/composition-api >=1.6.2`,并在创建应用前注册插件。
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install @vue/composition-api
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
// Vue 2.6
|
|
23
|
+
import Vue from 'vue'
|
|
24
|
+
import VueCompositionAPI from '@vue/composition-api'
|
|
25
|
+
|
|
26
|
+
Vue.use(VueCompositionAPI)
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## 快速上手
|
|
30
|
+
|
|
31
|
+
以下示例使用 Vue 3 的 `<script setup>`,局部导入组件即可使用。容器必须具有有效的宽度和高度。
|
|
32
|
+
|
|
33
|
+
```vue
|
|
34
|
+
<script setup lang="ts">
|
|
35
|
+
import { use } from 'echarts/core'
|
|
36
|
+
import { LineChart } from 'echarts/charts'
|
|
37
|
+
import { IxChart, type ChartProps } from '@idux/charts-core'
|
|
38
|
+
|
|
39
|
+
use([LineChart])
|
|
40
|
+
|
|
41
|
+
const option: ChartProps = {
|
|
42
|
+
xAxis: { type: 'category', data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'] },
|
|
43
|
+
yAxis: { type: 'value' },
|
|
44
|
+
series: [{ type: 'line', data: [123, 324, 156, 244, 188] }],
|
|
45
|
+
}
|
|
46
|
+
</script>
|
|
47
|
+
|
|
48
|
+
<template>
|
|
49
|
+
<div style="height: 320px">
|
|
50
|
+
<IxChart v-bind="option" />
|
|
51
|
+
</div>
|
|
52
|
+
</template>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
`IxChart` 的 ECharts 配置通过 `v-bind` 直接传入,不使用单独的 `option` 属性。默认注册 SVG 渲染器、Grid、Legend、Tooltip、Title、DataZoom,以及 LabelLayout、UniversalTransition。自定义系列或额外组件需要通过 `echarts/core` 的 `use` 注册;使用 Canvas 时也需注册 `CanvasRenderer`,并传入 `initOption: { renderer: 'canvas' }`。
|
|
56
|
+
|
|
57
|
+
## 核心 API
|
|
58
|
+
|
|
59
|
+
- `IxChart`:支持 `autoResize`(默认开启)、`loading`、`theme`、`group`、`initOption`、`setOptionOpts` 和 `onReady`。
|
|
60
|
+
- `useChart(options, listeners?)`:管理初始化、响应式更新、事件、尺寸变化和销毁,返回 `containerRef` 与 `chartRef`;在组件 `setup` 中调用。
|
|
61
|
+
- `seerTheme`:内置主题,默认主题名称为 `seer`。
|
|
62
|
+
- `useTooltipsFormatter`、`useReactiveAttrs`、`createInstall`、`withChartProps`:自定义图表开发工具。
|
|
63
|
+
- `ChartProps`、`ChartPublicProps`、`ChartOption`:公开配置类型。
|
|
64
|
+
|
|
65
|
+
此包不提供独立 CSS 文件;共享 HTML 提示框样式由 `@idux/charts/dist/style.css` 提供。
|
|
66
|
+
|
|
67
|
+
## 应用级主题
|
|
68
|
+
|
|
69
|
+
可用 `CHART_THEME_TOKEN` 提供应用级主题名称、对象或响应式 ref。显式 `theme` 属性优先,未配置时回退到 `seer`。注入主题变化沿用已有主题生命周期,重新创建图表实例。对于配置生成器绘制的文字和辅助图形,还需配置 `@idux/charts-plots`(或 `@idux/charts`)导出的 `PLOT_THEME_TOKEN`。
|
|
70
|
+
|
|
71
|
+
## TypeScript
|
|
72
|
+
|
|
73
|
+
`*ChartProps` 用于图表配置,允许扩展字段;`*ChartPublicProps` 提供具名公开属性类型,保留属性的类型及可选性,便于编写组件类型适配。具体适配说明见[仓库 README](https://github.com/IDuxFE/idux-charts/blob/main/README.zh.md#typescript-属性类型)。
|
|
74
|
+
|
|
75
|
+
## 文档
|
|
76
|
+
|
|
77
|
+
- [iDux Charts](https://charts.idux.site)
|
|
78
|
+
- [配置指南](https://github.com/IDuxFE/idux-charts/blob/main/packages/site/src/0-guide/GettingStarted.page.md)
|
|
79
|
+
- [Vue 2 / Vue 3 示例项目](https://github.com/IDuxFE/idux-charts/blob/main/playgrounds/README.zh.md)
|
|
80
|
+
- [仓库与开发指南](https://github.com/IDuxFE/idux-charts/blob/main/README.zh.md)
|
|
81
|
+
|
|
82
|
+
## 许可证
|
|
83
|
+
|
|
84
|
+
MIT © 2023-present IDuxFE
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { DataZoomComponent as e, GridComponent as t, LegendComponent as n, TitleComponent as r, TooltipComponent as i } from "echarts/components";
|
|
2
2
|
import { LabelLayout as a, UniversalTransition as o } from "echarts/features";
|
|
3
3
|
import { SVGRenderer as s } from "echarts/renderers";
|
|
4
|
-
import { computed as c, defineComponent as l, getCurrentInstance as u, h as d,
|
|
4
|
+
import { computed as c, defineComponent as l, getCurrentInstance as u, h as d, inject as f, isVue2 as p, onBeforeUnmount as ee, onBeforeUpdate as m, onMounted as te, onUpdated as ne, shallowRef as h, unref as g, watch as _, watchEffect as v } from "vue-demi";
|
|
5
5
|
import { PictorialBarChart as y } from "echarts/charts";
|
|
6
|
-
import { init as
|
|
7
|
-
import { cloneDeep as S, isBoolean as
|
|
6
|
+
import { init as re, registerTheme as b, use as x } from "echarts/core";
|
|
7
|
+
import { cloneDeep as S, isBoolean as ie, isEqual as C, isNil as w } from "lodash-es";
|
|
8
8
|
// composables/useResizeObserver.ts
|
|
9
9
|
function ae(e, t, n) {
|
|
10
10
|
_([
|
|
@@ -23,15 +23,15 @@ function ae(e, t, n) {
|
|
|
23
23
|
});
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
|
-
var
|
|
26
|
+
var T = /* @__PURE__ */ new Map();
|
|
27
27
|
function oe(e, t, n) {
|
|
28
28
|
if (e && t) {
|
|
29
|
-
if (
|
|
29
|
+
if (T.has(e)) T.get(e).listeners.push(t);
|
|
30
30
|
else {
|
|
31
31
|
let r = [t], i = new ResizeObserver((e) => {
|
|
32
32
|
e.forEach((e) => r.forEach((t) => t(e)));
|
|
33
33
|
});
|
|
34
|
-
i.observe(e, n),
|
|
34
|
+
i.observe(e, n), T.set(e, {
|
|
35
35
|
listeners: r,
|
|
36
36
|
ro: i
|
|
37
37
|
});
|
|
@@ -39,49 +39,51 @@ function oe(e, t, n) {
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
function se(e, t) {
|
|
42
|
-
if (!e || !t || !
|
|
43
|
-
let { listeners: n, ro: r } =
|
|
44
|
-
i > -1 && (n.splice(i, 1), n.length === 0 && (r.disconnect(),
|
|
42
|
+
if (!e || !t || !T.has(e)) return;
|
|
43
|
+
let { listeners: n, ro: r } = T.get(e), i = n.indexOf(t);
|
|
44
|
+
i > -1 && (n.splice(i, 1), n.length === 0 && (r.disconnect(), T.delete(e)));
|
|
45
45
|
}
|
|
46
|
+
// themes/token.ts
|
|
47
|
+
var E = Symbol("CHART_THEME_TOKEN");
|
|
46
48
|
// composables/useChart.ts
|
|
47
49
|
x([y]);
|
|
48
|
-
var
|
|
49
|
-
function
|
|
50
|
-
let n = () => typeof t == "function" ? t() : t, r = h(), i = h(), a = h(), o = c(() => g(e).autoResize ?? !0), s = c(() => g(e).group), l = c(() => g(e).initOption), u = c(() => g(e).loading), d = c(() => g(e).setOptionOpts), f = c(() => g(e).theme ?? "seer"),
|
|
51
|
-
|
|
50
|
+
var D = { text: "加载中..." };
|
|
51
|
+
function O(e, t) {
|
|
52
|
+
let n = () => typeof t == "function" ? t() : t, r = h(), i = h(), a = h(), o = c(() => g(e).autoResize ?? !0), s = c(() => g(e).group), l = c(() => g(e).initOption), u = c(() => g(e).loading), d = c(() => g(e).setOptionOpts), p = f(E, void 0), m = c(() => g(e).theme ?? g(p) ?? "seer"), y = [], b = (e, t) => {
|
|
53
|
+
y = y.filter((n) => {
|
|
52
54
|
let r = t.some(([e, t, r]) => e === n.name && t === n.handler && r === n.once);
|
|
53
55
|
return r || e.off(n.name, n.wrapped), r;
|
|
54
56
|
}), t.forEach(([t, n, r]) => {
|
|
55
|
-
if (
|
|
57
|
+
if (y.some((e) => e.name === t && e.handler === n && e.once === r)) return;
|
|
56
58
|
let i = (...a) => {
|
|
57
59
|
r && e.off(t, i), n(...a);
|
|
58
60
|
};
|
|
59
|
-
|
|
61
|
+
y.push({
|
|
60
62
|
name: t,
|
|
61
63
|
handler: n,
|
|
62
64
|
once: r,
|
|
63
65
|
wrapped: i
|
|
64
66
|
}), e.on(t, i);
|
|
65
67
|
});
|
|
66
|
-
},
|
|
68
|
+
}, x = () => {
|
|
67
69
|
let t = r.value;
|
|
68
70
|
if (!t) return;
|
|
69
|
-
let o =
|
|
70
|
-
o.setOption(c, d.value), a.value = S(c),
|
|
71
|
-
let
|
|
72
|
-
|
|
73
|
-
},
|
|
74
|
-
i.value && (i.value.dispose(), i.value = void 0,
|
|
71
|
+
let o = re(t, m.value, l.value), s = g(e), { restOptions: c, events: u } = k(s, n(), !1);
|
|
72
|
+
o.setOption(c, d.value), a.value = S(c), b(o, u);
|
|
73
|
+
let f = s.onReady || n()?.ready;
|
|
74
|
+
f && f(o), i.value = o;
|
|
75
|
+
}, w = () => {
|
|
76
|
+
i.value && (i.value.dispose(), i.value = void 0, y = []);
|
|
75
77
|
};
|
|
76
|
-
return
|
|
77
|
-
i.value &&
|
|
78
|
+
return te(() => x()), ee(() => w()), ne(() => {
|
|
79
|
+
i.value && b(i.value, k(g(e), n(), !1).events);
|
|
78
80
|
}), _(() => g(e), (e) => {
|
|
79
81
|
let t = i.value;
|
|
80
82
|
if (!t) return;
|
|
81
|
-
let { restOptions: r, events: o } =
|
|
82
|
-
|
|
83
|
-
}, { deep: !0 }), _([() => S(
|
|
84
|
-
C(e, n) && C(t, r) || (
|
|
83
|
+
let { restOptions: r, events: o } = k(e, n(), !1);
|
|
84
|
+
b(t, o), C(r, a.value) || (t.setOption(r, d.value), a.value = S(r));
|
|
85
|
+
}, { deep: !0 }), _([() => S(m.value), () => S(l.value)], ([e, t], [n, r]) => {
|
|
86
|
+
C(e, n) && C(t, r) || (w(), x());
|
|
85
87
|
}), v(() => {
|
|
86
88
|
let e = s.value;
|
|
87
89
|
i.value && (i.value.group = e ?? "");
|
|
@@ -89,10 +91,17 @@ function E(e, t) {
|
|
|
89
91
|
let e = i.value;
|
|
90
92
|
if (!e) return;
|
|
91
93
|
let t = u.value;
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
if (t) {
|
|
95
|
+
let n = e.getOption().darkMode === !0 ? {
|
|
96
|
+
...D,
|
|
97
|
+
textColor: "#F4F8FF",
|
|
98
|
+
maskColor: "rgba(10, 12, 15, 0.8)"
|
|
99
|
+
} : D;
|
|
100
|
+
e.showLoading(ie(t) ? n : {
|
|
101
|
+
...n,
|
|
102
|
+
...t
|
|
103
|
+
});
|
|
104
|
+
} else e.hideLoading();
|
|
96
105
|
}), ae(r, i, o), {
|
|
97
106
|
containerRef: r,
|
|
98
107
|
chartRef: i
|
|
@@ -112,7 +121,7 @@ var le = [
|
|
|
112
121
|
"theme",
|
|
113
122
|
"onReady"
|
|
114
123
|
];
|
|
115
|
-
function
|
|
124
|
+
function k(e, t = {}, n = !0) {
|
|
116
125
|
let r = {}, i = [];
|
|
117
126
|
return Object.keys(e).forEach((t) => {
|
|
118
127
|
if (!le.includes(t)) {
|
|
@@ -129,7 +138,7 @@ function D(e, t = {}, n = !0) {
|
|
|
129
138
|
}
|
|
130
139
|
} else r[t] = e[t];
|
|
131
140
|
}
|
|
132
|
-
}),
|
|
141
|
+
}), p && !n && Object.keys(t).forEach((e) => {
|
|
133
142
|
if (e === "ready" || e === "~ready") return;
|
|
134
143
|
let n = t[e];
|
|
135
144
|
if (n) {
|
|
@@ -146,7 +155,7 @@ function D(e, t = {}, n = !0) {
|
|
|
146
155
|
};
|
|
147
156
|
}
|
|
148
157
|
// composables/useTooltips.ts
|
|
149
|
-
function
|
|
158
|
+
function A(e, t) {
|
|
150
159
|
return `
|
|
151
160
|
<div class="charts-tooltips">
|
|
152
161
|
<div class="charts-tooltips-title">${e}</div>
|
|
@@ -159,7 +168,7 @@ function O(e, t) {
|
|
|
159
168
|
</div>`;
|
|
160
169
|
}
|
|
161
170
|
// composables/useStripe.ts
|
|
162
|
-
function
|
|
171
|
+
function j({ data: e = [], color: t = "", offset: n = [0, 0], rotate: r = -20, size: i = [2, 8] }) {
|
|
163
172
|
return {
|
|
164
173
|
name: "",
|
|
165
174
|
data: e,
|
|
@@ -188,7 +197,7 @@ function ue(e) {
|
|
|
188
197
|
formatter: function(t) {
|
|
189
198
|
if (!t?.length) return "";
|
|
190
199
|
let n = t[0].name;
|
|
191
|
-
return
|
|
200
|
+
return A(n, t.filter((e) => !!e.seriesName).map((t) => ({
|
|
192
201
|
name: t.seriesName,
|
|
193
202
|
value: `${t.value} ${e}`,
|
|
194
203
|
color: t.color
|
|
@@ -201,7 +210,7 @@ function de({ series: e, color: t, offset: n = [0, 0], rotate: r, size: i }) {
|
|
|
201
210
|
type: "bar",
|
|
202
211
|
z: 0,
|
|
203
212
|
...e
|
|
204
|
-
},
|
|
213
|
+
}, j({
|
|
205
214
|
data: e.data,
|
|
206
215
|
offset: n,
|
|
207
216
|
color: t,
|
|
@@ -230,9 +239,9 @@ var pe = {
|
|
|
230
239
|
"init-option": "initOption",
|
|
231
240
|
"set-option-opts": "setOptionOpts"
|
|
232
241
|
};
|
|
233
|
-
function
|
|
234
|
-
let t = u()?.proxy, n = () => Object.fromEntries(Object.entries(
|
|
235
|
-
if (
|
|
242
|
+
function M(e) {
|
|
243
|
+
let t = u()?.proxy, n = () => Object.fromEntries(Object.entries(p && t ? t.$attrs : e).map(([e, t]) => [pe[e] ?? e, t]));
|
|
244
|
+
if (p && t) return c(n);
|
|
236
245
|
let r = h(n());
|
|
237
246
|
return m(() => {
|
|
238
247
|
let e = n(), t = r.value;
|
|
@@ -240,15 +249,15 @@ function A(e) {
|
|
|
240
249
|
}), r;
|
|
241
250
|
}
|
|
242
251
|
// utils/withChartProps.ts
|
|
243
|
-
function
|
|
252
|
+
function N() {
|
|
244
253
|
return (e) => e;
|
|
245
254
|
}
|
|
246
255
|
// components/Chart.ts
|
|
247
|
-
var me =
|
|
256
|
+
var me = N()(l({
|
|
248
257
|
name: "IxChart",
|
|
249
258
|
inheritAttrs: !1,
|
|
250
259
|
setup(e, t) {
|
|
251
|
-
let { containerRef: n } =
|
|
260
|
+
let { containerRef: n } = O(M(t.attrs), () => t.listeners ?? {});
|
|
252
261
|
return { containerRef: n };
|
|
253
262
|
},
|
|
254
263
|
render() {
|
|
@@ -265,27 +274,27 @@ var me = j()(l({
|
|
|
265
274
|
}
|
|
266
275
|
}));
|
|
267
276
|
// ../../node_modules/.pnpm/@ctrl+tinycolor@4.2.2/node_modules/@ctrl/tinycolor/dist/module/util.js
|
|
268
|
-
function
|
|
277
|
+
function P(e, t) {
|
|
269
278
|
he(e) && (e = "100%");
|
|
270
|
-
let n =
|
|
279
|
+
let n = I(e);
|
|
271
280
|
return e = t === 360 ? parseFloat(e) : Math.min(t, Math.max(0, parseFloat(e))), n && (e = parseInt(String(e * t), 10) / 100), Math.abs(e - t) < 1e-6 ? 1 : (e = t === 360 ? (e < 0 ? e % t + t : e % t) / t : e % t / t, e);
|
|
272
281
|
}
|
|
273
|
-
function
|
|
282
|
+
function F(e) {
|
|
274
283
|
return Math.min(1, Math.max(0, e));
|
|
275
284
|
}
|
|
276
285
|
function he(e) {
|
|
277
|
-
return typeof e == "string" && e.indexOf(".") !== -1 && !
|
|
286
|
+
return typeof e == "string" && e.indexOf(".") !== -1 && !I(e) && parseFloat(e) === 1;
|
|
278
287
|
}
|
|
279
|
-
function
|
|
288
|
+
function I(e) {
|
|
280
289
|
return typeof e == "string" && e.indexOf("%") !== -1;
|
|
281
290
|
}
|
|
282
|
-
function
|
|
291
|
+
function L(e) {
|
|
283
292
|
return e = parseFloat(e), (isNaN(e) || e < 0 || e > 1) && (e = 1), e;
|
|
284
293
|
}
|
|
285
294
|
function ge(e) {
|
|
286
295
|
return Number(e) <= 1 ? `${Number(e) * 100}%` : e;
|
|
287
296
|
}
|
|
288
|
-
function
|
|
297
|
+
function R(e) {
|
|
289
298
|
if (typeof e != "number" || !(e <= 1)) return ge(e);
|
|
290
299
|
let t = Math.min(100, Math.max(0, e * 100)) * 100;
|
|
291
300
|
return (t >= 1e-6 ? Math.trunc(t) : parseInt(String(t), 10)) / 100;
|
|
@@ -296,13 +305,13 @@ function _e(e) {
|
|
|
296
305
|
// ../../node_modules/.pnpm/@ctrl+tinycolor@4.2.2/node_modules/@ctrl/tinycolor/dist/module/conversion.js
|
|
297
306
|
function ve(e, t, n) {
|
|
298
307
|
return {
|
|
299
|
-
r:
|
|
300
|
-
g:
|
|
301
|
-
b:
|
|
308
|
+
r: P(e, 255) * 255,
|
|
309
|
+
g: P(t, 255) * 255,
|
|
310
|
+
b: P(n, 255) * 255
|
|
302
311
|
};
|
|
303
312
|
}
|
|
304
|
-
function
|
|
305
|
-
e =
|
|
313
|
+
function z(e, t, n) {
|
|
314
|
+
e = P(e, 255), t = P(t, 255), n = P(n, 255);
|
|
306
315
|
let r = Math.max(e, t, n), i = Math.min(e, t, n), a = 0, o, s = (r + i) / 2;
|
|
307
316
|
if (r === i) o = 0, a = 0;
|
|
308
317
|
else {
|
|
@@ -324,15 +333,15 @@ function L(e, t, n) {
|
|
|
324
333
|
l: s
|
|
325
334
|
};
|
|
326
335
|
}
|
|
327
|
-
function
|
|
336
|
+
function B(e, t, n) {
|
|
328
337
|
return n < 0 && (n += 1), n > 1 && --n, n < 1 / 6 ? e + (t - e) * (6 * n) : n < 1 / 2 ? t : n < 2 / 3 ? e + (t - e) * (2 / 3 - n) * 6 : e;
|
|
329
338
|
}
|
|
330
339
|
function ye(e, t, n) {
|
|
331
340
|
let r, i, a;
|
|
332
|
-
if (e =
|
|
341
|
+
if (e = P(e, 360), t = P(t, 100), n = P(n, 100), t === 0) i = n, a = n, r = n;
|
|
333
342
|
else {
|
|
334
343
|
let o = n < .5 ? n * (1 + t) : n + t - n * t, s = 2 * n - o;
|
|
335
|
-
r =
|
|
344
|
+
r = B(s, o, e + 1 / 3), i = B(s, o, e), a = B(s, o, e - 1 / 3);
|
|
336
345
|
}
|
|
337
346
|
return {
|
|
338
347
|
r: r * 255,
|
|
@@ -340,8 +349,8 @@ function ye(e, t, n) {
|
|
|
340
349
|
b: a * 255
|
|
341
350
|
};
|
|
342
351
|
}
|
|
343
|
-
function
|
|
344
|
-
e =
|
|
352
|
+
function V(e, t, n) {
|
|
353
|
+
e = P(e, 255), t = P(t, 255), n = P(n, 255);
|
|
345
354
|
let r = Math.max(e, t, n), i = Math.min(e, t, n), a = 0, o = r, s = r - i, c = r === 0 ? 0 : s / r;
|
|
346
355
|
if (r === i) a = 0;
|
|
347
356
|
else {
|
|
@@ -363,7 +372,7 @@ function z(e, t, n) {
|
|
|
363
372
|
};
|
|
364
373
|
}
|
|
365
374
|
function be(e, t, n) {
|
|
366
|
-
e =
|
|
375
|
+
e = P(e, 360) * 6, t = P(t, 100), n = P(n, 100);
|
|
367
376
|
let r = Math.floor(e), i = e - r, a = n * (1 - t), o = n * (1 - i * t), s = n * (1 - (1 - i) * t), c = r % 6, l = [
|
|
368
377
|
n,
|
|
369
378
|
o,
|
|
@@ -392,22 +401,22 @@ function be(e, t, n) {
|
|
|
392
401
|
b: d * 255
|
|
393
402
|
};
|
|
394
403
|
}
|
|
395
|
-
function
|
|
404
|
+
function H(e) {
|
|
396
405
|
return e < 10 ? 48 + e : 87 + e;
|
|
397
406
|
}
|
|
398
|
-
function
|
|
407
|
+
function U(e) {
|
|
399
408
|
let t = Math.round(e);
|
|
400
|
-
return t >= 0 && t <= 255 ? String.fromCharCode(
|
|
409
|
+
return t >= 0 && t <= 255 ? String.fromCharCode(H(t >> 4), H(t & 15)) : _e(t.toString(16));
|
|
401
410
|
}
|
|
402
411
|
function xe(e) {
|
|
403
|
-
return
|
|
412
|
+
return U(parseFloat(e) * 255);
|
|
404
413
|
}
|
|
405
|
-
function
|
|
406
|
-
let i =
|
|
414
|
+
function W(e, t, n, r) {
|
|
415
|
+
let i = U(e), a = U(t), o = U(n);
|
|
407
416
|
return r && i.startsWith(i.charAt(1)) && a.startsWith(a.charAt(1)) && o.startsWith(o.charAt(1)) ? i.charAt(0) + a.charAt(0) + o.charAt(0) : i + a + o;
|
|
408
417
|
}
|
|
409
418
|
function Se(e, t, n, r, i) {
|
|
410
|
-
let a =
|
|
419
|
+
let a = U(e), o = U(t), s = U(n), c = xe(r);
|
|
411
420
|
return i && a.startsWith(a.charAt(1)) && o.startsWith(o.charAt(1)) && s.startsWith(s.charAt(1)) && c.startsWith(c.charAt(1)) ? a.charAt(0) + o.charAt(0) + s.charAt(0) + c.charAt(0) : a + o + s + c;
|
|
412
421
|
}
|
|
413
422
|
function Ce(e, t, n, r) {
|
|
@@ -418,7 +427,7 @@ function Ce(e, t, n, r) {
|
|
|
418
427
|
b: 255 * (1 - o) * (1 - s)
|
|
419
428
|
};
|
|
420
429
|
}
|
|
421
|
-
function
|
|
430
|
+
function G(e, t, n) {
|
|
422
431
|
let r = 1 - e / 255, i = 1 - t / 255, a = 1 - n / 255, o = Math.min(r, i, a);
|
|
423
432
|
return o === 1 ? (r = 0, i = 0, a = 0) : (r = (r - o) / (1 - o) * 100, i = (i - o) / (1 - o) * 100, a = (a - o) / (1 - o) * 100), o *= 100, {
|
|
424
433
|
c: Math.round(r),
|
|
@@ -435,7 +444,7 @@ function we(e) {
|
|
|
435
444
|
};
|
|
436
445
|
}
|
|
437
446
|
// ../../node_modules/.pnpm/@ctrl+tinycolor@4.2.2/node_modules/@ctrl/tinycolor/dist/module/css-color-names.js
|
|
438
|
-
var
|
|
447
|
+
var K = {
|
|
439
448
|
aliceblue: "#f0f8ff",
|
|
440
449
|
antiquewhite: "#faebd7",
|
|
441
450
|
aqua: "#00ffff",
|
|
@@ -593,20 +602,20 @@ function Te(e) {
|
|
|
593
602
|
b: 0
|
|
594
603
|
}, n = 1, r = !1, i = !1;
|
|
595
604
|
if (typeof e == "string" && (e = Ee(e)), typeof e == "object") {
|
|
596
|
-
if (
|
|
605
|
+
if (Q(e.r) && Q(e.g) && Q(e.b)) {
|
|
597
606
|
t = ve(e.r, e.g, e.b), r = !0;
|
|
598
607
|
let { r: n } = e;
|
|
599
608
|
i = typeof n != "number" && String(n).endsWith("%") ? "prgb" : "rgb";
|
|
600
|
-
} else if (
|
|
601
|
-
let n =
|
|
609
|
+
} else if (Q(e.h) && Q(e.s) && Q(e.v)) {
|
|
610
|
+
let n = R(e.s), a = R(e.v);
|
|
602
611
|
t = be(e.h, n, a), r = !0, i = "hsv";
|
|
603
|
-
} else if (
|
|
604
|
-
let n =
|
|
612
|
+
} else if (Q(e.h) && Q(e.s) && Q(e.l)) {
|
|
613
|
+
let n = R(e.s), a = R(e.l);
|
|
605
614
|
t = ye(e.h, n, a), r = !0, i = "hsl";
|
|
606
|
-
} else
|
|
615
|
+
} else Q(e.c) && Q(e.m) && Q(e.y) && Q(e.k) && (t = Ce(e.c, e.m, e.y, e.k), r = !0, i = "cmyk");
|
|
607
616
|
Object.prototype.hasOwnProperty.call(e, "a") && (n = e.a);
|
|
608
617
|
}
|
|
609
|
-
return n =
|
|
618
|
+
return n = L(n), {
|
|
610
619
|
ok: r,
|
|
611
620
|
format: e.format || i,
|
|
612
621
|
r: Math.min(255, Math.max(t.r, 0)),
|
|
@@ -615,20 +624,20 @@ function Te(e) {
|
|
|
615
624
|
a: n
|
|
616
625
|
};
|
|
617
626
|
}
|
|
618
|
-
var
|
|
619
|
-
CSS_UNIT: new RegExp(
|
|
620
|
-
rgb: RegExp("rgb" +
|
|
621
|
-
rgba: RegExp("rgba" +
|
|
622
|
-
hsl: RegExp("hsl" +
|
|
623
|
-
hsla: RegExp("hsla" +
|
|
624
|
-
hsv: RegExp("hsv" +
|
|
625
|
-
hsva: RegExp("hsva" +
|
|
626
|
-
cmyk: RegExp("cmyk" +
|
|
627
|
+
var q = "(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)", J = "[\\s|\\(]+(" + q + ")[,|\\s]+(" + q + ")[,|\\s]+(" + q + ")\\s*\\)?", Y = "[\\s|\\(]+(" + q + ")[,|\\s]+(" + q + ")[,|\\s]+(" + q + ")[,|\\s]+(" + q + ")\\s*\\)?", X = {
|
|
628
|
+
CSS_UNIT: new RegExp(q),
|
|
629
|
+
rgb: RegExp("rgb" + J),
|
|
630
|
+
rgba: RegExp("rgba" + Y),
|
|
631
|
+
hsl: RegExp("hsl" + J),
|
|
632
|
+
hsla: RegExp("hsla" + Y),
|
|
633
|
+
hsv: RegExp("hsv" + J),
|
|
634
|
+
hsva: RegExp("hsva" + Y),
|
|
635
|
+
cmyk: RegExp("cmyk" + Y)
|
|
627
636
|
};
|
|
628
637
|
function Ee(e) {
|
|
629
638
|
if (e = e.trim().toLowerCase(), e.length === 0) return !1;
|
|
630
639
|
let t = !1;
|
|
631
|
-
if (
|
|
640
|
+
if (K[e]) e = K[e], t = !0;
|
|
632
641
|
else if (e === "transparent") return {
|
|
633
642
|
r: 0,
|
|
634
643
|
g: 0,
|
|
@@ -640,35 +649,35 @@ function Ee(e) {
|
|
|
640
649
|
let n = De(e, t);
|
|
641
650
|
if (n) return n;
|
|
642
651
|
}
|
|
643
|
-
let n =
|
|
652
|
+
let n = X.rgb.exec(e);
|
|
644
653
|
return n ? {
|
|
645
654
|
r: n[1],
|
|
646
655
|
g: n[2],
|
|
647
656
|
b: n[3]
|
|
648
|
-
} : (n =
|
|
657
|
+
} : (n = X.rgba.exec(e), n ? {
|
|
649
658
|
r: n[1],
|
|
650
659
|
g: n[2],
|
|
651
660
|
b: n[3],
|
|
652
661
|
a: n[4]
|
|
653
|
-
} : (n =
|
|
662
|
+
} : (n = X.hsl.exec(e), n ? {
|
|
654
663
|
h: n[1],
|
|
655
664
|
s: n[2],
|
|
656
665
|
l: n[3]
|
|
657
|
-
} : (n =
|
|
666
|
+
} : (n = X.hsla.exec(e), n ? {
|
|
658
667
|
h: n[1],
|
|
659
668
|
s: n[2],
|
|
660
669
|
l: n[3],
|
|
661
670
|
a: n[4]
|
|
662
|
-
} : (n =
|
|
671
|
+
} : (n = X.hsv.exec(e), n ? {
|
|
663
672
|
h: n[1],
|
|
664
673
|
s: n[2],
|
|
665
674
|
v: n[3]
|
|
666
|
-
} : (n =
|
|
675
|
+
} : (n = X.hsva.exec(e), n ? {
|
|
667
676
|
h: n[1],
|
|
668
677
|
s: n[2],
|
|
669
678
|
v: n[3],
|
|
670
679
|
a: n[4]
|
|
671
|
-
} : (n =
|
|
680
|
+
} : (n = X.cmyk.exec(e), n ? {
|
|
672
681
|
c: n[1],
|
|
673
682
|
m: n[2],
|
|
674
683
|
y: n[3],
|
|
@@ -678,14 +687,14 @@ function Ee(e) {
|
|
|
678
687
|
function De(e, t) {
|
|
679
688
|
let n = +!!e.startsWith("#"), r = e.length - n;
|
|
680
689
|
if (r === 6 || r === 8) {
|
|
681
|
-
let i =
|
|
690
|
+
let i = Z(e, n) * 16 + Z(e, n + 1), a = Z(e, n + 2) * 16 + Z(e, n + 3), o = Z(e, n + 4) * 16 + Z(e, n + 5);
|
|
682
691
|
if (r === 6) return Number.isNaN(i + a + o) ? void 0 : {
|
|
683
692
|
r: i,
|
|
684
693
|
g: a,
|
|
685
694
|
b: o,
|
|
686
695
|
format: t ? "name" : "hex"
|
|
687
696
|
};
|
|
688
|
-
let s =
|
|
697
|
+
let s = Z(e, n + 6) * 16 + Z(e, n + 7);
|
|
689
698
|
return Number.isNaN(i + a + o + s) ? void 0 : {
|
|
690
699
|
r: i,
|
|
691
700
|
g: a,
|
|
@@ -695,14 +704,14 @@ function De(e, t) {
|
|
|
695
704
|
};
|
|
696
705
|
}
|
|
697
706
|
if (r === 3 || r === 4) {
|
|
698
|
-
let i =
|
|
707
|
+
let i = Z(e, n) * 17, a = Z(e, n + 1) * 17, o = Z(e, n + 2) * 17;
|
|
699
708
|
if (r === 3) return Number.isNaN(i + a + o) ? void 0 : {
|
|
700
709
|
r: i,
|
|
701
710
|
g: a,
|
|
702
711
|
b: o,
|
|
703
712
|
format: t ? "name" : "hex"
|
|
704
713
|
};
|
|
705
|
-
let s =
|
|
714
|
+
let s = Z(e, n + 3) * 17;
|
|
706
715
|
return Number.isNaN(i + a + o + s) ? void 0 : {
|
|
707
716
|
r: i,
|
|
708
717
|
g: a,
|
|
@@ -712,12 +721,12 @@ function De(e, t) {
|
|
|
712
721
|
};
|
|
713
722
|
}
|
|
714
723
|
}
|
|
715
|
-
function
|
|
724
|
+
function Z(e, t) {
|
|
716
725
|
let n = e.charCodeAt(t);
|
|
717
726
|
return n >= 48 && n <= 57 ? n - 48 : n >= 97 && n <= 102 ? n - 87 : n >= 65 && n <= 70 ? n - 55 : NaN;
|
|
718
727
|
}
|
|
719
|
-
function
|
|
720
|
-
return typeof e == "number" ? !Number.isNaN(e) : e !== void 0 &&
|
|
728
|
+
function Q(e) {
|
|
729
|
+
return typeof e == "number" ? !Number.isNaN(e) : e !== void 0 && X.CSS_UNIT.test(e);
|
|
721
730
|
}
|
|
722
731
|
// ../../node_modules/.pnpm/@ctrl+tinycolor@4.2.2/node_modules/@ctrl/tinycolor/dist/module/index.js
|
|
723
732
|
var Oe = class e {
|
|
@@ -745,14 +754,14 @@ var Oe = class e {
|
|
|
745
754
|
return this.a;
|
|
746
755
|
}
|
|
747
756
|
setAlpha(e) {
|
|
748
|
-
return this.a =
|
|
757
|
+
return this.a = L(e), this.roundA = Math.round(100 * this.a) / 100, this;
|
|
749
758
|
}
|
|
750
759
|
isMonochrome() {
|
|
751
760
|
let { s: e } = this.toHsl();
|
|
752
761
|
return e === 0;
|
|
753
762
|
}
|
|
754
763
|
toHsv() {
|
|
755
|
-
let e =
|
|
764
|
+
let e = V(this.r, this.g, this.b);
|
|
756
765
|
return {
|
|
757
766
|
h: e.h * 360,
|
|
758
767
|
s: e.s,
|
|
@@ -761,11 +770,11 @@ var Oe = class e {
|
|
|
761
770
|
};
|
|
762
771
|
}
|
|
763
772
|
toHsvString() {
|
|
764
|
-
let e =
|
|
773
|
+
let e = V(this.r, this.g, this.b), t = Math.round(e.h * 360), n = Math.round(e.s * 100), r = Math.round(e.v * 100);
|
|
765
774
|
return this.a === 1 ? `hsv(${t}, ${n}%, ${r}%)` : `hsva(${t}, ${n}%, ${r}%, ${this.roundA})`;
|
|
766
775
|
}
|
|
767
776
|
toHsl() {
|
|
768
|
-
let e =
|
|
777
|
+
let e = z(this.r, this.g, this.b);
|
|
769
778
|
return {
|
|
770
779
|
h: e.h * 360,
|
|
771
780
|
s: e.s,
|
|
@@ -774,11 +783,11 @@ var Oe = class e {
|
|
|
774
783
|
};
|
|
775
784
|
}
|
|
776
785
|
toHslString() {
|
|
777
|
-
let e =
|
|
786
|
+
let e = z(this.r, this.g, this.b), t = Math.round(e.h * 360), n = Math.round(e.s * 100), r = Math.round(e.l * 100);
|
|
778
787
|
return this.a === 1 ? `hsl(${t}, ${n}%, ${r}%)` : `hsla(${t}, ${n}%, ${r}%, ${this.roundA})`;
|
|
779
788
|
}
|
|
780
789
|
toHex(e = !1) {
|
|
781
|
-
return
|
|
790
|
+
return W(this.r, this.g, this.b, e);
|
|
782
791
|
}
|
|
783
792
|
toHexString(e = !1) {
|
|
784
793
|
return "#" + this.toHex(e);
|
|
@@ -805,7 +814,7 @@ var Oe = class e {
|
|
|
805
814
|
return this.a === 1 ? `rgb(${e}, ${t}, ${n})` : `rgba(${e}, ${t}, ${n}, ${this.roundA})`;
|
|
806
815
|
}
|
|
807
816
|
toPercentageRgb() {
|
|
808
|
-
let e = (e) => `${Math.round(
|
|
817
|
+
let e = (e) => `${Math.round(P(e, 255) * 100)}%`;
|
|
809
818
|
return {
|
|
810
819
|
r: e(this.r),
|
|
811
820
|
g: e(this.g),
|
|
@@ -814,20 +823,20 @@ var Oe = class e {
|
|
|
814
823
|
};
|
|
815
824
|
}
|
|
816
825
|
toPercentageRgbString() {
|
|
817
|
-
let e = (e) => Math.round(
|
|
826
|
+
let e = (e) => Math.round(P(e, 255) * 100);
|
|
818
827
|
return this.a === 1 ? `rgb(${e(this.r)}%, ${e(this.g)}%, ${e(this.b)}%)` : `rgba(${e(this.r)}%, ${e(this.g)}%, ${e(this.b)}%, ${this.roundA})`;
|
|
819
828
|
}
|
|
820
829
|
toCmyk() {
|
|
821
|
-
return { ...
|
|
830
|
+
return { ...G(this.r, this.g, this.b) };
|
|
822
831
|
}
|
|
823
832
|
toCmykString() {
|
|
824
|
-
let { c: e, m: t, y: n, k: r } =
|
|
833
|
+
let { c: e, m: t, y: n, k: r } = G(this.r, this.g, this.b);
|
|
825
834
|
return `cmyk(${e}, ${t}, ${n}, ${r})`;
|
|
826
835
|
}
|
|
827
836
|
toName() {
|
|
828
837
|
if (this.a === 0) return "transparent";
|
|
829
838
|
if (this.a < 1) return !1;
|
|
830
|
-
let e = "#" +
|
|
839
|
+
let e = "#" + W(this.r, this.g, this.b, !1), t = K;
|
|
831
840
|
for (let n in t) if (Object.prototype.hasOwnProperty.call(t, n) && t[n] === e) return n;
|
|
832
841
|
return !1;
|
|
833
842
|
}
|
|
@@ -845,7 +854,7 @@ var Oe = class e {
|
|
|
845
854
|
}
|
|
846
855
|
lighten(t = 10) {
|
|
847
856
|
let n = this.toHsl();
|
|
848
|
-
return n.l += t / 100, n.l =
|
|
857
|
+
return n.l += t / 100, n.l = F(n.l), new e(n);
|
|
849
858
|
}
|
|
850
859
|
brighten(t = 10) {
|
|
851
860
|
let n = this.toRgb();
|
|
@@ -853,7 +862,7 @@ var Oe = class e {
|
|
|
853
862
|
}
|
|
854
863
|
darken(t = 10) {
|
|
855
864
|
let n = this.toHsl();
|
|
856
|
-
return n.l -= t / 100, n.l =
|
|
865
|
+
return n.l -= t / 100, n.l = F(n.l), new e(n);
|
|
857
866
|
}
|
|
858
867
|
tint(e = 10) {
|
|
859
868
|
return this.mix("white", e);
|
|
@@ -863,11 +872,11 @@ var Oe = class e {
|
|
|
863
872
|
}
|
|
864
873
|
desaturate(t = 10) {
|
|
865
874
|
let n = this.toHsl();
|
|
866
|
-
return n.s -= t / 100, n.s =
|
|
875
|
+
return n.s -= t / 100, n.s = F(n.s), new e(n);
|
|
867
876
|
}
|
|
868
877
|
saturate(t = 10) {
|
|
869
878
|
let n = this.toHsl();
|
|
870
|
-
return n.s += t / 100, n.s =
|
|
879
|
+
return n.s += t / 100, n.s = F(n.s), new e(n);
|
|
871
880
|
}
|
|
872
881
|
greyscale() {
|
|
873
882
|
return this.desaturate(100);
|
|
@@ -947,7 +956,7 @@ var Oe = class e {
|
|
|
947
956
|
let n = new e(t);
|
|
948
957
|
return this.format === "cmyk" || n.format === "cmyk" ? this.toCmykString() === n.toCmykString() : this.toRgbString() === n.toRgbString();
|
|
949
958
|
}
|
|
950
|
-
},
|
|
959
|
+
}, $ = [
|
|
951
960
|
"#458FFF",
|
|
952
961
|
"#45D9A3",
|
|
953
962
|
"#FFC145",
|
|
@@ -990,8 +999,8 @@ var Oe = class e {
|
|
|
990
999
|
"#689FFF",
|
|
991
1000
|
"#45D9A3",
|
|
992
1001
|
"#99ACD1"
|
|
993
|
-
],
|
|
994
|
-
color:
|
|
1002
|
+
], je = {
|
|
1003
|
+
color: $,
|
|
995
1004
|
textStyle: {
|
|
996
1005
|
color: "#6F7785",
|
|
997
1006
|
fontSize: "12px"
|
|
@@ -1044,6 +1053,7 @@ var Oe = class e {
|
|
|
1044
1053
|
}
|
|
1045
1054
|
},
|
|
1046
1055
|
tooltip: {
|
|
1056
|
+
backgroundColor: "rgba(251, 253, 255, 0.88)",
|
|
1047
1057
|
borderWidth: 0,
|
|
1048
1058
|
padding: 12,
|
|
1049
1059
|
textStyle: { color: "#2F3540" },
|
|
@@ -1088,29 +1098,29 @@ var Oe = class e {
|
|
|
1088
1098
|
dataZoom: { height: 16 }
|
|
1089
1099
|
};
|
|
1090
1100
|
// utils/index.ts
|
|
1091
|
-
function
|
|
1101
|
+
function Me(e) {
|
|
1092
1102
|
return !!(e && e.xAxis && e.xAxis.data);
|
|
1093
1103
|
}
|
|
1094
|
-
function
|
|
1095
|
-
return
|
|
1104
|
+
function Ne(e, t) {
|
|
1105
|
+
return p ? {
|
|
1096
1106
|
attrs: { ...e },
|
|
1097
1107
|
on: { ...t }
|
|
1098
1108
|
} : { ...e };
|
|
1099
1109
|
}
|
|
1100
|
-
function
|
|
1110
|
+
function Pe(e) {
|
|
1101
1111
|
return Object.entries(e).reduce((e, [t, n]) => (n !== void 0 && (e[t] = n), e), {});
|
|
1102
1112
|
}
|
|
1103
|
-
function
|
|
1104
|
-
return
|
|
1113
|
+
function Fe(e) {
|
|
1114
|
+
return w(e) ? [] : Array.isArray(e) ? e : [e];
|
|
1105
1115
|
}
|
|
1106
|
-
var
|
|
1107
|
-
function
|
|
1108
|
-
return x(t), b("seer",
|
|
1116
|
+
var Ie = (e, t) => new Oe(e).setAlpha(t).toRgbString();
|
|
1117
|
+
function Le(e, t) {
|
|
1118
|
+
return x(t), b("seer", je), e.install = (t) => {
|
|
1109
1119
|
t.component(e.name, e);
|
|
1110
1120
|
}, e;
|
|
1111
1121
|
}
|
|
1112
1122
|
// components/index.ts
|
|
1113
|
-
var
|
|
1123
|
+
var Re = Le(me, [
|
|
1114
1124
|
e,
|
|
1115
1125
|
n,
|
|
1116
1126
|
t,
|
|
@@ -1120,4 +1130,4 @@ var Ie = $(me, [
|
|
|
1120
1130
|
o,
|
|
1121
1131
|
s
|
|
1122
1132
|
]);
|
|
1123
|
-
export {
|
|
1133
|
+
export { E as CHART_THEME_TOKEN, Re as IxChart, Fe as convertArray, Le as createInstall, Pe as filterEmptyProps, Ie as getAlphaColor, Me as isVertical, Ne as mergeAttrs, $ as seerColors, ke as seerColorsForMore, Ae as seerColorsForRisk, je as seerTheme, O as useChart, M as useReactiveAttrs, j as useStripe, fe as useStripeArea, de as useStripeBarSeries, ue as useStripeBarTooltip, A as useTooltipsFormatter, N as withChartProps };
|
package/dist/index.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("echarts/components"),require("echarts/features"),require("echarts/renderers"),require("vue-demi"),require("echarts/charts"),require("echarts/core"),require("lodash-es")):typeof define==`function`&&define.amd?define([`exports`,`echarts/components`,`echarts/features`,`echarts/renderers`,`vue-demi`,`echarts/charts`,`echarts/core`,`lodash-es`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.IduxChartsCore={},e.echarts,e.echarts,e.echarts,e.VueDemi,e.echarts,e.echarts,e._))})(this,function(e,t,n,r,i,a,o,s){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function c(e,t,n){(0,i.watch)([e,t,n],([e,n,r],i,a)=>{if(!e||!n||!r)return;let o,s=()=>{o===void 0&&(o=requestAnimationFrame(()=>{o=void 0,t.value===n&&n.resize()}))};u(e,s),a(()=>{d(e,s),o!==void 0&&cancelAnimationFrame(o)})})}var l=new Map;function u(e,t,n){if(e&&t){if(l.has(e))l.get(e).listeners.push(t);else{let r=[t],i=new ResizeObserver(e=>{e.forEach(e=>r.forEach(t=>t(e)))});i.observe(e,n),l.set(e,{listeners:r,ro:i})}}}function d(e,t){if(!e||!t||!l.has(e))return;let{listeners:n,ro:r}=l.get(e),i=n.indexOf(t);i>-1&&(n.splice(i,1),n.length===0&&(r.disconnect(),l.delete(e)))}(0,o.use)([a.PictorialBarChart]);var
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("echarts/components"),require("echarts/features"),require("echarts/renderers"),require("vue-demi"),require("echarts/charts"),require("echarts/core"),require("lodash-es")):typeof define==`function`&&define.amd?define([`exports`,`echarts/components`,`echarts/features`,`echarts/renderers`,`vue-demi`,`echarts/charts`,`echarts/core`,`lodash-es`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.IduxChartsCore={},e.echarts,e.echarts,e.echarts,e.VueDemi,e.echarts,e.echarts,e._))})(this,function(e,t,n,r,i,a,o,s){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function c(e,t,n){(0,i.watch)([e,t,n],([e,n,r],i,a)=>{if(!e||!n||!r)return;let o,s=()=>{o===void 0&&(o=requestAnimationFrame(()=>{o=void 0,t.value===n&&n.resize()}))};u(e,s),a(()=>{d(e,s),o!==void 0&&cancelAnimationFrame(o)})})}var l=new Map;function u(e,t,n){if(e&&t){if(l.has(e))l.get(e).listeners.push(t);else{let r=[t],i=new ResizeObserver(e=>{e.forEach(e=>r.forEach(t=>t(e)))});i.observe(e,n),l.set(e,{listeners:r,ro:i})}}}function d(e,t){if(!e||!t||!l.has(e))return;let{listeners:n,ro:r}=l.get(e),i=n.indexOf(t);i>-1&&(n.splice(i,1),n.length===0&&(r.disconnect(),l.delete(e)))}var f=Symbol(`CHART_THEME_TOKEN`);(0,o.use)([a.PictorialBarChart]);var p={text:`加载中...`};function m(e,t){let n=()=>typeof t==`function`?t():t,r=(0,i.shallowRef)(),a=(0,i.shallowRef)(),l=(0,i.shallowRef)(),u=(0,i.computed)(()=>(0,i.unref)(e).autoResize??!0),d=(0,i.computed)(()=>(0,i.unref)(e).group),m=(0,i.computed)(()=>(0,i.unref)(e).initOption),h=(0,i.computed)(()=>(0,i.unref)(e).loading),g=(0,i.computed)(()=>(0,i.unref)(e).setOptionOpts),v=(0,i.inject)(f,void 0),y=(0,i.computed)(()=>(0,i.unref)(e).theme??(0,i.unref)(v)??`seer`),b=[],x=(e,t)=>{b=b.filter(n=>{let r=t.some(([e,t,r])=>e===n.name&&t===n.handler&&r===n.once);return r||e.off(n.name,n.wrapped),r}),t.forEach(([t,n,r])=>{if(b.some(e=>e.name===t&&e.handler===n&&e.once===r))return;let i=(...a)=>{r&&e.off(t,i),n(...a)};b.push({name:t,handler:n,once:r,wrapped:i}),e.on(t,i)})},S=()=>{let t=r.value;if(!t)return;let c=(0,o.init)(t,y.value,m.value),u=(0,i.unref)(e),{restOptions:d,events:f}=_(u,n(),!1);c.setOption(d,g.value),l.value=(0,s.cloneDeep)(d),x(c,f);let p=u.onReady||n()?.ready;p&&p(c),a.value=c},C=()=>{a.value&&(a.value.dispose(),a.value=void 0,b=[])};return(0,i.onMounted)(()=>S()),(0,i.onBeforeUnmount)(()=>C()),(0,i.onUpdated)(()=>{a.value&&x(a.value,_((0,i.unref)(e),n(),!1).events)}),(0,i.watch)(()=>(0,i.unref)(e),e=>{let t=a.value;if(!t)return;let{restOptions:r,events:i}=_(e,n(),!1);x(t,i),(0,s.isEqual)(r,l.value)||(t.setOption(r,g.value),l.value=(0,s.cloneDeep)(r))},{deep:!0}),(0,i.watch)([()=>(0,s.cloneDeep)(y.value),()=>(0,s.cloneDeep)(m.value)],([e,t],[n,r])=>{(0,s.isEqual)(e,n)&&(0,s.isEqual)(t,r)||(C(),S())}),(0,i.watchEffect)(()=>{let e=d.value;a.value&&(a.value.group=e??``)}),(0,i.watchEffect)(()=>{let e=a.value;if(!e)return;let t=h.value;if(t){let n=e.getOption().darkMode===!0?{...p,textColor:`#F4F8FF`,maskColor:`rgba(10, 12, 15, 0.8)`}:p;e.showLoading((0,s.isBoolean)(t)?n:{...n,...t})}else e.hideLoading()}),c(r,a,u),{containerRef:r,chartRef:a}}function h(e){return/^on[^a-z]/.test(e)}var g=[`class`,`style`,`autoResize`,`initOption`,`group`,`loading`,`setOptionOpts`,`theme`,`onReady`];function _(e,t={},n=!0){let r={},a=[];return Object.keys(e).forEach(t=>{if(!g.includes(t)){if(h(t)){if(n)return;let r=e[t];if(r){let e=t.endsWith(`Once`),n=e?t.length-4:void 0,i=t.charAt(2).toLowerCase()+t.substring(3,n);a.push([i,r,e])}}else r[t]=e[t]}}),i.isVue2&&!n&&Object.keys(t).forEach(e=>{if(e===`ready`||e===`~ready`)return;let n=t[e];if(n){let t=e.startsWith(`~`),r=+!!t,i=e.substring(r);a.push([i,n,t])}}),{restOptions:r,events:a}}function v(e,t){return`
|
|
2
2
|
<div class="charts-tooltips">
|
|
3
3
|
<div class="charts-tooltips-title">${e}</div>
|
|
4
4
|
${t.map(e=>`
|
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
<span class="charts-tooltips-item-name">${e.name}</span>
|
|
8
8
|
<span class="charts-tooltips-item-value">${e.value}</span>
|
|
9
9
|
</div>`).join(``)}
|
|
10
|
-
</div>`}function v({data:e=[],color:t=``,offset:n=[0,0],rotate:r=-20,size:i=[2,8]}){return{name:``,data:e,type:`pictorialBar`,symbolRotate:r,silent:!0,itemStyle:{color:t,opacity:0},emphasis:{itemStyle:{opacity:1}},symbolRepeat:`fixed`,symbolMargin:2,symbol:`rect`,symbolClip:!0,symbolSize:i,symbolPosition:`start`,symbolOffset:n,z:1,animationEasing:`elasticOut`}}function y(e){return{axisPointer:{lineStyle:{opacity:.6}},formatter:function(t){if(!t?.length)return``;let n=t[0].name;return _(n,t.filter(e=>!!e.seriesName).map(t=>({name:t.seriesName,value:`${t.value} ${e}`,color:t.color})))}}}function b({series:e,color:t,offset:n=[0,0],rotate:r,size:i}){return[{type:`bar`,z:0,...e},v({data:e.data,offset:n,color:t,rotate:r,size:i})]}function x(){return{aria:{enabled:!0,decal:{show:!0,decals:[{color:`white`,dashArrayX:[1,0],dashArrayY:[6,0],symbolSize:.5,rotation:Math.PI/2}]}}}}var S={"auto-resize":`autoResize`,"init-option":`initOption`,"set-option-opts":`setOptionOpts`};function C(e){let t=(0,i.getCurrentInstance)()?.proxy,n=()=>Object.fromEntries(Object.entries(i.isVue2&&t?t.$attrs:e).map(([e,t])=>[S[e]??e,t]));if(i.isVue2&&t)return(0,i.computed)(n);let r=(0,i.shallowRef)(n());return(0,i.onBeforeUpdate)(()=>{let e=n(),t=r.value;(Object.keys(t).length!==Object.keys(e).length||Object.keys(e).some(n=>!Object.is(t[n],e[n])))&&(r.value=e)}),r}function w(){return e=>e}var ee=w()((0,i.defineComponent)({name:`IxChart`,inheritAttrs:!1,setup(e,t){let{containerRef:n}=p(C(t.attrs),()=>t.listeners??{});return{containerRef:n}},render(){let{class:e,style:t}=this.$attrs;return(0,i.h)(`div`,{ref:`containerRef`,class:e,style:{width:`100%`,height:`100%`,...t}})}}));function T(e,t){D(e)&&(e=`100%`);let n=O(e);return e=t===360?parseFloat(e):Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(e=t===360?(e<0?e%t+t:e%t)/t:e%t/t,e)}function E(e){return Math.min(1,Math.max(0,e))}function D(e){return typeof e==`string`&&e.indexOf(`.`)!==-1&&!O(e)&&parseFloat(e)===1}function O(e){return typeof e==`string`&&e.indexOf(`%`)!==-1}function k(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function A(e){return Number(e)<=1?`${Number(e)*100}%`:e}function j(e){if(typeof e!=`number`||!(e<=1))return A(e);let t=Math.min(100,Math.max(0,e*100))*100;return(t>=1e-6?Math.trunc(t):parseInt(String(t),10))/100}function M(e){return e.length===1?`0`+e:String(e)}function te(e,t,n){return{r:T(e,255)*255,g:T(t,255)*255,b:T(n,255)*255}}function N(e,t,n){e=T(e,255),t=T(t,255),n=T(n,255);let r=Math.max(e,t,n),i=Math.min(e,t,n),a=0,o,s=(r+i)/2;if(r===i)o=0,a=0;else{let c=r-i;switch(o=s>.5?c/(2-r-i):c/(r+i),r){case e:a=(t-n)/c+(t<n?6:0);break;case t:a=(n-e)/c+2;break;case n:a=(e-t)/c+4}a/=6}return{h:a,s:o,l:s}}function P(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*(6*n):n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function ne(e,t,n){let r,i,a;if(e=T(e,360),t=T(t,100),n=T(n,100),t===0)i=n,a=n,r=n;else{let o=n<.5?n*(1+t):n+t-n*t,s=2*n-o;r=P(s,o,e+1/3),i=P(s,o,e),a=P(s,o,e-1/3)}return{r:r*255,g:i*255,b:a*255}}function F(e,t,n){e=T(e,255),t=T(t,255),n=T(n,255);let r=Math.max(e,t,n),i=Math.min(e,t,n),a=0,o=r,s=r-i,c=r===0?0:s/r;if(r===i)a=0;else{switch(r){case e:a=(t-n)/s+(t<n?6:0);break;case t:a=(n-e)/s+2;break;case n:a=(e-t)/s+4}a/=6}return{h:a,s:c,v:o}}function I(e,t,n){e=T(e,360)*6,t=T(t,100),n=T(n,100);let r=Math.floor(e),i=e-r,a=n*(1-t),o=n*(1-i*t),s=n*(1-(1-i)*t),c=r%6,l=[n,o,a,a,s,n][c],u=[s,n,n,o,a,a][c],d=[a,a,s,n,n,o][c];return{r:l*255,g:u*255,b:d*255}}function L(e){return e<10?48+e:87+e}function R(e){let t=Math.round(e);return t>=0&&t<=255?String.fromCharCode(L(t>>4),L(t&15)):M(t.toString(16))}function z(e){return R(parseFloat(e)*255)}function B(e,t,n,r){let i=R(e),a=R(t),o=R(n);return r&&i.startsWith(i.charAt(1))&&a.startsWith(a.charAt(1))&&o.startsWith(o.charAt(1))?i.charAt(0)+a.charAt(0)+o.charAt(0):i+a+o}function re(e,t,n,r,i){let a=R(e),o=R(t),s=R(n),c=z(r);return i&&a.startsWith(a.charAt(1))&&o.startsWith(o.charAt(1))&&s.startsWith(s.charAt(1))&&c.startsWith(c.charAt(1))?a.charAt(0)+o.charAt(0)+s.charAt(0)+c.charAt(0):a+o+s+c}function ie(e,t,n,r){let i=e/100,a=t/100,o=n/100,s=r/100;return{r:255*(1-i)*(1-s),g:255*(1-a)*(1-s),b:255*(1-o)*(1-s)}}function V(e,t,n){let r=1-e/255,i=1-t/255,a=1-n/255,o=Math.min(r,i,a);return o===1?(r=0,i=0,a=0):(r=(r-o)/(1-o)*100,i=(i-o)/(1-o)*100,a=(a-o)/(1-o)*100),o*=100,{c:Math.round(r),m:Math.round(i),y:Math.round(a),k:Math.round(o)}}function H(e){return{r:e>>16,g:(e&65280)>>8,b:e&255}}var U={aliceblue:`#f0f8ff`,antiquewhite:`#faebd7`,aqua:`#00ffff`,aquamarine:`#7fffd4`,azure:`#f0ffff`,beige:`#f5f5dc`,bisque:`#ffe4c4`,black:`#000000`,blanchedalmond:`#ffebcd`,blue:`#0000ff`,blueviolet:`#8a2be2`,brown:`#a52a2a`,burlywood:`#deb887`,cadetblue:`#5f9ea0`,chartreuse:`#7fff00`,chocolate:`#d2691e`,coral:`#ff7f50`,cornflowerblue:`#6495ed`,cornsilk:`#fff8dc`,crimson:`#dc143c`,cyan:`#00ffff`,darkblue:`#00008b`,darkcyan:`#008b8b`,darkgoldenrod:`#b8860b`,darkgray:`#a9a9a9`,darkgreen:`#006400`,darkgrey:`#a9a9a9`,darkkhaki:`#bdb76b`,darkmagenta:`#8b008b`,darkolivegreen:`#556b2f`,darkorange:`#ff8c00`,darkorchid:`#9932cc`,darkred:`#8b0000`,darksalmon:`#e9967a`,darkseagreen:`#8fbc8f`,darkslateblue:`#483d8b`,darkslategray:`#2f4f4f`,darkslategrey:`#2f4f4f`,darkturquoise:`#00ced1`,darkviolet:`#9400d3`,deeppink:`#ff1493`,deepskyblue:`#00bfff`,dimgray:`#696969`,dimgrey:`#696969`,dodgerblue:`#1e90ff`,firebrick:`#b22222`,floralwhite:`#fffaf0`,forestgreen:`#228b22`,fuchsia:`#ff00ff`,gainsboro:`#dcdcdc`,ghostwhite:`#f8f8ff`,goldenrod:`#daa520`,gold:`#ffd700`,gray:`#808080`,green:`#008000`,greenyellow:`#adff2f`,grey:`#808080`,honeydew:`#f0fff0`,hotpink:`#ff69b4`,indianred:`#cd5c5c`,indigo:`#4b0082`,ivory:`#fffff0`,khaki:`#f0e68c`,lavenderblush:`#fff0f5`,lavender:`#e6e6fa`,lawngreen:`#7cfc00`,lemonchiffon:`#fffacd`,lightblue:`#add8e6`,lightcoral:`#f08080`,lightcyan:`#e0ffff`,lightgoldenrodyellow:`#fafad2`,lightgray:`#d3d3d3`,lightgreen:`#90ee90`,lightgrey:`#d3d3d3`,lightpink:`#ffb6c1`,lightsalmon:`#ffa07a`,lightseagreen:`#20b2aa`,lightskyblue:`#87cefa`,lightslategray:`#778899`,lightslategrey:`#778899`,lightsteelblue:`#b0c4de`,lightyellow:`#ffffe0`,lime:`#00ff00`,limegreen:`#32cd32`,linen:`#faf0e6`,magenta:`#ff00ff`,maroon:`#800000`,mediumaquamarine:`#66cdaa`,mediumblue:`#0000cd`,mediumorchid:`#ba55d3`,mediumpurple:`#9370db`,mediumseagreen:`#3cb371`,mediumslateblue:`#7b68ee`,mediumspringgreen:`#00fa9a`,mediumturquoise:`#48d1cc`,mediumvioletred:`#c71585`,midnightblue:`#191970`,mintcream:`#f5fffa`,mistyrose:`#ffe4e1`,moccasin:`#ffe4b5`,navajowhite:`#ffdead`,navy:`#000080`,oldlace:`#fdf5e6`,olive:`#808000`,olivedrab:`#6b8e23`,orange:`#ffa500`,orangered:`#ff4500`,orchid:`#da70d6`,palegoldenrod:`#eee8aa`,palegreen:`#98fb98`,paleturquoise:`#afeeee`,palevioletred:`#db7093`,papayawhip:`#ffefd5`,peachpuff:`#ffdab9`,peru:`#cd853f`,pink:`#ffc0cb`,plum:`#dda0dd`,powderblue:`#b0e0e6`,purple:`#800080`,rebeccapurple:`#663399`,red:`#ff0000`,rosybrown:`#bc8f8f`,royalblue:`#4169e1`,saddlebrown:`#8b4513`,salmon:`#fa8072`,sandybrown:`#f4a460`,seagreen:`#2e8b57`,seashell:`#fff5ee`,sienna:`#a0522d`,silver:`#c0c0c0`,skyblue:`#87ceeb`,slateblue:`#6a5acd`,slategray:`#708090`,slategrey:`#708090`,snow:`#fffafa`,springgreen:`#00ff7f`,steelblue:`#4682b4`,tan:`#d2b48c`,teal:`#008080`,thistle:`#d8bfd8`,tomato:`#ff6347`,turquoise:`#40e0d0`,violet:`#ee82ee`,wheat:`#f5deb3`,white:`#ffffff`,whitesmoke:`#f5f5f5`,yellow:`#ffff00`,yellowgreen:`#9acd32`};function W(e){let t={r:0,g:0,b:0},n=1,r=!1,i=!1;if(typeof e==`string`&&(e=ae(e)),typeof e==`object`){if(X(e.r)&&X(e.g)&&X(e.b)){t=te(e.r,e.g,e.b),r=!0;let{r:n}=e;i=typeof n!=`number`&&String(n).endsWith(`%`)?`prgb`:`rgb`}else if(X(e.h)&&X(e.s)&&X(e.v)){let n=j(e.s),a=j(e.v);t=I(e.h,n,a),r=!0,i=`hsv`}else if(X(e.h)&&X(e.s)&&X(e.l)){let n=j(e.s),a=j(e.l);t=ne(e.h,n,a),r=!0,i=`hsl`}else X(e.c)&&X(e.m)&&X(e.y)&&X(e.k)&&(t=ie(e.c,e.m,e.y,e.k),r=!0,i=`cmyk`);Object.prototype.hasOwnProperty.call(e,`a`)&&(n=e.a)}return n=k(n),{ok:r,format:e.format||i,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}var G=`(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)`,K=`[\\s|\\(]+(`+G+`)[,|\\s]+(`+G+`)[,|\\s]+(`+G+`)\\s*\\)?`,q=`[\\s|\\(]+(`+G+`)[,|\\s]+(`+G+`)[,|\\s]+(`+G+`)[,|\\s]+(`+G+`)\\s*\\)?`,J={CSS_UNIT:new RegExp(G),rgb:RegExp(`rgb`+K),rgba:RegExp(`rgba`+q),hsl:RegExp(`hsl`+K),hsla:RegExp(`hsla`+q),hsv:RegExp(`hsv`+K),hsva:RegExp(`hsva`+q),cmyk:RegExp(`cmyk`+q)};function ae(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;let t=!1;if(U[e])e=U[e],t=!0;else if(e===`transparent`)return{r:0,g:0,b:0,a:0,format:`name`};if(typeof e==`string`&&e.length<=9){let n=oe(e,t);if(n)return n}let n=J.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=J.rgba.exec(e),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=J.hsl.exec(e),n?{h:n[1],s:n[2],l:n[3]}:(n=J.hsla.exec(e),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=J.hsv.exec(e),n?{h:n[1],s:n[2],v:n[3]}:(n=J.hsva.exec(e),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=J.cmyk.exec(e),n?{c:n[1],m:n[2],y:n[3],k:n[4]}:!1))))))}function oe(e,t){let n=+!!e.startsWith(`#`),r=e.length-n;if(r===6||r===8){let i=Y(e,n)*16+Y(e,n+1),a=Y(e,n+2)*16+Y(e,n+3),o=Y(e,n+4)*16+Y(e,n+5);if(r===6)return Number.isNaN(i+a+o)?void 0:{r:i,g:a,b:o,format:t?`name`:`hex`};let s=Y(e,n+6)*16+Y(e,n+7);return Number.isNaN(i+a+o+s)?void 0:{r:i,g:a,b:o,a:s/255,format:t?`name`:`hex8`}}if(r===3||r===4){let i=Y(e,n)*17,a=Y(e,n+1)*17,o=Y(e,n+2)*17;if(r===3)return Number.isNaN(i+a+o)?void 0:{r:i,g:a,b:o,format:t?`name`:`hex`};let s=Y(e,n+3)*17;return Number.isNaN(i+a+o+s)?void 0:{r:i,g:a,b:o,a:s/255,format:t?`name`:`hex8`}}}function Y(e,t){let n=e.charCodeAt(t);return n>=48&&n<=57?n-48:n>=97&&n<=102?n-87:n>=65&&n<=70?n-55:NaN}function X(e){return typeof e==`number`?!Number.isNaN(e):e!==void 0&&J.CSS_UNIT.test(e)}var se=class e{constructor(t=``,n={}){if(t instanceof e)return t;typeof t==`number`&&(t=H(t)),this.originalInput=t;let r=W(t);this.originalInput=t,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=n.format??r.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=r.ok}isDark(){return this.getBrightness()<128}isLight(){return!this.isDark()}getBrightness(){let e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3}getLuminance(){let e=this.toRgb(),t,n,r,i=e.r/255,a=e.g/255,o=e.b/255;return t=i<=.03928?i/12.92:((i+.055)/1.055)**2.4,n=a<=.03928?a/12.92:((a+.055)/1.055)**2.4,r=o<=.03928?o/12.92:((o+.055)/1.055)**2.4,.2126*t+.7152*n+.0722*r}getAlpha(){return this.a}setAlpha(e){return this.a=k(e),this.roundA=Math.round(100*this.a)/100,this}isMonochrome(){let{s:e}=this.toHsl();return e===0}toHsv(){let e=F(this.r,this.g,this.b);return{h:e.h*360,s:e.s,v:e.v,a:this.a}}toHsvString(){let e=F(this.r,this.g,this.b),t=Math.round(e.h*360),n=Math.round(e.s*100),r=Math.round(e.v*100);return this.a===1?`hsv(${t}, ${n}%, ${r}%)`:`hsva(${t}, ${n}%, ${r}%, ${this.roundA})`}toHsl(){let e=N(this.r,this.g,this.b);return{h:e.h*360,s:e.s,l:e.l,a:this.a}}toHslString(){let e=N(this.r,this.g,this.b),t=Math.round(e.h*360),n=Math.round(e.s*100),r=Math.round(e.l*100);return this.a===1?`hsl(${t}, ${n}%, ${r}%)`:`hsla(${t}, ${n}%, ${r}%, ${this.roundA})`}toHex(e=!1){return B(this.r,this.g,this.b,e)}toHexString(e=!1){return`#`+this.toHex(e)}toHex8(e=!1){return re(this.r,this.g,this.b,this.a,e)}toHex8String(e=!1){return`#`+this.toHex8(e)}toHexShortString(e=!1){return this.a===1?this.toHexString(e):this.toHex8String(e)}toRgb(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}}toRgbString(){let e=Math.round(this.r),t=Math.round(this.g),n=Math.round(this.b);return this.a===1?`rgb(${e}, ${t}, ${n})`:`rgba(${e}, ${t}, ${n}, ${this.roundA})`}toPercentageRgb(){let e=e=>`${Math.round(T(e,255)*100)}%`;return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}}toPercentageRgbString(){let e=e=>Math.round(T(e,255)*100);return this.a===1?`rgb(${e(this.r)}%, ${e(this.g)}%, ${e(this.b)}%)`:`rgba(${e(this.r)}%, ${e(this.g)}%, ${e(this.b)}%, ${this.roundA})`}toCmyk(){return{...V(this.r,this.g,this.b)}}toCmykString(){let{c:e,m:t,y:n,k:r}=V(this.r,this.g,this.b);return`cmyk(${e}, ${t}, ${n}, ${r})`}toName(){if(this.a===0)return`transparent`;if(this.a<1)return!1;let e=`#`+B(this.r,this.g,this.b,!1),t=U;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&t[n]===e)return n;return!1}toString(e){let t=!!e;e??=this.format;let n=!1,r=this.a<1&&this.a>=0;return!t&&r&&(e.startsWith(`hex`)||e===`name`)?e===`name`&&this.a===0?this.toName():this.toRgbString():(e===`rgb`&&(n=this.toRgbString()),e===`prgb`&&(n=this.toPercentageRgbString()),(e===`hex`||e===`hex6`)&&(n=this.toHexString()),e===`hex3`&&(n=this.toHexString(!0)),e===`hex4`&&(n=this.toHex8String(!0)),e===`hex8`&&(n=this.toHex8String()),e===`name`&&(n=this.toName()),e===`hsl`&&(n=this.toHslString()),e===`hsv`&&(n=this.toHsvString()),e===`cmyk`&&(n=this.toCmykString()),n||this.toHexString())}toNumber(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)}clone(){return new e(this.toString())}lighten(t=10){let n=this.toHsl();return n.l+=t/100,n.l=E(n.l),new e(n)}brighten(t=10){let n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),new e(n)}darken(t=10){let n=this.toHsl();return n.l-=t/100,n.l=E(n.l),new e(n)}tint(e=10){return this.mix(`white`,e)}shade(e=10){return this.mix(`black`,e)}desaturate(t=10){let n=this.toHsl();return n.s-=t/100,n.s=E(n.s),new e(n)}saturate(t=10){let n=this.toHsl();return n.s+=t/100,n.s=E(n.s),new e(n)}greyscale(){return this.desaturate(100)}spin(t){let n=this.toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,new e(n)}mix(t,n=50){let r=this.toRgb(),i=new e(t).toRgb(),a=n/100,o={r:(i.r-r.r)*a+r.r,g:(i.g-r.g)*a+r.g,b:(i.b-r.b)*a+r.b,a:(i.a-r.a)*a+r.a};return new e(o)}analogous(t=6,n=30){let r=this.toHsl(),i=360/n,a=[this];for(r.h=(r.h-(i*t>>1)+720)%360;--t;)r.h=(r.h+i)%360,a.push(new e(r));return a}complement(){let t=this.toHsl();return t.h=(t.h+180)%360,new e(t)}monochromatic(t=6){let n=this.toHsv(),{h:r}=n,{s:i}=n,{v:a}=n,o=[],s=1/t;for(;t--;)o.push(new e({h:r,s:i,v:a})),a=(a+s)%1;return o}splitcomplement(){let t=this.toHsl(),{h:n}=t;return[this,new e({h:(n+72)%360,s:t.s,l:t.l}),new e({h:(n+216)%360,s:t.s,l:t.l})]}onBackground(t){let n=this.toRgb(),r=new e(t).toRgb(),i=n.a+r.a*(1-n.a);return new e({r:(n.r*n.a+r.r*r.a*(1-n.a))/i,g:(n.g*n.a+r.g*r.a*(1-n.a))/i,b:(n.b*n.a+r.b*r.a*(1-n.a))/i,a:i})}triad(){return this.polyad(3)}tetrad(){return this.polyad(4)}polyad(t){let n=this.toHsl(),{h:r}=n,i=[this],a=360/t;for(let o=1;o<t;o++)i.push(new e({h:(r+o*a)%360,s:n.s,l:n.l}));return i}equals(t){let n=new e(t);return this.format===`cmyk`||n.format===`cmyk`?this.toCmykString()===n.toCmykString():this.toRgbString()===n.toRgbString()}},Z=[`#458FFF`,`#45D9A3`,`#FFC145`,`#F5654F`,`#6A6AFD`,`#6ED1FF`,`#008787`,`#FF9245`,`#F587B3`,`#8352CC`,`#65779B`],ce=[`#458FFF`,`#C8DEFF`,`#45D9A3`,`#C8F4E4`,`#FFC145`,`#FFEDC8`,`#F5654F`,`#FCD1CB`,`#6A6AFD`,`#D3D3FE`,`#6ED1FF`,`#D3D3FE`,`#008787`,`#B3DBDB`,`#FF9245`,`#FFDFC8`,`#F587B3`,`#FCDBE8`,`#8352CC`,`#FCDBE8`,`#65779B`,`#65779B`],le=[`#8C1604`,`#DB4C35`,`#FF9245`,`#FFC145`,`#689FFF`,`#45D9A3`,`#99ACD1`],Q={color:Z,textStyle:{color:`#6F7785`,fontSize:`12px`},bar:{barGap:.2,barWidth:10,label:{color:`#6F7785`,position:`top`}},line:{label:{color:`#6F7785`,position:`top`}},pie:{avoidLabelOverlap:!1,radius:[`70%`,`80%`],itemStyle:{borderWidth:1,borderColor:`#fff`},label:{show:!1,color:`#2F3540`,formatter:`{c}`,position:`inside`}},legend:{itemWidth:12,itemHeight:12,inactiveColor:`#BEC3CC`,textStyle:{color:`#6F7785`,fontSize:`12px`}},title:{itemGap:4,textStyle:{color:`#2F3540`,fontSize:`12px`,fontWeight:500},subtextStyle:{color:`#6F7785`,fontSize:`12px`}},tooltip:{borderWidth:0,padding:12,textStyle:{color:`#2F3540`},axisPointer:{z:1,lineStyle:{type:`solid`,color:`#E1E5EB`}}},categoryAxis:{axisLine:{show:!0,lineStyle:{color:`#EDF1F7`}},axisTick:{show:!0,alignWithLabel:!0,lineStyle:{color:`#EDF1F7`}},axisLabel:{color:`#6F7785`},splitLine:{show:!1},splitArea:{show:!1}},valueAxis:{axisLine:{show:!1},axisTick:{show:!1},axisLabel:{color:`#6F7785`},splitLine:{lineStyle:{color:`#EDF1F7`}},splitArea:{show:!1},nameTextStyle:{color:`#6F7785`,padding:[0,30,-4,0]}},dataZoom:{height:16}};function ue(e){return!!(e&&e.xAxis&&e.xAxis.data)}function de(e,t){return i.isVue2?{attrs:{...e},on:{...t}}:{...e}}function fe(e){return Object.entries(e).reduce((e,[t,n])=>(n!==void 0&&(e[t]=n),e),{})}function pe(e){return(0,s.isNil)(e)?[]:Array.isArray(e)?e:[e]}var me=(e,t)=>new se(e).setAlpha(t).toRgbString();function $(e,t){return(0,o.use)(t),(0,o.registerTheme)(`seer`,Q),e.install=t=>{t.component(e.name,e)},e}e.IxChart=$(ee,[t.DataZoomComponent,t.LegendComponent,t.GridComponent,t.TitleComponent,t.TooltipComponent,n.LabelLayout,n.UniversalTransition,r.SVGRenderer]),e.convertArray=pe,e.createInstall=$,e.filterEmptyProps=fe,e.getAlphaColor=me,e.isVertical=ue,e.mergeAttrs=de,e.seerColors=Z,e.seerColorsForMore=ce,e.seerColorsForRisk=le,e.seerTheme=Q,e.useChart=p,e.useReactiveAttrs=C,e.useStripe=v,e.useStripeArea=x,e.useStripeBarSeries=b,e.useStripeBarTooltip=y,e.useTooltipsFormatter=_,e.withChartProps=w});
|
|
10
|
+
</div>`}function y({data:e=[],color:t=``,offset:n=[0,0],rotate:r=-20,size:i=[2,8]}){return{name:``,data:e,type:`pictorialBar`,symbolRotate:r,silent:!0,itemStyle:{color:t,opacity:0},emphasis:{itemStyle:{opacity:1}},symbolRepeat:`fixed`,symbolMargin:2,symbol:`rect`,symbolClip:!0,symbolSize:i,symbolPosition:`start`,symbolOffset:n,z:1,animationEasing:`elasticOut`}}function b(e){return{axisPointer:{lineStyle:{opacity:.6}},formatter:function(t){if(!t?.length)return``;let n=t[0].name;return v(n,t.filter(e=>!!e.seriesName).map(t=>({name:t.seriesName,value:`${t.value} ${e}`,color:t.color})))}}}function x({series:e,color:t,offset:n=[0,0],rotate:r,size:i}){return[{type:`bar`,z:0,...e},y({data:e.data,offset:n,color:t,rotate:r,size:i})]}function S(){return{aria:{enabled:!0,decal:{show:!0,decals:[{color:`white`,dashArrayX:[1,0],dashArrayY:[6,0],symbolSize:.5,rotation:Math.PI/2}]}}}}var C={"auto-resize":`autoResize`,"init-option":`initOption`,"set-option-opts":`setOptionOpts`};function w(e){let t=(0,i.getCurrentInstance)()?.proxy,n=()=>Object.fromEntries(Object.entries(i.isVue2&&t?t.$attrs:e).map(([e,t])=>[C[e]??e,t]));if(i.isVue2&&t)return(0,i.computed)(n);let r=(0,i.shallowRef)(n());return(0,i.onBeforeUpdate)(()=>{let e=n(),t=r.value;(Object.keys(t).length!==Object.keys(e).length||Object.keys(e).some(n=>!Object.is(t[n],e[n])))&&(r.value=e)}),r}function T(){return e=>e}var E=T()((0,i.defineComponent)({name:`IxChart`,inheritAttrs:!1,setup(e,t){let{containerRef:n}=m(w(t.attrs),()=>t.listeners??{});return{containerRef:n}},render(){let{class:e,style:t}=this.$attrs;return(0,i.h)(`div`,{ref:`containerRef`,class:e,style:{width:`100%`,height:`100%`,...t}})}}));function D(e,t){k(e)&&(e=`100%`);let n=A(e);return e=t===360?parseFloat(e):Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(e=t===360?(e<0?e%t+t:e%t)/t:e%t/t,e)}function O(e){return Math.min(1,Math.max(0,e))}function k(e){return typeof e==`string`&&e.indexOf(`.`)!==-1&&!A(e)&&parseFloat(e)===1}function A(e){return typeof e==`string`&&e.indexOf(`%`)!==-1}function j(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function ee(e){return Number(e)<=1?`${Number(e)*100}%`:e}function M(e){if(typeof e!=`number`||!(e<=1))return ee(e);let t=Math.min(100,Math.max(0,e*100))*100;return(t>=1e-6?Math.trunc(t):parseInt(String(t),10))/100}function te(e){return e.length===1?`0`+e:String(e)}function ne(e,t,n){return{r:D(e,255)*255,g:D(t,255)*255,b:D(n,255)*255}}function N(e,t,n){e=D(e,255),t=D(t,255),n=D(n,255);let r=Math.max(e,t,n),i=Math.min(e,t,n),a=0,o,s=(r+i)/2;if(r===i)o=0,a=0;else{let c=r-i;switch(o=s>.5?c/(2-r-i):c/(r+i),r){case e:a=(t-n)/c+(t<n?6:0);break;case t:a=(n-e)/c+2;break;case n:a=(e-t)/c+4}a/=6}return{h:a,s:o,l:s}}function P(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*(6*n):n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function F(e,t,n){let r,i,a;if(e=D(e,360),t=D(t,100),n=D(n,100),t===0)i=n,a=n,r=n;else{let o=n<.5?n*(1+t):n+t-n*t,s=2*n-o;r=P(s,o,e+1/3),i=P(s,o,e),a=P(s,o,e-1/3)}return{r:r*255,g:i*255,b:a*255}}function I(e,t,n){e=D(e,255),t=D(t,255),n=D(n,255);let r=Math.max(e,t,n),i=Math.min(e,t,n),a=0,o=r,s=r-i,c=r===0?0:s/r;if(r===i)a=0;else{switch(r){case e:a=(t-n)/s+(t<n?6:0);break;case t:a=(n-e)/s+2;break;case n:a=(e-t)/s+4}a/=6}return{h:a,s:c,v:o}}function re(e,t,n){e=D(e,360)*6,t=D(t,100),n=D(n,100);let r=Math.floor(e),i=e-r,a=n*(1-t),o=n*(1-i*t),s=n*(1-(1-i)*t),c=r%6,l=[n,o,a,a,s,n][c],u=[s,n,n,o,a,a][c],d=[a,a,s,n,n,o][c];return{r:l*255,g:u*255,b:d*255}}function L(e){return e<10?48+e:87+e}function R(e){let t=Math.round(e);return t>=0&&t<=255?String.fromCharCode(L(t>>4),L(t&15)):te(t.toString(16))}function z(e){return R(parseFloat(e)*255)}function B(e,t,n,r){let i=R(e),a=R(t),o=R(n);return r&&i.startsWith(i.charAt(1))&&a.startsWith(a.charAt(1))&&o.startsWith(o.charAt(1))?i.charAt(0)+a.charAt(0)+o.charAt(0):i+a+o}function V(e,t,n,r,i){let a=R(e),o=R(t),s=R(n),c=z(r);return i&&a.startsWith(a.charAt(1))&&o.startsWith(o.charAt(1))&&s.startsWith(s.charAt(1))&&c.startsWith(c.charAt(1))?a.charAt(0)+o.charAt(0)+s.charAt(0)+c.charAt(0):a+o+s+c}function ie(e,t,n,r){let i=e/100,a=t/100,o=n/100,s=r/100;return{r:255*(1-i)*(1-s),g:255*(1-a)*(1-s),b:255*(1-o)*(1-s)}}function H(e,t,n){let r=1-e/255,i=1-t/255,a=1-n/255,o=Math.min(r,i,a);return o===1?(r=0,i=0,a=0):(r=(r-o)/(1-o)*100,i=(i-o)/(1-o)*100,a=(a-o)/(1-o)*100),o*=100,{c:Math.round(r),m:Math.round(i),y:Math.round(a),k:Math.round(o)}}function ae(e){return{r:e>>16,g:(e&65280)>>8,b:e&255}}var U={aliceblue:`#f0f8ff`,antiquewhite:`#faebd7`,aqua:`#00ffff`,aquamarine:`#7fffd4`,azure:`#f0ffff`,beige:`#f5f5dc`,bisque:`#ffe4c4`,black:`#000000`,blanchedalmond:`#ffebcd`,blue:`#0000ff`,blueviolet:`#8a2be2`,brown:`#a52a2a`,burlywood:`#deb887`,cadetblue:`#5f9ea0`,chartreuse:`#7fff00`,chocolate:`#d2691e`,coral:`#ff7f50`,cornflowerblue:`#6495ed`,cornsilk:`#fff8dc`,crimson:`#dc143c`,cyan:`#00ffff`,darkblue:`#00008b`,darkcyan:`#008b8b`,darkgoldenrod:`#b8860b`,darkgray:`#a9a9a9`,darkgreen:`#006400`,darkgrey:`#a9a9a9`,darkkhaki:`#bdb76b`,darkmagenta:`#8b008b`,darkolivegreen:`#556b2f`,darkorange:`#ff8c00`,darkorchid:`#9932cc`,darkred:`#8b0000`,darksalmon:`#e9967a`,darkseagreen:`#8fbc8f`,darkslateblue:`#483d8b`,darkslategray:`#2f4f4f`,darkslategrey:`#2f4f4f`,darkturquoise:`#00ced1`,darkviolet:`#9400d3`,deeppink:`#ff1493`,deepskyblue:`#00bfff`,dimgray:`#696969`,dimgrey:`#696969`,dodgerblue:`#1e90ff`,firebrick:`#b22222`,floralwhite:`#fffaf0`,forestgreen:`#228b22`,fuchsia:`#ff00ff`,gainsboro:`#dcdcdc`,ghostwhite:`#f8f8ff`,goldenrod:`#daa520`,gold:`#ffd700`,gray:`#808080`,green:`#008000`,greenyellow:`#adff2f`,grey:`#808080`,honeydew:`#f0fff0`,hotpink:`#ff69b4`,indianred:`#cd5c5c`,indigo:`#4b0082`,ivory:`#fffff0`,khaki:`#f0e68c`,lavenderblush:`#fff0f5`,lavender:`#e6e6fa`,lawngreen:`#7cfc00`,lemonchiffon:`#fffacd`,lightblue:`#add8e6`,lightcoral:`#f08080`,lightcyan:`#e0ffff`,lightgoldenrodyellow:`#fafad2`,lightgray:`#d3d3d3`,lightgreen:`#90ee90`,lightgrey:`#d3d3d3`,lightpink:`#ffb6c1`,lightsalmon:`#ffa07a`,lightseagreen:`#20b2aa`,lightskyblue:`#87cefa`,lightslategray:`#778899`,lightslategrey:`#778899`,lightsteelblue:`#b0c4de`,lightyellow:`#ffffe0`,lime:`#00ff00`,limegreen:`#32cd32`,linen:`#faf0e6`,magenta:`#ff00ff`,maroon:`#800000`,mediumaquamarine:`#66cdaa`,mediumblue:`#0000cd`,mediumorchid:`#ba55d3`,mediumpurple:`#9370db`,mediumseagreen:`#3cb371`,mediumslateblue:`#7b68ee`,mediumspringgreen:`#00fa9a`,mediumturquoise:`#48d1cc`,mediumvioletred:`#c71585`,midnightblue:`#191970`,mintcream:`#f5fffa`,mistyrose:`#ffe4e1`,moccasin:`#ffe4b5`,navajowhite:`#ffdead`,navy:`#000080`,oldlace:`#fdf5e6`,olive:`#808000`,olivedrab:`#6b8e23`,orange:`#ffa500`,orangered:`#ff4500`,orchid:`#da70d6`,palegoldenrod:`#eee8aa`,palegreen:`#98fb98`,paleturquoise:`#afeeee`,palevioletred:`#db7093`,papayawhip:`#ffefd5`,peachpuff:`#ffdab9`,peru:`#cd853f`,pink:`#ffc0cb`,plum:`#dda0dd`,powderblue:`#b0e0e6`,purple:`#800080`,rebeccapurple:`#663399`,red:`#ff0000`,rosybrown:`#bc8f8f`,royalblue:`#4169e1`,saddlebrown:`#8b4513`,salmon:`#fa8072`,sandybrown:`#f4a460`,seagreen:`#2e8b57`,seashell:`#fff5ee`,sienna:`#a0522d`,silver:`#c0c0c0`,skyblue:`#87ceeb`,slateblue:`#6a5acd`,slategray:`#708090`,slategrey:`#708090`,snow:`#fffafa`,springgreen:`#00ff7f`,steelblue:`#4682b4`,tan:`#d2b48c`,teal:`#008080`,thistle:`#d8bfd8`,tomato:`#ff6347`,turquoise:`#40e0d0`,violet:`#ee82ee`,wheat:`#f5deb3`,white:`#ffffff`,whitesmoke:`#f5f5f5`,yellow:`#ffff00`,yellowgreen:`#9acd32`};function W(e){let t={r:0,g:0,b:0},n=1,r=!1,i=!1;if(typeof e==`string`&&(e=oe(e)),typeof e==`object`){if(X(e.r)&&X(e.g)&&X(e.b)){t=ne(e.r,e.g,e.b),r=!0;let{r:n}=e;i=typeof n!=`number`&&String(n).endsWith(`%`)?`prgb`:`rgb`}else if(X(e.h)&&X(e.s)&&X(e.v)){let n=M(e.s),a=M(e.v);t=re(e.h,n,a),r=!0,i=`hsv`}else if(X(e.h)&&X(e.s)&&X(e.l)){let n=M(e.s),a=M(e.l);t=F(e.h,n,a),r=!0,i=`hsl`}else X(e.c)&&X(e.m)&&X(e.y)&&X(e.k)&&(t=ie(e.c,e.m,e.y,e.k),r=!0,i=`cmyk`);Object.prototype.hasOwnProperty.call(e,`a`)&&(n=e.a)}return n=j(n),{ok:r,format:e.format||i,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}var G=`(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)`,K=`[\\s|\\(]+(`+G+`)[,|\\s]+(`+G+`)[,|\\s]+(`+G+`)\\s*\\)?`,q=`[\\s|\\(]+(`+G+`)[,|\\s]+(`+G+`)[,|\\s]+(`+G+`)[,|\\s]+(`+G+`)\\s*\\)?`,J={CSS_UNIT:new RegExp(G),rgb:RegExp(`rgb`+K),rgba:RegExp(`rgba`+q),hsl:RegExp(`hsl`+K),hsla:RegExp(`hsla`+q),hsv:RegExp(`hsv`+K),hsva:RegExp(`hsva`+q),cmyk:RegExp(`cmyk`+q)};function oe(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;let t=!1;if(U[e])e=U[e],t=!0;else if(e===`transparent`)return{r:0,g:0,b:0,a:0,format:`name`};if(typeof e==`string`&&e.length<=9){let n=se(e,t);if(n)return n}let n=J.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=J.rgba.exec(e),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=J.hsl.exec(e),n?{h:n[1],s:n[2],l:n[3]}:(n=J.hsla.exec(e),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=J.hsv.exec(e),n?{h:n[1],s:n[2],v:n[3]}:(n=J.hsva.exec(e),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=J.cmyk.exec(e),n?{c:n[1],m:n[2],y:n[3],k:n[4]}:!1))))))}function se(e,t){let n=+!!e.startsWith(`#`),r=e.length-n;if(r===6||r===8){let i=Y(e,n)*16+Y(e,n+1),a=Y(e,n+2)*16+Y(e,n+3),o=Y(e,n+4)*16+Y(e,n+5);if(r===6)return Number.isNaN(i+a+o)?void 0:{r:i,g:a,b:o,format:t?`name`:`hex`};let s=Y(e,n+6)*16+Y(e,n+7);return Number.isNaN(i+a+o+s)?void 0:{r:i,g:a,b:o,a:s/255,format:t?`name`:`hex8`}}if(r===3||r===4){let i=Y(e,n)*17,a=Y(e,n+1)*17,o=Y(e,n+2)*17;if(r===3)return Number.isNaN(i+a+o)?void 0:{r:i,g:a,b:o,format:t?`name`:`hex`};let s=Y(e,n+3)*17;return Number.isNaN(i+a+o+s)?void 0:{r:i,g:a,b:o,a:s/255,format:t?`name`:`hex8`}}}function Y(e,t){let n=e.charCodeAt(t);return n>=48&&n<=57?n-48:n>=97&&n<=102?n-87:n>=65&&n<=70?n-55:NaN}function X(e){return typeof e==`number`?!Number.isNaN(e):e!==void 0&&J.CSS_UNIT.test(e)}var ce=class e{constructor(t=``,n={}){if(t instanceof e)return t;typeof t==`number`&&(t=ae(t)),this.originalInput=t;let r=W(t);this.originalInput=t,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=n.format??r.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=r.ok}isDark(){return this.getBrightness()<128}isLight(){return!this.isDark()}getBrightness(){let e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3}getLuminance(){let e=this.toRgb(),t,n,r,i=e.r/255,a=e.g/255,o=e.b/255;return t=i<=.03928?i/12.92:((i+.055)/1.055)**2.4,n=a<=.03928?a/12.92:((a+.055)/1.055)**2.4,r=o<=.03928?o/12.92:((o+.055)/1.055)**2.4,.2126*t+.7152*n+.0722*r}getAlpha(){return this.a}setAlpha(e){return this.a=j(e),this.roundA=Math.round(100*this.a)/100,this}isMonochrome(){let{s:e}=this.toHsl();return e===0}toHsv(){let e=I(this.r,this.g,this.b);return{h:e.h*360,s:e.s,v:e.v,a:this.a}}toHsvString(){let e=I(this.r,this.g,this.b),t=Math.round(e.h*360),n=Math.round(e.s*100),r=Math.round(e.v*100);return this.a===1?`hsv(${t}, ${n}%, ${r}%)`:`hsva(${t}, ${n}%, ${r}%, ${this.roundA})`}toHsl(){let e=N(this.r,this.g,this.b);return{h:e.h*360,s:e.s,l:e.l,a:this.a}}toHslString(){let e=N(this.r,this.g,this.b),t=Math.round(e.h*360),n=Math.round(e.s*100),r=Math.round(e.l*100);return this.a===1?`hsl(${t}, ${n}%, ${r}%)`:`hsla(${t}, ${n}%, ${r}%, ${this.roundA})`}toHex(e=!1){return B(this.r,this.g,this.b,e)}toHexString(e=!1){return`#`+this.toHex(e)}toHex8(e=!1){return V(this.r,this.g,this.b,this.a,e)}toHex8String(e=!1){return`#`+this.toHex8(e)}toHexShortString(e=!1){return this.a===1?this.toHexString(e):this.toHex8String(e)}toRgb(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}}toRgbString(){let e=Math.round(this.r),t=Math.round(this.g),n=Math.round(this.b);return this.a===1?`rgb(${e}, ${t}, ${n})`:`rgba(${e}, ${t}, ${n}, ${this.roundA})`}toPercentageRgb(){let e=e=>`${Math.round(D(e,255)*100)}%`;return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}}toPercentageRgbString(){let e=e=>Math.round(D(e,255)*100);return this.a===1?`rgb(${e(this.r)}%, ${e(this.g)}%, ${e(this.b)}%)`:`rgba(${e(this.r)}%, ${e(this.g)}%, ${e(this.b)}%, ${this.roundA})`}toCmyk(){return{...H(this.r,this.g,this.b)}}toCmykString(){let{c:e,m:t,y:n,k:r}=H(this.r,this.g,this.b);return`cmyk(${e}, ${t}, ${n}, ${r})`}toName(){if(this.a===0)return`transparent`;if(this.a<1)return!1;let e=`#`+B(this.r,this.g,this.b,!1),t=U;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&t[n]===e)return n;return!1}toString(e){let t=!!e;e??=this.format;let n=!1,r=this.a<1&&this.a>=0;return!t&&r&&(e.startsWith(`hex`)||e===`name`)?e===`name`&&this.a===0?this.toName():this.toRgbString():(e===`rgb`&&(n=this.toRgbString()),e===`prgb`&&(n=this.toPercentageRgbString()),(e===`hex`||e===`hex6`)&&(n=this.toHexString()),e===`hex3`&&(n=this.toHexString(!0)),e===`hex4`&&(n=this.toHex8String(!0)),e===`hex8`&&(n=this.toHex8String()),e===`name`&&(n=this.toName()),e===`hsl`&&(n=this.toHslString()),e===`hsv`&&(n=this.toHsvString()),e===`cmyk`&&(n=this.toCmykString()),n||this.toHexString())}toNumber(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)}clone(){return new e(this.toString())}lighten(t=10){let n=this.toHsl();return n.l+=t/100,n.l=O(n.l),new e(n)}brighten(t=10){let n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),new e(n)}darken(t=10){let n=this.toHsl();return n.l-=t/100,n.l=O(n.l),new e(n)}tint(e=10){return this.mix(`white`,e)}shade(e=10){return this.mix(`black`,e)}desaturate(t=10){let n=this.toHsl();return n.s-=t/100,n.s=O(n.s),new e(n)}saturate(t=10){let n=this.toHsl();return n.s+=t/100,n.s=O(n.s),new e(n)}greyscale(){return this.desaturate(100)}spin(t){let n=this.toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,new e(n)}mix(t,n=50){let r=this.toRgb(),i=new e(t).toRgb(),a=n/100,o={r:(i.r-r.r)*a+r.r,g:(i.g-r.g)*a+r.g,b:(i.b-r.b)*a+r.b,a:(i.a-r.a)*a+r.a};return new e(o)}analogous(t=6,n=30){let r=this.toHsl(),i=360/n,a=[this];for(r.h=(r.h-(i*t>>1)+720)%360;--t;)r.h=(r.h+i)%360,a.push(new e(r));return a}complement(){let t=this.toHsl();return t.h=(t.h+180)%360,new e(t)}monochromatic(t=6){let n=this.toHsv(),{h:r}=n,{s:i}=n,{v:a}=n,o=[],s=1/t;for(;t--;)o.push(new e({h:r,s:i,v:a})),a=(a+s)%1;return o}splitcomplement(){let t=this.toHsl(),{h:n}=t;return[this,new e({h:(n+72)%360,s:t.s,l:t.l}),new e({h:(n+216)%360,s:t.s,l:t.l})]}onBackground(t){let n=this.toRgb(),r=new e(t).toRgb(),i=n.a+r.a*(1-n.a);return new e({r:(n.r*n.a+r.r*r.a*(1-n.a))/i,g:(n.g*n.a+r.g*r.a*(1-n.a))/i,b:(n.b*n.a+r.b*r.a*(1-n.a))/i,a:i})}triad(){return this.polyad(3)}tetrad(){return this.polyad(4)}polyad(t){let n=this.toHsl(),{h:r}=n,i=[this],a=360/t;for(let o=1;o<t;o++)i.push(new e({h:(r+o*a)%360,s:n.s,l:n.l}));return i}equals(t){let n=new e(t);return this.format===`cmyk`||n.format===`cmyk`?this.toCmykString()===n.toCmykString():this.toRgbString()===n.toRgbString()}},Z=[`#458FFF`,`#45D9A3`,`#FFC145`,`#F5654F`,`#6A6AFD`,`#6ED1FF`,`#008787`,`#FF9245`,`#F587B3`,`#8352CC`,`#65779B`],le=[`#458FFF`,`#C8DEFF`,`#45D9A3`,`#C8F4E4`,`#FFC145`,`#FFEDC8`,`#F5654F`,`#FCD1CB`,`#6A6AFD`,`#D3D3FE`,`#6ED1FF`,`#D3D3FE`,`#008787`,`#B3DBDB`,`#FF9245`,`#FFDFC8`,`#F587B3`,`#FCDBE8`,`#8352CC`,`#FCDBE8`,`#65779B`,`#65779B`],ue=[`#8C1604`,`#DB4C35`,`#FF9245`,`#FFC145`,`#689FFF`,`#45D9A3`,`#99ACD1`],Q={color:Z,textStyle:{color:`#6F7785`,fontSize:`12px`},bar:{barGap:.2,barWidth:10,label:{color:`#6F7785`,position:`top`}},line:{label:{color:`#6F7785`,position:`top`}},pie:{avoidLabelOverlap:!1,radius:[`70%`,`80%`],itemStyle:{borderWidth:1,borderColor:`#fff`},label:{show:!1,color:`#2F3540`,formatter:`{c}`,position:`inside`}},legend:{itemWidth:12,itemHeight:12,inactiveColor:`#BEC3CC`,textStyle:{color:`#6F7785`,fontSize:`12px`}},title:{itemGap:4,textStyle:{color:`#2F3540`,fontSize:`12px`,fontWeight:500},subtextStyle:{color:`#6F7785`,fontSize:`12px`}},tooltip:{backgroundColor:`rgba(251, 253, 255, 0.88)`,borderWidth:0,padding:12,textStyle:{color:`#2F3540`},axisPointer:{z:1,lineStyle:{type:`solid`,color:`#E1E5EB`}}},categoryAxis:{axisLine:{show:!0,lineStyle:{color:`#EDF1F7`}},axisTick:{show:!0,alignWithLabel:!0,lineStyle:{color:`#EDF1F7`}},axisLabel:{color:`#6F7785`},splitLine:{show:!1},splitArea:{show:!1}},valueAxis:{axisLine:{show:!1},axisTick:{show:!1},axisLabel:{color:`#6F7785`},splitLine:{lineStyle:{color:`#EDF1F7`}},splitArea:{show:!1},nameTextStyle:{color:`#6F7785`,padding:[0,30,-4,0]}},dataZoom:{height:16}};function de(e){return!!(e&&e.xAxis&&e.xAxis.data)}function fe(e,t){return i.isVue2?{attrs:{...e},on:{...t}}:{...e}}function pe(e){return Object.entries(e).reduce((e,[t,n])=>(n!==void 0&&(e[t]=n),e),{})}function me(e){return(0,s.isNil)(e)?[]:Array.isArray(e)?e:[e]}var he=(e,t)=>new ce(e).setAlpha(t).toRgbString();function $(e,t){return(0,o.use)(t),(0,o.registerTheme)(`seer`,Q),e.install=t=>{t.component(e.name,e)},e}var ge=$(E,[t.DataZoomComponent,t.LegendComponent,t.GridComponent,t.TitleComponent,t.TooltipComponent,n.LabelLayout,n.UniversalTransition,r.SVGRenderer]);e.CHART_THEME_TOKEN=f,e.IxChart=ge,e.convertArray=me,e.createInstall=$,e.filterEmptyProps=pe,e.getAlphaColor=he,e.isVertical=de,e.mergeAttrs=fe,e.seerColors=Z,e.seerColorsForMore=le,e.seerColorsForRisk=ue,e.seerTheme=Q,e.useChart=m,e.useReactiveAttrs=w,e.useStripe=y,e.useStripeArea=S,e.useStripeBarSeries=x,e.useStripeBarTooltip=b,e.useTooltipsFormatter=v,e.withChartProps=T});
|
package/dist/themes/index.d.ts
CHANGED
package/dist/themes/seer.d.ts
CHANGED