apexsankey 1.1.0 → 1.1.2

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.
@@ -8,7 +8,7 @@
8
8
  <script src="../apexsankey.min.js"></script>
9
9
  </head>
10
10
  <body>
11
- <div id="svg-sankey" style="display: flex; justify-content: center"></div>
11
+ <div id="svg-sankey" style="display: flex; justify-content: center; width: 100%; height: 300px"></div>
12
12
  <script>
13
13
  const data = {
14
14
  nodes: [
@@ -74,6 +74,7 @@
74
74
  nodeWidth: 20,
75
75
  fontFamily: 'Quicksand, sans-serif',
76
76
  fontWeight: 600,
77
+ height: 600,
77
78
  };
78
79
  const s = new ApexSankey(document.getElementById('svg-sankey'), graphOptions);
79
80
  s.render(data);
@@ -4,11 +4,12 @@
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 href="https://fonts.googleapis.com/css2?family=Satisfy&display=swap" rel="stylesheet" />
7
8
  <script src="../apexsankey.min.js"></script>
8
9
  </head>
9
10
 
10
11
  <body>
11
- <div id="svg-sankey" style="display: flex; justify-content: center"></div>
12
+ <div id="svg-sankey" style="display: flex; justify-content: center; width: 100%; height: 300px"></div>
12
13
  <script>
13
14
  const data = {
14
15
  nodes: [
@@ -157,6 +158,10 @@
157
158
  };
158
159
  const graphOptions = {
159
160
  nodeWidth: 10,
161
+ fontSize: '20px',
162
+ fontFamily: 'Satisfy, "cursive"',
163
+ fontWeight: 600,
164
+ fontColor: '#E37816',
160
165
  };
161
166
  const s = new ApexSankey(document.getElementById('svg-sankey'), graphOptions);
162
167
  s.render(data);
@@ -8,7 +8,7 @@
8
8
  <script src="../apexsankey.min.js"></script>
9
9
  </head>
10
10
  <body>
11
- <div id="svg-sankey" style="display: flex; justify-content: center"></div>
11
+ <div id="svg-sankey" style="display: flex; justify-content: center; width: 100%; height: 500px"></div>
12
12
  <script>
13
13
  const data = {
14
14
  nodes: [
@@ -95,6 +95,7 @@
95
95
  nodeWidth: 20,
96
96
  fontFamily: 'Quicksand, sans-serif',
97
97
  fontWeight: 600,
98
+ edgeOpacity: 0.2,
98
99
  };
99
100
  const s = new ApexSankey(document.getElementById('svg-sankey'), graphOptions);
100
101
  s.render(data);
@@ -8,7 +8,7 @@
8
8
  <script src="../apexsankey.min.js"></script>
9
9
  </head>
10
10
  <body>
11
- <div id="svg-sankey" style="display: flex; justify-content: center"></div>
11
+ <div id="svg-sankey" style="display: flex; justify-content: center; width: 100%; height: 300px"></div>
12
12
  <script>
13
13
  const data = {
14
14
  nodes: [
@@ -96,9 +96,12 @@
96
96
  };
97
97
  const graphOptions = {
98
98
  width: 1200,
99
- nodeWidth: 20,
100
99
  fontFamily: 'Quicksand, sans-serif',
101
100
  fontWeight: 600,
101
+ nodeWidth: 5,
102
+ nodeBorderWidth: 2,
103
+ nodeBorderColor: '#111',
104
+ edgeGradientFill: false,
102
105
  };
103
106
  const s = new ApexSankey(document.getElementById('svg-sankey'), graphOptions);
104
107
  s.render(data);
@@ -23,6 +23,7 @@ export interface Graph {
23
23
  }
24
24
  export declare class SankeyGraph extends Paper {
25
25
  graph: any;
26
+ maxRank: number;
26
27
  element: HTMLElement;
27
28
  options: SankeyOptions;
28
29
  constructor(element: HTMLElement, options: SankeyOptions);
@@ -1,3 +1,3 @@
1
1
  import { G } from '@svgdotjs/svg.js';
2
2
  import { FontOptions, NodeOptions } from './Options';
3
- export declare function renderNode(graphNode: any, options: Partial<NodeOptions & FontOptions>): G;
3
+ export declare function renderNode(graphNode: any, maxRank: number, options: Partial<NodeOptions & FontOptions>): G;
@@ -18,7 +18,7 @@ export declare function drawRect({ x, y, width, height, radius, color, borderCol
18
18
  opacity?: number;
19
19
  }): Rect;
20
20
  export declare function drawCircle(attributes?: CircleAttr): Circle;
21
- export declare function drawText(text: string, { x, y, fontColor, textAnchor }: any): Text;
21
+ export declare function drawText(text: string, { x, y, fontColor, textAnchor, pointerEvents }: any): Text;
22
22
  export declare function drawTemplate(template: string, { nodeWidth, nodeHeight }?: any): ForeignObject;
23
23
  export declare function drawGroup(x?: number, y?: number, id?: string, parent?: string): G;
24
24
  export declare function drawPath(pathString: string, { id, edgeColor, opacity }?: Partial<{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apexsankey",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "dependencies": {
5
5
  "@svgdotjs/svg.js": "^3.2.0",
6
6
  "@svgdotjs/svg.panzoom.js": "^2.1.2",