apexsankey 1.2.0 → 1.2.1
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 +2 -0
- package/apexsankey.es.min.js +5686 -181
- package/apexsankey.min.js +9 -1
- package/demo/basic-sankey.html +30 -39
- package/lib/layout/rankAssignment/makeAcyclic.d.ts +1 -1
- package/lib/models/Paper.d.ts +1 -0
- package/package.json +1 -4
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>
|
|
@@ -9,4 +9,4 @@ export declare function findSpanningTree(G: any, v0: any): Graph;
|
|
|
9
9
|
* Returns 1 if w is a descendent of v, -1 if v is a descendent of w, and 0 if
|
|
10
10
|
* they are unrelated.
|
|
11
11
|
*/
|
|
12
|
-
export declare function nodeRelationship(tree: any, v: any, w: any): 1 |
|
|
12
|
+
export declare function nodeRelationship(tree: any, v: any, w: any): 1 | -1 | 0;
|
package/lib/models/Paper.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "apexsankey",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"defined": "^1.0.1",
|
|
6
6
|
"graphlib": "~2.1.0",
|
|
7
7
|
"lodash": "^4.17.21"
|
|
8
8
|
},
|
|
9
|
-
"peerDependencies": {
|
|
10
|
-
"@apex/graph-utils": "*"
|
|
11
|
-
},
|
|
12
9
|
"type": "module",
|
|
13
10
|
"main": "./apexsankey.min.js",
|
|
14
11
|
"module": "./apexsankey.es.min.js",
|