@hpcc-js/graph 2.87.2 → 2.87.3

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.
Files changed (57) hide show
  1. package/LICENSE +43 -43
  2. package/README.md +256 -256
  3. package/dist/index.es6.js +7 -7
  4. package/dist/index.es6.js.map +1 -1
  5. package/dist/index.js +7 -7
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.min.js +1 -1
  8. package/dist/index.min.js.map +1 -1
  9. package/package.json +8 -8
  10. package/src/AdjacencyGraph.ts +224 -224
  11. package/src/Edge.css +23 -23
  12. package/src/Edge.ts +257 -257
  13. package/src/Graph.css +18 -18
  14. package/src/Graph.ts +1075 -1075
  15. package/src/GraphData.ts +187 -187
  16. package/src/GraphLayouts.ts +173 -173
  17. package/src/Sankey.css +46 -46
  18. package/src/Sankey.ts +291 -291
  19. package/src/Subgraph.css +10 -10
  20. package/src/Subgraph.ts +165 -165
  21. package/src/Vertex.css +3 -3
  22. package/src/Vertex.ts +282 -282
  23. package/src/__package__.ts +3 -3
  24. package/src/__tests__/data.ts +444 -444
  25. package/src/__tests__/index.ts +1 -1
  26. package/src/__tests__/test1.ts +18 -18
  27. package/src/__tests__/test2.ts +80 -80
  28. package/src/__tests__/test3.ts +46 -46
  29. package/src/__tests__/test4.ts +66 -66
  30. package/src/__tests__/test5.ts +85 -85
  31. package/src/graph2/dataGraph.ts +305 -305
  32. package/src/graph2/graph.css +34 -34
  33. package/src/graph2/graph.ts +135 -135
  34. package/src/graph2/graphReactT.ts +44 -44
  35. package/src/graph2/graphT.ts +1330 -1330
  36. package/src/graph2/index.ts +7 -7
  37. package/src/graph2/layouts/circle.ts +37 -37
  38. package/src/graph2/layouts/dagre.ts +132 -132
  39. package/src/graph2/layouts/dagreWorker.ts +35 -35
  40. package/src/graph2/layouts/forceDirected.ts +117 -117
  41. package/src/graph2/layouts/forceDirectedWorker.ts +30 -30
  42. package/src/graph2/layouts/geoForceDirected.ts +112 -112
  43. package/src/graph2/layouts/graphviz.ts +124 -124
  44. package/src/graph2/layouts/graphvizWorker.ts +71 -71
  45. package/src/graph2/layouts/index.ts +7 -7
  46. package/src/graph2/layouts/layout.ts +105 -105
  47. package/src/graph2/layouts/null.ts +35 -35
  48. package/src/graph2/layouts/placeholders.ts +103 -103
  49. package/src/graph2/layouts/tree.ts +328 -328
  50. package/src/graph2/liteMap.ts +72 -72
  51. package/src/graph2/liteSVGZooom.ts +61 -61
  52. package/src/graph2/sankeyGraph.css +45 -45
  53. package/src/graph2/sankeyGraph.ts +316 -316
  54. package/src/graph2/subgraph.tsx +30 -30
  55. package/src/graph2/vertex.tsx +31 -31
  56. package/src/index.ts +8 -8
  57. package/src/test.ts +649 -649
package/src/Sankey.ts CHANGED
@@ -1,291 +1,291 @@
1
- import { Palette, PropertyExt, SVGWidget, Utility } from "@hpcc-js/common";
2
- import { max as d3Max, mean as d3Mean, median as d3Median, min as d3Min, sum as d3Sum } from "d3-array";
3
- import { sankey as d3Sankey, sankeyLinkHorizontal as d3SankeyLinkHorizontal } from "d3-sankey";
4
- import { select as d3Select } from "d3-selection";
5
-
6
- import "../src/Sankey.css";
7
-
8
- const d3Aggr = {
9
- mean: d3Mean,
10
- median: d3Median,
11
- min: d3Min,
12
- max: d3Max,
13
- sum: d3Sum
14
- };
15
-
16
- export class SankeyColumn extends PropertyExt {
17
- _owner: Sankey;
18
-
19
- constructor() {
20
- super();
21
- }
22
-
23
- owner(): Sankey;
24
- owner(_: Sankey): this;
25
- owner(_?: Sankey): Sankey | this {
26
- if (!arguments.length) return this._owner;
27
- this._owner = _;
28
- return this;
29
- }
30
-
31
- valid(): boolean {
32
- return !!this.column();
33
- }
34
-
35
- aggregate(values) {
36
- switch (this.aggrType()) {
37
- case null:
38
- case undefined:
39
- case "":
40
- return values.length;
41
- default:
42
- const columns = this._owner.columns();
43
- const colIdx = columns.indexOf(this.aggrColumn());
44
- return d3Aggr[this.aggrType()](values, function (value) {
45
- return +value[colIdx];
46
- });
47
- }
48
- }
49
-
50
- column: { (): string; (_: string): SankeyColumn; };
51
- aggrType: { (): string; (_: string): SankeyColumn; };
52
- aggrColumn: { (): string; (_: string): SankeyColumn; };
53
-
54
- }
55
- SankeyColumn.prototype._class += " graph_Sankey.SankeyColumn";
56
-
57
- SankeyColumn.prototype.publish("column", null, "set", "Field", function () { return this._owner ? this._owner.columns() : []; }, { optional: true });
58
- SankeyColumn.prototype.publish("aggrType", null, "set", "Aggregation Type", [null, "mean", "median", "sum", "min", "max"], { optional: true, disable: w => !w._owner || w._owner.mappings().indexOf(w) === 0 });
59
- SankeyColumn.prototype.publish("aggrColumn", null, "set", "Aggregation Field", function () { return this._owner ? this._owner.columns() : []; }, { optional: true, disable: w => !w._owner || !w.aggrType() || w._owner.mappings().indexOf(w) === 0 });
60
-
61
- export class Sankey extends SVGWidget {
62
- Column;
63
- _palette;
64
- _d3Sankey;
65
- _d3SankeyPath;
66
- _selection;
67
-
68
- constructor() {
69
- super();
70
- Utility.SimpleSelectionMixin.call(this);
71
- this._drawStartPos = "origin";
72
- }
73
-
74
- sankeyData() {
75
- const retVal = {
76
- vertices: [],
77
- edges: []
78
- };
79
- if (this.data().length === 0) return retVal;
80
- const vertexIndex = {};
81
- const valueIdx = 2;
82
- const mappings = this.mappings().filter(mapping => mapping.valid());
83
- mappings.forEach(function (mapping, idx) {
84
- const view = this._db.rollupView([mapping.column()]);
85
- view.entries().forEach(function (row) {
86
- const id = mapping.column() + ":" + idx + ":" + row.key;
87
- if (!vertexIndex[id]) {
88
- retVal.vertices.push({
89
- __id: id,
90
- __category: mapping.column(),
91
- name: row.key,
92
- origRow: row.value,
93
- value: row.value[idx][valueIdx]
94
- });
95
- vertexIndex[id] = retVal.vertices.length - 1;
96
- }
97
- }, this);
98
- }, this);
99
- mappings.forEach(function (mapping, idx) {
100
- if (idx < mappings.length - 1) {
101
- const mapping2 = mappings[idx + 1];
102
- const view = this._db.rollupView([mapping.column(), mapping2.column()]);
103
- view.entries().forEach(function (row) {
104
- const sourceID = mapping.column() + ":" + idx + ":" + row.key;
105
- row.values.forEach(function (value) {
106
- const targetID = mapping2.column() + ":" + (idx + 1) + ":" + value.key;
107
- retVal.edges.push({
108
- __id: sourceID + "_" + targetID,
109
- source: vertexIndex[sourceID],
110
- target: vertexIndex[targetID],
111
- value: value.value[0][valueIdx]
112
- });
113
- });
114
- });
115
- }
116
- }, this);
117
-
118
- return retVal;
119
- }
120
- enter(domNode, element) {
121
- super.enter(domNode, element);
122
-
123
- this._d3Sankey = new d3Sankey();
124
- this._selection.widgetElement(element);
125
- }
126
-
127
- update(domNode, element) {
128
- super.update(domNode, element);
129
-
130
- this._palette = this._palette.switch(this.paletteID());
131
-
132
- const strokeWidth = this.vertexStrokeWidth();
133
-
134
- const sankeyData = this.sankeyData();
135
- const sw2 = strokeWidth * 2;
136
- this._d3Sankey
137
- .extent([
138
- [strokeWidth, strokeWidth],
139
- [this.width() - sw2, this.height() - sw2]
140
- ])
141
- .nodeWidth(this.vertexWidth())
142
- .nodePadding(this.vertexPadding())
143
- ;
144
- this._d3Sankey({
145
- nodes: sankeyData.vertices,
146
- links: sankeyData.edges
147
- });
148
- const context = this;
149
-
150
- // Links ---
151
- const link = element.selectAll(".link").data(sankeyData.edges);
152
- link.enter().append("path")
153
- .attr("class", "link")
154
- .each(function () {
155
- d3Select(this)
156
- .append("title")
157
- ;
158
- })
159
- .merge(link)
160
- .attr("d", d3SankeyLinkHorizontal())
161
- .style("stroke-width", function (d) {
162
- return Math.max(1, d.width);
163
- })
164
- .sort(function (a, b) { return b.width - a.width; })
165
- .select("title")
166
- .text(function (d) {
167
- return d.source.name + " → " + d.target.name + "\n" + d.value;
168
- })
169
- ;
170
- link.exit().remove();
171
- // Nodes ---
172
- const node = element.selectAll(".node").data(sankeyData.vertices);
173
- node.enter().append("g")
174
- .attr("class", "node")
175
- .call(this._selection.enter.bind(this._selection))
176
- .on("click", function (d) {
177
- context.click(context.rowToObj(d.origRow[0]), "", context._selection.selected(this));
178
- })
179
- .on("dblclick", function (d) {
180
- context.dblclick(context.rowToObj(d.origRow[0]), "", context._selection.selected(this));
181
- })
182
- .each(function () {
183
- const gElement = d3Select(this);
184
- gElement.append("rect");
185
- gElement.append("text");
186
- })
187
- /*
188
- .call(d3.behavior.drag()
189
- .origin(function (d) { return d; })
190
- .on("dragstart", function () {
191
- this.parentNode.appendChild(this);
192
- })
193
- .on("drag", dragmove)
194
- )
195
- */
196
- .merge(node)
197
- .attr("transform", function (d) {
198
- let _x = 0;
199
- let _y = 0;
200
- if (d.x0) _x = d.x0;
201
- if (d.y0) _y = d.y0;
202
- return "translate(" + (_x + strokeWidth) + "," + (_y + strokeWidth) + ")";
203
- })
204
- .each(function () {
205
- const n = d3Select(this);
206
- n.select("rect")
207
- .attr("height", function (d: any) { return d.y1 - d.y0; })
208
- .attr("width", context._d3Sankey.nodeWidth())
209
- .style("fill", function (d: any) { return context._palette(d.name); })
210
- .style("stroke", function (d: any) { return context.vertexStrokeColor(); })
211
- .style("stroke-width", function (d: any) { return strokeWidth; })
212
- .style("cursor", (context.xAxisMovement() || context.yAxisMovement()) ? null : "default")
213
- ;
214
- n.select("text")
215
- .attr("x", -6)
216
- .attr("y", function (d: any) {
217
- return (d.y1 - d.y0) / 2;
218
- })
219
- .attr("dy", ".35em")
220
- .attr("text-anchor", "end")
221
- .attr("transform", null)
222
- .text(function (d: any) { return d.name; })
223
- .filter(function (d: any) { return d.x0 < context.width() / 2; })
224
- .attr("x", 6 + context._d3Sankey.nodeWidth())
225
- .attr("text-anchor", "start")
226
- ;
227
- });
228
- node.exit().remove();
229
-
230
- /*
231
- function dragmove(d) {
232
- var gElement = d3.select(this);
233
- if (context.xAxisMovement()) {
234
- d.x = Math.max(0, Math.min(context.width() - d.dx, d3.event.x));
235
- }
236
- if (context.yAxisMovement()) {
237
- d.y = Math.max(0, Math.min(context.height() - d.dy, d3.event.y));
238
- }
239
- gElement.attr("transform", "translate(" + d.x + "," + d.y + ")");
240
- context._d3Sankey.relayout();
241
- link.attr("d", context._d3SankeyPath);
242
-
243
- gElement.select("text")
244
- .attr("x", -6)
245
- .attr("y", function (d) { return d.dy / 2; })
246
- .attr("dy", ".35em")
247
- .attr("text-anchor", "end")
248
- .attr("transform", null)
249
- .text(function (d) { return d.name; })
250
- .filter(function (d) { return d.x < context.width() / 2; })
251
- .attr("x", 6 + context._d3Sankey.nodeWidth())
252
- .attr("text-anchor", "start")
253
- ;
254
- }
255
- */
256
- }
257
-
258
- paletteID: { (): string; (_: string): Sankey; };
259
- mappings: { (): SankeyColumn[]; (_: SankeyColumn[]): Sankey; };
260
- vertexStrokeWidth: { (): number; (_: number): Sankey; };
261
- vertexStrokeColor: { (): string; (_: string): Sankey; };
262
- vertexWidth: { (): number; (_: number): Sankey; };
263
- vertexPadding: { (): number; (_: number): Sankey; };
264
- xAxisMovement: { (): boolean; (_: boolean): Sankey; };
265
- yAxisMovement: { (): boolean; (_: boolean): Sankey; };
266
-
267
- exit(domNode, element) {
268
- super.exit(domNode, element);
269
- }
270
-
271
- // Events ---
272
- click(row, column, selected) {
273
- }
274
-
275
- dblclick(row, column, selected) {
276
- }
277
- }
278
- Sankey.prototype._class += " graph_Sankey";
279
- Sankey.prototype.Column = SankeyColumn;
280
- Sankey.prototype.mixin(Utility.SimpleSelectionMixin);
281
-
282
- Sankey.prototype._palette = Palette.ordinal("default");
283
-
284
- Sankey.prototype.publish("paletteID", "default", "set", "Color palette for this widget", Sankey.prototype._palette.switch());
285
- Sankey.prototype.publish("mappings", [], "propertyArray", "Source Columns", null, { autoExpand: SankeyColumn });
286
- Sankey.prototype.publish("vertexStrokeWidth", 1, "number", "Vertex Stroke Width");
287
- Sankey.prototype.publish("vertexStrokeColor", "darkgray", "string", "Vertex Stroke Color");
288
- Sankey.prototype.publish("vertexWidth", 36, "number", "Vertex Width");
289
- Sankey.prototype.publish("vertexPadding", 40, "number", "Vertex Padding");
290
- Sankey.prototype.publish("xAxisMovement", false, "boolean", "Enable x-axis movement");
291
- Sankey.prototype.publish("yAxisMovement", false, "boolean", "Enable y-axis movement");
1
+ import { Palette, PropertyExt, SVGWidget, Utility } from "@hpcc-js/common";
2
+ import { max as d3Max, mean as d3Mean, median as d3Median, min as d3Min, sum as d3Sum } from "d3-array";
3
+ import { sankey as d3Sankey, sankeyLinkHorizontal as d3SankeyLinkHorizontal } from "d3-sankey";
4
+ import { select as d3Select } from "d3-selection";
5
+
6
+ import "../src/Sankey.css";
7
+
8
+ const d3Aggr = {
9
+ mean: d3Mean,
10
+ median: d3Median,
11
+ min: d3Min,
12
+ max: d3Max,
13
+ sum: d3Sum
14
+ };
15
+
16
+ export class SankeyColumn extends PropertyExt {
17
+ _owner: Sankey;
18
+
19
+ constructor() {
20
+ super();
21
+ }
22
+
23
+ owner(): Sankey;
24
+ owner(_: Sankey): this;
25
+ owner(_?: Sankey): Sankey | this {
26
+ if (!arguments.length) return this._owner;
27
+ this._owner = _;
28
+ return this;
29
+ }
30
+
31
+ valid(): boolean {
32
+ return !!this.column();
33
+ }
34
+
35
+ aggregate(values) {
36
+ switch (this.aggrType()) {
37
+ case null:
38
+ case undefined:
39
+ case "":
40
+ return values.length;
41
+ default:
42
+ const columns = this._owner.columns();
43
+ const colIdx = columns.indexOf(this.aggrColumn());
44
+ return d3Aggr[this.aggrType()](values, function (value) {
45
+ return +value[colIdx];
46
+ });
47
+ }
48
+ }
49
+
50
+ column: { (): string; (_: string): SankeyColumn; };
51
+ aggrType: { (): string; (_: string): SankeyColumn; };
52
+ aggrColumn: { (): string; (_: string): SankeyColumn; };
53
+
54
+ }
55
+ SankeyColumn.prototype._class += " graph_Sankey.SankeyColumn";
56
+
57
+ SankeyColumn.prototype.publish("column", null, "set", "Field", function () { return this._owner ? this._owner.columns() : []; }, { optional: true });
58
+ SankeyColumn.prototype.publish("aggrType", null, "set", "Aggregation Type", [null, "mean", "median", "sum", "min", "max"], { optional: true, disable: w => !w._owner || w._owner.mappings().indexOf(w) === 0 });
59
+ SankeyColumn.prototype.publish("aggrColumn", null, "set", "Aggregation Field", function () { return this._owner ? this._owner.columns() : []; }, { optional: true, disable: w => !w._owner || !w.aggrType() || w._owner.mappings().indexOf(w) === 0 });
60
+
61
+ export class Sankey extends SVGWidget {
62
+ Column;
63
+ _palette;
64
+ _d3Sankey;
65
+ _d3SankeyPath;
66
+ _selection;
67
+
68
+ constructor() {
69
+ super();
70
+ Utility.SimpleSelectionMixin.call(this);
71
+ this._drawStartPos = "origin";
72
+ }
73
+
74
+ sankeyData() {
75
+ const retVal = {
76
+ vertices: [],
77
+ edges: []
78
+ };
79
+ if (this.data().length === 0) return retVal;
80
+ const vertexIndex = {};
81
+ const valueIdx = 2;
82
+ const mappings = this.mappings().filter(mapping => mapping.valid());
83
+ mappings.forEach(function (mapping, idx) {
84
+ const view = this._db.rollupView([mapping.column()]);
85
+ view.entries().forEach(function (row) {
86
+ const id = mapping.column() + ":" + idx + ":" + row.key;
87
+ if (!vertexIndex[id]) {
88
+ retVal.vertices.push({
89
+ __id: id,
90
+ __category: mapping.column(),
91
+ name: row.key,
92
+ origRow: row.value,
93
+ value: row.value[idx][valueIdx]
94
+ });
95
+ vertexIndex[id] = retVal.vertices.length - 1;
96
+ }
97
+ }, this);
98
+ }, this);
99
+ mappings.forEach(function (mapping, idx) {
100
+ if (idx < mappings.length - 1) {
101
+ const mapping2 = mappings[idx + 1];
102
+ const view = this._db.rollupView([mapping.column(), mapping2.column()]);
103
+ view.entries().forEach(function (row) {
104
+ const sourceID = mapping.column() + ":" + idx + ":" + row.key;
105
+ row.values.forEach(function (value) {
106
+ const targetID = mapping2.column() + ":" + (idx + 1) + ":" + value.key;
107
+ retVal.edges.push({
108
+ __id: sourceID + "_" + targetID,
109
+ source: vertexIndex[sourceID],
110
+ target: vertexIndex[targetID],
111
+ value: value.value[0][valueIdx]
112
+ });
113
+ });
114
+ });
115
+ }
116
+ }, this);
117
+
118
+ return retVal;
119
+ }
120
+ enter(domNode, element) {
121
+ super.enter(domNode, element);
122
+
123
+ this._d3Sankey = new d3Sankey();
124
+ this._selection.widgetElement(element);
125
+ }
126
+
127
+ update(domNode, element) {
128
+ super.update(domNode, element);
129
+
130
+ this._palette = this._palette.switch(this.paletteID());
131
+
132
+ const strokeWidth = this.vertexStrokeWidth();
133
+
134
+ const sankeyData = this.sankeyData();
135
+ const sw2 = strokeWidth * 2;
136
+ this._d3Sankey
137
+ .extent([
138
+ [strokeWidth, strokeWidth],
139
+ [this.width() - sw2, this.height() - sw2]
140
+ ])
141
+ .nodeWidth(this.vertexWidth())
142
+ .nodePadding(this.vertexPadding())
143
+ ;
144
+ this._d3Sankey({
145
+ nodes: sankeyData.vertices,
146
+ links: sankeyData.edges
147
+ });
148
+ const context = this;
149
+
150
+ // Links ---
151
+ const link = element.selectAll(".link").data(sankeyData.edges);
152
+ link.enter().append("path")
153
+ .attr("class", "link")
154
+ .each(function () {
155
+ d3Select(this)
156
+ .append("title")
157
+ ;
158
+ })
159
+ .merge(link)
160
+ .attr("d", d3SankeyLinkHorizontal())
161
+ .style("stroke-width", function (d) {
162
+ return Math.max(1, d.width);
163
+ })
164
+ .sort(function (a, b) { return b.width - a.width; })
165
+ .select("title")
166
+ .text(function (d) {
167
+ return d.source.name + " → " + d.target.name + "\n" + d.value;
168
+ })
169
+ ;
170
+ link.exit().remove();
171
+ // Nodes ---
172
+ const node = element.selectAll(".node").data(sankeyData.vertices);
173
+ node.enter().append("g")
174
+ .attr("class", "node")
175
+ .call(this._selection.enter.bind(this._selection))
176
+ .on("click", function (d) {
177
+ context.click(context.rowToObj(d.origRow[0]), "", context._selection.selected(this));
178
+ })
179
+ .on("dblclick", function (d) {
180
+ context.dblclick(context.rowToObj(d.origRow[0]), "", context._selection.selected(this));
181
+ })
182
+ .each(function () {
183
+ const gElement = d3Select(this);
184
+ gElement.append("rect");
185
+ gElement.append("text");
186
+ })
187
+ /*
188
+ .call(d3.behavior.drag()
189
+ .origin(function (d) { return d; })
190
+ .on("dragstart", function () {
191
+ this.parentNode.appendChild(this);
192
+ })
193
+ .on("drag", dragmove)
194
+ )
195
+ */
196
+ .merge(node)
197
+ .attr("transform", function (d) {
198
+ let _x = 0;
199
+ let _y = 0;
200
+ if (d.x0) _x = d.x0;
201
+ if (d.y0) _y = d.y0;
202
+ return "translate(" + (_x + strokeWidth) + "," + (_y + strokeWidth) + ")";
203
+ })
204
+ .each(function () {
205
+ const n = d3Select(this);
206
+ n.select("rect")
207
+ .attr("height", function (d: any) { return d.y1 - d.y0; })
208
+ .attr("width", context._d3Sankey.nodeWidth())
209
+ .style("fill", function (d: any) { return context._palette(d.name); })
210
+ .style("stroke", function (d: any) { return context.vertexStrokeColor(); })
211
+ .style("stroke-width", function (d: any) { return strokeWidth; })
212
+ .style("cursor", (context.xAxisMovement() || context.yAxisMovement()) ? null : "default")
213
+ ;
214
+ n.select("text")
215
+ .attr("x", -6)
216
+ .attr("y", function (d: any) {
217
+ return (d.y1 - d.y0) / 2;
218
+ })
219
+ .attr("dy", ".35em")
220
+ .attr("text-anchor", "end")
221
+ .attr("transform", null)
222
+ .text(function (d: any) { return d.name; })
223
+ .filter(function (d: any) { return d.x0 < context.width() / 2; })
224
+ .attr("x", 6 + context._d3Sankey.nodeWidth())
225
+ .attr("text-anchor", "start")
226
+ ;
227
+ });
228
+ node.exit().remove();
229
+
230
+ /*
231
+ function dragmove(d) {
232
+ var gElement = d3.select(this);
233
+ if (context.xAxisMovement()) {
234
+ d.x = Math.max(0, Math.min(context.width() - d.dx, d3.event.x));
235
+ }
236
+ if (context.yAxisMovement()) {
237
+ d.y = Math.max(0, Math.min(context.height() - d.dy, d3.event.y));
238
+ }
239
+ gElement.attr("transform", "translate(" + d.x + "," + d.y + ")");
240
+ context._d3Sankey.relayout();
241
+ link.attr("d", context._d3SankeyPath);
242
+
243
+ gElement.select("text")
244
+ .attr("x", -6)
245
+ .attr("y", function (d) { return d.dy / 2; })
246
+ .attr("dy", ".35em")
247
+ .attr("text-anchor", "end")
248
+ .attr("transform", null)
249
+ .text(function (d) { return d.name; })
250
+ .filter(function (d) { return d.x < context.width() / 2; })
251
+ .attr("x", 6 + context._d3Sankey.nodeWidth())
252
+ .attr("text-anchor", "start")
253
+ ;
254
+ }
255
+ */
256
+ }
257
+
258
+ paletteID: { (): string; (_: string): Sankey; };
259
+ mappings: { (): SankeyColumn[]; (_: SankeyColumn[]): Sankey; };
260
+ vertexStrokeWidth: { (): number; (_: number): Sankey; };
261
+ vertexStrokeColor: { (): string; (_: string): Sankey; };
262
+ vertexWidth: { (): number; (_: number): Sankey; };
263
+ vertexPadding: { (): number; (_: number): Sankey; };
264
+ xAxisMovement: { (): boolean; (_: boolean): Sankey; };
265
+ yAxisMovement: { (): boolean; (_: boolean): Sankey; };
266
+
267
+ exit(domNode, element) {
268
+ super.exit(domNode, element);
269
+ }
270
+
271
+ // Events ---
272
+ click(row, column, selected) {
273
+ }
274
+
275
+ dblclick(row, column, selected) {
276
+ }
277
+ }
278
+ Sankey.prototype._class += " graph_Sankey";
279
+ Sankey.prototype.Column = SankeyColumn;
280
+ Sankey.prototype.mixin(Utility.SimpleSelectionMixin);
281
+
282
+ Sankey.prototype._palette = Palette.ordinal("default");
283
+
284
+ Sankey.prototype.publish("paletteID", "default", "set", "Color palette for this widget", Sankey.prototype._palette.switch());
285
+ Sankey.prototype.publish("mappings", [], "propertyArray", "Source Columns", null, { autoExpand: SankeyColumn });
286
+ Sankey.prototype.publish("vertexStrokeWidth", 1, "number", "Vertex Stroke Width");
287
+ Sankey.prototype.publish("vertexStrokeColor", "darkgray", "string", "Vertex Stroke Color");
288
+ Sankey.prototype.publish("vertexWidth", 36, "number", "Vertex Width");
289
+ Sankey.prototype.publish("vertexPadding", 40, "number", "Vertex Padding");
290
+ Sankey.prototype.publish("xAxisMovement", false, "boolean", "Enable x-axis movement");
291
+ Sankey.prototype.publish("yAxisMovement", false, "boolean", "Enable y-axis movement");
package/src/Subgraph.css CHANGED
@@ -1,10 +1,10 @@
1
- .graph_Subgraph .border {
2
- fill: none;
3
- stroke: #1f77b4;
4
- stroke-width: 1.0px;
5
- pointer-events: none;
6
- }
7
-
8
- .graph_Subgraph.selected > rect {
9
- stroke:red !important;
10
- }
1
+ .graph_Subgraph .border {
2
+ fill: none;
3
+ stroke: #1f77b4;
4
+ stroke-width: 1.0px;
5
+ pointer-events: none;
6
+ }
7
+
8
+ .graph_Subgraph.selected > rect {
9
+ stroke:red !important;
10
+ }