{"version":3,"file":"index.umd.cjs","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","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":"ueAAa,EAAW,gBACX,EAAc,QACd,EAAgB,SCF7B,SAASA,oBAAkB,EAAG,EAAG,CAC/B,OAAO,EAAE,SAAW,EAAE,OAAS,EAAI,CACrC,iDAEA,SAAS,MAAM,EAAU,CACvB,OAAO,EAAS,OAAO,YAAa,CAAC,EAAI,EAAS,MACpD,CAEA,SAAS,YAAY,EAAG,EAAG,CACzB,OAAO,EAAI,EAAE,CACf,CAEA,SAAS,KAAK,EAAU,CACtB,MAAO,GAAI,EAAS,OAAO,WAAY,CAAC,CAC1C,CAEA,SAAS,WAAW,EAAG,EAAG,CACxB,OAAO,KAAK,IAAI,EAAG,EAAE,CAAC,CACxB,CAEA,SAAS,SAAS,EAAM,CAEtB,IADA,IAAI,EACG,EAAW,EAAK,UAAU,EAAO,EAAS,GACjD,OAAO,CACT,CAEA,SAAS,UAAU,EAAM,CAEvB,IADA,IAAI,EACG,EAAW,EAAK,UAAU,EAAO,EAAS,EAAS,OAAS,GACnE,OAAO,CACT,mCAEA,SAAA,iBAA0B,KACpB,EAAaA,oBACb,EAAK,EACL,EAAK,EACL,EAAW,GAEf,SAAS,QAAQ,EAAM,KACjB,EACA,EAAI,EAGR,EAAK,UAAU,SAAS,EAAM,CAC5B,IAAI,EAAW,EAAK,SAChB,GACF,EAAK,EAAI,MAAM,CAAQ,EACvB,EAAK,EAAI,KAAK,CAAQ,IAEtB,EAAK,EAAI,EAAe,GAAK,EAAW,EAAM,CAAY,EAAI,EAC9D,EAAK,EAAI,EACT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