vue-chrts 0.0.141 → 0.0.143
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/AreaChart.cjs.map +1 -1
- package/dist/components/Area/AreaChart.js.map +1 -1
- package/dist/components/Area/AreaChart.vue.d.ts +2 -21
- package/dist/components/Area/index.d.ts +1 -0
- package/dist/components/Area/types.d.ts +84 -0
- package/dist/components/Tooltip.cjs +1 -1
- package/dist/components/Tooltip.cjs.map +1 -1
- package/dist/components/Tooltip.js +24 -23
- package/dist/components/Tooltip.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
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 {
|
|
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 { 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 { AreaChartProps } from \"./types\";\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":"osBAiBA,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 +1 @@
|
|
|
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 {
|
|
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 { 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 { AreaChartProps } from \"./types\";\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,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,26 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { PaginationPosition } from '../../types';
|
|
1
|
+
import { AreaChartProps } from './types';
|
|
3
2
|
|
|
4
3
|
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);
|
|
4
|
+
props: __VLS_Prettify<__VLS_OmitKeepDiscriminatedUnion<(Partial<{}> & Omit<{} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>) & AreaChartProps<T>, keyof import('vue').VNodeProps | keyof import('vue').AllowedComponentProps>> & {} & (import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps);
|
|
24
5
|
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
|
25
6
|
attrs: any;
|
|
26
7
|
slots: ReturnType<() => {}>;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { PaginationPosition } from '../../types';
|
|
2
|
+
import { BulletLegendItemInterface, CurveType } from '@unovis/ts';
|
|
3
|
+
|
|
4
|
+
export type AreaChartProps<T> = {
|
|
5
|
+
/**
|
|
6
|
+
* The data to be displayed in the area chart.
|
|
7
|
+
* Each element of the array represents a data point.
|
|
8
|
+
* The structure of 'T' should be compatible with the chart's rendering logic.
|
|
9
|
+
*/
|
|
10
|
+
data: T[];
|
|
11
|
+
/**
|
|
12
|
+
* The height of the chart in pixels.
|
|
13
|
+
*/
|
|
14
|
+
height: number;
|
|
15
|
+
/**
|
|
16
|
+
* Optional label for the x-axis.
|
|
17
|
+
*/
|
|
18
|
+
xLabel?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Optional label for the y-axis.
|
|
21
|
+
*/
|
|
22
|
+
yLabel?: string;
|
|
23
|
+
/**
|
|
24
|
+
* A record mapping category keys to `BulletLegendItemInterface` objects.
|
|
25
|
+
* This defines the visual representation and labels for each category in the chart's legend.
|
|
26
|
+
*/
|
|
27
|
+
categories: Record<string, BulletLegendItemInterface>;
|
|
28
|
+
/**
|
|
29
|
+
* A function that formats the x-axis tick labels.
|
|
30
|
+
* @param i The value to be formatted.
|
|
31
|
+
* @param idx The index of the data point.
|
|
32
|
+
* @returns The formatted x-axis label.
|
|
33
|
+
*/
|
|
34
|
+
xFormatter: (i: number, idx: number) => string;
|
|
35
|
+
/**
|
|
36
|
+
* An optional function that formats the y-axis tick labels.
|
|
37
|
+
* @param i The value to be formatted.
|
|
38
|
+
* @param idx The index of the data point (optional).
|
|
39
|
+
* @returns The formatted y-axis label or value.
|
|
40
|
+
*/
|
|
41
|
+
yFormatter?: (i: number, idx?: number) => string | number;
|
|
42
|
+
/**
|
|
43
|
+
* The type of curve to use for the area chart lines.
|
|
44
|
+
* See `CurveType` for available options.
|
|
45
|
+
*/
|
|
46
|
+
curveType?: CurveType;
|
|
47
|
+
/**
|
|
48
|
+
* The desired number of ticks on the x-axis.
|
|
49
|
+
*/
|
|
50
|
+
xNumTicks?: number;
|
|
51
|
+
/**
|
|
52
|
+
* The desired number of ticks on the y-axis.
|
|
53
|
+
*/
|
|
54
|
+
yNumTicks?: number;
|
|
55
|
+
/**
|
|
56
|
+
* If `true`, hides the chart legend.
|
|
57
|
+
*/
|
|
58
|
+
hideLegend?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* If `true`, hides the chart tooltip.
|
|
61
|
+
*/
|
|
62
|
+
hideTooltip?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* If `true`, displays grid lines along the x-axis.
|
|
65
|
+
*/
|
|
66
|
+
gridLineX?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* If `true`, displays a domain line (axis line) along the x-axis.
|
|
69
|
+
*/
|
|
70
|
+
domainLineX?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* If `true`, displays grid lines along the y-axis.
|
|
73
|
+
*/
|
|
74
|
+
gridLineY?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* If `true`, displays a domain line (axis line) along the y-axis.
|
|
77
|
+
*/
|
|
78
|
+
domainLineY?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Optional position for pagination controls, if applicable.
|
|
81
|
+
* See `PaginationPosition` for available options.
|
|
82
|
+
*/
|
|
83
|
+
paginationPoisition?: PaginationPosition;
|
|
84
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),i={class:"flex flex-col space-y-1"},d={class:"font-semibold mr-2 text-(--tooltip-label-color)"},u={class:"font-normal text-(--tooltip-value-color)"},m=e.defineComponent({__name:"Tooltip",props:{data:{},categories:{}},setup(n){const l=n,r=["_index","_stacked","_ending"],s=e.computed(()=>Object.entries(l.data).filter(([o,c])=>{var t;return!r.includes(o)&&((t=l.categories[o])==null?void 0:t.color)}));return(o,c)=>(e.openBlock(),e.createElementBlock("div",i,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,([t,a])=>(e.openBlock(),e.createElementBlock("div",{key:t,class:"flex items-center mr-2"},[e.createElementVNode("span",{class:"w-2 h-2 rounded mr-2",style:e.normalizeStyle({backgroundColor:o.categories[t].color})},null,4),e.createElementVNode("div",null,[e.createElementVNode("span",d,e.toDisplayString(t)+":",1),e.createElementVNode("span",u,e.toDisplayString(a),1)])]))),128))]))}});exports.default=m;
|
|
2
2
|
//# sourceMappingURL=Tooltip.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.cjs","sources":["../../src/components/Tooltip.vue"],"sourcesContent":["<script lang=\"ts\" setup generic=\"T\">\nimport { BulletLegendItemInterface } from \"@unovis/ts\";\n\nconst props = defineProps<{\n data: T;\n categories: Record<string, BulletLegendItemInterface>;\n}>();\n\nconst keyBlockList = [
|
|
1
|
+
{"version":3,"file":"Tooltip.cjs","sources":["../../src/components/Tooltip.vue"],"sourcesContent":["<script lang=\"ts\" setup generic=\"T\">\nimport { BulletLegendItemInterface } from \"@unovis/ts\";\nimport { computed } from \"vue\";\n\nconst props = defineProps<{\n data: T;\n categories: Record<string, BulletLegendItemInterface>;\n}>();\n\nconst keyBlockList = [\"_index\", \"_stacked\", \"_ending\"];\n\nconst visibleEntries = computed(() => {\n return Object.entries(props.data).filter(\n ([key, _]) => !keyBlockList.includes(key) && props.categories[key]?.color\n );\n});\n</script>\n\n<template>\n <div class=\"flex flex-col space-y-1\">\n <div \n v-for=\"[key, value] in visibleEntries\" \n :key=\"key\"\n class=\"flex items-center mr-2\"\n >\n <span\n class=\"w-2 h-2 rounded mr-2\"\n :style=\"{ backgroundColor: categories[key].color }\"\n ></span>\n <div>\n <span class=\"font-semibold mr-2 text-(--tooltip-label-color)\">{{ key }}:</span>\n <span class=\"font-normal text-(--tooltip-value-color)\">{{ value }}</span>\n </div>\n </div>\n </div>\n</template>\n"],"names":["props","__props","keyBlockList","visibleEntries","computed","key","_","_a"],"mappings":"qWAIA,MAAMA,EAAQC,EAKRC,EAAe,CAAC,SAAU,WAAY,SAAS,EAE/CC,EAAiBC,EAAAA,SAAS,IACvB,OAAO,QAAQJ,EAAM,IAAI,EAAE,OAChC,CAAC,CAACK,EAAKC,CAAC,IAAM,OAAA,OAACJ,EAAa,SAASG,CAAG,KAAKE,EAAAP,EAAM,WAAWK,CAAG,IAApB,YAAAE,EAAuB,OACtE,CACD"}
|
|
@@ -1,34 +1,35 @@
|
|
|
1
|
-
import { defineComponent as m, createElementBlock as
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent as m, computed as u, createElementBlock as s, openBlock as l, Fragment as _, renderList as f, createElementVNode as o, normalizeStyle as g, toDisplayString as r } from "vue";
|
|
2
|
+
const x = { class: "flex flex-col space-y-1" }, v = { class: "font-semibold mr-2 text-(--tooltip-label-color)" }, b = { class: "font-normal text-(--tooltip-value-color)" }, k = /* @__PURE__ */ m({
|
|
3
3
|
__name: "Tooltip",
|
|
4
4
|
props: {
|
|
5
5
|
data: {},
|
|
6
6
|
categories: {}
|
|
7
7
|
},
|
|
8
|
-
setup(
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
8
|
+
setup(c) {
|
|
9
|
+
const n = c, a = ["_index", "_stacked", "_ending"], i = u(() => Object.entries(n.data).filter(
|
|
10
|
+
([t, d]) => {
|
|
11
|
+
var e;
|
|
12
|
+
return !a.includes(t) && ((e = n.categories[t]) == null ? void 0 : e.color);
|
|
13
|
+
}
|
|
14
|
+
));
|
|
15
|
+
return (t, d) => (l(), s("div", x, [
|
|
16
|
+
(l(!0), s(_, null, f(i.value, ([e, p]) => (l(), s("div", {
|
|
17
|
+
key: e,
|
|
18
|
+
class: "flex items-center mr-2"
|
|
19
|
+
}, [
|
|
20
|
+
o("span", {
|
|
21
|
+
class: "w-2 h-2 rounded mr-2",
|
|
22
|
+
style: g({ backgroundColor: t.categories[e].color })
|
|
23
|
+
}, null, 4),
|
|
24
|
+
o("div", null, [
|
|
25
|
+
o("span", v, r(e) + ":", 1),
|
|
26
|
+
o("span", b, r(p), 1)
|
|
27
|
+
])
|
|
28
|
+
]))), 128))
|
|
28
29
|
]));
|
|
29
30
|
}
|
|
30
31
|
});
|
|
31
32
|
export {
|
|
32
|
-
|
|
33
|
+
k as default
|
|
33
34
|
};
|
|
34
35
|
//# sourceMappingURL=Tooltip.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.js","sources":["../../src/components/Tooltip.vue"],"sourcesContent":["<script lang=\"ts\" setup generic=\"T\">\nimport { BulletLegendItemInterface } from \"@unovis/ts\";\n\nconst props = defineProps<{\n data: T;\n categories: Record<string, BulletLegendItemInterface>;\n}>();\n\nconst keyBlockList = [
|
|
1
|
+
{"version":3,"file":"Tooltip.js","sources":["../../src/components/Tooltip.vue"],"sourcesContent":["<script lang=\"ts\" setup generic=\"T\">\nimport { BulletLegendItemInterface } from \"@unovis/ts\";\nimport { computed } from \"vue\";\n\nconst props = defineProps<{\n data: T;\n categories: Record<string, BulletLegendItemInterface>;\n}>();\n\nconst keyBlockList = [\"_index\", \"_stacked\", \"_ending\"];\n\nconst visibleEntries = computed(() => {\n return Object.entries(props.data).filter(\n ([key, _]) => !keyBlockList.includes(key) && props.categories[key]?.color\n );\n});\n</script>\n\n<template>\n <div class=\"flex flex-col space-y-1\">\n <div \n v-for=\"[key, value] in visibleEntries\" \n :key=\"key\"\n class=\"flex items-center mr-2\"\n >\n <span\n class=\"w-2 h-2 rounded mr-2\"\n :style=\"{ backgroundColor: categories[key].color }\"\n ></span>\n <div>\n <span class=\"font-semibold mr-2 text-(--tooltip-label-color)\">{{ key }}:</span>\n <span class=\"font-normal text-(--tooltip-value-color)\">{{ value }}</span>\n </div>\n </div>\n </div>\n</template>\n"],"names":["props","__props","keyBlockList","visibleEntries","computed","key","_","_a"],"mappings":";;;;;;;;AAIA,UAAMA,IAAQC,GAKRC,IAAe,CAAC,UAAU,YAAY,SAAS,GAE/CC,IAAiBC,EAAS,MACvB,OAAO,QAAQJ,EAAM,IAAI,EAAE;AAAA,MAChC,CAAC,CAACK,GAAKC,CAAC,MAAM;;AAAA,gBAACJ,EAAa,SAASG,CAAG,OAAKE,IAAAP,EAAM,WAAWK,CAAG,MAApB,gBAAAE,EAAuB;AAAA;AAAA,IACtE,CACD;;;;;;;;;;;;;;;;;;"}
|