@flowtools/uplot 0.0.10 → 0.0.12
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/README.md +1 -1
- package/dist/index.es.js +59 -55
- package/dist/index.umd.js +1 -1
- package/dist/src/App.vue.d.ts +2 -0
- package/dist/src/components/uplot.vue.d.ts +41 -59
- package/dist/src/index.d.ts +1 -1
- package/dist/src/utils/deepmerge.d.ts +5 -5
- package/dist/vite.config.d.ts +1 -1
- package/package.json +43 -31
- /package/dist/{style.css → uplot.css} +0 -0
package/README.md
CHANGED
|
@@ -14,9 +14,9 @@ pnpm add @flowtools/uplot uplot @vueuse/core
|
|
|
14
14
|
|
|
15
15
|
```vue
|
|
16
16
|
<script setup lang="ts">
|
|
17
|
-
import { ref } from 'vue'
|
|
18
17
|
import type { AlignedData, Options } from '@flowtools/uplot'
|
|
19
18
|
import { Uplot } from '@flowtools/uplot'
|
|
19
|
+
import { ref } from 'vue'
|
|
20
20
|
|
|
21
21
|
const options = ref<Options>({
|
|
22
22
|
series: [
|
package/dist/index.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as F, ref as D, onMounted as N, watch as v, nextTick as P, openBlock as p, createElementBlock as u, renderSlot as j, unref as d, createElementVNode as y, createTextVNode as U, toDisplayString as h, createCommentVNode as S, Fragment as L, renderList as M, normalizeClass as R, normalizeStyle as C } from "vue";
|
|
2
|
-
import q from "
|
|
3
|
-
import
|
|
4
|
-
|
|
2
|
+
import { useElementSize as q, useVModel as T } from "@vueuse/core";
|
|
3
|
+
import G from "uplot";
|
|
4
|
+
function B(n) {
|
|
5
5
|
if (typeof n == "object" && n !== null) {
|
|
6
6
|
if (typeof Object.getPrototypeOf == "function") {
|
|
7
7
|
const r = Object.getPrototypeOf(n);
|
|
@@ -10,15 +10,19 @@ const B = (n) => {
|
|
|
10
10
|
return Object.prototype.toString.call(n) === "[object Object]";
|
|
11
11
|
}
|
|
12
12
|
return !1;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
}
|
|
14
|
+
function c(...n) {
|
|
15
|
+
return n.reduce((r, a) => {
|
|
16
|
+
if (Array.isArray(a))
|
|
17
|
+
throw new TypeError(
|
|
18
|
+
"Arguments provided to ts-deepmerge must be objects, not arrays."
|
|
19
|
+
);
|
|
20
|
+
return a && Object.keys(a).forEach((o) => {
|
|
21
|
+
["__proto__", "constructor", "prototype"].includes(o) || (Array.isArray(r[o]) && Array.isArray(a[o]) ? r[o] = c.options.mergeArrays ? Array.from(new Set(r[o].concat(a[o]))) : a[o] : B(r[o]) && B(a[o]) ? r[o] = c(r[o], a[o]) : r[o] = a[o]);
|
|
22
|
+
}), r;
|
|
23
|
+
}, {});
|
|
24
|
+
}
|
|
25
|
+
const E = {
|
|
22
26
|
mergeArrays: !0
|
|
23
27
|
};
|
|
24
28
|
c.options = E;
|
|
@@ -33,13 +37,13 @@ c.withOptions = (n, ...r) => {
|
|
|
33
37
|
const H = { class: "__uplot-root" }, I = {
|
|
34
38
|
key: 0,
|
|
35
39
|
class: "extra-info"
|
|
36
|
-
}, J =
|
|
40
|
+
}, J = { style: { "text-align": "left" } }, K = { class: "__uplot-legend" }, Q = ["onClick"], W = {
|
|
37
41
|
key: 1,
|
|
38
42
|
class: "__uplot-legend-value"
|
|
39
|
-
},
|
|
43
|
+
}, X = {
|
|
40
44
|
key: 2,
|
|
41
45
|
class: "__uplot-legend-value"
|
|
42
|
-
},
|
|
46
|
+
}, oe = /* @__PURE__ */ F({
|
|
43
47
|
__name: "uplot",
|
|
44
48
|
props: {
|
|
45
49
|
options: {},
|
|
@@ -52,7 +56,7 @@ const H = { class: "__uplot-root" }, I = {
|
|
|
52
56
|
},
|
|
53
57
|
emits: ["select", "cursor", "update:zoom", "update:series"],
|
|
54
58
|
setup(n, { expose: r, emit: a }) {
|
|
55
|
-
const o = n,
|
|
59
|
+
const o = n, g = a, b = D(), { width: w, height: x } = q(b), z = T(o, "zoom", g, { passive: !0 }), i = T(o, "series", g, { passive: !0 }), $ = {
|
|
56
60
|
title: void 0,
|
|
57
61
|
legend: {
|
|
58
62
|
show: !1
|
|
@@ -60,26 +64,26 @@ const H = { class: "__uplot-root" }, I = {
|
|
|
60
64
|
hooks: {
|
|
61
65
|
init: [
|
|
62
66
|
(e) => {
|
|
63
|
-
o.showDebug && console.log("init", e), i.value = e.series.map((
|
|
64
|
-
label:
|
|
65
|
-
stroke: typeof
|
|
67
|
+
o.showDebug && console.log("init", e), i.value = e.series.map((t, s) => ({
|
|
68
|
+
label: t.label,
|
|
69
|
+
stroke: typeof t.stroke == "function" ? t.stroke(e, s) : null,
|
|
66
70
|
value: null,
|
|
67
71
|
data: null,
|
|
68
|
-
show:
|
|
72
|
+
show: t.show
|
|
69
73
|
// ...s,
|
|
70
74
|
}));
|
|
71
75
|
}
|
|
72
76
|
],
|
|
73
77
|
setCursor: [
|
|
74
78
|
(e) => {
|
|
75
|
-
|
|
79
|
+
g("cursor", e.cursor), i.value = e.series.map((t, s) => {
|
|
76
80
|
var f, m;
|
|
77
81
|
return {
|
|
78
|
-
label:
|
|
79
|
-
stroke: typeof
|
|
80
|
-
value: e.cursor.idx && e.data[
|
|
81
|
-
data: (f = e.cursor) != null && f.idx ? e.data[
|
|
82
|
-
show:
|
|
82
|
+
label: t.label,
|
|
83
|
+
stroke: typeof t.stroke == "function" ? t.stroke(e, s) : null,
|
|
84
|
+
value: e.cursor.idx && e.data[s][e.cursor.idx] ? typeof t.value == "function" ? t.value(e, e.data[s][e.cursor.idx], s, e.cursor.idx) : e.data[s][e.cursor.idx] : null,
|
|
85
|
+
data: (f = e.cursor) != null && f.idx ? e.data[s][(m = e.cursor) == null ? void 0 : m.idx] : null,
|
|
86
|
+
show: t.show
|
|
83
87
|
// ...s,
|
|
84
88
|
};
|
|
85
89
|
});
|
|
@@ -87,7 +91,7 @@ const H = { class: "__uplot-root" }, I = {
|
|
|
87
91
|
],
|
|
88
92
|
setSelect: [
|
|
89
93
|
(e) => {
|
|
90
|
-
|
|
94
|
+
g("select", e.select), o.showDebug && console.log("setSelect", e.select), z.value = [
|
|
91
95
|
e.posToVal(e.select.left, "x"),
|
|
92
96
|
e.posToVal(e.select.left + e.select.width, "x")
|
|
93
97
|
];
|
|
@@ -103,10 +107,10 @@ const H = { class: "__uplot-root" }, I = {
|
|
|
103
107
|
]
|
|
104
108
|
}
|
|
105
109
|
};
|
|
106
|
-
let
|
|
110
|
+
let l;
|
|
107
111
|
const O = D();
|
|
108
112
|
function A() {
|
|
109
|
-
|
|
113
|
+
l && l.destroy(), l = new G({ width: 100, height: 100, ...c(o.options, $) }, o.data, b.value), O.value = l, o.zoom[0] !== null && o.zoom[1] !== null && l.setScale("x", { min: o.zoom[0], max: o.zoom[1] }), setTimeout(() => {
|
|
110
114
|
k();
|
|
111
115
|
}, 0);
|
|
112
116
|
}
|
|
@@ -118,26 +122,26 @@ const H = { class: "__uplot-root" }, I = {
|
|
|
118
122
|
});
|
|
119
123
|
}), v(o.data, (e) => {
|
|
120
124
|
if (o.noResetScale) {
|
|
121
|
-
|
|
125
|
+
l.setData(e, !1), l.redraw(!1);
|
|
122
126
|
return;
|
|
123
127
|
}
|
|
124
|
-
|
|
125
|
-
}), v(o.options, (e,
|
|
126
|
-
o.showDebug && console.log("watch options", e,
|
|
127
|
-
}), v(() => o.zoom, (e
|
|
128
|
-
e[0] !== null && e[1] !== null && (
|
|
128
|
+
l.setData(e, !0);
|
|
129
|
+
}), v(o.options, (e, t) => {
|
|
130
|
+
o.showDebug && console.log("watch options", e, t), A();
|
|
131
|
+
}), v(() => o.zoom, (e) => {
|
|
132
|
+
e[0] !== null && e[1] !== null && (l.scales.x.min !== e[0] || l.scales.x.max !== e[1]) && (console.log("watch zoom setScale", l.scales.x.min, e[0], l.scales.x.max, e[1]), l.setScale("x", { min: e[0], max: e[1] }));
|
|
129
133
|
});
|
|
130
134
|
function k() {
|
|
131
|
-
|
|
135
|
+
l.setSize({ width: w.value, height: x.value }), o.showDebug && console.log("resize", l);
|
|
132
136
|
}
|
|
133
|
-
function
|
|
134
|
-
var
|
|
135
|
-
typeof e == "object" && (e = ((
|
|
137
|
+
function _(e) {
|
|
138
|
+
var t, s;
|
|
139
|
+
typeof e == "object" && (e = ((t = i.value) == null ? void 0 : t.indexOf(e)) || -1), l.setSeries(e, { show: !l.series[e].show }), (s = i.value) != null && s[e] && (i.value[e].show = l.series[e].show);
|
|
136
140
|
}
|
|
137
|
-
return r({ toggleShow:
|
|
141
|
+
return r({ toggleShow: _, uplot: O }), (e, t) => (p(), u("div", H, [
|
|
138
142
|
j(e.$slots, "header", {
|
|
139
143
|
series: d(i),
|
|
140
|
-
toggleShow:
|
|
144
|
+
toggleShow: _
|
|
141
145
|
}),
|
|
142
146
|
y("div", {
|
|
143
147
|
ref_key: "el",
|
|
@@ -146,30 +150,30 @@ const H = { class: "__uplot-root" }, I = {
|
|
|
146
150
|
}, null, 512),
|
|
147
151
|
e.showDebug ? (p(), u("div", I, [
|
|
148
152
|
U(h(d(w)) + " x " + h(d(x)) + " ", 1),
|
|
149
|
-
|
|
150
|
-
y("pre",
|
|
153
|
+
t[0] || (t[0] = y("br", null, null, -1)),
|
|
154
|
+
y("pre", J, h(d(i)), 1)
|
|
151
155
|
])) : S("", !0),
|
|
152
156
|
e.noFooter ? S("", !0) : j(e.$slots, "footer", {
|
|
153
157
|
key: 1,
|
|
154
158
|
series: d(i),
|
|
155
|
-
toggleShow:
|
|
159
|
+
toggleShow: _
|
|
156
160
|
}, () => [
|
|
157
|
-
y("div",
|
|
158
|
-
(p(!0), u(L, null, M(d(i), (
|
|
161
|
+
y("div", K, [
|
|
162
|
+
(p(!0), u(L, null, M(d(i), (s, f) => {
|
|
159
163
|
var m;
|
|
160
164
|
return p(), u("div", {
|
|
161
|
-
key:
|
|
162
|
-
class: R(["__uplot-legend-series", [`__uplot-${(m =
|
|
163
|
-
style: C({ backgroundColor:
|
|
164
|
-
onClick: (
|
|
165
|
+
key: s.label,
|
|
166
|
+
class: R(["__uplot-legend-series", [`__uplot-${(m = s.label) == null ? void 0 : m.toLowerCase()}`, `__uplot-i-${f}`]]),
|
|
167
|
+
style: C({ backgroundColor: s.show ? "" : "lightgrey" }),
|
|
168
|
+
onClick: (Y) => _(f)
|
|
165
169
|
}, [
|
|
166
170
|
f !== 0 ? (p(), u("span", {
|
|
167
171
|
key: 0,
|
|
168
|
-
style: C({ color:
|
|
172
|
+
style: C({ color: s.stroke || "black" }),
|
|
169
173
|
class: "__uplot-legend-label"
|
|
170
|
-
}, h(
|
|
171
|
-
|
|
172
|
-
], 14,
|
|
174
|
+
}, h(s.label), 5)) : S("", !0),
|
|
175
|
+
s.value ? (p(), u("span", W, h(s.value), 1)) : (p(), u("span", X, "--"))
|
|
176
|
+
], 14, Q);
|
|
173
177
|
}), 128))
|
|
174
178
|
])
|
|
175
179
|
])
|
|
@@ -177,5 +181,5 @@ const H = { class: "__uplot-root" }, I = {
|
|
|
177
181
|
}
|
|
178
182
|
});
|
|
179
183
|
export {
|
|
180
|
-
|
|
184
|
+
oe as Uplot
|
|
181
185
|
};
|
package/dist/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(c,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue"),require("@vueuse/core"),require("uplot")):typeof define=="function"&&define.amd?define(["exports","vue","@vueuse/core","uplot"],o):(c=typeof globalThis<"u"?globalThis:c||self,o(c["change-name"]={},c.vue,c.core,c.Uplot))})(this,function(c,o,g,D){"use strict";function w(i){if(typeof i=="object"&&i!==null){if(typeof Object.getPrototypeOf=="function"){const r=Object.getPrototypeOf(i);return r===Object.prototype||r===null}return Object.prototype.toString.call(i)==="[object Object]"}return!1}function f(...i){return i.reduce((r,a)=>{if(Array.isArray(a))throw new TypeError("Arguments provided to ts-deepmerge must be objects, not arrays.");return a&&Object.keys(a).forEach(t=>{["__proto__","constructor","prototype"].includes(t)||(Array.isArray(r[t])&&Array.isArray(a[t])?r[t]=f.options.mergeArrays?Array.from(new Set(r[t].concat(a[t]))):a[t]:w(r[t])&&w(a[t])?r[t]=f(r[t],a[t]):r[t]=a[t])}),r},{})}const S={mergeArrays:!0};f.options=S,f.withOptions=(i,...r)=>{f.options={mergeArrays:!0,...i};const a=f(...r);return f.options=S,a};const E={class:"__uplot-root"},O={key:0,class:"extra-info"},A={style:{"text-align":"left"}},j={class:"__uplot-legend"},C=["onClick"],T={key:1,class:"__uplot-legend-value"},N={key:2,class:"__uplot-legend-value"},$=o.defineComponent({__name:"uplot",props:{options:{},data:{},noResetScale:{type:Boolean,default:!1},showDebug:{type:Boolean,default:!1},noFooter:{type:Boolean,default:!1},zoom:{default:()=>[null,null]},series:{}},emits:["select","cursor","update:zoom","update:series"],setup(i,{expose:r,emit:a}){const t=i,h=a,y=o.ref(),{width:_,height:b}=g.useElementSize(y),k=g.useVModel(t,"zoom",h,{passive:!0}),p=g.useVModel(t,"series",h,{passive:!0}),M={title:void 0,legend:{show:!1},hooks:{init:[e=>{t.showDebug&&console.log("init",e),p.value=e.series.map((l,s)=>({label:l.label,stroke:typeof l.stroke=="function"?l.stroke(e,s):null,value:null,data:null,show:l.show}))}],setCursor:[e=>{h("cursor",e.cursor),p.value=e.series.map((l,s)=>{var d,m;return{label:l.label,stroke:typeof l.stroke=="function"?l.stroke(e,s):null,value:e.cursor.idx&&e.data[s][e.cursor.idx]?typeof l.value=="function"?l.value(e,e.data[s][e.cursor.idx],s,e.cursor.idx):e.data[s][e.cursor.idx]:null,data:(d=e.cursor)!=null&&d.idx?e.data[s][(m=e.cursor)==null?void 0:m.idx]:null,show:l.show}})}],setSelect:[e=>{h("select",e.select),t.showDebug&&console.log("setSelect",e.select),k.value=[e.posToVal(e.select.left,"x"),e.posToVal(e.select.left+e.select.width,"x")]}],setScale:[e=>{t.showDebug&&console.log("setScale",e.scales),k.value=[e.scales.x.min||null,e.scales.x.max||null]}]}};let n;const x=o.ref();function z(){n&&n.destroy(),n=new D({width:100,height:100,...f(t.options,M)},t.data,y.value),x.value=n,t.zoom[0]!==null&&t.zoom[1]!==null&&n.setScale("x",{min:t.zoom[0],max:t.zoom[1]}),setTimeout(()=>{B()},0)}o.onMounted(()=>{z()}),o.watch([_,b],()=>{o.nextTick(()=>{B()})}),o.watch(t.data,e=>{if(t.noResetScale){n.setData(e,!1),n.redraw(!1);return}n.setData(e,!0)}),o.watch(t.options,(e,l)=>{t.showDebug&&console.log("watch options",e,l),z()}),o.watch(()=>t.zoom,e=>{e[0]!==null&&e[1]!==null&&(n.scales.x.min!==e[0]||n.scales.x.max!==e[1])&&(console.log("watch zoom setScale",n.scales.x.min,e[0],n.scales.x.max,e[1]),n.setScale("x",{min:e[0],max:e[1]}))});function B(){n.setSize({width:_.value,height:b.value}),t.showDebug&&console.log("resize",n)}function u(e){var l,s;typeof e=="object"&&(e=((l=p.value)==null?void 0:l.indexOf(e))||-1),n.setSeries(e,{show:!n.series[e].show}),(s=p.value)!=null&&s[e]&&(p.value[e].show=n.series[e].show)}return r({toggleShow:u,uplot:x}),(e,l)=>(o.openBlock(),o.createElementBlock("div",E,[o.renderSlot(e.$slots,"header",{series:o.unref(p),toggleShow:u}),o.createElementVNode("div",{ref_key:"el",ref:y,class:"__uplot"},null,512),e.showDebug?(o.openBlock(),o.createElementBlock("div",O,[o.createTextVNode(o.toDisplayString(o.unref(_))+" x "+o.toDisplayString(o.unref(b))+" ",1),l[0]||(l[0]=o.createElementVNode("br",null,null,-1)),o.createElementVNode("pre",A,o.toDisplayString(o.unref(p)),1)])):o.createCommentVNode("",!0),e.noFooter?o.createCommentVNode("",!0):o.renderSlot(e.$slots,"footer",{key:1,series:o.unref(p),toggleShow:u},()=>[o.createElementVNode("div",j,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(o.unref(p),(s,d)=>{var m;return o.openBlock(),o.createElementBlock("div",{key:s.label,class:o.normalizeClass(["__uplot-legend-series",[`__uplot-${(m=s.label)==null?void 0:m.toLowerCase()}`,`__uplot-i-${d}`]]),style:o.normalizeStyle({backgroundColor:s.show?"":"lightgrey"}),onClick:P=>u(d)},[d!==0?(o.openBlock(),o.createElementBlock("span",{key:0,style:o.normalizeStyle({color:s.stroke||"black"}),class:"__uplot-legend-label"},o.toDisplayString(s.label),5)):o.createCommentVNode("",!0),s.value?(o.openBlock(),o.createElementBlock("span",T,o.toDisplayString(s.value),1)):(o.openBlock(),o.createElementBlock("span",N,"--"))],14,C)}),128))])])]))}});c.Uplot=$,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Uplot from 'uplot';
|
|
1
|
+
import { default as Uplot } from 'uplot';
|
|
2
2
|
export type Options = Omit<Uplot.Options, 'height' | 'width'>;
|
|
3
3
|
export type AlignedData = Uplot.AlignedData;
|
|
4
4
|
export interface Series {
|
|
@@ -24,74 +24,56 @@ interface UplotProps {
|
|
|
24
24
|
series?: Series[];
|
|
25
25
|
}
|
|
26
26
|
declare function toggleShow(idx: number | Series): void;
|
|
27
|
-
declare
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
declare function __VLS_template(): {
|
|
28
|
+
slots: {
|
|
29
|
+
header?(_: {
|
|
30
|
+
series: {
|
|
31
|
+
label: string | undefined;
|
|
32
|
+
stroke: string | null;
|
|
33
|
+
value: number | string | null | undefined;
|
|
34
|
+
data: number | null | undefined;
|
|
35
|
+
show: boolean | undefined;
|
|
36
|
+
}[] | undefined;
|
|
37
|
+
toggleShow: typeof toggleShow;
|
|
38
|
+
}): any;
|
|
39
|
+
footer?(_: {
|
|
40
|
+
series: {
|
|
41
|
+
label: string | undefined;
|
|
42
|
+
stroke: string | null;
|
|
43
|
+
value: number | string | null | undefined;
|
|
44
|
+
data: number | null | undefined;
|
|
45
|
+
show: boolean | undefined;
|
|
46
|
+
}[] | undefined;
|
|
47
|
+
toggleShow: typeof toggleShow;
|
|
48
|
+
}): any;
|
|
49
|
+
};
|
|
50
|
+
refs: {
|
|
51
|
+
el: HTMLDivElement;
|
|
52
|
+
};
|
|
53
|
+
attrs: Partial<{}>;
|
|
54
|
+
};
|
|
55
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
56
|
+
declare const __VLS_component: import('vue').DefineComponent<UplotProps, {
|
|
33
57
|
toggleShow: typeof toggleShow;
|
|
34
|
-
uplot: import(
|
|
35
|
-
},
|
|
36
|
-
select: (select: Uplot.Select) =>
|
|
37
|
-
cursor: (cursor: Uplot.Cursor) =>
|
|
38
|
-
"update:zoom": (zoom: number[]) =>
|
|
39
|
-
"update:series": (series: Series[]) =>
|
|
40
|
-
}, string, import(
|
|
41
|
-
noResetScale: boolean;
|
|
42
|
-
showDebug: boolean;
|
|
43
|
-
noFooter: boolean;
|
|
44
|
-
zoom: () => null[];
|
|
45
|
-
}>>> & {
|
|
58
|
+
uplot: import('vue').Ref<any, any>;
|
|
59
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
60
|
+
select: (select: Uplot.Select) => any;
|
|
61
|
+
cursor: (cursor: Uplot.Cursor) => any;
|
|
62
|
+
"update:zoom": (zoom: number[]) => any;
|
|
63
|
+
"update:series": (series: Series[]) => any;
|
|
64
|
+
}, string, import('vue').PublicProps, Readonly<UplotProps> & Readonly<{
|
|
46
65
|
onSelect?: ((select: Uplot.Select) => any) | undefined;
|
|
47
66
|
onCursor?: ((cursor: Uplot.Cursor) => any) | undefined;
|
|
48
67
|
"onUpdate:zoom"?: ((zoom: number[]) => any) | undefined;
|
|
49
68
|
"onUpdate:series"?: ((series: Series[]) => any) | undefined;
|
|
50
|
-
}
|
|
69
|
+
}>, {
|
|
51
70
|
noResetScale: boolean;
|
|
52
71
|
showDebug: boolean;
|
|
53
72
|
noFooter: boolean;
|
|
54
73
|
zoom: number[] | null[];
|
|
55
|
-
}, {}
|
|
56
|
-
|
|
57
|
-
series: {
|
|
58
|
-
label: string | undefined;
|
|
59
|
-
stroke: string | null;
|
|
60
|
-
value: string | number | null | undefined;
|
|
61
|
-
data: number | null | undefined;
|
|
62
|
-
show: boolean | undefined;
|
|
63
|
-
}[] | undefined;
|
|
64
|
-
toggleShow: typeof toggleShow;
|
|
65
|
-
}): any;
|
|
66
|
-
footer?(_: {
|
|
67
|
-
series: {
|
|
68
|
-
label: string | undefined;
|
|
69
|
-
stroke: string | null;
|
|
70
|
-
value: string | number | null | undefined;
|
|
71
|
-
data: number | null | undefined;
|
|
72
|
-
show: boolean | undefined;
|
|
73
|
-
}[] | undefined;
|
|
74
|
-
toggleShow: typeof toggleShow;
|
|
75
|
-
}): any;
|
|
76
|
-
}>;
|
|
74
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
75
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
77
76
|
export default _default;
|
|
78
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
79
|
-
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
80
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
81
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
82
|
-
} : {
|
|
83
|
-
type: import('vue').PropType<T[K]>;
|
|
84
|
-
required: true;
|
|
85
|
-
};
|
|
86
|
-
};
|
|
87
|
-
type __VLS_WithDefaults<P, D> = {
|
|
88
|
-
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
89
|
-
default: D[K];
|
|
90
|
-
}> : P[K];
|
|
91
|
-
};
|
|
92
|
-
type __VLS_Prettify<T> = {
|
|
93
|
-
[K in keyof T]: T[K];
|
|
94
|
-
} & {};
|
|
95
77
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
96
78
|
new (): {
|
|
97
79
|
$slots: S;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as Uplot } from './components/
|
|
1
|
+
export { default as Uplot } from './components/uplot.vue';
|
|
@@ -13,11 +13,11 @@ type TMerged<T> = [T] extends [Array<any>] ? {
|
|
|
13
13
|
interface IObject {
|
|
14
14
|
[key: string]: any;
|
|
15
15
|
}
|
|
16
|
-
declare
|
|
17
|
-
|
|
18
|
-
options: IOptions;
|
|
19
|
-
withOptions<
|
|
20
|
-
}
|
|
16
|
+
declare function merge<T extends IObject[]>(...objects: T): TMerged<T[number]>;
|
|
17
|
+
declare namespace merge {
|
|
18
|
+
var options: IOptions;
|
|
19
|
+
var withOptions: <T extends IObject[]>(options: Partial<IOptions>, ...objects: T) => TMerged<T[number]>;
|
|
20
|
+
}
|
|
21
21
|
interface IOptions {
|
|
22
22
|
mergeArrays: boolean;
|
|
23
23
|
}
|
package/dist/vite.config.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import(
|
|
1
|
+
declare const _default: import('vite').UserConfig;
|
|
2
2
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,59 +1,70 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flowtools/uplot",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.12",
|
|
5
5
|
"description": "Modern vue component for uplot",
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
"author": "Jukka Raimovaara <roska@mentalhouse.fi> (Mentalhouse Oy)",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"funding": "https://github.com/sponsors/flow-tools",
|
|
9
9
|
"homepage": "https://github.com/flow-tools/uplot",
|
|
10
|
-
"bugs": "https://github.com/flow-tools/uplot",
|
|
11
|
-
"author": "add author",
|
|
12
10
|
"repository": {
|
|
13
11
|
"type": "git",
|
|
14
12
|
"url": "https://github.com/flow-tools/uplot.git"
|
|
15
13
|
},
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
"bugs": "https://github.com/flow-tools/uplot",
|
|
15
|
+
"keywords": [
|
|
16
|
+
"vue",
|
|
17
|
+
"uplot",
|
|
18
|
+
"chart",
|
|
19
|
+
"component"
|
|
20
|
+
],
|
|
21
21
|
"exports": {
|
|
22
22
|
".": {
|
|
23
|
-
"
|
|
24
|
-
"
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"import": "./dist/index.es.js"
|
|
25
25
|
},
|
|
26
26
|
"./dist/style.css": "./dist/style.css"
|
|
27
27
|
},
|
|
28
28
|
"main": "./dist/index.es.js",
|
|
29
29
|
"types": "./dist/index.d.ts",
|
|
30
30
|
"files": [
|
|
31
|
-
"dist",
|
|
32
31
|
"LICENSE",
|
|
33
|
-
"README.md"
|
|
32
|
+
"README.md",
|
|
33
|
+
"dist"
|
|
34
34
|
],
|
|
35
|
-
"
|
|
35
|
+
"engines": {
|
|
36
|
+
"node": ">=18"
|
|
37
|
+
},
|
|
36
38
|
"peerDependencies": {
|
|
37
39
|
"@vueuse/core": "^9.13.0",
|
|
38
40
|
"uplot": "^1.6.24",
|
|
39
41
|
"vue": "=>3.2.47"
|
|
40
42
|
},
|
|
41
43
|
"devDependencies": {
|
|
42
|
-
"@antfu/eslint-config": "^
|
|
43
|
-
"@
|
|
44
|
-
"@
|
|
45
|
-
"@
|
|
46
|
-
"@
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
44
|
+
"@antfu/eslint-config": "^3.11.2",
|
|
45
|
+
"@types/node": "^22.10.1",
|
|
46
|
+
"@vitejs/plugin-vue": "^5.2.1",
|
|
47
|
+
"@vitest/coverage-v8": "^2.1.6",
|
|
48
|
+
"@vue/test-utils": "^2.4.6",
|
|
49
|
+
"@vueuse/core": "^12.0.0",
|
|
50
|
+
"bumpp": "^9.8.1",
|
|
51
|
+
"eslint": "^9.15.0",
|
|
52
|
+
"jsdom": "^25.0.1",
|
|
53
|
+
"lint-staged": "^15.2.10",
|
|
54
|
+
"simple-git-hooks": "^2.11.1",
|
|
55
|
+
"typescript": "^5.7.2",
|
|
56
|
+
"uplot": "^1.6.31",
|
|
52
57
|
"vi-canvas-mock": "^1.0.0",
|
|
53
|
-
"vite": "^
|
|
54
|
-
"vite-plugin-dts": "^3.
|
|
55
|
-
"vitest": "^
|
|
56
|
-
"vue": "^3.
|
|
58
|
+
"vite": "^6.0.1",
|
|
59
|
+
"vite-plugin-dts": "^4.3.0",
|
|
60
|
+
"vitest": "^2.1.6",
|
|
61
|
+
"vue": "^3.5.13"
|
|
62
|
+
},
|
|
63
|
+
"simple-git-hooks": {
|
|
64
|
+
"pre-commit": "pnpm lint-staged"
|
|
65
|
+
},
|
|
66
|
+
"lint-staged": {
|
|
67
|
+
"*": "pnpm eslint . --fix"
|
|
57
68
|
},
|
|
58
69
|
"publishConfig": {
|
|
59
70
|
"access": "public"
|
|
@@ -66,6 +77,7 @@
|
|
|
66
77
|
"lint:fix": "eslint . --fix",
|
|
67
78
|
"test": "vitest",
|
|
68
79
|
"test:watch": "vitest --watch",
|
|
69
|
-
"coverage": "vitest run --coverage"
|
|
80
|
+
"coverage": "vitest run --coverage",
|
|
81
|
+
"postinstall": "npx simple-git-hooks"
|
|
70
82
|
}
|
|
71
83
|
}
|
|
File without changes
|