vue-chrts 0.0.47 → 0.0.48
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/Area/Area.d.ts +22 -23
- package/dist/components/Area/index.d.ts +0 -62
- package/dist/index.cjs +120 -222
- package/dist/index.js +122 -225
- package/package.json +1 -1
|
@@ -1,31 +1,30 @@
|
|
|
1
|
-
import { BaseChartProps } from '.';
|
|
2
1
|
import { BulletLegendItemInterface, CurveType } from '@unovis/ts';
|
|
3
|
-
import {
|
|
2
|
+
import { PaginationPosition } from '.';
|
|
4
3
|
|
|
5
|
-
declare const _default: <T
|
|
6
|
-
props: __VLS_Prettify<__VLS_OmitKeepDiscriminatedUnion<(Partial<{}> & Omit<{
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
* Type of curve
|
|
15
|
-
*/
|
|
4
|
+
declare const _default: <T>(__VLS_props: Awaited<typeof __VLS_setup>["props"], __VLS_ctx?: __VLS_Prettify<Pick<Awaited<typeof __VLS_setup>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
5
|
+
props: __VLS_Prettify<__VLS_OmitKeepDiscriminatedUnion<(Partial<{}> & Omit<{} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>) & {
|
|
6
|
+
data: T[];
|
|
7
|
+
height: number;
|
|
8
|
+
xLabel?: string;
|
|
9
|
+
yLabel?: string;
|
|
10
|
+
categories: Record<string, BulletLegendItemInterface>;
|
|
11
|
+
xFormatter: (i: number, idx: number) => string;
|
|
12
|
+
yFormatter?: (i: number, idx?: number) => string | number;
|
|
16
13
|
curveType?: CurveType;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
14
|
+
xNumTicks?: number;
|
|
15
|
+
yNumTicks?: number;
|
|
16
|
+
hideLegend?: boolean;
|
|
17
|
+
hideTooltip?: boolean;
|
|
18
|
+
gridLineX?: boolean;
|
|
19
|
+
domainLineX?: boolean;
|
|
20
|
+
gridLineY?: boolean;
|
|
21
|
+
domainLineY?: boolean;
|
|
22
|
+
paginationPoisition?: PaginationPosition;
|
|
23
|
+
}, keyof import('vue').VNodeProps | keyof import('vue').AllowedComponentProps>> & {} & (import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps);
|
|
23
24
|
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
|
24
25
|
attrs: any;
|
|
25
|
-
slots: ReturnType<() => {
|
|
26
|
-
|
|
27
|
-
}>;
|
|
28
|
-
emit: (evt: "legendItemClick", d: BulletLegendItemInterface, i: number) => void;
|
|
26
|
+
slots: ReturnType<() => {}>;
|
|
27
|
+
emit: typeof __VLS_emit;
|
|
29
28
|
}>) => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
30
29
|
[key: string]: any;
|
|
31
30
|
}> & {
|
|
@@ -1,67 +1,5 @@
|
|
|
1
|
-
import { Spacing } from '@unovis/ts';
|
|
2
1
|
export { default as Area } from './Area.vue';
|
|
3
2
|
export declare enum PaginationPosition {
|
|
4
3
|
Top = "top",
|
|
5
4
|
Bottom = "bottom"
|
|
6
5
|
}
|
|
7
|
-
type KeyOf<T extends Record<string, any>> = Extract<keyof T, string>;
|
|
8
|
-
export interface BaseChartProps<T extends Record<string, any>> {
|
|
9
|
-
/**
|
|
10
|
-
* The source data, in which each entry is a dictionary.
|
|
11
|
-
*/
|
|
12
|
-
data: T[];
|
|
13
|
-
/**
|
|
14
|
-
* Select the categories from your data. Used to populate the legend and toolip.
|
|
15
|
-
*/
|
|
16
|
-
categories: KeyOf<T>[];
|
|
17
|
-
/**
|
|
18
|
-
* Sets the key to map the data to the axis.
|
|
19
|
-
*/
|
|
20
|
-
index: KeyOf<T>;
|
|
21
|
-
/**
|
|
22
|
-
* Change the default colors.
|
|
23
|
-
*/
|
|
24
|
-
colors?: string[];
|
|
25
|
-
/**
|
|
26
|
-
* Margin of each the container
|
|
27
|
-
*/
|
|
28
|
-
margin?: Spacing;
|
|
29
|
-
/**
|
|
30
|
-
* Change the opacity of the non-selected field
|
|
31
|
-
* @default 0.2
|
|
32
|
-
*/
|
|
33
|
-
filterOpacity?: number;
|
|
34
|
-
/**
|
|
35
|
-
* Function to format X label
|
|
36
|
-
*/
|
|
37
|
-
xFormatter?: (tick: number | Date, i: number, ticks: number[] | Date[]) => string;
|
|
38
|
-
/**
|
|
39
|
-
* Function to format Y label
|
|
40
|
-
*/
|
|
41
|
-
yFormatter?: (tick: number | Date, i: number, ticks: number[] | Date[]) => string;
|
|
42
|
-
/**
|
|
43
|
-
* Controls the visibility of the X axis.
|
|
44
|
-
* @default true
|
|
45
|
-
*/
|
|
46
|
-
showXAxis?: boolean;
|
|
47
|
-
/**
|
|
48
|
-
* Controls the visibility of the Y axis.
|
|
49
|
-
* @default true
|
|
50
|
-
*/
|
|
51
|
-
showYAxis?: boolean;
|
|
52
|
-
/**
|
|
53
|
-
* Controls the visibility of tooltip.
|
|
54
|
-
* @default true
|
|
55
|
-
*/
|
|
56
|
-
showTooltip?: boolean;
|
|
57
|
-
/**
|
|
58
|
-
* Controls the visibility of legend.
|
|
59
|
-
* @default true
|
|
60
|
-
*/
|
|
61
|
-
showLegend?: boolean;
|
|
62
|
-
/**
|
|
63
|
-
* Controls the visibility of gridline.
|
|
64
|
-
* @default true
|
|
65
|
-
*/
|
|
66
|
-
showGridLine?: boolean;
|
|
67
|
-
}
|
package/dist/index.cjs
CHANGED
|
@@ -1,265 +1,163 @@
|
|
|
1
1
|
(function(global, factory) {
|
|
2
|
-
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("vue"), require("vue/server-renderer"), require("@unovis/ts"), require("@unovis/vue")
|
|
3
|
-
})(this, function(exports2, vue, serverRenderer, ts, vue$1
|
|
2
|
+
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("vue"), require("vue/server-renderer"), require("@unovis/ts"), require("@unovis/vue")) : typeof define === "function" && define.amd ? define(["exports", "vue", "vue/server-renderer", "@unovis/ts", "@unovis/vue"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global["vue-chrts"] = {}, global.Vue, global.serverRenderer, global.ts, global.vue$1));
|
|
3
|
+
})(this, function(exports2, vue, serverRenderer, ts, vue$1) {
|
|
4
4
|
"use strict";
|
|
5
5
|
const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
|
|
6
6
|
__name: "Area",
|
|
7
7
|
__ssrInlineRender: true,
|
|
8
8
|
props: {
|
|
9
9
|
data: {},
|
|
10
|
+
height: {},
|
|
11
|
+
xLabel: {},
|
|
12
|
+
yLabel: {},
|
|
10
13
|
categories: {},
|
|
11
|
-
index: {},
|
|
12
|
-
colors: {},
|
|
13
|
-
margin: { default: () => ({ top: 0, bottom: 0, left: 0, right: 0 }) },
|
|
14
|
-
filterOpacity: { default: 0.2 },
|
|
15
14
|
xFormatter: {},
|
|
16
15
|
yFormatter: {},
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
curveType: {},
|
|
17
|
+
xNumTicks: { default: (props) => props.data.length > 24 ? 24 / 4 : props.data.length - 1 },
|
|
18
|
+
yNumTicks: { default: (props) => props.data.length > 24 ? 24 / 4 : props.data.length - 1 },
|
|
19
|
+
hideLegend: { type: Boolean },
|
|
20
|
+
hideTooltip: { type: Boolean },
|
|
21
|
+
gridLineX: { type: Boolean },
|
|
22
|
+
domainLineX: { type: Boolean },
|
|
23
|
+
gridLineY: { type: Boolean },
|
|
24
|
+
domainLineY: { type: Boolean },
|
|
25
|
+
paginationPoisition: {}
|
|
25
26
|
},
|
|
26
|
-
|
|
27
|
-
setup(__props, { emit: __emit }) {
|
|
28
|
-
function defaultColors(count = 3) {
|
|
29
|
-
const quotient = Math.floor(count / 2);
|
|
30
|
-
const remainder = count % 2;
|
|
31
|
-
const primaryCount = quotient + remainder;
|
|
32
|
-
const secondaryCount = quotient;
|
|
33
|
-
return [
|
|
34
|
-
...Array.from(new Array(primaryCount).keys()).map((i) => `hsl(var(--vis-primary-color) / ${1 - 1 / primaryCount * i})`),
|
|
35
|
-
...Array.from(new Array(secondaryCount).keys()).map((i) => `hsl(var(--vis-secondary-color) / ${1 - 1 / secondaryCount * i})`)
|
|
36
|
-
];
|
|
37
|
-
}
|
|
27
|
+
setup(__props) {
|
|
38
28
|
const props = __props;
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
const colors = vue.computed(() => {
|
|
29
|
+
const colors = Object.values(props.categories).map((c) => c.color);
|
|
30
|
+
function accessors(id) {
|
|
42
31
|
var _a;
|
|
43
|
-
return
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
color: colors.value[i],
|
|
48
|
-
inactive: false
|
|
49
|
-
})));
|
|
50
|
-
const isMounted = core.useMounted();
|
|
51
|
-
function handleLegendItemClick(d, i) {
|
|
52
|
-
emits("legendItemClick", d, i);
|
|
32
|
+
return {
|
|
33
|
+
y: (d) => Number(d[id]),
|
|
34
|
+
color: ((_a = props.categories[id]) == null ? void 0 : _a.color) ?? "#3b82f6"
|
|
35
|
+
};
|
|
53
36
|
}
|
|
37
|
+
const svgDefs = colors.map(
|
|
38
|
+
(color, index) => `
|
|
39
|
+
<linearGradient id="gradient${index}-${color}" gradientTransform="rotate(90)">
|
|
40
|
+
<stop offset="0%" stop-color="${color}" stop-opacity="1" />
|
|
41
|
+
<stop offset="100%" stop-color="${color}" stop-opacity="0" />
|
|
42
|
+
</linearGradient>
|
|
43
|
+
`
|
|
44
|
+
).join("");
|
|
54
45
|
return (_ctx, _push, _parent, _attrs) => {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
items: legendItems.value,
|
|
61
|
-
"onUpdate:items": ($event) => legendItems.value = $event,
|
|
62
|
-
onLegendItemClick: handleLegendItemClick
|
|
63
|
-
}, null, _parent));
|
|
64
|
-
} else {
|
|
65
|
-
_push(`<!---->`);
|
|
66
|
-
}
|
|
46
|
+
_push(`<div${serverRenderer.ssrRenderAttrs(vue.mergeProps({
|
|
47
|
+
class: ["flex flex-col space-y-4", {
|
|
48
|
+
"flex-col-reverse": props.paginationPoisition === "top"
|
|
49
|
+
}]
|
|
50
|
+
}, _attrs))}>`);
|
|
67
51
|
_push(serverRenderer.ssrRenderComponent(vue.unref(vue$1.VisXYContainer), {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
52
|
+
data: _ctx.data,
|
|
53
|
+
height: _ctx.height,
|
|
54
|
+
"svg-defs": vue.unref(svgDefs)
|
|
71
55
|
}, {
|
|
72
56
|
default: vue.withCtx((_, _push2, _parent2, _scopeId) => {
|
|
73
57
|
if (_push2) {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
_push2(`<!--[--><stop offset="5%"${serverRenderer.ssrRenderAttr("stop-color", color)} stop-opacity="0.4"${_scopeId}></stop><stop offset="95%"${serverRenderer.ssrRenderAttr("stop-color", color)} stop-opacity="0"${_scopeId}></stop><!--]-->`);
|
|
79
|
-
} else {
|
|
80
|
-
_push2(`<stop offset="0%"${serverRenderer.ssrRenderAttr("stop-color", color)}${_scopeId}></stop>`);
|
|
81
|
-
}
|
|
82
|
-
_push2(`</linearGradient>`);
|
|
83
|
-
});
|
|
84
|
-
_push2(`<!--]--></defs></svg>`);
|
|
85
|
-
if (_ctx.showTooltip) {
|
|
86
|
-
_push2(serverRenderer.ssrRenderComponent(_component_ChartCrosshair, {
|
|
87
|
-
colors: colors.value,
|
|
88
|
-
items: legendItems.value,
|
|
89
|
-
index: index.value,
|
|
90
|
-
"custom-tooltip": _ctx.customTooltip
|
|
58
|
+
if (!_ctx.hideTooltip) {
|
|
59
|
+
_push2(serverRenderer.ssrRenderComponent(vue.unref(vue$1.VisTooltip), {
|
|
60
|
+
"horizontal-placement": vue.unref(ts.Position).Right,
|
|
61
|
+
"vertical-placement": vue.unref(ts.Position).Top
|
|
91
62
|
}, null, _parent2, _scopeId));
|
|
92
63
|
} else {
|
|
93
64
|
_push2(`<!---->`);
|
|
94
65
|
}
|
|
95
66
|
_push2(`<!--[-->`);
|
|
96
|
-
serverRenderer.ssrRenderList(
|
|
97
|
-
|
|
98
|
-
_push2(serverRenderer.ssrRenderComponent(vue.unref(vue$1.VisArea), {
|
|
99
|
-
x: (_2,
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
|
-
opacity: ((_a = legendItems.value.find((item) => item.name === category)) == null ? void 0 : _a.inactive) ? _ctx.filterOpacity : 1
|
|
109
|
-
}, null, _parent2, _scopeId));
|
|
110
|
-
});
|
|
111
|
-
_push2(`<!--]--><!--[-->`);
|
|
112
|
-
serverRenderer.ssrRenderList(_ctx.categories, (category, i) => {
|
|
113
|
-
var _a;
|
|
67
|
+
serverRenderer.ssrRenderList(Object.keys(props.categories), (i, iKey) => {
|
|
68
|
+
_push2(`<!--[-->`);
|
|
69
|
+
_push2(serverRenderer.ssrRenderComponent(vue.unref(vue$1.VisArea), vue.mergeProps({
|
|
70
|
+
x: (_2, i2) => i2,
|
|
71
|
+
ref_for: true
|
|
72
|
+
}, accessors(i), {
|
|
73
|
+
color: `url(#gradient${iKey}-${vue.unref(colors)[iKey]})`,
|
|
74
|
+
opacity: 0.5,
|
|
75
|
+
"curve-type": _ctx.curveType ?? vue.unref(ts.CurveType).MonotoneX
|
|
76
|
+
}), null, _parent2, _scopeId));
|
|
114
77
|
_push2(serverRenderer.ssrRenderComponent(vue.unref(vue$1.VisLine), {
|
|
115
78
|
x: (_2, i2) => i2,
|
|
116
|
-
y: (d) => d[
|
|
117
|
-
color: colors
|
|
118
|
-
"curve-type": _ctx.curveType
|
|
119
|
-
attributes: {
|
|
120
|
-
[vue.unref(ts.Line).selectors.line]: {
|
|
121
|
-
opacity: ((_a = legendItems.value.find((item) => item.name === category)) == null ? void 0 : _a.inactive) ? _ctx.filterOpacity : 1
|
|
122
|
-
}
|
|
123
|
-
}
|
|
79
|
+
y: (d) => d[i],
|
|
80
|
+
color: vue.unref(colors)[iKey],
|
|
81
|
+
"curve-type": _ctx.curveType ?? vue.unref(ts.CurveType).MonotoneX
|
|
124
82
|
}, null, _parent2, _scopeId));
|
|
83
|
+
_push2(`<!--]-->`);
|
|
125
84
|
});
|
|
126
85
|
_push2(`<!--]-->`);
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
"tick-format": _ctx.yFormatter,
|
|
146
|
-
"domain-line": false,
|
|
147
|
-
"grid-line": _ctx.showGridLine,
|
|
148
|
-
attributes: {
|
|
149
|
-
[vue.unref(ts.Axis).selectors.grid]: {
|
|
150
|
-
class: "text-muted"
|
|
151
|
-
}
|
|
152
|
-
},
|
|
153
|
-
"tick-text-color": "hsl(var(--vis-text-color))"
|
|
154
|
-
}, null, _parent2, _scopeId));
|
|
155
|
-
} else {
|
|
156
|
-
_push2(`<!---->`);
|
|
157
|
-
}
|
|
158
|
-
serverRenderer.ssrRenderSlot(_ctx.$slots, "default", {}, null, _push2, _parent2, _scopeId);
|
|
86
|
+
_push2(serverRenderer.ssrRenderComponent(vue.unref(vue$1.VisAxis), {
|
|
87
|
+
type: "x",
|
|
88
|
+
"tick-format": _ctx.xFormatter,
|
|
89
|
+
"num-ticks": _ctx.xNumTicks,
|
|
90
|
+
label: _ctx.xLabel,
|
|
91
|
+
"grid-line": _ctx.gridLineX,
|
|
92
|
+
"domain-line": _ctx.domainLineX,
|
|
93
|
+
"tick-line": !!_ctx.gridLineX
|
|
94
|
+
}, null, _parent2, _scopeId));
|
|
95
|
+
_push2(serverRenderer.ssrRenderComponent(vue.unref(vue$1.VisAxis), {
|
|
96
|
+
type: "y",
|
|
97
|
+
"num-ticks": _ctx.yNumTicks ?? _ctx.data.length,
|
|
98
|
+
"tick-format": _ctx.yFormatter,
|
|
99
|
+
label: _ctx.yLabel,
|
|
100
|
+
"grid-line": _ctx.gridLineY,
|
|
101
|
+
"domain-line": _ctx.domainLineY,
|
|
102
|
+
"tick-line": !!_ctx.gridLineY
|
|
103
|
+
}, null, _parent2, _scopeId));
|
|
159
104
|
} else {
|
|
160
105
|
return [
|
|
161
|
-
(vue.openBlock(), vue.createBlock(
|
|
162
|
-
width: "0",
|
|
163
|
-
height: "0"
|
|
164
|
-
}, [
|
|
165
|
-
vue.createVNode("defs", null, [
|
|
166
|
-
(vue.openBlock(true), vue.createBlock(vue.Fragment, null, vue.renderList(colors.value, (color, i) => {
|
|
167
|
-
return vue.openBlock(), vue.createBlock("linearGradient", {
|
|
168
|
-
key: i,
|
|
169
|
-
x1: "0",
|
|
170
|
-
y1: "0",
|
|
171
|
-
x2: "0",
|
|
172
|
-
y2: "1"
|
|
173
|
-
}, [
|
|
174
|
-
_ctx.showGradiant ? (vue.openBlock(), vue.createBlock(vue.Fragment, { key: 0 }, [
|
|
175
|
-
vue.createVNode("stop", {
|
|
176
|
-
offset: "5%",
|
|
177
|
-
"stop-color": color,
|
|
178
|
-
"stop-opacity": "0.4"
|
|
179
|
-
}, null, 8, ["stop-color"]),
|
|
180
|
-
vue.createVNode("stop", {
|
|
181
|
-
offset: "95%",
|
|
182
|
-
"stop-color": color,
|
|
183
|
-
"stop-opacity": "0"
|
|
184
|
-
}, null, 8, ["stop-color"])
|
|
185
|
-
], 64)) : (vue.openBlock(), vue.createBlock("stop", {
|
|
186
|
-
key: 1,
|
|
187
|
-
offset: "0%",
|
|
188
|
-
"stop-color": color
|
|
189
|
-
}, null, 8, ["stop-color"]))
|
|
190
|
-
]);
|
|
191
|
-
}), 128))
|
|
192
|
-
])
|
|
193
|
-
])),
|
|
194
|
-
_ctx.showTooltip ? (vue.openBlock(), vue.createBlock(_component_ChartCrosshair, {
|
|
106
|
+
!_ctx.hideTooltip ? (vue.openBlock(), vue.createBlock(vue.unref(vue$1.VisTooltip), {
|
|
195
107
|
key: 0,
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
"curve-type"
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
}), 128)),
|
|
217
|
-
(vue.openBlock(true), vue.createBlock(vue.Fragment, null, vue.renderList(_ctx.categories, (category, i) => {
|
|
218
|
-
var _a;
|
|
219
|
-
return vue.openBlock(), vue.createBlock(vue.unref(vue$1.VisLine), {
|
|
220
|
-
key: category,
|
|
221
|
-
x: (_2, i2) => i2,
|
|
222
|
-
y: (d) => d[category],
|
|
223
|
-
color: colors.value[i],
|
|
224
|
-
"curve-type": _ctx.curveType,
|
|
225
|
-
attributes: {
|
|
226
|
-
[vue.unref(ts.Line).selectors.line]: {
|
|
227
|
-
opacity: ((_a = legendItems.value.find((item) => item.name === category)) == null ? void 0 : _a.inactive) ? _ctx.filterOpacity : 1
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
}, null, 8, ["x", "y", "color", "curve-type", "attributes"]);
|
|
108
|
+
"horizontal-placement": vue.unref(ts.Position).Right,
|
|
109
|
+
"vertical-placement": vue.unref(ts.Position).Top
|
|
110
|
+
}, null, 8, ["horizontal-placement", "vertical-placement"])) : vue.createCommentVNode("", true),
|
|
111
|
+
(vue.openBlock(true), vue.createBlock(vue.Fragment, null, vue.renderList(Object.keys(props.categories), (i, iKey) => {
|
|
112
|
+
return vue.openBlock(), vue.createBlock(vue.Fragment, { key: iKey }, [
|
|
113
|
+
vue.createVNode(vue.unref(vue$1.VisArea), vue.mergeProps({
|
|
114
|
+
x: (_2, i2) => i2,
|
|
115
|
+
ref_for: true
|
|
116
|
+
}, accessors(i), {
|
|
117
|
+
color: `url(#gradient${iKey}-${vue.unref(colors)[iKey]})`,
|
|
118
|
+
opacity: 0.5,
|
|
119
|
+
"curve-type": _ctx.curveType ?? vue.unref(ts.CurveType).MonotoneX
|
|
120
|
+
}), null, 16, ["x", "color", "curve-type"]),
|
|
121
|
+
vue.createVNode(vue.unref(vue$1.VisLine), {
|
|
122
|
+
x: (_2, i2) => i2,
|
|
123
|
+
y: (d) => d[i],
|
|
124
|
+
color: vue.unref(colors)[iKey],
|
|
125
|
+
"curve-type": _ctx.curveType ?? vue.unref(ts.CurveType).MonotoneX
|
|
126
|
+
}, null, 8, ["x", "y", "color", "curve-type"])
|
|
127
|
+
], 64);
|
|
231
128
|
}), 128)),
|
|
232
|
-
|
|
233
|
-
key: 1,
|
|
129
|
+
vue.createVNode(vue.unref(vue$1.VisAxis), {
|
|
234
130
|
type: "x",
|
|
235
|
-
"tick-format": _ctx.xFormatter
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
"
|
|
240
|
-
"tick-line":
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
_ctx.showYAxis ? (vue.openBlock(), vue.createBlock(vue.unref(vue$1.VisAxis), {
|
|
244
|
-
key: 2,
|
|
131
|
+
"tick-format": _ctx.xFormatter,
|
|
132
|
+
"num-ticks": _ctx.xNumTicks,
|
|
133
|
+
label: _ctx.xLabel,
|
|
134
|
+
"grid-line": _ctx.gridLineX,
|
|
135
|
+
"domain-line": _ctx.domainLineX,
|
|
136
|
+
"tick-line": !!_ctx.gridLineX
|
|
137
|
+
}, null, 8, ["tick-format", "num-ticks", "label", "grid-line", "domain-line", "tick-line"]),
|
|
138
|
+
vue.createVNode(vue.unref(vue$1.VisAxis), {
|
|
245
139
|
type: "y",
|
|
246
|
-
"
|
|
140
|
+
"num-ticks": _ctx.yNumTicks ?? _ctx.data.length,
|
|
247
141
|
"tick-format": _ctx.yFormatter,
|
|
248
|
-
|
|
249
|
-
"grid-line": _ctx.
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
}
|
|
254
|
-
},
|
|
255
|
-
"tick-text-color": "hsl(var(--vis-text-color))"
|
|
256
|
-
}, null, 8, ["tick-format", "grid-line", "attributes"])) : vue.createCommentVNode("", true),
|
|
257
|
-
vue.renderSlot(_ctx.$slots, "default")
|
|
142
|
+
label: _ctx.yLabel,
|
|
143
|
+
"grid-line": _ctx.gridLineY,
|
|
144
|
+
"domain-line": _ctx.domainLineY,
|
|
145
|
+
"tick-line": !!_ctx.gridLineY
|
|
146
|
+
}, null, 8, ["num-ticks", "tick-format", "label", "grid-line", "domain-line", "tick-line"])
|
|
258
147
|
];
|
|
259
148
|
}
|
|
260
149
|
}),
|
|
261
|
-
_:
|
|
150
|
+
_: 1
|
|
262
151
|
}, _parent));
|
|
152
|
+
if (!_ctx.hideLegend) {
|
|
153
|
+
_push(`<div class="flex items center justify-end">`);
|
|
154
|
+
_push(serverRenderer.ssrRenderComponent(vue.unref(vue$1.VisBulletLegend), {
|
|
155
|
+
items: Object.values(_ctx.categories)
|
|
156
|
+
}, null, _parent));
|
|
157
|
+
_push(`</div>`);
|
|
158
|
+
} else {
|
|
159
|
+
_push(`<!---->`);
|
|
160
|
+
}
|
|
263
161
|
_push(`</div>`);
|
|
264
162
|
};
|
|
265
163
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,266 +1,163 @@
|
|
|
1
|
-
import { defineComponent,
|
|
2
|
-
import { ssrRenderAttrs, ssrRenderComponent, ssrRenderList,
|
|
3
|
-
import {
|
|
4
|
-
import { VisXYContainer, VisArea, VisLine, VisAxis } from "@unovis/vue";
|
|
5
|
-
import { useMounted } from "@vueuse/core";
|
|
1
|
+
import { defineComponent, mergeProps, unref, withCtx, createBlock, createCommentVNode, createVNode, openBlock, Fragment, renderList, useSSRContext } from "vue";
|
|
2
|
+
import { ssrRenderAttrs, ssrRenderComponent, ssrRenderList, ssrRenderSlot } from "vue/server-renderer";
|
|
3
|
+
import { Position, CurveType } from "@unovis/ts";
|
|
4
|
+
import { VisXYContainer, VisTooltip, VisArea, VisLine, VisAxis, VisBulletLegend } from "@unovis/vue";
|
|
6
5
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
7
6
|
__name: "Area",
|
|
8
7
|
__ssrInlineRender: true,
|
|
9
8
|
props: {
|
|
10
9
|
data: {},
|
|
10
|
+
height: {},
|
|
11
|
+
xLabel: {},
|
|
12
|
+
yLabel: {},
|
|
11
13
|
categories: {},
|
|
12
|
-
index: {},
|
|
13
|
-
colors: {},
|
|
14
|
-
margin: { default: () => ({ top: 0, bottom: 0, left: 0, right: 0 }) },
|
|
15
|
-
filterOpacity: { default: 0.2 },
|
|
16
14
|
xFormatter: {},
|
|
17
15
|
yFormatter: {},
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
16
|
+
curveType: {},
|
|
17
|
+
xNumTicks: { default: (props) => props.data.length > 24 ? 24 / 4 : props.data.length - 1 },
|
|
18
|
+
yNumTicks: { default: (props) => props.data.length > 24 ? 24 / 4 : props.data.length - 1 },
|
|
19
|
+
hideLegend: { type: Boolean },
|
|
20
|
+
hideTooltip: { type: Boolean },
|
|
21
|
+
gridLineX: { type: Boolean },
|
|
22
|
+
domainLineX: { type: Boolean },
|
|
23
|
+
gridLineY: { type: Boolean },
|
|
24
|
+
domainLineY: { type: Boolean },
|
|
25
|
+
paginationPoisition: {}
|
|
26
26
|
},
|
|
27
|
-
|
|
28
|
-
setup(__props, { emit: __emit }) {
|
|
29
|
-
function defaultColors(count = 3) {
|
|
30
|
-
const quotient = Math.floor(count / 2);
|
|
31
|
-
const remainder = count % 2;
|
|
32
|
-
const primaryCount = quotient + remainder;
|
|
33
|
-
const secondaryCount = quotient;
|
|
34
|
-
return [
|
|
35
|
-
...Array.from(new Array(primaryCount).keys()).map((i) => `hsl(var(--vis-primary-color) / ${1 - 1 / primaryCount * i})`),
|
|
36
|
-
...Array.from(new Array(secondaryCount).keys()).map((i) => `hsl(var(--vis-secondary-color) / ${1 - 1 / secondaryCount * i})`)
|
|
37
|
-
];
|
|
38
|
-
}
|
|
27
|
+
setup(__props) {
|
|
39
28
|
const props = __props;
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
const colors = computed(() => {
|
|
29
|
+
const colors = Object.values(props.categories).map((c) => c.color);
|
|
30
|
+
function accessors(id) {
|
|
43
31
|
var _a;
|
|
44
|
-
return
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
color: colors.value[i],
|
|
49
|
-
inactive: false
|
|
50
|
-
})));
|
|
51
|
-
const isMounted = useMounted();
|
|
52
|
-
function handleLegendItemClick(d, i) {
|
|
53
|
-
emits("legendItemClick", d, i);
|
|
32
|
+
return {
|
|
33
|
+
y: (d) => Number(d[id]),
|
|
34
|
+
color: ((_a = props.categories[id]) == null ? void 0 : _a.color) ?? "#3b82f6"
|
|
35
|
+
};
|
|
54
36
|
}
|
|
37
|
+
const svgDefs = colors.map(
|
|
38
|
+
(color, index) => `
|
|
39
|
+
<linearGradient id="gradient${index}-${color}" gradientTransform="rotate(90)">
|
|
40
|
+
<stop offset="0%" stop-color="${color}" stop-opacity="1" />
|
|
41
|
+
<stop offset="100%" stop-color="${color}" stop-opacity="0" />
|
|
42
|
+
</linearGradient>
|
|
43
|
+
`
|
|
44
|
+
).join("");
|
|
55
45
|
return (_ctx, _push, _parent, _attrs) => {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
items: legendItems.value,
|
|
62
|
-
"onUpdate:items": ($event) => legendItems.value = $event,
|
|
63
|
-
onLegendItemClick: handleLegendItemClick
|
|
64
|
-
}, null, _parent));
|
|
65
|
-
} else {
|
|
66
|
-
_push(`<!---->`);
|
|
67
|
-
}
|
|
46
|
+
_push(`<div${ssrRenderAttrs(mergeProps({
|
|
47
|
+
class: ["flex flex-col space-y-4", {
|
|
48
|
+
"flex-col-reverse": props.paginationPoisition === "top"
|
|
49
|
+
}]
|
|
50
|
+
}, _attrs))}>`);
|
|
68
51
|
_push(ssrRenderComponent(unref(VisXYContainer), {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
52
|
+
data: _ctx.data,
|
|
53
|
+
height: _ctx.height,
|
|
54
|
+
"svg-defs": unref(svgDefs)
|
|
72
55
|
}, {
|
|
73
56
|
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
74
57
|
if (_push2) {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
_push2(`<!--[--><stop offset="5%"${ssrRenderAttr("stop-color", color)} stop-opacity="0.4"${_scopeId}></stop><stop offset="95%"${ssrRenderAttr("stop-color", color)} stop-opacity="0"${_scopeId}></stop><!--]-->`);
|
|
80
|
-
} else {
|
|
81
|
-
_push2(`<stop offset="0%"${ssrRenderAttr("stop-color", color)}${_scopeId}></stop>`);
|
|
82
|
-
}
|
|
83
|
-
_push2(`</linearGradient>`);
|
|
84
|
-
});
|
|
85
|
-
_push2(`<!--]--></defs></svg>`);
|
|
86
|
-
if (_ctx.showTooltip) {
|
|
87
|
-
_push2(ssrRenderComponent(_component_ChartCrosshair, {
|
|
88
|
-
colors: colors.value,
|
|
89
|
-
items: legendItems.value,
|
|
90
|
-
index: index.value,
|
|
91
|
-
"custom-tooltip": _ctx.customTooltip
|
|
58
|
+
if (!_ctx.hideTooltip) {
|
|
59
|
+
_push2(ssrRenderComponent(unref(VisTooltip), {
|
|
60
|
+
"horizontal-placement": unref(Position).Right,
|
|
61
|
+
"vertical-placement": unref(Position).Top
|
|
92
62
|
}, null, _parent2, _scopeId));
|
|
93
63
|
} else {
|
|
94
64
|
_push2(`<!---->`);
|
|
95
65
|
}
|
|
96
66
|
_push2(`<!--[-->`);
|
|
97
|
-
ssrRenderList(
|
|
98
|
-
|
|
99
|
-
_push2(ssrRenderComponent(unref(VisArea), {
|
|
100
|
-
x: (_2,
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
108
|
-
},
|
|
109
|
-
opacity: ((_a = legendItems.value.find((item) => item.name === category)) == null ? void 0 : _a.inactive) ? _ctx.filterOpacity : 1
|
|
110
|
-
}, null, _parent2, _scopeId));
|
|
111
|
-
});
|
|
112
|
-
_push2(`<!--]--><!--[-->`);
|
|
113
|
-
ssrRenderList(_ctx.categories, (category, i) => {
|
|
114
|
-
var _a;
|
|
67
|
+
ssrRenderList(Object.keys(props.categories), (i, iKey) => {
|
|
68
|
+
_push2(`<!--[-->`);
|
|
69
|
+
_push2(ssrRenderComponent(unref(VisArea), mergeProps({
|
|
70
|
+
x: (_2, i2) => i2,
|
|
71
|
+
ref_for: true
|
|
72
|
+
}, accessors(i), {
|
|
73
|
+
color: `url(#gradient${iKey}-${unref(colors)[iKey]})`,
|
|
74
|
+
opacity: 0.5,
|
|
75
|
+
"curve-type": _ctx.curveType ?? unref(CurveType).MonotoneX
|
|
76
|
+
}), null, _parent2, _scopeId));
|
|
115
77
|
_push2(ssrRenderComponent(unref(VisLine), {
|
|
116
78
|
x: (_2, i2) => i2,
|
|
117
|
-
y: (d) => d[
|
|
118
|
-
color: colors
|
|
119
|
-
"curve-type": _ctx.curveType
|
|
120
|
-
attributes: {
|
|
121
|
-
[unref(Line).selectors.line]: {
|
|
122
|
-
opacity: ((_a = legendItems.value.find((item) => item.name === category)) == null ? void 0 : _a.inactive) ? _ctx.filterOpacity : 1
|
|
123
|
-
}
|
|
124
|
-
}
|
|
79
|
+
y: (d) => d[i],
|
|
80
|
+
color: unref(colors)[iKey],
|
|
81
|
+
"curve-type": _ctx.curveType ?? unref(CurveType).MonotoneX
|
|
125
82
|
}, null, _parent2, _scopeId));
|
|
83
|
+
_push2(`<!--]-->`);
|
|
126
84
|
});
|
|
127
85
|
_push2(`<!--]-->`);
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
"tick-format": _ctx.yFormatter,
|
|
147
|
-
"domain-line": false,
|
|
148
|
-
"grid-line": _ctx.showGridLine,
|
|
149
|
-
attributes: {
|
|
150
|
-
[unref(Axis).selectors.grid]: {
|
|
151
|
-
class: "text-muted"
|
|
152
|
-
}
|
|
153
|
-
},
|
|
154
|
-
"tick-text-color": "hsl(var(--vis-text-color))"
|
|
155
|
-
}, null, _parent2, _scopeId));
|
|
156
|
-
} else {
|
|
157
|
-
_push2(`<!---->`);
|
|
158
|
-
}
|
|
159
|
-
ssrRenderSlot(_ctx.$slots, "default", {}, null, _push2, _parent2, _scopeId);
|
|
86
|
+
_push2(ssrRenderComponent(unref(VisAxis), {
|
|
87
|
+
type: "x",
|
|
88
|
+
"tick-format": _ctx.xFormatter,
|
|
89
|
+
"num-ticks": _ctx.xNumTicks,
|
|
90
|
+
label: _ctx.xLabel,
|
|
91
|
+
"grid-line": _ctx.gridLineX,
|
|
92
|
+
"domain-line": _ctx.domainLineX,
|
|
93
|
+
"tick-line": !!_ctx.gridLineX
|
|
94
|
+
}, null, _parent2, _scopeId));
|
|
95
|
+
_push2(ssrRenderComponent(unref(VisAxis), {
|
|
96
|
+
type: "y",
|
|
97
|
+
"num-ticks": _ctx.yNumTicks ?? _ctx.data.length,
|
|
98
|
+
"tick-format": _ctx.yFormatter,
|
|
99
|
+
label: _ctx.yLabel,
|
|
100
|
+
"grid-line": _ctx.gridLineY,
|
|
101
|
+
"domain-line": _ctx.domainLineY,
|
|
102
|
+
"tick-line": !!_ctx.gridLineY
|
|
103
|
+
}, null, _parent2, _scopeId));
|
|
160
104
|
} else {
|
|
161
105
|
return [
|
|
162
|
-
(openBlock(), createBlock(
|
|
163
|
-
width: "0",
|
|
164
|
-
height: "0"
|
|
165
|
-
}, [
|
|
166
|
-
createVNode("defs", null, [
|
|
167
|
-
(openBlock(true), createBlock(Fragment, null, renderList(colors.value, (color, i) => {
|
|
168
|
-
return openBlock(), createBlock("linearGradient", {
|
|
169
|
-
key: i,
|
|
170
|
-
x1: "0",
|
|
171
|
-
y1: "0",
|
|
172
|
-
x2: "0",
|
|
173
|
-
y2: "1"
|
|
174
|
-
}, [
|
|
175
|
-
_ctx.showGradiant ? (openBlock(), createBlock(Fragment, { key: 0 }, [
|
|
176
|
-
createVNode("stop", {
|
|
177
|
-
offset: "5%",
|
|
178
|
-
"stop-color": color,
|
|
179
|
-
"stop-opacity": "0.4"
|
|
180
|
-
}, null, 8, ["stop-color"]),
|
|
181
|
-
createVNode("stop", {
|
|
182
|
-
offset: "95%",
|
|
183
|
-
"stop-color": color,
|
|
184
|
-
"stop-opacity": "0"
|
|
185
|
-
}, null, 8, ["stop-color"])
|
|
186
|
-
], 64)) : (openBlock(), createBlock("stop", {
|
|
187
|
-
key: 1,
|
|
188
|
-
offset: "0%",
|
|
189
|
-
"stop-color": color
|
|
190
|
-
}, null, 8, ["stop-color"]))
|
|
191
|
-
]);
|
|
192
|
-
}), 128))
|
|
193
|
-
])
|
|
194
|
-
])),
|
|
195
|
-
_ctx.showTooltip ? (openBlock(), createBlock(_component_ChartCrosshair, {
|
|
106
|
+
!_ctx.hideTooltip ? (openBlock(), createBlock(unref(VisTooltip), {
|
|
196
107
|
key: 0,
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
"curve-type"
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
}), 128)),
|
|
218
|
-
(openBlock(true), createBlock(Fragment, null, renderList(_ctx.categories, (category, i) => {
|
|
219
|
-
var _a;
|
|
220
|
-
return openBlock(), createBlock(unref(VisLine), {
|
|
221
|
-
key: category,
|
|
222
|
-
x: (_2, i2) => i2,
|
|
223
|
-
y: (d) => d[category],
|
|
224
|
-
color: colors.value[i],
|
|
225
|
-
"curve-type": _ctx.curveType,
|
|
226
|
-
attributes: {
|
|
227
|
-
[unref(Line).selectors.line]: {
|
|
228
|
-
opacity: ((_a = legendItems.value.find((item) => item.name === category)) == null ? void 0 : _a.inactive) ? _ctx.filterOpacity : 1
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
}, null, 8, ["x", "y", "color", "curve-type", "attributes"]);
|
|
108
|
+
"horizontal-placement": unref(Position).Right,
|
|
109
|
+
"vertical-placement": unref(Position).Top
|
|
110
|
+
}, null, 8, ["horizontal-placement", "vertical-placement"])) : createCommentVNode("", true),
|
|
111
|
+
(openBlock(true), createBlock(Fragment, null, renderList(Object.keys(props.categories), (i, iKey) => {
|
|
112
|
+
return openBlock(), createBlock(Fragment, { key: iKey }, [
|
|
113
|
+
createVNode(unref(VisArea), mergeProps({
|
|
114
|
+
x: (_2, i2) => i2,
|
|
115
|
+
ref_for: true
|
|
116
|
+
}, accessors(i), {
|
|
117
|
+
color: `url(#gradient${iKey}-${unref(colors)[iKey]})`,
|
|
118
|
+
opacity: 0.5,
|
|
119
|
+
"curve-type": _ctx.curveType ?? unref(CurveType).MonotoneX
|
|
120
|
+
}), null, 16, ["x", "color", "curve-type"]),
|
|
121
|
+
createVNode(unref(VisLine), {
|
|
122
|
+
x: (_2, i2) => i2,
|
|
123
|
+
y: (d) => d[i],
|
|
124
|
+
color: unref(colors)[iKey],
|
|
125
|
+
"curve-type": _ctx.curveType ?? unref(CurveType).MonotoneX
|
|
126
|
+
}, null, 8, ["x", "y", "color", "curve-type"])
|
|
127
|
+
], 64);
|
|
232
128
|
}), 128)),
|
|
233
|
-
|
|
234
|
-
key: 1,
|
|
129
|
+
createVNode(unref(VisAxis), {
|
|
235
130
|
type: "x",
|
|
236
|
-
"tick-format": _ctx.xFormatter
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
"
|
|
241
|
-
"tick-line":
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
_ctx.showYAxis ? (openBlock(), createBlock(unref(VisAxis), {
|
|
245
|
-
key: 2,
|
|
131
|
+
"tick-format": _ctx.xFormatter,
|
|
132
|
+
"num-ticks": _ctx.xNumTicks,
|
|
133
|
+
label: _ctx.xLabel,
|
|
134
|
+
"grid-line": _ctx.gridLineX,
|
|
135
|
+
"domain-line": _ctx.domainLineX,
|
|
136
|
+
"tick-line": !!_ctx.gridLineX
|
|
137
|
+
}, null, 8, ["tick-format", "num-ticks", "label", "grid-line", "domain-line", "tick-line"]),
|
|
138
|
+
createVNode(unref(VisAxis), {
|
|
246
139
|
type: "y",
|
|
247
|
-
"
|
|
140
|
+
"num-ticks": _ctx.yNumTicks ?? _ctx.data.length,
|
|
248
141
|
"tick-format": _ctx.yFormatter,
|
|
249
|
-
|
|
250
|
-
"grid-line": _ctx.
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
}
|
|
255
|
-
},
|
|
256
|
-
"tick-text-color": "hsl(var(--vis-text-color))"
|
|
257
|
-
}, null, 8, ["tick-format", "grid-line", "attributes"])) : createCommentVNode("", true),
|
|
258
|
-
renderSlot(_ctx.$slots, "default")
|
|
142
|
+
label: _ctx.yLabel,
|
|
143
|
+
"grid-line": _ctx.gridLineY,
|
|
144
|
+
"domain-line": _ctx.domainLineY,
|
|
145
|
+
"tick-line": !!_ctx.gridLineY
|
|
146
|
+
}, null, 8, ["num-ticks", "tick-format", "label", "grid-line", "domain-line", "tick-line"])
|
|
259
147
|
];
|
|
260
148
|
}
|
|
261
149
|
}),
|
|
262
|
-
_:
|
|
150
|
+
_: 1
|
|
263
151
|
}, _parent));
|
|
152
|
+
if (!_ctx.hideLegend) {
|
|
153
|
+
_push(`<div class="flex items center justify-end">`);
|
|
154
|
+
_push(ssrRenderComponent(unref(VisBulletLegend), {
|
|
155
|
+
items: Object.values(_ctx.categories)
|
|
156
|
+
}, null, _parent));
|
|
157
|
+
_push(`</div>`);
|
|
158
|
+
} else {
|
|
159
|
+
_push(`<!---->`);
|
|
160
|
+
}
|
|
264
161
|
_push(`</div>`);
|
|
265
162
|
};
|
|
266
163
|
}
|