@progress/kendo-react-charts 7.5.0-develop.2 → 7.5.0-develop.21
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/cdn/js/kendo-react-charts.js +1 -1
- package/index.d.mts +135 -49
- package/index.d.ts +135 -49
- package/index.js +1 -1
- package/index.mjs +20 -18
- package/package-metadata.mjs +1 -1
- package/package.json +8 -8
- package/sankey/Sankey.js +1 -1
- package/sankey/Sankey.mjs +92 -48
- package/sankey/SankeyTooltip.js +8 -0
- package/sankey/SankeyTooltip.mjs +53 -0
- package/sankey/messages.js +8 -0
- package/sankey/messages.mjs +15 -0
- package/sankey/propTypes.js +1 -1
- package/sankey/propTypes.mjs +76 -35
- package/sankey/theme-service.js +8 -4
- package/sankey/theme-service.mjs +36 -36
- package/sankey/utils.js +8 -0
- package/sankey/utils.mjs +13 -0
package/sankey/Sankey.mjs
CHANGED
|
@@ -6,60 +6,104 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import * as
|
|
10
|
-
import { Sankey as
|
|
11
|
-
import { loadTheme as
|
|
12
|
-
import { validatePackage as
|
|
13
|
-
import { packageMetadata as
|
|
14
|
-
import { sankeyPropTypes as
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
import * as t from "react";
|
|
10
|
+
import { Sankey as w } from "@progress/kendo-charts";
|
|
11
|
+
import { loadTheme as x } from "./theme-service.mjs";
|
|
12
|
+
import { validatePackage as O, canUseDOM as D } from "@progress/kendo-react-common";
|
|
13
|
+
import { packageMetadata as H } from "../package-metadata.mjs";
|
|
14
|
+
import { sankeyPropTypes as I } from "./propTypes.mjs";
|
|
15
|
+
import { TooltipComponent as M, NodeTooltipContent as V, LinkTooltipContent as A } from "./SankeyTooltip.mjs";
|
|
16
|
+
const h = 12, p = {
|
|
17
|
+
offset: h,
|
|
18
|
+
visible: !0
|
|
19
|
+
}, F = ["nodeEnter", "nodeLeave", "linkEnter", "linkLeave", "nodeClick", "linkClick"], K = (o, s) => {
|
|
20
|
+
o && (o.unbind(), F.forEach((r) => {
|
|
21
|
+
s[r] && o.bind(r, s[r]);
|
|
18
22
|
}));
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
23
|
+
}, N = t.forwardRef((o, s) => {
|
|
24
|
+
O(H);
|
|
25
|
+
const r = t.useRef(null), n = t.useRef(null), u = t.useRef(null), { data: f, links: k, nodes: m, labels: y, title: E, legend: v, tooltip: c = p, disableAutoLayout: C } = o, b = t.useRef();
|
|
26
|
+
b.current = o;
|
|
27
|
+
const [T, g] = t.useState(null), L = t.useCallback((l) => {
|
|
28
|
+
const {
|
|
29
|
+
visible: a,
|
|
30
|
+
offset: e = h,
|
|
31
|
+
nodeComponent: d = V,
|
|
32
|
+
linkComponent: S = A
|
|
33
|
+
} = { ...p, ...c };
|
|
34
|
+
if (a) {
|
|
35
|
+
const P = {
|
|
36
|
+
event: l,
|
|
37
|
+
offset: e,
|
|
38
|
+
Content: l.targetType === "node" ? d : S
|
|
39
|
+
};
|
|
40
|
+
g(P);
|
|
41
|
+
}
|
|
42
|
+
}, [c]), R = t.useCallback(() => {
|
|
43
|
+
g(null);
|
|
44
|
+
}, []), i = t.useCallback((l, a) => {
|
|
45
|
+
const e = b.current[l];
|
|
46
|
+
if (e) {
|
|
47
|
+
const d = {
|
|
48
|
+
...a,
|
|
49
|
+
nativeEvent: a.originalEvent,
|
|
50
|
+
target: u.current
|
|
51
|
+
};
|
|
52
|
+
e.call(void 0, d);
|
|
53
|
+
}
|
|
54
|
+
}, []);
|
|
55
|
+
return t.useEffect(() => {
|
|
56
|
+
const l = {
|
|
57
|
+
data: f,
|
|
58
|
+
links: k,
|
|
59
|
+
nodes: m,
|
|
60
|
+
labels: y,
|
|
61
|
+
title: E,
|
|
62
|
+
legend: v,
|
|
63
|
+
disableAutoLayout: C,
|
|
64
|
+
tooltip: { ...p, ...c }
|
|
65
|
+
};
|
|
66
|
+
return n.current ? n.current.setOptions(l) : D && r.current && x(r.current.ownerDocument, (a) => {
|
|
67
|
+
n.current = new w(r.current, l, a), K(n.current, {
|
|
68
|
+
nodeEnter: (e) => {
|
|
69
|
+
i("onNodeEnter", e);
|
|
70
|
+
},
|
|
71
|
+
nodeLeave: (e) => {
|
|
72
|
+
i("onNodeLeave", e);
|
|
73
|
+
},
|
|
74
|
+
linkEnter: (e) => {
|
|
75
|
+
i("onLinkEnter", e);
|
|
76
|
+
},
|
|
77
|
+
linkLeave: (e) => {
|
|
78
|
+
i("onLinkLeave", e);
|
|
79
|
+
},
|
|
80
|
+
nodeClick: (e) => {
|
|
81
|
+
i("onNodeClick", e);
|
|
82
|
+
},
|
|
83
|
+
linkClick: (e) => {
|
|
84
|
+
i("onLinkClick", e);
|
|
85
|
+
}
|
|
86
|
+
}), n.current.bind("tooltipShow", L), n.current.bind("tooltipHide", R);
|
|
87
|
+
}), () => {
|
|
88
|
+
n.current && (n.current.destroy(), n.current = null);
|
|
89
|
+
};
|
|
90
|
+
}, [f, k, m, y, E, v, C, c, R, L, i]), t.useImperativeHandle(u, () => ({
|
|
37
91
|
get element() {
|
|
38
|
-
return
|
|
92
|
+
return r.current;
|
|
39
93
|
},
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
Object.defineProperty(u, "target", { get: () => i.current }), u.nativeEvent = u.originalEvent || null, a.call(void 0, u);
|
|
44
|
-
}), []);
|
|
45
|
-
return n.useEffect(() => {
|
|
46
|
-
g(r.current, {
|
|
47
|
-
nodeEnter: c(e.onNodeEnter),
|
|
48
|
-
nodeLeave: c(e.onNodeLeave),
|
|
49
|
-
linkEnter: c(e.onLinkEnter),
|
|
50
|
-
linkLeave: c(e.onLinkLeave)
|
|
51
|
-
});
|
|
52
|
-
}, [e.onNodeEnter, e.onNodeLeave, e.onLinkEnter, e.onLinkLeave]), /* @__PURE__ */ n.createElement(
|
|
94
|
+
exportVisual: (l) => n.current.exportVisual(l),
|
|
95
|
+
props: o
|
|
96
|
+
}), []), t.useImperativeHandle(s, () => u.current), /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(
|
|
53
97
|
"div",
|
|
54
98
|
{
|
|
55
|
-
ref:
|
|
56
|
-
className:
|
|
57
|
-
style:
|
|
99
|
+
ref: r,
|
|
100
|
+
className: o.className,
|
|
101
|
+
style: o.style
|
|
58
102
|
}
|
|
59
|
-
);
|
|
103
|
+
), T && /* @__PURE__ */ t.createElement(M, { ...T }));
|
|
60
104
|
});
|
|
61
|
-
|
|
62
|
-
|
|
105
|
+
N.propTypes = I;
|
|
106
|
+
N.displayName = "KendoReactSankey";
|
|
63
107
|
export {
|
|
64
|
-
|
|
108
|
+
N as Sankey
|
|
65
109
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react"),k=require("@progress/kendo-react-common"),v=require("@progress/kendo-svg-icons"),f=require("@progress/kendo-react-intl"),s=require("./messages.js");function x(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const l=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(n,o,l.get?l:{enumerable:!0,get:()=>t[o]})}}return n.default=t,Object.freeze(n)}const e=x(b),T=t=>{const{Content:n,offset:o,event:{tooltipData:l,dataItem:y,nodeValue:E}}=t,u=e.useRef(null);return e.useEffect(()=>{const i=u.current;if(!l||!i)return;const m={width:i.offsetWidth,height:i.offsetHeight},r={...l.popupOffset},c=l.popupAlign;r.left+=c.horizontal==="left"?o:-1*o,c.horizontal==="right"&&(r.left-=m.width),c.vertical==="bottom"?r.top-=m.height+o:r.top+=o,i.style.left=`${r.left}px`,i.style.top=`${r.top}px`,i.style.visibility=""},[l]),e.createElement("div",{ref:u,style:{visibility:"hidden"},className:"k-tooltip k-sankey-tooltip k-chart-tooltip k-chart-shared-tooltip"},e.createElement("div",{className:"k-tooltip-content"},e.createElement(n,{dataItem:y,nodeValue:E})))},d=3,C=`0 ${d}px`,g={display:"flex",alignItems:"center"},p=t=>e.createElement("div",{style:{width:15,height:15,backgroundColor:t.color,display:"inline-flex",marginLeft:d}}),a=t=>e.createElement("span",{style:{margin:C}},t.children),h=t=>f.useInternationalization().format(f.useLocalization().toLanguageString(s.tooltipUnitFormat,s.messages[s.tooltipUnitFormat]),[t||0]),I=t=>{const{color:n,label:o}=t.dataItem;return e.createElement("div",{style:g,className:"k-tooltip-content"},e.createElement(p,{color:n}),e.createElement(a,null,o.text),e.createElement(a,null,h(t.nodeValue)))},O=t=>{const{source:n,target:o,value:l}=t.dataItem;return e.createElement("div",{style:g},e.createElement(p,{color:n.color}),e.createElement(a,null,n.label.text),e.createElement(k.IconWrap,{icon:v.arrowRightIcon,name:"arrow-right"}),e.createElement(p,{color:o.color}),e.createElement(a,null,o.label.text),e.createElement(a,null,h(l)))};exports.LinkTooltipContent=O;exports.NodeTooltipContent=I;exports.TooltipComponent=T;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import * as t from "react";
|
|
10
|
+
import { IconWrap as y } from "@progress/kendo-react-common";
|
|
11
|
+
import { arrowRightIcon as x } from "@progress/kendo-svg-icons";
|
|
12
|
+
import { useInternationalization as v, useLocalization as k } from "@progress/kendo-react-intl";
|
|
13
|
+
import { tooltipUnitFormat as f, messages as b } from "./messages.mjs";
|
|
14
|
+
const L = (e) => {
|
|
15
|
+
const { Content: l, offset: o, event: { tooltipData: n, dataItem: g, nodeValue: E } } = e, m = t.useRef(null);
|
|
16
|
+
return t.useEffect(() => {
|
|
17
|
+
const i = m.current;
|
|
18
|
+
if (!n || !i)
|
|
19
|
+
return;
|
|
20
|
+
const p = { width: i.offsetWidth, height: i.offsetHeight }, r = { ...n.popupOffset }, c = n.popupAlign;
|
|
21
|
+
r.left += c.horizontal === "left" ? o : -1 * o, c.horizontal === "right" && (r.left -= p.width), c.vertical === "bottom" ? r.top -= p.height + o : r.top += o, i.style.left = `${r.left}px`, i.style.top = `${r.top}px`, i.style.visibility = "";
|
|
22
|
+
}, [n]), /* @__PURE__ */ t.createElement(
|
|
23
|
+
"div",
|
|
24
|
+
{
|
|
25
|
+
ref: m,
|
|
26
|
+
style: { visibility: "hidden" },
|
|
27
|
+
className: "k-tooltip k-sankey-tooltip k-chart-tooltip k-chart-shared-tooltip"
|
|
28
|
+
},
|
|
29
|
+
/* @__PURE__ */ t.createElement("div", { className: "k-tooltip-content" }, /* @__PURE__ */ t.createElement(l, { dataItem: g, nodeValue: E }))
|
|
30
|
+
);
|
|
31
|
+
}, u = 3, I = `0 ${u}px`, d = { display: "flex", alignItems: "center" }, s = (e) => /* @__PURE__ */ t.createElement(
|
|
32
|
+
"div",
|
|
33
|
+
{
|
|
34
|
+
style: {
|
|
35
|
+
width: 15,
|
|
36
|
+
height: 15,
|
|
37
|
+
backgroundColor: e.color,
|
|
38
|
+
display: "inline-flex",
|
|
39
|
+
marginLeft: u
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
), a = (e) => /* @__PURE__ */ t.createElement("span", { style: { margin: I } }, e.children), h = (e) => v().format(k().toLanguageString(f, b[f]), [e || 0]), N = (e) => {
|
|
43
|
+
const { color: l, label: o } = e.dataItem;
|
|
44
|
+
return /* @__PURE__ */ t.createElement("div", { style: d, className: "k-tooltip-content" }, /* @__PURE__ */ t.createElement(s, { color: l }), /* @__PURE__ */ t.createElement(a, null, o.text), /* @__PURE__ */ t.createElement(a, null, h(e.nodeValue)));
|
|
45
|
+
}, R = (e) => {
|
|
46
|
+
const { source: l, target: o, value: n } = e.dataItem;
|
|
47
|
+
return /* @__PURE__ */ t.createElement("div", { style: d }, /* @__PURE__ */ t.createElement(s, { color: l.color }), /* @__PURE__ */ t.createElement(a, null, l.label.text), /* @__PURE__ */ t.createElement(y, { icon: x, name: "arrow-right" }), /* @__PURE__ */ t.createElement(s, { color: o.color }), /* @__PURE__ */ t.createElement(a, null, o.label.text), /* @__PURE__ */ t.createElement(a, null, h(n)));
|
|
48
|
+
};
|
|
49
|
+
export {
|
|
50
|
+
R as LinkTooltipContent,
|
|
51
|
+
N as NodeTooltipContent,
|
|
52
|
+
L as TooltipComponent
|
|
53
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t="sankey.tooltipUnitFormat",o={[t]:"({0} units)"};exports.messages=o;exports.tooltipUnitFormat=t;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
const t = "sankey.tooltipUnitFormat", o = {
|
|
10
|
+
[t]: "({0} units)"
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
o as messages,
|
|
14
|
+
t as tooltipUnitFormat
|
|
15
|
+
};
|
package/sankey/propTypes.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("prop-types"),
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("prop-types"),r=e.exact({left:e.number,top:e.number}),i={left:e.number,right:e.number},l={...i,top:e.number,bottom:e.number},o=e.oneOfType([e.number,e.exact(l)]),t=o,n=e.exact({width:e.number,color:e.string,opacity:e.number,dashType:e.string}),s={visible:e.bool,font:e.string,color:e.string,opacity:e.number,align:e.oneOf(["left","right","center"]),position:e.oneOf(["inside","before","after"]),padding:t,margin:e.exact(i),border:n,offset:r},a={color:e.string,opacity:e.number,offset:r,padding:e.number,width:e.number},c={colorType:e.oneOf(["static","source","target"]),color:e.string,opacity:e.number,highlight:e.exact({opacity:e.number,inactiveOpacity:e.number})},p=e.exact({text:e.string,...s}),b=e.exact({id:e.oneOfType([e.string,e.number]).isRequired,label:p.isRequired,...a}),u=e.exact({sourceId:e.oneOfType([e.string,e.number]).isRequired,targetId:e.oneOfType([e.string,e.number]).isRequired,value:e.number.isRequired,...c}),d={data:e.exact({nodes:e.arrayOf(b.isRequired).isRequired,links:e.arrayOf(u.isRequired).isRequired}).isRequired,links:e.exact(c),nodes:e.exact(a),labels:e.exact(s),legend:e.exact({align:e.oneOf(["start","center","end"]),background:e.string,border:n,height:e.number,labels:e.object,margin:o,offsetX:e.number,offsetY:e.number,orientation:e.oneOf(["vertical","horizontal"]),padding:t,position:e.oneOf(["top","bottom","left","right","custom"]),reverse:e.bool,visible:e.bool,width:e.number,item:e.object,title:e.object}),title:e.exact({align:e.oneOf(["center","left","right"]),background:e.string,border:n,color:e.string,font:e.string,margin:o,padding:t,position:e.oneOf(["top","bottom"]),text:e.string,visible:e.bool}),tooltip:e.exact({visible:e.bool,offset:e.number,followPointer:e.bool,delay:e.number,linkComponent:e.any,nodeComponent:e.any}),className:e.string,style:e.object,disableAutoLayout:e.bool,onNodeEnter:e.func,onNodeLeave:e.func,onLinkEnter:e.func,onLinkLeave:e.func,onNodeClick:e.func,onLinkClick:e.func};exports.sankeyPropTypes=d;
|
package/sankey/propTypes.mjs
CHANGED
|
@@ -7,42 +7,42 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
import e from "prop-types";
|
|
10
|
-
const
|
|
10
|
+
const r = e.exact({
|
|
11
11
|
left: e.number,
|
|
12
12
|
top: e.number
|
|
13
|
-
}),
|
|
13
|
+
}), i = {
|
|
14
14
|
left: e.number,
|
|
15
15
|
right: e.number
|
|
16
|
-
},
|
|
17
|
-
...
|
|
16
|
+
}, l = {
|
|
17
|
+
...i,
|
|
18
18
|
top: e.number,
|
|
19
19
|
bottom: e.number
|
|
20
|
-
},
|
|
20
|
+
}, o = e.oneOfType([
|
|
21
|
+
e.number,
|
|
22
|
+
e.exact(l)
|
|
23
|
+
]), t = o, n = e.exact({
|
|
24
|
+
width: e.number,
|
|
25
|
+
color: e.string,
|
|
26
|
+
opacity: e.number,
|
|
27
|
+
dashType: e.string
|
|
28
|
+
}), s = {
|
|
21
29
|
visible: e.bool,
|
|
22
30
|
font: e.string,
|
|
23
31
|
color: e.string,
|
|
24
32
|
opacity: e.number,
|
|
25
33
|
align: e.oneOf(["left", "right", "center"]),
|
|
26
34
|
position: e.oneOf(["inside", "before", "after"]),
|
|
27
|
-
padding:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
border: e.exact({
|
|
33
|
-
width: e.number,
|
|
34
|
-
color: e.string,
|
|
35
|
-
opacity: e.number,
|
|
36
|
-
dashType: e.string
|
|
37
|
-
}),
|
|
38
|
-
offset: n
|
|
39
|
-
}, o = {
|
|
35
|
+
padding: t,
|
|
36
|
+
margin: e.exact(i),
|
|
37
|
+
border: n,
|
|
38
|
+
offset: r
|
|
39
|
+
}, a = {
|
|
40
40
|
color: e.string,
|
|
41
41
|
opacity: e.number,
|
|
42
|
-
offset:
|
|
42
|
+
offset: r,
|
|
43
43
|
padding: e.number,
|
|
44
44
|
width: e.number
|
|
45
|
-
},
|
|
45
|
+
}, c = {
|
|
46
46
|
colorType: e.oneOf(["static", "source", "target"]),
|
|
47
47
|
color: e.string,
|
|
48
48
|
opacity: e.number,
|
|
@@ -50,33 +50,74 @@ const n = e.exact({
|
|
|
50
50
|
opacity: e.number,
|
|
51
51
|
inactiveOpacity: e.number
|
|
52
52
|
})
|
|
53
|
-
},
|
|
53
|
+
}, p = e.exact({
|
|
54
54
|
text: e.string,
|
|
55
|
-
...
|
|
56
|
-
}),
|
|
55
|
+
...s
|
|
56
|
+
}), b = e.exact({
|
|
57
57
|
id: e.oneOfType([e.string, e.number]).isRequired,
|
|
58
|
-
label:
|
|
59
|
-
...
|
|
60
|
-
}),
|
|
58
|
+
label: p.isRequired,
|
|
59
|
+
...a
|
|
60
|
+
}), u = e.exact({
|
|
61
61
|
sourceId: e.oneOfType([e.string, e.number]).isRequired,
|
|
62
62
|
targetId: e.oneOfType([e.string, e.number]).isRequired,
|
|
63
63
|
value: e.number.isRequired,
|
|
64
|
-
...
|
|
65
|
-
}),
|
|
64
|
+
...c
|
|
65
|
+
}), f = {
|
|
66
66
|
data: e.exact({
|
|
67
|
-
nodes: e.arrayOf(
|
|
68
|
-
links: e.arrayOf(
|
|
67
|
+
nodes: e.arrayOf(b.isRequired).isRequired,
|
|
68
|
+
links: e.arrayOf(u.isRequired).isRequired
|
|
69
69
|
}).isRequired,
|
|
70
|
-
links: e.exact(
|
|
71
|
-
nodes: e.exact(
|
|
72
|
-
labels: e.exact(
|
|
70
|
+
links: e.exact(c),
|
|
71
|
+
nodes: e.exact(a),
|
|
72
|
+
labels: e.exact(s),
|
|
73
|
+
legend: e.exact({
|
|
74
|
+
align: e.oneOf(["start", "center", "end"]),
|
|
75
|
+
background: e.string,
|
|
76
|
+
border: n,
|
|
77
|
+
height: e.number,
|
|
78
|
+
labels: e.object,
|
|
79
|
+
margin: o,
|
|
80
|
+
offsetX: e.number,
|
|
81
|
+
offsetY: e.number,
|
|
82
|
+
orientation: e.oneOf(["vertical", "horizontal"]),
|
|
83
|
+
padding: t,
|
|
84
|
+
position: e.oneOf(["top", "bottom", "left", "right", "custom"]),
|
|
85
|
+
reverse: e.bool,
|
|
86
|
+
visible: e.bool,
|
|
87
|
+
width: e.number,
|
|
88
|
+
item: e.object,
|
|
89
|
+
title: e.object
|
|
90
|
+
}),
|
|
91
|
+
title: e.exact({
|
|
92
|
+
align: e.oneOf(["center", "left", "right"]),
|
|
93
|
+
background: e.string,
|
|
94
|
+
border: n,
|
|
95
|
+
color: e.string,
|
|
96
|
+
font: e.string,
|
|
97
|
+
margin: o,
|
|
98
|
+
padding: t,
|
|
99
|
+
position: e.oneOf(["top", "bottom"]),
|
|
100
|
+
text: e.string,
|
|
101
|
+
visible: e.bool
|
|
102
|
+
}),
|
|
103
|
+
tooltip: e.exact({
|
|
104
|
+
visible: e.bool,
|
|
105
|
+
offset: e.number,
|
|
106
|
+
followPointer: e.bool,
|
|
107
|
+
delay: e.number,
|
|
108
|
+
linkComponent: e.any,
|
|
109
|
+
nodeComponent: e.any
|
|
110
|
+
}),
|
|
73
111
|
className: e.string,
|
|
74
112
|
style: e.object,
|
|
113
|
+
disableAutoLayout: e.bool,
|
|
75
114
|
onNodeEnter: e.func,
|
|
76
115
|
onNodeLeave: e.func,
|
|
77
116
|
onLinkEnter: e.func,
|
|
78
|
-
onLinkLeave: e.func
|
|
117
|
+
onLinkLeave: e.func,
|
|
118
|
+
onNodeClick: e.func,
|
|
119
|
+
onLinkClick: e.func
|
|
79
120
|
};
|
|
80
121
|
export {
|
|
81
|
-
|
|
122
|
+
f as sankeyPropTypes
|
|
82
123
|
};
|
package/sankey/theme-service.js
CHANGED
|
@@ -5,21 +5,25 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=t=>`${t.fontWeight} ${t.fontSize} ${t.fontFamily}`,d=t=>window.getComputedStyle(t).backgroundColor,v=t=>t.toLowerCase().charCodeAt(0)-97,h=t=>{const e=t.match(/series-([a-z])$/);if(e!==null)return v(e[1]);const s=t.split("--series-")[1];return parseInt(s,10)-1},u=30,m=()=>{let t=`
|
|
9
9
|
<div class="k-var--series-a"></div>
|
|
10
10
|
<div class="k-var--series-b"></div>
|
|
11
11
|
<div class="k-var--series-c"></div>
|
|
12
12
|
<div class="k-var--series-d"></div>
|
|
13
13
|
<div class="k-var--series-e"></div>
|
|
14
14
|
<div class="k-var--series-f"></div>
|
|
15
|
-
`;for(let e=0;e<
|
|
16
|
-
<div class="k-var--series-${e+1}"></div>`;return
|
|
15
|
+
`;for(let e=0;e<u;e++)t+=`
|
|
16
|
+
<div class="k-var--series-${e+1}"></div>`;return t},k=`
|
|
17
|
+
<div class="k-var--background"></div>
|
|
17
18
|
<div class="k-var--normal-text-color"></div>
|
|
19
|
+
<div class="k-var--chart-major-lines"></div>
|
|
20
|
+
|
|
18
21
|
<div class="k-widget k-chart">
|
|
19
22
|
<div class="k-var--chart-font"></div>
|
|
23
|
+
<div class="k-var--chart-title-font"></div>
|
|
20
24
|
</div>
|
|
21
25
|
<div class="k-var--series-unset"></div>
|
|
22
26
|
<div class="k-var--series">
|
|
23
27
|
${m()}
|
|
24
28
|
</div>
|
|
25
|
-
`;class
|
|
29
|
+
`;class y{constructor(e){this.store=e}setStyle(e,s){const o=e.split(".");let r=this.store;o.forEach((i,a,n)=>{a<n.length-1&&(r=r[i]=r[i]||{})});const l=o.pop();l&&(r[l]=s)}setColors(){this.mapColor("labels.color","normal-text-color"),this.mapColor("labels.stroke.color","background"),this.mapColor("links.color","chart-major-lines"),this.mapColor("legend.labels.color","normal-text-color"),this.mapColor("title.color","normal-text-color")}setFonts(){const e=c(this.queryStyle("chart-title-font")),s=c(this.queryStyle("chart-font"));this.setStyle("title.font",e),this.setStyle("labels.font",s),this.setStyle("legend.labels.font",s)}setNodeColors(){const e=this.element;if(!e)return;const s=[].slice.call(e.querySelectorAll(".k-var--series div")),o=d(e.querySelector(".k-var--series-unset")),r=s.reduce((l,i)=>{const a=h(i.className),n=d(i);return n!==o&&(l[a]=n),l},[]);this.setStyle("nodeColors",r)}mapColor(e,s){this.setStyle(e,this.queryStyle(s).backgroundColor)}queryStyle(e){const s=this.element;return window.getComputedStyle(s.querySelector(`.k-var--${e}`))}}const C=(t,e)=>{const s={nodeColors:[]},o=new y(s),r=o.element=t.createElement("div");r.style.display="none",r.innerHTML=k,t.body.appendChild(r);try{o.setColors(),o.setFonts(),o.setNodeColors()}finally{t.body.removeChild(o.element),o.element=null,e(s)}};exports.loadTheme=C;
|
package/sankey/theme-service.mjs
CHANGED
|
@@ -6,15 +6,15 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
const
|
|
10
|
-
const e =
|
|
9
|
+
const c = (t) => `${t.fontWeight} ${t.fontSize} ${t.fontFamily}`, d = (t) => window.getComputedStyle(t).backgroundColor, v = (t) => t.toLowerCase().charCodeAt(0) - 97, h = (t) => {
|
|
10
|
+
const e = t.match(/series-([a-z])$/);
|
|
11
11
|
if (e !== null)
|
|
12
12
|
return v(e[1]);
|
|
13
|
-
const
|
|
14
|
-
return parseInt(
|
|
13
|
+
const s = t.split("--series-")[1];
|
|
14
|
+
return parseInt(s, 10) - 1;
|
|
15
15
|
};
|
|
16
|
-
const
|
|
17
|
-
let
|
|
16
|
+
const u = () => {
|
|
17
|
+
let t = `
|
|
18
18
|
<div class="k-var--series-a"></div>
|
|
19
19
|
<div class="k-var--series-b"></div>
|
|
20
20
|
<div class="k-var--series-c"></div>
|
|
@@ -23,74 +23,74 @@ const h = () => {
|
|
|
23
23
|
<div class="k-var--series-f"></div>
|
|
24
24
|
`;
|
|
25
25
|
for (let e = 0; e < 30; e++)
|
|
26
|
-
|
|
26
|
+
t += `
|
|
27
27
|
<div class="k-var--series-${e + 1}"></div>`;
|
|
28
|
-
return
|
|
28
|
+
return t;
|
|
29
29
|
}, m = `
|
|
30
|
+
<div class="k-var--background"></div>
|
|
30
31
|
<div class="k-var--normal-text-color"></div>
|
|
32
|
+
<div class="k-var--chart-major-lines"></div>
|
|
33
|
+
|
|
31
34
|
<div class="k-widget k-chart">
|
|
32
35
|
<div class="k-var--chart-font"></div>
|
|
36
|
+
<div class="k-var--chart-title-font"></div>
|
|
33
37
|
</div>
|
|
34
38
|
<div class="k-var--series-unset"></div>
|
|
35
39
|
<div class="k-var--series">
|
|
36
|
-
${
|
|
40
|
+
${u()}
|
|
37
41
|
</div>
|
|
38
42
|
`;
|
|
39
43
|
class C {
|
|
40
44
|
constructor(e) {
|
|
41
45
|
this.store = e;
|
|
42
46
|
}
|
|
43
|
-
setStyle(e,
|
|
47
|
+
setStyle(e, s) {
|
|
44
48
|
const o = e.split(".");
|
|
45
49
|
let r = this.store;
|
|
46
|
-
o.forEach((i,
|
|
47
|
-
|
|
50
|
+
o.forEach((i, a, n) => {
|
|
51
|
+
a < n.length - 1 && (r = r[i] = r[i] || {});
|
|
48
52
|
});
|
|
49
53
|
const l = o.pop();
|
|
50
|
-
l && (r[l] =
|
|
54
|
+
l && (r[l] = s);
|
|
51
55
|
}
|
|
52
56
|
setColors() {
|
|
53
|
-
this.mapColor("labels.color", "normal-text-color");
|
|
57
|
+
this.mapColor("labels.color", "normal-text-color"), this.mapColor("labels.stroke.color", "background"), this.mapColor("links.color", "chart-major-lines"), this.mapColor("legend.labels.color", "normal-text-color"), this.mapColor("title.color", "normal-text-color");
|
|
54
58
|
}
|
|
55
59
|
setFonts() {
|
|
56
|
-
const e =
|
|
57
|
-
this.setStyle("
|
|
60
|
+
const e = c(this.queryStyle("chart-title-font")), s = c(this.queryStyle("chart-font"));
|
|
61
|
+
this.setStyle("title.font", e), this.setStyle("labels.font", s), this.setStyle("legend.labels.font", s);
|
|
58
62
|
}
|
|
59
|
-
|
|
63
|
+
setNodeColors() {
|
|
60
64
|
const e = this.element;
|
|
61
65
|
if (!e)
|
|
62
66
|
return;
|
|
63
|
-
const
|
|
67
|
+
const s = [].slice.call(e.querySelectorAll(".k-var--series div")), o = d(e.querySelector(".k-var--series-unset")), r = s.reduce(
|
|
64
68
|
(l, i) => {
|
|
65
|
-
const
|
|
66
|
-
return n !== o && (l[
|
|
69
|
+
const a = h(i.className), n = d(i);
|
|
70
|
+
return n !== o && (l[a] = n), l;
|
|
67
71
|
},
|
|
68
72
|
[]
|
|
69
73
|
// Will populate the colors in this array
|
|
70
74
|
);
|
|
71
|
-
this.setStyle("
|
|
75
|
+
this.setStyle("nodeColors", r);
|
|
72
76
|
}
|
|
73
|
-
mapColor(e,
|
|
74
|
-
this.setStyle(e, this.queryStyle(
|
|
77
|
+
mapColor(e, s) {
|
|
78
|
+
this.setStyle(e, this.queryStyle(s).backgroundColor);
|
|
75
79
|
}
|
|
76
80
|
queryStyle(e) {
|
|
77
|
-
const
|
|
78
|
-
return window.getComputedStyle(
|
|
81
|
+
const s = this.element;
|
|
82
|
+
return window.getComputedStyle(s.querySelector(`.k-var--${e}`));
|
|
79
83
|
}
|
|
80
84
|
}
|
|
81
|
-
const k = (
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
},
|
|
87
|
-
nodesColors: []
|
|
88
|
-
}, o = new C(t), r = o.element = s.createElement("div");
|
|
89
|
-
r.style.display = "none", r.innerHTML = m, s.body.appendChild(r);
|
|
85
|
+
const k = (t, e) => {
|
|
86
|
+
const s = {
|
|
87
|
+
nodeColors: []
|
|
88
|
+
}, o = new C(s), r = o.element = t.createElement("div");
|
|
89
|
+
r.style.display = "none", r.innerHTML = m, t.body.appendChild(r);
|
|
90
90
|
try {
|
|
91
|
-
o.setColors(), o.setFonts(), o.
|
|
91
|
+
o.setColors(), o.setFonts(), o.setNodeColors();
|
|
92
92
|
} finally {
|
|
93
|
-
|
|
93
|
+
t.body.removeChild(o.element), o.element = null, e(s);
|
|
94
94
|
}
|
|
95
95
|
};
|
|
96
96
|
export {
|
package/sankey/utils.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@progress/kendo-charts"),t=e.createSankeyData;exports.createSankeyData=t;
|
package/sankey/utils.mjs
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import { createSankeyData as a } from "@progress/kendo-charts";
|
|
10
|
+
const t = a;
|
|
11
|
+
export {
|
|
12
|
+
t as createSankeyData
|
|
13
|
+
};
|