@hpcc-js/tree 2.31.0 → 2.35.0
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/index.es6.js +77 -77
- package/dist/index.es6.js.map +1 -1
- package/dist/index.js +80 -80
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +20 -19
- package/src/__package__.ts +2 -2
- package/types/__package__.d.ts +2 -2
- package/types-3.4/__package__.d.ts +2 -2
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
2
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@hpcc-js/api'), require('@hpcc-js/common')) :
|
|
3
3
|
typeof define === 'function' && define.amd ? define(['exports', '@hpcc-js/api', '@hpcc-js/common'], factory) :
|
|
4
|
-
(global = global || self, factory(global[
|
|
5
|
-
}(this, (function (exports, api, common) { 'use strict';
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@hpcc-js/tree"] = {}, global["@hpcc-js/api"], global["@hpcc-js/common"]));
|
|
5
|
+
})(this, (function (exports, api, common) { 'use strict';
|
|
6
6
|
|
|
7
7
|
var PKG_NAME = "@hpcc-js/tree";
|
|
8
|
-
var PKG_VERSION = "2.
|
|
9
|
-
var BUILD_VERSION = "2.
|
|
8
|
+
var PKG_VERSION = "2.35.0";
|
|
9
|
+
var BUILD_VERSION = "2.97.0";
|
|
10
10
|
|
|
11
11
|
/*! *****************************************************************************
|
|
12
12
|
Copyright (c) Microsoft Corporation.
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
function defaultSeparation(a, b) {
|
|
42
|
+
function defaultSeparation$1(a, b) {
|
|
43
43
|
return a.parent === b.parent ? 1 : 2;
|
|
44
44
|
}
|
|
45
45
|
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
function d3Cluster() {
|
|
75
|
-
var separation = defaultSeparation,
|
|
75
|
+
var separation = defaultSeparation$1,
|
|
76
76
|
dx = 1,
|
|
77
77
|
dy = 1,
|
|
78
78
|
nodeSize = false;
|
|
@@ -262,7 +262,7 @@
|
|
|
262
262
|
}
|
|
263
263
|
|
|
264
264
|
function hierarchy(data, children) {
|
|
265
|
-
var root = new Node(data),
|
|
265
|
+
var root = new Node$1(data),
|
|
266
266
|
valued = +data.value && (root.value = data.value),
|
|
267
267
|
node,
|
|
268
268
|
nodes = [root],
|
|
@@ -278,7 +278,7 @@
|
|
|
278
278
|
if ((childs = children(node.data)) && (n = childs.length)) {
|
|
279
279
|
node.children = new Array(n);
|
|
280
280
|
for (i = n - 1; i >= 0; --i) {
|
|
281
|
-
nodes.push(child = node.children[i] = new Node(childs[i]));
|
|
281
|
+
nodes.push(child = node.children[i] = new Node$1(childs[i]));
|
|
282
282
|
child.parent = node;
|
|
283
283
|
child.depth = node.depth + 1;
|
|
284
284
|
}
|
|
@@ -306,15 +306,15 @@
|
|
|
306
306
|
while ((node = node.parent) && (node.height < ++height));
|
|
307
307
|
}
|
|
308
308
|
|
|
309
|
-
function Node(data) {
|
|
309
|
+
function Node$1(data) {
|
|
310
310
|
this.data = data;
|
|
311
311
|
this.depth =
|
|
312
312
|
this.height = 0;
|
|
313
313
|
this.parent = null;
|
|
314
314
|
}
|
|
315
315
|
|
|
316
|
-
Node.prototype = hierarchy.prototype = {
|
|
317
|
-
constructor: Node,
|
|
316
|
+
Node$1.prototype = hierarchy.prototype = {
|
|
317
|
+
constructor: Node$1,
|
|
318
318
|
count: node_count,
|
|
319
319
|
each: node_each,
|
|
320
320
|
eachAfter: node_eachAfter,
|
|
@@ -501,7 +501,7 @@
|
|
|
501
501
|
return dx * dx + dy * dy;
|
|
502
502
|
}
|
|
503
503
|
|
|
504
|
-
function Node
|
|
504
|
+
function Node(circle) {
|
|
505
505
|
this._ = circle;
|
|
506
506
|
this.next = null;
|
|
507
507
|
this.previous = null;
|
|
@@ -524,14 +524,14 @@
|
|
|
524
524
|
place(b, a, c = circles[2]);
|
|
525
525
|
|
|
526
526
|
// Initialize the front-chain using the first three circles a, b and c.
|
|
527
|
-
a = new Node
|
|
527
|
+
a = new Node(a), b = new Node(b), c = new Node(c);
|
|
528
528
|
a.next = c.previous = b;
|
|
529
529
|
b.next = a.previous = c;
|
|
530
530
|
c.next = b.previous = a;
|
|
531
531
|
|
|
532
532
|
// Attempt to place each remaining circle…
|
|
533
533
|
pack: for (i = 3; i < n; ++i) {
|
|
534
|
-
place(a._, b._, c = circles[i]), c = new Node
|
|
534
|
+
place(a._, b._, c = circles[i]), c = new Node(c);
|
|
535
535
|
|
|
536
536
|
// Find the closest intersecting circle on the front-chain, if any.
|
|
537
537
|
// “Closeness” is determined by linear distance along the front-chain.
|
|
@@ -588,7 +588,7 @@
|
|
|
588
588
|
return 0;
|
|
589
589
|
}
|
|
590
590
|
|
|
591
|
-
function constant(x) {
|
|
591
|
+
function constant$1(x) {
|
|
592
592
|
return function() {
|
|
593
593
|
return x;
|
|
594
594
|
};
|
|
@@ -628,7 +628,7 @@
|
|
|
628
628
|
};
|
|
629
629
|
|
|
630
630
|
pack.padding = function(x) {
|
|
631
|
-
return arguments.length ? (padding = typeof x === "function" ? x : constant(+x), pack) : padding;
|
|
631
|
+
return arguments.length ? (padding = typeof x === "function" ? x : constant$1(+x), pack) : padding;
|
|
632
632
|
};
|
|
633
633
|
|
|
634
634
|
return pack;
|
|
@@ -740,7 +740,7 @@
|
|
|
740
740
|
return partition;
|
|
741
741
|
}
|
|
742
742
|
|
|
743
|
-
function defaultSeparation
|
|
743
|
+
function defaultSeparation(a, b) {
|
|
744
744
|
return a.parent === b.parent ? 1 : 2;
|
|
745
745
|
}
|
|
746
746
|
|
|
@@ -811,7 +811,7 @@
|
|
|
811
811
|
this.i = i; // number
|
|
812
812
|
}
|
|
813
813
|
|
|
814
|
-
TreeNode.prototype = Object.create(Node.prototype);
|
|
814
|
+
TreeNode.prototype = Object.create(Node$1.prototype);
|
|
815
815
|
|
|
816
816
|
function treeRoot(root) {
|
|
817
817
|
var tree = new TreeNode(root, 0),
|
|
@@ -838,7 +838,7 @@
|
|
|
838
838
|
|
|
839
839
|
// Node-link tree diagram using the Reingold-Tilford "tidy" algorithm
|
|
840
840
|
function d3Tree() {
|
|
841
|
-
var separation = defaultSeparation
|
|
841
|
+
var separation = defaultSeparation,
|
|
842
842
|
dx = 1,
|
|
843
843
|
dy = 1,
|
|
844
844
|
nodeSize = null;
|
|
@@ -1117,7 +1117,7 @@
|
|
|
1117
1117
|
};
|
|
1118
1118
|
|
|
1119
1119
|
treemap.paddingInner = function(x) {
|
|
1120
|
-
return arguments.length ? (paddingInner = typeof x === "function" ? x : constant(+x), treemap) : paddingInner;
|
|
1120
|
+
return arguments.length ? (paddingInner = typeof x === "function" ? x : constant$1(+x), treemap) : paddingInner;
|
|
1121
1121
|
};
|
|
1122
1122
|
|
|
1123
1123
|
treemap.paddingOuter = function(x) {
|
|
@@ -1125,19 +1125,19 @@
|
|
|
1125
1125
|
};
|
|
1126
1126
|
|
|
1127
1127
|
treemap.paddingTop = function(x) {
|
|
1128
|
-
return arguments.length ? (paddingTop = typeof x === "function" ? x : constant(+x), treemap) : paddingTop;
|
|
1128
|
+
return arguments.length ? (paddingTop = typeof x === "function" ? x : constant$1(+x), treemap) : paddingTop;
|
|
1129
1129
|
};
|
|
1130
1130
|
|
|
1131
1131
|
treemap.paddingRight = function(x) {
|
|
1132
|
-
return arguments.length ? (paddingRight = typeof x === "function" ? x : constant(+x), treemap) : paddingRight;
|
|
1132
|
+
return arguments.length ? (paddingRight = typeof x === "function" ? x : constant$1(+x), treemap) : paddingRight;
|
|
1133
1133
|
};
|
|
1134
1134
|
|
|
1135
1135
|
treemap.paddingBottom = function(x) {
|
|
1136
|
-
return arguments.length ? (paddingBottom = typeof x === "function" ? x : constant(+x), treemap) : paddingBottom;
|
|
1136
|
+
return arguments.length ? (paddingBottom = typeof x === "function" ? x : constant$1(+x), treemap) : paddingBottom;
|
|
1137
1137
|
};
|
|
1138
1138
|
|
|
1139
1139
|
treemap.paddingLeft = function(x) {
|
|
1140
|
-
return arguments.length ? (paddingLeft = typeof x === "function" ? x : constant(+x), treemap) : paddingLeft;
|
|
1140
|
+
return arguments.length ? (paddingLeft = typeof x === "function" ? x : constant$1(+x), treemap) : paddingLeft;
|
|
1141
1141
|
};
|
|
1142
1142
|
|
|
1143
1143
|
return treemap;
|
|
@@ -1254,8 +1254,8 @@
|
|
|
1254
1254
|
}
|
|
1255
1255
|
}
|
|
1256
1256
|
|
|
1257
|
-
var css_248z = ".tree_CirclePacking circle{fill:#1f77b4;fill-opacity:.25;stroke:#1f77b4;stroke-width:1px}.tree_CirclePacking .leaf circle{fill:#ff7f0e;fill-opacity:1}.tree_CirclePacking .label{fill:#fff;text-anchor:middle}";
|
|
1258
|
-
styleInject(css_248z);
|
|
1257
|
+
var css_248z$4 = ".tree_CirclePacking circle{fill:#1f77b4;fill-opacity:.25;stroke:#1f77b4;stroke-width:1px}.tree_CirclePacking .leaf circle{fill:#ff7f0e;fill-opacity:1}.tree_CirclePacking .label{fill:#fff;text-anchor:middle}";
|
|
1258
|
+
styleInject(css_248z$4);
|
|
1259
1259
|
|
|
1260
1260
|
var CirclePacking = /** @class */ (function (_super) {
|
|
1261
1261
|
__extends(CirclePacking, _super);
|
|
@@ -1354,8 +1354,8 @@
|
|
|
1354
1354
|
CirclePacking.prototype.publish("paletteID", "default", "set", "Color palette for this widget", CirclePacking.prototype._palette.switch(), { tags: ["Basic", "Shared"] });
|
|
1355
1355
|
CirclePacking.prototype.publish("useClonedPalette", false, "boolean", "Enable or disable using a cloned palette", null, { tags: ["Intermediate", "Shared"] });
|
|
1356
1356
|
|
|
1357
|
-
var css_248z$
|
|
1358
|
-
styleInject(css_248z$
|
|
1357
|
+
var css_248z$3 = ".tree_Dendrogram .node circle{fill:#dcf1ff;stroke:#1f77b4;stroke-width:1px}.tree_Dendrogram .node.selected circle{stroke:red}.tree_Dendrogram .node.over circle{stroke:orange}.tree_Dendrogram .node.selected.over circle{stroke:red}.tree_Dendrogram .node.selected text{fill:red}.tree_Dendrogram .node.over text{fill:orange}.tree_Dendrogram .node.selected.over text{fill:red}.tree_Dendrogram .node text{font-size:14px}.tree_Dendrogram .link{fill:none;stroke:#656565;stroke-width:1px}";
|
|
1358
|
+
styleInject(css_248z$3);
|
|
1359
1359
|
|
|
1360
1360
|
var DendrogramColumn = /** @class */ (function (_super) {
|
|
1361
1361
|
__extends(DendrogramColumn, _super);
|
|
@@ -1672,9 +1672,9 @@
|
|
|
1672
1672
|
var fontFamily = this.fontFamily();
|
|
1673
1673
|
var fontSize = this.fontSize();
|
|
1674
1674
|
var maxWeightWidth = common.max(flatData, function (d) { return _this.textSize(d.weightValue, fontFamily, fontSize).width; });
|
|
1675
|
-
var rowItemPadding = padding
|
|
1675
|
+
var rowItemPadding = "".concat(padding, "px ").concat(padding, "px ").concat(padding / 2, "px ").concat(padding, "px");
|
|
1676
1676
|
var rowEnter = rowSelection.enter().append("div")
|
|
1677
|
-
.attr("class", function (d) { return "directory-row directory-row-depth-"
|
|
1677
|
+
.attr("class", function (d) { return "directory-row directory-row-depth-".concat(d.depth); })
|
|
1678
1678
|
.style("display", "flex")
|
|
1679
1679
|
.style("cursor", "pointer")
|
|
1680
1680
|
.each(function (d) {
|
|
@@ -1686,7 +1686,7 @@
|
|
|
1686
1686
|
.attr("class", "row-weight")
|
|
1687
1687
|
.style("padding", rowItemPadding)
|
|
1688
1688
|
.style("color", weightFontColor)
|
|
1689
|
-
.style("box-shadow", "inset 0 0 100px "
|
|
1689
|
+
.style("box-shadow", "inset 0 0 100px ".concat(weightColor))
|
|
1690
1690
|
.style("font-weight", d.bold ? "bold" : "normal")
|
|
1691
1691
|
.style("font-family", fontFamily)
|
|
1692
1692
|
.style("font-size", fontSize + "px")
|
|
@@ -1804,7 +1804,7 @@
|
|
|
1804
1804
|
DirectoryTree.prototype.publish("textFileIcon", "fa fa-file-text-o", "string", "Text file icon class");
|
|
1805
1805
|
DirectoryTree.prototype.publish("verticalScroll", true, "boolean", "If true, vertical scroll bar will be shown");
|
|
1806
1806
|
|
|
1807
|
-
var css_248z$2 = ".tree_Indented .node rect{
|
|
1807
|
+
var css_248z$2 = ".tree_Indented .node rect{fill:#fff;stroke:#3182bd;stroke-width:1px;cursor:pointer}.tree_Indented .node text{font:10px sans-serif;pointer-events:none}.tree_Indented path.link{fill:none;stroke:#9ecae1;stroke-width:1.5px}";
|
|
1808
1808
|
styleInject(css_248z$2);
|
|
1809
1809
|
|
|
1810
1810
|
var IndentedColumn = /** @class */ (function (_super) {
|
|
@@ -2035,10 +2035,10 @@
|
|
|
2035
2035
|
return retVal;
|
|
2036
2036
|
}
|
|
2037
2037
|
|
|
2038
|
-
var pi = Math.PI,
|
|
2039
|
-
tau = 2 * pi,
|
|
2040
|
-
epsilon = 1e-6,
|
|
2041
|
-
tauEpsilon = tau - epsilon;
|
|
2038
|
+
var pi$1 = Math.PI,
|
|
2039
|
+
tau$1 = 2 * pi$1,
|
|
2040
|
+
epsilon$1 = 1e-6,
|
|
2041
|
+
tauEpsilon = tau$1 - epsilon$1;
|
|
2042
2042
|
|
|
2043
2043
|
function Path() {
|
|
2044
2044
|
this._x0 = this._y0 = // start of current subpath
|
|
@@ -2089,12 +2089,12 @@
|
|
|
2089
2089
|
}
|
|
2090
2090
|
|
|
2091
2091
|
// Or, is (x1,y1) coincident with (x0,y0)? Do nothing.
|
|
2092
|
-
else if (!(l01_2 > epsilon));
|
|
2092
|
+
else if (!(l01_2 > epsilon$1));
|
|
2093
2093
|
|
|
2094
2094
|
// Or, are (x0,y0), (x1,y1) and (x2,y2) collinear?
|
|
2095
2095
|
// Equivalently, is (x1,y1) coincident with (x2,y2)?
|
|
2096
2096
|
// Or, is the radius zero? Line to (x1,y1).
|
|
2097
|
-
else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) {
|
|
2097
|
+
else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon$1) || !r) {
|
|
2098
2098
|
this._ += "L" + (this._x1 = x1) + "," + (this._y1 = y1);
|
|
2099
2099
|
}
|
|
2100
2100
|
|
|
@@ -2106,12 +2106,12 @@
|
|
|
2106
2106
|
l20_2 = x20 * x20 + y20 * y20,
|
|
2107
2107
|
l21 = Math.sqrt(l21_2),
|
|
2108
2108
|
l01 = Math.sqrt(l01_2),
|
|
2109
|
-
l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2),
|
|
2109
|
+
l = r * Math.tan((pi$1 - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2),
|
|
2110
2110
|
t01 = l / l01,
|
|
2111
2111
|
t21 = l / l21;
|
|
2112
2112
|
|
|
2113
2113
|
// If the start tangent is not coincident with (x0,y0), line to.
|
|
2114
|
-
if (Math.abs(t01 - 1) > epsilon) {
|
|
2114
|
+
if (Math.abs(t01 - 1) > epsilon$1) {
|
|
2115
2115
|
this._ += "L" + (x1 + t01 * x01) + "," + (y1 + t01 * y01);
|
|
2116
2116
|
}
|
|
2117
2117
|
|
|
@@ -2136,7 +2136,7 @@
|
|
|
2136
2136
|
}
|
|
2137
2137
|
|
|
2138
2138
|
// Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0).
|
|
2139
|
-
else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) {
|
|
2139
|
+
else if (Math.abs(this._x1 - x0) > epsilon$1 || Math.abs(this._y1 - y0) > epsilon$1) {
|
|
2140
2140
|
this._ += "L" + x0 + "," + y0;
|
|
2141
2141
|
}
|
|
2142
2142
|
|
|
@@ -2144,7 +2144,7 @@
|
|
|
2144
2144
|
if (!r) return;
|
|
2145
2145
|
|
|
2146
2146
|
// Does the angle go the wrong way? Flip the direction.
|
|
2147
|
-
if (da < 0) da = da % tau + tau;
|
|
2147
|
+
if (da < 0) da = da % tau$1 + tau$1;
|
|
2148
2148
|
|
|
2149
2149
|
// Is this a complete circle? Draw two arcs to complete the circle.
|
|
2150
2150
|
if (da > tauEpsilon) {
|
|
@@ -2152,8 +2152,8 @@
|
|
|
2152
2152
|
}
|
|
2153
2153
|
|
|
2154
2154
|
// Is this arc non-empty? Draw an arc!
|
|
2155
|
-
else if (da > epsilon) {
|
|
2156
|
-
this._ += "A" + r + "," + r + ",0," + (+(da >= pi)) + "," + cw + "," + (this._x1 = x + r * Math.cos(a1)) + "," + (this._y1 = y + r * Math.sin(a1));
|
|
2155
|
+
else if (da > epsilon$1) {
|
|
2156
|
+
this._ += "A" + r + "," + r + ",0," + (+(da >= pi$1)) + "," + cw + "," + (this._x1 = x + r * Math.cos(a1)) + "," + (this._y1 = y + r * Math.sin(a1));
|
|
2157
2157
|
}
|
|
2158
2158
|
},
|
|
2159
2159
|
rect: function(x, y, w, h) {
|
|
@@ -2164,7 +2164,7 @@
|
|
|
2164
2164
|
}
|
|
2165
2165
|
};
|
|
2166
2166
|
|
|
2167
|
-
function constant
|
|
2167
|
+
function constant(x) {
|
|
2168
2168
|
return function constant() {
|
|
2169
2169
|
return x;
|
|
2170
2170
|
};
|
|
@@ -2178,13 +2178,13 @@
|
|
|
2178
2178
|
var sin = Math.sin;
|
|
2179
2179
|
var sqrt = Math.sqrt;
|
|
2180
2180
|
|
|
2181
|
-
var epsilon
|
|
2182
|
-
var pi
|
|
2183
|
-
var halfPi = pi
|
|
2184
|
-
var tau
|
|
2181
|
+
var epsilon = 1e-12;
|
|
2182
|
+
var pi = Math.PI;
|
|
2183
|
+
var halfPi = pi / 2;
|
|
2184
|
+
var tau = 2 * pi;
|
|
2185
2185
|
|
|
2186
2186
|
function acos(x) {
|
|
2187
|
-
return x > 1 ? 0 : x < -1 ? pi
|
|
2187
|
+
return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);
|
|
2188
2188
|
}
|
|
2189
2189
|
|
|
2190
2190
|
function asin(x) {
|
|
@@ -2215,7 +2215,7 @@
|
|
|
2215
2215
|
var x10 = x1 - x0, y10 = y1 - y0,
|
|
2216
2216
|
x32 = x3 - x2, y32 = y3 - y2,
|
|
2217
2217
|
t = y32 * x10 - x32 * y10;
|
|
2218
|
-
if (t * t < epsilon
|
|
2218
|
+
if (t * t < epsilon) return;
|
|
2219
2219
|
t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;
|
|
2220
2220
|
return [x0 + t * x10, y0 + t * y10];
|
|
2221
2221
|
}
|
|
@@ -2266,7 +2266,7 @@
|
|
|
2266
2266
|
function d3Arc() {
|
|
2267
2267
|
var innerRadius = arcInnerRadius,
|
|
2268
2268
|
outerRadius = arcOuterRadius,
|
|
2269
|
-
cornerRadius = constant
|
|
2269
|
+
cornerRadius = constant(0),
|
|
2270
2270
|
padRadius = null,
|
|
2271
2271
|
startAngle = arcStartAngle,
|
|
2272
2272
|
endAngle = arcEndAngle,
|
|
@@ -2289,13 +2289,13 @@
|
|
|
2289
2289
|
if (r1 < r0) r = r1, r1 = r0, r0 = r;
|
|
2290
2290
|
|
|
2291
2291
|
// Is it a point?
|
|
2292
|
-
if (!(r1 > epsilon
|
|
2292
|
+
if (!(r1 > epsilon)) context.moveTo(0, 0);
|
|
2293
2293
|
|
|
2294
2294
|
// Or is it a circle or annulus?
|
|
2295
|
-
else if (da > tau
|
|
2295
|
+
else if (da > tau - epsilon) {
|
|
2296
2296
|
context.moveTo(r1 * cos(a0), r1 * sin(a0));
|
|
2297
2297
|
context.arc(0, 0, r1, a0, a1, !cw);
|
|
2298
|
-
if (r0 > epsilon
|
|
2298
|
+
if (r0 > epsilon) {
|
|
2299
2299
|
context.moveTo(r0 * cos(a1), r0 * sin(a1));
|
|
2300
2300
|
context.arc(0, 0, r0, a1, a0, cw);
|
|
2301
2301
|
}
|
|
@@ -2310,7 +2310,7 @@
|
|
|
2310
2310
|
da0 = da,
|
|
2311
2311
|
da1 = da,
|
|
2312
2312
|
ap = padAngle.apply(this, arguments) / 2,
|
|
2313
|
-
rp = (ap > epsilon
|
|
2313
|
+
rp = (ap > epsilon) && (padRadius ? +padRadius.apply(this, arguments) : sqrt(r0 * r0 + r1 * r1)),
|
|
2314
2314
|
rc = min(abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments)),
|
|
2315
2315
|
rc0 = rc,
|
|
2316
2316
|
rc1 = rc,
|
|
@@ -2318,12 +2318,12 @@
|
|
|
2318
2318
|
t1;
|
|
2319
2319
|
|
|
2320
2320
|
// Apply padding? Note that since r1 ≥ r0, da1 ≥ da0.
|
|
2321
|
-
if (rp > epsilon
|
|
2321
|
+
if (rp > epsilon) {
|
|
2322
2322
|
var p0 = asin(rp / r0 * sin(ap)),
|
|
2323
2323
|
p1 = asin(rp / r1 * sin(ap));
|
|
2324
|
-
if ((da0 -= p0 * 2) > epsilon
|
|
2324
|
+
if ((da0 -= p0 * 2) > epsilon) p0 *= (cw ? 1 : -1), a00 += p0, a10 -= p0;
|
|
2325
2325
|
else da0 = 0, a00 = a10 = (a0 + a1) / 2;
|
|
2326
|
-
if ((da1 -= p1 * 2) > epsilon
|
|
2326
|
+
if ((da1 -= p1 * 2) > epsilon) p1 *= (cw ? 1 : -1), a01 += p1, a11 -= p1;
|
|
2327
2327
|
else da1 = 0, a01 = a11 = (a0 + a1) / 2;
|
|
2328
2328
|
}
|
|
2329
2329
|
|
|
@@ -2333,7 +2333,7 @@
|
|
|
2333
2333
|
y10 = r0 * sin(a10);
|
|
2334
2334
|
|
|
2335
2335
|
// Apply rounded corners?
|
|
2336
|
-
if (rc > epsilon
|
|
2336
|
+
if (rc > epsilon) {
|
|
2337
2337
|
var x11 = r1 * cos(a11),
|
|
2338
2338
|
y11 = r1 * sin(a11),
|
|
2339
2339
|
x00 = r0 * cos(a00),
|
|
@@ -2341,7 +2341,7 @@
|
|
|
2341
2341
|
oc;
|
|
2342
2342
|
|
|
2343
2343
|
// Restrict the corner radius according to the sector angle.
|
|
2344
|
-
if (da < pi
|
|
2344
|
+
if (da < pi && (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10))) {
|
|
2345
2345
|
var ax = x01 - oc[0],
|
|
2346
2346
|
ay = y01 - oc[1],
|
|
2347
2347
|
bx = x11 - oc[0],
|
|
@@ -2354,10 +2354,10 @@
|
|
|
2354
2354
|
}
|
|
2355
2355
|
|
|
2356
2356
|
// Is the sector collapsed to a line?
|
|
2357
|
-
if (!(da1 > epsilon
|
|
2357
|
+
if (!(da1 > epsilon)) context.moveTo(x01, y01);
|
|
2358
2358
|
|
|
2359
2359
|
// Does the sector’s outer ring have rounded corners?
|
|
2360
|
-
else if (rc1 > epsilon
|
|
2360
|
+
else if (rc1 > epsilon) {
|
|
2361
2361
|
t0 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw);
|
|
2362
2362
|
t1 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw);
|
|
2363
2363
|
|
|
@@ -2379,10 +2379,10 @@
|
|
|
2379
2379
|
|
|
2380
2380
|
// Is there no inner ring, and it’s a circular sector?
|
|
2381
2381
|
// Or perhaps it’s an annular sector collapsed due to padding?
|
|
2382
|
-
if (!(r0 > epsilon
|
|
2382
|
+
if (!(r0 > epsilon) || !(da0 > epsilon)) context.lineTo(x10, y10);
|
|
2383
2383
|
|
|
2384
2384
|
// Does the sector’s inner ring (or point) have rounded corners?
|
|
2385
|
-
else if (rc0 > epsilon
|
|
2385
|
+
else if (rc0 > epsilon) {
|
|
2386
2386
|
t0 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw);
|
|
2387
2387
|
t1 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw);
|
|
2388
2388
|
|
|
@@ -2410,36 +2410,36 @@
|
|
|
2410
2410
|
|
|
2411
2411
|
arc.centroid = function() {
|
|
2412
2412
|
var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2,
|
|
2413
|
-
a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - pi
|
|
2413
|
+
a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - pi / 2;
|
|
2414
2414
|
return [cos(a) * r, sin(a) * r];
|
|
2415
2415
|
};
|
|
2416
2416
|
|
|
2417
2417
|
arc.innerRadius = function(_) {
|
|
2418
|
-
return arguments.length ? (innerRadius = typeof _ === "function" ? _ : constant
|
|
2418
|
+
return arguments.length ? (innerRadius = typeof _ === "function" ? _ : constant(+_), arc) : innerRadius;
|
|
2419
2419
|
};
|
|
2420
2420
|
|
|
2421
2421
|
arc.outerRadius = function(_) {
|
|
2422
|
-
return arguments.length ? (outerRadius = typeof _ === "function" ? _ : constant
|
|
2422
|
+
return arguments.length ? (outerRadius = typeof _ === "function" ? _ : constant(+_), arc) : outerRadius;
|
|
2423
2423
|
};
|
|
2424
2424
|
|
|
2425
2425
|
arc.cornerRadius = function(_) {
|
|
2426
|
-
return arguments.length ? (cornerRadius = typeof _ === "function" ? _ : constant
|
|
2426
|
+
return arguments.length ? (cornerRadius = typeof _ === "function" ? _ : constant(+_), arc) : cornerRadius;
|
|
2427
2427
|
};
|
|
2428
2428
|
|
|
2429
2429
|
arc.padRadius = function(_) {
|
|
2430
|
-
return arguments.length ? (padRadius = _ == null ? null : typeof _ === "function" ? _ : constant
|
|
2430
|
+
return arguments.length ? (padRadius = _ == null ? null : typeof _ === "function" ? _ : constant(+_), arc) : padRadius;
|
|
2431
2431
|
};
|
|
2432
2432
|
|
|
2433
2433
|
arc.startAngle = function(_) {
|
|
2434
|
-
return arguments.length ? (startAngle = typeof _ === "function" ? _ : constant
|
|
2434
|
+
return arguments.length ? (startAngle = typeof _ === "function" ? _ : constant(+_), arc) : startAngle;
|
|
2435
2435
|
};
|
|
2436
2436
|
|
|
2437
2437
|
arc.endAngle = function(_) {
|
|
2438
|
-
return arguments.length ? (endAngle = typeof _ === "function" ? _ : constant
|
|
2438
|
+
return arguments.length ? (endAngle = typeof _ === "function" ? _ : constant(+_), arc) : endAngle;
|
|
2439
2439
|
};
|
|
2440
2440
|
|
|
2441
2441
|
arc.padAngle = function(_) {
|
|
2442
|
-
return arguments.length ? (padAngle = typeof _ === "function" ? _ : constant
|
|
2442
|
+
return arguments.length ? (padAngle = typeof _ === "function" ? _ : constant(+_), arc) : padAngle;
|
|
2443
2443
|
};
|
|
2444
2444
|
|
|
2445
2445
|
arc.context = function(_) {
|
|
@@ -2449,8 +2449,8 @@
|
|
|
2449
2449
|
return arc;
|
|
2450
2450
|
}
|
|
2451
2451
|
|
|
2452
|
-
var css_248z$
|
|
2453
|
-
styleInject(css_248z$
|
|
2452
|
+
var css_248z$1 = ".tree_Sunburst path{stroke:#fff;stroke-width:.5px;fill-rule:evenodd}";
|
|
2453
|
+
styleInject(css_248z$1);
|
|
2454
2454
|
|
|
2455
2455
|
var SunburstPartition = /** @class */ (function (_super) {
|
|
2456
2456
|
__extends(SunburstPartition, _super);
|
|
@@ -2556,8 +2556,8 @@
|
|
|
2556
2556
|
SunburstPartition.prototype.publish("paletteID", "default", "set", "Color palette for this widget", SunburstPartition.prototype._palette.switch(), { tags: ["Basic", "Shared"] });
|
|
2557
2557
|
SunburstPartition.prototype.publish("useClonedPalette", false, "boolean", "Enable or disable using a cloned palette", null, { tags: ["Intermediate", "Shared"] });
|
|
2558
2558
|
|
|
2559
|
-
var css_248z
|
|
2560
|
-
styleInject(css_248z
|
|
2559
|
+
var css_248z = ".tree_Treemap *{box-sizing:border-box}.tree_Treemap .node{border:1px solid #333;overflow:hidden;position:absolute;text-overflow:ellipsis}.tree_Treemap .node.selected{border-color:red}.tree_Treemap .node.over{border-color:orange}.tree_Treemap .node.selected.over{border-color:red}.tree_Treemap .node>span.treemap-parent-label{display:inline-block;font-weight:700;margin:4px 4px 0}.tree_Treemap .node>span.treemap-parent-value{font-style:italic;font-weight:400;margin:4px 0 0}.tree_Treemap .node>span.treemap-singleton-label{display:block;font-weight:400;margin:4px 0 0 4px}.tree_Treemap .node>span.treemap-singleton-value{display:block;font-style:italic;margin:0 0 0 4px}";
|
|
2560
|
+
styleInject(css_248z);
|
|
2561
2561
|
|
|
2562
2562
|
var TreemapColumn = /** @class */ (function (_super) {
|
|
2563
2563
|
__extends(TreemapColumn, _super);
|
|
@@ -2775,10 +2775,10 @@
|
|
|
2775
2775
|
return d.size || 1;
|
|
2776
2776
|
};
|
|
2777
2777
|
Treemap.prototype.parentWeightHTML = function (d) {
|
|
2778
|
-
return this.showParentWeight() ? "<span class=\"treemap-parent-label\">"
|
|
2778
|
+
return this.showParentWeight() ? "<span class=\"treemap-parent-label\">".concat(d.data.label, "</span><span class=\"treemap-parent-value\">").concat(d.value).concat(this.weightSuffix(), "</span>") : "<span class=\"treemap-parent-label\">".concat(d.data.label, "</span>");
|
|
2779
2779
|
};
|
|
2780
2780
|
Treemap.prototype.leafWeightHTML = function (d) {
|
|
2781
|
-
return this.showLeafWeight() ? "<span class=\"treemap-leaf-label\">"
|
|
2781
|
+
return this.showLeafWeight() ? "<span class=\"treemap-leaf-label\">".concat(d.data.label, "</span><span class=\"treemap-leaf-value\">").concat(d.value).concat(this.weightSuffix(), "</span>") : "<span class=\"treemap-leaf-label\">".concat(d.data.label, "</span>");
|
|
2782
2782
|
};
|
|
2783
2783
|
return Treemap;
|
|
2784
2784
|
}(common.HTMLWidget));
|
|
@@ -2825,5 +2825,5 @@
|
|
|
2825
2825
|
|
|
2826
2826
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2827
2827
|
|
|
2828
|
-
}))
|
|
2828
|
+
}));
|
|
2829
2829
|
//# sourceMappingURL=index.js.map
|