vue-chrts 0.0.46 → 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 +215 -0
- package/dist/index.js +215 -0
- package/package.json +1 -1
- package/dist/vue-chrts.js +0 -7814
- package/dist/vue-chrts.umd.cjs +0 -225
|
@@ -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
ADDED
|
@@ -0,0 +1,215 @@
|
|
|
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")) : 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
|
+
"use strict";
|
|
5
|
+
const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
|
|
6
|
+
__name: "Area",
|
|
7
|
+
__ssrInlineRender: true,
|
|
8
|
+
props: {
|
|
9
|
+
data: {},
|
|
10
|
+
height: {},
|
|
11
|
+
xLabel: {},
|
|
12
|
+
yLabel: {},
|
|
13
|
+
categories: {},
|
|
14
|
+
xFormatter: {},
|
|
15
|
+
yFormatter: {},
|
|
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
|
+
},
|
|
27
|
+
setup(__props) {
|
|
28
|
+
const props = __props;
|
|
29
|
+
const colors = Object.values(props.categories).map((c) => c.color);
|
|
30
|
+
function accessors(id) {
|
|
31
|
+
var _a;
|
|
32
|
+
return {
|
|
33
|
+
y: (d) => Number(d[id]),
|
|
34
|
+
color: ((_a = props.categories[id]) == null ? void 0 : _a.color) ?? "#3b82f6"
|
|
35
|
+
};
|
|
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("");
|
|
45
|
+
return (_ctx, _push, _parent, _attrs) => {
|
|
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))}>`);
|
|
51
|
+
_push(serverRenderer.ssrRenderComponent(vue.unref(vue$1.VisXYContainer), {
|
|
52
|
+
data: _ctx.data,
|
|
53
|
+
height: _ctx.height,
|
|
54
|
+
"svg-defs": vue.unref(svgDefs)
|
|
55
|
+
}, {
|
|
56
|
+
default: vue.withCtx((_, _push2, _parent2, _scopeId) => {
|
|
57
|
+
if (_push2) {
|
|
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
|
|
62
|
+
}, null, _parent2, _scopeId));
|
|
63
|
+
} else {
|
|
64
|
+
_push2(`<!---->`);
|
|
65
|
+
}
|
|
66
|
+
_push2(`<!--[-->`);
|
|
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));
|
|
77
|
+
_push2(serverRenderer.ssrRenderComponent(vue.unref(vue$1.VisLine), {
|
|
78
|
+
x: (_2, i2) => i2,
|
|
79
|
+
y: (d) => d[i],
|
|
80
|
+
color: vue.unref(colors)[iKey],
|
|
81
|
+
"curve-type": _ctx.curveType ?? vue.unref(ts.CurveType).MonotoneX
|
|
82
|
+
}, null, _parent2, _scopeId));
|
|
83
|
+
_push2(`<!--]-->`);
|
|
84
|
+
});
|
|
85
|
+
_push2(`<!--]-->`);
|
|
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));
|
|
104
|
+
} else {
|
|
105
|
+
return [
|
|
106
|
+
!_ctx.hideTooltip ? (vue.openBlock(), vue.createBlock(vue.unref(vue$1.VisTooltip), {
|
|
107
|
+
key: 0,
|
|
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);
|
|
128
|
+
}), 128)),
|
|
129
|
+
vue.createVNode(vue.unref(vue$1.VisAxis), {
|
|
130
|
+
type: "x",
|
|
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), {
|
|
139
|
+
type: "y",
|
|
140
|
+
"num-ticks": _ctx.yNumTicks ?? _ctx.data.length,
|
|
141
|
+
"tick-format": _ctx.yFormatter,
|
|
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"])
|
|
147
|
+
];
|
|
148
|
+
}
|
|
149
|
+
}),
|
|
150
|
+
_: 1
|
|
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
|
+
}
|
|
161
|
+
_push(`</div>`);
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
const _sfc_setup$1 = _sfc_main$1.setup;
|
|
166
|
+
_sfc_main$1.setup = (props, ctx) => {
|
|
167
|
+
const ssrContext = vue.useSSRContext();
|
|
168
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/Area/Area.vue");
|
|
169
|
+
return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
|
|
170
|
+
};
|
|
171
|
+
var PaginationPosition = /* @__PURE__ */ ((PaginationPosition2) => {
|
|
172
|
+
PaginationPosition2["Top"] = "top";
|
|
173
|
+
PaginationPosition2["Bottom"] = "bottom";
|
|
174
|
+
return PaginationPosition2;
|
|
175
|
+
})(PaginationPosition || {});
|
|
176
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
177
|
+
__name: "Button",
|
|
178
|
+
__ssrInlineRender: true,
|
|
179
|
+
props: {
|
|
180
|
+
variant: {},
|
|
181
|
+
size: {}
|
|
182
|
+
},
|
|
183
|
+
setup(__props) {
|
|
184
|
+
return (_ctx, _push, _parent, _attrs) => {
|
|
185
|
+
_push(`<button${serverRenderer.ssrRenderAttrs(vue.mergeProps({
|
|
186
|
+
class: [
|
|
187
|
+
"button",
|
|
188
|
+
`button--${_ctx.variant || "primary"}`,
|
|
189
|
+
`button--${_ctx.size || "medium"}`
|
|
190
|
+
]
|
|
191
|
+
}, _attrs))} data-v-52b6ec0c>`);
|
|
192
|
+
serverRenderer.ssrRenderSlot(_ctx.$slots, "default", {}, null, _push, _parent);
|
|
193
|
+
_push(`</button>`);
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
const _export_sfc = (sfc, props) => {
|
|
198
|
+
const target = sfc.__vccOpts || sfc;
|
|
199
|
+
for (const [key, val] of props) {
|
|
200
|
+
target[key] = val;
|
|
201
|
+
}
|
|
202
|
+
return target;
|
|
203
|
+
};
|
|
204
|
+
const _sfc_setup = _sfc_main.setup;
|
|
205
|
+
_sfc_main.setup = (props, ctx) => {
|
|
206
|
+
const ssrContext = vue.useSSRContext();
|
|
207
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/Button/Button.vue");
|
|
208
|
+
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
|
|
209
|
+
};
|
|
210
|
+
const Button = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-52b6ec0c"]]);
|
|
211
|
+
exports2.Area = _sfc_main$1;
|
|
212
|
+
exports2.Button = Button;
|
|
213
|
+
exports2.PaginationPosition = PaginationPosition;
|
|
214
|
+
Object.defineProperty(exports2, Symbol.toStringTag, { value: "Module" });
|
|
215
|
+
});
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,215 @@
|
|
|
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";
|
|
5
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
6
|
+
__name: "Area",
|
|
7
|
+
__ssrInlineRender: true,
|
|
8
|
+
props: {
|
|
9
|
+
data: {},
|
|
10
|
+
height: {},
|
|
11
|
+
xLabel: {},
|
|
12
|
+
yLabel: {},
|
|
13
|
+
categories: {},
|
|
14
|
+
xFormatter: {},
|
|
15
|
+
yFormatter: {},
|
|
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
|
+
},
|
|
27
|
+
setup(__props) {
|
|
28
|
+
const props = __props;
|
|
29
|
+
const colors = Object.values(props.categories).map((c) => c.color);
|
|
30
|
+
function accessors(id) {
|
|
31
|
+
var _a;
|
|
32
|
+
return {
|
|
33
|
+
y: (d) => Number(d[id]),
|
|
34
|
+
color: ((_a = props.categories[id]) == null ? void 0 : _a.color) ?? "#3b82f6"
|
|
35
|
+
};
|
|
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("");
|
|
45
|
+
return (_ctx, _push, _parent, _attrs) => {
|
|
46
|
+
_push(`<div${ssrRenderAttrs(mergeProps({
|
|
47
|
+
class: ["flex flex-col space-y-4", {
|
|
48
|
+
"flex-col-reverse": props.paginationPoisition === "top"
|
|
49
|
+
}]
|
|
50
|
+
}, _attrs))}>`);
|
|
51
|
+
_push(ssrRenderComponent(unref(VisXYContainer), {
|
|
52
|
+
data: _ctx.data,
|
|
53
|
+
height: _ctx.height,
|
|
54
|
+
"svg-defs": unref(svgDefs)
|
|
55
|
+
}, {
|
|
56
|
+
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
57
|
+
if (_push2) {
|
|
58
|
+
if (!_ctx.hideTooltip) {
|
|
59
|
+
_push2(ssrRenderComponent(unref(VisTooltip), {
|
|
60
|
+
"horizontal-placement": unref(Position).Right,
|
|
61
|
+
"vertical-placement": unref(Position).Top
|
|
62
|
+
}, null, _parent2, _scopeId));
|
|
63
|
+
} else {
|
|
64
|
+
_push2(`<!---->`);
|
|
65
|
+
}
|
|
66
|
+
_push2(`<!--[-->`);
|
|
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));
|
|
77
|
+
_push2(ssrRenderComponent(unref(VisLine), {
|
|
78
|
+
x: (_2, i2) => i2,
|
|
79
|
+
y: (d) => d[i],
|
|
80
|
+
color: unref(colors)[iKey],
|
|
81
|
+
"curve-type": _ctx.curveType ?? unref(CurveType).MonotoneX
|
|
82
|
+
}, null, _parent2, _scopeId));
|
|
83
|
+
_push2(`<!--]-->`);
|
|
84
|
+
});
|
|
85
|
+
_push2(`<!--]-->`);
|
|
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));
|
|
104
|
+
} else {
|
|
105
|
+
return [
|
|
106
|
+
!_ctx.hideTooltip ? (openBlock(), createBlock(unref(VisTooltip), {
|
|
107
|
+
key: 0,
|
|
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);
|
|
128
|
+
}), 128)),
|
|
129
|
+
createVNode(unref(VisAxis), {
|
|
130
|
+
type: "x",
|
|
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), {
|
|
139
|
+
type: "y",
|
|
140
|
+
"num-ticks": _ctx.yNumTicks ?? _ctx.data.length,
|
|
141
|
+
"tick-format": _ctx.yFormatter,
|
|
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"])
|
|
147
|
+
];
|
|
148
|
+
}
|
|
149
|
+
}),
|
|
150
|
+
_: 1
|
|
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
|
+
}
|
|
161
|
+
_push(`</div>`);
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
const _sfc_setup$1 = _sfc_main$1.setup;
|
|
166
|
+
_sfc_main$1.setup = (props, ctx) => {
|
|
167
|
+
const ssrContext = useSSRContext();
|
|
168
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/Area/Area.vue");
|
|
169
|
+
return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
|
|
170
|
+
};
|
|
171
|
+
var PaginationPosition = /* @__PURE__ */ ((PaginationPosition2) => {
|
|
172
|
+
PaginationPosition2["Top"] = "top";
|
|
173
|
+
PaginationPosition2["Bottom"] = "bottom";
|
|
174
|
+
return PaginationPosition2;
|
|
175
|
+
})(PaginationPosition || {});
|
|
176
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
177
|
+
__name: "Button",
|
|
178
|
+
__ssrInlineRender: true,
|
|
179
|
+
props: {
|
|
180
|
+
variant: {},
|
|
181
|
+
size: {}
|
|
182
|
+
},
|
|
183
|
+
setup(__props) {
|
|
184
|
+
return (_ctx, _push, _parent, _attrs) => {
|
|
185
|
+
_push(`<button${ssrRenderAttrs(mergeProps({
|
|
186
|
+
class: [
|
|
187
|
+
"button",
|
|
188
|
+
`button--${_ctx.variant || "primary"}`,
|
|
189
|
+
`button--${_ctx.size || "medium"}`
|
|
190
|
+
]
|
|
191
|
+
}, _attrs))} data-v-52b6ec0c>`);
|
|
192
|
+
ssrRenderSlot(_ctx.$slots, "default", {}, null, _push, _parent);
|
|
193
|
+
_push(`</button>`);
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
const _export_sfc = (sfc, props) => {
|
|
198
|
+
const target = sfc.__vccOpts || sfc;
|
|
199
|
+
for (const [key, val] of props) {
|
|
200
|
+
target[key] = val;
|
|
201
|
+
}
|
|
202
|
+
return target;
|
|
203
|
+
};
|
|
204
|
+
const _sfc_setup = _sfc_main.setup;
|
|
205
|
+
_sfc_main.setup = (props, ctx) => {
|
|
206
|
+
const ssrContext = useSSRContext();
|
|
207
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/Button/Button.vue");
|
|
208
|
+
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
|
|
209
|
+
};
|
|
210
|
+
const Button = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-52b6ec0c"]]);
|
|
211
|
+
export {
|
|
212
|
+
_sfc_main$1 as Area,
|
|
213
|
+
Button,
|
|
214
|
+
PaginationPosition
|
|
215
|
+
};
|