vue-chrts 1.0.0-test.1 → 1.0.0-test.2
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/components/DonutChart/DonutChart.js +64 -62
- package/dist/components/DonutChart/DonutChart.vue.d.ts +1 -1
- package/dist/components/{Timeline/Timeline.js → GanttChart/GanttChart.js} +10 -10
- package/dist/components/{Timeline/Timeline.vue.d.ts → GanttChart/GanttChart.vue.d.ts} +2 -2
- package/dist/components/GanttChart/GanttChart2.js +4 -0
- package/dist/components/{Timeline → GanttChart}/types.d.ts +1 -5
- package/dist/components/LineChart/LineChart.js +14 -14
- package/dist/components/LineChart/LineChart.vue.d.ts +9 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +12 -12
- package/dist/types.d.ts +2 -2
- package/package.json +1 -1
- package/dist/components/Timeline/Timeline2.js +0 -4
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as T, useSlots as B, useTemplateRef as P, ref as W, computed as c, createElementBlock as f, openBlock as m, normalizeStyle as s, createVNode as a, createCommentVNode as v, createElementVNode as i, unref as l, withCtx as _, renderSlot as p, toDisplayString as b } from "vue";
|
|
2
2
|
import { Donut as R } from "@unovis/ts";
|
|
3
|
-
import { DonutType as
|
|
4
|
-
import { VisSingleContainer as H, VisTooltip as N, VisDonut as $, VisBulletLegend as
|
|
3
|
+
import { DonutType as z } from "./types.js";
|
|
4
|
+
import { VisSingleContainer as H, VisTooltip as N, VisDonut as $, VisBulletLegend as j } from "@unovis/vue";
|
|
5
5
|
import { LegendPosition as E } from "../../types.js";
|
|
6
|
-
const O = {
|
|
6
|
+
const M = { class: "absolute top-1/2 left-1/2 -translate-1/2" }, O = {
|
|
7
7
|
ref: "slotWrapper",
|
|
8
8
|
style: { display: "none" }
|
|
9
|
-
},
|
|
9
|
+
}, U = { style: { display: "flex", "align-items": "center", padding: "10px 15px" } }, K = /* @__PURE__ */ T({
|
|
10
10
|
__name: "DonutChart",
|
|
11
11
|
props: {
|
|
12
12
|
type: {},
|
|
@@ -21,95 +21,97 @@ const O = {
|
|
|
21
21
|
padAngle: {}
|
|
22
22
|
},
|
|
23
23
|
emits: ["click"],
|
|
24
|
-
setup(
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
return Array.isArray(o) ? o[0] : o ?? "#3b82f6";
|
|
29
|
-
})
|
|
30
|
-
), x = i(
|
|
31
|
-
() => Object.values(t.categories).map((e) => ({
|
|
32
|
-
...e,
|
|
33
|
-
color: Array.isArray(e.color) ? e.color[0] : e.color ?? "#3b82f6"
|
|
34
|
-
}))
|
|
35
|
-
);
|
|
36
|
-
function A(e) {
|
|
37
|
-
l.value = e;
|
|
24
|
+
setup(h, { emit: y }) {
|
|
25
|
+
const C = y, n = h, k = B(), g = P("slotWrapper"), r = W(), V = (e) => e, x = n.type === z.Half;
|
|
26
|
+
function S(e) {
|
|
27
|
+
return r.value = e, w();
|
|
38
28
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
29
|
+
function w(e) {
|
|
30
|
+
return typeof window > "u" ? "" : g.value ? g.value.innerHTML : "";
|
|
31
|
+
}
|
|
32
|
+
const A = c(() => n.legendPosition.includes("top")), D = c(() => n.legendPosition.includes("left") ? "flex-start" : n.legendPosition.includes("right") ? "flex-end" : "center"), d = (e, o = "#ccc") => e ? Array.isArray(e) ? e[0] || o : e : o, u = c(() => Object.values(n.categories)), L = (e, o) => {
|
|
33
|
+
const t = u.value[o];
|
|
34
|
+
if (t)
|
|
35
|
+
return d(t.color);
|
|
36
|
+
};
|
|
37
|
+
return (e, o) => (m(), f("div", {
|
|
38
|
+
style: s({
|
|
42
39
|
display: "flex",
|
|
43
|
-
flexDirection:
|
|
40
|
+
flexDirection: A.value ? "column-reverse" : "column",
|
|
44
41
|
gap: "var(--vis-legend-spacing)"
|
|
45
42
|
}),
|
|
46
|
-
onClick: o[0] || (o[0] = (
|
|
43
|
+
onClick: o[0] || (o[0] = (t) => C("click", t, r.value))
|
|
47
44
|
}, [
|
|
48
|
-
|
|
45
|
+
a(l(H), {
|
|
49
46
|
data: e.data,
|
|
50
47
|
height: e.height,
|
|
51
48
|
margin: {}
|
|
52
49
|
}, {
|
|
53
|
-
default:
|
|
54
|
-
|
|
50
|
+
default: _(() => [
|
|
51
|
+
a(l(N), {
|
|
55
52
|
"horizontal-shift": 20,
|
|
56
53
|
"vertical-shift": 20,
|
|
57
54
|
triggers: {
|
|
58
|
-
[
|
|
59
|
-
var p;
|
|
60
|
-
return A(n), n ? (p = C.value) == null ? void 0 : p.innerHTML : "";
|
|
61
|
-
}
|
|
55
|
+
[l(R).selectors.segment]: S
|
|
62
56
|
}
|
|
63
57
|
}, null, 8, ["triggers"]),
|
|
64
|
-
|
|
58
|
+
a(l($), {
|
|
65
59
|
value: V,
|
|
66
60
|
"corner-radius": e.radius,
|
|
67
61
|
"arc-width": e.arcWidth ?? 20,
|
|
68
|
-
color:
|
|
69
|
-
"angle-range":
|
|
70
|
-
"pad-angle":
|
|
71
|
-
}, null, 8, ["corner-radius", "arc-width", "
|
|
62
|
+
color: L,
|
|
63
|
+
"angle-range": x ? [-1.5707963267948966, 1.5707963267948966] : [],
|
|
64
|
+
"pad-angle": n.padAngle || 0
|
|
65
|
+
}, null, 8, ["corner-radius", "arc-width", "angle-range", "pad-angle"]),
|
|
66
|
+
i("div", M, [
|
|
67
|
+
p(e.$slots, "default")
|
|
68
|
+
])
|
|
72
69
|
]),
|
|
73
|
-
_:
|
|
70
|
+
_: 3
|
|
74
71
|
}, 8, ["data", "height"]),
|
|
75
|
-
|
|
72
|
+
n.hideLegend ? v("", !0) : (m(), f("div", {
|
|
76
73
|
key: 0,
|
|
77
|
-
style:
|
|
74
|
+
style: s({
|
|
78
75
|
display: "flex",
|
|
79
76
|
justifyContent: D.value
|
|
80
77
|
})
|
|
81
78
|
}, [
|
|
82
|
-
|
|
83
|
-
style:
|
|
84
|
-
|
|
79
|
+
a(l(j), {
|
|
80
|
+
style: s([
|
|
81
|
+
n.legendStyle,
|
|
85
82
|
"display: flex; gap: var(--vis-legend-spacing);"
|
|
86
83
|
]),
|
|
87
|
-
items:
|
|
84
|
+
items: u.value.map((t) => ({
|
|
85
|
+
...t,
|
|
86
|
+
color: d(t.color)
|
|
87
|
+
}))
|
|
88
88
|
}, null, 8, ["style", "items"])
|
|
89
89
|
], 4)),
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
r(k).tooltip ? u(e.$slots, "tooltip", {
|
|
90
|
+
i("div", O, [
|
|
91
|
+
l(k).tooltip ? p(e.$slots, "tooltip", {
|
|
93
92
|
key: 0,
|
|
94
|
-
values:
|
|
95
|
-
}) :
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
93
|
+
values: r.value
|
|
94
|
+
}) : r.value ? p(e.$slots, "fallback", { key: 1 }, () => {
|
|
95
|
+
var t;
|
|
96
|
+
return [
|
|
97
|
+
i("div", U, [
|
|
98
|
+
i("div", {
|
|
99
|
+
style: s({
|
|
100
|
+
width: "0.5rem",
|
|
101
|
+
height: "0.5rem",
|
|
102
|
+
borderRadius: "9999px",
|
|
103
|
+
marginRight: "0.5rem",
|
|
104
|
+
backgroundColor: d((t = u.value[r.value.index]) == null ? void 0 : t.color)
|
|
105
|
+
})
|
|
106
|
+
}, null, 4),
|
|
107
|
+
i("div", null, b(r.value.data), 1)
|
|
108
|
+
])
|
|
109
|
+
];
|
|
110
|
+
}) : v("", !0)
|
|
109
111
|
], 512)
|
|
110
112
|
], 4));
|
|
111
113
|
}
|
|
112
114
|
});
|
|
113
115
|
export {
|
|
114
|
-
|
|
116
|
+
K as default
|
|
115
117
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DonutChartProps } from './types';
|
|
2
|
-
declare const _default: <T extends
|
|
2
|
+
declare const _default: <T extends {}>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
3
3
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
4
4
|
readonly onClick?: ((event: MouseEvent, values?: any) => any) | undefined;
|
|
5
5
|
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onClick"> & DonutChartProps & Partial<{}>> & import('vue').PublicProps;
|
|
@@ -2,10 +2,10 @@ import { defineComponent as V, useSlots as B, useTemplateRef as w, ref as A, com
|
|
|
2
2
|
import { Timeline as y } from "@unovis/ts";
|
|
3
3
|
import { dateFormatter as S, getFirstPropertyValue as N } from "../../utils.js";
|
|
4
4
|
import j from "../Tooltip.js";
|
|
5
|
-
import { VisXYContainer as O, VisTimeline as $, VisTooltip as D, VisAxis as
|
|
6
|
-
import { LegendPosition as
|
|
5
|
+
import { VisXYContainer as O, VisTimeline as $, VisTooltip as D, VisAxis as G, VisBulletLegend as M } from "@unovis/vue";
|
|
6
|
+
import { LegendPosition as E } from "../../types.js";
|
|
7
7
|
const I = /* @__PURE__ */ V({
|
|
8
|
-
__name: "
|
|
8
|
+
__name: "GanttChart",
|
|
9
9
|
props: {
|
|
10
10
|
data: {},
|
|
11
11
|
labelWidth: { default: 220 },
|
|
@@ -22,7 +22,7 @@ const I = /* @__PURE__ */ V({
|
|
|
22
22
|
crosshairConfig: {},
|
|
23
23
|
lineWidth: { default: 12 },
|
|
24
24
|
rowHeight: { default: 24 },
|
|
25
|
-
legendPosition: { default:
|
|
25
|
+
legendPosition: { default: E.TopRight },
|
|
26
26
|
legendStyle: {},
|
|
27
27
|
hideLegend: { type: Boolean },
|
|
28
28
|
xTickLine: { type: Boolean },
|
|
@@ -44,10 +44,10 @@ const I = /* @__PURE__ */ V({
|
|
|
44
44
|
function L(e, a, t) {
|
|
45
45
|
r("click", t, { index: a, item: e });
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function C(e) {
|
|
48
48
|
r("scroll", e.deltaY);
|
|
49
49
|
}
|
|
50
|
-
const
|
|
50
|
+
const W = s(() => {
|
|
51
51
|
const e = Object.values(l.categories).map(
|
|
52
52
|
(a, t) => `var(--vis-color${t})`
|
|
53
53
|
);
|
|
@@ -65,7 +65,7 @@ const I = /* @__PURE__ */ V({
|
|
|
65
65
|
o(i(O), {
|
|
66
66
|
data: l.data,
|
|
67
67
|
height: l.height,
|
|
68
|
-
onWheel:
|
|
68
|
+
onWheel: C
|
|
69
69
|
}, {
|
|
70
70
|
default: P(() => [
|
|
71
71
|
o(i($), {
|
|
@@ -74,7 +74,7 @@ const I = /* @__PURE__ */ V({
|
|
|
74
74
|
lineWidth: l.lineWidth,
|
|
75
75
|
rowHeight: l.rowHeight,
|
|
76
76
|
type: l.type,
|
|
77
|
-
color:
|
|
77
|
+
color: W.value,
|
|
78
78
|
labelWidth: l.labelWidth,
|
|
79
79
|
showLabels: l.showLabels,
|
|
80
80
|
onClick: L
|
|
@@ -87,7 +87,7 @@ const I = /* @__PURE__ */ V({
|
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
}, null, 8, ["triggers"]),
|
|
90
|
-
o(i(
|
|
90
|
+
o(i(G), F({
|
|
91
91
|
type: "x",
|
|
92
92
|
tickFormat: e.xTickFormat || i(S),
|
|
93
93
|
numTicks: e.xNumTicks,
|
|
@@ -105,7 +105,7 @@ const I = /* @__PURE__ */ V({
|
|
|
105
105
|
justifyContent: b.value
|
|
106
106
|
})
|
|
107
107
|
}, [
|
|
108
|
-
o(i(
|
|
108
|
+
o(i(M), {
|
|
109
109
|
style: c([
|
|
110
110
|
l.legendStyle,
|
|
111
111
|
"display: flex; gap: var(--vis-legend-spacing);"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GanttChartProps } from '../../types';
|
|
2
2
|
export interface TimelineCategory {
|
|
3
3
|
name: string;
|
|
4
4
|
color?: string | string[];
|
|
@@ -11,7 +11,7 @@ declare const _default: <T extends Record<string, any>>(__VLS_props: NonNullable
|
|
|
11
11
|
}) => any) | undefined;
|
|
12
12
|
readonly onScroll?: ((distance: number) => any) | undefined;
|
|
13
13
|
readonly onLabelHover?: ((item: T | undefined) => any) | undefined;
|
|
14
|
-
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onClick" | "onScroll" | "onLabelHover"> &
|
|
14
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onClick" | "onScroll" | "onLabelHover"> & GanttChartProps<T> & Partial<{}>> & import('vue').PublicProps;
|
|
15
15
|
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
|
16
16
|
attrs: any;
|
|
17
17
|
slots: {
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { BulletLegendItemInterface, CrosshairConfig, LegendPosition, AxisConfig } from '../../types';
|
|
2
|
-
export interface
|
|
3
|
-
name: string;
|
|
4
|
-
color: string;
|
|
5
|
-
}
|
|
6
|
-
export interface TimelineProps<T> {
|
|
2
|
+
export interface GanttChartProps<T> {
|
|
7
3
|
/**
|
|
8
4
|
* The data to be displayed in the timeline chart.
|
|
9
5
|
* Each element of the array represents a timeline event or item.
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { defineComponent as a, createBlock as r, openBlock as
|
|
2
|
-
import
|
|
3
|
-
const
|
|
4
|
-
inheritAttrs: !1,
|
|
1
|
+
import { defineComponent as t, useSlots as a, createBlock as r, openBlock as l, mergeProps as p, createSlots as s, withCtx as y, renderSlot as c, normalizeProps as m, guardReactiveProps as d } from "vue";
|
|
2
|
+
import x from "../AreaChart/AreaChart.js";
|
|
3
|
+
const u = /* @__PURE__ */ t({
|
|
5
4
|
__name: "LineChart",
|
|
6
5
|
props: {
|
|
7
6
|
data: {},
|
|
@@ -38,18 +37,19 @@ const L = /* @__PURE__ */ a({
|
|
|
38
37
|
yDomain: {},
|
|
39
38
|
xDomain: {}
|
|
40
39
|
},
|
|
41
|
-
setup(
|
|
42
|
-
const
|
|
43
|
-
return (e,
|
|
44
|
-
|
|
45
|
-
name:
|
|
46
|
-
fn:
|
|
47
|
-
|
|
48
|
-
])
|
|
49
|
-
|
|
40
|
+
setup(o) {
|
|
41
|
+
const i = o;
|
|
42
|
+
return a(), (e, h) => (l(), r(x, p(i, { "hide-area": !0 }), s({ _: 2 }, [
|
|
43
|
+
e.$slots.tooltip ? {
|
|
44
|
+
name: "tooltip",
|
|
45
|
+
fn: y((n) => [
|
|
46
|
+
c(e.$slots, "tooltip", m(d(n)))
|
|
47
|
+
]),
|
|
48
|
+
key: "0"
|
|
49
|
+
} : void 0
|
|
50
50
|
]), 1040));
|
|
51
51
|
}
|
|
52
52
|
});
|
|
53
53
|
export {
|
|
54
|
-
|
|
54
|
+
u as default
|
|
55
55
|
};
|
|
@@ -3,7 +3,15 @@ declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>
|
|
|
3
3
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, never> & LineChartProps<T> & Partial<{}>> & import('vue').PublicProps;
|
|
4
4
|
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
|
5
5
|
attrs: any;
|
|
6
|
-
slots:
|
|
6
|
+
slots: Readonly<{
|
|
7
|
+
tooltip?: (props: {
|
|
8
|
+
values: T | undefined;
|
|
9
|
+
}) => any;
|
|
10
|
+
}> & {
|
|
11
|
+
tooltip?: (props: {
|
|
12
|
+
values: T | undefined;
|
|
13
|
+
}) => any;
|
|
14
|
+
};
|
|
7
15
|
emit: {};
|
|
8
16
|
}>) => import('vue').VNode & {
|
|
9
17
|
__ctx?: Awaited<typeof __VLS_setup>;
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { default as LineChart } from './components/LineChart/LineChart.vue';
|
|
|
3
3
|
import { default as BarChart } from './components/BarChart/BarChart.vue';
|
|
4
4
|
import { default as DonutChart } from './components/DonutChart/DonutChart.vue';
|
|
5
5
|
import { default as BubbleChart } from './components/BubbleChart/BubbleChart.vue';
|
|
6
|
-
import { default as
|
|
6
|
+
import { default as GanttChart } from './components/GanttChart/GanttChart.vue';
|
|
7
7
|
import { LegendPosition, CurveType, Orientation, BulletLegendItemInterface, MarkerConfig, CrosshairConfig } from './types';
|
|
8
|
-
export { AreaChart, LineChart, BarChart, DonutChart, BubbleChart,
|
|
8
|
+
export { AreaChart, LineChart, BarChart, DonutChart, BubbleChart, GanttChart, Orientation, CurveType, LegendPosition };
|
|
9
9
|
export type { BulletLegendItemInterface, MarkerConfig, CrosshairConfig };
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { default as
|
|
1
|
+
import { default as a } from "./components/AreaChart/AreaChart.js";
|
|
2
2
|
import { default as o } from "./components/LineChart/LineChart.js";
|
|
3
3
|
import { default as u } from "./components/BarChart/BarChart.js";
|
|
4
|
-
import { default as
|
|
5
|
-
import { default as
|
|
6
|
-
import { default as
|
|
7
|
-
import { CurveType as
|
|
4
|
+
import { default as d } from "./components/DonutChart/DonutChart.js";
|
|
5
|
+
import { default as m } from "./components/BubbleChart/BubbleChart.js";
|
|
6
|
+
import { default as s } from "./components/GanttChart/GanttChart.js";
|
|
7
|
+
import { CurveType as C, LegendPosition as h, Orientation as i } from "./types.js";
|
|
8
8
|
export {
|
|
9
|
-
|
|
9
|
+
a as AreaChart,
|
|
10
10
|
u as BarChart,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
m as BubbleChart,
|
|
12
|
+
C as CurveType,
|
|
13
|
+
d as DonutChart,
|
|
14
|
+
s as GanttChart,
|
|
15
|
+
h as LegendPosition,
|
|
15
16
|
o as LineChart,
|
|
16
|
-
|
|
17
|
-
n as Timeline
|
|
17
|
+
i as Orientation
|
|
18
18
|
};
|
package/dist/types.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { BarChartProps } from './components/BarChart/types';
|
|
|
3
3
|
import { LineChartProps } from './components/LineChart/types';
|
|
4
4
|
import { DonutChartProps } from './components/DonutChart/types';
|
|
5
5
|
import { BubbleChartProps } from './components/BubbleChart/types';
|
|
6
|
-
import {
|
|
6
|
+
import { GanttChartProps } from './components/GanttChart/types';
|
|
7
7
|
declare enum LegendPosition {
|
|
8
8
|
TopLeft = "top-left",
|
|
9
9
|
TopCenter = "top-center",
|
|
@@ -44,7 +44,7 @@ declare enum Orientation {
|
|
|
44
44
|
Horizontal = "horizontal",
|
|
45
45
|
Vertical = "vertical"
|
|
46
46
|
}
|
|
47
|
-
export { LegendPosition, CurveType, Orientation, type AreaChartProps, type BarChartProps, type LineChartProps, type DonutChartProps, type BulletLegendItemInterface, type BubbleChartProps, type
|
|
47
|
+
export { LegendPosition, CurveType, Orientation, type AreaChartProps, type BarChartProps, type LineChartProps, type DonutChartProps, type BulletLegendItemInterface, type BubbleChartProps, type GanttChartProps, };
|
|
48
48
|
export type axisFormatter = ((tick: number, i?: number, ticks?: number[]) => string) | ((tick: Date, i?: number, ticks?: Date[]) => string);
|
|
49
49
|
export interface AxisConfig {
|
|
50
50
|
tickLine?: boolean;
|
package/package.json
CHANGED