vue-chrts 0.0.142 → 0.0.144
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 +2 -2
- package/dist/components/Area/AreaChart.js +8 -8
- package/dist/components/AreaStacked/AreaStackedChart.cjs +1 -1
- package/dist/components/AreaStacked/AreaStackedChart.js +6 -6
- package/dist/components/Bar/BarChart.cjs +1 -1
- package/dist/components/Bar/BarChart.js +11 -11
- package/dist/components/Line/LineChart.js +2 -2
- package/dist/components/Tooltip.cjs +1 -1
- package/dist/components/Tooltip.cjs.map +1 -1
- package/dist/components/Tooltip.js +35 -5
- package/dist/components/Tooltip.js.map +1 -1
- package/dist/components/Tooltip2.cjs +1 -1
- package/dist/components/Tooltip2.cjs.map +1 -1
- package/dist/components/Tooltip2.js +2 -38
- package/dist/components/Tooltip2.js.map +1 -1
- package/package.json +1 -1
- package/dist/_virtual/_plugin-vue_export-helper.cjs +0 -2
- package/dist/_virtual/_plugin-vue_export-helper.cjs.map +0 -1
- package/dist/_virtual/_plugin-vue_export-helper.js +0 -10
- package/dist/_virtual/_plugin-vue_export-helper.js.map +0 -1
- package/dist/index.css +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
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"),
|
|
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
2
|
<linearGradient id="gradient${o}-${t}" gradientTransform="rotate(90)">
|
|
3
3
|
<stop offset="0%" stop-color="${t}" stop-opacity="1" />
|
|
4
4
|
<stop offset="100%" stop-color="${t}" stop-opacity="0" />
|
|
5
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(
|
|
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
7
|
//# sourceMappingURL=AreaChart.cjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
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
|
|
2
|
-
import { Position as
|
|
3
|
-
import { VisXYContainer as
|
|
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
4
|
import M from "../Tooltip.js";
|
|
5
5
|
const O = {
|
|
6
6
|
key: 0,
|
|
@@ -56,7 +56,7 @@ const O = {
|
|
|
56
56
|
"flex-col-reverse": s.paginationPoisition === "top"
|
|
57
57
|
}])
|
|
58
58
|
}, [
|
|
59
|
-
l(t(
|
|
59
|
+
l(t(Y), {
|
|
60
60
|
data: e.data,
|
|
61
61
|
height: e.height,
|
|
62
62
|
"svg-defs": t(T)
|
|
@@ -64,11 +64,11 @@ const O = {
|
|
|
64
64
|
default: X(() => [
|
|
65
65
|
e.hideTooltip ? u("", !0) : (r(), g(t(j), {
|
|
66
66
|
key: 0,
|
|
67
|
-
"horizontal-placement": t(
|
|
68
|
-
"vertical-placement": t(
|
|
67
|
+
"horizontal-placement": t(y).Right,
|
|
68
|
+
"vertical-placement": t(y).Top
|
|
69
69
|
}, null, 8, ["horizontal-placement", "vertical-placement"])),
|
|
70
|
-
(r(!0), c(
|
|
71
|
-
l(t(F),
|
|
70
|
+
(r(!0), c(f, null, N(Object.keys(s.categories), (n, a) => (r(), c(f, { key: a }, [
|
|
71
|
+
l(t(F), $({
|
|
72
72
|
x: (d, p) => p,
|
|
73
73
|
ref_for: !0
|
|
74
74
|
}, L(n), {
|
|
@@ -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"),r=require("@unovis/vue"),p=require("@unovis/ts"),d=require("../Tooltip.cjs"),m={class:"flex flex-col space-y-4"},f={class:"flex items center justify-end"},_=e.defineComponent({__name:"AreaStackedChart",props:{data:{},categories:{},hideTooltip:{type:Boolean}},setup(s){const a=s,c=e.computed(()=>t=>{const n=e.createApp(d.default,{data:t,categories:a.categories}),o=document.createElement("div");n.mount(o);const l=o.innerHTML;return n.unmount(),l}),i=t=>Number.parseInt(t.time),u=[t=>t.firstTime,t=>t.returning];return(t,n)=>(e.openBlock(),e.createElementBlock("div",m,[e.createVNode(e.unref(r.VisXYContainer),{data:t.data,height:200},{default:e.withCtx(()=>[e.createVNode(e.unref(r.VisArea),{x:i,y:u,color:Object.values(a.categories).map(o=>o.color),"curve-type":e.unref(p.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}),t.hideTooltip?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(r.VisCrosshair),{key:0,color:"#666",template:c.value},null,8,["template"]))]),_:1},8,["data"]),e.createElementVNode("div",f,[e.createVNode(e.unref(r.VisBulletLegend),{items:Object.values(t.categories)},null,8,["items"])])]))}});exports.default=_;
|
|
2
2
|
//# sourceMappingURL=AreaStackedChart.cjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as d, computed as f, createApp as h, createElementBlock as y, openBlock as i, createVNode as o, createElementVNode as v, unref as t, withCtx as
|
|
2
|
-
import { VisXYContainer as
|
|
1
|
+
import { defineComponent as d, computed as f, createApp as h, createElementBlock as y, openBlock as i, createVNode as o, createElementVNode as v, unref as t, withCtx as _, createBlock as g, createCommentVNode as V } from "vue";
|
|
2
|
+
import { VisXYContainer as k, VisArea as C, VisAxis as s, VisCrosshair as T, VisBulletLegend as b } from "@unovis/vue";
|
|
3
3
|
import { CurveType as x } from "@unovis/ts";
|
|
4
4
|
import B from "../Tooltip.js";
|
|
5
5
|
const N = { class: "flex flex-col space-y-4" }, A = { class: "flex items center justify-end" }, w = /* @__PURE__ */ d({
|
|
@@ -20,12 +20,12 @@ const N = { class: "flex flex-col space-y-4" }, A = { class: "flex items center
|
|
|
20
20
|
return a.unmount(), u;
|
|
21
21
|
}), m = (e) => Number.parseInt(e.time), p = [(e) => e.firstTime, (e) => e.returning];
|
|
22
22
|
return (e, a) => (i(), y("div", N, [
|
|
23
|
-
o(t(
|
|
23
|
+
o(t(k), {
|
|
24
24
|
data: e.data,
|
|
25
25
|
height: 200
|
|
26
26
|
}, {
|
|
27
|
-
default:
|
|
28
|
-
o(t(
|
|
27
|
+
default: _(() => [
|
|
28
|
+
o(t(C), {
|
|
29
29
|
x: m,
|
|
30
30
|
y: p,
|
|
31
31
|
color: Object.values(n.categories).map((r) => r.color),
|
|
@@ -41,7 +41,7 @@ const N = { class: "flex flex-col space-y-4" }, A = { class: "flex items center
|
|
|
41
41
|
label: "Number of visitors",
|
|
42
42
|
"num-ticks": 3
|
|
43
43
|
}),
|
|
44
|
-
e.hideTooltip ? V("", !0) : (i(),
|
|
44
|
+
e.hideTooltip ? V("", !0) : (i(), g(t(T), {
|
|
45
45
|
key: 0,
|
|
46
46
|
color: "#666",
|
|
47
47
|
template: l.value
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("@unovis/ts"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("@unovis/ts"),t=require("@unovis/vue"),m=require("../Tooltip.cjs"),p=require("../../types.cjs"),f=e.defineComponent({__name:"BarChart",props:{data:{},stacked:{type:Boolean},height:{},xLabel:{},yLabel:{},categories:{},xFormatter:{},yFormatter:{},yNumTicks:{},xNumTicks:{},yAxis:{},groupPadding:{},barPadding:{},radius:{},hideLegend:{type:Boolean},orientation:{default:r.Orientation.Vertical},paginationPosition:{default:p.PaginationPosition.Bottom}},setup(g){const o=g,s=e.computed(()=>o.yAxis.map(a=>n=>n[a])),d=(a,n)=>Object.values(o.categories)[n].color,u=e.computed(()=>a=>{const n=e.createApp(m.default,{data:a,categories:o.categories}),l=document.createElement("div");n.mount(l);const i=l.innerHTML;return n.unmount(),i}),c=e.computed(()=>o.paginationPosition===p.PaginationPosition.Top);return(a,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col space-y-4",{"flex-col-reverse":c.value}])},[e.createVNode(e.unref(t.VisXYContainer),{height:a.height},{default:e.withCtx(()=>[e.createVNode(e.unref(t.VisTooltip),{triggers:{[e.unref(r.GroupedBar).selectors.bar]:u.value,[e.unref(r.StackedBar).selectors.bar]:u.value}},null,8,["triggers"]),a.stacked?(e.openBlock(),e.createBlock(e.unref(t.VisStackedBar),{key:1,data:a.data,x:(l,i)=>i,y:s.value,"grid-line":!1,"domain-line":!1,color:d,"rounded-corners":a.radius??0,"group-padding":a.groupPadding??0,"bar-padding":a.barPadding??.2,orientation:a.orientation??e.unref(r.Orientation).Vertical},null,8,["data","x","y","rounded-corners","group-padding","bar-padding","orientation"])):(e.openBlock(),e.createBlock(e.unref(t.VisGroupedBar),{key:0,data:a.data,x:(l,i)=>i,y:s.value,"grid-line":!1,"domain-line":!1,color:d,"rounded-corners":a.radius??0,"group-padding":a.groupPadding??0,"bar-padding":a.barPadding??.2,orientation:a.orientation??e.unref(r.Orientation).Vertical},null,8,["data","x","y","rounded-corners","group-padding","bar-padding","orientation"])),e.createVNode(e.unref(t.VisAxis),{type:"x",label:a.xLabel,"grid-line":!1,"domain-line":!1,"tick-format":a.xFormatter,"num-ticks":a.xNumTicks,"tick-line":!1},null,8,["label","tick-format","num-ticks"]),e.createVNode(e.unref(t.VisAxis),{type:"y",label:a.yLabel,"grid-line":a.orientation!==e.unref(r.Orientation).Horizontal,"domain-line":!1,"tick-format":a.yFormatter},null,8,["label","grid-line","tick-format"])]),_:1},8,["height"]),a.hideLegend?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["flex items center justify-end",{"pb-4":c.value}])},[e.createVNode(e.unref(t.VisBulletLegend),{items:Object.values(a.categories)},null,8,["items"])],2))],2))}});exports.default=f;
|
|
2
2
|
//# sourceMappingURL=BarChart.cjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as v, computed as s, createApp as B, createElementBlock as c, openBlock as l, normalizeClass as f, createVNode as r, createCommentVNode as P, unref as a, withCtx as V, createBlock as y } from "vue";
|
|
2
|
-
import { Orientation as d, StackedBar as
|
|
2
|
+
import { Orientation as d, StackedBar as L, GroupedBar as T } from "@unovis/ts";
|
|
3
3
|
import { VisXYContainer as C, VisTooltip as A, VisGroupedBar as N, VisStackedBar as F, VisAxis as b, VisBulletLegend as j } from "@unovis/vue";
|
|
4
4
|
import O from "../Tooltip.js";
|
|
5
5
|
import { PaginationPosition as k } from "../../types.js";
|
|
@@ -25,16 +25,16 @@ const S = /* @__PURE__ */ v({
|
|
|
25
25
|
paginationPosition: { default: k.Bottom }
|
|
26
26
|
},
|
|
27
27
|
setup(h) {
|
|
28
|
-
const
|
|
28
|
+
const n = h, u = s(() => n.yAxis.map((e) => (i) => i[e])), p = (e, i) => Object.values(n.categories)[i].color, g = s(() => (e) => {
|
|
29
29
|
const i = B(O, {
|
|
30
30
|
data: e,
|
|
31
|
-
categories:
|
|
32
|
-
}),
|
|
33
|
-
i.mount(
|
|
34
|
-
const o =
|
|
31
|
+
categories: n.categories
|
|
32
|
+
}), t = document.createElement("div");
|
|
33
|
+
i.mount(t);
|
|
34
|
+
const o = t.innerHTML;
|
|
35
35
|
return i.unmount(), o;
|
|
36
36
|
}), m = s(
|
|
37
|
-
() =>
|
|
37
|
+
() => n.paginationPosition === k.Top
|
|
38
38
|
);
|
|
39
39
|
return (e, i) => (l(), c("div", {
|
|
40
40
|
class: f(["flex flex-col space-y-4", { "flex-col-reverse": m.value }])
|
|
@@ -43,14 +43,14 @@ const S = /* @__PURE__ */ v({
|
|
|
43
43
|
default: V(() => [
|
|
44
44
|
r(a(A), {
|
|
45
45
|
triggers: {
|
|
46
|
-
[a(
|
|
47
|
-
[a(
|
|
46
|
+
[a(T).selectors.bar]: g.value,
|
|
47
|
+
[a(L).selectors.bar]: g.value
|
|
48
48
|
}
|
|
49
49
|
}, null, 8, ["triggers"]),
|
|
50
50
|
e.stacked ? (l(), y(a(F), {
|
|
51
51
|
key: 1,
|
|
52
52
|
data: e.data,
|
|
53
|
-
x: (
|
|
53
|
+
x: (t, o) => o,
|
|
54
54
|
y: u.value,
|
|
55
55
|
"grid-line": !1,
|
|
56
56
|
"domain-line": !1,
|
|
@@ -62,7 +62,7 @@ const S = /* @__PURE__ */ v({
|
|
|
62
62
|
}, null, 8, ["data", "x", "y", "rounded-corners", "group-padding", "bar-padding", "orientation"])) : (l(), y(a(N), {
|
|
63
63
|
key: 0,
|
|
64
64
|
data: e.data,
|
|
65
|
-
x: (
|
|
65
|
+
x: (t, o) => o,
|
|
66
66
|
y: u.value,
|
|
67
67
|
"grid-line": !1,
|
|
68
68
|
"domain-line": !1,
|
|
@@ -2,7 +2,7 @@ import { defineComponent as g, computed as h, createApp as k, createElementBlock
|
|
|
2
2
|
import { Position as m, CurveType as C } from "@unovis/ts";
|
|
3
3
|
import { VisXYContainer as F, VisTooltip as N, VisLine as j, VisAxis as u, VisCrosshair as B, VisBulletLegend as z } from "@unovis/vue";
|
|
4
4
|
import E from "../Tooltip.js";
|
|
5
|
-
const O = { class: "flex items center justify-end" },
|
|
5
|
+
const O = { class: "flex items center justify-end" }, _ = /* @__PURE__ */ g({
|
|
6
6
|
__name: "LineChart",
|
|
7
7
|
props: {
|
|
8
8
|
data: {},
|
|
@@ -80,6 +80,6 @@ const O = { class: "flex items center justify-end" }, w = /* @__PURE__ */ g({
|
|
|
80
80
|
}
|
|
81
81
|
});
|
|
82
82
|
export {
|
|
83
|
-
|
|
83
|
+
_ as default
|
|
84
84
|
};
|
|
85
85
|
//# sourceMappingURL=LineChart.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),s=e.defineComponent({__name:"Tooltip",props:{data:{},categories:{}},setup(r){const l=r,n=["_index","_stacked","_ending"],i=e.computed(()=>Object.entries(l.data).filter(([o,a])=>{var t;return!n.includes(o)&&((t=l.categories[o])==null?void 0:t.color)}));return(o,a)=>(e.openBlock(),e.createElementBlock("div",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,([t,c])=>(e.openBlock(),e.createElementBlock("div",{key:t,style:{display:"flex","align-items":"center","margin-bottom":"4px"}},[e.createElementVNode("span",{style:e.normalizeStyle([{width:"8px",height:"8px","border-radius":"4px","margin-right":"8px"},{backgroundColor:o.categories[t].color}])},null,4),e.createElementVNode("div",null,[e.createElementVNode("span",{style:e.normalizeStyle([{"font-weight":"600","margin-right":"8px"},{color:"var(--tooltip-label-color)"}])},e.toDisplayString(t)+":",1),e.createElementVNode("span",{style:e.normalizeStyle([{"font-weight":"400"},{color:"var(--tooltip-value-color)"}])},e.toDisplayString(c),1)])]))),128))]))}});exports.default=s;
|
|
2
2
|
//# sourceMappingURL=Tooltip.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
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>\n <div v-for=\"[key, value] in visibleEntries\" :key=\"key\" style=\"display: flex; align-items: center; margin-bottom: 4px;\">\n <span\n style=\"width: 8px; height: 8px; border-radius: 4px; margin-right: 8px;\"\n :style=\"{ backgroundColor: categories[key].color }\"\n ></span>\n <div>\n <span style=\"font-weight: 600; margin-right: 8px;\" :style=\"{ color: 'var(--tooltip-label-color)' }\">{{ key }}:</span>\n <span style=\"font-weight: 400;\" :style=\"{ color: 'var(--tooltip-value-color)' }\">{{ value }}</span>\n </div>\n </div>\n </div>\n</template>\n"],"names":["props","__props","keyBlockList","visibleEntries","computed","key","_","_a"],"mappings":"gNAIA,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,8 +1,38 @@
|
|
|
1
|
-
import o from "
|
|
2
|
-
/*
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { defineComponent as g, computed as m, createElementBlock as r, openBlock as l, Fragment as x, renderList as _, createElementVNode as o, normalizeStyle as n, toDisplayString as a } from "vue";
|
|
2
|
+
const h = /* @__PURE__ */ g({
|
|
3
|
+
__name: "Tooltip",
|
|
4
|
+
props: {
|
|
5
|
+
data: {},
|
|
6
|
+
categories: {}
|
|
7
|
+
},
|
|
8
|
+
setup(s) {
|
|
9
|
+
const i = s, c = ["_index", "_stacked", "_ending"], p = m(() => Object.entries(i.data).filter(
|
|
10
|
+
([t, d]) => {
|
|
11
|
+
var e;
|
|
12
|
+
return !c.includes(t) && ((e = i.categories[t]) == null ? void 0 : e.color);
|
|
13
|
+
}
|
|
14
|
+
));
|
|
15
|
+
return (t, d) => (l(), r("div", null, [
|
|
16
|
+
(l(!0), r(x, null, _(p.value, ([e, u]) => (l(), r("div", {
|
|
17
|
+
key: e,
|
|
18
|
+
style: { display: "flex", "align-items": "center", "margin-bottom": "4px" }
|
|
19
|
+
}, [
|
|
20
|
+
o("span", {
|
|
21
|
+
style: n([{ width: "8px", height: "8px", "border-radius": "4px", "margin-right": "8px" }, { backgroundColor: t.categories[e].color }])
|
|
22
|
+
}, null, 4),
|
|
23
|
+
o("div", null, [
|
|
24
|
+
o("span", {
|
|
25
|
+
style: n([{ "font-weight": "600", "margin-right": "8px" }, { color: "var(--tooltip-label-color)" }])
|
|
26
|
+
}, a(e) + ":", 1),
|
|
27
|
+
o("span", {
|
|
28
|
+
style: n([{ "font-weight": "400" }, { color: "var(--tooltip-value-color)" }])
|
|
29
|
+
}, a(u), 1)
|
|
30
|
+
])
|
|
31
|
+
]))), 128))
|
|
32
|
+
]));
|
|
33
|
+
}
|
|
34
|
+
});
|
|
5
35
|
export {
|
|
6
|
-
|
|
36
|
+
h as default
|
|
7
37
|
};
|
|
8
38
|
//# sourceMappingURL=Tooltip.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
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>\n <div v-for=\"[key, value] in visibleEntries\" :key=\"key\" style=\"display: flex; align-items: center; margin-bottom: 4px;\">\n <span\n style=\"width: 8px; height: 8px; border-radius: 4px; margin-right: 8px;\"\n :style=\"{ backgroundColor: categories[key].color }\"\n ></span>\n <div>\n <span style=\"font-weight: 600; margin-right: 8px;\" :style=\"{ color: 'var(--tooltip-label-color)' }\">{{ key }}:</span>\n <span style=\"font-weight: 400;\" :style=\"{ color: 'var(--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;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./Tooltip.cjs");exports.default=e.default;
|
|
2
2
|
//# sourceMappingURL=Tooltip2.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip2.cjs","sources":[
|
|
1
|
+
{"version":3,"file":"Tooltip2.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,41 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
const v = { class: "flex flex-col space-y-1" }, b = {
|
|
3
|
-
id: "t-label",
|
|
4
|
-
class: "font-semibold mr-2"
|
|
5
|
-
}, h = {
|
|
6
|
-
id: "t-value",
|
|
7
|
-
class: "font-normal"
|
|
8
|
-
}, k = /* @__PURE__ */ p({
|
|
9
|
-
__name: "Tooltip",
|
|
10
|
-
props: {
|
|
11
|
-
data: {},
|
|
12
|
-
categories: {}
|
|
13
|
-
},
|
|
14
|
-
setup(c) {
|
|
15
|
-
const l = c, a = ["_index", "_stacked", "_ending"], i = u(() => Object.entries(l.data).filter(
|
|
16
|
-
([t, d]) => {
|
|
17
|
-
var e;
|
|
18
|
-
return !a.includes(t) && ((e = l.categories[t]) == null ? void 0 : e.color);
|
|
19
|
-
}
|
|
20
|
-
));
|
|
21
|
-
return (t, d) => (n(), s("div", v, [
|
|
22
|
-
(n(!0), s(_, null, f(i.value, ([e, m]) => (n(), s("div", {
|
|
23
|
-
key: e,
|
|
24
|
-
class: "flex items-center mr-2"
|
|
25
|
-
}, [
|
|
26
|
-
o("span", {
|
|
27
|
-
class: "w-2 h-2 rounded mr-2",
|
|
28
|
-
style: g({ backgroundColor: t.categories[e].color })
|
|
29
|
-
}, null, 4),
|
|
30
|
-
o("div", null, [
|
|
31
|
-
o("span", b, r(e) + ":", 1),
|
|
32
|
-
o("span", h, r(m), 1)
|
|
33
|
-
])
|
|
34
|
-
]))), 128))
|
|
35
|
-
]));
|
|
36
|
-
}
|
|
37
|
-
});
|
|
1
|
+
import f from "./Tooltip.js";
|
|
38
2
|
export {
|
|
39
|
-
|
|
3
|
+
f as default
|
|
40
4
|
};
|
|
41
5
|
//# sourceMappingURL=Tooltip2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip2.js","sources":[
|
|
1
|
+
{"version":3,"file":"Tooltip2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_plugin-vue_export-helper.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_plugin-vue_export-helper.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|
package/dist/index.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
#t-label[data-v-cce34be2]{margin-right:8px;color:var(--tooltip-label-color);text-transform:capitalize}#t-value[data-v-cce34be2]{color:var(--tooltip-value-color)}
|