vue-chrts 0.0.156 → 0.0.157

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 (96) hide show
  1. package/dist/Area/AreaChart.vue.d.ts +11 -0
  2. package/dist/Area/index.d.ts +23 -0
  3. package/dist/AreaStacked/AreaStackedChart.vue.d.ts +8 -0
  4. package/dist/AreaStacked/index.d.ts +7 -0
  5. package/dist/Bar/BarChart.vue.d.ts +11 -0
  6. package/dist/Bar/index.d.ts +23 -0
  7. package/dist/Donut/DonutChart.vue.d.ts +11 -0
  8. package/dist/Donut/index.d.ts +12 -0
  9. package/dist/Line/LineChart.vue.d.ts +8 -0
  10. package/dist/Line/index.d.ts +20 -0
  11. package/dist/Progress/Progress.vue.d.ts +2 -0
  12. package/dist/Status/Status.vue.d.ts +2 -0
  13. package/dist/Tooltip/Tooltip.vue.d.ts +10 -0
  14. package/dist/charts-CO6Yq10P.js +16172 -0
  15. package/dist/charts.d.ts +19 -0
  16. package/dist/index.d.ts +16 -1
  17. package/dist/index.js +192 -14
  18. package/package.json +16 -14
  19. package/dist/components/Area/AreaChart.cjs +0 -7
  20. package/dist/components/Area/AreaChart.cjs.map +0 -1
  21. package/dist/components/Area/AreaChart.js +0 -123
  22. package/dist/components/Area/AreaChart.js.map +0 -1
  23. package/dist/components/Area/AreaChart.vue.d.ts +0 -36
  24. package/dist/components/Area/AreaChart2.cjs +0 -2
  25. package/dist/components/Area/AreaChart2.cjs.map +0 -1
  26. package/dist/components/Area/AreaChart2.js +0 -5
  27. package/dist/components/Area/AreaChart2.js.map +0 -1
  28. package/dist/components/Area/index.d.ts +0 -1
  29. package/dist/components/AreaStacked/AreaStackedChart.cjs +0 -2
  30. package/dist/components/AreaStacked/AreaStackedChart.cjs.map +0 -1
  31. package/dist/components/AreaStacked/AreaStackedChart.js +0 -51
  32. package/dist/components/AreaStacked/AreaStackedChart.js.map +0 -1
  33. package/dist/components/AreaStacked/AreaStackedChart.vue.d.ts +0 -18
  34. package/dist/components/AreaStacked/AreaStackedChart2.cjs +0 -2
  35. package/dist/components/AreaStacked/AreaStackedChart2.cjs.map +0 -1
  36. package/dist/components/AreaStacked/AreaStackedChart2.js +0 -5
  37. package/dist/components/AreaStacked/AreaStackedChart2.js.map +0 -1
  38. package/dist/components/AreaStacked/index.d.ts +0 -1
  39. package/dist/components/Bar/BarChart.cjs +0 -2
  40. package/dist/components/Bar/BarChart.cjs.map +0 -1
  41. package/dist/components/Bar/BarChart.js +0 -107
  42. package/dist/components/Bar/BarChart.js.map +0 -1
  43. package/dist/components/Bar/BarChart.vue.d.ts +0 -36
  44. package/dist/components/Bar/BarChart2.cjs +0 -2
  45. package/dist/components/Bar/BarChart2.cjs.map +0 -1
  46. package/dist/components/Bar/BarChart2.js +0 -5
  47. package/dist/components/Bar/BarChart2.js.map +0 -1
  48. package/dist/components/Bar/index.d.ts +0 -1
  49. package/dist/components/Crosshair/Crosshair.cjs +0 -2
  50. package/dist/components/Crosshair/Crosshair.cjs.map +0 -1
  51. package/dist/components/Crosshair/Crosshair.js +0 -40
  52. package/dist/components/Crosshair/Crosshair.js.map +0 -1
  53. package/dist/components/Crosshair/Crosshair.vue.d.ts +0 -38
  54. package/dist/components/Crosshair/Crosshair2.cjs +0 -2
  55. package/dist/components/Crosshair/Crosshair2.cjs.map +0 -1
  56. package/dist/components/Crosshair/Crosshair2.js +0 -5
  57. package/dist/components/Crosshair/Crosshair2.js.map +0 -1
  58. package/dist/components/Crosshair/index.d.ts +0 -1
  59. package/dist/components/Donut/DonutChart.cjs +0 -6
  60. package/dist/components/Donut/DonutChart.cjs.map +0 -1
  61. package/dist/components/Donut/DonutChart.js +0 -59
  62. package/dist/components/Donut/DonutChart.js.map +0 -1
  63. package/dist/components/Donut/DonutChart.vue.d.ts +0 -31
  64. package/dist/components/Donut/DonutChart2.cjs +0 -2
  65. package/dist/components/Donut/DonutChart2.cjs.map +0 -1
  66. package/dist/components/Donut/DonutChart2.js +0 -5
  67. package/dist/components/Donut/DonutChart2.js.map +0 -1
  68. package/dist/components/Donut/index.d.ts +0 -1
  69. package/dist/components/Line/LineChart.cjs +0 -2
  70. package/dist/components/Line/LineChart.cjs.map +0 -1
  71. package/dist/components/Line/LineChart.js +0 -85
  72. package/dist/components/Line/LineChart.js.map +0 -1
  73. package/dist/components/Line/LineChart.vue.d.ts +0 -27
  74. package/dist/components/Line/LineChart2.cjs +0 -2
  75. package/dist/components/Line/LineChart2.cjs.map +0 -1
  76. package/dist/components/Line/LineChart2.js +0 -5
  77. package/dist/components/Line/LineChart2.js.map +0 -1
  78. package/dist/components/Line/index.d.ts +0 -1
  79. package/dist/components/Tooltip.cjs +0 -2
  80. package/dist/components/Tooltip.cjs.map +0 -1
  81. package/dist/components/Tooltip.js +0 -21
  82. package/dist/components/Tooltip.js.map +0 -1
  83. package/dist/components/Tooltip.vue.d.ts +0 -14
  84. package/dist/components/Tooltip2.cjs +0 -2
  85. package/dist/components/Tooltip2.cjs.map +0 -1
  86. package/dist/components/Tooltip2.js +0 -5
  87. package/dist/components/Tooltip2.js.map +0 -1
  88. package/dist/components.d.ts +0 -6
  89. package/dist/index.cjs +0 -2
  90. package/dist/index.cjs.map +0 -1
  91. package/dist/index.js.map +0 -1
  92. package/dist/types.cjs +0 -2
  93. package/dist/types.cjs.map +0 -1
  94. package/dist/types.d.ts +0 -4
  95. package/dist/types.js +0 -5
  96. package/dist/types.js.map +0 -1
@@ -0,0 +1,19 @@
1
+ import { AreaChart } from './Area/index';
2
+ import { AreaStackedChart } from './AreaStacked/index';
3
+ import { BarChart } from './Bar/index';
4
+ import { DonutChart } from './Donut/index';
5
+ import { LineChart, PaginationPosition } from './Line/index';
6
+ import { AreaChartProps } from './Area';
7
+ import { AreaStackedChartProps } from './AreaStacked';
8
+ import { BarChartProps } from './Bar';
9
+ import { DonutChartProps } from './Donut';
10
+ import { LineChartProps } from './Line';
11
+
12
+ export type AreaChartType = typeof AreaChart;
13
+ export type AreaStackedChartType = typeof AreaStackedChart;
14
+ export type BarChartType = typeof BarChart;
15
+ export type DonutChartType = typeof DonutChart;
16
+ export type LineChartType = typeof LineChart;
17
+ export type PaginationPositionType = typeof PaginationPosition;
18
+ export type { AreaChartProps, AreaStackedChartProps, BarChartProps, DonutChartProps, LineChartProps };
19
+ export { AreaChart, AreaStackedChart, BarChart, DonutChart, LineChart, PaginationPosition, };
package/dist/index.d.ts CHANGED
@@ -1 +1,16 @@
1
- export * from './components';
1
+ import { default as Progress } from './Progress/Progress.vue';
2
+ import { default as Status } from './Status/Status.vue';
3
+ import { default as Tooltip } from './Tooltip/Tooltip.vue';
4
+ import { AreaChartType, AreaStackedChartType, BarChartType, DonutChartType, LineChartType, PaginationPositionType, AreaChartProps, AreaStackedChartProps, BarChartProps, DonutChartProps, LineChartProps } from './charts';
5
+
6
+ export { Progress, Status, Tooltip };
7
+ export type { AreaChartProps, AreaStackedChartProps, BarChartProps, DonutChartProps, LineChartProps };
8
+ export interface ChartModules {
9
+ AreaChart: AreaChartType;
10
+ AreaStackedChart: AreaStackedChartType;
11
+ BarChart: BarChartType;
12
+ DonutChart: DonutChartType;
13
+ LineChart: LineChartType;
14
+ PaginationPosition: PaginationPositionType;
15
+ }
16
+ export declare const loadCharts: () => Promise<ChartModules>;
package/dist/index.js CHANGED
@@ -1,15 +1,193 @@
1
- import { default as t } from "./components/Area/AreaChart.js";
2
- import { default as o } from "./components/AreaStacked/AreaStackedChart.js";
3
- import { default as s } from "./components/Line/LineChart.js";
4
- import { default as u } from "./components/Bar/BarChart.js";
5
- import { default as l } from "./components/Donut/DonutChart.js";
6
- import { default as p } from "./components/Crosshair/Crosshair.js";
7
- export {
8
- t as AreaChart,
9
- o as AreaStackedChart,
10
- u as BarChart,
11
- p as Crosshair,
12
- l as DonutChart,
13
- s as LineChart
1
+ import { defineComponent, computed, createElementBlock, openBlock, createElementVNode, toDisplayString, normalizeStyle, ref, Fragment, renderList, normalizeClass, createCommentVNode } from 'vue';
2
+
3
+ const _hoisted_1$2 = { class: "space-y-2" };
4
+ const _hoisted_2$2 = { class: "space-y-2" };
5
+ const _hoisted_3$2 = { class: "text-gray-500 mb-1" };
6
+ const _hoisted_4$2 = { class: "text-xl dark:text-white font-bold" };
7
+ const _hoisted_5$2 = { class: "flex items-center justify-between text-sm font-medium dark:text-gray-500 mt-2" };
8
+ const _hoisted_6$1 = { class: "dark:bg-white/5 bg-gray-100 rounded-full h-3" };
9
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
10
+ __name: "Progress",
11
+ props: {
12
+ label: {},
13
+ value: {},
14
+ unit: {},
15
+ progress: {},
16
+ total: {},
17
+ color: {}
18
+ },
19
+ setup(__props) {
20
+ const props = __props;
21
+ const percentage = computed(() => {
22
+ return (props.progress / props.total * 100).toFixed(1);
23
+ });
24
+ const width = computed(() => {
25
+ return `${props.progress / props.total * 100}%`;
26
+ });
27
+ return (_ctx, _cache) => {
28
+ return openBlock(), createElementBlock("div", _hoisted_1$2, [
29
+ createElementVNode("div", _hoisted_2$2, [
30
+ createElementVNode("p", _hoisted_3$2, toDisplayString(_ctx.label), 1),
31
+ createElementVNode("h2", _hoisted_4$2, toDisplayString(_ctx.value), 1)
32
+ ]),
33
+ createElementVNode("div", _hoisted_5$2, [
34
+ createElementVNode("div", null, toDisplayString(percentage.value) + "%", 1),
35
+ createElementVNode("div", null, toDisplayString(_ctx.progress) + " of " + toDisplayString(_ctx.total) + toDisplayString(_ctx.unit), 1)
36
+ ]),
37
+ createElementVNode("div", _hoisted_6$1, [
38
+ createElementVNode("div", {
39
+ class: "rounded-full h-full",
40
+ style: normalizeStyle({ width: width.value, backgroundColor: _ctx.color })
41
+ }, null, 4)
42
+ ])
43
+ ]);
44
+ };
45
+ }
46
+ });
47
+
48
+ const _hoisted_1$1 = { class: "ring ring-border divide-y divide-(--ui-border) rounded-xl shadow-sm" };
49
+ const _hoisted_2$1 = { class: "flex items-center justify-between p-4" };
50
+ const _hoisted_3$1 = { class: "flex items-center gap-2" };
51
+ const _hoisted_4$1 = { class: "font-medium" };
52
+ const _hoisted_5$1 = { class: "text-sm dark:text-gray-400" };
53
+ const _hoisted_6 = { class: "p-4" };
54
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
55
+ __name: "Status",
56
+ setup(__props) {
57
+ const domain = ref("example.com");
58
+ const uptime = ref("99.9% uptime");
59
+ const outages = ref([
60
+ { hour: 0, status: "online" },
61
+ { hour: 1, status: "online" },
62
+ { hour: 2, status: "online" },
63
+ { hour: 3, status: "online" },
64
+ { hour: 4, status: "online" },
65
+ { hour: 5, status: "online" },
66
+ { hour: 6, status: "online" },
67
+ { hour: 7, status: "online" },
68
+ { hour: 8, status: "online" },
69
+ { hour: 9, status: "online" },
70
+ { hour: 10, status: "online" },
71
+ { hour: 11, status: "offline" },
72
+ { hour: 12, status: "online" },
73
+ { hour: 13, status: "online" },
74
+ { hour: 14, status: "online" },
75
+ { hour: 15, status: "online" },
76
+ { hour: 16, status: "online" },
77
+ { hour: 17, status: "online" },
78
+ { hour: 18, status: "online" },
79
+ { hour: 19, status: "online" },
80
+ { hour: 20, status: "online" },
81
+ { hour: 21, status: "online" },
82
+ { hour: 22, status: "online" },
83
+ { hour: 23, status: "online" },
84
+ { hour: 0, status: "online" },
85
+ { hour: 1, status: "online" },
86
+ { hour: 2, status: "online" },
87
+ { hour: 3, status: "online" },
88
+ { hour: 4, status: "online" },
89
+ { hour: 5, status: "online" },
90
+ { hour: 6, status: "online" },
91
+ { hour: 7, status: "online" },
92
+ { hour: 8, status: "online" },
93
+ { hour: 9, status: "online" },
94
+ { hour: 10, status: "online" },
95
+ { hour: 11, status: "online" },
96
+ { hour: 12, status: "online" },
97
+ { hour: 13, status: "online" },
98
+ { hour: 14, status: "online" },
99
+ { hour: 15, status: "online" },
100
+ { hour: 16, status: "online" },
101
+ { hour: 17, status: "online" },
102
+ { hour: 18, status: "online" },
103
+ { hour: 19, status: "online" },
104
+ { hour: 20, status: "online" },
105
+ { hour: 21, status: "online" },
106
+ { hour: 22, status: "online" },
107
+ { hour: 23, status: "online" },
108
+ { hour: 0, status: "online" },
109
+ { hour: 1, status: "online" }
110
+ ]);
111
+ return (_ctx, _cache) => {
112
+ return openBlock(), createElementBlock("div", _hoisted_1$1, [
113
+ createElementVNode("div", _hoisted_2$1, [
114
+ createElementVNode("div", _hoisted_3$1, [
115
+ _cache[0] || (_cache[0] = createElementVNode("svg", {
116
+ xmlns: "http://www.w3.org/2000/svg",
117
+ fill: "none",
118
+ viewBox: "0 0 24 24",
119
+ "stroke-width": "1.5",
120
+ stroke: "currentColor",
121
+ class: "size-6 text-primary"
122
+ }, [
123
+ createElementVNode("path", {
124
+ "stroke-linecap": "round",
125
+ "stroke-linejoin": "round",
126
+ d: "M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"
127
+ })
128
+ ], -1)),
129
+ createElementVNode("span", _hoisted_4$1, toDisplayString(domain.value), 1)
130
+ ]),
131
+ createElementVNode("span", _hoisted_5$1, toDisplayString(uptime.value), 1)
132
+ ]),
133
+ createElementVNode("div", _hoisted_6, [
134
+ (openBlock(true), createElementBlock(Fragment, null, renderList(outages.value, (outage, index) => {
135
+ return openBlock(), createElementBlock("div", {
136
+ key: index,
137
+ class: normalizeClass(["w-2.5 h-8 first:rounded-tl first:rounded-bl last:rounded-tr last:rounded-br ml-[3px] inline-block", outage.status === "online" ? "bg-primary" : "bg-white"])
138
+ }, null, 2);
139
+ }), 128))
140
+ ])
141
+ ]);
142
+ };
143
+ }
144
+ });
145
+
146
+ const _hoisted_1 = { class: "flex flex-col" };
147
+ const _hoisted_2 = { class: "flex items-center mr-2 mt-2" };
148
+ const _hoisted_3 = { class: "font-semibold capitalize text-white/75" };
149
+ const _hoisted_4 = { class: "flex items-center gap-2" };
150
+ const _hoisted_5 = { class: "font-normal" };
151
+ const _sfc_main = /* @__PURE__ */ defineComponent({
152
+ __name: "Tooltip",
153
+ props: {
154
+ data: {},
155
+ categories: {}
156
+ },
157
+ setup(__props) {
158
+ function getColor(key) {
159
+ return props.categories[key]?.color ?? "#f00";
160
+ }
161
+ const props = __props;
162
+ return (_ctx, _cache) => {
163
+ return openBlock(), createElementBlock("div", _hoisted_1, [
164
+ (openBlock(true), createElementBlock(Fragment, null, renderList(Object.entries(_ctx.data), ([key, value]) => {
165
+ return openBlock(), createElementBlock(Fragment, { key }, [
166
+ createElementVNode("div", _hoisted_2, [
167
+ createElementVNode("span", _hoisted_3, toDisplayString(key) + ":", 1)
168
+ ]),
169
+ createElementVNode("div", _hoisted_4, [
170
+ props.categories[key]?.color ? (openBlock(), createElementBlock("span", {
171
+ key: 0,
172
+ style: normalizeStyle({ backgroundColor: getColor(key) }),
173
+ class: "w-2 h-2"
174
+ }, null, 4)) : createCommentVNode("", true),
175
+ createElementVNode("span", _hoisted_5, toDisplayString(value), 1)
176
+ ])
177
+ ], 64);
178
+ }), 128))
179
+ ]);
180
+ };
181
+ }
182
+ });
183
+
184
+ const loadCharts = () => {
185
+ if (import.meta.client || typeof window !== "undefined") {
186
+ return import('./charts-CO6Yq10P.js').then((module) => {
187
+ return module;
188
+ });
189
+ }
190
+ return Promise.resolve({});
14
191
  };
15
- //# sourceMappingURL=index.js.map
192
+
193
+ export { _sfc_main$2 as Progress, _sfc_main$1 as Status, _sfc_main as Tooltip, loadCharts };
package/package.json CHANGED
@@ -1,31 +1,36 @@
1
1
  {
2
2
  "name": "vue-chrts",
3
- "version": "0.0.156",
3
+ "type": "module",
4
+ "version": "0.0.157",
4
5
  "license": "MIT",
5
6
  "files": [
6
7
  "dist"
7
8
  ],
9
+ "sideEffects": false,
8
10
  "exports": {
9
11
  ".": {
10
12
  "types": "./dist/index.d.ts",
11
- "require": "./dist/index.cjs",
12
- "import": "./dist/index.js"
13
+ "import": "./dist/index.js",
14
+ "require": "./dist/index.cjs"
13
15
  },
14
- "./*": {
15
- "types": "./*/dist/index.d.ts",
16
- "require": "./*/dist/index.cjs",
17
- "import": "./*/dist/index.js"
16
+ "./date": {
17
+ "import": {
18
+ "types": "./dist/date.d.ts",
19
+ "default": "./dist/date.js"
20
+ },
21
+ "require": {
22
+ "types": "./dist/date.d.ts",
23
+ "default": "./dist/date.cjs"
24
+ }
18
25
  }
19
26
  },
20
27
  "main": "./dist/index.cjs",
21
28
  "module": "./dist/index.js",
22
29
  "types": "./dist/index.d.ts",
23
- "typings": "./index.d.ts",
24
- "type": "module",
25
- "sideEffects": false,
30
+ "typings": "./dist/index.d.ts",
26
31
  "scripts": {
27
32
  "dev": "vite",
28
- "build": "vite build",
33
+ "build": "vue-tsc -b && vite build",
29
34
  "preview": "vite preview",
30
35
  "deploy": "pnpm build && npm publish"
31
36
  },
@@ -40,9 +45,6 @@
40
45
  "vue-router": "^4.5.0"
41
46
  },
42
47
  "devDependencies": {
43
- "@rollup/plugin-node-resolve": "^13.0.4",
44
- "rollup-plugin-commonjs": "^10.1.0",
45
- "rollup-plugin-typescript2": "^0.31.1",
46
48
  "@types/d3": "^7.4.0",
47
49
  "@unovis/ts": "^1.5.0",
48
50
  "@unovis/vue": "^1.5.0",
@@ -1,7 +0,0 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("@unovis/ts"),n=require("@unovis/vue"),f=require("../Tooltip.cjs"),y={key:0,class:"flex items center justify-end"},k=e.defineComponent({__name:"AreaChart",props:{data:{},height:{},xLabel:{},yLabel:{},categories:{},xFormatter:{},yFormatter:{},curveType:{},xNumTicks:{default:r=>r.data.length>24?24/4:r.data.length-1},yNumTicks:{default:r=>r.data.length>24?24/4:r.data.length-1},hideLegend:{type:Boolean},hideTooltip:{type:Boolean},gridLineX:{type:Boolean},domainLineX:{type:Boolean},gridLineY:{type:Boolean},domainLineY:{type:Boolean},paginationPoisition:{}},setup(r){const l=r,s=Object.values(l.categories).map(t=>t.color),p=e.computed(()=>t=>{const o=e.createApp(f.default,{data:t,categories:l.categories}),i=document.createElement("div");o.mount(i);const a=i.innerHTML;return o.unmount(),a});function m(t){var o;return{y:i=>Number(i[t]),color:((o=l.categories[t])==null?void 0:o.color)??"#3b82f6"}}const g=s.map((t,o)=>`
2
- <linearGradient id="gradient${o}-${t}" gradientTransform="rotate(90)">
3
- <stop offset="0%" stop-color="${t}" stop-opacity="1" />
4
- <stop offset="100%" stop-color="${t}" stop-opacity="0" />
5
- </linearGradient>
6
- `).join("");return(t,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col space-y-4",{"flex-col-reverse":l.paginationPoisition==="top"}])},[e.createVNode(e.unref(n.VisXYContainer),{data:t.data,height:t.height,"svg-defs":e.unref(g)},{default:e.withCtx(()=>[t.hideTooltip?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(n.VisTooltip),{key:0,"horizontal-placement":e.unref(c.Position).Right,"vertical-placement":e.unref(c.Position).Top},null,8,["horizontal-placement","vertical-placement"])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Object.keys(l.categories),(i,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:a},[e.createVNode(e.unref(n.VisArea),e.mergeProps({x:(u,d)=>d,ref_for:!0},m(i),{color:`url(#gradient${a}-${e.unref(s)[a]})`,opacity:.5,"curve-type":t.curveType??e.unref(c.CurveType).MonotoneX}),null,16,["x","color","curve-type"]),e.createVNode(e.unref(n.VisLine),{x:(u,d)=>d,y:u=>u[i],color:e.unref(s)[a],"curve-type":t.curveType??e.unref(c.CurveType).MonotoneX},null,8,["x","y","color","curve-type"])],64))),128)),e.createVNode(e.unref(n.VisAxis),{type:"x","tick-format":t.xFormatter,"num-ticks":t.xNumTicks,label:t.xLabel,"grid-line":t.gridLineX,"domain-line":t.domainLineX,"tick-line":!!t.gridLineX},null,8,["tick-format","num-ticks","label","grid-line","domain-line","tick-line"]),e.createVNode(e.unref(n.VisAxis),{type:"y","num-ticks":t.yNumTicks??t.data.length,"tick-format":t.yFormatter,label:t.yLabel,"grid-line":t.gridLineY,"domain-line":t.domainLineY,"tick-line":!!t.gridLineY},null,8,["num-ticks","tick-format","label","grid-line","domain-line","tick-line"]),t.hideTooltip?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(n.VisCrosshair),{key:1,color:"#666",template:p.value},null,8,["template"]))]),_:1},8,["data","height","svg-defs"]),t.hideLegend?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",y,[e.createVNode(e.unref(n.VisBulletLegend),{items:Object.values(t.categories)},null,8,["items"])]))],2))}});exports.default=k;
7
- //# sourceMappingURL=AreaChart.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AreaChart.cjs","sources":["../../../src/components/Area/AreaChart.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"T\">\nimport { computed, createApp } from \"vue\";\nimport type { BulletLegendItemInterface, NumericAccessor } from \"@unovis/ts\";\nimport { CurveType, Position } from \"@unovis/ts\";\nimport {\n VisArea,\n VisAxis,\n VisBulletLegend,\n VisCrosshair,\n VisLine,\n VisTooltip,\n VisXYContainer,\n} from \"@unovis/vue\";\n\nimport Tooltip from \"./../Tooltip.vue\";\nimport { PaginationPosition } from \"../../types\";\n\ntype AreaChartProps<T> = {\n data: T[];\n height: number;\n xLabel?: string;\n yLabel?: string;\n categories: Record<string, BulletLegendItemInterface>;\n xFormatter: (i: number, idx: number) => string;\n yFormatter?: (i: number, idx?: number) => string | number;\n curveType?: CurveType;\n xNumTicks?: number;\n yNumTicks?: number;\n hideLegend?: boolean;\n hideTooltip?: boolean;\n gridLineX?: boolean;\n domainLineX?: boolean;\n gridLineY?: boolean;\n domainLineY?: boolean;\n paginationPoisition?: PaginationPosition;\n};\n\nconst props = withDefaults(defineProps<AreaChartProps<T>>(), {\n xNumTicks: (props) =>\n props.data.length > 24 ? 24 / 4 : props.data.length - 1,\n yNumTicks: (props) =>\n props.data.length > 24 ? 24 / 4 : props.data.length - 1,\n});\n\nconst colors = Object.values(props.categories).map((c) => c.color);\n\nconst generateTooltip = computed(() => (d: T) => {\n const app = createApp(Tooltip, {\n data: d,\n categories: props.categories,\n });\n\n const container = document.createElement(\"div\");\n app.mount(container);\n\n const html = container.innerHTML;\n app.unmount();\n\n return html;\n});\n\nfunction accessors(id: string): { y: NumericAccessor<T>; color: string } {\n return {\n y: (d: T) => Number(d[id as keyof typeof d]),\n color: props.categories[id]?.color ?? \"#3b82f6\",\n };\n}\n\nconst svgDefs = colors\n .map(\n (color, index) => `\n <linearGradient id=\"gradient${index}-${color}\" gradientTransform=\"rotate(90)\">\n <stop offset=\"0%\" stop-color=\"${color}\" stop-opacity=\"1\" />\n <stop offset=\"100%\" stop-color=\"${color}\" stop-opacity=\"0\" />\n </linearGradient>\n`\n )\n .join(\"\");\n</script>\n\n<template>\n <div\n class=\"flex flex-col space-y-4\"\n :class=\"{\n 'flex-col-reverse': props.paginationPoisition === 'top',\n }\"\n >\n <VisXYContainer :data=\"data\" :height=\"height\" :svg-defs=\"svgDefs\">\n <VisTooltip\n v-if=\"!hideTooltip\"\n :horizontal-placement=\"Position.Right\"\n :vertical-placement=\"Position.Top\"\n />\n <template v-for=\"(i, iKey) in Object.keys(props.categories)\" :key=\"iKey\">\n <VisArea\n :x=\"(_: T, i: number) => i\"\n v-bind=\"accessors(i)\"\n :color=\"`url(#gradient${iKey}-${colors[iKey]})`\"\n :opacity=\"0.5\"\n :curve-type=\"curveType ?? CurveType.MonotoneX\"\n />\n <VisLine\n :x=\"(_: any, i: number) => i\"\n :y=\"(d: T) => d[i as keyof typeof d]\"\n :color=\"colors[iKey]\"\n :curve-type=\"curveType ?? CurveType.MonotoneX\"\n />\n </template>\n\n <VisAxis\n type=\"x\"\n :tick-format=\"xFormatter\"\n :num-ticks=\"xNumTicks\"\n :label=\"xLabel\"\n :grid-line=\"gridLineX\"\n :domain-line=\"domainLineX\"\n :tick-line=\"!!gridLineX\"\n />\n <VisAxis\n type=\"y\"\n :num-ticks=\"yNumTicks ?? data.length\"\n :tick-format=\"yFormatter\"\n :label=\"yLabel\"\n :grid-line=\"gridLineY\"\n :domain-line=\"domainLineY\"\n :tick-line=\"!!gridLineY\"\n />\n <VisCrosshair\n v-if=\"!hideTooltip\"\n color=\"#666\"\n :template=\"generateTooltip\"\n />\n </VisXYContainer>\n <div v-if=\"!hideLegend\" class=\"flex items center justify-end\">\n <VisBulletLegend :items=\"Object.values(categories)\" />\n </div>\n </div>\n</template>\n"],"names":["props","__props","colors","c","generateTooltip","computed","d","app","createApp","Tooltip","container","html","accessors","id","_a","svgDefs","color","index"],"mappings":"osBAqCA,MAAMA,EAAQC,EAORC,EAAS,OAAO,OAAOF,EAAM,UAAU,EAAE,IAAKG,GAAMA,EAAE,KAAK,EAE3DC,EAAkBC,EAAAA,SAAS,IAAOC,GAAS,CACzC,MAAAC,EAAMC,YAAUC,UAAS,CAC7B,KAAMH,EACN,WAAYN,EAAM,UAAA,CACnB,EAEKU,EAAY,SAAS,cAAc,KAAK,EAC9CH,EAAI,MAAMG,CAAS,EAEnB,MAAMC,EAAOD,EAAU,UACvB,OAAAH,EAAI,QAAQ,EAELI,CAAA,CACR,EAED,SAASC,EAAUC,EAAsD,OAChE,MAAA,CACL,EAAIP,GAAS,OAAOA,EAAEO,CAAoB,CAAC,EAC3C,QAAOC,EAAAd,EAAM,WAAWa,CAAE,IAAnB,YAAAC,EAAsB,QAAS,SACxC,CAAA,CAGF,MAAMC,EAAUb,EACb,IACC,CAACc,EAAOC,IAAU;AAAA,gCACUA,CAAK,IAAID,CAAK;AAAA,oCACVA,CAAK;AAAA,sCACHA,CAAK;AAAA;AAAA,CAAA,EAIxC,KAAK,EAAE"}
@@ -1,123 +0,0 @@
1
- import { defineComponent as b, computed as B, createApp as V, createElementBlock as c, openBlock as r, normalizeClass as C, createVNode as l, createCommentVNode as u, unref as t, withCtx as X, createBlock as g, Fragment as f, renderList as N, mergeProps as $ } from "vue";
2
- import { Position as y, CurveType as h } from "@unovis/ts";
3
- import { VisXYContainer as Y, VisTooltip as j, VisArea as F, VisLine as A, VisAxis as k, VisCrosshair as P, VisBulletLegend as z } from "@unovis/vue";
4
- import M from "../Tooltip.js";
5
- const O = {
6
- key: 0,
7
- class: "flex items center justify-end"
8
- }, H = /* @__PURE__ */ b({
9
- __name: "AreaChart",
10
- props: {
11
- data: {},
12
- height: {},
13
- xLabel: {},
14
- yLabel: {},
15
- categories: {},
16
- xFormatter: {},
17
- yFormatter: {},
18
- curveType: {},
19
- xNumTicks: { default: (i) => i.data.length > 24 ? 24 / 4 : i.data.length - 1 },
20
- yNumTicks: { default: (i) => i.data.length > 24 ? 24 / 4 : i.data.length - 1 },
21
- hideLegend: { type: Boolean },
22
- hideTooltip: { type: Boolean },
23
- gridLineX: { type: Boolean },
24
- domainLineX: { type: Boolean },
25
- gridLineY: { type: Boolean },
26
- domainLineY: { type: Boolean },
27
- paginationPoisition: {}
28
- },
29
- setup(i) {
30
- const s = i, m = Object.values(s.categories).map((e) => e.color), v = B(() => (e) => {
31
- const o = V(M, {
32
- data: e,
33
- categories: s.categories
34
- }), n = document.createElement("div");
35
- o.mount(n);
36
- const a = n.innerHTML;
37
- return o.unmount(), a;
38
- });
39
- function L(e) {
40
- var o;
41
- return {
42
- y: (n) => Number(n[e]),
43
- color: ((o = s.categories[e]) == null ? void 0 : o.color) ?? "#3b82f6"
44
- };
45
- }
46
- const T = m.map(
47
- (e, o) => `
48
- <linearGradient id="gradient${o}-${e}" gradientTransform="rotate(90)">
49
- <stop offset="0%" stop-color="${e}" stop-opacity="1" />
50
- <stop offset="100%" stop-color="${e}" stop-opacity="0" />
51
- </linearGradient>
52
- `
53
- ).join("");
54
- return (e, o) => (r(), c("div", {
55
- class: C(["flex flex-col space-y-4", {
56
- "flex-col-reverse": s.paginationPoisition === "top"
57
- }])
58
- }, [
59
- l(t(Y), {
60
- data: e.data,
61
- height: e.height,
62
- "svg-defs": t(T)
63
- }, {
64
- default: X(() => [
65
- e.hideTooltip ? u("", !0) : (r(), g(t(j), {
66
- key: 0,
67
- "horizontal-placement": t(y).Right,
68
- "vertical-placement": t(y).Top
69
- }, null, 8, ["horizontal-placement", "vertical-placement"])),
70
- (r(!0), c(f, null, N(Object.keys(s.categories), (n, a) => (r(), c(f, { key: a }, [
71
- l(t(F), $({
72
- x: (d, p) => p,
73
- ref_for: !0
74
- }, L(n), {
75
- color: `url(#gradient${a}-${t(m)[a]})`,
76
- opacity: 0.5,
77
- "curve-type": e.curveType ?? t(h).MonotoneX
78
- }), null, 16, ["x", "color", "curve-type"]),
79
- l(t(A), {
80
- x: (d, p) => p,
81
- y: (d) => d[n],
82
- color: t(m)[a],
83
- "curve-type": e.curveType ?? t(h).MonotoneX
84
- }, null, 8, ["x", "y", "color", "curve-type"])
85
- ], 64))), 128)),
86
- l(t(k), {
87
- type: "x",
88
- "tick-format": e.xFormatter,
89
- "num-ticks": e.xNumTicks,
90
- label: e.xLabel,
91
- "grid-line": e.gridLineX,
92
- "domain-line": e.domainLineX,
93
- "tick-line": !!e.gridLineX
94
- }, null, 8, ["tick-format", "num-ticks", "label", "grid-line", "domain-line", "tick-line"]),
95
- l(t(k), {
96
- type: "y",
97
- "num-ticks": e.yNumTicks ?? e.data.length,
98
- "tick-format": e.yFormatter,
99
- label: e.yLabel,
100
- "grid-line": e.gridLineY,
101
- "domain-line": e.domainLineY,
102
- "tick-line": !!e.gridLineY
103
- }, null, 8, ["num-ticks", "tick-format", "label", "grid-line", "domain-line", "tick-line"]),
104
- e.hideTooltip ? u("", !0) : (r(), g(t(P), {
105
- key: 1,
106
- color: "#666",
107
- template: v.value
108
- }, null, 8, ["template"]))
109
- ]),
110
- _: 1
111
- }, 8, ["data", "height", "svg-defs"]),
112
- e.hideLegend ? u("", !0) : (r(), c("div", O, [
113
- l(t(z), {
114
- items: Object.values(e.categories)
115
- }, null, 8, ["items"])
116
- ]))
117
- ], 2));
118
- }
119
- });
120
- export {
121
- H as default
122
- };
123
- //# sourceMappingURL=AreaChart.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AreaChart.js","sources":["../../../src/components/Area/AreaChart.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"T\">\nimport { computed, createApp } from \"vue\";\nimport type { BulletLegendItemInterface, NumericAccessor } from \"@unovis/ts\";\nimport { CurveType, Position } from \"@unovis/ts\";\nimport {\n VisArea,\n VisAxis,\n VisBulletLegend,\n VisCrosshair,\n VisLine,\n VisTooltip,\n VisXYContainer,\n} from \"@unovis/vue\";\n\nimport Tooltip from \"./../Tooltip.vue\";\nimport { PaginationPosition } from \"../../types\";\n\ntype AreaChartProps<T> = {\n data: T[];\n height: number;\n xLabel?: string;\n yLabel?: string;\n categories: Record<string, BulletLegendItemInterface>;\n xFormatter: (i: number, idx: number) => string;\n yFormatter?: (i: number, idx?: number) => string | number;\n curveType?: CurveType;\n xNumTicks?: number;\n yNumTicks?: number;\n hideLegend?: boolean;\n hideTooltip?: boolean;\n gridLineX?: boolean;\n domainLineX?: boolean;\n gridLineY?: boolean;\n domainLineY?: boolean;\n paginationPoisition?: PaginationPosition;\n};\n\nconst props = withDefaults(defineProps<AreaChartProps<T>>(), {\n xNumTicks: (props) =>\n props.data.length > 24 ? 24 / 4 : props.data.length - 1,\n yNumTicks: (props) =>\n props.data.length > 24 ? 24 / 4 : props.data.length - 1,\n});\n\nconst colors = Object.values(props.categories).map((c) => c.color);\n\nconst generateTooltip = computed(() => (d: T) => {\n const app = createApp(Tooltip, {\n data: d,\n categories: props.categories,\n });\n\n const container = document.createElement(\"div\");\n app.mount(container);\n\n const html = container.innerHTML;\n app.unmount();\n\n return html;\n});\n\nfunction accessors(id: string): { y: NumericAccessor<T>; color: string } {\n return {\n y: (d: T) => Number(d[id as keyof typeof d]),\n color: props.categories[id]?.color ?? \"#3b82f6\",\n };\n}\n\nconst svgDefs = colors\n .map(\n (color, index) => `\n <linearGradient id=\"gradient${index}-${color}\" gradientTransform=\"rotate(90)\">\n <stop offset=\"0%\" stop-color=\"${color}\" stop-opacity=\"1\" />\n <stop offset=\"100%\" stop-color=\"${color}\" stop-opacity=\"0\" />\n </linearGradient>\n`\n )\n .join(\"\");\n</script>\n\n<template>\n <div\n class=\"flex flex-col space-y-4\"\n :class=\"{\n 'flex-col-reverse': props.paginationPoisition === 'top',\n }\"\n >\n <VisXYContainer :data=\"data\" :height=\"height\" :svg-defs=\"svgDefs\">\n <VisTooltip\n v-if=\"!hideTooltip\"\n :horizontal-placement=\"Position.Right\"\n :vertical-placement=\"Position.Top\"\n />\n <template v-for=\"(i, iKey) in Object.keys(props.categories)\" :key=\"iKey\">\n <VisArea\n :x=\"(_: T, i: number) => i\"\n v-bind=\"accessors(i)\"\n :color=\"`url(#gradient${iKey}-${colors[iKey]})`\"\n :opacity=\"0.5\"\n :curve-type=\"curveType ?? CurveType.MonotoneX\"\n />\n <VisLine\n :x=\"(_: any, i: number) => i\"\n :y=\"(d: T) => d[i as keyof typeof d]\"\n :color=\"colors[iKey]\"\n :curve-type=\"curveType ?? CurveType.MonotoneX\"\n />\n </template>\n\n <VisAxis\n type=\"x\"\n :tick-format=\"xFormatter\"\n :num-ticks=\"xNumTicks\"\n :label=\"xLabel\"\n :grid-line=\"gridLineX\"\n :domain-line=\"domainLineX\"\n :tick-line=\"!!gridLineX\"\n />\n <VisAxis\n type=\"y\"\n :num-ticks=\"yNumTicks ?? data.length\"\n :tick-format=\"yFormatter\"\n :label=\"yLabel\"\n :grid-line=\"gridLineY\"\n :domain-line=\"domainLineY\"\n :tick-line=\"!!gridLineY\"\n />\n <VisCrosshair\n v-if=\"!hideTooltip\"\n color=\"#666\"\n :template=\"generateTooltip\"\n />\n </VisXYContainer>\n <div v-if=\"!hideLegend\" class=\"flex items center justify-end\">\n <VisBulletLegend :items=\"Object.values(categories)\" />\n </div>\n </div>\n</template>\n"],"names":["props","__props","colors","c","generateTooltip","computed","d","app","createApp","Tooltip","container","html","accessors","id","_a","svgDefs","color","index"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCA,UAAMA,IAAQC,GAORC,IAAS,OAAO,OAAOF,EAAM,UAAU,EAAE,IAAI,CAACG,MAAMA,EAAE,KAAK,GAE3DC,IAAkBC,EAAS,MAAM,CAACC,MAAS;AACzC,YAAAC,IAAMC,EAAUC,GAAS;AAAA,QAC7B,MAAMH;AAAA,QACN,YAAYN,EAAM;AAAA,MAAA,CACnB,GAEKU,IAAY,SAAS,cAAc,KAAK;AAC9C,MAAAH,EAAI,MAAMG,CAAS;AAEnB,YAAMC,IAAOD,EAAU;AACvB,aAAAH,EAAI,QAAQ,GAELI;AAAA,IAAA,CACR;AAED,aAASC,EAAUC,GAAsD;;AAChE,aAAA;AAAA,QACL,GAAG,CAACP,MAAS,OAAOA,EAAEO,CAAoB,CAAC;AAAA,QAC3C,SAAOC,IAAAd,EAAM,WAAWa,CAAE,MAAnB,gBAAAC,EAAsB,UAAS;AAAA,MACxC;AAAA,IAAA;AAGF,UAAMC,IAAUb,EACb;AAAA,MACC,CAACc,GAAOC,MAAU;AAAA,gCACUA,CAAK,IAAID,CAAK;AAAA,oCACVA,CAAK;AAAA,sCACHA,CAAK;AAAA;AAAA;AAAA,IAAA,EAIxC,KAAK,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,36 +0,0 @@
1
- import { BulletLegendItemInterface, CurveType } from '@unovis/ts';
2
- import { PaginationPosition } from '../../types';
3
-
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;
13
- curveType?: CurveType;
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);
24
- expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
25
- attrs: any;
26
- slots: ReturnType<() => {}>;
27
- emit: typeof __VLS_emit;
28
- }>) => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
29
- [key: string]: any;
30
- }> & {
31
- __ctx?: Awaited<typeof __VLS_setup>;
32
- };
33
- export default _default;
34
- type __VLS_Prettify<T> = {
35
- [K in keyof T]: T[K];
36
- } & {};
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./AreaChart.cjs");exports.default=e.default;
2
- //# sourceMappingURL=AreaChart2.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AreaChart2.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,5 +0,0 @@
1
- import f from "./AreaChart.js";
2
- export {
3
- f as default
4
- };
5
- //# sourceMappingURL=AreaChart2.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AreaChart2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1 +0,0 @@
1
- export { default as AreaChart } from './AreaChart.vue';
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("@unovis/vue"),i=require("@unovis/ts"),u={class:"flex flex-col space-y-4"},l={class:"flex items center justify-end"},d=e.defineComponent({__name:"AreaStackedChart",props:{data:{},categories:{}},setup(s){const o=s,a=t=>Number.parseInt(t.time),n=[t=>t.firstTime,t=>t.returning];return(t,f)=>(e.openBlock(),e.createElementBlock("div",u,[e.createVNode(e.unref(r.VisXYContainer),{data:t.data,height:200},{default:e.withCtx(()=>[e.createVNode(e.unref(r.VisArea),{x:a,y:n,color:Object.values(o.categories).map(c=>c.color),"curve-type":e.unref(i.CurveType).Linear},null,8,["color","curve-type"]),e.createVNode(e.unref(r.VisAxis),{type:"x",label:"Time","num-ticks":12}),e.createVNode(e.unref(r.VisAxis),{type:"y",label:"Number of visitors","num-ticks":3})]),_:1},8,["data"]),e.createElementVNode("div",l,[e.createVNode(e.unref(r.VisBulletLegend),{items:Object.values(t.categories)},null,8,["items"])])]))}});exports.default=d;
2
- //# sourceMappingURL=AreaStackedChart.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AreaStackedChart.cjs","sources":["../../../src/components/AreaStacked/AreaStackedChart.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"T\">\nimport { VisXYContainer, VisAxis, VisArea, VisBulletLegend } from '@unovis/vue'\nimport { BulletLegendItemInterface, CurveType } from '@unovis/ts'\n\nexport type AreaStackedChartProps<T> = {\n data: T[];\n categories: Record<string, BulletLegendItemInterface>;\n }\n\nconst props = defineProps<AreaStackedChartProps<T>>()\n\nconst x = (d: any) => {\n return Number.parseInt(d.time)\n}\nconst y = [\n (d: any) => d.firstTime,\n (d: any) => d.returning\n]\n</script>\n\n<template>\n <div class=\"flex flex-col space-y-4\">\n <VisXYContainer\n :data=\"data\"\n :height=\"200\"\n >\n <VisArea\n :x=\"x\"\n :y=\"y\"\n :color=\"Object.values(props.categories).map((i) => i.color) \"\n :curve-type=\"CurveType.Linear\"\n />\n <VisAxis\n type=\"x\"\n label=\"Time\"\n :num-ticks=\"12\"\n\n />\n <VisAxis\n type=\"y\"\n label=\"Number of visitors\"\n :num-ticks=\"3\"\n />\n </VisXYContainer>\n <div class=\"flex items center justify-end\">\n <VisBulletLegend\n :items=\"Object.values(categories)\"\n />\n </div>\n </div>\n</template>"],"names":["props","__props","x","d","y"],"mappings":"wVASA,MAAMA,EAAQC,EAERC,EAAKC,GACF,OAAO,SAASA,EAAE,IAAI,EAEzBC,EAAI,CACPD,GAAWA,EAAE,UACbA,GAAWA,EAAE,SAChB"}
@@ -1,51 +0,0 @@
1
- import { defineComponent as l, createElementBlock as m, openBlock as u, createVNode as r, createElementVNode as p, unref as t, withCtx as d } from "vue";
2
- import { VisXYContainer as f, VisArea as y, VisAxis as s, VisBulletLegend as _ } from "@unovis/vue";
3
- import { CurveType as v } from "@unovis/ts";
4
- const h = { class: "flex flex-col space-y-4" }, x = { class: "flex items center justify-end" }, C = /* @__PURE__ */ l({
5
- __name: "AreaStackedChart",
6
- props: {
7
- data: {},
8
- categories: {}
9
- },
10
- setup(o) {
11
- const a = o, i = (e) => Number.parseInt(e.time), c = [
12
- (e) => e.firstTime,
13
- (e) => e.returning
14
- ];
15
- return (e, b) => (u(), m("div", h, [
16
- r(t(f), {
17
- data: e.data,
18
- height: 200
19
- }, {
20
- default: d(() => [
21
- r(t(y), {
22
- x: i,
23
- y: c,
24
- color: Object.values(a.categories).map((n) => n.color),
25
- "curve-type": t(v).Linear
26
- }, null, 8, ["color", "curve-type"]),
27
- r(t(s), {
28
- type: "x",
29
- label: "Time",
30
- "num-ticks": 12
31
- }),
32
- r(t(s), {
33
- type: "y",
34
- label: "Number of visitors",
35
- "num-ticks": 3
36
- })
37
- ]),
38
- _: 1
39
- }, 8, ["data"]),
40
- p("div", x, [
41
- r(t(_), {
42
- items: Object.values(e.categories)
43
- }, null, 8, ["items"])
44
- ])
45
- ]));
46
- }
47
- });
48
- export {
49
- C as default
50
- };
51
- //# sourceMappingURL=AreaStackedChart.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AreaStackedChart.js","sources":["../../../src/components/AreaStacked/AreaStackedChart.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"T\">\nimport { VisXYContainer, VisAxis, VisArea, VisBulletLegend } from '@unovis/vue'\nimport { BulletLegendItemInterface, CurveType } from '@unovis/ts'\n\nexport type AreaStackedChartProps<T> = {\n data: T[];\n categories: Record<string, BulletLegendItemInterface>;\n }\n\nconst props = defineProps<AreaStackedChartProps<T>>()\n\nconst x = (d: any) => {\n return Number.parseInt(d.time)\n}\nconst y = [\n (d: any) => d.firstTime,\n (d: any) => d.returning\n]\n</script>\n\n<template>\n <div class=\"flex flex-col space-y-4\">\n <VisXYContainer\n :data=\"data\"\n :height=\"200\"\n >\n <VisArea\n :x=\"x\"\n :y=\"y\"\n :color=\"Object.values(props.categories).map((i) => i.color) \"\n :curve-type=\"CurveType.Linear\"\n />\n <VisAxis\n type=\"x\"\n label=\"Time\"\n :num-ticks=\"12\"\n\n />\n <VisAxis\n type=\"y\"\n label=\"Number of visitors\"\n :num-ticks=\"3\"\n />\n </VisXYContainer>\n <div class=\"flex items center justify-end\">\n <VisBulletLegend\n :items=\"Object.values(categories)\"\n />\n </div>\n </div>\n</template>"],"names":["props","__props","x","d","y"],"mappings":";;;;;;;;;;AASA,UAAMA,IAAQC,GAERC,IAAI,CAACC,MACF,OAAO,SAASA,EAAE,IAAI,GAEzBC,IAAI;AAAA,MACR,CAACD,MAAWA,EAAE;AAAA,MACd,CAACA,MAAWA,EAAE;AAAA,IAChB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,18 +0,0 @@
1
- import { BulletLegendItemInterface } from '@unovis/ts';
2
-
3
- export type AreaStackedChartProps<T> = {
4
- data: T[];
5
- categories: Record<string, BulletLegendItemInterface>;
6
- };
7
- 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<{
8
- props: __VLS_Prettify<__VLS_OmitKeepDiscriminatedUnion<(Partial<{}> & Omit<{} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>) & AreaStackedChartProps<T>, keyof import('vue').VNodeProps | keyof import('vue').AllowedComponentProps>> & {} & (import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps);
9
- expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
10
- attrs: any;
11
- slots: ReturnType<() => {}>;
12
- emit: typeof __VLS_emit;
13
- }>) => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
14
- [key: string]: any;
15
- }> & {
16
- __ctx?: Awaited<typeof __VLS_setup>;
17
- };
18
- export default _default;
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./AreaStackedChart.cjs");exports.default=e.default;
2
- //# sourceMappingURL=AreaStackedChart2.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AreaStackedChart2.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,5 +0,0 @@
1
- import f from "./AreaStackedChart.js";
2
- export {
3
- f as default
4
- };
5
- //# sourceMappingURL=AreaStackedChart2.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AreaStackedChart2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}