vue-chrts 0.2.5 → 1.0.0-test.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/dist/components/AreaChart/AreaChart.js +103 -73
  2. package/dist/components/AreaChart/types.d.ts +26 -9
  3. package/dist/components/BarChart/BarChart.js +91 -85
  4. package/dist/components/BarChart/stackedGroupedUtils.d.ts +2 -3
  5. package/dist/components/BarChart/types.d.ts +13 -1
  6. package/dist/components/BubbleChart/BubbleChart.js +78 -61
  7. package/dist/components/BubbleChart/BubbleChart.vue.d.ts +1 -1
  8. package/dist/components/BubbleChart/types.d.ts +15 -17
  9. package/dist/components/DonutChart/DonutChart.js +94 -78
  10. package/dist/components/DonutChart/DonutChart.vue.d.ts +1 -1
  11. package/dist/components/DonutChart/types.d.ts +16 -8
  12. package/dist/components/LineChart/LineChart.js +28 -130
  13. package/dist/components/LineChart/LineChart.vue.d.ts +3 -10
  14. package/dist/components/LineChart/types.d.ts +2 -140
  15. package/dist/components/Timeline/Timeline.js +140 -0
  16. package/dist/components/Timeline/Timeline.vue.d.ts +33 -0
  17. package/dist/components/Timeline/Timeline2.js +4 -0
  18. package/dist/components/Timeline/types.d.ts +116 -0
  19. package/dist/components/Tooltip.js +9 -9
  20. package/dist/index.d.ts +2 -2
  21. package/dist/index.js +14 -14
  22. package/dist/types.d.ts +24 -14
  23. package/dist/types.js +4 -4
  24. package/dist/utils.d.ts +1 -0
  25. package/dist/utils.js +27 -26
  26. package/package.json +1 -1
  27. package/dist/components/AreaStackedChart/AreaStackedChart.js +0 -77
  28. package/dist/components/AreaStackedChart/AreaStackedChart.vue.d.ts +0 -14
  29. package/dist/components/AreaStackedChart/AreaStackedChart2.js +0 -4
  30. package/dist/components/AreaStackedChart/types.d.ts +0 -86
@@ -1,4 +1,4 @@
1
- import { BulletLegendItemInterface, Orientation, LegendPosition, axisFormatter } from '../../types';
1
+ import { BulletLegendItemInterface, Orientation, LegendPosition, axisFormatter, AxisConfig } from '../../types';
2
2
  type BarChartPropsBase<T> = {
3
3
  /**
4
4
  * The data to be displayed in the bar chart.
@@ -101,6 +101,10 @@ type BarChartPropsBase<T> = {
101
101
  * See `LegendPosition` for available options.
102
102
  */
103
103
  legendPosition?: LegendPosition;
104
+ /**
105
+ * Optional style object for the legend container. Allows custom CSS styling.
106
+ */
107
+ legendStyle?: string | Record<string, string>;
104
108
  /**
105
109
  * If `true`, displays a domain line (axis line) along the x-axis.
106
110
  */
@@ -138,6 +142,14 @@ type BarChartPropsBase<T> = {
138
142
  * Only applicable if `stackAndGrouped` is `true`.
139
143
  */
140
144
  stackedGroupedSpacing?: number;
145
+ /**
146
+ * Axis configuration object for customizing the appearance of the axes.
147
+ */
148
+ xAxisConfig?: AxisConfig;
149
+ /**
150
+ * Axis configuration object for customizing the appearance of the axes.
151
+ */
152
+ yAxisConfig?: AxisConfig;
141
153
  };
142
154
  export type BarChartProps<T> = BarChartPropsBase<T> & {
143
155
  /**
@@ -1,16 +1,13 @@
1
- import { defineComponent as C, useSlots as z, useTemplateRef as P, ref as _, createElementBlock as m, openBlock as n, Fragment as N, createCommentVNode as l, createVNode as s, createElementVNode as O, unref as t, withCtx as R, createBlock as c, renderSlot as p } from "vue";
2
- import { Scatter as w, Position as D } from "@unovis/ts";
3
- import { VisBulletLegend as K, VisXYContainer as M, VisTooltip as S, VisScatter as E, VisAxis as f } from "@unovis/vue";
4
- import { LegendPosition as g } from "../../types.js";
5
- import { getFirstPropertyValue as G } from "../../utils.js";
6
- import $ from "../Tooltip.js";
7
- const j = {
8
- key: 0,
9
- class: "flex items-center justify-end pb-4"
10
- }, W = {
1
+ import { defineComponent as O, useSlots as S, useTemplateRef as D, ref as R, computed as f, createElementBlock as m, openBlock as l, normalizeStyle as c, createVNode as s, createCommentVNode as r, createElementVNode as w, unref as i, withCtx as K, createBlock as d, mergeProps as g, renderSlot as k } from "vue";
2
+ import { Scatter as M, Position as _ } from "@unovis/ts";
3
+ import { VisXYContainer as E, VisTooltip as G, VisScatter as W, VisAxis as x, VisBulletLegend as $ } from "@unovis/vue";
4
+ import { LegendPosition as j } from "../../types.js";
5
+ import { getFirstPropertyValue as X } from "../../utils.js";
6
+ import Y from "../Tooltip.js";
7
+ const q = {
11
8
  ref: "slotWrapper",
12
9
  class: "hidden"
13
- }, J = /* @__PURE__ */ C({
10
+ }, ee = /* @__PURE__ */ O({
14
11
  __name: "BubbleChart",
15
12
  props: {
16
13
  xAccessor: {},
@@ -31,7 +28,8 @@ const j = {
31
28
  categoryKey: {},
32
29
  xFormatter: {},
33
30
  yFormatter: {},
34
- legendPosition: { default: g.Bottom },
31
+ legendPosition: { default: j.BottomCenter },
32
+ legendStyle: { default: void 0 },
35
33
  sizeOptions: {},
36
34
  xDomainLine: { type: Boolean, default: !0 },
37
35
  yDomainLine: { type: Boolean, default: !0 },
@@ -46,63 +44,63 @@ const j = {
46
44
  hideTooltip: { type: Boolean, default: !1 },
47
45
  crosshairConfig: { default: () => ({
48
46
  color: "#666"
49
- }) }
47
+ }) },
48
+ xAxisConfig: {},
49
+ yAxisConfig: {}
50
50
  },
51
51
  emits: ["click"],
52
- setup(k, { emit: x }) {
53
- const e = k, L = z(), u = P("slotWrapper"), a = _(), T = e.xAccessor, h = e.yAccessor, b = e.sizeAccessor || ((o) => typeof o.comments == "number" ? o.comments : 1), B = (o) => {
54
- var d, y;
52
+ setup(L, { emit: T }) {
53
+ const e = L, h = S(), u = D("slotWrapper"), n = R(), v = e.xAccessor, b = e.yAccessor, B = e.sizeAccessor || ((t) => typeof t.comments == "number" ? t.comments : 1), A = (t) => {
54
+ var y, p;
55
55
  if (!e.categories || !e.categoryKey)
56
56
  return console.warn(
57
57
  "BubbleChart: categories and categoryKey are required for color mapping"
58
58
  ), "#cccccc";
59
- const r = String(o[e.categoryKey]);
60
- let i = (d = e.categories[r]) == null ? void 0 : d.color;
61
- return Object.keys(e.categories).length === 1 && (i = (y = e.categories[e.categoryKey]) == null ? void 0 : y.color), i || (console.warn(
62
- `BubbleChart: No color defined for category "${r}"`
59
+ const a = String(t[e.categoryKey]);
60
+ let o = (y = e.categories[a]) == null ? void 0 : y.color;
61
+ return Object.keys(e.categories).length === 1 && (o = (p = e.categories[e.categoryKey]) == null ? void 0 : p.color), o || (console.warn(
62
+ `BubbleChart: No color defined for category "${a}"`
63
63
  ), "#cccccc");
64
- }, v = x;
65
- function A(o) {
66
- return a.value = o, F();
64
+ }, C = T;
65
+ function V(t) {
66
+ return n.value = t, F();
67
67
  }
68
- function F(o) {
68
+ function F(t) {
69
69
  return typeof window > "u" ? "" : u.value ? u.value.innerHTML : "";
70
70
  }
71
- const V = {
72
- [w.selectors.point]: A
73
- };
74
- return (o, r) => (n(), m(N, null, [
75
- !e.hideLegend && e.legendPosition === t(g).Top ? (n(), m("div", j, [
76
- s(t(K), {
77
- items: Object.values(e.categories).map((i) => ({
78
- ...i,
79
- color: Array.isArray(i.color) ? i.color[0] : i.color
80
- }))
81
- }, null, 8, ["items"])
82
- ])) : l("", !0),
83
- s(t(M), {
71
+ const P = {
72
+ [M.selectors.point]: V
73
+ }, z = f(() => e.legendPosition.startsWith("top")), N = f(() => e.legendPosition.includes("left") ? "flex-start" : e.legendPosition.includes("right") ? "flex-end" : "center");
74
+ return (t, a) => (l(), m("div", {
75
+ style: c({
76
+ display: "flex",
77
+ flexDirection: z.value ? "column-reverse" : "column",
78
+ gap: "var(--vis-legend-spacing)"
79
+ })
80
+ }, [
81
+ s(i(E), {
84
82
  data: e.data,
85
83
  height: e.height || 600,
86
84
  padding: e.padding,
87
85
  scaleByDomain: !0,
88
- onClick: r[0] || (r[0] = (i) => v("click", i, a.value))
86
+ onClick: a[0] || (a[0] = (o) => C("click", o, n.value))
89
87
  }, {
90
- default: R(() => [
91
- e.hideTooltip ? l("", !0) : (n(), c(t(S), {
88
+ default: K(() => [
89
+ e.hideTooltip ? r("", !0) : (l(), d(i(G), {
92
90
  key: 0,
93
- triggers: V
91
+ triggers: P
94
92
  })),
95
- s(t(E), {
96
- x: t(T),
97
- y: t(h),
98
- color: B,
99
- size: t(b),
100
- labelPosition: e.labelPosition || t(D).Bottom,
93
+ s(i(W), {
94
+ x: i(v),
95
+ y: i(b),
96
+ color: A,
97
+ size: i(B),
98
+ labelPosition: e.labelPosition || i(_).Bottom,
101
99
  sizeRange: e.sizeRange || [1, 20],
102
100
  opacity: e.opacity,
103
101
  cursor: "pointer"
104
102
  }, null, 8, ["x", "y", "size", "labelPosition", "sizeRange", "opacity"]),
105
- e.hideXAxis ? l("", !0) : (n(), c(t(f), {
103
+ e.hideXAxis ? r("", !0) : (l(), d(i(x), g({
106
104
  key: 1,
107
105
  type: "x",
108
106
  label: e.xLabel,
@@ -113,8 +111,8 @@ const j = {
113
111
  numTicks: e.xNumTicks,
114
112
  tickValues: e.xExplicitTicks,
115
113
  minMaxTicksOnly: e.minMaxTicksOnly
116
- }, null, 8, ["label", "tickFormat", "gridLine", "domainLine", "tickLine", "numTicks", "tickValues", "minMaxTicksOnly"])),
117
- e.hideYAxis ? l("", !0) : (n(), c(t(f), {
114
+ }, t.xAxisConfig), null, 16, ["label", "tickFormat", "gridLine", "domainLine", "tickLine", "numTicks", "tickValues", "minMaxTicksOnly"])),
115
+ e.hideYAxis ? r("", !0) : (l(), d(i(x), g({
118
116
  key: 2,
119
117
  type: "y",
120
118
  label: e.yLabel,
@@ -123,26 +121,45 @@ const j = {
123
121
  domainLine: !!e.yDomainLine,
124
122
  tickLine: e.yTickLine,
125
123
  numTicks: e.yNumTicks
126
- }, null, 8, ["label", "tickFormat", "gridLine", "domainLine", "tickLine", "numTicks"]))
124
+ }, t.yAxisConfig), null, 16, ["label", "tickFormat", "gridLine", "domainLine", "tickLine", "numTicks"]))
127
125
  ]),
128
126
  _: 1
129
127
  }, 8, ["data", "height", "padding"]),
130
- O("div", W, [
131
- t(L).tooltip ? p(o.$slots, "tooltip", {
128
+ e.hideLegend ? r("", !0) : (l(), m("div", {
129
+ key: 0,
130
+ style: c({
131
+ display: "flex",
132
+ justifyContent: N.value
133
+ })
134
+ }, [
135
+ s(i($), {
136
+ class: "bulletLegendOverrides",
137
+ style: c([
138
+ e.legendStyle,
139
+ "display: flex; gap: var(--vis-legend-spacing);"
140
+ ]),
141
+ items: Object.values(e.categories).map((o) => ({
142
+ ...o,
143
+ color: Array.isArray(o.color) ? o.color[0] : o.color
144
+ }))
145
+ }, null, 8, ["style", "items"])
146
+ ], 4)),
147
+ w("div", q, [
148
+ i(h).tooltip ? k(t.$slots, "tooltip", {
132
149
  key: 0,
133
- values: a.value
134
- }) : a.value ? p(o.$slots, "fallback", { key: 1 }, () => [
135
- s($, {
136
- data: a.value,
150
+ values: n.value
151
+ }) : n.value ? k(t.$slots, "fallback", { key: 1 }, () => [
152
+ s(Y, {
153
+ data: n.value,
137
154
  categories: e.categories || {},
138
- toolTipTitle: t(G)(a.value) ?? "",
155
+ toolTipTitle: i(X)(n.value) ?? "",
139
156
  yFormatter: e.yFormatter
140
157
  }, null, 8, ["data", "categories", "toolTipTitle", "yFormatter"])
141
- ]) : l("", !0)
158
+ ]) : r("", !0)
142
159
  ], 512)
143
- ], 64));
160
+ ], 4));
144
161
  }
145
162
  });
146
163
  export {
147
- J as default
164
+ ee as default
148
165
  };
@@ -1,5 +1,5 @@
1
1
  import { BubbleChartProps } from './types';
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<{
2
+ declare const _default: <T>(__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?: T | undefined) => any) | undefined;
5
5
  } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onClick"> & BubbleChartProps<T> & Partial<{}>> & import('vue').PublicProps;
@@ -1,17 +1,5 @@
1
- import { axisFormatter, BulletLegendItemInterface, LegendPosition } from '../../types';
1
+ import { axisFormatter, BulletLegendItemInterface, LegendPosition, CrosshairConfig, AxisConfig } from '../../types';
2
2
  import { NumericAccessor, Position } from '@unovis/ts';
3
- export type DataRecord = {
4
- species: string;
5
- island: string;
6
- beakLength: number | undefined;
7
- beakDepth: number | undefined;
8
- flipperLength: number | undefined;
9
- bodyMass: number | undefined;
10
- sex: string;
11
- };
12
- /**
13
- * Configuration for bubble sizes.
14
- */
15
3
  export interface SizeOptions {
16
4
  minRadius?: number;
17
5
  maxRadius?: number;
@@ -107,6 +95,10 @@ export interface BubbleChartProps<T> {
107
95
  * See `LegendPosition` for available options.
108
96
  */
109
97
  legendPosition?: LegendPosition;
98
+ /**
99
+ * Optional inline CSS styles for the legend container.
100
+ */
101
+ legendStyle?: Record<string, string>;
110
102
  /** Options for controlling bubble sizes. */
111
103
  sizeOptions?: SizeOptions;
112
104
  /**
@@ -154,9 +146,15 @@ export interface BubbleChartProps<T> {
154
146
  */
155
147
  hideTooltip?: boolean;
156
148
  /**
157
- * Configuration for the crosshair behavior.
149
+ * Crosshair configuration object for customizing the appearance of the crosshair line.
158
150
  */
159
- crosshairConfig?: {
160
- color?: string;
161
- };
151
+ crosshairConfig?: CrosshairConfig;
152
+ /**
153
+ * Axis configuration object for customizing the appearance of the axes.
154
+ */
155
+ xAxisConfig?: AxisConfig;
156
+ /**
157
+ * Axis configuration object for customizing the appearance of the axes.
158
+ */
159
+ yAxisConfig?: AxisConfig;
162
160
  }
@@ -1,19 +1,12 @@
1
- import { defineComponent as V, useSlots as b, useTemplateRef as w, ref as T, createElementBlock as u, openBlock as p, Fragment as D, createElementVNode as n, createCommentVNode as m, createVNode as o, renderSlot as i, unref as l, withCtx as S, normalizeStyle as W, toDisplayString as B } from "vue";
2
- import { Donut as L } from "@unovis/ts";
3
- import { DonutType as R } from "./types.js";
4
- import { VisSingleContainer as H, VisTooltip as N, VisDonut as $, VisBulletLegend as j } from "@unovis/vue";
5
- const z = {
1
+ import { defineComponent as L, useSlots as B, useTemplateRef as P, ref as T, computed as i, createElementBlock as g, openBlock as m, normalizeStyle as a, createVNode as s, createCommentVNode as f, renderSlot as u, createElementVNode as d, unref as r, withCtx as W, toDisplayString as w } from "vue";
2
+ import { Donut as R } from "@unovis/ts";
3
+ import { DonutType as j } from "./types.js";
4
+ import { VisSingleContainer as H, VisTooltip as N, VisDonut as $, VisBulletLegend as z } from "@unovis/vue";
5
+ import { LegendPosition as E } from "../../types.js";
6
+ const O = {
6
7
  ref: "slotWrapper",
7
8
  style: { display: "none" }
8
- }, A = { style: { display: "flex", "align-items": "center", padding: "10px 15px" } }, E = {
9
- key: 0,
10
- style: {
11
- display: "flex",
12
- alignItems: "center",
13
- justifyContent: "center",
14
- marginTop: "1rem"
15
- }
16
- }, M = /* @__PURE__ */ V({
9
+ }, _ = { style: { display: "flex", "align-items": "center", padding: "10px 15px" } }, G = /* @__PURE__ */ L({
17
10
  __name: "DonutChart",
18
11
  props: {
19
12
  type: {},
@@ -22,78 +15,101 @@ const z = {
22
15
  height: {},
23
16
  radius: {},
24
17
  hideLegend: { type: Boolean },
25
- labels: {},
18
+ legendPosition: { default: E.BottomCenter },
19
+ legendStyle: {},
20
+ categories: {},
26
21
  padAngle: {}
27
22
  },
28
23
  emits: ["click"],
29
- setup(c, { emit: g }) {
30
- const f = g, r = c, h = b(), s = w("slotWrapper"), t = T(), y = (e) => e, v = r.type === R.Half;
31
- function C(e) {
32
- return t.value = e, k();
33
- }
34
- function k(e) {
35
- return typeof window > "u" ? "" : s.value ? s.value.innerHTML : "";
24
+ setup(v, { emit: y }) {
25
+ const h = y, t = v, k = B(), C = P("slotWrapper"), l = T(), V = (e) => e, b = t.type === j.Half, c = i(
26
+ () => Object.values(t.categories).map((e) => {
27
+ const o = e.color;
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;
36
38
  }
37
- return (e, d) => (p(), u(D, null, [
38
- n("div", {
39
- style: {
39
+ const S = i(() => t.legendPosition.includes("top")), D = i(() => t.legendPosition.includes("left") ? "flex-start" : t.legendPosition.includes("right") ? "flex-end" : "center");
40
+ return (e, o) => (m(), g("div", {
41
+ style: a({
42
+ display: "flex",
43
+ flexDirection: S.value ? "column-reverse" : "column",
44
+ gap: "var(--vis-legend-spacing)"
45
+ }),
46
+ onClick: o[0] || (o[0] = (n) => h("click", n, l.value))
47
+ }, [
48
+ s(r(H), {
49
+ data: e.data,
50
+ height: e.height,
51
+ margin: {}
52
+ }, {
53
+ default: W(() => [
54
+ s(r(N), {
55
+ "horizontal-shift": 20,
56
+ "vertical-shift": 20,
57
+ triggers: {
58
+ [r(R).selectors.segment]: (n) => {
59
+ var p;
60
+ return A(n), n ? (p = C.value) == null ? void 0 : p.innerHTML : "";
61
+ }
62
+ }
63
+ }, null, 8, ["triggers"]),
64
+ s(r($), {
65
+ value: V,
66
+ "corner-radius": e.radius,
67
+ "arc-width": e.arcWidth ?? 20,
68
+ color: c.value,
69
+ "angle-range": b ? [-1.5707963267948966, 1.5707963267948966] : [],
70
+ "pad-angle": t.padAngle || 0
71
+ }, null, 8, ["corner-radius", "arc-width", "color", "angle-range", "pad-angle"])
72
+ ]),
73
+ _: 1
74
+ }, 8, ["data", "height"]),
75
+ t.hideLegend ? f("", !0) : (m(), g("div", {
76
+ key: 0,
77
+ style: a({
40
78
  display: "flex",
41
- alignItems: "center",
42
- justifyContent: "center"
43
- },
44
- onClick: d[0] || (d[0] = (a) => f("click", a, t.value))
79
+ justifyContent: D.value
80
+ })
45
81
  }, [
46
- o(l(H), {
47
- data: e.data,
48
- height: e.height,
49
- margin: {}
50
- }, {
51
- default: S(() => [
52
- o(l(N), {
53
- "horizontal-shift": 20,
54
- "vertical-shift": 20,
55
- triggers: {
56
- [l(L).selectors.segment]: C
57
- }
58
- }, null, 8, ["triggers"]),
59
- o(l($), {
60
- value: y,
61
- "corner-radius": e.radius,
62
- "arc-width": e.arcWidth ?? 20,
63
- color: r.labels.map((a) => a.color),
64
- "angle-range": v ? [-1.5707963267948966, 1.5707963267948966] : [],
65
- "pad-angle": r.padAngle || 0
66
- }, null, 8, ["corner-radius", "arc-width", "color", "angle-range", "pad-angle"])
82
+ s(r(z), {
83
+ style: a([
84
+ t.legendStyle,
85
+ "display: flex; gap: var(--vis-legend-spacing);"
67
86
  ]),
68
- _: 1
69
- }, 8, ["data", "height"]),
70
- i(e.$slots, "default"),
71
- n("div", z, [
72
- l(h).tooltip ? i(e.$slots, "tooltip", {
73
- key: 0,
74
- values: t.value
75
- }) : t.value ? i(e.$slots, "fallback", { key: 1 }, () => [
76
- n("div", A, [
77
- n("div", {
78
- style: W({
79
- width: "0.5rem",
80
- height: "0.5rem",
81
- borderRadius: "9999px",
82
- marginRight: "0.5rem",
83
- backgroundColor: r.labels[t.value.index].color
84
- })
85
- }, null, 4),
86
- n("div", null, B(t.value.data), 1)
87
- ])
88
- ]) : m("", !0)
89
- ], 512)
90
- ]),
91
- e.hideLegend ? m("", !0) : (p(), u("div", E, [
92
- o(l(j), { items: e.labels }, null, 8, ["items"])
93
- ]))
94
- ], 64));
87
+ items: x.value
88
+ }, null, 8, ["style", "items"])
89
+ ], 4)),
90
+ u(e.$slots, "default"),
91
+ d("div", O, [
92
+ r(k).tooltip ? u(e.$slots, "tooltip", {
93
+ key: 0,
94
+ values: l.value
95
+ }) : l.value ? u(e.$slots, "fallback", { key: 1 }, () => [
96
+ d("div", _, [
97
+ d("div", {
98
+ style: a({
99
+ width: "0.5rem",
100
+ height: "0.5rem",
101
+ borderRadius: "9999px",
102
+ marginRight: "0.5rem",
103
+ backgroundColor: c.value[l.value.index]
104
+ })
105
+ }, null, 4),
106
+ d("div", null, w(l.value.data), 1)
107
+ ])
108
+ ]) : f("", !0)
109
+ ], 512)
110
+ ], 4));
95
111
  }
96
112
  });
97
113
  export {
98
- M as default
114
+ G as default
99
115
  };
@@ -1,5 +1,5 @@
1
1
  import { DonutChartProps } from './types';
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<{
2
+ declare const _default: <T extends Record<string, any> = any>(__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;
@@ -1,9 +1,10 @@
1
+ import { BulletLegendItemInterface, LegendPosition } from '../../types';
1
2
  export type DonutChartProps = {
2
3
  /**
3
4
  * The type of donut chart to render.
4
5
  * See `DonutType` for available options.
5
6
  */
6
- type?: string;
7
+ type?: DonutType;
7
8
  /**
8
9
  * The data to be displayed in the donut chart.
9
10
  * Each number in the array represents a segment value.
@@ -14,8 +15,8 @@ export type DonutChartProps = {
14
15
  */
15
16
  arcWidth?: number;
16
17
  /**
17
- * The height of the chart in pixels.
18
- */
18
+ * The height of the chart in pixels.
19
+ */
19
20
  height: number;
20
21
  /**
21
22
  * The radius of the donut in pixels.
@@ -26,12 +27,19 @@ export type DonutChartProps = {
26
27
  */
27
28
  hideLegend?: boolean;
28
29
  /**
29
- * An array of label objects defining the name and color for each segment.
30
+ * Optional position for the legend, if applicable.
31
+ * See `LegendPosition` for available options.
32
+ */
33
+ legendPosition?: LegendPosition;
34
+ /**
35
+ * Optional style object for the legend container. Allows custom CSS styling.
36
+ */
37
+ legendStyle?: string | Record<string, string>;
38
+ /**
39
+ * A record mapping category keys to `BulletLegendItemInterface` objects.
40
+ * This defines the visual representation and labels for each category in the chart's legend.
30
41
  */
31
- labels: {
32
- name: string;
33
- color: string;
34
- }[];
42
+ categories: Record<string, BulletLegendItemInterface>;
35
43
  /**
36
44
  * Pad angle. Default: 0
37
45
  */