@caipira/tamandua 0.0.60 → 0.0.61
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/ChartTreemap.js +2 -2
- package/dist/{ChartTreemap.vue_vue_type_script_setup_true_lang-B7eDxuIH.js → ChartTreemap.vue_vue_type_script_setup_true_lang-DKaI62CD.js} +48 -49
- package/dist/components.js +1 -1
- package/dist/{plugin-D8EMKVQ9.js → plugin-B97_3CZA.js} +1 -1
- package/dist/{plugins-CpDwnGUh.js → plugins-B1SFJH99.js} +1 -1
- package/dist/plugins.js +1 -1
- package/dist/tamandua.js +1 -1
- package/dist/types/components/ChartTreemap/ChartTreemap.story.d.ts +0 -1
- package/dist/types/components/ChartTreemap/types.d.ts +4 -7
- package/package.json +1 -1
package/dist/ChartTreemap.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as e } from "./ChartTreemap.vue_vue_type_script_setup_true_lang-
|
|
2
|
-
import { p as m } from "./plugin-
|
|
1
|
+
import { _ as e } from "./ChartTreemap.vue_vue_type_script_setup_true_lang-DKaI62CD.js";
|
|
2
|
+
import { p as m } from "./plugin-B97_3CZA.js";
|
|
3
3
|
export {
|
|
4
4
|
e as ChartTreemap,
|
|
5
5
|
m as ChartTreemapPlugin
|
|
@@ -20,18 +20,18 @@ function Q(e, t) {
|
|
|
20
20
|
return this;
|
|
21
21
|
}
|
|
22
22
|
function U(e, t) {
|
|
23
|
-
for (var r = this, a = [r],
|
|
24
|
-
if (e.call(t, r, ++l, this),
|
|
25
|
-
for (
|
|
26
|
-
a.push(i
|
|
23
|
+
for (var r = this, a = [r], o, i, l = -1; r = a.pop(); )
|
|
24
|
+
if (e.call(t, r, ++l, this), o = r.children)
|
|
25
|
+
for (i = o.length - 1; i >= 0; --i)
|
|
26
|
+
a.push(o[i]);
|
|
27
27
|
return this;
|
|
28
28
|
}
|
|
29
29
|
function ee(e, t) {
|
|
30
|
-
for (var r = this, a = [r],
|
|
31
|
-
if (
|
|
32
|
-
for (l = 0, u =
|
|
33
|
-
a.push(
|
|
34
|
-
for (; r =
|
|
30
|
+
for (var r = this, a = [r], o = [], i, l, u, d = -1; r = a.pop(); )
|
|
31
|
+
if (o.push(r), i = r.children)
|
|
32
|
+
for (l = 0, u = i.length; l < u; ++l)
|
|
33
|
+
a.push(i[l]);
|
|
34
|
+
for (; r = o.pop(); )
|
|
35
35
|
e.call(t, r, ++d, this);
|
|
36
36
|
return this;
|
|
37
37
|
}
|
|
@@ -43,8 +43,8 @@ function te(e, t) {
|
|
|
43
43
|
}
|
|
44
44
|
function ne(e) {
|
|
45
45
|
return this.eachAfter(function(t) {
|
|
46
|
-
for (var r = +e(t.data) || 0, a = t.children,
|
|
47
|
-
r += a[
|
|
46
|
+
for (var r = +e(t.data) || 0, a = t.children, o = a && a.length; --o >= 0; )
|
|
47
|
+
r += a[o].value;
|
|
48
48
|
t.value = r;
|
|
49
49
|
});
|
|
50
50
|
}
|
|
@@ -56,17 +56,17 @@ function re(e) {
|
|
|
56
56
|
function ae(e) {
|
|
57
57
|
for (var t = this, r = oe(t, e), a = [t]; t !== r; )
|
|
58
58
|
t = t.parent, a.push(t);
|
|
59
|
-
for (var
|
|
60
|
-
a.splice(
|
|
59
|
+
for (var o = a.length; e !== r; )
|
|
60
|
+
a.splice(o, 0, e), e = e.parent;
|
|
61
61
|
return a;
|
|
62
62
|
}
|
|
63
63
|
function oe(e, t) {
|
|
64
64
|
if (e === t)
|
|
65
65
|
return e;
|
|
66
|
-
var r = e.ancestors(), a = t.ancestors(),
|
|
66
|
+
var r = e.ancestors(), a = t.ancestors(), o = null;
|
|
67
67
|
for (e = r.pop(), t = a.pop(); e === t; )
|
|
68
|
-
|
|
69
|
-
return
|
|
68
|
+
o = e, e = r.pop(), t = a.pop();
|
|
69
|
+
return o;
|
|
70
70
|
}
|
|
71
71
|
function ie() {
|
|
72
72
|
for (var e = this, t = [e]; e = e.parent; )
|
|
@@ -89,20 +89,20 @@ function se() {
|
|
|
89
89
|
}), t;
|
|
90
90
|
}
|
|
91
91
|
function* ce() {
|
|
92
|
-
var e = this, t, r = [e], a,
|
|
92
|
+
var e = this, t, r = [e], a, o, i;
|
|
93
93
|
do
|
|
94
94
|
for (t = r.reverse(), r = []; e = t.pop(); )
|
|
95
95
|
if (yield e, a = e.children)
|
|
96
|
-
for (
|
|
97
|
-
r.push(a[
|
|
96
|
+
for (o = 0, i = a.length; o < i; ++o)
|
|
97
|
+
r.push(a[o]);
|
|
98
98
|
while (r.length);
|
|
99
99
|
}
|
|
100
100
|
function $(e, t) {
|
|
101
101
|
e instanceof Map ? (e = [void 0, e], t === void 0 && (t = he)) : t === void 0 && (t = de);
|
|
102
|
-
for (var r = new C(e), a,
|
|
102
|
+
for (var r = new C(e), a, o = [r], i, l, u, d; a = o.pop(); )
|
|
103
103
|
if ((l = t(a.data)) && (d = (l = Array.from(l)).length))
|
|
104
104
|
for (a.children = l, u = d - 1; u >= 0; --u)
|
|
105
|
-
|
|
105
|
+
o.push(i = l[u] = new C(l[u])), i.parent = a, i.depth = a.depth + 1;
|
|
106
106
|
return r.eachBefore(ge);
|
|
107
107
|
}
|
|
108
108
|
function fe() {
|
|
@@ -159,18 +159,18 @@ function S(e) {
|
|
|
159
159
|
function me(e) {
|
|
160
160
|
e.x0 = Math.round(e.x0), e.y0 = Math.round(e.y0), e.x1 = Math.round(e.x1), e.y1 = Math.round(e.y1);
|
|
161
161
|
}
|
|
162
|
-
function ye(e, t, r, a,
|
|
163
|
-
for (var
|
|
164
|
-
l =
|
|
162
|
+
function ye(e, t, r, a, o) {
|
|
163
|
+
for (var i = e.children, l, u = -1, d = i.length, m = e.value && (a - t) / e.value; ++u < d; )
|
|
164
|
+
l = i[u], l.y0 = r, l.y1 = o, l.x0 = t, l.x1 = t += l.value * m;
|
|
165
165
|
}
|
|
166
|
-
function be(e, t, r, a,
|
|
167
|
-
for (var
|
|
168
|
-
l =
|
|
166
|
+
function be(e, t, r, a, o) {
|
|
167
|
+
for (var i = e.children, l, u = -1, d = i.length, m = e.value && (o - r) / e.value; ++u < d; )
|
|
168
|
+
l = i[u], l.x0 = t, l.x1 = a, l.y0 = r, l.y1 = r += l.value * m;
|
|
169
169
|
}
|
|
170
170
|
var we = (1 + Math.sqrt(5)) / 2;
|
|
171
|
-
function _e(e, t, r, a,
|
|
171
|
+
function _e(e, t, r, a, o, i) {
|
|
172
172
|
for (var l = [], u = t.children, d, m, s = 0, y = 0, n = u.length, g, v, f = t.value, c, p, w, _, A, k, b; s < n; ) {
|
|
173
|
-
g =
|
|
173
|
+
g = o - r, v = i - a;
|
|
174
174
|
do
|
|
175
175
|
c = u[y++].value;
|
|
176
176
|
while (!c && y < n);
|
|
@@ -181,26 +181,26 @@ function _e(e, t, r, a, i, o) {
|
|
|
181
181
|
}
|
|
182
182
|
A = _;
|
|
183
183
|
}
|
|
184
|
-
l.push(d = { value: c, dice: g < v, children: u.slice(s, y) }), d.dice ? ye(d, r, a,
|
|
184
|
+
l.push(d = { value: c, dice: g < v, children: u.slice(s, y) }), d.dice ? ye(d, r, a, o, f ? a += v * c / f : i) : be(d, r, a, f ? r += g * c / f : o, i), f -= c, s = y;
|
|
185
185
|
}
|
|
186
186
|
return l;
|
|
187
187
|
}
|
|
188
188
|
const ke = function e(t) {
|
|
189
|
-
function r(a,
|
|
190
|
-
_e(t, a,
|
|
189
|
+
function r(a, o, i, l, u) {
|
|
190
|
+
_e(t, a, o, i, l, u);
|
|
191
191
|
}
|
|
192
192
|
return r.ratio = function(a) {
|
|
193
193
|
return e((a = +a) > 1 ? a : 1);
|
|
194
194
|
}, r;
|
|
195
195
|
}(we);
|
|
196
196
|
function Be() {
|
|
197
|
-
var e = ke, t = !1, r = 1, a = 1,
|
|
197
|
+
var e = ke, t = !1, r = 1, a = 1, o = [0], i = x, l = x, u = x, d = x, m = x;
|
|
198
198
|
function s(n) {
|
|
199
|
-
return n.x0 = n.y0 = 0, n.x1 = r, n.y1 = a, n.eachBefore(y),
|
|
199
|
+
return n.x0 = n.y0 = 0, n.x1 = r, n.y1 = a, n.eachBefore(y), o = [0], t && n.eachBefore(me), n;
|
|
200
200
|
}
|
|
201
201
|
function y(n) {
|
|
202
|
-
var g =
|
|
203
|
-
c < v && (v = c = (v + c) / 2), p < f && (f = p = (f + p) / 2), n.x0 = v, n.y0 = f, n.x1 = c, n.y1 = p, n.children && (g =
|
|
202
|
+
var g = o[n.depth], v = n.x0 + g, f = n.y0 + g, c = n.x1 - g, p = n.y1 - g;
|
|
203
|
+
c < v && (v = c = (v + c) / 2), p < f && (f = p = (f + p) / 2), n.x0 = v, n.y0 = f, n.x1 = c, n.y1 = p, n.children && (g = o[n.depth + 1] = i(n) / 2, v += m(n) - g, f += l(n) - g, c -= u(n) - g, p -= d(n) - g, c < v && (v = c = (v + c) / 2), p < f && (f = p = (f + p) / 2), e(n, v, f, c, p));
|
|
204
204
|
}
|
|
205
205
|
return s.round = function(n) {
|
|
206
206
|
return arguments.length ? (t = !!n, s) : t;
|
|
@@ -211,7 +211,7 @@ function Be() {
|
|
|
211
211
|
}, s.padding = function(n) {
|
|
212
212
|
return arguments.length ? s.paddingInner(n).paddingOuter(n) : s.paddingInner();
|
|
213
213
|
}, s.paddingInner = function(n) {
|
|
214
|
-
return arguments.length ? (
|
|
214
|
+
return arguments.length ? (i = typeof n == "function" ? n : S(+n), s) : i;
|
|
215
215
|
}, s.paddingOuter = function(n) {
|
|
216
216
|
return arguments.length ? s.paddingTop(n).paddingRight(n).paddingBottom(n).paddingLeft(n) : s.paddingTop();
|
|
217
217
|
}, s.paddingTop = function(n) {
|
|
@@ -247,25 +247,24 @@ const Re = /* @__PURE__ */ P({
|
|
|
247
247
|
name: "TChartTreemap",
|
|
248
248
|
__name: "ChartTreemap",
|
|
249
249
|
props: {
|
|
250
|
-
data: {}
|
|
251
|
-
options: {}
|
|
250
|
+
data: {}
|
|
252
251
|
},
|
|
253
252
|
setup(e) {
|
|
254
|
-
const t = e, r =
|
|
253
|
+
const t = e, r = M(0), a = M(0), o = `tamandua-chart-treemap-${++Ce}`, i = M(), l = M(), u = M(), { floatingStyles: d, update: m } = j(l, i, {
|
|
255
254
|
middleware: [Z(10), G()]
|
|
256
255
|
}), s = (f) => {
|
|
257
256
|
u.value = f;
|
|
258
257
|
}, y = () => {
|
|
259
|
-
!
|
|
258
|
+
!i.value || i.value.style.display === "none" || (i.value.style.display = "none");
|
|
260
259
|
}, n = () => {
|
|
261
|
-
!
|
|
260
|
+
!i.value || i.value.style.display === "block" || (i.value.style.display = "block");
|
|
262
261
|
}, g = (f) => {
|
|
263
|
-
|
|
262
|
+
r.value = f.pageX, a.value = f.pageY, m();
|
|
264
263
|
}, v = () => {
|
|
265
264
|
const c = parseInt(
|
|
266
|
-
q(`div#${
|
|
265
|
+
q(`div#${o}`).style("width"),
|
|
267
266
|
10
|
|
268
|
-
), p = 350, w = q(`div#${
|
|
267
|
+
), p = 350, w = q(`div#${o} svg`).attr("width", c).attr("height", p).append("g"), _ = $(t.data).sum((h) => h?.value ?? 0).sort(
|
|
269
268
|
(h, B) => (B.value ?? 0) - (h.value ?? 0)
|
|
270
269
|
), k = Be().size([c, p]).padding(1)(_), b = Ae;
|
|
271
270
|
w.selectAll("rect").data(k.leaves()).enter().append("rect").attr("x", (h) => h.x0).attr("y", (h) => h.y0).attr("width", (h) => h.x1 - h.x0).attr("height", (h) => h.y1 - h.y0).attr("fill", (h, B) => h.data.color ? h.data.color : h.parent?.data?.color ? h.parent?.data?.color : b(B / 7)).on("mouseover", (h, B) => s(B.data));
|
|
@@ -274,7 +273,7 @@ const Re = /* @__PURE__ */ P({
|
|
|
274
273
|
v();
|
|
275
274
|
}), (f, c) => (N(), I(R, null, [
|
|
276
275
|
T("div", {
|
|
277
|
-
id:
|
|
276
|
+
id: o,
|
|
278
277
|
class: "w-full",
|
|
279
278
|
onMousemove: g,
|
|
280
279
|
onMouseenter: n,
|
|
@@ -286,14 +285,14 @@ const Re = /* @__PURE__ */ P({
|
|
|
286
285
|
ref: l,
|
|
287
286
|
class: "w-1 h-1 absolute",
|
|
288
287
|
style: V({
|
|
289
|
-
left: `${
|
|
290
|
-
top: `${
|
|
288
|
+
left: `${r.value}px`,
|
|
289
|
+
top: `${a.value}px`
|
|
291
290
|
})
|
|
292
291
|
}, null, 4)
|
|
293
292
|
], 32),
|
|
294
293
|
T("div", {
|
|
295
294
|
ref_key: "tooltip",
|
|
296
|
-
ref:
|
|
295
|
+
ref: i,
|
|
297
296
|
style: V(D(d)),
|
|
298
297
|
class: "hidden absolute select-none bg-caipira-primary border-color text-base px-2 py-1 rounded-sm"
|
|
299
298
|
}, [
|
package/dist/components.js
CHANGED
|
@@ -2,7 +2,7 @@ import { _ as e } from "./Avatar.vue_vue_type_script_setup_true_lang-BbcM5CB3.js
|
|
|
2
2
|
import { _ as a } from "./Backdrop.vue_vue_type_script_setup_true_lang-OaEBTmYK.js";
|
|
3
3
|
import { B as s } from "./Button-uTiKL1_J.js";
|
|
4
4
|
import { _ as f } from "./ChartLine.vue_vue_type_style_index_0_lang-DO_gKCe4.js";
|
|
5
|
-
import { _ as n } from "./ChartTreemap.vue_vue_type_script_setup_true_lang-
|
|
5
|
+
import { _ as n } from "./ChartTreemap.vue_vue_type_script_setup_true_lang-DKaI62CD.js";
|
|
6
6
|
import { D as u } from "./Drawer-Cl9_4uHA.js";
|
|
7
7
|
import { _ as l } from "./Dropdown.vue_vue_type_script_setup_true_lang-pjG__bX2.js";
|
|
8
8
|
import { _ as c } from "./FileDrop.vue_vue_type_script_setup_true_lang-DLEH_LLX.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r } from "./register-component-B-fdqewb.js";
|
|
2
|
-
import { _ as s } from "./ChartTreemap.vue_vue_type_script_setup_true_lang-
|
|
2
|
+
import { _ as s } from "./ChartTreemap.vue_vue_type_script_setup_true_lang-DKaI62CD.js";
|
|
3
3
|
const m = {
|
|
4
4
|
install(o) {
|
|
5
5
|
r(o, s);
|
|
@@ -7,7 +7,7 @@ import { p as r } from "./plugin-D3ADZgWc.js";
|
|
|
7
7
|
import "./transform-DSaNEFMr.js";
|
|
8
8
|
import "./ChartLine.vue_vue_type_style_index_0_lang-DO_gKCe4.js";
|
|
9
9
|
import { p as o } from "./plugin-DDXOF4cU.js";
|
|
10
|
-
import { p as n } from "./plugin-
|
|
10
|
+
import { p as n } from "./plugin-B97_3CZA.js";
|
|
11
11
|
import "./Drawer-Cl9_4uHA.js";
|
|
12
12
|
import { p as m } from "./plugin-CNwzCYlr.js";
|
|
13
13
|
import { p as u } from "./plugin-CNqL90UL.js";
|
package/dist/plugins.js
CHANGED
|
@@ -7,7 +7,7 @@ import { p as S } from "./plugin-D3ADZgWc.js";
|
|
|
7
7
|
import "./transform-DSaNEFMr.js";
|
|
8
8
|
import "./ChartLine.vue_vue_type_style_index_0_lang-DO_gKCe4.js";
|
|
9
9
|
import { p as v } from "./plugin-DDXOF4cU.js";
|
|
10
|
-
import { p as D } from "./plugin-
|
|
10
|
+
import { p as D } from "./plugin-B97_3CZA.js";
|
|
11
11
|
import "./Drawer-Cl9_4uHA.js";
|
|
12
12
|
import { p as L } from "./plugin-CNwzCYlr.js";
|
|
13
13
|
import { p as A } from "./plugin-CNqL90UL.js";
|
package/dist/tamandua.js
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export type Node = {
|
|
4
|
-
children?: Node[];
|
|
1
|
+
export type ChartTreemapNode = {
|
|
2
|
+
children?: ChartTreemapNode[];
|
|
5
3
|
color?: string;
|
|
6
4
|
label?: string;
|
|
7
5
|
tooltipSlotName?: string;
|
|
8
|
-
tooltipSlotComponent?:
|
|
6
|
+
tooltipSlotComponent?: any;
|
|
9
7
|
tooltipSlotComponentProps?: Record<string, any>;
|
|
10
8
|
value: number;
|
|
11
9
|
};
|
|
12
10
|
export type ChartTreemapProps = {
|
|
13
11
|
data: {
|
|
14
12
|
name: string;
|
|
15
|
-
children:
|
|
13
|
+
children: ChartTreemapNode[];
|
|
16
14
|
};
|
|
17
|
-
options: never;
|
|
18
15
|
};
|