apexsankey 1.2.4 → 1.2.5
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/apexsankey.es.min.js +194 -0
- package/apexsankey.min.js +2 -2
- package/demo/basic-sankey.html +30 -39
- package/index.d.ts +4 -1
- package/lib/sankey.d.ts +5 -0
- package/package.json +2 -18
- package/.husky/commit-msg +0 -1
- package/.husky/pre-push +0 -1
- package/commitlint.config.js +0 -5
package/demo/basic-sankey.html
CHANGED
|
@@ -1,93 +1,84 @@
|
|
|
1
|
-
<!
|
|
1
|
+
<!doctype html>
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>Document</title>
|
|
7
|
-
<link
|
|
8
|
-
href="https://fonts.googleapis.com/css2?family=Quicksand:wght@400;600&display=swap"
|
|
9
|
-
rel="stylesheet"
|
|
10
|
-
/>
|
|
7
|
+
<link href="https://fonts.googleapis.com/css2?family=Quicksand:wght@400;600&display=swap" rel="stylesheet" />
|
|
11
8
|
<script src="https://cdn.jsdelivr.net/npm/@svgdotjs/svg.js"></script>
|
|
12
9
|
<script src="../apexsankey.min.js"></script>
|
|
13
10
|
</head>
|
|
14
11
|
<body>
|
|
15
|
-
<div
|
|
16
|
-
id="svg-sankey"
|
|
17
|
-
style="margin: 0 auto; width: 800px; height: 600px"
|
|
18
|
-
></div>
|
|
12
|
+
<div id="svg-sankey" style="margin: 0 auto; width: 800px; height: 600px"></div>
|
|
19
13
|
<script>
|
|
20
14
|
const data = {
|
|
21
15
|
nodes: [
|
|
22
16
|
{
|
|
23
|
-
id:
|
|
24
|
-
title:
|
|
17
|
+
id: 'Oil',
|
|
18
|
+
title: 'Oil',
|
|
25
19
|
},
|
|
26
20
|
{
|
|
27
|
-
id:
|
|
28
|
-
title:
|
|
21
|
+
id: 'Natural Gas',
|
|
22
|
+
title: 'Natural Gas',
|
|
29
23
|
},
|
|
30
24
|
{
|
|
31
|
-
id:
|
|
32
|
-
title:
|
|
25
|
+
id: 'Coal',
|
|
26
|
+
title: 'Coal',
|
|
33
27
|
},
|
|
34
28
|
{
|
|
35
|
-
id:
|
|
36
|
-
title:
|
|
29
|
+
id: 'Fossil Fuels',
|
|
30
|
+
title: 'Fossil Fuels',
|
|
37
31
|
},
|
|
38
32
|
{
|
|
39
|
-
id:
|
|
40
|
-
title:
|
|
33
|
+
id: 'Electricity',
|
|
34
|
+
title: 'Electricity',
|
|
41
35
|
},
|
|
42
36
|
{
|
|
43
|
-
id:
|
|
44
|
-
title:
|
|
37
|
+
id: 'Energy',
|
|
38
|
+
title: 'Energy',
|
|
45
39
|
},
|
|
46
40
|
],
|
|
47
41
|
edges: [
|
|
48
42
|
{
|
|
49
|
-
source:
|
|
50
|
-
target:
|
|
43
|
+
source: 'Oil',
|
|
44
|
+
target: 'Fossil Fuels',
|
|
51
45
|
value: 15,
|
|
52
46
|
},
|
|
53
47
|
{
|
|
54
|
-
source:
|
|
55
|
-
target:
|
|
48
|
+
source: 'Natural Gas',
|
|
49
|
+
target: 'Fossil Fuels',
|
|
56
50
|
value: 20,
|
|
57
51
|
},
|
|
58
52
|
{
|
|
59
|
-
source:
|
|
60
|
-
target:
|
|
53
|
+
source: 'Coal',
|
|
54
|
+
target: 'Fossil Fuels',
|
|
61
55
|
value: 25,
|
|
62
56
|
},
|
|
63
57
|
{
|
|
64
|
-
source:
|
|
65
|
-
target:
|
|
58
|
+
source: 'Coal',
|
|
59
|
+
target: 'Electricity',
|
|
66
60
|
value: 25,
|
|
67
61
|
},
|
|
68
62
|
{
|
|
69
|
-
source:
|
|
70
|
-
target:
|
|
63
|
+
source: 'Fossil Fuels',
|
|
64
|
+
target: 'Energy',
|
|
71
65
|
value: 60,
|
|
72
66
|
},
|
|
73
67
|
{
|
|
74
|
-
source:
|
|
75
|
-
target:
|
|
68
|
+
source: 'Electricity',
|
|
69
|
+
target: 'Energy',
|
|
76
70
|
value: 25,
|
|
77
71
|
},
|
|
78
72
|
],
|
|
79
73
|
};
|
|
80
74
|
const graphOptions = {
|
|
81
75
|
nodeWidth: 20,
|
|
82
|
-
fontFamily:
|
|
83
|
-
fontWeight:
|
|
76
|
+
fontFamily: 'Quicksand, sans-serif',
|
|
77
|
+
fontWeight: '600',
|
|
84
78
|
height: 600,
|
|
85
79
|
enableToolbar: true,
|
|
86
80
|
};
|
|
87
|
-
const s = new ApexSankey(
|
|
88
|
-
document.getElementById("svg-sankey"),
|
|
89
|
-
graphOptions
|
|
90
|
-
);
|
|
81
|
+
const s = new ApexSankey(document.getElementById('svg-sankey'), graphOptions);
|
|
91
82
|
s.render(data);
|
|
92
83
|
</script>
|
|
93
84
|
</body>
|
package/index.d.ts
CHANGED
package/lib/sankey.d.ts
CHANGED
|
@@ -6,5 +6,10 @@ export declare class ApexSankey {
|
|
|
6
6
|
options: SankeyOptions;
|
|
7
7
|
graph: SankeyGraph;
|
|
8
8
|
constructor(element: HTMLElement, options: SankeyOptions);
|
|
9
|
+
static setLicense(key: string): void;
|
|
10
|
+
/**
|
|
11
|
+
* Handle watermark display based on license validation
|
|
12
|
+
*/
|
|
13
|
+
private handleWatermark;
|
|
9
14
|
render(data: GraphData): SankeyGraph;
|
|
10
15
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "apexsankey",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.5",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"defined": "^1.0.1",
|
|
6
6
|
"graphlib": "~2.1.0",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"main": "./apexsankey.min.js",
|
|
11
11
|
"module": "./apexsankey.es.min.js",
|
|
12
12
|
"types": "./index.d.ts",
|
|
13
|
-
"license": "See
|
|
13
|
+
"license": "See LICENSE in LICENSE",
|
|
14
14
|
"exports": {
|
|
15
15
|
".": {
|
|
16
16
|
"import": {
|
|
@@ -22,21 +22,5 @@
|
|
|
22
22
|
"default": "./apexsankey.min.js"
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
},
|
|
26
|
-
"devDependencies": {
|
|
27
|
-
"@commitlint/cli": "^19.8.1",
|
|
28
|
-
"@commitlint/config-conventional": "^19.8.1",
|
|
29
|
-
"commitlint": "^19.8.1",
|
|
30
|
-
"husky": "^9.1.7",
|
|
31
|
-
"standard-version": "^9.5.0"
|
|
32
|
-
},
|
|
33
|
-
"scripts": {
|
|
34
|
-
"prepare": "husky",
|
|
35
|
-
"release": "standard-version --no-tag"
|
|
36
|
-
},
|
|
37
|
-
"standard-version": {
|
|
38
|
-
"skip": {
|
|
39
|
-
"tag": true
|
|
40
|
-
}
|
|
41
25
|
}
|
|
42
26
|
}
|
package/.husky/commit-msg
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
npx --no -- commitlint --edit "$1"
|
package/.husky/pre-push
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
npm run release && git push --no-verify
|