@hpcc-js/tree 3.2.20 → 3.3.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.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +1 -1
- package/dist/index.umd.cjs.map +1 -1
- package/package.json +6 -6
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["defaultSeparation","Node","node_count","node_each","node_eachAfter","node_eachBefore","node_sum","node_sort","node_path","node_ancestors","node_descendants","node_leaves","node_links","enclose","constant","roundNode","Node","squarify","roundNode","constant","slice","dice","pi","tau","epsilon","max","max","constant"],"sources":["../src/__package__.ts","../../../node_modules/d3-hierarchy/src/cluster.js","../../../node_modules/d3-hierarchy/src/hierarchy/count.js","../../../node_modules/d3-hierarchy/src/hierarchy/each.js","../../../node_modules/d3-hierarchy/src/hierarchy/eachBefore.js","../../../node_modules/d3-hierarchy/src/hierarchy/eachAfter.js","../../../node_modules/d3-hierarchy/src/hierarchy/sum.js","../../../node_modules/d3-hierarchy/src/hierarchy/sort.js","../../../node_modules/d3-hierarchy/src/hierarchy/path.js","../../../node_modules/d3-hierarchy/src/hierarchy/ancestors.js","../../../node_modules/d3-hierarchy/src/hierarchy/descendants.js","../../../node_modules/d3-hierarchy/src/hierarchy/leaves.js","../../../node_modules/d3-hierarchy/src/hierarchy/links.js","../../../node_modules/d3-hierarchy/src/hierarchy/index.js","../../../node_modules/d3-hierarchy/src/array.js","../../../node_modules/d3-hierarchy/src/pack/enclose.js","../../../node_modules/d3-hierarchy/src/pack/siblings.js","../../../node_modules/d3-hierarchy/src/accessors.js","../../../node_modules/d3-hierarchy/src/constant.js","../../../node_modules/d3-hierarchy/src/pack/index.js","../../../node_modules/d3-hierarchy/src/treemap/round.js","../../../node_modules/d3-hierarchy/src/treemap/dice.js","../../../node_modules/d3-hierarchy/src/partition.js","../../../node_modules/d3-hierarchy/src/tree.js","../../../node_modules/d3-hierarchy/src/treemap/slice.js","../../../node_modules/d3-hierarchy/src/treemap/squarify.js","../../../node_modules/d3-hierarchy/src/treemap/index.js","../../../node_modules/d3-hierarchy/src/treemap/binary.js","../../../node_modules/d3-hierarchy/src/treemap/sliceDice.js","../../../node_modules/d3-hierarchy/src/treemap/resquarify.js","../src/CirclePacking.ts","../src/Dendrogram.ts","../src/DirectoryTree.ts","../src/Indented.ts","../../../node_modules/d3-path/src/path.js","../../../node_modules/d3-shape/src/constant.js","../../../node_modules/d3-shape/src/math.js","../../../node_modules/d3-shape/src/arc.js","../src/SunburstPartition.ts","../src/Treemap.ts"],"sourcesContent":["export const PKG_NAME = \"__PACKAGE_NAME__\";\nexport const PKG_VERSION = \"__PACKAGE_VERSION__\";\nexport const BUILD_VERSION = \"__BUILD_VERSION__\";\n","function defaultSeparation(a, b) {\n return a.parent === b.parent ? 1 : 2;\n}\n\nfunction meanX(children) {\n return children.reduce(meanXReduce, 0) / children.length;\n}\n\nfunction meanXReduce(x, c) {\n return x + c.x;\n}\n\nfunction maxY(children) {\n return 1 + children.reduce(maxYReduce, 0);\n}\n\nfunction maxYReduce(y, c) {\n return Math.max(y, c.y);\n}\n\nfunction leafLeft(node) {\n var children;\n while (children = node.children) node = children[0];\n return node;\n}\n\nfunction leafRight(node) {\n var children;\n while (children = node.children) node = children[children.length - 1];\n return node;\n}\n\nexport default function() {\n var separation = defaultSeparation,\n dx = 1,\n dy = 1,\n nodeSize = false;\n\n function cluster(root) {\n var previousNode,\n x = 0;\n\n // First walk, computing the initial x & y values.\n root.eachAfter(function(node) {\n var children = node.children;\n if (children) {\n node.x = meanX(children);\n node.y = maxY(children);\n } else {\n node.x = previousNode ? x += separation(node, previousNode) : 0;\n node.y = 0;\n previousNode = node;\n }\n });\n\n var left = leafLeft(root),\n right = leafRight(root),\n x0 = left.x - separation(left, right) / 2,\n x1 = right.x + separation(right, left) / 2;\n\n // Second walk, normalizing x & y to the desired size.\n return root.eachAfter(nodeSize ? function(node) {\n node.x = (node.x - root.x) * dx;\n node.y = (root.y - node.y) * dy;\n } : function(node) {\n node.x = (node.x - x0) / (x1 - x0) * dx;\n node.y = (1 - (root.y ? node.y / root.y : 1)) * dy;\n });\n }\n\n cluster.separation = function(x) {\n return arguments.length ? (separation = x, cluster) : separation;\n };\n\n cluster.size = function(x) {\n return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], cluster) : (nodeSize ? null : [dx, dy]);\n };\n\n cluster.nodeSize = function(x) {\n return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], cluster) : (nodeSize ? [dx, dy] : null);\n };\n\n return cluster;\n}\n","function count(node) {\n var sum = 0,\n children = node.children,\n i = children && children.length;\n if (!i) sum = 1;\n else while (--i >= 0) sum += children[i].value;\n node.value = sum;\n}\n\nexport default function() {\n return this.eachAfter(count);\n}\n","export default function(callback) {\n var node = this, current, next = [node], children, i, n;\n do {\n current = next.reverse(), next = [];\n while (node = current.pop()) {\n callback(node), children = node.children;\n if (children) for (i = 0, n = children.length; i < n; ++i) {\n next.push(children[i]);\n }\n }\n } while (next.length);\n return this;\n}\n","export default function(callback) {\n var node = this, nodes = [node], children, i;\n while (node = nodes.pop()) {\n callback(node), children = node.children;\n if (children) for (i = children.length - 1; i >= 0; --i) {\n nodes.push(children[i]);\n }\n }\n return this;\n}\n","export default function(callback) {\n var node = this, nodes = [node], next = [], children, i, n;\n while (node = nodes.pop()) {\n next.push(node), children = node.children;\n if (children) for (i = 0, n = children.length; i < n; ++i) {\n nodes.push(children[i]);\n }\n }\n while (node = next.pop()) {\n callback(node);\n }\n return this;\n}\n","export default function(value) {\n return this.eachAfter(function(node) {\n var sum = +value(node.data) || 0,\n children = node.children,\n i = children && children.length;\n while (--i >= 0) sum += children[i].value;\n node.value = sum;\n });\n}\n","export default function(compare) {\n return this.eachBefore(function(node) {\n if (node.children) {\n node.children.sort(compare);\n }\n });\n}\n","export default function(end) {\n var start = this,\n ancestor = leastCommonAncestor(start, end),\n nodes = [start];\n while (start !== ancestor) {\n start = start.parent;\n nodes.push(start);\n }\n var k = nodes.length;\n while (end !== ancestor) {\n nodes.splice(k, 0, end);\n end = end.parent;\n }\n return nodes;\n}\n\nfunction leastCommonAncestor(a, b) {\n if (a === b) return a;\n var aNodes = a.ancestors(),\n bNodes = b.ancestors(),\n c = null;\n a = aNodes.pop();\n b = bNodes.pop();\n while (a === b) {\n c = a;\n a = aNodes.pop();\n b = bNodes.pop();\n }\n return c;\n}\n","export default function() {\n var node = this, nodes = [node];\n while (node = node.parent) {\n nodes.push(node);\n }\n return nodes;\n}\n","export default function() {\n var nodes = [];\n this.each(function(node) {\n nodes.push(node);\n });\n return nodes;\n}\n","export default function() {\n var leaves = [];\n this.eachBefore(function(node) {\n if (!node.children) {\n leaves.push(node);\n }\n });\n return leaves;\n}\n","export default function() {\n var root = this, links = [];\n root.each(function(node) {\n if (node !== root) { // Don’t include the root’s parent, if any.\n links.push({source: node.parent, target: node});\n }\n });\n return links;\n}\n","import node_count from \"./count.js\";\nimport node_each from \"./each.js\";\nimport node_eachBefore from \"./eachBefore.js\";\nimport node_eachAfter from \"./eachAfter.js\";\nimport node_sum from \"./sum.js\";\nimport node_sort from \"./sort.js\";\nimport node_path from \"./path.js\";\nimport node_ancestors from \"./ancestors.js\";\nimport node_descendants from \"./descendants.js\";\nimport node_leaves from \"./leaves.js\";\nimport node_links from \"./links.js\";\n\nexport default function hierarchy(data, children) {\n var root = new Node(data),\n valued = +data.value && (root.value = data.value),\n node,\n nodes = [root],\n child,\n childs,\n i,\n n;\n\n if (children == null) children = defaultChildren;\n\n while (node = nodes.pop()) {\n if (valued) node.value = +node.data.value;\n if ((childs = children(node.data)) && (n = childs.length)) {\n node.children = new Array(n);\n for (i = n - 1; i >= 0; --i) {\n nodes.push(child = node.children[i] = new Node(childs[i]));\n child.parent = node;\n child.depth = node.depth + 1;\n }\n }\n }\n\n return root.eachBefore(computeHeight);\n}\n\nfunction node_copy() {\n return hierarchy(this).eachBefore(copyData);\n}\n\nfunction defaultChildren(d) {\n return d.children;\n}\n\nfunction copyData(node) {\n node.data = node.data.data;\n}\n\nexport function computeHeight(node) {\n var height = 0;\n do node.height = height;\n while ((node = node.parent) && (node.height < ++height));\n}\n\nexport function Node(data) {\n this.data = data;\n this.depth =\n this.height = 0;\n this.parent = null;\n}\n\nNode.prototype = hierarchy.prototype = {\n constructor: Node,\n count: node_count,\n each: node_each,\n eachAfter: node_eachAfter,\n eachBefore: node_eachBefore,\n sum: node_sum,\n sort: node_sort,\n path: node_path,\n ancestors: node_ancestors,\n descendants: node_descendants,\n leaves: node_leaves,\n links: node_links,\n copy: node_copy\n};\n","export var slice = Array.prototype.slice;\n\nexport function shuffle(array) {\n var m = array.length,\n t,\n i;\n\n while (m) {\n i = Math.random() * m-- | 0;\n t = array[m];\n array[m] = array[i];\n array[i] = t;\n }\n\n return array;\n}\n","import {shuffle, slice} from \"../array.js\";\n\nexport default function(circles) {\n var i = 0, n = (circles = shuffle(slice.call(circles))).length, B = [], p, e;\n\n while (i < n) {\n p = circles[i];\n if (e && enclosesWeak(e, p)) ++i;\n else e = encloseBasis(B = extendBasis(B, p)), i = 0;\n }\n\n return e;\n}\n\nfunction extendBasis(B, p) {\n var i, j;\n\n if (enclosesWeakAll(p, B)) return [p];\n\n // If we get here then B must have at least one element.\n for (i = 0; i < B.length; ++i) {\n if (enclosesNot(p, B[i])\n && enclosesWeakAll(encloseBasis2(B[i], p), B)) {\n return [B[i], p];\n }\n }\n\n // If we get here then B must have at least two elements.\n for (i = 0; i < B.length - 1; ++i) {\n for (j = i + 1; j < B.length; ++j) {\n if (enclosesNot(encloseBasis2(B[i], B[j]), p)\n && enclosesNot(encloseBasis2(B[i], p), B[j])\n && enclosesNot(encloseBasis2(B[j], p), B[i])\n && enclosesWeakAll(encloseBasis3(B[i], B[j], p), B)) {\n return [B[i], B[j], p];\n }\n }\n }\n\n // If we get here then something is very wrong.\n throw new Error;\n}\n\nfunction enclosesNot(a, b) {\n var dr = a.r - b.r, dx = b.x - a.x, dy = b.y - a.y;\n return dr < 0 || dr * dr < dx * dx + dy * dy;\n}\n\nfunction enclosesWeak(a, b) {\n var dr = a.r - b.r + 1e-6, dx = b.x - a.x, dy = b.y - a.y;\n return dr > 0 && dr * dr > dx * dx + dy * dy;\n}\n\nfunction enclosesWeakAll(a, B) {\n for (var i = 0; i < B.length; ++i) {\n if (!enclosesWeak(a, B[i])) {\n return false;\n }\n }\n return true;\n}\n\nfunction encloseBasis(B) {\n switch (B.length) {\n case 1: return encloseBasis1(B[0]);\n case 2: return encloseBasis2(B[0], B[1]);\n case 3: return encloseBasis3(B[0], B[1], B[2]);\n }\n}\n\nfunction encloseBasis1(a) {\n return {\n x: a.x,\n y: a.y,\n r: a.r\n };\n}\n\nfunction encloseBasis2(a, b) {\n var x1 = a.x, y1 = a.y, r1 = a.r,\n x2 = b.x, y2 = b.y, r2 = b.r,\n x21 = x2 - x1, y21 = y2 - y1, r21 = r2 - r1,\n l = Math.sqrt(x21 * x21 + y21 * y21);\n return {\n x: (x1 + x2 + x21 / l * r21) / 2,\n y: (y1 + y2 + y21 / l * r21) / 2,\n r: (l + r1 + r2) / 2\n };\n}\n\nfunction encloseBasis3(a, b, c) {\n var x1 = a.x, y1 = a.y, r1 = a.r,\n x2 = b.x, y2 = b.y, r2 = b.r,\n x3 = c.x, y3 = c.y, r3 = c.r,\n a2 = x1 - x2,\n a3 = x1 - x3,\n b2 = y1 - y2,\n b3 = y1 - y3,\n c2 = r2 - r1,\n c3 = r3 - r1,\n d1 = x1 * x1 + y1 * y1 - r1 * r1,\n d2 = d1 - x2 * x2 - y2 * y2 + r2 * r2,\n d3 = d1 - x3 * x3 - y3 * y3 + r3 * r3,\n ab = a3 * b2 - a2 * b3,\n xa = (b2 * d3 - b3 * d2) / (ab * 2) - x1,\n xb = (b3 * c2 - b2 * c3) / ab,\n ya = (a3 * d2 - a2 * d3) / (ab * 2) - y1,\n yb = (a2 * c3 - a3 * c2) / ab,\n A = xb * xb + yb * yb - 1,\n B = 2 * (r1 + xa * xb + ya * yb),\n C = xa * xa + ya * ya - r1 * r1,\n r = -(A ? (B + Math.sqrt(B * B - 4 * A * C)) / (2 * A) : C / B);\n return {\n x: x1 + xa + xb * r,\n y: y1 + ya + yb * r,\n r: r\n };\n}\n","import enclose from \"./enclose.js\";\n\nfunction place(b, a, c) {\n var dx = b.x - a.x, x, a2,\n dy = b.y - a.y, y, b2,\n d2 = dx * dx + dy * dy;\n if (d2) {\n a2 = a.r + c.r, a2 *= a2;\n b2 = b.r + c.r, b2 *= b2;\n if (a2 > b2) {\n x = (d2 + b2 - a2) / (2 * d2);\n y = Math.sqrt(Math.max(0, b2 / d2 - x * x));\n c.x = b.x - x * dx - y * dy;\n c.y = b.y - x * dy + y * dx;\n } else {\n x = (d2 + a2 - b2) / (2 * d2);\n y = Math.sqrt(Math.max(0, a2 / d2 - x * x));\n c.x = a.x + x * dx - y * dy;\n c.y = a.y + x * dy + y * dx;\n }\n } else {\n c.x = a.x + c.r;\n c.y = a.y;\n }\n}\n\nfunction intersects(a, b) {\n var dr = a.r + b.r - 1e-6, dx = b.x - a.x, dy = b.y - a.y;\n return dr > 0 && dr * dr > dx * dx + dy * dy;\n}\n\nfunction score(node) {\n var a = node._,\n b = node.next._,\n ab = a.r + b.r,\n dx = (a.x * b.r + b.x * a.r) / ab,\n dy = (a.y * b.r + b.y * a.r) / ab;\n return dx * dx + dy * dy;\n}\n\nfunction Node(circle) {\n this._ = circle;\n this.next = null;\n this.previous = null;\n}\n\nexport function packEnclose(circles) {\n if (!(n = circles.length)) return 0;\n\n var a, b, c, n, aa, ca, i, j, k, sj, sk;\n\n // Place the first circle.\n a = circles[0], a.x = 0, a.y = 0;\n if (!(n > 1)) return a.r;\n\n // Place the second circle.\n b = circles[1], a.x = -b.r, b.x = a.r, b.y = 0;\n if (!(n > 2)) return a.r + b.r;\n\n // Place the third circle.\n place(b, a, c = circles[2]);\n\n // Initialize the front-chain using the first three circles a, b and c.\n a = new Node(a), b = new Node(b), c = new Node(c);\n a.next = c.previous = b;\n b.next = a.previous = c;\n c.next = b.previous = a;\n\n // Attempt to place each remaining circle…\n pack: for (i = 3; i < n; ++i) {\n place(a._, b._, c = circles[i]), c = new Node(c);\n\n // Find the closest intersecting circle on the front-chain, if any.\n // “Closeness” is determined by linear distance along the front-chain.\n // “Ahead” or “behind” is likewise determined by linear distance.\n j = b.next, k = a.previous, sj = b._.r, sk = a._.r;\n do {\n if (sj <= sk) {\n if (intersects(j._, c._)) {\n b = j, a.next = b, b.previous = a, --i;\n continue pack;\n }\n sj += j._.r, j = j.next;\n } else {\n if (intersects(k._, c._)) {\n a = k, a.next = b, b.previous = a, --i;\n continue pack;\n }\n sk += k._.r, k = k.previous;\n }\n } while (j !== k.next);\n\n // Success! Insert the new circle c between a and b.\n c.previous = a, c.next = b, a.next = b.previous = b = c;\n\n // Compute the new closest circle pair to the centroid.\n aa = score(a);\n while ((c = c.next) !== b) {\n if ((ca = score(c)) < aa) {\n a = c, aa = ca;\n }\n }\n b = a.next;\n }\n\n // Compute the enclosing circle of the front chain.\n a = [b._], c = b; while ((c = c.next) !== b) a.push(c._); c = enclose(a);\n\n // Translate the circles to put the enclosing circle around the origin.\n for (i = 0; i < n; ++i) a = circles[i], a.x -= c.x, a.y -= c.y;\n\n return c.r;\n}\n\nexport default function(circles) {\n packEnclose(circles);\n return circles;\n}\n","export function optional(f) {\n return f == null ? null : required(f);\n}\n\nexport function required(f) {\n if (typeof f !== \"function\") throw new Error;\n return f;\n}\n","export function constantZero() {\n return 0;\n}\n\nexport default function(x) {\n return function() {\n return x;\n };\n}\n","import {packEnclose} from \"./siblings.js\";\nimport {optional} from \"../accessors.js\";\nimport constant, {constantZero} from \"../constant.js\";\n\nfunction defaultRadius(d) {\n return Math.sqrt(d.value);\n}\n\nexport default function() {\n var radius = null,\n dx = 1,\n dy = 1,\n padding = constantZero;\n\n function pack(root) {\n root.x = dx / 2, root.y = dy / 2;\n if (radius) {\n root.eachBefore(radiusLeaf(radius))\n .eachAfter(packChildren(padding, 0.5))\n .eachBefore(translateChild(1));\n } else {\n root.eachBefore(radiusLeaf(defaultRadius))\n .eachAfter(packChildren(constantZero, 1))\n .eachAfter(packChildren(padding, root.r / Math.min(dx, dy)))\n .eachBefore(translateChild(Math.min(dx, dy) / (2 * root.r)));\n }\n return root;\n }\n\n pack.radius = function(x) {\n return arguments.length ? (radius = optional(x), pack) : radius;\n };\n\n pack.size = function(x) {\n return arguments.length ? (dx = +x[0], dy = +x[1], pack) : [dx, dy];\n };\n\n pack.padding = function(x) {\n return arguments.length ? (padding = typeof x === \"function\" ? x : constant(+x), pack) : padding;\n };\n\n return pack;\n}\n\nfunction radiusLeaf(radius) {\n return function(node) {\n if (!node.children) {\n node.r = Math.max(0, +radius(node) || 0);\n }\n };\n}\n\nfunction packChildren(padding, k) {\n return function(node) {\n if (children = node.children) {\n var children,\n i,\n n = children.length,\n r = padding(node) * k || 0,\n e;\n\n if (r) for (i = 0; i < n; ++i) children[i].r += r;\n e = packEnclose(children);\n if (r) for (i = 0; i < n; ++i) children[i].r -= r;\n node.r = e + r;\n }\n };\n}\n\nfunction translateChild(k) {\n return function(node) {\n var parent = node.parent;\n node.r *= k;\n if (parent) {\n node.x = parent.x + k * node.x;\n node.y = parent.y + k * node.y;\n }\n };\n}\n","export default function(node) {\n node.x0 = Math.round(node.x0);\n node.y0 = Math.round(node.y0);\n node.x1 = Math.round(node.x1);\n node.y1 = Math.round(node.y1);\n}\n","export default function(parent, x0, y0, x1, y1) {\n var nodes = parent.children,\n node,\n i = -1,\n n = nodes.length,\n k = parent.value && (x1 - x0) / parent.value;\n\n while (++i < n) {\n node = nodes[i], node.y0 = y0, node.y1 = y1;\n node.x0 = x0, node.x1 = x0 += node.value * k;\n }\n}\n","import roundNode from \"./treemap/round.js\";\nimport treemapDice from \"./treemap/dice.js\";\n\nexport default function() {\n var dx = 1,\n dy = 1,\n padding = 0,\n round = false;\n\n function partition(root) {\n var n = root.height + 1;\n root.x0 =\n root.y0 = padding;\n root.x1 = dx;\n root.y1 = dy / n;\n root.eachBefore(positionNode(dy, n));\n if (round) root.eachBefore(roundNode);\n return root;\n }\n\n function positionNode(dy, n) {\n return function(node) {\n if (node.children) {\n treemapDice(node, node.x0, dy * (node.depth + 1) / n, node.x1, dy * (node.depth + 2) / n);\n }\n var x0 = node.x0,\n y0 = node.y0,\n x1 = node.x1 - padding,\n y1 = node.y1 - padding;\n if (x1 < x0) x0 = x1 = (x0 + x1) / 2;\n if (y1 < y0) y0 = y1 = (y0 + y1) / 2;\n node.x0 = x0;\n node.y0 = y0;\n node.x1 = x1;\n node.y1 = y1;\n };\n }\n\n partition.round = function(x) {\n return arguments.length ? (round = !!x, partition) : round;\n };\n\n partition.size = function(x) {\n return arguments.length ? (dx = +x[0], dy = +x[1], partition) : [dx, dy];\n };\n\n partition.padding = function(x) {\n return arguments.length ? (padding = +x, partition) : padding;\n };\n\n return partition;\n}\n","import {Node} from \"./hierarchy/index.js\";\n\nfunction defaultSeparation(a, b) {\n return a.parent === b.parent ? 1 : 2;\n}\n\n// function radialSeparation(a, b) {\n// return (a.parent === b.parent ? 1 : 2) / a.depth;\n// }\n\n// This function is used to traverse the left contour of a subtree (or\n// subforest). It returns the successor of v on this contour. This successor is\n// either given by the leftmost child of v or by the thread of v. The function\n// returns null if and only if v is on the highest level of its subtree.\nfunction nextLeft(v) {\n var children = v.children;\n return children ? children[0] : v.t;\n}\n\n// This function works analogously to nextLeft.\nfunction nextRight(v) {\n var children = v.children;\n return children ? children[children.length - 1] : v.t;\n}\n\n// Shifts the current subtree rooted at w+. This is done by increasing\n// prelim(w+) and mod(w+) by shift.\nfunction moveSubtree(wm, wp, shift) {\n var change = shift / (wp.i - wm.i);\n wp.c -= change;\n wp.s += shift;\n wm.c += change;\n wp.z += shift;\n wp.m += shift;\n}\n\n// All other shifts, applied to the smaller subtrees between w- and w+, are\n// performed by this function. To prepare the shifts, we have to adjust\n// change(w+), shift(w+), and change(w-).\nfunction executeShifts(v) {\n var shift = 0,\n change = 0,\n children = v.children,\n i = children.length,\n w;\n while (--i >= 0) {\n w = children[i];\n w.z += shift;\n w.m += shift;\n shift += w.s + (change += w.c);\n }\n}\n\n// If vi-’s ancestor is a sibling of v, returns vi-’s ancestor. Otherwise,\n// returns the specified (default) ancestor.\nfunction nextAncestor(vim, v, ancestor) {\n return vim.a.parent === v.parent ? vim.a : ancestor;\n}\n\nfunction TreeNode(node, i) {\n this._ = node;\n this.parent = null;\n this.children = null;\n this.A = null; // default ancestor\n this.a = this; // ancestor\n this.z = 0; // prelim\n this.m = 0; // mod\n this.c = 0; // change\n this.s = 0; // shift\n this.t = null; // thread\n this.i = i; // number\n}\n\nTreeNode.prototype = Object.create(Node.prototype);\n\nfunction treeRoot(root) {\n var tree = new TreeNode(root, 0),\n node,\n nodes = [tree],\n child,\n children,\n i,\n n;\n\n while (node = nodes.pop()) {\n if (children = node._.children) {\n node.children = new Array(n = children.length);\n for (i = n - 1; i >= 0; --i) {\n nodes.push(child = node.children[i] = new TreeNode(children[i], i));\n child.parent = node;\n }\n }\n }\n\n (tree.parent = new TreeNode(null, 0)).children = [tree];\n return tree;\n}\n\n// Node-link tree diagram using the Reingold-Tilford \"tidy\" algorithm\nexport default function() {\n var separation = defaultSeparation,\n dx = 1,\n dy = 1,\n nodeSize = null;\n\n function tree(root) {\n var t = treeRoot(root);\n\n // Compute the layout using Buchheim et al.’s algorithm.\n t.eachAfter(firstWalk), t.parent.m = -t.z;\n t.eachBefore(secondWalk);\n\n // If a fixed node size is specified, scale x and y.\n if (nodeSize) root.eachBefore(sizeNode);\n\n // If a fixed tree size is specified, scale x and y based on the extent.\n // Compute the left-most, right-most, and depth-most nodes for extents.\n else {\n var left = root,\n right = root,\n bottom = root;\n root.eachBefore(function(node) {\n if (node.x < left.x) left = node;\n if (node.x > right.x) right = node;\n if (node.depth > bottom.depth) bottom = node;\n });\n var s = left === right ? 1 : separation(left, right) / 2,\n tx = s - left.x,\n kx = dx / (right.x + s + tx),\n ky = dy / (bottom.depth || 1);\n root.eachBefore(function(node) {\n node.x = (node.x + tx) * kx;\n node.y = node.depth * ky;\n });\n }\n\n return root;\n }\n\n // Computes a preliminary x-coordinate for v. Before that, FIRST WALK is\n // applied recursively to the children of v, as well as the function\n // APPORTION. After spacing out the children by calling EXECUTE SHIFTS, the\n // node v is placed to the midpoint of its outermost children.\n function firstWalk(v) {\n var children = v.children,\n siblings = v.parent.children,\n w = v.i ? siblings[v.i - 1] : null;\n if (children) {\n executeShifts(v);\n var midpoint = (children[0].z + children[children.length - 1].z) / 2;\n if (w) {\n v.z = w.z + separation(v._, w._);\n v.m = v.z - midpoint;\n } else {\n v.z = midpoint;\n }\n } else if (w) {\n v.z = w.z + separation(v._, w._);\n }\n v.parent.A = apportion(v, w, v.parent.A || siblings[0]);\n }\n\n // Computes all real x-coordinates by summing up the modifiers recursively.\n function secondWalk(v) {\n v._.x = v.z + v.parent.m;\n v.m += v.parent.m;\n }\n\n // The core of the algorithm. Here, a new subtree is combined with the\n // previous subtrees. Threads are used to traverse the inside and outside\n // contours of the left and right subtree up to the highest common level. The\n // vertices used for the traversals are vi+, vi-, vo-, and vo+, where the\n // superscript o means outside and i means inside, the subscript - means left\n // subtree and + means right subtree. For summing up the modifiers along the\n // contour, we use respective variables si+, si-, so-, and so+. Whenever two\n // nodes of the inside contours conflict, we compute the left one of the\n // greatest uncommon ancestors using the function ANCESTOR and call MOVE\n // SUBTREE to shift the subtree and prepare the shifts of smaller subtrees.\n // Finally, we add a new thread (if necessary).\n function apportion(v, w, ancestor) {\n if (w) {\n var vip = v,\n vop = v,\n vim = w,\n vom = vip.parent.children[0],\n sip = vip.m,\n sop = vop.m,\n sim = vim.m,\n som = vom.m,\n shift;\n while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) {\n vom = nextLeft(vom);\n vop = nextRight(vop);\n vop.a = v;\n shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);\n if (shift > 0) {\n moveSubtree(nextAncestor(vim, v, ancestor), v, shift);\n sip += shift;\n sop += shift;\n }\n sim += vim.m;\n sip += vip.m;\n som += vom.m;\n sop += vop.m;\n }\n if (vim && !nextRight(vop)) {\n vop.t = vim;\n vop.m += sim - sop;\n }\n if (vip && !nextLeft(vom)) {\n vom.t = vip;\n vom.m += sip - som;\n ancestor = v;\n }\n }\n return ancestor;\n }\n\n function sizeNode(node) {\n node.x *= dx;\n node.y = node.depth * dy;\n }\n\n tree.separation = function(x) {\n return arguments.length ? (separation = x, tree) : separation;\n };\n\n tree.size = function(x) {\n return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], tree) : (nodeSize ? null : [dx, dy]);\n };\n\n tree.nodeSize = function(x) {\n return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], tree) : (nodeSize ? [dx, dy] : null);\n };\n\n return tree;\n}\n","export default function(parent, x0, y0, x1, y1) {\n var nodes = parent.children,\n node,\n i = -1,\n n = nodes.length,\n k = parent.value && (y1 - y0) / parent.value;\n\n while (++i < n) {\n node = nodes[i], node.x0 = x0, node.x1 = x1;\n node.y0 = y0, node.y1 = y0 += node.value * k;\n }\n}\n","import treemapDice from \"./dice.js\";\nimport treemapSlice from \"./slice.js\";\n\nexport var phi = (1 + Math.sqrt(5)) / 2;\n\nexport function squarifyRatio(ratio, parent, x0, y0, x1, y1) {\n var rows = [],\n nodes = parent.children,\n row,\n nodeValue,\n i0 = 0,\n i1 = 0,\n n = nodes.length,\n dx, dy,\n value = parent.value,\n sumValue,\n minValue,\n maxValue,\n newRatio,\n minRatio,\n alpha,\n beta;\n\n while (i0 < n) {\n dx = x1 - x0, dy = y1 - y0;\n\n // Find the next non-empty node.\n do sumValue = nodes[i1++].value; while (!sumValue && i1 < n);\n minValue = maxValue = sumValue;\n alpha = Math.max(dy / dx, dx / dy) / (value * ratio);\n beta = sumValue * sumValue * alpha;\n minRatio = Math.max(maxValue / beta, beta / minValue);\n\n // Keep adding nodes while the aspect ratio maintains or improves.\n for (; i1 < n; ++i1) {\n sumValue += nodeValue = nodes[i1].value;\n if (nodeValue < minValue) minValue = nodeValue;\n if (nodeValue > maxValue) maxValue = nodeValue;\n beta = sumValue * sumValue * alpha;\n newRatio = Math.max(maxValue / beta, beta / minValue);\n if (newRatio > minRatio) { sumValue -= nodeValue; break; }\n minRatio = newRatio;\n }\n\n // Position and record the row orientation.\n rows.push(row = {value: sumValue, dice: dx < dy, children: nodes.slice(i0, i1)});\n if (row.dice) treemapDice(row, x0, y0, x1, value ? y0 += dy * sumValue / value : y1);\n else treemapSlice(row, x0, y0, value ? x0 += dx * sumValue / value : x1, y1);\n value -= sumValue, i0 = i1;\n }\n\n return rows;\n}\n\nexport default (function custom(ratio) {\n\n function squarify(parent, x0, y0, x1, y1) {\n squarifyRatio(ratio, parent, x0, y0, x1, y1);\n }\n\n squarify.ratio = function(x) {\n return custom((x = +x) > 1 ? x : 1);\n };\n\n return squarify;\n})(phi);\n","import roundNode from \"./round.js\";\nimport squarify from \"./squarify.js\";\nimport {required} from \"../accessors.js\";\nimport constant, {constantZero} from \"../constant.js\";\n\nexport default function() {\n var tile = squarify,\n round = false,\n dx = 1,\n dy = 1,\n paddingStack = [0],\n paddingInner = constantZero,\n paddingTop = constantZero,\n paddingRight = constantZero,\n paddingBottom = constantZero,\n paddingLeft = constantZero;\n\n function treemap(root) {\n root.x0 =\n root.y0 = 0;\n root.x1 = dx;\n root.y1 = dy;\n root.eachBefore(positionNode);\n paddingStack = [0];\n if (round) root.eachBefore(roundNode);\n return root;\n }\n\n function positionNode(node) {\n var p = paddingStack[node.depth],\n x0 = node.x0 + p,\n y0 = node.y0 + p,\n x1 = node.x1 - p,\n y1 = node.y1 - p;\n if (x1 < x0) x0 = x1 = (x0 + x1) / 2;\n if (y1 < y0) y0 = y1 = (y0 + y1) / 2;\n node.x0 = x0;\n node.y0 = y0;\n node.x1 = x1;\n node.y1 = y1;\n if (node.children) {\n p = paddingStack[node.depth + 1] = paddingInner(node) / 2;\n x0 += paddingLeft(node) - p;\n y0 += paddingTop(node) - p;\n x1 -= paddingRight(node) - p;\n y1 -= paddingBottom(node) - p;\n if (x1 < x0) x0 = x1 = (x0 + x1) / 2;\n if (y1 < y0) y0 = y1 = (y0 + y1) / 2;\n tile(node, x0, y0, x1, y1);\n }\n }\n\n treemap.round = function(x) {\n return arguments.length ? (round = !!x, treemap) : round;\n };\n\n treemap.size = function(x) {\n return arguments.length ? (dx = +x[0], dy = +x[1], treemap) : [dx, dy];\n };\n\n treemap.tile = function(x) {\n return arguments.length ? (tile = required(x), treemap) : tile;\n };\n\n treemap.padding = function(x) {\n return arguments.length ? treemap.paddingInner(x).paddingOuter(x) : treemap.paddingInner();\n };\n\n treemap.paddingInner = function(x) {\n return arguments.length ? (paddingInner = typeof x === \"function\" ? x : constant(+x), treemap) : paddingInner;\n };\n\n treemap.paddingOuter = function(x) {\n return arguments.length ? treemap.paddingTop(x).paddingRight(x).paddingBottom(x).paddingLeft(x) : treemap.paddingTop();\n };\n\n treemap.paddingTop = function(x) {\n return arguments.length ? (paddingTop = typeof x === \"function\" ? x : constant(+x), treemap) : paddingTop;\n };\n\n treemap.paddingRight = function(x) {\n return arguments.length ? (paddingRight = typeof x === \"function\" ? x : constant(+x), treemap) : paddingRight;\n };\n\n treemap.paddingBottom = function(x) {\n return arguments.length ? (paddingBottom = typeof x === \"function\" ? x : constant(+x), treemap) : paddingBottom;\n };\n\n treemap.paddingLeft = function(x) {\n return arguments.length ? (paddingLeft = typeof x === \"function\" ? x : constant(+x), treemap) : paddingLeft;\n };\n\n return treemap;\n}\n","export default function(parent, x0, y0, x1, y1) {\n var nodes = parent.children,\n i, n = nodes.length,\n sum, sums = new Array(n + 1);\n\n for (sums[0] = sum = i = 0; i < n; ++i) {\n sums[i + 1] = sum += nodes[i].value;\n }\n\n partition(0, n, parent.value, x0, y0, x1, y1);\n\n function partition(i, j, value, x0, y0, x1, y1) {\n if (i >= j - 1) {\n var node = nodes[i];\n node.x0 = x0, node.y0 = y0;\n node.x1 = x1, node.y1 = y1;\n return;\n }\n\n var valueOffset = sums[i],\n valueTarget = (value / 2) + valueOffset,\n k = i + 1,\n hi = j - 1;\n\n while (k < hi) {\n var mid = k + hi >>> 1;\n if (sums[mid] < valueTarget) k = mid + 1;\n else hi = mid;\n }\n\n if ((valueTarget - sums[k - 1]) < (sums[k] - valueTarget) && i + 1 < k) --k;\n\n var valueLeft = sums[k] - valueOffset,\n valueRight = value - valueLeft;\n\n if ((x1 - x0) > (y1 - y0)) {\n var xk = (x0 * valueRight + x1 * valueLeft) / value;\n partition(i, k, valueLeft, x0, y0, xk, y1);\n partition(k, j, valueRight, xk, y0, x1, y1);\n } else {\n var yk = (y0 * valueRight + y1 * valueLeft) / value;\n partition(i, k, valueLeft, x0, y0, x1, yk);\n partition(k, j, valueRight, x0, yk, x1, y1);\n }\n }\n}\n","import dice from \"./dice.js\";\nimport slice from \"./slice.js\";\n\nexport default function(parent, x0, y0, x1, y1) {\n (parent.depth & 1 ? slice : dice)(parent, x0, y0, x1, y1);\n}\n","import treemapDice from \"./dice.js\";\nimport treemapSlice from \"./slice.js\";\nimport {phi, squarifyRatio} from \"./squarify.js\";\n\nexport default (function custom(ratio) {\n\n function resquarify(parent, x0, y0, x1, y1) {\n if ((rows = parent._squarify) && (rows.ratio === ratio)) {\n var rows,\n row,\n nodes,\n i,\n j = -1,\n n,\n m = rows.length,\n value = parent.value;\n\n while (++j < m) {\n row = rows[j], nodes = row.children;\n for (i = row.value = 0, n = nodes.length; i < n; ++i) row.value += nodes[i].value;\n if (row.dice) treemapDice(row, x0, y0, x1, y0 += (y1 - y0) * row.value / value);\n else treemapSlice(row, x0, y0, x0 += (x1 - x0) * row.value / value, y1);\n value -= row.value;\n }\n } else {\n parent._squarify = rows = squarifyRatio(ratio, parent, x0, y0, x1, y1);\n rows.ratio = ratio;\n }\n }\n\n resquarify.ratio = function(x) {\n return custom((x = +x) > 1 ? x : 1);\n };\n\n return resquarify;\n})(phi);\n","import { ITree } from \"@hpcc-js/api\";\nimport { d3Event, SVGWidget } from \"@hpcc-js/common\";\nimport { rgb as d3Rgb } from \"d3-color\";\nimport { hierarchy as d3Hierarchy, pack as d3Pack } from \"d3-hierarchy\";\nimport { interpolateZoom as d3InterpolateZoom } from \"d3-interpolate\";\nimport \"d3-transition\";\n\nimport \"../src/CirclePacking.css\";\n\nexport class CirclePacking extends SVGWidget {\n diameter;\n pack;\n svg;\n _focus;\n circle;\n view;\n protected _node;\n\n constructor() {\n super();\n ITree.call(this);\n }\n\n enter(_domNode, element) {\n this.diameter = Math.min(this.width(), this.height());\n\n this.pack = d3Pack()\n .size([this.diameter - 4, this.diameter - 4])\n .padding(1.5)\n ;\n\n this.svg = element\n .append(\"g\")\n ;\n }\n\n update(_domNode, _element) {\n const context = this;\n\n this.diameter = Math.min(this.width(), this.height());\n this.pack\n .size([this.diameter - 4, this.diameter - 4])\n .padding(1.5)\n ;\n\n this._palette = this._palette.switch(this.paletteID());\n if (this.useClonedPalette()) {\n this._palette = this._palette.cloneNotExists(this.paletteID() + \"_\" + this.id());\n }\n\n this.svg.selectAll(\"circle\").remove();\n this.svg.selectAll(\"text\").remove();\n\n const root: any = d3Hierarchy(this.data())\n .sum(function (d) {\n return d && d.size ? d.size : 1;\n }).sort(function (a, b) {\n return a.value < b.value ? -1 : a.value > b.value ? 1 : 0;\n })\n ;\n this._focus = root;\n this.pack(root);\n\n this.circle = this.svg.selectAll(\"circle\").data(root.descendants())\n .enter().append(\"circle\")\n .attr(\"class\", function (d) { return d.parent ? d.children ? \"node\" : \"node leaf\" : \"node root\"; })\n .style(\"fill\", function (d) {\n d.color = context.paletteDepthLevel_exists() && d.depth > context.paletteDepthLevel() ? d3Rgb(d.parent.color)[context.paletteDepthVariant()](1) : context._palette(d.data.label);\n return d.color;\n })\n .on(\"click\", function (d) { context.click(d.data, null, null); })\n .on(\"dblclick\", function (d) {\n if (this._focus !== d) {\n context.zoom(d);\n }\n d3Event().stopPropagation();\n })\n ;\n this.circle.append(\"title\").text(function (d) { return d.data.label; });\n\n this.svg.selectAll(\"text\").data(root.descendants())\n .enter().append(\"text\")\n .attr(\"class\", \"label\")\n .style(\"fill-opacity\", function (d) { return d.parent === root ? 1 : 0; })\n .style(\"display\", function (d) { return d.parent === root ? null : \"none\"; })\n .text(function (d) {\n return d.data.label + (context.showSize() && typeof d.data.size !== \"undefined\" ? \" \" + d.data.size : \"\");\n })\n ;\n\n this._node = this.svg.selectAll(\"circle,text\");\n\n this.zoomTo([root.x, root.y, root.r * 2]);\n }\n\n zoom(newFocus) {\n this._focus = newFocus;\n const context = this;\n const transition = this.svg.transition()\n .duration(d3Event().altKey ? 7500 : 750)\n .tween(\"zoom\", function () {\n const i = d3InterpolateZoom(context.view, [context._focus.x, context._focus.y, context._focus.r * 2]);\n return function (t) { context.zoomTo(i(t)); };\n });\n\n function showText(d) {\n return (d === context._focus && !d.children) || d.parent === context._focus;\n }\n\n transition.selectAll(\"text\")\n .filter(function (d) { return showText(d) || this.style.display === \"inline\"; })\n .style(\"fill-opacity\", function (d) { return showText(d) ? 1 : 0; })\n .on(\"start\", function (d) { if (showText(d)) this.style.display = \"inline\"; })\n .on(\"end\", function (d) { if (!showText(d)) this.style.display = \"none\"; });\n }\n\n zoomTo(v) {\n const k = this.diameter / v[2];\n this.view = v;\n this._node.attr(\"transform\", function (d) { return \"translate(\" + (d.x - v[0]) * k + \",\" + (d.y - v[1]) * k + \")\"; });\n this.circle.attr(\"r\", function (d) { return d.r * k; });\n }\n}\nCirclePacking.prototype._class += \" tree_CirclePacking\";\nCirclePacking.prototype.implements(ITree.prototype);\n\nexport interface CirclePacking {\n _palette;\n\n // I2DChart ---\n click(row, column, selected): void;\n dblclick(row, column, selected): void;\n\n // Properties ---\n showSize(): boolean;\n showSize(_: boolean): this;\n paletteDepthLevel(): number;\n paletteDepthLevel(_: number): this;\n paletteDepthLevel_exists(): boolean;\n paletteDepthVariant(): \"brighter\" | \"darker\";\n paletteDepthVariant(_: \"brighter\" | \"darker\"): this;\n paletteID(): string;\n paletteID(_: string): this;\n useClonedPalette(): boolean;\n useClonedPalette(_: boolean): this;\n}\n\nCirclePacking.prototype.publish(\"showSize\", true, \"boolean\", \"Show size along with label\");\nCirclePacking.prototype.publish(\"paletteDepthLevel\", null, \"number\", \"If not null then beyond this depth number the child node colors are based on parent\", null, { optional: true });\nCirclePacking.prototype.publish(\"paletteDepthVariant\", \"brighter\", \"set\", \"Determines paletteDepthLevel decendant color shade variant\", [\"brighter\", \"darker\"], { disable: w => w.paletteDepthLevel_exists() });\nCirclePacking.prototype.publish(\"paletteID\", \"default\", \"set\", \"Color palette for this widget\", CirclePacking.prototype._palette.switch(), { tags: [\"Basic\", \"Shared\"] });\nCirclePacking.prototype.publish(\"useClonedPalette\", false, \"boolean\", \"Enable or disable using a cloned palette\", null, { tags: [\"Intermediate\", \"Shared\"] });\n","import { ITree } from \"@hpcc-js/api\";\nimport { PropertyExt, SVGZoomWidget, Utility } from \"@hpcc-js/common\";\nimport { cluster as d3Cluster, hierarchy as d3Hierarchy, tree as d3Tree } from \"d3-hierarchy\";\nimport { select as d3Select } from \"d3-selection\";\n\nimport \"../src/Dendrogram.css\";\n\nexport class DendrogramColumn extends PropertyExt {\n _owner: Dendrogram;\n\n constructor() {\n super();\n }\n\n owner(): Dendrogram;\n owner(_: Dendrogram): this;\n owner(_?: Dendrogram): Dendrogram | this {\n if (!arguments.length) return this._owner;\n this._owner = _;\n return this;\n }\n valid(): boolean {\n return !!this.column();\n }\n\n column: { (): string; (_: string): Dendrogram; };\n}\nDendrogramColumn.prototype._class += \" tree_Dendrogram.DendrogramColumn\";\n\nDendrogramColumn.prototype.publish(\"column\", null, \"set\", \"Field\", function (this: DendrogramColumn) { return this._owner ? this._owner.columns() : []; }, { optional: true });\n\n// ===\nexport class Dendrogram extends SVGZoomWidget {\n Column;\n _d3LayoutCluster;\n _d3LayoutTree;\n _d3Layout;\n\n constructor() {\n super();\n ITree.call(this);\n Utility.SimpleSelectionMixin.call(this);\n\n this._drawStartPos = \"origin\";\n\n this._d3LayoutCluster = d3Cluster();\n this._d3LayoutTree = d3Tree();\n }\n\n dendrogramData() {\n if (this.data().length === 0) return [];\n if (!this.mappings().filter(mapping => mapping.valid()).length) {\n return this.data();\n }\n const view = this._db.rollupView(this.mappings().map(function (mapping) { return mapping.column(); }));\n const retVal = {\n key: \"root\",\n values: view.entries()\n };\n return formatData(retVal);\n\n function formatData(node) {\n return {\n label: node.key,\n children: node.values.filter(function (value) { return !(value instanceof Array); }).map(function (value) { return formatData(value); }),\n origRows: node.values\n };\n }\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n this._renderElement\n .attr(\"opacity\", 0)\n .transition().duration(500)\n .attr(\"opacity\", 1)\n ;\n this._selection.widgetElement(this._renderElement);\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n const context = this;\n const isVertical = this.orientation() === \"vertical\";\n\n this._palette = this._palette.switch(this.paletteID());\n if (this.useClonedPalette()) {\n this._palette = this._palette.cloneNotExists(this.paletteID() + \"_\" + this.id());\n }\n\n this._d3Layout = this.dendrogram() ? this._d3LayoutCluster : this._d3LayoutTree;\n\n if (this.radial()) {\n this._d3Layout\n .size([360, this.separation() * 2])\n ;\n this._d3Layout.separation(function separation(a, b) {\n return (a.parent === b.parent ? 1 : 2) / a.depth;\n });\n } else {\n this._d3Layout.nodeSize([14, this.separation()]);\n this._d3Layout.separation(function separation(a, b) {\n return a.parent === b.parent ? 1 : 2;\n });\n }\n\n const data = this.dendrogramData();\n const root = d3Hierarchy(data);\n this._d3Layout(root);\n\n const dataNodes = root.descendants();\n const links = root.descendants().slice(1);\n\n // Lines ---\n function linkVertical(d) {\n return \"M\" + d.parent.x + \",\" + d.parent.y\n + \"C\" + d.parent.x + \",\" + (d.parent.y + d.y) / 2\n + \" \" + d.x + \",\" + (d.parent.y + d.y) / 2\n + \" \" + d.x + \",\" + d.y;\n }\n\n function linkHorizontal(d) {\n return \"M\" + d.y + \",\" + d.x\n + \"C\" + (d.y + d.parent.y) / 2 + \",\" + d.x\n + \" \" + (d.y + d.parent.y) / 2 + \",\" + d.parent.x\n + \" \" + d.parent.y + \",\" + d.parent.x;\n }\n function diagonal(d) {\n return isVertical ? linkVertical(d) : linkHorizontal(d);\n }\n\n function project(x, y) {\n const angle = (x - 90) / 180 * Math.PI;\n const radius = y;\n return [radius * Math.cos(angle), radius * Math.sin(angle)];\n }\n\n function radialDiagonal(d) {\n return \"M\" + project(d.x, d.y)\n + \"C\" + project(d.x, (d.y + d.parent.y) / 2)\n + \" \" + project(d.parent.x, (d.y + d.parent.y) / 2)\n + \" \" + project(d.parent.x, d.parent.y);\n }\n\n const transitionDuration = this._renderCount ? 500 : 0;\n const lines = this._renderElement.selectAll(\".link\").data(links);\n lines.enter().append(\"path\")\n .attr(\"class\", \"link\")\n .attr(\"d\", this.radial() ? radialDiagonal : diagonal)\n ;\n lines.transition().duration(transitionDuration)\n .attr(\"d\", this.radial() ? radialDiagonal : diagonal)\n ;\n lines.exit().remove();\n\n // Nodes ---\n const textOffsetX = this.circleRadius() + 2;\n function nodeTransform(d) {\n if (context.radial()) {\n return \"rotate(\" + (d.x - 90) + \")translate(\" + d.y + \")\";\n }\n return context.orientation() === \"horizontal\" ? \"translate(\" + d.y + \",\" + d.x + \")\" : \"translate(\" + d.x + \",\" + d.y + \")\";\n }\n const nodes = this._renderElement.selectAll(\".node\").data(dataNodes);\n nodes.transition().duration(transitionDuration)\n .attr(\"transform\", nodeTransform)\n ;\n const enterNodes = nodes.enter().append(\"g\")\n .attr(\"class\", \"node\")\n .attr(\"transform\", nodeTransform)\n .call(this._selection.enter.bind(this._selection))\n .on(\"click\", function (d) {\n let tmp = d;\n while (tmp.children) {\n tmp = tmp.children[0];\n }\n if (d.depth > 0) {\n if (tmp.origRows) {\n context.click(context.rowToObj(tmp.origRows[0]), context.mappings()[d.depth - 1].column(), true);\n } else {\n context.click(tmp.data, context.mappings()[d.depth - 1].column(), true);\n }\n }\n })\n .on(\"dblclick\", function (d) {\n let tmp = d;\n while (tmp.children) {\n tmp = tmp.children[0];\n }\n if (d.depth > 0) {\n if (tmp.origRows) {\n context.dblclick(context.rowToObj(tmp.origRows[0]), context.mappings()[d.depth - 1].column(), true);\n } else {\n context.dblclick(tmp.data, context.mappings()[d.depth - 1].column(), true);\n }\n }\n })\n .each(function () {\n const e = d3Select(this);\n e.append(\"circle\");\n e.append(\"text\");\n })\n ;\n enterNodes.merge(nodes).select(\"circle\")\n .attr(\"r\", this.circleRadius())\n .style(\"fill\", function (d) { return context._palette(d.data.label); })\n .append(\"title\")\n .text(function (d) { return d.data.label; })\n ;\n enterNodes.merge(nodes).select(\"text\")\n .attr(\"dx\", function (d) {\n if (context.radial()) {\n if (d.children) {\n return d.x < 180 ? -textOffsetX : textOffsetX;\n } else {\n return d.x < 180 ? textOffsetX : -textOffsetX;\n }\n } else if (isVertical) {\n return d.children ? textOffsetX : -textOffsetX;\n }\n return d.children ? -textOffsetX : textOffsetX;\n })\n .attr(\"dy\", \"0.25em\")\n .style(\"text-anchor\", function (d) {\n if (context.radial()) {\n if (d.children) {\n return d.x < 180 ? \"end\" : \"start\";\n } else {\n return d.x < 180 ? \"start\" : \"end\";\n }\n } else if (isVertical) {\n return d.children ? \"start\" : \"end\";\n }\n return d.children ? \"end\" : \"start\";\n })\n .attr(\"transform\", function (d) {\n if (context.radial()) {\n return d.x < 180 ? null : \"rotate(180)\";\n } else if (isVertical) {\n return \"rotate(-66)\";\n }\n return null;\n })\n .text(function (d) { return d.data.label; })\n ;\n nodes.exit().remove();\n\n if (!this._renderCount) {\n context.zoomToFit();\n }\n }\n}\nDendrogram.prototype._class += \" tree_Dendrogram\";\nDendrogram.prototype.implements(ITree.prototype);\nDendrogram.prototype.mixin(Utility.SimpleSelectionMixin);\nDendrogram.prototype.Column = DendrogramColumn;\n\nexport interface Dendrogram {\n _palette;\n\n // ITree ---\n click(row, column, selected): void;\n dblclick(row, column, selected): void;\n\n // SimpleSelectionMixin ---\n _selection;\n\n // Properties ---\n paletteID(): string;\n paletteID(_: string): this;\n useClonedPalette(): boolean;\n useClonedPalette(_: boolean): this;\n mappings(): DendrogramColumn[];\n mappings(_: DendrogramColumn[]): this;\n\n circleRadius(): number;\n circleRadius(_: number): this;\n separation(): number;\n separation(_: number): this;\n dendrogram(): boolean;\n dendrogram(_: boolean): this;\n radial(): boolean;\n radial(_: boolean): this;\n orientation(): \"horizontal\" | \"vertical\";\n orientation(_: \"horizontal\" | \"vertical\"): this;\n}\n\nDendrogram.prototype.publish(\"paletteID\", \"default\", \"set\", \"Color palette for this widget\", Dendrogram.prototype._palette.switch(), { tags: [\"Basic\", \"Shared\"] });\nDendrogram.prototype.publish(\"useClonedPalette\", false, \"boolean\", \"Enable or disable using a cloned palette\", null, { tags: [\"Intermediate\", \"Shared\"] });\nDendrogram.prototype.publish(\"mappings\", [], \"propertyArray\", \"Source Columns\", null, { autoExpand: DendrogramColumn });\n\nDendrogram.prototype.publish(\"circleRadius\", 4.5, \"number\", \"Text offset from circle\");\nDendrogram.prototype.publish(\"separation\", 240, \"number\", \"Leaf Separation\");\nDendrogram.prototype.publish(\"dendrogram\", true, \"boolean\", \"Dendrogram\");\nDendrogram.prototype.publish(\"radial\", false, \"boolean\", \"Radial\");\nDendrogram.prototype.publish(\"orientation\", \"horizontal\", \"set\", \"Orientation\", [\"horizontal\", \"vertical\"], { tags: [\"Private\"], disable: w => w.radial() });\n","import { HTMLWidget, Palette, Platform, select as d3Select, Utility, } from \"@hpcc-js/common\";\nimport { max as d3Max } from \"d3-array\";\nimport { hierarchy as d3Hierarchy } from \"d3-hierarchy\";\n\ninterface DirectoryItem {\n color?: string;\n iconClass?: string;\n label: string;\n depth: number;\n content?: string;\n markers?: any;\n isFolder: boolean;\n bold?: boolean;\n selected?: boolean;\n weightValue?: string;\n weightColor?: string;\n}\n\nexport class DirectoryTree extends HTMLWidget {\n\n constructor() {\n super();\n }\n\n flattenData(json): DirectoryItem[] {\n const context = this;\n const root = d3Hierarchy(json);\n const ret = [];\n\n if (!this.omitRoot()) {\n visitNode(root);\n } else if (root.children) {\n root.children.forEach(visitNode);\n }\n\n return ret;\n\n function visitNode(node) {\n const weightValue = node.data.markers && node.data.markers.length ? node.data.markers.length : \"\";\n ret.push({\n label: node.data.label,\n depth: node.depth - (context.omitRoot() ? 1 : 0),\n content: node.data.content,\n isFolder: !!node.data.children,\n iconClass: node.data.iconClass,\n color: node.data.color,\n bold: node.data.bold,\n weightValue,\n markers: node.data.markers,\n selected: node.data.selected\n });\n if (node.children) {\n node.children.forEach(visitNode);\n }\n }\n }\n\n protected iconClass(d) {\n if (d.label === \"error\") {\n return \"fa fa-exclamation\";\n }\n if (d.isFolder) {\n return this.folderIconOpen();\n }\n return this.textFileIcon();\n }\n\n protected calcRequiredWidth() {\n const flatData = this.flattenData(this.data());\n\n let widest = 0;\n\n const padding = this.rowItemPadding();\n const iconWidth = this.iconSize() + (padding * 2);\n const scrollbarWidth = Platform.getScrollbarWidth();\n\n flatData.forEach(row => {\n const offsetWidth = (row.depth * iconWidth) + (padding * 2);\n const textWidth = Utility.textSize(\n row.label,\n this.fontFamily(),\n this.fontSize(),\n !!row.bold\n ).width + (padding * 2);\n const totalWidth = textWidth + iconWidth + offsetWidth + scrollbarWidth;\n if (widest < totalWidth) {\n widest = totalWidth;\n }\n });\n return widest;\n }\n\n rowClick(str, markers) { }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n element\n .style(\"width\", \"100%\")\n .style(\"height\", \"100%\")\n ;\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n\n this._palette = this._palette.switch(this.paletteID());\n\n element\n .style(\"overflow-y\", this.verticalScroll() ? \"scroll\" : null)\n ;\n const flatData = this.flattenData(this.data());\n const maxWeightValue = d3Max(flatData, n => Number(n.weightValue));\n\n flatData.forEach(d => {\n if (!d.weightValue) {\n d.weightColor = \"transparent\";\n } else {\n d.weightColor = this._palette(d.weightValue, 1, maxWeightValue);\n }\n });\n const context = this;\n const padding = this.rowItemPadding();\n const iconWidth = this.iconSize() + padding;\n const lineHeight = Math.max(context.iconSize(), context.fontSize());\n const rowSelection = element.selectAll(\".directory-row\").data(flatData);\n const fontFamily = this.fontFamily();\n const fontSize = this.fontSize();\n const maxWeightWidth = d3Max(flatData, d => this.textSize(d.weightValue, fontFamily, fontSize).width);\n const rowItemPadding = `${padding}px ${padding}px ${padding / 2}px ${padding}px`;\n\n const rowEnter = rowSelection.enter().append(\"div\")\n .attr(\"class\", d => `directory-row directory-row-depth-${d.depth}`)\n .style(\"display\", \"flex\")\n .style(\"cursor\", \"pointer\")\n .each(function (d: DirectoryItem) {\n const rowDiv = d3Select(this);\n\n const fontColor = d.color ? d.color : context.fontColor();\n const weightColor = d.weightColor ? d.weightColor : \"transparent\";\n const weightFontColor = Palette.textColor(weightColor);\n\n const weightDiv = rowDiv.append(\"div\")\n .attr(\"class\", \"row-weight\")\n .style(\"padding\", rowItemPadding)\n .style(\"color\", weightFontColor)\n .style(\"box-shadow\", `inset 0 0 100px ${weightColor}`)\n .style(\"font-weight\", d.bold ? \"bold\" : \"normal\")\n .style(\"font-family\", fontFamily)\n .style(\"font-size\", fontSize + \"px\")\n .text(d.weightValue)\n .attr(\"title\", d.weightValue)\n .style(\"overflow\", \"hidden\")\n .style(\"width\", (maxWeightWidth + (padding * 2)) + \"px\")\n .style(\"text-overflow\", \"ellipsis\")\n .style(\"text-align\", \"right\")\n .style(\"line-height\", lineHeight + \"px\")\n ;\n rowDiv.append(\"div\")\n .attr(\"class\", \"row-depth\")\n .style(\"width\", (context.depthSize() * d.depth) + \"px\")\n .style(\"opacity\", 1)\n .style(\"line-height\", lineHeight + \"px\")\n ;\n const iconDiv = rowDiv.append(\"div\")\n .attr(\"class\", \"row-icon \" + (d.iconClass ? d.iconClass : context.iconClass(d)))\n .style(\"width\", iconWidth + \"px\")\n .style(\"height\", lineHeight + \"px\")\n .style(\"color\", fontColor)\n .style(\"background-color\", d.selected ? context.selectionBackgroundColor() : \"transparent\")\n .style(\"font-size\", context.iconSize() + \"px\")\n .style(\"padding\", rowItemPadding)\n .style(\"line-height\", lineHeight + \"px\")\n ;\n const labelDiv = rowDiv.append(\"div\")\n .attr(\"class\", \"row-label\")\n .style(\"padding\", rowItemPadding)\n .style(\"color\", fontColor)\n .style(\"background-color\", d.selected ? context.selectionBackgroundColor() : \"transparent\")\n .style(\"font-weight\", d.bold ? \"bold\" : \"normal\")\n .style(\"font-family\", context.fontFamily())\n .style(\"font-size\", context.fontSize() + \"px\")\n .text(d.label)\n .attr(\"title\", d.label)\n .style(\"flex\", 1)\n .style(\"overflow\", \"hidden\")\n .style(\"text-overflow\", \"ellipsis\")\n .style(\"line-height\", lineHeight + \"px\")\n ;\n\n rowDiv\n .on(\"mouseenter\", () => {\n labelDiv.style(\"font-weight\", \"bold\");\n })\n .on(\"mouseleave\", () => {\n labelDiv.style(\"font-weight\", d.bold ? \"bold\" : \"normal\");\n })\n ;\n weightDiv\n .on(\"mouseenter\", () => {\n context.weight_mouseenter(d);\n })\n .on(\"mouseleave\", () => {\n context.weight_mouseleave(d);\n })\n ;\n\n if (d.isFolder) {\n rowDiv.on(\"click\", function (d: any) {\n let next = this.nextSibling;\n const wasClosed = rowDiv.classed(\"folder-closed\");\n if (wasClosed) {\n rowDiv.classed(\"folder-closed\", false);\n rowDiv.classed(\"folder-open\", true);\n iconDiv.attr(\"class\", \"row-icon \" + context.folderIconOpen());\n } else {\n rowDiv.classed(\"folder-closed\", true);\n rowDiv.classed(\"folder-open\", false);\n iconDiv.attr(\"class\", \"row-icon \" + context.folderIconClosed());\n }\n while (next !== null) {\n const nextDepth = (d3Select(next).datum() as any).depth;\n if (nextDepth > d.depth) {\n next.style.display = wasClosed ? \"flex\" : \"none\";\n next = next.nextSibling;\n } else {\n next = null;\n }\n }\n });\n } else {\n rowDiv.on(\"click\", () => {\n element.selectAll(\".row-label\").style(\"background-color\", \"transparent\");\n element.selectAll(\".row-icon\").style(\"background-color\", \"transparent\");\n iconDiv.style(\"background-color\", context.selectionBackgroundColor());\n labelDiv.style(\"background-color\", context.selectionBackgroundColor());\n const ext = d.label.split(\".\").pop().toLowerCase();\n context.rowClick(ext === \"json\" ? JSON.stringify(JSON.parse(d.content), null, 4) : d.content, d.markers);\n });\n }\n })\n ;\n\n rowEnter\n .merge(rowSelection)\n .style(\"background-color\", context.backgroundColor())\n ;\n\n rowSelection.exit().remove();\n }\n weight_mouseenter(d) {\n\n }\n weight_mouseleave(d) {\n\n }\n}\nDirectoryTree.prototype._class += \" tree_DirectoryTree\";\nDirectoryTree.prototype._palette = Palette.rainbow(\"Blues\");\n\nexport interface DirectoryTree {\n _palette;\n\n depthSize(): number;\n depthSize(_: number): this;\n paletteID(): string;\n paletteID(_: string): this;\n omitRoot(): boolean;\n omitRoot(_: boolean): this;\n rowItemPadding(): number;\n rowItemPadding(_: number): this;\n selectionBackgroundColor(): string;\n selectionBackgroundColor(_: string): this;\n backgroundColor(): string;\n backgroundColor(_: string): this;\n fontColor(): string;\n fontColor(_: string): this;\n fontFamily(): string;\n fontFamily(_: string): this;\n fontSize(): number;\n fontSize(_: number): this;\n iconSize(): number;\n iconSize(_: number): this;\n folderIconOpen(): string;\n folderIconOpen(_: string): this;\n folderIconClosed(): string;\n folderIconClosed(_: string): this;\n textFileIcon(): string;\n textFileIcon(_: string): this;\n verticalScroll(): boolean;\n verticalScroll(_: boolean): this;\n}\n\nDirectoryTree.prototype.publish(\"depthSize\", 14, \"number\", \"Width of indentation per file or folder depth (pixels)\");\nDirectoryTree.prototype.publish(\"paletteID\", \"Blues\", \"set\", \"Color palette for the weight backgrounds\", DirectoryTree.prototype._palette.switch(), { tags: [\"Basic\"] });\nDirectoryTree.prototype.publish(\"omitRoot\", false, \"boolean\", \"If true, root node will not display\");\nDirectoryTree.prototype.publish(\"rowItemPadding\", 2, \"number\", \"Top, bottom, left and right row item padding\");\nDirectoryTree.prototype.publish(\"selectionBackgroundColor\", \"#CCC\", \"html-color\", \"Background color of selected directory rows\");\nDirectoryTree.prototype.publish(\"backgroundColor\", \"#FFF\", \"html-color\", \"Directory item background color\");\nDirectoryTree.prototype.publish(\"fontColor\", \"#000\", \"html-color\", \"Directory item font color\");\nDirectoryTree.prototype.publish(\"fontFamily\", \"Arial\", \"string\", \"Directory item font family\");\nDirectoryTree.prototype.publish(\"fontSize\", 12, \"number\", \"Directory item font size (pixels)\");\nDirectoryTree.prototype.publish(\"iconSize\", 12, \"number\", \"Directory folder and file icon size (pixels)\");\nDirectoryTree.prototype.publish(\"folderIconOpen\", \"fa fa-folder-open\", \"string\", \"Open folder icon class\");\nDirectoryTree.prototype.publish(\"folderIconClosed\", \"fa fa-folder\", \"string\", \"Closed folder icon class\");\nDirectoryTree.prototype.publish(\"textFileIcon\", \"fa fa-file-text-o\", \"string\", \"Text file icon class\");\nDirectoryTree.prototype.publish(\"verticalScroll\", true, \"boolean\", \"If true, vertical scroll bar will be shown\");\n","import { ITree } from \"@hpcc-js/api\";\nimport { PropertyExt, SVGZoomWidget, Utility } from \"@hpcc-js/common\";\nimport { hierarchy as d3Hierarchy, tree as d3Tree } from \"d3-hierarchy\";\nimport { select as d3Select } from \"d3-selection\";\n\nimport \"../src/Indented.css\";\n\nexport class IndentedColumn extends PropertyExt {\n _owner: Indented;\n\n constructor() {\n super();\n }\n\n owner(): Indented;\n owner(_: Indented): this;\n owner(_?: Indented): Indented | this {\n if (!arguments.length) return this._owner;\n this._owner = _;\n return this;\n }\n valid(): boolean {\n return !!this.column();\n }\n\n column: (_?: string) => string | IndentedColumn;\n}\nIndentedColumn.prototype._class += \" tree_Dendrogram.IndentedColumn\";\n\nIndentedColumn.prototype.publish(\"column\", null, \"set\", \"Field\", function (this: IndentedColumn) { return this._owner ? this._owner.columns() : []; }, { optional: true });\n\n// ===\nexport class Indented extends SVGZoomWidget {\n Column;\n _d3Tree;\n _xml;\n _svgLinks;\n _svgNodes;\n _treeData;\n _collapsed: { [key: string]: boolean } = {};\n\n constructor() {\n super();\n ITree.call(this);\n Utility.SimpleSelectionMixin.call(this);\n\n this._drawStartPos = \"origin\";\n\n this._d3Tree = d3Tree();\n }\n\n xmlToData(xml, id = \"\") {\n if (DOMParser) {\n const parser = new DOMParser();\n const doc = parser.parseFromString(xml, \"text/xml\");\n return xmlToJson(doc, id).children[0];\n }\n return [];\n }\n\n xml(_) {\n if (!arguments.length) return this._xml;\n this._xml = _;\n this.data(this.xmlToData(this._xml));\n return this;\n }\n\n IndentedData() {\n if (this.data().length === 0) return [];\n if (this.xmlColumn_exists()) {\n const cellIdx = this.columns().indexOf(this.xmlColumn());\n const retVal = {\n label: this.xmlColumn(),\n children: this.data().map(function (row, idx) {\n return this.xmlToData(row[cellIdx], \"[\" + idx + \"]\");\n }, this)\n };\n return retVal.children.length === 1 ? retVal.children[0] : retVal;\n } else {\n if (!this.mappings().filter(mapping => mapping.valid()).length) {\n return this.data();\n }\n const view = this._db.rollupView(this.mappings().map(function (mapping) { return mapping.column(); }));\n const root = {\n key: \"root\",\n values: view.entries()\n };\n return formatData(root);\n }\n\n function formatData(node): any {\n if (node.values instanceof Array) {\n const children = node.values.filter(function (value) {\n return !(value instanceof Array);\n }).map(function (value) {\n return formatData(value);\n });\n const retVal: any = {\n label: node.key\n };\n if (children.length) {\n retVal.children = children;\n } else {\n retVal.size = 22;\n }\n return retVal;\n }\n return {\n label: node.key,\n size: node.values.aggregate,\n origRows: node.values\n };\n }\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n this._svgLinks = this._renderElement.append(\"g\");\n this._svgNodes = this._renderElement.append(\"g\");\n this._selection.widgetElement(this._svgNodes);\n }\n\n protected _prevDataChecksum;\n update(domNode, _element) {\n super.update(domNode, _element);\n const context = this;\n\n this._d3Tree\n .nodeSize([0, this.barHeight()])\n ;\n const dataChecksum = this._db.dataChecksum();\n if (this._prevDataChecksum !== dataChecksum) {\n this._treeData = this.IndentedData();\n this._prevDataChecksum = dataChecksum;\n }\n\n function getID(d) {\n return (d.parent ? getID(d.parent) + \".\" : \"\") + d.data.label;\n }\n\n const root = d3Hierarchy(this.data())\n .sum(function (d) {\n return d.size || 50;\n }).each((d) => {\n if (this._collapsed[getID(d)]) {\n delete (d.children);\n }\n })\n ;\n\n const dataNodes = this._d3Tree(root).descendants();\n const links = this._d3Tree(root).descendants().slice(1);\n\n let nodeIdx = 0;\n root.eachBefore((n: any) => {\n n.x = nodeIdx * context.barHeight();\n ++nodeIdx;\n });\n\n const boxSize = this.barHeight() - 4;\n const transitionDuration = this._renderCount ? 500 : 0;\n\n // Lines ---\n const lines = this._svgLinks.selectAll(\".link\").data(links, function (d) { return getID(d); });\n lines.enter().append(\"path\")\n .attr(\"class\", \"link\")\n .attr(\"d\", elbow)\n ;\n lines.transition().duration(transitionDuration)\n .attr(\"d\", elbow)\n ;\n lines.exit().remove();\n\n function elbow(d) {\n return \"M\" + d.parent.y + \",\" + d.parent.x\n + \"V\" + d.x + \", H\" + d.y;\n }\n\n // Nodes ---\n const nodes = this._svgNodes.selectAll(\".node\").data(dataNodes, function (d) { return getID(d); });\n nodes.transition().duration(transitionDuration)\n .attr(\"transform\", function (d) { return \"translate(\" + d.y + \",\" + d.x + \")\"; })\n ;\n const enterNodes = nodes.enter().append(\"g\")\n .attr(\"class\", \"node\")\n .attr(\"transform\", function (d) { return \"translate(\" + d.y + \",\" + d.x + \")\"; })\n .call(this._selection.enter.bind(this._selection))\n .each(function () {\n const element = d3Select(this);\n element.append(\"rect\")\n .attr(\"height\", boxSize)\n .attr(\"width\", boxSize)\n .on(\"click\", function (d: any) {\n if (context._collapsed[getID(d)]) {\n delete context._collapsed[getID(d)];\n } else if (d.children) {\n context._collapsed[getID(d)] = true;\n }\n context.lazyRender();\n })\n ;\n element.append(\"text\");\n })\n .style(\"opacity\", 0)\n ;\n enterNodes.transition()\n .style(\"opacity\", 1)\n ;\n enterNodes.merge(nodes).select(\"rect\")\n .attr(\"x\", -boxSize / 2)\n .attr(\"y\", -boxSize / 2)\n .style(\"fill\", color)\n ;\n enterNodes.merge(nodes).select(\"text\")\n .attr(\"dx\", boxSize / 2 + 4 + \"px\")\n .attr(\"dy\", \"0.33em\")\n .text(function (d) { return d.data.label; })\n ;\n nodes.exit().transition()\n .style(\"opacity\", 0)\n .remove()\n ;\n\n if (!this._renderCount) {\n context.zoomToFit();\n }\n\n function color(d) {\n return context._collapsed[getID(d)] ? \"#3182bd\" : d.children ? \"#c6dbef\" : \"#fd8d3c\";\n }\n }\n}\nIndented.prototype._class += \" tree_Indented\";\nIndented.prototype.implements(ITree.prototype);\nIndented.prototype.mixin(Utility.SimpleSelectionMixin);\nIndented.prototype.Column = IndentedColumn;\n\nexport interface Indented {\n _palette;\n\n // ITree ---\n click(row, column, selected): void;\n dblclick(row, column, selected): void;\n\n // SimpleSelectionMixin ---\n _selection;\n\n // Properties ---\n xmlColumn(): string;\n xmlColumn(_: string): this;\n xmlColumn_exists(): boolean;\n mappings(): IndentedColumn[];\n mappings(_: IndentedColumn[]): this;\n barHeight(): number;\n barHeight(_: number): this;\n}\n\nIndented.prototype.publish(\"xmlColumn\", null, \"set\", \"Field\", function () { return this.columns(); }, { optional: true });\nIndented.prototype.publish(\"mappings\", [], \"propertyArray\", \"Source Columns\", null, { autoExpand: IndentedColumn, disable: (w) => w.xmlColumn_exists() });\nIndented.prototype.publish(\"barHeight\", 16, \"number\", \"Bar height\");\n\nfunction xmlToJson(xml, id = \"\") {\n const retVal = {\n id,\n label: \"\",\n attributes: {},\n children: []\n };\n\n retVal.label = xml.nodeName;\n if (xml.nodeType === 1) { // element\n if (xml.attributes.length > 0) {\n for (let j = 0; j < xml.attributes.length; j++) {\n const attribute = xml.attributes.item(j);\n retVal.attributes[attribute.nodeName] = attribute.nodeValue;\n }\n }\n } else if (xml.nodeType === 3) { // text\n retVal.label = xml.nodeValue;\n }\n\n if (xml.hasChildNodes()) {\n for (let i = 0; i < xml.childNodes.length; i++) {\n const item = xml.childNodes.item(i);\n const child = xmlToJson(item, id + \"[\" + retVal.children.length + \"]\");\n retVal.children.push(child);\n }\n }\n return retVal;\n}\n","var pi = Math.PI,\n tau = 2 * pi,\n epsilon = 1e-6,\n tauEpsilon = tau - epsilon;\n\nfunction Path() {\n this._x0 = this._y0 = // start of current subpath\n this._x1 = this._y1 = null; // end of current subpath\n this._ = \"\";\n}\n\nfunction path() {\n return new Path;\n}\n\nPath.prototype = path.prototype = {\n constructor: Path,\n moveTo: function(x, y) {\n this._ += \"M\" + (this._x0 = this._x1 = +x) + \",\" + (this._y0 = this._y1 = +y);\n },\n closePath: function() {\n if (this._x1 !== null) {\n this._x1 = this._x0, this._y1 = this._y0;\n this._ += \"Z\";\n }\n },\n lineTo: function(x, y) {\n this._ += \"L\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n quadraticCurveTo: function(x1, y1, x, y) {\n this._ += \"Q\" + (+x1) + \",\" + (+y1) + \",\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n bezierCurveTo: function(x1, y1, x2, y2, x, y) {\n this._ += \"C\" + (+x1) + \",\" + (+y1) + \",\" + (+x2) + \",\" + (+y2) + \",\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n arcTo: function(x1, y1, x2, y2, r) {\n x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;\n var x0 = this._x1,\n y0 = this._y1,\n x21 = x2 - x1,\n y21 = y2 - y1,\n x01 = x0 - x1,\n y01 = y0 - y1,\n l01_2 = x01 * x01 + y01 * y01;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(\"negative radius: \" + r);\n\n // Is this path empty? Move to (x1,y1).\n if (this._x1 === null) {\n this._ += \"M\" + (this._x1 = x1) + \",\" + (this._y1 = y1);\n }\n\n // Or, is (x1,y1) coincident with (x0,y0)? Do nothing.\n else if (!(l01_2 > epsilon));\n\n // Or, are (x0,y0), (x1,y1) and (x2,y2) collinear?\n // Equivalently, is (x1,y1) coincident with (x2,y2)?\n // Or, is the radius zero? Line to (x1,y1).\n else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) {\n this._ += \"L\" + (this._x1 = x1) + \",\" + (this._y1 = y1);\n }\n\n // Otherwise, draw an arc!\n else {\n var x20 = x2 - x0,\n y20 = y2 - y0,\n l21_2 = x21 * x21 + y21 * y21,\n l20_2 = x20 * x20 + y20 * y20,\n l21 = Math.sqrt(l21_2),\n l01 = Math.sqrt(l01_2),\n l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2),\n t01 = l / l01,\n t21 = l / l21;\n\n // If the start tangent is not coincident with (x0,y0), line to.\n if (Math.abs(t01 - 1) > epsilon) {\n this._ += \"L\" + (x1 + t01 * x01) + \",\" + (y1 + t01 * y01);\n }\n\n this._ += \"A\" + r + \",\" + r + \",0,0,\" + (+(y01 * x20 > x01 * y20)) + \",\" + (this._x1 = x1 + t21 * x21) + \",\" + (this._y1 = y1 + t21 * y21);\n }\n },\n arc: function(x, y, r, a0, a1, ccw) {\n x = +x, y = +y, r = +r, ccw = !!ccw;\n var dx = r * Math.cos(a0),\n dy = r * Math.sin(a0),\n x0 = x + dx,\n y0 = y + dy,\n cw = 1 ^ ccw,\n da = ccw ? a0 - a1 : a1 - a0;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(\"negative radius: \" + r);\n\n // Is this path empty? Move to (x0,y0).\n if (this._x1 === null) {\n this._ += \"M\" + x0 + \",\" + y0;\n }\n\n // Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0).\n else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) {\n this._ += \"L\" + x0 + \",\" + y0;\n }\n\n // Is this arc empty? We’re done.\n if (!r) return;\n\n // Does the angle go the wrong way? Flip the direction.\n if (da < 0) da = da % tau + tau;\n\n // Is this a complete circle? Draw two arcs to complete the circle.\n if (da > tauEpsilon) {\n this._ += \"A\" + r + \",\" + r + \",0,1,\" + cw + \",\" + (x - dx) + \",\" + (y - dy) + \"A\" + r + \",\" + r + \",0,1,\" + cw + \",\" + (this._x1 = x0) + \",\" + (this._y1 = y0);\n }\n\n // Is this arc non-empty? Draw an arc!\n else if (da > epsilon) {\n this._ += \"A\" + r + \",\" + r + \",0,\" + (+(da >= pi)) + \",\" + cw + \",\" + (this._x1 = x + r * Math.cos(a1)) + \",\" + (this._y1 = y + r * Math.sin(a1));\n }\n },\n rect: function(x, y, w, h) {\n this._ += \"M\" + (this._x0 = this._x1 = +x) + \",\" + (this._y0 = this._y1 = +y) + \"h\" + (+w) + \"v\" + (+h) + \"h\" + (-w) + \"Z\";\n },\n toString: function() {\n return this._;\n }\n};\n\nexport default path;\n","export default function(x) {\n return function constant() {\n return x;\n };\n}\n","export var abs = Math.abs;\nexport var atan2 = Math.atan2;\nexport var cos = Math.cos;\nexport var max = Math.max;\nexport var min = Math.min;\nexport var sin = Math.sin;\nexport var sqrt = Math.sqrt;\n\nexport var epsilon = 1e-12;\nexport var pi = Math.PI;\nexport var halfPi = pi / 2;\nexport var tau = 2 * pi;\n\nexport function acos(x) {\n return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);\n}\n\nexport function asin(x) {\n return x >= 1 ? halfPi : x <= -1 ? -halfPi : Math.asin(x);\n}\n","import {path} from \"d3-path\";\nimport constant from \"./constant.js\";\nimport {abs, acos, asin, atan2, cos, epsilon, halfPi, max, min, pi, sin, sqrt, tau} from \"./math.js\";\n\nfunction arcInnerRadius(d) {\n return d.innerRadius;\n}\n\nfunction arcOuterRadius(d) {\n return d.outerRadius;\n}\n\nfunction arcStartAngle(d) {\n return d.startAngle;\n}\n\nfunction arcEndAngle(d) {\n return d.endAngle;\n}\n\nfunction arcPadAngle(d) {\n return d && d.padAngle; // Note: optional!\n}\n\nfunction intersect(x0, y0, x1, y1, x2, y2, x3, y3) {\n var x10 = x1 - x0, y10 = y1 - y0,\n x32 = x3 - x2, y32 = y3 - y2,\n t = y32 * x10 - x32 * y10;\n if (t * t < epsilon) return;\n t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;\n return [x0 + t * x10, y0 + t * y10];\n}\n\n// Compute perpendicular offset line of length rc.\n// http://mathworld.wolfram.com/Circle-LineIntersection.html\nfunction cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * sqrt(max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}\n\nexport default function() {\n var innerRadius = arcInnerRadius,\n outerRadius = arcOuterRadius,\n cornerRadius = constant(0),\n padRadius = null,\n startAngle = arcStartAngle,\n endAngle = arcEndAngle,\n padAngle = arcPadAngle,\n context = null;\n\n function arc() {\n var buffer,\n r,\n r0 = +innerRadius.apply(this, arguments),\n r1 = +outerRadius.apply(this, arguments),\n a0 = startAngle.apply(this, arguments) - halfPi,\n a1 = endAngle.apply(this, arguments) - halfPi,\n da = abs(a1 - a0),\n cw = a1 > a0;\n\n if (!context) context = buffer = path();\n\n // Ensure that the outer radius is always larger than the inner radius.\n if (r1 < r0) r = r1, r1 = r0, r0 = r;\n\n // Is it a point?\n if (!(r1 > epsilon)) context.moveTo(0, 0);\n\n // Or is it a circle or annulus?\n else if (da > tau - epsilon) {\n context.moveTo(r1 * cos(a0), r1 * sin(a0));\n context.arc(0, 0, r1, a0, a1, !cw);\n if (r0 > epsilon) {\n context.moveTo(r0 * cos(a1), r0 * sin(a1));\n context.arc(0, 0, r0, a1, a0, cw);\n }\n }\n\n // Or is it a circular or annular sector?\n else {\n var a01 = a0,\n a11 = a1,\n a00 = a0,\n a10 = a1,\n da0 = da,\n da1 = da,\n ap = padAngle.apply(this, arguments) / 2,\n rp = (ap > epsilon) && (padRadius ? +padRadius.apply(this, arguments) : sqrt(r0 * r0 + r1 * r1)),\n rc = min(abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments)),\n rc0 = rc,\n rc1 = rc,\n t0,\n t1;\n\n // Apply padding? Note that since r1 ≥ r0, da1 ≥ da0.\n if (rp > epsilon) {\n var p0 = asin(rp / r0 * sin(ap)),\n p1 = asin(rp / r1 * sin(ap));\n if ((da0 -= p0 * 2) > epsilon) p0 *= (cw ? 1 : -1), a00 += p0, a10 -= p0;\n else da0 = 0, a00 = a10 = (a0 + a1) / 2;\n if ((da1 -= p1 * 2) > epsilon) p1 *= (cw ? 1 : -1), a01 += p1, a11 -= p1;\n else da1 = 0, a01 = a11 = (a0 + a1) / 2;\n }\n\n var x01 = r1 * cos(a01),\n y01 = r1 * sin(a01),\n x10 = r0 * cos(a10),\n y10 = r0 * sin(a10);\n\n // Apply rounded corners?\n if (rc > epsilon) {\n var x11 = r1 * cos(a11),\n y11 = r1 * sin(a11),\n x00 = r0 * cos(a00),\n y00 = r0 * sin(a00),\n oc;\n\n // Restrict the corner radius according to the sector angle.\n if (da < pi && (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10))) {\n var ax = x01 - oc[0],\n ay = y01 - oc[1],\n bx = x11 - oc[0],\n by = y11 - oc[1],\n kc = 1 / sin(acos((ax * bx + ay * by) / (sqrt(ax * ax + ay * ay) * sqrt(bx * bx + by * by))) / 2),\n lc = sqrt(oc[0] * oc[0] + oc[1] * oc[1]);\n rc0 = min(rc, (r0 - lc) / (kc - 1));\n rc1 = min(rc, (r1 - lc) / (kc + 1));\n }\n }\n\n // Is the sector collapsed to a line?\n if (!(da1 > epsilon)) context.moveTo(x01, y01);\n\n // Does the sector’s outer ring have rounded corners?\n else if (rc1 > epsilon) {\n t0 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw);\n t1 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw);\n\n context.moveTo(t0.cx + t0.x01, t0.cy + t0.y01);\n\n // Have the corners merged?\n if (rc1 < rc) context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);\n\n // Otherwise, draw the two corners and the ring.\n else {\n context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r1, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), !cw);\n context.arc(t1.cx, t1.cy, rc1, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);\n }\n }\n\n // Or is the outer ring just a circular arc?\n else context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw);\n\n // Is there no inner ring, and it’s a circular sector?\n // Or perhaps it’s an annular sector collapsed due to padding?\n if (!(r0 > epsilon) || !(da0 > epsilon)) context.lineTo(x10, y10);\n\n // Does the sector’s inner ring (or point) have rounded corners?\n else if (rc0 > epsilon) {\n t0 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw);\n t1 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw);\n\n context.lineTo(t0.cx + t0.x01, t0.cy + t0.y01);\n\n // Have the corners merged?\n if (rc0 < rc) context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);\n\n // Otherwise, draw the two corners and the ring.\n else {\n context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r0, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), cw);\n context.arc(t1.cx, t1.cy, rc0, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);\n }\n }\n\n // Or is the inner ring just a circular arc?\n else context.arc(0, 0, r0, a10, a00, cw);\n }\n\n context.closePath();\n\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n arc.centroid = function() {\n var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2,\n a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - pi / 2;\n return [cos(a) * r, sin(a) * r];\n };\n\n arc.innerRadius = function(_) {\n return arguments.length ? (innerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : innerRadius;\n };\n\n arc.outerRadius = function(_) {\n return arguments.length ? (outerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : outerRadius;\n };\n\n arc.cornerRadius = function(_) {\n return arguments.length ? (cornerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : cornerRadius;\n };\n\n arc.padRadius = function(_) {\n return arguments.length ? (padRadius = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), arc) : padRadius;\n };\n\n arc.startAngle = function(_) {\n return arguments.length ? (startAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : startAngle;\n };\n\n arc.endAngle = function(_) {\n return arguments.length ? (endAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : endAngle;\n };\n\n arc.padAngle = function(_) {\n return arguments.length ? (padAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : padAngle;\n };\n\n arc.context = function(_) {\n return arguments.length ? ((context = _ == null ? null : _), arc) : context;\n };\n\n return arc;\n}\n","import { ITree } from \"@hpcc-js/api\";\nimport { d3Event, select as d3Select, SVGWidget } from \"@hpcc-js/common\";\nimport { hierarchy as d3Hierarchy, partition as d3Parition } from \"d3-hierarchy\";\nimport { interpolate as d3Interpolate } from \"d3-interpolate\";\nimport { scaleLinear as d3ScaleLinear, scaleSqrt as d3ScaleSqrt } from \"d3-scale\";\nimport { arc as d3Arc } from \"d3-shape\";\n\nimport \"../src/SunburstPartition.css\";\n\nexport class SunburstPartition extends SVGWidget {\n svg;\n radius;\n _xScale;\n _yScale;\n partition;\n arc;\n _resetRoot;\n\n constructor() {\n super();\n ITree.call(this);\n }\n\n data(): any;\n data(_: any): this;\n data(_?: any): any | this {\n const retVal = SVGWidget.prototype.data.apply(this, arguments);\n if (arguments.length) {\n this._resetRoot = true;\n }\n return retVal;\n }\n\n enter(_domNode, element) {\n const context = this;\n\n this.radius = Math.min(this.width(), this.height()) / 2;\n\n this._xScale = d3ScaleLinear()\n .range([0, 2 * Math.PI])\n ;\n\n this._yScale = d3ScaleSqrt()\n .range([0, this.radius])\n ;\n\n this.partition = d3Parition();\n\n this.arc = d3Arc()\n .startAngle(function (d: any) {\n return Math.max(0, Math.min(2 * Math.PI, context._xScale(d.x0)));\n })\n .endAngle(function (d: any) {\n return Math.max(0, Math.min(2 * Math.PI, context._xScale(d.x1)));\n })\n .innerRadius(function (d: any) {\n return Math.max(0, context._yScale(d.y0));\n })\n .outerRadius(function (d: any) {\n return Math.max(0, context._yScale(d.y1));\n })\n ;\n\n this.svg = element.append(\"g\");\n }\n\n update(_domNode, _element) {\n const context = this;\n\n this._palette = this._palette.switch(this.paletteID());\n if (this.useClonedPalette()) {\n this._palette = this._palette.cloneNotExists(this.paletteID() + \"_\" + this.id());\n }\n\n this.radius = Math.min(this.width(), this.height()) / 2;\n this._yScale.range([0, this.radius]);\n\n const root = d3Hierarchy(this.data())\n .sum(function (d) {\n return d.size !== undefined ? d.size : 1;\n })\n ;\n\n const paths = this.svg.selectAll(\"path\").data(this.partition(root).descendants(), function (d, i) {\n return d.data.label !== undefined ? d.data.label : i;\n });\n\n paths.enter().append(\"path\")\n .on(\"click\", function (d) { context.click(d.data, null, null); })\n .on(\"dblclick\", function (d) {\n const event = d3Event();\n if (event) {\n event.stopPropagation();\n }\n context.zoomTo(d);\n })\n .each(function () {\n const element = d3Select(this);\n element\n .append(\"title\")\n ;\n })\n .merge(paths)\n .attr(\"d\", this.arc)\n .style(\"fill\", function (d) {\n return d.data.__viz_fill ? d.data.__viz_fill : context._palette(d.data.label);\n })\n .style(\"stroke\", function (d) {\n return d.value > 16 ? \"white\" : \"none\";\n })\n .select(\"title\")\n .text(function (d) {\n return d.data.label;\n })\n ;\n\n paths.exit().remove();\n\n if (this._resetRoot) {\n this._resetRoot = false;\n this.zoomTo(root);\n }\n }\n\n zoomTo(d) {\n const context = this;\n this.svg.transition()\n .duration(750)\n .tween(\"scale\", function () {\n const xd = d3Interpolate(context._xScale.domain(), [d.x0, d.x1]);\n const yd = d3Interpolate(context._yScale.domain(), [d.y0, 1]);\n const yr = d3Interpolate(context._yScale.range(), [d.y0 ? 20 : 0, context.radius]);\n return function (t) { context._xScale.domain(xd(t)); context._yScale.domain(yd(t)).range(yr(t)); };\n })\n .selectAll(\"path\")\n .attrTween(\"d\", function (d2) { return function () { return context.arc(d2); }; });\n }\n}\nSunburstPartition.prototype._class += \" tree_SunburstPartition\";\nSunburstPartition.prototype.implements(ITree.prototype);\n\nexport interface SunburstPartition {\n _palette;\n\n // ITree ---\n click(row, column, selected): void;\n dblclick(row, column, selected): void;\n\n // Properties ---\n paletteID(): string;\n paletteID(_: string): this;\n useClonedPalette(): boolean;\n useClonedPalette(_: boolean): this;\n}\n\nSunburstPartition.prototype.publish(\"paletteID\", \"default\", \"set\", \"Color palette for this widget\", SunburstPartition.prototype._palette.switch(), { tags: [\"Basic\", \"Shared\"] });\nSunburstPartition.prototype.publish(\"useClonedPalette\", false, \"boolean\", \"Enable or disable using a cloned palette\", null, { tags: [\"Intermediate\", \"Shared\"] });\n","import { ITree } from \"@hpcc-js/api\";\nimport { HTMLWidget, Palette, PropertyExt, Utility } from \"@hpcc-js/common\";\nimport { rgb as d3rgb } from \"d3-color\";\nimport { hierarchy as d3Hierarchy, treemap as d3Treemap, treemapBinary as d3treemapBinary, treemapDice as d3treemapDice, treemapResquarify as d3treemapResquarify, treemapSlice as d3treemapSlice, treemapSliceDice as d3treemapSliceDice, treemapSquarify as d3treemapSquarify } from \"d3-hierarchy\";\n\nimport \"../src/Treemap.css\";\n\nexport class TreemapColumn extends PropertyExt {\n _owner: Treemap;\n\n constructor() {\n super();\n }\n\n owner(): Treemap;\n owner(_: Treemap): this;\n owner(_?: Treemap): Treemap | this {\n if (!arguments.length) return this._owner;\n this._owner = _;\n return this;\n }\n\n valid(): boolean {\n return !!this.column();\n }\n\n column: { (): string; (_: string): TreemapColumn; };\n}\nTreemapColumn.prototype._class += \" tree_Dendrogram.TreemapColumn\";\n\nTreemapColumn.prototype.publish(\"column\", null, \"set\", \"Field\", function (this: TreemapColumn) { return this._owner ? this._owner.columns() : []; }, { optional: true });\n\n// ===\nexport class Treemap extends HTMLWidget {\n Column;\n protected _d3Treemap;\n protected _elementDIV;\n protected _selection;\n constructor() {\n super();\n ITree.call(this);\n Utility.SimpleSelectionMixin.call(this, true);\n }\n\n private getTilingMethod() {\n switch (this.tilingMethod()) {\n case \"treemapBinary\":\n return d3treemapBinary;\n case \"treemapDice\":\n return d3treemapDice;\n case \"treemapSlice\":\n return d3treemapSlice;\n case \"treemapSliceDice\":\n return d3treemapSliceDice;\n case \"treemapResquarify\":\n return d3treemapResquarify;\n case \"treemapSquarify\":\n default:\n return d3treemapSquarify;\n }\n }\n\n treemapData() {\n if (!this.mappings().filter(mapping => mapping.valid()).length) {\n return this.data();\n }\n\n const view = this._db.aggregateView(this.mappings().map(function (mapping) { return mapping.column(); }), this.aggrType(), this.aggrColumn());\n const retVal = {\n key: \"root\",\n values: view.entries()\n };\n return formatData(retVal);\n\n function formatData(node): any {\n if (node.values instanceof Array) {\n const children = node.values.filter(function (value) {\n return !(value instanceof Array);\n }).map(function (value) {\n return formatData(value);\n });\n const retVal2: any = {\n label: node.key\n };\n if (children.length) {\n retVal2.children = children;\n } else {\n retVal2.size = 22;\n }\n return retVal2;\n }\n return {\n label: node.key,\n size: node.values.aggregate,\n origRows: node.values\n };\n }\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n this._d3Treemap = d3Treemap();\n\n this._elementDIV = element.append(\"div\");\n this._selection.widgetElement(this._elementDIV);\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n const context = this;\n\n this._palette = this._palette.switch(this.paletteID());\n if (this.useClonedPalette()) {\n this._palette = this._palette.cloneNotExists(this.paletteID() + \"_\" + this.id());\n }\n\n const root = d3Hierarchy(this.treemapData())\n .sum(this.nodeWeight)\n ;\n\n this._d3Treemap\n .size([this.width(), this.height()])\n .paddingInner(this.paddingInner())\n .paddingOuter(this.paddingOuter())\n .paddingTop(this.paddingTop())\n ;\n if ([\"treemapSquarify\", \"treemapResquarify\"].indexOf(this.tilingMethod()) !== -1) {\n this._d3Treemap.tile(this.getTilingMethod()[\"ratio\"](this.squarifyRatio()));\n } else {\n this._d3Treemap.tile(this.getTilingMethod());\n }\n this._d3Treemap(root);\n\n this._elementDIV\n .style(\"font-size\", this.fontSize_exists() ? this.fontSize() + \"px\" : null)\n .style(\"line-height\", this.fontSize_exists() ? (this.fontSize() + 2) + \"px\" : null)\n ;\n\n const node = this._elementDIV.selectAll(\".node\").data(root.descendants());\n node.enter().append(\"div\")\n .attr(\"class\", \"node\")\n .call(this._selection.enter.bind(this._selection))\n .on(\"click\", function (d) {\n if (d) {\n let columnLabel = \"\";\n context.mappings().forEach(function (mapping) {\n if (mapping.column()) {\n columnLabel = mapping.column();\n }\n });\n if (d.origRows) {\n context.click(context.rowToObj(d.origRows[0]), columnLabel, context._selection.selected(this));\n } else {\n context.click(d.data, columnLabel, context._selection.selected(this));\n }\n }\n })\n .on(\"dblclick\", function (d) {\n if (d) {\n let columnLabel = \"\";\n context.mappings().forEach(function (mapping) {\n if (mapping.column()) {\n columnLabel = mapping.column();\n }\n });\n if (d.origRows) {\n context.dblclick(context.rowToObj(d.origRows[0]), columnLabel, context._selection.selected(this));\n } else {\n context.dblclick(d.data, columnLabel, context._selection.selected(this));\n }\n }\n })\n .merge(node)\n .style(\"left\", function (d) { return (d.x0 + Math.max(0, d.x1 - d.x0) / 2) + \"px\"; })\n .style(\"top\", function (d) { return (d.y0 + Math.max(0, d.y1 - d.y0) / 2) + \"px\"; })\n .style(\"width\", function () { return 0 + \"px\"; })\n .style(\"height\", function () { return 0 + \"px\"; })\n .style(\"font-size\", function (d) { return (d.children ? context.parentFontSize() : context.leafFontSize()) + \"px\"; })\n .style(\"line-height\", function (d) { return (d.children ? context.parentFontSize() : context.leafFontSize()) + \"px\"; })\n .attr(\"title\", tooltip)\n .html(function (d) {\n if (!context.showRoot() && d.depth === 0) {\n return null;\n }\n if (d.children) {\n if (context.enableParentLabels()) {\n return context.parentWeightHTML(d);\n } else {\n return null;\n }\n } else {\n return context.leafWeightHTML(d);\n }\n })\n .style(\"background\", function (d) {\n if (!context.showRoot() && d.depth === 0) {\n this.style.color = \"transparent\";\n return \"transparent\";\n }\n const light_dark = context.brighterLeafNodes() ? \"brighter\" : \"darker\";\n let _color;\n if (context.usePaletteOnParentNodes()) {\n _color = d.children ? context._palette(d.data.label) : d3rgb(context._palette(d.parent.data.label))[light_dark](1);\n } else {\n if (d.depth > context.depthColorLimit()) {\n _color = d3rgb(d.parent.color)[light_dark](1);\n } else {\n _color = context._palette(d.data.label);\n }\n d.color = _color;\n }\n this.style.color = Palette.textColor(_color);\n return _color;\n })\n .transition().duration(this.transitionDuration())\n .style(\"pointer-events\", function (d) { return !context.showRoot() && d.depth === 0 ? \"none\" : \"all\"; })\n .style(\"opacity\", function (d) { return d.children ? 1 : null; })\n .style(\"left\", function (d) { return d.x0 + \"px\"; })\n .style(\"top\", function (d) { return d.y0 + \"px\"; })\n .style(\"width\", function (d) { return Math.max(0, d.x1 - d.x0) + \"px\"; })\n .style(\"height\", function (d) { return Math.max(0, d.y1 - d.y0) + \"px\"; })\n .each(function (d) {\n if (d.depth === 0) {\n this.style.color = !context.showRoot() ? \"transparent\" : \"\";\n this.style.borderColor = !context.showRoot() ? \"transparent\" : \"\";\n }\n })\n ;\n node.exit().transition().duration(this.transitionDuration())\n .style(\"opacity\", 0)\n .remove()\n ;\n function tooltip(d) {\n if (d.children && !context.enableParentTooltips()) {\n return null;\n }\n let retVal = d.data.label + \" (\" + d.value + \")\";\n while (d.parent && d.parent.parent) {\n retVal = d.parent.data.label + \" -> \" + retVal;\n d = d.parent;\n }\n return retVal;\n }\n }\n\n exit(domNode, element) {\n super.exit(domNode, element);\n }\n\n nodeWeight(d) {\n return d.size || 1;\n }\n\n parentWeightHTML(d) {\n return this.showParentWeight() ? `<span class=\"treemap-parent-label\">${d.data.label}</span><span class=\"treemap-parent-value\">${d.value}${this.weightSuffix()}</span>` : `<span class=\"treemap-parent-label\">${d.data.label}</span>`;\n }\n\n leafWeightHTML(d) {\n return this.showLeafWeight() ? `<span class=\"treemap-leaf-label\">${d.data.label}</span><span class=\"treemap-leaf-value\">${d.value}${this.weightSuffix()}</span>` : `<span class=\"treemap-leaf-label\">${d.data.label}</span>`;\n }\n}\nTreemap.prototype._class += \" tree_Treemap\";\nTreemap.prototype.implements(ITree.prototype);\nTreemap.prototype.mixin(Utility.SimpleSelectionMixin);\nTreemap.prototype.Column = TreemapColumn;\n\nexport interface Treemap {\n _palette;\n\n // ITree ---\n click(row, column, selected): void;\n dblclick(row, column, selected): void;\n\n // Properties ---\n paletteID(): string;\n paletteID(_: string): this;\n useClonedPalette(): boolean;\n useClonedPalette(_: boolean): this;\n mappings(): TreemapColumn[];\n mappings(_: TreemapColumn[]): this;\n aggrType(): string;\n aggrType(_: string): this;\n aggrColumn(): string;\n aggrColumn(_: string): this;\n fontSize(): number;\n fontSize(_: number): this;\n fontSize_exists(): boolean;\n paddingInner(): number;\n paddingInner(_: number): this;\n paddingOuter(): number;\n paddingOuter(_: number): this;\n paddingTop(): number;\n paddingTop(_: number): this;\n showRoot(): boolean;\n showRoot(_: boolean): this;\n parentFontSize(): number;\n parentFontSize(_: number): this;\n leafFontSize(): number;\n leafFontSize(_: number): this;\n usePaletteOnParentNodes(): boolean;\n usePaletteOnParentNodes(_: boolean): this;\n depthColorLimit(): number;\n depthColorLimit(_: number): this;\n squarifyRatio(): number;\n squarifyRatio(_: number): this;\n showParentWeight(): boolean;\n showParentWeight(_: boolean): this;\n showLeafWeight(): boolean;\n showLeafWeight(_: boolean): this;\n weightSuffix(): string;\n weightSuffix(_: string): this;\n brighterLeafNodes(): boolean;\n brighterLeafNodes(_: boolean): this;\n enableParentLabels(): boolean;\n enableParentLabels(_: boolean): this;\n enableParentTooltips(): boolean;\n enableParentTooltips(_: boolean): this;\n transitionDuration(): number[];\n transitionDuration(_: number[]): this;\n tilingMethod(): string;\n tilingMethod(_: string): this;\n}\n\nTreemap.prototype.publish(\"paletteID\", \"default\", \"set\", \"Color palette for this widget\", Treemap.prototype._palette.switch(), { tags: [\"Basic\", \"Shared\"] });\nTreemap.prototype.publish(\"useClonedPalette\", false, \"boolean\", \"Enable or disable using a cloned palette\", null, { tags: [\"Intermediate\", \"Shared\"] });\nTreemap.prototype.publish(\"mappings\", [], \"propertyArray\", \"Source Columns\", null, { autoExpand: TreemapColumn });\nTreemap.prototype.publish(\"aggrType\", null, \"set\", \"Aggregation Type\", [null, \"mean\", \"median\", \"sum\", \"min\", \"max\"], { optional: true });\nTreemap.prototype.publish(\"aggrColumn\", null, \"set\", \"Aggregation Field\", function () { return this.columns(); }, { optional: true, disable: (w) => !w.aggrType() });\nTreemap.prototype.publish(\"fontSize\", null, \"number\", \"Font Size\", null, { optional: true });\nTreemap.prototype.publish(\"paddingInner\", 18.6, \"number\", \"Pixel spacing between each sibling node\");\nTreemap.prototype.publish(\"paddingOuter\", 30, \"number\", \"Pixel padding of parent nodes\");\nTreemap.prototype.publish(\"paddingTop\", 41.4, \"number\", \"Additional top pixel padding of parent nodes\");\nTreemap.prototype.publish(\"showRoot\", false, \"boolean\", \"Show root element\");\nTreemap.prototype.publish(\"parentFontSize\", 18, \"number\", \"Parent font-size\");\nTreemap.prototype.publish(\"leafFontSize\", 16, \"number\", \"Leaf font-size\");\nTreemap.prototype.publish(\"usePaletteOnParentNodes\", false, \"boolean\", \"Assign a color from the palette to every parent node\");\nTreemap.prototype.publish(\"depthColorLimit\", 1, \"number\", \"Assign a color from the palette to node with depth lower than this value\", null, { optional: true, disable: (w) => w.usePaletteOnParentNodes() });\nTreemap.prototype.publish(\"squarifyRatio\", 1, \"number\", \"Specifies the desired aspect ratio of the generated rectangles (must be >= 1)\", null, { optional: true, disable: (w) => [\"treemapSquarify\", \"treemapResquarify\"].indexOf(w.tilingMethod()) === -1 });\nTreemap.prototype.publish(\"showParentWeight\", true, \"boolean\", \"Show weight of parent nodes\");\nTreemap.prototype.publish(\"showLeafWeight\", true, \"boolean\", \"Show weight of leaf nodes\");\nTreemap.prototype.publish(\"weightSuffix\", \"\", \"string\", \"Weight suffix (ex: 'ms')\");\nTreemap.prototype.publish(\"brighterLeafNodes\", false, \"boolean\", \"Brighter/darker leaf node color (false = darker)\");\nTreemap.prototype.publish(\"enableParentLabels\", true, \"boolean\", \"Enable parent labels\");\nTreemap.prototype.publish(\"enableParentTooltips\", true, \"boolean\", \"Enable parent tooltips\");\nTreemap.prototype.publish(\"transitionDuration\", 250, \"number\", \"Transition Duration\");\nTreemap.prototype.publish(\"tilingMethod\", \"treemapSquarify\", \"set\", \"Transition Duration\", [\"treemapBinary\", \"treemapDice\", \"treemapResquarify\", \"treemapSlice\", \"treemapSliceDice\", \"treemapSquarify\"]);\n"],"x_google_ignoreList":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,34,35,36,37],"mappings":";;;;;;IAAa,IAAW,iBACX,IAAc,UACd,IAAgB;;;ACF7B,SAASA,oBAAkB,GAAG,GAAG;CAC/B,OAAO,EAAE,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vF,QAAQ,UAAU,QAAQ,wBAAwB,IAAM,WAAW,wBAAwB,GAC3F,QAAQ,UAAU,QAAQ,sBAAsB,KAAK,UAAU,qBAAqB,GACpF,QAAQ,UAAU,QAAQ,gBAAgB,mBAAmB,OAAO,uBAAuB;CAAC;CAAiB;CAAe;CAAqB;CAAgB;CAAoB;AAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["defaultSeparation","Node","node_count","node_each","node_eachAfter","node_eachBefore","node_sum","node_sort","node_path","node_ancestors","node_descendants","node_leaves","node_links","enclose","constant","roundNode","Node","squarify","roundNode","constant","slice","dice","pi","tau","epsilon","max","max","constant"],"sources":["../src/__package__.ts","../../../node_modules/d3-hierarchy/src/cluster.js","../../../node_modules/d3-hierarchy/src/hierarchy/count.js","../../../node_modules/d3-hierarchy/src/hierarchy/each.js","../../../node_modules/d3-hierarchy/src/hierarchy/eachBefore.js","../../../node_modules/d3-hierarchy/src/hierarchy/eachAfter.js","../../../node_modules/d3-hierarchy/src/hierarchy/sum.js","../../../node_modules/d3-hierarchy/src/hierarchy/sort.js","../../../node_modules/d3-hierarchy/src/hierarchy/path.js","../../../node_modules/d3-hierarchy/src/hierarchy/ancestors.js","../../../node_modules/d3-hierarchy/src/hierarchy/descendants.js","../../../node_modules/d3-hierarchy/src/hierarchy/leaves.js","../../../node_modules/d3-hierarchy/src/hierarchy/links.js","../../../node_modules/d3-hierarchy/src/hierarchy/index.js","../../../node_modules/d3-hierarchy/src/array.js","../../../node_modules/d3-hierarchy/src/pack/enclose.js","../../../node_modules/d3-hierarchy/src/pack/siblings.js","../../../node_modules/d3-hierarchy/src/accessors.js","../../../node_modules/d3-hierarchy/src/constant.js","../../../node_modules/d3-hierarchy/src/pack/index.js","../../../node_modules/d3-hierarchy/src/treemap/round.js","../../../node_modules/d3-hierarchy/src/treemap/dice.js","../../../node_modules/d3-hierarchy/src/partition.js","../../../node_modules/d3-hierarchy/src/tree.js","../../../node_modules/d3-hierarchy/src/treemap/slice.js","../../../node_modules/d3-hierarchy/src/treemap/squarify.js","../../../node_modules/d3-hierarchy/src/treemap/index.js","../../../node_modules/d3-hierarchy/src/treemap/binary.js","../../../node_modules/d3-hierarchy/src/treemap/sliceDice.js","../../../node_modules/d3-hierarchy/src/treemap/resquarify.js","../src/CirclePacking.ts","../src/Dendrogram.ts","../src/DirectoryTree.ts","../src/Indented.ts","../../../node_modules/d3-path/src/path.js","../../../node_modules/d3-shape/src/constant.js","../../../node_modules/d3-shape/src/math.js","../../../node_modules/d3-shape/src/arc.js","../src/SunburstPartition.ts","../src/Treemap.ts"],"sourcesContent":["export const PKG_NAME = \"__PACKAGE_NAME__\";\nexport const PKG_VERSION = \"__PACKAGE_VERSION__\";\nexport const BUILD_VERSION = \"__BUILD_VERSION__\";\n","function defaultSeparation(a, b) {\n return a.parent === b.parent ? 1 : 2;\n}\n\nfunction meanX(children) {\n return children.reduce(meanXReduce, 0) / children.length;\n}\n\nfunction meanXReduce(x, c) {\n return x + c.x;\n}\n\nfunction maxY(children) {\n return 1 + children.reduce(maxYReduce, 0);\n}\n\nfunction maxYReduce(y, c) {\n return Math.max(y, c.y);\n}\n\nfunction leafLeft(node) {\n var children;\n while (children = node.children) node = children[0];\n return node;\n}\n\nfunction leafRight(node) {\n var children;\n while (children = node.children) node = children[children.length - 1];\n return node;\n}\n\nexport default function() {\n var separation = defaultSeparation,\n dx = 1,\n dy = 1,\n nodeSize = false;\n\n function cluster(root) {\n var previousNode,\n x = 0;\n\n // First walk, computing the initial x & y values.\n root.eachAfter(function(node) {\n var children = node.children;\n if (children) {\n node.x = meanX(children);\n node.y = maxY(children);\n } else {\n node.x = previousNode ? x += separation(node, previousNode) : 0;\n node.y = 0;\n previousNode = node;\n }\n });\n\n var left = leafLeft(root),\n right = leafRight(root),\n x0 = left.x - separation(left, right) / 2,\n x1 = right.x + separation(right, left) / 2;\n\n // Second walk, normalizing x & y to the desired size.\n return root.eachAfter(nodeSize ? function(node) {\n node.x = (node.x - root.x) * dx;\n node.y = (root.y - node.y) * dy;\n } : function(node) {\n node.x = (node.x - x0) / (x1 - x0) * dx;\n node.y = (1 - (root.y ? node.y / root.y : 1)) * dy;\n });\n }\n\n cluster.separation = function(x) {\n return arguments.length ? (separation = x, cluster) : separation;\n };\n\n cluster.size = function(x) {\n return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], cluster) : (nodeSize ? null : [dx, dy]);\n };\n\n cluster.nodeSize = function(x) {\n return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], cluster) : (nodeSize ? [dx, dy] : null);\n };\n\n return cluster;\n}\n","function count(node) {\n var sum = 0,\n children = node.children,\n i = children && children.length;\n if (!i) sum = 1;\n else while (--i >= 0) sum += children[i].value;\n node.value = sum;\n}\n\nexport default function() {\n return this.eachAfter(count);\n}\n","export default function(callback) {\n var node = this, current, next = [node], children, i, n;\n do {\n current = next.reverse(), next = [];\n while (node = current.pop()) {\n callback(node), children = node.children;\n if (children) for (i = 0, n = children.length; i < n; ++i) {\n next.push(children[i]);\n }\n }\n } while (next.length);\n return this;\n}\n","export default function(callback) {\n var node = this, nodes = [node], children, i;\n while (node = nodes.pop()) {\n callback(node), children = node.children;\n if (children) for (i = children.length - 1; i >= 0; --i) {\n nodes.push(children[i]);\n }\n }\n return this;\n}\n","export default function(callback) {\n var node = this, nodes = [node], next = [], children, i, n;\n while (node = nodes.pop()) {\n next.push(node), children = node.children;\n if (children) for (i = 0, n = children.length; i < n; ++i) {\n nodes.push(children[i]);\n }\n }\n while (node = next.pop()) {\n callback(node);\n }\n return this;\n}\n","export default function(value) {\n return this.eachAfter(function(node) {\n var sum = +value(node.data) || 0,\n children = node.children,\n i = children && children.length;\n while (--i >= 0) sum += children[i].value;\n node.value = sum;\n });\n}\n","export default function(compare) {\n return this.eachBefore(function(node) {\n if (node.children) {\n node.children.sort(compare);\n }\n });\n}\n","export default function(end) {\n var start = this,\n ancestor = leastCommonAncestor(start, end),\n nodes = [start];\n while (start !== ancestor) {\n start = start.parent;\n nodes.push(start);\n }\n var k = nodes.length;\n while (end !== ancestor) {\n nodes.splice(k, 0, end);\n end = end.parent;\n }\n return nodes;\n}\n\nfunction leastCommonAncestor(a, b) {\n if (a === b) return a;\n var aNodes = a.ancestors(),\n bNodes = b.ancestors(),\n c = null;\n a = aNodes.pop();\n b = bNodes.pop();\n while (a === b) {\n c = a;\n a = aNodes.pop();\n b = bNodes.pop();\n }\n return c;\n}\n","export default function() {\n var node = this, nodes = [node];\n while (node = node.parent) {\n nodes.push(node);\n }\n return nodes;\n}\n","export default function() {\n var nodes = [];\n this.each(function(node) {\n nodes.push(node);\n });\n return nodes;\n}\n","export default function() {\n var leaves = [];\n this.eachBefore(function(node) {\n if (!node.children) {\n leaves.push(node);\n }\n });\n return leaves;\n}\n","export default function() {\n var root = this, links = [];\n root.each(function(node) {\n if (node !== root) { // Don’t include the root’s parent, if any.\n links.push({source: node.parent, target: node});\n }\n });\n return links;\n}\n","import node_count from \"./count.js\";\nimport node_each from \"./each.js\";\nimport node_eachBefore from \"./eachBefore.js\";\nimport node_eachAfter from \"./eachAfter.js\";\nimport node_sum from \"./sum.js\";\nimport node_sort from \"./sort.js\";\nimport node_path from \"./path.js\";\nimport node_ancestors from \"./ancestors.js\";\nimport node_descendants from \"./descendants.js\";\nimport node_leaves from \"./leaves.js\";\nimport node_links from \"./links.js\";\n\nexport default function hierarchy(data, children) {\n var root = new Node(data),\n valued = +data.value && (root.value = data.value),\n node,\n nodes = [root],\n child,\n childs,\n i,\n n;\n\n if (children == null) children = defaultChildren;\n\n while (node = nodes.pop()) {\n if (valued) node.value = +node.data.value;\n if ((childs = children(node.data)) && (n = childs.length)) {\n node.children = new Array(n);\n for (i = n - 1; i >= 0; --i) {\n nodes.push(child = node.children[i] = new Node(childs[i]));\n child.parent = node;\n child.depth = node.depth + 1;\n }\n }\n }\n\n return root.eachBefore(computeHeight);\n}\n\nfunction node_copy() {\n return hierarchy(this).eachBefore(copyData);\n}\n\nfunction defaultChildren(d) {\n return d.children;\n}\n\nfunction copyData(node) {\n node.data = node.data.data;\n}\n\nexport function computeHeight(node) {\n var height = 0;\n do node.height = height;\n while ((node = node.parent) && (node.height < ++height));\n}\n\nexport function Node(data) {\n this.data = data;\n this.depth =\n this.height = 0;\n this.parent = null;\n}\n\nNode.prototype = hierarchy.prototype = {\n constructor: Node,\n count: node_count,\n each: node_each,\n eachAfter: node_eachAfter,\n eachBefore: node_eachBefore,\n sum: node_sum,\n sort: node_sort,\n path: node_path,\n ancestors: node_ancestors,\n descendants: node_descendants,\n leaves: node_leaves,\n links: node_links,\n copy: node_copy\n};\n","export var slice = Array.prototype.slice;\n\nexport function shuffle(array) {\n var m = array.length,\n t,\n i;\n\n while (m) {\n i = Math.random() * m-- | 0;\n t = array[m];\n array[m] = array[i];\n array[i] = t;\n }\n\n return array;\n}\n","import {shuffle, slice} from \"../array.js\";\n\nexport default function(circles) {\n var i = 0, n = (circles = shuffle(slice.call(circles))).length, B = [], p, e;\n\n while (i < n) {\n p = circles[i];\n if (e && enclosesWeak(e, p)) ++i;\n else e = encloseBasis(B = extendBasis(B, p)), i = 0;\n }\n\n return e;\n}\n\nfunction extendBasis(B, p) {\n var i, j;\n\n if (enclosesWeakAll(p, B)) return [p];\n\n // If we get here then B must have at least one element.\n for (i = 0; i < B.length; ++i) {\n if (enclosesNot(p, B[i])\n && enclosesWeakAll(encloseBasis2(B[i], p), B)) {\n return [B[i], p];\n }\n }\n\n // If we get here then B must have at least two elements.\n for (i = 0; i < B.length - 1; ++i) {\n for (j = i + 1; j < B.length; ++j) {\n if (enclosesNot(encloseBasis2(B[i], B[j]), p)\n && enclosesNot(encloseBasis2(B[i], p), B[j])\n && enclosesNot(encloseBasis2(B[j], p), B[i])\n && enclosesWeakAll(encloseBasis3(B[i], B[j], p), B)) {\n return [B[i], B[j], p];\n }\n }\n }\n\n // If we get here then something is very wrong.\n throw new Error;\n}\n\nfunction enclosesNot(a, b) {\n var dr = a.r - b.r, dx = b.x - a.x, dy = b.y - a.y;\n return dr < 0 || dr * dr < dx * dx + dy * dy;\n}\n\nfunction enclosesWeak(a, b) {\n var dr = a.r - b.r + 1e-6, dx = b.x - a.x, dy = b.y - a.y;\n return dr > 0 && dr * dr > dx * dx + dy * dy;\n}\n\nfunction enclosesWeakAll(a, B) {\n for (var i = 0; i < B.length; ++i) {\n if (!enclosesWeak(a, B[i])) {\n return false;\n }\n }\n return true;\n}\n\nfunction encloseBasis(B) {\n switch (B.length) {\n case 1: return encloseBasis1(B[0]);\n case 2: return encloseBasis2(B[0], B[1]);\n case 3: return encloseBasis3(B[0], B[1], B[2]);\n }\n}\n\nfunction encloseBasis1(a) {\n return {\n x: a.x,\n y: a.y,\n r: a.r\n };\n}\n\nfunction encloseBasis2(a, b) {\n var x1 = a.x, y1 = a.y, r1 = a.r,\n x2 = b.x, y2 = b.y, r2 = b.r,\n x21 = x2 - x1, y21 = y2 - y1, r21 = r2 - r1,\n l = Math.sqrt(x21 * x21 + y21 * y21);\n return {\n x: (x1 + x2 + x21 / l * r21) / 2,\n y: (y1 + y2 + y21 / l * r21) / 2,\n r: (l + r1 + r2) / 2\n };\n}\n\nfunction encloseBasis3(a, b, c) {\n var x1 = a.x, y1 = a.y, r1 = a.r,\n x2 = b.x, y2 = b.y, r2 = b.r,\n x3 = c.x, y3 = c.y, r3 = c.r,\n a2 = x1 - x2,\n a3 = x1 - x3,\n b2 = y1 - y2,\n b3 = y1 - y3,\n c2 = r2 - r1,\n c3 = r3 - r1,\n d1 = x1 * x1 + y1 * y1 - r1 * r1,\n d2 = d1 - x2 * x2 - y2 * y2 + r2 * r2,\n d3 = d1 - x3 * x3 - y3 * y3 + r3 * r3,\n ab = a3 * b2 - a2 * b3,\n xa = (b2 * d3 - b3 * d2) / (ab * 2) - x1,\n xb = (b3 * c2 - b2 * c3) / ab,\n ya = (a3 * d2 - a2 * d3) / (ab * 2) - y1,\n yb = (a2 * c3 - a3 * c2) / ab,\n A = xb * xb + yb * yb - 1,\n B = 2 * (r1 + xa * xb + ya * yb),\n C = xa * xa + ya * ya - r1 * r1,\n r = -(A ? (B + Math.sqrt(B * B - 4 * A * C)) / (2 * A) : C / B);\n return {\n x: x1 + xa + xb * r,\n y: y1 + ya + yb * r,\n r: r\n };\n}\n","import enclose from \"./enclose.js\";\n\nfunction place(b, a, c) {\n var dx = b.x - a.x, x, a2,\n dy = b.y - a.y, y, b2,\n d2 = dx * dx + dy * dy;\n if (d2) {\n a2 = a.r + c.r, a2 *= a2;\n b2 = b.r + c.r, b2 *= b2;\n if (a2 > b2) {\n x = (d2 + b2 - a2) / (2 * d2);\n y = Math.sqrt(Math.max(0, b2 / d2 - x * x));\n c.x = b.x - x * dx - y * dy;\n c.y = b.y - x * dy + y * dx;\n } else {\n x = (d2 + a2 - b2) / (2 * d2);\n y = Math.sqrt(Math.max(0, a2 / d2 - x * x));\n c.x = a.x + x * dx - y * dy;\n c.y = a.y + x * dy + y * dx;\n }\n } else {\n c.x = a.x + c.r;\n c.y = a.y;\n }\n}\n\nfunction intersects(a, b) {\n var dr = a.r + b.r - 1e-6, dx = b.x - a.x, dy = b.y - a.y;\n return dr > 0 && dr * dr > dx * dx + dy * dy;\n}\n\nfunction score(node) {\n var a = node._,\n b = node.next._,\n ab = a.r + b.r,\n dx = (a.x * b.r + b.x * a.r) / ab,\n dy = (a.y * b.r + b.y * a.r) / ab;\n return dx * dx + dy * dy;\n}\n\nfunction Node(circle) {\n this._ = circle;\n this.next = null;\n this.previous = null;\n}\n\nexport function packEnclose(circles) {\n if (!(n = circles.length)) return 0;\n\n var a, b, c, n, aa, ca, i, j, k, sj, sk;\n\n // Place the first circle.\n a = circles[0], a.x = 0, a.y = 0;\n if (!(n > 1)) return a.r;\n\n // Place the second circle.\n b = circles[1], a.x = -b.r, b.x = a.r, b.y = 0;\n if (!(n > 2)) return a.r + b.r;\n\n // Place the third circle.\n place(b, a, c = circles[2]);\n\n // Initialize the front-chain using the first three circles a, b and c.\n a = new Node(a), b = new Node(b), c = new Node(c);\n a.next = c.previous = b;\n b.next = a.previous = c;\n c.next = b.previous = a;\n\n // Attempt to place each remaining circle…\n pack: for (i = 3; i < n; ++i) {\n place(a._, b._, c = circles[i]), c = new Node(c);\n\n // Find the closest intersecting circle on the front-chain, if any.\n // “Closeness” is determined by linear distance along the front-chain.\n // “Ahead” or “behind” is likewise determined by linear distance.\n j = b.next, k = a.previous, sj = b._.r, sk = a._.r;\n do {\n if (sj <= sk) {\n if (intersects(j._, c._)) {\n b = j, a.next = b, b.previous = a, --i;\n continue pack;\n }\n sj += j._.r, j = j.next;\n } else {\n if (intersects(k._, c._)) {\n a = k, a.next = b, b.previous = a, --i;\n continue pack;\n }\n sk += k._.r, k = k.previous;\n }\n } while (j !== k.next);\n\n // Success! Insert the new circle c between a and b.\n c.previous = a, c.next = b, a.next = b.previous = b = c;\n\n // Compute the new closest circle pair to the centroid.\n aa = score(a);\n while ((c = c.next) !== b) {\n if ((ca = score(c)) < aa) {\n a = c, aa = ca;\n }\n }\n b = a.next;\n }\n\n // Compute the enclosing circle of the front chain.\n a = [b._], c = b; while ((c = c.next) !== b) a.push(c._); c = enclose(a);\n\n // Translate the circles to put the enclosing circle around the origin.\n for (i = 0; i < n; ++i) a = circles[i], a.x -= c.x, a.y -= c.y;\n\n return c.r;\n}\n\nexport default function(circles) {\n packEnclose(circles);\n return circles;\n}\n","export function optional(f) {\n return f == null ? null : required(f);\n}\n\nexport function required(f) {\n if (typeof f !== \"function\") throw new Error;\n return f;\n}\n","export function constantZero() {\n return 0;\n}\n\nexport default function(x) {\n return function() {\n return x;\n };\n}\n","import {packEnclose} from \"./siblings.js\";\nimport {optional} from \"../accessors.js\";\nimport constant, {constantZero} from \"../constant.js\";\n\nfunction defaultRadius(d) {\n return Math.sqrt(d.value);\n}\n\nexport default function() {\n var radius = null,\n dx = 1,\n dy = 1,\n padding = constantZero;\n\n function pack(root) {\n root.x = dx / 2, root.y = dy / 2;\n if (radius) {\n root.eachBefore(radiusLeaf(radius))\n .eachAfter(packChildren(padding, 0.5))\n .eachBefore(translateChild(1));\n } else {\n root.eachBefore(radiusLeaf(defaultRadius))\n .eachAfter(packChildren(constantZero, 1))\n .eachAfter(packChildren(padding, root.r / Math.min(dx, dy)))\n .eachBefore(translateChild(Math.min(dx, dy) / (2 * root.r)));\n }\n return root;\n }\n\n pack.radius = function(x) {\n return arguments.length ? (radius = optional(x), pack) : radius;\n };\n\n pack.size = function(x) {\n return arguments.length ? (dx = +x[0], dy = +x[1], pack) : [dx, dy];\n };\n\n pack.padding = function(x) {\n return arguments.length ? (padding = typeof x === \"function\" ? x : constant(+x), pack) : padding;\n };\n\n return pack;\n}\n\nfunction radiusLeaf(radius) {\n return function(node) {\n if (!node.children) {\n node.r = Math.max(0, +radius(node) || 0);\n }\n };\n}\n\nfunction packChildren(padding, k) {\n return function(node) {\n if (children = node.children) {\n var children,\n i,\n n = children.length,\n r = padding(node) * k || 0,\n e;\n\n if (r) for (i = 0; i < n; ++i) children[i].r += r;\n e = packEnclose(children);\n if (r) for (i = 0; i < n; ++i) children[i].r -= r;\n node.r = e + r;\n }\n };\n}\n\nfunction translateChild(k) {\n return function(node) {\n var parent = node.parent;\n node.r *= k;\n if (parent) {\n node.x = parent.x + k * node.x;\n node.y = parent.y + k * node.y;\n }\n };\n}\n","export default function(node) {\n node.x0 = Math.round(node.x0);\n node.y0 = Math.round(node.y0);\n node.x1 = Math.round(node.x1);\n node.y1 = Math.round(node.y1);\n}\n","export default function(parent, x0, y0, x1, y1) {\n var nodes = parent.children,\n node,\n i = -1,\n n = nodes.length,\n k = parent.value && (x1 - x0) / parent.value;\n\n while (++i < n) {\n node = nodes[i], node.y0 = y0, node.y1 = y1;\n node.x0 = x0, node.x1 = x0 += node.value * k;\n }\n}\n","import roundNode from \"./treemap/round.js\";\nimport treemapDice from \"./treemap/dice.js\";\n\nexport default function() {\n var dx = 1,\n dy = 1,\n padding = 0,\n round = false;\n\n function partition(root) {\n var n = root.height + 1;\n root.x0 =\n root.y0 = padding;\n root.x1 = dx;\n root.y1 = dy / n;\n root.eachBefore(positionNode(dy, n));\n if (round) root.eachBefore(roundNode);\n return root;\n }\n\n function positionNode(dy, n) {\n return function(node) {\n if (node.children) {\n treemapDice(node, node.x0, dy * (node.depth + 1) / n, node.x1, dy * (node.depth + 2) / n);\n }\n var x0 = node.x0,\n y0 = node.y0,\n x1 = node.x1 - padding,\n y1 = node.y1 - padding;\n if (x1 < x0) x0 = x1 = (x0 + x1) / 2;\n if (y1 < y0) y0 = y1 = (y0 + y1) / 2;\n node.x0 = x0;\n node.y0 = y0;\n node.x1 = x1;\n node.y1 = y1;\n };\n }\n\n partition.round = function(x) {\n return arguments.length ? (round = !!x, partition) : round;\n };\n\n partition.size = function(x) {\n return arguments.length ? (dx = +x[0], dy = +x[1], partition) : [dx, dy];\n };\n\n partition.padding = function(x) {\n return arguments.length ? (padding = +x, partition) : padding;\n };\n\n return partition;\n}\n","import {Node} from \"./hierarchy/index.js\";\n\nfunction defaultSeparation(a, b) {\n return a.parent === b.parent ? 1 : 2;\n}\n\n// function radialSeparation(a, b) {\n// return (a.parent === b.parent ? 1 : 2) / a.depth;\n// }\n\n// This function is used to traverse the left contour of a subtree (or\n// subforest). It returns the successor of v on this contour. This successor is\n// either given by the leftmost child of v or by the thread of v. The function\n// returns null if and only if v is on the highest level of its subtree.\nfunction nextLeft(v) {\n var children = v.children;\n return children ? children[0] : v.t;\n}\n\n// This function works analogously to nextLeft.\nfunction nextRight(v) {\n var children = v.children;\n return children ? children[children.length - 1] : v.t;\n}\n\n// Shifts the current subtree rooted at w+. This is done by increasing\n// prelim(w+) and mod(w+) by shift.\nfunction moveSubtree(wm, wp, shift) {\n var change = shift / (wp.i - wm.i);\n wp.c -= change;\n wp.s += shift;\n wm.c += change;\n wp.z += shift;\n wp.m += shift;\n}\n\n// All other shifts, applied to the smaller subtrees between w- and w+, are\n// performed by this function. To prepare the shifts, we have to adjust\n// change(w+), shift(w+), and change(w-).\nfunction executeShifts(v) {\n var shift = 0,\n change = 0,\n children = v.children,\n i = children.length,\n w;\n while (--i >= 0) {\n w = children[i];\n w.z += shift;\n w.m += shift;\n shift += w.s + (change += w.c);\n }\n}\n\n// If vi-’s ancestor is a sibling of v, returns vi-’s ancestor. Otherwise,\n// returns the specified (default) ancestor.\nfunction nextAncestor(vim, v, ancestor) {\n return vim.a.parent === v.parent ? vim.a : ancestor;\n}\n\nfunction TreeNode(node, i) {\n this._ = node;\n this.parent = null;\n this.children = null;\n this.A = null; // default ancestor\n this.a = this; // ancestor\n this.z = 0; // prelim\n this.m = 0; // mod\n this.c = 0; // change\n this.s = 0; // shift\n this.t = null; // thread\n this.i = i; // number\n}\n\nTreeNode.prototype = Object.create(Node.prototype);\n\nfunction treeRoot(root) {\n var tree = new TreeNode(root, 0),\n node,\n nodes = [tree],\n child,\n children,\n i,\n n;\n\n while (node = nodes.pop()) {\n if (children = node._.children) {\n node.children = new Array(n = children.length);\n for (i = n - 1; i >= 0; --i) {\n nodes.push(child = node.children[i] = new TreeNode(children[i], i));\n child.parent = node;\n }\n }\n }\n\n (tree.parent = new TreeNode(null, 0)).children = [tree];\n return tree;\n}\n\n// Node-link tree diagram using the Reingold-Tilford \"tidy\" algorithm\nexport default function() {\n var separation = defaultSeparation,\n dx = 1,\n dy = 1,\n nodeSize = null;\n\n function tree(root) {\n var t = treeRoot(root);\n\n // Compute the layout using Buchheim et al.’s algorithm.\n t.eachAfter(firstWalk), t.parent.m = -t.z;\n t.eachBefore(secondWalk);\n\n // If a fixed node size is specified, scale x and y.\n if (nodeSize) root.eachBefore(sizeNode);\n\n // If a fixed tree size is specified, scale x and y based on the extent.\n // Compute the left-most, right-most, and depth-most nodes for extents.\n else {\n var left = root,\n right = root,\n bottom = root;\n root.eachBefore(function(node) {\n if (node.x < left.x) left = node;\n if (node.x > right.x) right = node;\n if (node.depth > bottom.depth) bottom = node;\n });\n var s = left === right ? 1 : separation(left, right) / 2,\n tx = s - left.x,\n kx = dx / (right.x + s + tx),\n ky = dy / (bottom.depth || 1);\n root.eachBefore(function(node) {\n node.x = (node.x + tx) * kx;\n node.y = node.depth * ky;\n });\n }\n\n return root;\n }\n\n // Computes a preliminary x-coordinate for v. Before that, FIRST WALK is\n // applied recursively to the children of v, as well as the function\n // APPORTION. After spacing out the children by calling EXECUTE SHIFTS, the\n // node v is placed to the midpoint of its outermost children.\n function firstWalk(v) {\n var children = v.children,\n siblings = v.parent.children,\n w = v.i ? siblings[v.i - 1] : null;\n if (children) {\n executeShifts(v);\n var midpoint = (children[0].z + children[children.length - 1].z) / 2;\n if (w) {\n v.z = w.z + separation(v._, w._);\n v.m = v.z - midpoint;\n } else {\n v.z = midpoint;\n }\n } else if (w) {\n v.z = w.z + separation(v._, w._);\n }\n v.parent.A = apportion(v, w, v.parent.A || siblings[0]);\n }\n\n // Computes all real x-coordinates by summing up the modifiers recursively.\n function secondWalk(v) {\n v._.x = v.z + v.parent.m;\n v.m += v.parent.m;\n }\n\n // The core of the algorithm. Here, a new subtree is combined with the\n // previous subtrees. Threads are used to traverse the inside and outside\n // contours of the left and right subtree up to the highest common level. The\n // vertices used for the traversals are vi+, vi-, vo-, and vo+, where the\n // superscript o means outside and i means inside, the subscript - means left\n // subtree and + means right subtree. For summing up the modifiers along the\n // contour, we use respective variables si+, si-, so-, and so+. Whenever two\n // nodes of the inside contours conflict, we compute the left one of the\n // greatest uncommon ancestors using the function ANCESTOR and call MOVE\n // SUBTREE to shift the subtree and prepare the shifts of smaller subtrees.\n // Finally, we add a new thread (if necessary).\n function apportion(v, w, ancestor) {\n if (w) {\n var vip = v,\n vop = v,\n vim = w,\n vom = vip.parent.children[0],\n sip = vip.m,\n sop = vop.m,\n sim = vim.m,\n som = vom.m,\n shift;\n while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) {\n vom = nextLeft(vom);\n vop = nextRight(vop);\n vop.a = v;\n shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);\n if (shift > 0) {\n moveSubtree(nextAncestor(vim, v, ancestor), v, shift);\n sip += shift;\n sop += shift;\n }\n sim += vim.m;\n sip += vip.m;\n som += vom.m;\n sop += vop.m;\n }\n if (vim && !nextRight(vop)) {\n vop.t = vim;\n vop.m += sim - sop;\n }\n if (vip && !nextLeft(vom)) {\n vom.t = vip;\n vom.m += sip - som;\n ancestor = v;\n }\n }\n return ancestor;\n }\n\n function sizeNode(node) {\n node.x *= dx;\n node.y = node.depth * dy;\n }\n\n tree.separation = function(x) {\n return arguments.length ? (separation = x, tree) : separation;\n };\n\n tree.size = function(x) {\n return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], tree) : (nodeSize ? null : [dx, dy]);\n };\n\n tree.nodeSize = function(x) {\n return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], tree) : (nodeSize ? [dx, dy] : null);\n };\n\n return tree;\n}\n","export default function(parent, x0, y0, x1, y1) {\n var nodes = parent.children,\n node,\n i = -1,\n n = nodes.length,\n k = parent.value && (y1 - y0) / parent.value;\n\n while (++i < n) {\n node = nodes[i], node.x0 = x0, node.x1 = x1;\n node.y0 = y0, node.y1 = y0 += node.value * k;\n }\n}\n","import treemapDice from \"./dice.js\";\nimport treemapSlice from \"./slice.js\";\n\nexport var phi = (1 + Math.sqrt(5)) / 2;\n\nexport function squarifyRatio(ratio, parent, x0, y0, x1, y1) {\n var rows = [],\n nodes = parent.children,\n row,\n nodeValue,\n i0 = 0,\n i1 = 0,\n n = nodes.length,\n dx, dy,\n value = parent.value,\n sumValue,\n minValue,\n maxValue,\n newRatio,\n minRatio,\n alpha,\n beta;\n\n while (i0 < n) {\n dx = x1 - x0, dy = y1 - y0;\n\n // Find the next non-empty node.\n do sumValue = nodes[i1++].value; while (!sumValue && i1 < n);\n minValue = maxValue = sumValue;\n alpha = Math.max(dy / dx, dx / dy) / (value * ratio);\n beta = sumValue * sumValue * alpha;\n minRatio = Math.max(maxValue / beta, beta / minValue);\n\n // Keep adding nodes while the aspect ratio maintains or improves.\n for (; i1 < n; ++i1) {\n sumValue += nodeValue = nodes[i1].value;\n if (nodeValue < minValue) minValue = nodeValue;\n if (nodeValue > maxValue) maxValue = nodeValue;\n beta = sumValue * sumValue * alpha;\n newRatio = Math.max(maxValue / beta, beta / minValue);\n if (newRatio > minRatio) { sumValue -= nodeValue; break; }\n minRatio = newRatio;\n }\n\n // Position and record the row orientation.\n rows.push(row = {value: sumValue, dice: dx < dy, children: nodes.slice(i0, i1)});\n if (row.dice) treemapDice(row, x0, y0, x1, value ? y0 += dy * sumValue / value : y1);\n else treemapSlice(row, x0, y0, value ? x0 += dx * sumValue / value : x1, y1);\n value -= sumValue, i0 = i1;\n }\n\n return rows;\n}\n\nexport default (function custom(ratio) {\n\n function squarify(parent, x0, y0, x1, y1) {\n squarifyRatio(ratio, parent, x0, y0, x1, y1);\n }\n\n squarify.ratio = function(x) {\n return custom((x = +x) > 1 ? x : 1);\n };\n\n return squarify;\n})(phi);\n","import roundNode from \"./round.js\";\nimport squarify from \"./squarify.js\";\nimport {required} from \"../accessors.js\";\nimport constant, {constantZero} from \"../constant.js\";\n\nexport default function() {\n var tile = squarify,\n round = false,\n dx = 1,\n dy = 1,\n paddingStack = [0],\n paddingInner = constantZero,\n paddingTop = constantZero,\n paddingRight = constantZero,\n paddingBottom = constantZero,\n paddingLeft = constantZero;\n\n function treemap(root) {\n root.x0 =\n root.y0 = 0;\n root.x1 = dx;\n root.y1 = dy;\n root.eachBefore(positionNode);\n paddingStack = [0];\n if (round) root.eachBefore(roundNode);\n return root;\n }\n\n function positionNode(node) {\n var p = paddingStack[node.depth],\n x0 = node.x0 + p,\n y0 = node.y0 + p,\n x1 = node.x1 - p,\n y1 = node.y1 - p;\n if (x1 < x0) x0 = x1 = (x0 + x1) / 2;\n if (y1 < y0) y0 = y1 = (y0 + y1) / 2;\n node.x0 = x0;\n node.y0 = y0;\n node.x1 = x1;\n node.y1 = y1;\n if (node.children) {\n p = paddingStack[node.depth + 1] = paddingInner(node) / 2;\n x0 += paddingLeft(node) - p;\n y0 += paddingTop(node) - p;\n x1 -= paddingRight(node) - p;\n y1 -= paddingBottom(node) - p;\n if (x1 < x0) x0 = x1 = (x0 + x1) / 2;\n if (y1 < y0) y0 = y1 = (y0 + y1) / 2;\n tile(node, x0, y0, x1, y1);\n }\n }\n\n treemap.round = function(x) {\n return arguments.length ? (round = !!x, treemap) : round;\n };\n\n treemap.size = function(x) {\n return arguments.length ? (dx = +x[0], dy = +x[1], treemap) : [dx, dy];\n };\n\n treemap.tile = function(x) {\n return arguments.length ? (tile = required(x), treemap) : tile;\n };\n\n treemap.padding = function(x) {\n return arguments.length ? treemap.paddingInner(x).paddingOuter(x) : treemap.paddingInner();\n };\n\n treemap.paddingInner = function(x) {\n return arguments.length ? (paddingInner = typeof x === \"function\" ? x : constant(+x), treemap) : paddingInner;\n };\n\n treemap.paddingOuter = function(x) {\n return arguments.length ? treemap.paddingTop(x).paddingRight(x).paddingBottom(x).paddingLeft(x) : treemap.paddingTop();\n };\n\n treemap.paddingTop = function(x) {\n return arguments.length ? (paddingTop = typeof x === \"function\" ? x : constant(+x), treemap) : paddingTop;\n };\n\n treemap.paddingRight = function(x) {\n return arguments.length ? (paddingRight = typeof x === \"function\" ? x : constant(+x), treemap) : paddingRight;\n };\n\n treemap.paddingBottom = function(x) {\n return arguments.length ? (paddingBottom = typeof x === \"function\" ? x : constant(+x), treemap) : paddingBottom;\n };\n\n treemap.paddingLeft = function(x) {\n return arguments.length ? (paddingLeft = typeof x === \"function\" ? x : constant(+x), treemap) : paddingLeft;\n };\n\n return treemap;\n}\n","export default function(parent, x0, y0, x1, y1) {\n var nodes = parent.children,\n i, n = nodes.length,\n sum, sums = new Array(n + 1);\n\n for (sums[0] = sum = i = 0; i < n; ++i) {\n sums[i + 1] = sum += nodes[i].value;\n }\n\n partition(0, n, parent.value, x0, y0, x1, y1);\n\n function partition(i, j, value, x0, y0, x1, y1) {\n if (i >= j - 1) {\n var node = nodes[i];\n node.x0 = x0, node.y0 = y0;\n node.x1 = x1, node.y1 = y1;\n return;\n }\n\n var valueOffset = sums[i],\n valueTarget = (value / 2) + valueOffset,\n k = i + 1,\n hi = j - 1;\n\n while (k < hi) {\n var mid = k + hi >>> 1;\n if (sums[mid] < valueTarget) k = mid + 1;\n else hi = mid;\n }\n\n if ((valueTarget - sums[k - 1]) < (sums[k] - valueTarget) && i + 1 < k) --k;\n\n var valueLeft = sums[k] - valueOffset,\n valueRight = value - valueLeft;\n\n if ((x1 - x0) > (y1 - y0)) {\n var xk = (x0 * valueRight + x1 * valueLeft) / value;\n partition(i, k, valueLeft, x0, y0, xk, y1);\n partition(k, j, valueRight, xk, y0, x1, y1);\n } else {\n var yk = (y0 * valueRight + y1 * valueLeft) / value;\n partition(i, k, valueLeft, x0, y0, x1, yk);\n partition(k, j, valueRight, x0, yk, x1, y1);\n }\n }\n}\n","import dice from \"./dice.js\";\nimport slice from \"./slice.js\";\n\nexport default function(parent, x0, y0, x1, y1) {\n (parent.depth & 1 ? slice : dice)(parent, x0, y0, x1, y1);\n}\n","import treemapDice from \"./dice.js\";\nimport treemapSlice from \"./slice.js\";\nimport {phi, squarifyRatio} from \"./squarify.js\";\n\nexport default (function custom(ratio) {\n\n function resquarify(parent, x0, y0, x1, y1) {\n if ((rows = parent._squarify) && (rows.ratio === ratio)) {\n var rows,\n row,\n nodes,\n i,\n j = -1,\n n,\n m = rows.length,\n value = parent.value;\n\n while (++j < m) {\n row = rows[j], nodes = row.children;\n for (i = row.value = 0, n = nodes.length; i < n; ++i) row.value += nodes[i].value;\n if (row.dice) treemapDice(row, x0, y0, x1, y0 += (y1 - y0) * row.value / value);\n else treemapSlice(row, x0, y0, x0 += (x1 - x0) * row.value / value, y1);\n value -= row.value;\n }\n } else {\n parent._squarify = rows = squarifyRatio(ratio, parent, x0, y0, x1, y1);\n rows.ratio = ratio;\n }\n }\n\n resquarify.ratio = function(x) {\n return custom((x = +x) > 1 ? x : 1);\n };\n\n return resquarify;\n})(phi);\n","import { ITree } from \"@hpcc-js/api\";\nimport { d3Event, SVGWidget } from \"@hpcc-js/common\";\nimport { rgb as d3Rgb } from \"d3-color\";\nimport { hierarchy as d3Hierarchy, pack as d3Pack } from \"d3-hierarchy\";\nimport { interpolateZoom as d3InterpolateZoom } from \"d3-interpolate\";\nimport \"d3-transition\";\n\nimport \"../src/CirclePacking.css\";\n\nexport class CirclePacking extends SVGWidget {\n diameter;\n pack;\n svg;\n _focus;\n circle;\n view;\n protected _node;\n\n constructor() {\n super();\n ITree.call(this);\n }\n\n enter(_domNode, element) {\n this.diameter = Math.min(this.width(), this.height());\n\n this.pack = d3Pack()\n .size([this.diameter - 4, this.diameter - 4])\n .padding(1.5)\n ;\n\n this.svg = element\n .append(\"g\")\n ;\n }\n\n update(_domNode, _element) {\n const context = this;\n\n this.diameter = Math.min(this.width(), this.height());\n this.pack\n .size([this.diameter - 4, this.diameter - 4])\n .padding(1.5)\n ;\n\n this._palette = this._palette.switch(this.paletteID());\n if (this.useClonedPalette()) {\n this._palette = this._palette.cloneNotExists(this.paletteID() + \"_\" + this.id());\n }\n\n this.svg.selectAll(\"circle\").remove();\n this.svg.selectAll(\"text\").remove();\n\n const root: any = d3Hierarchy(this.data())\n .sum(function (d) {\n return d && d.size ? d.size : 1;\n }).sort(function (a, b) {\n return a.value < b.value ? -1 : a.value > b.value ? 1 : 0;\n })\n ;\n this._focus = root;\n this.pack(root);\n\n this.circle = this.svg.selectAll(\"circle\").data(root.descendants())\n .enter().append(\"circle\")\n .attr(\"class\", function (d) { return d.parent ? d.children ? \"node\" : \"node leaf\" : \"node root\"; })\n .style(\"fill\", function (d) {\n d.color = context.paletteDepthLevel_exists() && d.depth > context.paletteDepthLevel() ? d3Rgb(d.parent.color)[context.paletteDepthVariant()](1) : context._palette(d.data.label);\n return d.color;\n })\n .on(\"click\", function (d) { context.click(d.data, null, null); })\n .on(\"dblclick\", function (d) {\n if (this._focus !== d) {\n context.zoom(d);\n }\n d3Event().stopPropagation();\n })\n ;\n this.circle.append(\"title\").text(function (d) { return d.data.label; });\n\n this.svg.selectAll(\"text\").data(root.descendants())\n .enter().append(\"text\")\n .attr(\"class\", \"label\")\n .style(\"fill-opacity\", function (d) { return d.parent === root ? 1 : 0; })\n .style(\"display\", function (d) { return d.parent === root ? null : \"none\"; })\n .text(function (d) {\n return d.data.label + (context.showSize() && typeof d.data.size !== \"undefined\" ? \" \" + d.data.size : \"\");\n })\n ;\n\n this._node = this.svg.selectAll(\"circle,text\");\n\n this.zoomTo([root.x, root.y, root.r * 2]);\n }\n\n zoom(newFocus) {\n this._focus = newFocus;\n const context = this;\n const transition = this.svg.transition()\n .duration(d3Event().altKey ? 7500 : 750)\n .tween(\"zoom\", function () {\n const i = d3InterpolateZoom(context.view, [context._focus.x, context._focus.y, context._focus.r * 2]);\n return function (t) { context.zoomTo(i(t)); };\n });\n\n function showText(d) {\n return (d === context._focus && !d.children) || d.parent === context._focus;\n }\n\n transition.selectAll(\"text\")\n .filter(function (d) { return showText(d) || this.style.display === \"inline\"; })\n .style(\"fill-opacity\", function (d) { return showText(d) ? 1 : 0; })\n .on(\"start\", function (d) { if (showText(d)) this.style.display = \"inline\"; })\n .on(\"end\", function (d) { if (!showText(d)) this.style.display = \"none\"; });\n }\n\n zoomTo(v) {\n const k = this.diameter / v[2];\n this.view = v;\n this._node.attr(\"transform\", function (d) { return \"translate(\" + (d.x - v[0]) * k + \",\" + (d.y - v[1]) * k + \")\"; });\n this.circle.attr(\"r\", function (d) { return d.r * k; });\n }\n}\nCirclePacking.prototype._class += \" tree_CirclePacking\";\nCirclePacking.prototype.implements(ITree.prototype);\n\nexport interface CirclePacking {\n _palette;\n\n // I2DChart ---\n click(row, column, selected): void;\n dblclick(row, column, selected): void;\n\n // Properties ---\n showSize(): boolean;\n showSize(_: boolean): this;\n paletteDepthLevel(): number;\n paletteDepthLevel(_: number): this;\n paletteDepthLevel_exists(): boolean;\n paletteDepthVariant(): \"brighter\" | \"darker\";\n paletteDepthVariant(_: \"brighter\" | \"darker\"): this;\n paletteID(): string;\n paletteID(_: string): this;\n useClonedPalette(): boolean;\n useClonedPalette(_: boolean): this;\n}\n\nCirclePacking.prototype.publish(\"showSize\", true, \"boolean\", \"Show size along with label\");\nCirclePacking.prototype.publish(\"paletteDepthLevel\", null, \"number\", \"If not null then beyond this depth number the child node colors are based on parent\", null, { optional: true });\nCirclePacking.prototype.publish(\"paletteDepthVariant\", \"brighter\", \"set\", \"Determines paletteDepthLevel decendant color shade variant\", [\"brighter\", \"darker\"], { disable: w => w.paletteDepthLevel_exists() });\nCirclePacking.prototype.publish(\"paletteID\", \"default\", \"set\", \"Color palette for this widget\", CirclePacking.prototype._palette.switch(), { tags: [\"Basic\", \"Shared\"] });\nCirclePacking.prototype.publish(\"useClonedPalette\", false, \"boolean\", \"Enable or disable using a cloned palette\", null, { tags: [\"Intermediate\", \"Shared\"] });\n","import { ITree } from \"@hpcc-js/api\";\nimport { PropertyExt, SVGZoomWidget, Utility } from \"@hpcc-js/common\";\nimport { cluster as d3Cluster, hierarchy as d3Hierarchy, tree as d3Tree } from \"d3-hierarchy\";\nimport { select as d3Select } from \"d3-selection\";\n\nimport \"../src/Dendrogram.css\";\n\nexport class DendrogramColumn extends PropertyExt {\n _owner: Dendrogram;\n\n constructor() {\n super();\n }\n\n owner(): Dendrogram;\n owner(_: Dendrogram): this;\n owner(_?: Dendrogram): Dendrogram | this {\n if (!arguments.length) return this._owner;\n this._owner = _;\n return this;\n }\n valid(): boolean {\n return !!this.column();\n }\n\n column: { (): string; (_: string): Dendrogram; };\n}\nDendrogramColumn.prototype._class += \" tree_Dendrogram.DendrogramColumn\";\n\nDendrogramColumn.prototype.publish(\"column\", null, \"set\", \"Field\", function (this: DendrogramColumn) { return this._owner ? this._owner.columns() : []; }, { optional: true });\n\n// ===\nexport class Dendrogram extends SVGZoomWidget {\n Column;\n _d3LayoutCluster;\n _d3LayoutTree;\n _d3Layout;\n\n constructor() {\n super();\n ITree.call(this);\n Utility.SimpleSelectionMixin.call(this);\n\n this._drawStartPos = \"origin\";\n\n this._d3LayoutCluster = d3Cluster();\n this._d3LayoutTree = d3Tree();\n }\n\n dendrogramData() {\n if (this.data().length === 0) return [];\n if (!this.mappings().filter(mapping => mapping.valid()).length) {\n return this.data();\n }\n const view = this._db.rollupView(this.mappings().map(function (mapping) { return mapping.column(); }));\n const retVal = {\n key: \"root\",\n values: view.entries()\n };\n return formatData(retVal);\n\n function formatData(node) {\n return {\n label: node.key,\n children: node.values.filter(function (value) { return !(value instanceof Array); }).map(function (value) { return formatData(value); }),\n origRows: node.values\n };\n }\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n this._renderElement\n .attr(\"opacity\", 0)\n .transition().duration(500)\n .attr(\"opacity\", 1)\n ;\n this._selection.widgetElement(this._renderElement);\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n const context = this;\n const isVertical = this.orientation() === \"vertical\";\n\n this._palette = this._palette.switch(this.paletteID());\n if (this.useClonedPalette()) {\n this._palette = this._palette.cloneNotExists(this.paletteID() + \"_\" + this.id());\n }\n\n this._d3Layout = this.dendrogram() ? this._d3LayoutCluster : this._d3LayoutTree;\n\n if (this.radial()) {\n this._d3Layout\n .size([360, this.separation() * 2])\n ;\n this._d3Layout.separation(function separation(a, b) {\n return (a.parent === b.parent ? 1 : 2) / a.depth;\n });\n } else {\n this._d3Layout.nodeSize([14, this.separation()]);\n this._d3Layout.separation(function separation(a, b) {\n return a.parent === b.parent ? 1 : 2;\n });\n }\n\n const data = this.dendrogramData();\n const root = d3Hierarchy(data);\n this._d3Layout(root);\n\n const dataNodes = root.descendants();\n const links = root.descendants().slice(1);\n\n // Lines ---\n function linkVertical(d) {\n return \"M\" + d.parent.x + \",\" + d.parent.y\n + \"C\" + d.parent.x + \",\" + (d.parent.y + d.y) / 2\n + \" \" + d.x + \",\" + (d.parent.y + d.y) / 2\n + \" \" + d.x + \",\" + d.y;\n }\n\n function linkHorizontal(d) {\n return \"M\" + d.y + \",\" + d.x\n + \"C\" + (d.y + d.parent.y) / 2 + \",\" + d.x\n + \" \" + (d.y + d.parent.y) / 2 + \",\" + d.parent.x\n + \" \" + d.parent.y + \",\" + d.parent.x;\n }\n function diagonal(d) {\n return isVertical ? linkVertical(d) : linkHorizontal(d);\n }\n\n function project(x, y) {\n const angle = (x - 90) / 180 * Math.PI;\n const radius = y;\n return [radius * Math.cos(angle), radius * Math.sin(angle)];\n }\n\n function radialDiagonal(d) {\n return \"M\" + project(d.x, d.y)\n + \"C\" + project(d.x, (d.y + d.parent.y) / 2)\n + \" \" + project(d.parent.x, (d.y + d.parent.y) / 2)\n + \" \" + project(d.parent.x, d.parent.y);\n }\n\n const transitionDuration = this._renderCount ? 500 : 0;\n const lines = this._renderElement.selectAll(\".link\").data(links);\n lines.enter().append(\"path\")\n .attr(\"class\", \"link\")\n .attr(\"d\", this.radial() ? radialDiagonal : diagonal)\n ;\n lines.transition().duration(transitionDuration)\n .attr(\"d\", this.radial() ? radialDiagonal : diagonal)\n ;\n lines.exit().remove();\n\n // Nodes ---\n const textOffsetX = this.circleRadius() + 2;\n function nodeTransform(d) {\n if (context.radial()) {\n return \"rotate(\" + (d.x - 90) + \")translate(\" + d.y + \")\";\n }\n return context.orientation() === \"horizontal\" ? \"translate(\" + d.y + \",\" + d.x + \")\" : \"translate(\" + d.x + \",\" + d.y + \")\";\n }\n const nodes = this._renderElement.selectAll(\".node\").data(dataNodes);\n nodes.transition().duration(transitionDuration)\n .attr(\"transform\", nodeTransform)\n ;\n const enterNodes = nodes.enter().append(\"g\")\n .attr(\"class\", \"node\")\n .attr(\"transform\", nodeTransform)\n .call(this._selection.enter.bind(this._selection))\n .on(\"click\", function (d) {\n let tmp = d;\n while (tmp.children) {\n tmp = tmp.children[0];\n }\n if (d.depth > 0) {\n if (tmp.origRows) {\n context.click(context.rowToObj(tmp.origRows[0]), context.mappings()[d.depth - 1].column(), true);\n } else {\n context.click(tmp.data, context.mappings()[d.depth - 1].column(), true);\n }\n }\n })\n .on(\"dblclick\", function (d) {\n let tmp = d;\n while (tmp.children) {\n tmp = tmp.children[0];\n }\n if (d.depth > 0) {\n if (tmp.origRows) {\n context.dblclick(context.rowToObj(tmp.origRows[0]), context.mappings()[d.depth - 1].column(), true);\n } else {\n context.dblclick(tmp.data, context.mappings()[d.depth - 1].column(), true);\n }\n }\n })\n .each(function () {\n const e = d3Select(this);\n e.append(\"circle\");\n e.append(\"text\");\n })\n ;\n enterNodes.merge(nodes).select(\"circle\")\n .attr(\"r\", this.circleRadius())\n .style(\"fill\", function (d) { return context._palette(d.data.label); })\n .append(\"title\")\n .text(function (d) { return d.data.label; })\n ;\n enterNodes.merge(nodes).select(\"text\")\n .attr(\"dx\", function (d) {\n if (context.radial()) {\n if (d.children) {\n return d.x < 180 ? -textOffsetX : textOffsetX;\n } else {\n return d.x < 180 ? textOffsetX : -textOffsetX;\n }\n } else if (isVertical) {\n return d.children ? textOffsetX : -textOffsetX;\n }\n return d.children ? -textOffsetX : textOffsetX;\n })\n .attr(\"dy\", \"0.25em\")\n .style(\"text-anchor\", function (d) {\n if (context.radial()) {\n if (d.children) {\n return d.x < 180 ? \"end\" : \"start\";\n } else {\n return d.x < 180 ? \"start\" : \"end\";\n }\n } else if (isVertical) {\n return d.children ? \"start\" : \"end\";\n }\n return d.children ? \"end\" : \"start\";\n })\n .attr(\"transform\", function (d) {\n if (context.radial()) {\n return d.x < 180 ? null : \"rotate(180)\";\n } else if (isVertical) {\n return \"rotate(-66)\";\n }\n return null;\n })\n .text(function (d) { return d.data.label; })\n ;\n nodes.exit().remove();\n\n if (!this._renderCount) {\n context.zoomToFit();\n }\n }\n}\nDendrogram.prototype._class += \" tree_Dendrogram\";\nDendrogram.prototype.implements(ITree.prototype);\nDendrogram.prototype.mixin(Utility.SimpleSelectionMixin);\nDendrogram.prototype.Column = DendrogramColumn;\n\nexport interface Dendrogram {\n _palette;\n\n // ITree ---\n click(row, column, selected): void;\n dblclick(row, column, selected): void;\n\n // SimpleSelectionMixin ---\n _selection;\n\n // Properties ---\n paletteID(): string;\n paletteID(_: string): this;\n useClonedPalette(): boolean;\n useClonedPalette(_: boolean): this;\n mappings(): DendrogramColumn[];\n mappings(_: DendrogramColumn[]): this;\n\n circleRadius(): number;\n circleRadius(_: number): this;\n separation(): number;\n separation(_: number): this;\n dendrogram(): boolean;\n dendrogram(_: boolean): this;\n radial(): boolean;\n radial(_: boolean): this;\n orientation(): \"horizontal\" | \"vertical\";\n orientation(_: \"horizontal\" | \"vertical\"): this;\n}\n\nDendrogram.prototype.publish(\"paletteID\", \"default\", \"set\", \"Color palette for this widget\", Dendrogram.prototype._palette.switch(), { tags: [\"Basic\", \"Shared\"] });\nDendrogram.prototype.publish(\"useClonedPalette\", false, \"boolean\", \"Enable or disable using a cloned palette\", null, { tags: [\"Intermediate\", \"Shared\"] });\nDendrogram.prototype.publish(\"mappings\", [], \"propertyArray\", \"Source Columns\", null, { autoExpand: DendrogramColumn });\n\nDendrogram.prototype.publish(\"circleRadius\", 4.5, \"number\", \"Text offset from circle\");\nDendrogram.prototype.publish(\"separation\", 240, \"number\", \"Leaf Separation\");\nDendrogram.prototype.publish(\"dendrogram\", true, \"boolean\", \"Dendrogram\");\nDendrogram.prototype.publish(\"radial\", false, \"boolean\", \"Radial\");\nDendrogram.prototype.publish(\"orientation\", \"horizontal\", \"set\", \"Orientation\", [\"horizontal\", \"vertical\"], { tags: [\"Private\"], disable: w => w.radial() });\n","import { HTMLWidget, Palette, Platform, select as d3Select, Utility, } from \"@hpcc-js/common\";\nimport { max as d3Max } from \"d3-array\";\nimport { hierarchy as d3Hierarchy } from \"d3-hierarchy\";\n\ninterface DirectoryItem {\n color?: string;\n iconClass?: string;\n label: string;\n depth: number;\n content?: string;\n markers?: any;\n isFolder: boolean;\n bold?: boolean;\n selected?: boolean;\n weightValue?: string;\n weightColor?: string;\n}\n\nexport class DirectoryTree extends HTMLWidget {\n\n constructor() {\n super();\n }\n\n flattenData(json): DirectoryItem[] {\n const context = this;\n const root = d3Hierarchy(json);\n const ret = [];\n\n if (!this.omitRoot()) {\n visitNode(root);\n } else if (root.children) {\n root.children.forEach(visitNode);\n }\n\n return ret;\n\n function visitNode(node) {\n const weightValue = node.data.markers && node.data.markers.length ? node.data.markers.length : \"\";\n ret.push({\n label: node.data.label,\n depth: node.depth - (context.omitRoot() ? 1 : 0),\n content: node.data.content,\n isFolder: !!node.data.children,\n iconClass: node.data.iconClass,\n color: node.data.color,\n bold: node.data.bold,\n weightValue,\n markers: node.data.markers,\n selected: node.data.selected\n });\n if (node.children) {\n node.children.forEach(visitNode);\n }\n }\n }\n\n protected iconClass(d) {\n if (d.label === \"error\") {\n return \"fa fa-exclamation\";\n }\n if (d.isFolder) {\n return this.folderIconOpen();\n }\n return this.textFileIcon();\n }\n\n protected calcRequiredWidth() {\n const flatData = this.flattenData(this.data());\n\n let widest = 0;\n\n const padding = this.rowItemPadding();\n const iconWidth = this.iconSize() + (padding * 2);\n const scrollbarWidth = Platform.getScrollbarWidth();\n\n flatData.forEach(row => {\n const offsetWidth = (row.depth * iconWidth) + (padding * 2);\n const textWidth = Utility.textSize(\n row.label,\n this.fontFamily(),\n this.fontSize(),\n !!row.bold\n ).width + (padding * 2);\n const totalWidth = textWidth + iconWidth + offsetWidth + scrollbarWidth;\n if (widest < totalWidth) {\n widest = totalWidth;\n }\n });\n return widest;\n }\n\n rowClick(str, markers) { }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n element\n .style(\"width\", \"100%\")\n .style(\"height\", \"100%\")\n ;\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n\n this._palette = this._palette.switch(this.paletteID());\n\n element\n .style(\"overflow-y\", this.verticalScroll() ? \"scroll\" : null)\n ;\n const flatData = this.flattenData(this.data());\n const maxWeightValue = d3Max(flatData, n => Number(n.weightValue));\n\n flatData.forEach(d => {\n if (!d.weightValue) {\n d.weightColor = \"transparent\";\n } else {\n d.weightColor = this._palette(d.weightValue, 1, maxWeightValue);\n }\n });\n const context = this;\n const padding = this.rowItemPadding();\n const iconWidth = this.iconSize() + padding;\n const lineHeight = Math.max(context.iconSize(), context.fontSize());\n const rowSelection = element.selectAll(\".directory-row\").data(flatData);\n const fontFamily = this.fontFamily();\n const fontSize = this.fontSize();\n const maxWeightWidth = d3Max(flatData, d => this.textSize(d.weightValue, fontFamily, fontSize).width);\n const rowItemPadding = `${padding}px ${padding}px ${padding / 2}px ${padding}px`;\n\n const rowEnter = rowSelection.enter().append(\"div\")\n .attr(\"class\", d => `directory-row directory-row-depth-${d.depth}`)\n .style(\"display\", \"flex\")\n .style(\"cursor\", \"pointer\")\n .each(function (d: DirectoryItem) {\n const rowDiv = d3Select(this);\n\n const fontColor = d.color ? d.color : context.fontColor();\n const weightColor = d.weightColor ? d.weightColor : \"transparent\";\n const weightFontColor = Palette.textColor(weightColor);\n\n const weightDiv = rowDiv.append(\"div\")\n .attr(\"class\", \"row-weight\")\n .style(\"padding\", rowItemPadding)\n .style(\"color\", weightFontColor)\n .style(\"box-shadow\", `inset 0 0 100px ${weightColor}`)\n .style(\"font-weight\", d.bold ? \"bold\" : \"normal\")\n .style(\"font-family\", fontFamily)\n .style(\"font-size\", fontSize + \"px\")\n .text(d.weightValue)\n .attr(\"title\", d.weightValue)\n .style(\"overflow\", \"hidden\")\n .style(\"width\", (maxWeightWidth + (padding * 2)) + \"px\")\n .style(\"text-overflow\", \"ellipsis\")\n .style(\"text-align\", \"right\")\n .style(\"line-height\", lineHeight + \"px\")\n ;\n rowDiv.append(\"div\")\n .attr(\"class\", \"row-depth\")\n .style(\"width\", (context.depthSize() * d.depth) + \"px\")\n .style(\"opacity\", 1)\n .style(\"line-height\", lineHeight + \"px\")\n ;\n const iconDiv = rowDiv.append(\"div\")\n .attr(\"class\", \"row-icon \" + (d.iconClass ? d.iconClass : context.iconClass(d)))\n .style(\"width\", iconWidth + \"px\")\n .style(\"height\", lineHeight + \"px\")\n .style(\"color\", fontColor)\n .style(\"background-color\", d.selected ? context.selectionBackgroundColor() : \"transparent\")\n .style(\"font-size\", context.iconSize() + \"px\")\n .style(\"padding\", rowItemPadding)\n .style(\"line-height\", lineHeight + \"px\")\n ;\n const labelDiv = rowDiv.append(\"div\")\n .attr(\"class\", \"row-label\")\n .style(\"padding\", rowItemPadding)\n .style(\"color\", fontColor)\n .style(\"background-color\", d.selected ? context.selectionBackgroundColor() : \"transparent\")\n .style(\"font-weight\", d.bold ? \"bold\" : \"normal\")\n .style(\"font-family\", context.fontFamily())\n .style(\"font-size\", context.fontSize() + \"px\")\n .text(d.label)\n .attr(\"title\", d.label)\n .style(\"flex\", 1)\n .style(\"overflow\", \"hidden\")\n .style(\"text-overflow\", \"ellipsis\")\n .style(\"line-height\", lineHeight + \"px\")\n ;\n\n rowDiv\n .on(\"mouseenter\", () => {\n labelDiv.style(\"font-weight\", \"bold\");\n })\n .on(\"mouseleave\", () => {\n labelDiv.style(\"font-weight\", d.bold ? \"bold\" : \"normal\");\n })\n ;\n weightDiv\n .on(\"mouseenter\", () => {\n context.weight_mouseenter(d);\n })\n .on(\"mouseleave\", () => {\n context.weight_mouseleave(d);\n })\n ;\n\n if (d.isFolder) {\n rowDiv.on(\"click\", function (d: any) {\n let next = this.nextSibling;\n const wasClosed = rowDiv.classed(\"folder-closed\");\n if (wasClosed) {\n rowDiv.classed(\"folder-closed\", false);\n rowDiv.classed(\"folder-open\", true);\n iconDiv.attr(\"class\", \"row-icon \" + context.folderIconOpen());\n } else {\n rowDiv.classed(\"folder-closed\", true);\n rowDiv.classed(\"folder-open\", false);\n iconDiv.attr(\"class\", \"row-icon \" + context.folderIconClosed());\n }\n while (next !== null) {\n const nextDepth = (d3Select(next).datum() as any).depth;\n if (nextDepth > d.depth) {\n next.style.display = wasClosed ? \"flex\" : \"none\";\n next = next.nextSibling;\n } else {\n next = null;\n }\n }\n });\n } else {\n rowDiv.on(\"click\", () => {\n element.selectAll(\".row-label\").style(\"background-color\", \"transparent\");\n element.selectAll(\".row-icon\").style(\"background-color\", \"transparent\");\n iconDiv.style(\"background-color\", context.selectionBackgroundColor());\n labelDiv.style(\"background-color\", context.selectionBackgroundColor());\n const ext = d.label.split(\".\").pop().toLowerCase();\n context.rowClick(ext === \"json\" ? JSON.stringify(JSON.parse(d.content), null, 4) : d.content, d.markers);\n });\n }\n })\n ;\n\n rowEnter\n .merge(rowSelection)\n .style(\"background-color\", context.backgroundColor())\n ;\n\n rowSelection.exit().remove();\n }\n weight_mouseenter(d) {\n\n }\n weight_mouseleave(d) {\n\n }\n}\nDirectoryTree.prototype._class += \" tree_DirectoryTree\";\nDirectoryTree.prototype._palette = Palette.rainbow(\"Blues\");\n\nexport interface DirectoryTree {\n _palette;\n\n depthSize(): number;\n depthSize(_: number): this;\n paletteID(): string;\n paletteID(_: string): this;\n omitRoot(): boolean;\n omitRoot(_: boolean): this;\n rowItemPadding(): number;\n rowItemPadding(_: number): this;\n selectionBackgroundColor(): string;\n selectionBackgroundColor(_: string): this;\n backgroundColor(): string;\n backgroundColor(_: string): this;\n fontColor(): string;\n fontColor(_: string): this;\n fontFamily(): string;\n fontFamily(_: string): this;\n fontSize(): number;\n fontSize(_: number): this;\n iconSize(): number;\n iconSize(_: number): this;\n folderIconOpen(): string;\n folderIconOpen(_: string): this;\n folderIconClosed(): string;\n folderIconClosed(_: string): this;\n textFileIcon(): string;\n textFileIcon(_: string): this;\n verticalScroll(): boolean;\n verticalScroll(_: boolean): this;\n}\n\nDirectoryTree.prototype.publish(\"depthSize\", 14, \"number\", \"Width of indentation per file or folder depth (pixels)\");\nDirectoryTree.prototype.publish(\"paletteID\", \"Blues\", \"set\", \"Color palette for the weight backgrounds\", DirectoryTree.prototype._palette.switch(), { tags: [\"Basic\"] });\nDirectoryTree.prototype.publish(\"omitRoot\", false, \"boolean\", \"If true, root node will not display\");\nDirectoryTree.prototype.publish(\"rowItemPadding\", 2, \"number\", \"Top, bottom, left and right row item padding\");\nDirectoryTree.prototype.publish(\"selectionBackgroundColor\", \"#CCC\", \"html-color\", \"Background color of selected directory rows\");\nDirectoryTree.prototype.publish(\"backgroundColor\", \"#FFF\", \"html-color\", \"Directory item background color\");\nDirectoryTree.prototype.publish(\"fontColor\", \"#000\", \"html-color\", \"Directory item font color\");\nDirectoryTree.prototype.publish(\"fontFamily\", \"Arial\", \"string\", \"Directory item font family\");\nDirectoryTree.prototype.publish(\"fontSize\", 12, \"number\", \"Directory item font size (pixels)\");\nDirectoryTree.prototype.publish(\"iconSize\", 12, \"number\", \"Directory folder and file icon size (pixels)\");\nDirectoryTree.prototype.publish(\"folderIconOpen\", \"fa fa-folder-open\", \"string\", \"Open folder icon class\");\nDirectoryTree.prototype.publish(\"folderIconClosed\", \"fa fa-folder\", \"string\", \"Closed folder icon class\");\nDirectoryTree.prototype.publish(\"textFileIcon\", \"fa fa-file-text-o\", \"string\", \"Text file icon class\");\nDirectoryTree.prototype.publish(\"verticalScroll\", true, \"boolean\", \"If true, vertical scroll bar will be shown\");\n","import { ITree } from \"@hpcc-js/api\";\nimport { PropertyExt, SVGZoomWidget, Utility } from \"@hpcc-js/common\";\nimport { hierarchy as d3Hierarchy, tree as d3Tree } from \"d3-hierarchy\";\nimport { select as d3Select } from \"d3-selection\";\n\nimport \"../src/Indented.css\";\n\nexport class IndentedColumn extends PropertyExt {\n _owner: Indented;\n\n constructor() {\n super();\n }\n\n owner(): Indented;\n owner(_: Indented): this;\n owner(_?: Indented): Indented | this {\n if (!arguments.length) return this._owner;\n this._owner = _;\n return this;\n }\n valid(): boolean {\n return !!this.column();\n }\n\n column: (_?: string) => string | IndentedColumn;\n}\nIndentedColumn.prototype._class += \" tree_Dendrogram.IndentedColumn\";\n\nIndentedColumn.prototype.publish(\"column\", null, \"set\", \"Field\", function (this: IndentedColumn) { return this._owner ? this._owner.columns() : []; }, { optional: true });\n\n// ===\nexport class Indented extends SVGZoomWidget {\n Column;\n _d3Tree;\n _xml;\n _svgLinks;\n _svgNodes;\n _treeData;\n _collapsed: { [key: string]: boolean } = {};\n\n constructor() {\n super();\n ITree.call(this);\n Utility.SimpleSelectionMixin.call(this);\n\n this._drawStartPos = \"origin\";\n\n this._d3Tree = d3Tree();\n }\n\n xmlToData(xml, id = \"\") {\n if (DOMParser) {\n const parser = new DOMParser();\n const doc = parser.parseFromString(xml, \"text/xml\");\n return xmlToJson(doc, id).children[0];\n }\n return [];\n }\n\n xml(_) {\n if (!arguments.length) return this._xml;\n this._xml = _;\n this.data(this.xmlToData(this._xml));\n return this;\n }\n\n IndentedData() {\n if (this.data().length === 0) return [];\n if (this.xmlColumn_exists()) {\n const cellIdx = this.columns().indexOf(this.xmlColumn());\n const retVal = {\n label: this.xmlColumn(),\n children: this.data().map(function (row, idx) {\n return this.xmlToData(row[cellIdx], \"[\" + idx + \"]\");\n }, this)\n };\n return retVal.children.length === 1 ? retVal.children[0] : retVal;\n } else {\n if (!this.mappings().filter(mapping => mapping.valid()).length) {\n return this.data();\n }\n const view = this._db.rollupView(this.mappings().map(function (mapping) { return mapping.column(); }));\n const root = {\n key: \"root\",\n values: view.entries()\n };\n return formatData(root);\n }\n\n function formatData(node): any {\n if (node.values instanceof Array) {\n const children = node.values.filter(function (value) {\n return !(value instanceof Array);\n }).map(function (value) {\n return formatData(value);\n });\n const retVal: any = {\n label: node.key\n };\n if (children.length) {\n retVal.children = children;\n } else {\n retVal.size = 22;\n }\n return retVal;\n }\n return {\n label: node.key,\n size: node.values.aggregate,\n origRows: node.values\n };\n }\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n this._svgLinks = this._renderElement.append(\"g\");\n this._svgNodes = this._renderElement.append(\"g\");\n this._selection.widgetElement(this._svgNodes);\n }\n\n protected _prevDataChecksum;\n update(domNode, _element) {\n super.update(domNode, _element);\n const context = this;\n\n this._d3Tree\n .nodeSize([0, this.barHeight()])\n ;\n const dataChecksum = this._db.dataChecksum();\n if (this._prevDataChecksum !== dataChecksum) {\n this._treeData = this.IndentedData();\n this._prevDataChecksum = dataChecksum;\n }\n\n function getID(d) {\n return (d.parent ? getID(d.parent) + \".\" : \"\") + d.data.label;\n }\n\n const root = d3Hierarchy(this.data())\n .sum(function (d) {\n return d.size || 50;\n }).each((d) => {\n if (this._collapsed[getID(d)]) {\n delete (d.children);\n }\n })\n ;\n\n const dataNodes = this._d3Tree(root).descendants();\n const links = this._d3Tree(root).descendants().slice(1);\n\n let nodeIdx = 0;\n root.eachBefore((n: any) => {\n n.x = nodeIdx * context.barHeight();\n ++nodeIdx;\n });\n\n const boxSize = this.barHeight() - 4;\n const transitionDuration = this._renderCount ? 500 : 0;\n\n // Lines ---\n const lines = this._svgLinks.selectAll(\".link\").data(links, function (d) { return getID(d); });\n lines.enter().append(\"path\")\n .attr(\"class\", \"link\")\n .attr(\"d\", elbow)\n ;\n lines.transition().duration(transitionDuration)\n .attr(\"d\", elbow)\n ;\n lines.exit().remove();\n\n function elbow(d) {\n return \"M\" + d.parent.y + \",\" + d.parent.x\n + \"V\" + d.x + \", H\" + d.y;\n }\n\n // Nodes ---\n const nodes = this._svgNodes.selectAll(\".node\").data(dataNodes, function (d) { return getID(d); });\n nodes.transition().duration(transitionDuration)\n .attr(\"transform\", function (d) { return \"translate(\" + d.y + \",\" + d.x + \")\"; })\n ;\n const enterNodes = nodes.enter().append(\"g\")\n .attr(\"class\", \"node\")\n .attr(\"transform\", function (d) { return \"translate(\" + d.y + \",\" + d.x + \")\"; })\n .call(this._selection.enter.bind(this._selection))\n .each(function () {\n const element = d3Select(this);\n element.append(\"rect\")\n .attr(\"height\", boxSize)\n .attr(\"width\", boxSize)\n .on(\"click\", function (d: any) {\n if (context._collapsed[getID(d)]) {\n delete context._collapsed[getID(d)];\n } else if (d.children) {\n context._collapsed[getID(d)] = true;\n }\n context.lazyRender();\n })\n ;\n element.append(\"text\");\n })\n .style(\"opacity\", 0)\n ;\n enterNodes.transition()\n .style(\"opacity\", 1)\n ;\n enterNodes.merge(nodes).select(\"rect\")\n .attr(\"x\", -boxSize / 2)\n .attr(\"y\", -boxSize / 2)\n .style(\"fill\", color)\n ;\n enterNodes.merge(nodes).select(\"text\")\n .attr(\"dx\", boxSize / 2 + 4 + \"px\")\n .attr(\"dy\", \"0.33em\")\n .text(function (d) { return d.data.label; })\n ;\n nodes.exit().transition()\n .style(\"opacity\", 0)\n .remove()\n ;\n\n if (!this._renderCount) {\n context.zoomToFit();\n }\n\n function color(d) {\n return context._collapsed[getID(d)] ? \"#3182bd\" : d.children ? \"#c6dbef\" : \"#fd8d3c\";\n }\n }\n}\nIndented.prototype._class += \" tree_Indented\";\nIndented.prototype.implements(ITree.prototype);\nIndented.prototype.mixin(Utility.SimpleSelectionMixin);\nIndented.prototype.Column = IndentedColumn;\n\nexport interface Indented {\n _palette;\n\n // ITree ---\n click(row, column, selected): void;\n dblclick(row, column, selected): void;\n\n // SimpleSelectionMixin ---\n _selection;\n\n // Properties ---\n xmlColumn(): string;\n xmlColumn(_: string): this;\n xmlColumn_exists(): boolean;\n mappings(): IndentedColumn[];\n mappings(_: IndentedColumn[]): this;\n barHeight(): number;\n barHeight(_: number): this;\n}\n\nIndented.prototype.publish(\"xmlColumn\", null, \"set\", \"Field\", function () { return this.columns(); }, { optional: true });\nIndented.prototype.publish(\"mappings\", [], \"propertyArray\", \"Source Columns\", null, { autoExpand: IndentedColumn, disable: (w) => w.xmlColumn_exists() });\nIndented.prototype.publish(\"barHeight\", 16, \"number\", \"Bar height\");\n\nfunction xmlToJson(xml, id = \"\") {\n const retVal = {\n id,\n label: \"\",\n attributes: {},\n children: []\n };\n\n retVal.label = xml.nodeName;\n if (xml.nodeType === 1) { // element\n if (xml.attributes.length > 0) {\n for (let j = 0; j < xml.attributes.length; j++) {\n const attribute = xml.attributes.item(j);\n retVal.attributes[attribute.nodeName] = attribute.nodeValue;\n }\n }\n } else if (xml.nodeType === 3) { // text\n retVal.label = xml.nodeValue;\n }\n\n if (xml.hasChildNodes()) {\n for (let i = 0; i < xml.childNodes.length; i++) {\n const item = xml.childNodes.item(i);\n const child = xmlToJson(item, id + \"[\" + retVal.children.length + \"]\");\n retVal.children.push(child);\n }\n }\n return retVal;\n}\n","var pi = Math.PI,\n tau = 2 * pi,\n epsilon = 1e-6,\n tauEpsilon = tau - epsilon;\n\nfunction Path() {\n this._x0 = this._y0 = // start of current subpath\n this._x1 = this._y1 = null; // end of current subpath\n this._ = \"\";\n}\n\nfunction path() {\n return new Path;\n}\n\nPath.prototype = path.prototype = {\n constructor: Path,\n moveTo: function(x, y) {\n this._ += \"M\" + (this._x0 = this._x1 = +x) + \",\" + (this._y0 = this._y1 = +y);\n },\n closePath: function() {\n if (this._x1 !== null) {\n this._x1 = this._x0, this._y1 = this._y0;\n this._ += \"Z\";\n }\n },\n lineTo: function(x, y) {\n this._ += \"L\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n quadraticCurveTo: function(x1, y1, x, y) {\n this._ += \"Q\" + (+x1) + \",\" + (+y1) + \",\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n bezierCurveTo: function(x1, y1, x2, y2, x, y) {\n this._ += \"C\" + (+x1) + \",\" + (+y1) + \",\" + (+x2) + \",\" + (+y2) + \",\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n arcTo: function(x1, y1, x2, y2, r) {\n x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;\n var x0 = this._x1,\n y0 = this._y1,\n x21 = x2 - x1,\n y21 = y2 - y1,\n x01 = x0 - x1,\n y01 = y0 - y1,\n l01_2 = x01 * x01 + y01 * y01;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(\"negative radius: \" + r);\n\n // Is this path empty? Move to (x1,y1).\n if (this._x1 === null) {\n this._ += \"M\" + (this._x1 = x1) + \",\" + (this._y1 = y1);\n }\n\n // Or, is (x1,y1) coincident with (x0,y0)? Do nothing.\n else if (!(l01_2 > epsilon));\n\n // Or, are (x0,y0), (x1,y1) and (x2,y2) collinear?\n // Equivalently, is (x1,y1) coincident with (x2,y2)?\n // Or, is the radius zero? Line to (x1,y1).\n else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) {\n this._ += \"L\" + (this._x1 = x1) + \",\" + (this._y1 = y1);\n }\n\n // Otherwise, draw an arc!\n else {\n var x20 = x2 - x0,\n y20 = y2 - y0,\n l21_2 = x21 * x21 + y21 * y21,\n l20_2 = x20 * x20 + y20 * y20,\n l21 = Math.sqrt(l21_2),\n l01 = Math.sqrt(l01_2),\n l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2),\n t01 = l / l01,\n t21 = l / l21;\n\n // If the start tangent is not coincident with (x0,y0), line to.\n if (Math.abs(t01 - 1) > epsilon) {\n this._ += \"L\" + (x1 + t01 * x01) + \",\" + (y1 + t01 * y01);\n }\n\n this._ += \"A\" + r + \",\" + r + \",0,0,\" + (+(y01 * x20 > x01 * y20)) + \",\" + (this._x1 = x1 + t21 * x21) + \",\" + (this._y1 = y1 + t21 * y21);\n }\n },\n arc: function(x, y, r, a0, a1, ccw) {\n x = +x, y = +y, r = +r, ccw = !!ccw;\n var dx = r * Math.cos(a0),\n dy = r * Math.sin(a0),\n x0 = x + dx,\n y0 = y + dy,\n cw = 1 ^ ccw,\n da = ccw ? a0 - a1 : a1 - a0;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(\"negative radius: \" + r);\n\n // Is this path empty? Move to (x0,y0).\n if (this._x1 === null) {\n this._ += \"M\" + x0 + \",\" + y0;\n }\n\n // Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0).\n else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) {\n this._ += \"L\" + x0 + \",\" + y0;\n }\n\n // Is this arc empty? We’re done.\n if (!r) return;\n\n // Does the angle go the wrong way? Flip the direction.\n if (da < 0) da = da % tau + tau;\n\n // Is this a complete circle? Draw two arcs to complete the circle.\n if (da > tauEpsilon) {\n this._ += \"A\" + r + \",\" + r + \",0,1,\" + cw + \",\" + (x - dx) + \",\" + (y - dy) + \"A\" + r + \",\" + r + \",0,1,\" + cw + \",\" + (this._x1 = x0) + \",\" + (this._y1 = y0);\n }\n\n // Is this arc non-empty? Draw an arc!\n else if (da > epsilon) {\n this._ += \"A\" + r + \",\" + r + \",0,\" + (+(da >= pi)) + \",\" + cw + \",\" + (this._x1 = x + r * Math.cos(a1)) + \",\" + (this._y1 = y + r * Math.sin(a1));\n }\n },\n rect: function(x, y, w, h) {\n this._ += \"M\" + (this._x0 = this._x1 = +x) + \",\" + (this._y0 = this._y1 = +y) + \"h\" + (+w) + \"v\" + (+h) + \"h\" + (-w) + \"Z\";\n },\n toString: function() {\n return this._;\n }\n};\n\nexport default path;\n","export default function(x) {\n return function constant() {\n return x;\n };\n}\n","export var abs = Math.abs;\nexport var atan2 = Math.atan2;\nexport var cos = Math.cos;\nexport var max = Math.max;\nexport var min = Math.min;\nexport var sin = Math.sin;\nexport var sqrt = Math.sqrt;\n\nexport var epsilon = 1e-12;\nexport var pi = Math.PI;\nexport var halfPi = pi / 2;\nexport var tau = 2 * pi;\n\nexport function acos(x) {\n return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);\n}\n\nexport function asin(x) {\n return x >= 1 ? halfPi : x <= -1 ? -halfPi : Math.asin(x);\n}\n","import {path} from \"d3-path\";\nimport constant from \"./constant.js\";\nimport {abs, acos, asin, atan2, cos, epsilon, halfPi, max, min, pi, sin, sqrt, tau} from \"./math.js\";\n\nfunction arcInnerRadius(d) {\n return d.innerRadius;\n}\n\nfunction arcOuterRadius(d) {\n return d.outerRadius;\n}\n\nfunction arcStartAngle(d) {\n return d.startAngle;\n}\n\nfunction arcEndAngle(d) {\n return d.endAngle;\n}\n\nfunction arcPadAngle(d) {\n return d && d.padAngle; // Note: optional!\n}\n\nfunction intersect(x0, y0, x1, y1, x2, y2, x3, y3) {\n var x10 = x1 - x0, y10 = y1 - y0,\n x32 = x3 - x2, y32 = y3 - y2,\n t = y32 * x10 - x32 * y10;\n if (t * t < epsilon) return;\n t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;\n return [x0 + t * x10, y0 + t * y10];\n}\n\n// Compute perpendicular offset line of length rc.\n// http://mathworld.wolfram.com/Circle-LineIntersection.html\nfunction cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * sqrt(max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}\n\nexport default function() {\n var innerRadius = arcInnerRadius,\n outerRadius = arcOuterRadius,\n cornerRadius = constant(0),\n padRadius = null,\n startAngle = arcStartAngle,\n endAngle = arcEndAngle,\n padAngle = arcPadAngle,\n context = null;\n\n function arc() {\n var buffer,\n r,\n r0 = +innerRadius.apply(this, arguments),\n r1 = +outerRadius.apply(this, arguments),\n a0 = startAngle.apply(this, arguments) - halfPi,\n a1 = endAngle.apply(this, arguments) - halfPi,\n da = abs(a1 - a0),\n cw = a1 > a0;\n\n if (!context) context = buffer = path();\n\n // Ensure that the outer radius is always larger than the inner radius.\n if (r1 < r0) r = r1, r1 = r0, r0 = r;\n\n // Is it a point?\n if (!(r1 > epsilon)) context.moveTo(0, 0);\n\n // Or is it a circle or annulus?\n else if (da > tau - epsilon) {\n context.moveTo(r1 * cos(a0), r1 * sin(a0));\n context.arc(0, 0, r1, a0, a1, !cw);\n if (r0 > epsilon) {\n context.moveTo(r0 * cos(a1), r0 * sin(a1));\n context.arc(0, 0, r0, a1, a0, cw);\n }\n }\n\n // Or is it a circular or annular sector?\n else {\n var a01 = a0,\n a11 = a1,\n a00 = a0,\n a10 = a1,\n da0 = da,\n da1 = da,\n ap = padAngle.apply(this, arguments) / 2,\n rp = (ap > epsilon) && (padRadius ? +padRadius.apply(this, arguments) : sqrt(r0 * r0 + r1 * r1)),\n rc = min(abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments)),\n rc0 = rc,\n rc1 = rc,\n t0,\n t1;\n\n // Apply padding? Note that since r1 ≥ r0, da1 ≥ da0.\n if (rp > epsilon) {\n var p0 = asin(rp / r0 * sin(ap)),\n p1 = asin(rp / r1 * sin(ap));\n if ((da0 -= p0 * 2) > epsilon) p0 *= (cw ? 1 : -1), a00 += p0, a10 -= p0;\n else da0 = 0, a00 = a10 = (a0 + a1) / 2;\n if ((da1 -= p1 * 2) > epsilon) p1 *= (cw ? 1 : -1), a01 += p1, a11 -= p1;\n else da1 = 0, a01 = a11 = (a0 + a1) / 2;\n }\n\n var x01 = r1 * cos(a01),\n y01 = r1 * sin(a01),\n x10 = r0 * cos(a10),\n y10 = r0 * sin(a10);\n\n // Apply rounded corners?\n if (rc > epsilon) {\n var x11 = r1 * cos(a11),\n y11 = r1 * sin(a11),\n x00 = r0 * cos(a00),\n y00 = r0 * sin(a00),\n oc;\n\n // Restrict the corner radius according to the sector angle.\n if (da < pi && (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10))) {\n var ax = x01 - oc[0],\n ay = y01 - oc[1],\n bx = x11 - oc[0],\n by = y11 - oc[1],\n kc = 1 / sin(acos((ax * bx + ay * by) / (sqrt(ax * ax + ay * ay) * sqrt(bx * bx + by * by))) / 2),\n lc = sqrt(oc[0] * oc[0] + oc[1] * oc[1]);\n rc0 = min(rc, (r0 - lc) / (kc - 1));\n rc1 = min(rc, (r1 - lc) / (kc + 1));\n }\n }\n\n // Is the sector collapsed to a line?\n if (!(da1 > epsilon)) context.moveTo(x01, y01);\n\n // Does the sector’s outer ring have rounded corners?\n else if (rc1 > epsilon) {\n t0 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw);\n t1 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw);\n\n context.moveTo(t0.cx + t0.x01, t0.cy + t0.y01);\n\n // Have the corners merged?\n if (rc1 < rc) context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);\n\n // Otherwise, draw the two corners and the ring.\n else {\n context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r1, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), !cw);\n context.arc(t1.cx, t1.cy, rc1, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);\n }\n }\n\n // Or is the outer ring just a circular arc?\n else context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw);\n\n // Is there no inner ring, and it’s a circular sector?\n // Or perhaps it’s an annular sector collapsed due to padding?\n if (!(r0 > epsilon) || !(da0 > epsilon)) context.lineTo(x10, y10);\n\n // Does the sector’s inner ring (or point) have rounded corners?\n else if (rc0 > epsilon) {\n t0 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw);\n t1 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw);\n\n context.lineTo(t0.cx + t0.x01, t0.cy + t0.y01);\n\n // Have the corners merged?\n if (rc0 < rc) context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);\n\n // Otherwise, draw the two corners and the ring.\n else {\n context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r0, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), cw);\n context.arc(t1.cx, t1.cy, rc0, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);\n }\n }\n\n // Or is the inner ring just a circular arc?\n else context.arc(0, 0, r0, a10, a00, cw);\n }\n\n context.closePath();\n\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n arc.centroid = function() {\n var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2,\n a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - pi / 2;\n return [cos(a) * r, sin(a) * r];\n };\n\n arc.innerRadius = function(_) {\n return arguments.length ? (innerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : innerRadius;\n };\n\n arc.outerRadius = function(_) {\n return arguments.length ? (outerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : outerRadius;\n };\n\n arc.cornerRadius = function(_) {\n return arguments.length ? (cornerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : cornerRadius;\n };\n\n arc.padRadius = function(_) {\n return arguments.length ? (padRadius = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), arc) : padRadius;\n };\n\n arc.startAngle = function(_) {\n return arguments.length ? (startAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : startAngle;\n };\n\n arc.endAngle = function(_) {\n return arguments.length ? (endAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : endAngle;\n };\n\n arc.padAngle = function(_) {\n return arguments.length ? (padAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : padAngle;\n };\n\n arc.context = function(_) {\n return arguments.length ? ((context = _ == null ? null : _), arc) : context;\n };\n\n return arc;\n}\n","import { ITree } from \"@hpcc-js/api\";\nimport { d3Event, select as d3Select, SVGWidget } from \"@hpcc-js/common\";\nimport { hierarchy as d3Hierarchy, partition as d3Parition } from \"d3-hierarchy\";\nimport { interpolate as d3Interpolate } from \"d3-interpolate\";\nimport { scaleLinear as d3ScaleLinear, scaleSqrt as d3ScaleSqrt } from \"d3-scale\";\nimport { arc as d3Arc } from \"d3-shape\";\n\nimport \"../src/SunburstPartition.css\";\n\nexport class SunburstPartition extends SVGWidget {\n svg;\n radius;\n _xScale;\n _yScale;\n partition;\n arc;\n _resetRoot;\n\n constructor() {\n super();\n ITree.call(this);\n }\n\n data(): any;\n data(_: any): this;\n data(_?: any): any | this {\n const retVal = SVGWidget.prototype.data.apply(this, arguments);\n if (arguments.length) {\n this._resetRoot = true;\n }\n return retVal;\n }\n\n enter(_domNode, element) {\n const context = this;\n\n this.radius = Math.min(this.width(), this.height()) / 2;\n\n this._xScale = d3ScaleLinear()\n .range([0, 2 * Math.PI])\n ;\n\n this._yScale = d3ScaleSqrt()\n .range([0, this.radius])\n ;\n\n this.partition = d3Parition();\n\n this.arc = d3Arc()\n .startAngle(function (d: any) {\n return Math.max(0, Math.min(2 * Math.PI, context._xScale(d.x0)));\n })\n .endAngle(function (d: any) {\n return Math.max(0, Math.min(2 * Math.PI, context._xScale(d.x1)));\n })\n .innerRadius(function (d: any) {\n return Math.max(0, context._yScale(d.y0));\n })\n .outerRadius(function (d: any) {\n return Math.max(0, context._yScale(d.y1));\n })\n ;\n\n this.svg = element.append(\"g\");\n }\n\n update(_domNode, _element) {\n const context = this;\n\n this._palette = this._palette.switch(this.paletteID());\n if (this.useClonedPalette()) {\n this._palette = this._palette.cloneNotExists(this.paletteID() + \"_\" + this.id());\n }\n\n this.radius = Math.min(this.width(), this.height()) / 2;\n this._yScale.range([0, this.radius]);\n\n const root = d3Hierarchy(this.data())\n .sum(function (d) {\n return d.size !== undefined ? d.size : 1;\n })\n ;\n\n const paths = this.svg.selectAll(\"path\").data(this.partition(root).descendants(), function (d, i) {\n return d.data.label !== undefined ? d.data.label : i;\n });\n\n paths.enter().append(\"path\")\n .on(\"click\", function (d) { context.click(d.data, null, null); })\n .on(\"dblclick\", function (d) {\n const event = d3Event();\n if (event) {\n event.stopPropagation();\n }\n context.zoomTo(d);\n })\n .each(function () {\n const element = d3Select(this);\n element\n .append(\"title\")\n ;\n })\n .merge(paths)\n .attr(\"d\", this.arc)\n .style(\"fill\", function (d) {\n return d.data.__viz_fill ? d.data.__viz_fill : context._palette(d.data.label);\n })\n .style(\"stroke\", function (d) {\n return d.value > 16 ? \"white\" : \"none\";\n })\n .select(\"title\")\n .text(function (d) {\n return d.data.label;\n })\n ;\n\n paths.exit().remove();\n\n if (this._resetRoot) {\n this._resetRoot = false;\n this.zoomTo(root);\n }\n }\n\n zoomTo(d) {\n const context = this;\n this.svg.transition()\n .duration(750)\n .tween(\"scale\", function () {\n const xd = d3Interpolate(context._xScale.domain(), [d.x0, d.x1]);\n const yd = d3Interpolate(context._yScale.domain(), [d.y0, 1]);\n const yr = d3Interpolate(context._yScale.range(), [d.y0 ? 20 : 0, context.radius]);\n return function (t) { context._xScale.domain(xd(t)); context._yScale.domain(yd(t)).range(yr(t)); };\n })\n .selectAll(\"path\")\n .attrTween(\"d\", function (d2) { return function () { return context.arc(d2); }; });\n }\n}\nSunburstPartition.prototype._class += \" tree_SunburstPartition\";\nSunburstPartition.prototype.implements(ITree.prototype);\n\nexport interface SunburstPartition {\n _palette;\n\n // ITree ---\n click(row, column, selected): void;\n dblclick(row, column, selected): void;\n\n // Properties ---\n paletteID(): string;\n paletteID(_: string): this;\n useClonedPalette(): boolean;\n useClonedPalette(_: boolean): this;\n}\n\nSunburstPartition.prototype.publish(\"paletteID\", \"default\", \"set\", \"Color palette for this widget\", SunburstPartition.prototype._palette.switch(), { tags: [\"Basic\", \"Shared\"] });\nSunburstPartition.prototype.publish(\"useClonedPalette\", false, \"boolean\", \"Enable or disable using a cloned palette\", null, { tags: [\"Intermediate\", \"Shared\"] });\n","import { ITree } from \"@hpcc-js/api\";\nimport { HTMLWidget, Palette, PropertyExt, Utility } from \"@hpcc-js/common\";\nimport { rgb as d3rgb } from \"d3-color\";\nimport { hierarchy as d3Hierarchy, treemap as d3Treemap, treemapBinary as d3treemapBinary, treemapDice as d3treemapDice, treemapResquarify as d3treemapResquarify, treemapSlice as d3treemapSlice, treemapSliceDice as d3treemapSliceDice, treemapSquarify as d3treemapSquarify } from \"d3-hierarchy\";\n\nimport \"../src/Treemap.css\";\n\nexport class TreemapColumn extends PropertyExt {\n _owner: Treemap;\n\n constructor() {\n super();\n }\n\n owner(): Treemap;\n owner(_: Treemap): this;\n owner(_?: Treemap): Treemap | this {\n if (!arguments.length) return this._owner;\n this._owner = _;\n return this;\n }\n\n valid(): boolean {\n return !!this.column();\n }\n\n column: { (): string; (_: string): TreemapColumn; };\n}\nTreemapColumn.prototype._class += \" tree_Dendrogram.TreemapColumn\";\n\nTreemapColumn.prototype.publish(\"column\", null, \"set\", \"Field\", function (this: TreemapColumn) { return this._owner ? this._owner.columns() : []; }, { optional: true });\n\n// ===\nexport class Treemap extends HTMLWidget {\n Column;\n protected _d3Treemap;\n protected _elementDIV;\n protected _selection;\n constructor() {\n super();\n ITree.call(this);\n Utility.SimpleSelectionMixin.call(this, true);\n }\n\n private getTilingMethod() {\n switch (this.tilingMethod()) {\n case \"treemapBinary\":\n return d3treemapBinary;\n case \"treemapDice\":\n return d3treemapDice;\n case \"treemapSlice\":\n return d3treemapSlice;\n case \"treemapSliceDice\":\n return d3treemapSliceDice;\n case \"treemapResquarify\":\n return d3treemapResquarify;\n case \"treemapSquarify\":\n default:\n return d3treemapSquarify;\n }\n }\n\n treemapData() {\n if (!this.mappings().filter(mapping => mapping.valid()).length) {\n return this.data();\n }\n\n const view = this._db.aggregateView(this.mappings().map(function (mapping) { return mapping.column(); }), this.aggrType(), this.aggrColumn());\n const retVal = {\n key: \"root\",\n values: view.entries()\n };\n return formatData(retVal);\n\n function formatData(node): any {\n if (node.values instanceof Array) {\n const children = node.values.filter(function (value) {\n return !(value instanceof Array);\n }).map(function (value) {\n return formatData(value);\n });\n const retVal2: any = {\n label: node.key\n };\n if (children.length) {\n retVal2.children = children;\n } else {\n retVal2.size = 22;\n }\n return retVal2;\n }\n return {\n label: node.key,\n size: node.values.aggregate,\n origRows: node.values\n };\n }\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n this._d3Treemap = d3Treemap();\n\n this._elementDIV = element.append(\"div\");\n this._selection.widgetElement(this._elementDIV);\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n const context = this;\n\n this._palette = this._palette.switch(this.paletteID());\n if (this.useClonedPalette()) {\n this._palette = this._palette.cloneNotExists(this.paletteID() + \"_\" + this.id());\n }\n\n const root = d3Hierarchy(this.treemapData())\n .sum(this.nodeWeight)\n ;\n\n this._d3Treemap\n .size([this.width(), this.height()])\n .paddingInner(this.paddingInner())\n .paddingOuter(this.paddingOuter())\n .paddingTop(this.paddingTop())\n ;\n if ([\"treemapSquarify\", \"treemapResquarify\"].indexOf(this.tilingMethod()) !== -1) {\n this._d3Treemap.tile(this.getTilingMethod()[\"ratio\"](this.squarifyRatio()));\n } else {\n this._d3Treemap.tile(this.getTilingMethod());\n }\n this._d3Treemap(root);\n\n this._elementDIV\n .style(\"font-size\", this.fontSize_exists() ? this.fontSize() + \"px\" : null)\n .style(\"line-height\", this.fontSize_exists() ? (this.fontSize() + 2) + \"px\" : null)\n ;\n\n const node = this._elementDIV.selectAll(\".node\").data(root.descendants());\n node.enter().append(\"div\")\n .attr(\"class\", \"node\")\n .call(this._selection.enter.bind(this._selection))\n .on(\"click\", function (d) {\n if (d) {\n let columnLabel = \"\";\n context.mappings().forEach(function (mapping) {\n if (mapping.column()) {\n columnLabel = mapping.column();\n }\n });\n if (d.origRows) {\n context.click(context.rowToObj(d.origRows[0]), columnLabel, context._selection.selected(this));\n } else {\n context.click(d.data, columnLabel, context._selection.selected(this));\n }\n }\n })\n .on(\"dblclick\", function (d) {\n if (d) {\n let columnLabel = \"\";\n context.mappings().forEach(function (mapping) {\n if (mapping.column()) {\n columnLabel = mapping.column();\n }\n });\n if (d.origRows) {\n context.dblclick(context.rowToObj(d.origRows[0]), columnLabel, context._selection.selected(this));\n } else {\n context.dblclick(d.data, columnLabel, context._selection.selected(this));\n }\n }\n })\n .merge(node)\n .style(\"left\", function (d) { return (d.x0 + Math.max(0, d.x1 - d.x0) / 2) + \"px\"; })\n .style(\"top\", function (d) { return (d.y0 + Math.max(0, d.y1 - d.y0) / 2) + \"px\"; })\n .style(\"width\", function () { return 0 + \"px\"; })\n .style(\"height\", function () { return 0 + \"px\"; })\n .style(\"font-size\", function (d) { return (d.children ? context.parentFontSize() : context.leafFontSize()) + \"px\"; })\n .style(\"line-height\", function (d) { return (d.children ? context.parentFontSize() : context.leafFontSize()) + \"px\"; })\n .attr(\"title\", tooltip)\n .html(function (d) {\n if (!context.showRoot() && d.depth === 0) {\n return null;\n }\n if (d.children) {\n if (context.enableParentLabels()) {\n return context.parentWeightHTML(d);\n } else {\n return null;\n }\n } else {\n return context.leafWeightHTML(d);\n }\n })\n .style(\"background\", function (d) {\n if (!context.showRoot() && d.depth === 0) {\n this.style.color = \"transparent\";\n return \"transparent\";\n }\n const light_dark = context.brighterLeafNodes() ? \"brighter\" : \"darker\";\n let _color;\n if (context.usePaletteOnParentNodes()) {\n _color = d.children ? context._palette(d.data.label) : d3rgb(context._palette(d.parent.data.label))[light_dark](1);\n } else {\n if (d.depth > context.depthColorLimit()) {\n _color = d3rgb(d.parent.color)[light_dark](1);\n } else {\n _color = context._palette(d.data.label);\n }\n d.color = _color;\n }\n this.style.color = Palette.textColor(_color);\n return _color;\n })\n .transition().duration(this.transitionDuration())\n .style(\"pointer-events\", function (d) { return !context.showRoot() && d.depth === 0 ? \"none\" : \"all\"; })\n .style(\"opacity\", function (d) { return d.children ? 1 : null; })\n .style(\"left\", function (d) { return d.x0 + \"px\"; })\n .style(\"top\", function (d) { return d.y0 + \"px\"; })\n .style(\"width\", function (d) { return Math.max(0, d.x1 - d.x0) + \"px\"; })\n .style(\"height\", function (d) { return Math.max(0, d.y1 - d.y0) + \"px\"; })\n .each(function (d) {\n if (d.depth === 0) {\n this.style.color = !context.showRoot() ? \"transparent\" : \"\";\n this.style.borderColor = !context.showRoot() ? \"transparent\" : \"\";\n }\n })\n ;\n node.exit().transition().duration(this.transitionDuration())\n .style(\"opacity\", 0)\n .remove()\n ;\n function tooltip(d) {\n if (d.children && !context.enableParentTooltips()) {\n return null;\n }\n let retVal = d.data.label + \" (\" + d.value + \")\";\n while (d.parent && d.parent.parent) {\n retVal = d.parent.data.label + \" -> \" + retVal;\n d = d.parent;\n }\n return retVal;\n }\n }\n\n exit(domNode, element) {\n super.exit(domNode, element);\n }\n\n nodeWeight(d) {\n return d.size || 1;\n }\n\n parentWeightHTML(d) {\n return this.showParentWeight() ? `<span class=\"treemap-parent-label\">${d.data.label}</span><span class=\"treemap-parent-value\">${d.value}${this.weightSuffix()}</span>` : `<span class=\"treemap-parent-label\">${d.data.label}</span>`;\n }\n\n leafWeightHTML(d) {\n return this.showLeafWeight() ? `<span class=\"treemap-leaf-label\">${d.data.label}</span><span class=\"treemap-leaf-value\">${d.value}${this.weightSuffix()}</span>` : `<span class=\"treemap-leaf-label\">${d.data.label}</span>`;\n }\n}\nTreemap.prototype._class += \" tree_Treemap\";\nTreemap.prototype.implements(ITree.prototype);\nTreemap.prototype.mixin(Utility.SimpleSelectionMixin);\nTreemap.prototype.Column = TreemapColumn;\n\nexport interface Treemap {\n _palette;\n\n // ITree ---\n click(row, column, selected): void;\n dblclick(row, column, selected): void;\n\n // Properties ---\n paletteID(): string;\n paletteID(_: string): this;\n useClonedPalette(): boolean;\n useClonedPalette(_: boolean): this;\n mappings(): TreemapColumn[];\n mappings(_: TreemapColumn[]): this;\n aggrType(): string;\n aggrType(_: string): this;\n aggrColumn(): string;\n aggrColumn(_: string): this;\n fontSize(): number;\n fontSize(_: number): this;\n fontSize_exists(): boolean;\n paddingInner(): number;\n paddingInner(_: number): this;\n paddingOuter(): number;\n paddingOuter(_: number): this;\n paddingTop(): number;\n paddingTop(_: number): this;\n showRoot(): boolean;\n showRoot(_: boolean): this;\n parentFontSize(): number;\n parentFontSize(_: number): this;\n leafFontSize(): number;\n leafFontSize(_: number): this;\n usePaletteOnParentNodes(): boolean;\n usePaletteOnParentNodes(_: boolean): this;\n depthColorLimit(): number;\n depthColorLimit(_: number): this;\n squarifyRatio(): number;\n squarifyRatio(_: number): this;\n showParentWeight(): boolean;\n showParentWeight(_: boolean): this;\n showLeafWeight(): boolean;\n showLeafWeight(_: boolean): this;\n weightSuffix(): string;\n weightSuffix(_: string): this;\n brighterLeafNodes(): boolean;\n brighterLeafNodes(_: boolean): this;\n enableParentLabels(): boolean;\n enableParentLabels(_: boolean): this;\n enableParentTooltips(): boolean;\n enableParentTooltips(_: boolean): this;\n transitionDuration(): number[];\n transitionDuration(_: number[]): this;\n tilingMethod(): string;\n tilingMethod(_: string): this;\n}\n\nTreemap.prototype.publish(\"paletteID\", \"default\", \"set\", \"Color palette for this widget\", Treemap.prototype._palette.switch(), { tags: [\"Basic\", \"Shared\"] });\nTreemap.prototype.publish(\"useClonedPalette\", false, \"boolean\", \"Enable or disable using a cloned palette\", null, { tags: [\"Intermediate\", \"Shared\"] });\nTreemap.prototype.publish(\"mappings\", [], \"propertyArray\", \"Source Columns\", null, { autoExpand: TreemapColumn });\nTreemap.prototype.publish(\"aggrType\", null, \"set\", \"Aggregation Type\", [null, \"mean\", \"median\", \"sum\", \"min\", \"max\"], { optional: true });\nTreemap.prototype.publish(\"aggrColumn\", null, \"set\", \"Aggregation Field\", function () { return this.columns(); }, { optional: true, disable: (w) => !w.aggrType() });\nTreemap.prototype.publish(\"fontSize\", null, \"number\", \"Font Size\", null, { optional: true });\nTreemap.prototype.publish(\"paddingInner\", 18.6, \"number\", \"Pixel spacing between each sibling node\");\nTreemap.prototype.publish(\"paddingOuter\", 30, \"number\", \"Pixel padding of parent nodes\");\nTreemap.prototype.publish(\"paddingTop\", 41.4, \"number\", \"Additional top pixel padding of parent nodes\");\nTreemap.prototype.publish(\"showRoot\", false, \"boolean\", \"Show root element\");\nTreemap.prototype.publish(\"parentFontSize\", 18, \"number\", \"Parent font-size\");\nTreemap.prototype.publish(\"leafFontSize\", 16, \"number\", \"Leaf font-size\");\nTreemap.prototype.publish(\"usePaletteOnParentNodes\", false, \"boolean\", \"Assign a color from the palette to every parent node\");\nTreemap.prototype.publish(\"depthColorLimit\", 1, \"number\", \"Assign a color from the palette to node with depth lower than this value\", null, { optional: true, disable: (w) => w.usePaletteOnParentNodes() });\nTreemap.prototype.publish(\"squarifyRatio\", 1, \"number\", \"Specifies the desired aspect ratio of the generated rectangles (must be >= 1)\", null, { optional: true, disable: (w) => [\"treemapSquarify\", \"treemapResquarify\"].indexOf(w.tilingMethod()) === -1 });\nTreemap.prototype.publish(\"showParentWeight\", true, \"boolean\", \"Show weight of parent nodes\");\nTreemap.prototype.publish(\"showLeafWeight\", true, \"boolean\", \"Show weight of leaf nodes\");\nTreemap.prototype.publish(\"weightSuffix\", \"\", \"string\", \"Weight suffix (ex: 'ms')\");\nTreemap.prototype.publish(\"brighterLeafNodes\", false, \"boolean\", \"Brighter/darker leaf node color (false = darker)\");\nTreemap.prototype.publish(\"enableParentLabels\", true, \"boolean\", \"Enable parent labels\");\nTreemap.prototype.publish(\"enableParentTooltips\", true, \"boolean\", \"Enable parent tooltips\");\nTreemap.prototype.publish(\"transitionDuration\", 250, \"number\", \"Transition Duration\");\nTreemap.prototype.publish(\"tilingMethod\", \"treemapSquarify\", \"set\", \"Transition Duration\", [\"treemapBinary\", \"treemapDice\", \"treemapResquarify\", \"treemapSlice\", \"treemapSliceDice\", \"treemapSquarify\"]);\n"],"x_google_ignoreList":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,34,35,36,37],"mappings":";;;;;;IAAa,IAAW,iBACX,IAAc,SACd,IAAgB;;;ACF7B,SAASA,oBAAkB,GAAG,GAAG;CAC/B,OAAO,EAAE,WAAW,EAAE,SAAS,IAAI;AACrC;;A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