@hpcc-js/chart 3.4.3 → 3.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"index.umd.cjs","names":["pi","tau","epsilon","x","y","x1","y1","x0","y0","cw","x","abs","max","sqrt","epsilon","pi","halfPi","tau","x","asin","arcInnerRadius","arcOuterRadius","arcStartAngle","arcEndAngle","arcPadAngle","intersect","x1","x0","y1","y0","cornerTangents","cw","sqrt","x00","y00","max","constant","halfPi","abs","path","tau","asin","pi","a","Linear","x","y","x","y","x","pointX","y","pointY","constant","curveLinear","path","x0","pointX","x1","y0","constant","y1","pointY","curveLinear","k","path","line","a","identity","descending","constant","tau","k","i","j","point","x","y","Basis","Bundle","Basis","x","y","x0","y0","beta","point","x","y","Cardinal","tension","point","x1","y1","a","x","y","CatmullRom","Cardinal","alpha","sign","x","slope3","slope2","point","x0","y0","x1","y1","MonotoneX","y","MonotoneY","ReflectContext","Natural","x","y","controlPoints","a","Step","x","y","x1","slice","x","epsilon","x","y","k","axis","identity","range","path","slice","retVal: IOverflow","lowerPos: number","upperPos: number","currSel: any","prevBrushSel: any","context: XYAxis","valueAnchor: \"start\" | \"middle\" | \"end\"","k","a","c","Node","node_count","node_each","node_eachAfter","node_eachBefore","node_sum","node_sort","node_path","node_ancestors","node_descendants","node_leaves","node_links","slice","array","slice","a","x1","y1","c","a","x","y","c","circle","k","enclose","x","x","constant","k","now","d3AxisLeft","d3Descending","wrap","x1","x0","range","axis","x","slice","a","x","c","x","point","y","pi","a","thresholdSturges","ascending","area","contains","x","y","point","constant","slice","noop","x","y","k","constant","data","contours","slice","y","x","a","pi","halfPi","tau","x","adder","x00","y00","x0","y0","x","y","x0","y0","x","y","x00","y00","x0","y0","x","y","x","y","tau","adder","x","y","x","y","path","pathArea","pathMeasure","pathBounds","pathCentroid","identity","x","x","x1","x0","y1","y0","cw","x00","y00","constant","path","a","x","y","x","pointX","y","pointY","constant","curveLinear","path","curveLinear","a","point","x","y","noop","x","y","x","y","x0","y0","x","y","x0","y0","beta","point","x","y","tension","noop","x","y","tension","x","y","tension","point","x1","y1","a","x","y","alpha","noop","x","y","alpha","x","y","alpha","noop","x","y","x","x0","y0","x1","y1","y","x","y","a","Step","x","y","x1","get","Annotation","x","y","AnnotationCollection","a","k","pointHandle","circleHandles","addHandles","leftRightDynamic","topBottomDynamic","lineBuilder","curveLinear","lineGen","line","arcBuilder","arc","lineSetup","annotation","x1","y1","curveCatmullRom","c","updatePoint","event","createPoints","updateRadius","circle","notCornerPointerXY","sign","Type","s","customType","d3NoteText","newWithClass","addHandlers","wrap","text","bboxWithoutHandles","padding: number | undefined","x0","y0","x1","y1","x","y","point","pi","dx","dy","ticks: Ticks","row: any","cloud: any"],"sources":["../src/__package__.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","../../../node_modules/d3-shape/src/curve/linear.js","../../../node_modules/d3-shape/src/point.js","../../../node_modules/d3-shape/src/line.js","../../../node_modules/d3-shape/src/area.js","../../../node_modules/d3-shape/src/descending.js","../../../node_modules/d3-shape/src/identity.js","../../../node_modules/d3-shape/src/pie.js","../../../node_modules/d3-shape/src/curve/basis.js","../../../node_modules/d3-shape/src/curve/bundle.js","../../../node_modules/d3-shape/src/curve/cardinal.js","../../../node_modules/d3-shape/src/curve/catmullRom.js","../../../node_modules/d3-shape/src/curve/monotone.js","../../../node_modules/d3-shape/src/curve/natural.js","../../../node_modules/d3-shape/src/curve/step.js","../../../node_modules/d3-axis/src/array.js","../../../node_modules/d3-axis/src/identity.js","../../../node_modules/d3-axis/src/axis.js","../src/Axis.ts","../src/XYAxis.ts","../src/Scatter.ts","../src/Area.ts","../src/Column.ts","../src/Bar.ts","../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","../src/Bubble.ts","../src/BubbleXY.ts","../../../node_modules/d3-timer/src/timer.js","../../../node_modules/d3v4-bullet/src/bullet.js","../src/Bullet.ts","../../../node_modules/d3-contour/src/array.js","../../../node_modules/d3-contour/src/ascending.js","../../../node_modules/d3-contour/src/area.js","../../../node_modules/d3-contour/src/constant.js","../../../node_modules/d3-contour/src/contains.js","../../../node_modules/d3-contour/src/noop.js","../../../node_modules/d3-contour/src/contours.js","../../../node_modules/d3-contour/src/blur.js","../../../node_modules/d3-contour/src/density.js","../../../node_modules/d3-geo/src/adder.js","../../../node_modules/d3-geo/src/math.js","../../../node_modules/d3-geo/src/noop.js","../../../node_modules/d3-geo/src/stream.js","../../../node_modules/d3-geo/src/identity.js","../../../node_modules/d3-geo/src/path/area.js","../../../node_modules/d3-geo/src/path/bounds.js","../../../node_modules/d3-geo/src/path/centroid.js","../../../node_modules/d3-geo/src/path/context.js","../../../node_modules/d3-geo/src/path/measure.js","../../../node_modules/d3-geo/src/path/string.js","../../../node_modules/d3-geo/src/path/index.js","../src/Contour.ts","../src/Gantt.ts","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/constant.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/math.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/arc.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/curve/linear.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/point.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/line.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/curve/radial.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/symbol/diamond.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/symbol/star.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/symbol/triangle.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/symbol/wye.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/noop.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/curve/basis.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/curve/basisClosed.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/curve/basisOpen.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/curve/bundle.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/curve/cardinal.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/curve/cardinalClosed.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/curve/cardinalOpen.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/curve/catmullRom.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/curve/catmullRomClosed.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/curve/catmullRomOpen.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/curve/linearClosed.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/curve/monotone.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/curve/natural.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/curve/step.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/array.js","../../../node_modules/d3-svg-annotation/indexRollupNext.js","../src/Gauge.ts","../src/Pie.ts","../src/HalfPie.ts","../src/Heat.ts","../../../node_modules/d3-hexbin/src/hexbin.js","../src/HexBin.ts","../src/Line.ts","../src/QuarterPie.ts","../src/QuartileCandlestick.ts","../src/Radar.ts","../src/RadialBar.ts","../src/StatChart.ts","../src/Step.ts","../src/Summary.ts","../src/SummaryC.ts","../src/D3Cloud.ts","../src/WordCloud.ts"],"sourcesContent":["export const PKG_NAME = \"@hpcc-js/chart\";\nexport const PKG_VERSION = \"3.2.0\";\nexport const BUILD_VERSION = \"3.2.1\";\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","function Linear(context) {\n this._context = context;\n}\n\nLinear.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // proceed\n default: this._context.lineTo(x, y); break;\n }\n }\n};\n\nexport default function(context) {\n return new Linear(context);\n}\n","export function x(p) {\n return p[0];\n}\n\nexport function y(p) {\n return p[1];\n}\n","import {path} from \"d3-path\";\nimport constant from \"./constant.js\";\nimport curveLinear from \"./curve/linear.js\";\nimport {x as pointX, y as pointY} from \"./point.js\";\n\nexport default function() {\n var x = pointX,\n y = pointY,\n defined = constant(true),\n context = null,\n curve = curveLinear,\n output = null;\n\n function line(data) {\n var i,\n n = data.length,\n d,\n defined0 = false,\n buffer;\n\n if (context == null) output = curve(buffer = path());\n\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) output.lineStart();\n else output.lineEnd();\n }\n if (defined0) output.point(+x(d, i, data), +y(d, i, data));\n }\n\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n line.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : constant(+_), line) : x;\n };\n\n line.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : constant(+_), line) : y;\n };\n\n line.defined = function(_) {\n return arguments.length ? (defined = typeof _ === \"function\" ? _ : constant(!!_), line) : defined;\n };\n\n line.curve = function(_) {\n return arguments.length ? (curve = _, context != null && (output = curve(context)), line) : curve;\n };\n\n line.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), line) : context;\n };\n\n return line;\n}\n","import {path} from \"d3-path\";\nimport constant from \"./constant.js\";\nimport curveLinear from \"./curve/linear.js\";\nimport line from \"./line.js\";\nimport {x as pointX, y as pointY} from \"./point.js\";\n\nexport default function() {\n var x0 = pointX,\n x1 = null,\n y0 = constant(0),\n y1 = pointY,\n defined = constant(true),\n context = null,\n curve = curveLinear,\n output = null;\n\n function area(data) {\n var i,\n j,\n k,\n n = data.length,\n d,\n defined0 = false,\n buffer,\n x0z = new Array(n),\n y0z = new Array(n);\n\n if (context == null) output = curve(buffer = path());\n\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) {\n j = i;\n output.areaStart();\n output.lineStart();\n } else {\n output.lineEnd();\n output.lineStart();\n for (k = i - 1; k >= j; --k) {\n output.point(x0z[k], y0z[k]);\n }\n output.lineEnd();\n output.areaEnd();\n }\n }\n if (defined0) {\n x0z[i] = +x0(d, i, data), y0z[i] = +y0(d, i, data);\n output.point(x1 ? +x1(d, i, data) : x0z[i], y1 ? +y1(d, i, data) : y0z[i]);\n }\n }\n\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n function arealine() {\n return line().defined(defined).curve(curve).context(context);\n }\n\n area.x = function(_) {\n return arguments.length ? (x0 = typeof _ === \"function\" ? _ : constant(+_), x1 = null, area) : x0;\n };\n\n area.x0 = function(_) {\n return arguments.length ? (x0 = typeof _ === \"function\" ? _ : constant(+_), area) : x0;\n };\n\n area.x1 = function(_) {\n return arguments.length ? (x1 = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), area) : x1;\n };\n\n area.y = function(_) {\n return arguments.length ? (y0 = typeof _ === \"function\" ? _ : constant(+_), y1 = null, area) : y0;\n };\n\n area.y0 = function(_) {\n return arguments.length ? (y0 = typeof _ === \"function\" ? _ : constant(+_), area) : y0;\n };\n\n area.y1 = function(_) {\n return arguments.length ? (y1 = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), area) : y1;\n };\n\n area.lineX0 =\n area.lineY0 = function() {\n return arealine().x(x0).y(y0);\n };\n\n area.lineY1 = function() {\n return arealine().x(x0).y(y1);\n };\n\n area.lineX1 = function() {\n return arealine().x(x1).y(y0);\n };\n\n area.defined = function(_) {\n return arguments.length ? (defined = typeof _ === \"function\" ? _ : constant(!!_), area) : defined;\n };\n\n area.curve = function(_) {\n return arguments.length ? (curve = _, context != null && (output = curve(context)), area) : curve;\n };\n\n area.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), area) : context;\n };\n\n return area;\n}\n","export default function(a, b) {\n return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;\n}\n","export default function(d) {\n return d;\n}\n","import constant from \"./constant.js\";\nimport descending from \"./descending.js\";\nimport identity from \"./identity.js\";\nimport {tau} from \"./math.js\";\n\nexport default function() {\n var value = identity,\n sortValues = descending,\n sort = null,\n startAngle = constant(0),\n endAngle = constant(tau),\n padAngle = constant(0);\n\n function pie(data) {\n var i,\n n = data.length,\n j,\n k,\n sum = 0,\n index = new Array(n),\n arcs = new Array(n),\n a0 = +startAngle.apply(this, arguments),\n da = Math.min(tau, Math.max(-tau, endAngle.apply(this, arguments) - a0)),\n a1,\n p = Math.min(Math.abs(da) / n, padAngle.apply(this, arguments)),\n pa = p * (da < 0 ? -1 : 1),\n v;\n\n for (i = 0; i < n; ++i) {\n if ((v = arcs[index[i] = i] = +value(data[i], i, data)) > 0) {\n sum += v;\n }\n }\n\n // Optionally sort the arcs by previously-computed values or by data.\n if (sortValues != null) index.sort(function(i, j) { return sortValues(arcs[i], arcs[j]); });\n else if (sort != null) index.sort(function(i, j) { return sort(data[i], data[j]); });\n\n // Compute the arcs! They are stored in the original data's order.\n for (i = 0, k = sum ? (da - n * pa) / sum : 0; i < n; ++i, a0 = a1) {\n j = index[i], v = arcs[j], a1 = a0 + (v > 0 ? v * k : 0) + pa, arcs[j] = {\n data: data[j],\n index: i,\n value: v,\n startAngle: a0,\n endAngle: a1,\n padAngle: p\n };\n }\n\n return arcs;\n }\n\n pie.value = function(_) {\n return arguments.length ? (value = typeof _ === \"function\" ? _ : constant(+_), pie) : value;\n };\n\n pie.sortValues = function(_) {\n return arguments.length ? (sortValues = _, sort = null, pie) : sortValues;\n };\n\n pie.sort = function(_) {\n return arguments.length ? (sort = _, sortValues = null, pie) : sort;\n };\n\n pie.startAngle = function(_) {\n return arguments.length ? (startAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : startAngle;\n };\n\n pie.endAngle = function(_) {\n return arguments.length ? (endAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : endAngle;\n };\n\n pie.padAngle = function(_) {\n return arguments.length ? (padAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : padAngle;\n };\n\n return pie;\n}\n","export function point(that, x, y) {\n that._context.bezierCurveTo(\n (2 * that._x0 + that._x1) / 3,\n (2 * that._y0 + that._y1) / 3,\n (that._x0 + 2 * that._x1) / 3,\n (that._y0 + 2 * that._y1) / 3,\n (that._x0 + 4 * that._x1 + x) / 6,\n (that._y0 + 4 * that._y1 + y) / 6\n );\n}\n\nexport function Basis(context) {\n this._context = context;\n}\n\nBasis.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 3: point(this, this._x1, this._y1); // proceed\n case 2: this._context.lineTo(this._x1, this._y1); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6); // proceed\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new Basis(context);\n}\n","import {Basis} from \"./basis.js\";\n\nfunction Bundle(context, beta) {\n this._basis = new Basis(context);\n this._beta = beta;\n}\n\nBundle.prototype = {\n lineStart: function() {\n this._x = [];\n this._y = [];\n this._basis.lineStart();\n },\n lineEnd: function() {\n var x = this._x,\n y = this._y,\n j = x.length - 1;\n\n if (j > 0) {\n var x0 = x[0],\n y0 = y[0],\n dx = x[j] - x0,\n dy = y[j] - y0,\n i = -1,\n t;\n\n while (++i <= j) {\n t = i / j;\n this._basis.point(\n this._beta * x[i] + (1 - this._beta) * (x0 + t * dx),\n this._beta * y[i] + (1 - this._beta) * (y0 + t * dy)\n );\n }\n }\n\n this._x = this._y = null;\n this._basis.lineEnd();\n },\n point: function(x, y) {\n this._x.push(+x);\n this._y.push(+y);\n }\n};\n\nexport default (function custom(beta) {\n\n function bundle(context) {\n return beta === 1 ? new Basis(context) : new Bundle(context, beta);\n }\n\n bundle.beta = function(beta) {\n return custom(+beta);\n };\n\n return bundle;\n})(0.85);\n","export function point(that, x, y) {\n that._context.bezierCurveTo(\n that._x1 + that._k * (that._x2 - that._x0),\n that._y1 + that._k * (that._y2 - that._y0),\n that._x2 + that._k * (that._x1 - x),\n that._y2 + that._k * (that._y1 - y),\n that._x2,\n that._y2\n );\n}\n\nexport function Cardinal(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinal.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x2, this._y2); break;\n case 3: point(this, this._x1, this._y1); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; this._x1 = x, this._y1 = y; break;\n case 2: this._point = 3; // proceed\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new Cardinal(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n","import {epsilon} from \"../math.js\";\nimport {Cardinal} from \"./cardinal.js\";\n\nexport function point(that, x, y) {\n var x1 = that._x1,\n y1 = that._y1,\n x2 = that._x2,\n y2 = that._y2;\n\n if (that._l01_a > epsilon) {\n var a = 2 * that._l01_2a + 3 * that._l01_a * that._l12_a + that._l12_2a,\n n = 3 * that._l01_a * (that._l01_a + that._l12_a);\n x1 = (x1 * a - that._x0 * that._l12_2a + that._x2 * that._l01_2a) / n;\n y1 = (y1 * a - that._y0 * that._l12_2a + that._y2 * that._l01_2a) / n;\n }\n\n if (that._l23_a > epsilon) {\n var b = 2 * that._l23_2a + 3 * that._l23_a * that._l12_a + that._l12_2a,\n m = 3 * that._l23_a * (that._l23_a + that._l12_a);\n x2 = (x2 * b + that._x1 * that._l23_2a - x * that._l12_2a) / m;\n y2 = (y2 * b + that._y1 * that._l23_2a - y * that._l12_2a) / m;\n }\n\n that._context.bezierCurveTo(x1, y1, x2, y2, that._x2, that._y2);\n}\n\nfunction CatmullRom(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRom.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x2, this._y2); break;\n case 3: this.point(this._x2, this._y2); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; // proceed\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRom(context, alpha) : new Cardinal(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n","function sign(x) {\n return x < 0 ? -1 : 1;\n}\n\n// Calculate the slopes of the tangents (Hermite-type interpolation) based on\n// the following paper: Steffen, M. 1990. A Simple Method for Monotonic\n// Interpolation in One Dimension. Astronomy and Astrophysics, Vol. 239, NO.\n// NOV(II), P. 443, 1990.\nfunction slope3(that, x2, y2) {\n var h0 = that._x1 - that._x0,\n h1 = x2 - that._x1,\n s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0),\n s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0),\n p = (s0 * h1 + s1 * h0) / (h0 + h1);\n return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;\n}\n\n// Calculate a one-sided slope.\nfunction slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}\n\n// According to https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Representations\n// \"you can express cubic Hermite interpolation in terms of cubic Bézier curves\n// with respect to the four values p0, p0 + m0 / 3, p1 - m1 / 3, p1\".\nfunction point(that, t0, t1) {\n var x0 = that._x0,\n y0 = that._y0,\n x1 = that._x1,\n y1 = that._y1,\n dx = (x1 - x0) / 3;\n that._context.bezierCurveTo(x0 + dx, y0 + dx * t0, x1 - dx, y1 - dx * t1, x1, y1);\n}\n\nfunction MonotoneX(context) {\n this._context = context;\n}\n\nMonotoneX.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 =\n this._t0 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x1, this._y1); break;\n case 3: point(this, this._t0, slope2(this, this._t0)); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n var t1 = NaN;\n\n x = +x, y = +y;\n if (x === this._x1 && y === this._y1) return; // Ignore coincident points.\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; point(this, slope2(this, t1 = slope3(this, x, y)), t1); break;\n default: point(this, this._t0, t1 = slope3(this, x, y)); break;\n }\n\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n this._t0 = t1;\n }\n}\n\nfunction MonotoneY(context) {\n this._context = new ReflectContext(context);\n}\n\n(MonotoneY.prototype = Object.create(MonotoneX.prototype)).point = function(x, y) {\n MonotoneX.prototype.point.call(this, y, x);\n};\n\nfunction ReflectContext(context) {\n this._context = context;\n}\n\nReflectContext.prototype = {\n moveTo: function(x, y) { this._context.moveTo(y, x); },\n closePath: function() { this._context.closePath(); },\n lineTo: function(x, y) { this._context.lineTo(y, x); },\n bezierCurveTo: function(x1, y1, x2, y2, x, y) { this._context.bezierCurveTo(y1, x1, y2, x2, y, x); }\n};\n\nexport function monotoneX(context) {\n return new MonotoneX(context);\n}\n\nexport function monotoneY(context) {\n return new MonotoneY(context);\n}\n","function Natural(context) {\n this._context = context;\n}\n\nNatural.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x = [];\n this._y = [];\n },\n lineEnd: function() {\n var x = this._x,\n y = this._y,\n n = x.length;\n\n if (n) {\n this._line ? this._context.lineTo(x[0], y[0]) : this._context.moveTo(x[0], y[0]);\n if (n === 2) {\n this._context.lineTo(x[1], y[1]);\n } else {\n var px = controlPoints(x),\n py = controlPoints(y);\n for (var i0 = 0, i1 = 1; i1 < n; ++i0, ++i1) {\n this._context.bezierCurveTo(px[0][i0], py[0][i0], px[1][i0], py[1][i0], x[i1], y[i1]);\n }\n }\n }\n\n if (this._line || (this._line !== 0 && n === 1)) this._context.closePath();\n this._line = 1 - this._line;\n this._x = this._y = null;\n },\n point: function(x, y) {\n this._x.push(+x);\n this._y.push(+y);\n }\n};\n\n// See https://www.particleincell.com/2012/bezier-splines/ for derivation.\nfunction controlPoints(x) {\n var i,\n n = x.length - 1,\n m,\n a = new Array(n),\n b = new Array(n),\n r = new Array(n);\n a[0] = 0, b[0] = 2, r[0] = x[0] + 2 * x[1];\n for (i = 1; i < n - 1; ++i) a[i] = 1, b[i] = 4, r[i] = 4 * x[i] + 2 * x[i + 1];\n a[n - 1] = 2, b[n - 1] = 7, r[n - 1] = 8 * x[n - 1] + x[n];\n for (i = 1; i < n; ++i) m = a[i] / b[i - 1], b[i] -= m, r[i] -= m * r[i - 1];\n a[n - 1] = r[n - 1] / b[n - 1];\n for (i = n - 2; i >= 0; --i) a[i] = (r[i] - a[i + 1]) / b[i];\n b[n - 1] = (x[n] + a[n - 1]) / 2;\n for (i = 0; i < n - 1; ++i) b[i] = 2 * x[i + 1] - a[i + 1];\n return [a, b];\n}\n\nexport default function(context) {\n return new Natural(context);\n}\n","function Step(context, t) {\n this._context = context;\n this._t = t;\n}\n\nStep.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x = this._y = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (0 < this._t && this._t < 1 && this._point === 2) this._context.lineTo(this._x, this._y);\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n if (this._line >= 0) this._t = 1 - this._t, this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // proceed\n default: {\n if (this._t <= 0) {\n this._context.lineTo(this._x, y);\n this._context.lineTo(x, y);\n } else {\n var x1 = this._x * (1 - this._t) + x * this._t;\n this._context.lineTo(x1, this._y);\n this._context.lineTo(x1, y);\n }\n break;\n }\n }\n this._x = x, this._y = y;\n }\n};\n\nexport default function(context) {\n return new Step(context, 0.5);\n}\n\nexport function stepBefore(context) {\n return new Step(context, 0);\n}\n\nexport function stepAfter(context) {\n return new Step(context, 1);\n}\n","export var slice = Array.prototype.slice;\n","export default function(x) {\n return x;\n}\n","import {slice} from \"./array\";\nimport identity from \"./identity\";\n\nvar top = 1,\n right = 2,\n bottom = 3,\n left = 4,\n epsilon = 1e-6;\n\nfunction translateX(x) {\n return \"translate(\" + (x + 0.5) + \",0)\";\n}\n\nfunction translateY(y) {\n return \"translate(0,\" + (y + 0.5) + \")\";\n}\n\nfunction number(scale) {\n return function(d) {\n return +scale(d);\n };\n}\n\nfunction center(scale) {\n var offset = Math.max(0, scale.bandwidth() - 1) / 2; // Adjust for 0.5px offset.\n if (scale.round()) offset = Math.round(offset);\n return function(d) {\n return +scale(d) + offset;\n };\n}\n\nfunction entering() {\n return !this.__axis;\n}\n\nfunction axis(orient, scale) {\n var tickArguments = [],\n tickValues = null,\n tickFormat = null,\n tickSizeInner = 6,\n tickSizeOuter = 6,\n tickPadding = 3,\n k = orient === top || orient === left ? -1 : 1,\n x = orient === left || orient === right ? \"x\" : \"y\",\n transform = orient === top || orient === bottom ? translateX : translateY;\n\n function axis(context) {\n var values = tickValues == null ? (scale.ticks ? scale.ticks.apply(scale, tickArguments) : scale.domain()) : tickValues,\n format = tickFormat == null ? (scale.tickFormat ? scale.tickFormat.apply(scale, tickArguments) : identity) : tickFormat,\n spacing = Math.max(tickSizeInner, 0) + tickPadding,\n range = scale.range(),\n range0 = +range[0] + 0.5,\n range1 = +range[range.length - 1] + 0.5,\n position = (scale.bandwidth ? center : number)(scale.copy()),\n selection = context.selection ? context.selection() : context,\n path = selection.selectAll(\".domain\").data([null]),\n tick = selection.selectAll(\".tick\").data(values, scale).order(),\n tickExit = tick.exit(),\n tickEnter = tick.enter().append(\"g\").attr(\"class\", \"tick\"),\n line = tick.select(\"line\"),\n text = tick.select(\"text\");\n\n path = path.merge(path.enter().insert(\"path\", \".tick\")\n .attr(\"class\", \"domain\")\n .attr(\"stroke\", \"currentColor\"));\n\n tick = tick.merge(tickEnter);\n\n line = line.merge(tickEnter.append(\"line\")\n .attr(\"stroke\", \"currentColor\")\n .attr(x + \"2\", k * tickSizeInner));\n\n text = text.merge(tickEnter.append(\"text\")\n .attr(\"fill\", \"currentColor\")\n .attr(x, k * spacing)\n .attr(\"dy\", orient === top ? \"0em\" : orient === bottom ? \"0.71em\" : \"0.32em\"));\n\n if (context !== selection) {\n path = path.transition(context);\n tick = tick.transition(context);\n line = line.transition(context);\n text = text.transition(context);\n\n tickExit = tickExit.transition(context)\n .attr(\"opacity\", epsilon)\n .attr(\"transform\", function(d) { return isFinite(d = position(d)) ? transform(d) : this.getAttribute(\"transform\"); });\n\n tickEnter\n .attr(\"opacity\", epsilon)\n .attr(\"transform\", function(d) { var p = this.parentNode.__axis; return transform(p && isFinite(p = p(d)) ? p : position(d)); });\n }\n\n tickExit.remove();\n\n path\n .attr(\"d\", orient === left || orient == right\n ? (tickSizeOuter ? \"M\" + k * tickSizeOuter + \",\" + range0 + \"H0.5V\" + range1 + \"H\" + k * tickSizeOuter : \"M0.5,\" + range0 + \"V\" + range1)\n : (tickSizeOuter ? \"M\" + range0 + \",\" + k * tickSizeOuter + \"V0.5H\" + range1 + \"V\" + k * tickSizeOuter : \"M\" + range0 + \",0.5H\" + range1));\n\n tick\n .attr(\"opacity\", 1)\n .attr(\"transform\", function(d) { return transform(position(d)); });\n\n line\n .attr(x + \"2\", k * tickSizeInner);\n\n text\n .attr(x, k * spacing)\n .text(format);\n\n selection.filter(entering)\n .attr(\"fill\", \"none\")\n .attr(\"font-size\", 10)\n .attr(\"font-family\", \"sans-serif\")\n .attr(\"text-anchor\", orient === right ? \"start\" : orient === left ? \"end\" : \"middle\");\n\n selection\n .each(function() { this.__axis = position; });\n }\n\n axis.scale = function(_) {\n return arguments.length ? (scale = _, axis) : scale;\n };\n\n axis.ticks = function() {\n return tickArguments = slice.call(arguments), axis;\n };\n\n axis.tickArguments = function(_) {\n return arguments.length ? (tickArguments = _ == null ? [] : slice.call(_), axis) : tickArguments.slice();\n };\n\n axis.tickValues = function(_) {\n return arguments.length ? (tickValues = _ == null ? null : slice.call(_), axis) : tickValues && tickValues.slice();\n };\n\n axis.tickFormat = function(_) {\n return arguments.length ? (tickFormat = _, axis) : tickFormat;\n };\n\n axis.tickSize = function(_) {\n return arguments.length ? (tickSizeInner = tickSizeOuter = +_, axis) : tickSizeInner;\n };\n\n axis.tickSizeInner = function(_) {\n return arguments.length ? (tickSizeInner = +_, axis) : tickSizeInner;\n };\n\n axis.tickSizeOuter = function(_) {\n return arguments.length ? (tickSizeOuter = +_, axis) : tickSizeOuter;\n };\n\n axis.tickPadding = function(_) {\n return arguments.length ? (tickPadding = +_, axis) : tickPadding;\n };\n\n return axis;\n}\n\nexport function axisTop(scale) {\n return axis(top, scale);\n}\n\nexport function axisRight(scale) {\n return axis(right, scale);\n}\n\nexport function axisBottom(scale) {\n return axis(bottom, scale);\n}\n\nexport function axisLeft(scale) {\n return axis(left, scale);\n}\n","import { SVGWidget } from \"@hpcc-js/common\";\nimport { axisBottom as d3AxisBottom, axisLeft as d3AxisLeft, axisRight as d3AxisRight, axisTop as d3AxisTop } from \"d3-axis\";\nimport { format as d3Format } from \"d3-format\";\nimport { scaleBand as d3ScaleBand, scaleLinear as d3ScaleLinear, scaleLog as d3ScaleLog, scalePow as d3ScalePow, scaleTime as d3ScaleTime } from \"d3-scale\";\nimport { select as d3Select } from \"d3-selection\";\nimport { timeFormat as d3TimeFormat, timeParse as d3TimeParse } from \"d3-time-format\";\n\nimport \"../src/Axis.css\";\n\nexport interface IOverflow {\n left: number;\n top: number;\n right: number;\n bottom: number;\n depth: number;\n tickOverlapModulus: number;\n}\n\nexport class Axis extends SVGWidget {\n _origType;\n _origTimePattern;\n\n protected parser;\n protected parserInvert;\n protected formatter: (date: Date) => string;\n protected d3Scale;\n protected d3Axis;\n protected d3Guides;\n protected _guideElement;\n protected svg;\n protected svgAxis;\n protected svgGuides;\n\n constructor(drawStartPosition: \"origin\" | \"center\" = \"origin\") {\n super();\n this._drawStartPos = drawStartPosition;\n\n this.updateScale();\n }\n\n lowValue() {\n return this.parse(this.low());\n }\n\n highValue() {\n return this.parse(this.high());\n }\n\n parse(d, forceNumeric?) {\n if (d instanceof Array) {\n return d.map(function (d2) {\n return this.parse(d2);\n }, this);\n }\n if (d !== undefined && d !== null) {\n if (this.parser) {\n return this.parser(typeof d === \"number\" ? d.toString() : d);\n }\n if (forceNumeric && typeof d === \"string\") {\n return +d;\n }\n }\n return d;\n }\n\n parseInvert(d) {\n if (d instanceof Array) {\n return d.map(function (d2) {\n return this.parseInvert(d2);\n }, this);\n }\n if (this.parserInvert && d) {\n return this.parserInvert(d);\n }\n return d;\n }\n\n format(d) {\n if (d instanceof Array) {\n return d.map(function (d2) {\n return this.format(d2);\n }, this);\n }\n if (d !== undefined && d !== null && this.formatter) {\n return this.formatter(d);\n }\n return d;\n }\n\n parseFormat(d) {\n return this.format(this.parse(d));\n }\n\n scalePos(d) {\n let retVal = this.d3Scale(this.parse(d));\n if (this.type() === \"ordinal\") {\n retVal += this.bandwidth() / 2;\n }\n return retVal;\n }\n\n bandwidth() {\n return this.d3Scale.bandwidth ? this.d3Scale.bandwidth() : 0;\n }\n\n isHorizontal() {\n switch (this.orientation()) {\n case \"left\":\n case \"right\":\n return false;\n default:\n }\n return true;\n }\n\n domain(_?) {\n if (!arguments.length) return this.d3Scale.domain();\n this.d3Scale.domain(_);\n return this;\n }\n\n range(_?) {\n if (!arguments.length) {\n if (this.d3Scale.rangeRoundBands) {\n return this.d3Scale.rangeExtent();\n } else if (this.d3Scale.rangeRound) {\n return this.d3Scale.range();\n }\n }\n if (this.d3Scale.rangeRoundBands) {\n this.d3Scale.rangeRoundBands(_, 0.1);\n } else if (this.d3Scale.rangeRound) {\n this.d3Scale.range(_);\n }\n return this;\n }\n\n invert(pos) {\n return this.d3Scale.invert(pos);\n }\n\n guideTarget(_) {\n this._guideElement = d3Select(_)\n .attr(\"class\", this._class)\n ;\n return this;\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n this.svg = element.append(\"g\");\n this.svgAxis = this.svg.append(\"g\")\n .attr(\"class\", \"axis\")\n ;\n this.svgGuides = (this._guideElement || element).append(\"g\")\n .attr(\"class\", \"guide\")\n ;\n }\n\n protected _prevOrientation;\n updateScale(): this {\n switch (this.type()) {\n case \"ordinal\":\n this.d3Scale = d3ScaleBand()\n .paddingInner(this.ordinalPaddingInner())\n .paddingOuter(this.ordinalPaddingOuter())\n ;\n if (this.ordinals_exists()) {\n this.d3Scale.domain(this.ordinals());\n }\n this.parser = null;\n if (this.ordinalMappings_exists()) {\n const mappings = this.ordinalMappings();\n this.formatter = (_: any) => mappings[_] || _;\n } else {\n this.formatter = null;\n }\n break;\n case \"linear\":\n this.d3Scale = d3ScaleLinear();\n if (this.low_exists() && this.high_exists()) {\n this.d3Scale.domain([this.lowValue(), this.highValue()]);\n }\n this.parser = null;\n this.formatter = this.tickFormat_exists() ? d3Format(this.tickFormat()) : null;\n break;\n case \"pow\":\n this.d3Scale = d3ScalePow()\n .exponent(this.powExponent())\n ;\n if (this.low_exists() && this.high_exists()) {\n this.d3Scale.domain([this.lowValue(), this.highValue()]);\n }\n this.parser = null;\n this.formatter = this.tickFormat_exists() ? d3Format(this.tickFormat()) : null;\n break;\n case \"log\":\n this.d3Scale = d3ScaleLog()\n .base(this.logBase())\n ;\n if (this.low_exists() && this.high_exists()) {\n this.d3Scale.domain([this.lowValue(), this.highValue()]);\n }\n this.parser = null;\n this.formatter = this.tickFormat_exists() ? d3Format(this.tickFormat()) : null;\n break;\n case \"time\":\n this.d3Scale = d3ScaleTime();\n if (this.low_exists() && this.high_exists()) {\n this.d3Scale.domain([this.lowValue(), this.highValue()]);\n }\n this.parser = this.timePattern_exists() ? d3TimeParse(this.timePattern()) : null;\n this.parserInvert = this.timePattern_exists() ? d3TimeFormat(this.timePattern()) : null;\n this.formatter = this.tickFormat_exists() ? d3TimeFormat(this.tickFormat()) : null;\n break;\n default:\n }\n if (this._prevOrientation !== this.orientation()) {\n switch (this.orientation()) {\n case \"left\":\n this.d3Axis = d3AxisLeft(this.d3Scale);\n this.d3Guides = d3AxisLeft(this.d3Scale);\n break;\n case \"top\":\n this.d3Axis = d3AxisTop(this.d3Scale);\n this.d3Guides = d3AxisTop(this.d3Scale);\n break;\n case \"right\":\n this.d3Axis = d3AxisRight(this.d3Scale);\n this.d3Guides = d3AxisRight(this.d3Scale);\n break;\n case \"bottom\":\n default:\n this.d3Axis = d3AxisBottom(this.d3Scale);\n this.d3Guides = d3AxisBottom(this.d3Scale);\n break;\n }\n this._prevOrientation = this.orientation();\n if (this.svgAxis) {\n this.svgAxis.html(\"\");\n }\n if (this.svgGuides) {\n this.svgGuides.html(\"\");\n }\n }\n\n if (this.extend()) {\n switch (this.type()) {\n case \"ordinal\":\n break;\n default:\n let length;\n let delta;\n let low;\n let high;\n let newLow;\n let newHigh;\n if (this.isHorizontal()) {\n length = this.width();\n this.d3Scale.range([0, length]);\n delta = length * this.extend() / 100;\n low = this.d3Scale.invert(0);\n newLow = this.d3Scale.invert(-delta);\n high = this.d3Scale.invert(length);\n newHigh = this.d3Scale.invert(length + delta);\n } else {\n length = this.height();\n this.d3Scale.range([length, 0]);\n delta = length * this.extend() / 100;\n low = this.d3Scale.invert(length);\n newLow = this.d3Scale.invert(length + delta);\n high = this.d3Scale.invert(0);\n newHigh = this.d3Scale.invert(-delta);\n }\n if (newLow === low) { // Edge case when there is only one item in the domain ---\n newLow = low - low * this.extend() / 100;\n }\n if (newHigh === high) { // Edge case when there is only one item in the domain ---\n newHigh = high + high * this.extend() / 100;\n }\n if ((Math as any).sign(low) !== (Math as any).sign(newLow)) {\n newLow = 0;\n }\n if ((Math as any).sign(high) !== (Math as any).sign(newHigh)) {\n newHigh = 0;\n }\n this.d3Scale.domain([newLow, newHigh]);\n break;\n }\n }\n\n this.d3Axis\n .scale(this.d3Scale)\n .tickFormat(this.formatter)\n .ticks(this.tickCount())\n ;\n this.d3Guides\n .scale(this.d3Scale)\n .tickSize(this.tickLength_exists() ? -this.tickLength() : 0)\n .tickFormat(\"\")\n .ticks(this.tickCount())\n ;\n const customTicks = this.ticks();\n if (customTicks.length) {\n this.d3Axis\n .tickValues(customTicks.map(d => this.parse(d.value)))\n .tickFormat((_d, i) => {\n return customTicks[i].label;\n });\n this.d3Guides\n .tickValues(customTicks.map(d => this.parse(d.value)));\n }\n return this;\n }\n\n adjustText(svg, tickOverlapModulus) {\n const isHoriztontal = this.isHorizontal();\n const isLeft = this.orientation() === \"left\";\n const isBottom = this.orientation() === \"bottom\";\n const context = this;\n const textSelection = svg.selectAll(\".tick > text\")\n .style(\"font-family\", this.fontFamily())\n .style(\"font-size\", this.fontSize_exists() ? this.fontSize() + \"px\" : null)\n ;\n if (this.overlapMode() === \"linebreak\") {\n if (this.type() === \"ordinal\") {\n textSelection\n .call(function () {\n return context.linebreak.apply(context, arguments);\n }, this.bandwidth())\n ;\n }\n } else if (this.overlapMode() === \"wrap\") {\n if (this.type() === \"ordinal\") {\n textSelection\n .call(function () {\n return context.wrap.apply(context, arguments);\n }, this.bandwidth())\n ;\n }\n } else {\n switch (isHoriztontal ? this.overlapMode() : \"none\") {\n case \"stagger\":\n textSelection\n .style(\"text-anchor\", \"middle\")\n .attr(\"dy\", function (_d, i) { return (isBottom ? 1 : -1) * ((isBottom ? 0.71 : 0) + i % tickOverlapModulus) + \"em\"; })\n .attr(\"dx\", 0)\n .attr(\"visibility\", null)\n .attr(\"transform\", \"rotate(0)\")\n ;\n break;\n case \"hide\":\n textSelection\n .style(\"text-anchor\", \"middle\")\n .attr(\"dy\", (isBottom ? 0.71 : 0) + \"em\")\n .attr(\"dx\", 0)\n .attr(\"visibility\", function (_d, i) { return i % tickOverlapModulus ? \"hidden\" : null; })\n .attr(\"transform\", \"rotate(0)\")\n ;\n break;\n case \"rotate\":\n const deg = -(this.labelRotation()) || 0;\n if (deg !== 0 && tickOverlapModulus > 1) {\n textSelection\n .each(function () {\n const elm = d3Select(this);\n const bbox = elm.node().getBBox();\n const dyOff = (isBottom ? 1 : -1) * Math.sin(Math.PI * (-Math.abs(deg) / 180));\n elm\n .style(\"text-anchor\", deg > 0 ? (isBottom ? \"start\" : \"end\") : (isBottom ? \"end\" : \"start\"))\n .attr(\"dy\", (bbox.height / 2 * dyOff) + \"px\")\n .attr(\"dx\", deg > 0 ? (isBottom ? \"0.71em\" : \"-0.71em\") : (isBottom ? \"-0.71em\" : \"0.71em\"))\n .attr(\"transform\", \"rotate(\" + deg + \")\")\n .attr(\"visibility\", null)\n ;\n })\n ;\n break;\n }\n /* falls through */\n default:\n textSelection\n .style(\"text-anchor\", isHoriztontal ? \"middle\" : isLeft ? \"end\" : \"start\")\n .attr(\"dy\", isHoriztontal ? ((isBottom ? 0.71 : 0) + \"em\") : \"0.32em\")\n .attr(\"dx\", 0)\n .attr(\"visibility\", null)\n .attr(\"transform\", \"rotate(0)\")\n ;\n }\n }\n }\n\n calcTickOverlapModulus(element) {\n let retVal = 1;\n switch (this.overlapMode()) {\n case \"rotate\":\n case \"stagger\":\n case \"hide\":\n const bboxArr = [];\n element.selectAll(\".tick > text\").each(function () {\n const bbox = this.getBoundingClientRect();\n for (let i = bboxArr.length - 1; i >= 0; --i) {\n if (bboxArr[i].right < bbox.left) {\n break;\n }\n if (bboxArr.length + 1 - i > retVal) {\n retVal = bboxArr.length + 1 - i;\n }\n }\n bboxArr.push(bbox);\n });\n break;\n default:\n }\n return retVal;\n }\n\n calcOverflow(element, ignoreText?): IOverflow {\n this.updateScale();\n if (this.hidden()) {\n return {\n left: 0,\n top: 0,\n right: 0,\n bottom: 0,\n depth: 0,\n tickOverlapModulus: 1\n };\n }\n const isHorizontal = this.isHorizontal();\n this.range(isHorizontal ? [0, this.width()] : [this.height(), 0]);\n const tmpSvg = element.append(\"g\").attr(\"class\", this.classID());\n const tmpSvgG = tmpSvg.append(\"g\");\n tmpSvgG\n .attr(\"class\", isHorizontal ? \"x\" : \"y\")\n .call(this.d3Axis)\n ;\n if (ignoreText) {\n element.selectAll(\".tick > text\").remove();\n }\n\n const retVal: IOverflow = {\n left: 0,\n top: 0,\n right: 0,\n bottom: 0,\n depth: 0,\n tickOverlapModulus: this.calcTickOverlapModulus(tmpSvgG)\n };\n this.adjustText(tmpSvgG, retVal.tickOverlapModulus);\n\n const bbox = tmpSvgG.node().getBBox();\n retVal.depth = isHorizontal ? bbox.height : bbox.width;\n switch (this.shrinkToFit()) {\n case \"low\":\n case \"both\":\n retVal.left = isHorizontal ? -bbox.x : 0;\n retVal.bottom = isHorizontal ? 0 : -(this.height() - (bbox.height + bbox.y));\n break;\n default:\n }\n switch (this.shrinkToFit()) {\n case \"high\":\n case \"both\":\n retVal.top = isHorizontal ? 0 : -bbox.y;\n retVal.right = isHorizontal ? -(this.width() - bbox.x - bbox.width) : 0;\n break;\n default:\n }\n tmpSvg.remove();\n\n return retVal;\n }\n\n wrap(_text, bandSize, re) {\n re = re || /\\s+/;\n const context = this;\n _text.each(function () {\n const text = d3Select(this);\n const words = text.text().split(re).reverse();\n let line = [];\n let lineNumber = 0;\n const lineHeight = 1.1;\n const x = text.attr(\"x\");\n const y = text.attr(\"y\");\n const fs = parseFloat(text.style(\"font-size\")) || 10;\n const maxLinesPerBand = Math.floor(bandSize / (fs * lineHeight)) - 1;\n const minWordsPerLine = context.isHorizontal() ? 1 : Math.ceil(words.length / maxLinesPerBand);\n const dy = parseFloat(text.attr(\"dy\"))\n ;\n let tspan = text.text(null).append(\"tspan\")\n .attr(\"x\", x)\n .attr(\"y\", y)\n .attr(\"dy\", dy + \"em\")\n ;\n let wordsOnLine = 0;\n let word = words.pop();\n while (word) {\n line.push(word);\n tspan.text(line.join(\" \"));\n wordsOnLine++;\n if ((tspan.node() as any).getComputedTextLength() > bandSize && wordsOnLine >= minWordsPerLine) {\n line.pop();\n tspan.text(line.join(\" \"));\n line = [word];\n tspan = text.append(\"tspan\").attr(\"x\", x).attr(\"y\", y).attr(\"dy\", ++lineNumber * lineHeight + dy + \"em\").text(word);\n wordsOnLine = 0;\n }\n word = words.pop();\n }\n if (!context.isHorizontal()) {\n text.selectAll(\"tspan\")\n .attr(\"y\", (-lineNumber / 2) + \"em\")\n ;\n }\n });\n }\n\n linebreak(text, bandSize) {\n this.wrap(text, bandSize, \"\\n\");\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n\n this.svg.style(\"display\", this.hidden() ? \"none\" : null);\n\n const overlap = this.calcOverflow(element);\n\n const lowerPos: number = this.isHorizontal() ? overlap.left : this.height() - overlap.top - overlap.bottom;\n const upperPos: number = this.isHorizontal() ? this.width() - overlap.right - this.padding() : 0 + this.padding();\n\n this.range(this.reverse() ? [upperPos, lowerPos] : [lowerPos, upperPos]);\n\n const context = this;\n function doPosition(element) {\n element.attr(\"transform\", function () {\n switch (context.orientation()) {\n case \"left\":\n return \"translate(\" + overlap.depth + \", \" + overlap.top + \")\";\n case \"top\":\n return \"translate(0,\" + overlap.depth + \")\";\n case \"right\":\n return \"translate(\" + (context.width() - overlap.depth) + \", \" + overlap.top + \")\";\n case \"bottom\":\n return \"translate(0,\" + (context.height() - overlap.depth) + \")\";\n default:\n }\n return \"translate(0,0)\";\n });\n }\n this.svg\n // .attr(\"class\", this.isHorizontal() ? \"x\" : \"y\")\n .style(\"visibility\", this.type() === \"none\" ? \"hidden\" : null)\n .transition()\n .call(doPosition)\n ;\n if (this._guideElement) {\n this.svgGuides\n .transition()\n .call(doPosition)\n ;\n }\n this.svgAxis\n .call(this.d3Axis)\n ;\n this.adjustText(this.svgAxis, overlap.tickOverlapModulus);\n\n const svgLineBBox = {\n x: this.pos().x,\n width: this.width()\n };\n const svgText = this.svgAxis.selectAll(\".axisTitle\").data(this.title() ? [this.title()] : []);\n const svgTextUpdate = svgText.enter().append(\"text\")\n .attr(\"class\", \"axisTitle\")\n .merge(svgText)\n ;\n const svgTitleTransition = svgTextUpdate.transition()\n .attr(\"dx\", null)\n .style(\"text-anchor\", \"end\")\n ;\n switch (this.orientation()) {\n case \"left\":\n svgTitleTransition\n .attr(\"transform\", \"rotate(-90)\")\n .attr(\"x\", -2)\n .attr(\"y\", 2)\n .attr(\"dy\", \".71em\")\n ;\n break;\n case \"right\":\n svgTitleTransition\n .attr(\"transform\", \"rotate(-90)\")\n .attr(\"x\", -2)\n .attr(\"y\", 4)\n .attr(\"dx\", null)\n .attr(\"dy\", \"-.71em\")\n ;\n break;\n case \"top\":\n svgTitleTransition\n .attr(\"transform\", \"rotate(0)\")\n .attr(\"x\", svgLineBBox.width - 2)\n .attr(\"y\", 2)\n .attr(\"dx\", null)\n .attr(\"dy\", \".71em\")\n ;\n break;\n case \"bottom\":\n svgTitleTransition\n .attr(\"transform\", \"rotate(0)\")\n .attr(\"x\", svgLineBBox.width - 2)\n .attr(\"y\", -2)\n .attr(\"dy\", null)\n ;\n break;\n default:\n }\n svgTitleTransition\n .text(this.title_exists() ? this.title() : \"\")\n ;\n svgText.exit().remove();\n this.svgGuides\n .call(this.d3Guides)\n .selectAll(\".tick\").classed(\"guide-0\", d => d === 0 && this.low() < 0)\n ;\n }\n\n rerender() {\n this.svgAxis.call(this.d3Axis);\n this.svgGuides.call(this.d3Guides);\n }\n\n postUpdate(domNode, element) {\n super.postUpdate(domNode, element);\n if (this._guideElement) {\n this._guideElement\n .attr(\"transform\", this._element.attr(\"transform\"))\n ;\n }\n }\n}\nAxis.prototype._class += \" chart_Axis\";\n\nexport interface Axis {\n type(): string;\n type(_: string): this;\n type_exists(): boolean;\n timePattern(): string;\n timePattern(_: string): this;\n timePattern_exists(): boolean;\n reverse(): boolean;\n reverse(_: boolean): this;\n\n title(): string;\n title(_: string): this;\n title_exists(): boolean;\n orientation(): string;\n orientation(_: string): this;\n orientation_default(): string;\n orientation_default(_: string): this;\n powExponent(): number;\n powExponent(_: number): this;\n logBase(): number;\n logBase(_: number): this;\n ordinals(): string[];\n ordinals(_: string[]): this;\n ordinals_exists(): boolean;\n fontSize(): number;\n fontSize(_: number): this;\n fontSize_exists(): boolean;\n fontFamily(): string;\n fontFamily(_: string): this;\n tickCount(): number;\n tickCount(_: number): this;\n tickFormat(): string;\n tickFormat(_: string): this;\n tickFormat_exists(): boolean;\n tickFormat_reset(): void;\n tickLength(): number;\n tickLength(_: number): this;\n tickLength_exists(): boolean;\n ticks(): Array<{ value: string, label: string }>;\n ticks(_: Array<{ value: string, label: string }>): this;\n low(): any;\n low(_: any): this;\n low_exists(): boolean;\n high(): any;\n high(_: any): this;\n high_exists(): boolean;\n overlapMode(): string;\n overlapMode(_: string): this;\n overlapMode_default(): string;\n overlapMode_default(_: string): this;\n labelRotation(): number;\n labelRotation(_: number): this;\n shrinkToFit(): string;\n shrinkToFit(_: string): this;\n shrinkToFit_default(): string;\n shrinkToFit_default(_: string): this;\n extend(): number;\n extend(_: number): this;\n extend_default(): number;\n extend_default(_: number): this;\n hidden(): boolean;\n hidden(_: boolean): this;\n\n ordinalPaddingInner(): number;\n ordinalPaddingInner(_: number): this;\n ordinalPaddingOuter(): number;\n ordinalPaddingOuter(_: number): this;\n ordinalMappings(_: { [key: string]: string }): this;\n ordinalMappings(): { [key: string]: string };\n ordinalMappings_exists(): boolean;\n padding(): number;\n padding(_: number): this;\n}\n\nAxis.prototype.publish(\"type\", \"linear\", \"set\", \"Type\", [\"none\", \"ordinal\", \"linear\", \"pow\", \"log\", \"time\"]);\nAxis.prototype.publish(\"timePattern\", \"%Y-%m-%d\", \"string\", \"Time Series Pattern\", null, { disable: (w: any) => w.type() !== \"time\" });\nAxis.prototype.publish(\"reverse\", false, \"boolean\", \"Reverse\");\n\nAxis.prototype.publish(\"title\", null, \"string\", \"Title\");\nAxis.prototype.publish(\"orientation\", \"bottom\", \"set\", \"Placement/orientation of the axis\", [\"left\", \"top\", \"right\", \"bottom\"]);\nAxis.prototype.publish(\"powExponent\", 2, \"number\", \"Power exponent (disabled when type is not 'pow')\", null, { disable: (w: any) => w.type() !== \"pow\" });\nAxis.prototype.publish(\"logBase\", 10, \"number\", \"Logarithmic base (disabled when type is not 'log')\", null, { disable: (w: any) => w.type() !== \"log\" });\nAxis.prototype.publish(\"ordinals\", [], \"array\", \"Array of ordinal values to display (disabled when type is not 'ordinal')\", null, { disable: (w: any) => w.type() !== \"ordinal\" });\nAxis.prototype.publish(\"fontSize\", null, \"number\", \"Size of tick label font (pixels)\", null, { optional: true });\nAxis.prototype.publish(\"fontFamily\", null, \"string\", \"Font family of tick labels\", null, { optional: true });\nAxis.prototype.publish(\"tickCount\", null, \"number\", \"Number of ticks to display (disabled when type is 'ordinal')\", null, { optional: true, disable: (w: any) => w.type() === \"ordinal\" });\nAxis.prototype.publish(\"tickFormat\", null, \"string\", \"Format rules for tick text (disabled when type is 'ordinal')\", null, { optional: true, disable: (w: any) => w.type() === \"ordinal\" });\nAxis.prototype.publish(\"tickLength\", null, \"number\", \"Height (or width for left/right orientations) of the axis ticks (in pixels)\", null, { optional: true });\nAxis.prototype.publish(\"ticks\", [], \"array\", \"Custom tick labels\", null, { optional: true }); // TODO: What does this control?\nAxis.prototype.publish(\"low\", null, \"any\", \"Minimum tick value (disabled when type is ordinal)\", null, { optional: true, disable: (w: any) => w.type() === \"ordinal\" });\nAxis.prototype.publish(\"high\", null, \"any\", \"Maximum tick value (disabled when type is ordinal)\", null, { optional: true, disable: (w: any) => w.type() === \"ordinal\" });\nAxis.prototype.publish(\"overlapMode\", \"none\", \"set\", \"Specifies the behavior when tick labels overlap\", [\"none\", \"stagger\", \"hide\", \"rotate\", \"linebreak\", \"wrap\"]);\nAxis.prototype.publish(\"labelRotation\", 33, \"number\", \"Angle of rotation for tick labels (disabled when overlapMode is not 'rotate')\", null, { optional: true, disable: (w: any) => w.overlapMode() !== \"rotate\" });\nAxis.prototype.publish(\"shrinkToFit\", \"both\", \"set\", \"shrinkToFit\", [\"none\", \"low\", \"high\", \"both\"]); // TODO: What does this control?\nAxis.prototype.publish(\"extend\", 5, \"number\", \"Extend the axis range by this % beyond what is needed to display the data (disabled when type is 'ordinal')\", null, { optional: true, disable: (w: any) => w.type() === \"ordinal\" });\nAxis.prototype.publish(\"hidden\", false, \"boolean\", \"Hides axis when 'true'\");\n\nAxis.prototype.publish(\"ordinalPaddingInner\", 0.1, \"number\", \"Determines the ratio of the range that is reserved for blank space between band (0->1)\", null, { disable: (w: Axis) => w.type() !== \"ordinal\" });\nAxis.prototype.publish(\"ordinalPaddingOuter\", 0.1, \"number\", \"Determines the ratio of the range that is reserved for blank space before the first band and after the last band (0->1)\", null, { disable: (w: Axis) => w.type() !== \"ordinal\" });\nAxis.prototype.publish(\"ordinalMappings\", null, \"object\", \"Alternative label mappings (icons)\", null, { optional: true });\nAxis.prototype.publish(\"padding\", 0, \"number\", \"Padding space at top of axis (pixels)\", null, { optional: true });\n\nAxis.prototype._origType = Axis.prototype.type;\nAxis.prototype.type = function (_?: string) {\n const retVal = Axis.prototype._origType.apply(this, arguments);\n if (_ !== undefined) {\n this._type = _;\n this.updateScale();\n }\n return retVal;\n};\n\nAxis.prototype._origTimePattern = Axis.prototype.timePattern;\nAxis.prototype.timePattern = function (_?: string) {\n const retVal = Axis.prototype._origTimePattern.apply(this, arguments);\n if (_ !== undefined) {\n this._timePattern = _;\n this.updateScale();\n }\n return retVal;\n};\n","import { d3Event, select as d3Select, SVGWidget, Utility } from \"@hpcc-js/common\";\nimport { max as d3Max, min as d3Min } from \"d3-array\";\nimport { brush as d3Brush, brushSelection as d3BrushSelection, brushX as d3BrushX, brushY as d3BrushY } from \"d3-brush\";\nimport { hsl as d3Hsl } from \"d3-color\";\nimport { Axis } from \"./Axis.ts\";\n\nimport \"../src/XYAxis.css\";\n\nexport class XYAxis extends SVGWidget {\n protected domainAxis: Axis;\n protected valueAxis: Axis;\n protected xAxis: Axis;\n protected yAxis: Axis;\n protected xyBrush;\n protected xBrush;\n protected yBrush;\n protected margin;\n protected focusChart: XYAxis;\n\n constructor() {\n super();\n Utility.SimpleSelectionMixin.call(this);\n\n this._drawStartPos = \"origin\";\n\n this.domainAxis = new Axis()\n .classed({ domain: true })\n .orientation_default(\"bottom\")\n .type(\"ordinal\")\n .overlapMode_default(\"stagger\")\n .shrinkToFit_default(\"high\")\n .extend_default(0)\n ;\n this.valueAxis = new Axis()\n .classed({ value: true })\n .orientation_default(\"left\")\n .type(\"linear\")\n .shrinkToFit_default(\"high\")\n ;\n\n this.xyBrush = d3Brush()\n .on(\"end\", () => {\n return this.brushMoved();\n })\n .on(\"start.handle brush.handle end.handle\", () => {\n return this.brushMoved2();\n })\n ;\n this.xBrush = d3BrushX()\n .on(\"end\", () => {\n return this.brushMoved();\n })\n .on(\"start.handle brush.handle end.handle\", () => {\n return this.brushMoved2();\n })\n ;\n this.yBrush = d3BrushY()\n .on(\"end\", () => {\n return this.brushMoved();\n })\n .on(\"start.handle brush.handle end.handle\", () => {\n return this.brushMoved2();\n })\n ;\n }\n\n protected _prevBrush;\n resetSelection() {\n this._prevBrush = null;\n return this;\n }\n\n parseData(d) {\n return this.domainAxis.parse(d);\n }\n\n parseValue(d) {\n return this.valueAxis.parse(d, true);\n }\n\n formatData(d) {\n return this.domainAxis.format(d);\n }\n\n formatValue(d) {\n return this.valueAxis.format(d);\n }\n\n parsedData() {\n const retVal = this.data().map(function (row) {\n let prevValue = 0;\n return row.map(function (cell, idx) {\n if (idx === 0) {\n return this.parseData(cell);\n }\n if (idx >= this.columns().length) {\n return cell;\n }\n const _retVal = this.yAxisStacked() ? [prevValue, prevValue + this.parseValue(cell)] : this.parseValue(cell);\n prevValue += this.parseValue(cell);\n return _retVal;\n }, this);\n }, this);\n return retVal;\n }\n\n bandwidth() {\n return this.domainAxis.bandwidth();\n }\n\n protected svg;\n protected svgRegions;\n protected svgDomainGuide;\n protected svgValueGuide;\n protected svgData;\n protected svgDataClipRect;\n protected svgFocus;\n protected svgBrush;\n enter(domNode, element) {\n super.enter(domNode, element);\n this.svg = element.append(\"g\");\n this.svgRegions = element.append(\"g\");\n this.svgDomainGuide = this.svg.append(\"g\");\n this.svgValueGuide = this.svg.append(\"g\");\n this.svgData = this.svg.append(\"g\");\n\n this.svgDataClipRect = this.svg.append(\"clipPath\")\n .attr(\"id\", this.id() + \"_clippath\")\n .append(\"rect\")\n .attr(\"x\", 0)\n .attr(\"y\", 0)\n ;\n this.svgData = this.svg.append(\"g\")\n .attr(\"clip-path\", \"url(#\" + this.id() + \"_clippath)\")\n ;\n this._selection.widgetElement(this.svgData);\n\n this.svgFocus = element.append(\"g\");\n\n this.domainAxis\n .target(this.svg.node())\n .guideTarget(this.svgDomainGuide.node())\n ;\n\n this.valueAxis\n .target(this.svg.node())\n .guideTarget(this.svgValueGuide.node())\n ;\n\n this.svgBrush = element.append(\"g\")\n .attr(\"class\", \"brush\")\n ;\n this.chartsEnter(this, this.svgData, 250);\n }\n\n resizeBrushHandle(d, width, height) {\n let e;\n let x;\n let y;\n if (d.type === \"e\" || d.type === \"w\") {\n e = +(d.type === \"e\");\n x = e ? 1 : -1;\n y = height / 3;\n return \"M\" + (0.5 * x) + \",\" + y +\n \"A6,6 0 0 \" + e + \" \" + (6.5 * x) + \",\" + (y + 6) +\n \"V\" + (2 * y - 6) +\n \"A6,6 0 0 \" + e + \" \" + (0.5 * x) + \",\" + (2 * y) +\n \"Z\" +\n \"M\" + (2.5 * x) + \",\" + (y + 8) +\n \"V\" + (2 * y - 8) +\n \"M\" + (4.5 * x) + \",\" + (y + 8) +\n \"V\" + (2 * y - 8);\n } else {\n e = +(d.type === \"s\");\n y = e ? 1 : -1;\n x = width / 3;\n return \"M\" + x + \", \" + (0.5 * y) +\n \"A6,6 0 0 \" + (e + 1) % 2 + \" \" + (x + 6) + \",\" + (6.5 * y) +\n \"H\" + (2 * x - 6) +\n \"A6,6 0 0 \" + (e + 1) % 2 + \" \" + (2 * x) + \",\" + (0.5 * y) +\n \"Z\" +\n \"M\" + (x + 8) + \",\" + (2.5 * y) +\n \"H\" + (2 * x - 8) +\n \"M\" + (x + 8) + \",\" + (4.5 * y) +\n \"H\" + (2 * x - 8);\n }\n }\n\n private _skipSelection = false;\n skipSelection(): boolean;\n skipSelection(_: boolean): this;\n skipSelection(_?: boolean): boolean | this {\n if (!arguments.length) return this._skipSelection;\n this._skipSelection = _;\n return this;\n }\n\n brushMoved() {\n if (this._skipSelection) return;\n let selected = [];\n const context = this;\n const currSel: any = d3BrushSelection(this.svgBrush.node());\n if (currSel) {\n selected = this.data().filter(function (d) {\n const pos = context.dataPos(d[0]);\n if (context.use2dSelection()) {\n const pos2 = context.valuePos(d[1]) + context.valueAxis.bandwidth() / 2;\n return pos >= currSel[0][0] && pos <= currSel[1][0] && pos2 >= currSel[0][1] && pos2 <= currSel[1][1];\n } else {\n return pos >= currSel[0] && pos <= currSel[1];\n }\n });\n }\n this.selection(selected);\n }\n\n brushMoved2() {\n const isHorizontal = this.orientation() === \"horizontal\";\n const handleTypes = this.use2dSelection() ? [] : isHorizontal ? [{ type: \"w\" }, { type: \"e\" }] : [{ type: \"n\" }, { type: \"s\" }];\n const handlePath = this.svgBrush.selectAll(\".handle--custom\").data(handleTypes);\n const s = d3Event()?.selection;\n if (s == null) {\n handlePath.attr(\"display\", \"none\");\n } else if (isHorizontal) {\n handlePath.attr(\"display\", null).attr(\"transform\", (_d, i) => \"translate(\" + s[i] + \",\" + 0 + \")\");\n } else {\n handlePath.attr(\"display\", null).attr(\"transform\", (_d, i) => \"translate(\" + 0 + \", \" + s[i] + \")\");\n }\n }\n\n dataPos(d) {\n return this.domainAxis.scalePos(d);\n }\n\n valuePos(d) {\n return this.valueAxis.scalePos(d);\n }\n\n getAxisSize(host: XYAxis): { width: number, height: number } {\n return {\n width: !this.xAxis ? host.xAxis.width() : this.xAxis.width(),\n height: !this.yAxis ? host.yAxis.width() : this.yAxis.height()\n };\n }\n\n calcMargin(_domNode, element, isHorizontal) {\n const margin = {\n top: !isHorizontal && this.selectionMode() ? 10 : 2,\n right: isHorizontal && (this.selectionMode() || this.xAxisFocus()) ? 10 : 2,\n bottom: (this.xAxisFocus() ? this.xAxisFocusHeight() : 0) + 2,\n left: 2\n };\n const width = this.width() - margin.left - margin.right;\n const height = this.height() - margin.top - margin.bottom;\n\n let xRight = 0;\n let xHeight = 30;\n let yTop = 0;\n let yWidth = 30;\n for (let i = 0; i < 10; ++i) {\n this.xAxis.width(width - yWidth).height(0);\n const xAxisOverlap = this.xAxis.calcOverflow(element);\n const newXHeight = xAxisOverlap.depth;\n\n this.yAxis.width(0).height(height - xHeight);\n const yAxisOverlap = this.yAxis.calcOverflow(element);\n const newYWidth = yAxisOverlap.depth;\n\n xRight = xAxisOverlap.right;\n yTop = yAxisOverlap.top;\n\n if (newXHeight === xHeight && newYWidth === yWidth) {\n break;\n }\n xHeight = newXHeight;\n yWidth = newYWidth;\n }\n this.xAxis\n .x(width / 2 + yWidth / 2 + margin.left)\n .y(height + margin.top)\n .width(width - yWidth)\n ;\n this.yAxis\n .x(margin.left)\n .y(height / 2 - xHeight / 2 + margin.top)\n .height(height - xHeight)\n ;\n margin.left += yWidth;\n margin.top += yTop;\n margin.right += xRight;\n margin.bottom += xHeight;\n return margin;\n }\n\n updateRegions(_domNode, _element, isHorizontal) {\n const context = this;\n\n const regions = this.svgRegions.selectAll(\".region\").data(this.regions());\n regions.enter().append(\"rect\")\n .attr(\"class\", \"region\")\n ;\n if (isHorizontal) {\n regions\n .attr(\"x\", function (d) { return context.dataPos(d.x0); })\n .attr(\"y\", 0)\n .attr(\"width\", function (d) { return context.dataPos(d.x1) - context.dataPos(d.x0); })\n .attr(\"height\", this.height())\n .style(\"stroke\", function (d) { return context._palette(d.colorID); })\n .style(\"fill\", function (d) { return d3Hsl(context._palette(d.colorID)).brighter(); })\n ;\n } else {\n regions\n .attr(\"x\", 0)\n .attr(\"y\", function (d) { return context.dataPos(d.x0); })\n .attr(\"width\", this.width())\n .attr(\"height\", function (d) { return context.dataPos(d.x0) - context.dataPos(d.x1); })\n .style(\"stroke\", function (d) { return context._palette(d.colorID); })\n .style(\"fill\", function (d) { return d3Hsl(context._palette(d.colorID)).brighter(); })\n ;\n }\n regions.exit().remove();\n }\n\n protected _prevXAxisType;\n update(domNode, element) {\n super.update(domNode, element);\n const context = this;\n\n const isHorizontal = this.orientation() === \"horizontal\";\n this.updateRegions(domNode, element, isHorizontal);\n\n this.domainAxis\n .orientation(isHorizontal ? \"bottom\" : \"left\")\n .title(this.xAxisTitle_exists() ? this.xAxisTitle() : this.columns()[0])\n ;\n this.valueAxis\n .orientation(isHorizontal ? \"left\" : \"bottom\")\n ;\n this.xAxis = isHorizontal ? this.domainAxis : this.valueAxis;\n this.yAxis = isHorizontal ? this.valueAxis : this.domainAxis;\n\n // Update Domain ---\n switch (this.xAxisType()) {\n case \"ordinal\":\n const colLen = this.columns().length;\n const ordinalMappings = {};\n this.domainAxis\n .ordinals(this.data().map(function (d) {\n ordinalMappings[d[0]] = context.xAxisOrdinalMapping(d, d[colLen]);\n return d[0];\n }))\n .ordinalMappings(ordinalMappings)\n ;\n\n break;\n default:\n const domainMin = this.xAxisDomainLow() ? this.xAxisDomainLow() : this.domainAxis.parseInvert(d3Min(this.parsedData(), function (data) {\n return data[0];\n }));\n const domainMax = this.xAxisDomainHigh() ? this.xAxisDomainHigh() : this.domainAxis.parseInvert(d3Max(this.parsedData(), function (data) {\n return data[0];\n }));\n if (domainMin !== undefined && domainMax !== undefined) {\n this.domainAxis\n .low(domainMin)\n .high(domainMax)\n ;\n }\n break;\n }\n\n const min = this.yAxisDomainLow() ? this.yAxisDomainLow() : this.valueAxis.parseInvert(d3Min(this.parsedData(), function (data: any[]) {\n return d3Min(data.filter(function (cell, i) { return i > 0 && context.columns()[i] && context.columns()[i].indexOf(\"__\") !== 0 && cell !== null; }), function (d) { return d instanceof Array ? d[0] : d; });\n }));\n const max = this.yAxisDomainHigh() ? this.yAxisDomainHigh() : this.valueAxis.parseInvert(d3Max(this.parsedData(), function (data: any[]) {\n return d3Max(data.filter(function (cell, i) { return i > 0 && context.columns()[i] && context.columns()[i].indexOf(\"__\") !== 0 && cell !== null; }), function (d) { return d instanceof Array ? d[1] : d; });\n }));\n this.valueAxis\n .low(min)\n .high(max)\n ;\n\n // Calculate Margins ---\n this.margin = this.calcMargin(domNode, element, isHorizontal);\n\n // Update Range ---\n let width = this.width() - this.margin.left - this.margin.right;\n if (width < 0) width = 0;\n let height = this.height() - this.margin.top - this.margin.bottom;\n if (height < 0) height = 0;\n const maxCurrExtent = isHorizontal ? width : height;\n const maxOtherExtent = isHorizontal ? height : width;\n\n // Render ---\n this.domainAxis\n .tickLength(this.xAxisGuideLines() ? maxOtherExtent : 0)\n .render()\n ;\n this.valueAxis\n .tickLength(this.yAxisGuideLines() ? maxCurrExtent : 0)\n .render()\n ;\n\n this.svgDataClipRect\n .attr(\"width\", width)\n .attr(\"height\", height)\n ;\n this.svgData.transition()\n .attr(\"transform\", \"translate(\" + this.margin.left + \",\" + this.margin.top + \")\")\n ;\n\n this.updateBrush(width, height, maxCurrExtent, isHorizontal);\n this.updateFocusChart(domNode, element, this.margin, width, height, isHorizontal);\n this.chartsUpdate(width, height, 250);\n if (this.selectionMode()) {\n return this.brushMoved();\n }\n }\n\n updateBrush(width, height, maxCurrExtent, isHorizontal) {\n const currBrush = this.use2dSelection() ? this.xyBrush : isHorizontal ? this.xBrush : this.yBrush;\n const prevBrushSel: any = d3BrushSelection(this.svgBrush.node());\n currBrush.extent([[0, 0], [width, height]]);\n this.svgBrush\n .attr(\"transform\", \"translate(\" + this.margin.left + \", \" + this.margin.top + \")\")\n .style(\"display\", this.selectionMode() ? null : \"none\")\n .call(currBrush)\n ;\n const handleTypes = this.use2dSelection() ? [] : isHorizontal ? [{ type: \"w\" }, { type: \"e\" }] : [{ type: \"n\" }, { type: \"s\" }];\n const handlePath = this.svgBrush.selectAll(\".handle--custom\").data(handleTypes);\n handlePath.enter().append(\"path\")\n .attr(\"class\", \"handle--custom\")\n .merge(handlePath)\n .attr(\"cursor\", isHorizontal ? \"ew-resize\" : \"ns-resize\")\n .attr(\"d\", (d) => this.resizeBrushHandle(d, width, height))\n ;\n\n if (this.selectionMode()) {\n if (this._prevXAxisType !== this.xAxisType()) {\n this._prevXAxisType = this.xAxisType();\n this._prevBrush = null;\n }\n if (this._prevBrush) {\n if (prevBrushSel) {\n if (this._prevBrush.orientation !== this.orientation()) {\n const tmp = prevBrushSel[0];\n prevBrushSel[0] = this._prevBrush.maxCurrExtent - prevBrushSel[1];\n prevBrushSel[1] = this._prevBrush.maxCurrExtent - tmp;\n }\n const ratio = maxCurrExtent / this._prevBrush.maxCurrExtent;\n if (ratio !== 1) {\n this.svgBrush.transition()\n .on(\"start\", function () {\n currBrush.on(\"end\", null);\n })\n .call(currBrush.move, [prevBrushSel[0] * ratio, prevBrushSel[1] * ratio])\n .on(\"end\", () => {\n currBrush.on(\"end\", () => {\n return this.brushMoved();\n });\n })\n ;\n }\n }\n } else {\n this.svgBrush\n .call(currBrush.move, [0, maxCurrExtent])\n ;\n }\n this._prevBrush = {\n orientation: this.orientation(),\n maxCurrExtent\n };\n }\n }\n\n updateFocusChart(domNode, element, margin, width, height, isHorizontal) {\n const context: XYAxis = this;\n const focusChart = this.svgFocus.selectAll(\"#\" + this.id() + \"_focusChart\").data(this.xAxisFocus() ? [true] : []);\n focusChart.enter().append(\"g\")\n .attr(\"id\", this.id() + \"_focusChart\")\n .attr(\"class\", \"focus\")\n .each(function () {\n context.focusChart = new (context.constructor as any)()\n .target(this)\n ;\n context.focusChart.xBrush\n .on(\"brush.focus\", function () {\n context.syncAxis(width);\n context.chartsUpdate(width, height, 0);\n })\n ;\n context.focusChart\n .layers(context.layers().map((w: any) => new w.constructor()))\n ;\n })\n .merge(focusChart)\n .each(function (this: SVGElement) {\n context.copyPropsTo(context.focusChart, [\"layers\"]);\n let layerIdx = 0;\n for (const layer of context.layers()) {\n layer.copyPropsTo(context.focusChart.layers()[layerIdx]);\n layerIdx++;\n }\n context.focusChart\n .xAxisFocus(false)\n .selectionMode(true)\n .skipSelection(true)\n .orientation(\"horizontal\")\n .xAxisGuideLines(false)\n .xAxisDomainLow(null)\n .xAxisDomainHigh(null)\n .yAxisGuideLines(false)\n .x(context.width() / 2)\n .y(context.height() - context.xAxisFocusHeight() / 2)\n .width(context.width())\n .height(context.xAxisFocusHeight())\n .columns(context.columns())\n .data(context.data())\n .render()\n ;\n context.syncAxis(width);\n })\n ;\n focusChart.exit()\n .each(function () {\n if (context.focusChart) {\n context.focusChart\n .target(null)\n ;\n delete context.focusChart;\n }\n })\n .remove()\n ;\n }\n\n syncAxis(width: number) {\n const currSel = d3BrushSelection(this.focusChart.svgBrush.node()) as [number, number];\n if (currSel) {\n if (this.focusChart.xAxisType() !== \"ordinal\") {\n this.xAxis.domain([this.focusChart.xAxis.invert(currSel[0]), this.focusChart.xAxis.invert(currSel[1])]);\n } else {\n const brushWidth = currSel[1] - currSel[0];\n const scale = brushWidth / width;\n this.xAxis.range([-currSel[0] / scale, (width - currSel[0]) / scale]);\n }\n this.xAxis.rerender();\n }\n }\n\n // Layers ---\n layerColumns(host: XYAxis): string[] {\n const masterColumns = host.columns();\n const retVal = super.columns().filter(col => col !== masterColumns[0]);\n if (!retVal.length) {\n return masterColumns;\n }\n return [masterColumns[0], ...retVal];\n }\n\n layerColumnIndices(host: XYAxis): number[] {\n const masterColumns = host.columns();\n const layerColumns = this.layerColumns(host);\n return layerColumns.map(col => masterColumns.indexOf(col));\n }\n\n layerColumnIndex(host: XYAxis, column: string): number {\n const masterColumns = host.columns();\n return masterColumns.indexOf(column);\n }\n\n layerData(host?: XYAxis): any[][] {\n if (arguments.length === 1) {\n const indices = this.layerColumnIndices(host);\n return host.data().map(row => {\n const retVal = indices.map(idx => row[idx]);\n (retVal as any).__hpcc_origRow = row;\n return retVal;\n });\n }\n throw new Error(\"Setting data on XYAxisLayer is not supported.\");\n }\n\n layerEnter(host: XYAxis, element, duration: number = 250) {\n }\n\n layerUpdate(host: XYAxis, element, duration: number = 250) {\n }\n\n layerExit(host: XYAxis, element, duration: number = 250) {\n }\n\n chartsEnter(host: XYAxis, element, duration: number = 250) {\n this.layerEnter(this, element, duration);\n for (const w of this.layers()) {\n w[\"__xyAxisElement\"] = element.append(\"g\")\n .attr(\"class\", w.class())\n ;\n w\n .target(w[\"__xyAxisElement\"].node() as SVGElement)\n .layerEnter(this, element, duration)\n ;\n }\n }\n\n chartsUpdate(width, height, duration): void {\n this.layerUpdate(this, this.svgData, duration);\n for (const w of this.layers()) {\n w\n .resize({ width, height })\n .layerUpdate(this, w[\"__xyAxisElement\"], duration)\n ;\n }\n }\n\n exit(domNode, element) {\n this.valueAxis.target(null);\n this.domainAxis.target(null);\n super.exit(domNode, element);\n }\n\n selection(_selected) {\n const context = this;\n this._selection.widgetElement().selectAll(\".selected,.deselected\")\n .each(function (d) {\n const selected = _selected.indexOf(d.origRow) >= 0;\n d3Select(this)\n .classed(\"selected\", selected)\n .classed(\"deselected\", !selected)\n .attr(\"filter\", context._selection.svgGlowID() && selected ? `url(#${context._selection.svgGlowID()})` : null)\n ;\n })\n ;\n\n const selRows = _selected.map(d => {\n return this.rowToObj(d);\n });\n setTimeout(() => {\n this.click(selRows, \"\", true);\n }, 0);\n }\n\n // XYAxis ---\n xAxisOrdinalMapping(origRow, lparam) {\n return origRow[0];\n }\n\n // Events ---\n click(row, column, selected) {\n // console.log(\"Click: \" + JSON.stringify(row) + \", \" + column + \", \" + selected);\n }\n\n // Selection ---\n _selection: Utility.SimpleSelection;\n}\nXYAxis.prototype._class += \" chart_XYAxis\";\nXYAxis.prototype.mixin(Utility.SimpleSelectionMixin);\n\nexport interface XYAxis {\n _palette;\n orientation(): \"horizontal\" | \"vertical\";\n orientation(_: \"horizontal\" | \"vertical\"): this;\n orientation_default(_: string);\n pointSizeColumn(): string;\n pointSizeColumn(_: string): this;\n pointSizeColumn_exists(): boolean;\n minPointSize(): number;\n minPointSize(_: number): this;\n maxPointSize(): number;\n maxPointSize(_: number): this;\n use2dSelection(): boolean;\n use2dSelection(_: boolean): this;\n selectionMode(): boolean;\n selectionMode(_: boolean): this;\n xAxisTitle(): string;\n xAxisTitle(_: string): this;\n xAxisTitle_exists(): boolean;\n xAxisTickCount(): number;\n xAxisTickCount(_: number): this;\n xAxisTickFormat(): string;\n xAxisTickFormat(_: string): this;\n xAxisTicks(): Array<{ value: string, label: string }>;\n xAxisTicks(_: Array<{ value: string, label: string }>): this;\n xAxisType(): \"none\" | \"ordinal\" | \"linear\" | \"pow\" | \"log\" | \"time\";\n xAxisType(_: \"none\" | \"ordinal\" | \"linear\" | \"pow\" | \"log\" | \"time\"): this;\n xAxisType_default(_: string);\n xAxisTypeTimePattern(): string;\n xAxisTypeTimePattern(_: string): this;\n xAxisDomainLow(): number | string;\n xAxisDomainLow(_: number | string): this;\n xAxisDomainHigh(): number | string;\n xAxisDomainHigh(_: number | string): this;\n xAxisFontSize(): number | string;\n xAxisFontSize(_: number | string): this;\n xAxisFontFamily(): string;\n xAxisFontFamily(_: string): this;\n xAxisOrdinalPaddingInner(): number;\n xAxisOrdinalPaddingInner(_: number): this;\n xAxisOrdinalPaddingOuter(): number;\n xAxisOrdinalPaddingOuter(_: number): this;\n xAxisOverlapMode(): \"none\" | \"stagger\" | \"hide\" | \"rotate\" | \"linebreak\" | \"wrap\";\n xAxisOverlapMode(_: \"none\" | \"stagger\" | \"hide\" | \"rotate\" | \"linebreak\" | \"wrap\"): this;\n xAxisLabelRotation(): number;\n xAxisLabelRotation(_: number): this;\n xAxisDomainPadding(): number;\n xAxisDomainPadding(_: number): this;\n xAxisGuideLines(): boolean;\n xAxisGuideLines(_: boolean): this;\n xAxisGuideLines_default(_: boolean);\n xAxisFocus(): boolean;\n xAxisFocus(_: boolean): this;\n xAxisFocusHeight(): number;\n xAxisFocusHeight(_: number): this;\n xAxisHidden(): boolean;\n xAxisHidden(_: boolean): this;\n xAxisHidden_default(_: boolean);\n yAxisTitle(): string;\n yAxisTitle(_: string): this;\n yAxisTickCount(): number;\n yAxisTickCount(_: number): this;\n yAxisTickFormat(): string;\n yAxisTickFormat(_: string): this;\n yAxisTicks(): Array<{ value: string, label: string }>;\n yAxisTicks(_: Array<{ value: string, label: string }>): this;\n yAxisType(): \"none\" | \"ordinal\" | \"linear\" | \"pow\" | \"log\" | \"time\";\n yAxisType(_: \"none\" | \"ordinal\" | \"linear\" | \"pow\" | \"log\" | \"time\"): this;\n yAxisType_default(_: string);\n yAxisTypeTimePattern(): string;\n yAxisTypeTimePattern(_: string): this;\n yAxisTypePowExponent(): number;\n yAxisTypePowExponent(_: number): this;\n yAxisTypeLogBase(): number;\n yAxisTypeLogBase(_: number): this;\n yAxisStacked(): boolean;\n yAxisStacked(_: boolean): this;\n yAxisDomainLow(): number | string;\n yAxisDomainLow(_: number | string): this;\n yAxisDomainHigh(): number | string;\n yAxisDomainHigh(_: number | string): this;\n yAxisDomainPadding(): number;\n yAxisDomainPadding(_: number): this;\n yAxisGuideLines(): boolean;\n yAxisGuideLines(_: boolean): this;\n yAxisGuideLines_default(_: boolean);\n yAxisHidden(): boolean;\n yAxisHidden(_: boolean): this;\n yAxisHidden_default(_: boolean);\n regions(): object[];\n regions(_: object[]): this;\n layers(): XYAxis[];\n layers(_: XYAxis[]): this;\n xAxisPadding(): number;\n xAxisPadding(_: number): this;\n yAxisPadding(): number;\n yAxisPadding(_: number): this;\n}\n\nXYAxis.prototype.publish(\"orientation\", \"horizontal\", \"set\", \"Selects orientation for the axis\", [\"horizontal\", \"vertical\"]);\nXYAxis.prototype.publish(\"pointSizeColumn\", null, \"string\", \"pointSizeColumn\", null, { optional: true });\nXYAxis.prototype.publish(\"minPointSize\", 6, \"number\", \"minPointSize\");\nXYAxis.prototype.publish(\"maxPointSize\", 26, \"number\", \"maxPointSize\");\nXYAxis.prototype.publish(\"use2dSelection\", false, \"boolean\", \"2D Range Selector\");\nXYAxis.prototype.publish(\"selectionMode\", false, \"boolean\", \"Range Selector\");\nXYAxis.prototype.publishProxy(\"xAxisTitle\", \"domainAxis\", \"title\");\nXYAxis.prototype.publishProxy(\"xAxisTickCount\", \"domainAxis\", \"tickCount\");\nXYAxis.prototype.publishProxy(\"xAxisTickFormat\", \"domainAxis\", \"tickFormat\");\nXYAxis.prototype.publishProxy(\"xAxisTicks\", \"domainAxis\", \"ticks\");\nXYAxis.prototype.publishProxy(\"xAxisType\", \"domainAxis\", \"type\");\nXYAxis.prototype.publishProxy(\"xAxisTypeTimePattern\", \"domainAxis\", \"timePattern\");\nXYAxis.prototype.publish(\"xAxisDomainLow\", null, \"string\", \"X-Axis Low\", null, { optional: true, disable: (w: XYAxis) => w.xAxisType() === \"ordinal\" });\nXYAxis.prototype.publish(\"xAxisDomainHigh\", null, \"string\", \"X-Axis High\", null, { optional: true, disable: (w: XYAxis) => w.xAxisType() === \"ordinal\" });\nXYAxis.prototype.publishProxy(\"xAxisFontSize\", \"domainAxis\", \"fontSize\");\nXYAxis.prototype.publishProxy(\"xAxisFontFamily\", \"domainAxis\", \"fontFamily\");\nXYAxis.prototype.publishProxy(\"xAxisOrdinalPaddingInner\", \"domainAxis\", \"ordinalPaddingInner\");\nXYAxis.prototype.publishProxy(\"xAxisOrdinalPaddingOuter\", \"domainAxis\", \"ordinalPaddingOuter\");\nXYAxis.prototype.publishProxy(\"xAxisOverlapMode\", \"domainAxis\", \"overlapMode\");\nXYAxis.prototype.publishProxy(\"xAxisLabelRotation\", \"domainAxis\", \"labelRotation\");\nXYAxis.prototype.publishProxy(\"xAxisDomainPadding\", \"domainAxis\", \"extend\");\nXYAxis.prototype.publish(\"xAxisGuideLines\", false, \"boolean\", \"Y-Axis Guide Lines\");\nXYAxis.prototype.publish(\"xAxisFocus\", false, \"boolean\", \"X-Axis Focus\", null, { disable: (w: any) => w.orientation() !== \"horizontal\" });\nXYAxis.prototype.publish(\"xAxisFocusHeight\", 80, \"number\", \"X-Axis Focus Height\", null, { disable: (w: any) => !w.xAxisFocus() });\nXYAxis.prototype.publishProxy(\"xAxisHidden\", \"domainAxis\", \"hidden\");\nXYAxis.prototype.publishProxy(\"yAxisFontSize\", \"valueAxis\", \"fontSize\");\nXYAxis.prototype.publishProxy(\"yAxisFontFamily\", \"valueAxis\", \"fontFamily\");\nXYAxis.prototype.publishProxy(\"yAxisTitle\", \"valueAxis\", \"title\");\nXYAxis.prototype.publishProxy(\"yAxisTickCount\", \"valueAxis\", \"tickCount\");\nXYAxis.prototype.publishProxy(\"yAxisTickFormat\", \"valueAxis\", \"tickFormat\");\nXYAxis.prototype.publishProxy(\"yAxisTicks\", \"valueAxis\", \"ticks\");\nXYAxis.prototype.publishProxy(\"yAxisType\", \"valueAxis\", \"type\");\nXYAxis.prototype.publishProxy(\"yAxisTypeTimePattern\", \"valueAxis\", \"timePattern\");\nXYAxis.prototype.publishProxy(\"yAxisTypePowExponent\", \"valueAxis\", \"powExponent\");\nXYAxis.prototype.publishProxy(\"yAxisTypeLogBase\", \"valueAxis\", \"logBase\");\nXYAxis.prototype.publish(\"yAxisStacked\", false, \"boolean\", \"Stacked Chart\", null, { tags: [\"Basic\"], disable: (w: any) => w.xAxisType() !== \"ordinal\" || w._class.indexOf(\"chart_Column\") < 0 });\nXYAxis.prototype.publish(\"yAxisDomainLow\", null, \"string\", \"Y-Axis Low\", null, { optional: true, disable: (w: any) => w.yAxisType() === \"ordinal\" });\nXYAxis.prototype.publish(\"yAxisDomainHigh\", null, \"string\", \"Y-Axis High\", null, { optional: true, disable: (w: any) => w.yAxisType() === \"ordinal\" });\nXYAxis.prototype.publishProxy(\"yAxisDomainPadding\", \"valueAxis\", \"extend\");\nXYAxis.prototype.publish(\"yAxisGuideLines\", true, \"boolean\", \"Y-Axis Guide Lines\");\nXYAxis.prototype.publishProxy(\"yAxisHidden\", \"valueAxis\", \"hidden\");\nXYAxis.prototype.publish(\"regions\", [], \"array\", \"Regions\");\nXYAxis.prototype.publish(\"layers\", [], \"widgetArray\", \"Layers\", null, { render: false });\nXYAxis.prototype.publishProxy(\"xAxisPadding\", \"domainAxis\", \"padding\");\nXYAxis.prototype.publishProxy(\"yAxisPadding\", \"valueAxis\", \"padding\");\n","import { INDChart, ITooltip } from \"@hpcc-js/api\";\nimport { InputField } from \"@hpcc-js/common\";\nimport { extent as d3Extent } from \"d3-array\";\nimport { scaleLinear as d3ScaleLinear, scaleLog as d3ScaleLog, scalePow as d3ScalePow, scaleSqrt as d3ScaleSqrt } from \"d3-scale\";\nimport { select as d3Select } from \"d3-selection\";\nimport {\n area as d3Area,\n curveBasis as d3CurveBasis, curveBundle as d3CurveBundle, curveCardinal as d3CurveCardinal, curveCatmullRom as d3curveCatmullRom, curveLinear as d3CurveLinear,\n curveMonotoneX as d3CurveMonotoneX, curveNatural as d3CurveNatural, curveStep as d3CurveStep, curveStepAfter as d3CurveStepAfter, curveStepBefore as d3CurveStepBefore,\n line as d3Line\n} from \"d3-shape\";\nimport { XYAxis } from \"./XYAxis.ts\";\n\nimport \"../src/Scatter.css\";\n\nexport class Scatter extends XYAxis {\n static __inputs: InputField[] = [{\n id: \"label\",\n type: \"any\"\n }, {\n id: \"values\",\n type: \"number\",\n multi: true\n }];\n\n constructor() {\n super();\n INDChart.call(this);\n ITooltip.call(this);\n this\n .xAxisGuideLines_default(true)\n .yAxisGuideLines_default(true)\n ;\n }\n\n xPos(host: XYAxis, d) {\n return host.orientation() === \"horizontal\" ? host.dataPos(d.label) : host.valuePos(d.value);\n }\n\n yPos(host: XYAxis, d) {\n return host.orientation() === \"horizontal\" ? host.valuePos(d.value) : host.dataPos(d.label);\n }\n\n private curve(): any {\n switch (this.interpolate()) {\n case \"linear\":\n return d3CurveLinear;\n case \"step\":\n return d3CurveStep;\n case \"step-before\":\n return d3CurveStepBefore;\n case \"step-after\":\n return d3CurveStepAfter;\n case \"basis\":\n return d3CurveBasis;\n case \"bundle\":\n return d3CurveBundle;\n case \"cardinal\":\n return d3CurveCardinal;\n case \"catmullRom\":\n return d3curveCatmullRom;\n case \"natural\":\n return d3CurveNatural;\n case \"monotone\":\n default:\n return d3CurveMonotoneX;\n }\n }\n\n private getScale() {\n switch (this.pointSizeScale()) {\n case \"linear\":\n return d3ScaleLinear();\n case \"pow\":\n return d3ScalePow().exponent(2);\n case \"log\":\n return d3ScaleLog();\n case \"sqrt\":\n return d3ScaleSqrt();\n }\n }\n\n protected pointColor(row, col, value, origRow) {\n if (this.interpolate() && this.pointDarken()) {\n return this.strokeColor(row, col, value, origRow);\n }\n return this.fillColor(row, col, value, origRow);\n }\n\n protected lineColor(row, col, value, origRow) {\n if (this.interpolateFill() && this.interpolateDarken()) {\n return this.strokeColor(row, col, value, origRow);\n }\n return this.fillColor(row, col, value, origRow);\n }\n\n protected areaColor(row, col, value, origRow) {\n return this.fillColor(row, col, value, origRow);\n }\n\n layerEnter(host: XYAxis, element, duration: number = 250) {\n super.layerEnter(host, element, duration);\n const context = this;\n this\n .tooltipHTML(function (d) {\n switch (context.tooltipStyle()) {\n case \"series-table\":\n return context.tooltipFormat({\n label: d.label,\n arr: context.columns().slice(1).map(function (column, i) {\n return {\n label: column,\n color: context._palette(column),\n value: context.data()[d.rowIdx][i + 1]\n };\n })\n });\n default:\n return context.tooltipFormat({ label: d.label, series: d.column, value: d.value });\n }\n })\n ;\n }\n\n protected _prevPointShape;\n layerUpdate(host: XYAxis, element, duration: number = 250) {\n super.layerUpdate(host, element);\n const isHorizontal = host.orientation() === \"horizontal\";\n const height = isHorizontal ? this.height() : this.width();\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 if (this._prevPointShape !== this.pointShape()) {\n element.selectAll(\".data\").remove();\n this._prevPointShape = this.pointShape();\n }\n\n function mapShape(shape) {\n switch (shape) {\n case \"rectangle\":\n return \"rect\";\n case \"circle\":\n return \"circle\";\n case \"cross\":\n return \"path\";\n default:\n }\n }\n const usePointSizeColumn = this.pointSizeColumn_exists();\n let pointSizeColumnIdx;\n let extent;\n let scale;\n if (usePointSizeColumn) {\n pointSizeColumnIdx = this.columns().indexOf(this.pointSizeColumn());\n extent = d3Extent(this.data(), d => d[pointSizeColumnIdx]);\n scale = this.getScale().domain(extent);\n }\n const layerColumns = this.layerColumns(host);\n const layerData = this.layerData(host);\n const flatData = this.flattenData(layerColumns, layerData).map(function (d) {\n d.shape = mapShape(context.pointShape());\n d.column = layerColumns[d.colIdx];\n d.row = layerData[d.rowIdx];\n d.origRow = (layerData[d.rowIdx] as any).__hpcc_origRow;\n if (extent) {\n d.size = scale(d.row[pointSizeColumnIdx]) * (context.maxPointSize() - context.minPointSize()) + context.minPointSize();\n return d.column === context.pointSizeColumn() ? false : d;\n } else {\n d.size = context.pointSize();\n return d;\n }\n\n }).filter(d => d);\n\n const areas = element.selectAll(\".area\").data(layerColumns.filter(function (_d, idx) { return context.interpolate() && context.interpolateFill() && idx > 0; }));\n const areasEnter = areas.enter().append(\"path\");\n const area = d3Area()\n .curve(this.curve())\n ;\n if (isHorizontal) {\n area\n .x(function (d) { return context.xPos(host, d); })\n .y0(Math.min(height, this.yPos(host, { value: 0 })))\n .y1(function (d) { return context.yPos(host, d); })\n ;\n } else {\n area\n .y(function (d) { return context.yPos(host, d); })\n .x0(Math.max(0, this.xPos(host, { value: 0 })))\n .x1(function (d) { return context.xPos(host, d); })\n ;\n }\n areasEnter.merge(areas)\n .attr(\"class\", d => \"area series series-\" + this.cssTag(d))\n .each(function (_d, idx) {\n const element = d3Select(this);\n element\n .attr(\"d\", area(flatData.filter(function (d2) { return d2.colIdx === idx + 1; })))\n .style(\"opacity\", context.interpolateFillOpacity())\n .style(\"stroke\", \"none\")\n .style(\"fill\", context.areaColor([], _d, undefined, []))\n ;\n });\n areas.exit().remove();\n\n const lines = element.selectAll(\".line\").data(layerColumns.filter(function (_d, idx) { return context.interpolate() && idx > 0; }));\n const linesEnter = lines.enter().append(\"path\");\n const line = d3Line()\n .x(function (d) { return context.xPos(host, d); })\n .y(function (d) { return context.yPos(host, d); })\n .curve(this.curve())\n ;\n linesEnter.merge(lines)\n .attr(\"class\", d => \"line series series-\" + this.cssTag(d))\n .each(function (_d, idx) {\n const element = d3Select(this);\n const data2 = flatData.filter(function (d2) { return d2.colIdx === idx + 1; });\n element\n .attr(\"d\", line(data2))\n .style(\"stroke\", context.lineColor([], _d, undefined, []))\n .style(\"fill\", \"none\")\n ;\n });\n lines.exit().remove();\n\n const points = element.selectAll(\".point\").data(flatData, function (d, idx) { return d.shape + \"_\" + idx; });\n points.enter().append(\"g\")\n .each(function (this: SVGElement, d2) {\n const element = d3Select(this);\n element\n .append(d2.shape)\n .attr(\"class\", \"pointShape\")\n ;\n element\n .append(\"text\")\n .attr(\"class\", \"pointValue\")\n .style(\"display\", \"none\")\n .attr(\"text-anchor\", context.valueAnchor())\n .attr(\"alignment-baseline\", context.valueBaseline())\n .attr(\"fill\", function (d: any, _idx) {\n const useTextColor = context.valueBaseline() === \"middle\" || context.valueBaseline() === \"central\";\n return useTextColor ? context.textColor(d.row, d.column, d.value, d.origRow) : null;\n })\n ;\n element\n .append(\"circle\")\n .attr(\"class\", \"pointSelection\")\n .on(\"mouseout.tooltip\", context.tooltip.hide)\n .on(\"mousemove.tooltip\", context.tooltip.show)\n .call(host._selection.enter.bind(host._selection))\n .on(\"click\", function (d: any, _idx) {\n context.click(host.rowToObj(host.data()[d.rowIdx]), d.column, host._selection.selected(this));\n })\n .on(\"dblclick\", function (d: any, _idx) {\n context.dblclick(host.rowToObj(host.data()[d.rowIdx]), d.column, host._selection.selected(this));\n })\n ;\n })\n .merge(points)\n .attr(\"class\", d => \"point series series-\" + this.cssTag(d.column))\n .each(function (this: SVGElement, d2) {\n const textSelection = d3Select(this).select(\".pointValue\");\n textSelection\n .attr(\"x\", function (d) { return context.xPos(host, d); })\n .attr(\"y\", function (d) { return context.yPos(host, d); })\n .style(\"display\", context.showValue() ? \"block\" : \"none\")\n .attr(\"text-anchor\", context.valueAnchor())\n .attr(\"alignment-baseline\", context.valueBaseline())\n .text(function (d) {\n return d[\"value\"];\n })\n ;\n const elementSelection = d3Select(this).select(\".pointSelection\");\n elementSelection\n .attr(\"cx\", function (d) { return context.xPos(host, d); })\n .attr(\"cy\", function (d) { return context.yPos(host, d); })\n .attr(\"r\", d2.size)\n ;\n\n const element = d3Select(this).select(\".pointShape\");\n switch (d2.shape) {\n case \"rect\":\n element\n .attr(\"x\", function (d) { return context.xPos(host, d) - d2.size / 2; })\n .attr(\"y\", function (d) { return context.yPos(host, d) - d2.size / 2; })\n .attr(\"width\", d2.size)\n .attr(\"height\", d2.size)\n .style(\"fill\", context.pointColor(d2.row, d2.column, d2.value, d2.origRow))\n ;\n break;\n case \"circle\":\n element\n .attr(\"cx\", function (d) { return context.xPos(host, d); })\n .attr(\"cy\", function (d) { return context.yPos(host, d); })\n .attr(\"r\", d2.size * 0.9)\n .style(\"fill\", context.pointColor(d2.row, d2.column, d2.value, d2.origRow))\n ;\n break;\n case \"path\":\n element\n .attr(\"d\", function (d: any) {\n return \"M\" + (context.xPos(host, d) - d2.size / 2) + \" \" + (context.yPos(host, d) - d2.size / 2) + \" \" +\n \"L\" + (context.xPos(host, d) + d2.size / 2) + \" \" + (context.yPos(host, d) + d2.size / 2) + \" \" +\n \"M\" + (context.xPos(host, d) - d2.size / 2) + \" \" + (context.yPos(host, d) + d2.size / 2) + \" \" +\n \"L\" + (context.xPos(host, d) + d2.size / 2) + \" \" + (context.yPos(host, d) - d2.size / 2);\n })\n .style(\"stroke\", context.pointColor(d2.row, d2.column, d2.value, d2.origRow))\n ;\n break;\n default:\n }\n })\n ;\n points.exit().remove();\n }\n\n exit(domNode, element) {\n super.exit(domNode, element);\n }\n}\nScatter.prototype._class += \" chart_Scatter\";\nScatter.prototype.implements(INDChart.prototype);\nScatter.prototype.implements(ITooltip.prototype);\n\nexport interface Scatter {\n\n valueAnchor(): string;\n valueAnchor(_: string): this;\n valueBaseline(): string;\n valueBaseline(_: string): this;\n showValue(): boolean;\n showValue(_: boolean): this;\n pointDarken(): boolean;\n pointDarken(_: boolean): this;\n interpolateDarken(): boolean;\n interpolateDarken(_: boolean): this;\n\n paletteID(): string;\n paletteID(_: string): this;\n useClonedPalette(): boolean;\n useClonedPalette(_: boolean): this;\n pointSizeScale(): string;\n pointSizeScale(_: string): this;\n pointShape(): string;\n pointShape(_: string): this;\n pointSize(): number;\n pointSize(_: number): this;\n interpolate(): string;\n interpolate(_: string): this;\n interpolate_default(): string;\n interpolate_default(_: string): this;\n interpolateFill(): boolean;\n interpolateFill(_: boolean): this;\n interpolateFill_default(): boolean;\n interpolateFill_default(_: boolean): this;\n interpolateFillOpacity(): number;\n interpolateFillOpacity(_: number): this;\n\n // INDChart\n fillColor(row, column, value, origRow): string;\n strokeColor(row, column, value, origRow): string;\n textColor(row, column, value, origRow): string;\n dblclick(row, column, selected): void;\n\n // ITooltip\n tooltip;\n tooltipHTML(_): string;\n tooltipFormat(_): string;\n tooltipStyle(): \"default\" | \"none\" | \"series-table\";\n}\nScatter.prototype.publish(\"paletteID\", \"default\", \"set\", \"Color palette for this widget\", Scatter.prototype._palette.switch(), { tags: [\"Basic\", \"Shared\"] });\nScatter.prototype.publish(\"pointSizeScale\", \"linear\", \"set\", \"pointSizeScale\", [\"linear\", \"pow\", \"log\", \"sqrt\"]);\nScatter.prototype.publish(\"pointShape\", \"cross\", \"set\", \"Shape of the data points\", [\"circle\", \"rectangle\", \"cross\"]);\nScatter.prototype.publish(\"pointSize\", 6, \"number\", \"Point Size\", null, { range: { min: 1, step: 1, max: 200 } });\nScatter.prototype.publish(\"interpolate\", \"\", \"set\", \"Interpolate Data\", [\"\", \"linear\", \"step\", \"step-before\", \"step-after\", \"basis\", \"bundle\", \"cardinal\", \"catmullRom\", \"natural\", \"monotone\"]);\nScatter.prototype.publish(\"pointDarken\", true, \"boolean\", \"If true, and interpolate is set, then points will have a slightly darker color than their assigned palette color\", null, { disable: w => !w.interpolate() });\nScatter.prototype.publish(\"interpolateDarken\", true, \"boolean\", \"If true, and interpolateFill is true, then lines will have a slightly darker color than their assigned palette color\", null, { disable: w => !w.interpolateFill() });\nScatter.prototype.publish(\"interpolateFill\", false, \"boolean\", \"If true, the area between the line and zero will be filled\");\nScatter.prototype.publish(\"interpolateFillOpacity\", 0.66, \"number\", \"Fill interpolation Opacity\", null, { range: { min: 0, step: 0.01, max: 1 } });\nScatter.prototype.publish(\"useClonedPalette\", false, \"boolean\", \"Enable or disable using a cloned palette\", null, { tags: [\"Intermediate\", \"Shared\"] });\nScatter.prototype.publish(\"showValue\", false, \"boolean\");\nScatter.prototype.publish(\"valueAnchor\", \"middle\", \"set\", \"text-anchor for shown value text\", [\"start\", \"middle\", \"end\"]);\nScatter.prototype.publish(\"valueBaseline\", \"ideographic\", \"set\", \"alignment-baseline for shown value text\", [\"auto\", \"baseline\", \"before-edge\", \"text-before-edge\", \"middle\", \"central\", \"after-edge\", \"text-after-edge\", \"ideographic\", \"alphabetic\", \"hanging\", \"mathematical\", \"inherit\"]);\n","import { Scatter } from \"./Scatter.ts\";\n\nexport class Area extends Scatter {\n constructor() {\n super();\n this\n .interpolate_default(\"linear\")\n .interpolateFill_default(true)\n ;\n }\n}\nArea.prototype._class += \" chart_Area\";\n","import { INDChart, ITooltip } from \"@hpcc-js/api\";\nimport { InputField, Text } from \"@hpcc-js/common\";\nimport { format as d3Format } from \"d3-format\";\nimport { scaleBand as d3ScaleBand } from \"d3-scale\";\nimport { local as d3Local, select as d3Select } from \"d3-selection\";\nimport { XYAxis } from \"./XYAxis.ts\";\n\nimport \"../src/Column.css\";\n\nexport class Column extends XYAxis {\n static __inputs: InputField[] = [{\n id: \"label\",\n type: \"string\"\n }, {\n id: \"values\",\n type: \"number\",\n multi: true\n }];\n\n protected _linearGap: number;\n private textLocal = d3Local<Text>();\n private stackedTextLocal = d3Local<Text>();\n private isHorizontal: boolean;\n\n constructor() {\n super();\n INDChart.call(this);\n ITooltip.call(this);\n\n this._selection.skipBringToTop(true);\n\n this._linearGap = 25.0;\n }\n\n layerEnter(host: XYAxis, element, duration: number = 250) {\n super.layerEnter(host, element, duration);\n const context = this;\n this\n .tooltipHTML(function (d) {\n switch (context.tooltipStyle()) {\n case \"series-table\":\n return context.tooltipFormat({\n label: d.row[0],\n arr: context.columns().slice(1).map(function (column, i) {\n return {\n label: column,\n color: context._palette(column),\n value: d.row[i + 1]\n };\n })\n });\n default:\n let value = d.row[d.idx];\n if (value instanceof Array) {\n value = value[1] - value[0];\n }\n return context.tooltipFormat({ label: d.row[0], series: context.layerColumns(host)[d.idx], value });\n }\n })\n ;\n }\n\n adjustedData(host: XYAxis) {\n const retVal = this.layerData(host).map(row => {\n let prevValue = 0;\n return row.map((cell, idx) => {\n if (idx === 0) {\n return cell;\n }\n if (idx >= this.layerColumns(host).length) {\n return cell;\n }\n const retVal2 = host.yAxisStacked() ? [prevValue, prevValue + cell] : cell;\n prevValue += cell;\n return retVal2;\n }, this);\n }, this);\n return retVal;\n }\n\n layerUpdate(host: XYAxis, element, duration: number = 250) {\n super.layerUpdate(host, element, duration);\n const isHorizontal = host.orientation() === \"horizontal\";\n this.isHorizontal = isHorizontal;\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 const formatPct = d3Format(context.showValueAsPercentFormat());\n\n let dataLen = 10;\n let offset = 0;\n switch (host.xAxisType()) {\n case \"ordinal\":\n dataLen = host.bandwidth();\n offset = -dataLen / 2;\n break;\n case \"linear\":\n case \"time\":\n dataLen = Math.max(Math.abs(host.dataPos(2) - host.dataPos(1)) * (100 - this._linearGap) / 100, dataLen);\n offset = -dataLen / 2;\n break;\n default:\n }\n\n this.tooltip.direction(isHorizontal ? \"n\" : \"e\");\n\n const columnScale = d3ScaleBand()\n .domain(context.layerColumns(host).filter(function (_d, idx) { return idx > 0; }))\n .rangeRound(isHorizontal ? [0, dataLen] : [dataLen, 0])\n .paddingInner(this.xAxisSeriesPaddingInner())\n .paddingOuter(0)\n ;\n let domainSums = [];\n const seriesSums = [];\n const columnLength = this.columns().length;\n const rowData = this.data();\n if (this.showValue() && this.showValueAsPercent() === \"series\") {\n rowData.forEach((row) => {\n row.filter((_, idx) => idx > 0 && idx < columnLength).forEach((col, idx) => {\n if (seriesSums[idx + 1] === undefined) {\n seriesSums[idx + 1] = 0;\n }\n seriesSums[idx + 1] += col;\n });\n });\n }\n\n if (this.showDomainTotal() || (this.showValue() && this.showValueAsPercent() === \"domain\")) {\n domainSums = rowData.map(row => {\n return row.filter((cell, idx) => idx > 0 && idx < columnLength).reduce((sum, cell) => {\n return sum + cell;\n }, 0);\n });\n }\n\n const column = element.selectAll(\".dataRow\")\n .data(this.adjustedData(host))\n ;\n const hostData = host.data();\n const axisSize = this.getAxisSize(host);\n column.enter().append(\"g\")\n .attr(\"class\", \"dataRow\")\n .merge(column)\n .each(function (dataRow, dataRowIdx) {\n const element = d3Select(this);\n\n const columnGRect = element.selectAll(\".dataCell\").data(dataRow.filter(function (_d, i) { return i < context.layerColumns(host).length; }).map(function (d, i) {\n return {\n column: context.layerColumns(host)[i],\n row: dataRow,\n origRow: hostData[dataRowIdx],\n value: d,\n idx: i\n };\n }).filter(function (d) { return d.value !== null && d.idx > 0; }), (d: any) => d.column);\n\n const columnGEnter = columnGRect\n .enter().append(\"g\")\n .attr(\"class\", \"dataCell\")\n .on(\"mouseout.tooltip\", function (d: any) {\n if (!context.tooltipInnerTextEllipsedOnly() || (d.innerTextObj && d.innerTextObj.isTruncated)) {\n context.tooltip.hide.apply(context, arguments);\n }\n })\n .on(\"mousemove.tooltip\", function (d: any) {\n if (!context.tooltipInnerTextEllipsedOnly() || (d.innerTextObj && d.innerTextObj.isTruncated)) {\n context.tooltip.show.apply(context, arguments);\n }\n })\n .call(host._selection.enter.bind(host._selection))\n .on(\"click\", function (d: any) {\n context.click(host.rowToObj(d.origRow), d.column, host._selection.selected(this));\n })\n .on(\"dblclick\", function (d: any) {\n context.dblclick(host.rowToObj(d.origRow), d.column, host._selection.selected(this));\n })\n .style(\"opacity\", 0)\n .each(function (this: SVGElement, d: any) {\n const element = d3Select(this);\n element.append(\"rect\")\n .attr(\"class\", \"columnRect series series-\" + context.cssTag(d.column))\n ;\n element.append(\"text\")\n .attr(\"class\", \"columnRectText\")\n .style(\"stroke\", \"transparent\")\n ;\n })\n ;\n columnGEnter.transition().duration(duration)\n .style(\"opacity\", 1)\n ;\n const domainLength = host.yAxisStacked() ? dataLen : columnScale.bandwidth();\n columnGEnter.merge(columnGRect as any).each(function (this: SVGElement, d: any) {\n const element = d3Select(this);\n const domainPos = host.dataPos(dataRow[0]) + (host.yAxisStacked() ? 0 : columnScale(d.column)) + offset;\n const upperValue = d.value instanceof Array ? d.value[1] : d.value;\n let valueText = d.origRow[d.idx];\n if (context.showValue()) {\n const dm = context.dataMeta();\n switch (context.showValueAsPercent()) {\n case \"series\":\n const seriesSum = typeof dm.sum !== \"undefined\" ? dm.sum : seriesSums[d.idx];\n valueText = formatPct(valueText / seriesSum);\n break;\n case \"domain\":\n const domainSum = typeof dm.sum !== \"undefined\" ? dm.sum : domainSums[dataRowIdx];\n valueText = formatPct(valueText / domainSum);\n break;\n case null:\n default:\n valueText = d3Format(context.showValueFormat())(valueText);\n break;\n }\n }\n const upperValuePos = host.valuePos(upperValue);\n const lowerValuePos = host.valuePos(d.value instanceof Array ? d.value[0] : 0);\n const valuePos = Math.min(lowerValuePos, upperValuePos);\n const valueLength = Math.abs(upperValuePos - lowerValuePos);\n\n const innerTextHeight = context.innerTextFontSize();\n const innerTextPadding = context.innerTextPadding_exists() ? context.innerTextPadding() : innerTextHeight / 2.5;\n\n const dataRect = context.intersectRectRect(\n {\n x: isHorizontal ? domainPos : valuePos,\n y: isHorizontal ? valuePos : domainPos,\n width: isHorizontal ? domainLength : valueLength,\n height: isHorizontal ? valueLength : domainLength\n },\n {\n x: 0,\n y: 0,\n width: axisSize.width,\n height: axisSize.height\n }\n );\n\n const _rects = element.select(\"rect\").transition().duration(duration)\n .style(\"fill\", (d: any) => context.fillColor(d.row, d.column, d.value, d.origRow))\n ;\n\n if (isHorizontal) {\n _rects\n .attr(\"x\", domainPos)\n .attr(\"y\", valuePos)\n .attr(\"width\", domainLength)\n .attr(\"height\", valueLength)\n ;\n } else {\n _rects\n .attr(\"y\", domainPos)\n .attr(\"x\", valuePos)\n .attr(\"height\", domainLength)\n .attr(\"width\", valueLength)\n ;\n }\n const _texts = element.select(\"text\").transition().duration(duration)\n .style(\"font-size\", innerTextHeight + \"px\")\n .style(\"fill\", (d: any) => context.textColor(d.row, d.column, d.value, d.origRow))\n ;\n\n _texts.style(\"font-family\", context.innerTextFontFamily_exists() ? context.innerTextFontFamily() : null);\n\n const padding = context.innerTextPadding_exists() ? context.innerTextPadding() : 8;\n\n const textHeightOffset = innerTextHeight / 2.7;\n\n if (isHorizontal) { // Column\n const y = dataRect.y + dataRect.height - innerTextPadding;\n _texts\n .attr(\"x\", domainPos + (domainLength / 2))\n .attr(\"y\", y + textHeightOffset)\n .attr(\"transform\", `rotate(-90, ${domainPos + (domainLength / 2)}, ${y})`)\n ;\n } else { // Bar\n _texts\n .attr(\"x\", dataRect.x + padding)\n .attr(\"y\", domainPos + (domainLength / 2) + textHeightOffset)\n ;\n }\n _texts\n .attr(\"height\", domainLength)\n .attr(\"width\", valueLength)\n ;\n if (context.showInnerText()) {\n _texts\n .text((d: any) => {\n const innerText = context.innerText(d.origRow, d.origRow[columnLength], d.idx);\n if (innerText) {\n const clippedValueLength = isHorizontal ? dataRect.height : dataRect.width;\n const innerTextObj = context.calcInnerText(clippedValueLength, innerText, valueText);\n d.innerTextObj = innerTextObj;\n\n return innerTextObj.text;\n }\n return \"\";\n })\n ;\n }\n const dataText = element.selectAll(\".dataText\").data(context.showValue() ? [`${upperValue}`] : []);\n const dataTextEnter = dataText.enter().append(\"g\")\n .attr(\"class\", \"dataText\")\n .each(function (this: SVGElement, d) {\n context.textLocal.set(this, new Text().target(this).colorStroke_default(\"transparent\"));\n });\n dataTextEnter.merge(dataText as any)\n .each(function (this: SVGElement) {\n const pos = { x: 0, y: 0 };\n const valueFontFamily = context.valueFontFamily();\n const valueFontSize = context.valueFontSize();\n const textSize = context.textSize(valueText, valueFontFamily, valueFontSize);\n\n const isPositive = parseFloat(valueText) >= 0;\n\n let valueAnchor = context.valueAnchor() ? context.valueAnchor() : isHorizontal ? \"middle\" : \"start\";\n\n const leftSpace = dataRect.x;\n const rightSpace = axisSize.width - (dataRect.x + dataRect.width);\n const topSpace = dataRect.y;\n const bottomSpace = axisSize.height - (dataRect.y + dataRect.height);\n\n let noRoomInside;\n let isOutside;\n let noRoomOnExpectedSide;\n\n if (d.innerTextObj) {\n const { padding, valueTextWidth } = d.innerTextObj;\n isOutside = false;\n if (isHorizontal) { // Column\n valueAnchor = \"middle\";\n pos.x = domainPos + (domainLength / 2);\n\n if (d.innerTextObj.category === 4) {\n isOutside = true;\n pos.y = valuePos - padding - (valueFontSize / 2);\n } else {\n pos.y = valuePos + padding + (valueFontSize / 2);\n }\n } else { // Bar\n valueAnchor = \"start\";\n if (d.innerTextObj.category === 4) {\n isOutside = true;\n pos.x = (valueLength + valuePos) + padding;\n } else {\n pos.x = (valueLength + valuePos) - valueTextWidth - padding;\n }\n pos.y = domainPos + (domainLength / 2);\n }\n } else {\n /*\n IF this.valueCentered() and NO ROOM INSIDE\n ...then ASSUME THERES ROOM OUTSIDE\n IF NO ROOM OUTSIDE ON EXPECTED SIDE\n ...then ASSUME THERES ROOM ON THE OPPOSITE SIDE\n */\n if (isHorizontal) { // Column\n noRoomInside = dataRect.height < textSize.height;\n isOutside = !context.valueCentered() || noRoomInside;\n\n pos.x = dataRect.x + (dataRect.width / 2);\n\n if (isOutside) {\n if (isPositive) {\n noRoomOnExpectedSide = topSpace < textSize.height + padding;\n if (noRoomOnExpectedSide) {\n if (!noRoomInside) {\n isOutside = false;\n pos.y = dataRect.y + (dataRect.height / 2);\n } else {\n pos.y = dataRect.y + dataRect.height + textSize.height;\n }\n } else {\n pos.y = dataRect.y - (textSize.height / 2) - padding;\n }\n } else {\n noRoomOnExpectedSide = bottomSpace < textSize.height;\n if (noRoomOnExpectedSide) {\n if (!noRoomInside) {\n isOutside = false;\n pos.y = dataRect.y + (dataRect.height / 2);\n } else {\n pos.y = dataRect.y - (textSize.height / 2) - padding;\n }\n } else {\n pos.y = dataRect.y + textSize.height + padding;\n }\n }\n } else {\n pos.y = dataRect.y + (dataRect.height / 2);\n }\n } else { // Bar\n noRoomInside = dataRect.width < textSize.width;\n isOutside = !context.valueCentered() || noRoomInside;\n\n pos.y = dataRect.y + (dataRect.height / 2);\n\n if (isOutside) {\n if (isPositive) {\n noRoomOnExpectedSide = rightSpace < textSize.width + padding;\n if (noRoomOnExpectedSide) {\n if (context.showInnerText() || !noRoomInside) {\n isOutside = false;\n pos.x = dataRect.x + (dataRect.width / 2);\n } else {\n pos.x = dataRect.x - (textSize.width - padding);\n }\n } else {\n pos.x = dataRect.x + dataRect.width + (textSize.width / 2) + padding;\n }\n } else {\n noRoomOnExpectedSide = leftSpace < textSize.width;\n if (noRoomOnExpectedSide) {\n if (context.showInnerText() || !noRoomInside) {\n isOutside = false;\n pos.x = dataRect.x + (dataRect.width / 2);\n } else {\n pos.x = dataRect.x + dataRect.width + (textSize.width - padding);\n }\n } else {\n pos.x = dataRect.x - (textSize.width - padding);\n }\n }\n } else {\n pos.x = dataRect.x + (dataRect.width / 2);\n }\n }\n }\n const textColor = isOutside ? null : context.textColor(d.row, d.column, d.value, d.origRow);\n\n // Prevent overlapping labels on stacked columns\n const columns = context.columns();\n const hideValue = (context.yAxisStacked() && noRoomInside) ||\n (isOutside && context.yAxisStacked() && columns.indexOf(d.column) !== columns.length - 1);\n context.textLocal.get(this)\n .pos(pos)\n .anchor(valueAnchor)\n .fontFamily(valueFontFamily)\n .fontSize(valueFontSize)\n .text(`${valueText}`)\n .colorFill(textColor)\n .visible(context.showValue() && !hideValue)\n .render()\n ;\n\n });\n dataText.exit()\n .each(function (this: SVGElement, d) {\n context.textLocal.get(this).target(null);\n })\n .remove()\n ;\n });\n columnGRect.exit().transition().duration(duration)\n .style(\"opacity\", 0)\n .remove()\n ;\n\n const value4pos = host.yAxisStacked() ? domainSums[dataRowIdx] : Math.max(...dataRow.filter((_, idx) => idx > 0 && idx < columnLength));\n const stackedTotalText = element.selectAll(\".stackedTotalText\").data(context.showDomainTotal() ? [domainSums[dataRowIdx]] : []);\n const stackedTotalTextEnter = stackedTotalText.enter().append(\"g\")\n .attr(\"class\", \"stackedTotalText\")\n .each(function (this: SVGElement, d) {\n context.stackedTextLocal.set(this, new Text().target(this).colorStroke_default(\"transparent\"));\n });\n stackedTotalTextEnter.merge(stackedTotalText as any)\n .each(function (this: SVGElement, d: any) {\n const pos = { x: 0, y: 0 };\n const domainPos = host.dataPos(dataRow[0]);\n const valuePos = host.valuePos(value4pos);\n\n const valueFontFamily = context.valueFontFamily();\n const valueFontSize = context.valueFontSize();\n const textSize = context.textSize(d, valueFontFamily, valueFontSize);\n\n const isPositive = parseFloat(d) >= 0;\n let valueAnchor: \"start\" | \"middle\" | \"end\" = \"middle\";\n if (isHorizontal) {\n pos.x = domainPos;\n if (isPositive) {\n pos.y = valuePos - textSize.height / 2;\n } else {\n pos.y = valuePos + textSize.height / 2;\n }\n } else {\n valueAnchor = \"start\";\n pos.y = domainPos;\n if (isPositive) {\n pos.x = valuePos + textSize.width / 2;\n } else {\n pos.x = valuePos - textSize.width / 2;\n }\n }\n\n context.stackedTextLocal.get(this)\n .pos(pos)\n .anchor(valueAnchor)\n .fontFamily(valueFontFamily)\n .fontSize(valueFontSize)\n .text(d)\n .render()\n ;\n\n });\n stackedTotalText.exit()\n .each(function (this: SVGElement, d) {\n context.textLocal.get(this).target(null);\n })\n .remove()\n ;\n });\n column.exit().transition().duration(duration)\n .remove()\n ;\n }\n\n calcInnerText(offset, innerText, valueText) {\n\n const fontFamily = this.innerTextFontFamily_exists() ? this.innerTextFontFamily() : \"Verdana\";\n const fontSize = this.innerTextFontSize();\n const valueFontFamily = this.valueFontFamily_exists() ? this.valueFontFamily() : \"Verdana\";\n const valueFontSize = this.valueFontSize();\n const padding = this.innerTextPadding_exists() ? this.innerTextPadding() : fontSize / 2.5;\n const valueTextWidth = this.isHorizontal ? valueFontSize : this.textSize(valueText, valueFontFamily, valueFontSize).width;\n const ellipsisWidth = this.textSize(\"...\", fontFamily, fontSize).width;\n const innerTextWidth = this.textSize(innerText, fontFamily, fontSize).width;\n const origInnerText = innerText;\n\n const fullWidth = (padding * 3) + innerTextWidth + valueTextWidth;\n const fullWidth2 = (padding * 3) + ellipsisWidth + valueTextWidth;\n const fullWidth3 = (padding * 1) + valueTextWidth;\n /*\n Categories:\n 1) room to display inner text (with padding) AND value text (with padding)\n 2) room to display ellipsis (with padding) AND value text (with padding)\n 3) room to display value text only (with padding)\n 4) no room to display any text except value on the outside\n */\n let category = 4;\n if (fullWidth < offset) {\n category = 1;\n } else if (fullWidth2 < offset) {\n const excessWidth = offset - fullWidth2;\n let _text = \"\";\n for (const letter of innerText) {\n if (this.textSize(_text + letter, fontFamily, fontSize).width > excessWidth) {\n innerText = _text + \"...\";\n break;\n } else {\n _text += letter;\n }\n }\n category = 2;\n } else if (fullWidth3 < offset) {\n innerText = \"\";\n category = 3;\n } else {\n innerText = \"\";\n }\n\n return {\n text: innerText,\n isTruncated: origInnerText !== innerText,\n padding,\n category,\n valueTextWidth\n };\n }\n\n innerText(origRow, lparam, idx): string {\n return origRow[0];\n }\n}\nColumn.prototype._class += \" chart_Column\";\nColumn.prototype.implements(INDChart.prototype);\nColumn.prototype.implements(ITooltip.prototype);\n\nexport interface Column {\n paletteID(): string;\n paletteID(_: string): this;\n useClonedPalette(): boolean;\n useClonedPalette(_: boolean): this;\n showValue(): boolean;\n showValue(_: boolean): this;\n showInnerText(): boolean;\n showInnerText(_: boolean): this;\n showValueFormat(): string;\n showValueFormat(_: string): this;\n showValueAsPercent(): null | \"series\" | \"domain\";\n showValueAsPercent(_: null | \"series\" | \"domain\"): this;\n showValueAsPercentFormat(): string;\n showValueAsPercentFormat(_: string): this;\n showDomainTotal(): boolean;\n showDomainTotal(_: boolean): this;\n valueCentered(): boolean;\n valueCentered(_: boolean): this;\n valueAnchor(): \"start\" | \"middle\" | \"end\";\n valueAnchor(_: \"start\" | \"middle\" | \"end\"): this;\n valueFontFamily(): string;\n valueFontFamily(_: string): this;\n valueFontFamily_exists(): boolean;\n valueFontSize(): number;\n valueFontSize(_: number): this;\n xAxisSeriesPaddingInner(): number;\n xAxisSeriesPaddingInner(_: number): this;\n innerTextFontFamily(): string;\n innerTextFontFamily(_: string): this;\n innerTextFontFamily_exists(): boolean;\n innerTextFontSize(): number;\n innerTextFontSize(_: number): this;\n innerTextPadding(): number;\n innerTextPadding(_: number): this;\n innerTextPadding_exists(): boolean;\n tooltipInnerTextEllipsedOnly(): boolean;\n tooltipInnerTextEllipsedOnly(_: boolean): this;\n\n // INDChart ---\n fillColor(row, column, value, origRow): string;\n textColor(row, column, value, origRow): string;\n dblclick(row, column, selected): void;\n\n // ITooltip ---\n tooltip;\n tooltipHTML(_): string;\n tooltipFormat(_): string;\n tooltipStyle(): \"default\" | \"none\" | \"series-table\";\n tooltipStyle(_: \"default\" | \"none\" | \"series-table\"): this;\n}\n\nColumn.prototype.publish(\"valueFontFamily\", null, \"string\", \"Font family of value text\", null, { optional: true });\nColumn.prototype.publish(\"valueFontSize\", 12, \"number\", \"Height of value text (pixels)\");\nColumn.prototype.publish(\"innerTextFontFamily\", null, \"string\", \"Font family of inner text\", null, { optional: true });\nColumn.prototype.publish(\"innerTextPadding\", 8, \"number\", \"Offset of inner text (pixels)\", null, { optional: true });\nColumn.prototype.publish(\"innerTextFontSize\", 12, \"number\", \"Height of inner text (pixels)\");\nColumn.prototype.publish(\"paletteID\", \"default\", \"set\", \"Color palette for this widget\", () => Column.prototype._palette.switch(), { tags: [\"Basic\", \"Shared\"] });\nColumn.prototype.publish(\"useClonedPalette\", false, \"boolean\", \"Enable or disable using a cloned palette\", null, { tags: [\"Intermediate\", \"Shared\"] });\nColumn.prototype.publish(\"showValue\", false, \"boolean\", \"Show Value in column\");\nColumn.prototype.publish(\"showInnerText\", false, \"boolean\", \"Show Label in column\");\nColumn.prototype.publish(\"showValueFormat\", \",\", \"string\", \"D3 Format for Value\", null, { disable: (w: Column) => !w.showValue() || !!w.showValueAsPercent() });\nColumn.prototype.publish(\"showValueAsPercent\", null, \"set\", \"If showValue is true, optionally show value as a percentage by Series or Domain\", [null, \"series\", \"domain\"], { disable: w => !w.showValue(), optional: true });\nColumn.prototype.publish(\"showValueAsPercentFormat\", \".0%\", \"string\", \"D3 Format for %\", null, { disable: (w: Column) => !w.showValue() || !w.showValueAsPercent() });\nColumn.prototype.publish(\"showDomainTotal\", false, \"boolean\", \"Show Total Value for Stacked Columns\", null);\nColumn.prototype.publish(\"valueCentered\", false, \"boolean\", \"Show Value in center of column\");\nColumn.prototype.publish(\"valueAnchor\", \"middle\", \"set\", \"text-anchor for shown value text\", [\"start\", \"middle\", \"end\"]);\nColumn.prototype.publish(\"xAxisSeriesPaddingInner\", 0, \"number\", \"Determines the ratio of the range that is reserved for blank space between band (0->1)\");\nColumn.prototype.publish(\"tooltipInnerTextEllipsedOnly\", false, \"boolean\", \"Show tooltip only when inner text is truncated with an ellipsis\");\n\n/*\nconst origUseClonedPalette = Column.prototype.useClonedPalette;\nColumn.prototype.useClonedPalette = function (this: Column, _?) {\n const retVal = origUseClonedPalette.apply(this, arguments);\n if (arguments.length) {\n this._useClonedPalette = _;\n }\n return retVal;;\n}\n*/\n","import { Column } from \"./Column.ts\";\n\nexport class Bar extends Column {\n constructor() {\n super();\n this.orientation_default(\"vertical\");\n }\n}\nBar.prototype._class += \" chart_Bar\";\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","import { I2DChart, ITooltip } from \"@hpcc-js/api\";\nimport { FAChar, InputField, ISize, SVGWidget, Text, Utility } from \"@hpcc-js/common\";\nimport { hierarchy as d3Hierarchy, pack as d3Pack } from \"d3-hierarchy\";\nimport { select as d3Select } from \"d3-selection\";\n\nimport \"../src/Bubble.css\";\n\nexport class Bubble extends SVGWidget {\n static __inputs: InputField[] = [{\n id: \"label\",\n type: \"string\"\n }, {\n id: \"value\",\n type: \"number\"\n }];\n\n labelWidgets;\n d3Pack;\n\n constructor() {\n super();\n I2DChart.call(this);\n ITooltip.call(this);\n Utility.SimpleSelectionMixin.call(this);\n\n this._drawStartPos = \"origin\";\n\n this.labelWidgets = {};\n\n this.d3Pack = d3Pack()\n .size([this.width(), this.height()])\n .padding(1.5)\n ;\n }\n\n size(): ISize;\n size(_): this;\n size(_?): ISize | this {\n const retVal = super.size.apply(this, arguments);\n if (arguments.length) {\n this.d3Pack\n .size([this.width(), this.height()])\n ;\n }\n return retVal;\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n this._selection.widgetElement(element);\n const context = this;\n this\n .tooltipHTML(function (d) {\n switch (context.tooltipStyle()) {\n case \"series-table\":\n return context.tooltipFormat({\n label: d[0],\n arr: context.columns().slice(1).map(function (column, i) {\n return {\n label: column,\n color: context._palette(d[0]),\n value: d[1]\n };\n })\n });\n default:\n return context.tooltipFormat({ label: d.data[0], value: d.data[1] });\n }\n })\n ;\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({ children: this.cloneData() })\n .sum(function (d) { return d[1]; })\n .sort(function (b, a) {\n return a[1] < b[1] ? -1 : a[1] > b[1] ? 1 : 0;\n })\n ;\n this.d3Pack(root);\n\n const node = element.selectAll(\".node\").data(root.children || [], d => d.data[0]);\n\n // Enter ---\n node.enter().append(\"g\")\n .attr(\"class\", (d, i) => \"node series series-\" + this.cssTag(d.data[0]))\n .attr(\"opacity\", 0)\n .call(this._selection.enter.bind(this._selection))\n .on(\"click\", function (d) {\n context.click(context.rowToObj(d.data), context.columns()[1], context._selection.selected(this));\n })\n .on(\"dblclick\", function (d) {\n context.dblclick(context.rowToObj(d.data), context.columns()[1], context._selection.selected(this));\n })\n .each(function (d) {\n const element2 = d3Select(this);\n const pos = { x: d.x, y: d.y };\n element2.append(\"circle\")\n .attr(\"transform\", \"translate(\" + pos.x + \",\" + pos.y + \")\")\n .attr(\"r\", 0)\n .on(\"mouseout.tooltip\", context.tooltip.hide)\n .on(\"mousemove.tooltip\", context.tooltip.show)\n ;\n if (d.__viz_faChar) {\n context.labelWidgets[d.data[0]] = new FAChar()\n .char(d.__viz_faChar)\n .target(this)\n .render()\n ;\n } else {\n context.labelWidgets[d.data[0]] = new Text()\n .text(d.data[0])\n .target(this)\n .render()\n ;\n }\n })\n .merge(node).transition()\n .attr(\"opacity\", 1)\n .each(function (d) {\n const element2 = d3Select(this);\n const pos = { x: d.x, y: d.y };\n element2.select(\"circle\").transition()\n .attr(\"transform\", \"translate(\" + pos.x + \",\" + pos.y + \")\")\n .style(\"fill\", context.fillColor(d.data, context.columns()[1], d.data[1]))\n .attr(\"r\", d.r)\n .select(\"title\")\n .text(d.data[0] + \" (\" + d.data[1] + \")\")\n ;\n if (d.__viz_faChar) {\n context.labelWidgets[d.data[0]]\n .pos(pos)\n .render()\n ;\n } else {\n context.labelWidgets[d.data[0]]\n .pos(pos)\n .colorFill_default(context.textColor(d.data, context.columns()[1], d.data[1]))\n .width(d.r * 2)\n .text(d.data[0])\n .render()\n ;\n }\n })\n ;\n\n // Exit ---\n node.exit().transition()\n .style(\"opacity\", 0)\n .remove()\n ;\n }\n\n exit(domNode, element) {\n super.exit(domNode, element);\n }\n\n}\nBubble.prototype._class += \" chart_Bubble\";\nBubble.prototype.implements(I2DChart.prototype);\nBubble.prototype.implements(ITooltip.prototype);\nBubble.prototype.mixin(Utility.SimpleSelectionMixin);\n\nexport interface Bubble {\n paletteID(): string;\n paletteID(_: string): this;\n useClonedPalette(): boolean;\n useClonedPalette(_: boolean): this;\n\n // I2DChart\n _palette;\n fillColor(row: any[], column: string, value: number): string;\n textColor(row: any[], column: string, value: number): string;\n click(row, column, selected): void;\n dblclick(row, column, selected): void;\n\n // ITooltip\n tooltip;\n tooltipHTML(_): string;\n tooltipFormat(_): string;\n tooltipStyle(): \"default\" | \"none\" | \"series-table\";\n\n // SimpleSelectionMixin\n _selection;\n}\n\nBubble.prototype.publish(\"paletteID\", \"default\", \"set\", \"Color palette for this widget\", Bubble.prototype._palette.switch(), { tags: [\"Basic\", \"Shared\"] });\nBubble.prototype.publish(\"useClonedPalette\", false, \"boolean\", \"Enable or disable using a cloned palette\", null, { tags: [\"Intermediate\", \"Shared\"] });\n","import { Scatter } from \"./Scatter.ts\";\n\nexport class BubbleXY extends Scatter {\n constructor() {\n super();\n }\n enter(domNode, element) {\n if (!this.pointSizeColumn_exists()) {\n this.pointSizeColumn(this.columns()[this.columns().length - 1]);\n }\n super.enter(domNode, element);\n }\n}\nBubbleXY.prototype._class += \" chart_BubbleXY\";\n","var frame = 0, // is an animation frame pending?\n timeout = 0, // is a timeout pending?\n interval = 0, // are any timers active?\n pokeDelay = 1000, // how frequently we check for clock skew\n taskHead,\n taskTail,\n clockLast = 0,\n clockNow = 0,\n clockSkew = 0,\n clock = typeof performance === \"object\" && performance.now ? performance : Date,\n setFrame = typeof window === \"object\" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) { setTimeout(f, 17); };\n\nexport function now() {\n return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);\n}\n\nfunction clearNow() {\n clockNow = 0;\n}\n\nexport function Timer() {\n this._call =\n this._time =\n this._next = null;\n}\n\nTimer.prototype = timer.prototype = {\n constructor: Timer,\n restart: function(callback, delay, time) {\n if (typeof callback !== \"function\") throw new TypeError(\"callback is not a function\");\n time = (time == null ? now() : +time) + (delay == null ? 0 : +delay);\n if (!this._next && taskTail !== this) {\n if (taskTail) taskTail._next = this;\n else taskHead = this;\n taskTail = this;\n }\n this._call = callback;\n this._time = time;\n sleep();\n },\n stop: function() {\n if (this._call) {\n this._call = null;\n this._time = Infinity;\n sleep();\n }\n }\n};\n\nexport function timer(callback, delay, time) {\n var t = new Timer;\n t.restart(callback, delay, time);\n return t;\n}\n\nexport function timerFlush() {\n now(); // Get the current time, if not already set.\n ++frame; // Pretend we’ve set an alarm, if we haven’t already.\n var t = taskHead, e;\n while (t) {\n if ((e = clockNow - t._time) >= 0) t._call.call(null, e);\n t = t._next;\n }\n --frame;\n}\n\nfunction wake() {\n clockNow = (clockLast = clock.now()) + clockSkew;\n frame = timeout = 0;\n try {\n timerFlush();\n } finally {\n frame = 0;\n nap();\n clockNow = 0;\n }\n}\n\nfunction poke() {\n var now = clock.now(), delay = now - clockLast;\n if (delay > pokeDelay) clockSkew -= delay, clockLast = now;\n}\n\nfunction nap() {\n var t0, t1 = taskHead, t2, time = Infinity;\n while (t1) {\n if (t1._call) {\n if (time > t1._time) time = t1._time;\n t0 = t1, t1 = t1._next;\n } else {\n t2 = t1._next, t1._next = null;\n t1 = t0 ? t0._next = t2 : taskHead = t2;\n }\n }\n taskTail = t0;\n sleep(time);\n}\n\nfunction sleep(time) {\n if (frame) return; // Soonest alarm already set, or will be.\n if (timeout) timeout = clearTimeout(timeout);\n var delay = time - clockNow; // Strictly less than if we recomputed clockNow.\n if (delay > 24) {\n if (time < Infinity) timeout = setTimeout(wake, time - clock.now() - clockSkew);\n if (interval) interval = clearInterval(interval);\n } else {\n if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay);\n frame = 1, setFrame(wake);\n }\n}\n","import { descending as d3Descending } from \"d3-array\";\r\nimport { axisLeft as d3AxisLeft } from \"d3-axis\";\r\nimport { scaleLinear as d3ScaleLinear } from \"d3-scale\";\r\nimport { select as d3Select } from \"d3-selection\";\r\nimport { timerFlush as d3TimerFlush } from \"d3-timer\";\r\nimport \"d3-transition\";\r\n\r\nexport default function () {\r\n var orient = \"left\",\r\n reverse = false,\r\n vertical = false,\r\n ranges = bulvarRanges,\r\n markers = bulvarMarkers,\r\n measures = bulvarMeasures,\r\n width = 380,\r\n height = 30,\r\n xAxis = d3AxisLeft();\r\n\r\n // For each small multiple…\r\n function bulvar(g) {\r\n g.each(function (d, i) {\r\n var rangez = ranges.call(this, d, i).slice().sort(d3Descending),\r\n markerz = markers.call(this, d, i).slice().sort(d3Descending),\r\n measurez = measures.call(this, d, i).slice().sort(d3Descending),\r\n g2 = d3Select(this),\r\n extentX,\r\n extentY;\r\n\r\n var wrap = g2.select(\"g.wrap\");\r\n if (wrap.empty()) wrap = g2.append(\"g\").attr(\"class\", \"wrap\");\r\n\r\n if (vertical) {\r\n extentX = height, extentY = width;\r\n wrap.attr(\"transform\", \"rotate(90)translate(0,\" + -width + \")\");\r\n } else {\r\n extentX = width, extentY = height;\r\n wrap.attr(\"transform\", null);\r\n }\r\n\r\n // Compute the new x-scale.\r\n var x1 = d3ScaleLinear()\r\n .domain([0, Math.max(rangez[0], markerz[0], measurez[0])])\r\n .range(reverse ? [extentX, 0] : [0, extentX]);\r\n\r\n // Retrieve the old x-scale, if this is an update.\r\n var x0 = this.__chart__ || d3ScaleLinear()\r\n .domain([0, Infinity])\r\n .range(x1.range());\r\n\r\n // Stash the new scale.\r\n this.__chart__ = x1;\r\n\r\n // Derive width-scales from the x-scales.\r\n var w0 = bulvarWidth(x0),\r\n w1 = bulvarWidth(x1);\r\n\r\n // Update the range rects.\r\n var range = wrap.selectAll(\"rect.range\")\r\n .data(rangez);\r\n\r\n range.enter().append(\"rect\")\r\n .attr(\"class\", function (_d, i2) { return \"range s\" + i2; })\r\n .attr(\"width\", w0)\r\n .attr(\"height\", extentY)\r\n .attr(\"x\", reverse ? x0 : 0)\r\n .merge(range)\r\n .transition(range)\r\n .attr(\"x\", reverse ? x1 : 0)\r\n .attr(\"width\", w1)\r\n .attr(\"height\", extentY);\r\n\r\n // Update the measure rects.\r\n var measure = wrap.selectAll(\"rect.measure\")\r\n .data(measurez);\r\n\r\n measure.enter().append(\"rect\")\r\n .attr(\"class\", function (_d, i2) { return \"measure s\" + i2; })\r\n .attr(\"width\", w0)\r\n .attr(\"height\", extentY / 3)\r\n .attr(\"x\", reverse ? x0 : 0)\r\n .attr(\"y\", extentY / 3)\r\n .merge(measure)\r\n .transition(measure)\r\n .attr(\"width\", w1)\r\n .attr(\"height\", extentY / 3)\r\n .attr(\"x\", reverse ? x1 : 0)\r\n .attr(\"y\", extentY / 3);\r\n\r\n // Update the marker lines.\r\n var marker = wrap.selectAll(\"line.marker\")\r\n .data(markerz);\r\n\r\n marker.enter().append(\"line\")\r\n .attr(\"class\", \"marker\")\r\n .attr(\"x1\", x0)\r\n .attr(\"x2\", x0)\r\n .attr(\"y1\", extentY / 6)\r\n .attr(\"y2\", extentY * 5 / 6)\r\n .merge(marker)\r\n .transition(marker)\r\n .attr(\"x1\", x1)\r\n .attr(\"x2\", x1)\r\n .attr(\"y1\", extentY / 6)\r\n .attr(\"y2\", extentY * 5 / 6);\r\n\r\n var axis = g2.selectAll(\"g.axis\").data([0]);\r\n axis.enter().append(\"g\").attr(\"class\", \"axis\");\r\n axis.attr(\"transform\", vertical ? null : \"translate(0,\" + extentY + \")\")\r\n .call(xAxis.scale(x1));\r\n });\r\n d3TimerFlush();\r\n }\r\n\r\n // left, right, top, bottom\r\n bulvar.orient = function (_) {\r\n if (!arguments.length) return orient;\r\n orient = _ + \"\";\r\n reverse = orient === \"right\" || orient === \"bottom\";\r\n xAxis.orient((vertical = orient === \"top\" || orient === \"bottom\") ? \"left\" : \"bottom\"); // eslint-disable-line\r\n return bulvar;\r\n };\r\n\r\n // ranges (bad, satisfactory, good)\r\n bulvar.ranges = function (_) {\r\n if (!arguments.length) return ranges;\r\n ranges = _;\r\n return bulvar;\r\n };\r\n\r\n // markers (previous, goal)\r\n bulvar.markers = function (_) {\r\n if (!arguments.length) return markers;\r\n markers = _;\r\n return bulvar;\r\n };\r\n\r\n // measures (actual, forecast)\r\n bulvar.measures = function (_) {\r\n if (!arguments.length) return measures;\r\n measures = _;\r\n return bulvar;\r\n };\r\n\r\n bulvar.width = function (_) {\r\n if (!arguments.length) return width;\r\n width = +_;\r\n return bulvar;\r\n };\r\n\r\n bulvar.height = function (_) {\r\n if (!arguments.length) return height;\r\n height = +_;\r\n return bulvar;\r\n };\r\n\r\n bulvar.tickFormat = function (_) {\r\n if (!arguments.length) return xAxis.tickFormat();\r\n xAxis.tickFormat(_);\r\n return bulvar;\r\n };\r\n\r\n return bulvar;\r\n}\r\n\r\nfunction bulvarRanges(d) {\r\n return d.ranges;\r\n}\r\n\r\nfunction bulvarMarkers(d) {\r\n return d.markers;\r\n}\r\n\r\nfunction bulvarMeasures(d) {\r\n return d.measures;\r\n}\r\n\r\nfunction bulvarWidth(x) {\r\n var x0 = x(0);\r\n return function (d) {\r\n return Math.abs(x(d) - x0);\r\n };\r\n}\r\n","import { HTMLWidget, Utility } from \"@hpcc-js/common\";\nimport { select as d3Select } from \"d3-selection\";\nimport { bullet as d3Bullet } from \"d3v4-bullet\";\n\nimport \"../src/Bullet.css\";\n\nexport class Bullet extends HTMLWidget {\n\n private _hiddenColumns = {};\n\n constructor() {\n super();\n Utility.SimpleSelectionMixin.call(this, true);\n }\n\n bulletData() {\n const context = this;\n this._hiddenColumns = {};\n const columns = this.columns();\n return this.data().map(function (row) {\n return {\n title: valueOf(row, this.titleColumn()),\n subtitle: valueOf(row, this.subtitleColumn()),\n ranges: valueOf(row, this.rangesColumn(), \"range\"),\n measures: valueOf(row, this.measuresColumn(), \"measure\"),\n markers: valueOf(row, this.markersColumn(), \"marker\"),\n origRow: row\n };\n }, this);\n\n function valueOf(row, column, columnType?) {\n const colIdx = columns.indexOf(column);\n if (colIdx >= 0) {\n if (row[colIdx] instanceof Array) {\n return row[colIdx];\n }\n return [row[colIdx]];\n }\n if (columnType) {\n context._hiddenColumns[columnType] = true;\n }\n return [0];\n }\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n d3Select(domNode.parentNode).style(\"overflow\", \"auto\");\n this._selection.widgetElement(element);\n }\n\n update(_domNode, element) {\n super.update(_domNode, element);\n const context = this;\n\n element.selectAll(\".axis\")\n .style(\"display\", \"none\")\n ;\n element.selectAll(\".range,.measure,.marker\")\n .style(\"display\", null)\n ;\n\n const margin = { left: 2, top: 8, right: 2, bottom: 8 };\n const width = this.width() - margin.left - margin.right;\n const height = 40 - margin.top - margin.bottom;\n\n const svg = element.selectAll(\"svg\").data(this.bulletData());\n const svgUpdate = svg.enter().append(\"svg\")\n .attr(\"class\", \"bullet\")\n .call(this._selection.enter.bind(this._selection))\n .on(\"click\", function (d) {\n context.click(context.rowToObj(d.origRow), context.titleColumn(), context._selection.selected(this));\n })\n .on(\"dblclick\", function (d) {\n context.dblclick(context.rowToObj(d.origRow), context.titleColumn(), context._selection.selected(this));\n })\n .each(function () {\n const element2 = d3Select(this);\n const bulletBar = element2.append(\"g\")\n .attr(\"class\", (d, i) => \"bulletBar series series-\" + context.cssTag(context.titleColumn()))\n ;\n const bulletTitle = bulletBar.append(\"g\")\n .attr(\"class\", \"bulletTitle\")\n ;\n bulletTitle.append(\"text\")\n .attr(\"class\", \"title\")\n ;\n bulletTitle.append(\"text\")\n .attr(\"class\", \"subtitle\")\n .attr(\"dy\", \"1em\")\n ;\n })\n .merge(svg)\n ;\n\n // Title ---\n const title = svgUpdate.select(\".bulletTitle\")\n .style(\"text-anchor\", \"end\")\n .attr(\"transform\", \"translate(-6,\" + height / 2 + \")\")\n ;\n title.select(\".title\")\n .text(function (d) { return d.title; })\n ;\n title.select(\".subtitle\")\n .text(function (d) { return d.subtitle; })\n ;\n\n let titleWidth = 0;\n title.each(function () {\n const bbox = this.getBBox();\n if (bbox.width > titleWidth) {\n titleWidth = bbox.width;\n }\n });\n\n // Bullet Chart ---\n const chart = d3Bullet()\n .width(width - titleWidth - 6)\n .height(height)\n ;\n svgUpdate\n .attr(\"width\", width)\n .attr(\"height\", height + margin.top + margin.bottom)\n .style(\"margin-left\", `${margin.left}px`)\n ;\n svgUpdate.select(\".bulletBar\")\n .attr(\"transform\", \"translate(\" + (titleWidth + 6) + \",\" + margin.top + \")\")\n .call(chart)\n ;\n\n svg.exit().remove();\n\n if (Object.keys(this._hiddenColumns).length > 0) {\n element.selectAll(`.${Object.keys(this._hiddenColumns).join(\",.\")}`)\n .style(\"display\", \"none\")\n ;\n }\n }\n\n exit(domNode, element) {\n super.exit(domNode, element);\n }\n\n // Events ---\n click(row, column, selected) {\n // console.log(\"Click: \" + JSON.stringify(row) + \", \" + column + \",\" + selected);\n }\n\n dblclick(row, column, selected) {\n // console.log(\"Double click: \" + JSON.stringify(row) + \", \" + column + \",\" + selected);\n }\n\n // SimpleSelectionMixin\n _selection;\n}\nBullet.prototype._class += \" chart_Bullet\";\n\nexport interface Bullet {\n titleColumn(): string;\n titleColumn(_: string): this;\n subtitleColumn(): string;\n subtitleColumn(_: string): this;\n rangesColumn(): string;\n rangesColumn(_: string): this;\n measuresColumn(): string;\n measuresColumn(_: string): this;\n markersColumn(): string;\n markersColumn(_: string): this;\n}\n\nBullet.prototype.publish(\"titleColumn\", null, \"set\", \"Title Column\", function () { return this.columns(); }, { optional: true });\nBullet.prototype.publish(\"subtitleColumn\", null, \"set\", \"Subtitle Column\", function () { return this.columns(); }, { optional: true });\nBullet.prototype.publish(\"rangesColumn\", null, \"set\", \"Ranges Column\", function () { return this.columns(); }, { optional: true });\nBullet.prototype.publish(\"measuresColumn\", null, \"set\", \"Measures Column\", function () { return this.columns(); }, { optional: true });\nBullet.prototype.publish(\"markersColumn\", null, \"set\", \"Markers Column\", function () { return this.columns(); }, { optional: true });\n\n","var array = Array.prototype;\n\nexport var slice = array.slice;\n","export default function(a, b) {\n return a - b;\n}\n","export default function(ring) {\n var i = 0, n = ring.length, area = ring[n - 1][1] * ring[0][0] - ring[n - 1][0] * ring[0][1];\n while (++i < n) area += ring[i - 1][1] * ring[i][0] - ring[i - 1][0] * ring[i][1];\n return area;\n}\n","export default function(x) {\n return function() {\n return x;\n };\n}\n","export default function(ring, hole) {\n var i = -1, n = hole.length, c;\n while (++i < n) if (c = ringContains(ring, hole[i])) return c;\n return 0;\n}\n\nfunction ringContains(ring, point) {\n var x = point[0], y = point[1], contains = -1;\n for (var i = 0, n = ring.length, j = n - 1; i < n; j = i++) {\n var pi = ring[i], xi = pi[0], yi = pi[1], pj = ring[j], xj = pj[0], yj = pj[1];\n if (segmentContains(pi, pj, point)) return 0;\n if (((yi > y) !== (yj > y)) && ((x < (xj - xi) * (y - yi) / (yj - yi) + xi))) contains = -contains;\n }\n return contains;\n}\n\nfunction segmentContains(a, b, c) {\n var i; return collinear(a, b, c) && within(a[i = +(a[0] === b[0])], c[i], b[i]);\n}\n\nfunction collinear(a, b, c) {\n return (b[0] - a[0]) * (c[1] - a[1]) === (c[0] - a[0]) * (b[1] - a[1]);\n}\n\nfunction within(p, q, r) {\n return p <= q && q <= r || r <= q && q <= p;\n}\n","export default function() {}\n","import {extent, thresholdSturges, tickStep, range} from \"d3-array\";\nimport {slice} from \"./array\";\nimport ascending from \"./ascending\";\nimport area from \"./area\";\nimport constant from \"./constant\";\nimport contains from \"./contains\";\nimport noop from \"./noop\";\n\nvar cases = [\n [],\n [[[1.0, 1.5], [0.5, 1.0]]],\n [[[1.5, 1.0], [1.0, 1.5]]],\n [[[1.5, 1.0], [0.5, 1.0]]],\n [[[1.0, 0.5], [1.5, 1.0]]],\n [[[1.0, 1.5], [0.5, 1.0]], [[1.0, 0.5], [1.5, 1.0]]],\n [[[1.0, 0.5], [1.0, 1.5]]],\n [[[1.0, 0.5], [0.5, 1.0]]],\n [[[0.5, 1.0], [1.0, 0.5]]],\n [[[1.0, 1.5], [1.0, 0.5]]],\n [[[0.5, 1.0], [1.0, 0.5]], [[1.5, 1.0], [1.0, 1.5]]],\n [[[1.5, 1.0], [1.0, 0.5]]],\n [[[0.5, 1.0], [1.5, 1.0]]],\n [[[1.0, 1.5], [1.5, 1.0]]],\n [[[0.5, 1.0], [1.0, 1.5]]],\n []\n];\n\nexport default function() {\n var dx = 1,\n dy = 1,\n threshold = thresholdSturges,\n smooth = smoothLinear;\n\n function contours(values) {\n var tz = threshold(values);\n\n // Convert number of thresholds into uniform thresholds.\n if (!Array.isArray(tz)) {\n var domain = extent(values), start = domain[0], stop = domain[1];\n tz = tickStep(start, stop, tz);\n tz = range(Math.floor(start / tz) * tz, Math.floor(stop / tz) * tz, tz);\n } else {\n tz = tz.slice().sort(ascending);\n }\n\n return tz.map(function(value) {\n return contour(values, value);\n });\n }\n\n // Accumulate, smooth contour rings, assign holes to exterior rings.\n // Based on https://github.com/mbostock/shapefile/blob/v0.6.2/shp/polygon.js\n function contour(values, value) {\n var polygons = [],\n holes = [];\n\n isorings(values, value, function(ring) {\n smooth(ring, values, value);\n if (area(ring) > 0) polygons.push([ring]);\n else holes.push(ring);\n });\n\n holes.forEach(function(hole) {\n for (var i = 0, n = polygons.length, polygon; i < n; ++i) {\n if (contains((polygon = polygons[i])[0], hole) !== -1) {\n polygon.push(hole);\n return;\n }\n }\n });\n\n return {\n type: \"MultiPolygon\",\n value: value,\n coordinates: polygons\n };\n }\n\n // Marching squares with isolines stitched into rings.\n // Based on https://github.com/topojson/topojson-client/blob/v3.0.0/src/stitch.js\n function isorings(values, value, callback) {\n var fragmentByStart = new Array,\n fragmentByEnd = new Array,\n x, y, t0, t1, t2, t3;\n\n // Special case for the first row (y = -1, t2 = t3 = 0).\n x = y = -1;\n t1 = values[0] >= value;\n cases[t1 << 1].forEach(stitch);\n while (++x < dx - 1) {\n t0 = t1, t1 = values[x + 1] >= value;\n cases[t0 | t1 << 1].forEach(stitch);\n }\n cases[t1 << 0].forEach(stitch);\n\n // General case for the intermediate rows.\n while (++y < dy - 1) {\n x = -1;\n t1 = values[y * dx + dx] >= value;\n t2 = values[y * dx] >= value;\n cases[t1 << 1 | t2 << 2].forEach(stitch);\n while (++x < dx - 1) {\n t0 = t1, t1 = values[y * dx + dx + x + 1] >= value;\n t3 = t2, t2 = values[y * dx + x + 1] >= value;\n cases[t0 | t1 << 1 | t2 << 2 | t3 << 3].forEach(stitch);\n }\n cases[t1 | t2 << 3].forEach(stitch);\n }\n\n // Special case for the last row (y = dy - 1, t0 = t1 = 0).\n x = -1;\n t2 = values[y * dx] >= value;\n cases[t2 << 2].forEach(stitch);\n while (++x < dx - 1) {\n t3 = t2, t2 = values[y * dx + x + 1] >= value;\n cases[t2 << 2 | t3 << 3].forEach(stitch);\n }\n cases[t2 << 3].forEach(stitch);\n\n function stitch(line) {\n var start = [line[0][0] + x, line[0][1] + y],\n end = [line[1][0] + x, line[1][1] + y],\n startIndex = index(start),\n endIndex = index(end),\n f, g;\n if (f = fragmentByEnd[startIndex]) {\n if (g = fragmentByStart[endIndex]) {\n delete fragmentByEnd[f.end];\n delete fragmentByStart[g.start];\n if (f === g) {\n f.ring.push(end);\n callback(f.ring);\n } else {\n fragmentByStart[f.start] = fragmentByEnd[g.end] = {start: f.start, end: g.end, ring: f.ring.concat(g.ring)};\n }\n } else {\n delete fragmentByEnd[f.end];\n f.ring.push(end);\n fragmentByEnd[f.end = endIndex] = f;\n }\n } else if (f = fragmentByStart[endIndex]) {\n if (g = fragmentByEnd[startIndex]) {\n delete fragmentByStart[f.start];\n delete fragmentByEnd[g.end];\n if (f === g) {\n f.ring.push(end);\n callback(f.ring);\n } else {\n fragmentByStart[g.start] = fragmentByEnd[f.end] = {start: g.start, end: f.end, ring: g.ring.concat(f.ring)};\n }\n } else {\n delete fragmentByStart[f.start];\n f.ring.unshift(start);\n fragmentByStart[f.start = startIndex] = f;\n }\n } else {\n fragmentByStart[startIndex] = fragmentByEnd[endIndex] = {start: startIndex, end: endIndex, ring: [start, end]};\n }\n }\n }\n\n function index(point) {\n return point[0] * 2 + point[1] * (dx + 1) * 4;\n }\n\n function smoothLinear(ring, values, value) {\n ring.forEach(function(point) {\n var x = point[0],\n y = point[1],\n xt = x | 0,\n yt = y | 0,\n v0,\n v1 = values[yt * dx + xt];\n if (x > 0 && x < dx && xt === x) {\n v0 = values[yt * dx + xt - 1];\n point[0] = x + (value - v0) / (v1 - v0) - 0.5;\n }\n if (y > 0 && y < dy && yt === y) {\n v0 = values[(yt - 1) * dx + xt];\n point[1] = y + (value - v0) / (v1 - v0) - 0.5;\n }\n });\n }\n\n contours.contour = contour;\n\n contours.size = function(_) {\n if (!arguments.length) return [dx, dy];\n var _0 = Math.ceil(_[0]), _1 = Math.ceil(_[1]);\n if (!(_0 > 0) || !(_1 > 0)) throw new Error(\"invalid size\");\n return dx = _0, dy = _1, contours;\n };\n\n contours.thresholds = function(_) {\n return arguments.length ? (threshold = typeof _ === \"function\" ? _ : Array.isArray(_) ? constant(slice.call(_)) : constant(_), contours) : threshold;\n };\n\n contours.smooth = function(_) {\n return arguments.length ? (smooth = _ ? smoothLinear : noop, contours) : smooth === smoothLinear;\n };\n\n return contours;\n}\n","// TODO Optimize edge cases.\n// TODO Optimize index calculation.\n// TODO Optimize arguments.\nexport function blurX(source, target, r) {\n var n = source.width,\n m = source.height,\n w = (r << 1) + 1;\n for (var j = 0; j < m; ++j) {\n for (var i = 0, sr = 0; i < n + r; ++i) {\n if (i < n) {\n sr += source.data[i + j * n];\n }\n if (i >= r) {\n if (i >= w) {\n sr -= source.data[i - w + j * n];\n }\n target.data[i - r + j * n] = sr / Math.min(i + 1, n - 1 + w - i, w);\n }\n }\n }\n}\n\n// TODO Optimize edge cases.\n// TODO Optimize index calculation.\n// TODO Optimize arguments.\nexport function blurY(source, target, r) {\n var n = source.width,\n m = source.height,\n w = (r << 1) + 1;\n for (var i = 0; i < n; ++i) {\n for (var j = 0, sr = 0; j < m + r; ++j) {\n if (j < m) {\n sr += source.data[i + j * n];\n }\n if (j >= r) {\n if (j >= w) {\n sr -= source.data[i + (j - w) * n];\n }\n target.data[i + (j - r) * n] = sr / Math.min(j + 1, m - 1 + w - j, w);\n }\n }\n }\n}\n","import {max, range, tickStep} from \"d3-array\";\nimport {slice} from \"./array\";\nimport {blurX, blurY} from \"./blur\";\nimport constant from \"./constant\";\nimport contours from \"./contours\";\n\nfunction defaultX(d) {\n return d[0];\n}\n\nfunction defaultY(d) {\n return d[1];\n}\n\nfunction defaultWeight() {\n return 1;\n}\n\nexport default function() {\n var x = defaultX,\n y = defaultY,\n weight = defaultWeight,\n dx = 960,\n dy = 500,\n r = 20, // blur radius\n k = 2, // log2(grid cell size)\n o = r * 3, // grid offset, to pad for blur\n n = (dx + o * 2) >> k, // grid width\n m = (dy + o * 2) >> k, // grid height\n threshold = constant(20);\n\n function density(data) {\n var values0 = new Float32Array(n * m),\n values1 = new Float32Array(n * m);\n\n data.forEach(function(d, i, data) {\n var xi = (+x(d, i, data) + o) >> k,\n yi = (+y(d, i, data) + o) >> k,\n wi = +weight(d, i, data);\n if (xi >= 0 && xi < n && yi >= 0 && yi < m) {\n values0[xi + yi * n] += wi;\n }\n });\n\n // TODO Optimize.\n blurX({width: n, height: m, data: values0}, {width: n, height: m, data: values1}, r >> k);\n blurY({width: n, height: m, data: values1}, {width: n, height: m, data: values0}, r >> k);\n blurX({width: n, height: m, data: values0}, {width: n, height: m, data: values1}, r >> k);\n blurY({width: n, height: m, data: values1}, {width: n, height: m, data: values0}, r >> k);\n blurX({width: n, height: m, data: values0}, {width: n, height: m, data: values1}, r >> k);\n blurY({width: n, height: m, data: values1}, {width: n, height: m, data: values0}, r >> k);\n\n var tz = threshold(values0);\n\n // Convert number of thresholds into uniform thresholds.\n if (!Array.isArray(tz)) {\n var stop = max(values0);\n tz = tickStep(0, stop, tz);\n tz = range(0, Math.floor(stop / tz) * tz, tz);\n tz.shift();\n }\n\n return contours()\n .thresholds(tz)\n .size([n, m])\n (values0)\n .map(transform);\n }\n\n function transform(geometry) {\n geometry.value *= Math.pow(2, -2 * k); // Density in points per square pixel.\n geometry.coordinates.forEach(transformPolygon);\n return geometry;\n }\n\n function transformPolygon(coordinates) {\n coordinates.forEach(transformRing);\n }\n\n function transformRing(coordinates) {\n coordinates.forEach(transformPoint);\n }\n\n // TODO Optimize.\n function transformPoint(coordinates) {\n coordinates[0] = coordinates[0] * Math.pow(2, k) - o;\n coordinates[1] = coordinates[1] * Math.pow(2, k) - o;\n }\n\n function resize() {\n o = r * 3;\n n = (dx + o * 2) >> k;\n m = (dy + o * 2) >> k;\n return density;\n }\n\n density.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : constant(+_), density) : x;\n };\n\n density.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : constant(+_), density) : y;\n };\n\n density.weight = function(_) {\n return arguments.length ? (weight = typeof _ === \"function\" ? _ : constant(+_), density) : weight;\n };\n\n density.size = function(_) {\n if (!arguments.length) return [dx, dy];\n var _0 = Math.ceil(_[0]), _1 = Math.ceil(_[1]);\n if (!(_0 >= 0) && !(_0 >= 0)) throw new Error(\"invalid size\");\n return dx = _0, dy = _1, resize();\n };\n\n density.cellSize = function(_) {\n if (!arguments.length) return 1 << k;\n if (!((_ = +_) >= 1)) throw new Error(\"invalid cell size\");\n return k = Math.floor(Math.log(_) / Math.LN2), resize();\n };\n\n density.thresholds = function(_) {\n return arguments.length ? (threshold = typeof _ === \"function\" ? _ : Array.isArray(_) ? constant(slice.call(_)) : constant(_), density) : threshold;\n };\n\n density.bandwidth = function(_) {\n if (!arguments.length) return Math.sqrt(r * (r + 1));\n if (!((_ = +_) >= 0)) throw new Error(\"invalid bandwidth\");\n return r = Math.round((Math.sqrt(4 * _ * _ + 1) - 1) / 2), resize();\n };\n\n return density;\n}\n","// Adds floating point numbers with twice the normal precision.\n// Reference: J. R. Shewchuk, Adaptive Precision Floating-Point Arithmetic and\n// Fast Robust Geometric Predicates, Discrete & Computational Geometry 18(3)\n// 305–363 (1997).\n// Code adapted from GeographicLib by Charles F. F. Karney,\n// http://geographiclib.sourceforge.net/\n\nexport default function() {\n return new Adder;\n}\n\nfunction Adder() {\n this.reset();\n}\n\nAdder.prototype = {\n constructor: Adder,\n reset: function() {\n this.s = // rounded value\n this.t = 0; // exact error\n },\n add: function(y) {\n add(temp, y, this.t);\n add(this, temp.s, this.s);\n if (this.s) this.t += temp.t;\n else this.s = temp.t;\n },\n valueOf: function() {\n return this.s;\n }\n};\n\nvar temp = new Adder;\n\nfunction add(adder, a, b) {\n var x = adder.s = a + b,\n bv = x - a,\n av = x - bv;\n adder.t = (a - av) + (b - bv);\n}\n","export var epsilon = 1e-6;\nexport var epsilon2 = 1e-12;\nexport var pi = Math.PI;\nexport var halfPi = pi / 2;\nexport var quarterPi = pi / 4;\nexport var tau = pi * 2;\n\nexport var degrees = 180 / pi;\nexport var radians = pi / 180;\n\nexport var abs = Math.abs;\nexport var atan = Math.atan;\nexport var atan2 = Math.atan2;\nexport var cos = Math.cos;\nexport var ceil = Math.ceil;\nexport var exp = Math.exp;\nexport var floor = Math.floor;\nexport var log = Math.log;\nexport var pow = Math.pow;\nexport var sin = Math.sin;\nexport var sign = Math.sign || function(x) { return x > 0 ? 1 : x < 0 ? -1 : 0; };\nexport var sqrt = Math.sqrt;\nexport var tan = Math.tan;\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\nexport function haversin(x) {\n return (x = sin(x / 2)) * x;\n}\n","export default function noop() {}\n","function streamGeometry(geometry, stream) {\n if (geometry && streamGeometryType.hasOwnProperty(geometry.type)) {\n streamGeometryType[geometry.type](geometry, stream);\n }\n}\n\nvar streamObjectType = {\n Feature: function(object, stream) {\n streamGeometry(object.geometry, stream);\n },\n FeatureCollection: function(object, stream) {\n var features = object.features, i = -1, n = features.length;\n while (++i < n) streamGeometry(features[i].geometry, stream);\n }\n};\n\nvar streamGeometryType = {\n Sphere: function(object, stream) {\n stream.sphere();\n },\n Point: function(object, stream) {\n object = object.coordinates;\n stream.point(object[0], object[1], object[2]);\n },\n MultiPoint: function(object, stream) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) object = coordinates[i], stream.point(object[0], object[1], object[2]);\n },\n LineString: function(object, stream) {\n streamLine(object.coordinates, stream, 0);\n },\n MultiLineString: function(object, stream) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) streamLine(coordinates[i], stream, 0);\n },\n Polygon: function(object, stream) {\n streamPolygon(object.coordinates, stream);\n },\n MultiPolygon: function(object, stream) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) streamPolygon(coordinates[i], stream);\n },\n GeometryCollection: function(object, stream) {\n var geometries = object.geometries, i = -1, n = geometries.length;\n while (++i < n) streamGeometry(geometries[i], stream);\n }\n};\n\nfunction streamLine(coordinates, stream, closed) {\n var i = -1, n = coordinates.length - closed, coordinate;\n stream.lineStart();\n while (++i < n) coordinate = coordinates[i], stream.point(coordinate[0], coordinate[1], coordinate[2]);\n stream.lineEnd();\n}\n\nfunction streamPolygon(coordinates, stream) {\n var i = -1, n = coordinates.length;\n stream.polygonStart();\n while (++i < n) streamLine(coordinates[i], stream, 1);\n stream.polygonEnd();\n}\n\nexport default function(object, stream) {\n if (object && streamObjectType.hasOwnProperty(object.type)) {\n streamObjectType[object.type](object, stream);\n } else {\n streamGeometry(object, stream);\n }\n}\n","export default function(x) {\n return x;\n}\n","import adder from \"../adder.js\";\nimport {abs} from \"../math.js\";\nimport noop from \"../noop.js\";\n\nvar areaSum = adder(),\n areaRingSum = adder(),\n x00,\n y00,\n x0,\n y0;\n\nvar areaStream = {\n point: noop,\n lineStart: noop,\n lineEnd: noop,\n polygonStart: function() {\n areaStream.lineStart = areaRingStart;\n areaStream.lineEnd = areaRingEnd;\n },\n polygonEnd: function() {\n areaStream.lineStart = areaStream.lineEnd = areaStream.point = noop;\n areaSum.add(abs(areaRingSum));\n areaRingSum.reset();\n },\n result: function() {\n var area = areaSum / 2;\n areaSum.reset();\n return area;\n }\n};\n\nfunction areaRingStart() {\n areaStream.point = areaPointFirst;\n}\n\nfunction areaPointFirst(x, y) {\n areaStream.point = areaPoint;\n x00 = x0 = x, y00 = y0 = y;\n}\n\nfunction areaPoint(x, y) {\n areaRingSum.add(y0 * x - x0 * y);\n x0 = x, y0 = y;\n}\n\nfunction areaRingEnd() {\n areaPoint(x00, y00);\n}\n\nexport default areaStream;\n","import noop from \"../noop.js\";\n\nvar x0 = Infinity,\n y0 = x0,\n x1 = -x0,\n y1 = x1;\n\nvar boundsStream = {\n point: boundsPoint,\n lineStart: noop,\n lineEnd: noop,\n polygonStart: noop,\n polygonEnd: noop,\n result: function() {\n var bounds = [[x0, y0], [x1, y1]];\n x1 = y1 = -(y0 = x0 = Infinity);\n return bounds;\n }\n};\n\nfunction boundsPoint(x, y) {\n if (x < x0) x0 = x;\n if (x > x1) x1 = x;\n if (y < y0) y0 = y;\n if (y > y1) y1 = y;\n}\n\nexport default boundsStream;\n","import {sqrt} from \"../math.js\";\n\n// TODO Enforce positive area for exterior, negative area for interior?\n\nvar X0 = 0,\n Y0 = 0,\n Z0 = 0,\n X1 = 0,\n Y1 = 0,\n Z1 = 0,\n X2 = 0,\n Y2 = 0,\n Z2 = 0,\n x00,\n y00,\n x0,\n y0;\n\nvar centroidStream = {\n point: centroidPoint,\n lineStart: centroidLineStart,\n lineEnd: centroidLineEnd,\n polygonStart: function() {\n centroidStream.lineStart = centroidRingStart;\n centroidStream.lineEnd = centroidRingEnd;\n },\n polygonEnd: function() {\n centroidStream.point = centroidPoint;\n centroidStream.lineStart = centroidLineStart;\n centroidStream.lineEnd = centroidLineEnd;\n },\n result: function() {\n var centroid = Z2 ? [X2 / Z2, Y2 / Z2]\n : Z1 ? [X1 / Z1, Y1 / Z1]\n : Z0 ? [X0 / Z0, Y0 / Z0]\n : [NaN, NaN];\n X0 = Y0 = Z0 =\n X1 = Y1 = Z1 =\n X2 = Y2 = Z2 = 0;\n return centroid;\n }\n};\n\nfunction centroidPoint(x, y) {\n X0 += x;\n Y0 += y;\n ++Z0;\n}\n\nfunction centroidLineStart() {\n centroidStream.point = centroidPointFirstLine;\n}\n\nfunction centroidPointFirstLine(x, y) {\n centroidStream.point = centroidPointLine;\n centroidPoint(x0 = x, y0 = y);\n}\n\nfunction centroidPointLine(x, y) {\n var dx = x - x0, dy = y - y0, z = sqrt(dx * dx + dy * dy);\n X1 += z * (x0 + x) / 2;\n Y1 += z * (y0 + y) / 2;\n Z1 += z;\n centroidPoint(x0 = x, y0 = y);\n}\n\nfunction centroidLineEnd() {\n centroidStream.point = centroidPoint;\n}\n\nfunction centroidRingStart() {\n centroidStream.point = centroidPointFirstRing;\n}\n\nfunction centroidRingEnd() {\n centroidPointRing(x00, y00);\n}\n\nfunction centroidPointFirstRing(x, y) {\n centroidStream.point = centroidPointRing;\n centroidPoint(x00 = x0 = x, y00 = y0 = y);\n}\n\nfunction centroidPointRing(x, y) {\n var dx = x - x0,\n dy = y - y0,\n z = sqrt(dx * dx + dy * dy);\n\n X1 += z * (x0 + x) / 2;\n Y1 += z * (y0 + y) / 2;\n Z1 += z;\n\n z = y0 * x - x0 * y;\n X2 += z * (x0 + x);\n Y2 += z * (y0 + y);\n Z2 += z * 3;\n centroidPoint(x0 = x, y0 = y);\n}\n\nexport default centroidStream;\n","import {tau} from \"../math.js\";\nimport noop from \"../noop.js\";\n\nexport default function PathContext(context) {\n this._context = context;\n}\n\nPathContext.prototype = {\n _radius: 4.5,\n pointRadius: function(_) {\n return this._radius = _, this;\n },\n polygonStart: function() {\n this._line = 0;\n },\n polygonEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line === 0) this._context.closePath();\n this._point = NaN;\n },\n point: function(x, y) {\n switch (this._point) {\n case 0: {\n this._context.moveTo(x, y);\n this._point = 1;\n break;\n }\n case 1: {\n this._context.lineTo(x, y);\n break;\n }\n default: {\n this._context.moveTo(x + this._radius, y);\n this._context.arc(x, y, this._radius, 0, tau);\n break;\n }\n }\n },\n result: noop\n};\n","import adder from \"../adder.js\";\nimport {sqrt} from \"../math.js\";\nimport noop from \"../noop.js\";\n\nvar lengthSum = adder(),\n lengthRing,\n x00,\n y00,\n x0,\n y0;\n\nvar lengthStream = {\n point: noop,\n lineStart: function() {\n lengthStream.point = lengthPointFirst;\n },\n lineEnd: function() {\n if (lengthRing) lengthPoint(x00, y00);\n lengthStream.point = noop;\n },\n polygonStart: function() {\n lengthRing = true;\n },\n polygonEnd: function() {\n lengthRing = null;\n },\n result: function() {\n var length = +lengthSum;\n lengthSum.reset();\n return length;\n }\n};\n\nfunction lengthPointFirst(x, y) {\n lengthStream.point = lengthPoint;\n x00 = x0 = x, y00 = y0 = y;\n}\n\nfunction lengthPoint(x, y) {\n x0 -= x, y0 -= y;\n lengthSum.add(sqrt(x0 * x0 + y0 * y0));\n x0 = x, y0 = y;\n}\n\nexport default lengthStream;\n","export default function PathString() {\n this._string = [];\n}\n\nPathString.prototype = {\n _radius: 4.5,\n _circle: circle(4.5),\n pointRadius: function(_) {\n if ((_ = +_) !== this._radius) this._radius = _, this._circle = null;\n return this;\n },\n polygonStart: function() {\n this._line = 0;\n },\n polygonEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line === 0) this._string.push(\"Z\");\n this._point = NaN;\n },\n point: function(x, y) {\n switch (this._point) {\n case 0: {\n this._string.push(\"M\", x, \",\", y);\n this._point = 1;\n break;\n }\n case 1: {\n this._string.push(\"L\", x, \",\", y);\n break;\n }\n default: {\n if (this._circle == null) this._circle = circle(this._radius);\n this._string.push(\"M\", x, \",\", y, this._circle);\n break;\n }\n }\n },\n result: function() {\n if (this._string.length) {\n var result = this._string.join(\"\");\n this._string = [];\n return result;\n } else {\n return null;\n }\n }\n};\n\nfunction circle(radius) {\n return \"m0,\" + radius\n + \"a\" + radius + \",\" + radius + \" 0 1,1 0,\" + -2 * radius\n + \"a\" + radius + \",\" + radius + \" 0 1,1 0,\" + 2 * radius\n + \"z\";\n}\n","import identity from \"../identity.js\";\nimport stream from \"../stream.js\";\nimport pathArea from \"./area.js\";\nimport pathBounds from \"./bounds.js\";\nimport pathCentroid from \"./centroid.js\";\nimport PathContext from \"./context.js\";\nimport pathMeasure from \"./measure.js\";\nimport PathString from \"./string.js\";\n\nexport default function(projection, context) {\n var pointRadius = 4.5,\n projectionStream,\n contextStream;\n\n function path(object) {\n if (object) {\n if (typeof pointRadius === \"function\") contextStream.pointRadius(+pointRadius.apply(this, arguments));\n stream(object, projectionStream(contextStream));\n }\n return contextStream.result();\n }\n\n path.area = function(object) {\n stream(object, projectionStream(pathArea));\n return pathArea.result();\n };\n\n path.measure = function(object) {\n stream(object, projectionStream(pathMeasure));\n return pathMeasure.result();\n };\n\n path.bounds = function(object) {\n stream(object, projectionStream(pathBounds));\n return pathBounds.result();\n };\n\n path.centroid = function(object) {\n stream(object, projectionStream(pathCentroid));\n return pathCentroid.result();\n };\n\n path.projection = function(_) {\n return arguments.length ? (projectionStream = _ == null ? (projection = null, identity) : (projection = _).stream, path) : projection;\n };\n\n path.context = function(_) {\n if (!arguments.length) return context;\n contextStream = _ == null ? (context = null, new PathString) : new PathContext(context = _);\n if (typeof pointRadius !== \"function\") contextStream.pointRadius(pointRadius);\n return path;\n };\n\n path.pointRadius = function(_) {\n if (!arguments.length) return pointRadius;\n pointRadius = typeof _ === \"function\" ? _ : (contextStream.pointRadius(+_), +_);\n return path;\n };\n\n return path.projection(projection).context(context);\n}\n","import { I1DChart } from \"@hpcc-js/api\";\nimport { InputField } from \"@hpcc-js/common\";\nimport { contourDensity as d3ContourDensity } from \"d3-contour\";\nimport { geoPath } from \"d3-geo\";\nimport { XYAxis } from \"./XYAxis.ts\";\n\nexport class Contour extends XYAxis {\n static __inputs: InputField[] = [{\n id: \"x\",\n type: \"any\"\n }, {\n id: \"y\",\n type: \"number\"\n }];\n\n protected _dataMinWeight;\n protected _dataMaxWeight;\n constructor() {\n super();\n this\n .xAxisGuideLines_default(false)\n .yAxisGuideLines_default(false)\n .xAxisType_default(\"linear\")\n ;\n }\n\n xPos(host: XYAxis, d) {\n return host.orientation() === \"horizontal\" ? host.dataPos(d.label) : host.valuePos(d.value);\n }\n\n yPos(host: XYAxis, d) {\n return host.orientation() === \"horizontal\" ? host.valuePos(d.value) : host.dataPos(d.label);\n }\n\n layerEnter(host: XYAxis, element, duration: number = 250) {\n super.layerEnter(host, element, duration);\n }\n\n layerUpdate(host: XYAxis, element, duration: number = 250) {\n super.layerUpdate(host, element, duration);\n\n this._palette = this._palette.switch(this.paletteID());\n\n const data = this.flattenData(this.layerColumns(host), this.layerData(host));\n const contourData = d3ContourDensity()\n .x(d => this.xPos(host, d))\n .y(d => this.yPos(host, d))\n .size([this.width(), this.height()])\n .bandwidth(this.contourBandwidth())(data)\n ;\n const _vals = contourData.map(d => d.value);\n const minValue = Math.min.apply(this, _vals);\n const maxValue = Math.max.apply(this, _vals);\n this._dataMinWeight = minValue;\n this._dataMaxWeight = maxValue;\n const lines = element.selectAll(\"path\").data(contourData);\n lines.enter().append(\"path\")\n .merge(lines)\n .attr(\"d\", geoPath())\n .attr(\"fill\", d => this.showContourFill() ? this._palette(d.value, minValue, maxValue) : \"none\")\n .attr(\"stroke\", this.contourStrokeColor())\n .attr(\"stroke-linejoin\", \"round\")\n .attr(\"stroke-width\", this.contourStrokeWidth())\n ;\n lines.exit().remove();\n }\n\n exit(_domNode, _element) {\n super.exit(_domNode, _element);\n }\n}\nContour.prototype._class += \" chart_Contour\";\nContour.prototype.implements(I1DChart.prototype);\n\nexport interface Contour {\n paletteID(): string;\n paletteID(_: string): this;\n useClonedPalette(): boolean;\n useClonedPalette(_: boolean): this;\n showContourFill(): boolean;\n showContourFill(_: boolean): this;\n showContour(): boolean;\n showContour(_: boolean): this;\n contourBandwidth(): number;\n contourBandwidth(_: number): this;\n contourStrokeColor(): string;\n contourStrokeColor(_: string): this;\n contourStrokeWidth(): number;\n contourStrokeWidth(_: number): this;\n}\nContour.prototype.publish(\"paletteID\", \"YlGnBu\", \"string\", \"Color palette for this widget\");\nContour.prototype.publish(\"useClonedPalette\", true, \"boolean\", \"Enable or disable using a cloned palette\");\nContour.prototype.publish(\"showContourFill\", true, \"boolean\", \"Show/hide the contour background colors\");\nContour.prototype.publish(\"showContour\", true, \"boolean\", \"Show/hide the contour border lines\");\nContour.prototype.publish(\"contourBandwidth\", 40, \"number\", \"Controls the sensitivity of the contour grouping algorithm\");\nContour.prototype.publish(\"contourStrokeColor\", \"#2C3A47\", \"html-color\", \"Color of the contour border lines\");\nContour.prototype.publish(\"contourStrokeWidth\", 1, \"number\", \"Width of the contour border lines\");\n","import { Bar } from \"./Bar.ts\";\n\nexport class Gantt extends Bar {\n constructor() {\n super();\n\n this\n .orientation_default(\"vertical\")\n .xAxisType_default(\"ordinal\")\n .yAxisType_default(\"time\")\n ;\n }\n}\nGantt.prototype._class += \" chart_Gantt\";\n","export default function(x) {\n return function constant() {\n return x;\n };\n}\n","export var epsilon = 1e-12;\nexport var pi = Math.PI;\nexport var halfPi = pi / 2;\nexport var tau = 2 * pi;\n","import {path} from \"d3-path\";\nimport constant from \"./constant\";\nimport {epsilon, pi, halfPi, tau} from \"./math\";\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 asin(x) {\n return x >= 1 ? halfPi : x <= -1 ? -halfPi : Math.asin(x);\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 = (x32 * (y0 - y2) - y32 * (x0 - x2)) / (y32 * x10 - x32 * y10);\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) / Math.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) * Math.sqrt(Math.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 = Math.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 * Math.cos(a0), r1 * Math.sin(a0));\n context.arc(0, 0, r1, a0, a1, !cw);\n if (r0 > epsilon) {\n context.moveTo(r0 * Math.cos(a1), r0 * Math.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) : Math.sqrt(r0 * r0 + r1 * r1)),\n rc = Math.min(Math.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 * Math.sin(ap)),\n p1 = asin(rp / r1 * Math.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 * Math.cos(a01),\n y01 = r1 * Math.sin(a01),\n x10 = r0 * Math.cos(a10),\n y10 = r0 * Math.sin(a10);\n\n // Apply rounded corners?\n if (rc > epsilon) {\n var x11 = r1 * Math.cos(a11),\n y11 = r1 * Math.sin(a11),\n x00 = r0 * Math.cos(a00),\n y00 = r0 * Math.sin(a00);\n\n // Restrict the corner radius according to the sector angle.\n if (da < pi) {\n var oc = da0 > epsilon ? intersect(x01, y01, x00, y00, x11, y11, x10, y10) : [x10, y10],\n ax = x01 - oc[0],\n ay = y01 - oc[1],\n bx = x11 - oc[0],\n by = y11 - oc[1],\n kc = 1 / Math.sin(Math.acos((ax * bx + ay * by) / (Math.sqrt(ax * ax + ay * ay) * Math.sqrt(bx * bx + by * by))) / 2),\n lc = Math.sqrt(oc[0] * oc[0] + oc[1] * oc[1]);\n rc0 = Math.min(rc, (r0 - lc) / (kc - 1));\n rc1 = Math.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, Math.atan2(t0.y01, t0.x01), Math.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, Math.atan2(t0.y01, t0.x01), Math.atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r1, Math.atan2(t0.cy + t0.y11, t0.cx + t0.x11), Math.atan2(t1.cy + t1.y11, t1.cx + t1.x11), !cw);\n context.arc(t1.cx, t1.cy, rc1, Math.atan2(t1.y11, t1.x11), Math.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, Math.atan2(t0.y01, t0.x01), Math.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, Math.atan2(t0.y01, t0.x01), Math.atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r0, Math.atan2(t0.cy + t0.y11, t0.cx + t0.x11), Math.atan2(t1.cy + t1.y11, t1.cx + t1.x11), cw);\n context.arc(t1.cx, t1.cy, rc0, Math.atan2(t1.y11, t1.x11), Math.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 [Math.cos(a) * r, Math.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","function Linear(context) {\n this._context = context;\n}\n\nLinear.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // proceed\n default: this._context.lineTo(x, y); break;\n }\n }\n};\n\nexport default function(context) {\n return new Linear(context);\n}\n","export function x(p) {\n return p[0];\n}\n\nexport function y(p) {\n return p[1];\n}\n","import {path} from \"d3-path\";\nimport constant from \"./constant\";\nimport curveLinear from \"./curve/linear\";\nimport {x as pointX, y as pointY} from \"./point\";\n\nexport default function() {\n var x = pointX,\n y = pointY,\n defined = constant(true),\n context = null,\n curve = curveLinear,\n output = null;\n\n function line(data) {\n var i,\n n = data.length,\n d,\n defined0 = false,\n buffer;\n\n if (context == null) output = curve(buffer = path());\n\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) output.lineStart();\n else output.lineEnd();\n }\n if (defined0) output.point(+x(d, i, data), +y(d, i, data));\n }\n\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n line.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : constant(+_), line) : x;\n };\n\n line.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : constant(+_), line) : y;\n };\n\n line.defined = function(_) {\n return arguments.length ? (defined = typeof _ === \"function\" ? _ : constant(!!_), line) : defined;\n };\n\n line.curve = function(_) {\n return arguments.length ? (curve = _, context != null && (output = curve(context)), line) : curve;\n };\n\n line.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), line) : context;\n };\n\n return line;\n}\n","import curveLinear from \"./linear\";\n\nexport var curveRadialLinear = curveRadial(curveLinear);\n\nfunction Radial(curve) {\n this._curve = curve;\n}\n\nRadial.prototype = {\n areaStart: function() {\n this._curve.areaStart();\n },\n areaEnd: function() {\n this._curve.areaEnd();\n },\n lineStart: function() {\n this._curve.lineStart();\n },\n lineEnd: function() {\n this._curve.lineEnd();\n },\n point: function(a, r) {\n this._curve.point(r * Math.sin(a), r * -Math.cos(a));\n }\n};\n\nexport default function curveRadial(curve) {\n\n function radial(context) {\n return new Radial(curve(context));\n }\n\n radial._curve = curve;\n\n return radial;\n}\n","var tan30 = Math.sqrt(1 / 3),\n tan30_2 = tan30 * 2;\n\nexport default {\n draw: function(context, size) {\n var y = Math.sqrt(size / tan30_2),\n x = y * tan30;\n context.moveTo(0, -y);\n context.lineTo(x, 0);\n context.lineTo(0, y);\n context.lineTo(-x, 0);\n context.closePath();\n }\n};\n","import {pi, tau} from \"../math\";\n\nvar ka = 0.89081309152928522810,\n kr = Math.sin(pi / 10) / Math.sin(7 * pi / 10),\n kx = Math.sin(tau / 10) * kr,\n ky = -Math.cos(tau / 10) * kr;\n\nexport default {\n draw: function(context, size) {\n var r = Math.sqrt(size * ka),\n x = kx * r,\n y = ky * r;\n context.moveTo(0, -r);\n context.lineTo(x, y);\n for (var i = 1; i < 5; ++i) {\n var a = tau * i / 5,\n c = Math.cos(a),\n s = Math.sin(a);\n context.lineTo(s * r, -c * r);\n context.lineTo(c * x - s * y, s * x + c * y);\n }\n context.closePath();\n }\n};\n","var sqrt3 = Math.sqrt(3);\n\nexport default {\n draw: function(context, size) {\n var y = -Math.sqrt(size / (sqrt3 * 3));\n context.moveTo(0, y * 2);\n context.lineTo(-sqrt3 * y, -y);\n context.lineTo(sqrt3 * y, -y);\n context.closePath();\n }\n};\n","var c = -0.5,\n s = Math.sqrt(3) / 2,\n k = 1 / Math.sqrt(12),\n a = (k / 2 + 1) * 3;\n\nexport default {\n draw: function(context, size) {\n var r = Math.sqrt(size / a),\n x0 = r / 2,\n y0 = r * k,\n x1 = x0,\n y1 = r * k + r,\n x2 = -x1,\n y2 = y1;\n context.moveTo(x0, y0);\n context.lineTo(x1, y1);\n context.lineTo(x2, y2);\n context.lineTo(c * x0 - s * y0, s * x0 + c * y0);\n context.lineTo(c * x1 - s * y1, s * x1 + c * y1);\n context.lineTo(c * x2 - s * y2, s * x2 + c * y2);\n context.lineTo(c * x0 + s * y0, c * y0 - s * x0);\n context.lineTo(c * x1 + s * y1, c * y1 - s * x1);\n context.lineTo(c * x2 + s * y2, c * y2 - s * x2);\n context.closePath();\n }\n};\n","export default function() {}\n","export function point(that, x, y) {\n that._context.bezierCurveTo(\n (2 * that._x0 + that._x1) / 3,\n (2 * that._y0 + that._y1) / 3,\n (that._x0 + 2 * that._x1) / 3,\n (that._y0 + 2 * that._y1) / 3,\n (that._x0 + 4 * that._x1 + x) / 6,\n (that._y0 + 4 * that._y1 + y) / 6\n );\n}\n\nexport function Basis(context) {\n this._context = context;\n}\n\nBasis.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 3: point(this, this._x1, this._y1); // proceed\n case 2: this._context.lineTo(this._x1, this._y1); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6); // proceed\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new Basis(context);\n}\n","import noop from \"../noop\";\nimport {point} from \"./basis\";\n\nfunction BasisClosed(context) {\n this._context = context;\n}\n\nBasisClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x2, this._y2);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3);\n this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x2, this._y2);\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._x2 = x, this._y2 = y; break;\n case 1: this._point = 2; this._x3 = x, this._y3 = y; break;\n case 2: this._point = 3; this._x4 = x, this._y4 = y; this._context.moveTo((this._x0 + 4 * this._x1 + x) / 6, (this._y0 + 4 * this._y1 + y) / 6); break;\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new BasisClosed(context);\n}\n","import {point} from \"./basis\";\n\nfunction BasisOpen(context) {\n this._context = context;\n}\n\nBasisOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; var x0 = (this._x0 + 4 * this._x1 + x) / 6, y0 = (this._y0 + 4 * this._y1 + y) / 6; this._line ? this._context.lineTo(x0, y0) : this._context.moveTo(x0, y0); break;\n case 3: this._point = 4; // proceed\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new BasisOpen(context);\n}\n","import {Basis} from \"./basis\";\n\nfunction Bundle(context, beta) {\n this._basis = new Basis(context);\n this._beta = beta;\n}\n\nBundle.prototype = {\n lineStart: function() {\n this._x = [];\n this._y = [];\n this._basis.lineStart();\n },\n lineEnd: function() {\n var x = this._x,\n y = this._y,\n j = x.length - 1;\n\n if (j > 0) {\n var x0 = x[0],\n y0 = y[0],\n dx = x[j] - x0,\n dy = y[j] - y0,\n i = -1,\n t;\n\n while (++i <= j) {\n t = i / j;\n this._basis.point(\n this._beta * x[i] + (1 - this._beta) * (x0 + t * dx),\n this._beta * y[i] + (1 - this._beta) * (y0 + t * dy)\n );\n }\n }\n\n this._x = this._y = null;\n this._basis.lineEnd();\n },\n point: function(x, y) {\n this._x.push(+x);\n this._y.push(+y);\n }\n};\n\nexport default (function custom(beta) {\n\n function bundle(context) {\n return beta === 1 ? new Basis(context) : new Bundle(context, beta);\n }\n\n bundle.beta = function(beta) {\n return custom(+beta);\n };\n\n return bundle;\n})(0.85);\n","export function point(that, x, y) {\n that._context.bezierCurveTo(\n that._x1 + that._k * (that._x2 - that._x0),\n that._y1 + that._k * (that._y2 - that._y0),\n that._x2 + that._k * (that._x1 - x),\n that._y2 + that._k * (that._y1 - y),\n that._x2,\n that._y2\n );\n}\n\nexport function Cardinal(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinal.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x2, this._y2); break;\n case 3: point(this, this._x1, this._y1); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; this._x1 = x, this._y1 = y; break;\n case 2: this._point = 3; // proceed\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new Cardinal(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n","import noop from \"../noop\";\nimport {point} from \"./cardinal\";\n\nexport function CardinalClosed(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinalClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.lineTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n this.point(this._x5, this._y5);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._x3 = x, this._y3 = y; break;\n case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break;\n case 2: this._point = 3; this._x5 = x, this._y5 = y; break;\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new CardinalClosed(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n","import {point} from \"./cardinal\";\n\nexport function CardinalOpen(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinalOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break;\n case 3: this._point = 4; // proceed\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new CardinalOpen(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n","import {epsilon} from \"../math\";\nimport {Cardinal} from \"./cardinal\";\n\nexport function point(that, x, y) {\n var x1 = that._x1,\n y1 = that._y1,\n x2 = that._x2,\n y2 = that._y2;\n\n if (that._l01_a > epsilon) {\n var a = 2 * that._l01_2a + 3 * that._l01_a * that._l12_a + that._l12_2a,\n n = 3 * that._l01_a * (that._l01_a + that._l12_a);\n x1 = (x1 * a - that._x0 * that._l12_2a + that._x2 * that._l01_2a) / n;\n y1 = (y1 * a - that._y0 * that._l12_2a + that._y2 * that._l01_2a) / n;\n }\n\n if (that._l23_a > epsilon) {\n var b = 2 * that._l23_2a + 3 * that._l23_a * that._l12_a + that._l12_2a,\n m = 3 * that._l23_a * (that._l23_a + that._l12_a);\n x2 = (x2 * b + that._x1 * that._l23_2a - x * that._l12_2a) / m;\n y2 = (y2 * b + that._y1 * that._l23_2a - y * that._l12_2a) / m;\n }\n\n that._context.bezierCurveTo(x1, y1, x2, y2, that._x2, that._y2);\n}\n\nfunction CatmullRom(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRom.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x2, this._y2); break;\n case 3: this.point(this._x2, this._y2); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; // proceed\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRom(context, alpha) : new Cardinal(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n","import {CardinalClosed} from \"./cardinalClosed\";\nimport noop from \"../noop\";\nimport {point} from \"./catmullRom\";\n\nfunction CatmullRomClosed(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRomClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.lineTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n this.point(this._x5, this._y5);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; this._x3 = x, this._y3 = y; break;\n case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break;\n case 2: this._point = 3; this._x5 = x, this._y5 = y; break;\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRomClosed(context, alpha) : new CardinalClosed(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n","import {CardinalOpen} from \"./cardinalOpen\";\nimport {point} from \"./catmullRom\";\n\nfunction CatmullRomOpen(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRomOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break;\n case 3: this._point = 4; // proceed\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRomOpen(context, alpha) : new CardinalOpen(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n","import noop from \"../noop\";\n\nfunction LinearClosed(context) {\n this._context = context;\n}\n\nLinearClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._point) this._context.closePath();\n },\n point: function(x, y) {\n x = +x, y = +y;\n if (this._point) this._context.lineTo(x, y);\n else this._point = 1, this._context.moveTo(x, y);\n }\n};\n\nexport default function(context) {\n return new LinearClosed(context);\n}\n","function sign(x) {\n return x < 0 ? -1 : 1;\n}\n\n// Calculate the slopes of the tangents (Hermite-type interpolation) based on\n// the following paper: Steffen, M. 1990. A Simple Method for Monotonic\n// Interpolation in One Dimension. Astronomy and Astrophysics, Vol. 239, NO.\n// NOV(II), P. 443, 1990.\nfunction slope3(that, x2, y2) {\n var h0 = that._x1 - that._x0,\n h1 = x2 - that._x1,\n s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0),\n s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0),\n p = (s0 * h1 + s1 * h0) / (h0 + h1);\n return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;\n}\n\n// Calculate a one-sided slope.\nfunction slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}\n\n// According to https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Representations\n// \"you can express cubic Hermite interpolation in terms of cubic Bézier curves\n// with respect to the four values p0, p0 + m0 / 3, p1 - m1 / 3, p1\".\nfunction point(that, t0, t1) {\n var x0 = that._x0,\n y0 = that._y0,\n x1 = that._x1,\n y1 = that._y1,\n dx = (x1 - x0) / 3;\n that._context.bezierCurveTo(x0 + dx, y0 + dx * t0, x1 - dx, y1 - dx * t1, x1, y1);\n}\n\nfunction MonotoneX(context) {\n this._context = context;\n}\n\nMonotoneX.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 =\n this._t0 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x1, this._y1); break;\n case 3: point(this, this._t0, slope2(this, this._t0)); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n var t1 = NaN;\n\n x = +x, y = +y;\n if (x === this._x1 && y === this._y1) return; // Ignore coincident points.\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; point(this, slope2(this, t1 = slope3(this, x, y)), t1); break;\n default: point(this, this._t0, t1 = slope3(this, x, y)); break;\n }\n\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n this._t0 = t1;\n }\n}\n\nfunction MonotoneY(context) {\n this._context = new ReflectContext(context);\n}\n\n(MonotoneY.prototype = Object.create(MonotoneX.prototype)).point = function(x, y) {\n MonotoneX.prototype.point.call(this, y, x);\n};\n\nfunction ReflectContext(context) {\n this._context = context;\n}\n\nReflectContext.prototype = {\n moveTo: function(x, y) { this._context.moveTo(y, x); },\n closePath: function() { this._context.closePath(); },\n lineTo: function(x, y) { this._context.lineTo(y, x); },\n bezierCurveTo: function(x1, y1, x2, y2, x, y) { this._context.bezierCurveTo(y1, x1, y2, x2, y, x); }\n};\n\nexport function monotoneX(context) {\n return new MonotoneX(context);\n}\n\nexport function monotoneY(context) {\n return new MonotoneY(context);\n}\n","function Natural(context) {\n this._context = context;\n}\n\nNatural.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x = [];\n this._y = [];\n },\n lineEnd: function() {\n var x = this._x,\n y = this._y,\n n = x.length;\n\n if (n) {\n this._line ? this._context.lineTo(x[0], y[0]) : this._context.moveTo(x[0], y[0]);\n if (n === 2) {\n this._context.lineTo(x[1], y[1]);\n } else {\n var px = controlPoints(x),\n py = controlPoints(y);\n for (var i0 = 0, i1 = 1; i1 < n; ++i0, ++i1) {\n this._context.bezierCurveTo(px[0][i0], py[0][i0], px[1][i0], py[1][i0], x[i1], y[i1]);\n }\n }\n }\n\n if (this._line || (this._line !== 0 && n === 1)) this._context.closePath();\n this._line = 1 - this._line;\n this._x = this._y = null;\n },\n point: function(x, y) {\n this._x.push(+x);\n this._y.push(+y);\n }\n};\n\n// See https://www.particleincell.com/2012/bezier-splines/ for derivation.\nfunction controlPoints(x) {\n var i,\n n = x.length - 1,\n m,\n a = new Array(n),\n b = new Array(n),\n r = new Array(n);\n a[0] = 0, b[0] = 2, r[0] = x[0] + 2 * x[1];\n for (i = 1; i < n - 1; ++i) a[i] = 1, b[i] = 4, r[i] = 4 * x[i] + 2 * x[i + 1];\n a[n - 1] = 2, b[n - 1] = 7, r[n - 1] = 8 * x[n - 1] + x[n];\n for (i = 1; i < n; ++i) m = a[i] / b[i - 1], b[i] -= m, r[i] -= m * r[i - 1];\n a[n - 1] = r[n - 1] / b[n - 1];\n for (i = n - 2; i >= 0; --i) a[i] = (r[i] - a[i + 1]) / b[i];\n b[n - 1] = (x[n] + a[n - 1]) / 2;\n for (i = 0; i < n - 1; ++i) b[i] = 2 * x[i + 1] - a[i + 1];\n return [a, b];\n}\n\nexport default function(context) {\n return new Natural(context);\n}\n","function Step(context, t) {\n this._context = context;\n this._t = t;\n}\n\nStep.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x = this._y = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (0 < this._t && this._t < 1 && this._point === 2) this._context.lineTo(this._x, this._y);\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n if (this._line >= 0) this._t = 1 - this._t, this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // proceed\n default: {\n if (this._t <= 0) {\n this._context.lineTo(this._x, y);\n this._context.lineTo(x, y);\n } else {\n var x1 = this._x * (1 - this._t) + x * this._t;\n this._context.lineTo(x1, this._y);\n this._context.lineTo(x1, y);\n }\n break;\n }\n }\n this._x = x, this._y = y;\n }\n};\n\nexport default function(context) {\n return new Step(context, 0.5);\n}\n\nexport function stepBefore(context) {\n return new Step(context, 0);\n}\n\nexport function stepAfter(context) {\n return new Step(context, 1);\n}\n","export var slice = Array.prototype.slice;\n","import { event, select } from 'd3-selection';\nimport { drag } from 'd3-drag';\nimport { arc, curveCatmullRom, curveLinear, line } from 'd3-shape';\nimport { dispatch } from 'd3-dispatch';\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) {\n return typeof obj;\n} : function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n};\n\n\n\n\n\n\n\n\n\n\n\nvar classCallCheck = function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n};\n\nvar createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\n\n\n\n\n\n\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\nvar get = function get(object, property, receiver) {\n if (object === null) object = Function.prototype;\n var desc = Object.getOwnPropertyDescriptor(object, property);\n\n if (desc === undefined) {\n var parent = Object.getPrototypeOf(object);\n\n if (parent === null) {\n return undefined;\n } else {\n return get(parent, property, receiver);\n }\n } else if (\"value\" in desc) {\n return desc.value;\n } else {\n var getter = desc.get;\n\n if (getter === undefined) {\n return undefined;\n }\n\n return getter.call(receiver);\n }\n};\n\nvar inherits = function (subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n};\n\n\n\n\n\n\n\n\n\n\n\nvar possibleConstructorReturn = function (self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n};\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar toConsumableArray = function (arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];\n\n return arr2;\n } else {\n return Array.from(arr);\n }\n};\n\nvar Annotation = function () {\n function Annotation(_ref) {\n var _ref$x = _ref.x,\n x = _ref$x === undefined ? 0 : _ref$x,\n _ref$y = _ref.y,\n y = _ref$y === undefined ? 0 : _ref$y,\n nx = _ref.nx,\n ny = _ref.ny,\n _ref$dy = _ref.dy,\n dy = _ref$dy === undefined ? 0 : _ref$dy,\n _ref$dx = _ref.dx,\n dx = _ref$dx === undefined ? 0 : _ref$dx,\n _ref$color = _ref.color,\n color = _ref$color === undefined ? \"grey\" : _ref$color,\n data = _ref.data,\n type = _ref.type,\n subject = _ref.subject,\n connector = _ref.connector,\n note = _ref.note,\n disable = _ref.disable,\n id = _ref.id,\n className = _ref.className;\n classCallCheck(this, Annotation);\n\n this._dx = nx !== undefined ? nx - x : dx;\n this._dy = ny !== undefined ? ny - y : dy;\n this._x = x;\n this._y = y;\n this._color = color;\n this.id = id;\n this._className = className || \"\";\n\n this._type = type || \"\";\n this.data = data;\n\n this.note = note || {};\n this.connector = connector || {};\n this.subject = subject || {};\n\n this.disable = disable || [];\n }\n\n createClass(Annotation, [{\n key: \"updatePosition\",\n value: function updatePosition() {\n if (this.type.setPosition) {\n this.type.setPosition();\n if (this.type.subject && this.type.subject.selectAll(\":not(.handle)\").nodes().length !== 0) {\n this.type.redrawSubject();\n }\n }\n }\n }, {\n key: \"clearComponents\",\n value: function clearComponents() {\n this.type.clearComponents && this.type.clearComponents();\n }\n }, {\n key: \"updateOffset\",\n value: function updateOffset() {\n if (this.type.setOffset) {\n this.type.setOffset();\n\n if (this.type.connector.selectAll(\":not(.handle)\").nodes().length !== 0) {\n this.type.redrawConnector();\n }\n\n this.type.redrawNote();\n }\n }\n }, {\n key: \"className\",\n get: function get$$1() {\n return this._className;\n },\n set: function set$$1(className) {\n this._className = className;\n if (this.type.setClassName) this.type.setClassName();\n }\n }, {\n key: \"type\",\n get: function get$$1() {\n return this._type;\n },\n set: function set$$1(type) {\n this._type = type;\n this.clearComponents();\n }\n }, {\n key: \"x\",\n get: function get$$1() {\n return this._x;\n },\n set: function set$$1(x) {\n this._x = x;\n this.updatePosition();\n }\n }, {\n key: \"y\",\n get: function get$$1() {\n return this._y;\n },\n set: function set$$1(y) {\n this._y = y;\n this.updatePosition();\n }\n }, {\n key: \"color\",\n get: function get$$1() {\n return this._color;\n },\n set: function set$$1(color) {\n this._color = color;\n this.updatePosition();\n }\n }, {\n key: \"dx\",\n get: function get$$1() {\n return this._dx;\n },\n set: function set$$1(dx) {\n this._dx = dx;\n this.updateOffset();\n }\n }, {\n key: \"dy\",\n get: function get$$1() {\n return this._dy;\n },\n set: function set$$1(dy) {\n this._dy = dy;\n this.updateOffset();\n }\n }, {\n key: \"nx\",\n set: function set$$1(nx) {\n this._dx = nx - this._x;\n this.updateOffset();\n }\n }, {\n key: \"ny\",\n set: function set$$1(ny) {\n this._dy = ny - this._y;\n this.updateOffset();\n }\n }, {\n key: \"offset\",\n get: function get$$1() {\n return { x: this._dx, y: this._dy };\n },\n set: function set$$1(_ref2) {\n var x = _ref2.x,\n y = _ref2.y;\n\n this._dx = x;\n this._dy = y;\n this.updateOffset();\n }\n }, {\n key: \"position\",\n get: function get$$1() {\n return { x: this._x, y: this._y };\n },\n set: function set$$1(_ref3) {\n var x = _ref3.x,\n y = _ref3.y;\n\n this._x = x;\n this._y = y;\n this.updatePosition();\n }\n }, {\n key: \"translation\",\n get: function get$$1() {\n return {\n x: this._x + this._dx,\n y: this._y + this._dy\n };\n }\n }, {\n key: \"json\",\n get: function get$$1() {\n var json = {\n x: this._x,\n y: this._y,\n dx: this._dx,\n dy: this._dy\n };\n\n if (this.data && Object.keys(this.data).length > 0) json.data = this.data;\n if (this.type) json.type = this.type;\n if (this._className) json.className = this._className;\n\n if (Object.keys(this.connector).length > 0) json.connector = this.connector;\n if (Object.keys(this.subject).length > 0) json.subject = this.subject;\n if (Object.keys(this.note).length > 0) json.note = this.note;\n\n return json;\n }\n }]);\n return Annotation;\n}();\n\nvar AnnotationCollection = function () {\n function AnnotationCollection(_ref) {\n var annotations = _ref.annotations,\n accessors = _ref.accessors,\n accessorsInverse = _ref.accessorsInverse;\n classCallCheck(this, AnnotationCollection);\n\n this.accessors = accessors;\n this.accessorsInverse = accessorsInverse;\n this.annotations = annotations;\n }\n\n createClass(AnnotationCollection, [{\n key: \"clearTypes\",\n value: function clearTypes(newSettings) {\n this.annotations.forEach(function (d) {\n d.type = undefined;\n d.subject = newSettings && newSettings.subject || d.subject;\n d.connector = newSettings && newSettings.connector || d.connector;\n d.note = newSettings && newSettings.note || d.note;\n });\n }\n }, {\n key: \"setPositionWithAccessors\",\n value: function setPositionWithAccessors() {\n var _this = this;\n\n this.annotations.forEach(function (d) {\n d.type.setPositionWithAccessors(_this.accessors);\n });\n }\n }, {\n key: \"editMode\",\n value: function editMode(_editMode) {\n this.annotations.forEach(function (a) {\n if (a.type) {\n a.type.editMode = _editMode;\n a.type.updateEditMode();\n }\n });\n }\n }, {\n key: \"updateDisable\",\n value: function updateDisable(disable) {\n this.annotations.forEach(function (a) {\n a.disable = disable;\n if (a.type) {\n disable.forEach(function (d) {\n if (a.type[d]) {\n a.type[d].remove && a.type[d].remove();\n a.type[d] = undefined;\n }\n });\n }\n });\n }\n }, {\n key: \"updateTextWrap\",\n value: function updateTextWrap(textWrap) {\n this.annotations.forEach(function (a) {\n if (a.type && a.type.updateTextWrap) {\n a.type.updateTextWrap(textWrap);\n }\n });\n }\n }, {\n key: \"updateText\",\n value: function updateText() {\n this.annotations.forEach(function (a) {\n if (a.type && a.type.drawText) {\n a.type.drawText();\n }\n });\n }\n }, {\n key: \"updateNotePadding\",\n value: function updateNotePadding(notePadding) {\n this.annotations.forEach(function (a) {\n if (a.type) {\n a.type.notePadding = notePadding;\n }\n });\n }\n }, {\n key: \"json\",\n get: function get$$1() {\n var _this2 = this;\n\n return this.annotations.map(function (a) {\n var json = a.json;\n if (_this2.accessorsInverse && a.data) {\n json.data = {};\n Object.keys(_this2.accessorsInverse).forEach(function (k) {\n json.data[k] = _this2.accessorsInverse[k]({ x: a.x, y: a.y });\n\n //TODO make this feasible to map back to data for other types of subjects\n });\n }\n return json;\n });\n }\n }, {\n key: \"noteNodes\",\n get: function get$$1() {\n return this.annotations.map(function (a) {\n return _extends({}, a.type.getNoteBBoxOffset(), { positionX: a.x, positionY: a.y });\n });\n }\n\n //TODO: come back and rethink if a.x and a.y are applicable in all situations\n // get connectorNodes() {\n // return this.annotations.map(a => ({ ...a.type.getConnectorBBox(), startX: a.x, startY: a.y}))\n // }\n\n // get subjectNodes() {\n // return this.annotations.map(a => ({ ...a.type.getSubjectBBox(), startX: a.x, startY: a.y}))\n // }\n\n // get annotationNodes() {\n // return this.annotations.map(a => ({ ...a.type.getAnnotationBBox(), startX: a.x, startY: a.y}))\n // }\n\n }]);\n return AnnotationCollection;\n}();\n\nvar pointHandle = function pointHandle(_ref) {\n var _ref$cx = _ref.cx,\n cx = _ref$cx === undefined ? 0 : _ref$cx,\n _ref$cy = _ref.cy,\n cy = _ref$cy === undefined ? 0 : _ref$cy;\n\n return { move: { x: cx, y: cy } };\n};\n\nvar circleHandles = function circleHandles(_ref2) {\n var _ref2$cx = _ref2.cx,\n cx = _ref2$cx === undefined ? 0 : _ref2$cx,\n _ref2$cy = _ref2.cy,\n cy = _ref2$cy === undefined ? 0 : _ref2$cy,\n r1 = _ref2.r1,\n r2 = _ref2.r2,\n padding = _ref2.padding;\n\n var h = { move: { x: cx, y: cy } };\n\n if (r1 !== undefined) {\n h.r1 = { x: cx + r1 / Math.sqrt(2), y: cy + r1 / Math.sqrt(2) };\n }\n\n if (r2 !== undefined) {\n h.r2 = { x: cx + r2 / Math.sqrt(2), y: cy + r2 / Math.sqrt(2) };\n }\n\n if (padding !== undefined) {\n h.padding = { x: cx + r1 + padding, y: cy };\n }\n\n return h;\n};\n\n\n\n\n\n//arc handles\nvar addHandles = function addHandles(_ref5) {\n var group = _ref5.group,\n handles = _ref5.handles,\n _ref5$r = _ref5.r,\n r = _ref5$r === undefined ? 10 : _ref5$r;\n\n //give it a group and x,y to draw handles\n //then give it instructions on what the handles change\n var h = group.selectAll(\"circle.handle\").data(handles);\n\n h.enter().append(\"circle\").attr(\"class\", \"handle\").attr(\"fill\", \"grey\").attr(\"fill-opacity\", 0.1).attr(\"cursor\", \"move\").attr(\"stroke-dasharray\", 5).attr(\"stroke\", \"grey\").call(drag().container(select(\"g.annotations\").node()).on(\"start\", function (d) {\n return d.start && d.start(d);\n }).on(\"drag\", function (d) {\n return d.drag && d.drag(d);\n }).on(\"end\", function (d) {\n return d.end && d.end(d);\n }));\n\n group.selectAll(\"circle.handle\").attr(\"cx\", function (d) {\n return d.x;\n }).attr(\"cy\", function (d) {\n return d.y;\n }).attr(\"r\", function (d) {\n return d.r || r;\n }).attr(\"class\", function (d) {\n return \"handle \" + (d.className || \"\");\n });\n\n h.exit().remove();\n};\n\nvar leftRightDynamic = function leftRightDynamic(align, y) {\n if (align === \"dynamic\" || align === \"left\" || align === \"right\") {\n if (y < 0) {\n align = \"top\";\n } else {\n align = \"bottom\";\n }\n }\n return align;\n};\n\nvar topBottomDynamic = function topBottomDynamic(align, x) {\n if (align === \"dynamic\" || align === \"top\" || align === \"bottom\") {\n if (x < 0) {\n align = \"right\";\n } else {\n align = \"left\";\n }\n }\n return align;\n};\n\nvar orientationTopBottom = [\"topBottom\", \"top\", \"bottom\"];\nvar orientationLeftRight = [\"leftRight\", \"left\", \"right\"];\n\nvar noteAlignment = (function (_ref) {\n var _ref$padding = _ref.padding,\n padding = _ref$padding === undefined ? 0 : _ref$padding,\n _ref$bbox = _ref.bbox,\n bbox = _ref$bbox === undefined ? { x: 0, y: 0, width: 0, height: 0 } : _ref$bbox,\n align = _ref.align,\n orientation = _ref.orientation,\n _ref$offset = _ref.offset,\n offset = _ref$offset === undefined ? { x: 0, y: 0 } : _ref$offset;\n\n var x = -bbox.x;\n var y = 0; //-bbox.y\n if (orientationTopBottom.indexOf(orientation) !== -1) {\n align = topBottomDynamic(align, offset.x);\n if (offset.y < 0 && orientation === \"topBottom\" || orientation === \"top\") {\n y -= bbox.height + padding;\n } else {\n y += padding;\n }\n\n if (align === \"middle\") {\n x -= bbox.width / 2;\n } else if (align === \"right\") {\n x -= bbox.width;\n }\n } else if (orientationLeftRight.indexOf(orientation) !== -1) {\n align = leftRightDynamic(align, offset.y);\n if (offset.x < 0 && orientation === \"leftRight\" || orientation === \"left\") {\n x -= bbox.width + padding;\n } else {\n x += padding;\n }\n\n if (align === \"middle\") {\n y -= bbox.height / 2;\n } else if (align === \"top\") {\n y -= bbox.height;\n }\n }\n\n return { x: x, y: y };\n});\n\nvar lineBuilder = function lineBuilder(_ref) {\n var data = _ref.data,\n _ref$curve = _ref.curve,\n curve = _ref$curve === undefined ? curveLinear : _ref$curve,\n canvasContext = _ref.canvasContext,\n className = _ref.className,\n classID = _ref.classID;\n\n var lineGen = line().curve(curve);\n\n var builder = {\n type: 'path',\n className: className,\n classID: classID,\n data: data\n };\n\n if (canvasContext) {\n lineGen.context(canvasContext);\n builder.pathMethods = lineGen;\n } else {\n builder.attrs = {\n d: lineGen(data)\n };\n }\n\n return builder;\n};\n\nvar arcBuilder = function arcBuilder(_ref2) {\n var data = _ref2.data,\n canvasContext = _ref2.canvasContext,\n className = _ref2.className,\n classID = _ref2.classID;\n\n\n var builder = {\n type: 'path',\n className: className,\n classID: classID,\n data: data\n };\n\n var arcShape = arc().innerRadius(data.innerRadius || 0).outerRadius(data.outerRadius || data.radius || 2).startAngle(data.startAngle || 0).endAngle(data.endAngle || 2 * Math.PI);\n\n if (canvasContext) {\n arcShape.context(canvasContext);\n builder.pathMethods = lineGen;\n } else {\n\n builder.attrs = {\n d: arcShape()\n };\n }\n\n return builder;\n};\n\nvar noteVertical = (function (_ref) {\n var align = _ref.align,\n _ref$x = _ref.x,\n x = _ref$x === undefined ? 0 : _ref$x,\n _ref$y = _ref.y,\n y = _ref$y === undefined ? 0 : _ref$y,\n bbox = _ref.bbox,\n offset = _ref.offset;\n\n align = leftRightDynamic(align, offset.y);\n\n if (align === \"top\") {\n y -= bbox.height;\n } else if (align === \"middle\") {\n y -= bbox.height / 2;\n }\n\n var data = [[x, y], [x, y + bbox.height]];\n return { components: [lineBuilder({ data: data, className: \"note-line\" })] };\n});\n\nvar noteHorizontal = (function (_ref) {\n var align = _ref.align,\n _ref$x = _ref.x,\n x = _ref$x === undefined ? 0 : _ref$x,\n _ref$y = _ref.y,\n y = _ref$y === undefined ? 0 : _ref$y,\n offset = _ref.offset,\n bbox = _ref.bbox;\n\n align = topBottomDynamic(align, offset.x);\n\n if (align === \"right\") {\n x -= bbox.width;\n } else if (align === \"middle\") {\n x -= bbox.width / 2;\n }\n\n var data = [[x, y], [x + bbox.width, y]];\n return { components: [lineBuilder({ data: data, className: \"note-line\" })] };\n});\n\nvar lineSetup = function lineSetup(_ref) {\n var type = _ref.type,\n subjectType = _ref.subjectType;\n\n var annotation = type.annotation;\n var offset = annotation.position;\n\n var x1 = annotation.x - offset.x,\n x2 = x1 + annotation.dx,\n y1 = annotation.y - offset.y,\n y2 = y1 + annotation.dy;\n\n var subjectData = annotation.subject;\n\n if (subjectType === \"circle\" && (subjectData.outerRadius || subjectData.radius)) {\n var h = Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));\n var angle = Math.asin(-y2 / h);\n var r = subjectData.outerRadius || subjectData.radius + (subjectData.radiusPadding || 0);\n\n x1 = Math.abs(Math.cos(angle) * r) * (x2 < 0 ? -1 : 1);\n y1 = Math.abs(Math.sin(angle) * r) * (y2 < 0 ? -1 : 1);\n }\n\n if (subjectType === \"rect\") {\n var width = subjectData.width,\n height = subjectData.height;\n\n\n if (width > 0 && annotation.dx > 0 || width < 0 && annotation.dx < 0) {\n if (Math.abs(width) > Math.abs(annotation.dx)) x1 = width / 2;else x1 = width;\n }\n if (height > 0 && annotation.dy > 0 || height < 0 && annotation.dy < 0) {\n if (Math.abs(height) > Math.abs(annotation.dy)) y1 = height / 2;else y1 = height;\n }\n if (x1 === width / 2 && y1 === height / 2) {\n x1 = x2;y1 = y2;\n }\n }\n\n return [[x1, y1], [x2, y2]];\n};\n\nvar connectorLine = (function (connectorData) {\n var data = lineSetup(connectorData);\n return { components: [lineBuilder({ data: data, className: \"connector\" })] };\n});\n\nvar connectorElbow = (function (_ref) {\n var type = _ref.type,\n subjectType = _ref.subjectType;\n\n\n var annotation = type.annotation;\n var offset = annotation.position;\n\n var x1 = annotation.x - offset.x,\n x2 = x1 + annotation.dx,\n y1 = annotation.y - offset.y,\n y2 = y1 + annotation.dy;\n\n var subjectData = annotation.subject;\n\n if (subjectType === \"rect\") {\n var width = subjectData.width,\n height = subjectData.height;\n\n\n if (width > 0 && annotation.dx > 0 || width < 0 && annotation.dx < 0) {\n if (Math.abs(width) > Math.abs(annotation.dx)) x1 = width / 2;else x1 = width;\n }\n if (height > 0 && annotation.dy > 0 || height < 0 && annotation.dy < 0) {\n if (Math.abs(height) > Math.abs(annotation.dy)) y1 = height / 2;else y1 = height;\n }\n if (x1 === width / 2 && y1 === height / 2) {\n x1 = x2;y1 = y2;\n }\n }\n\n var data = [[x1, y1], [x2, y2]];\n\n var diffY = y2 - y1;\n var diffX = x2 - x1;\n var xe = x2;\n var ye = y2;\n var opposite = y2 < y1 && x2 > x1 || x2 < x1 && y2 > y1 ? -1 : 1;\n\n if (Math.abs(diffX) < Math.abs(diffY)) {\n xe = x2;\n ye = y1 + diffX * opposite;\n } else {\n ye = y2;\n xe = x1 + diffY * opposite;\n }\n\n if (subjectType === \"circle\" && (subjectData.outerRadius || subjectData.radius)) {\n var r = (subjectData.outerRadius || subjectData.radius) + (subjectData.radiusPadding || 0);\n var length = r / Math.sqrt(2);\n\n if (Math.abs(diffX) > length && Math.abs(diffY) > length) {\n x1 = length * (x2 < 0 ? -1 : 1);\n y1 = length * (y2 < 0 ? -1 : 1);\n data = [[x1, y1], [xe, ye], [x2, y2]];\n } else if (Math.abs(diffX) > Math.abs(diffY)) {\n var angle = Math.asin(-y2 / r);\n x1 = Math.abs(Math.cos(angle) * r) * (x2 < 0 ? -1 : 1);\n data = [[x1, y2], [x2, y2]];\n } else {\n var _angle = Math.acos(x2 / r);\n y1 = Math.abs(Math.sin(_angle) * r) * (y2 < 0 ? -1 : 1);\n data = [[x2, y1], [x2, y2]];\n }\n } else {\n data = [[x1, y1], [xe, ye], [x2, y2]];\n }\n\n return { components: [lineBuilder({ data: data, className: \"connector\" })] };\n});\n\nvar connectorCurve = (function (_ref) {\n var type = _ref.type,\n connectorData = _ref.connectorData,\n subjectType = _ref.subjectType;\n\n\n if (!connectorData) {\n connectorData = {};\n }\n if (!connectorData.points || typeof connectorData.points === \"number\") {\n connectorData.points = createPoints(type.annotation.offset, connectorData.points);\n }\n if (!connectorData.curve) {\n connectorData.curve = curveCatmullRom;\n }\n\n var handles = [];\n\n if (type.editMode) {\n var cHandles = connectorData.points.map(function (c, i) {\n return _extends({}, pointHandle({ cx: c[0], cy: c[1] }), { index: i });\n });\n\n var updatePoint = function updatePoint(index) {\n connectorData.points[index][0] += event.dx;\n connectorData.points[index][1] += event.dy;\n type.redrawConnector();\n };\n\n handles = type.mapHandles(cHandles.map(function (h) {\n return _extends({}, h.move, { drag: updatePoint.bind(type, h.index) });\n }));\n }\n\n var data = lineSetup({ type: type, subjectType: subjectType });\n data = [data[0]].concat(toConsumableArray(connectorData.points), [data[1]]);\n var components = [lineBuilder({ data: data, curve: connectorData.curve, className: \"connector\" })];\n\n return { components: components, handles: handles };\n});\n\nvar createPoints = function createPoints(offset) {\n var anchors = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;\n\n var diff = { x: offset.x / (anchors + 1), y: offset.y / (anchors + 1) };\n var p = [];\n\n var i = 1;\n for (; i <= anchors; i++) {\n p.push([diff.x * i + i % 2 * 20, diff.y * i - i % 2 * 20]);\n }\n return p;\n};\n\nvar connectorArrow = (function (_ref) {\n var annotation = _ref.annotation,\n start = _ref.start,\n end = _ref.end,\n _ref$scale = _ref.scale,\n scale = _ref$scale === undefined ? 1 : _ref$scale;\n\n var offset = annotation.position;\n if (!start) {\n start = [annotation.dx, annotation.dy];\n } else {\n start = [-end[0] + start[0], -end[1] + start[1]];\n }\n if (!end) {\n end = [annotation.x - offset.x, annotation.y - offset.y];\n }\n\n var x1 = end[0],\n y1 = end[1];\n\n var dx = start[0];\n var dy = start[1];\n\n var size = 10 * scale;\n var angleOffset = 16 / 180 * Math.PI;\n var angle = Math.atan(dy / dx);\n\n if (dx < 0) {\n angle += Math.PI;\n }\n\n var data = [[x1, y1], [Math.cos(angle + angleOffset) * size + x1, Math.sin(angle + angleOffset) * size + y1], [Math.cos(angle - angleOffset) * size + x1, Math.sin(angle - angleOffset) * size + y1], [x1, y1]];\n\n //TODO add in reverse\n // if (canvasContext.arrowReverse){\n // data = [[x1, y1],\n // [Math.cos(angle + angleOffset)*size, Math.sin(angle + angleOffset)*size],\n // [Math.cos(angle - angleOffset)*size, Math.sin(angle - angleOffset)*size],\n // [x1, y1]\n // ]\n // } else {\n // data = [[x1, y1],\n // [Math.cos(angle + angleOffset)*size, Math.sin(angle + angleOffset)*size],\n // [Math.cos(angle - angleOffset)*size, Math.sin(angle - angleOffset)*size],\n // [x1, y1]\n // ]\n // }\n\n return {\n components: [lineBuilder({\n data: data,\n className: \"connector-end connector-arrow\",\n classID: \"connector-end\"\n })]\n };\n});\n\nvar connectorDot = (function (_ref) {\n var line$$1 = _ref.line,\n _ref$scale = _ref.scale,\n scale = _ref$scale === undefined ? 1 : _ref$scale;\n\n var dot = arcBuilder({\n className: \"connector-end connector-dot\",\n classID: \"connector-end\",\n data: { radius: 3 * Math.sqrt(scale) }\n });\n dot.attrs.transform = \"translate(\" + line$$1.data[0][0] + \", \" + line$$1.data[0][1] + \")\";\n\n return { components: [dot] };\n});\n\nvar subjectCircle = (function (_ref) {\n var subjectData = _ref.subjectData,\n type = _ref.type;\n\n if (!subjectData.radius && !subjectData.outerRadius) {\n subjectData.radius = 20;\n }\n\n var handles = [];\n var c = arcBuilder({ data: subjectData, className: \"subject\" });\n if (type.editMode) {\n var h = circleHandles({\n r1: c.data.outerRadius || c.data.radius,\n r2: c.data.innerRadius,\n padding: subjectData.radiusPadding\n });\n\n var updateRadius = function updateRadius(attr) {\n var r = subjectData[attr] + event.dx * Math.sqrt(2);\n subjectData[attr] = r;\n type.redrawSubject();\n type.redrawConnector();\n };\n\n var cHandles = [_extends({}, h.r1, {\n drag: updateRadius.bind(type, subjectData.outerRadius !== undefined ? \"outerRadius\" : \"radius\")\n })];\n\n if (subjectData.innerRadius) {\n cHandles.push(_extends({}, h.r2, { drag: updateRadius.bind(type, \"innerRadius\") }));\n }\n handles = type.mapHandles(cHandles);\n }\n\n c.attrs[\"fill-opacity\"] = 0;\n\n return { components: [c], handles: handles };\n});\n\nvar subjectRect = (function (_ref) {\n var subjectData = _ref.subjectData,\n type = _ref.type;\n\n if (!subjectData.width) {\n subjectData.width = 100;\n }\n if (!subjectData.height) {\n subjectData.height = 100;\n }\n\n var handles = [];\n var width = subjectData.width,\n height = subjectData.height;\n\n\n var data = [[0, 0], [width, 0], [width, height], [0, height], [0, 0]];\n var rect = lineBuilder({ data: data, className: \"subject\" });\n\n if (type.editMode) {\n var updateWidth = function updateWidth() {\n subjectData.width = event.x;\n type.redrawSubject();\n type.redrawConnector();\n };\n\n var updateHeight = function updateHeight() {\n subjectData.height = event.y;\n type.redrawSubject();\n type.redrawConnector();\n };\n\n var rHandles = [{ x: width, y: height / 2, drag: updateWidth.bind(type) }, { x: width / 2, y: height, drag: updateHeight.bind(type) }];\n\n handles = type.mapHandles(rHandles);\n }\n rect.attrs[\"fill-opacity\"] = 0.1;\n return { components: [rect], handles: handles };\n});\n\nvar subjectThreshold = (function (_ref) {\n var subjectData = _ref.subjectData,\n type = _ref.type;\n\n var offset = type.annotation.position;\n\n var x1 = (subjectData.x1 !== undefined ? subjectData.x1 : offset.x) - offset.x,\n x2 = (subjectData.x2 !== undefined ? subjectData.x2 : offset.x) - offset.x,\n y1 = (subjectData.y1 !== undefined ? subjectData.y1 : offset.y) - offset.y,\n y2 = (subjectData.y2 !== undefined ? subjectData.y2 : offset.y) - offset.y;\n\n var data = [[x1, y1], [x2, y2]];\n return { components: [lineBuilder({ data: data, className: 'subject' })] };\n});\n\nvar subjectBadge = (function (_ref) {\n var _ref$subjectData = _ref.subjectData,\n subjectData = _ref$subjectData === undefined ? {} : _ref$subjectData,\n _ref$type = _ref.type,\n type = _ref$type === undefined ? {} : _ref$type;\n var annotation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var typeSettings = type.typeSettings && type.typeSettings.subject;\n\n if (!subjectData.radius) {\n if (typeSettings && typeSettings.radius) {\n subjectData.radius = typeSettings.radius;\n } else {\n subjectData.radius = 14;\n }\n }\n if (!subjectData.x) {\n if (typeSettings && typeSettings.x) {\n subjectData.x = typeSettings.x;\n }\n }\n if (!subjectData.y) {\n if (typeSettings && typeSettings.y) {\n subjectData.y = typeSettings.y;\n }\n }\n\n var handles = [];\n var components = [];\n var radius = subjectData.radius;\n var innerRadius = radius * 0.7;\n var x = 0;\n var y = 0;\n\n var notCornerOffset = Math.sqrt(2) * radius;\n var placement = {\n xleftcorner: -radius,\n xrightcorner: radius,\n ytopcorner: -radius,\n ybottomcorner: radius,\n xleft: -notCornerOffset,\n xright: notCornerOffset,\n ytop: -notCornerOffset,\n ybottom: notCornerOffset\n };\n\n if (subjectData.x && !subjectData.y) {\n x = placement[\"x\" + subjectData.x];\n } else if (subjectData.y && !subjectData.x) {\n y = placement[\"y\" + subjectData.y];\n } else if (subjectData.x && subjectData.y) {\n x = placement[\"x\" + subjectData.x + \"corner\"];\n y = placement[\"y\" + subjectData.y + \"corner\"];\n }\n\n var transform = \"translate(\" + x + \", \" + y + \")\";\n var circlebg = arcBuilder({ className: \"subject\", data: { radius: radius } });\n circlebg.attrs.transform = transform;\n circlebg.attrs.fill = annotation.color;\n circlebg.attrs[\"stroke-linecap\"] = \"round\";\n circlebg.attrs[\"stroke-width\"] = \"3px\";\n\n var circle = arcBuilder({\n className: \"subject-ring\",\n data: { outerRadius: radius, innerRadius: innerRadius }\n });\n\n circle.attrs.transform = transform;\n // circle.attrs.fill = annotation.color\n circle.attrs[\"stroke-width\"] = \"3px\";\n circle.attrs.fill = \"white\";\n\n var pointer = void 0;\n if (x && y || !x && !y) {\n pointer = lineBuilder({\n className: \"subject-pointer\",\n data: [[0, 0], [x || 0, 0], [0, y || 0], [0, 0]]\n });\n } else if (x || y) {\n var notCornerPointerXY = function notCornerPointerXY(v) {\n var sign = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n return v && v / Math.sqrt(2) / Math.sqrt(2) || sign * radius / Math.sqrt(2);\n };\n\n pointer = lineBuilder({\n className: \"subject-pointer\",\n data: [[0, 0], [notCornerPointerXY(x), notCornerPointerXY(y)], [notCornerPointerXY(x, -1), notCornerPointerXY(y, -1)], [0, 0]]\n });\n }\n\n if (pointer) {\n pointer.attrs.fill = annotation.color;\n pointer.attrs[\"stroke-linecap\"] = \"round\";\n pointer.attrs[\"stroke-width\"] = \"3px\";\n components.push(pointer);\n }\n\n if (type.editMode) {\n var dragBadge = function dragBadge() {\n subjectData.x = event.x < -radius * 2 ? \"left\" : event.x > radius * 2 ? \"right\" : undefined;\n subjectData.y = event.y < -radius * 2 ? \"top\" : event.y > radius * 2 ? \"bottom\" : undefined;\n\n type.redrawSubject();\n };\n\n var bHandles = { x: x * 2, y: y * 2, drag: dragBadge.bind(type) };\n if (!bHandles.x && !bHandles.y) {\n bHandles.y = -radius;\n }\n\n handles = type.mapHandles([bHandles]);\n }\n\n var text = void 0;\n if (subjectData.text) {\n text = {\n type: \"text\",\n className: \"badge-text\",\n attrs: {\n fill: \"white\",\n stroke: \"none\",\n \"font-size\": \".7em\",\n text: subjectData.text,\n \"text-anchor\": \"middle\",\n dy: \".25em\",\n x: x,\n y: y\n }\n };\n }\n\n components.push(circlebg);\n components.push(circle);\n components.push(text);\n\n return { components: components, handles: handles };\n});\n\n//Note options\n//Connector options\n//Subject options\nvar Type = function () {\n function Type(_ref) {\n var a = _ref.a,\n annotation = _ref.annotation,\n editMode = _ref.editMode,\n dispatcher = _ref.dispatcher,\n notePadding = _ref.notePadding,\n accessors = _ref.accessors;\n classCallCheck(this, Type);\n\n this.a = a;\n\n this.note = annotation.disable.indexOf(\"note\") === -1 && a.select(\"g.annotation-note\");\n this.noteContent = this.note && a.select(\"g.annotation-note-content\");\n this.connector = annotation.disable.indexOf(\"connector\") === -1 && a.select(\"g.annotation-connector\");\n this.subject = annotation.disable.indexOf(\"subject\") === -1 && a.select(\"g.annotation-subject\");\n this.dispatcher = dispatcher;\n\n if (dispatcher) {\n var handler = addHandlers.bind(null, dispatcher, annotation);\n handler({ component: this.note, name: \"note\" });\n handler({ component: this.connector, name: \"connector\" });\n handler({ component: this.subject, name: \"subject\" });\n }\n\n this.annotation = annotation;\n this.editMode = annotation.editMode || editMode;\n this.notePadding = notePadding !== undefined ? notePadding : 3;\n this.offsetCornerX = 0;\n this.offsetCornerY = 0;\n\n if (accessors && annotation.data) {\n this.init(accessors);\n }\n }\n\n createClass(Type, [{\n key: \"init\",\n value: function init(accessors) {\n if (!this.annotation.x) {\n this.mapX(accessors);\n }\n if (!this.annotation.y) {\n this.mapY(accessors);\n }\n }\n }, {\n key: \"mapY\",\n value: function mapY(accessors) {\n if (accessors.y) {\n this.annotation.y = accessors.y(this.annotation.data);\n }\n }\n }, {\n key: \"mapX\",\n value: function mapX(accessors) {\n if (accessors.x) {\n this.annotation.x = accessors.x(this.annotation.data);\n }\n }\n }, {\n key: \"updateEditMode\",\n value: function updateEditMode() {\n this.a.selectAll(\"circle.handle\").remove();\n }\n }, {\n key: \"drawOnSVG\",\n value: function drawOnSVG(component, builders) {\n var _this = this;\n\n if (!Array.isArray(builders)) {\n builders = [builders];\n }\n\n builders.filter(function (b) {\n return b;\n }).forEach(function (_ref2) {\n var type = _ref2.type,\n className = _ref2.className,\n attrs = _ref2.attrs,\n handles = _ref2.handles,\n classID = _ref2.classID;\n\n if (type === \"handle\") {\n addHandles({ group: component, r: attrs && attrs.r, handles: handles });\n } else {\n newWithClass(component, [_this.annotation], type, className, classID);\n var el = component.select(type + \".\" + (classID || className));\n var addAttrs = Object.keys(attrs);\n var removeAttrs = [];\n\n var currentAttrs = el.node().attributes;\n for (var i = currentAttrs.length - 1; i >= 0; i--) {\n var name = currentAttrs[i].name;\n if (addAttrs.indexOf(name) === -1 && name !== \"class\") removeAttrs.push(name);\n }\n\n addAttrs.forEach(function (attr) {\n if (attr === \"text\") {\n el.text(attrs[attr]);\n } else {\n el.attr(attr, attrs[attr]);\n }\n });\n\n removeAttrs.forEach(function (attr) {\n return el.attr(attr, null);\n });\n }\n });\n }\n\n //TODO: how to extend this to a drawOnCanvas mode?\n\n }, {\n key: \"getNoteBBox\",\n value: function getNoteBBox() {\n return bboxWithoutHandles(this.note, \".annotation-note-content text\");\n }\n }, {\n key: \"getNoteBBoxOffset\",\n value: function getNoteBBoxOffset() {\n var bbox = bboxWithoutHandles(this.note, \".annotation-note-content\");\n var transform = this.noteContent.attr(\"transform\").split(/\\(|\\,|\\)/g);\n bbox.offsetCornerX = parseFloat(transform[1]) + this.annotation.dx;\n bbox.offsetCornerY = parseFloat(transform[2]) + this.annotation.dy;\n bbox.offsetX = this.annotation.dx;\n bbox.offsetY = this.annotation.dy;\n return bbox;\n }\n }, {\n key: \"drawSubject\",\n value: function drawSubject() {\n var _this2 = this;\n\n var context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n var subjectData = this.annotation.subject;\n var type = context.type;\n var subjectParams = { type: this, subjectData: subjectData };\n\n var subject = {};\n if (type === \"circle\") subject = subjectCircle(subjectParams);else if (type === \"rect\") subject = subjectRect(subjectParams);else if (type === \"threshold\") subject = subjectThreshold(subjectParams);else if (type === \"badge\") subject = subjectBadge(subjectParams, this.annotation);\n\n var _subject = subject,\n _subject$components = _subject.components,\n components = _subject$components === undefined ? [] : _subject$components,\n _subject$handles = _subject.handles,\n handles = _subject$handles === undefined ? [] : _subject$handles;\n\n components.forEach(function (c) {\n if (c && c.attrs && !c.attrs.stroke) {\n c.attrs.stroke = _this2.annotation.color;\n }\n });\n\n if (this.editMode) {\n handles = handles.concat(this.mapHandles([{ drag: this.dragSubject.bind(this) }]));\n components.push({ type: \"handle\", handles: handles });\n }\n\n return components;\n }\n }, {\n key: \"drawConnector\",\n value: function drawConnector() {\n var _this3 = this;\n\n var context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n var connectorData = this.annotation.connector;\n var type = connectorData.type || context.type;\n var connectorParams = { type: this, connectorData: connectorData };\n connectorParams.subjectType = this.typeSettings && this.typeSettings.subject && this.typeSettings.subject.type;\n\n var connector = {};\n if (type === \"curve\") connector = connectorCurve(connectorParams);else if (type === \"elbow\") connector = connectorElbow(connectorParams);else connector = connectorLine(connectorParams);\n var _connector = connector,\n _connector$components = _connector.components,\n components = _connector$components === undefined ? [] : _connector$components,\n _connector$handles = _connector.handles,\n handles = _connector$handles === undefined ? [] : _connector$handles;\n\n var line$$1 = components[0];\n //TODO: genericize this into fill t/f stroke t/f\n if (line$$1) {\n line$$1.attrs.stroke = this.annotation.color;\n line$$1.attrs.fill = \"none\";\n }\n var endType = connectorData.end || context.end;\n var end = {};\n if (endType === \"arrow\") {\n var s = line$$1.data[1];\n var e = line$$1.data[0];\n var distance = Math.sqrt(Math.pow(s[0] - e[0], 2) + Math.pow(s[1] - e[1], 2));\n if (distance < 5 && line$$1.data[2]) {\n s = line$$1.data[2];\n }\n end = connectorArrow({\n annotation: this.annotation,\n start: s,\n end: e,\n scale: connectorData.endScale\n });\n } else if (endType === \"dot\") {\n end = connectorDot({ line: line$$1, scale: connectorData.endScale });\n } else if (!endType || endType === \"none\") {\n this.connector && this.connector.select(\".connector-end\").remove();\n }\n\n if (end.components) {\n end.components.forEach(function (c) {\n c.attrs.fill = _this3.annotation.color;\n c.attrs.stroke = _this3.annotation.color;\n });\n components = components.concat(end.components);\n }\n\n if (this.editMode) {\n if (handles.length !== 0) components.push({ type: \"handle\", handles: handles });\n }\n return components;\n }\n }, {\n key: \"drawNote\",\n value: function drawNote() {\n var _this4 = this;\n\n var context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n var noteData = this.annotation.note;\n var align = noteData.align || context.align || \"dynamic\";\n var noteParams = {\n bbox: context.bbox,\n align: align,\n offset: this.annotation.offset\n };\n var lineType = noteData.lineType || context.lineType;\n var note = {};\n if (lineType === \"vertical\") note = noteVertical(noteParams);else if (lineType === \"horizontal\") note = noteHorizontal(noteParams);\n\n var _note = note,\n _note$components = _note.components,\n components = _note$components === undefined ? [] : _note$components,\n _note$handles = _note.handles,\n handles = _note$handles === undefined ? [] : _note$handles;\n\n components.forEach(function (c) {\n c.attrs.stroke = _this4.annotation.color;\n });\n\n if (this.editMode) {\n handles = this.mapHandles([{ x: 0, y: 0, drag: this.dragNote.bind(this) }]);\n components.push({ type: \"handle\", handles: handles });\n\n var dragging = this.dragNote.bind(this),\n start = this.dragstarted.bind(this),\n end = this.dragended.bind(this);\n this.note.call(drag().container(select(\"g.annotations\").node()).on(\"start\", function (d) {\n return start(d);\n }).on(\"drag\", function (d) {\n return dragging(d);\n }).on(\"end\", function (d) {\n return end(d);\n }));\n } else {\n this.note.on(\"mousedown.drag\", null);\n }\n return components;\n }\n }, {\n key: \"drawNoteContent\",\n value: function drawNoteContent(context) {\n var noteData = this.annotation.note;\n var padding = noteData.padding !== undefined ? noteData.padding : this.notePadding;\n var orientation = noteData.orientation || context.orientation || \"topBottom\";\n var lineType = noteData.lineType || context.lineType;\n var align = noteData.align || context.align || \"dynamic\";\n\n if (lineType === \"vertical\") orientation = \"leftRight\";else if (lineType === \"horizontal\") orientation = \"topBottom\";\n\n var noteParams = {\n padding: padding,\n bbox: context.bbox,\n offset: this.annotation.offset,\n orientation: orientation,\n align: align\n };\n\n var _noteAlignment = noteAlignment(noteParams),\n x = _noteAlignment.x,\n y = _noteAlignment.y;\n\n this.offsetCornerX = x + this.annotation.dx;\n this.offsetCornerY = y + this.annotation.dy;\n this.note && this.noteContent.attr(\"transform\", \"translate(\" + x + \", \" + y + \")\");\n\n return [];\n }\n }, {\n key: \"drawOnScreen\",\n value: function drawOnScreen(component, drawFunction) {\n return this.drawOnSVG(component, drawFunction);\n }\n }, {\n key: \"redrawSubject\",\n value: function redrawSubject() {\n this.subject && this.drawOnScreen(this.subject, this.drawSubject());\n }\n }, {\n key: \"redrawConnector\",\n value: function redrawConnector() {\n this.connector && this.drawOnScreen(this.connector, this.drawConnector());\n }\n }, {\n key: \"redrawNote\",\n value: function redrawNote() {\n var bbox = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getNoteBBox();\n\n this.noteContent && this.drawOnScreen(this.noteContent, this.drawNoteContent({ bbox: bbox }));\n this.note && this.drawOnScreen(this.note, this.drawNote({ bbox: bbox }));\n }\n }, {\n key: \"setPosition\",\n value: function setPosition() {\n var position = this.annotation.position;\n this.a.attr(\"transform\", \"translate(\" + position.x + \", \" + position.y + \")\");\n }\n }, {\n key: \"clearComponents\",\n value: function clearComponents() {\n this.subject && this.subject.select(\"*\").remove();\n this.connector && this.connector.select(\"*\").remove();\n // this.note && this.note.select(\"*\").remove()\n }\n }, {\n key: \"setOffset\",\n value: function setOffset() {\n if (this.note) {\n var offset = this.annotation.offset;\n this.note.attr(\"transform\", \"translate(\" + offset.x + \", \" + offset.y + \")\");\n }\n }\n }, {\n key: \"setPositionWithAccessors\",\n value: function setPositionWithAccessors(accessors) {\n if (accessors && this.annotation.data) {\n this.mapX(accessors);\n this.mapY(accessors);\n }\n this.setPosition();\n }\n }, {\n key: \"setClassName\",\n value: function setClassName() {\n this.a.attr(\"class\", \"annotation \" + (this.className && this.className()) + \" \" + (this.editMode ? \"editable\" : \"\") + \" \" + (this.annotation.className || \"\"));\n }\n }, {\n key: \"draw\",\n value: function draw() {\n this.setClassName();\n this.setPosition();\n this.setOffset();\n this.redrawSubject();\n this.redrawConnector();\n this.redrawNote();\n }\n }, {\n key: \"dragstarted\",\n value: function dragstarted() {\n event.sourceEvent.stopPropagation();\n this.dispatcher && this.dispatcher.call(\"dragstart\", this.a, this.annotation);\n this.a.classed(\"dragging\", true);\n this.a.selectAll(\"circle.handle\").style(\"pointer-events\", \"none\");\n }\n }, {\n key: \"dragended\",\n value: function dragended() {\n this.dispatcher && this.dispatcher.call(\"dragend\", this.a, this.annotation);\n this.a.classed(\"dragging\", false);\n this.a.selectAll(\"circle.handle\").style(\"pointer-events\", \"all\");\n }\n }, {\n key: \"dragSubject\",\n value: function dragSubject() {\n var position = this.annotation.position;\n position.x += event.dx;\n position.y += event.dy;\n this.annotation.position = position;\n }\n }, {\n key: \"dragNote\",\n value: function dragNote() {\n var offset = this.annotation.offset;\n offset.x += event.dx;\n offset.y += event.dy;\n this.annotation.offset = offset;\n }\n }, {\n key: \"mapHandles\",\n value: function mapHandles(handles) {\n var _this5 = this;\n\n return handles.map(function (h) {\n return _extends({}, h, {\n start: _this5.dragstarted.bind(_this5),\n end: _this5.dragended.bind(_this5)\n });\n });\n }\n }]);\n return Type;\n}();\n\nvar customType = function customType(initialType, typeSettings, _init) {\n return function (_initialType) {\n inherits(customType, _initialType);\n\n function customType(settings) {\n classCallCheck(this, customType);\n\n var _this6 = possibleConstructorReturn(this, (customType.__proto__ || Object.getPrototypeOf(customType)).call(this, settings));\n\n _this6.typeSettings = typeSettings;\n\n if (typeSettings.disable) {\n typeSettings.disable.forEach(function (d) {\n _this6[d] && _this6[d].remove();\n\n _this6[d] = undefined;\n if (d === \"note\") {\n _this6.noteContent = undefined;\n }\n });\n }\n return _this6;\n }\n\n createClass(customType, [{\n key: \"className\",\n value: function className() {\n return \"\" + (typeSettings.className || get(customType.prototype.__proto__ || Object.getPrototypeOf(customType.prototype), \"className\", this) && get(customType.prototype.__proto__ || Object.getPrototypeOf(customType.prototype), \"className\", this).call(this) || \"\");\n }\n }, {\n key: \"drawSubject\",\n value: function drawSubject(context) {\n this.typeSettings.subject = _extends({}, typeSettings.subject, this.typeSettings.subject);\n return get(customType.prototype.__proto__ || Object.getPrototypeOf(customType.prototype), \"drawSubject\", this).call(this, _extends({}, context, this.typeSettings.subject));\n }\n }, {\n key: \"drawConnector\",\n value: function drawConnector(context) {\n this.typeSettings.connector = _extends({}, typeSettings.connector, this.typeSettings.connector);\n return get(customType.prototype.__proto__ || Object.getPrototypeOf(customType.prototype), \"drawConnector\", this).call(this, _extends({}, context, typeSettings.connector, this.typeSettings.connector));\n }\n }, {\n key: \"drawNote\",\n value: function drawNote(context) {\n this.typeSettings.note = _extends({}, typeSettings.note, this.typeSettings.note);\n return get(customType.prototype.__proto__ || Object.getPrototypeOf(customType.prototype), \"drawNote\", this).call(this, _extends({}, context, typeSettings.note, this.typeSettings.note));\n }\n }, {\n key: \"drawNoteContent\",\n value: function drawNoteContent(context) {\n return get(customType.prototype.__proto__ || Object.getPrototypeOf(customType.prototype), \"drawNoteContent\", this).call(this, _extends({}, context, typeSettings.note, this.typeSettings.note));\n }\n }], [{\n key: \"init\",\n value: function init(annotation, accessors) {\n get(customType.__proto__ || Object.getPrototypeOf(customType), \"init\", this).call(this, annotation, accessors);\n if (_init) {\n annotation = _init(annotation, accessors);\n }\n return annotation;\n }\n }]);\n return customType;\n }(initialType);\n};\n\nvar d3NoteText = function (_Type) {\n inherits(d3NoteText, _Type);\n\n function d3NoteText(params) {\n classCallCheck(this, d3NoteText);\n\n var _this7 = possibleConstructorReturn(this, (d3NoteText.__proto__ || Object.getPrototypeOf(d3NoteText)).call(this, params));\n\n _this7.textWrap = params.textWrap || 120;\n _this7.drawText();\n return _this7;\n }\n\n createClass(d3NoteText, [{\n key: \"updateTextWrap\",\n value: function updateTextWrap(textWrap) {\n this.textWrap = textWrap;\n this.drawText();\n }\n\n //TODO: add update text functionality\n\n }, {\n key: \"drawText\",\n value: function drawText() {\n if (this.note) {\n newWithClass(this.note, [this.annotation], \"g\", \"annotation-note-content\");\n\n var noteContent = this.note.select(\"g.annotation-note-content\");\n newWithClass(noteContent, [this.annotation], \"rect\", \"annotation-note-bg\");\n newWithClass(noteContent, [this.annotation], \"text\", \"annotation-note-label\");\n newWithClass(noteContent, [this.annotation], \"text\", \"annotation-note-title\");\n\n var titleBBox = { height: 0 };\n var label = this.a.select(\"text.annotation-note-label\");\n var wrapLength = this.annotation.note && this.annotation.note.wrap || this.typeSettings && this.typeSettings.note && this.typeSettings.note.wrap || this.textWrap;\n\n var wrapSplitter = this.annotation.note && this.annotation.note.wrapSplitter || this.typeSettings && this.typeSettings.note && this.typeSettings.note.wrapSplitter;\n\n var bgPadding = this.annotation.note && this.annotation.note.bgPadding || this.typeSettings && this.typeSettings.note && this.typeSettings.note.bgPadding;\n\n var bgPaddingFinal = { top: 0, bottom: 0, left: 0, right: 0 };\n if (typeof bgPadding === \"number\") {\n bgPaddingFinal = {\n top: bgPadding,\n bottom: bgPadding,\n left: bgPadding,\n right: bgPadding\n };\n } else if (bgPadding && (typeof bgPadding === \"undefined\" ? \"undefined\" : _typeof(bgPadding)) === \"object\") {\n bgPaddingFinal = _extends(bgPaddingFinal, bgPadding);\n }\n\n if (this.annotation.note.title) {\n var title = this.a.select(\"text.annotation-note-title\");\n title.text(this.annotation.note.title);\n title.attr(\"fill\", this.annotation.color);\n title.attr(\"font-weight\", \"bold\");\n title.call(wrap, wrapLength, wrapSplitter);\n titleBBox = title.node().getBBox();\n }\n\n label.text(this.annotation.note.label).attr(\"dx\", \"0\");\n label.call(wrap, wrapLength, wrapSplitter);\n\n label.attr(\"y\", titleBBox.height * 1.1 || 0);\n label.attr(\"fill\", this.annotation.color);\n\n var bbox = this.getNoteBBox();\n\n this.a.select(\"rect.annotation-note-bg\").attr(\"width\", bbox.width + bgPaddingFinal.left + bgPaddingFinal.right).attr(\"height\", bbox.height + bgPaddingFinal.top + bgPaddingFinal.bottom).attr(\"x\", bbox.x - bgPaddingFinal.left).attr(\"y\", -bgPaddingFinal.top).attr(\"fill\", \"white\").attr(\"fill-opacity\", 0);\n }\n }\n }]);\n return d3NoteText;\n}(Type);\n\nvar d3Label = customType(d3NoteText, {\n className: \"label\",\n note: { align: \"middle\" }\n});\n\nvar d3Callout = customType(d3NoteText, {\n className: \"callout\",\n note: { lineType: \"horizontal\" }\n});\n\nvar d3CalloutElbow = customType(d3Callout, {\n className: \"callout elbow\",\n connector: { type: \"elbow\" }\n});\n\nvar d3CalloutCurve = customType(d3Callout, {\n className: \"callout curve\",\n connector: { type: \"curve\" }\n});\n\nvar d3Badge = customType(Type, {\n className: \"badge\",\n subject: { type: \"badge\" },\n disable: [\"connector\", \"note\"]\n});\n\nvar d3CalloutCircle = customType(d3NoteText, {\n className: \"callout circle\",\n subject: { type: \"circle\" },\n note: { lineType: \"horizontal\" },\n connector: { type: \"elbow\" }\n});\n\nvar d3CalloutRect = customType(d3NoteText, {\n className: \"callout rect\",\n subject: { type: \"rect\" },\n note: { lineType: \"horizontal\" },\n connector: { type: \"elbow\" }\n});\n\nvar ThresholdMap = function (_d3Callout) {\n inherits(ThresholdMap, _d3Callout);\n\n function ThresholdMap() {\n classCallCheck(this, ThresholdMap);\n return possibleConstructorReturn(this, (ThresholdMap.__proto__ || Object.getPrototypeOf(ThresholdMap)).apply(this, arguments));\n }\n\n createClass(ThresholdMap, [{\n key: \"mapY\",\n value: function mapY(accessors) {\n get(ThresholdMap.prototype.__proto__ || Object.getPrototypeOf(ThresholdMap.prototype), \"mapY\", this).call(this, accessors);\n var a = this.annotation;\n if ((a.subject.x1 || a.subject.x2) && a.data && accessors.y) {\n a.y = accessors.y(a.data);\n }\n if ((a.subject.x1 || a.subject.x2) && !a.x) {\n a.x = a.subject.x1 || a.subject.x2;\n }\n }\n }, {\n key: \"mapX\",\n value: function mapX(accessors) {\n get(ThresholdMap.prototype.__proto__ || Object.getPrototypeOf(ThresholdMap.prototype), \"mapX\", this).call(this, accessors);\n var a = this.annotation;\n if ((a.subject.y1 || a.subject.y2) && a.data && accessors.x) {\n a.x = accessors.x(a.data);\n }\n if ((a.subject.y1 || a.subject.y2) && !a.y) {\n a.y = a.subject.y1 || a.subject.y2;\n }\n }\n }]);\n return ThresholdMap;\n}(d3Callout);\n\nvar d3XYThreshold = customType(ThresholdMap, {\n className: \"callout xythreshold\",\n subject: { type: \"threshold\" }\n});\n\nvar newWithClass = function newWithClass(a, d, type, className, classID) {\n var group = a.selectAll(type + \".\" + (classID || className)).data(d);\n group.enter().append(type).merge(group).attr(\"class\", className);\n\n group.exit().remove();\n return a;\n};\n\nvar addHandlers = function addHandlers(dispatcher, annotation, _ref3) {\n var component = _ref3.component,\n name = _ref3.name;\n\n if (component) {\n component.on(\"mouseover.annotations\", function () {\n dispatcher.call(name + \"over\", component, annotation);\n }).on(\"mouseout.annotations\", function () {\n return dispatcher.call(name + \"out\", component, annotation);\n }).on(\"click.annotations\", function () {\n return dispatcher.call(name + \"click\", component, annotation);\n });\n }\n};\n\n//Text wrapping code adapted from Mike Bostock\nvar wrap = function wrap(text, width, wrapSplitter) {\n var lineHeight = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1.2;\n\n text.each(function () {\n var text = select(this),\n words = text.text().split(wrapSplitter || /[ \\t\\r\\n]+/).reverse().filter(function (w) {\n return w !== \"\";\n });\n var word = void 0,\n line$$1 = [],\n tspan = text.text(null).append(\"tspan\").attr(\"x\", 0).attr(\"dy\", 0.8 + \"em\");\n\n while (word = words.pop()) {\n line$$1.push(word);\n tspan.text(line$$1.join(\" \"));\n if (tspan.node().getComputedTextLength() > width && line$$1.length > 1) {\n line$$1.pop();\n tspan.text(line$$1.join(\" \"));\n line$$1 = [word];\n tspan = text.append(\"tspan\").attr(\"x\", 0).attr(\"dy\", lineHeight + \"em\").text(word);\n }\n }\n });\n};\n\nvar bboxWithoutHandles = function bboxWithoutHandles(selection) {\n var selector = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : \":not(.handle)\";\n\n if (!selection) {\n return { x: 0, y: 0, width: 0, height: 0 };\n }\n\n return selection.selectAll(selector).nodes().reduce(function (p, c) {\n var bbox = c.getBBox();\n p.x = Math.min(p.x, bbox.x);\n p.y = Math.min(p.y, bbox.y);\n p.width = Math.max(p.width, bbox.width);\n\n var yOffset = c && c.attributes && c.attributes.y;\n p.height = Math.max(p.height, (yOffset && parseFloat(yOffset.value) || 0) + bbox.height);\n return p;\n }, { x: 0, y: 0, width: 0, height: 0 });\n};\n\nfunction annotation() {\n var annotations = [],\n collection = void 0,\n context = void 0,\n //TODO: add canvas functionality\n disable = [],\n accessors = {},\n accessorsInverse = {},\n editMode = false,\n ids = void 0,\n type = d3Callout,\n textWrap = void 0,\n notePadding = void 0,\n annotationDispatcher = dispatch(\"subjectover\", \"subjectout\", \"subjectclick\", \"connectorover\", \"connectorout\", \"connectorclick\", \"noteover\", \"noteout\", \"noteclick\", \"dragend\", \"dragstart\"),\n sel = void 0;\n\n var annotation = function annotation(selection) {\n sel = selection;\n //TODO: check to see if this is still needed\n if (!editMode) {\n selection.selectAll(\"circle.handle\").remove();\n }\n\n var translatedAnnotations = annotations.map(function (a) {\n if (!a.type) {\n a.type = type;\n }\n if (!a.disable) {\n a.disable = disable;\n }\n return new Annotation(a);\n });\n\n collection = collection || new AnnotationCollection({\n annotations: translatedAnnotations,\n accessors: accessors,\n accessorsInverse: accessorsInverse,\n ids: ids\n });\n\n var annotationG = selection.selectAll(\"g\").data([collection]);\n annotationG.enter().append(\"g\").attr(\"class\", \"annotations\");\n\n var group = selection.select(\"g.annotations\");\n newWithClass(group, collection.annotations, \"g\", \"annotation\");\n\n var annotation = group.selectAll(\"g.annotation\");\n\n annotation.each(function (d) {\n var a = select(this);\n\n a.attr(\"class\", \"annotation\");\n\n newWithClass(a, [d], \"g\", \"annotation-connector\");\n newWithClass(a, [d], \"g\", \"annotation-subject\");\n newWithClass(a, [d], \"g\", \"annotation-note\");\n newWithClass(a.select(\"g.annotation-note\"), [d], \"g\", \"annotation-note-content\");\n d.type = d.type.toString() === \"[object Object]\" ? d.type : new d.type({\n a: a,\n annotation: d,\n textWrap: textWrap,\n notePadding: notePadding,\n editMode: editMode,\n dispatcher: annotationDispatcher,\n accessors: accessors\n });\n d.type.draw();\n d.type.drawText && d.type.drawText();\n });\n };\n\n annotation.json = function () {\n /* eslint-disable no-console */\n console.log(\"Annotations JSON was copied to your clipboard. Please note the annotation type is not JSON compatible. It appears in the objects array in the console, but not in the copied JSON.\", collection.json);\n /* eslint-enable no-console */\n window.copy(JSON.stringify(collection.json.map(function (a) {\n delete a.type;\n return a;\n })));\n return annotation;\n };\n\n annotation.update = function () {\n if (annotations && collection) {\n annotations = collection.annotations.map(function (a) {\n a.type.draw();\n return a;\n });\n }\n return annotation;\n };\n\n annotation.updateText = function () {\n if (collection) {\n collection.updateText(textWrap);\n annotations = collection.annotations;\n }\n return annotation;\n };\n\n annotation.updatedAccessors = function () {\n collection.setPositionWithAccessors();\n annotations = collection.annotations;\n return annotation;\n };\n\n annotation.disable = function (_) {\n if (!arguments.length) return disable;\n disable = _;\n if (collection) {\n collection.updateDisable(disable);\n annotations = collection.annotations;\n }\n return annotation;\n };\n\n annotation.textWrap = function (_) {\n if (!arguments.length) return textWrap;\n textWrap = _;\n if (collection) {\n collection.updateTextWrap(textWrap);\n annotations = collection.annotations;\n }\n return annotation;\n };\n\n annotation.notePadding = function (_) {\n if (!arguments.length) return notePadding;\n notePadding = _;\n if (collection) {\n collection.updateNotePadding(notePadding);\n annotations = collection.annotations;\n }\n return annotation;\n };\n //todo think of how to handle when undefined is sent\n annotation.type = function (_, settings) {\n if (!arguments.length) return type;\n type = _;\n if (collection) {\n collection.annotations.map(function (a) {\n a.type.note && a.type.note.selectAll(\"*:not(.annotation-note-content)\").remove();\n a.type.noteContent && a.type.noteContent.selectAll(\"*\").remove();\n a.type.subject && a.type.subject.selectAll(\"*\").remove();\n a.type.connector && a.type.connector.selectAll(\"*\").remove();\n a.type.typeSettings = {};\n a.type = type;\n\n a.subject = settings && settings.subject || a.subject;\n a.connector = settings && settings.connector || a.connector;\n a.note = settings && settings.note || a.note;\n });\n\n annotations = collection.annotations;\n }\n return annotation;\n };\n\n annotation.annotations = function (_) {\n if (!arguments.length) return collection && collection.annotations || annotations;\n annotations = _;\n\n if (collection && collection.annotations) {\n var rerun = annotations.some(function (d) {\n return !d.type || d.type.toString() !== \"[object Object]\";\n });\n\n if (rerun) {\n collection = null;\n annotation(sel);\n } else {\n collection.annotations = annotations;\n }\n }\n return annotation;\n };\n\n annotation.context = function (_) {\n if (!arguments.length) return context;\n context = _;\n return annotation;\n };\n\n annotation.accessors = function (_) {\n if (!arguments.length) return accessors;\n accessors = _;\n return annotation;\n };\n\n annotation.accessorsInverse = function (_) {\n if (!arguments.length) return accessorsInverse;\n accessorsInverse = _;\n return annotation;\n };\n\n annotation.ids = function (_) {\n if (!arguments.length) return ids;\n ids = _;\n return annotation;\n };\n\n annotation.editMode = function (_) {\n if (!arguments.length) return editMode;\n editMode = _;\n\n if (sel) {\n sel.selectAll(\"g.annotation\").classed(\"editable\", editMode);\n }\n\n if (collection) {\n collection.editMode(editMode);\n annotations = collection.annotations;\n }\n return annotation;\n };\n\n annotation.collection = function (_) {\n if (!arguments.length) return collection;\n collection = _;\n return annotation;\n };\n\n annotation.on = function () {\n var value = annotationDispatcher.on.apply(annotationDispatcher, arguments);\n return value === annotationDispatcher ? annotation : value;\n };\n\n return annotation;\n}\n\nvar index = {\n annotation: annotation,\n annotationTypeBase: Type,\n annotationLabel: d3Label,\n annotationCallout: d3Callout,\n annotationCalloutCurve: d3CalloutCurve,\n annotationCalloutElbow: d3CalloutElbow,\n annotationCalloutCircle: d3CalloutCircle,\n annotationCalloutRect: d3CalloutRect,\n annotationXYThreshold: d3XYThreshold,\n annotationBadge: d3Badge,\n annotationCustomType: customType\n};\n\nexport { annotation, Type as annotationTypeBase, d3Label as annotationLabel, d3Callout as annotationCallout, d3CalloutCurve as annotationCalloutCurve, d3CalloutElbow as annotationCalloutElbow, d3CalloutCircle as annotationCalloutCircle, d3CalloutRect as annotationCalloutRect, d3XYThreshold as annotationXYThreshold, d3Badge as annotationBadge, customType as annotationCustomType };export default index;\n//# sourceMappingURL=indexRollupNext.js.map\n","import { SVGWidget } from \"@hpcc-js/common\";\nimport { format as d3Format } from \"d3-format\";\nimport { interpolate as d3Interpolate, interpolateHcl as d3InterpolateHcl } from \"d3-interpolate\";\nimport { scaleLinear } from \"d3-scale\";\nimport { Arc, arc as d3Arc, DefaultArcObject } from \"d3-shape\";\nimport { annotation as d3Annotation, annotationCalloutElbow } from \"d3-svg-annotation\";\n\nfunction value2Angle(value: number): number {\n return (value - 0.5) * .65 * 2 * Math.PI;\n}\n\nfunction pointOnArc(angle: number, radius: number): { x: number, y: number } {\n return {\n x: Math.cos(angle - Math.PI / 2) * radius,\n y: Math.sin(angle - Math.PI / 2) * radius\n };\n}\n\nfunction indicatorTranslate(angle: number, radius: number, inner: boolean = false) {\n const point = pointOnArc(angle, radius);\n const rotation = angle * 180 / Math.PI + (inner === true ? 180 : 0);\n return `translate(${point.x}, ${point.y}) rotate(${rotation})`;\n}\n\ntype IndicatorDatum = { angle: number };\nfunction indicatorTween(newAngle: number, radius: number, inner: boolean = false) {\n return function (d: IndicatorDatum) {\n const interpolate = d3Interpolate(d.angle, newAngle);\n d.angle = newAngle;\n return function (t: number) {\n return indicatorTranslate(interpolate(t), radius, inner);\n };\n };\n}\n\nfunction arcTween(startAngle: number, endAngle: number, arc: Arc<any, DefaultArcObject>) {\n return function (d: DefaultArcObject) {\n const startInterpolate = d3Interpolate(d.startAngle, startAngle);\n const endInterpolate = d3Interpolate(d.endAngle, endAngle);\n return function (t: number): string {\n d.startAngle = startInterpolate(t);\n d.endAngle = endInterpolate(t);\n return arc(d)!;\n };\n };\n}\n\nexport class Gauge extends SVGWidget {\n\n private _d3Arc: Arc<any, DefaultArcObject> = d3Arc()\n .innerRadius(85)\n .outerRadius(100)\n ;\n private _colorScale = scaleLinear<string, string>()\n .interpolate(d3InterpolateHcl)\n ;\n\n protected _usageArc: any;\n protected _meanArc: any;\n protected _freeArc: any;\n protected _indInner: any;\n protected _indOuter: any;\n protected _centerTextG: any;\n protected _centerText: any;\n protected _bottomText: any;\n protected _tooltipG: any;\n protected _mainTooltip: any;\n\n constructor() {\n super();\n }\n\n protected tip(d: any) {\n if (d === null || d.label === \"\") {\n this._tooltipG\n .transition()\n .style(\"opacity\", 0)\n .on(\"interrupt end\", () => {\n this._tooltipG\n .selectAll(\"g\")\n .remove()\n ;\n })\n ;\n } else {\n this._tooltipG\n .interrupt()\n .style(\"opacity\", 1)\n ;\n d.w = (this._centerText.datum() as any).w + 10;\n let lineType = \"horizontal\";\n let xOffset = 0;\n let yOffset = 5;\n let padding: number | undefined = 5;\n if (d.y >= 5 && d.y <= 25) {\n xOffset = d.x < 0 ? -d.w / 2 : d.w / 2;\n yOffset = 12.5;\n padding = undefined;\n lineType = \"vertical\";\n } else if (d.y > 25) {\n yOffset = 25;\n padding = 0;\n }\n const annotationtip = d3Annotation()\n .type(annotationCalloutElbow)\n .annotations([{\n data: d,\n dx: -d.x + xOffset,\n dy: -d.y + yOffset,\n color: \"black\",\n note: {\n label: d.label,\n lineType,\n padding,\n align: \"middle\"\n }\n }])\n .accessors({ x: (d2: any) => d2.x, y: (d2: any) => d2.y });\n this._tooltipG.call(annotationtip as any);\n }\n }\n\n protected calcSize(textElement, width: number, height: number): { width: number, height: number, scale: number } {\n const bb = (textElement.node() as any).getBBox();\n const widthTransform = width / bb.width;\n const heightTransform = height / bb.height;\n const scale = widthTransform < heightTransform ? widthTransform : heightTransform;\n return {\n width: bb.width,\n height: bb.height,\n scale\n };\n }\n\n protected updateText(textElement, x: number, y: number, w: number, h: number) {\n textElement\n .datum({ x, y, w, h })\n .attr(\"transform\", null)\n ;\n const size = this.calcSize(textElement, w, h);\n const x2 = x + w / 2 - size.width / 2 * size.scale;\n const y2 = y + h / 2 - size.height / 2 * size.scale;\n textElement.attr(\"transform\", `translate(${x2}, ${y2}) scale(${size.scale})`);\n }\n\n calcWidth(): number {\n return Math.min(this.width(), this.height(), this.maxDiameter());\n }\n\n enter(domNode: HTMLElement, element) {\n super.enter(domNode, element);\n\n element.on(\"click\", (d: Gauge) => {\n this.click(d);\n });\n\n this._usageArc = element.append(\"path\").datum({ startAngle: value2Angle(0), endAngle: value2Angle(0) })\n .style(\"fill\", \"green\")\n .on(\"mousemove\", (d: any) => {\n const [x, y] = this._d3Arc.centroid(d);\n this.tip({ x, y, label: this.valueDescription() });\n })\n .on(\"mouseout\", (d: any) => {\n this.tip(null);\n })\n ;\n this._freeArc = element.append(\"path\").datum({ startAngle: value2Angle(0), endAngle: value2Angle(1) })\n .style(\"fill\", \"lightGrey\")\n ;\n this._meanArc = element.append(\"path\").datum({ startAngle: value2Angle(0), endAngle: value2Angle(0) })\n .style(\"fill\", \"black\")\n .on(\"mousemove\", (d: any) => {\n const [x, y] = this._d3Arc.centroid(d);\n this.tip({ x, y, label: this.tickValueDescription() });\n })\n .on(\"mouseout\", (d: any) => {\n this.tip(null);\n })\n ;\n\n this._mainTooltip = element.append(\"title\");\n\n const context = this;\n function appendIndicator() {\n return element.append(\"path\").datum({ angle: value2Angle(0) })\n .style(\"fill\", \"black\")\n .style(\"stroke\", \"black\")\n .attr(\"d\", \"M 0 0 l -3 -3 l 6 0 z\")\n .on(\"mousemove\", (d: any) => {\n const [x, y] = context._d3Arc.centroid(context._meanArc.datum() as any);\n context.tip({ x, y, label: context.tickValueDescription() });\n })\n .on(\"mouseout\", (d: any) => {\n context.tip(null);\n })\n ;\n }\n this._indInner = appendIndicator();\n this._indOuter = appendIndicator();\n this._centerText = element.append(\"text\")\n .attr(\"dy\", \".66em\")\n .style(\"fill\", \"green\")\n .on(\"mousemove\", (d: any) => {\n this.tip({ x: 0, y: 0, label: this.valueDescription() });\n })\n .on(\"mouseout\", (d: any) => {\n this.tip(null);\n })\n ;\n this._bottomText = element.append(\"text\")\n .attr(\"dy\", \".66em\")\n .on(\"mousemove\", (d: any) => {\n this.tip({ x: 0, y: d.y, label: this.titleDescription() });\n })\n .on(\"mouseout\", (d: any) => {\n this.tip(null);\n })\n ;\n\n this._tooltipG = element.append(\"g\")\n .attr(\"class\", \"annotation-tip\")\n ;\n }\n\n update(domNode: HTMLElement, element) {\n super.update(domNode, element);\n\n this._colorScale\n .domain(this.colorDomain())\n .range(this.colorRange())\n ;\n element\n .attr(\"title\", this.tooltip())\n .style(\"cursor\", this.click !== Gauge.prototype.click ? \"pointer\" : null)\n ;\n\n const innerRadius = this.calcWidth() / 3;\n const outerRadius = this.calcWidth() / 2 - 5;\n this._d3Arc\n .innerRadius(innerRadius)\n .outerRadius(outerRadius)\n ;\n\n const val = this.value();\n const tickVal = this.tickValue();\n\n this._usageArc\n .style(\"fill\", this._colorScale(val))\n .transition()\n .duration(750)\n .attrTween(\"d\", arcTween(value2Angle(0), value2Angle(val), this._d3Arc))\n ;\n\n this._freeArc\n .style(\"fill\", this.emptyColor())\n .transition()\n .duration(750)\n .attrTween(\"d\", arcTween(value2Angle(val), value2Angle(1), this._d3Arc))\n ;\n\n this._meanArc\n .style(\"fill\", this.tickColor())\n .style(\"visibility\", this.showTick() ? \"visible\" : \"hidden\")\n .transition()\n .duration(750)\n .attrTween(\"d\", arcTween(value2Angle(tickVal - 0.001), value2Angle(tickVal + 0.001), this._d3Arc))\n ;\n\n this._indInner\n .style(\"fill\", this.tickColor())\n .style(\"stroke\", this.tickColor())\n .style(\"visibility\", this.showTick() ? \"visible\" : \"hidden\")\n .transition()\n .duration(750)\n .attrTween(\"transform\", indicatorTween(value2Angle(tickVal), innerRadius, true))\n ;\n\n this._indOuter\n .style(\"fill\", this.tickColor())\n .style(\"stroke\", this.tickColor())\n .style(\"visibility\", this.showTick() ? \"visible\" : \"hidden\")\n .transition()\n .duration(750)\n .attrTween(\"transform\", indicatorTween(value2Angle(tickVal), outerRadius))\n ;\n\n this._centerText\n .style(\"fill\", this._colorScale(val))\n .text(d3Format(\".0%\")(val))\n ;\n\n this._bottomText\n .style(\"fill\", this.click !== Gauge.prototype.click ? this.titleClickColor() : this.titleColor())\n .style(\"text-decoration\", this.click !== Gauge.prototype.click ? \"underline\" : null)\n .text(this.title())\n ;\n\n // Update Text ---\n const point = pointOnArc(value2Angle(1), innerRadius - 8);\n this.updateText(this._centerText, -point.x, -point.y, 2 * point.x, 2 * point.y);\n\n const point2 = pointOnArc(value2Angle(1), outerRadius);\n point2.y += 5;\n const width = this.calcWidth() - 20;\n const height = this.calcWidth() / 2 - point2.y - 5;\n this.updateText(this._bottomText, -width / 2, point2.y, width, height);\n\n this._mainTooltip.text(this.tooltip());\n }\n\n // Events ---\n click(w: Gauge) {\n }\n}\nGauge.prototype._class += \" chart_Gauge\";\n\nexport interface Gauge {\n title(): string;\n title(_: string): this;\n titleDescription(): string;\n titleDescription(_: string): this;\n titleColor(): string;\n titleColor(_: string): this;\n titleClickColor(): string;\n titleClickColor(_: string): this;\n\n maxDiameter(): number;\n maxDiameter(_: number): this;\n value(): number;\n value(_: number): this;\n valueDescription(): string;\n valueDescription(_: string): this;\n showTick(): boolean;\n showTick(_: boolean): this;\n tickValue(): number;\n tickValue(_: number): this;\n tickValueDescription(): string;\n tickValueDescription(_: string): this;\n tooltip(): string;\n tooltip(_: string): this;\n\n tickColor(): string;\n tickColor(_: string): this;\n emptyColor(): string;\n emptyColor(_: string): this;\n colorDomain(): number[];\n colorDomain(_: number[]): this;\n colorRange(): string[];\n colorRange(_: string[]): this;\n}\n\nGauge.prototype.publish(\"title\", \"\", \"string\", \"Title\");\nGauge.prototype.publish(\"titleDescription\", \"\", \"string\", \"Title Description\");\nGauge.prototype.publish(\"titleColor\", \"black\", \"html-color\", \"Color of the title text\");\nGauge.prototype.publish(\"titleClickColor\", \"blue\", \"html-color\", \"Color of the title text when clickable\");\n\nGauge.prototype.publish(\"maxDiameter\", 128, \"number\", \"Max Diameter\");\nGauge.prototype.publish(\"value\", 0, \"number\", \"Value\");\nGauge.prototype.publish(\"valueDescription\", \"\", \"string\", \"Value Description\");\nGauge.prototype.publish(\"showTick\", false, \"boolean\", \"Show Tick\");\nGauge.prototype.publish(\"tickValue\", 0, \"number\", \"Tick Value\");\nGauge.prototype.publish(\"tickValueDescription\", \"\", \"string\", \"Tick Value Description\");\nGauge.prototype.publish(\"tooltip\", \"\", \"string\", \"Tooltip\");\n\nGauge.prototype.publish(\"colorRange\", [\"green\", \"green\", \"green\", \"green\", \"green\", \"green\", \"green\", \"green\", \"orange\", \"red\", \"red\"], \"array\", \"Array of colors for the filled gauge portion. The fill color will be relative to the gauge value.\");\nGauge.prototype.publish(\"colorDomain\", [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1], \"array\", \"This array augments the mapping of the value to the fill colorRange.\");\nGauge.prototype.publish(\"emptyColor\", \"lightgrey\", \"html-color\", \"Color of the empty portion of the gauge\");\nGauge.prototype.publish(\"tickColor\", \"black\", \"html-color\", \"Color of the tick\");\n","import { I2DChart, ITooltip } from \"@hpcc-js/api\";\nimport { InputField, SVGWidget, Utility } from \"@hpcc-js/common\";\nimport { degreesToRadians, normalizeRadians } from \"@hpcc-js/util\";\nimport { format as d3Format } from \"d3-format\";\nimport { interpolate as d3Interpolate } from \"d3-interpolate\";\nimport { select as d3Select } from \"d3-selection\";\nimport { arc as d3Arc, pie as d3Pie } from \"d3-shape\";\n\nimport \"../src/Pie.css\";\n\nconst sortAscending = (a, b) => a[1] - b[1] > 0 ? 1 : -1;\nconst sortDescending = (a, b) => a[1] - b[1] > 0 ? -1 : 1;\n\nexport class Pie extends SVGWidget {\n static __inputs: InputField[] = [{\n id: \"label\",\n type: \"string\"\n }, {\n id: \"value\",\n type: \"number\"\n }];\n\n protected _totalValue: number;\n\n d3Pie;\n d3Arc;\n d3LabelArc;\n private _labelPositions;\n private _smallValueLabelHeight;\n private _labelWidthLimit: number;\n private _quadIdxArr;\n private _minLabelTop = 0;\n private _maxLabelBottom = 0;\n private _seriesValueFormatter;\n private _seriesPercentageFormatter;\n constructor() {\n super();\n I2DChart.call(this);\n ITooltip.call(this);\n Utility.SimpleSelectionMixin.call(this);\n\n this.d3Pie = d3Pie();\n\n this.d3Arc = d3Arc();\n this.d3LabelArc = d3Arc();\n this\n .tooltipTick_default(false)\n .tooltipOffset_default(0)\n ;\n }\n\n intersection(pointA, pointB) {\n return this.intersectCircle(this.calcOuterRadius(), pointA, pointB);\n }\n\n calcInnerRadius() {\n return this.innerRadius_exists() ? this.calcOuterRadius() * (this.innerRadius() as number) / 100 : 0;\n }\n\n calcOuterRadius() {\n const maxTextWidth = this.textSize(this.data().map(d => this.getLabelText({ data: d }, false)), \"Verdana\", 12).width;\n const horizontalLimit = this._size.width - (this.showLabels() ? maxTextWidth * 2 : 0) - 20;\n const verticalLimit = this._size.height - 12 * 3 - (this.showLabels() ? this._smallValueLabelHeight : 0);\n const outerRadius = Math.min(horizontalLimit, verticalLimit) / 2 - 2;\n if ((horizontalLimit / 2) - 2 < this.minOuterRadius()) {\n this._labelWidthLimit = maxTextWidth - (this.minOuterRadius() - ((horizontalLimit / 2) - 2));\n } else {\n this._labelWidthLimit = maxTextWidth;\n }\n if (outerRadius < this.minOuterRadius()) {\n return this.minOuterRadius();\n }\n return outerRadius;\n }\n\n calcSmallValueLabelHeight() {\n const smallDef = 0.1;\n const totalVal = this.data().reduce((acc, n) => acc + n[1], 0);\n let smallCount = 0;\n this.data().forEach(row => {\n if (row[1] / totalVal < smallDef) {\n smallCount++;\n }\n });\n return this.labelHeight() * smallCount;\n }\n\n calcTotalValue(): number {\n return this.data().reduce((acc, d) => {\n return acc + d[1];\n }, 0);\n }\n\n getLabelText(d, truncate?) {\n let len;\n let label = d.data[0];\n if (typeof this._labelWidthLimit !== \"undefined\" && truncate) {\n const labelWidth = this.textSize(label, \"Verdana\", this.labelHeight()).width;\n if (this._labelWidthLimit < labelWidth) {\n len = label.length * (this._labelWidthLimit / labelWidth) - 3;\n label = len < label.length ? label.slice(0, len) + \"...\" : label;\n }\n }\n if (this.showSeriesValue()) {\n label += ` : ${this._seriesValueFormatter(d.data[1])}`;\n }\n if (this.showSeriesPercentage()) {\n let sum = this._totalValue;\n const dm = this.dataMeta();\n if (typeof dm.sum !== \"undefined\") {\n sum = dm.sum;\n }\n const perc = (d.data[1] / sum) * 100;\n label += ` : ${this._seriesPercentageFormatter(perc)}%`;\n }\n return label;\n }\n\n selection(): any[]; // any[] === single row\n selection(_: any[]): this;\n selection(_?: any[]): any[] | this {\n if (!arguments.length) {\n try {\n return this._selection.selection2()[0]?.data;\n } catch (e) {\n return undefined;\n }\n }\n // Stringify to enable a deep equal\n const strRow = JSON.stringify(_);\n this._selection.selection2(d => strRow === JSON.stringify(d.data));\n }\n\n selectByLabel(_: string) {\n const row = this.data().filter(row => row[0] === _)[0];\n if (row) {\n this.selection(row);\n }\n }\n\n _slices;\n _labels;\n enter(_domNode, element) {\n super.enter(_domNode, element);\n this._selection.widgetElement(element);\n this._slices = element.append(\"g\");\n this._labels = element.append(\"g\");\n const context = this;\n this\n .tooltipHTML(function (d) {\n switch (context.tooltipStyle()) {\n case \"series-table\":\n return context.tooltipFormat({\n label: d.data[0],\n arr: context.columns().slice(1).map(function (column, i) {\n return {\n label: column,\n color: context._palette(d.data[0]),\n value: d.data[i + 1]\n };\n })\n });\n default:\n return context.tooltipFormat({ label: d.data[0], value: d.data[1] });\n }\n })\n ;\n }\n\n update(_domNode, element) {\n super.update(_domNode, element);\n const context = this;\n this.updateD3Pie();\n this._palette = this._palette.switch(this.paletteID());\n this._seriesValueFormatter = d3Format(this.seriesValueFormat() as string);\n this._seriesPercentageFormatter = d3Format(this.seriesPercentageFormat() as string);\n if (this.useClonedPalette()) {\n this._palette = this._palette.cloneNotExists(this.paletteID() + \"_\" + this.id());\n }\n this._smallValueLabelHeight = this.calcSmallValueLabelHeight();\n this._totalValue = this.calcTotalValue();\n const innerRadius = this.calcInnerRadius();\n const outerRadius = this.calcOuterRadius();\n const labelRadius = outerRadius + 12;\n this.d3Arc\n .innerRadius(innerRadius)\n .padRadius(outerRadius)\n .outerRadius(outerRadius)\n ;\n\n this._quadIdxArr = [[], [], [], []];\n const data = [...this.data()];\n switch (this.sortDataByValue()) {\n case \"ascending\":\n data.sort(sortAscending);\n break;\n case \"descending\":\n data.sort(sortDescending);\n break;\n }\n const arc = this._slices.selectAll(\".arc\").data(this.d3Pie(data), d => d.data[0]);\n\n this._labelPositions = [];\n\n // Enter ---\n arc.enter().append(\"g\")\n .attr(\"class\", (d, i) => \"arc series series-\" + this.cssTag(d.data[0]))\n .attr(\"opacity\", 0)\n .call(this._selection.enter.bind(this._selection))\n .on(\"click\", function (d) {\n context.click(context.rowToObj(d.data), context.columns()[1], context._selection.selected(this));\n })\n .on(\"dblclick\", function (d) {\n context.dblclick(context.rowToObj(d.data), context.columns()[1], context._selection.selected(this));\n })\n .each(function (d, i) {\n d3Select(this).append(\"path\")\n .on(\"mouseout.tooltip\", context.tooltip.hide)\n .on(\"mousemove.tooltip\", context.tooltip.show)\n .on(\"mouseover\", arcTween(0, 0))\n .on(\"mouseout\", arcTween(-5, 150))\n ;\n })\n .merge(arc).transition()\n .attr(\"opacity\", 1)\n .each(function (d, i) {\n const quad = context.getQuadrant(midAngle(d));\n context._quadIdxArr[quad].push(i);\n d.outerRadius = outerRadius - 5;\n const element2 = d3Select(this);\n element2.select(\"path\").transition()\n .attr(\"d\", context.d3Arc)\n .style(\"fill\", context.fillColor(d.data, context.columns()[1], d.data[1]))\n ;\n })\n ;\n\n // Exit ---\n arc.exit().transition()\n .style(\"opacity\", 0)\n .remove()\n ;\n // Labels ---\n this.d3LabelArc\n .innerRadius(labelRadius)\n .outerRadius(labelRadius)\n ;\n const text = this._labels.selectAll(\"text\").data(this.showLabels() ? this.d3Pie(data) : [], d => d.data[0]);\n\n const mergedText = text.enter().append(\"text\")\n .on(\"mouseout.tooltip\", context.tooltip.hide)\n .on(\"mousemove.tooltip\", context.tooltip.show)\n .attr(\"dy\", \".5em\")\n .on(\"click\", function (d) {\n context._slices.selectAll(\"g\").filter(function (d2) {\n if (d.data === d2.data) {\n context._selection.click(this);\n context.click(context.rowToObj(d.data), context.columns()[1], context._selection.selected(this));\n }\n });\n })\n .on(\"dblclick\", function (d) {\n context._slices.selectAll(\"g\").filter(function (d2) {\n if (d.data === d2.data) {\n context.dblclick(context.rowToObj(d.data), context.columns()[1], context._selection.selected(this));\n }\n });\n })\n .merge(text)\n .text(d => this.getLabelText(d, true))\n .each(function (d, i) {\n const pos = context.d3LabelArc.centroid(d);\n const mid_angle = midAngle(d);\n pos[0] = labelRadius * (context.isLeftSide(mid_angle) ? 1 : -1);\n context._labelPositions.push({\n top: pos[1],\n bottom: pos[1] + context.labelHeight()\n });\n });\n if (this.showLabels()) {\n this.adjustForOverlap();\n mergedText.transition()\n .style(\"font-size\", this.labelHeight() + \"px\")\n .attr(\"transform\", (d, i) => {\n const pos = context.d3LabelArc.centroid(d);\n pos[0] = labelRadius * (context.isLeftSide(midAngle(d)) ? 1 : -1);\n pos[1] = context._labelPositions[i].top;\n return \"translate(\" + pos + \")\";\n })\n .style(\"text-anchor\", d => this.isLeftSide(midAngle(d)) ? \"start\" : \"end\");\n }\n\n text.exit()\n .remove();\n\n const polyline = this._labels.selectAll(\"polyline\").data(this.showLabels() ? this.d3Pie(data) : [], d => this.getLabelText(d, true));\n\n polyline.enter()\n .append(\"polyline\")\n .merge(polyline).transition()\n .attr(\"points\", function (d, i) {\n const pos = context.d3LabelArc.centroid(d);\n const pos1 = context.d3Arc.centroid(d);\n const pos2 = [...pos];\n pos[0] = labelRadius * (context.isLeftSide(midAngle(d)) ? 1 : -1);\n pos[1] = context._labelPositions[i].top;\n return [pos1, pos2, pos];\n });\n\n polyline.exit()\n .remove();\n\n if (this.showLabels()) {\n this.centerOnLabels();\n }\n function midAngle(d) {\n return d.startAngle + (d.endAngle - d.startAngle) / 2;\n }\n\n function arcTween(outerRadiusDelta, delay) {\n return function () {\n d3Select(this).transition().delay(delay).attrTween(\"d\", function (d: any) {\n const i = d3Interpolate(d.outerRadius, outerRadius + outerRadiusDelta);\n return function (t) { d.outerRadius = i(t); return context.d3Arc(d); };\n });\n };\n }\n }\n\n isLeftSide(midAngle) {\n midAngle = normalizeRadians(midAngle);\n const isLeft = midAngle > Math.PI * 2 ? midAngle : midAngle < Math.PI && midAngle > 0;\n return isLeft;\n }\n\n getQuadrant(radians) {\n let quad = 0;\n const rad = normalizeRadians(radians);\n quad = rad <= Math.PI * 1.0 && rad >= Math.PI * 0.5 ? 3 : quad;\n quad = rad <= Math.PI * 0.5 && rad >= Math.PI * 0.0 ? 2 : quad;\n quad = rad <= Math.PI * 0.0 && rad >= Math.PI * -0.5 ? 1 : quad;\n return quad;\n }\n\n centerOnLabels() {\n const gY = this.pos().y;\n const gY2 = gY * 2;\n const radius = this.calcOuterRadius();\n const top = Math.min(this._minLabelTop, -radius);\n const bottom = Math.max(this._maxLabelBottom, radius);\n const h = bottom - top;\n const heightDiff = gY2 - h;\n const absTop = Math.abs(this._minLabelTop);\n let yShift = 0;\n if (bottom > gY) {\n yShift = gY - bottom + (this.labelHeight() / 2);\n yShift -= heightDiff / 2;\n } else if (top < 0 && absTop > gY) {\n yShift = absTop - gY + (this.labelHeight() / 2);\n yShift += heightDiff / 2;\n }\n const pos = this.pos();\n this.pos({\n y: pos.y + yShift,\n x: pos.x\n });\n }\n\n adjustForOverlap() {\n const labelHeight = this.labelHeight();\n this._quadIdxArr.forEach((arr, quad) => {\n this._quadIdxArr[quad].sort((a, b) => {\n if (quad === 1 || quad === 2) {\n return this._labelPositions[a].top > this._labelPositions[b].top ? -1 : 1;\n } else if (quad === 0 || quad === 3) {\n return this._labelPositions[a].top > this._labelPositions[b].top ? 1 : -1;\n }\n });\n let prevTop;\n this._quadIdxArr[quad].forEach((n, i) => {\n if (i > 0) {\n if (quad === 1 || quad === 2) {\n if (prevTop < this._labelPositions[n].bottom) {\n const overlap = this._labelPositions[n].bottom - prevTop;\n this._labelPositions[n].top -= overlap;\n this._labelPositions[n].bottom -= overlap;\n }\n } else if (quad === 0 || quad === 3) {\n if (prevTop + labelHeight > this._labelPositions[n].top) {\n const overlap = Math.abs(this._labelPositions[n].top) - Math.abs(prevTop + labelHeight);\n this._labelPositions[n].top -= overlap;\n this._labelPositions[n].bottom -= overlap;\n }\n }\n }\n prevTop = this._labelPositions[n].top;\n });\n });\n this._minLabelTop = 0;\n this._maxLabelBottom = 0;\n this._quadIdxArr.forEach((arr, quad) => {\n this._quadIdxArr[quad].forEach((n, i) => {\n if (this._minLabelTop > this._labelPositions[n].top) {\n this._minLabelTop = this._labelPositions[n].top;\n }\n if (this._maxLabelBottom < this._labelPositions[n].bottom) {\n this._maxLabelBottom = this._labelPositions[n].bottom;\n }\n });\n });\n }\n\n exit(domNode, element) {\n super.exit(domNode, element);\n }\n\n updateD3Pie() {\n const startAngle = normalizeRadians(degreesToRadians(this.startAngle()));\n\n switch (this.sortDataByValue()) {\n case \"ascending\":\n this.d3Pie.sort(sortAscending);\n break;\n case \"descending\":\n this.d3Pie.sort(sortDescending);\n break;\n default:\n this.d3Pie.sort(null);\n }\n\n this.d3Pie\n .padAngle(0.0025)\n .startAngle(startAngle)\n .endAngle(2 * Math.PI + startAngle)\n .value(function (d) {\n return d[1];\n })\n ;\n }\n}\nPie.prototype._class += \" chart_Pie\";\nPie.prototype.implements(I2DChart.prototype);\nPie.prototype.implements(ITooltip.prototype);\nPie.prototype.mixin(Utility.SimpleSelectionMixin);\n\nexport interface Pie {\n showSeriesValue(): boolean;\n showSeriesValue(_: boolean): this;\n seriesValueFormat(): string;\n seriesValueFormat(_: string): this;\n showSeriesPercentage(): boolean;\n showSeriesPercentage(_: boolean): this;\n minOuterRadius(): number;\n minOuterRadius(_: number): this;\n startAngle(): number;\n startAngle(_: number): this;\n labelHeight(): number;\n labelHeight(_: number): this;\n seriesPercentageFormat(): string;\n seriesPercentageFormat(_: string): this;\n showLabels(): boolean;\n showLabels(_: boolean): this;\n sortDataByValue(): \"none\" | \"ascending\" | \"descending\";\n sortDataByValue(_: \"none\" | \"ascending\" | \"descending\"): this;\n\n paletteID(_?: string): string | Pie;\n useClonedPalette(_?: boolean): boolean | Pie;\n outerText(_?: boolean): boolean | Pie;\n innerRadius(): number;\n innerRadius_exists(): boolean;\n\n // I2DChart\n _palette;\n fillColor(row: any[], column: string, value: number): string;\n textColor(row: any[], column: string, value: number): string;\n click(row, column, selected): void;\n dblclick(row, column, selected): void;\n\n // ITooltip\n tooltip;\n tooltipHTML(_): string;\n tooltipFormat(_): string;\n tooltipStyle(): \"default\" | \"none\" | \"series-table\";\n tooltipTick(): boolean;\n tooltipTick(_: boolean): Pie;\n tooltipTick_default(): boolean;\n tooltipTick_default(_: boolean): Pie;\n tooltipOffset(): number;\n tooltipOffset(_: number): Pie;\n tooltipOffset_default(): number;\n tooltipOffset_default(_: number): Pie;\n\n // SimpleSelectionMixin\n _selection: Utility.SimpleSelection;\n}\nPie.prototype.publish(\"showLabels\", true, \"boolean\", \"If true, wedge labels will display\");\nPie.prototype.publish(\"showSeriesValue\", false, \"boolean\", \"Append data series value next to label\", null, { disable: w => !w.showLabels() });\nPie.prototype.publish(\"seriesValueFormat\", \",.0f\", \"string\", \"Number format used for formatting series values\", null, { disable: w => !w.showSeriesValue() });\nPie.prototype.publish(\"showSeriesPercentage\", false, \"boolean\", \"Append data series percentage next to label\", null, { disable: w => !w.showLabels() });\nPie.prototype.publish(\"seriesPercentageFormat\", \",.0f\", \"string\", \"Number format used for formatting series percentages\", null, { disable: w => !w.showSeriesPercentage() });\nPie.prototype.publish(\"paletteID\", \"default\", \"set\", \"Color palette for this widget\", Pie.prototype._palette.switch(), { tags: [\"Basic\", \"Shared\"] });\nPie.prototype.publish(\"useClonedPalette\", false, \"boolean\", \"Enable or disable using a cloned palette\", null, { tags: [\"Intermediate\", \"Shared\"] });\nPie.prototype.publish(\"innerRadius\", 0, \"number\", \"Sets inner pie hole radius as a percentage of the radius of the pie chart\", null, { tags: [\"Basic\"], range: { min: 0, step: 1, max: 100 } });\nPie.prototype.publish(\"minOuterRadius\", 20, \"number\", \"Minimum outer radius (pixels)\");\nPie.prototype.publish(\"startAngle\", 0, \"number\", \"Starting angle of the first (and largest) wedge (degrees)\");\nPie.prototype.publish(\"labelHeight\", 12, \"number\", \"Font size of labels (pixels)\", null, { disable: w => !w.showLabels() });\nPie.prototype.publish(\"sortDataByValue\", \"descending\", \"set\", \"Sort data by value\", [\"none\", \"ascending\", \"descending\"]);\n","import { Pie } from \"./Pie.ts\";\n\nexport class HalfPie extends Pie {\n constructor() {\n super();\n }\n postUpdate(domNode, element) {\n super.postUpdate(domNode, element);\n let x = this._pos.x;\n let y = this._pos.y;\n if (this._drawStartPos === \"origin\" && this._target instanceof SVGElement) {\n x -= this._size.width / 2;\n y -= this._size.height / 2;\n }\n y += (this._size.height / 4);\n this._element.attr(\"transform\", \"translate(\" + x + \",\" + y + \")scale(\" + this._widgetScale + \")\");\n }\n updateD3Pie() {\n super.updateD3Pie();\n this.d3Pie\n .startAngle(-Math.PI / 2)\n .endAngle(Math.PI / 2)\n ;\n }\n}\nHalfPie.prototype._class += \" chart_HalfPie\";\n","import { max, Palette } from \"@hpcc-js/common\";\nimport { XYAxis } from \"./XYAxis.ts\";\n\nexport class Heat extends XYAxis {\n\n protected _domForeignObject;\n protected _domCanvas;\n protected _heat;\n\n constructor() {\n super();\n this\n .xAxisGuideLines_default(true)\n .yAxisGuideLines_default(true)\n ;\n }\n\n radius(r: number): this {\n this.radiusX(r);\n this.radiusY(r);\n return this;\n }\n\n layerEnter(host: XYAxis, element, duration: number = 250) {\n super.layerEnter(host, element, duration);\n this._domForeignObject = this.svg.insert(\"foreignObject\", `#${this.id() + \"_clippath\"}`);\n this._domCanvas = this._domForeignObject.append(\"xhtml:body\")\n .style(\"margin\", \"0px\")\n .style(\"padding\", \"0px\")\n .style(\"background-color\", \"transparent\")\n .append(\"canvas\")\n ;\n this._heat = simpleheat(this._domCanvas.node());\n }\n\n layerUpdate(host: XYAxis, element, duration: number = 250) {\n super.layerUpdate(host, element);\n\n this._palette = this._palette.switch(this.paletteID());\n\n let width = this.width() - this.margin.left - this.margin.right;\n if (width < 0) width = 0;\n let height = this.height() - this.margin.top - this.margin.bottom;\n if (height < 0) height = 0;\n\n this._domForeignObject\n .attr(\"x\", this.margin.left)\n .attr(\"y\", this.margin.top)\n .attr(\"width\", width)\n .attr(\"height\", height)\n ;\n this._domCanvas\n .attr(\"width\", width)\n .attr(\"height\", height)\n ;\n\n const data = host.orientation() === \"horizontal\" ?\n this.data().map(r => [host.dataPos(r[0]), host.valuePos(r[1]), r[2]]) :\n this.data().map(r => [host.valuePos(r[1]), host.dataPos(r[0]), r[2]])\n ;\n\n const maxWeight = this.maxWeight_exists() ? this.maxWeight() : max(data, r => r[2]);\n\n if (this.paletteID() !== \"default\") {\n const gradient = {};\n const count = 8;\n const reverse = this.reversePalette();\n for (let i = 0; i < count; ++i) {\n gradient[i / count] = this._palette((reverse ? count - i : i) / count, 0, 1);\n }\n this._heat.gradient(gradient);\n } else {\n this._heat.gradient(this._heat.defaultGradient);\n }\n\n this._heat.resize();\n\n const radiusX = this.radiusAsPercent() ? this.radiusX() * width / 100 : this.radiusX();\n const radiusY = this.radiusAsPercent() ? this.radiusY() * height / 100 : this.radiusY();\n\n this._heat\n .clear()\n .radius(radiusX, radiusY, this.blur())\n .max(maxWeight)\n .data(data)\n .draw(this.minOpacity())\n ;\n }\n}\n\nHeat.prototype._class += \" chart_Heat\";\nHeat.prototype._palette = Palette.rainbow(\"default\");\n\nexport interface Heat {\n paletteID(): string;\n paletteID(_: string): this;\n useClonedPalette(): boolean;\n useClonedPalette(_: boolean): this;\n reversePalette(): boolean;\n reversePalette(_: boolean): this;\n\n radiusX(): number;\n radiusX(_: number): this;\n radiusY(): number;\n radiusY(_: number): this;\n radiusAsPercent(): boolean;\n radiusAsPercent(_: boolean): this;\n blur(): number;\n blur(_: number): this;\n\n maxWeight(): number;\n maxWeight(_: number): this;\n maxWeight_exists(): boolean;\n\n minOpacity(): number;\n minOpacity(_: number): this;\n}\n\nHeat.prototype.publish(\"paletteID\", \"default\", \"set\", \"Color palette for this widget\", Heat.prototype._palette.switch(), { tags: [\"Basic\"] });\nHeat.prototype.publish(\"useClonedPalette\", false, \"boolean\", \"Enable or disable using a cloned palette\", null, { tags: [\"Intermediate\", \"Shared\"] });\nHeat.prototype.publish(\"reversePalette\", false, \"boolean\", \"Reverse Palette Colors\", null, { disable: w => w.paletteID() === \"default\" });\n\nHeat.prototype.publish(\"radiusX\", 25, \"number\", \"Point X radius (25 by default)\");\nHeat.prototype.publish(\"radiusY\", 25, \"number\", \"Point Y radius (25 by default)\");\nHeat.prototype.publish(\"radiusAsPercent\", false, \"boolean\", \"Calculate RadiusX + RadiusY as % of size\");\nHeat.prototype.publish(\"blur\", 15, \"number\", \"Point blur radius (15 by default)\");\n\nHeat.prototype.publish(\"maxWeight\", undefined, \"number\", \"Clamp max weight to value (optional), omitting uses max data point\", undefined, { optional: true });\nHeat.prototype.publish(\"minOpacity\", 0.05, \"number\", \"Minimum point opacity (0.05 by default)\");\n\n// The following code is a modified version of \n// - https://github.com/mourner/simpleheat\n// - Licensed under BSD-2-Clause - https://github.com/mourner/simpleheat/blob/gh-pages/LICENSE\n// Changes:\n// * Fixed TS syntax issues\n// * Added support for eliptical shapes instead of circles\n\nfunction simpleheat(canvas): void {\n if (!(this instanceof simpleheat)) return new simpleheat(canvas);\n\n this._canvas = canvas = typeof canvas === \"string\" ? document.getElementById(canvas) : canvas;\n\n this._ctx = canvas.getContext(\"2d\");\n this._width = canvas.width;\n this._height = canvas.height;\n\n this._max = 1;\n this._data = [];\n}\n\nsimpleheat.prototype = {\n\n defaultRadius: 25,\n\n defaultGradient: {\n 0.4: \"blue\",\n 0.6: \"cyan\",\n 0.7: \"lime\",\n 0.8: \"yellow\",\n 1.0: \"red\"\n },\n\n data: function (data) {\n this._data = data;\n return this;\n },\n\n max: function (max) {\n this._max = max;\n return this;\n },\n\n add: function (point) {\n this._data.push(point);\n return this;\n },\n\n clear: function () {\n this._data = [];\n return this;\n },\n\n radius: function (rX, rY, blur) {\n blur = blur === undefined ? 15 : blur;\n\n // create a grayscale blurred ellipse image that we'll use for drawing points\n const ellipse = this._ellipse = this._createCanvas();\n const ctx = ellipse.getContext(\"2d\");\n const rX2 = this._r = rX + blur;\n const rY2 = this._r = rY + blur;\n\n ellipse.width = rX2 * 2;\n ellipse.height = rY2 * 2;\n\n ctx.shadowOffsetX = ctx.shadowOffsetY = rX2 * 2;\n ctx.shadowOffsetY = ctx.shadowOffsetY = rY2 * 2;\n ctx.shadowBlur = blur;\n ctx.shadowColor = \"black\";\n\n ctx.beginPath();\n ctx.ellipse(-rX2, -rY2, rX, rY, 0, 0, Math.PI * 2, true);\n ctx.closePath();\n ctx.fill();\n\n return this;\n },\n\n resize: function () {\n this._width = this._canvas.width;\n this._height = this._canvas.height;\n },\n\n gradient: function (grad) {\n // create a 256x1 gradient that we'll use to turn a grayscale heatmap into a colored one\n const canvas = this._createCanvas(),\n ctx = canvas.getContext(\"2d\"),\n gradient = ctx.createLinearGradient(0, 0, 0, 256);\n\n canvas.width = 1;\n canvas.height = 256;\n\n for (const i in grad) {\n gradient.addColorStop(+i, grad[i]);\n }\n\n ctx.fillStyle = gradient;\n ctx.fillRect(0, 0, 1, 256);\n\n this._grad = ctx.getImageData(0, 0, 1, 256).data;\n\n return this;\n },\n\n draw: function (minOpacity) {\n if (!this._ellipse) this.radius(this.defaultRadius, this.defaultRadius);\n if (!this._grad) this.gradient(this.defaultGradient);\n\n const ctx = this._ctx;\n\n ctx.clearRect(0, 0, this._width, this._height);\n\n // draw a grayscale heatmap by putting a blurred ellipse at each data point\n for (let i = 0, len = this._data.length, p; i < len; i++) {\n p = this._data[i];\n if (p[2] < 0) {\n p[2] = 0;\n } else if (p[2] > this._max) {\n p[2] = this._max;\n }\n ctx.globalAlpha = Math.max(p[2] / this._max, minOpacity === undefined ? 0.05 : minOpacity);\n ctx.drawImage(this._ellipse, p[0] - this._r, p[1] - this._r);\n }\n\n // colorize the heatmap, using opacity value of each pixel to get the right color from our gradient\n const colored = ctx.getImageData(0, 0, this._width, this._height);\n this._colorize(colored.data, this._grad);\n ctx.putImageData(colored, 0, 0);\n\n return this;\n },\n\n _colorize: function (pixels, gradient) {\n for (let i = 0, len = pixels.length, j; i < len; i += 4) {\n j = pixels[i + 3] * 4; // get gradient color from opacity value\n\n if (j) {\n pixels[i] = gradient[j];\n pixels[i + 1] = gradient[j + 1];\n pixels[i + 2] = gradient[j + 2];\n }\n }\n },\n\n _createCanvas: function () {\n if (typeof document !== \"undefined\") {\n return document.createElement(\"canvas\");\n } else {\n // create a new canvas instance in node.js\n // the canvas class needs to have a default constructor without any parameter\n return new this._canvas.constructor();\n }\n }\n};\n","var thirdPi = Math.PI / 3,\n angles = [0, thirdPi, 2 * thirdPi, 3 * thirdPi, 4 * thirdPi, 5 * thirdPi];\n\nfunction pointX(d) {\n return d[0];\n}\n\nfunction pointY(d) {\n return d[1];\n}\n\nexport default function() {\n var x0 = 0,\n y0 = 0,\n x1 = 1,\n y1 = 1,\n x = pointX,\n y = pointY,\n r,\n dx,\n dy;\n\n function hexbin(points) {\n var binsById = {}, bins = [], i, n = points.length;\n\n for (i = 0; i < n; ++i) {\n if (isNaN(px = +x.call(null, point = points[i], i, points))\n || isNaN(py = +y.call(null, point, i, points))) continue;\n\n var point,\n px,\n py,\n pj = Math.round(py = py / dy),\n pi = Math.round(px = px / dx - (pj & 1) / 2),\n py1 = py - pj;\n\n if (Math.abs(py1) * 3 > 1) {\n var px1 = px - pi,\n pi2 = pi + (px < pi ? -1 : 1) / 2,\n pj2 = pj + (py < pj ? -1 : 1),\n px2 = px - pi2,\n py2 = py - pj2;\n if (px1 * px1 + py1 * py1 > px2 * px2 + py2 * py2) pi = pi2 + (pj & 1 ? 1 : -1) / 2, pj = pj2;\n }\n\n var id = pi + \"-\" + pj, bin = binsById[id];\n if (bin) bin.push(point);\n else {\n bins.push(bin = binsById[id] = [point]);\n bin.x = (pi + (pj & 1) / 2) * dx;\n bin.y = pj * dy;\n }\n }\n\n return bins;\n }\n\n function hexagon(radius) {\n var x0 = 0, y0 = 0;\n return angles.map(function(angle) {\n var x1 = Math.sin(angle) * radius,\n y1 = -Math.cos(angle) * radius,\n dx = x1 - x0,\n dy = y1 - y0;\n x0 = x1, y0 = y1;\n return [dx, dy];\n });\n }\n\n hexbin.hexagon = function(radius) {\n return \"m\" + hexagon(radius == null ? r : +radius).join(\"l\") + \"z\";\n };\n\n hexbin.centers = function() {\n var centers = [],\n j = Math.round(y0 / dy),\n i = Math.round(x0 / dx);\n for (var y = j * dy; y < y1 + r; y += dy, ++j) {\n for (var x = i * dx + (j & 1) * dx / 2; x < x1 + dx / 2; x += dx) {\n centers.push([x, y]);\n }\n }\n return centers;\n };\n\n hexbin.mesh = function() {\n var fragment = hexagon(r).slice(0, 4).join(\"l\");\n return hexbin.centers().map(function(p) { return \"M\" + p + \"m\" + fragment; }).join(\"\");\n };\n\n hexbin.x = function(_) {\n return arguments.length ? (x = _, hexbin) : x;\n };\n\n hexbin.y = function(_) {\n return arguments.length ? (y = _, hexbin) : y;\n };\n\n hexbin.radius = function(_) {\n return arguments.length ? (r = +_, dx = r * 2 * Math.sin(thirdPi), dy = r * 1.5, hexbin) : r;\n };\n\n hexbin.size = function(_) {\n return arguments.length ? (x0 = y0 = 0, x1 = +_[0], y1 = +_[1], hexbin) : [x1 - x0, y1 - y0];\n };\n\n hexbin.extent = function(_) {\n return arguments.length ? (x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1], hexbin) : [[x0, y0], [x1, y1]];\n };\n\n return hexbin.radius(1);\n}\n","import { I2DAggrChart, ITooltip } from \"@hpcc-js/api\";\nimport { InputField } from \"@hpcc-js/common\";\nimport { extent as d3Extent, max as d3Max, min as d3Min } from \"d3-array\";\nimport { hexbin as d3HexBin } from \"d3-hexbin\";\nimport { XYAxis } from \"./XYAxis.ts\";\n\nimport \"../src/HexBin.css\";\n\nexport class HexBin extends XYAxis {\n static __inputs: InputField[] = [{\n id: \"x\",\n type: \"any\"\n }, {\n id: \"y\",\n type: \"number\"\n }];\n\n protected _hexbin;\n protected _dataMinWeight;\n protected _dataMaxWeight;\n constructor() {\n super();\n I2DAggrChart.call(this);\n this.tooltipValueFormat_default(\",.0f\");\n ITooltip.call(this);\n this.tooltipHTML(d => {\n const seriesExtent = d3Extent<{ label: any, value: any }>(d, d => d.label);\n const labelExtent = d3Extent<{ label: any, value: any }>(d, d => d.value);\n return this.tooltipFormat({\n series: seriesExtent[0] === seriesExtent[1] ? seriesExtent[0] : `${seriesExtent[0]} -> ${seriesExtent[1]}`,\n label: labelExtent[0] === labelExtent[1] ? labelExtent[0] : `${labelExtent[0]} -> ${labelExtent[1]}`,\n value: d.length\n });\n });\n this._hexbin = d3HexBin()\n .x(d => d.x)\n .y(d => d.y)\n ;\n this\n .xAxisGuideLines_default(false)\n .yAxisGuideLines_default(false)\n .xAxisType_default(\"linear\")\n ;\n }\n\n xPos(host: XYAxis, d) {\n return host.orientation() === \"horizontal\" ? host.dataPos(d.label) : host.valuePos(d.value);\n }\n\n yPos(host: XYAxis, d) {\n return host.orientation() === \"horizontal\" ? host.valuePos(d.value) : host.dataPos(d.label);\n }\n\n layerUpdate(host: XYAxis, element, duration: number = 250) {\n super.layerUpdate(host, element, duration);\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._hexbin\n .extent([0, 0], [this.width(), this.height()])\n .radius(this.binSize())\n ;\n\n const flatData = this.flattenData();\n const dataPoints = flatData.map(d => {\n return {\n x: context.xPos(host, d),\n y: context.yPos(host, d),\n label: host.parseData(d.label),\n value: host.parseValue(d.value),\n origRow: d\n };\n });\n const hexBinPoints = this._hexbin(dataPoints);\n const minBinPoints = d3Min(hexBinPoints, function (d: any) { return d.length; });\n const maxBinPoints = d3Max(hexBinPoints, function (d: any) { return d.length; });\n this._dataMinWeight = minBinPoints;\n this._dataMaxWeight = maxBinPoints;\n\n const points = element.selectAll(\".hexagon\").data(hexBinPoints, function (d) { return d.i + \"_\" + d.j; });\n points.enter().append(\"path\")\n .attr(\"class\", \"hexagon\")\n .call(host._selection.enter.bind(host._selection))\n .on(\"click\", function (d: any) {\n const data = context.data();\n context.click(d.map(row => host.rowToObj(data[row.origRow.rowIdx])), context.columns()[1], host._selection.selected(this));\n })\n .on(\"dblclick\", function (d: any) {\n const data = context.data();\n context.dblclick(d.map(row => host.rowToObj(data[row.origRow.rowIdx])), context.columns()[1], host._selection.selected(this));\n })\n .on(\"mouseout.tooltip\", context.tooltip.hide)\n .on(\"mousemove.tooltip\", context.tooltip.show)\n .attr(\"transform\", function (d) { return \"translate(\" + d.x + \",\" + d.y + \")scale(0)\"; })\n .merge(points).transition().duration(duration)\n .attr(\"d\", this._hexbin.hexagon())\n .attr(\"transform\", function (d) { return \"translate(\" + d.x + \",\" + d.y + \")scale(1)\"; })\n .style(\"fill\", function (d) { return context._palette(d.length, minBinPoints, maxBinPoints); })\n ;\n points.exit().transition().duration(duration)\n .attr(\"transform\", function (d) { return \"translate(\" + d.x + \",\" + d.y + \")scale(0)\"; })\n .remove()\n ;\n }\n\n exit(domNode, element) {\n super.exit(domNode, element);\n }\n\n // Events ---\n click(row: object[], column, selected) {\n // console.log(\"Click: \" + JSON.stringify(row) + \", \" + column + \", \" + selected);\n }\n dblclick(row: object[], column, selected) {\n // console.log(\"Click: \" + JSON.stringify(row) + \", \" + column + \", \" + selected);\n }\n}\nHexBin.prototype._class += \" chart_HexBin\";\nHexBin.prototype.implements(I2DAggrChart.prototype);\nHexBin.prototype.implements(ITooltip.prototype);\n\nexport interface HexBin {\n // ITooltip\n tooltip;\n tooltipHTML(_): string;\n tooltipFormat(_): string;\n tooltipValueFormat(_): string;\n tooltipValueFormat_default(_): string;\n\n paletteID(): string;\n paletteID(_: string): this;\n useClonedPalette(): boolean;\n useClonedPalette(_: boolean): this;\n binSize(): number;\n binSize(_: number): this;\n}\n\nHexBin.prototype.publish(\"paletteID\", \"Blues\", \"set\", \"Color palette for this widget\", HexBin.prototype._palette.switch(), { tags: [\"Basic\", \"Shared\"] });\nHexBin.prototype.publish(\"useClonedPalette\", false, \"boolean\", \"Enable or disable using a cloned palette\", null, { tags: [\"Intermediate\", \"Shared\"] });\nHexBin.prototype.publish(\"binSize\", 20, \"number\", \"Bin radius\", null, { range: { min: 1, max: 300, step: 1 } });\n","import { Scatter } from \"./Scatter.ts\";\n\nimport \"../src/Line.css\";\n\nexport class Line extends Scatter {\n constructor() {\n super();\n\n this\n .interpolate_default(\"linear\")\n ;\n }\n}\nLine.prototype._class += \" chart_Line\";\n","import { Pie } from \"./Pie.ts\";\n\nexport class QuarterPie extends Pie {\n constructor() {\n super();\n }\n postUpdate(domNode, element) {\n super.postUpdate(domNode, element);\n let x = this.orientation() === \"left\" ? 0 : this._size.width;\n let y = this._size.height;\n if (this._drawStartPos === \"origin\" && this._target instanceof SVGElement) {\n x -= this._size.width / 2;\n y -= this._size.height / 2;\n }\n this._element.attr(\"transform\", \"translate(\" + x + \",\" + y + \")scale(\" + this._widgetScale + \")\");\n }\n updateD3Pie() {\n super.updateD3Pie();\n this.d3Pie\n .startAngle(this.orientation() === \"left\" ? 0 : -Math.PI / 2)\n .endAngle(this.orientation() === \"left\" ? Math.PI / 2 : 0)\n ;\n }\n calcOuterRadius() {\n const maxTextWidth = this.textSize(this.data().map(d => this.getLabelText({ data: d })), \"Verdana\", 12).width;\n return Math.min(this._size.width - maxTextWidth - 10, this._size.height - 12 * 3) - 2;\n }\n}\nQuarterPie.prototype._class += \" chart_QuarterPie\";\n\nexport interface QuarterPie {\n orientation(): string;\n orientation(_: string): this;\n}\nQuarterPie.prototype.publish(\"orientation\", \"left\", \"set\", \"Determines the placement and start/end angle.\", [\"left\", \"right\"]);\n","import { SVGWidget } from \"@hpcc-js/common\";\nimport { scaleLinear as d3ScaleLinear } from \"d3-scale\";\n\nexport class QuartileCandlestick extends SVGWidget {\n protected _g;\n protected _leftLine;\n protected _rightLine;\n protected _midLine;\n protected _midOuterRect;\n protected _midInnerRect1;\n protected _midInnerRect2;\n protected _q0text;\n protected _q1text;\n protected _q2text;\n protected _q3text;\n protected _q4text;\n protected _q0val;\n protected _q1val;\n protected _q2val;\n protected _q3val;\n protected _q4val;\n constructor() {\n super();\n }\n enter(domNode, element) {\n super.enter(domNode, element);\n this._g = element.append(\"g\");\n this._leftLine = this._g.append(\"rect\");\n this._rightLine = this._g.append(\"rect\");\n this._midLine = this._g.append(\"rect\");\n this._midOuterRect = this._g.append(\"rect\");\n this._midInnerRect1 = this._g.append(\"rect\");\n this._midInnerRect2 = this._g.append(\"rect\");\n this._q0text = this._g.append(\"text\");\n this._q1text = this._g.append(\"text\");\n this._q2text = this._g.append(\"text\");\n this._q3text = this._g.append(\"text\");\n this._q4text = this._g.append(\"text\");\n this._q0val = this._g.append(\"text\");\n this._q1val = this._g.append(\"text\");\n this._q2val = this._g.append(\"text\");\n this._q3val = this._g.append(\"text\");\n this._q4val = this._g.append(\"text\");\n }\n update(domNode, element) {\n super.update(domNode, element);\n const valueSize = (this.orientation() === \"horizontal\" ? this.width() : this.height()) - this.lineWidth();\n const domainSize = this.orientation() === \"horizontal\" ? this.height() : this.width();\n const scale = d3ScaleLinear()\n .domain([\n this.data()[0],\n this.data()[4]\n ])\n .range([\n this.edgePadding(),\n valueSize - this.edgePadding()\n ])\n ;\n const candleWidth = this.candleWidth_exists() ? this.candleWidth() : domainSize;\n const lineWidth = this.lineWidth();\n const lineColor = this.lineColor();\n const roundedCorners = this.roundedCorners();\n const q0x = this.edgePadding();\n let q1x = scale(this.data()[1]);\n let q2x = scale(this.data()[2]);\n let q3x = scale(this.data()[3]);\n const dataTop = -candleWidth / 2;\n const dataBottom = candleWidth / 2;\n const upperTextRotation = this.upperTextRotation();\n const lowerTextRotation = this.lowerTextRotation();\n const padding = this.textPadding();\n const labelFontSize = this.labelFontSize();\n const valueFontSize = this.valueFontSize();\n const sz = Math.max(labelFontSize, valueFontSize);\n const q4x = valueSize - q0x;\n if (sz > 0) {\n while (q1x - q0x < sz) {\n q1x += sz;\n }\n while (q2x - q1x < sz) {\n q2x += sz;\n }\n while (q3x - q2x < sz) {\n q3x += sz;\n }\n while (q4x - q3x < sz) {\n q3x -= sz;\n }\n while (q3x - q2x < sz) {\n q2x -= sz;\n }\n while (q2x - q1x < sz) {\n q1x -= sz;\n }\n }\n let transX = (-valueSize / 2) - (this.lineWidth() / 2);\n let transY = 0;\n let rotate = 0;\n const s = 1;\n let textScale = 1;\n let labelAnchor = \"start\";\n let valueAnchor = \"end\";\n if (this.orientation() === \"vertical\") {\n transX = 0;\n transY = valueSize / 2 + (this.lineWidth() / 2);\n rotate = -90;\n labelAnchor = \"end\";\n valueAnchor = \"start\";\n textScale = -1;\n }\n this._g\n .style(\"shape-rendering\", \"crispEdges\")\n .attr(\"transform\", `translate(${transX},${transY})rotate(${rotate})scale(${s})`)\n ;\n this._leftLine\n .attr(\"fill\", lineColor)\n .attr(\"height\", candleWidth)\n .attr(\"width\", lineWidth)\n .attr(\"x\", q0x)\n .attr(\"y\", dataTop)\n .attr(\"rx\", roundedCorners)\n .attr(\"ry\", roundedCorners)\n ;\n this._rightLine\n .attr(\"class\", \"right-line\")\n .attr(\"fill\", lineColor)\n .attr(\"height\", candleWidth)\n .attr(\"width\", lineWidth)\n .attr(\"x\", q4x)\n .attr(\"y\", dataTop)\n .attr(\"rx\", roundedCorners)\n .attr(\"ry\", roundedCorners)\n ;\n this._midLine\n .attr(\"fill\", lineColor)\n .attr(\"height\", lineWidth)\n .attr(\"width\", q4x - q0x)\n .attr(\"x\", q0x)\n .attr(\"y\", -lineWidth / 2)\n ;\n this._midOuterRect\n .attr(\"fill\", lineColor)\n .attr(\"height\", candleWidth)\n .attr(\"width\", q3x - q1x)\n .attr(\"x\", q1x)\n .attr(\"y\", dataTop)\n .attr(\"rx\", roundedCorners)\n .attr(\"ry\", roundedCorners)\n ;\n this._midInnerRect1\n .attr(\"fill\", this.innerRectColor())\n .attr(\"height\", candleWidth - (lineWidth * 2))\n .attr(\"width\", q2x - (q1x + (lineWidth * 2)))\n .attr(\"x\", q1x + lineWidth)\n .attr(\"y\", lineWidth - (candleWidth / 2))\n .attr(\"rx\", roundedCorners * 0.618)\n .attr(\"ry\", roundedCorners * 0.618)\n ;\n this._midInnerRect2\n .attr(\"fill\", this.innerRectColor())\n .attr(\"height\", candleWidth - (lineWidth * 2))\n .attr(\"width\", q3x - q2x - lineWidth)\n .attr(\"x\", q2x)\n .attr(\"y\", lineWidth - (candleWidth / 2))\n .attr(\"rx\", roundedCorners * 0.618)\n .attr(\"ry\", roundedCorners * 0.618)\n ;\n this._q0text\n .attr(\"height\", candleWidth)\n .attr(\"width\", q3x - q1x)\n .attr(\"display\", this.showLabels() ? null : \"none\")\n .attr(\"fill\", this.textColor())\n .attr(\"x\", 0)\n .attr(\"y\", 0)\n .attr(\"transform\", `translate(${q0x}, ${dataTop - padding})rotate(${upperTextRotation})scale(${textScale})`)\n .attr(\"font-size\", labelFontSize)\n .attr(\"text-anchor\", labelAnchor)\n .attr(\"alignment-baseline\", \"hanging\")\n .text(this.columns()[0])\n ;\n this._q1text\n .attr(\"height\", candleWidth)\n .attr(\"width\", q3x - q1x)\n .attr(\"display\", this.showLabels() ? null : \"none\")\n .attr(\"fill\", this.textColor())\n .attr(\"x\", 0)\n .attr(\"y\", 0)\n .attr(\"transform\", `translate(${q1x}, ${dataTop - padding})rotate(${upperTextRotation})scale(${textScale})`)\n .attr(\"font-size\", labelFontSize)\n .attr(\"text-anchor\", labelAnchor)\n .attr(\"alignment-baseline\", \"middle\")\n .text(this.columns()[1])\n ;\n this._q2text\n .attr(\"height\", candleWidth)\n .attr(\"width\", q3x - q1x)\n .attr(\"display\", this.showLabels() ? null : \"none\")\n .attr(\"fill\", this.textColor())\n .attr(\"x\", 0)\n .attr(\"y\", 0)\n .attr(\"transform\", `translate(${q2x}, ${dataTop - padding})rotate(${upperTextRotation})scale(${textScale})`)\n .attr(\"font-size\", labelFontSize)\n .attr(\"text-anchor\", labelAnchor)\n .attr(\"alignment-baseline\", \"middle\")\n .text(this.columns()[2])\n ;\n this._q3text\n .attr(\"height\", candleWidth)\n .attr(\"width\", q3x - q1x)\n .attr(\"display\", this.showLabels() ? null : \"none\")\n .attr(\"fill\", this.textColor())\n .attr(\"x\", 0)\n .attr(\"y\", 0)\n .attr(\"transform\", `translate(${q3x}, ${dataTop - padding})rotate(${upperTextRotation})scale(${textScale})`)\n .attr(\"font-size\", labelFontSize)\n .attr(\"text-anchor\", labelAnchor)\n .attr(\"alignment-baseline\", \"middle\")\n .text(this.columns()[3])\n ;\n this._q4text\n .attr(\"height\", candleWidth)\n .attr(\"width\", q3x - q1x)\n .attr(\"display\", this.showLabels() ? null : \"none\")\n .attr(\"fill\", this.textColor())\n .attr(\"x\", 0)\n .attr(\"y\", 0)\n .attr(\"transform\", `translate(${q4x + lineWidth}, ${dataTop - padding})rotate(${upperTextRotation})scale(${textScale})`)\n .attr(\"font-size\", labelFontSize)\n .attr(\"text-anchor\", labelAnchor)\n .attr(\"alignment-baseline\", \"baseline\")\n .text(this.columns()[4])\n ;\n this._q0val\n .attr(\"height\", candleWidth)\n .attr(\"width\", q3x - q1x)\n .attr(\"display\", this.showValues() ? null : \"none\")\n .attr(\"fill\", this.textColor())\n .attr(\"x\", 0)\n .attr(\"y\", 0)\n .attr(\"transform\", `translate(${q0x}, ${dataBottom + padding})rotate(${lowerTextRotation})scale(${textScale})`)\n .attr(\"font-size\", valueFontSize)\n .attr(\"text-anchor\", valueAnchor)\n .attr(\"alignment-baseline\", \"hanging\")\n .text(this.data()[0])\n ;\n this._q1val\n .attr(\"height\", candleWidth)\n .attr(\"width\", q3x - q1x)\n .attr(\"display\", this.showValues() ? null : \"none\")\n .attr(\"fill\", this.textColor())\n .attr(\"x\", 0)\n .attr(\"y\", 0)\n .attr(\"transform\", `translate(${q1x}, ${dataBottom + padding})rotate(${lowerTextRotation})scale(${textScale})`)\n .attr(\"font-size\", valueFontSize)\n .attr(\"text-anchor\", valueAnchor)\n .attr(\"alignment-baseline\", \"middle\")\n .text(this.data()[1])\n ;\n this._q2val\n .attr(\"height\", candleWidth)\n .attr(\"width\", q3x - q1x)\n .attr(\"display\", this.showValues() ? null : \"none\")\n .attr(\"fill\", this.textColor())\n .attr(\"x\", 0)\n .attr(\"y\", 0)\n .attr(\"transform\", `translate(${q2x}, ${dataBottom + padding})rotate(${lowerTextRotation})scale(${textScale})`)\n .attr(\"font-size\", valueFontSize)\n .attr(\"text-anchor\", valueAnchor)\n .attr(\"alignment-baseline\", \"middle\")\n .text(this.data()[2])\n ;\n this._q3val\n .attr(\"height\", candleWidth)\n .attr(\"width\", q3x - q1x)\n .attr(\"display\", this.showValues() ? null : \"none\")\n .attr(\"fill\", this.textColor())\n .attr(\"x\", 0)\n .attr(\"y\", 0)\n .attr(\"transform\", `translate(${q3x}, ${dataBottom + padding})rotate(${lowerTextRotation})scale(${textScale})`)\n .attr(\"font-size\", valueFontSize)\n .attr(\"text-anchor\", valueAnchor)\n .attr(\"alignment-baseline\", \"middle\")\n .text(this.data()[3])\n ;\n this._q4val\n .attr(\"height\", candleWidth)\n .attr(\"width\", q3x - q1x)\n .attr(\"display\", this.showValues() ? null : \"none\")\n .attr(\"fill\", this.textColor())\n .attr(\"x\", 0)\n .attr(\"y\", 0)\n .attr(\"transform\", `translate(${q4x + lineWidth}, ${dataBottom + padding})rotate(${lowerTextRotation})scale(${textScale})`)\n .attr(\"font-size\", valueFontSize)\n .attr(\"text-anchor\", valueAnchor)\n .attr(\"alignment-baseline\", \"baseline\")\n .text(this.data()[4])\n ;\n }\n}\nQuartileCandlestick.prototype._class += \" chart_QuartileCandlestick\";\n\nexport interface QuartileCandlestick {\n orientation(): \"horizontal\" | \"vertical\";\n orientation(_: \"horizontal\" | \"vertical\"): this;\n textPadding(): number;\n textPadding(_: number): this;\n edgePadding(): number;\n edgePadding(_: number): this;\n candleWidth(): number;\n candleWidth(_: number): this;\n candleWidth_exists(): boolean;\n lineWidth(): number;\n lineWidth(_: number): this;\n lineColor(): string;\n lineColor(_: string): this;\n innerRectColor(): string;\n innerRectColor(_: string): this;\n lowerTextRotation(): number;\n lowerTextRotation(_: number): this;\n upperTextRotation(): number;\n upperTextRotation(_: number): this;\n roundedCorners(): number;\n roundedCorners(_: number): this;\n labelFontSize(): number;\n labelFontSize(_: number): this;\n valueFontSize(): number;\n valueFontSize(_: number): this;\n textColor(): string;\n textColor(_: string): this;\n showLabels(): boolean;\n showLabels(_: boolean): this;\n showValues(): boolean;\n showValues(_: boolean): this;\n}\nQuartileCandlestick.prototype.publish(\"textColor\", \"black\", \"html-color\", \"Color of label and value text\");\nQuartileCandlestick.prototype.publish(\"showLabels\", true, \"boolean\", \"If true, labels will be shown\");\nQuartileCandlestick.prototype.publish(\"showValues\", true, \"boolean\", \"If true, values will be shown\");\nQuartileCandlestick.prototype.publish(\"orientation\", \"horizontal\", \"set\", \"Determines layout\", [\"horizontal\", \"vertical\"]);\nQuartileCandlestick.prototype.publish(\"valueFontSize\", 12, \"number\", \"Font size of value text (pixels)\");\nQuartileCandlestick.prototype.publish(\"labelFontSize\", 12, \"number\", \"Font size of label text (pixels)\");\nQuartileCandlestick.prototype.publish(\"roundedCorners\", 8, \"number\", \"Radius of rounded rect corners (pixels)\");\nQuartileCandlestick.prototype.publish(\"lineWidth\", 4, \"number\", \"Width of lines (pixels)\");\nQuartileCandlestick.prototype.publish(\"candleWidth\", null, \"number\", \"Height of outer rect (pixels)\", null, {optional: true});\nQuartileCandlestick.prototype.publish(\"textPadding\", 8, \"number\", \"Padding between outer rect and text (pixels)\");\nQuartileCandlestick.prototype.publish(\"edgePadding\", 30, \"number\", \"Padding between outer rect and left/right sides (pixels)\");\nQuartileCandlestick.prototype.publish(\"lineColor\", \"#333\", \"html-color\", \"Color of outer rect and lines\");\nQuartileCandlestick.prototype.publish(\"innerRectColor\", \"white\", \"html-color\", \"Color of the inner rects\");\nQuartileCandlestick.prototype.publish(\"upperTextRotation\", -60, \"number\", \"Rotation of label text (degrees)\");\nQuartileCandlestick.prototype.publish(\"lowerTextRotation\", -60, \"number\", \"Rotation of value text (degrees)\");\n","import { INDChart, ITooltip } from \"@hpcc-js/api\";\nimport { SVGWidget, Utility } from \"@hpcc-js/common\";\nimport { select as d3Select } from \"d3-selection\";\n\nimport \"../src/Radar.css\";\nexport class Radar extends SVGWidget {\n\n constructor() {\n super();\n INDChart.call(this);\n ITooltip.call(this);\n Utility.SimpleSelectionMixin.call(this);\n }\n\n mapShape(shape) {\n switch (shape) {\n case \"rectangle\":\n return \"rect\";\n case \"circle\":\n return \"circle\";\n case \"cross\":\n return \"path\";\n default:\n }\n }\n setPointAttributes(element, x, y) {\n const shape = this.mapShape(this.pointShape());\n const context = this;\n switch (shape) {\n case \"rect\":\n element\n .attr(\"width\", context.pointSize())\n .attr(\"height\", context.pointSize())\n .style(\"fill\", d => this.strokeColor(d.data, d.column, d.value))\n ;\n break;\n case \"circle\":\n element\n .attr(\"r\", context.pointSize() / 2)\n .attr(\"cx\", x)\n .attr(\"cy\", y)\n .style(\"fill\", d => this.strokeColor(d.data, d.column, d.value))\n ;\n break;\n case \"path\":\n const half_size = context.pointSize() / 2;\n element\n .attr(\"d\", function (d: any) {\n return \"M\" + (x - half_size) + \" \" + (y - half_size) + \" \" +\n \"L\" + (x + half_size) + \" \" + (y + half_size) + \" \" +\n \"M\" + (x - half_size) + \" \" + (y + half_size) + \" \" +\n \"L\" + (x + half_size) + \" \" + (y - half_size);\n })\n .style(\"stroke\", d => this.strokeColor(d.data, d.column, d.value))\n ;\n break;\n default:\n }\n }\n enter(domNode, element) {\n super.enter(domNode, element);\n this._selection.widgetElement(element);\n\n this\n .tooltipHTML(d => {\n return this.tooltipFormat({ label: d.label, series: d.column, value: d.value });\n })\n ;\n }\n update(domNode, element) {\n super.update(domNode, element);\n this._palette = this._palette.switch(this.paletteID());\n const context = this;\n const h = this.height();\n const w = this.width();\n const half_h = (h / 2);\n const half_w = (w / 2);\n\n const columns = this.columns();\n const data = this.data();\n const flatData = this.flattenData(columns, data).map((d: any, idx: number) => {\n d.shape = this.mapShape(this.pointShape());\n d.column = columns[d.colIdx];\n d.row = data[idx];\n return d;\n });\n const domain_points = [];\n const arc = this.degrees2radians(360 / this.data().length);\n const max_label_h = this.fontSize();\n let max_label_w = 0;\n flatData.filter(n => n.colIdx === 1).forEach(n => {\n const isize = super.textSize(n.label, `${this.fontFamily()}`, this.fontSize());\n if (max_label_w < isize.width) max_label_w = isize.width;\n });\n const radius = Math.min(half_h - max_label_h, half_w - max_label_w);\n const labels = element\n .selectAll(\".label\")\n .data(flatData.filter(n => n.colIdx === 1))\n ;\n const max_val = Math.max.apply(context, flatData.map(n => n.value));\n labels.enter()\n .append(\"text\")\n .attr(\"class\", \"label\")\n .attr(\"text-anchor\", \"middle\")\n .merge(labels)\n .attr(\"font-size\", this.fontSize())\n .attr(\"font-family\", this.fontFamily())\n .each(function (this: SVGElement, n, i) {\n const xy = context.polar2cartesian(radius, (i * arc) - (Math.PI / 2));\n domain_points.push(xy.map(n => n * context.labelPaddingRatio()));\n let text_anchor = \"middle\";\n const _x = Math.round(xy[0]);\n text_anchor = _x > 0 ? \"start\" : text_anchor;\n text_anchor = _x < 0 ? \"end\" : text_anchor;\n d3Select(this)\n .attr(\"text-anchor\", text_anchor)\n .attr(\"x\", xy[0])\n .attr(\"y\", xy[1])\n ;\n })\n .text(n => n.label)\n ;\n labels.exit().remove();\n const domains = element\n .selectAll(\".domain\")\n .data(flatData.filter(n => n.colIdx === 1));\n domains.enter()\n .append(\"line\")\n .classed(\"domain\", true)\n .style(\"stroke\", \"#000\")\n .style(\"stroke-opacity\", \"0.75\")\n .style(\"stroke-width\", \"1px\")\n .merge(domains)\n .attr(\"x1\", 0)\n .attr(\"y1\", 0)\n .attr(\"x2\", (n, i) => domain_points[i][0])\n .attr(\"y2\", (n, i) => domain_points[i][1]);\n domains.exit().remove();\n const value_guides = element\n .selectAll(\".value_guide\")\n .data(this.valueGuideRatios())\n ;\n value_guides.enter()\n .append(\"polygon\")\n .classed(\"value_guide\", true)\n .style(\"stroke\", \"grey\")\n .style(\"stroke-opacity\", \"0.75\")\n .style(\"stroke-width\", \"0.3px\")\n .merge(value_guides)\n .each(function (mult, i) {\n const poly_points = [];\n domain_points.forEach((domain_point, row_idx) => {\n poly_points.push([\n domain_point[0] * mult,\n domain_point[1] * mult\n ]);\n });\n d3Select(this)\n .attr(\"points\", poly_points.join(\" \"))\n .attr(\"stroke\", \"rgb(0, 0, 0)\")\n .attr(\"stroke-opacity\", 0.75)\n .attr(\"stroke-width\", 0.3)\n .attr(\"fill-opacity\", 0)\n ;\n })\n ;\n value_guides.exit().remove();\n\n const value_guide_text = element\n .selectAll(\".value_guide_text\")\n .data(this.valueGuideRatios())\n ;\n value_guide_text.enter()\n .append(\"text\")\n .attr(\"class\", \"value_guide_text\")\n .attr(\"text-anchor\", \"start\")\n .attr(\"font-size\", this.fontSize())\n .attr(\"font-family\", this.fontFamily())\n .merge(value_guide_text)\n .attr(\"x\", 2)\n .attr(\"y\", mult => domain_points[0][1] * mult)\n .text((mult, i) => Math.round(mult * max_val))\n ;\n value_guides.exit().remove();\n\n // Polygon shapes ---\n const series_polygons = element\n .selectAll(\".area\")\n .data(columns.filter((n, i) => i > 0));\n series_polygons.enter()\n .append(\"polygon\")\n .attr(\"class\", \"area\")\n .style(\"stroke-opacity\", \"0.75\")\n .style(\"stroke-width\", \"0.3px\")\n .merge(series_polygons)\n .style(\"stroke\", d => this.strokeColor([], d, 0))\n .style(\"fill\", d => this.fillColor([], d, 0))\n .style(\"fill-opacity\", this.fillOpacity())\n .attr(\"points\", (d, col_idx) => {\n return domain_points.map((domain_point, row_idx) => {\n const val = data[row_idx][col_idx + 1];\n const val_mult = val === 0 ? 0 : val / max_val;\n return domain_point[0] * val_mult + \",\" + domain_point[1] * val_mult;\n }).join(\" \");\n });\n series_polygons.exit().remove();\n\n // Points ---\n const point_elm = element\n .selectAll(\".point\")\n .data(flatData);\n point_elm.enter()\n .append(\"g\")\n .attr(\"class\", \"point\")\n .on(\"mouseout.tooltip\", context.tooltip.hide)\n .on(\"mousemove.tooltip\", context.tooltip.show)\n .on(\"click\", function (d: any, _idx) {\n const data_row = context.data()[d.rowIdx];\n const row_obj = context.rowToObj(data_row);\n const selected = context._selection.selected(this);\n context.click(row_obj, context.columns()[d.colIdx], selected);\n })\n .on(\"dblclick\", function (d: any, _idx) {\n context.dblclick(context.rowToObj(context.data()[d.rowIdx]), d.column, context._selection.selected(this));\n })\n .each(function (d) {\n const element = d3Select(this);\n element.append(\"circle\")\n .attr(\"class\", \"pointSelection\")\n .attr(\"r\", context.pointSize())\n .call(context._selection.enter.bind(context._selection))\n ;\n element.append(context.mapShape(context.pointShape()))\n .attr(\"class\", \"pointShape\")\n ;\n })\n .merge(point_elm)\n .each(function (d) {\n const element = d3Select(this);\n const val_mult = d.value === 0 ? 0 : d.value / max_val;\n const x = domain_points[d.rowIdx][0] * val_mult;\n const y = domain_points[d.rowIdx][1] * val_mult;\n element.select(\".pointSelection\")\n .attr(\"cx\", x)\n .attr(\"cy\", y)\n ;\n\n const pointElement = element.select(\".pointShape\")\n .style(\"stroke\", context.strokeColor(d.row, d.column, d.value))\n .style(\"fill\", context.fillColor(d.row, d.column, d.value))\n ;\n context.setPointAttributes(pointElement, x, y);\n })\n ;\n point_elm.exit().remove();\n }\n\n polar2cartesian(r, theta) {\n return [r * Math.cos(theta), r * Math.sin(theta)];\n }\n cartesian2polar(x, y) {\n return [Math.atan2(y, x), Math.sqrt(x * x + y * y)];\n }\n degrees2radians(d) {\n return d / 57.295779513;\n }\n radians2degrees(r) {\n return r * 57.295779513;\n }\n point_in_polygon(point, vs) {\n const x = point[0];\n const y = point[1];\n let inside = false;\n for (let i = 0, j = vs.length - 1; i < vs.length; j = i++) {\n const xi = vs[i][0];\n const yi = vs[i][1];\n const xj = vs[j][0];\n const yj = vs[j][1];\n const intersect = ((yi > y) !== (yj > y))\n && (x < (xj - xi) * (y - yi) / (yj - yi) + xi);\n if (intersect) inside = !inside;\n }\n return inside;\n }\n}\nRadar.prototype._class += \" chart_Radar\";\nRadar.prototype.implements(INDChart.prototype);\nRadar.prototype.implements(ITooltip.prototype);\nRadar.prototype.mixin(Utility.SimpleSelectionMixin);\n\nexport interface Radar {\n labelPaddingRatio(): number;\n labelPaddingRatio(_: number): this;\n fillOpacity(): number;\n fillOpacity(_: number): this;\n fontFamily(): string;\n fontFamily(_: string): this;\n fontSize(): number;\n fontSize(_: number): this;\n valueGuideRatios(): any;\n valueGuideRatios(_: any): this;\n valueGuideFontSize(): number;\n valueGuideFontSize(_: number): this;\n valueGuideFontFamily(): string;\n valueGuideFontFamily(_: string): this;\n paletteID(): string;\n paletteID(_: string): this;\n pointShape(): string;\n pointShape(_: string): this;\n pointSize(): number;\n pointSize(_: number): this;\n\n // INDChart\n _palette;\n fillColor(row, column, value): string;\n strokeColor(row, column, value): string;\n textColor(row, column, value): string;\n click(row, column, selected): void;\n dblclick(row, column, selected): void;\n\n // ITooltip\n tooltip;\n tooltipHTML(_): string;\n tooltipFormat(_): string;\n\n _selection;\n}\n\nRadar.prototype.publish(\"paletteID\", \"default\", \"set\", \"Color palette for this widget\", Radar.prototype._palette.switch());\nRadar.prototype.publish(\"pointShape\", \"cross\", \"set\", \"pointShape\", [\"circle\", \"rectangle\", \"cross\"]);\nRadar.prototype.publish(\"pointSize\", 6, \"number\", \"Point Size\", null, { range: { min: 1, step: 1, max: 200 } });\nRadar.prototype.publish(\"valueGuideRatios\", [0.2, 0.4, 0.6, 0.8, 1], \"array\", \"Array of values between 0 and 1 that are multiplied by the widget radius to produce guide lines\");\nRadar.prototype.publish(\"fillOpacity\", 0.66, \"number\", \"Opacity of the data polygon(s)\");\nRadar.prototype.publish(\"fontFamily\", \"\", \"string\", \"fontFamily\");\nRadar.prototype.publish(\"fontSize\", 16, \"number\", \"fontSize\");\nRadar.prototype.publish(\"labelPaddingRatio\", 0.9, \"number\", \"labelPaddingRatio\");\n","import { INDChart, ITooltip } from \"@hpcc-js/api\";\nimport { InputField, SVGWidget, Utility } from \"@hpcc-js/common\";\nimport { interpolate as d3Interpolate } from \"d3-interpolate\";\nimport { scaleBand as d3ScaleBand, scaleLinear as d3ScaleLinear } from \"d3-scale\";\nimport { arc as d3Arc } from \"d3-shape\";\n\nimport \"../src/RadialBar.css\";\n\nexport class RadialBar extends SVGWidget {\n static __inputs: InputField[] = [{\n id: \"label\",\n type: \"any\"\n }, {\n id: \"values\",\n type: \"number\"\n }];\n\n private _domainScale = d3ScaleBand();\n private _valueScale = d3ScaleLinear();\n private _d3Arc = d3Arc<[string, number]>()\n .startAngle(0)\n .endAngle((d) => this._valueScale(d[1]))\n ;\n\n protected _arcs;\n protected _axialAxis;\n protected _radialAxis;\n\n constructor() {\n super();\n INDChart.call(this);\n ITooltip.call(this);\n Utility.SimpleSelectionMixin.call(this);\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n this._selection.widgetElement(element);\n this.tooltipHTML(d => {\n return this.tooltipFormat({ label: d[0], value: d[1] });\n });\n\n this._radialAxis = element.append(\"g\")\n .attr(\"class\", \"r axis\")\n ;\n this._axialAxis = element.append(\"g\")\n .attr(\"class\", \"a axis\")\n ;\n this._arcs = element.append(\"g\")\n .attr(\"class\", \"data\")\n ;\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n const context = this;\n const maxValue = Math.max(this.valueDomainHigh_exists() ? this.valueDomainHigh() : 0, ...this.data().map(d => d[1]));\n\n this._valueScale\n .domain([0, maxValue])\n .range([0, this.radians(this.valueMaxAngle())])\n ;\n\n const ticks = this._valueScale.ticks(this.tickCount());\n\n const maxTextWidth = this.textSize(ticks.map(d => \"\" + d), \"Verdana\", 12).width;\n const chartRadius = (Math.min(this.width() - (10 + maxTextWidth) * 2, this.height() - (10 + 12) * 2) / 2);\n\n // Domain Axis (x-axis) ---\n const domainData = this.data().map(d => d[0]);\n\n this._domainScale\n .domain(domainData)\n .range([0, chartRadius])\n .padding(this.domainPadding())\n ;\n const domainPadding = this._domainScale.step() * this._domainScale.padding();\n\n const domainCircles = this._radialAxis.selectAll(\"circle\").data(domainData);\n domainCircles.enter().append(\"circle\")\n .attr(\"fill\", \"transparent\")\n .merge(domainCircles)\n .attr(\"r\", d => this._domainScale(d) + this._domainScale.step() - domainPadding / 2)\n ;\n domainCircles.exit().remove();\n\n const domainText = this._radialAxis.selectAll(\".arc-text\").data(domainData);\n domainText.enter().append(\"text\")\n .attr(\"class\", \"arc-text\")\n .attr(\"x\", -4)\n .attr(\"alignment-baseline\", \"middle\")\n .attr(\"text-anchor\", \"end\")\n .merge(domainText)\n .attr(\"y\", d => -this._domainScale(d) - this._domainScale.bandwidth() / 2)\n .text(d => d);\n domainText.exit().remove();\n\n // Value Axis (y-axis) ---\n const valueLines = this._axialAxis.selectAll(\"line\").data(ticks);\n valueLines.enter().append(\"line\")\n .merge(valueLines)\n .attr(\"x2\", d => chartRadius * Math.cos(this._valueScale(d) - this.radians(90)))\n .attr(\"y2\", d => chartRadius * Math.sin(this._valueScale(d) - this.radians(90)))\n ;\n valueLines.exit().remove();\n\n const valueText = this._axialAxis.selectAll(\"text\").data(ticks);\n valueText.enter().append(\"text\")\n .style(\"dominant-baseline\", \"central\")\n .merge(valueText)\n .attr(\"x\", d => (chartRadius + 10) * Math.cos(this._valueScale(d) - this.radians(90)))\n .attr(\"y\", d => (chartRadius + 10) * Math.sin(this._valueScale(d) - this.radians(90)))\n .style(\"text-anchor\", d => {\n const middleZone = 20;\n const angle = this.degrees(this._valueScale(d));\n if (angle >= 0 && angle <= middleZone ||\n angle >= 180 - middleZone && angle <= 180 + middleZone ||\n angle >= 360 - middleZone && angle <= 360\n ) {\n return \"middle\";\n } else if (angle >= 180 && angle <= 360) {\n return \"end\";\n } else {\n return null;\n }\n })\n .text(d => d)\n ;\n valueText.exit().remove();\n\n const valueColumn = this.columns().length > 1 ? this.columns()[1] : \"\";\n // Data (arcs) ---\n this._d3Arc\n .innerRadius(d => this._domainScale(d[0]))\n .outerRadius(d => this._domainScale(d[0]) + this._domainScale.bandwidth())\n ;\n const arcs = this._arcs.selectAll(\"path\").data(this.data(), d => d[0]);\n arcs.enter().append(\"path\")\n .attr(\"class\", \"arc\")\n .call(this._selection.enter.bind(this._selection))\n .on(\"mouseout.tooltip\", this.tooltip.hide)\n .on(\"mousemove.tooltip\", this.tooltip.show)\n .on(\"click\", function (d: any, _idx) {\n context.click(context.rowToObj(d), valueColumn, context._selection.selected(this));\n })\n .on(\"dblclick\", function (d: any, _idx) {\n context.dblclick(context.rowToObj(d), valueColumn, context._selection.selected(this));\n })\n .merge(arcs)\n .style(\"fill\", (d, i) => this.fillColor(d, d[0], d[1]))\n .transition()\n .delay((d, i) => i * this.transitionDelay())\n .duration(this.transitionDuration())\n .attrTween(\"d\", (d, indx) => {\n const interpolate = d3Interpolate(d._current || 0, d[1]);\n d._current = d[1];\n return t => this._d3Arc([d[0], interpolate(t)], indx);\n })\n ;\n arcs.exit().remove();\n }\n\n degrees(radians) {\n return radians * 180 / Math.PI;\n }\n\n radians(degrees) {\n return degrees * Math.PI / 180;\n }\n\n}\nRadialBar.prototype._class += \" chart_RadialBar\";\nRadialBar.prototype.implements(INDChart.prototype);\nRadialBar.prototype.implements(ITooltip.prototype);\nRadialBar.prototype.mixin(Utility.SimpleSelectionMixin);\n\nexport interface RadialBar {\n paletteID(): string;\n paletteID(_: string): this;\n tickCount(): number;\n tickCount(_: number): this;\n domainPadding(): number;\n domainPadding(_: number): this;\n valueMaxAngle(): number;\n valueMaxAngle(_: number): this;\n valueDomainHigh(): number;\n valueDomainHigh(_: number): this;\n valueDomainHigh_exists(): boolean;\n transitionDelay(): number;\n transitionDelay(_: number): this;\n transitionDuration(): number;\n transitionDuration(_: number): this;\n\n // INDChart\n _palette;\n fillColor(row, column, value): string;\n strokeColor(row, column, value): string;\n textColor(row, column, value): string;\n click(row, column, selected): void;\n dblclick(row, column, selected): void;\n\n // ITooltip\n tooltip;\n tooltipHTML(_): string;\n tooltipFormat(_): string;\n\n // SimpleSelectionMixin\n _selection;\n}\n\nRadialBar.prototype.publish(\"paletteID\", \"default\", \"set\", \"Color palette for this widget\", RadialBar.prototype._palette.switch());\nRadialBar.prototype.publish(\"tickCount\", 10, \"number\", \"Number of ticks to display\");\nRadialBar.prototype.publish(\"domainPadding\", 0.25, \"number\", \"Padding between chart edge and container edge (0..1)\");\nRadialBar.prototype.publish(\"valueMaxAngle\", 270, \"number\", \"Maximum angular length of a bar (degrees)\");\nRadialBar.prototype.publish(\"valueDomainHigh\", null, \"number\", \"Value domain high\", undefined, { optional: true });\nRadialBar.prototype.publish(\"transitionDelay\", 100, \"number\", \"Delay between the start of each row animation (ms)\");\nRadialBar.prototype.publish(\"transitionDuration\", 750, \"number\", \"Duration of a row's animation (ms)\");\n","import { format as d3Format, HTMLWidget, Palette } from \"@hpcc-js/common\";\nimport { QuartileCandlestick } from \"./QuartileCandlestick.ts\";\nimport { Scatter } from \"./Scatter.ts\";\n\nconst rainbow = Palette.rainbow(\"Blues\");\nconst palette = Palette.ordinal(\"Quartile\", [rainbow(100, 0, 100), rainbow(50, 0, 100), rainbow(50, 0, 100), rainbow(75, 0, 100)]);\npalette(\"Std. Dev.\");\npalette(\"MinMax\");\npalette(\"25%\");\npalette(\"50%\");\n\ntype View = \"min_max\" | \"25_75\" | \"normal\";\ntype Tick = { label: string, value: number };\ntype Ticks = Tick[];\ntype AxisTick = { label: string, value: string };\ntype AxisTicks = AxisTick[];\n\nfunction myFormatter(format: string): (num: number) => string {\n const formatter = d3Format(format);\n return function (num: number) {\n const strVal = (Math.round(num * 100) / 100).toString();\n if (strVal.length <= 4) return strVal;\n return formatter(num);\n };\n}\n\nexport type StatChartView = \"min_max\" | \"25_75\" | \"normal\";\nexport type Quartiles = [number, number, number, number, number];\nexport type Data = [[number, number, number, number, number, number, number]];\n\nexport class StatChart extends HTMLWidget {\n\n protected _selectElement: any;\n protected _tickFormatter: (_: number) => string;\n\n protected _bellCurve: Scatter = new Scatter()\n .columns([\"\", \"Std. Dev.\"])\n .paletteID(\"Quartile\")\n .interpolate_default(\"basis\")\n .pointSize(0)\n .xAxisType(\"linear\")\n .xAxisOverlapMode(\"none\")\n .xAxisTickFormat(\",\")\n .yAxisHidden(true)\n .yAxisDomainLow(0)\n .yAxisDomainHigh(110)\n .yAxisGuideLines(false) as Scatter\n ;\n\n protected _candle = new QuartileCandlestick()\n .columns([\"Min\", \"25%\", \"50%\", \"75%\", \"Max\"])\n .edgePadding(0)\n .roundedCorners(1)\n .lineWidth(1)\n .upperTextRotation(-90)\n .lowerTextRotation(-90)\n .labelFontSize(0)\n .valueFontSize(0)\n .lineColor(rainbow(90, 0, 100))\n .innerRectColor(rainbow(10, 0, 100))\n ;\n\n constructor() {\n super();\n this\n .columns([\"Min\", \"25%\", \"50%\", \"75%\", \"Max\", \"Mean\", \"Std. Dev.\"])\n ;\n }\n\n protected stdDev(degrees: number): number {\n return this.mean() + degrees * this.standardDeviation();\n }\n\n protected formatStdDev(degrees: number): string {\n return this._tickFormatter(this.stdDev(degrees));\n }\n\n protected quartile(q: 0 | 1 | 2 | 3 | 4): number {\n return this.quartiles()[q];\n }\n\n protected formatQ(q: 0 | 1 | 2 | 3 | 4): string {\n return this._tickFormatter(this.quartile(q));\n }\n\n protected domain(mode: View): [number, number] {\n switch (mode) {\n case \"25_75\":\n return [this.quartile(1), this.quartile(3)];\n case \"normal\":\n return [this.stdDev(-4), this.stdDev(4)];\n case \"min_max\":\n default:\n return [this.quartile(0), this.quartile(4)];\n }\n }\n\n protected min(): number {\n return this.quartile(0);\n }\n\n protected max(): number {\n return this.quartile(4);\n }\n\n data(): Data;\n data(_: Data): this;\n data(_?: Data): Data | this {\n if (!arguments.length) return [[...this.quartiles(), this.mean(), this.standardDeviation()]];\n const row = _[0];\n this.quartiles([row[0], row[1], row[2], row[3], row[4]]);\n this.mean(row[5]);\n this.standardDeviation(row[6]);\n return this;\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n\n this._bellCurve.target(element.append(\"div\").node());\n\n this._candle.target(element.append(\"div\").node());\n\n this._selectElement = element.append(\"div\")\n .style(\"position\", \"absolute\")\n .style(\"top\", \"0px\")\n .style(\"right\", \"0px\").append(\"select\")\n .on(\"change\", () => {\n this.view(this._selectElement.node().value);\n this.lazyRender();\n })\n ;\n this._selectElement.append(\"option\").attr(\"value\", \"min_max\").text(\"Min / Max\");\n this._selectElement.append(\"option\").attr(\"value\", \"25_75\").text(\"25% / 75%\");\n this._selectElement.append(\"option\").attr(\"value\", \"normal\").text(\"Normal\");\n }\n\n protected bellTicks(mode: View): AxisTicks {\n let ticks: Ticks;\n switch (mode) {\n case \"25_75\":\n ticks = [\n { label: this.formatQ(1), value: this.quartile(1) },\n { label: this.formatQ(2), value: this.quartile(2) },\n { label: this.formatQ(3), value: this.quartile(3) }\n ];\n break;\n case \"normal\":\n ticks = [\n { label: this.formatStdDev(-4), value: this.stdDev(-4) },\n { label: \"-3σ\", value: this.stdDev(-3) },\n { label: \"-2σ\", value: this.stdDev(-2) },\n { label: \"-1σ\", value: this.stdDev(-1) },\n { label: this.formatStdDev(0), value: this.stdDev(0) },\n { label: \"+1σ\", value: this.stdDev(1) },\n { label: \"+2σ\", value: this.stdDev(2) },\n { label: \"+3σ\", value: this.stdDev(3) },\n { label: this.formatStdDev(4), value: this.stdDev(4) }\n ];\n break;\n case \"min_max\":\n default:\n ticks = [\n { label: this.formatQ(0), value: this.quartile(0) },\n { label: this.formatQ(1), value: this.quartile(1) },\n { label: this.formatQ(2), value: this.quartile(2) },\n { label: this.formatQ(3), value: this.quartile(3) },\n { label: this.formatQ(4), value: this.quartile(4) }\n ];\n }\n\n const [domainLow, domainHigh] = this.domain(this._selectElement.node().value);\n return ticks\n .filter(sd => sd.value >= domainLow && sd.value <= domainHigh)\n .map(sd => ({ label: sd.label, value: sd.value.toString() }))\n ;\n }\n\n updateScatter() {\n const mode = this._selectElement.node().value;\n const [domainLow, domainHigh] = this.domain(mode);\n const padding = (domainHigh - domainLow) * (this.domainPadding() / 100);\n\n this._bellCurve\n .xAxisDomainLow(domainLow - padding)\n .xAxisDomainHigh(domainHigh + padding)\n .xAxisTicks(this.bellTicks(mode))\n .data([\n [this.stdDev(-4), 0],\n [this.stdDev(-3), 0.3],\n [this.stdDev(-2), 5],\n [this.stdDev(-1), 68],\n [this.stdDev(0), 100],\n [this.stdDev(1), 68],\n [this.stdDev(2), 5],\n [this.stdDev(3), 0.3],\n [this.stdDev(4), 0]\n ])\n .resize({ width: this.width(), height: this.height() - this.candleHeight() })\n .render()\n ;\n }\n\n updateCandle() {\n const candleX = this._bellCurve.dataPos(this.quartile(0));\n const candleW = this._bellCurve.dataPos(this.quartile(4)) - candleX;\n this._candle\n .resize({ width: this.width(), height: this.candleHeight() })\n .pos({ x: (candleX + candleW / 2) + 2, y: this.candleHeight() / 2 })\n .width(candleW)\n .candleWidth(this.candleHeight())\n .data(this.quartiles())\n .render()\n ;\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n this._tickFormatter = myFormatter(this.tickFormat());\n this._selectElement.node().value = this.view();\n this.updateScatter();\n this.updateCandle();\n }\n\n exit(domNode, element) {\n this._bellCurve.target(null);\n this._candle.target(null);\n this._selectElement.remove();\n\n super.exit(domNode, element);\n }\n}\nStatChart.prototype._class += \" chart_StatChart\";\n\nexport interface StatChart {\n view(): StatChartView;\n view(_: StatChartView): this;\n\n tickFormat(): string;\n tickFormat(_: string): this;\n candleHeight(): number;\n candleHeight(_: number): this;\n domainPadding(): number;\n domainPadding(_: number): this;\n\n mean(): number;\n mean(_: number): this;\n standardDeviation(): number;\n standardDeviation(_: number): this;\n quartiles(): Quartiles;\n quartiles(_: Quartiles): this;\n}\nStatChart.prototype.publish(\"view\", \"min_max\", \"set\", \"View\", [\"min_max\", \"25_75\", \"normal\"]);\n\nStatChart.prototype.publish(\"tickFormat\", \".2e\", \"string\", \"X-Axis Tick Format\");\nStatChart.prototype.publish(\"candleHeight\", 20, \"number\", \"Height of candle widget (pixels)\");\nStatChart.prototype.publish(\"domainPadding\", 10, \"number\", \"Domain value padding\");\n\nStatChart.prototype.publish(\"mean\", .5, \"number\", \"Mean\");\nStatChart.prototype.publish(\"standardDeviation\", .125, \"number\", \"Standard Deviation (σ)\");\nStatChart.prototype.publish(\"quartiles\", [0, .25, .5, .75, 1], \"object\", \"Quartiles (Min, 25%, 50%, 75%, Max)\");\n","import { Scatter } from \"./Scatter.ts\";\n\nexport class Step extends Scatter {\n constructor() {\n super();\n\n this\n .interpolate_default(\"step\")\n ;\n }\n}\nStep.prototype._class += \" chart_Step\";\n","import { I2DChart } from \"@hpcc-js/api\";\nimport { HTMLWidget } from \"@hpcc-js/common\";\nimport { rgb as d3Rgb } from \"d3-color\";\nimport { select as d3Select } from \"d3-selection\";\n\nimport \"../src/Summary.css\";\n\nconst TEXT = \"text\";\nconst HTML = \"html\";\n\nexport class Summary extends HTMLWidget {\n protected _playIntervalIdx = 0;\n protected _mainDiv;\n protected _headerDiv;\n protected _textDiv;\n\n constructor() {\n super();\n this._tag = \"div\";\n\n this._drawStartPos = \"center\";\n this.playInterval(this.playInterval());\n }\n\n lookupFieldIdx(propID, defaultIdx?: number) {\n let retVal = defaultIdx;\n if (this[propID + \"_exists\"]()) {\n retVal = this.columns().indexOf(this[propID]());\n if (retVal < 0) {\n return undefined;\n }\n }\n return retVal;\n }\n\n lookupFieldText(propID, defaultIdx?: number) {\n if (this[propID + \"_exists\"]()) {\n return this[propID]();\n }\n if (defaultIdx !== undefined) {\n return this.columns()[defaultIdx] || \"\";\n }\n return \"\";\n }\n\n currentRow() {\n return this.data()[this._playIntervalIdx];\n }\n\n summaryData() {\n let labelFieldIdx; // undefined\n if (!this.hideLabel()) {\n labelFieldIdx = this.lookupFieldIdx(\"labelColumn\", 0);\n }\n const iconFieldIdx = this.lookupFieldIdx(\"iconColumn\");\n const valueFieldIdx = this.lookupFieldIdx(\"valueColumn\", 1);\n let moreIconIdx; // undefined\n let moreTextIdx; // undefined\n if (!this.hideMore()) {\n moreIconIdx = this.lookupFieldIdx(\"moreIconColumn\");\n moreTextIdx = this.lookupFieldIdx(\"moreTextColumn\");\n }\n const colorFillIdx = this.lookupFieldIdx(\"colorFillColumn\");\n const colorStrokeIdx = this.lookupFieldIdx(\"colorStrokeColumn\");\n return this.formattedData().map(function (row) {\n return {\n icon: iconFieldIdx === undefined ? this.icon() : row[iconFieldIdx],\n label: labelFieldIdx === undefined ? \"\" : row[labelFieldIdx],\n value: row[valueFieldIdx],\n moreIcon: moreIconIdx === undefined ? (this.hideMore() ? \"\" : this.moreIcon()) : row[moreIconIdx],\n moreText: moreTextIdx === undefined ? (this.hideMore() ? \"\" : this.moreText()) : row[moreTextIdx],\n fill: colorFillIdx === undefined ? this.colorFill() : row[colorFillIdx],\n stroke: colorStrokeIdx === undefined ? this.colorStroke() : row[colorStrokeIdx]\n };\n }, this);\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n this._mainDiv = element.append(\"div\")\n ;\n const context = this;\n this._headerDiv = this._mainDiv.append(\"h2\")\n .on(\"click\", function () {\n context.click(context.rowToObj(context.currentRow()), context.lookupFieldText(\"valueColumn\", 1), true);\n })\n .on(\"dblclick\", function () {\n context.dblclick(context.rowToObj(context.currentRow()), context.lookupFieldText(\"valueColumn\", 1), true);\n })\n ;\n this._textDiv = this._mainDiv.append(\"div\")\n .attr(\"class\", \"text\")\n .on(\"click\", function () {\n context.click(context.rowToObj(context.currentRow()), context.lookupFieldText(\"labelColumn\", 0), true);\n })\n .on(\"dblclick\", function () {\n context.dblclick(context.rowToObj(context.currentRow()), context.lookupFieldText(\"labelColumn\", 0), true);\n })\n ;\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n if (this.data().length) {\n\n }\n const data = this.summaryData();\n if (this._playIntervalIdx >= data.length) {\n this._playIntervalIdx = 0;\n }\n const row: any = this._playIntervalIdx < data.length ? data[this._playIntervalIdx] : [\"\", \"\"];\n element\n .style(\"width\", this.fixedSize() ? this.minWidth_exists() ? this.minWidth() + \"px\" : null : \"100%\")\n .style(\"height\", this.fixedSize() ? this.minHeight_exists() ? this.minHeight() + \"px\" : null : \"100%\")\n ;\n this._mainDiv\n .attr(\"class\", \"content bgIcon \" + row.icon)\n .transition()\n .style(\"background-color\", row.fill)\n .style(\"color\", row.stroke)\n .style(\"min-width\", this.minWidth_exists() ? this.minWidth() + \"px\" : null)\n .style(\"min-height\", this.minHeight_exists() ? this.minHeight() + \"px\" : null)\n .style(\"font-size\", this.iconFontSize() + \"px\")\n ;\n this._headerDiv\n .transition()\n .style(\"color\", row.stroke)\n .style(\"font-size\", this.headerFontSize() + \"px\")\n [this.valueHTML() ? HTML : TEXT](row.value)\n ;\n this._textDiv\n .style(\"font-size\", this.textFontSize() + \"px\")\n [this.labelHTML() ? HTML : TEXT](row.label)\n ;\n const context = this;\n const moreDivs = this._mainDiv.selectAll(\".more\").data([row]);\n const moreDivsEnter = moreDivs.enter()\n .append(\"div\")\n .attr(\"class\", \"more\")\n .on(\"click\", function (d) {\n context.click(context.rowToObj(context.currentRow()), context.lookupFieldText(\"moreTextColumn\") || \"more\", true);\n })\n .each(function () {\n const element2 = d3Select(this);\n element2.append(\"i\");\n element2.append(\"span\");\n })\n ;\n const moreDivsUpdate = moreDivsEnter\n .merge(moreDivs)\n .style(\"display\", this.hideMoreWrapper() ? \"none\" : null)\n .style(\"font-size\", this.moreFontSize() + \"px\")\n .style(\"height\", this.moreWrapperHeight_exists() ? this.moreWrapperHeight() + \"px\" : null)\n .transition()\n .style(\"background-color\", d3Rgb(row.fill).darker(0.75).toString())\n ;\n moreDivsUpdate\n .select(\"i\")\n .attr(\"class\", function (d) {\n return \"fa \" + d.moreIcon;\n })\n ;\n if (this.moreTextHTML()) {\n moreDivsUpdate.select(\"span\")\n .each(function (d) {\n this.innerHTML = d.moreText;\n });\n } else {\n moreDivsUpdate.select(\"span\").text(d => d.moreText);\n }\n moreDivs.exit().remove();\n }\n\n exit(domNode, element) {\n super.exit(domNode, element);\n }\n}\nSummary.prototype._class += \" chart_Summary\";\nSummary.prototype.implements(I2DChart.prototype);\n\nexport interface Summary {\n iconColumn(): string;\n iconColumn(_: string): this;\n iconColumn_exists(): boolean;\n icon(): string;\n icon(_: string): this;\n icon_exists(): boolean;\n\n headerFontSize(): number;\n headerFontSize(_: number): this;\n textFontSize(): number;\n textFontSize(_: number): this;\n moreFontSize(): number;\n moreFontSize(_: number): this;\n iconFontSize(): number;\n iconFontSize(_: number): this;\n\n hideLabel(): boolean;\n hideLabel(_: boolean): this;\n hideLabel_exists(): boolean;\n labelColumn(): string;\n labelColumn(_: string): this;\n labelColumn_exists(): boolean;\n labelHTML(): boolean;\n labelHTML(_: boolean): this;\n labelHTML_exists(): boolean;\n\n valueColumn(): string;\n valueColumn(_: string): this;\n valueColumn_exists(): boolean;\n valueHTML(): boolean;\n valueHTML(_: boolean): this;\n valueHTML_exists(): boolean;\n\n hideMore(): boolean;\n hideMore(_: boolean): this;\n hideMore_exists(): boolean;\n hideMoreWrapper(): boolean;\n hideMoreWrapper(_: boolean): this;\n moreWrapperHeight(): number;\n moreWrapperHeight(_: number): this;\n moreWrapperHeight_exists(): boolean;\n moreIconColumn(): string;\n moreIconColumn(_: string): this;\n moreIconColumn_exists(): boolean;\n moreIcon(): string;\n moreIcon(_: string): this;\n moreIcon_exists(): boolean;\n moreTextColumn(): string;\n moreTextColumn(_: string): this;\n moreTextColumn_exists(): boolean;\n moreText(): string;\n moreText(_: string): this;\n moreText_exists(): boolean;\n moreTextHTML(): boolean;\n moreTextHTML(_: boolean): this;\n moreTextHTML_exists(): boolean;\n\n colorFillColumn(): string;\n colorFillColumn(_: string): this;\n colorFillColumn_exists(): boolean;\n colorFill(): string;\n colorFill(_: string): this;\n colorFill_exists(): boolean;\n colorStrokeColumn(): string;\n colorStrokeColumn(_: string): this;\n colorStrokeColumn_exists(): boolean;\n colorStroke(): string;\n colorStroke(_: string): this;\n colorStroke_exists(): boolean;\n\n fixedSize(): boolean;\n fixedSize(_: boolean): this;\n fixedSize_exists(): boolean;\n minWidth(): number;\n minWidth(_: number): this;\n minWidth_exists(): boolean;\n minHeight(): number;\n minHeight(_: number): this;\n minHeight_exists(): boolean;\n playInterval(): number;\n playInterval(_: number): this;\n playInterval_exists(): boolean;\n\n // I2DChart ---\n click(row, column, selected);\n dblclick(row, column, selected);\n}\n\nSummary.prototype.publish(\"iconColumn\", null, \"set\", \"Select Icon Column\", function () { return this.columns(); }, { optional: true });\nSummary.prototype.publish(\"icon\", \"fa-briefcase\", \"string\", \"FA Char icon class\", null, { disable: (w) => w.iconColumn() });\n\nSummary.prototype.publish(\"headerFontSize\", null, \"number\", \"headerFontSize\");\nSummary.prototype.publish(\"textFontSize\", null, \"number\", \"textFontSize\");\nSummary.prototype.publish(\"moreFontSize\", null, \"number\", \"moreFontSize\");\nSummary.prototype.publish(\"iconFontSize\", null, \"number\", \"iconFontSize\");\n\nSummary.prototype.publish(\"hideLabel\", false, \"boolean\", \"Hide label column\");\nSummary.prototype.publish(\"labelColumn\", null, \"set\", \"Select display value\", function () { return this.columns(); }, { optional: true, disable: (w) => w.hideLabel() });\nSummary.prototype.publish(\"labelHTML\", false, \"boolean\", \"Allow HTML\", null, { disable: (w) => w.hideLabel() });\n\nSummary.prototype.publish(\"valueColumn\", null, \"set\", \"Select display value\", function () { return this.columns(); }, { optional: true });\nSummary.prototype.publish(\"valueHTML\", false, \"boolean\", \"Allow HTML\");\n\nSummary.prototype.publish(\"hideMore\", false, \"boolean\", \"Hide More Information\");\nSummary.prototype.publish(\"hideMoreWrapper\", false, \"boolean\", \"Hide More Information Wrapper\");\nSummary.prototype.publish(\"moreWrapperHeight\", null, \"number\", \"Height of the 'more' text wrapper (pixels)\");\nSummary.prototype.publish(\"moreIconColumn\", null, \"set\", \"Select More Icon Column\", function () { return this.columns(); }, { optional: true, disable: (w) => w.hideMore() });\nSummary.prototype.publish(\"moreIcon\", \"fa-info-circle\", \"string\", \"FA Char icon class\", null, { disable: (w) => w.hideMore() || w.moreIconColumn() });\nSummary.prototype.publish(\"moreTextColumn\", null, \"set\", \"Select display value\", function () { return this.columns(); }, { optional: true, disable: (w) => w.hideMore() });\nSummary.prototype.publish(\"moreText\", \"More Info\", \"string\", \"More text\", null, { disable: (w) => w.hideMore() || w.moreTextColumn() });\nSummary.prototype.publish(\"moreTextHTML\", false, \"boolean\", \"Allow HTML\", null, { disable: (w) => w.hideMore() });\n\nSummary.prototype.publish(\"colorFillColumn\", null, \"set\", \"Column for color\", function () { return this.columns(); }, { optional: true });\nSummary.prototype.publish(\"colorFill\", \"#3498db\", \"html-color\", \"Fill Color\", null, { disable: (w) => w.colorFillColumn() });\nSummary.prototype.publish(\"colorStrokeColumn\", null, \"set\", \"Column for color\", function () { return this.columns(); }, { optional: true });\nSummary.prototype.publish(\"colorStroke\", \"#ffffff\", \"html-color\", \"Fill Color\", null, { disable: (w) => w.colorStrokeColumn() });\n\nSummary.prototype.publish(\"fixedSize\", true, \"boolean\", \"Fix Size to Min Width/Height\");\nSummary.prototype.publish(\"minWidth\", 225, \"number\", \"Minimum Width\");\nSummary.prototype.publish(\"minHeight\", 150, \"number\", \"Minimum Height\");\nSummary.prototype.publish(\"playInterval\", null, \"number\", \"Play Interval\", null, { optional: true });\n\nconst playInterval = Summary.prototype.playInterval;\nSummary.prototype.playInterval = function (_?: number): number | any {\n const retVal = playInterval.apply(this, arguments);\n if (arguments.length) {\n if (this._playIntervalHandle) {\n clearInterval(this._playIntervalHandle);\n }\n const context = this;\n if (_) {\n this._playIntervalHandle = setInterval(function () {\n context._playIntervalIdx++;\n if (context._renderCount && context.data().length) {\n context.render();\n }\n }, _);\n }\n }\n return retVal;\n};\n","import { I2DChart } from \"@hpcc-js/api\";\nimport { CanvasWidget, Utility } from \"@hpcc-js/common\";\n\nexport class SummaryC extends CanvasWidget {\n protected _playIntervalIdx = 0;\n\n constructor() {\n super();\n I2DChart.call(this);\n this.playInterval(this.playInterval());\n }\n\n currentRow() {\n return this.data()[this._playIntervalIdx];\n }\n\n enter(domNode, element) {\n super.enter.apply(this, arguments);\n const { width, height } = this.size();\n domNode.height = height;\n domNode.width = width;\n }\n\n update(domNode, element) {\n super.update.apply(this, arguments);\n const context = this;\n if (this._playIntervalIdx >= this.data().length) {\n this._playIntervalIdx = 0;\n }\n const size = this.size();\n const minDimension = Math.min(size.width, size.height);\n const sizeRatio = this.fontSizeRatio();\n const labelIdx = this.columns().indexOf(this.labelColumn());\n const valueIdx = this.columns().indexOf(this.valueColumn());\n const bgColorIdx = this.columns().indexOf(this.colorFillColumn());\n const fontColorIdx = this.columns().indexOf(this.colorStrokeColumn());\n const iconIdx = this.columns().indexOf(this.iconColumn());\n const icon = iconIdx !== -1 ? this.currentRow()[iconIdx] : this.icon();\n const label = labelIdx !== -1 ? this.currentRow()[labelIdx] : \"\";\n const value = valueIdx !== -1 ? this.currentRow()[valueIdx] : \"\";\n const bgColor = bgColorIdx !== -1 ? this.currentRow()[bgColorIdx] : this.colorFill();\n const fontColor = fontColorIdx !== -1 ? this.currentRow()[fontColorIdx] : this.colorStroke();\n\n let mainFontSize = size.height * (sizeRatio - this.paddingSizeRatio());\n const subFontSize = size.height * (1 - sizeRatio - this.paddingSizeRatio());\n const iconSize = size.height * (this.iconSizeRatio() - this.paddingSizeRatio());\n const p = minDimension * this.paddingSizeRatio();\n const ctx = domNode.getContext(\"2d\");\n\n ctx.clearRect(0, 0, size.width, size.height);\n\n const fontFamily = context.fontFamily();\n\n ctx.fillStyle = bgColor;\n ctx.fillRect(0, 0, size.width, size.height);\n\n ctx.globalAlpha = this.iconOpacity();\n drawIcon(Utility.faChar(icon), iconSize, context.iconAnchor());\n\n ctx.globalAlpha = this.valueOpacity();\n mainFontSize = drawText(value, p, mainFontSize, context.valueAnchor());\n\n ctx.globalAlpha = this.labelOpacity();\n drawText(label, mainFontSize + p, subFontSize, context.labelAnchor());\n\n function drawText(text, y, fontSize, anchorMode) {\n ctx.textBaseline = \"top\";\n ctx.font = `${fontSize}px ${fontFamily}`;\n ctx.fillStyle = fontColor;\n let measurement = ctx.measureText(text);\n if (measurement.width > (size.width - (p * 2))) {\n const fontSizeMult = (size.width - (p * 2)) / measurement.width;\n fontSize = fontSize * fontSizeMult;\n ctx.font = `${fontSize}px ${fontFamily}`;\n measurement = ctx.measureText(text);\n }\n const x = getTextOffsetX(measurement.width, anchorMode);\n ctx.fillText(text, x, y);\n return fontSize;\n }\n\n function drawIcon(text, fontSize, anchorMode) {\n if (typeof text === \"undefined\") return;\n ctx.textBaseline = context.iconBaseline();\n ctx.font = `${fontSize}px FontAwesome`;\n ctx.fillStyle = fontColor;\n let measurement = ctx.measureText(text);\n if (measurement.width > (size.width - (p * 2))) {\n const fontSizeMult = (size.width - (p * 2)) / measurement.width;\n ctx.font = `${fontSize * fontSizeMult}px FontAwesome`;\n measurement = ctx.measureText(text);\n }\n const x = getTextOffsetX(measurement.width, anchorMode);\n const y = getTextOffsetY(context.iconBaseline());\n ctx.fillText(text, x, y);\n }\n\n function getTextOffsetX(width, anchorMode) {\n switch (anchorMode) {\n case \"start\":\n return p;\n case \"middle\":\n return (size.width / 2) - (width / 2);\n case \"end\":\n return size.width - width - p;\n }\n }\n function getTextOffsetY(anchorMode) {\n switch (anchorMode) {\n case \"top\":\n return p;\n case \"middle\":\n return size.height / 2;\n case \"bottom\":\n return size.height - p;\n }\n }\n }\n}\nSummaryC.prototype._class += \" chart_SummaryC\";\nSummaryC.prototype.implements(I2DChart.prototype);\n\nexport interface SummaryC {\n iconColumn(): string;\n iconColumn(_: string): this;\n iconColumn_exists(): boolean;\n icon(): string;\n icon(_: string): this;\n icon_exists(): boolean;\n iconOpacity(): number;\n iconOpacity(_: number): this;\n\n fontFamily(): string;\n fontFamily(_: string): this;\n\n labelColumn(): string;\n labelColumn(_: string): this;\n labelColumn_exists(): boolean;\n labelOpacity(): number;\n labelOpacity(_: number): this;\n\n valueColumn(): string;\n valueColumn(_: string): this;\n valueColumn_exists(): boolean;\n valueOpacity(): number;\n valueOpacity(_: number): this;\n\n fontSizeRatio(): number;\n fontSizeRatio(_: number): this;\n\n colorFillColumn(): string;\n colorFillColumn(_: string): this;\n colorFillColumn_exists(): boolean;\n colorFill(): string;\n colorFill(_: string): this;\n colorFill_exists(): boolean;\n colorStrokeColumn(): string;\n colorStrokeColumn(_: string): this;\n colorStrokeColumn_exists(): boolean;\n colorStroke(): string;\n colorStroke(_: string): this;\n colorStroke_exists(): boolean;\n\n fixedSize(): boolean;\n fixedSize(_: boolean): this;\n fixedSize_exists(): boolean;\n minWidth(): number;\n minWidth(_: number): this;\n minWidth_exists(): boolean;\n minHeight(): number;\n minHeight(_: number): this;\n minHeight_exists(): boolean;\n playInterval(): number;\n playInterval(_: number): this;\n playInterval_exists(): boolean;\n paddingSizeRatio(): number;\n paddingSizeRatio(_: number): this;\n iconSizeRatio(): number;\n iconSizeRatio(_: number): this;\n\n iconAnchor(): \"start\" | \"middle\" | \"end\";\n iconAnchor(_: \"start\" | \"middle\" | \"end\"): this;\n labelAnchor(): \"start\" | \"middle\" | \"end\";\n labelAnchor(_: \"start\" | \"middle\" | \"end\"): this;\n valueAnchor(): \"start\" | \"middle\" | \"end\";\n valueAnchor(_: \"start\" | \"middle\" | \"end\"): this;\n\n iconBaseline(): \"top\" | \"middle\" | \"bottom\";\n iconBaseline(_: \"top\" | \"middle\" | \"bottom\"): this;\n}\n\nSummaryC.prototype.publish(\"iconBaseline\", \"bottom\", \"string\", \"Text baseline for the icon\", [\"top\", \"middle\", \"bottom\"]);\nSummaryC.prototype.publish(\"iconAnchor\", \"end\", \"set\", \"Anchors the icon either at the start, middle, or end of the summary\", [\"start\", \"middle\", \"end\"]);\nSummaryC.prototype.publish(\"valueAnchor\", \"start\", \"set\", \"Anchors the value either at the start, middle, or end of the summary\", [\"start\", \"middle\", \"end\"]);\nSummaryC.prototype.publish(\"labelAnchor\", \"start\", \"set\", \"Anchors the label either at the start, middle, or end of the summary\", [\"start\", \"middle\", \"end\"]);\nSummaryC.prototype.publish(\"iconColumn\", null, \"set\", \"Select Icon Column\", function () { return this.columns(); }, { optional: true });\nSummaryC.prototype.publish(\"icon\", \"fa-briefcase\", \"string\", \"FA Char icon class\", null, { disable: (w) => w.iconColumn() });\n\nSummaryC.prototype.publish(\"fontFamily\", \"Arial\", \"string\", \"Font Family\");\n\nSummaryC.prototype.publish(\"labelColumn\", null, \"set\", \"Select display value\", function () { return this.columns(); }, { optional: true });\nSummaryC.prototype.publish(\"valueColumn\", null, \"set\", \"Select display value\", function () { return this.columns(); }, { optional: true });\n\nSummaryC.prototype.publish(\"colorFillColumn\", null, \"set\", \"Column for background color\", function () { return this.columns(); }, { optional: true });\nSummaryC.prototype.publish(\"colorFill\", \"#0097e6\", \"html-color\", \"Background Color\", null, { disable: (w) => w.colorFillColumn() });\nSummaryC.prototype.publish(\"colorStrokeColumn\", null, \"set\", \"Column for font color\", function () { return this.columns(); }, { optional: true });\nSummaryC.prototype.publish(\"colorStroke\", \"#2f3640\", \"html-color\", \"Font Color\", null, { disable: (w) => w.colorStrokeColumn() });\n\nSummaryC.prototype.publish(\"fixedSize\", true, \"boolean\", \"Fix Size to Min Width/Height\");\nSummaryC.prototype.publish(\"minWidth\", 225, \"number\", \"Minimum Width\");\nSummaryC.prototype.publish(\"minHeight\", 150, \"number\", \"Minimum Height\");\nSummaryC.prototype.publish(\"playInterval\", null, \"number\", \"Play Interval\", null, { optional: true });\n\nSummaryC.prototype.publish(\"fontSizeRatio\", 0.618, \"number\", \"Ratio between widget height and value font size\");\nSummaryC.prototype.publish(\"valueOpacity\", 1, \"number\", \"Opacity of value text (0..1)\");\nSummaryC.prototype.publish(\"labelOpacity\", 0.9, \"number\", \"Opacity of label text (0..1)\");\nSummaryC.prototype.publish(\"iconOpacity\", 0.3, \"number\", \"Opacity of icon text (0..1)\");\n\nSummaryC.prototype.publish(\"paddingSizeRatio\", 0.1, \"number\", \"Ratio of the smallest dimension for edge padding (0..1)\");\nSummaryC.prototype.publish(\"iconSizeRatio\", 0.9, \"number\", \"Ratio of the height for icon size (0..1)\");\n\nconst playInterval = SummaryC.prototype.playInterval;\nSummaryC.prototype.playInterval = function (_?: number): number | any {\n const retVal = playInterval.apply(this, arguments);\n if (arguments.length) {\n if (this._playIntervalHandle) {\n clearInterval(this._playIntervalHandle);\n }\n const context = this;\n if (_) {\n this._playIntervalHandle = setInterval(function () {\n context._playIntervalIdx++;\n if (context._renderCount && context.data().length) {\n context.render();\n }\n }, _);\n }\n }\n return retVal;\n};\n","// Word cloud layout by Jason Davies, https://www.jasondavies.com/wordcloud/\n// Algorithm due to Jonathan Feinberg, http://static.mrfeinberg.com/bv_ch03.pdf\n\nimport { dispatch } from \"d3-dispatch\";\n\nconst cloudRadians = Math.PI / 180;\nconst cw = 1 << 11 >> 5;\nconst ch = 1 << 11;\n\nexport function d3Cloud() {\n const event = dispatch(\"word\", \"end\");\n const cloud: any = {};\n\n let size = [256, 256];\n let text = cloudText;\n let font = cloudFont;\n let fontSize = cloudFontSize;\n let fontStyle = cloudFontNormal;\n let fontWeight = cloudFontNormal;\n let rotate = cloudRotate;\n let padding = cloudPadding;\n let words = [];\n let spiral = archimedeanSpiral;\n let timeInterval = Infinity;\n let timer = null;\n let random = Math.random;\n let canvas = cloudCanvas;\n\n cloud.canvas = function (_?) {\n return arguments.length ? (canvas = functor(_), cloud) : canvas;\n };\n\n cloud.start = function () {\n const contextAndRatio = getContext(canvas());\n const board = zeroArray((size[0] >> 5) * size[1]);\n let bounds = null;\n const n = words.length;\n let i = -1;\n const tags = [];\n const data = words.map(function (d, i) {\n d.text = text.call(this, d, i);\n d.font = font.call(this, d, i);\n d.style = fontStyle.call(this, d, i);\n d.weight = fontWeight.call(this, d, i);\n d.rotate = rotate.call(this, d, i);\n d.size = ~~fontSize.call(this, d, i);\n d.padding = padding.call(this, d, i);\n return d;\n }).sort(function (a, b) { return b.size - a.size; });\n\n if (timer) clearInterval(timer);\n timer = setInterval(step, 0);\n step();\n\n return cloud;\n\n function step() {\n const start = Date.now();\n while (Date.now() - start < timeInterval && ++i < n && timer) {\n const d = data[i];\n d.x = (size[0] * (random() + .5)) >> 1;\n d.y = (size[1] * (random() + .5)) >> 1;\n cloudSprite(contextAndRatio, d, data, i);\n if (d.hasText && place(board, d, bounds)) {\n tags.push(d);\n event.call(\"word\", cloud, d);\n if (bounds) cloudBounds(bounds, d);\n else bounds = [{ x: d.x + d.x0, y: d.y + d.y0 }, { x: d.x + d.x1, y: d.y + d.y1 }];\n // Temporary hack\n d.x -= size[0] >> 1;\n d.y -= size[1] >> 1;\n }\n }\n if (i >= n) {\n cloud.stop();\n event.call(\"end\", cloud, tags, bounds);\n }\n }\n };\n\n cloud.stop = function () {\n if (timer) {\n clearInterval(timer);\n timer = null;\n }\n return cloud;\n };\n\n function getContext(canvas) {\n canvas.width = canvas.height = 1;\n const ratio = Math.sqrt(canvas.getContext(\"2d\").getImageData(0, 0, 1, 1).data.length >> 2);\n canvas.width = (cw << 5) / ratio;\n canvas.height = ch / ratio;\n\n const context = canvas.getContext(\"2d\");\n context.fillStyle = context.strokeStyle = \"red\";\n context.textAlign = \"center\";\n\n return { context, ratio };\n }\n\n function place(board, tag, bounds) {\n const startX = tag.x;\n const startY = tag.y;\n const maxDelta = Math.sqrt(size[0] * size[0] + size[1] * size[1]);\n const s = spiral(size);\n const dt = random() < .5 ? 1 : -1;\n let t = -dt;\n let dxdy;\n let dx;\n let dy;\n\n // eslint-disable-next-line no-cond-assign\n while (dxdy = s(t += dt)) {\n dx = ~~dxdy[0];\n dy = ~~dxdy[1];\n\n if (Math.min(Math.abs(dx), Math.abs(dy)) >= maxDelta) break;\n\n tag.x = startX + dx;\n tag.y = startY + dy;\n\n if (tag.x + tag.x0 < 0 || tag.y + tag.y0 < 0 ||\n tag.x + tag.x1 > size[0] || tag.y + tag.y1 > size[1]) continue;\n // TODO only check for collisions within current bounds.\n if (!bounds || !cloudCollide(tag, board, size[0])) {\n if (!bounds || collideRects(tag, bounds)) {\n const sprite = tag.sprite;\n const w = tag.width >> 5;\n const sw = size[0] >> 5;\n const lx = tag.x - (w << 4);\n const sx = lx & 0x7f;\n const msx = 32 - sx;\n const h = tag.y1 - tag.y0;\n let x = (tag.y + tag.y0) * sw + (lx >> 5);\n let last;\n for (let j = 0; j < h; j++) {\n last = 0;\n for (let i = 0; i <= w; i++) {\n board[x + i] |= (last << msx) | (i < w ? (last = sprite[j * w + i]) >>> sx : 0);\n }\n x += sw;\n }\n delete tag.sprite;\n return true;\n }\n }\n }\n return false;\n }\n\n cloud.timeInterval = function (_?) {\n return arguments.length ? (timeInterval = _ == null ? Infinity : _, cloud) : timeInterval;\n };\n\n cloud.words = function (_?) {\n return arguments.length ? (words = _, cloud) : words;\n };\n\n cloud.size = function (_?) {\n return arguments.length ? (size = [+_[0], +_[1]], cloud) : size;\n };\n\n cloud.font = function (_?) {\n return arguments.length ? (font = functor(_), cloud) : font;\n };\n\n cloud.fontStyle = function (_?) {\n return arguments.length ? (fontStyle = functor(_), cloud) : fontStyle;\n };\n\n cloud.fontWeight = function (_?) {\n return arguments.length ? (fontWeight = functor(_), cloud) : fontWeight;\n };\n\n cloud.rotate = function (_?) {\n return arguments.length ? (rotate = functor(_), cloud) : rotate;\n };\n\n cloud.text = function (_?) {\n return arguments.length ? (text = functor(_), cloud) : text;\n };\n\n cloud.spiral = function (_?) {\n return arguments.length ? (spiral = spirals[_] || _, cloud) : spiral;\n };\n\n cloud.fontSize = function (_?) {\n return arguments.length ? (fontSize = functor(_), cloud) : fontSize;\n };\n\n cloud.padding = function (_?) {\n return arguments.length ? (padding = functor(_), cloud) : padding;\n };\n\n cloud.random = function (_?) {\n return arguments.length ? (random = _, cloud) : random;\n };\n\n cloud.on = function () {\n const value = event.on.apply(event, arguments);\n return value === event ? cloud : value;\n };\n\n return cloud;\n}\n\nfunction cloudText(d) {\n return d.text;\n}\n\nfunction cloudFont() {\n return \"serif\";\n}\n\nfunction cloudFontNormal() {\n return \"normal\";\n}\n\nfunction cloudFontSize(d) {\n return Math.sqrt(d.value);\n}\n\nfunction cloudRotate() {\n return (~~(Math.random() * 6) - 3) * 30;\n}\n\nfunction cloudPadding() {\n return 1;\n}\n\n// Fetches a monochrome sprite bitmap for the specified text.\n// Load in batches for speed.\nfunction cloudSprite(contextAndRatio, d, data, di) {\n if (d.sprite) return;\n const c = contextAndRatio.context;\n const ratio = contextAndRatio.ratio;\n\n c.clearRect(0, 0, (cw << 5) / ratio, ch / ratio);\n let x = 0;\n let y = 0;\n let maxh = 0;\n const n = data.length;\n --di;\n while (++di < n) {\n d = data[di];\n c.save();\n c.font = d.style + \" \" + d.weight + \" \" + ~~((d.size + 1) / ratio) + \"px \" + d.font;\n let w = c.measureText(d.text + \"m\").width * ratio;\n let h = d.size << 1;\n if (d.rotate) {\n const sr = Math.sin(d.rotate * cloudRadians);\n const cr = Math.cos(d.rotate * cloudRadians);\n const wcr = w * cr;\n const wsr = w * sr;\n const hcr = h * cr;\n const hsr = h * sr;\n w = (Math.max(Math.abs(wcr + hsr), Math.abs(wcr - hsr)) + 0x1f) >> 5 << 5;\n h = ~~Math.max(Math.abs(wsr + hcr), Math.abs(wsr - hcr));\n } else {\n w = (w + 0x1f) >> 5 << 5;\n }\n if (h > maxh) maxh = h;\n if (x + w >= (cw << 5)) {\n x = 0;\n y += maxh;\n maxh = 0;\n }\n if (y + h >= ch) break;\n c.translate((x + (w >> 1)) / ratio, (y + (h >> 1)) / ratio);\n if (d.rotate) c.rotate(d.rotate * cloudRadians);\n c.fillText(d.text, 0, 0);\n if (d.padding) {\n c.lineWidth = 2 * d.padding;\n c.strokeText(d.text, 0, 0);\n }\n c.restore();\n d.width = w;\n d.height = h;\n d.xoff = x;\n d.yoff = y;\n d.x1 = w >> 1;\n d.y1 = h >> 1;\n d.x0 = -d.x1;\n d.y0 = -d.y1;\n d.hasText = true;\n x += w;\n }\n const pixels = c.getImageData(0, 0, (cw << 5) / ratio, ch / ratio).data;\n const sprite = [];\n while (--di >= 0) {\n d = data[di];\n if (!d.hasText) continue;\n const w = d.width;\n const w32 = w >> 5;\n let h = d.y1 - d.y0;\n // Zero the buffer\n for (let i = 0; i < h * w32; i++) sprite[i] = 0;\n x = d.xoff;\n if (x == null) return;\n y = d.yoff;\n let seen = 0;\n let seenRow = -1;\n for (let j = 0; j < h; j++) {\n for (let i = 0; i < w; i++) {\n const k = w32 * j + (i >> 5);\n const m = pixels[((y + j) * (cw << 5) + (x + i)) << 2] ? 1 << (31 - (i % 32)) : 0;\n sprite[k] |= m;\n seen |= m;\n }\n if (seen) seenRow = j;\n else {\n d.y0++;\n h--;\n j--;\n y++;\n }\n }\n d.y1 = d.y0 + seenRow;\n d.sprite = sprite.slice(0, (d.y1 - d.y0) * w32);\n }\n}\n\n// Use mask-based collision detection.\nfunction cloudCollide(tag, board, sw) {\n sw >>= 5;\n const sprite = tag.sprite;\n const w = tag.width >> 5;\n const lx = tag.x - (w << 4);\n const sx = lx & 0x7f;\n const msx = 32 - sx;\n const h = tag.y1 - tag.y0;\n let x = (tag.y + tag.y0) * sw + (lx >> 5);\n let last;\n for (let j = 0; j < h; j++) {\n last = 0;\n for (let i = 0; i <= w; i++) {\n if (((last << msx) | (i < w ? (last = sprite[j * w + i]) >>> sx : 0))\n & board[x + i]) return true;\n }\n x += sw;\n }\n return false;\n}\n\nfunction cloudBounds(bounds, d) {\n const b0 = bounds[0];\n const b1 = bounds[1];\n if (d.x + d.x0 < b0.x) b0.x = d.x + d.x0;\n if (d.y + d.y0 < b0.y) b0.y = d.y + d.y0;\n if (d.x + d.x1 > b1.x) b1.x = d.x + d.x1;\n if (d.y + d.y1 > b1.y) b1.y = d.y + d.y1;\n}\n\nfunction collideRects(a, b) {\n return a.x + a.x1 > b[0].x && a.x + a.x0 < b[1].x && a.y + a.y1 > b[0].y && a.y + a.y0 < b[1].y;\n}\n\nfunction archimedeanSpiral(size) {\n const e = size[0] / size[1];\n return function (t) {\n return [e * (t *= .1) * Math.cos(t), t * Math.sin(t)];\n };\n}\n\nfunction rectangularSpiral(size) {\n const dy = 4;\n const dx = dy * size[0] / size[1];\n let x = 0;\n let y = 0;\n return function (t) {\n const sign = t < 0 ? -1 : 1;\n // See triangular numbers: T_n = n * (n + 1) / 2.\n switch ((Math.sqrt(1 + 4 * sign * t) - sign) & 3) {\n case 0: x += dx; break;\n case 1: y += dy; break;\n case 2: x -= dx; break;\n default: y -= dy; break;\n }\n return [x, y];\n };\n}\n\n// TODO reuse arrays?\nfunction zeroArray(n) {\n const a = [];\n let i = -1;\n while (++i < n) a[i] = 0;\n return a;\n}\n\nfunction cloudCanvas() {\n return document.createElement(\"canvas\");\n}\n\nfunction functor(d) {\n return typeof d === \"function\" ? d : function () { return d; };\n}\n\nconst spirals = {\n archimedean: archimedeanSpiral,\n rectangular: rectangularSpiral\n};\n","import { I2DChart, ITooltip } from \"@hpcc-js/api\";\nimport { d3Event, InputField, SVGWidget, Utility, zoom as d3Zoom } from \"@hpcc-js/common\";\nimport { extent as d3Extent } from \"d3-array\";\nimport { scaleLinear as d3ScaleLinear, scaleLog as d3ScaleLog, scalePow as d3ScalePow, scaleSqrt as d3ScaleSqrt } from \"d3-scale\";\nimport { d3Cloud } from \"./D3Cloud.ts\";\n\nimport \"../src/WordCloud.css\";\n\nexport class WordCloud extends SVGWidget {\n static __inputs: InputField[] = [{\n id: \"label\",\n type: \"string\"\n }, {\n id: \"value\",\n type: \"number\"\n }];\n\n private _prevOffsetX;\n private _prevOffsetY;\n private _prevZoom;\n private _root;\n private _canvas;\n private _d3Cloud;\n private _d3Zoom;\n\n constructor() {\n super();\n I2DChart.call(this);\n ITooltip.call(this);\n Utility.SimpleSelectionMixin.call(this);\n\n this._prevOffsetX = this.offsetX();\n this._prevOffsetY = this.offsetY();\n this._prevZoom = this.zoom();\n }\n\n calcData() {\n return this.data().map(row => {\n return {\n __viz_label: row[0],\n __viz_weight: row[1],\n __viz_row: row\n };\n });\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n this._selection.widgetElement(element);\n\n this._root = element.append(\"g\");\n this._canvas = document.createElement(\"canvas\");\n\n const context = this;\n this._d3Zoom = d3Zoom()\n .scaleExtent([0.1, 10])\n ;\n this._d3Zoom\n .on(\"zoom\", function (evt) {\n const event = d3Event();\n if (event && event.transform) {\n context.zoomed(context._d3Zoom, [event.transform.x, event.transform.y], event.transform.k);\n }\n })\n ;\n element.call(this._d3Zoom);\n\n this\n .tooltipHTML(function (d) {\n const columns = context.columns();\n const series = columns && columns.length ? columns[0] : \"Word\";\n return context.tooltipFormat({ label: d.__viz_label, series, value: d.__viz_weight });\n })\n ;\n }\n\n update(domNode, element) {\n super.update(domNode, element);\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._d3Cloud = d3Cloud()\n .canvas(() => this._canvas)\n ;\n\n this.zoomed(this, [this.offsetX(), this.offsetY()], this.zoom());\n\n const data = this.calcData();\n const context = this;\n const extent = d3Extent(data, function (d: any) { return d.__viz_weight; });\n let scaler;\n switch (this.scaleMode()) {\n case \"log\":\n scaler = d3ScaleLog;\n break;\n case \"sqrt\":\n scaler = d3ScaleSqrt;\n break;\n case \"pow\":\n scaler = d3ScalePow;\n break;\n case \"linear\":\n default:\n scaler = d3ScaleLinear;\n break;\n }\n const scale = scaler().domain(extent).range([this.fontSizeFrom(), this.fontSizeTo()]);\n const angleDomain = d3ScaleLinear().domain([0, context.angleCount() - 1]).range([context.angleFrom(), context.angleTo()]);\n\n this._d3Cloud.stop()\n .size([this.width(), this.height()])\n .words(data)\n .font(this.fontFamily())\n .padding(this.padding())\n .spiral(this.spiral())\n .text(function (d) {\n return d.__viz_label.trim();\n })\n .fontSize(function (d) {\n return scale(d.__viz_weight);\n })\n .rotate((d, i) => angleDomain(i % context.angleCount()))\n .on(\"word\", w => {\n })\n .on(\"end\", draw)\n .start()\n ;\n\n function draw(data, bounds) {\n const text = context._root.selectAll(\"text\")\n .data(data, function (d) { return d.__viz_label ? d.__viz_label.toLowerCase() : \"\"; })\n ;\n text.enter().append(\"text\")\n .attr(\"text-anchor\", \"middle\")\n .call(context._selection.enter.bind(context._selection))\n .text(function (d) { return d.__viz_label; })\n .on(\"click\", function (d) {\n context.click(context.rowToObj(d.__viz_row), context.columns()[1], context._selection.selected(this));\n })\n .on(\"dblclick\", function (d) {\n context.dblclick(context.rowToObj(d.__viz_row), context.columns()[1], context._selection.selected(this));\n })\n .on(\"mouseout.tooltip\", context.tooltip.hide)\n .on(\"mousemove.tooltip\", context.tooltip.show)\n .style(\"opacity\", 1e-6)\n .merge(text)\n .style(\"font-size\", function (d) { return scale(d.__viz_weight) + \"px\"; })\n .style(\"font-family\", context.fontFamily())\n .transition().duration(1000)\n .attr(\"transform\", function (d) { return \"translate(\" + [d.x, d.y] + \")rotate(\" + d.rotate + \")\"; })\n .style(\"fill\", function (d) { return context._palette(d.__viz_label ? d.__viz_label.toLowerCase() : \"\"); })\n .style(\"opacity\", 1)\n ;\n text.exit().transition().duration(1000)\n .style(\"opacity\", 1e-4)\n .remove()\n ;\n }\n }\n\n zoomed(source, translate, scale) {\n if (translate[0] !== this._prevOffsetX || translate[1] !== this._prevOffsetY || scale !== this._prevZoom) {\n this._root.attr(\"transform\", translate);\n switch (source) {\n case this:\n /*\n this._d3Zoom\n .scale(scale)\n .translate(translate)\n ;\n */\n break;\n case this._d3Zoom:\n this.offsetX(translate[0]);\n this.offsetY(translate[1]);\n this.zoom(scale);\n break;\n }\n this._prevOffsetX = translate[0];\n this._prevOffsetY = translate[1];\n this._prevZoom = scale;\n }\n }\n}\nWordCloud.prototype._class += \" chart_WordCloud\";\nWordCloud.prototype.implements(I2DChart.prototype);\nWordCloud.prototype.implements(ITooltip.prototype);\nWordCloud.prototype.mixin(Utility.SimpleSelectionMixin);\n\nexport interface WordCloud {\n\n paletteID(): string;\n paletteID(_: string): this;\n useClonedPalette(): boolean;\n useClonedPalette(_: boolean): this;\n fontFamily(): string;\n fontFamily(_: string): this;\n fontSizeFrom(): number;\n fontSizeFrom(_: number): this;\n fontSizeTo(): number;\n fontSizeTo(_: number): this;\n angleFrom(): number;\n angleFrom(_: number): this;\n angleTo(): number;\n angleTo(_: number): this;\n angleCount(): number;\n angleCount(_: number): this;\n padding(): number;\n padding(_: number): this;\n scaleMode(): string;\n scaleMode(_: string): this;\n spiral(): string;\n spiral(_: string): this;\n offsetX(): number;\n offsetX(_: number): this;\n offsetY(): number;\n offsetY(_: number): this;\n zoom(): number;\n zoom(_: number): this;\n zoom_exists(): boolean;\n\n // I2DChart\n _palette;\n click(row, column, selected): void;\n dblclick(row, column, selected): void;\n\n // ITooltip ---\n tooltip;\n tooltipHTML(_?): any;\n tooltipFormat(opts): any;\n tooltipStyle(): string;\n tooltipStyle(_: string): this;\n tooltipValueFormat(): string;\n tooltipValueFormat(_: string): this;\n tooltipSeriesColor(): string;\n tooltipSeriesColor(_: string): this;\n tooltipLabelColor(): string;\n tooltipLabelColor(_: string): this;\n tooltipValueColor(): string;\n tooltipValueColor(_: string): this;\n tooltipTick(): boolean;\n tooltipTick(_: boolean): this;\n tooltipOffset(): number;\n tooltipOffset(_: number): this;\n tooltipOffset_exists(): boolean;\n\n // SimpleSelectionMixin\n _selection: Utility.SimpleSelection;\n}\n\nWordCloud.prototype.publish(\"paletteID\", \"default\", \"set\", \"Color palette for this widget\", WordCloud.prototype._palette.switch(), { tags: [\"Basic\", \"Shared\"] });\nWordCloud.prototype.publish(\"useClonedPalette\", false, \"boolean\", \"Enable or disable using a cloned palette\", null, { tags: [\"Intermediate\", \"Shared\"] });\n\nWordCloud.prototype.publish(\"fontFamily\", \"Impact\", \"string\", \"Font Name\", null, { tags: [\"Basic\"] });\nWordCloud.prototype.publish(\"fontSizeFrom\", 6, \"number\", \"Minimum font size (pixels)\", null, { tags: [\"Basic\"] });\nWordCloud.prototype.publish(\"fontSizeTo\", 48, \"number\", \"Maximum font size (pixels)\", null, { tags: [\"Basic\"] });\nWordCloud.prototype.publish(\"angleFrom\", -60, \"number\", \"Minimum angle (degrees)\", null, { tags: [\"Basic\"] });\nWordCloud.prototype.publish(\"angleTo\", 60, \"number\", \"Maximum angle (degrees)\", null, { tags: [\"Basic\"] });\nWordCloud.prototype.publish(\"angleCount\", 5, \"number\", \"Number of different angles\", null, { tags: [\"Basic\"] });\nWordCloud.prototype.publish(\"padding\", 0, \"number\", \"Padding between words (pixels)\", null, { tags: [\"Intermediate\"] });\nWordCloud.prototype.publish(\"scaleMode\", \"linear\", \"set\", \"Text scaling mode\", [\"linear\", \"log\", \"sqrt\", \"pow\"], { tags: [\"Intermediate\"] });\nWordCloud.prototype.publish(\"spiral\", \"archimedean\", \"set\", \"Text scaling mode\", [\"archimedean\", \"rectangular\"], { tags: [\"Intermediate\"] });\nWordCloud.prototype.publish(\"offsetX\", 0, \"number\", \"X offset\", null, { tags: [\"Advanced\"] });\nWordCloud.prototype.publish(\"offsetY\", 0, \"number\", \"Y offset\", null, { tags: [\"Advanced\"] });\nWordCloud.prototype.publish(\"zoom\", 1, \"number\", \"Zoom\", null, { tags: [\"Advanced\"] });\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,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,48,49,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,106],"mappings":"u5BCAA,IAAIA,EAAK,KAAK,GACVC,EAAM,EAAID,EACVE,EAAU,KACV,EAAaD,EAAMC,EAEvB,SAAS,IACP,KAAK,IAAM,KAAK,IAChB,KAAK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,KAAM,CAAE,KAAM,CAAC,kBACrG,GAAU,UAAU,QAAQ,YAAa,SAAU,MAAO,oBAAqB,CAAC,SAAU,MAAO,OAAQ,OAAQ,CAAE,KAAM,CAAC,kBAC1H,GAAU,UAAU,QAAQ,SAAU,cAAe,MAAO,oBAAqB,CAAC,cAAe,eAAgB,CAAE,KAAM,CAAC,kBAC1H,GAAU,UAAU,QAAQ,UAAW,EAAG,SAAU,WAAY,KAAM,CAAE,KAAM,CAAC,cAC/E,GAAU,UAAU,QAAQ,UAAW,EAAG,SAAU,WAAY,KAAM,CAAE,KAAM,CAAC,cAC/E,GAAU,UAAU,QAAQ,OAAQ,EAAG,SAAU,OAAQ,KAAM,CAAE,KAAM,CAAC,kDtHzQ3C,8JAFL,+BACG"}
1
+ {"version":3,"file":"index.umd.cjs","names":["pi","tau","epsilon","x","y","x1","y1","x0","y0","cw","x","abs","max","sqrt","epsilon","pi","halfPi","tau","x","asin","arcInnerRadius","arcOuterRadius","arcStartAngle","arcEndAngle","arcPadAngle","intersect","x1","x0","y1","y0","cornerTangents","cw","sqrt","x00","y00","max","constant","halfPi","abs","path","tau","asin","pi","a","Linear","x","y","x","y","x","pointX","y","pointY","constant","curveLinear","path","x0","pointX","x1","y0","constant","y1","pointY","curveLinear","k","path","line","a","identity","descending","constant","tau","k","i","j","point","x","y","Basis","Bundle","Basis","x","y","x0","y0","beta","point","x","y","Cardinal","tension","point","x1","y1","a","x","y","CatmullRom","Cardinal","alpha","sign","x","slope3","slope2","point","x0","y0","x1","y1","MonotoneX","y","MonotoneY","ReflectContext","Natural","x","y","controlPoints","a","Step","x","y","x1","slice","x","epsilon","x","y","k","axis","identity","range","path","slice","retVal: IOverflow","lowerPos: number","upperPos: number","currSel: any","prevBrushSel: any","context: XYAxis","valueAnchor: \"start\" | \"middle\" | \"end\"","k","a","c","Node","node_count","node_each","node_eachAfter","node_eachBefore","node_sum","node_sort","node_path","node_ancestors","node_descendants","node_leaves","node_links","slice","array","slice","a","x1","y1","c","a","x","y","c","circle","k","enclose","x","x","constant","k","now","d3AxisLeft","d3Descending","wrap","x1","x0","range","axis","x","slice","a","x","c","x","point","y","pi","a","thresholdSturges","ascending","area","contains","x","y","point","constant","slice","noop","x","y","k","constant","data","contours","slice","y","x","a","pi","halfPi","tau","x","adder","x00","y00","x0","y0","x","y","x0","y0","x","y","x00","y00","x0","y0","x","y","x","y","tau","adder","x","y","x","y","path","pathArea","pathMeasure","pathBounds","pathCentroid","identity","x","x","x1","x0","y1","y0","cw","x00","y00","constant","path","a","x","y","x","pointX","y","pointY","constant","curveLinear","path","curveLinear","a","point","x","y","noop","x","y","x","y","x0","y0","x","y","x0","y0","beta","point","x","y","tension","noop","x","y","tension","x","y","tension","point","x1","y1","a","x","y","alpha","noop","x","y","alpha","x","y","alpha","noop","x","y","x","x0","y0","x1","y1","y","x","y","a","Step","x","y","x1","get","Annotation","x","y","AnnotationCollection","a","k","pointHandle","circleHandles","addHandles","leftRightDynamic","topBottomDynamic","lineBuilder","curveLinear","lineGen","line","arcBuilder","arc","lineSetup","annotation","x1","y1","curveCatmullRom","c","updatePoint","event","createPoints","updateRadius","circle","notCornerPointerXY","sign","Type","s","customType","d3NoteText","newWithClass","addHandlers","wrap","text","bboxWithoutHandles","padding: number | undefined","x0","y0","x1","y1","x","y","point","pi","dx","dy","ticks: Ticks","row: any","cloud: any"],"sources":["../src/__package__.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","../../../node_modules/d3-shape/src/curve/linear.js","../../../node_modules/d3-shape/src/point.js","../../../node_modules/d3-shape/src/line.js","../../../node_modules/d3-shape/src/area.js","../../../node_modules/d3-shape/src/descending.js","../../../node_modules/d3-shape/src/identity.js","../../../node_modules/d3-shape/src/pie.js","../../../node_modules/d3-shape/src/curve/basis.js","../../../node_modules/d3-shape/src/curve/bundle.js","../../../node_modules/d3-shape/src/curve/cardinal.js","../../../node_modules/d3-shape/src/curve/catmullRom.js","../../../node_modules/d3-shape/src/curve/monotone.js","../../../node_modules/d3-shape/src/curve/natural.js","../../../node_modules/d3-shape/src/curve/step.js","../../../node_modules/d3-axis/src/array.js","../../../node_modules/d3-axis/src/identity.js","../../../node_modules/d3-axis/src/axis.js","../src/Axis.ts","../src/XYAxis.ts","../src/Scatter.ts","../src/Area.ts","../src/Column.ts","../src/Bar.ts","../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","../src/Bubble.ts","../src/BubbleXY.ts","../../../node_modules/d3-timer/src/timer.js","../../../node_modules/d3v4-bullet/src/bullet.js","../src/Bullet.ts","../../../node_modules/d3-contour/src/array.js","../../../node_modules/d3-contour/src/ascending.js","../../../node_modules/d3-contour/src/area.js","../../../node_modules/d3-contour/src/constant.js","../../../node_modules/d3-contour/src/contains.js","../../../node_modules/d3-contour/src/noop.js","../../../node_modules/d3-contour/src/contours.js","../../../node_modules/d3-contour/src/blur.js","../../../node_modules/d3-contour/src/density.js","../../../node_modules/d3-geo/src/adder.js","../../../node_modules/d3-geo/src/math.js","../../../node_modules/d3-geo/src/noop.js","../../../node_modules/d3-geo/src/stream.js","../../../node_modules/d3-geo/src/identity.js","../../../node_modules/d3-geo/src/path/area.js","../../../node_modules/d3-geo/src/path/bounds.js","../../../node_modules/d3-geo/src/path/centroid.js","../../../node_modules/d3-geo/src/path/context.js","../../../node_modules/d3-geo/src/path/measure.js","../../../node_modules/d3-geo/src/path/string.js","../../../node_modules/d3-geo/src/path/index.js","../src/Contour.ts","../src/Gantt.ts","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/constant.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/math.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/arc.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/curve/linear.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/point.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/line.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/curve/radial.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/symbol/diamond.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/symbol/star.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/symbol/triangle.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/symbol/wye.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/noop.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/curve/basis.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/curve/basisClosed.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/curve/basisOpen.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/curve/bundle.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/curve/cardinal.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/curve/cardinalClosed.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/curve/cardinalOpen.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/curve/catmullRom.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/curve/catmullRomClosed.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/curve/catmullRomOpen.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/curve/linearClosed.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/curve/monotone.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/curve/natural.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/curve/step.js","../../../node_modules/d3-svg-annotation/node_modules/d3-shape/src/array.js","../../../node_modules/d3-svg-annotation/indexRollupNext.js","../src/Gauge.ts","../src/Pie.ts","../src/HalfPie.ts","../src/Heat.ts","../../../node_modules/d3-hexbin/src/hexbin.js","../src/HexBin.ts","../src/Line.ts","../src/QuarterPie.ts","../src/QuartileCandlestick.ts","../src/Radar.ts","../src/RadialBar.ts","../src/StatChart.ts","../src/Step.ts","../src/Summary.ts","../src/SummaryC.ts","../src/D3Cloud.ts","../src/WordCloud.ts"],"sourcesContent":["export const PKG_NAME = \"__PACKAGE_NAME__\";\nexport const PKG_VERSION = \"__PACKAGE_VERSION__\";\nexport const BUILD_VERSION = \"__BUILD_VERSION__\";\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","function Linear(context) {\n this._context = context;\n}\n\nLinear.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // proceed\n default: this._context.lineTo(x, y); break;\n }\n }\n};\n\nexport default function(context) {\n return new Linear(context);\n}\n","export function x(p) {\n return p[0];\n}\n\nexport function y(p) {\n return p[1];\n}\n","import {path} from \"d3-path\";\nimport constant from \"./constant.js\";\nimport curveLinear from \"./curve/linear.js\";\nimport {x as pointX, y as pointY} from \"./point.js\";\n\nexport default function() {\n var x = pointX,\n y = pointY,\n defined = constant(true),\n context = null,\n curve = curveLinear,\n output = null;\n\n function line(data) {\n var i,\n n = data.length,\n d,\n defined0 = false,\n buffer;\n\n if (context == null) output = curve(buffer = path());\n\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) output.lineStart();\n else output.lineEnd();\n }\n if (defined0) output.point(+x(d, i, data), +y(d, i, data));\n }\n\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n line.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : constant(+_), line) : x;\n };\n\n line.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : constant(+_), line) : y;\n };\n\n line.defined = function(_) {\n return arguments.length ? (defined = typeof _ === \"function\" ? _ : constant(!!_), line) : defined;\n };\n\n line.curve = function(_) {\n return arguments.length ? (curve = _, context != null && (output = curve(context)), line) : curve;\n };\n\n line.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), line) : context;\n };\n\n return line;\n}\n","import {path} from \"d3-path\";\nimport constant from \"./constant.js\";\nimport curveLinear from \"./curve/linear.js\";\nimport line from \"./line.js\";\nimport {x as pointX, y as pointY} from \"./point.js\";\n\nexport default function() {\n var x0 = pointX,\n x1 = null,\n y0 = constant(0),\n y1 = pointY,\n defined = constant(true),\n context = null,\n curve = curveLinear,\n output = null;\n\n function area(data) {\n var i,\n j,\n k,\n n = data.length,\n d,\n defined0 = false,\n buffer,\n x0z = new Array(n),\n y0z = new Array(n);\n\n if (context == null) output = curve(buffer = path());\n\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) {\n j = i;\n output.areaStart();\n output.lineStart();\n } else {\n output.lineEnd();\n output.lineStart();\n for (k = i - 1; k >= j; --k) {\n output.point(x0z[k], y0z[k]);\n }\n output.lineEnd();\n output.areaEnd();\n }\n }\n if (defined0) {\n x0z[i] = +x0(d, i, data), y0z[i] = +y0(d, i, data);\n output.point(x1 ? +x1(d, i, data) : x0z[i], y1 ? +y1(d, i, data) : y0z[i]);\n }\n }\n\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n function arealine() {\n return line().defined(defined).curve(curve).context(context);\n }\n\n area.x = function(_) {\n return arguments.length ? (x0 = typeof _ === \"function\" ? _ : constant(+_), x1 = null, area) : x0;\n };\n\n area.x0 = function(_) {\n return arguments.length ? (x0 = typeof _ === \"function\" ? _ : constant(+_), area) : x0;\n };\n\n area.x1 = function(_) {\n return arguments.length ? (x1 = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), area) : x1;\n };\n\n area.y = function(_) {\n return arguments.length ? (y0 = typeof _ === \"function\" ? _ : constant(+_), y1 = null, area) : y0;\n };\n\n area.y0 = function(_) {\n return arguments.length ? (y0 = typeof _ === \"function\" ? _ : constant(+_), area) : y0;\n };\n\n area.y1 = function(_) {\n return arguments.length ? (y1 = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), area) : y1;\n };\n\n area.lineX0 =\n area.lineY0 = function() {\n return arealine().x(x0).y(y0);\n };\n\n area.lineY1 = function() {\n return arealine().x(x0).y(y1);\n };\n\n area.lineX1 = function() {\n return arealine().x(x1).y(y0);\n };\n\n area.defined = function(_) {\n return arguments.length ? (defined = typeof _ === \"function\" ? _ : constant(!!_), area) : defined;\n };\n\n area.curve = function(_) {\n return arguments.length ? (curve = _, context != null && (output = curve(context)), area) : curve;\n };\n\n area.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), area) : context;\n };\n\n return area;\n}\n","export default function(a, b) {\n return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;\n}\n","export default function(d) {\n return d;\n}\n","import constant from \"./constant.js\";\nimport descending from \"./descending.js\";\nimport identity from \"./identity.js\";\nimport {tau} from \"./math.js\";\n\nexport default function() {\n var value = identity,\n sortValues = descending,\n sort = null,\n startAngle = constant(0),\n endAngle = constant(tau),\n padAngle = constant(0);\n\n function pie(data) {\n var i,\n n = data.length,\n j,\n k,\n sum = 0,\n index = new Array(n),\n arcs = new Array(n),\n a0 = +startAngle.apply(this, arguments),\n da = Math.min(tau, Math.max(-tau, endAngle.apply(this, arguments) - a0)),\n a1,\n p = Math.min(Math.abs(da) / n, padAngle.apply(this, arguments)),\n pa = p * (da < 0 ? -1 : 1),\n v;\n\n for (i = 0; i < n; ++i) {\n if ((v = arcs[index[i] = i] = +value(data[i], i, data)) > 0) {\n sum += v;\n }\n }\n\n // Optionally sort the arcs by previously-computed values or by data.\n if (sortValues != null) index.sort(function(i, j) { return sortValues(arcs[i], arcs[j]); });\n else if (sort != null) index.sort(function(i, j) { return sort(data[i], data[j]); });\n\n // Compute the arcs! They are stored in the original data's order.\n for (i = 0, k = sum ? (da - n * pa) / sum : 0; i < n; ++i, a0 = a1) {\n j = index[i], v = arcs[j], a1 = a0 + (v > 0 ? v * k : 0) + pa, arcs[j] = {\n data: data[j],\n index: i,\n value: v,\n startAngle: a0,\n endAngle: a1,\n padAngle: p\n };\n }\n\n return arcs;\n }\n\n pie.value = function(_) {\n return arguments.length ? (value = typeof _ === \"function\" ? _ : constant(+_), pie) : value;\n };\n\n pie.sortValues = function(_) {\n return arguments.length ? (sortValues = _, sort = null, pie) : sortValues;\n };\n\n pie.sort = function(_) {\n return arguments.length ? (sort = _, sortValues = null, pie) : sort;\n };\n\n pie.startAngle = function(_) {\n return arguments.length ? (startAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : startAngle;\n };\n\n pie.endAngle = function(_) {\n return arguments.length ? (endAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : endAngle;\n };\n\n pie.padAngle = function(_) {\n return arguments.length ? (padAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : padAngle;\n };\n\n return pie;\n}\n","export function point(that, x, y) {\n that._context.bezierCurveTo(\n (2 * that._x0 + that._x1) / 3,\n (2 * that._y0 + that._y1) / 3,\n (that._x0 + 2 * that._x1) / 3,\n (that._y0 + 2 * that._y1) / 3,\n (that._x0 + 4 * that._x1 + x) / 6,\n (that._y0 + 4 * that._y1 + y) / 6\n );\n}\n\nexport function Basis(context) {\n this._context = context;\n}\n\nBasis.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 3: point(this, this._x1, this._y1); // proceed\n case 2: this._context.lineTo(this._x1, this._y1); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6); // proceed\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new Basis(context);\n}\n","import {Basis} from \"./basis.js\";\n\nfunction Bundle(context, beta) {\n this._basis = new Basis(context);\n this._beta = beta;\n}\n\nBundle.prototype = {\n lineStart: function() {\n this._x = [];\n this._y = [];\n this._basis.lineStart();\n },\n lineEnd: function() {\n var x = this._x,\n y = this._y,\n j = x.length - 1;\n\n if (j > 0) {\n var x0 = x[0],\n y0 = y[0],\n dx = x[j] - x0,\n dy = y[j] - y0,\n i = -1,\n t;\n\n while (++i <= j) {\n t = i / j;\n this._basis.point(\n this._beta * x[i] + (1 - this._beta) * (x0 + t * dx),\n this._beta * y[i] + (1 - this._beta) * (y0 + t * dy)\n );\n }\n }\n\n this._x = this._y = null;\n this._basis.lineEnd();\n },\n point: function(x, y) {\n this._x.push(+x);\n this._y.push(+y);\n }\n};\n\nexport default (function custom(beta) {\n\n function bundle(context) {\n return beta === 1 ? new Basis(context) : new Bundle(context, beta);\n }\n\n bundle.beta = function(beta) {\n return custom(+beta);\n };\n\n return bundle;\n})(0.85);\n","export function point(that, x, y) {\n that._context.bezierCurveTo(\n that._x1 + that._k * (that._x2 - that._x0),\n that._y1 + that._k * (that._y2 - that._y0),\n that._x2 + that._k * (that._x1 - x),\n that._y2 + that._k * (that._y1 - y),\n that._x2,\n that._y2\n );\n}\n\nexport function Cardinal(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinal.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x2, this._y2); break;\n case 3: point(this, this._x1, this._y1); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; this._x1 = x, this._y1 = y; break;\n case 2: this._point = 3; // proceed\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new Cardinal(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n","import {epsilon} from \"../math.js\";\nimport {Cardinal} from \"./cardinal.js\";\n\nexport function point(that, x, y) {\n var x1 = that._x1,\n y1 = that._y1,\n x2 = that._x2,\n y2 = that._y2;\n\n if (that._l01_a > epsilon) {\n var a = 2 * that._l01_2a + 3 * that._l01_a * that._l12_a + that._l12_2a,\n n = 3 * that._l01_a * (that._l01_a + that._l12_a);\n x1 = (x1 * a - that._x0 * that._l12_2a + that._x2 * that._l01_2a) / n;\n y1 = (y1 * a - that._y0 * that._l12_2a + that._y2 * that._l01_2a) / n;\n }\n\n if (that._l23_a > epsilon) {\n var b = 2 * that._l23_2a + 3 * that._l23_a * that._l12_a + that._l12_2a,\n m = 3 * that._l23_a * (that._l23_a + that._l12_a);\n x2 = (x2 * b + that._x1 * that._l23_2a - x * that._l12_2a) / m;\n y2 = (y2 * b + that._y1 * that._l23_2a - y * that._l12_2a) / m;\n }\n\n that._context.bezierCurveTo(x1, y1, x2, y2, that._x2, that._y2);\n}\n\nfunction CatmullRom(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRom.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x2, this._y2); break;\n case 3: this.point(this._x2, this._y2); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; // proceed\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRom(context, alpha) : new Cardinal(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n","function sign(x) {\n return x < 0 ? -1 : 1;\n}\n\n// Calculate the slopes of the tangents (Hermite-type interpolation) based on\n// the following paper: Steffen, M. 1990. A Simple Method for Monotonic\n// Interpolation in One Dimension. Astronomy and Astrophysics, Vol. 239, NO.\n// NOV(II), P. 443, 1990.\nfunction slope3(that, x2, y2) {\n var h0 = that._x1 - that._x0,\n h1 = x2 - that._x1,\n s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0),\n s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0),\n p = (s0 * h1 + s1 * h0) / (h0 + h1);\n return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;\n}\n\n// Calculate a one-sided slope.\nfunction slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}\n\n// According to https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Representations\n// \"you can express cubic Hermite interpolation in terms of cubic Bézier curves\n// with respect to the four values p0, p0 + m0 / 3, p1 - m1 / 3, p1\".\nfunction point(that, t0, t1) {\n var x0 = that._x0,\n y0 = that._y0,\n x1 = that._x1,\n y1 = that._y1,\n dx = (x1 - x0) / 3;\n that._context.bezierCurveTo(x0 + dx, y0 + dx * t0, x1 - dx, y1 - dx * t1, x1, y1);\n}\n\nfunction MonotoneX(context) {\n this._context = context;\n}\n\nMonotoneX.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 =\n this._t0 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x1, this._y1); break;\n case 3: point(this, this._t0, slope2(this, this._t0)); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n var t1 = NaN;\n\n x = +x, y = +y;\n if (x === this._x1 && y === this._y1) return; // Ignore coincident points.\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; point(this, slope2(this, t1 = slope3(this, x, y)), t1); break;\n default: point(this, this._t0, t1 = slope3(this, x, y)); break;\n }\n\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n this._t0 = t1;\n }\n}\n\nfunction MonotoneY(context) {\n this._context = new ReflectContext(context);\n}\n\n(MonotoneY.prototype = Object.create(MonotoneX.prototype)).point = function(x, y) {\n MonotoneX.prototype.point.call(this, y, x);\n};\n\nfunction ReflectContext(context) {\n this._context = context;\n}\n\nReflectContext.prototype = {\n moveTo: function(x, y) { this._context.moveTo(y, x); },\n closePath: function() { this._context.closePath(); },\n lineTo: function(x, y) { this._context.lineTo(y, x); },\n bezierCurveTo: function(x1, y1, x2, y2, x, y) { this._context.bezierCurveTo(y1, x1, y2, x2, y, x); }\n};\n\nexport function monotoneX(context) {\n return new MonotoneX(context);\n}\n\nexport function monotoneY(context) {\n return new MonotoneY(context);\n}\n","function Natural(context) {\n this._context = context;\n}\n\nNatural.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x = [];\n this._y = [];\n },\n lineEnd: function() {\n var x = this._x,\n y = this._y,\n n = x.length;\n\n if (n) {\n this._line ? this._context.lineTo(x[0], y[0]) : this._context.moveTo(x[0], y[0]);\n if (n === 2) {\n this._context.lineTo(x[1], y[1]);\n } else {\n var px = controlPoints(x),\n py = controlPoints(y);\n for (var i0 = 0, i1 = 1; i1 < n; ++i0, ++i1) {\n this._context.bezierCurveTo(px[0][i0], py[0][i0], px[1][i0], py[1][i0], x[i1], y[i1]);\n }\n }\n }\n\n if (this._line || (this._line !== 0 && n === 1)) this._context.closePath();\n this._line = 1 - this._line;\n this._x = this._y = null;\n },\n point: function(x, y) {\n this._x.push(+x);\n this._y.push(+y);\n }\n};\n\n// See https://www.particleincell.com/2012/bezier-splines/ for derivation.\nfunction controlPoints(x) {\n var i,\n n = x.length - 1,\n m,\n a = new Array(n),\n b = new Array(n),\n r = new Array(n);\n a[0] = 0, b[0] = 2, r[0] = x[0] + 2 * x[1];\n for (i = 1; i < n - 1; ++i) a[i] = 1, b[i] = 4, r[i] = 4 * x[i] + 2 * x[i + 1];\n a[n - 1] = 2, b[n - 1] = 7, r[n - 1] = 8 * x[n - 1] + x[n];\n for (i = 1; i < n; ++i) m = a[i] / b[i - 1], b[i] -= m, r[i] -= m * r[i - 1];\n a[n - 1] = r[n - 1] / b[n - 1];\n for (i = n - 2; i >= 0; --i) a[i] = (r[i] - a[i + 1]) / b[i];\n b[n - 1] = (x[n] + a[n - 1]) / 2;\n for (i = 0; i < n - 1; ++i) b[i] = 2 * x[i + 1] - a[i + 1];\n return [a, b];\n}\n\nexport default function(context) {\n return new Natural(context);\n}\n","function Step(context, t) {\n this._context = context;\n this._t = t;\n}\n\nStep.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x = this._y = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (0 < this._t && this._t < 1 && this._point === 2) this._context.lineTo(this._x, this._y);\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n if (this._line >= 0) this._t = 1 - this._t, this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // proceed\n default: {\n if (this._t <= 0) {\n this._context.lineTo(this._x, y);\n this._context.lineTo(x, y);\n } else {\n var x1 = this._x * (1 - this._t) + x * this._t;\n this._context.lineTo(x1, this._y);\n this._context.lineTo(x1, y);\n }\n break;\n }\n }\n this._x = x, this._y = y;\n }\n};\n\nexport default function(context) {\n return new Step(context, 0.5);\n}\n\nexport function stepBefore(context) {\n return new Step(context, 0);\n}\n\nexport function stepAfter(context) {\n return new Step(context, 1);\n}\n","export var slice = Array.prototype.slice;\n","export default function(x) {\n return x;\n}\n","import {slice} from \"./array\";\nimport identity from \"./identity\";\n\nvar top = 1,\n right = 2,\n bottom = 3,\n left = 4,\n epsilon = 1e-6;\n\nfunction translateX(x) {\n return \"translate(\" + (x + 0.5) + \",0)\";\n}\n\nfunction translateY(y) {\n return \"translate(0,\" + (y + 0.5) + \")\";\n}\n\nfunction number(scale) {\n return function(d) {\n return +scale(d);\n };\n}\n\nfunction center(scale) {\n var offset = Math.max(0, scale.bandwidth() - 1) / 2; // Adjust for 0.5px offset.\n if (scale.round()) offset = Math.round(offset);\n return function(d) {\n return +scale(d) + offset;\n };\n}\n\nfunction entering() {\n return !this.__axis;\n}\n\nfunction axis(orient, scale) {\n var tickArguments = [],\n tickValues = null,\n tickFormat = null,\n tickSizeInner = 6,\n tickSizeOuter = 6,\n tickPadding = 3,\n k = orient === top || orient === left ? -1 : 1,\n x = orient === left || orient === right ? \"x\" : \"y\",\n transform = orient === top || orient === bottom ? translateX : translateY;\n\n function axis(context) {\n var values = tickValues == null ? (scale.ticks ? scale.ticks.apply(scale, tickArguments) : scale.domain()) : tickValues,\n format = tickFormat == null ? (scale.tickFormat ? scale.tickFormat.apply(scale, tickArguments) : identity) : tickFormat,\n spacing = Math.max(tickSizeInner, 0) + tickPadding,\n range = scale.range(),\n range0 = +range[0] + 0.5,\n range1 = +range[range.length - 1] + 0.5,\n position = (scale.bandwidth ? center : number)(scale.copy()),\n selection = context.selection ? context.selection() : context,\n path = selection.selectAll(\".domain\").data([null]),\n tick = selection.selectAll(\".tick\").data(values, scale).order(),\n tickExit = tick.exit(),\n tickEnter = tick.enter().append(\"g\").attr(\"class\", \"tick\"),\n line = tick.select(\"line\"),\n text = tick.select(\"text\");\n\n path = path.merge(path.enter().insert(\"path\", \".tick\")\n .attr(\"class\", \"domain\")\n .attr(\"stroke\", \"currentColor\"));\n\n tick = tick.merge(tickEnter);\n\n line = line.merge(tickEnter.append(\"line\")\n .attr(\"stroke\", \"currentColor\")\n .attr(x + \"2\", k * tickSizeInner));\n\n text = text.merge(tickEnter.append(\"text\")\n .attr(\"fill\", \"currentColor\")\n .attr(x, k * spacing)\n .attr(\"dy\", orient === top ? \"0em\" : orient === bottom ? \"0.71em\" : \"0.32em\"));\n\n if (context !== selection) {\n path = path.transition(context);\n tick = tick.transition(context);\n line = line.transition(context);\n text = text.transition(context);\n\n tickExit = tickExit.transition(context)\n .attr(\"opacity\", epsilon)\n .attr(\"transform\", function(d) { return isFinite(d = position(d)) ? transform(d) : this.getAttribute(\"transform\"); });\n\n tickEnter\n .attr(\"opacity\", epsilon)\n .attr(\"transform\", function(d) { var p = this.parentNode.__axis; return transform(p && isFinite(p = p(d)) ? p : position(d)); });\n }\n\n tickExit.remove();\n\n path\n .attr(\"d\", orient === left || orient == right\n ? (tickSizeOuter ? \"M\" + k * tickSizeOuter + \",\" + range0 + \"H0.5V\" + range1 + \"H\" + k * tickSizeOuter : \"M0.5,\" + range0 + \"V\" + range1)\n : (tickSizeOuter ? \"M\" + range0 + \",\" + k * tickSizeOuter + \"V0.5H\" + range1 + \"V\" + k * tickSizeOuter : \"M\" + range0 + \",0.5H\" + range1));\n\n tick\n .attr(\"opacity\", 1)\n .attr(\"transform\", function(d) { return transform(position(d)); });\n\n line\n .attr(x + \"2\", k * tickSizeInner);\n\n text\n .attr(x, k * spacing)\n .text(format);\n\n selection.filter(entering)\n .attr(\"fill\", \"none\")\n .attr(\"font-size\", 10)\n .attr(\"font-family\", \"sans-serif\")\n .attr(\"text-anchor\", orient === right ? \"start\" : orient === left ? \"end\" : \"middle\");\n\n selection\n .each(function() { this.__axis = position; });\n }\n\n axis.scale = function(_) {\n return arguments.length ? (scale = _, axis) : scale;\n };\n\n axis.ticks = function() {\n return tickArguments = slice.call(arguments), axis;\n };\n\n axis.tickArguments = function(_) {\n return arguments.length ? (tickArguments = _ == null ? [] : slice.call(_), axis) : tickArguments.slice();\n };\n\n axis.tickValues = function(_) {\n return arguments.length ? (tickValues = _ == null ? null : slice.call(_), axis) : tickValues && tickValues.slice();\n };\n\n axis.tickFormat = function(_) {\n return arguments.length ? (tickFormat = _, axis) : tickFormat;\n };\n\n axis.tickSize = function(_) {\n return arguments.length ? (tickSizeInner = tickSizeOuter = +_, axis) : tickSizeInner;\n };\n\n axis.tickSizeInner = function(_) {\n return arguments.length ? (tickSizeInner = +_, axis) : tickSizeInner;\n };\n\n axis.tickSizeOuter = function(_) {\n return arguments.length ? (tickSizeOuter = +_, axis) : tickSizeOuter;\n };\n\n axis.tickPadding = function(_) {\n return arguments.length ? (tickPadding = +_, axis) : tickPadding;\n };\n\n return axis;\n}\n\nexport function axisTop(scale) {\n return axis(top, scale);\n}\n\nexport function axisRight(scale) {\n return axis(right, scale);\n}\n\nexport function axisBottom(scale) {\n return axis(bottom, scale);\n}\n\nexport function axisLeft(scale) {\n return axis(left, scale);\n}\n","import { SVGWidget } from \"@hpcc-js/common\";\nimport { axisBottom as d3AxisBottom, axisLeft as d3AxisLeft, axisRight as d3AxisRight, axisTop as d3AxisTop } from \"d3-axis\";\nimport { format as d3Format } from \"d3-format\";\nimport { scaleBand as d3ScaleBand, scaleLinear as d3ScaleLinear, scaleLog as d3ScaleLog, scalePow as d3ScalePow, scaleTime as d3ScaleTime } from \"d3-scale\";\nimport { select as d3Select } from \"d3-selection\";\nimport { timeFormat as d3TimeFormat, timeParse as d3TimeParse } from \"d3-time-format\";\n\nimport \"../src/Axis.css\";\n\nexport interface IOverflow {\n left: number;\n top: number;\n right: number;\n bottom: number;\n depth: number;\n tickOverlapModulus: number;\n}\n\nexport class Axis extends SVGWidget {\n _origType;\n _origTimePattern;\n\n protected parser;\n protected parserInvert;\n protected formatter: (date: Date) => string;\n protected d3Scale;\n protected d3Axis;\n protected d3Guides;\n protected _guideElement;\n protected svg;\n protected svgAxis;\n protected svgGuides;\n\n constructor(drawStartPosition: \"origin\" | \"center\" = \"origin\") {\n super();\n this._drawStartPos = drawStartPosition;\n\n this.updateScale();\n }\n\n lowValue() {\n return this.parse(this.low());\n }\n\n highValue() {\n return this.parse(this.high());\n }\n\n parse(d, forceNumeric?) {\n if (d instanceof Array) {\n return d.map(function (d2) {\n return this.parse(d2);\n }, this);\n }\n if (d !== undefined && d !== null) {\n if (this.parser) {\n return this.parser(typeof d === \"number\" ? d.toString() : d);\n }\n if (forceNumeric && typeof d === \"string\") {\n return +d;\n }\n }\n return d;\n }\n\n parseInvert(d) {\n if (d instanceof Array) {\n return d.map(function (d2) {\n return this.parseInvert(d2);\n }, this);\n }\n if (this.parserInvert && d) {\n return this.parserInvert(d);\n }\n return d;\n }\n\n format(d) {\n if (d instanceof Array) {\n return d.map(function (d2) {\n return this.format(d2);\n }, this);\n }\n if (d !== undefined && d !== null && this.formatter) {\n return this.formatter(d);\n }\n return d;\n }\n\n parseFormat(d) {\n return this.format(this.parse(d));\n }\n\n scalePos(d) {\n let retVal = this.d3Scale(this.parse(d));\n if (this.type() === \"ordinal\") {\n retVal += this.bandwidth() / 2;\n }\n return retVal;\n }\n\n bandwidth() {\n return this.d3Scale.bandwidth ? this.d3Scale.bandwidth() : 0;\n }\n\n isHorizontal() {\n switch (this.orientation()) {\n case \"left\":\n case \"right\":\n return false;\n default:\n }\n return true;\n }\n\n domain(_?) {\n if (!arguments.length) return this.d3Scale.domain();\n this.d3Scale.domain(_);\n return this;\n }\n\n range(_?) {\n if (!arguments.length) {\n if (this.d3Scale.rangeRoundBands) {\n return this.d3Scale.rangeExtent();\n } else if (this.d3Scale.rangeRound) {\n return this.d3Scale.range();\n }\n }\n if (this.d3Scale.rangeRoundBands) {\n this.d3Scale.rangeRoundBands(_, 0.1);\n } else if (this.d3Scale.rangeRound) {\n this.d3Scale.range(_);\n }\n return this;\n }\n\n invert(pos) {\n return this.d3Scale.invert(pos);\n }\n\n guideTarget(_) {\n this._guideElement = d3Select(_)\n .attr(\"class\", this._class)\n ;\n return this;\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n this.svg = element.append(\"g\");\n this.svgAxis = this.svg.append(\"g\")\n .attr(\"class\", \"axis\")\n ;\n this.svgGuides = (this._guideElement || element).append(\"g\")\n .attr(\"class\", \"guide\")\n ;\n }\n\n protected _prevOrientation;\n updateScale(): this {\n switch (this.type()) {\n case \"ordinal\":\n this.d3Scale = d3ScaleBand()\n .paddingInner(this.ordinalPaddingInner())\n .paddingOuter(this.ordinalPaddingOuter())\n ;\n if (this.ordinals_exists()) {\n this.d3Scale.domain(this.ordinals());\n }\n this.parser = null;\n if (this.ordinalMappings_exists()) {\n const mappings = this.ordinalMappings();\n this.formatter = (_: any) => mappings[_] || _;\n } else {\n this.formatter = null;\n }\n break;\n case \"linear\":\n this.d3Scale = d3ScaleLinear();\n if (this.low_exists() && this.high_exists()) {\n this.d3Scale.domain([this.lowValue(), this.highValue()]);\n }\n this.parser = null;\n this.formatter = this.tickFormat_exists() ? d3Format(this.tickFormat()) : null;\n break;\n case \"pow\":\n this.d3Scale = d3ScalePow()\n .exponent(this.powExponent())\n ;\n if (this.low_exists() && this.high_exists()) {\n this.d3Scale.domain([this.lowValue(), this.highValue()]);\n }\n this.parser = null;\n this.formatter = this.tickFormat_exists() ? d3Format(this.tickFormat()) : null;\n break;\n case \"log\":\n this.d3Scale = d3ScaleLog()\n .base(this.logBase())\n ;\n if (this.low_exists() && this.high_exists()) {\n this.d3Scale.domain([this.lowValue(), this.highValue()]);\n }\n this.parser = null;\n this.formatter = this.tickFormat_exists() ? d3Format(this.tickFormat()) : null;\n break;\n case \"time\":\n this.d3Scale = d3ScaleTime();\n if (this.low_exists() && this.high_exists()) {\n this.d3Scale.domain([this.lowValue(), this.highValue()]);\n }\n this.parser = this.timePattern_exists() ? d3TimeParse(this.timePattern()) : null;\n this.parserInvert = this.timePattern_exists() ? d3TimeFormat(this.timePattern()) : null;\n this.formatter = this.tickFormat_exists() ? d3TimeFormat(this.tickFormat()) : null;\n break;\n default:\n }\n if (this._prevOrientation !== this.orientation()) {\n switch (this.orientation()) {\n case \"left\":\n this.d3Axis = d3AxisLeft(this.d3Scale);\n this.d3Guides = d3AxisLeft(this.d3Scale);\n break;\n case \"top\":\n this.d3Axis = d3AxisTop(this.d3Scale);\n this.d3Guides = d3AxisTop(this.d3Scale);\n break;\n case \"right\":\n this.d3Axis = d3AxisRight(this.d3Scale);\n this.d3Guides = d3AxisRight(this.d3Scale);\n break;\n case \"bottom\":\n default:\n this.d3Axis = d3AxisBottom(this.d3Scale);\n this.d3Guides = d3AxisBottom(this.d3Scale);\n break;\n }\n this._prevOrientation = this.orientation();\n if (this.svgAxis) {\n this.svgAxis.html(\"\");\n }\n if (this.svgGuides) {\n this.svgGuides.html(\"\");\n }\n }\n\n if (this.extend()) {\n switch (this.type()) {\n case \"ordinal\":\n break;\n default:\n let length;\n let delta;\n let low;\n let high;\n let newLow;\n let newHigh;\n if (this.isHorizontal()) {\n length = this.width();\n this.d3Scale.range([0, length]);\n delta = length * this.extend() / 100;\n low = this.d3Scale.invert(0);\n newLow = this.d3Scale.invert(-delta);\n high = this.d3Scale.invert(length);\n newHigh = this.d3Scale.invert(length + delta);\n } else {\n length = this.height();\n this.d3Scale.range([length, 0]);\n delta = length * this.extend() / 100;\n low = this.d3Scale.invert(length);\n newLow = this.d3Scale.invert(length + delta);\n high = this.d3Scale.invert(0);\n newHigh = this.d3Scale.invert(-delta);\n }\n if (newLow === low) { // Edge case when there is only one item in the domain ---\n newLow = low - low * this.extend() / 100;\n }\n if (newHigh === high) { // Edge case when there is only one item in the domain ---\n newHigh = high + high * this.extend() / 100;\n }\n if ((Math as any).sign(low) !== (Math as any).sign(newLow)) {\n newLow = 0;\n }\n if ((Math as any).sign(high) !== (Math as any).sign(newHigh)) {\n newHigh = 0;\n }\n this.d3Scale.domain([newLow, newHigh]);\n break;\n }\n }\n\n this.d3Axis\n .scale(this.d3Scale)\n .tickFormat(this.formatter)\n .ticks(this.tickCount())\n ;\n this.d3Guides\n .scale(this.d3Scale)\n .tickSize(this.tickLength_exists() ? -this.tickLength() : 0)\n .tickFormat(\"\")\n .ticks(this.tickCount())\n ;\n const customTicks = this.ticks();\n if (customTicks.length) {\n this.d3Axis\n .tickValues(customTicks.map(d => this.parse(d.value)))\n .tickFormat((_d, i) => {\n return customTicks[i].label;\n });\n this.d3Guides\n .tickValues(customTicks.map(d => this.parse(d.value)));\n }\n return this;\n }\n\n adjustText(svg, tickOverlapModulus) {\n const isHoriztontal = this.isHorizontal();\n const isLeft = this.orientation() === \"left\";\n const isBottom = this.orientation() === \"bottom\";\n const context = this;\n const textSelection = svg.selectAll(\".tick > text\")\n .style(\"font-family\", this.fontFamily())\n .style(\"font-size\", this.fontSize_exists() ? this.fontSize() + \"px\" : null)\n ;\n if (this.overlapMode() === \"linebreak\") {\n if (this.type() === \"ordinal\") {\n textSelection\n .call(function () {\n return context.linebreak.apply(context, arguments);\n }, this.bandwidth())\n ;\n }\n } else if (this.overlapMode() === \"wrap\") {\n if (this.type() === \"ordinal\") {\n textSelection\n .call(function () {\n return context.wrap.apply(context, arguments);\n }, this.bandwidth())\n ;\n }\n } else {\n switch (isHoriztontal ? this.overlapMode() : \"none\") {\n case \"stagger\":\n textSelection\n .style(\"text-anchor\", \"middle\")\n .attr(\"dy\", function (_d, i) { return (isBottom ? 1 : -1) * ((isBottom ? 0.71 : 0) + i % tickOverlapModulus) + \"em\"; })\n .attr(\"dx\", 0)\n .attr(\"visibility\", null)\n .attr(\"transform\", \"rotate(0)\")\n ;\n break;\n case \"hide\":\n textSelection\n .style(\"text-anchor\", \"middle\")\n .attr(\"dy\", (isBottom ? 0.71 : 0) + \"em\")\n .attr(\"dx\", 0)\n .attr(\"visibility\", function (_d, i) { return i % tickOverlapModulus ? \"hidden\" : null; })\n .attr(\"transform\", \"rotate(0)\")\n ;\n break;\n case \"rotate\":\n const deg = -(this.labelRotation()) || 0;\n if (deg !== 0 && tickOverlapModulus > 1) {\n textSelection\n .each(function () {\n const elm = d3Select(this);\n const bbox = elm.node().getBBox();\n const dyOff = (isBottom ? 1 : -1) * Math.sin(Math.PI * (-Math.abs(deg) / 180));\n elm\n .style(\"text-anchor\", deg > 0 ? (isBottom ? \"start\" : \"end\") : (isBottom ? \"end\" : \"start\"))\n .attr(\"dy\", (bbox.height / 2 * dyOff) + \"px\")\n .attr(\"dx\", deg > 0 ? (isBottom ? \"0.71em\" : \"-0.71em\") : (isBottom ? \"-0.71em\" : \"0.71em\"))\n .attr(\"transform\", \"rotate(\" + deg + \")\")\n .attr(\"visibility\", null)\n ;\n })\n ;\n break;\n }\n /* falls through */\n default:\n textSelection\n .style(\"text-anchor\", isHoriztontal ? \"middle\" : isLeft ? \"end\" : \"start\")\n .attr(\"dy\", isHoriztontal ? ((isBottom ? 0.71 : 0) + \"em\") : \"0.32em\")\n .attr(\"dx\", 0)\n .attr(\"visibility\", null)\n .attr(\"transform\", \"rotate(0)\")\n ;\n }\n }\n }\n\n calcTickOverlapModulus(element) {\n let retVal = 1;\n switch (this.overlapMode()) {\n case \"rotate\":\n case \"stagger\":\n case \"hide\":\n const bboxArr = [];\n element.selectAll(\".tick > text\").each(function () {\n const bbox = this.getBoundingClientRect();\n for (let i = bboxArr.length - 1; i >= 0; --i) {\n if (bboxArr[i].right < bbox.left) {\n break;\n }\n if (bboxArr.length + 1 - i > retVal) {\n retVal = bboxArr.length + 1 - i;\n }\n }\n bboxArr.push(bbox);\n });\n break;\n default:\n }\n return retVal;\n }\n\n calcOverflow(element, ignoreText?): IOverflow {\n this.updateScale();\n if (this.hidden()) {\n return {\n left: 0,\n top: 0,\n right: 0,\n bottom: 0,\n depth: 0,\n tickOverlapModulus: 1\n };\n }\n const isHorizontal = this.isHorizontal();\n this.range(isHorizontal ? [0, this.width()] : [this.height(), 0]);\n const tmpSvg = element.append(\"g\").attr(\"class\", this.classID());\n const tmpSvgG = tmpSvg.append(\"g\");\n tmpSvgG\n .attr(\"class\", isHorizontal ? \"x\" : \"y\")\n .call(this.d3Axis)\n ;\n if (ignoreText) {\n element.selectAll(\".tick > text\").remove();\n }\n\n const retVal: IOverflow = {\n left: 0,\n top: 0,\n right: 0,\n bottom: 0,\n depth: 0,\n tickOverlapModulus: this.calcTickOverlapModulus(tmpSvgG)\n };\n this.adjustText(tmpSvgG, retVal.tickOverlapModulus);\n\n const bbox = tmpSvgG.node().getBBox();\n retVal.depth = isHorizontal ? bbox.height : bbox.width;\n switch (this.shrinkToFit()) {\n case \"low\":\n case \"both\":\n retVal.left = isHorizontal ? -bbox.x : 0;\n retVal.bottom = isHorizontal ? 0 : -(this.height() - (bbox.height + bbox.y));\n break;\n default:\n }\n switch (this.shrinkToFit()) {\n case \"high\":\n case \"both\":\n retVal.top = isHorizontal ? 0 : -bbox.y;\n retVal.right = isHorizontal ? -(this.width() - bbox.x - bbox.width) : 0;\n break;\n default:\n }\n tmpSvg.remove();\n\n return retVal;\n }\n\n wrap(_text, bandSize, re) {\n re = re || /\\s+/;\n const context = this;\n _text.each(function () {\n const text = d3Select(this);\n const words = text.text().split(re).reverse();\n let line = [];\n let lineNumber = 0;\n const lineHeight = 1.1;\n const x = text.attr(\"x\");\n const y = text.attr(\"y\");\n const fs = parseFloat(text.style(\"font-size\")) || 10;\n const maxLinesPerBand = Math.floor(bandSize / (fs * lineHeight)) - 1;\n const minWordsPerLine = context.isHorizontal() ? 1 : Math.ceil(words.length / maxLinesPerBand);\n const dy = parseFloat(text.attr(\"dy\"))\n ;\n let tspan = text.text(null).append(\"tspan\")\n .attr(\"x\", x)\n .attr(\"y\", y)\n .attr(\"dy\", dy + \"em\")\n ;\n let wordsOnLine = 0;\n let word = words.pop();\n while (word) {\n line.push(word);\n tspan.text(line.join(\" \"));\n wordsOnLine++;\n if ((tspan.node() as any).getComputedTextLength() > bandSize && wordsOnLine >= minWordsPerLine) {\n line.pop();\n tspan.text(line.join(\" \"));\n line = [word];\n tspan = text.append(\"tspan\").attr(\"x\", x).attr(\"y\", y).attr(\"dy\", ++lineNumber * lineHeight + dy + \"em\").text(word);\n wordsOnLine = 0;\n }\n word = words.pop();\n }\n if (!context.isHorizontal()) {\n text.selectAll(\"tspan\")\n .attr(\"y\", (-lineNumber / 2) + \"em\")\n ;\n }\n });\n }\n\n linebreak(text, bandSize) {\n this.wrap(text, bandSize, \"\\n\");\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n\n this.svg.style(\"display\", this.hidden() ? \"none\" : null);\n\n const overlap = this.calcOverflow(element);\n\n const lowerPos: number = this.isHorizontal() ? overlap.left : this.height() - overlap.top - overlap.bottom;\n const upperPos: number = this.isHorizontal() ? this.width() - overlap.right - this.padding() : 0 + this.padding();\n\n this.range(this.reverse() ? [upperPos, lowerPos] : [lowerPos, upperPos]);\n\n const context = this;\n function doPosition(element) {\n element.attr(\"transform\", function () {\n switch (context.orientation()) {\n case \"left\":\n return \"translate(\" + overlap.depth + \", \" + overlap.top + \")\";\n case \"top\":\n return \"translate(0,\" + overlap.depth + \")\";\n case \"right\":\n return \"translate(\" + (context.width() - overlap.depth) + \", \" + overlap.top + \")\";\n case \"bottom\":\n return \"translate(0,\" + (context.height() - overlap.depth) + \")\";\n default:\n }\n return \"translate(0,0)\";\n });\n }\n this.svg\n // .attr(\"class\", this.isHorizontal() ? \"x\" : \"y\")\n .style(\"visibility\", this.type() === \"none\" ? \"hidden\" : null)\n .transition()\n .call(doPosition)\n ;\n if (this._guideElement) {\n this.svgGuides\n .transition()\n .call(doPosition)\n ;\n }\n this.svgAxis\n .call(this.d3Axis)\n ;\n this.adjustText(this.svgAxis, overlap.tickOverlapModulus);\n\n const svgLineBBox = {\n x: this.pos().x,\n width: this.width()\n };\n const svgText = this.svgAxis.selectAll(\".axisTitle\").data(this.title() ? [this.title()] : []);\n const svgTextUpdate = svgText.enter().append(\"text\")\n .attr(\"class\", \"axisTitle\")\n .merge(svgText)\n ;\n const svgTitleTransition = svgTextUpdate.transition()\n .attr(\"dx\", null)\n .style(\"text-anchor\", \"end\")\n ;\n switch (this.orientation()) {\n case \"left\":\n svgTitleTransition\n .attr(\"transform\", \"rotate(-90)\")\n .attr(\"x\", -2)\n .attr(\"y\", 2)\n .attr(\"dy\", \".71em\")\n ;\n break;\n case \"right\":\n svgTitleTransition\n .attr(\"transform\", \"rotate(-90)\")\n .attr(\"x\", -2)\n .attr(\"y\", 4)\n .attr(\"dx\", null)\n .attr(\"dy\", \"-.71em\")\n ;\n break;\n case \"top\":\n svgTitleTransition\n .attr(\"transform\", \"rotate(0)\")\n .attr(\"x\", svgLineBBox.width - 2)\n .attr(\"y\", 2)\n .attr(\"dx\", null)\n .attr(\"dy\", \".71em\")\n ;\n break;\n case \"bottom\":\n svgTitleTransition\n .attr(\"transform\", \"rotate(0)\")\n .attr(\"x\", svgLineBBox.width - 2)\n .attr(\"y\", -2)\n .attr(\"dy\", null)\n ;\n break;\n default:\n }\n svgTitleTransition\n .text(this.title_exists() ? this.title() : \"\")\n ;\n svgText.exit().remove();\n this.svgGuides\n .call(this.d3Guides)\n .selectAll(\".tick\").classed(\"guide-0\", d => d === 0 && this.low() < 0)\n ;\n }\n\n rerender() {\n this.svgAxis.call(this.d3Axis);\n this.svgGuides.call(this.d3Guides);\n }\n\n postUpdate(domNode, element) {\n super.postUpdate(domNode, element);\n if (this._guideElement) {\n this._guideElement\n .attr(\"transform\", this._element.attr(\"transform\"))\n ;\n }\n }\n}\nAxis.prototype._class += \" chart_Axis\";\n\nexport interface Axis {\n type(): string;\n type(_: string): this;\n type_exists(): boolean;\n timePattern(): string;\n timePattern(_: string): this;\n timePattern_exists(): boolean;\n reverse(): boolean;\n reverse(_: boolean): this;\n\n title(): string;\n title(_: string): this;\n title_exists(): boolean;\n orientation(): string;\n orientation(_: string): this;\n orientation_default(): string;\n orientation_default(_: string): this;\n powExponent(): number;\n powExponent(_: number): this;\n logBase(): number;\n logBase(_: number): this;\n ordinals(): string[];\n ordinals(_: string[]): this;\n ordinals_exists(): boolean;\n fontSize(): number;\n fontSize(_: number): this;\n fontSize_exists(): boolean;\n fontFamily(): string;\n fontFamily(_: string): this;\n tickCount(): number;\n tickCount(_: number): this;\n tickFormat(): string;\n tickFormat(_: string): this;\n tickFormat_exists(): boolean;\n tickFormat_reset(): void;\n tickLength(): number;\n tickLength(_: number): this;\n tickLength_exists(): boolean;\n ticks(): Array<{ value: string, label: string }>;\n ticks(_: Array<{ value: string, label: string }>): this;\n low(): any;\n low(_: any): this;\n low_exists(): boolean;\n high(): any;\n high(_: any): this;\n high_exists(): boolean;\n overlapMode(): string;\n overlapMode(_: string): this;\n overlapMode_default(): string;\n overlapMode_default(_: string): this;\n labelRotation(): number;\n labelRotation(_: number): this;\n shrinkToFit(): string;\n shrinkToFit(_: string): this;\n shrinkToFit_default(): string;\n shrinkToFit_default(_: string): this;\n extend(): number;\n extend(_: number): this;\n extend_default(): number;\n extend_default(_: number): this;\n hidden(): boolean;\n hidden(_: boolean): this;\n\n ordinalPaddingInner(): number;\n ordinalPaddingInner(_: number): this;\n ordinalPaddingOuter(): number;\n ordinalPaddingOuter(_: number): this;\n ordinalMappings(_: { [key: string]: string }): this;\n ordinalMappings(): { [key: string]: string };\n ordinalMappings_exists(): boolean;\n padding(): number;\n padding(_: number): this;\n}\n\nAxis.prototype.publish(\"type\", \"linear\", \"set\", \"Type\", [\"none\", \"ordinal\", \"linear\", \"pow\", \"log\", \"time\"]);\nAxis.prototype.publish(\"timePattern\", \"%Y-%m-%d\", \"string\", \"Time Series Pattern\", null, { disable: (w: any) => w.type() !== \"time\" });\nAxis.prototype.publish(\"reverse\", false, \"boolean\", \"Reverse\");\n\nAxis.prototype.publish(\"title\", null, \"string\", \"Title\");\nAxis.prototype.publish(\"orientation\", \"bottom\", \"set\", \"Placement/orientation of the axis\", [\"left\", \"top\", \"right\", \"bottom\"]);\nAxis.prototype.publish(\"powExponent\", 2, \"number\", \"Power exponent (disabled when type is not 'pow')\", null, { disable: (w: any) => w.type() !== \"pow\" });\nAxis.prototype.publish(\"logBase\", 10, \"number\", \"Logarithmic base (disabled when type is not 'log')\", null, { disable: (w: any) => w.type() !== \"log\" });\nAxis.prototype.publish(\"ordinals\", [], \"array\", \"Array of ordinal values to display (disabled when type is not 'ordinal')\", null, { disable: (w: any) => w.type() !== \"ordinal\" });\nAxis.prototype.publish(\"fontSize\", null, \"number\", \"Size of tick label font (pixels)\", null, { optional: true });\nAxis.prototype.publish(\"fontFamily\", null, \"string\", \"Font family of tick labels\", null, { optional: true });\nAxis.prototype.publish(\"tickCount\", null, \"number\", \"Number of ticks to display (disabled when type is 'ordinal')\", null, { optional: true, disable: (w: any) => w.type() === \"ordinal\" });\nAxis.prototype.publish(\"tickFormat\", null, \"string\", \"Format rules for tick text (disabled when type is 'ordinal')\", null, { optional: true, disable: (w: any) => w.type() === \"ordinal\" });\nAxis.prototype.publish(\"tickLength\", null, \"number\", \"Height (or width for left/right orientations) of the axis ticks (in pixels)\", null, { optional: true });\nAxis.prototype.publish(\"ticks\", [], \"array\", \"Custom tick labels\", null, { optional: true }); // TODO: What does this control?\nAxis.prototype.publish(\"low\", null, \"any\", \"Minimum tick value (disabled when type is ordinal)\", null, { optional: true, disable: (w: any) => w.type() === \"ordinal\" });\nAxis.prototype.publish(\"high\", null, \"any\", \"Maximum tick value (disabled when type is ordinal)\", null, { optional: true, disable: (w: any) => w.type() === \"ordinal\" });\nAxis.prototype.publish(\"overlapMode\", \"none\", \"set\", \"Specifies the behavior when tick labels overlap\", [\"none\", \"stagger\", \"hide\", \"rotate\", \"linebreak\", \"wrap\"]);\nAxis.prototype.publish(\"labelRotation\", 33, \"number\", \"Angle of rotation for tick labels (disabled when overlapMode is not 'rotate')\", null, { optional: true, disable: (w: any) => w.overlapMode() !== \"rotate\" });\nAxis.prototype.publish(\"shrinkToFit\", \"both\", \"set\", \"shrinkToFit\", [\"none\", \"low\", \"high\", \"both\"]); // TODO: What does this control?\nAxis.prototype.publish(\"extend\", 5, \"number\", \"Extend the axis range by this % beyond what is needed to display the data (disabled when type is 'ordinal')\", null, { optional: true, disable: (w: any) => w.type() === \"ordinal\" });\nAxis.prototype.publish(\"hidden\", false, \"boolean\", \"Hides axis when 'true'\");\n\nAxis.prototype.publish(\"ordinalPaddingInner\", 0.1, \"number\", \"Determines the ratio of the range that is reserved for blank space between band (0->1)\", null, { disable: (w: Axis) => w.type() !== \"ordinal\" });\nAxis.prototype.publish(\"ordinalPaddingOuter\", 0.1, \"number\", \"Determines the ratio of the range that is reserved for blank space before the first band and after the last band (0->1)\", null, { disable: (w: Axis) => w.type() !== \"ordinal\" });\nAxis.prototype.publish(\"ordinalMappings\", null, \"object\", \"Alternative label mappings (icons)\", null, { optional: true });\nAxis.prototype.publish(\"padding\", 0, \"number\", \"Padding space at top of axis (pixels)\", null, { optional: true });\n\nAxis.prototype._origType = Axis.prototype.type;\nAxis.prototype.type = function (_?: string) {\n const retVal = Axis.prototype._origType.apply(this, arguments);\n if (_ !== undefined) {\n this._type = _;\n this.updateScale();\n }\n return retVal;\n};\n\nAxis.prototype._origTimePattern = Axis.prototype.timePattern;\nAxis.prototype.timePattern = function (_?: string) {\n const retVal = Axis.prototype._origTimePattern.apply(this, arguments);\n if (_ !== undefined) {\n this._timePattern = _;\n this.updateScale();\n }\n return retVal;\n};\n","import { d3Event, select as d3Select, SVGWidget, Utility } from \"@hpcc-js/common\";\nimport { max as d3Max, min as d3Min } from \"d3-array\";\nimport { brush as d3Brush, brushSelection as d3BrushSelection, brushX as d3BrushX, brushY as d3BrushY } from \"d3-brush\";\nimport { hsl as d3Hsl } from \"d3-color\";\nimport { Axis } from \"./Axis.ts\";\n\nimport \"../src/XYAxis.css\";\n\nexport class XYAxis extends SVGWidget {\n protected domainAxis: Axis;\n protected valueAxis: Axis;\n protected xAxis: Axis;\n protected yAxis: Axis;\n protected xyBrush;\n protected xBrush;\n protected yBrush;\n protected margin;\n protected focusChart: XYAxis;\n\n constructor() {\n super();\n Utility.SimpleSelectionMixin.call(this);\n\n this._drawStartPos = \"origin\";\n\n this.domainAxis = new Axis()\n .classed({ domain: true })\n .orientation_default(\"bottom\")\n .type(\"ordinal\")\n .overlapMode_default(\"stagger\")\n .shrinkToFit_default(\"high\")\n .extend_default(0)\n ;\n this.valueAxis = new Axis()\n .classed({ value: true })\n .orientation_default(\"left\")\n .type(\"linear\")\n .shrinkToFit_default(\"high\")\n ;\n\n this.xyBrush = d3Brush()\n .on(\"end\", () => {\n return this.brushMoved();\n })\n .on(\"start.handle brush.handle end.handle\", () => {\n return this.brushMoved2();\n })\n ;\n this.xBrush = d3BrushX()\n .on(\"end\", () => {\n return this.brushMoved();\n })\n .on(\"start.handle brush.handle end.handle\", () => {\n return this.brushMoved2();\n })\n ;\n this.yBrush = d3BrushY()\n .on(\"end\", () => {\n return this.brushMoved();\n })\n .on(\"start.handle brush.handle end.handle\", () => {\n return this.brushMoved2();\n })\n ;\n }\n\n protected _prevBrush;\n resetSelection() {\n this._prevBrush = null;\n return this;\n }\n\n parseData(d) {\n return this.domainAxis.parse(d);\n }\n\n parseValue(d) {\n return this.valueAxis.parse(d, true);\n }\n\n formatData(d) {\n return this.domainAxis.format(d);\n }\n\n formatValue(d) {\n return this.valueAxis.format(d);\n }\n\n parsedData() {\n const retVal = this.data().map(function (row) {\n let prevValue = 0;\n return row.map(function (cell, idx) {\n if (idx === 0) {\n return this.parseData(cell);\n }\n if (idx >= this.columns().length) {\n return cell;\n }\n const _retVal = this.yAxisStacked() ? [prevValue, prevValue + this.parseValue(cell)] : this.parseValue(cell);\n prevValue += this.parseValue(cell);\n return _retVal;\n }, this);\n }, this);\n return retVal;\n }\n\n bandwidth() {\n return this.domainAxis.bandwidth();\n }\n\n protected svg;\n protected svgRegions;\n protected svgDomainGuide;\n protected svgValueGuide;\n protected svgData;\n protected svgDataClipRect;\n protected svgFocus;\n protected svgBrush;\n enter(domNode, element) {\n super.enter(domNode, element);\n this.svg = element.append(\"g\");\n this.svgRegions = element.append(\"g\");\n this.svgDomainGuide = this.svg.append(\"g\");\n this.svgValueGuide = this.svg.append(\"g\");\n this.svgData = this.svg.append(\"g\");\n\n this.svgDataClipRect = this.svg.append(\"clipPath\")\n .attr(\"id\", this.id() + \"_clippath\")\n .append(\"rect\")\n .attr(\"x\", 0)\n .attr(\"y\", 0)\n ;\n this.svgData = this.svg.append(\"g\")\n .attr(\"clip-path\", \"url(#\" + this.id() + \"_clippath)\")\n ;\n this._selection.widgetElement(this.svgData);\n\n this.svgFocus = element.append(\"g\");\n\n this.domainAxis\n .target(this.svg.node())\n .guideTarget(this.svgDomainGuide.node())\n ;\n\n this.valueAxis\n .target(this.svg.node())\n .guideTarget(this.svgValueGuide.node())\n ;\n\n this.svgBrush = element.append(\"g\")\n .attr(\"class\", \"brush\")\n ;\n this.chartsEnter(this, this.svgData, 250);\n }\n\n resizeBrushHandle(d, width, height) {\n let e;\n let x;\n let y;\n if (d.type === \"e\" || d.type === \"w\") {\n e = +(d.type === \"e\");\n x = e ? 1 : -1;\n y = height / 3;\n return \"M\" + (0.5 * x) + \",\" + y +\n \"A6,6 0 0 \" + e + \" \" + (6.5 * x) + \",\" + (y + 6) +\n \"V\" + (2 * y - 6) +\n \"A6,6 0 0 \" + e + \" \" + (0.5 * x) + \",\" + (2 * y) +\n \"Z\" +\n \"M\" + (2.5 * x) + \",\" + (y + 8) +\n \"V\" + (2 * y - 8) +\n \"M\" + (4.5 * x) + \",\" + (y + 8) +\n \"V\" + (2 * y - 8);\n } else {\n e = +(d.type === \"s\");\n y = e ? 1 : -1;\n x = width / 3;\n return \"M\" + x + \", \" + (0.5 * y) +\n \"A6,6 0 0 \" + (e + 1) % 2 + \" \" + (x + 6) + \",\" + (6.5 * y) +\n \"H\" + (2 * x - 6) +\n \"A6,6 0 0 \" + (e + 1) % 2 + \" \" + (2 * x) + \",\" + (0.5 * y) +\n \"Z\" +\n \"M\" + (x + 8) + \",\" + (2.5 * y) +\n \"H\" + (2 * x - 8) +\n \"M\" + (x + 8) + \",\" + (4.5 * y) +\n \"H\" + (2 * x - 8);\n }\n }\n\n private _skipSelection = false;\n skipSelection(): boolean;\n skipSelection(_: boolean): this;\n skipSelection(_?: boolean): boolean | this {\n if (!arguments.length) return this._skipSelection;\n this._skipSelection = _;\n return this;\n }\n\n brushMoved() {\n if (this._skipSelection) return;\n let selected = [];\n const context = this;\n const currSel: any = d3BrushSelection(this.svgBrush.node());\n if (currSel) {\n selected = this.data().filter(function (d) {\n const pos = context.dataPos(d[0]);\n if (context.use2dSelection()) {\n const pos2 = context.valuePos(d[1]) + context.valueAxis.bandwidth() / 2;\n return pos >= currSel[0][0] && pos <= currSel[1][0] && pos2 >= currSel[0][1] && pos2 <= currSel[1][1];\n } else {\n return pos >= currSel[0] && pos <= currSel[1];\n }\n });\n }\n this.selection(selected);\n }\n\n brushMoved2() {\n const isHorizontal = this.orientation() === \"horizontal\";\n const handleTypes = this.use2dSelection() ? [] : isHorizontal ? [{ type: \"w\" }, { type: \"e\" }] : [{ type: \"n\" }, { type: \"s\" }];\n const handlePath = this.svgBrush.selectAll(\".handle--custom\").data(handleTypes);\n const s = d3Event()?.selection;\n if (s == null) {\n handlePath.attr(\"display\", \"none\");\n } else if (isHorizontal) {\n handlePath.attr(\"display\", null).attr(\"transform\", (_d, i) => \"translate(\" + s[i] + \",\" + 0 + \")\");\n } else {\n handlePath.attr(\"display\", null).attr(\"transform\", (_d, i) => \"translate(\" + 0 + \", \" + s[i] + \")\");\n }\n }\n\n dataPos(d) {\n return this.domainAxis.scalePos(d);\n }\n\n valuePos(d) {\n return this.valueAxis.scalePos(d);\n }\n\n getAxisSize(host: XYAxis): { width: number, height: number } {\n return {\n width: !this.xAxis ? host.xAxis.width() : this.xAxis.width(),\n height: !this.yAxis ? host.yAxis.width() : this.yAxis.height()\n };\n }\n\n calcMargin(_domNode, element, isHorizontal) {\n const margin = {\n top: !isHorizontal && this.selectionMode() ? 10 : 2,\n right: isHorizontal && (this.selectionMode() || this.xAxisFocus()) ? 10 : 2,\n bottom: (this.xAxisFocus() ? this.xAxisFocusHeight() : 0) + 2,\n left: 2\n };\n const width = this.width() - margin.left - margin.right;\n const height = this.height() - margin.top - margin.bottom;\n\n let xRight = 0;\n let xHeight = 30;\n let yTop = 0;\n let yWidth = 30;\n for (let i = 0; i < 10; ++i) {\n this.xAxis.width(width - yWidth).height(0);\n const xAxisOverlap = this.xAxis.calcOverflow(element);\n const newXHeight = xAxisOverlap.depth;\n\n this.yAxis.width(0).height(height - xHeight);\n const yAxisOverlap = this.yAxis.calcOverflow(element);\n const newYWidth = yAxisOverlap.depth;\n\n xRight = xAxisOverlap.right;\n yTop = yAxisOverlap.top;\n\n if (newXHeight === xHeight && newYWidth === yWidth) {\n break;\n }\n xHeight = newXHeight;\n yWidth = newYWidth;\n }\n this.xAxis\n .x(width / 2 + yWidth / 2 + margin.left)\n .y(height + margin.top)\n .width(width - yWidth)\n ;\n this.yAxis\n .x(margin.left)\n .y(height / 2 - xHeight / 2 + margin.top)\n .height(height - xHeight)\n ;\n margin.left += yWidth;\n margin.top += yTop;\n margin.right += xRight;\n margin.bottom += xHeight;\n return margin;\n }\n\n updateRegions(_domNode, _element, isHorizontal) {\n const context = this;\n\n const regions = this.svgRegions.selectAll(\".region\").data(this.regions());\n regions.enter().append(\"rect\")\n .attr(\"class\", \"region\")\n ;\n if (isHorizontal) {\n regions\n .attr(\"x\", function (d) { return context.dataPos(d.x0); })\n .attr(\"y\", 0)\n .attr(\"width\", function (d) { return context.dataPos(d.x1) - context.dataPos(d.x0); })\n .attr(\"height\", this.height())\n .style(\"stroke\", function (d) { return context._palette(d.colorID); })\n .style(\"fill\", function (d) { return d3Hsl(context._palette(d.colorID)).brighter(); })\n ;\n } else {\n regions\n .attr(\"x\", 0)\n .attr(\"y\", function (d) { return context.dataPos(d.x0); })\n .attr(\"width\", this.width())\n .attr(\"height\", function (d) { return context.dataPos(d.x0) - context.dataPos(d.x1); })\n .style(\"stroke\", function (d) { return context._palette(d.colorID); })\n .style(\"fill\", function (d) { return d3Hsl(context._palette(d.colorID)).brighter(); })\n ;\n }\n regions.exit().remove();\n }\n\n protected _prevXAxisType;\n update(domNode, element) {\n super.update(domNode, element);\n const context = this;\n\n const isHorizontal = this.orientation() === \"horizontal\";\n this.updateRegions(domNode, element, isHorizontal);\n\n this.domainAxis\n .orientation(isHorizontal ? \"bottom\" : \"left\")\n .title(this.xAxisTitle_exists() ? this.xAxisTitle() : this.columns()[0])\n ;\n this.valueAxis\n .orientation(isHorizontal ? \"left\" : \"bottom\")\n ;\n this.xAxis = isHorizontal ? this.domainAxis : this.valueAxis;\n this.yAxis = isHorizontal ? this.valueAxis : this.domainAxis;\n\n // Update Domain ---\n switch (this.xAxisType()) {\n case \"ordinal\":\n const colLen = this.columns().length;\n const ordinalMappings = {};\n this.domainAxis\n .ordinals(this.data().map(function (d) {\n ordinalMappings[d[0]] = context.xAxisOrdinalMapping(d, d[colLen]);\n return d[0];\n }))\n .ordinalMappings(ordinalMappings)\n ;\n\n break;\n default:\n const domainMin = this.xAxisDomainLow() ? this.xAxisDomainLow() : this.domainAxis.parseInvert(d3Min(this.parsedData(), function (data) {\n return data[0];\n }));\n const domainMax = this.xAxisDomainHigh() ? this.xAxisDomainHigh() : this.domainAxis.parseInvert(d3Max(this.parsedData(), function (data) {\n return data[0];\n }));\n if (domainMin !== undefined && domainMax !== undefined) {\n this.domainAxis\n .low(domainMin)\n .high(domainMax)\n ;\n }\n break;\n }\n\n const min = this.yAxisDomainLow() ? this.yAxisDomainLow() : this.valueAxis.parseInvert(d3Min(this.parsedData(), function (data: any[]) {\n return d3Min(data.filter(function (cell, i) { return i > 0 && context.columns()[i] && context.columns()[i].indexOf(\"__\") !== 0 && cell !== null; }), function (d) { return d instanceof Array ? d[0] : d; });\n }));\n const max = this.yAxisDomainHigh() ? this.yAxisDomainHigh() : this.valueAxis.parseInvert(d3Max(this.parsedData(), function (data: any[]) {\n return d3Max(data.filter(function (cell, i) { return i > 0 && context.columns()[i] && context.columns()[i].indexOf(\"__\") !== 0 && cell !== null; }), function (d) { return d instanceof Array ? d[1] : d; });\n }));\n this.valueAxis\n .low(min)\n .high(max)\n ;\n\n // Calculate Margins ---\n this.margin = this.calcMargin(domNode, element, isHorizontal);\n\n // Update Range ---\n let width = this.width() - this.margin.left - this.margin.right;\n if (width < 0) width = 0;\n let height = this.height() - this.margin.top - this.margin.bottom;\n if (height < 0) height = 0;\n const maxCurrExtent = isHorizontal ? width : height;\n const maxOtherExtent = isHorizontal ? height : width;\n\n // Render ---\n this.domainAxis\n .tickLength(this.xAxisGuideLines() ? maxOtherExtent : 0)\n .render()\n ;\n this.valueAxis\n .tickLength(this.yAxisGuideLines() ? maxCurrExtent : 0)\n .render()\n ;\n\n this.svgDataClipRect\n .attr(\"width\", width)\n .attr(\"height\", height)\n ;\n this.svgData.transition()\n .attr(\"transform\", \"translate(\" + this.margin.left + \",\" + this.margin.top + \")\")\n ;\n\n this.updateBrush(width, height, maxCurrExtent, isHorizontal);\n this.updateFocusChart(domNode, element, this.margin, width, height, isHorizontal);\n this.chartsUpdate(width, height, 250);\n if (this.selectionMode()) {\n return this.brushMoved();\n }\n }\n\n updateBrush(width, height, maxCurrExtent, isHorizontal) {\n const currBrush = this.use2dSelection() ? this.xyBrush : isHorizontal ? this.xBrush : this.yBrush;\n const prevBrushSel: any = d3BrushSelection(this.svgBrush.node());\n currBrush.extent([[0, 0], [width, height]]);\n this.svgBrush\n .attr(\"transform\", \"translate(\" + this.margin.left + \", \" + this.margin.top + \")\")\n .style(\"display\", this.selectionMode() ? null : \"none\")\n .call(currBrush)\n ;\n const handleTypes = this.use2dSelection() ? [] : isHorizontal ? [{ type: \"w\" }, { type: \"e\" }] : [{ type: \"n\" }, { type: \"s\" }];\n const handlePath = this.svgBrush.selectAll(\".handle--custom\").data(handleTypes);\n handlePath.enter().append(\"path\")\n .attr(\"class\", \"handle--custom\")\n .merge(handlePath)\n .attr(\"cursor\", isHorizontal ? \"ew-resize\" : \"ns-resize\")\n .attr(\"d\", (d) => this.resizeBrushHandle(d, width, height))\n ;\n\n if (this.selectionMode()) {\n if (this._prevXAxisType !== this.xAxisType()) {\n this._prevXAxisType = this.xAxisType();\n this._prevBrush = null;\n }\n if (this._prevBrush) {\n if (prevBrushSel) {\n if (this._prevBrush.orientation !== this.orientation()) {\n const tmp = prevBrushSel[0];\n prevBrushSel[0] = this._prevBrush.maxCurrExtent - prevBrushSel[1];\n prevBrushSel[1] = this._prevBrush.maxCurrExtent - tmp;\n }\n const ratio = maxCurrExtent / this._prevBrush.maxCurrExtent;\n if (ratio !== 1) {\n this.svgBrush.transition()\n .on(\"start\", function () {\n currBrush.on(\"end\", null);\n })\n .call(currBrush.move, [prevBrushSel[0] * ratio, prevBrushSel[1] * ratio])\n .on(\"end\", () => {\n currBrush.on(\"end\", () => {\n return this.brushMoved();\n });\n })\n ;\n }\n }\n } else {\n this.svgBrush\n .call(currBrush.move, [0, maxCurrExtent])\n ;\n }\n this._prevBrush = {\n orientation: this.orientation(),\n maxCurrExtent\n };\n }\n }\n\n updateFocusChart(domNode, element, margin, width, height, isHorizontal) {\n const context: XYAxis = this;\n const focusChart = this.svgFocus.selectAll(\"#\" + this.id() + \"_focusChart\").data(this.xAxisFocus() ? [true] : []);\n focusChart.enter().append(\"g\")\n .attr(\"id\", this.id() + \"_focusChart\")\n .attr(\"class\", \"focus\")\n .each(function () {\n context.focusChart = new (context.constructor as any)()\n .target(this)\n ;\n context.focusChart.xBrush\n .on(\"brush.focus\", function () {\n context.syncAxis(width);\n context.chartsUpdate(width, height, 0);\n })\n ;\n context.focusChart\n .layers(context.layers().map((w: any) => new w.constructor()))\n ;\n })\n .merge(focusChart)\n .each(function (this: SVGElement) {\n context.copyPropsTo(context.focusChart, [\"layers\"]);\n let layerIdx = 0;\n for (const layer of context.layers()) {\n layer.copyPropsTo(context.focusChart.layers()[layerIdx]);\n layerIdx++;\n }\n context.focusChart\n .xAxisFocus(false)\n .selectionMode(true)\n .skipSelection(true)\n .orientation(\"horizontal\")\n .xAxisGuideLines(false)\n .xAxisDomainLow(null)\n .xAxisDomainHigh(null)\n .yAxisGuideLines(false)\n .x(context.width() / 2)\n .y(context.height() - context.xAxisFocusHeight() / 2)\n .width(context.width())\n .height(context.xAxisFocusHeight())\n .columns(context.columns())\n .data(context.data())\n .render()\n ;\n context.syncAxis(width);\n })\n ;\n focusChart.exit()\n .each(function () {\n if (context.focusChart) {\n context.focusChart\n .target(null)\n ;\n delete context.focusChart;\n }\n })\n .remove()\n ;\n }\n\n syncAxis(width: number) {\n const currSel = d3BrushSelection(this.focusChart.svgBrush.node()) as [number, number];\n if (currSel) {\n if (this.focusChart.xAxisType() !== \"ordinal\") {\n this.xAxis.domain([this.focusChart.xAxis.invert(currSel[0]), this.focusChart.xAxis.invert(currSel[1])]);\n } else {\n const brushWidth = currSel[1] - currSel[0];\n const scale = brushWidth / width;\n this.xAxis.range([-currSel[0] / scale, (width - currSel[0]) / scale]);\n }\n this.xAxis.rerender();\n }\n }\n\n // Layers ---\n layerColumns(host: XYAxis): string[] {\n const masterColumns = host.columns();\n const retVal = super.columns().filter(col => col !== masterColumns[0]);\n if (!retVal.length) {\n return masterColumns;\n }\n return [masterColumns[0], ...retVal];\n }\n\n layerColumnIndices(host: XYAxis): number[] {\n const masterColumns = host.columns();\n const layerColumns = this.layerColumns(host);\n return layerColumns.map(col => masterColumns.indexOf(col));\n }\n\n layerColumnIndex(host: XYAxis, column: string): number {\n const masterColumns = host.columns();\n return masterColumns.indexOf(column);\n }\n\n layerData(host?: XYAxis): any[][] {\n if (arguments.length === 1) {\n const indices = this.layerColumnIndices(host);\n return host.data().map(row => {\n const retVal = indices.map(idx => row[idx]);\n (retVal as any).__hpcc_origRow = row;\n return retVal;\n });\n }\n throw new Error(\"Setting data on XYAxisLayer is not supported.\");\n }\n\n layerEnter(host: XYAxis, element, duration: number = 250) {\n }\n\n layerUpdate(host: XYAxis, element, duration: number = 250) {\n }\n\n layerExit(host: XYAxis, element, duration: number = 250) {\n }\n\n chartsEnter(host: XYAxis, element, duration: number = 250) {\n this.layerEnter(this, element, duration);\n for (const w of this.layers()) {\n w[\"__xyAxisElement\"] = element.append(\"g\")\n .attr(\"class\", w.class())\n ;\n w\n .target(w[\"__xyAxisElement\"].node() as SVGElement)\n .layerEnter(this, element, duration)\n ;\n }\n }\n\n chartsUpdate(width, height, duration): void {\n this.layerUpdate(this, this.svgData, duration);\n for (const w of this.layers()) {\n w\n .resize({ width, height })\n .layerUpdate(this, w[\"__xyAxisElement\"], duration)\n ;\n }\n }\n\n exit(domNode, element) {\n this.valueAxis.target(null);\n this.domainAxis.target(null);\n super.exit(domNode, element);\n }\n\n selection(_selected) {\n const context = this;\n this._selection.widgetElement().selectAll(\".selected,.deselected\")\n .each(function (d) {\n const selected = _selected.indexOf(d.origRow) >= 0;\n d3Select(this)\n .classed(\"selected\", selected)\n .classed(\"deselected\", !selected)\n .attr(\"filter\", context._selection.svgGlowID() && selected ? `url(#${context._selection.svgGlowID()})` : null)\n ;\n })\n ;\n\n const selRows = _selected.map(d => {\n return this.rowToObj(d);\n });\n setTimeout(() => {\n this.click(selRows, \"\", true);\n }, 0);\n }\n\n // XYAxis ---\n xAxisOrdinalMapping(origRow, lparam) {\n return origRow[0];\n }\n\n // Events ---\n click(row, column, selected) {\n // console.log(\"Click: \" + JSON.stringify(row) + \", \" + column + \", \" + selected);\n }\n\n // Selection ---\n _selection: Utility.SimpleSelection;\n}\nXYAxis.prototype._class += \" chart_XYAxis\";\nXYAxis.prototype.mixin(Utility.SimpleSelectionMixin);\n\nexport interface XYAxis {\n _palette;\n orientation(): \"horizontal\" | \"vertical\";\n orientation(_: \"horizontal\" | \"vertical\"): this;\n orientation_default(_: string);\n pointSizeColumn(): string;\n pointSizeColumn(_: string): this;\n pointSizeColumn_exists(): boolean;\n minPointSize(): number;\n minPointSize(_: number): this;\n maxPointSize(): number;\n maxPointSize(_: number): this;\n use2dSelection(): boolean;\n use2dSelection(_: boolean): this;\n selectionMode(): boolean;\n selectionMode(_: boolean): this;\n xAxisTitle(): string;\n xAxisTitle(_: string): this;\n xAxisTitle_exists(): boolean;\n xAxisTickCount(): number;\n xAxisTickCount(_: number): this;\n xAxisTickFormat(): string;\n xAxisTickFormat(_: string): this;\n xAxisTicks(): Array<{ value: string, label: string }>;\n xAxisTicks(_: Array<{ value: string, label: string }>): this;\n xAxisType(): \"none\" | \"ordinal\" | \"linear\" | \"pow\" | \"log\" | \"time\";\n xAxisType(_: \"none\" | \"ordinal\" | \"linear\" | \"pow\" | \"log\" | \"time\"): this;\n xAxisType_default(_: string);\n xAxisTypeTimePattern(): string;\n xAxisTypeTimePattern(_: string): this;\n xAxisDomainLow(): number | string;\n xAxisDomainLow(_: number | string): this;\n xAxisDomainHigh(): number | string;\n xAxisDomainHigh(_: number | string): this;\n xAxisFontSize(): number | string;\n xAxisFontSize(_: number | string): this;\n xAxisFontFamily(): string;\n xAxisFontFamily(_: string): this;\n xAxisOrdinalPaddingInner(): number;\n xAxisOrdinalPaddingInner(_: number): this;\n xAxisOrdinalPaddingOuter(): number;\n xAxisOrdinalPaddingOuter(_: number): this;\n xAxisOverlapMode(): \"none\" | \"stagger\" | \"hide\" | \"rotate\" | \"linebreak\" | \"wrap\";\n xAxisOverlapMode(_: \"none\" | \"stagger\" | \"hide\" | \"rotate\" | \"linebreak\" | \"wrap\"): this;\n xAxisLabelRotation(): number;\n xAxisLabelRotation(_: number): this;\n xAxisDomainPadding(): number;\n xAxisDomainPadding(_: number): this;\n xAxisGuideLines(): boolean;\n xAxisGuideLines(_: boolean): this;\n xAxisGuideLines_default(_: boolean);\n xAxisFocus(): boolean;\n xAxisFocus(_: boolean): this;\n xAxisFocusHeight(): number;\n xAxisFocusHeight(_: number): this;\n xAxisHidden(): boolean;\n xAxisHidden(_: boolean): this;\n xAxisHidden_default(_: boolean);\n yAxisTitle(): string;\n yAxisTitle(_: string): this;\n yAxisTickCount(): number;\n yAxisTickCount(_: number): this;\n yAxisTickFormat(): string;\n yAxisTickFormat(_: string): this;\n yAxisTicks(): Array<{ value: string, label: string }>;\n yAxisTicks(_: Array<{ value: string, label: string }>): this;\n yAxisType(): \"none\" | \"ordinal\" | \"linear\" | \"pow\" | \"log\" | \"time\";\n yAxisType(_: \"none\" | \"ordinal\" | \"linear\" | \"pow\" | \"log\" | \"time\"): this;\n yAxisType_default(_: string);\n yAxisTypeTimePattern(): string;\n yAxisTypeTimePattern(_: string): this;\n yAxisTypePowExponent(): number;\n yAxisTypePowExponent(_: number): this;\n yAxisTypeLogBase(): number;\n yAxisTypeLogBase(_: number): this;\n yAxisStacked(): boolean;\n yAxisStacked(_: boolean): this;\n yAxisDomainLow(): number | string;\n yAxisDomainLow(_: number | string): this;\n yAxisDomainHigh(): number | string;\n yAxisDomainHigh(_: number | string): this;\n yAxisDomainPadding(): number;\n yAxisDomainPadding(_: number): this;\n yAxisGuideLines(): boolean;\n yAxisGuideLines(_: boolean): this;\n yAxisGuideLines_default(_: boolean);\n yAxisHidden(): boolean;\n yAxisHidden(_: boolean): this;\n yAxisHidden_default(_: boolean);\n regions(): object[];\n regions(_: object[]): this;\n layers(): XYAxis[];\n layers(_: XYAxis[]): this;\n xAxisPadding(): number;\n xAxisPadding(_: number): this;\n yAxisPadding(): number;\n yAxisPadding(_: number): this;\n}\n\nXYAxis.prototype.publish(\"orientation\", \"horizontal\", \"set\", \"Selects orientation for the axis\", [\"horizontal\", \"vertical\"]);\nXYAxis.prototype.publish(\"pointSizeColumn\", null, \"string\", \"pointSizeColumn\", null, { optional: true });\nXYAxis.prototype.publish(\"minPointSize\", 6, \"number\", \"minPointSize\");\nXYAxis.prototype.publish(\"maxPointSize\", 26, \"number\", \"maxPointSize\");\nXYAxis.prototype.publish(\"use2dSelection\", false, \"boolean\", \"2D Range Selector\");\nXYAxis.prototype.publish(\"selectionMode\", false, \"boolean\", \"Range Selector\");\nXYAxis.prototype.publishProxy(\"xAxisTitle\", \"domainAxis\", \"title\");\nXYAxis.prototype.publishProxy(\"xAxisTickCount\", \"domainAxis\", \"tickCount\");\nXYAxis.prototype.publishProxy(\"xAxisTickFormat\", \"domainAxis\", \"tickFormat\");\nXYAxis.prototype.publishProxy(\"xAxisTicks\", \"domainAxis\", \"ticks\");\nXYAxis.prototype.publishProxy(\"xAxisType\", \"domainAxis\", \"type\");\nXYAxis.prototype.publishProxy(\"xAxisTypeTimePattern\", \"domainAxis\", \"timePattern\");\nXYAxis.prototype.publish(\"xAxisDomainLow\", null, \"string\", \"X-Axis Low\", null, { optional: true, disable: (w: XYAxis) => w.xAxisType() === \"ordinal\" });\nXYAxis.prototype.publish(\"xAxisDomainHigh\", null, \"string\", \"X-Axis High\", null, { optional: true, disable: (w: XYAxis) => w.xAxisType() === \"ordinal\" });\nXYAxis.prototype.publishProxy(\"xAxisFontSize\", \"domainAxis\", \"fontSize\");\nXYAxis.prototype.publishProxy(\"xAxisFontFamily\", \"domainAxis\", \"fontFamily\");\nXYAxis.prototype.publishProxy(\"xAxisOrdinalPaddingInner\", \"domainAxis\", \"ordinalPaddingInner\");\nXYAxis.prototype.publishProxy(\"xAxisOrdinalPaddingOuter\", \"domainAxis\", \"ordinalPaddingOuter\");\nXYAxis.prototype.publishProxy(\"xAxisOverlapMode\", \"domainAxis\", \"overlapMode\");\nXYAxis.prototype.publishProxy(\"xAxisLabelRotation\", \"domainAxis\", \"labelRotation\");\nXYAxis.prototype.publishProxy(\"xAxisDomainPadding\", \"domainAxis\", \"extend\");\nXYAxis.prototype.publish(\"xAxisGuideLines\", false, \"boolean\", \"Y-Axis Guide Lines\");\nXYAxis.prototype.publish(\"xAxisFocus\", false, \"boolean\", \"X-Axis Focus\", null, { disable: (w: any) => w.orientation() !== \"horizontal\" });\nXYAxis.prototype.publish(\"xAxisFocusHeight\", 80, \"number\", \"X-Axis Focus Height\", null, { disable: (w: any) => !w.xAxisFocus() });\nXYAxis.prototype.publishProxy(\"xAxisHidden\", \"domainAxis\", \"hidden\");\nXYAxis.prototype.publishProxy(\"yAxisFontSize\", \"valueAxis\", \"fontSize\");\nXYAxis.prototype.publishProxy(\"yAxisFontFamily\", \"valueAxis\", \"fontFamily\");\nXYAxis.prototype.publishProxy(\"yAxisTitle\", \"valueAxis\", \"title\");\nXYAxis.prototype.publishProxy(\"yAxisTickCount\", \"valueAxis\", \"tickCount\");\nXYAxis.prototype.publishProxy(\"yAxisTickFormat\", \"valueAxis\", \"tickFormat\");\nXYAxis.prototype.publishProxy(\"yAxisTicks\", \"valueAxis\", \"ticks\");\nXYAxis.prototype.publishProxy(\"yAxisType\", \"valueAxis\", \"type\");\nXYAxis.prototype.publishProxy(\"yAxisTypeTimePattern\", \"valueAxis\", \"timePattern\");\nXYAxis.prototype.publishProxy(\"yAxisTypePowExponent\", \"valueAxis\", \"powExponent\");\nXYAxis.prototype.publishProxy(\"yAxisTypeLogBase\", \"valueAxis\", \"logBase\");\nXYAxis.prototype.publish(\"yAxisStacked\", false, \"boolean\", \"Stacked Chart\", null, { tags: [\"Basic\"], disable: (w: any) => w.xAxisType() !== \"ordinal\" || w._class.indexOf(\"chart_Column\") < 0 });\nXYAxis.prototype.publish(\"yAxisDomainLow\", null, \"string\", \"Y-Axis Low\", null, { optional: true, disable: (w: any) => w.yAxisType() === \"ordinal\" });\nXYAxis.prototype.publish(\"yAxisDomainHigh\", null, \"string\", \"Y-Axis High\", null, { optional: true, disable: (w: any) => w.yAxisType() === \"ordinal\" });\nXYAxis.prototype.publishProxy(\"yAxisDomainPadding\", \"valueAxis\", \"extend\");\nXYAxis.prototype.publish(\"yAxisGuideLines\", true, \"boolean\", \"Y-Axis Guide Lines\");\nXYAxis.prototype.publishProxy(\"yAxisHidden\", \"valueAxis\", \"hidden\");\nXYAxis.prototype.publish(\"regions\", [], \"array\", \"Regions\");\nXYAxis.prototype.publish(\"layers\", [], \"widgetArray\", \"Layers\", null, { render: false });\nXYAxis.prototype.publishProxy(\"xAxisPadding\", \"domainAxis\", \"padding\");\nXYAxis.prototype.publishProxy(\"yAxisPadding\", \"valueAxis\", \"padding\");\n","import { INDChart, ITooltip } from \"@hpcc-js/api\";\nimport { InputField } from \"@hpcc-js/common\";\nimport { extent as d3Extent } from \"d3-array\";\nimport { scaleLinear as d3ScaleLinear, scaleLog as d3ScaleLog, scalePow as d3ScalePow, scaleSqrt as d3ScaleSqrt } from \"d3-scale\";\nimport { select as d3Select } from \"d3-selection\";\nimport {\n area as d3Area,\n curveBasis as d3CurveBasis, curveBundle as d3CurveBundle, curveCardinal as d3CurveCardinal, curveCatmullRom as d3curveCatmullRom, curveLinear as d3CurveLinear,\n curveMonotoneX as d3CurveMonotoneX, curveNatural as d3CurveNatural, curveStep as d3CurveStep, curveStepAfter as d3CurveStepAfter, curveStepBefore as d3CurveStepBefore,\n line as d3Line\n} from \"d3-shape\";\nimport { XYAxis } from \"./XYAxis.ts\";\n\nimport \"../src/Scatter.css\";\n\nexport class Scatter extends XYAxis {\n static __inputs: InputField[] = [{\n id: \"label\",\n type: \"any\"\n }, {\n id: \"values\",\n type: \"number\",\n multi: true\n }];\n\n constructor() {\n super();\n INDChart.call(this);\n ITooltip.call(this);\n this\n .xAxisGuideLines_default(true)\n .yAxisGuideLines_default(true)\n ;\n }\n\n xPos(host: XYAxis, d) {\n return host.orientation() === \"horizontal\" ? host.dataPos(d.label) : host.valuePos(d.value);\n }\n\n yPos(host: XYAxis, d) {\n return host.orientation() === \"horizontal\" ? host.valuePos(d.value) : host.dataPos(d.label);\n }\n\n private curve(): any {\n switch (this.interpolate()) {\n case \"linear\":\n return d3CurveLinear;\n case \"step\":\n return d3CurveStep;\n case \"step-before\":\n return d3CurveStepBefore;\n case \"step-after\":\n return d3CurveStepAfter;\n case \"basis\":\n return d3CurveBasis;\n case \"bundle\":\n return d3CurveBundle;\n case \"cardinal\":\n return d3CurveCardinal;\n case \"catmullRom\":\n return d3curveCatmullRom;\n case \"natural\":\n return d3CurveNatural;\n case \"monotone\":\n default:\n return d3CurveMonotoneX;\n }\n }\n\n private getScale() {\n switch (this.pointSizeScale()) {\n case \"linear\":\n return d3ScaleLinear();\n case \"pow\":\n return d3ScalePow().exponent(2);\n case \"log\":\n return d3ScaleLog();\n case \"sqrt\":\n return d3ScaleSqrt();\n }\n }\n\n protected pointColor(row, col, value, origRow) {\n if (this.interpolate() && this.pointDarken()) {\n return this.strokeColor(row, col, value, origRow);\n }\n return this.fillColor(row, col, value, origRow);\n }\n\n protected lineColor(row, col, value, origRow) {\n if (this.interpolateFill() && this.interpolateDarken()) {\n return this.strokeColor(row, col, value, origRow);\n }\n return this.fillColor(row, col, value, origRow);\n }\n\n protected areaColor(row, col, value, origRow) {\n return this.fillColor(row, col, value, origRow);\n }\n\n layerEnter(host: XYAxis, element, duration: number = 250) {\n super.layerEnter(host, element, duration);\n const context = this;\n this\n .tooltipHTML(function (d) {\n switch (context.tooltipStyle()) {\n case \"series-table\":\n return context.tooltipFormat({\n label: d.label,\n arr: context.columns().slice(1).map(function (column, i) {\n return {\n label: column,\n color: context._palette(column),\n value: context.data()[d.rowIdx][i + 1]\n };\n })\n });\n default:\n return context.tooltipFormat({ label: d.label, series: d.column, value: d.value });\n }\n })\n ;\n }\n\n protected _prevPointShape;\n layerUpdate(host: XYAxis, element, duration: number = 250) {\n super.layerUpdate(host, element);\n const isHorizontal = host.orientation() === \"horizontal\";\n const height = isHorizontal ? this.height() : this.width();\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 if (this._prevPointShape !== this.pointShape()) {\n element.selectAll(\".data\").remove();\n this._prevPointShape = this.pointShape();\n }\n\n function mapShape(shape) {\n switch (shape) {\n case \"rectangle\":\n return \"rect\";\n case \"circle\":\n return \"circle\";\n case \"cross\":\n return \"path\";\n default:\n }\n }\n const usePointSizeColumn = this.pointSizeColumn_exists();\n let pointSizeColumnIdx;\n let extent;\n let scale;\n if (usePointSizeColumn) {\n pointSizeColumnIdx = this.columns().indexOf(this.pointSizeColumn());\n extent = d3Extent(this.data(), d => d[pointSizeColumnIdx]);\n scale = this.getScale().domain(extent);\n }\n const layerColumns = this.layerColumns(host);\n const layerData = this.layerData(host);\n const flatData = this.flattenData(layerColumns, layerData).map(function (d) {\n d.shape = mapShape(context.pointShape());\n d.column = layerColumns[d.colIdx];\n d.row = layerData[d.rowIdx];\n d.origRow = (layerData[d.rowIdx] as any).__hpcc_origRow;\n if (extent) {\n d.size = scale(d.row[pointSizeColumnIdx]) * (context.maxPointSize() - context.minPointSize()) + context.minPointSize();\n return d.column === context.pointSizeColumn() ? false : d;\n } else {\n d.size = context.pointSize();\n return d;\n }\n\n }).filter(d => d);\n\n const areas = element.selectAll(\".area\").data(layerColumns.filter(function (_d, idx) { return context.interpolate() && context.interpolateFill() && idx > 0; }));\n const areasEnter = areas.enter().append(\"path\");\n const area = d3Area()\n .curve(this.curve())\n ;\n if (isHorizontal) {\n area\n .x(function (d) { return context.xPos(host, d); })\n .y0(Math.min(height, this.yPos(host, { value: 0 })))\n .y1(function (d) { return context.yPos(host, d); })\n ;\n } else {\n area\n .y(function (d) { return context.yPos(host, d); })\n .x0(Math.max(0, this.xPos(host, { value: 0 })))\n .x1(function (d) { return context.xPos(host, d); })\n ;\n }\n areasEnter.merge(areas)\n .attr(\"class\", d => \"area series series-\" + this.cssTag(d))\n .each(function (_d, idx) {\n const element = d3Select(this);\n element\n .attr(\"d\", area(flatData.filter(function (d2) { return d2.colIdx === idx + 1; })))\n .style(\"opacity\", context.interpolateFillOpacity())\n .style(\"stroke\", \"none\")\n .style(\"fill\", context.areaColor([], _d, undefined, []))\n ;\n });\n areas.exit().remove();\n\n const lines = element.selectAll(\".line\").data(layerColumns.filter(function (_d, idx) { return context.interpolate() && idx > 0; }));\n const linesEnter = lines.enter().append(\"path\");\n const line = d3Line()\n .x(function (d) { return context.xPos(host, d); })\n .y(function (d) { return context.yPos(host, d); })\n .curve(this.curve())\n ;\n linesEnter.merge(lines)\n .attr(\"class\", d => \"line series series-\" + this.cssTag(d))\n .each(function (_d, idx) {\n const element = d3Select(this);\n const data2 = flatData.filter(function (d2) { return d2.colIdx === idx + 1; });\n element\n .attr(\"d\", line(data2))\n .style(\"stroke\", context.lineColor([], _d, undefined, []))\n .style(\"fill\", \"none\")\n ;\n });\n lines.exit().remove();\n\n const points = element.selectAll(\".point\").data(flatData, function (d, idx) { return d.shape + \"_\" + idx; });\n points.enter().append(\"g\")\n .each(function (this: SVGElement, d2) {\n const element = d3Select(this);\n element\n .append(d2.shape)\n .attr(\"class\", \"pointShape\")\n ;\n element\n .append(\"text\")\n .attr(\"class\", \"pointValue\")\n .style(\"display\", \"none\")\n .attr(\"text-anchor\", context.valueAnchor())\n .attr(\"alignment-baseline\", context.valueBaseline())\n .attr(\"fill\", function (d: any, _idx) {\n const useTextColor = context.valueBaseline() === \"middle\" || context.valueBaseline() === \"central\";\n return useTextColor ? context.textColor(d.row, d.column, d.value, d.origRow) : null;\n })\n ;\n element\n .append(\"circle\")\n .attr(\"class\", \"pointSelection\")\n .on(\"mouseout.tooltip\", context.tooltip.hide)\n .on(\"mousemove.tooltip\", context.tooltip.show)\n .call(host._selection.enter.bind(host._selection))\n .on(\"click\", function (d: any, _idx) {\n context.click(host.rowToObj(host.data()[d.rowIdx]), d.column, host._selection.selected(this));\n })\n .on(\"dblclick\", function (d: any, _idx) {\n context.dblclick(host.rowToObj(host.data()[d.rowIdx]), d.column, host._selection.selected(this));\n })\n ;\n })\n .merge(points)\n .attr(\"class\", d => \"point series series-\" + this.cssTag(d.column))\n .each(function (this: SVGElement, d2) {\n const textSelection = d3Select(this).select(\".pointValue\");\n textSelection\n .attr(\"x\", function (d) { return context.xPos(host, d); })\n .attr(\"y\", function (d) { return context.yPos(host, d); })\n .style(\"display\", context.showValue() ? \"block\" : \"none\")\n .attr(\"text-anchor\", context.valueAnchor())\n .attr(\"alignment-baseline\", context.valueBaseline())\n .text(function (d) {\n return d[\"value\"];\n })\n ;\n const elementSelection = d3Select(this).select(\".pointSelection\");\n elementSelection\n .attr(\"cx\", function (d) { return context.xPos(host, d); })\n .attr(\"cy\", function (d) { return context.yPos(host, d); })\n .attr(\"r\", d2.size)\n ;\n\n const element = d3Select(this).select(\".pointShape\");\n switch (d2.shape) {\n case \"rect\":\n element\n .attr(\"x\", function (d) { return context.xPos(host, d) - d2.size / 2; })\n .attr(\"y\", function (d) { return context.yPos(host, d) - d2.size / 2; })\n .attr(\"width\", d2.size)\n .attr(\"height\", d2.size)\n .style(\"fill\", context.pointColor(d2.row, d2.column, d2.value, d2.origRow))\n ;\n break;\n case \"circle\":\n element\n .attr(\"cx\", function (d) { return context.xPos(host, d); })\n .attr(\"cy\", function (d) { return context.yPos(host, d); })\n .attr(\"r\", d2.size * 0.9)\n .style(\"fill\", context.pointColor(d2.row, d2.column, d2.value, d2.origRow))\n ;\n break;\n case \"path\":\n element\n .attr(\"d\", function (d: any) {\n return \"M\" + (context.xPos(host, d) - d2.size / 2) + \" \" + (context.yPos(host, d) - d2.size / 2) + \" \" +\n \"L\" + (context.xPos(host, d) + d2.size / 2) + \" \" + (context.yPos(host, d) + d2.size / 2) + \" \" +\n \"M\" + (context.xPos(host, d) - d2.size / 2) + \" \" + (context.yPos(host, d) + d2.size / 2) + \" \" +\n \"L\" + (context.xPos(host, d) + d2.size / 2) + \" \" + (context.yPos(host, d) - d2.size / 2);\n })\n .style(\"stroke\", context.pointColor(d2.row, d2.column, d2.value, d2.origRow))\n ;\n break;\n default:\n }\n })\n ;\n points.exit().remove();\n }\n\n exit(domNode, element) {\n super.exit(domNode, element);\n }\n}\nScatter.prototype._class += \" chart_Scatter\";\nScatter.prototype.implements(INDChart.prototype);\nScatter.prototype.implements(ITooltip.prototype);\n\nexport interface Scatter {\n\n valueAnchor(): string;\n valueAnchor(_: string): this;\n valueBaseline(): string;\n valueBaseline(_: string): this;\n showValue(): boolean;\n showValue(_: boolean): this;\n pointDarken(): boolean;\n pointDarken(_: boolean): this;\n interpolateDarken(): boolean;\n interpolateDarken(_: boolean): this;\n\n paletteID(): string;\n paletteID(_: string): this;\n useClonedPalette(): boolean;\n useClonedPalette(_: boolean): this;\n pointSizeScale(): string;\n pointSizeScale(_: string): this;\n pointShape(): string;\n pointShape(_: string): this;\n pointSize(): number;\n pointSize(_: number): this;\n interpolate(): string;\n interpolate(_: string): this;\n interpolate_default(): string;\n interpolate_default(_: string): this;\n interpolateFill(): boolean;\n interpolateFill(_: boolean): this;\n interpolateFill_default(): boolean;\n interpolateFill_default(_: boolean): this;\n interpolateFillOpacity(): number;\n interpolateFillOpacity(_: number): this;\n\n // INDChart\n fillColor(row, column, value, origRow): string;\n strokeColor(row, column, value, origRow): string;\n textColor(row, column, value, origRow): string;\n dblclick(row, column, selected): void;\n\n // ITooltip\n tooltip;\n tooltipHTML(_): string;\n tooltipFormat(_): string;\n tooltipStyle(): \"default\" | \"none\" | \"series-table\";\n}\nScatter.prototype.publish(\"paletteID\", \"default\", \"set\", \"Color palette for this widget\", Scatter.prototype._palette.switch(), { tags: [\"Basic\", \"Shared\"] });\nScatter.prototype.publish(\"pointSizeScale\", \"linear\", \"set\", \"pointSizeScale\", [\"linear\", \"pow\", \"log\", \"sqrt\"]);\nScatter.prototype.publish(\"pointShape\", \"cross\", \"set\", \"Shape of the data points\", [\"circle\", \"rectangle\", \"cross\"]);\nScatter.prototype.publish(\"pointSize\", 6, \"number\", \"Point Size\", null, { range: { min: 1, step: 1, max: 200 } });\nScatter.prototype.publish(\"interpolate\", \"\", \"set\", \"Interpolate Data\", [\"\", \"linear\", \"step\", \"step-before\", \"step-after\", \"basis\", \"bundle\", \"cardinal\", \"catmullRom\", \"natural\", \"monotone\"]);\nScatter.prototype.publish(\"pointDarken\", true, \"boolean\", \"If true, and interpolate is set, then points will have a slightly darker color than their assigned palette color\", null, { disable: w => !w.interpolate() });\nScatter.prototype.publish(\"interpolateDarken\", true, \"boolean\", \"If true, and interpolateFill is true, then lines will have a slightly darker color than their assigned palette color\", null, { disable: w => !w.interpolateFill() });\nScatter.prototype.publish(\"interpolateFill\", false, \"boolean\", \"If true, the area between the line and zero will be filled\");\nScatter.prototype.publish(\"interpolateFillOpacity\", 0.66, \"number\", \"Fill interpolation Opacity\", null, { range: { min: 0, step: 0.01, max: 1 } });\nScatter.prototype.publish(\"useClonedPalette\", false, \"boolean\", \"Enable or disable using a cloned palette\", null, { tags: [\"Intermediate\", \"Shared\"] });\nScatter.prototype.publish(\"showValue\", false, \"boolean\");\nScatter.prototype.publish(\"valueAnchor\", \"middle\", \"set\", \"text-anchor for shown value text\", [\"start\", \"middle\", \"end\"]);\nScatter.prototype.publish(\"valueBaseline\", \"ideographic\", \"set\", \"alignment-baseline for shown value text\", [\"auto\", \"baseline\", \"before-edge\", \"text-before-edge\", \"middle\", \"central\", \"after-edge\", \"text-after-edge\", \"ideographic\", \"alphabetic\", \"hanging\", \"mathematical\", \"inherit\"]);\n","import { Scatter } from \"./Scatter.ts\";\n\nexport class Area extends Scatter {\n constructor() {\n super();\n this\n .interpolate_default(\"linear\")\n .interpolateFill_default(true)\n ;\n }\n}\nArea.prototype._class += \" chart_Area\";\n","import { INDChart, ITooltip } from \"@hpcc-js/api\";\nimport { InputField, Text } from \"@hpcc-js/common\";\nimport { format as d3Format } from \"d3-format\";\nimport { scaleBand as d3ScaleBand } from \"d3-scale\";\nimport { local as d3Local, select as d3Select } from \"d3-selection\";\nimport { XYAxis } from \"./XYAxis.ts\";\n\nimport \"../src/Column.css\";\n\nexport class Column extends XYAxis {\n static __inputs: InputField[] = [{\n id: \"label\",\n type: \"string\"\n }, {\n id: \"values\",\n type: \"number\",\n multi: true\n }];\n\n protected _linearGap: number;\n private textLocal = d3Local<Text>();\n private stackedTextLocal = d3Local<Text>();\n private isHorizontal: boolean;\n\n constructor() {\n super();\n INDChart.call(this);\n ITooltip.call(this);\n\n this._selection.skipBringToTop(true);\n\n this._linearGap = 25.0;\n }\n\n layerEnter(host: XYAxis, element, duration: number = 250) {\n super.layerEnter(host, element, duration);\n const context = this;\n this\n .tooltipHTML(function (d) {\n switch (context.tooltipStyle()) {\n case \"series-table\":\n return context.tooltipFormat({\n label: d.row[0],\n arr: context.columns().slice(1).map(function (column, i) {\n return {\n label: column,\n color: context._palette(column),\n value: d.row[i + 1]\n };\n })\n });\n default:\n let value = d.row[d.idx];\n if (value instanceof Array) {\n value = value[1] - value[0];\n }\n return context.tooltipFormat({ label: d.row[0], series: context.layerColumns(host)[d.idx], value });\n }\n })\n ;\n }\n\n adjustedData(host: XYAxis) {\n const retVal = this.layerData(host).map(row => {\n let prevValue = 0;\n return row.map((cell, idx) => {\n if (idx === 0) {\n return cell;\n }\n if (idx >= this.layerColumns(host).length) {\n return cell;\n }\n const retVal2 = host.yAxisStacked() ? [prevValue, prevValue + cell] : cell;\n prevValue += cell;\n return retVal2;\n }, this);\n }, this);\n return retVal;\n }\n\n layerUpdate(host: XYAxis, element, duration: number = 250) {\n super.layerUpdate(host, element, duration);\n const isHorizontal = host.orientation() === \"horizontal\";\n this.isHorizontal = isHorizontal;\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 const formatPct = d3Format(context.showValueAsPercentFormat());\n\n let dataLen = 10;\n let offset = 0;\n switch (host.xAxisType()) {\n case \"ordinal\":\n dataLen = host.bandwidth();\n offset = -dataLen / 2;\n break;\n case \"linear\":\n case \"time\":\n dataLen = Math.max(Math.abs(host.dataPos(2) - host.dataPos(1)) * (100 - this._linearGap) / 100, dataLen);\n offset = -dataLen / 2;\n break;\n default:\n }\n\n this.tooltip.direction(isHorizontal ? \"n\" : \"e\");\n\n const columnScale = d3ScaleBand()\n .domain(context.layerColumns(host).filter(function (_d, idx) { return idx > 0; }))\n .rangeRound(isHorizontal ? [0, dataLen] : [dataLen, 0])\n .paddingInner(this.xAxisSeriesPaddingInner())\n .paddingOuter(0)\n ;\n let domainSums = [];\n const seriesSums = [];\n const columnLength = this.columns().length;\n const rowData = this.data();\n if (this.showValue() && this.showValueAsPercent() === \"series\") {\n rowData.forEach((row) => {\n row.filter((_, idx) => idx > 0 && idx < columnLength).forEach((col, idx) => {\n if (seriesSums[idx + 1] === undefined) {\n seriesSums[idx + 1] = 0;\n }\n seriesSums[idx + 1] += col;\n });\n });\n }\n\n if (this.showDomainTotal() || (this.showValue() && this.showValueAsPercent() === \"domain\")) {\n domainSums = rowData.map(row => {\n return row.filter((cell, idx) => idx > 0 && idx < columnLength).reduce((sum, cell) => {\n return sum + cell;\n }, 0);\n });\n }\n\n const column = element.selectAll(\".dataRow\")\n .data(this.adjustedData(host))\n ;\n const hostData = host.data();\n const axisSize = this.getAxisSize(host);\n column.enter().append(\"g\")\n .attr(\"class\", \"dataRow\")\n .merge(column)\n .each(function (dataRow, dataRowIdx) {\n const element = d3Select(this);\n\n const columnGRect = element.selectAll(\".dataCell\").data(dataRow.filter(function (_d, i) { return i < context.layerColumns(host).length; }).map(function (d, i) {\n return {\n column: context.layerColumns(host)[i],\n row: dataRow,\n origRow: hostData[dataRowIdx],\n value: d,\n idx: i\n };\n }).filter(function (d) { return d.value !== null && d.idx > 0; }), (d: any) => d.column);\n\n const columnGEnter = columnGRect\n .enter().append(\"g\")\n .attr(\"class\", \"dataCell\")\n .on(\"mouseout.tooltip\", function (d: any) {\n if (!context.tooltipInnerTextEllipsedOnly() || (d.innerTextObj && d.innerTextObj.isTruncated)) {\n context.tooltip.hide.apply(context, arguments);\n }\n })\n .on(\"mousemove.tooltip\", function (d: any) {\n if (!context.tooltipInnerTextEllipsedOnly() || (d.innerTextObj && d.innerTextObj.isTruncated)) {\n context.tooltip.show.apply(context, arguments);\n }\n })\n .call(host._selection.enter.bind(host._selection))\n .on(\"click\", function (d: any) {\n context.click(host.rowToObj(d.origRow), d.column, host._selection.selected(this));\n })\n .on(\"dblclick\", function (d: any) {\n context.dblclick(host.rowToObj(d.origRow), d.column, host._selection.selected(this));\n })\n .style(\"opacity\", 0)\n .each(function (this: SVGElement, d: any) {\n const element = d3Select(this);\n element.append(\"rect\")\n .attr(\"class\", \"columnRect series series-\" + context.cssTag(d.column))\n ;\n element.append(\"text\")\n .attr(\"class\", \"columnRectText\")\n .style(\"stroke\", \"transparent\")\n ;\n })\n ;\n columnGEnter.transition().duration(duration)\n .style(\"opacity\", 1)\n ;\n const domainLength = host.yAxisStacked() ? dataLen : columnScale.bandwidth();\n columnGEnter.merge(columnGRect as any).each(function (this: SVGElement, d: any) {\n const element = d3Select(this);\n const domainPos = host.dataPos(dataRow[0]) + (host.yAxisStacked() ? 0 : columnScale(d.column)) + offset;\n const upperValue = d.value instanceof Array ? d.value[1] : d.value;\n let valueText = d.origRow[d.idx];\n if (context.showValue()) {\n const dm = context.dataMeta();\n switch (context.showValueAsPercent()) {\n case \"series\":\n const seriesSum = typeof dm.sum !== \"undefined\" ? dm.sum : seriesSums[d.idx];\n valueText = formatPct(valueText / seriesSum);\n break;\n case \"domain\":\n const domainSum = typeof dm.sum !== \"undefined\" ? dm.sum : domainSums[dataRowIdx];\n valueText = formatPct(valueText / domainSum);\n break;\n case null:\n default:\n valueText = d3Format(context.showValueFormat())(valueText);\n break;\n }\n }\n const upperValuePos = host.valuePos(upperValue);\n const lowerValuePos = host.valuePos(d.value instanceof Array ? d.value[0] : 0);\n const valuePos = Math.min(lowerValuePos, upperValuePos);\n const valueLength = Math.abs(upperValuePos - lowerValuePos);\n\n const innerTextHeight = context.innerTextFontSize();\n const innerTextPadding = context.innerTextPadding_exists() ? context.innerTextPadding() : innerTextHeight / 2.5;\n\n const dataRect = context.intersectRectRect(\n {\n x: isHorizontal ? domainPos : valuePos,\n y: isHorizontal ? valuePos : domainPos,\n width: isHorizontal ? domainLength : valueLength,\n height: isHorizontal ? valueLength : domainLength\n },\n {\n x: 0,\n y: 0,\n width: axisSize.width,\n height: axisSize.height\n }\n );\n\n const _rects = element.select(\"rect\").transition().duration(duration)\n .style(\"fill\", (d: any) => context.fillColor(d.row, d.column, d.value, d.origRow))\n ;\n\n if (isHorizontal) {\n _rects\n .attr(\"x\", domainPos)\n .attr(\"y\", valuePos)\n .attr(\"width\", domainLength)\n .attr(\"height\", valueLength)\n ;\n } else {\n _rects\n .attr(\"y\", domainPos)\n .attr(\"x\", valuePos)\n .attr(\"height\", domainLength)\n .attr(\"width\", valueLength)\n ;\n }\n const _texts = element.select(\"text\").transition().duration(duration)\n .style(\"font-size\", innerTextHeight + \"px\")\n .style(\"fill\", (d: any) => context.textColor(d.row, d.column, d.value, d.origRow))\n ;\n\n _texts.style(\"font-family\", context.innerTextFontFamily_exists() ? context.innerTextFontFamily() : null);\n\n const padding = context.innerTextPadding_exists() ? context.innerTextPadding() : 8;\n\n const textHeightOffset = innerTextHeight / 2.7;\n\n if (isHorizontal) { // Column\n const y = dataRect.y + dataRect.height - innerTextPadding;\n _texts\n .attr(\"x\", domainPos + (domainLength / 2))\n .attr(\"y\", y + textHeightOffset)\n .attr(\"transform\", `rotate(-90, ${domainPos + (domainLength / 2)}, ${y})`)\n ;\n } else { // Bar\n _texts\n .attr(\"x\", dataRect.x + padding)\n .attr(\"y\", domainPos + (domainLength / 2) + textHeightOffset)\n ;\n }\n _texts\n .attr(\"height\", domainLength)\n .attr(\"width\", valueLength)\n ;\n if (context.showInnerText()) {\n _texts\n .text((d: any) => {\n const innerText = context.innerText(d.origRow, d.origRow[columnLength], d.idx);\n if (innerText) {\n const clippedValueLength = isHorizontal ? dataRect.height : dataRect.width;\n const innerTextObj = context.calcInnerText(clippedValueLength, innerText, valueText);\n d.innerTextObj = innerTextObj;\n\n return innerTextObj.text;\n }\n return \"\";\n })\n ;\n }\n const dataText = element.selectAll(\".dataText\").data(context.showValue() ? [`${upperValue}`] : []);\n const dataTextEnter = dataText.enter().append(\"g\")\n .attr(\"class\", \"dataText\")\n .each(function (this: SVGElement, d) {\n context.textLocal.set(this, new Text().target(this).colorStroke_default(\"transparent\"));\n });\n dataTextEnter.merge(dataText as any)\n .each(function (this: SVGElement) {\n const pos = { x: 0, y: 0 };\n const valueFontFamily = context.valueFontFamily();\n const valueFontSize = context.valueFontSize();\n const textSize = context.textSize(valueText, valueFontFamily, valueFontSize);\n\n const isPositive = parseFloat(valueText) >= 0;\n\n let valueAnchor = context.valueAnchor() ? context.valueAnchor() : isHorizontal ? \"middle\" : \"start\";\n\n const leftSpace = dataRect.x;\n const rightSpace = axisSize.width - (dataRect.x + dataRect.width);\n const topSpace = dataRect.y;\n const bottomSpace = axisSize.height - (dataRect.y + dataRect.height);\n\n let noRoomInside;\n let isOutside;\n let noRoomOnExpectedSide;\n\n if (d.innerTextObj) {\n const { padding, valueTextWidth } = d.innerTextObj;\n isOutside = false;\n if (isHorizontal) { // Column\n valueAnchor = \"middle\";\n pos.x = domainPos + (domainLength / 2);\n\n if (d.innerTextObj.category === 4) {\n isOutside = true;\n pos.y = valuePos - padding - (valueFontSize / 2);\n } else {\n pos.y = valuePos + padding + (valueFontSize / 2);\n }\n } else { // Bar\n valueAnchor = \"start\";\n if (d.innerTextObj.category === 4) {\n isOutside = true;\n pos.x = (valueLength + valuePos) + padding;\n } else {\n pos.x = (valueLength + valuePos) - valueTextWidth - padding;\n }\n pos.y = domainPos + (domainLength / 2);\n }\n } else {\n /*\n IF this.valueCentered() and NO ROOM INSIDE\n ...then ASSUME THERES ROOM OUTSIDE\n IF NO ROOM OUTSIDE ON EXPECTED SIDE\n ...then ASSUME THERES ROOM ON THE OPPOSITE SIDE\n */\n if (isHorizontal) { // Column\n noRoomInside = dataRect.height < textSize.height;\n isOutside = !context.valueCentered() || noRoomInside;\n\n pos.x = dataRect.x + (dataRect.width / 2);\n\n if (isOutside) {\n if (isPositive) {\n noRoomOnExpectedSide = topSpace < textSize.height + padding;\n if (noRoomOnExpectedSide) {\n if (!noRoomInside) {\n isOutside = false;\n pos.y = dataRect.y + (dataRect.height / 2);\n } else {\n pos.y = dataRect.y + dataRect.height + textSize.height;\n }\n } else {\n pos.y = dataRect.y - (textSize.height / 2) - padding;\n }\n } else {\n noRoomOnExpectedSide = bottomSpace < textSize.height;\n if (noRoomOnExpectedSide) {\n if (!noRoomInside) {\n isOutside = false;\n pos.y = dataRect.y + (dataRect.height / 2);\n } else {\n pos.y = dataRect.y - (textSize.height / 2) - padding;\n }\n } else {\n pos.y = dataRect.y + textSize.height + padding;\n }\n }\n } else {\n pos.y = dataRect.y + (dataRect.height / 2);\n }\n } else { // Bar\n noRoomInside = dataRect.width < textSize.width;\n isOutside = !context.valueCentered() || noRoomInside;\n\n pos.y = dataRect.y + (dataRect.height / 2);\n\n if (isOutside) {\n if (isPositive) {\n noRoomOnExpectedSide = rightSpace < textSize.width + padding;\n if (noRoomOnExpectedSide) {\n if (context.showInnerText() || !noRoomInside) {\n isOutside = false;\n pos.x = dataRect.x + (dataRect.width / 2);\n } else {\n pos.x = dataRect.x - (textSize.width - padding);\n }\n } else {\n pos.x = dataRect.x + dataRect.width + (textSize.width / 2) + padding;\n }\n } else {\n noRoomOnExpectedSide = leftSpace < textSize.width;\n if (noRoomOnExpectedSide) {\n if (context.showInnerText() || !noRoomInside) {\n isOutside = false;\n pos.x = dataRect.x + (dataRect.width / 2);\n } else {\n pos.x = dataRect.x + dataRect.width + (textSize.width - padding);\n }\n } else {\n pos.x = dataRect.x - (textSize.width - padding);\n }\n }\n } else {\n pos.x = dataRect.x + (dataRect.width / 2);\n }\n }\n }\n const textColor = isOutside ? null : context.textColor(d.row, d.column, d.value, d.origRow);\n\n // Prevent overlapping labels on stacked columns\n const columns = context.columns();\n const hideValue = (context.yAxisStacked() && noRoomInside) ||\n (isOutside && context.yAxisStacked() && columns.indexOf(d.column) !== columns.length - 1);\n context.textLocal.get(this)\n .pos(pos)\n .anchor(valueAnchor)\n .fontFamily(valueFontFamily)\n .fontSize(valueFontSize)\n .text(`${valueText}`)\n .colorFill(textColor)\n .visible(context.showValue() && !hideValue)\n .render()\n ;\n\n });\n dataText.exit()\n .each(function (this: SVGElement, d) {\n context.textLocal.get(this).target(null);\n })\n .remove()\n ;\n });\n columnGRect.exit().transition().duration(duration)\n .style(\"opacity\", 0)\n .remove()\n ;\n\n const value4pos = host.yAxisStacked() ? domainSums[dataRowIdx] : Math.max(...dataRow.filter((_, idx) => idx > 0 && idx < columnLength));\n const stackedTotalText = element.selectAll(\".stackedTotalText\").data(context.showDomainTotal() ? [domainSums[dataRowIdx]] : []);\n const stackedTotalTextEnter = stackedTotalText.enter().append(\"g\")\n .attr(\"class\", \"stackedTotalText\")\n .each(function (this: SVGElement, d) {\n context.stackedTextLocal.set(this, new Text().target(this).colorStroke_default(\"transparent\"));\n });\n stackedTotalTextEnter.merge(stackedTotalText as any)\n .each(function (this: SVGElement, d: any) {\n const pos = { x: 0, y: 0 };\n const domainPos = host.dataPos(dataRow[0]);\n const valuePos = host.valuePos(value4pos);\n\n const valueFontFamily = context.valueFontFamily();\n const valueFontSize = context.valueFontSize();\n const textSize = context.textSize(d, valueFontFamily, valueFontSize);\n\n const isPositive = parseFloat(d) >= 0;\n let valueAnchor: \"start\" | \"middle\" | \"end\" = \"middle\";\n if (isHorizontal) {\n pos.x = domainPos;\n if (isPositive) {\n pos.y = valuePos - textSize.height / 2;\n } else {\n pos.y = valuePos + textSize.height / 2;\n }\n } else {\n valueAnchor = \"start\";\n pos.y = domainPos;\n if (isPositive) {\n pos.x = valuePos + textSize.width / 2;\n } else {\n pos.x = valuePos - textSize.width / 2;\n }\n }\n\n context.stackedTextLocal.get(this)\n .pos(pos)\n .anchor(valueAnchor)\n .fontFamily(valueFontFamily)\n .fontSize(valueFontSize)\n .text(d)\n .render()\n ;\n\n });\n stackedTotalText.exit()\n .each(function (this: SVGElement, d) {\n context.textLocal.get(this).target(null);\n })\n .remove()\n ;\n });\n column.exit().transition().duration(duration)\n .remove()\n ;\n }\n\n calcInnerText(offset, innerText, valueText) {\n\n const fontFamily = this.innerTextFontFamily_exists() ? this.innerTextFontFamily() : \"Verdana\";\n const fontSize = this.innerTextFontSize();\n const valueFontFamily = this.valueFontFamily_exists() ? this.valueFontFamily() : \"Verdana\";\n const valueFontSize = this.valueFontSize();\n const padding = this.innerTextPadding_exists() ? this.innerTextPadding() : fontSize / 2.5;\n const valueTextWidth = this.isHorizontal ? valueFontSize : this.textSize(valueText, valueFontFamily, valueFontSize).width;\n const ellipsisWidth = this.textSize(\"...\", fontFamily, fontSize).width;\n const innerTextWidth = this.textSize(innerText, fontFamily, fontSize).width;\n const origInnerText = innerText;\n\n const fullWidth = (padding * 3) + innerTextWidth + valueTextWidth;\n const fullWidth2 = (padding * 3) + ellipsisWidth + valueTextWidth;\n const fullWidth3 = (padding * 1) + valueTextWidth;\n /*\n Categories:\n 1) room to display inner text (with padding) AND value text (with padding)\n 2) room to display ellipsis (with padding) AND value text (with padding)\n 3) room to display value text only (with padding)\n 4) no room to display any text except value on the outside\n */\n let category = 4;\n if (fullWidth < offset) {\n category = 1;\n } else if (fullWidth2 < offset) {\n const excessWidth = offset - fullWidth2;\n let _text = \"\";\n for (const letter of innerText) {\n if (this.textSize(_text + letter, fontFamily, fontSize).width > excessWidth) {\n innerText = _text + \"...\";\n break;\n } else {\n _text += letter;\n }\n }\n category = 2;\n } else if (fullWidth3 < offset) {\n innerText = \"\";\n category = 3;\n } else {\n innerText = \"\";\n }\n\n return {\n text: innerText,\n isTruncated: origInnerText !== innerText,\n padding,\n category,\n valueTextWidth\n };\n }\n\n innerText(origRow, lparam, idx): string {\n return origRow[0];\n }\n}\nColumn.prototype._class += \" chart_Column\";\nColumn.prototype.implements(INDChart.prototype);\nColumn.prototype.implements(ITooltip.prototype);\n\nexport interface Column {\n paletteID(): string;\n paletteID(_: string): this;\n useClonedPalette(): boolean;\n useClonedPalette(_: boolean): this;\n showValue(): boolean;\n showValue(_: boolean): this;\n showInnerText(): boolean;\n showInnerText(_: boolean): this;\n showValueFormat(): string;\n showValueFormat(_: string): this;\n showValueAsPercent(): null | \"series\" | \"domain\";\n showValueAsPercent(_: null | \"series\" | \"domain\"): this;\n showValueAsPercentFormat(): string;\n showValueAsPercentFormat(_: string): this;\n showDomainTotal(): boolean;\n showDomainTotal(_: boolean): this;\n valueCentered(): boolean;\n valueCentered(_: boolean): this;\n valueAnchor(): \"start\" | \"middle\" | \"end\";\n valueAnchor(_: \"start\" | \"middle\" | \"end\"): this;\n valueFontFamily(): string;\n valueFontFamily(_: string): this;\n valueFontFamily_exists(): boolean;\n valueFontSize(): number;\n valueFontSize(_: number): this;\n xAxisSeriesPaddingInner(): number;\n xAxisSeriesPaddingInner(_: number): this;\n innerTextFontFamily(): string;\n innerTextFontFamily(_: string): this;\n innerTextFontFamily_exists(): boolean;\n innerTextFontSize(): number;\n innerTextFontSize(_: number): this;\n innerTextPadding(): number;\n innerTextPadding(_: number): this;\n innerTextPadding_exists(): boolean;\n tooltipInnerTextEllipsedOnly(): boolean;\n tooltipInnerTextEllipsedOnly(_: boolean): this;\n\n // INDChart ---\n fillColor(row, column, value, origRow): string;\n textColor(row, column, value, origRow): string;\n dblclick(row, column, selected): void;\n\n // ITooltip ---\n tooltip;\n tooltipHTML(_): string;\n tooltipFormat(_): string;\n tooltipStyle(): \"default\" | \"none\" | \"series-table\";\n tooltipStyle(_: \"default\" | \"none\" | \"series-table\"): this;\n}\n\nColumn.prototype.publish(\"valueFontFamily\", null, \"string\", \"Font family of value text\", null, { optional: true });\nColumn.prototype.publish(\"valueFontSize\", 12, \"number\", \"Height of value text (pixels)\");\nColumn.prototype.publish(\"innerTextFontFamily\", null, \"string\", \"Font family of inner text\", null, { optional: true });\nColumn.prototype.publish(\"innerTextPadding\", 8, \"number\", \"Offset of inner text (pixels)\", null, { optional: true });\nColumn.prototype.publish(\"innerTextFontSize\", 12, \"number\", \"Height of inner text (pixels)\");\nColumn.prototype.publish(\"paletteID\", \"default\", \"set\", \"Color palette for this widget\", () => Column.prototype._palette.switch(), { tags: [\"Basic\", \"Shared\"] });\nColumn.prototype.publish(\"useClonedPalette\", false, \"boolean\", \"Enable or disable using a cloned palette\", null, { tags: [\"Intermediate\", \"Shared\"] });\nColumn.prototype.publish(\"showValue\", false, \"boolean\", \"Show Value in column\");\nColumn.prototype.publish(\"showInnerText\", false, \"boolean\", \"Show Label in column\");\nColumn.prototype.publish(\"showValueFormat\", \",\", \"string\", \"D3 Format for Value\", null, { disable: (w: Column) => !w.showValue() || !!w.showValueAsPercent() });\nColumn.prototype.publish(\"showValueAsPercent\", null, \"set\", \"If showValue is true, optionally show value as a percentage by Series or Domain\", [null, \"series\", \"domain\"], { disable: w => !w.showValue(), optional: true });\nColumn.prototype.publish(\"showValueAsPercentFormat\", \".0%\", \"string\", \"D3 Format for %\", null, { disable: (w: Column) => !w.showValue() || !w.showValueAsPercent() });\nColumn.prototype.publish(\"showDomainTotal\", false, \"boolean\", \"Show Total Value for Stacked Columns\", null);\nColumn.prototype.publish(\"valueCentered\", false, \"boolean\", \"Show Value in center of column\");\nColumn.prototype.publish(\"valueAnchor\", \"middle\", \"set\", \"text-anchor for shown value text\", [\"start\", \"middle\", \"end\"]);\nColumn.prototype.publish(\"xAxisSeriesPaddingInner\", 0, \"number\", \"Determines the ratio of the range that is reserved for blank space between band (0->1)\");\nColumn.prototype.publish(\"tooltipInnerTextEllipsedOnly\", false, \"boolean\", \"Show tooltip only when inner text is truncated with an ellipsis\");\n\n/*\nconst origUseClonedPalette = Column.prototype.useClonedPalette;\nColumn.prototype.useClonedPalette = function (this: Column, _?) {\n const retVal = origUseClonedPalette.apply(this, arguments);\n if (arguments.length) {\n this._useClonedPalette = _;\n }\n return retVal;;\n}\n*/\n","import { Column } from \"./Column.ts\";\n\nexport class Bar extends Column {\n constructor() {\n super();\n this.orientation_default(\"vertical\");\n }\n}\nBar.prototype._class += \" chart_Bar\";\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","import { I2DChart, ITooltip } from \"@hpcc-js/api\";\nimport { FAChar, InputField, ISize, SVGWidget, Text, Utility } from \"@hpcc-js/common\";\nimport { hierarchy as d3Hierarchy, pack as d3Pack } from \"d3-hierarchy\";\nimport { select as d3Select } from \"d3-selection\";\n\nimport \"../src/Bubble.css\";\n\nexport class Bubble extends SVGWidget {\n static __inputs: InputField[] = [{\n id: \"label\",\n type: \"string\"\n }, {\n id: \"value\",\n type: \"number\"\n }];\n\n labelWidgets;\n d3Pack;\n\n constructor() {\n super();\n I2DChart.call(this);\n ITooltip.call(this);\n Utility.SimpleSelectionMixin.call(this);\n\n this._drawStartPos = \"origin\";\n\n this.labelWidgets = {};\n\n this.d3Pack = d3Pack()\n .size([this.width(), this.height()])\n .padding(1.5)\n ;\n }\n\n size(): ISize;\n size(_): this;\n size(_?): ISize | this {\n const retVal = super.size.apply(this, arguments);\n if (arguments.length) {\n this.d3Pack\n .size([this.width(), this.height()])\n ;\n }\n return retVal;\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n this._selection.widgetElement(element);\n const context = this;\n this\n .tooltipHTML(function (d) {\n switch (context.tooltipStyle()) {\n case \"series-table\":\n return context.tooltipFormat({\n label: d[0],\n arr: context.columns().slice(1).map(function (column, i) {\n return {\n label: column,\n color: context._palette(d[0]),\n value: d[1]\n };\n })\n });\n default:\n return context.tooltipFormat({ label: d.data[0], value: d.data[1] });\n }\n })\n ;\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({ children: this.cloneData() })\n .sum(function (d) { return d[1]; })\n .sort(function (b, a) {\n return a[1] < b[1] ? -1 : a[1] > b[1] ? 1 : 0;\n })\n ;\n this.d3Pack(root);\n\n const node = element.selectAll(\".node\").data(root.children || [], d => d.data[0]);\n\n // Enter ---\n node.enter().append(\"g\")\n .attr(\"class\", (d, i) => \"node series series-\" + this.cssTag(d.data[0]))\n .attr(\"opacity\", 0)\n .call(this._selection.enter.bind(this._selection))\n .on(\"click\", function (d) {\n context.click(context.rowToObj(d.data), context.columns()[1], context._selection.selected(this));\n })\n .on(\"dblclick\", function (d) {\n context.dblclick(context.rowToObj(d.data), context.columns()[1], context._selection.selected(this));\n })\n .each(function (d) {\n const element2 = d3Select(this);\n const pos = { x: d.x, y: d.y };\n element2.append(\"circle\")\n .attr(\"transform\", \"translate(\" + pos.x + \",\" + pos.y + \")\")\n .attr(\"r\", 0)\n .on(\"mouseout.tooltip\", context.tooltip.hide)\n .on(\"mousemove.tooltip\", context.tooltip.show)\n ;\n if (d.__viz_faChar) {\n context.labelWidgets[d.data[0]] = new FAChar()\n .char(d.__viz_faChar)\n .target(this)\n .render()\n ;\n } else {\n context.labelWidgets[d.data[0]] = new Text()\n .text(d.data[0])\n .target(this)\n .render()\n ;\n }\n })\n .merge(node).transition()\n .attr(\"opacity\", 1)\n .each(function (d) {\n const element2 = d3Select(this);\n const pos = { x: d.x, y: d.y };\n element2.select(\"circle\").transition()\n .attr(\"transform\", \"translate(\" + pos.x + \",\" + pos.y + \")\")\n .style(\"fill\", context.fillColor(d.data, context.columns()[1], d.data[1]))\n .attr(\"r\", d.r)\n .select(\"title\")\n .text(d.data[0] + \" (\" + d.data[1] + \")\")\n ;\n if (d.__viz_faChar) {\n context.labelWidgets[d.data[0]]\n .pos(pos)\n .render()\n ;\n } else {\n context.labelWidgets[d.data[0]]\n .pos(pos)\n .colorFill_default(context.textColor(d.data, context.columns()[1], d.data[1]))\n .width(d.r * 2)\n .text(d.data[0])\n .render()\n ;\n }\n })\n ;\n\n // Exit ---\n node.exit().transition()\n .style(\"opacity\", 0)\n .remove()\n ;\n }\n\n exit(domNode, element) {\n super.exit(domNode, element);\n }\n\n}\nBubble.prototype._class += \" chart_Bubble\";\nBubble.prototype.implements(I2DChart.prototype);\nBubble.prototype.implements(ITooltip.prototype);\nBubble.prototype.mixin(Utility.SimpleSelectionMixin);\n\nexport interface Bubble {\n paletteID(): string;\n paletteID(_: string): this;\n useClonedPalette(): boolean;\n useClonedPalette(_: boolean): this;\n\n // I2DChart\n _palette;\n fillColor(row: any[], column: string, value: number): string;\n textColor(row: any[], column: string, value: number): string;\n click(row, column, selected): void;\n dblclick(row, column, selected): void;\n\n // ITooltip\n tooltip;\n tooltipHTML(_): string;\n tooltipFormat(_): string;\n tooltipStyle(): \"default\" | \"none\" | \"series-table\";\n\n // SimpleSelectionMixin\n _selection;\n}\n\nBubble.prototype.publish(\"paletteID\", \"default\", \"set\", \"Color palette for this widget\", Bubble.prototype._palette.switch(), { tags: [\"Basic\", \"Shared\"] });\nBubble.prototype.publish(\"useClonedPalette\", false, \"boolean\", \"Enable or disable using a cloned palette\", null, { tags: [\"Intermediate\", \"Shared\"] });\n","import { Scatter } from \"./Scatter.ts\";\n\nexport class BubbleXY extends Scatter {\n constructor() {\n super();\n }\n enter(domNode, element) {\n if (!this.pointSizeColumn_exists()) {\n this.pointSizeColumn(this.columns()[this.columns().length - 1]);\n }\n super.enter(domNode, element);\n }\n}\nBubbleXY.prototype._class += \" chart_BubbleXY\";\n","var frame = 0, // is an animation frame pending?\n timeout = 0, // is a timeout pending?\n interval = 0, // are any timers active?\n pokeDelay = 1000, // how frequently we check for clock skew\n taskHead,\n taskTail,\n clockLast = 0,\n clockNow = 0,\n clockSkew = 0,\n clock = typeof performance === \"object\" && performance.now ? performance : Date,\n setFrame = typeof window === \"object\" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) { setTimeout(f, 17); };\n\nexport function now() {\n return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);\n}\n\nfunction clearNow() {\n clockNow = 0;\n}\n\nexport function Timer() {\n this._call =\n this._time =\n this._next = null;\n}\n\nTimer.prototype = timer.prototype = {\n constructor: Timer,\n restart: function(callback, delay, time) {\n if (typeof callback !== \"function\") throw new TypeError(\"callback is not a function\");\n time = (time == null ? now() : +time) + (delay == null ? 0 : +delay);\n if (!this._next && taskTail !== this) {\n if (taskTail) taskTail._next = this;\n else taskHead = this;\n taskTail = this;\n }\n this._call = callback;\n this._time = time;\n sleep();\n },\n stop: function() {\n if (this._call) {\n this._call = null;\n this._time = Infinity;\n sleep();\n }\n }\n};\n\nexport function timer(callback, delay, time) {\n var t = new Timer;\n t.restart(callback, delay, time);\n return t;\n}\n\nexport function timerFlush() {\n now(); // Get the current time, if not already set.\n ++frame; // Pretend we’ve set an alarm, if we haven’t already.\n var t = taskHead, e;\n while (t) {\n if ((e = clockNow - t._time) >= 0) t._call.call(null, e);\n t = t._next;\n }\n --frame;\n}\n\nfunction wake() {\n clockNow = (clockLast = clock.now()) + clockSkew;\n frame = timeout = 0;\n try {\n timerFlush();\n } finally {\n frame = 0;\n nap();\n clockNow = 0;\n }\n}\n\nfunction poke() {\n var now = clock.now(), delay = now - clockLast;\n if (delay > pokeDelay) clockSkew -= delay, clockLast = now;\n}\n\nfunction nap() {\n var t0, t1 = taskHead, t2, time = Infinity;\n while (t1) {\n if (t1._call) {\n if (time > t1._time) time = t1._time;\n t0 = t1, t1 = t1._next;\n } else {\n t2 = t1._next, t1._next = null;\n t1 = t0 ? t0._next = t2 : taskHead = t2;\n }\n }\n taskTail = t0;\n sleep(time);\n}\n\nfunction sleep(time) {\n if (frame) return; // Soonest alarm already set, or will be.\n if (timeout) timeout = clearTimeout(timeout);\n var delay = time - clockNow; // Strictly less than if we recomputed clockNow.\n if (delay > 24) {\n if (time < Infinity) timeout = setTimeout(wake, time - clock.now() - clockSkew);\n if (interval) interval = clearInterval(interval);\n } else {\n if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay);\n frame = 1, setFrame(wake);\n }\n}\n","import { descending as d3Descending } from \"d3-array\";\r\nimport { axisLeft as d3AxisLeft } from \"d3-axis\";\r\nimport { scaleLinear as d3ScaleLinear } from \"d3-scale\";\r\nimport { select as d3Select } from \"d3-selection\";\r\nimport { timerFlush as d3TimerFlush } from \"d3-timer\";\r\nimport \"d3-transition\";\r\n\r\nexport default function () {\r\n var orient = \"left\",\r\n reverse = false,\r\n vertical = false,\r\n ranges = bulvarRanges,\r\n markers = bulvarMarkers,\r\n measures = bulvarMeasures,\r\n width = 380,\r\n height = 30,\r\n xAxis = d3AxisLeft();\r\n\r\n // For each small multiple…\r\n function bulvar(g) {\r\n g.each(function (d, i) {\r\n var rangez = ranges.call(this, d, i).slice().sort(d3Descending),\r\n markerz = markers.call(this, d, i).slice().sort(d3Descending),\r\n measurez = measures.call(this, d, i).slice().sort(d3Descending),\r\n g2 = d3Select(this),\r\n extentX,\r\n extentY;\r\n\r\n var wrap = g2.select(\"g.wrap\");\r\n if (wrap.empty()) wrap = g2.append(\"g\").attr(\"class\", \"wrap\");\r\n\r\n if (vertical) {\r\n extentX = height, extentY = width;\r\n wrap.attr(\"transform\", \"rotate(90)translate(0,\" + -width + \")\");\r\n } else {\r\n extentX = width, extentY = height;\r\n wrap.attr(\"transform\", null);\r\n }\r\n\r\n // Compute the new x-scale.\r\n var x1 = d3ScaleLinear()\r\n .domain([0, Math.max(rangez[0], markerz[0], measurez[0])])\r\n .range(reverse ? [extentX, 0] : [0, extentX]);\r\n\r\n // Retrieve the old x-scale, if this is an update.\r\n var x0 = this.__chart__ || d3ScaleLinear()\r\n .domain([0, Infinity])\r\n .range(x1.range());\r\n\r\n // Stash the new scale.\r\n this.__chart__ = x1;\r\n\r\n // Derive width-scales from the x-scales.\r\n var w0 = bulvarWidth(x0),\r\n w1 = bulvarWidth(x1);\r\n\r\n // Update the range rects.\r\n var range = wrap.selectAll(\"rect.range\")\r\n .data(rangez);\r\n\r\n range.enter().append(\"rect\")\r\n .attr(\"class\", function (_d, i2) { return \"range s\" + i2; })\r\n .attr(\"width\", w0)\r\n .attr(\"height\", extentY)\r\n .attr(\"x\", reverse ? x0 : 0)\r\n .merge(range)\r\n .transition(range)\r\n .attr(\"x\", reverse ? x1 : 0)\r\n .attr(\"width\", w1)\r\n .attr(\"height\", extentY);\r\n\r\n // Update the measure rects.\r\n var measure = wrap.selectAll(\"rect.measure\")\r\n .data(measurez);\r\n\r\n measure.enter().append(\"rect\")\r\n .attr(\"class\", function (_d, i2) { return \"measure s\" + i2; })\r\n .attr(\"width\", w0)\r\n .attr(\"height\", extentY / 3)\r\n .attr(\"x\", reverse ? x0 : 0)\r\n .attr(\"y\", extentY / 3)\r\n .merge(measure)\r\n .transition(measure)\r\n .attr(\"width\", w1)\r\n .attr(\"height\", extentY / 3)\r\n .attr(\"x\", reverse ? x1 : 0)\r\n .attr(\"y\", extentY / 3);\r\n\r\n // Update the marker lines.\r\n var marker = wrap.selectAll(\"line.marker\")\r\n .data(markerz);\r\n\r\n marker.enter().append(\"line\")\r\n .attr(\"class\", \"marker\")\r\n .attr(\"x1\", x0)\r\n .attr(\"x2\", x0)\r\n .attr(\"y1\", extentY / 6)\r\n .attr(\"y2\", extentY * 5 / 6)\r\n .merge(marker)\r\n .transition(marker)\r\n .attr(\"x1\", x1)\r\n .attr(\"x2\", x1)\r\n .attr(\"y1\", extentY / 6)\r\n .attr(\"y2\", extentY * 5 / 6);\r\n\r\n var axis = g2.selectAll(\"g.axis\").data([0]);\r\n axis.enter().append(\"g\").attr(\"class\", \"axis\");\r\n axis.attr(\"transform\", vertical ? null : \"translate(0,\" + extentY + \")\")\r\n .call(xAxis.scale(x1));\r\n });\r\n d3TimerFlush();\r\n }\r\n\r\n // left, right, top, bottom\r\n bulvar.orient = function (_) {\r\n if (!arguments.length) return orient;\r\n orient = _ + \"\";\r\n reverse = orient === \"right\" || orient === \"bottom\";\r\n xAxis.orient((vertical = orient === \"top\" || orient === \"bottom\") ? \"left\" : \"bottom\"); // eslint-disable-line\r\n return bulvar;\r\n };\r\n\r\n // ranges (bad, satisfactory, good)\r\n bulvar.ranges = function (_) {\r\n if (!arguments.length) return ranges;\r\n ranges = _;\r\n return bulvar;\r\n };\r\n\r\n // markers (previous, goal)\r\n bulvar.markers = function (_) {\r\n if (!arguments.length) return markers;\r\n markers = _;\r\n return bulvar;\r\n };\r\n\r\n // measures (actual, forecast)\r\n bulvar.measures = function (_) {\r\n if (!arguments.length) return measures;\r\n measures = _;\r\n return bulvar;\r\n };\r\n\r\n bulvar.width = function (_) {\r\n if (!arguments.length) return width;\r\n width = +_;\r\n return bulvar;\r\n };\r\n\r\n bulvar.height = function (_) {\r\n if (!arguments.length) return height;\r\n height = +_;\r\n return bulvar;\r\n };\r\n\r\n bulvar.tickFormat = function (_) {\r\n if (!arguments.length) return xAxis.tickFormat();\r\n xAxis.tickFormat(_);\r\n return bulvar;\r\n };\r\n\r\n return bulvar;\r\n}\r\n\r\nfunction bulvarRanges(d) {\r\n return d.ranges;\r\n}\r\n\r\nfunction bulvarMarkers(d) {\r\n return d.markers;\r\n}\r\n\r\nfunction bulvarMeasures(d) {\r\n return d.measures;\r\n}\r\n\r\nfunction bulvarWidth(x) {\r\n var x0 = x(0);\r\n return function (d) {\r\n return Math.abs(x(d) - x0);\r\n };\r\n}\r\n","import { HTMLWidget, Utility } from \"@hpcc-js/common\";\nimport { select as d3Select } from \"d3-selection\";\nimport { bullet as d3Bullet } from \"d3v4-bullet\";\n\nimport \"../src/Bullet.css\";\n\nexport class Bullet extends HTMLWidget {\n\n private _hiddenColumns = {};\n\n constructor() {\n super();\n Utility.SimpleSelectionMixin.call(this, true);\n }\n\n bulletData() {\n const context = this;\n this._hiddenColumns = {};\n const columns = this.columns();\n return this.data().map(function (row) {\n return {\n title: valueOf(row, this.titleColumn()),\n subtitle: valueOf(row, this.subtitleColumn()),\n ranges: valueOf(row, this.rangesColumn(), \"range\"),\n measures: valueOf(row, this.measuresColumn(), \"measure\"),\n markers: valueOf(row, this.markersColumn(), \"marker\"),\n origRow: row\n };\n }, this);\n\n function valueOf(row, column, columnType?) {\n const colIdx = columns.indexOf(column);\n if (colIdx >= 0) {\n if (row[colIdx] instanceof Array) {\n return row[colIdx];\n }\n return [row[colIdx]];\n }\n if (columnType) {\n context._hiddenColumns[columnType] = true;\n }\n return [0];\n }\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n d3Select(domNode.parentNode).style(\"overflow\", \"auto\");\n this._selection.widgetElement(element);\n }\n\n update(_domNode, element) {\n super.update(_domNode, element);\n const context = this;\n\n element.selectAll(\".axis\")\n .style(\"display\", \"none\")\n ;\n element.selectAll(\".range,.measure,.marker\")\n .style(\"display\", null)\n ;\n\n const margin = { left: 2, top: 8, right: 2, bottom: 8 };\n const width = this.width() - margin.left - margin.right;\n const height = 40 - margin.top - margin.bottom;\n\n const svg = element.selectAll(\"svg\").data(this.bulletData());\n const svgUpdate = svg.enter().append(\"svg\")\n .attr(\"class\", \"bullet\")\n .call(this._selection.enter.bind(this._selection))\n .on(\"click\", function (d) {\n context.click(context.rowToObj(d.origRow), context.titleColumn(), context._selection.selected(this));\n })\n .on(\"dblclick\", function (d) {\n context.dblclick(context.rowToObj(d.origRow), context.titleColumn(), context._selection.selected(this));\n })\n .each(function () {\n const element2 = d3Select(this);\n const bulletBar = element2.append(\"g\")\n .attr(\"class\", (d, i) => \"bulletBar series series-\" + context.cssTag(context.titleColumn()))\n ;\n const bulletTitle = bulletBar.append(\"g\")\n .attr(\"class\", \"bulletTitle\")\n ;\n bulletTitle.append(\"text\")\n .attr(\"class\", \"title\")\n ;\n bulletTitle.append(\"text\")\n .attr(\"class\", \"subtitle\")\n .attr(\"dy\", \"1em\")\n ;\n })\n .merge(svg)\n ;\n\n // Title ---\n const title = svgUpdate.select(\".bulletTitle\")\n .style(\"text-anchor\", \"end\")\n .attr(\"transform\", \"translate(-6,\" + height / 2 + \")\")\n ;\n title.select(\".title\")\n .text(function (d) { return d.title; })\n ;\n title.select(\".subtitle\")\n .text(function (d) { return d.subtitle; })\n ;\n\n let titleWidth = 0;\n title.each(function () {\n const bbox = this.getBBox();\n if (bbox.width > titleWidth) {\n titleWidth = bbox.width;\n }\n });\n\n // Bullet Chart ---\n const chart = d3Bullet()\n .width(width - titleWidth - 6)\n .height(height)\n ;\n svgUpdate\n .attr(\"width\", width)\n .attr(\"height\", height + margin.top + margin.bottom)\n .style(\"margin-left\", `${margin.left}px`)\n ;\n svgUpdate.select(\".bulletBar\")\n .attr(\"transform\", \"translate(\" + (titleWidth + 6) + \",\" + margin.top + \")\")\n .call(chart)\n ;\n\n svg.exit().remove();\n\n if (Object.keys(this._hiddenColumns).length > 0) {\n element.selectAll(`.${Object.keys(this._hiddenColumns).join(\",.\")}`)\n .style(\"display\", \"none\")\n ;\n }\n }\n\n exit(domNode, element) {\n super.exit(domNode, element);\n }\n\n // Events ---\n click(row, column, selected) {\n // console.log(\"Click: \" + JSON.stringify(row) + \", \" + column + \",\" + selected);\n }\n\n dblclick(row, column, selected) {\n // console.log(\"Double click: \" + JSON.stringify(row) + \", \" + column + \",\" + selected);\n }\n\n // SimpleSelectionMixin\n _selection;\n}\nBullet.prototype._class += \" chart_Bullet\";\n\nexport interface Bullet {\n titleColumn(): string;\n titleColumn(_: string): this;\n subtitleColumn(): string;\n subtitleColumn(_: string): this;\n rangesColumn(): string;\n rangesColumn(_: string): this;\n measuresColumn(): string;\n measuresColumn(_: string): this;\n markersColumn(): string;\n markersColumn(_: string): this;\n}\n\nBullet.prototype.publish(\"titleColumn\", null, \"set\", \"Title Column\", function () { return this.columns(); }, { optional: true });\nBullet.prototype.publish(\"subtitleColumn\", null, \"set\", \"Subtitle Column\", function () { return this.columns(); }, { optional: true });\nBullet.prototype.publish(\"rangesColumn\", null, \"set\", \"Ranges Column\", function () { return this.columns(); }, { optional: true });\nBullet.prototype.publish(\"measuresColumn\", null, \"set\", \"Measures Column\", function () { return this.columns(); }, { optional: true });\nBullet.prototype.publish(\"markersColumn\", null, \"set\", \"Markers Column\", function () { return this.columns(); }, { optional: true });\n\n","var array = Array.prototype;\n\nexport var slice = array.slice;\n","export default function(a, b) {\n return a - b;\n}\n","export default function(ring) {\n var i = 0, n = ring.length, area = ring[n - 1][1] * ring[0][0] - ring[n - 1][0] * ring[0][1];\n while (++i < n) area += ring[i - 1][1] * ring[i][0] - ring[i - 1][0] * ring[i][1];\n return area;\n}\n","export default function(x) {\n return function() {\n return x;\n };\n}\n","export default function(ring, hole) {\n var i = -1, n = hole.length, c;\n while (++i < n) if (c = ringContains(ring, hole[i])) return c;\n return 0;\n}\n\nfunction ringContains(ring, point) {\n var x = point[0], y = point[1], contains = -1;\n for (var i = 0, n = ring.length, j = n - 1; i < n; j = i++) {\n var pi = ring[i], xi = pi[0], yi = pi[1], pj = ring[j], xj = pj[0], yj = pj[1];\n if (segmentContains(pi, pj, point)) return 0;\n if (((yi > y) !== (yj > y)) && ((x < (xj - xi) * (y - yi) / (yj - yi) + xi))) contains = -contains;\n }\n return contains;\n}\n\nfunction segmentContains(a, b, c) {\n var i; return collinear(a, b, c) && within(a[i = +(a[0] === b[0])], c[i], b[i]);\n}\n\nfunction collinear(a, b, c) {\n return (b[0] - a[0]) * (c[1] - a[1]) === (c[0] - a[0]) * (b[1] - a[1]);\n}\n\nfunction within(p, q, r) {\n return p <= q && q <= r || r <= q && q <= p;\n}\n","export default function() {}\n","import {extent, thresholdSturges, tickStep, range} from \"d3-array\";\nimport {slice} from \"./array\";\nimport ascending from \"./ascending\";\nimport area from \"./area\";\nimport constant from \"./constant\";\nimport contains from \"./contains\";\nimport noop from \"./noop\";\n\nvar cases = [\n [],\n [[[1.0, 1.5], [0.5, 1.0]]],\n [[[1.5, 1.0], [1.0, 1.5]]],\n [[[1.5, 1.0], [0.5, 1.0]]],\n [[[1.0, 0.5], [1.5, 1.0]]],\n [[[1.0, 1.5], [0.5, 1.0]], [[1.0, 0.5], [1.5, 1.0]]],\n [[[1.0, 0.5], [1.0, 1.5]]],\n [[[1.0, 0.5], [0.5, 1.0]]],\n [[[0.5, 1.0], [1.0, 0.5]]],\n [[[1.0, 1.5], [1.0, 0.5]]],\n [[[0.5, 1.0], [1.0, 0.5]], [[1.5, 1.0], [1.0, 1.5]]],\n [[[1.5, 1.0], [1.0, 0.5]]],\n [[[0.5, 1.0], [1.5, 1.0]]],\n [[[1.0, 1.5], [1.5, 1.0]]],\n [[[0.5, 1.0], [1.0, 1.5]]],\n []\n];\n\nexport default function() {\n var dx = 1,\n dy = 1,\n threshold = thresholdSturges,\n smooth = smoothLinear;\n\n function contours(values) {\n var tz = threshold(values);\n\n // Convert number of thresholds into uniform thresholds.\n if (!Array.isArray(tz)) {\n var domain = extent(values), start = domain[0], stop = domain[1];\n tz = tickStep(start, stop, tz);\n tz = range(Math.floor(start / tz) * tz, Math.floor(stop / tz) * tz, tz);\n } else {\n tz = tz.slice().sort(ascending);\n }\n\n return tz.map(function(value) {\n return contour(values, value);\n });\n }\n\n // Accumulate, smooth contour rings, assign holes to exterior rings.\n // Based on https://github.com/mbostock/shapefile/blob/v0.6.2/shp/polygon.js\n function contour(values, value) {\n var polygons = [],\n holes = [];\n\n isorings(values, value, function(ring) {\n smooth(ring, values, value);\n if (area(ring) > 0) polygons.push([ring]);\n else holes.push(ring);\n });\n\n holes.forEach(function(hole) {\n for (var i = 0, n = polygons.length, polygon; i < n; ++i) {\n if (contains((polygon = polygons[i])[0], hole) !== -1) {\n polygon.push(hole);\n return;\n }\n }\n });\n\n return {\n type: \"MultiPolygon\",\n value: value,\n coordinates: polygons\n };\n }\n\n // Marching squares with isolines stitched into rings.\n // Based on https://github.com/topojson/topojson-client/blob/v3.0.0/src/stitch.js\n function isorings(values, value, callback) {\n var fragmentByStart = new Array,\n fragmentByEnd = new Array,\n x, y, t0, t1, t2, t3;\n\n // Special case for the first row (y = -1, t2 = t3 = 0).\n x = y = -1;\n t1 = values[0] >= value;\n cases[t1 << 1].forEach(stitch);\n while (++x < dx - 1) {\n t0 = t1, t1 = values[x + 1] >= value;\n cases[t0 | t1 << 1].forEach(stitch);\n }\n cases[t1 << 0].forEach(stitch);\n\n // General case for the intermediate rows.\n while (++y < dy - 1) {\n x = -1;\n t1 = values[y * dx + dx] >= value;\n t2 = values[y * dx] >= value;\n cases[t1 << 1 | t2 << 2].forEach(stitch);\n while (++x < dx - 1) {\n t0 = t1, t1 = values[y * dx + dx + x + 1] >= value;\n t3 = t2, t2 = values[y * dx + x + 1] >= value;\n cases[t0 | t1 << 1 | t2 << 2 | t3 << 3].forEach(stitch);\n }\n cases[t1 | t2 << 3].forEach(stitch);\n }\n\n // Special case for the last row (y = dy - 1, t0 = t1 = 0).\n x = -1;\n t2 = values[y * dx] >= value;\n cases[t2 << 2].forEach(stitch);\n while (++x < dx - 1) {\n t3 = t2, t2 = values[y * dx + x + 1] >= value;\n cases[t2 << 2 | t3 << 3].forEach(stitch);\n }\n cases[t2 << 3].forEach(stitch);\n\n function stitch(line) {\n var start = [line[0][0] + x, line[0][1] + y],\n end = [line[1][0] + x, line[1][1] + y],\n startIndex = index(start),\n endIndex = index(end),\n f, g;\n if (f = fragmentByEnd[startIndex]) {\n if (g = fragmentByStart[endIndex]) {\n delete fragmentByEnd[f.end];\n delete fragmentByStart[g.start];\n if (f === g) {\n f.ring.push(end);\n callback(f.ring);\n } else {\n fragmentByStart[f.start] = fragmentByEnd[g.end] = {start: f.start, end: g.end, ring: f.ring.concat(g.ring)};\n }\n } else {\n delete fragmentByEnd[f.end];\n f.ring.push(end);\n fragmentByEnd[f.end = endIndex] = f;\n }\n } else if (f = fragmentByStart[endIndex]) {\n if (g = fragmentByEnd[startIndex]) {\n delete fragmentByStart[f.start];\n delete fragmentByEnd[g.end];\n if (f === g) {\n f.ring.push(end);\n callback(f.ring);\n } else {\n fragmentByStart[g.start] = fragmentByEnd[f.end] = {start: g.start, end: f.end, ring: g.ring.concat(f.ring)};\n }\n } else {\n delete fragmentByStart[f.start];\n f.ring.unshift(start);\n fragmentByStart[f.start = startIndex] = f;\n }\n } else {\n fragmentByStart[startIndex] = fragmentByEnd[endIndex] = {start: startIndex, end: endIndex, ring: [start, end]};\n }\n }\n }\n\n function index(point) {\n return point[0] * 2 + point[1] * (dx + 1) * 4;\n }\n\n function smoothLinear(ring, values, value) {\n ring.forEach(function(point) {\n var x = point[0],\n y = point[1],\n xt = x | 0,\n yt = y | 0,\n v0,\n v1 = values[yt * dx + xt];\n if (x > 0 && x < dx && xt === x) {\n v0 = values[yt * dx + xt - 1];\n point[0] = x + (value - v0) / (v1 - v0) - 0.5;\n }\n if (y > 0 && y < dy && yt === y) {\n v0 = values[(yt - 1) * dx + xt];\n point[1] = y + (value - v0) / (v1 - v0) - 0.5;\n }\n });\n }\n\n contours.contour = contour;\n\n contours.size = function(_) {\n if (!arguments.length) return [dx, dy];\n var _0 = Math.ceil(_[0]), _1 = Math.ceil(_[1]);\n if (!(_0 > 0) || !(_1 > 0)) throw new Error(\"invalid size\");\n return dx = _0, dy = _1, contours;\n };\n\n contours.thresholds = function(_) {\n return arguments.length ? (threshold = typeof _ === \"function\" ? _ : Array.isArray(_) ? constant(slice.call(_)) : constant(_), contours) : threshold;\n };\n\n contours.smooth = function(_) {\n return arguments.length ? (smooth = _ ? smoothLinear : noop, contours) : smooth === smoothLinear;\n };\n\n return contours;\n}\n","// TODO Optimize edge cases.\n// TODO Optimize index calculation.\n// TODO Optimize arguments.\nexport function blurX(source, target, r) {\n var n = source.width,\n m = source.height,\n w = (r << 1) + 1;\n for (var j = 0; j < m; ++j) {\n for (var i = 0, sr = 0; i < n + r; ++i) {\n if (i < n) {\n sr += source.data[i + j * n];\n }\n if (i >= r) {\n if (i >= w) {\n sr -= source.data[i - w + j * n];\n }\n target.data[i - r + j * n] = sr / Math.min(i + 1, n - 1 + w - i, w);\n }\n }\n }\n}\n\n// TODO Optimize edge cases.\n// TODO Optimize index calculation.\n// TODO Optimize arguments.\nexport function blurY(source, target, r) {\n var n = source.width,\n m = source.height,\n w = (r << 1) + 1;\n for (var i = 0; i < n; ++i) {\n for (var j = 0, sr = 0; j < m + r; ++j) {\n if (j < m) {\n sr += source.data[i + j * n];\n }\n if (j >= r) {\n if (j >= w) {\n sr -= source.data[i + (j - w) * n];\n }\n target.data[i + (j - r) * n] = sr / Math.min(j + 1, m - 1 + w - j, w);\n }\n }\n }\n}\n","import {max, range, tickStep} from \"d3-array\";\nimport {slice} from \"./array\";\nimport {blurX, blurY} from \"./blur\";\nimport constant from \"./constant\";\nimport contours from \"./contours\";\n\nfunction defaultX(d) {\n return d[0];\n}\n\nfunction defaultY(d) {\n return d[1];\n}\n\nfunction defaultWeight() {\n return 1;\n}\n\nexport default function() {\n var x = defaultX,\n y = defaultY,\n weight = defaultWeight,\n dx = 960,\n dy = 500,\n r = 20, // blur radius\n k = 2, // log2(grid cell size)\n o = r * 3, // grid offset, to pad for blur\n n = (dx + o * 2) >> k, // grid width\n m = (dy + o * 2) >> k, // grid height\n threshold = constant(20);\n\n function density(data) {\n var values0 = new Float32Array(n * m),\n values1 = new Float32Array(n * m);\n\n data.forEach(function(d, i, data) {\n var xi = (+x(d, i, data) + o) >> k,\n yi = (+y(d, i, data) + o) >> k,\n wi = +weight(d, i, data);\n if (xi >= 0 && xi < n && yi >= 0 && yi < m) {\n values0[xi + yi * n] += wi;\n }\n });\n\n // TODO Optimize.\n blurX({width: n, height: m, data: values0}, {width: n, height: m, data: values1}, r >> k);\n blurY({width: n, height: m, data: values1}, {width: n, height: m, data: values0}, r >> k);\n blurX({width: n, height: m, data: values0}, {width: n, height: m, data: values1}, r >> k);\n blurY({width: n, height: m, data: values1}, {width: n, height: m, data: values0}, r >> k);\n blurX({width: n, height: m, data: values0}, {width: n, height: m, data: values1}, r >> k);\n blurY({width: n, height: m, data: values1}, {width: n, height: m, data: values0}, r >> k);\n\n var tz = threshold(values0);\n\n // Convert number of thresholds into uniform thresholds.\n if (!Array.isArray(tz)) {\n var stop = max(values0);\n tz = tickStep(0, stop, tz);\n tz = range(0, Math.floor(stop / tz) * tz, tz);\n tz.shift();\n }\n\n return contours()\n .thresholds(tz)\n .size([n, m])\n (values0)\n .map(transform);\n }\n\n function transform(geometry) {\n geometry.value *= Math.pow(2, -2 * k); // Density in points per square pixel.\n geometry.coordinates.forEach(transformPolygon);\n return geometry;\n }\n\n function transformPolygon(coordinates) {\n coordinates.forEach(transformRing);\n }\n\n function transformRing(coordinates) {\n coordinates.forEach(transformPoint);\n }\n\n // TODO Optimize.\n function transformPoint(coordinates) {\n coordinates[0] = coordinates[0] * Math.pow(2, k) - o;\n coordinates[1] = coordinates[1] * Math.pow(2, k) - o;\n }\n\n function resize() {\n o = r * 3;\n n = (dx + o * 2) >> k;\n m = (dy + o * 2) >> k;\n return density;\n }\n\n density.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : constant(+_), density) : x;\n };\n\n density.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : constant(+_), density) : y;\n };\n\n density.weight = function(_) {\n return arguments.length ? (weight = typeof _ === \"function\" ? _ : constant(+_), density) : weight;\n };\n\n density.size = function(_) {\n if (!arguments.length) return [dx, dy];\n var _0 = Math.ceil(_[0]), _1 = Math.ceil(_[1]);\n if (!(_0 >= 0) && !(_0 >= 0)) throw new Error(\"invalid size\");\n return dx = _0, dy = _1, resize();\n };\n\n density.cellSize = function(_) {\n if (!arguments.length) return 1 << k;\n if (!((_ = +_) >= 1)) throw new Error(\"invalid cell size\");\n return k = Math.floor(Math.log(_) / Math.LN2), resize();\n };\n\n density.thresholds = function(_) {\n return arguments.length ? (threshold = typeof _ === \"function\" ? _ : Array.isArray(_) ? constant(slice.call(_)) : constant(_), density) : threshold;\n };\n\n density.bandwidth = function(_) {\n if (!arguments.length) return Math.sqrt(r * (r + 1));\n if (!((_ = +_) >= 0)) throw new Error(\"invalid bandwidth\");\n return r = Math.round((Math.sqrt(4 * _ * _ + 1) - 1) / 2), resize();\n };\n\n return density;\n}\n","// Adds floating point numbers with twice the normal precision.\n// Reference: J. R. Shewchuk, Adaptive Precision Floating-Point Arithmetic and\n// Fast Robust Geometric Predicates, Discrete & Computational Geometry 18(3)\n// 305–363 (1997).\n// Code adapted from GeographicLib by Charles F. F. Karney,\n// http://geographiclib.sourceforge.net/\n\nexport default function() {\n return new Adder;\n}\n\nfunction Adder() {\n this.reset();\n}\n\nAdder.prototype = {\n constructor: Adder,\n reset: function() {\n this.s = // rounded value\n this.t = 0; // exact error\n },\n add: function(y) {\n add(temp, y, this.t);\n add(this, temp.s, this.s);\n if (this.s) this.t += temp.t;\n else this.s = temp.t;\n },\n valueOf: function() {\n return this.s;\n }\n};\n\nvar temp = new Adder;\n\nfunction add(adder, a, b) {\n var x = adder.s = a + b,\n bv = x - a,\n av = x - bv;\n adder.t = (a - av) + (b - bv);\n}\n","export var epsilon = 1e-6;\nexport var epsilon2 = 1e-12;\nexport var pi = Math.PI;\nexport var halfPi = pi / 2;\nexport var quarterPi = pi / 4;\nexport var tau = pi * 2;\n\nexport var degrees = 180 / pi;\nexport var radians = pi / 180;\n\nexport var abs = Math.abs;\nexport var atan = Math.atan;\nexport var atan2 = Math.atan2;\nexport var cos = Math.cos;\nexport var ceil = Math.ceil;\nexport var exp = Math.exp;\nexport var floor = Math.floor;\nexport var log = Math.log;\nexport var pow = Math.pow;\nexport var sin = Math.sin;\nexport var sign = Math.sign || function(x) { return x > 0 ? 1 : x < 0 ? -1 : 0; };\nexport var sqrt = Math.sqrt;\nexport var tan = Math.tan;\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\nexport function haversin(x) {\n return (x = sin(x / 2)) * x;\n}\n","export default function noop() {}\n","function streamGeometry(geometry, stream) {\n if (geometry && streamGeometryType.hasOwnProperty(geometry.type)) {\n streamGeometryType[geometry.type](geometry, stream);\n }\n}\n\nvar streamObjectType = {\n Feature: function(object, stream) {\n streamGeometry(object.geometry, stream);\n },\n FeatureCollection: function(object, stream) {\n var features = object.features, i = -1, n = features.length;\n while (++i < n) streamGeometry(features[i].geometry, stream);\n }\n};\n\nvar streamGeometryType = {\n Sphere: function(object, stream) {\n stream.sphere();\n },\n Point: function(object, stream) {\n object = object.coordinates;\n stream.point(object[0], object[1], object[2]);\n },\n MultiPoint: function(object, stream) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) object = coordinates[i], stream.point(object[0], object[1], object[2]);\n },\n LineString: function(object, stream) {\n streamLine(object.coordinates, stream, 0);\n },\n MultiLineString: function(object, stream) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) streamLine(coordinates[i], stream, 0);\n },\n Polygon: function(object, stream) {\n streamPolygon(object.coordinates, stream);\n },\n MultiPolygon: function(object, stream) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) streamPolygon(coordinates[i], stream);\n },\n GeometryCollection: function(object, stream) {\n var geometries = object.geometries, i = -1, n = geometries.length;\n while (++i < n) streamGeometry(geometries[i], stream);\n }\n};\n\nfunction streamLine(coordinates, stream, closed) {\n var i = -1, n = coordinates.length - closed, coordinate;\n stream.lineStart();\n while (++i < n) coordinate = coordinates[i], stream.point(coordinate[0], coordinate[1], coordinate[2]);\n stream.lineEnd();\n}\n\nfunction streamPolygon(coordinates, stream) {\n var i = -1, n = coordinates.length;\n stream.polygonStart();\n while (++i < n) streamLine(coordinates[i], stream, 1);\n stream.polygonEnd();\n}\n\nexport default function(object, stream) {\n if (object && streamObjectType.hasOwnProperty(object.type)) {\n streamObjectType[object.type](object, stream);\n } else {\n streamGeometry(object, stream);\n }\n}\n","export default function(x) {\n return x;\n}\n","import adder from \"../adder.js\";\nimport {abs} from \"../math.js\";\nimport noop from \"../noop.js\";\n\nvar areaSum = adder(),\n areaRingSum = adder(),\n x00,\n y00,\n x0,\n y0;\n\nvar areaStream = {\n point: noop,\n lineStart: noop,\n lineEnd: noop,\n polygonStart: function() {\n areaStream.lineStart = areaRingStart;\n areaStream.lineEnd = areaRingEnd;\n },\n polygonEnd: function() {\n areaStream.lineStart = areaStream.lineEnd = areaStream.point = noop;\n areaSum.add(abs(areaRingSum));\n areaRingSum.reset();\n },\n result: function() {\n var area = areaSum / 2;\n areaSum.reset();\n return area;\n }\n};\n\nfunction areaRingStart() {\n areaStream.point = areaPointFirst;\n}\n\nfunction areaPointFirst(x, y) {\n areaStream.point = areaPoint;\n x00 = x0 = x, y00 = y0 = y;\n}\n\nfunction areaPoint(x, y) {\n areaRingSum.add(y0 * x - x0 * y);\n x0 = x, y0 = y;\n}\n\nfunction areaRingEnd() {\n areaPoint(x00, y00);\n}\n\nexport default areaStream;\n","import noop from \"../noop.js\";\n\nvar x0 = Infinity,\n y0 = x0,\n x1 = -x0,\n y1 = x1;\n\nvar boundsStream = {\n point: boundsPoint,\n lineStart: noop,\n lineEnd: noop,\n polygonStart: noop,\n polygonEnd: noop,\n result: function() {\n var bounds = [[x0, y0], [x1, y1]];\n x1 = y1 = -(y0 = x0 = Infinity);\n return bounds;\n }\n};\n\nfunction boundsPoint(x, y) {\n if (x < x0) x0 = x;\n if (x > x1) x1 = x;\n if (y < y0) y0 = y;\n if (y > y1) y1 = y;\n}\n\nexport default boundsStream;\n","import {sqrt} from \"../math.js\";\n\n// TODO Enforce positive area for exterior, negative area for interior?\n\nvar X0 = 0,\n Y0 = 0,\n Z0 = 0,\n X1 = 0,\n Y1 = 0,\n Z1 = 0,\n X2 = 0,\n Y2 = 0,\n Z2 = 0,\n x00,\n y00,\n x0,\n y0;\n\nvar centroidStream = {\n point: centroidPoint,\n lineStart: centroidLineStart,\n lineEnd: centroidLineEnd,\n polygonStart: function() {\n centroidStream.lineStart = centroidRingStart;\n centroidStream.lineEnd = centroidRingEnd;\n },\n polygonEnd: function() {\n centroidStream.point = centroidPoint;\n centroidStream.lineStart = centroidLineStart;\n centroidStream.lineEnd = centroidLineEnd;\n },\n result: function() {\n var centroid = Z2 ? [X2 / Z2, Y2 / Z2]\n : Z1 ? [X1 / Z1, Y1 / Z1]\n : Z0 ? [X0 / Z0, Y0 / Z0]\n : [NaN, NaN];\n X0 = Y0 = Z0 =\n X1 = Y1 = Z1 =\n X2 = Y2 = Z2 = 0;\n return centroid;\n }\n};\n\nfunction centroidPoint(x, y) {\n X0 += x;\n Y0 += y;\n ++Z0;\n}\n\nfunction centroidLineStart() {\n centroidStream.point = centroidPointFirstLine;\n}\n\nfunction centroidPointFirstLine(x, y) {\n centroidStream.point = centroidPointLine;\n centroidPoint(x0 = x, y0 = y);\n}\n\nfunction centroidPointLine(x, y) {\n var dx = x - x0, dy = y - y0, z = sqrt(dx * dx + dy * dy);\n X1 += z * (x0 + x) / 2;\n Y1 += z * (y0 + y) / 2;\n Z1 += z;\n centroidPoint(x0 = x, y0 = y);\n}\n\nfunction centroidLineEnd() {\n centroidStream.point = centroidPoint;\n}\n\nfunction centroidRingStart() {\n centroidStream.point = centroidPointFirstRing;\n}\n\nfunction centroidRingEnd() {\n centroidPointRing(x00, y00);\n}\n\nfunction centroidPointFirstRing(x, y) {\n centroidStream.point = centroidPointRing;\n centroidPoint(x00 = x0 = x, y00 = y0 = y);\n}\n\nfunction centroidPointRing(x, y) {\n var dx = x - x0,\n dy = y - y0,\n z = sqrt(dx * dx + dy * dy);\n\n X1 += z * (x0 + x) / 2;\n Y1 += z * (y0 + y) / 2;\n Z1 += z;\n\n z = y0 * x - x0 * y;\n X2 += z * (x0 + x);\n Y2 += z * (y0 + y);\n Z2 += z * 3;\n centroidPoint(x0 = x, y0 = y);\n}\n\nexport default centroidStream;\n","import {tau} from \"../math.js\";\nimport noop from \"../noop.js\";\n\nexport default function PathContext(context) {\n this._context = context;\n}\n\nPathContext.prototype = {\n _radius: 4.5,\n pointRadius: function(_) {\n return this._radius = _, this;\n },\n polygonStart: function() {\n this._line = 0;\n },\n polygonEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line === 0) this._context.closePath();\n this._point = NaN;\n },\n point: function(x, y) {\n switch (this._point) {\n case 0: {\n this._context.moveTo(x, y);\n this._point = 1;\n break;\n }\n case 1: {\n this._context.lineTo(x, y);\n break;\n }\n default: {\n this._context.moveTo(x + this._radius, y);\n this._context.arc(x, y, this._radius, 0, tau);\n break;\n }\n }\n },\n result: noop\n};\n","import adder from \"../adder.js\";\nimport {sqrt} from \"../math.js\";\nimport noop from \"../noop.js\";\n\nvar lengthSum = adder(),\n lengthRing,\n x00,\n y00,\n x0,\n y0;\n\nvar lengthStream = {\n point: noop,\n lineStart: function() {\n lengthStream.point = lengthPointFirst;\n },\n lineEnd: function() {\n if (lengthRing) lengthPoint(x00, y00);\n lengthStream.point = noop;\n },\n polygonStart: function() {\n lengthRing = true;\n },\n polygonEnd: function() {\n lengthRing = null;\n },\n result: function() {\n var length = +lengthSum;\n lengthSum.reset();\n return length;\n }\n};\n\nfunction lengthPointFirst(x, y) {\n lengthStream.point = lengthPoint;\n x00 = x0 = x, y00 = y0 = y;\n}\n\nfunction lengthPoint(x, y) {\n x0 -= x, y0 -= y;\n lengthSum.add(sqrt(x0 * x0 + y0 * y0));\n x0 = x, y0 = y;\n}\n\nexport default lengthStream;\n","export default function PathString() {\n this._string = [];\n}\n\nPathString.prototype = {\n _radius: 4.5,\n _circle: circle(4.5),\n pointRadius: function(_) {\n if ((_ = +_) !== this._radius) this._radius = _, this._circle = null;\n return this;\n },\n polygonStart: function() {\n this._line = 0;\n },\n polygonEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line === 0) this._string.push(\"Z\");\n this._point = NaN;\n },\n point: function(x, y) {\n switch (this._point) {\n case 0: {\n this._string.push(\"M\", x, \",\", y);\n this._point = 1;\n break;\n }\n case 1: {\n this._string.push(\"L\", x, \",\", y);\n break;\n }\n default: {\n if (this._circle == null) this._circle = circle(this._radius);\n this._string.push(\"M\", x, \",\", y, this._circle);\n break;\n }\n }\n },\n result: function() {\n if (this._string.length) {\n var result = this._string.join(\"\");\n this._string = [];\n return result;\n } else {\n return null;\n }\n }\n};\n\nfunction circle(radius) {\n return \"m0,\" + radius\n + \"a\" + radius + \",\" + radius + \" 0 1,1 0,\" + -2 * radius\n + \"a\" + radius + \",\" + radius + \" 0 1,1 0,\" + 2 * radius\n + \"z\";\n}\n","import identity from \"../identity.js\";\nimport stream from \"../stream.js\";\nimport pathArea from \"./area.js\";\nimport pathBounds from \"./bounds.js\";\nimport pathCentroid from \"./centroid.js\";\nimport PathContext from \"./context.js\";\nimport pathMeasure from \"./measure.js\";\nimport PathString from \"./string.js\";\n\nexport default function(projection, context) {\n var pointRadius = 4.5,\n projectionStream,\n contextStream;\n\n function path(object) {\n if (object) {\n if (typeof pointRadius === \"function\") contextStream.pointRadius(+pointRadius.apply(this, arguments));\n stream(object, projectionStream(contextStream));\n }\n return contextStream.result();\n }\n\n path.area = function(object) {\n stream(object, projectionStream(pathArea));\n return pathArea.result();\n };\n\n path.measure = function(object) {\n stream(object, projectionStream(pathMeasure));\n return pathMeasure.result();\n };\n\n path.bounds = function(object) {\n stream(object, projectionStream(pathBounds));\n return pathBounds.result();\n };\n\n path.centroid = function(object) {\n stream(object, projectionStream(pathCentroid));\n return pathCentroid.result();\n };\n\n path.projection = function(_) {\n return arguments.length ? (projectionStream = _ == null ? (projection = null, identity) : (projection = _).stream, path) : projection;\n };\n\n path.context = function(_) {\n if (!arguments.length) return context;\n contextStream = _ == null ? (context = null, new PathString) : new PathContext(context = _);\n if (typeof pointRadius !== \"function\") contextStream.pointRadius(pointRadius);\n return path;\n };\n\n path.pointRadius = function(_) {\n if (!arguments.length) return pointRadius;\n pointRadius = typeof _ === \"function\" ? _ : (contextStream.pointRadius(+_), +_);\n return path;\n };\n\n return path.projection(projection).context(context);\n}\n","import { I1DChart } from \"@hpcc-js/api\";\nimport { InputField } from \"@hpcc-js/common\";\nimport { contourDensity as d3ContourDensity } from \"d3-contour\";\nimport { geoPath } from \"d3-geo\";\nimport { XYAxis } from \"./XYAxis.ts\";\n\nexport class Contour extends XYAxis {\n static __inputs: InputField[] = [{\n id: \"x\",\n type: \"any\"\n }, {\n id: \"y\",\n type: \"number\"\n }];\n\n protected _dataMinWeight;\n protected _dataMaxWeight;\n constructor() {\n super();\n this\n .xAxisGuideLines_default(false)\n .yAxisGuideLines_default(false)\n .xAxisType_default(\"linear\")\n ;\n }\n\n xPos(host: XYAxis, d) {\n return host.orientation() === \"horizontal\" ? host.dataPos(d.label) : host.valuePos(d.value);\n }\n\n yPos(host: XYAxis, d) {\n return host.orientation() === \"horizontal\" ? host.valuePos(d.value) : host.dataPos(d.label);\n }\n\n layerEnter(host: XYAxis, element, duration: number = 250) {\n super.layerEnter(host, element, duration);\n }\n\n layerUpdate(host: XYAxis, element, duration: number = 250) {\n super.layerUpdate(host, element, duration);\n\n this._palette = this._palette.switch(this.paletteID());\n\n const data = this.flattenData(this.layerColumns(host), this.layerData(host));\n const contourData = d3ContourDensity()\n .x(d => this.xPos(host, d))\n .y(d => this.yPos(host, d))\n .size([this.width(), this.height()])\n .bandwidth(this.contourBandwidth())(data)\n ;\n const _vals = contourData.map(d => d.value);\n const minValue = Math.min.apply(this, _vals);\n const maxValue = Math.max.apply(this, _vals);\n this._dataMinWeight = minValue;\n this._dataMaxWeight = maxValue;\n const lines = element.selectAll(\"path\").data(contourData);\n lines.enter().append(\"path\")\n .merge(lines)\n .attr(\"d\", geoPath())\n .attr(\"fill\", d => this.showContourFill() ? this._palette(d.value, minValue, maxValue) : \"none\")\n .attr(\"stroke\", this.contourStrokeColor())\n .attr(\"stroke-linejoin\", \"round\")\n .attr(\"stroke-width\", this.contourStrokeWidth())\n ;\n lines.exit().remove();\n }\n\n exit(_domNode, _element) {\n super.exit(_domNode, _element);\n }\n}\nContour.prototype._class += \" chart_Contour\";\nContour.prototype.implements(I1DChart.prototype);\n\nexport interface Contour {\n paletteID(): string;\n paletteID(_: string): this;\n useClonedPalette(): boolean;\n useClonedPalette(_: boolean): this;\n showContourFill(): boolean;\n showContourFill(_: boolean): this;\n showContour(): boolean;\n showContour(_: boolean): this;\n contourBandwidth(): number;\n contourBandwidth(_: number): this;\n contourStrokeColor(): string;\n contourStrokeColor(_: string): this;\n contourStrokeWidth(): number;\n contourStrokeWidth(_: number): this;\n}\nContour.prototype.publish(\"paletteID\", \"YlGnBu\", \"string\", \"Color palette for this widget\");\nContour.prototype.publish(\"useClonedPalette\", true, \"boolean\", \"Enable or disable using a cloned palette\");\nContour.prototype.publish(\"showContourFill\", true, \"boolean\", \"Show/hide the contour background colors\");\nContour.prototype.publish(\"showContour\", true, \"boolean\", \"Show/hide the contour border lines\");\nContour.prototype.publish(\"contourBandwidth\", 40, \"number\", \"Controls the sensitivity of the contour grouping algorithm\");\nContour.prototype.publish(\"contourStrokeColor\", \"#2C3A47\", \"html-color\", \"Color of the contour border lines\");\nContour.prototype.publish(\"contourStrokeWidth\", 1, \"number\", \"Width of the contour border lines\");\n","import { Bar } from \"./Bar.ts\";\n\nexport class Gantt extends Bar {\n constructor() {\n super();\n\n this\n .orientation_default(\"vertical\")\n .xAxisType_default(\"ordinal\")\n .yAxisType_default(\"time\")\n ;\n }\n}\nGantt.prototype._class += \" chart_Gantt\";\n","export default function(x) {\n return function constant() {\n return x;\n };\n}\n","export var epsilon = 1e-12;\nexport var pi = Math.PI;\nexport var halfPi = pi / 2;\nexport var tau = 2 * pi;\n","import {path} from \"d3-path\";\nimport constant from \"./constant\";\nimport {epsilon, pi, halfPi, tau} from \"./math\";\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 asin(x) {\n return x >= 1 ? halfPi : x <= -1 ? -halfPi : Math.asin(x);\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 = (x32 * (y0 - y2) - y32 * (x0 - x2)) / (y32 * x10 - x32 * y10);\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) / Math.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) * Math.sqrt(Math.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 = Math.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 * Math.cos(a0), r1 * Math.sin(a0));\n context.arc(0, 0, r1, a0, a1, !cw);\n if (r0 > epsilon) {\n context.moveTo(r0 * Math.cos(a1), r0 * Math.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) : Math.sqrt(r0 * r0 + r1 * r1)),\n rc = Math.min(Math.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 * Math.sin(ap)),\n p1 = asin(rp / r1 * Math.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 * Math.cos(a01),\n y01 = r1 * Math.sin(a01),\n x10 = r0 * Math.cos(a10),\n y10 = r0 * Math.sin(a10);\n\n // Apply rounded corners?\n if (rc > epsilon) {\n var x11 = r1 * Math.cos(a11),\n y11 = r1 * Math.sin(a11),\n x00 = r0 * Math.cos(a00),\n y00 = r0 * Math.sin(a00);\n\n // Restrict the corner radius according to the sector angle.\n if (da < pi) {\n var oc = da0 > epsilon ? intersect(x01, y01, x00, y00, x11, y11, x10, y10) : [x10, y10],\n ax = x01 - oc[0],\n ay = y01 - oc[1],\n bx = x11 - oc[0],\n by = y11 - oc[1],\n kc = 1 / Math.sin(Math.acos((ax * bx + ay * by) / (Math.sqrt(ax * ax + ay * ay) * Math.sqrt(bx * bx + by * by))) / 2),\n lc = Math.sqrt(oc[0] * oc[0] + oc[1] * oc[1]);\n rc0 = Math.min(rc, (r0 - lc) / (kc - 1));\n rc1 = Math.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, Math.atan2(t0.y01, t0.x01), Math.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, Math.atan2(t0.y01, t0.x01), Math.atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r1, Math.atan2(t0.cy + t0.y11, t0.cx + t0.x11), Math.atan2(t1.cy + t1.y11, t1.cx + t1.x11), !cw);\n context.arc(t1.cx, t1.cy, rc1, Math.atan2(t1.y11, t1.x11), Math.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, Math.atan2(t0.y01, t0.x01), Math.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, Math.atan2(t0.y01, t0.x01), Math.atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r0, Math.atan2(t0.cy + t0.y11, t0.cx + t0.x11), Math.atan2(t1.cy + t1.y11, t1.cx + t1.x11), cw);\n context.arc(t1.cx, t1.cy, rc0, Math.atan2(t1.y11, t1.x11), Math.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 [Math.cos(a) * r, Math.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","function Linear(context) {\n this._context = context;\n}\n\nLinear.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // proceed\n default: this._context.lineTo(x, y); break;\n }\n }\n};\n\nexport default function(context) {\n return new Linear(context);\n}\n","export function x(p) {\n return p[0];\n}\n\nexport function y(p) {\n return p[1];\n}\n","import {path} from \"d3-path\";\nimport constant from \"./constant\";\nimport curveLinear from \"./curve/linear\";\nimport {x as pointX, y as pointY} from \"./point\";\n\nexport default function() {\n var x = pointX,\n y = pointY,\n defined = constant(true),\n context = null,\n curve = curveLinear,\n output = null;\n\n function line(data) {\n var i,\n n = data.length,\n d,\n defined0 = false,\n buffer;\n\n if (context == null) output = curve(buffer = path());\n\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) output.lineStart();\n else output.lineEnd();\n }\n if (defined0) output.point(+x(d, i, data), +y(d, i, data));\n }\n\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n line.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : constant(+_), line) : x;\n };\n\n line.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : constant(+_), line) : y;\n };\n\n line.defined = function(_) {\n return arguments.length ? (defined = typeof _ === \"function\" ? _ : constant(!!_), line) : defined;\n };\n\n line.curve = function(_) {\n return arguments.length ? (curve = _, context != null && (output = curve(context)), line) : curve;\n };\n\n line.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), line) : context;\n };\n\n return line;\n}\n","import curveLinear from \"./linear\";\n\nexport var curveRadialLinear = curveRadial(curveLinear);\n\nfunction Radial(curve) {\n this._curve = curve;\n}\n\nRadial.prototype = {\n areaStart: function() {\n this._curve.areaStart();\n },\n areaEnd: function() {\n this._curve.areaEnd();\n },\n lineStart: function() {\n this._curve.lineStart();\n },\n lineEnd: function() {\n this._curve.lineEnd();\n },\n point: function(a, r) {\n this._curve.point(r * Math.sin(a), r * -Math.cos(a));\n }\n};\n\nexport default function curveRadial(curve) {\n\n function radial(context) {\n return new Radial(curve(context));\n }\n\n radial._curve = curve;\n\n return radial;\n}\n","var tan30 = Math.sqrt(1 / 3),\n tan30_2 = tan30 * 2;\n\nexport default {\n draw: function(context, size) {\n var y = Math.sqrt(size / tan30_2),\n x = y * tan30;\n context.moveTo(0, -y);\n context.lineTo(x, 0);\n context.lineTo(0, y);\n context.lineTo(-x, 0);\n context.closePath();\n }\n};\n","import {pi, tau} from \"../math\";\n\nvar ka = 0.89081309152928522810,\n kr = Math.sin(pi / 10) / Math.sin(7 * pi / 10),\n kx = Math.sin(tau / 10) * kr,\n ky = -Math.cos(tau / 10) * kr;\n\nexport default {\n draw: function(context, size) {\n var r = Math.sqrt(size * ka),\n x = kx * r,\n y = ky * r;\n context.moveTo(0, -r);\n context.lineTo(x, y);\n for (var i = 1; i < 5; ++i) {\n var a = tau * i / 5,\n c = Math.cos(a),\n s = Math.sin(a);\n context.lineTo(s * r, -c * r);\n context.lineTo(c * x - s * y, s * x + c * y);\n }\n context.closePath();\n }\n};\n","var sqrt3 = Math.sqrt(3);\n\nexport default {\n draw: function(context, size) {\n var y = -Math.sqrt(size / (sqrt3 * 3));\n context.moveTo(0, y * 2);\n context.lineTo(-sqrt3 * y, -y);\n context.lineTo(sqrt3 * y, -y);\n context.closePath();\n }\n};\n","var c = -0.5,\n s = Math.sqrt(3) / 2,\n k = 1 / Math.sqrt(12),\n a = (k / 2 + 1) * 3;\n\nexport default {\n draw: function(context, size) {\n var r = Math.sqrt(size / a),\n x0 = r / 2,\n y0 = r * k,\n x1 = x0,\n y1 = r * k + r,\n x2 = -x1,\n y2 = y1;\n context.moveTo(x0, y0);\n context.lineTo(x1, y1);\n context.lineTo(x2, y2);\n context.lineTo(c * x0 - s * y0, s * x0 + c * y0);\n context.lineTo(c * x1 - s * y1, s * x1 + c * y1);\n context.lineTo(c * x2 - s * y2, s * x2 + c * y2);\n context.lineTo(c * x0 + s * y0, c * y0 - s * x0);\n context.lineTo(c * x1 + s * y1, c * y1 - s * x1);\n context.lineTo(c * x2 + s * y2, c * y2 - s * x2);\n context.closePath();\n }\n};\n","export default function() {}\n","export function point(that, x, y) {\n that._context.bezierCurveTo(\n (2 * that._x0 + that._x1) / 3,\n (2 * that._y0 + that._y1) / 3,\n (that._x0 + 2 * that._x1) / 3,\n (that._y0 + 2 * that._y1) / 3,\n (that._x0 + 4 * that._x1 + x) / 6,\n (that._y0 + 4 * that._y1 + y) / 6\n );\n}\n\nexport function Basis(context) {\n this._context = context;\n}\n\nBasis.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 3: point(this, this._x1, this._y1); // proceed\n case 2: this._context.lineTo(this._x1, this._y1); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6); // proceed\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new Basis(context);\n}\n","import noop from \"../noop\";\nimport {point} from \"./basis\";\n\nfunction BasisClosed(context) {\n this._context = context;\n}\n\nBasisClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x2, this._y2);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3);\n this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x2, this._y2);\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._x2 = x, this._y2 = y; break;\n case 1: this._point = 2; this._x3 = x, this._y3 = y; break;\n case 2: this._point = 3; this._x4 = x, this._y4 = y; this._context.moveTo((this._x0 + 4 * this._x1 + x) / 6, (this._y0 + 4 * this._y1 + y) / 6); break;\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new BasisClosed(context);\n}\n","import {point} from \"./basis\";\n\nfunction BasisOpen(context) {\n this._context = context;\n}\n\nBasisOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; var x0 = (this._x0 + 4 * this._x1 + x) / 6, y0 = (this._y0 + 4 * this._y1 + y) / 6; this._line ? this._context.lineTo(x0, y0) : this._context.moveTo(x0, y0); break;\n case 3: this._point = 4; // proceed\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new BasisOpen(context);\n}\n","import {Basis} from \"./basis\";\n\nfunction Bundle(context, beta) {\n this._basis = new Basis(context);\n this._beta = beta;\n}\n\nBundle.prototype = {\n lineStart: function() {\n this._x = [];\n this._y = [];\n this._basis.lineStart();\n },\n lineEnd: function() {\n var x = this._x,\n y = this._y,\n j = x.length - 1;\n\n if (j > 0) {\n var x0 = x[0],\n y0 = y[0],\n dx = x[j] - x0,\n dy = y[j] - y0,\n i = -1,\n t;\n\n while (++i <= j) {\n t = i / j;\n this._basis.point(\n this._beta * x[i] + (1 - this._beta) * (x0 + t * dx),\n this._beta * y[i] + (1 - this._beta) * (y0 + t * dy)\n );\n }\n }\n\n this._x = this._y = null;\n this._basis.lineEnd();\n },\n point: function(x, y) {\n this._x.push(+x);\n this._y.push(+y);\n }\n};\n\nexport default (function custom(beta) {\n\n function bundle(context) {\n return beta === 1 ? new Basis(context) : new Bundle(context, beta);\n }\n\n bundle.beta = function(beta) {\n return custom(+beta);\n };\n\n return bundle;\n})(0.85);\n","export function point(that, x, y) {\n that._context.bezierCurveTo(\n that._x1 + that._k * (that._x2 - that._x0),\n that._y1 + that._k * (that._y2 - that._y0),\n that._x2 + that._k * (that._x1 - x),\n that._y2 + that._k * (that._y1 - y),\n that._x2,\n that._y2\n );\n}\n\nexport function Cardinal(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinal.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x2, this._y2); break;\n case 3: point(this, this._x1, this._y1); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; this._x1 = x, this._y1 = y; break;\n case 2: this._point = 3; // proceed\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new Cardinal(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n","import noop from \"../noop\";\nimport {point} from \"./cardinal\";\n\nexport function CardinalClosed(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinalClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.lineTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n this.point(this._x5, this._y5);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._x3 = x, this._y3 = y; break;\n case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break;\n case 2: this._point = 3; this._x5 = x, this._y5 = y; break;\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new CardinalClosed(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n","import {point} from \"./cardinal\";\n\nexport function CardinalOpen(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinalOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break;\n case 3: this._point = 4; // proceed\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new CardinalOpen(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n","import {epsilon} from \"../math\";\nimport {Cardinal} from \"./cardinal\";\n\nexport function point(that, x, y) {\n var x1 = that._x1,\n y1 = that._y1,\n x2 = that._x2,\n y2 = that._y2;\n\n if (that._l01_a > epsilon) {\n var a = 2 * that._l01_2a + 3 * that._l01_a * that._l12_a + that._l12_2a,\n n = 3 * that._l01_a * (that._l01_a + that._l12_a);\n x1 = (x1 * a - that._x0 * that._l12_2a + that._x2 * that._l01_2a) / n;\n y1 = (y1 * a - that._y0 * that._l12_2a + that._y2 * that._l01_2a) / n;\n }\n\n if (that._l23_a > epsilon) {\n var b = 2 * that._l23_2a + 3 * that._l23_a * that._l12_a + that._l12_2a,\n m = 3 * that._l23_a * (that._l23_a + that._l12_a);\n x2 = (x2 * b + that._x1 * that._l23_2a - x * that._l12_2a) / m;\n y2 = (y2 * b + that._y1 * that._l23_2a - y * that._l12_2a) / m;\n }\n\n that._context.bezierCurveTo(x1, y1, x2, y2, that._x2, that._y2);\n}\n\nfunction CatmullRom(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRom.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x2, this._y2); break;\n case 3: this.point(this._x2, this._y2); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; // proceed\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRom(context, alpha) : new Cardinal(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n","import {CardinalClosed} from \"./cardinalClosed\";\nimport noop from \"../noop\";\nimport {point} from \"./catmullRom\";\n\nfunction CatmullRomClosed(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRomClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.lineTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n this.point(this._x5, this._y5);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; this._x3 = x, this._y3 = y; break;\n case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break;\n case 2: this._point = 3; this._x5 = x, this._y5 = y; break;\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRomClosed(context, alpha) : new CardinalClosed(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n","import {CardinalOpen} from \"./cardinalOpen\";\nimport {point} from \"./catmullRom\";\n\nfunction CatmullRomOpen(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRomOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break;\n case 3: this._point = 4; // proceed\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRomOpen(context, alpha) : new CardinalOpen(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n","import noop from \"../noop\";\n\nfunction LinearClosed(context) {\n this._context = context;\n}\n\nLinearClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._point) this._context.closePath();\n },\n point: function(x, y) {\n x = +x, y = +y;\n if (this._point) this._context.lineTo(x, y);\n else this._point = 1, this._context.moveTo(x, y);\n }\n};\n\nexport default function(context) {\n return new LinearClosed(context);\n}\n","function sign(x) {\n return x < 0 ? -1 : 1;\n}\n\n// Calculate the slopes of the tangents (Hermite-type interpolation) based on\n// the following paper: Steffen, M. 1990. A Simple Method for Monotonic\n// Interpolation in One Dimension. Astronomy and Astrophysics, Vol. 239, NO.\n// NOV(II), P. 443, 1990.\nfunction slope3(that, x2, y2) {\n var h0 = that._x1 - that._x0,\n h1 = x2 - that._x1,\n s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0),\n s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0),\n p = (s0 * h1 + s1 * h0) / (h0 + h1);\n return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;\n}\n\n// Calculate a one-sided slope.\nfunction slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}\n\n// According to https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Representations\n// \"you can express cubic Hermite interpolation in terms of cubic Bézier curves\n// with respect to the four values p0, p0 + m0 / 3, p1 - m1 / 3, p1\".\nfunction point(that, t0, t1) {\n var x0 = that._x0,\n y0 = that._y0,\n x1 = that._x1,\n y1 = that._y1,\n dx = (x1 - x0) / 3;\n that._context.bezierCurveTo(x0 + dx, y0 + dx * t0, x1 - dx, y1 - dx * t1, x1, y1);\n}\n\nfunction MonotoneX(context) {\n this._context = context;\n}\n\nMonotoneX.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 =\n this._t0 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x1, this._y1); break;\n case 3: point(this, this._t0, slope2(this, this._t0)); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n var t1 = NaN;\n\n x = +x, y = +y;\n if (x === this._x1 && y === this._y1) return; // Ignore coincident points.\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; point(this, slope2(this, t1 = slope3(this, x, y)), t1); break;\n default: point(this, this._t0, t1 = slope3(this, x, y)); break;\n }\n\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n this._t0 = t1;\n }\n}\n\nfunction MonotoneY(context) {\n this._context = new ReflectContext(context);\n}\n\n(MonotoneY.prototype = Object.create(MonotoneX.prototype)).point = function(x, y) {\n MonotoneX.prototype.point.call(this, y, x);\n};\n\nfunction ReflectContext(context) {\n this._context = context;\n}\n\nReflectContext.prototype = {\n moveTo: function(x, y) { this._context.moveTo(y, x); },\n closePath: function() { this._context.closePath(); },\n lineTo: function(x, y) { this._context.lineTo(y, x); },\n bezierCurveTo: function(x1, y1, x2, y2, x, y) { this._context.bezierCurveTo(y1, x1, y2, x2, y, x); }\n};\n\nexport function monotoneX(context) {\n return new MonotoneX(context);\n}\n\nexport function monotoneY(context) {\n return new MonotoneY(context);\n}\n","function Natural(context) {\n this._context = context;\n}\n\nNatural.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x = [];\n this._y = [];\n },\n lineEnd: function() {\n var x = this._x,\n y = this._y,\n n = x.length;\n\n if (n) {\n this._line ? this._context.lineTo(x[0], y[0]) : this._context.moveTo(x[0], y[0]);\n if (n === 2) {\n this._context.lineTo(x[1], y[1]);\n } else {\n var px = controlPoints(x),\n py = controlPoints(y);\n for (var i0 = 0, i1 = 1; i1 < n; ++i0, ++i1) {\n this._context.bezierCurveTo(px[0][i0], py[0][i0], px[1][i0], py[1][i0], x[i1], y[i1]);\n }\n }\n }\n\n if (this._line || (this._line !== 0 && n === 1)) this._context.closePath();\n this._line = 1 - this._line;\n this._x = this._y = null;\n },\n point: function(x, y) {\n this._x.push(+x);\n this._y.push(+y);\n }\n};\n\n// See https://www.particleincell.com/2012/bezier-splines/ for derivation.\nfunction controlPoints(x) {\n var i,\n n = x.length - 1,\n m,\n a = new Array(n),\n b = new Array(n),\n r = new Array(n);\n a[0] = 0, b[0] = 2, r[0] = x[0] + 2 * x[1];\n for (i = 1; i < n - 1; ++i) a[i] = 1, b[i] = 4, r[i] = 4 * x[i] + 2 * x[i + 1];\n a[n - 1] = 2, b[n - 1] = 7, r[n - 1] = 8 * x[n - 1] + x[n];\n for (i = 1; i < n; ++i) m = a[i] / b[i - 1], b[i] -= m, r[i] -= m * r[i - 1];\n a[n - 1] = r[n - 1] / b[n - 1];\n for (i = n - 2; i >= 0; --i) a[i] = (r[i] - a[i + 1]) / b[i];\n b[n - 1] = (x[n] + a[n - 1]) / 2;\n for (i = 0; i < n - 1; ++i) b[i] = 2 * x[i + 1] - a[i + 1];\n return [a, b];\n}\n\nexport default function(context) {\n return new Natural(context);\n}\n","function Step(context, t) {\n this._context = context;\n this._t = t;\n}\n\nStep.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x = this._y = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (0 < this._t && this._t < 1 && this._point === 2) this._context.lineTo(this._x, this._y);\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n if (this._line >= 0) this._t = 1 - this._t, this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // proceed\n default: {\n if (this._t <= 0) {\n this._context.lineTo(this._x, y);\n this._context.lineTo(x, y);\n } else {\n var x1 = this._x * (1 - this._t) + x * this._t;\n this._context.lineTo(x1, this._y);\n this._context.lineTo(x1, y);\n }\n break;\n }\n }\n this._x = x, this._y = y;\n }\n};\n\nexport default function(context) {\n return new Step(context, 0.5);\n}\n\nexport function stepBefore(context) {\n return new Step(context, 0);\n}\n\nexport function stepAfter(context) {\n return new Step(context, 1);\n}\n","export var slice = Array.prototype.slice;\n","import { event, select } from 'd3-selection';\nimport { drag } from 'd3-drag';\nimport { arc, curveCatmullRom, curveLinear, line } from 'd3-shape';\nimport { dispatch } from 'd3-dispatch';\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) {\n return typeof obj;\n} : function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n};\n\n\n\n\n\n\n\n\n\n\n\nvar classCallCheck = function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n};\n\nvar createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\n\n\n\n\n\n\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\nvar get = function get(object, property, receiver) {\n if (object === null) object = Function.prototype;\n var desc = Object.getOwnPropertyDescriptor(object, property);\n\n if (desc === undefined) {\n var parent = Object.getPrototypeOf(object);\n\n if (parent === null) {\n return undefined;\n } else {\n return get(parent, property, receiver);\n }\n } else if (\"value\" in desc) {\n return desc.value;\n } else {\n var getter = desc.get;\n\n if (getter === undefined) {\n return undefined;\n }\n\n return getter.call(receiver);\n }\n};\n\nvar inherits = function (subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n};\n\n\n\n\n\n\n\n\n\n\n\nvar possibleConstructorReturn = function (self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n};\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar toConsumableArray = function (arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];\n\n return arr2;\n } else {\n return Array.from(arr);\n }\n};\n\nvar Annotation = function () {\n function Annotation(_ref) {\n var _ref$x = _ref.x,\n x = _ref$x === undefined ? 0 : _ref$x,\n _ref$y = _ref.y,\n y = _ref$y === undefined ? 0 : _ref$y,\n nx = _ref.nx,\n ny = _ref.ny,\n _ref$dy = _ref.dy,\n dy = _ref$dy === undefined ? 0 : _ref$dy,\n _ref$dx = _ref.dx,\n dx = _ref$dx === undefined ? 0 : _ref$dx,\n _ref$color = _ref.color,\n color = _ref$color === undefined ? \"grey\" : _ref$color,\n data = _ref.data,\n type = _ref.type,\n subject = _ref.subject,\n connector = _ref.connector,\n note = _ref.note,\n disable = _ref.disable,\n id = _ref.id,\n className = _ref.className;\n classCallCheck(this, Annotation);\n\n this._dx = nx !== undefined ? nx - x : dx;\n this._dy = ny !== undefined ? ny - y : dy;\n this._x = x;\n this._y = y;\n this._color = color;\n this.id = id;\n this._className = className || \"\";\n\n this._type = type || \"\";\n this.data = data;\n\n this.note = note || {};\n this.connector = connector || {};\n this.subject = subject || {};\n\n this.disable = disable || [];\n }\n\n createClass(Annotation, [{\n key: \"updatePosition\",\n value: function updatePosition() {\n if (this.type.setPosition) {\n this.type.setPosition();\n if (this.type.subject && this.type.subject.selectAll(\":not(.handle)\").nodes().length !== 0) {\n this.type.redrawSubject();\n }\n }\n }\n }, {\n key: \"clearComponents\",\n value: function clearComponents() {\n this.type.clearComponents && this.type.clearComponents();\n }\n }, {\n key: \"updateOffset\",\n value: function updateOffset() {\n if (this.type.setOffset) {\n this.type.setOffset();\n\n if (this.type.connector.selectAll(\":not(.handle)\").nodes().length !== 0) {\n this.type.redrawConnector();\n }\n\n this.type.redrawNote();\n }\n }\n }, {\n key: \"className\",\n get: function get$$1() {\n return this._className;\n },\n set: function set$$1(className) {\n this._className = className;\n if (this.type.setClassName) this.type.setClassName();\n }\n }, {\n key: \"type\",\n get: function get$$1() {\n return this._type;\n },\n set: function set$$1(type) {\n this._type = type;\n this.clearComponents();\n }\n }, {\n key: \"x\",\n get: function get$$1() {\n return this._x;\n },\n set: function set$$1(x) {\n this._x = x;\n this.updatePosition();\n }\n }, {\n key: \"y\",\n get: function get$$1() {\n return this._y;\n },\n set: function set$$1(y) {\n this._y = y;\n this.updatePosition();\n }\n }, {\n key: \"color\",\n get: function get$$1() {\n return this._color;\n },\n set: function set$$1(color) {\n this._color = color;\n this.updatePosition();\n }\n }, {\n key: \"dx\",\n get: function get$$1() {\n return this._dx;\n },\n set: function set$$1(dx) {\n this._dx = dx;\n this.updateOffset();\n }\n }, {\n key: \"dy\",\n get: function get$$1() {\n return this._dy;\n },\n set: function set$$1(dy) {\n this._dy = dy;\n this.updateOffset();\n }\n }, {\n key: \"nx\",\n set: function set$$1(nx) {\n this._dx = nx - this._x;\n this.updateOffset();\n }\n }, {\n key: \"ny\",\n set: function set$$1(ny) {\n this._dy = ny - this._y;\n this.updateOffset();\n }\n }, {\n key: \"offset\",\n get: function get$$1() {\n return { x: this._dx, y: this._dy };\n },\n set: function set$$1(_ref2) {\n var x = _ref2.x,\n y = _ref2.y;\n\n this._dx = x;\n this._dy = y;\n this.updateOffset();\n }\n }, {\n key: \"position\",\n get: function get$$1() {\n return { x: this._x, y: this._y };\n },\n set: function set$$1(_ref3) {\n var x = _ref3.x,\n y = _ref3.y;\n\n this._x = x;\n this._y = y;\n this.updatePosition();\n }\n }, {\n key: \"translation\",\n get: function get$$1() {\n return {\n x: this._x + this._dx,\n y: this._y + this._dy\n };\n }\n }, {\n key: \"json\",\n get: function get$$1() {\n var json = {\n x: this._x,\n y: this._y,\n dx: this._dx,\n dy: this._dy\n };\n\n if (this.data && Object.keys(this.data).length > 0) json.data = this.data;\n if (this.type) json.type = this.type;\n if (this._className) json.className = this._className;\n\n if (Object.keys(this.connector).length > 0) json.connector = this.connector;\n if (Object.keys(this.subject).length > 0) json.subject = this.subject;\n if (Object.keys(this.note).length > 0) json.note = this.note;\n\n return json;\n }\n }]);\n return Annotation;\n}();\n\nvar AnnotationCollection = function () {\n function AnnotationCollection(_ref) {\n var annotations = _ref.annotations,\n accessors = _ref.accessors,\n accessorsInverse = _ref.accessorsInverse;\n classCallCheck(this, AnnotationCollection);\n\n this.accessors = accessors;\n this.accessorsInverse = accessorsInverse;\n this.annotations = annotations;\n }\n\n createClass(AnnotationCollection, [{\n key: \"clearTypes\",\n value: function clearTypes(newSettings) {\n this.annotations.forEach(function (d) {\n d.type = undefined;\n d.subject = newSettings && newSettings.subject || d.subject;\n d.connector = newSettings && newSettings.connector || d.connector;\n d.note = newSettings && newSettings.note || d.note;\n });\n }\n }, {\n key: \"setPositionWithAccessors\",\n value: function setPositionWithAccessors() {\n var _this = this;\n\n this.annotations.forEach(function (d) {\n d.type.setPositionWithAccessors(_this.accessors);\n });\n }\n }, {\n key: \"editMode\",\n value: function editMode(_editMode) {\n this.annotations.forEach(function (a) {\n if (a.type) {\n a.type.editMode = _editMode;\n a.type.updateEditMode();\n }\n });\n }\n }, {\n key: \"updateDisable\",\n value: function updateDisable(disable) {\n this.annotations.forEach(function (a) {\n a.disable = disable;\n if (a.type) {\n disable.forEach(function (d) {\n if (a.type[d]) {\n a.type[d].remove && a.type[d].remove();\n a.type[d] = undefined;\n }\n });\n }\n });\n }\n }, {\n key: \"updateTextWrap\",\n value: function updateTextWrap(textWrap) {\n this.annotations.forEach(function (a) {\n if (a.type && a.type.updateTextWrap) {\n a.type.updateTextWrap(textWrap);\n }\n });\n }\n }, {\n key: \"updateText\",\n value: function updateText() {\n this.annotations.forEach(function (a) {\n if (a.type && a.type.drawText) {\n a.type.drawText();\n }\n });\n }\n }, {\n key: \"updateNotePadding\",\n value: function updateNotePadding(notePadding) {\n this.annotations.forEach(function (a) {\n if (a.type) {\n a.type.notePadding = notePadding;\n }\n });\n }\n }, {\n key: \"json\",\n get: function get$$1() {\n var _this2 = this;\n\n return this.annotations.map(function (a) {\n var json = a.json;\n if (_this2.accessorsInverse && a.data) {\n json.data = {};\n Object.keys(_this2.accessorsInverse).forEach(function (k) {\n json.data[k] = _this2.accessorsInverse[k]({ x: a.x, y: a.y });\n\n //TODO make this feasible to map back to data for other types of subjects\n });\n }\n return json;\n });\n }\n }, {\n key: \"noteNodes\",\n get: function get$$1() {\n return this.annotations.map(function (a) {\n return _extends({}, a.type.getNoteBBoxOffset(), { positionX: a.x, positionY: a.y });\n });\n }\n\n //TODO: come back and rethink if a.x and a.y are applicable in all situations\n // get connectorNodes() {\n // return this.annotations.map(a => ({ ...a.type.getConnectorBBox(), startX: a.x, startY: a.y}))\n // }\n\n // get subjectNodes() {\n // return this.annotations.map(a => ({ ...a.type.getSubjectBBox(), startX: a.x, startY: a.y}))\n // }\n\n // get annotationNodes() {\n // return this.annotations.map(a => ({ ...a.type.getAnnotationBBox(), startX: a.x, startY: a.y}))\n // }\n\n }]);\n return AnnotationCollection;\n}();\n\nvar pointHandle = function pointHandle(_ref) {\n var _ref$cx = _ref.cx,\n cx = _ref$cx === undefined ? 0 : _ref$cx,\n _ref$cy = _ref.cy,\n cy = _ref$cy === undefined ? 0 : _ref$cy;\n\n return { move: { x: cx, y: cy } };\n};\n\nvar circleHandles = function circleHandles(_ref2) {\n var _ref2$cx = _ref2.cx,\n cx = _ref2$cx === undefined ? 0 : _ref2$cx,\n _ref2$cy = _ref2.cy,\n cy = _ref2$cy === undefined ? 0 : _ref2$cy,\n r1 = _ref2.r1,\n r2 = _ref2.r2,\n padding = _ref2.padding;\n\n var h = { move: { x: cx, y: cy } };\n\n if (r1 !== undefined) {\n h.r1 = { x: cx + r1 / Math.sqrt(2), y: cy + r1 / Math.sqrt(2) };\n }\n\n if (r2 !== undefined) {\n h.r2 = { x: cx + r2 / Math.sqrt(2), y: cy + r2 / Math.sqrt(2) };\n }\n\n if (padding !== undefined) {\n h.padding = { x: cx + r1 + padding, y: cy };\n }\n\n return h;\n};\n\n\n\n\n\n//arc handles\nvar addHandles = function addHandles(_ref5) {\n var group = _ref5.group,\n handles = _ref5.handles,\n _ref5$r = _ref5.r,\n r = _ref5$r === undefined ? 10 : _ref5$r;\n\n //give it a group and x,y to draw handles\n //then give it instructions on what the handles change\n var h = group.selectAll(\"circle.handle\").data(handles);\n\n h.enter().append(\"circle\").attr(\"class\", \"handle\").attr(\"fill\", \"grey\").attr(\"fill-opacity\", 0.1).attr(\"cursor\", \"move\").attr(\"stroke-dasharray\", 5).attr(\"stroke\", \"grey\").call(drag().container(select(\"g.annotations\").node()).on(\"start\", function (d) {\n return d.start && d.start(d);\n }).on(\"drag\", function (d) {\n return d.drag && d.drag(d);\n }).on(\"end\", function (d) {\n return d.end && d.end(d);\n }));\n\n group.selectAll(\"circle.handle\").attr(\"cx\", function (d) {\n return d.x;\n }).attr(\"cy\", function (d) {\n return d.y;\n }).attr(\"r\", function (d) {\n return d.r || r;\n }).attr(\"class\", function (d) {\n return \"handle \" + (d.className || \"\");\n });\n\n h.exit().remove();\n};\n\nvar leftRightDynamic = function leftRightDynamic(align, y) {\n if (align === \"dynamic\" || align === \"left\" || align === \"right\") {\n if (y < 0) {\n align = \"top\";\n } else {\n align = \"bottom\";\n }\n }\n return align;\n};\n\nvar topBottomDynamic = function topBottomDynamic(align, x) {\n if (align === \"dynamic\" || align === \"top\" || align === \"bottom\") {\n if (x < 0) {\n align = \"right\";\n } else {\n align = \"left\";\n }\n }\n return align;\n};\n\nvar orientationTopBottom = [\"topBottom\", \"top\", \"bottom\"];\nvar orientationLeftRight = [\"leftRight\", \"left\", \"right\"];\n\nvar noteAlignment = (function (_ref) {\n var _ref$padding = _ref.padding,\n padding = _ref$padding === undefined ? 0 : _ref$padding,\n _ref$bbox = _ref.bbox,\n bbox = _ref$bbox === undefined ? { x: 0, y: 0, width: 0, height: 0 } : _ref$bbox,\n align = _ref.align,\n orientation = _ref.orientation,\n _ref$offset = _ref.offset,\n offset = _ref$offset === undefined ? { x: 0, y: 0 } : _ref$offset;\n\n var x = -bbox.x;\n var y = 0; //-bbox.y\n if (orientationTopBottom.indexOf(orientation) !== -1) {\n align = topBottomDynamic(align, offset.x);\n if (offset.y < 0 && orientation === \"topBottom\" || orientation === \"top\") {\n y -= bbox.height + padding;\n } else {\n y += padding;\n }\n\n if (align === \"middle\") {\n x -= bbox.width / 2;\n } else if (align === \"right\") {\n x -= bbox.width;\n }\n } else if (orientationLeftRight.indexOf(orientation) !== -1) {\n align = leftRightDynamic(align, offset.y);\n if (offset.x < 0 && orientation === \"leftRight\" || orientation === \"left\") {\n x -= bbox.width + padding;\n } else {\n x += padding;\n }\n\n if (align === \"middle\") {\n y -= bbox.height / 2;\n } else if (align === \"top\") {\n y -= bbox.height;\n }\n }\n\n return { x: x, y: y };\n});\n\nvar lineBuilder = function lineBuilder(_ref) {\n var data = _ref.data,\n _ref$curve = _ref.curve,\n curve = _ref$curve === undefined ? curveLinear : _ref$curve,\n canvasContext = _ref.canvasContext,\n className = _ref.className,\n classID = _ref.classID;\n\n var lineGen = line().curve(curve);\n\n var builder = {\n type: 'path',\n className: className,\n classID: classID,\n data: data\n };\n\n if (canvasContext) {\n lineGen.context(canvasContext);\n builder.pathMethods = lineGen;\n } else {\n builder.attrs = {\n d: lineGen(data)\n };\n }\n\n return builder;\n};\n\nvar arcBuilder = function arcBuilder(_ref2) {\n var data = _ref2.data,\n canvasContext = _ref2.canvasContext,\n className = _ref2.className,\n classID = _ref2.classID;\n\n\n var builder = {\n type: 'path',\n className: className,\n classID: classID,\n data: data\n };\n\n var arcShape = arc().innerRadius(data.innerRadius || 0).outerRadius(data.outerRadius || data.radius || 2).startAngle(data.startAngle || 0).endAngle(data.endAngle || 2 * Math.PI);\n\n if (canvasContext) {\n arcShape.context(canvasContext);\n builder.pathMethods = lineGen;\n } else {\n\n builder.attrs = {\n d: arcShape()\n };\n }\n\n return builder;\n};\n\nvar noteVertical = (function (_ref) {\n var align = _ref.align,\n _ref$x = _ref.x,\n x = _ref$x === undefined ? 0 : _ref$x,\n _ref$y = _ref.y,\n y = _ref$y === undefined ? 0 : _ref$y,\n bbox = _ref.bbox,\n offset = _ref.offset;\n\n align = leftRightDynamic(align, offset.y);\n\n if (align === \"top\") {\n y -= bbox.height;\n } else if (align === \"middle\") {\n y -= bbox.height / 2;\n }\n\n var data = [[x, y], [x, y + bbox.height]];\n return { components: [lineBuilder({ data: data, className: \"note-line\" })] };\n});\n\nvar noteHorizontal = (function (_ref) {\n var align = _ref.align,\n _ref$x = _ref.x,\n x = _ref$x === undefined ? 0 : _ref$x,\n _ref$y = _ref.y,\n y = _ref$y === undefined ? 0 : _ref$y,\n offset = _ref.offset,\n bbox = _ref.bbox;\n\n align = topBottomDynamic(align, offset.x);\n\n if (align === \"right\") {\n x -= bbox.width;\n } else if (align === \"middle\") {\n x -= bbox.width / 2;\n }\n\n var data = [[x, y], [x + bbox.width, y]];\n return { components: [lineBuilder({ data: data, className: \"note-line\" })] };\n});\n\nvar lineSetup = function lineSetup(_ref) {\n var type = _ref.type,\n subjectType = _ref.subjectType;\n\n var annotation = type.annotation;\n var offset = annotation.position;\n\n var x1 = annotation.x - offset.x,\n x2 = x1 + annotation.dx,\n y1 = annotation.y - offset.y,\n y2 = y1 + annotation.dy;\n\n var subjectData = annotation.subject;\n\n if (subjectType === \"circle\" && (subjectData.outerRadius || subjectData.radius)) {\n var h = Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));\n var angle = Math.asin(-y2 / h);\n var r = subjectData.outerRadius || subjectData.radius + (subjectData.radiusPadding || 0);\n\n x1 = Math.abs(Math.cos(angle) * r) * (x2 < 0 ? -1 : 1);\n y1 = Math.abs(Math.sin(angle) * r) * (y2 < 0 ? -1 : 1);\n }\n\n if (subjectType === \"rect\") {\n var width = subjectData.width,\n height = subjectData.height;\n\n\n if (width > 0 && annotation.dx > 0 || width < 0 && annotation.dx < 0) {\n if (Math.abs(width) > Math.abs(annotation.dx)) x1 = width / 2;else x1 = width;\n }\n if (height > 0 && annotation.dy > 0 || height < 0 && annotation.dy < 0) {\n if (Math.abs(height) > Math.abs(annotation.dy)) y1 = height / 2;else y1 = height;\n }\n if (x1 === width / 2 && y1 === height / 2) {\n x1 = x2;y1 = y2;\n }\n }\n\n return [[x1, y1], [x2, y2]];\n};\n\nvar connectorLine = (function (connectorData) {\n var data = lineSetup(connectorData);\n return { components: [lineBuilder({ data: data, className: \"connector\" })] };\n});\n\nvar connectorElbow = (function (_ref) {\n var type = _ref.type,\n subjectType = _ref.subjectType;\n\n\n var annotation = type.annotation;\n var offset = annotation.position;\n\n var x1 = annotation.x - offset.x,\n x2 = x1 + annotation.dx,\n y1 = annotation.y - offset.y,\n y2 = y1 + annotation.dy;\n\n var subjectData = annotation.subject;\n\n if (subjectType === \"rect\") {\n var width = subjectData.width,\n height = subjectData.height;\n\n\n if (width > 0 && annotation.dx > 0 || width < 0 && annotation.dx < 0) {\n if (Math.abs(width) > Math.abs(annotation.dx)) x1 = width / 2;else x1 = width;\n }\n if (height > 0 && annotation.dy > 0 || height < 0 && annotation.dy < 0) {\n if (Math.abs(height) > Math.abs(annotation.dy)) y1 = height / 2;else y1 = height;\n }\n if (x1 === width / 2 && y1 === height / 2) {\n x1 = x2;y1 = y2;\n }\n }\n\n var data = [[x1, y1], [x2, y2]];\n\n var diffY = y2 - y1;\n var diffX = x2 - x1;\n var xe = x2;\n var ye = y2;\n var opposite = y2 < y1 && x2 > x1 || x2 < x1 && y2 > y1 ? -1 : 1;\n\n if (Math.abs(diffX) < Math.abs(diffY)) {\n xe = x2;\n ye = y1 + diffX * opposite;\n } else {\n ye = y2;\n xe = x1 + diffY * opposite;\n }\n\n if (subjectType === \"circle\" && (subjectData.outerRadius || subjectData.radius)) {\n var r = (subjectData.outerRadius || subjectData.radius) + (subjectData.radiusPadding || 0);\n var length = r / Math.sqrt(2);\n\n if (Math.abs(diffX) > length && Math.abs(diffY) > length) {\n x1 = length * (x2 < 0 ? -1 : 1);\n y1 = length * (y2 < 0 ? -1 : 1);\n data = [[x1, y1], [xe, ye], [x2, y2]];\n } else if (Math.abs(diffX) > Math.abs(diffY)) {\n var angle = Math.asin(-y2 / r);\n x1 = Math.abs(Math.cos(angle) * r) * (x2 < 0 ? -1 : 1);\n data = [[x1, y2], [x2, y2]];\n } else {\n var _angle = Math.acos(x2 / r);\n y1 = Math.abs(Math.sin(_angle) * r) * (y2 < 0 ? -1 : 1);\n data = [[x2, y1], [x2, y2]];\n }\n } else {\n data = [[x1, y1], [xe, ye], [x2, y2]];\n }\n\n return { components: [lineBuilder({ data: data, className: \"connector\" })] };\n});\n\nvar connectorCurve = (function (_ref) {\n var type = _ref.type,\n connectorData = _ref.connectorData,\n subjectType = _ref.subjectType;\n\n\n if (!connectorData) {\n connectorData = {};\n }\n if (!connectorData.points || typeof connectorData.points === \"number\") {\n connectorData.points = createPoints(type.annotation.offset, connectorData.points);\n }\n if (!connectorData.curve) {\n connectorData.curve = curveCatmullRom;\n }\n\n var handles = [];\n\n if (type.editMode) {\n var cHandles = connectorData.points.map(function (c, i) {\n return _extends({}, pointHandle({ cx: c[0], cy: c[1] }), { index: i });\n });\n\n var updatePoint = function updatePoint(index) {\n connectorData.points[index][0] += event.dx;\n connectorData.points[index][1] += event.dy;\n type.redrawConnector();\n };\n\n handles = type.mapHandles(cHandles.map(function (h) {\n return _extends({}, h.move, { drag: updatePoint.bind(type, h.index) });\n }));\n }\n\n var data = lineSetup({ type: type, subjectType: subjectType });\n data = [data[0]].concat(toConsumableArray(connectorData.points), [data[1]]);\n var components = [lineBuilder({ data: data, curve: connectorData.curve, className: \"connector\" })];\n\n return { components: components, handles: handles };\n});\n\nvar createPoints = function createPoints(offset) {\n var anchors = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;\n\n var diff = { x: offset.x / (anchors + 1), y: offset.y / (anchors + 1) };\n var p = [];\n\n var i = 1;\n for (; i <= anchors; i++) {\n p.push([diff.x * i + i % 2 * 20, diff.y * i - i % 2 * 20]);\n }\n return p;\n};\n\nvar connectorArrow = (function (_ref) {\n var annotation = _ref.annotation,\n start = _ref.start,\n end = _ref.end,\n _ref$scale = _ref.scale,\n scale = _ref$scale === undefined ? 1 : _ref$scale;\n\n var offset = annotation.position;\n if (!start) {\n start = [annotation.dx, annotation.dy];\n } else {\n start = [-end[0] + start[0], -end[1] + start[1]];\n }\n if (!end) {\n end = [annotation.x - offset.x, annotation.y - offset.y];\n }\n\n var x1 = end[0],\n y1 = end[1];\n\n var dx = start[0];\n var dy = start[1];\n\n var size = 10 * scale;\n var angleOffset = 16 / 180 * Math.PI;\n var angle = Math.atan(dy / dx);\n\n if (dx < 0) {\n angle += Math.PI;\n }\n\n var data = [[x1, y1], [Math.cos(angle + angleOffset) * size + x1, Math.sin(angle + angleOffset) * size + y1], [Math.cos(angle - angleOffset) * size + x1, Math.sin(angle - angleOffset) * size + y1], [x1, y1]];\n\n //TODO add in reverse\n // if (canvasContext.arrowReverse){\n // data = [[x1, y1],\n // [Math.cos(angle + angleOffset)*size, Math.sin(angle + angleOffset)*size],\n // [Math.cos(angle - angleOffset)*size, Math.sin(angle - angleOffset)*size],\n // [x1, y1]\n // ]\n // } else {\n // data = [[x1, y1],\n // [Math.cos(angle + angleOffset)*size, Math.sin(angle + angleOffset)*size],\n // [Math.cos(angle - angleOffset)*size, Math.sin(angle - angleOffset)*size],\n // [x1, y1]\n // ]\n // }\n\n return {\n components: [lineBuilder({\n data: data,\n className: \"connector-end connector-arrow\",\n classID: \"connector-end\"\n })]\n };\n});\n\nvar connectorDot = (function (_ref) {\n var line$$1 = _ref.line,\n _ref$scale = _ref.scale,\n scale = _ref$scale === undefined ? 1 : _ref$scale;\n\n var dot = arcBuilder({\n className: \"connector-end connector-dot\",\n classID: \"connector-end\",\n data: { radius: 3 * Math.sqrt(scale) }\n });\n dot.attrs.transform = \"translate(\" + line$$1.data[0][0] + \", \" + line$$1.data[0][1] + \")\";\n\n return { components: [dot] };\n});\n\nvar subjectCircle = (function (_ref) {\n var subjectData = _ref.subjectData,\n type = _ref.type;\n\n if (!subjectData.radius && !subjectData.outerRadius) {\n subjectData.radius = 20;\n }\n\n var handles = [];\n var c = arcBuilder({ data: subjectData, className: \"subject\" });\n if (type.editMode) {\n var h = circleHandles({\n r1: c.data.outerRadius || c.data.radius,\n r2: c.data.innerRadius,\n padding: subjectData.radiusPadding\n });\n\n var updateRadius = function updateRadius(attr) {\n var r = subjectData[attr] + event.dx * Math.sqrt(2);\n subjectData[attr] = r;\n type.redrawSubject();\n type.redrawConnector();\n };\n\n var cHandles = [_extends({}, h.r1, {\n drag: updateRadius.bind(type, subjectData.outerRadius !== undefined ? \"outerRadius\" : \"radius\")\n })];\n\n if (subjectData.innerRadius) {\n cHandles.push(_extends({}, h.r2, { drag: updateRadius.bind(type, \"innerRadius\") }));\n }\n handles = type.mapHandles(cHandles);\n }\n\n c.attrs[\"fill-opacity\"] = 0;\n\n return { components: [c], handles: handles };\n});\n\nvar subjectRect = (function (_ref) {\n var subjectData = _ref.subjectData,\n type = _ref.type;\n\n if (!subjectData.width) {\n subjectData.width = 100;\n }\n if (!subjectData.height) {\n subjectData.height = 100;\n }\n\n var handles = [];\n var width = subjectData.width,\n height = subjectData.height;\n\n\n var data = [[0, 0], [width, 0], [width, height], [0, height], [0, 0]];\n var rect = lineBuilder({ data: data, className: \"subject\" });\n\n if (type.editMode) {\n var updateWidth = function updateWidth() {\n subjectData.width = event.x;\n type.redrawSubject();\n type.redrawConnector();\n };\n\n var updateHeight = function updateHeight() {\n subjectData.height = event.y;\n type.redrawSubject();\n type.redrawConnector();\n };\n\n var rHandles = [{ x: width, y: height / 2, drag: updateWidth.bind(type) }, { x: width / 2, y: height, drag: updateHeight.bind(type) }];\n\n handles = type.mapHandles(rHandles);\n }\n rect.attrs[\"fill-opacity\"] = 0.1;\n return { components: [rect], handles: handles };\n});\n\nvar subjectThreshold = (function (_ref) {\n var subjectData = _ref.subjectData,\n type = _ref.type;\n\n var offset = type.annotation.position;\n\n var x1 = (subjectData.x1 !== undefined ? subjectData.x1 : offset.x) - offset.x,\n x2 = (subjectData.x2 !== undefined ? subjectData.x2 : offset.x) - offset.x,\n y1 = (subjectData.y1 !== undefined ? subjectData.y1 : offset.y) - offset.y,\n y2 = (subjectData.y2 !== undefined ? subjectData.y2 : offset.y) - offset.y;\n\n var data = [[x1, y1], [x2, y2]];\n return { components: [lineBuilder({ data: data, className: 'subject' })] };\n});\n\nvar subjectBadge = (function (_ref) {\n var _ref$subjectData = _ref.subjectData,\n subjectData = _ref$subjectData === undefined ? {} : _ref$subjectData,\n _ref$type = _ref.type,\n type = _ref$type === undefined ? {} : _ref$type;\n var annotation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var typeSettings = type.typeSettings && type.typeSettings.subject;\n\n if (!subjectData.radius) {\n if (typeSettings && typeSettings.radius) {\n subjectData.radius = typeSettings.radius;\n } else {\n subjectData.radius = 14;\n }\n }\n if (!subjectData.x) {\n if (typeSettings && typeSettings.x) {\n subjectData.x = typeSettings.x;\n }\n }\n if (!subjectData.y) {\n if (typeSettings && typeSettings.y) {\n subjectData.y = typeSettings.y;\n }\n }\n\n var handles = [];\n var components = [];\n var radius = subjectData.radius;\n var innerRadius = radius * 0.7;\n var x = 0;\n var y = 0;\n\n var notCornerOffset = Math.sqrt(2) * radius;\n var placement = {\n xleftcorner: -radius,\n xrightcorner: radius,\n ytopcorner: -radius,\n ybottomcorner: radius,\n xleft: -notCornerOffset,\n xright: notCornerOffset,\n ytop: -notCornerOffset,\n ybottom: notCornerOffset\n };\n\n if (subjectData.x && !subjectData.y) {\n x = placement[\"x\" + subjectData.x];\n } else if (subjectData.y && !subjectData.x) {\n y = placement[\"y\" + subjectData.y];\n } else if (subjectData.x && subjectData.y) {\n x = placement[\"x\" + subjectData.x + \"corner\"];\n y = placement[\"y\" + subjectData.y + \"corner\"];\n }\n\n var transform = \"translate(\" + x + \", \" + y + \")\";\n var circlebg = arcBuilder({ className: \"subject\", data: { radius: radius } });\n circlebg.attrs.transform = transform;\n circlebg.attrs.fill = annotation.color;\n circlebg.attrs[\"stroke-linecap\"] = \"round\";\n circlebg.attrs[\"stroke-width\"] = \"3px\";\n\n var circle = arcBuilder({\n className: \"subject-ring\",\n data: { outerRadius: radius, innerRadius: innerRadius }\n });\n\n circle.attrs.transform = transform;\n // circle.attrs.fill = annotation.color\n circle.attrs[\"stroke-width\"] = \"3px\";\n circle.attrs.fill = \"white\";\n\n var pointer = void 0;\n if (x && y || !x && !y) {\n pointer = lineBuilder({\n className: \"subject-pointer\",\n data: [[0, 0], [x || 0, 0], [0, y || 0], [0, 0]]\n });\n } else if (x || y) {\n var notCornerPointerXY = function notCornerPointerXY(v) {\n var sign = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n return v && v / Math.sqrt(2) / Math.sqrt(2) || sign * radius / Math.sqrt(2);\n };\n\n pointer = lineBuilder({\n className: \"subject-pointer\",\n data: [[0, 0], [notCornerPointerXY(x), notCornerPointerXY(y)], [notCornerPointerXY(x, -1), notCornerPointerXY(y, -1)], [0, 0]]\n });\n }\n\n if (pointer) {\n pointer.attrs.fill = annotation.color;\n pointer.attrs[\"stroke-linecap\"] = \"round\";\n pointer.attrs[\"stroke-width\"] = \"3px\";\n components.push(pointer);\n }\n\n if (type.editMode) {\n var dragBadge = function dragBadge() {\n subjectData.x = event.x < -radius * 2 ? \"left\" : event.x > radius * 2 ? \"right\" : undefined;\n subjectData.y = event.y < -radius * 2 ? \"top\" : event.y > radius * 2 ? \"bottom\" : undefined;\n\n type.redrawSubject();\n };\n\n var bHandles = { x: x * 2, y: y * 2, drag: dragBadge.bind(type) };\n if (!bHandles.x && !bHandles.y) {\n bHandles.y = -radius;\n }\n\n handles = type.mapHandles([bHandles]);\n }\n\n var text = void 0;\n if (subjectData.text) {\n text = {\n type: \"text\",\n className: \"badge-text\",\n attrs: {\n fill: \"white\",\n stroke: \"none\",\n \"font-size\": \".7em\",\n text: subjectData.text,\n \"text-anchor\": \"middle\",\n dy: \".25em\",\n x: x,\n y: y\n }\n };\n }\n\n components.push(circlebg);\n components.push(circle);\n components.push(text);\n\n return { components: components, handles: handles };\n});\n\n//Note options\n//Connector options\n//Subject options\nvar Type = function () {\n function Type(_ref) {\n var a = _ref.a,\n annotation = _ref.annotation,\n editMode = _ref.editMode,\n dispatcher = _ref.dispatcher,\n notePadding = _ref.notePadding,\n accessors = _ref.accessors;\n classCallCheck(this, Type);\n\n this.a = a;\n\n this.note = annotation.disable.indexOf(\"note\") === -1 && a.select(\"g.annotation-note\");\n this.noteContent = this.note && a.select(\"g.annotation-note-content\");\n this.connector = annotation.disable.indexOf(\"connector\") === -1 && a.select(\"g.annotation-connector\");\n this.subject = annotation.disable.indexOf(\"subject\") === -1 && a.select(\"g.annotation-subject\");\n this.dispatcher = dispatcher;\n\n if (dispatcher) {\n var handler = addHandlers.bind(null, dispatcher, annotation);\n handler({ component: this.note, name: \"note\" });\n handler({ component: this.connector, name: \"connector\" });\n handler({ component: this.subject, name: \"subject\" });\n }\n\n this.annotation = annotation;\n this.editMode = annotation.editMode || editMode;\n this.notePadding = notePadding !== undefined ? notePadding : 3;\n this.offsetCornerX = 0;\n this.offsetCornerY = 0;\n\n if (accessors && annotation.data) {\n this.init(accessors);\n }\n }\n\n createClass(Type, [{\n key: \"init\",\n value: function init(accessors) {\n if (!this.annotation.x) {\n this.mapX(accessors);\n }\n if (!this.annotation.y) {\n this.mapY(accessors);\n }\n }\n }, {\n key: \"mapY\",\n value: function mapY(accessors) {\n if (accessors.y) {\n this.annotation.y = accessors.y(this.annotation.data);\n }\n }\n }, {\n key: \"mapX\",\n value: function mapX(accessors) {\n if (accessors.x) {\n this.annotation.x = accessors.x(this.annotation.data);\n }\n }\n }, {\n key: \"updateEditMode\",\n value: function updateEditMode() {\n this.a.selectAll(\"circle.handle\").remove();\n }\n }, {\n key: \"drawOnSVG\",\n value: function drawOnSVG(component, builders) {\n var _this = this;\n\n if (!Array.isArray(builders)) {\n builders = [builders];\n }\n\n builders.filter(function (b) {\n return b;\n }).forEach(function (_ref2) {\n var type = _ref2.type,\n className = _ref2.className,\n attrs = _ref2.attrs,\n handles = _ref2.handles,\n classID = _ref2.classID;\n\n if (type === \"handle\") {\n addHandles({ group: component, r: attrs && attrs.r, handles: handles });\n } else {\n newWithClass(component, [_this.annotation], type, className, classID);\n var el = component.select(type + \".\" + (classID || className));\n var addAttrs = Object.keys(attrs);\n var removeAttrs = [];\n\n var currentAttrs = el.node().attributes;\n for (var i = currentAttrs.length - 1; i >= 0; i--) {\n var name = currentAttrs[i].name;\n if (addAttrs.indexOf(name) === -1 && name !== \"class\") removeAttrs.push(name);\n }\n\n addAttrs.forEach(function (attr) {\n if (attr === \"text\") {\n el.text(attrs[attr]);\n } else {\n el.attr(attr, attrs[attr]);\n }\n });\n\n removeAttrs.forEach(function (attr) {\n return el.attr(attr, null);\n });\n }\n });\n }\n\n //TODO: how to extend this to a drawOnCanvas mode?\n\n }, {\n key: \"getNoteBBox\",\n value: function getNoteBBox() {\n return bboxWithoutHandles(this.note, \".annotation-note-content text\");\n }\n }, {\n key: \"getNoteBBoxOffset\",\n value: function getNoteBBoxOffset() {\n var bbox = bboxWithoutHandles(this.note, \".annotation-note-content\");\n var transform = this.noteContent.attr(\"transform\").split(/\\(|\\,|\\)/g);\n bbox.offsetCornerX = parseFloat(transform[1]) + this.annotation.dx;\n bbox.offsetCornerY = parseFloat(transform[2]) + this.annotation.dy;\n bbox.offsetX = this.annotation.dx;\n bbox.offsetY = this.annotation.dy;\n return bbox;\n }\n }, {\n key: \"drawSubject\",\n value: function drawSubject() {\n var _this2 = this;\n\n var context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n var subjectData = this.annotation.subject;\n var type = context.type;\n var subjectParams = { type: this, subjectData: subjectData };\n\n var subject = {};\n if (type === \"circle\") subject = subjectCircle(subjectParams);else if (type === \"rect\") subject = subjectRect(subjectParams);else if (type === \"threshold\") subject = subjectThreshold(subjectParams);else if (type === \"badge\") subject = subjectBadge(subjectParams, this.annotation);\n\n var _subject = subject,\n _subject$components = _subject.components,\n components = _subject$components === undefined ? [] : _subject$components,\n _subject$handles = _subject.handles,\n handles = _subject$handles === undefined ? [] : _subject$handles;\n\n components.forEach(function (c) {\n if (c && c.attrs && !c.attrs.stroke) {\n c.attrs.stroke = _this2.annotation.color;\n }\n });\n\n if (this.editMode) {\n handles = handles.concat(this.mapHandles([{ drag: this.dragSubject.bind(this) }]));\n components.push({ type: \"handle\", handles: handles });\n }\n\n return components;\n }\n }, {\n key: \"drawConnector\",\n value: function drawConnector() {\n var _this3 = this;\n\n var context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n var connectorData = this.annotation.connector;\n var type = connectorData.type || context.type;\n var connectorParams = { type: this, connectorData: connectorData };\n connectorParams.subjectType = this.typeSettings && this.typeSettings.subject && this.typeSettings.subject.type;\n\n var connector = {};\n if (type === \"curve\") connector = connectorCurve(connectorParams);else if (type === \"elbow\") connector = connectorElbow(connectorParams);else connector = connectorLine(connectorParams);\n var _connector = connector,\n _connector$components = _connector.components,\n components = _connector$components === undefined ? [] : _connector$components,\n _connector$handles = _connector.handles,\n handles = _connector$handles === undefined ? [] : _connector$handles;\n\n var line$$1 = components[0];\n //TODO: genericize this into fill t/f stroke t/f\n if (line$$1) {\n line$$1.attrs.stroke = this.annotation.color;\n line$$1.attrs.fill = \"none\";\n }\n var endType = connectorData.end || context.end;\n var end = {};\n if (endType === \"arrow\") {\n var s = line$$1.data[1];\n var e = line$$1.data[0];\n var distance = Math.sqrt(Math.pow(s[0] - e[0], 2) + Math.pow(s[1] - e[1], 2));\n if (distance < 5 && line$$1.data[2]) {\n s = line$$1.data[2];\n }\n end = connectorArrow({\n annotation: this.annotation,\n start: s,\n end: e,\n scale: connectorData.endScale\n });\n } else if (endType === \"dot\") {\n end = connectorDot({ line: line$$1, scale: connectorData.endScale });\n } else if (!endType || endType === \"none\") {\n this.connector && this.connector.select(\".connector-end\").remove();\n }\n\n if (end.components) {\n end.components.forEach(function (c) {\n c.attrs.fill = _this3.annotation.color;\n c.attrs.stroke = _this3.annotation.color;\n });\n components = components.concat(end.components);\n }\n\n if (this.editMode) {\n if (handles.length !== 0) components.push({ type: \"handle\", handles: handles });\n }\n return components;\n }\n }, {\n key: \"drawNote\",\n value: function drawNote() {\n var _this4 = this;\n\n var context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n var noteData = this.annotation.note;\n var align = noteData.align || context.align || \"dynamic\";\n var noteParams = {\n bbox: context.bbox,\n align: align,\n offset: this.annotation.offset\n };\n var lineType = noteData.lineType || context.lineType;\n var note = {};\n if (lineType === \"vertical\") note = noteVertical(noteParams);else if (lineType === \"horizontal\") note = noteHorizontal(noteParams);\n\n var _note = note,\n _note$components = _note.components,\n components = _note$components === undefined ? [] : _note$components,\n _note$handles = _note.handles,\n handles = _note$handles === undefined ? [] : _note$handles;\n\n components.forEach(function (c) {\n c.attrs.stroke = _this4.annotation.color;\n });\n\n if (this.editMode) {\n handles = this.mapHandles([{ x: 0, y: 0, drag: this.dragNote.bind(this) }]);\n components.push({ type: \"handle\", handles: handles });\n\n var dragging = this.dragNote.bind(this),\n start = this.dragstarted.bind(this),\n end = this.dragended.bind(this);\n this.note.call(drag().container(select(\"g.annotations\").node()).on(\"start\", function (d) {\n return start(d);\n }).on(\"drag\", function (d) {\n return dragging(d);\n }).on(\"end\", function (d) {\n return end(d);\n }));\n } else {\n this.note.on(\"mousedown.drag\", null);\n }\n return components;\n }\n }, {\n key: \"drawNoteContent\",\n value: function drawNoteContent(context) {\n var noteData = this.annotation.note;\n var padding = noteData.padding !== undefined ? noteData.padding : this.notePadding;\n var orientation = noteData.orientation || context.orientation || \"topBottom\";\n var lineType = noteData.lineType || context.lineType;\n var align = noteData.align || context.align || \"dynamic\";\n\n if (lineType === \"vertical\") orientation = \"leftRight\";else if (lineType === \"horizontal\") orientation = \"topBottom\";\n\n var noteParams = {\n padding: padding,\n bbox: context.bbox,\n offset: this.annotation.offset,\n orientation: orientation,\n align: align\n };\n\n var _noteAlignment = noteAlignment(noteParams),\n x = _noteAlignment.x,\n y = _noteAlignment.y;\n\n this.offsetCornerX = x + this.annotation.dx;\n this.offsetCornerY = y + this.annotation.dy;\n this.note && this.noteContent.attr(\"transform\", \"translate(\" + x + \", \" + y + \")\");\n\n return [];\n }\n }, {\n key: \"drawOnScreen\",\n value: function drawOnScreen(component, drawFunction) {\n return this.drawOnSVG(component, drawFunction);\n }\n }, {\n key: \"redrawSubject\",\n value: function redrawSubject() {\n this.subject && this.drawOnScreen(this.subject, this.drawSubject());\n }\n }, {\n key: \"redrawConnector\",\n value: function redrawConnector() {\n this.connector && this.drawOnScreen(this.connector, this.drawConnector());\n }\n }, {\n key: \"redrawNote\",\n value: function redrawNote() {\n var bbox = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getNoteBBox();\n\n this.noteContent && this.drawOnScreen(this.noteContent, this.drawNoteContent({ bbox: bbox }));\n this.note && this.drawOnScreen(this.note, this.drawNote({ bbox: bbox }));\n }\n }, {\n key: \"setPosition\",\n value: function setPosition() {\n var position = this.annotation.position;\n this.a.attr(\"transform\", \"translate(\" + position.x + \", \" + position.y + \")\");\n }\n }, {\n key: \"clearComponents\",\n value: function clearComponents() {\n this.subject && this.subject.select(\"*\").remove();\n this.connector && this.connector.select(\"*\").remove();\n // this.note && this.note.select(\"*\").remove()\n }\n }, {\n key: \"setOffset\",\n value: function setOffset() {\n if (this.note) {\n var offset = this.annotation.offset;\n this.note.attr(\"transform\", \"translate(\" + offset.x + \", \" + offset.y + \")\");\n }\n }\n }, {\n key: \"setPositionWithAccessors\",\n value: function setPositionWithAccessors(accessors) {\n if (accessors && this.annotation.data) {\n this.mapX(accessors);\n this.mapY(accessors);\n }\n this.setPosition();\n }\n }, {\n key: \"setClassName\",\n value: function setClassName() {\n this.a.attr(\"class\", \"annotation \" + (this.className && this.className()) + \" \" + (this.editMode ? \"editable\" : \"\") + \" \" + (this.annotation.className || \"\"));\n }\n }, {\n key: \"draw\",\n value: function draw() {\n this.setClassName();\n this.setPosition();\n this.setOffset();\n this.redrawSubject();\n this.redrawConnector();\n this.redrawNote();\n }\n }, {\n key: \"dragstarted\",\n value: function dragstarted() {\n event.sourceEvent.stopPropagation();\n this.dispatcher && this.dispatcher.call(\"dragstart\", this.a, this.annotation);\n this.a.classed(\"dragging\", true);\n this.a.selectAll(\"circle.handle\").style(\"pointer-events\", \"none\");\n }\n }, {\n key: \"dragended\",\n value: function dragended() {\n this.dispatcher && this.dispatcher.call(\"dragend\", this.a, this.annotation);\n this.a.classed(\"dragging\", false);\n this.a.selectAll(\"circle.handle\").style(\"pointer-events\", \"all\");\n }\n }, {\n key: \"dragSubject\",\n value: function dragSubject() {\n var position = this.annotation.position;\n position.x += event.dx;\n position.y += event.dy;\n this.annotation.position = position;\n }\n }, {\n key: \"dragNote\",\n value: function dragNote() {\n var offset = this.annotation.offset;\n offset.x += event.dx;\n offset.y += event.dy;\n this.annotation.offset = offset;\n }\n }, {\n key: \"mapHandles\",\n value: function mapHandles(handles) {\n var _this5 = this;\n\n return handles.map(function (h) {\n return _extends({}, h, {\n start: _this5.dragstarted.bind(_this5),\n end: _this5.dragended.bind(_this5)\n });\n });\n }\n }]);\n return Type;\n}();\n\nvar customType = function customType(initialType, typeSettings, _init) {\n return function (_initialType) {\n inherits(customType, _initialType);\n\n function customType(settings) {\n classCallCheck(this, customType);\n\n var _this6 = possibleConstructorReturn(this, (customType.__proto__ || Object.getPrototypeOf(customType)).call(this, settings));\n\n _this6.typeSettings = typeSettings;\n\n if (typeSettings.disable) {\n typeSettings.disable.forEach(function (d) {\n _this6[d] && _this6[d].remove();\n\n _this6[d] = undefined;\n if (d === \"note\") {\n _this6.noteContent = undefined;\n }\n });\n }\n return _this6;\n }\n\n createClass(customType, [{\n key: \"className\",\n value: function className() {\n return \"\" + (typeSettings.className || get(customType.prototype.__proto__ || Object.getPrototypeOf(customType.prototype), \"className\", this) && get(customType.prototype.__proto__ || Object.getPrototypeOf(customType.prototype), \"className\", this).call(this) || \"\");\n }\n }, {\n key: \"drawSubject\",\n value: function drawSubject(context) {\n this.typeSettings.subject = _extends({}, typeSettings.subject, this.typeSettings.subject);\n return get(customType.prototype.__proto__ || Object.getPrototypeOf(customType.prototype), \"drawSubject\", this).call(this, _extends({}, context, this.typeSettings.subject));\n }\n }, {\n key: \"drawConnector\",\n value: function drawConnector(context) {\n this.typeSettings.connector = _extends({}, typeSettings.connector, this.typeSettings.connector);\n return get(customType.prototype.__proto__ || Object.getPrototypeOf(customType.prototype), \"drawConnector\", this).call(this, _extends({}, context, typeSettings.connector, this.typeSettings.connector));\n }\n }, {\n key: \"drawNote\",\n value: function drawNote(context) {\n this.typeSettings.note = _extends({}, typeSettings.note, this.typeSettings.note);\n return get(customType.prototype.__proto__ || Object.getPrototypeOf(customType.prototype), \"drawNote\", this).call(this, _extends({}, context, typeSettings.note, this.typeSettings.note));\n }\n }, {\n key: \"drawNoteContent\",\n value: function drawNoteContent(context) {\n return get(customType.prototype.__proto__ || Object.getPrototypeOf(customType.prototype), \"drawNoteContent\", this).call(this, _extends({}, context, typeSettings.note, this.typeSettings.note));\n }\n }], [{\n key: \"init\",\n value: function init(annotation, accessors) {\n get(customType.__proto__ || Object.getPrototypeOf(customType), \"init\", this).call(this, annotation, accessors);\n if (_init) {\n annotation = _init(annotation, accessors);\n }\n return annotation;\n }\n }]);\n return customType;\n }(initialType);\n};\n\nvar d3NoteText = function (_Type) {\n inherits(d3NoteText, _Type);\n\n function d3NoteText(params) {\n classCallCheck(this, d3NoteText);\n\n var _this7 = possibleConstructorReturn(this, (d3NoteText.__proto__ || Object.getPrototypeOf(d3NoteText)).call(this, params));\n\n _this7.textWrap = params.textWrap || 120;\n _this7.drawText();\n return _this7;\n }\n\n createClass(d3NoteText, [{\n key: \"updateTextWrap\",\n value: function updateTextWrap(textWrap) {\n this.textWrap = textWrap;\n this.drawText();\n }\n\n //TODO: add update text functionality\n\n }, {\n key: \"drawText\",\n value: function drawText() {\n if (this.note) {\n newWithClass(this.note, [this.annotation], \"g\", \"annotation-note-content\");\n\n var noteContent = this.note.select(\"g.annotation-note-content\");\n newWithClass(noteContent, [this.annotation], \"rect\", \"annotation-note-bg\");\n newWithClass(noteContent, [this.annotation], \"text\", \"annotation-note-label\");\n newWithClass(noteContent, [this.annotation], \"text\", \"annotation-note-title\");\n\n var titleBBox = { height: 0 };\n var label = this.a.select(\"text.annotation-note-label\");\n var wrapLength = this.annotation.note && this.annotation.note.wrap || this.typeSettings && this.typeSettings.note && this.typeSettings.note.wrap || this.textWrap;\n\n var wrapSplitter = this.annotation.note && this.annotation.note.wrapSplitter || this.typeSettings && this.typeSettings.note && this.typeSettings.note.wrapSplitter;\n\n var bgPadding = this.annotation.note && this.annotation.note.bgPadding || this.typeSettings && this.typeSettings.note && this.typeSettings.note.bgPadding;\n\n var bgPaddingFinal = { top: 0, bottom: 0, left: 0, right: 0 };\n if (typeof bgPadding === \"number\") {\n bgPaddingFinal = {\n top: bgPadding,\n bottom: bgPadding,\n left: bgPadding,\n right: bgPadding\n };\n } else if (bgPadding && (typeof bgPadding === \"undefined\" ? \"undefined\" : _typeof(bgPadding)) === \"object\") {\n bgPaddingFinal = _extends(bgPaddingFinal, bgPadding);\n }\n\n if (this.annotation.note.title) {\n var title = this.a.select(\"text.annotation-note-title\");\n title.text(this.annotation.note.title);\n title.attr(\"fill\", this.annotation.color);\n title.attr(\"font-weight\", \"bold\");\n title.call(wrap, wrapLength, wrapSplitter);\n titleBBox = title.node().getBBox();\n }\n\n label.text(this.annotation.note.label).attr(\"dx\", \"0\");\n label.call(wrap, wrapLength, wrapSplitter);\n\n label.attr(\"y\", titleBBox.height * 1.1 || 0);\n label.attr(\"fill\", this.annotation.color);\n\n var bbox = this.getNoteBBox();\n\n this.a.select(\"rect.annotation-note-bg\").attr(\"width\", bbox.width + bgPaddingFinal.left + bgPaddingFinal.right).attr(\"height\", bbox.height + bgPaddingFinal.top + bgPaddingFinal.bottom).attr(\"x\", bbox.x - bgPaddingFinal.left).attr(\"y\", -bgPaddingFinal.top).attr(\"fill\", \"white\").attr(\"fill-opacity\", 0);\n }\n }\n }]);\n return d3NoteText;\n}(Type);\n\nvar d3Label = customType(d3NoteText, {\n className: \"label\",\n note: { align: \"middle\" }\n});\n\nvar d3Callout = customType(d3NoteText, {\n className: \"callout\",\n note: { lineType: \"horizontal\" }\n});\n\nvar d3CalloutElbow = customType(d3Callout, {\n className: \"callout elbow\",\n connector: { type: \"elbow\" }\n});\n\nvar d3CalloutCurve = customType(d3Callout, {\n className: \"callout curve\",\n connector: { type: \"curve\" }\n});\n\nvar d3Badge = customType(Type, {\n className: \"badge\",\n subject: { type: \"badge\" },\n disable: [\"connector\", \"note\"]\n});\n\nvar d3CalloutCircle = customType(d3NoteText, {\n className: \"callout circle\",\n subject: { type: \"circle\" },\n note: { lineType: \"horizontal\" },\n connector: { type: \"elbow\" }\n});\n\nvar d3CalloutRect = customType(d3NoteText, {\n className: \"callout rect\",\n subject: { type: \"rect\" },\n note: { lineType: \"horizontal\" },\n connector: { type: \"elbow\" }\n});\n\nvar ThresholdMap = function (_d3Callout) {\n inherits(ThresholdMap, _d3Callout);\n\n function ThresholdMap() {\n classCallCheck(this, ThresholdMap);\n return possibleConstructorReturn(this, (ThresholdMap.__proto__ || Object.getPrototypeOf(ThresholdMap)).apply(this, arguments));\n }\n\n createClass(ThresholdMap, [{\n key: \"mapY\",\n value: function mapY(accessors) {\n get(ThresholdMap.prototype.__proto__ || Object.getPrototypeOf(ThresholdMap.prototype), \"mapY\", this).call(this, accessors);\n var a = this.annotation;\n if ((a.subject.x1 || a.subject.x2) && a.data && accessors.y) {\n a.y = accessors.y(a.data);\n }\n if ((a.subject.x1 || a.subject.x2) && !a.x) {\n a.x = a.subject.x1 || a.subject.x2;\n }\n }\n }, {\n key: \"mapX\",\n value: function mapX(accessors) {\n get(ThresholdMap.prototype.__proto__ || Object.getPrototypeOf(ThresholdMap.prototype), \"mapX\", this).call(this, accessors);\n var a = this.annotation;\n if ((a.subject.y1 || a.subject.y2) && a.data && accessors.x) {\n a.x = accessors.x(a.data);\n }\n if ((a.subject.y1 || a.subject.y2) && !a.y) {\n a.y = a.subject.y1 || a.subject.y2;\n }\n }\n }]);\n return ThresholdMap;\n}(d3Callout);\n\nvar d3XYThreshold = customType(ThresholdMap, {\n className: \"callout xythreshold\",\n subject: { type: \"threshold\" }\n});\n\nvar newWithClass = function newWithClass(a, d, type, className, classID) {\n var group = a.selectAll(type + \".\" + (classID || className)).data(d);\n group.enter().append(type).merge(group).attr(\"class\", className);\n\n group.exit().remove();\n return a;\n};\n\nvar addHandlers = function addHandlers(dispatcher, annotation, _ref3) {\n var component = _ref3.component,\n name = _ref3.name;\n\n if (component) {\n component.on(\"mouseover.annotations\", function () {\n dispatcher.call(name + \"over\", component, annotation);\n }).on(\"mouseout.annotations\", function () {\n return dispatcher.call(name + \"out\", component, annotation);\n }).on(\"click.annotations\", function () {\n return dispatcher.call(name + \"click\", component, annotation);\n });\n }\n};\n\n//Text wrapping code adapted from Mike Bostock\nvar wrap = function wrap(text, width, wrapSplitter) {\n var lineHeight = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1.2;\n\n text.each(function () {\n var text = select(this),\n words = text.text().split(wrapSplitter || /[ \\t\\r\\n]+/).reverse().filter(function (w) {\n return w !== \"\";\n });\n var word = void 0,\n line$$1 = [],\n tspan = text.text(null).append(\"tspan\").attr(\"x\", 0).attr(\"dy\", 0.8 + \"em\");\n\n while (word = words.pop()) {\n line$$1.push(word);\n tspan.text(line$$1.join(\" \"));\n if (tspan.node().getComputedTextLength() > width && line$$1.length > 1) {\n line$$1.pop();\n tspan.text(line$$1.join(\" \"));\n line$$1 = [word];\n tspan = text.append(\"tspan\").attr(\"x\", 0).attr(\"dy\", lineHeight + \"em\").text(word);\n }\n }\n });\n};\n\nvar bboxWithoutHandles = function bboxWithoutHandles(selection) {\n var selector = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : \":not(.handle)\";\n\n if (!selection) {\n return { x: 0, y: 0, width: 0, height: 0 };\n }\n\n return selection.selectAll(selector).nodes().reduce(function (p, c) {\n var bbox = c.getBBox();\n p.x = Math.min(p.x, bbox.x);\n p.y = Math.min(p.y, bbox.y);\n p.width = Math.max(p.width, bbox.width);\n\n var yOffset = c && c.attributes && c.attributes.y;\n p.height = Math.max(p.height, (yOffset && parseFloat(yOffset.value) || 0) + bbox.height);\n return p;\n }, { x: 0, y: 0, width: 0, height: 0 });\n};\n\nfunction annotation() {\n var annotations = [],\n collection = void 0,\n context = void 0,\n //TODO: add canvas functionality\n disable = [],\n accessors = {},\n accessorsInverse = {},\n editMode = false,\n ids = void 0,\n type = d3Callout,\n textWrap = void 0,\n notePadding = void 0,\n annotationDispatcher = dispatch(\"subjectover\", \"subjectout\", \"subjectclick\", \"connectorover\", \"connectorout\", \"connectorclick\", \"noteover\", \"noteout\", \"noteclick\", \"dragend\", \"dragstart\"),\n sel = void 0;\n\n var annotation = function annotation(selection) {\n sel = selection;\n //TODO: check to see if this is still needed\n if (!editMode) {\n selection.selectAll(\"circle.handle\").remove();\n }\n\n var translatedAnnotations = annotations.map(function (a) {\n if (!a.type) {\n a.type = type;\n }\n if (!a.disable) {\n a.disable = disable;\n }\n return new Annotation(a);\n });\n\n collection = collection || new AnnotationCollection({\n annotations: translatedAnnotations,\n accessors: accessors,\n accessorsInverse: accessorsInverse,\n ids: ids\n });\n\n var annotationG = selection.selectAll(\"g\").data([collection]);\n annotationG.enter().append(\"g\").attr(\"class\", \"annotations\");\n\n var group = selection.select(\"g.annotations\");\n newWithClass(group, collection.annotations, \"g\", \"annotation\");\n\n var annotation = group.selectAll(\"g.annotation\");\n\n annotation.each(function (d) {\n var a = select(this);\n\n a.attr(\"class\", \"annotation\");\n\n newWithClass(a, [d], \"g\", \"annotation-connector\");\n newWithClass(a, [d], \"g\", \"annotation-subject\");\n newWithClass(a, [d], \"g\", \"annotation-note\");\n newWithClass(a.select(\"g.annotation-note\"), [d], \"g\", \"annotation-note-content\");\n d.type = d.type.toString() === \"[object Object]\" ? d.type : new d.type({\n a: a,\n annotation: d,\n textWrap: textWrap,\n notePadding: notePadding,\n editMode: editMode,\n dispatcher: annotationDispatcher,\n accessors: accessors\n });\n d.type.draw();\n d.type.drawText && d.type.drawText();\n });\n };\n\n annotation.json = function () {\n /* eslint-disable no-console */\n console.log(\"Annotations JSON was copied to your clipboard. Please note the annotation type is not JSON compatible. It appears in the objects array in the console, but not in the copied JSON.\", collection.json);\n /* eslint-enable no-console */\n window.copy(JSON.stringify(collection.json.map(function (a) {\n delete a.type;\n return a;\n })));\n return annotation;\n };\n\n annotation.update = function () {\n if (annotations && collection) {\n annotations = collection.annotations.map(function (a) {\n a.type.draw();\n return a;\n });\n }\n return annotation;\n };\n\n annotation.updateText = function () {\n if (collection) {\n collection.updateText(textWrap);\n annotations = collection.annotations;\n }\n return annotation;\n };\n\n annotation.updatedAccessors = function () {\n collection.setPositionWithAccessors();\n annotations = collection.annotations;\n return annotation;\n };\n\n annotation.disable = function (_) {\n if (!arguments.length) return disable;\n disable = _;\n if (collection) {\n collection.updateDisable(disable);\n annotations = collection.annotations;\n }\n return annotation;\n };\n\n annotation.textWrap = function (_) {\n if (!arguments.length) return textWrap;\n textWrap = _;\n if (collection) {\n collection.updateTextWrap(textWrap);\n annotations = collection.annotations;\n }\n return annotation;\n };\n\n annotation.notePadding = function (_) {\n if (!arguments.length) return notePadding;\n notePadding = _;\n if (collection) {\n collection.updateNotePadding(notePadding);\n annotations = collection.annotations;\n }\n return annotation;\n };\n //todo think of how to handle when undefined is sent\n annotation.type = function (_, settings) {\n if (!arguments.length) return type;\n type = _;\n if (collection) {\n collection.annotations.map(function (a) {\n a.type.note && a.type.note.selectAll(\"*:not(.annotation-note-content)\").remove();\n a.type.noteContent && a.type.noteContent.selectAll(\"*\").remove();\n a.type.subject && a.type.subject.selectAll(\"*\").remove();\n a.type.connector && a.type.connector.selectAll(\"*\").remove();\n a.type.typeSettings = {};\n a.type = type;\n\n a.subject = settings && settings.subject || a.subject;\n a.connector = settings && settings.connector || a.connector;\n a.note = settings && settings.note || a.note;\n });\n\n annotations = collection.annotations;\n }\n return annotation;\n };\n\n annotation.annotations = function (_) {\n if (!arguments.length) return collection && collection.annotations || annotations;\n annotations = _;\n\n if (collection && collection.annotations) {\n var rerun = annotations.some(function (d) {\n return !d.type || d.type.toString() !== \"[object Object]\";\n });\n\n if (rerun) {\n collection = null;\n annotation(sel);\n } else {\n collection.annotations = annotations;\n }\n }\n return annotation;\n };\n\n annotation.context = function (_) {\n if (!arguments.length) return context;\n context = _;\n return annotation;\n };\n\n annotation.accessors = function (_) {\n if (!arguments.length) return accessors;\n accessors = _;\n return annotation;\n };\n\n annotation.accessorsInverse = function (_) {\n if (!arguments.length) return accessorsInverse;\n accessorsInverse = _;\n return annotation;\n };\n\n annotation.ids = function (_) {\n if (!arguments.length) return ids;\n ids = _;\n return annotation;\n };\n\n annotation.editMode = function (_) {\n if (!arguments.length) return editMode;\n editMode = _;\n\n if (sel) {\n sel.selectAll(\"g.annotation\").classed(\"editable\", editMode);\n }\n\n if (collection) {\n collection.editMode(editMode);\n annotations = collection.annotations;\n }\n return annotation;\n };\n\n annotation.collection = function (_) {\n if (!arguments.length) return collection;\n collection = _;\n return annotation;\n };\n\n annotation.on = function () {\n var value = annotationDispatcher.on.apply(annotationDispatcher, arguments);\n return value === annotationDispatcher ? annotation : value;\n };\n\n return annotation;\n}\n\nvar index = {\n annotation: annotation,\n annotationTypeBase: Type,\n annotationLabel: d3Label,\n annotationCallout: d3Callout,\n annotationCalloutCurve: d3CalloutCurve,\n annotationCalloutElbow: d3CalloutElbow,\n annotationCalloutCircle: d3CalloutCircle,\n annotationCalloutRect: d3CalloutRect,\n annotationXYThreshold: d3XYThreshold,\n annotationBadge: d3Badge,\n annotationCustomType: customType\n};\n\nexport { annotation, Type as annotationTypeBase, d3Label as annotationLabel, d3Callout as annotationCallout, d3CalloutCurve as annotationCalloutCurve, d3CalloutElbow as annotationCalloutElbow, d3CalloutCircle as annotationCalloutCircle, d3CalloutRect as annotationCalloutRect, d3XYThreshold as annotationXYThreshold, d3Badge as annotationBadge, customType as annotationCustomType };export default index;\n//# sourceMappingURL=indexRollupNext.js.map\n","import { SVGWidget } from \"@hpcc-js/common\";\nimport { format as d3Format } from \"d3-format\";\nimport { interpolate as d3Interpolate, interpolateHcl as d3InterpolateHcl } from \"d3-interpolate\";\nimport { scaleLinear } from \"d3-scale\";\nimport { Arc, arc as d3Arc, DefaultArcObject } from \"d3-shape\";\nimport { annotation as d3Annotation, annotationCalloutElbow } from \"d3-svg-annotation\";\n\nfunction value2Angle(value: number): number {\n return (value - 0.5) * .65 * 2 * Math.PI;\n}\n\nfunction pointOnArc(angle: number, radius: number): { x: number, y: number } {\n return {\n x: Math.cos(angle - Math.PI / 2) * radius,\n y: Math.sin(angle - Math.PI / 2) * radius\n };\n}\n\nfunction indicatorTranslate(angle: number, radius: number, inner: boolean = false) {\n const point = pointOnArc(angle, radius);\n const rotation = angle * 180 / Math.PI + (inner === true ? 180 : 0);\n return `translate(${point.x}, ${point.y}) rotate(${rotation})`;\n}\n\ntype IndicatorDatum = { angle: number };\nfunction indicatorTween(newAngle: number, radius: number, inner: boolean = false) {\n return function (d: IndicatorDatum) {\n const interpolate = d3Interpolate(d.angle, newAngle);\n d.angle = newAngle;\n return function (t: number) {\n return indicatorTranslate(interpolate(t), radius, inner);\n };\n };\n}\n\nfunction arcTween(startAngle: number, endAngle: number, arc: Arc<any, DefaultArcObject>) {\n return function (d: DefaultArcObject) {\n const startInterpolate = d3Interpolate(d.startAngle, startAngle);\n const endInterpolate = d3Interpolate(d.endAngle, endAngle);\n return function (t: number): string {\n d.startAngle = startInterpolate(t);\n d.endAngle = endInterpolate(t);\n return arc(d)!;\n };\n };\n}\n\nexport class Gauge extends SVGWidget {\n\n private _d3Arc: Arc<any, DefaultArcObject> = d3Arc()\n .innerRadius(85)\n .outerRadius(100)\n ;\n private _colorScale = scaleLinear<string, string>()\n .interpolate(d3InterpolateHcl)\n ;\n\n protected _usageArc: any;\n protected _meanArc: any;\n protected _freeArc: any;\n protected _indInner: any;\n protected _indOuter: any;\n protected _centerTextG: any;\n protected _centerText: any;\n protected _bottomText: any;\n protected _tooltipG: any;\n protected _mainTooltip: any;\n\n constructor() {\n super();\n }\n\n protected tip(d: any) {\n if (d === null || d.label === \"\") {\n this._tooltipG\n .transition()\n .style(\"opacity\", 0)\n .on(\"interrupt end\", () => {\n this._tooltipG\n .selectAll(\"g\")\n .remove()\n ;\n })\n ;\n } else {\n this._tooltipG\n .interrupt()\n .style(\"opacity\", 1)\n ;\n d.w = (this._centerText.datum() as any).w + 10;\n let lineType = \"horizontal\";\n let xOffset = 0;\n let yOffset = 5;\n let padding: number | undefined = 5;\n if (d.y >= 5 && d.y <= 25) {\n xOffset = d.x < 0 ? -d.w / 2 : d.w / 2;\n yOffset = 12.5;\n padding = undefined;\n lineType = \"vertical\";\n } else if (d.y > 25) {\n yOffset = 25;\n padding = 0;\n }\n const annotationtip = d3Annotation()\n .type(annotationCalloutElbow)\n .annotations([{\n data: d,\n dx: -d.x + xOffset,\n dy: -d.y + yOffset,\n color: \"black\",\n note: {\n label: d.label,\n lineType,\n padding,\n align: \"middle\"\n }\n }])\n .accessors({ x: (d2: any) => d2.x, y: (d2: any) => d2.y });\n this._tooltipG.call(annotationtip as any);\n }\n }\n\n protected calcSize(textElement, width: number, height: number): { width: number, height: number, scale: number } {\n const bb = (textElement.node() as any).getBBox();\n const widthTransform = width / bb.width;\n const heightTransform = height / bb.height;\n const scale = widthTransform < heightTransform ? widthTransform : heightTransform;\n return {\n width: bb.width,\n height: bb.height,\n scale\n };\n }\n\n protected updateText(textElement, x: number, y: number, w: number, h: number) {\n textElement\n .datum({ x, y, w, h })\n .attr(\"transform\", null)\n ;\n const size = this.calcSize(textElement, w, h);\n const x2 = x + w / 2 - size.width / 2 * size.scale;\n const y2 = y + h / 2 - size.height / 2 * size.scale;\n textElement.attr(\"transform\", `translate(${x2}, ${y2}) scale(${size.scale})`);\n }\n\n calcWidth(): number {\n return Math.min(this.width(), this.height(), this.maxDiameter());\n }\n\n enter(domNode: HTMLElement, element) {\n super.enter(domNode, element);\n\n element.on(\"click\", (d: Gauge) => {\n this.click(d);\n });\n\n this._usageArc = element.append(\"path\").datum({ startAngle: value2Angle(0), endAngle: value2Angle(0) })\n .style(\"fill\", \"green\")\n .on(\"mousemove\", (d: any) => {\n const [x, y] = this._d3Arc.centroid(d);\n this.tip({ x, y, label: this.valueDescription() });\n })\n .on(\"mouseout\", (d: any) => {\n this.tip(null);\n })\n ;\n this._freeArc = element.append(\"path\").datum({ startAngle: value2Angle(0), endAngle: value2Angle(1) })\n .style(\"fill\", \"lightGrey\")\n ;\n this._meanArc = element.append(\"path\").datum({ startAngle: value2Angle(0), endAngle: value2Angle(0) })\n .style(\"fill\", \"black\")\n .on(\"mousemove\", (d: any) => {\n const [x, y] = this._d3Arc.centroid(d);\n this.tip({ x, y, label: this.tickValueDescription() });\n })\n .on(\"mouseout\", (d: any) => {\n this.tip(null);\n })\n ;\n\n this._mainTooltip = element.append(\"title\");\n\n const context = this;\n function appendIndicator() {\n return element.append(\"path\").datum({ angle: value2Angle(0) })\n .style(\"fill\", \"black\")\n .style(\"stroke\", \"black\")\n .attr(\"d\", \"M 0 0 l -3 -3 l 6 0 z\")\n .on(\"mousemove\", (d: any) => {\n const [x, y] = context._d3Arc.centroid(context._meanArc.datum() as any);\n context.tip({ x, y, label: context.tickValueDescription() });\n })\n .on(\"mouseout\", (d: any) => {\n context.tip(null);\n })\n ;\n }\n this._indInner = appendIndicator();\n this._indOuter = appendIndicator();\n this._centerText = element.append(\"text\")\n .attr(\"dy\", \".66em\")\n .style(\"fill\", \"green\")\n .on(\"mousemove\", (d: any) => {\n this.tip({ x: 0, y: 0, label: this.valueDescription() });\n })\n .on(\"mouseout\", (d: any) => {\n this.tip(null);\n })\n ;\n this._bottomText = element.append(\"text\")\n .attr(\"dy\", \".66em\")\n .on(\"mousemove\", (d: any) => {\n this.tip({ x: 0, y: d.y, label: this.titleDescription() });\n })\n .on(\"mouseout\", (d: any) => {\n this.tip(null);\n })\n ;\n\n this._tooltipG = element.append(\"g\")\n .attr(\"class\", \"annotation-tip\")\n ;\n }\n\n update(domNode: HTMLElement, element) {\n super.update(domNode, element);\n\n this._colorScale\n .domain(this.colorDomain())\n .range(this.colorRange())\n ;\n element\n .attr(\"title\", this.tooltip())\n .style(\"cursor\", this.click !== Gauge.prototype.click ? \"pointer\" : null)\n ;\n\n const innerRadius = this.calcWidth() / 3;\n const outerRadius = this.calcWidth() / 2 - 5;\n this._d3Arc\n .innerRadius(innerRadius)\n .outerRadius(outerRadius)\n ;\n\n const val = this.value();\n const tickVal = this.tickValue();\n\n this._usageArc\n .style(\"fill\", this._colorScale(val))\n .transition()\n .duration(750)\n .attrTween(\"d\", arcTween(value2Angle(0), value2Angle(val), this._d3Arc))\n ;\n\n this._freeArc\n .style(\"fill\", this.emptyColor())\n .transition()\n .duration(750)\n .attrTween(\"d\", arcTween(value2Angle(val), value2Angle(1), this._d3Arc))\n ;\n\n this._meanArc\n .style(\"fill\", this.tickColor())\n .style(\"visibility\", this.showTick() ? \"visible\" : \"hidden\")\n .transition()\n .duration(750)\n .attrTween(\"d\", arcTween(value2Angle(tickVal - 0.001), value2Angle(tickVal + 0.001), this._d3Arc))\n ;\n\n this._indInner\n .style(\"fill\", this.tickColor())\n .style(\"stroke\", this.tickColor())\n .style(\"visibility\", this.showTick() ? \"visible\" : \"hidden\")\n .transition()\n .duration(750)\n .attrTween(\"transform\", indicatorTween(value2Angle(tickVal), innerRadius, true))\n ;\n\n this._indOuter\n .style(\"fill\", this.tickColor())\n .style(\"stroke\", this.tickColor())\n .style(\"visibility\", this.showTick() ? \"visible\" : \"hidden\")\n .transition()\n .duration(750)\n .attrTween(\"transform\", indicatorTween(value2Angle(tickVal), outerRadius))\n ;\n\n this._centerText\n .style(\"fill\", this._colorScale(val))\n .text(d3Format(\".0%\")(val))\n ;\n\n this._bottomText\n .style(\"fill\", this.click !== Gauge.prototype.click ? this.titleClickColor() : this.titleColor())\n .style(\"text-decoration\", this.click !== Gauge.prototype.click ? \"underline\" : null)\n .text(this.title())\n ;\n\n // Update Text ---\n const point = pointOnArc(value2Angle(1), innerRadius - 8);\n this.updateText(this._centerText, -point.x, -point.y, 2 * point.x, 2 * point.y);\n\n const point2 = pointOnArc(value2Angle(1), outerRadius);\n point2.y += 5;\n const width = this.calcWidth() - 20;\n const height = this.calcWidth() / 2 - point2.y - 5;\n this.updateText(this._bottomText, -width / 2, point2.y, width, height);\n\n this._mainTooltip.text(this.tooltip());\n }\n\n // Events ---\n click(w: Gauge) {\n }\n}\nGauge.prototype._class += \" chart_Gauge\";\n\nexport interface Gauge {\n title(): string;\n title(_: string): this;\n titleDescription(): string;\n titleDescription(_: string): this;\n titleColor(): string;\n titleColor(_: string): this;\n titleClickColor(): string;\n titleClickColor(_: string): this;\n\n maxDiameter(): number;\n maxDiameter(_: number): this;\n value(): number;\n value(_: number): this;\n valueDescription(): string;\n valueDescription(_: string): this;\n showTick(): boolean;\n showTick(_: boolean): this;\n tickValue(): number;\n tickValue(_: number): this;\n tickValueDescription(): string;\n tickValueDescription(_: string): this;\n tooltip(): string;\n tooltip(_: string): this;\n\n tickColor(): string;\n tickColor(_: string): this;\n emptyColor(): string;\n emptyColor(_: string): this;\n colorDomain(): number[];\n colorDomain(_: number[]): this;\n colorRange(): string[];\n colorRange(_: string[]): this;\n}\n\nGauge.prototype.publish(\"title\", \"\", \"string\", \"Title\");\nGauge.prototype.publish(\"titleDescription\", \"\", \"string\", \"Title Description\");\nGauge.prototype.publish(\"titleColor\", \"black\", \"html-color\", \"Color of the title text\");\nGauge.prototype.publish(\"titleClickColor\", \"blue\", \"html-color\", \"Color of the title text when clickable\");\n\nGauge.prototype.publish(\"maxDiameter\", 128, \"number\", \"Max Diameter\");\nGauge.prototype.publish(\"value\", 0, \"number\", \"Value\");\nGauge.prototype.publish(\"valueDescription\", \"\", \"string\", \"Value Description\");\nGauge.prototype.publish(\"showTick\", false, \"boolean\", \"Show Tick\");\nGauge.prototype.publish(\"tickValue\", 0, \"number\", \"Tick Value\");\nGauge.prototype.publish(\"tickValueDescription\", \"\", \"string\", \"Tick Value Description\");\nGauge.prototype.publish(\"tooltip\", \"\", \"string\", \"Tooltip\");\n\nGauge.prototype.publish(\"colorRange\", [\"green\", \"green\", \"green\", \"green\", \"green\", \"green\", \"green\", \"green\", \"orange\", \"red\", \"red\"], \"array\", \"Array of colors for the filled gauge portion. The fill color will be relative to the gauge value.\");\nGauge.prototype.publish(\"colorDomain\", [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1], \"array\", \"This array augments the mapping of the value to the fill colorRange.\");\nGauge.prototype.publish(\"emptyColor\", \"lightgrey\", \"html-color\", \"Color of the empty portion of the gauge\");\nGauge.prototype.publish(\"tickColor\", \"black\", \"html-color\", \"Color of the tick\");\n","import { I2DChart, ITooltip } from \"@hpcc-js/api\";\nimport { InputField, SVGWidget, Utility } from \"@hpcc-js/common\";\nimport { degreesToRadians, normalizeRadians } from \"@hpcc-js/util\";\nimport { format as d3Format } from \"d3-format\";\nimport { interpolate as d3Interpolate } from \"d3-interpolate\";\nimport { select as d3Select } from \"d3-selection\";\nimport { arc as d3Arc, pie as d3Pie } from \"d3-shape\";\n\nimport \"../src/Pie.css\";\n\nconst sortAscending = (a, b) => a[1] - b[1] > 0 ? 1 : -1;\nconst sortDescending = (a, b) => a[1] - b[1] > 0 ? -1 : 1;\n\nexport class Pie extends SVGWidget {\n static __inputs: InputField[] = [{\n id: \"label\",\n type: \"string\"\n }, {\n id: \"value\",\n type: \"number\"\n }];\n\n protected _totalValue: number;\n\n d3Pie;\n d3Arc;\n d3LabelArc;\n private _labelPositions;\n private _smallValueLabelHeight;\n private _labelWidthLimit: number;\n private _quadIdxArr;\n private _minLabelTop = 0;\n private _maxLabelBottom = 0;\n private _seriesValueFormatter;\n private _seriesPercentageFormatter;\n constructor() {\n super();\n I2DChart.call(this);\n ITooltip.call(this);\n Utility.SimpleSelectionMixin.call(this);\n\n this.d3Pie = d3Pie();\n\n this.d3Arc = d3Arc();\n this.d3LabelArc = d3Arc();\n this\n .tooltipTick_default(false)\n .tooltipOffset_default(0)\n ;\n }\n\n intersection(pointA, pointB) {\n return this.intersectCircle(this.calcOuterRadius(), pointA, pointB);\n }\n\n calcInnerRadius() {\n return this.innerRadius_exists() ? this.calcOuterRadius() * (this.innerRadius() as number) / 100 : 0;\n }\n\n calcOuterRadius() {\n const maxTextWidth = this.textSize(this.data().map(d => this.getLabelText({ data: d }, false)), \"Verdana\", 12).width;\n const horizontalLimit = this._size.width - (this.showLabels() ? maxTextWidth * 2 : 0) - 20;\n const verticalLimit = this._size.height - 12 * 3 - (this.showLabels() ? this._smallValueLabelHeight : 0);\n const outerRadius = Math.min(horizontalLimit, verticalLimit) / 2 - 2;\n if ((horizontalLimit / 2) - 2 < this.minOuterRadius()) {\n this._labelWidthLimit = maxTextWidth - (this.minOuterRadius() - ((horizontalLimit / 2) - 2));\n } else {\n this._labelWidthLimit = maxTextWidth;\n }\n if (outerRadius < this.minOuterRadius()) {\n return this.minOuterRadius();\n }\n return outerRadius;\n }\n\n calcSmallValueLabelHeight() {\n const smallDef = 0.1;\n const totalVal = this.data().reduce((acc, n) => acc + n[1], 0);\n let smallCount = 0;\n this.data().forEach(row => {\n if (row[1] / totalVal < smallDef) {\n smallCount++;\n }\n });\n return this.labelHeight() * smallCount;\n }\n\n calcTotalValue(): number {\n return this.data().reduce((acc, d) => {\n return acc + d[1];\n }, 0);\n }\n\n getLabelText(d, truncate?) {\n let len;\n let label = d.data[0];\n if (typeof this._labelWidthLimit !== \"undefined\" && truncate) {\n const labelWidth = this.textSize(label, \"Verdana\", this.labelHeight()).width;\n if (this._labelWidthLimit < labelWidth) {\n len = label.length * (this._labelWidthLimit / labelWidth) - 3;\n label = len < label.length ? label.slice(0, len) + \"...\" : label;\n }\n }\n if (this.showSeriesValue()) {\n label += ` : ${this._seriesValueFormatter(d.data[1])}`;\n }\n if (this.showSeriesPercentage()) {\n let sum = this._totalValue;\n const dm = this.dataMeta();\n if (typeof dm.sum !== \"undefined\") {\n sum = dm.sum;\n }\n const perc = (d.data[1] / sum) * 100;\n label += ` : ${this._seriesPercentageFormatter(perc)}%`;\n }\n return label;\n }\n\n selection(): any[]; // any[] === single row\n selection(_: any[]): this;\n selection(_?: any[]): any[] | this {\n if (!arguments.length) {\n try {\n return this._selection.selection2()[0]?.data;\n } catch (e) {\n return undefined;\n }\n }\n // Stringify to enable a deep equal\n const strRow = JSON.stringify(_);\n this._selection.selection2(d => strRow === JSON.stringify(d.data));\n }\n\n selectByLabel(_: string) {\n const row = this.data().filter(row => row[0] === _)[0];\n if (row) {\n this.selection(row);\n }\n }\n\n _slices;\n _labels;\n enter(_domNode, element) {\n super.enter(_domNode, element);\n this._selection.widgetElement(element);\n this._slices = element.append(\"g\");\n this._labels = element.append(\"g\");\n const context = this;\n this\n .tooltipHTML(function (d) {\n switch (context.tooltipStyle()) {\n case \"series-table\":\n return context.tooltipFormat({\n label: d.data[0],\n arr: context.columns().slice(1).map(function (column, i) {\n return {\n label: column,\n color: context._palette(d.data[0]),\n value: d.data[i + 1]\n };\n })\n });\n default:\n return context.tooltipFormat({ label: d.data[0], value: d.data[1] });\n }\n })\n ;\n }\n\n update(_domNode, element) {\n super.update(_domNode, element);\n const context = this;\n this.updateD3Pie();\n this._palette = this._palette.switch(this.paletteID());\n this._seriesValueFormatter = d3Format(this.seriesValueFormat() as string);\n this._seriesPercentageFormatter = d3Format(this.seriesPercentageFormat() as string);\n if (this.useClonedPalette()) {\n this._palette = this._palette.cloneNotExists(this.paletteID() + \"_\" + this.id());\n }\n this._smallValueLabelHeight = this.calcSmallValueLabelHeight();\n this._totalValue = this.calcTotalValue();\n const innerRadius = this.calcInnerRadius();\n const outerRadius = this.calcOuterRadius();\n const labelRadius = outerRadius + 12;\n this.d3Arc\n .innerRadius(innerRadius)\n .padRadius(outerRadius)\n .outerRadius(outerRadius)\n ;\n\n this._quadIdxArr = [[], [], [], []];\n const data = [...this.data()];\n switch (this.sortDataByValue()) {\n case \"ascending\":\n data.sort(sortAscending);\n break;\n case \"descending\":\n data.sort(sortDescending);\n break;\n }\n const arc = this._slices.selectAll(\".arc\").data(this.d3Pie(data), d => d.data[0]);\n\n this._labelPositions = [];\n\n // Enter ---\n arc.enter().append(\"g\")\n .attr(\"class\", (d, i) => \"arc series series-\" + this.cssTag(d.data[0]))\n .attr(\"opacity\", 0)\n .call(this._selection.enter.bind(this._selection))\n .on(\"click\", function (d) {\n context.click(context.rowToObj(d.data), context.columns()[1], context._selection.selected(this));\n })\n .on(\"dblclick\", function (d) {\n context.dblclick(context.rowToObj(d.data), context.columns()[1], context._selection.selected(this));\n })\n .each(function (d, i) {\n d3Select(this).append(\"path\")\n .on(\"mouseout.tooltip\", context.tooltip.hide)\n .on(\"mousemove.tooltip\", context.tooltip.show)\n .on(\"mouseover\", arcTween(0, 0))\n .on(\"mouseout\", arcTween(-5, 150))\n ;\n })\n .merge(arc).transition()\n .attr(\"opacity\", 1)\n .each(function (d, i) {\n const quad = context.getQuadrant(midAngle(d));\n context._quadIdxArr[quad].push(i);\n d.outerRadius = outerRadius - 5;\n const element2 = d3Select(this);\n element2.select(\"path\").transition()\n .attr(\"d\", context.d3Arc)\n .style(\"fill\", context.fillColor(d.data, context.columns()[1], d.data[1]))\n ;\n })\n ;\n\n // Exit ---\n arc.exit().transition()\n .style(\"opacity\", 0)\n .remove()\n ;\n // Labels ---\n this.d3LabelArc\n .innerRadius(labelRadius)\n .outerRadius(labelRadius)\n ;\n const text = this._labels.selectAll(\"text\").data(this.showLabels() ? this.d3Pie(data) : [], d => d.data[0]);\n\n const mergedText = text.enter().append(\"text\")\n .on(\"mouseout.tooltip\", context.tooltip.hide)\n .on(\"mousemove.tooltip\", context.tooltip.show)\n .attr(\"dy\", \".5em\")\n .on(\"click\", function (d) {\n context._slices.selectAll(\"g\").filter(function (d2) {\n if (d.data === d2.data) {\n context._selection.click(this);\n context.click(context.rowToObj(d.data), context.columns()[1], context._selection.selected(this));\n }\n });\n })\n .on(\"dblclick\", function (d) {\n context._slices.selectAll(\"g\").filter(function (d2) {\n if (d.data === d2.data) {\n context.dblclick(context.rowToObj(d.data), context.columns()[1], context._selection.selected(this));\n }\n });\n })\n .merge(text)\n .text(d => this.getLabelText(d, true))\n .each(function (d, i) {\n const pos = context.d3LabelArc.centroid(d);\n const mid_angle = midAngle(d);\n pos[0] = labelRadius * (context.isLeftSide(mid_angle) ? 1 : -1);\n context._labelPositions.push({\n top: pos[1],\n bottom: pos[1] + context.labelHeight()\n });\n });\n if (this.showLabels()) {\n this.adjustForOverlap();\n mergedText.transition()\n .style(\"font-size\", this.labelHeight() + \"px\")\n .attr(\"transform\", (d, i) => {\n const pos = context.d3LabelArc.centroid(d);\n pos[0] = labelRadius * (context.isLeftSide(midAngle(d)) ? 1 : -1);\n pos[1] = context._labelPositions[i].top;\n return \"translate(\" + pos + \")\";\n })\n .style(\"text-anchor\", d => this.isLeftSide(midAngle(d)) ? \"start\" : \"end\");\n }\n\n text.exit()\n .remove();\n\n const polyline = this._labels.selectAll(\"polyline\").data(this.showLabels() ? this.d3Pie(data) : [], d => this.getLabelText(d, true));\n\n polyline.enter()\n .append(\"polyline\")\n .merge(polyline).transition()\n .attr(\"points\", function (d, i) {\n const pos = context.d3LabelArc.centroid(d);\n const pos1 = context.d3Arc.centroid(d);\n const pos2 = [...pos];\n pos[0] = labelRadius * (context.isLeftSide(midAngle(d)) ? 1 : -1);\n pos[1] = context._labelPositions[i].top;\n return [pos1, pos2, pos];\n });\n\n polyline.exit()\n .remove();\n\n if (this.showLabels()) {\n this.centerOnLabels();\n }\n function midAngle(d) {\n return d.startAngle + (d.endAngle - d.startAngle) / 2;\n }\n\n function arcTween(outerRadiusDelta, delay) {\n return function () {\n d3Select(this).transition().delay(delay).attrTween(\"d\", function (d: any) {\n const i = d3Interpolate(d.outerRadius, outerRadius + outerRadiusDelta);\n return function (t) { d.outerRadius = i(t); return context.d3Arc(d); };\n });\n };\n }\n }\n\n isLeftSide(midAngle) {\n midAngle = normalizeRadians(midAngle);\n const isLeft = midAngle > Math.PI * 2 ? midAngle : midAngle < Math.PI && midAngle > 0;\n return isLeft;\n }\n\n getQuadrant(radians) {\n let quad = 0;\n const rad = normalizeRadians(radians);\n quad = rad <= Math.PI * 1.0 && rad >= Math.PI * 0.5 ? 3 : quad;\n quad = rad <= Math.PI * 0.5 && rad >= Math.PI * 0.0 ? 2 : quad;\n quad = rad <= Math.PI * 0.0 && rad >= Math.PI * -0.5 ? 1 : quad;\n return quad;\n }\n\n centerOnLabels() {\n const gY = this.pos().y;\n const gY2 = gY * 2;\n const radius = this.calcOuterRadius();\n const top = Math.min(this._minLabelTop, -radius);\n const bottom = Math.max(this._maxLabelBottom, radius);\n const h = bottom - top;\n const heightDiff = gY2 - h;\n const absTop = Math.abs(this._minLabelTop);\n let yShift = 0;\n if (bottom > gY) {\n yShift = gY - bottom + (this.labelHeight() / 2);\n yShift -= heightDiff / 2;\n } else if (top < 0 && absTop > gY) {\n yShift = absTop - gY + (this.labelHeight() / 2);\n yShift += heightDiff / 2;\n }\n const pos = this.pos();\n this.pos({\n y: pos.y + yShift,\n x: pos.x\n });\n }\n\n adjustForOverlap() {\n const labelHeight = this.labelHeight();\n this._quadIdxArr.forEach((arr, quad) => {\n this._quadIdxArr[quad].sort((a, b) => {\n if (quad === 1 || quad === 2) {\n return this._labelPositions[a].top > this._labelPositions[b].top ? -1 : 1;\n } else if (quad === 0 || quad === 3) {\n return this._labelPositions[a].top > this._labelPositions[b].top ? 1 : -1;\n }\n });\n let prevTop;\n this._quadIdxArr[quad].forEach((n, i) => {\n if (i > 0) {\n if (quad === 1 || quad === 2) {\n if (prevTop < this._labelPositions[n].bottom) {\n const overlap = this._labelPositions[n].bottom - prevTop;\n this._labelPositions[n].top -= overlap;\n this._labelPositions[n].bottom -= overlap;\n }\n } else if (quad === 0 || quad === 3) {\n if (prevTop + labelHeight > this._labelPositions[n].top) {\n const overlap = Math.abs(this._labelPositions[n].top) - Math.abs(prevTop + labelHeight);\n this._labelPositions[n].top -= overlap;\n this._labelPositions[n].bottom -= overlap;\n }\n }\n }\n prevTop = this._labelPositions[n].top;\n });\n });\n this._minLabelTop = 0;\n this._maxLabelBottom = 0;\n this._quadIdxArr.forEach((arr, quad) => {\n this._quadIdxArr[quad].forEach((n, i) => {\n if (this._minLabelTop > this._labelPositions[n].top) {\n this._minLabelTop = this._labelPositions[n].top;\n }\n if (this._maxLabelBottom < this._labelPositions[n].bottom) {\n this._maxLabelBottom = this._labelPositions[n].bottom;\n }\n });\n });\n }\n\n exit(domNode, element) {\n super.exit(domNode, element);\n }\n\n updateD3Pie() {\n const startAngle = normalizeRadians(degreesToRadians(this.startAngle()));\n\n switch (this.sortDataByValue()) {\n case \"ascending\":\n this.d3Pie.sort(sortAscending);\n break;\n case \"descending\":\n this.d3Pie.sort(sortDescending);\n break;\n default:\n this.d3Pie.sort(null);\n }\n\n this.d3Pie\n .padAngle(0.0025)\n .startAngle(startAngle)\n .endAngle(2 * Math.PI + startAngle)\n .value(function (d) {\n return d[1];\n })\n ;\n }\n}\nPie.prototype._class += \" chart_Pie\";\nPie.prototype.implements(I2DChart.prototype);\nPie.prototype.implements(ITooltip.prototype);\nPie.prototype.mixin(Utility.SimpleSelectionMixin);\n\nexport interface Pie {\n showSeriesValue(): boolean;\n showSeriesValue(_: boolean): this;\n seriesValueFormat(): string;\n seriesValueFormat(_: string): this;\n showSeriesPercentage(): boolean;\n showSeriesPercentage(_: boolean): this;\n minOuterRadius(): number;\n minOuterRadius(_: number): this;\n startAngle(): number;\n startAngle(_: number): this;\n labelHeight(): number;\n labelHeight(_: number): this;\n seriesPercentageFormat(): string;\n seriesPercentageFormat(_: string): this;\n showLabels(): boolean;\n showLabels(_: boolean): this;\n sortDataByValue(): \"none\" | \"ascending\" | \"descending\";\n sortDataByValue(_: \"none\" | \"ascending\" | \"descending\"): this;\n\n paletteID(_?: string): string | Pie;\n useClonedPalette(_?: boolean): boolean | Pie;\n outerText(_?: boolean): boolean | Pie;\n innerRadius(): number;\n innerRadius_exists(): boolean;\n\n // I2DChart\n _palette;\n fillColor(row: any[], column: string, value: number): string;\n textColor(row: any[], column: string, value: number): string;\n click(row, column, selected): void;\n dblclick(row, column, selected): void;\n\n // ITooltip\n tooltip;\n tooltipHTML(_): string;\n tooltipFormat(_): string;\n tooltipStyle(): \"default\" | \"none\" | \"series-table\";\n tooltipTick(): boolean;\n tooltipTick(_: boolean): Pie;\n tooltipTick_default(): boolean;\n tooltipTick_default(_: boolean): Pie;\n tooltipOffset(): number;\n tooltipOffset(_: number): Pie;\n tooltipOffset_default(): number;\n tooltipOffset_default(_: number): Pie;\n\n // SimpleSelectionMixin\n _selection: Utility.SimpleSelection;\n}\nPie.prototype.publish(\"showLabels\", true, \"boolean\", \"If true, wedge labels will display\");\nPie.prototype.publish(\"showSeriesValue\", false, \"boolean\", \"Append data series value next to label\", null, { disable: w => !w.showLabels() });\nPie.prototype.publish(\"seriesValueFormat\", \",.0f\", \"string\", \"Number format used for formatting series values\", null, { disable: w => !w.showSeriesValue() });\nPie.prototype.publish(\"showSeriesPercentage\", false, \"boolean\", \"Append data series percentage next to label\", null, { disable: w => !w.showLabels() });\nPie.prototype.publish(\"seriesPercentageFormat\", \",.0f\", \"string\", \"Number format used for formatting series percentages\", null, { disable: w => !w.showSeriesPercentage() });\nPie.prototype.publish(\"paletteID\", \"default\", \"set\", \"Color palette for this widget\", Pie.prototype._palette.switch(), { tags: [\"Basic\", \"Shared\"] });\nPie.prototype.publish(\"useClonedPalette\", false, \"boolean\", \"Enable or disable using a cloned palette\", null, { tags: [\"Intermediate\", \"Shared\"] });\nPie.prototype.publish(\"innerRadius\", 0, \"number\", \"Sets inner pie hole radius as a percentage of the radius of the pie chart\", null, { tags: [\"Basic\"], range: { min: 0, step: 1, max: 100 } });\nPie.prototype.publish(\"minOuterRadius\", 20, \"number\", \"Minimum outer radius (pixels)\");\nPie.prototype.publish(\"startAngle\", 0, \"number\", \"Starting angle of the first (and largest) wedge (degrees)\");\nPie.prototype.publish(\"labelHeight\", 12, \"number\", \"Font size of labels (pixels)\", null, { disable: w => !w.showLabels() });\nPie.prototype.publish(\"sortDataByValue\", \"descending\", \"set\", \"Sort data by value\", [\"none\", \"ascending\", \"descending\"]);\n","import { Pie } from \"./Pie.ts\";\n\nexport class HalfPie extends Pie {\n constructor() {\n super();\n }\n postUpdate(domNode, element) {\n super.postUpdate(domNode, element);\n let x = this._pos.x;\n let y = this._pos.y;\n if (this._drawStartPos === \"origin\" && this._target instanceof SVGElement) {\n x -= this._size.width / 2;\n y -= this._size.height / 2;\n }\n y += (this._size.height / 4);\n this._element.attr(\"transform\", \"translate(\" + x + \",\" + y + \")scale(\" + this._widgetScale + \")\");\n }\n updateD3Pie() {\n super.updateD3Pie();\n this.d3Pie\n .startAngle(-Math.PI / 2)\n .endAngle(Math.PI / 2)\n ;\n }\n}\nHalfPie.prototype._class += \" chart_HalfPie\";\n","import { max, Palette } from \"@hpcc-js/common\";\nimport { XYAxis } from \"./XYAxis.ts\";\n\nexport class Heat extends XYAxis {\n\n protected _domForeignObject;\n protected _domCanvas;\n protected _heat;\n\n constructor() {\n super();\n this\n .xAxisGuideLines_default(true)\n .yAxisGuideLines_default(true)\n ;\n }\n\n radius(r: number): this {\n this.radiusX(r);\n this.radiusY(r);\n return this;\n }\n\n layerEnter(host: XYAxis, element, duration: number = 250) {\n super.layerEnter(host, element, duration);\n this._domForeignObject = this.svg.insert(\"foreignObject\", `#${this.id() + \"_clippath\"}`);\n this._domCanvas = this._domForeignObject.append(\"xhtml:body\")\n .style(\"margin\", \"0px\")\n .style(\"padding\", \"0px\")\n .style(\"background-color\", \"transparent\")\n .append(\"canvas\")\n ;\n this._heat = simpleheat(this._domCanvas.node());\n }\n\n layerUpdate(host: XYAxis, element, duration: number = 250) {\n super.layerUpdate(host, element);\n\n this._palette = this._palette.switch(this.paletteID());\n\n let width = this.width() - this.margin.left - this.margin.right;\n if (width < 0) width = 0;\n let height = this.height() - this.margin.top - this.margin.bottom;\n if (height < 0) height = 0;\n\n this._domForeignObject\n .attr(\"x\", this.margin.left)\n .attr(\"y\", this.margin.top)\n .attr(\"width\", width)\n .attr(\"height\", height)\n ;\n this._domCanvas\n .attr(\"width\", width)\n .attr(\"height\", height)\n ;\n\n const data = host.orientation() === \"horizontal\" ?\n this.data().map(r => [host.dataPos(r[0]), host.valuePos(r[1]), r[2]]) :\n this.data().map(r => [host.valuePos(r[1]), host.dataPos(r[0]), r[2]])\n ;\n\n const maxWeight = this.maxWeight_exists() ? this.maxWeight() : max(data, r => r[2]);\n\n if (this.paletteID() !== \"default\") {\n const gradient = {};\n const count = 8;\n const reverse = this.reversePalette();\n for (let i = 0; i < count; ++i) {\n gradient[i / count] = this._palette((reverse ? count - i : i) / count, 0, 1);\n }\n this._heat.gradient(gradient);\n } else {\n this._heat.gradient(this._heat.defaultGradient);\n }\n\n this._heat.resize();\n\n const radiusX = this.radiusAsPercent() ? this.radiusX() * width / 100 : this.radiusX();\n const radiusY = this.radiusAsPercent() ? this.radiusY() * height / 100 : this.radiusY();\n\n this._heat\n .clear()\n .radius(radiusX, radiusY, this.blur())\n .max(maxWeight)\n .data(data)\n .draw(this.minOpacity())\n ;\n }\n}\n\nHeat.prototype._class += \" chart_Heat\";\nHeat.prototype._palette = Palette.rainbow(\"default\");\n\nexport interface Heat {\n paletteID(): string;\n paletteID(_: string): this;\n useClonedPalette(): boolean;\n useClonedPalette(_: boolean): this;\n reversePalette(): boolean;\n reversePalette(_: boolean): this;\n\n radiusX(): number;\n radiusX(_: number): this;\n radiusY(): number;\n radiusY(_: number): this;\n radiusAsPercent(): boolean;\n radiusAsPercent(_: boolean): this;\n blur(): number;\n blur(_: number): this;\n\n maxWeight(): number;\n maxWeight(_: number): this;\n maxWeight_exists(): boolean;\n\n minOpacity(): number;\n minOpacity(_: number): this;\n}\n\nHeat.prototype.publish(\"paletteID\", \"default\", \"set\", \"Color palette for this widget\", Heat.prototype._palette.switch(), { tags: [\"Basic\"] });\nHeat.prototype.publish(\"useClonedPalette\", false, \"boolean\", \"Enable or disable using a cloned palette\", null, { tags: [\"Intermediate\", \"Shared\"] });\nHeat.prototype.publish(\"reversePalette\", false, \"boolean\", \"Reverse Palette Colors\", null, { disable: w => w.paletteID() === \"default\" });\n\nHeat.prototype.publish(\"radiusX\", 25, \"number\", \"Point X radius (25 by default)\");\nHeat.prototype.publish(\"radiusY\", 25, \"number\", \"Point Y radius (25 by default)\");\nHeat.prototype.publish(\"radiusAsPercent\", false, \"boolean\", \"Calculate RadiusX + RadiusY as % of size\");\nHeat.prototype.publish(\"blur\", 15, \"number\", \"Point blur radius (15 by default)\");\n\nHeat.prototype.publish(\"maxWeight\", undefined, \"number\", \"Clamp max weight to value (optional), omitting uses max data point\", undefined, { optional: true });\nHeat.prototype.publish(\"minOpacity\", 0.05, \"number\", \"Minimum point opacity (0.05 by default)\");\n\n// The following code is a modified version of \n// - https://github.com/mourner/simpleheat\n// - Licensed under BSD-2-Clause - https://github.com/mourner/simpleheat/blob/gh-pages/LICENSE\n// Changes:\n// * Fixed TS syntax issues\n// * Added support for eliptical shapes instead of circles\n\nfunction simpleheat(canvas): void {\n if (!(this instanceof simpleheat)) return new simpleheat(canvas);\n\n this._canvas = canvas = typeof canvas === \"string\" ? document.getElementById(canvas) : canvas;\n\n this._ctx = canvas.getContext(\"2d\");\n this._width = canvas.width;\n this._height = canvas.height;\n\n this._max = 1;\n this._data = [];\n}\n\nsimpleheat.prototype = {\n\n defaultRadius: 25,\n\n defaultGradient: {\n 0.4: \"blue\",\n 0.6: \"cyan\",\n 0.7: \"lime\",\n 0.8: \"yellow\",\n 1.0: \"red\"\n },\n\n data: function (data) {\n this._data = data;\n return this;\n },\n\n max: function (max) {\n this._max = max;\n return this;\n },\n\n add: function (point) {\n this._data.push(point);\n return this;\n },\n\n clear: function () {\n this._data = [];\n return this;\n },\n\n radius: function (rX, rY, blur) {\n blur = blur === undefined ? 15 : blur;\n\n // create a grayscale blurred ellipse image that we'll use for drawing points\n const ellipse = this._ellipse = this._createCanvas();\n const ctx = ellipse.getContext(\"2d\");\n const rX2 = this._r = rX + blur;\n const rY2 = this._r = rY + blur;\n\n ellipse.width = rX2 * 2;\n ellipse.height = rY2 * 2;\n\n ctx.shadowOffsetX = ctx.shadowOffsetY = rX2 * 2;\n ctx.shadowOffsetY = ctx.shadowOffsetY = rY2 * 2;\n ctx.shadowBlur = blur;\n ctx.shadowColor = \"black\";\n\n ctx.beginPath();\n ctx.ellipse(-rX2, -rY2, rX, rY, 0, 0, Math.PI * 2, true);\n ctx.closePath();\n ctx.fill();\n\n return this;\n },\n\n resize: function () {\n this._width = this._canvas.width;\n this._height = this._canvas.height;\n },\n\n gradient: function (grad) {\n // create a 256x1 gradient that we'll use to turn a grayscale heatmap into a colored one\n const canvas = this._createCanvas(),\n ctx = canvas.getContext(\"2d\"),\n gradient = ctx.createLinearGradient(0, 0, 0, 256);\n\n canvas.width = 1;\n canvas.height = 256;\n\n for (const i in grad) {\n gradient.addColorStop(+i, grad[i]);\n }\n\n ctx.fillStyle = gradient;\n ctx.fillRect(0, 0, 1, 256);\n\n this._grad = ctx.getImageData(0, 0, 1, 256).data;\n\n return this;\n },\n\n draw: function (minOpacity) {\n if (!this._ellipse) this.radius(this.defaultRadius, this.defaultRadius);\n if (!this._grad) this.gradient(this.defaultGradient);\n\n const ctx = this._ctx;\n\n ctx.clearRect(0, 0, this._width, this._height);\n\n // draw a grayscale heatmap by putting a blurred ellipse at each data point\n for (let i = 0, len = this._data.length, p; i < len; i++) {\n p = this._data[i];\n if (p[2] < 0) {\n p[2] = 0;\n } else if (p[2] > this._max) {\n p[2] = this._max;\n }\n ctx.globalAlpha = Math.max(p[2] / this._max, minOpacity === undefined ? 0.05 : minOpacity);\n ctx.drawImage(this._ellipse, p[0] - this._r, p[1] - this._r);\n }\n\n // colorize the heatmap, using opacity value of each pixel to get the right color from our gradient\n const colored = ctx.getImageData(0, 0, this._width, this._height);\n this._colorize(colored.data, this._grad);\n ctx.putImageData(colored, 0, 0);\n\n return this;\n },\n\n _colorize: function (pixels, gradient) {\n for (let i = 0, len = pixels.length, j; i < len; i += 4) {\n j = pixels[i + 3] * 4; // get gradient color from opacity value\n\n if (j) {\n pixels[i] = gradient[j];\n pixels[i + 1] = gradient[j + 1];\n pixels[i + 2] = gradient[j + 2];\n }\n }\n },\n\n _createCanvas: function () {\n if (typeof document !== \"undefined\") {\n return document.createElement(\"canvas\");\n } else {\n // create a new canvas instance in node.js\n // the canvas class needs to have a default constructor without any parameter\n return new this._canvas.constructor();\n }\n }\n};\n","var thirdPi = Math.PI / 3,\n angles = [0, thirdPi, 2 * thirdPi, 3 * thirdPi, 4 * thirdPi, 5 * thirdPi];\n\nfunction pointX(d) {\n return d[0];\n}\n\nfunction pointY(d) {\n return d[1];\n}\n\nexport default function() {\n var x0 = 0,\n y0 = 0,\n x1 = 1,\n y1 = 1,\n x = pointX,\n y = pointY,\n r,\n dx,\n dy;\n\n function hexbin(points) {\n var binsById = {}, bins = [], i, n = points.length;\n\n for (i = 0; i < n; ++i) {\n if (isNaN(px = +x.call(null, point = points[i], i, points))\n || isNaN(py = +y.call(null, point, i, points))) continue;\n\n var point,\n px,\n py,\n pj = Math.round(py = py / dy),\n pi = Math.round(px = px / dx - (pj & 1) / 2),\n py1 = py - pj;\n\n if (Math.abs(py1) * 3 > 1) {\n var px1 = px - pi,\n pi2 = pi + (px < pi ? -1 : 1) / 2,\n pj2 = pj + (py < pj ? -1 : 1),\n px2 = px - pi2,\n py2 = py - pj2;\n if (px1 * px1 + py1 * py1 > px2 * px2 + py2 * py2) pi = pi2 + (pj & 1 ? 1 : -1) / 2, pj = pj2;\n }\n\n var id = pi + \"-\" + pj, bin = binsById[id];\n if (bin) bin.push(point);\n else {\n bins.push(bin = binsById[id] = [point]);\n bin.x = (pi + (pj & 1) / 2) * dx;\n bin.y = pj * dy;\n }\n }\n\n return bins;\n }\n\n function hexagon(radius) {\n var x0 = 0, y0 = 0;\n return angles.map(function(angle) {\n var x1 = Math.sin(angle) * radius,\n y1 = -Math.cos(angle) * radius,\n dx = x1 - x0,\n dy = y1 - y0;\n x0 = x1, y0 = y1;\n return [dx, dy];\n });\n }\n\n hexbin.hexagon = function(radius) {\n return \"m\" + hexagon(radius == null ? r : +radius).join(\"l\") + \"z\";\n };\n\n hexbin.centers = function() {\n var centers = [],\n j = Math.round(y0 / dy),\n i = Math.round(x0 / dx);\n for (var y = j * dy; y < y1 + r; y += dy, ++j) {\n for (var x = i * dx + (j & 1) * dx / 2; x < x1 + dx / 2; x += dx) {\n centers.push([x, y]);\n }\n }\n return centers;\n };\n\n hexbin.mesh = function() {\n var fragment = hexagon(r).slice(0, 4).join(\"l\");\n return hexbin.centers().map(function(p) { return \"M\" + p + \"m\" + fragment; }).join(\"\");\n };\n\n hexbin.x = function(_) {\n return arguments.length ? (x = _, hexbin) : x;\n };\n\n hexbin.y = function(_) {\n return arguments.length ? (y = _, hexbin) : y;\n };\n\n hexbin.radius = function(_) {\n return arguments.length ? (r = +_, dx = r * 2 * Math.sin(thirdPi), dy = r * 1.5, hexbin) : r;\n };\n\n hexbin.size = function(_) {\n return arguments.length ? (x0 = y0 = 0, x1 = +_[0], y1 = +_[1], hexbin) : [x1 - x0, y1 - y0];\n };\n\n hexbin.extent = function(_) {\n return arguments.length ? (x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1], hexbin) : [[x0, y0], [x1, y1]];\n };\n\n return hexbin.radius(1);\n}\n","import { I2DAggrChart, ITooltip } from \"@hpcc-js/api\";\nimport { InputField } from \"@hpcc-js/common\";\nimport { extent as d3Extent, max as d3Max, min as d3Min } from \"d3-array\";\nimport { hexbin as d3HexBin } from \"d3-hexbin\";\nimport { XYAxis } from \"./XYAxis.ts\";\n\nimport \"../src/HexBin.css\";\n\nexport class HexBin extends XYAxis {\n static __inputs: InputField[] = [{\n id: \"x\",\n type: \"any\"\n }, {\n id: \"y\",\n type: \"number\"\n }];\n\n protected _hexbin;\n protected _dataMinWeight;\n protected _dataMaxWeight;\n constructor() {\n super();\n I2DAggrChart.call(this);\n this.tooltipValueFormat_default(\",.0f\");\n ITooltip.call(this);\n this.tooltipHTML(d => {\n const seriesExtent = d3Extent<{ label: any, value: any }>(d, d => d.label);\n const labelExtent = d3Extent<{ label: any, value: any }>(d, d => d.value);\n return this.tooltipFormat({\n series: seriesExtent[0] === seriesExtent[1] ? seriesExtent[0] : `${seriesExtent[0]} -> ${seriesExtent[1]}`,\n label: labelExtent[0] === labelExtent[1] ? labelExtent[0] : `${labelExtent[0]} -> ${labelExtent[1]}`,\n value: d.length\n });\n });\n this._hexbin = d3HexBin()\n .x(d => d.x)\n .y(d => d.y)\n ;\n this\n .xAxisGuideLines_default(false)\n .yAxisGuideLines_default(false)\n .xAxisType_default(\"linear\")\n ;\n }\n\n xPos(host: XYAxis, d) {\n return host.orientation() === \"horizontal\" ? host.dataPos(d.label) : host.valuePos(d.value);\n }\n\n yPos(host: XYAxis, d) {\n return host.orientation() === \"horizontal\" ? host.valuePos(d.value) : host.dataPos(d.label);\n }\n\n layerUpdate(host: XYAxis, element, duration: number = 250) {\n super.layerUpdate(host, element, duration);\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._hexbin\n .extent([0, 0], [this.width(), this.height()])\n .radius(this.binSize())\n ;\n\n const flatData = this.flattenData();\n const dataPoints = flatData.map(d => {\n return {\n x: context.xPos(host, d),\n y: context.yPos(host, d),\n label: host.parseData(d.label),\n value: host.parseValue(d.value),\n origRow: d\n };\n });\n const hexBinPoints = this._hexbin(dataPoints);\n const minBinPoints = d3Min(hexBinPoints, function (d: any) { return d.length; });\n const maxBinPoints = d3Max(hexBinPoints, function (d: any) { return d.length; });\n this._dataMinWeight = minBinPoints;\n this._dataMaxWeight = maxBinPoints;\n\n const points = element.selectAll(\".hexagon\").data(hexBinPoints, function (d) { return d.i + \"_\" + d.j; });\n points.enter().append(\"path\")\n .attr(\"class\", \"hexagon\")\n .call(host._selection.enter.bind(host._selection))\n .on(\"click\", function (d: any) {\n const data = context.data();\n context.click(d.map(row => host.rowToObj(data[row.origRow.rowIdx])), context.columns()[1], host._selection.selected(this));\n })\n .on(\"dblclick\", function (d: any) {\n const data = context.data();\n context.dblclick(d.map(row => host.rowToObj(data[row.origRow.rowIdx])), context.columns()[1], host._selection.selected(this));\n })\n .on(\"mouseout.tooltip\", context.tooltip.hide)\n .on(\"mousemove.tooltip\", context.tooltip.show)\n .attr(\"transform\", function (d) { return \"translate(\" + d.x + \",\" + d.y + \")scale(0)\"; })\n .merge(points).transition().duration(duration)\n .attr(\"d\", this._hexbin.hexagon())\n .attr(\"transform\", function (d) { return \"translate(\" + d.x + \",\" + d.y + \")scale(1)\"; })\n .style(\"fill\", function (d) { return context._palette(d.length, minBinPoints, maxBinPoints); })\n ;\n points.exit().transition().duration(duration)\n .attr(\"transform\", function (d) { return \"translate(\" + d.x + \",\" + d.y + \")scale(0)\"; })\n .remove()\n ;\n }\n\n exit(domNode, element) {\n super.exit(domNode, element);\n }\n\n // Events ---\n click(row: object[], column, selected) {\n // console.log(\"Click: \" + JSON.stringify(row) + \", \" + column + \", \" + selected);\n }\n dblclick(row: object[], column, selected) {\n // console.log(\"Click: \" + JSON.stringify(row) + \", \" + column + \", \" + selected);\n }\n}\nHexBin.prototype._class += \" chart_HexBin\";\nHexBin.prototype.implements(I2DAggrChart.prototype);\nHexBin.prototype.implements(ITooltip.prototype);\n\nexport interface HexBin {\n // ITooltip\n tooltip;\n tooltipHTML(_): string;\n tooltipFormat(_): string;\n tooltipValueFormat(_): string;\n tooltipValueFormat_default(_): string;\n\n paletteID(): string;\n paletteID(_: string): this;\n useClonedPalette(): boolean;\n useClonedPalette(_: boolean): this;\n binSize(): number;\n binSize(_: number): this;\n}\n\nHexBin.prototype.publish(\"paletteID\", \"Blues\", \"set\", \"Color palette for this widget\", HexBin.prototype._palette.switch(), { tags: [\"Basic\", \"Shared\"] });\nHexBin.prototype.publish(\"useClonedPalette\", false, \"boolean\", \"Enable or disable using a cloned palette\", null, { tags: [\"Intermediate\", \"Shared\"] });\nHexBin.prototype.publish(\"binSize\", 20, \"number\", \"Bin radius\", null, { range: { min: 1, max: 300, step: 1 } });\n","import { Scatter } from \"./Scatter.ts\";\n\nimport \"../src/Line.css\";\n\nexport class Line extends Scatter {\n constructor() {\n super();\n\n this\n .interpolate_default(\"linear\")\n ;\n }\n}\nLine.prototype._class += \" chart_Line\";\n","import { Pie } from \"./Pie.ts\";\n\nexport class QuarterPie extends Pie {\n constructor() {\n super();\n }\n postUpdate(domNode, element) {\n super.postUpdate(domNode, element);\n let x = this.orientation() === \"left\" ? 0 : this._size.width;\n let y = this._size.height;\n if (this._drawStartPos === \"origin\" && this._target instanceof SVGElement) {\n x -= this._size.width / 2;\n y -= this._size.height / 2;\n }\n this._element.attr(\"transform\", \"translate(\" + x + \",\" + y + \")scale(\" + this._widgetScale + \")\");\n }\n updateD3Pie() {\n super.updateD3Pie();\n this.d3Pie\n .startAngle(this.orientation() === \"left\" ? 0 : -Math.PI / 2)\n .endAngle(this.orientation() === \"left\" ? Math.PI / 2 : 0)\n ;\n }\n calcOuterRadius() {\n const maxTextWidth = this.textSize(this.data().map(d => this.getLabelText({ data: d })), \"Verdana\", 12).width;\n return Math.min(this._size.width - maxTextWidth - 10, this._size.height - 12 * 3) - 2;\n }\n}\nQuarterPie.prototype._class += \" chart_QuarterPie\";\n\nexport interface QuarterPie {\n orientation(): string;\n orientation(_: string): this;\n}\nQuarterPie.prototype.publish(\"orientation\", \"left\", \"set\", \"Determines the placement and start/end angle.\", [\"left\", \"right\"]);\n","import { SVGWidget } from \"@hpcc-js/common\";\nimport { scaleLinear as d3ScaleLinear } from \"d3-scale\";\n\nexport class QuartileCandlestick extends SVGWidget {\n protected _g;\n protected _leftLine;\n protected _rightLine;\n protected _midLine;\n protected _midOuterRect;\n protected _midInnerRect1;\n protected _midInnerRect2;\n protected _q0text;\n protected _q1text;\n protected _q2text;\n protected _q3text;\n protected _q4text;\n protected _q0val;\n protected _q1val;\n protected _q2val;\n protected _q3val;\n protected _q4val;\n constructor() {\n super();\n }\n enter(domNode, element) {\n super.enter(domNode, element);\n this._g = element.append(\"g\");\n this._leftLine = this._g.append(\"rect\");\n this._rightLine = this._g.append(\"rect\");\n this._midLine = this._g.append(\"rect\");\n this._midOuterRect = this._g.append(\"rect\");\n this._midInnerRect1 = this._g.append(\"rect\");\n this._midInnerRect2 = this._g.append(\"rect\");\n this._q0text = this._g.append(\"text\");\n this._q1text = this._g.append(\"text\");\n this._q2text = this._g.append(\"text\");\n this._q3text = this._g.append(\"text\");\n this._q4text = this._g.append(\"text\");\n this._q0val = this._g.append(\"text\");\n this._q1val = this._g.append(\"text\");\n this._q2val = this._g.append(\"text\");\n this._q3val = this._g.append(\"text\");\n this._q4val = this._g.append(\"text\");\n }\n update(domNode, element) {\n super.update(domNode, element);\n const valueSize = (this.orientation() === \"horizontal\" ? this.width() : this.height()) - this.lineWidth();\n const domainSize = this.orientation() === \"horizontal\" ? this.height() : this.width();\n const scale = d3ScaleLinear()\n .domain([\n this.data()[0],\n this.data()[4]\n ])\n .range([\n this.edgePadding(),\n valueSize - this.edgePadding()\n ])\n ;\n const candleWidth = this.candleWidth_exists() ? this.candleWidth() : domainSize;\n const lineWidth = this.lineWidth();\n const lineColor = this.lineColor();\n const roundedCorners = this.roundedCorners();\n const q0x = this.edgePadding();\n let q1x = scale(this.data()[1]);\n let q2x = scale(this.data()[2]);\n let q3x = scale(this.data()[3]);\n const dataTop = -candleWidth / 2;\n const dataBottom = candleWidth / 2;\n const upperTextRotation = this.upperTextRotation();\n const lowerTextRotation = this.lowerTextRotation();\n const padding = this.textPadding();\n const labelFontSize = this.labelFontSize();\n const valueFontSize = this.valueFontSize();\n const sz = Math.max(labelFontSize, valueFontSize);\n const q4x = valueSize - q0x;\n if (sz > 0) {\n while (q1x - q0x < sz) {\n q1x += sz;\n }\n while (q2x - q1x < sz) {\n q2x += sz;\n }\n while (q3x - q2x < sz) {\n q3x += sz;\n }\n while (q4x - q3x < sz) {\n q3x -= sz;\n }\n while (q3x - q2x < sz) {\n q2x -= sz;\n }\n while (q2x - q1x < sz) {\n q1x -= sz;\n }\n }\n let transX = (-valueSize / 2) - (this.lineWidth() / 2);\n let transY = 0;\n let rotate = 0;\n const s = 1;\n let textScale = 1;\n let labelAnchor = \"start\";\n let valueAnchor = \"end\";\n if (this.orientation() === \"vertical\") {\n transX = 0;\n transY = valueSize / 2 + (this.lineWidth() / 2);\n rotate = -90;\n labelAnchor = \"end\";\n valueAnchor = \"start\";\n textScale = -1;\n }\n this._g\n .style(\"shape-rendering\", \"crispEdges\")\n .attr(\"transform\", `translate(${transX},${transY})rotate(${rotate})scale(${s})`)\n ;\n this._leftLine\n .attr(\"fill\", lineColor)\n .attr(\"height\", candleWidth)\n .attr(\"width\", lineWidth)\n .attr(\"x\", q0x)\n .attr(\"y\", dataTop)\n .attr(\"rx\", roundedCorners)\n .attr(\"ry\", roundedCorners)\n ;\n this._rightLine\n .attr(\"class\", \"right-line\")\n .attr(\"fill\", lineColor)\n .attr(\"height\", candleWidth)\n .attr(\"width\", lineWidth)\n .attr(\"x\", q4x)\n .attr(\"y\", dataTop)\n .attr(\"rx\", roundedCorners)\n .attr(\"ry\", roundedCorners)\n ;\n this._midLine\n .attr(\"fill\", lineColor)\n .attr(\"height\", lineWidth)\n .attr(\"width\", q4x - q0x)\n .attr(\"x\", q0x)\n .attr(\"y\", -lineWidth / 2)\n ;\n this._midOuterRect\n .attr(\"fill\", lineColor)\n .attr(\"height\", candleWidth)\n .attr(\"width\", q3x - q1x)\n .attr(\"x\", q1x)\n .attr(\"y\", dataTop)\n .attr(\"rx\", roundedCorners)\n .attr(\"ry\", roundedCorners)\n ;\n this._midInnerRect1\n .attr(\"fill\", this.innerRectColor())\n .attr(\"height\", candleWidth - (lineWidth * 2))\n .attr(\"width\", q2x - (q1x + (lineWidth * 2)))\n .attr(\"x\", q1x + lineWidth)\n .attr(\"y\", lineWidth - (candleWidth / 2))\n .attr(\"rx\", roundedCorners * 0.618)\n .attr(\"ry\", roundedCorners * 0.618)\n ;\n this._midInnerRect2\n .attr(\"fill\", this.innerRectColor())\n .attr(\"height\", candleWidth - (lineWidth * 2))\n .attr(\"width\", q3x - q2x - lineWidth)\n .attr(\"x\", q2x)\n .attr(\"y\", lineWidth - (candleWidth / 2))\n .attr(\"rx\", roundedCorners * 0.618)\n .attr(\"ry\", roundedCorners * 0.618)\n ;\n this._q0text\n .attr(\"height\", candleWidth)\n .attr(\"width\", q3x - q1x)\n .attr(\"display\", this.showLabels() ? null : \"none\")\n .attr(\"fill\", this.textColor())\n .attr(\"x\", 0)\n .attr(\"y\", 0)\n .attr(\"transform\", `translate(${q0x}, ${dataTop - padding})rotate(${upperTextRotation})scale(${textScale})`)\n .attr(\"font-size\", labelFontSize)\n .attr(\"text-anchor\", labelAnchor)\n .attr(\"alignment-baseline\", \"hanging\")\n .text(this.columns()[0])\n ;\n this._q1text\n .attr(\"height\", candleWidth)\n .attr(\"width\", q3x - q1x)\n .attr(\"display\", this.showLabels() ? null : \"none\")\n .attr(\"fill\", this.textColor())\n .attr(\"x\", 0)\n .attr(\"y\", 0)\n .attr(\"transform\", `translate(${q1x}, ${dataTop - padding})rotate(${upperTextRotation})scale(${textScale})`)\n .attr(\"font-size\", labelFontSize)\n .attr(\"text-anchor\", labelAnchor)\n .attr(\"alignment-baseline\", \"middle\")\n .text(this.columns()[1])\n ;\n this._q2text\n .attr(\"height\", candleWidth)\n .attr(\"width\", q3x - q1x)\n .attr(\"display\", this.showLabels() ? null : \"none\")\n .attr(\"fill\", this.textColor())\n .attr(\"x\", 0)\n .attr(\"y\", 0)\n .attr(\"transform\", `translate(${q2x}, ${dataTop - padding})rotate(${upperTextRotation})scale(${textScale})`)\n .attr(\"font-size\", labelFontSize)\n .attr(\"text-anchor\", labelAnchor)\n .attr(\"alignment-baseline\", \"middle\")\n .text(this.columns()[2])\n ;\n this._q3text\n .attr(\"height\", candleWidth)\n .attr(\"width\", q3x - q1x)\n .attr(\"display\", this.showLabels() ? null : \"none\")\n .attr(\"fill\", this.textColor())\n .attr(\"x\", 0)\n .attr(\"y\", 0)\n .attr(\"transform\", `translate(${q3x}, ${dataTop - padding})rotate(${upperTextRotation})scale(${textScale})`)\n .attr(\"font-size\", labelFontSize)\n .attr(\"text-anchor\", labelAnchor)\n .attr(\"alignment-baseline\", \"middle\")\n .text(this.columns()[3])\n ;\n this._q4text\n .attr(\"height\", candleWidth)\n .attr(\"width\", q3x - q1x)\n .attr(\"display\", this.showLabels() ? null : \"none\")\n .attr(\"fill\", this.textColor())\n .attr(\"x\", 0)\n .attr(\"y\", 0)\n .attr(\"transform\", `translate(${q4x + lineWidth}, ${dataTop - padding})rotate(${upperTextRotation})scale(${textScale})`)\n .attr(\"font-size\", labelFontSize)\n .attr(\"text-anchor\", labelAnchor)\n .attr(\"alignment-baseline\", \"baseline\")\n .text(this.columns()[4])\n ;\n this._q0val\n .attr(\"height\", candleWidth)\n .attr(\"width\", q3x - q1x)\n .attr(\"display\", this.showValues() ? null : \"none\")\n .attr(\"fill\", this.textColor())\n .attr(\"x\", 0)\n .attr(\"y\", 0)\n .attr(\"transform\", `translate(${q0x}, ${dataBottom + padding})rotate(${lowerTextRotation})scale(${textScale})`)\n .attr(\"font-size\", valueFontSize)\n .attr(\"text-anchor\", valueAnchor)\n .attr(\"alignment-baseline\", \"hanging\")\n .text(this.data()[0])\n ;\n this._q1val\n .attr(\"height\", candleWidth)\n .attr(\"width\", q3x - q1x)\n .attr(\"display\", this.showValues() ? null : \"none\")\n .attr(\"fill\", this.textColor())\n .attr(\"x\", 0)\n .attr(\"y\", 0)\n .attr(\"transform\", `translate(${q1x}, ${dataBottom + padding})rotate(${lowerTextRotation})scale(${textScale})`)\n .attr(\"font-size\", valueFontSize)\n .attr(\"text-anchor\", valueAnchor)\n .attr(\"alignment-baseline\", \"middle\")\n .text(this.data()[1])\n ;\n this._q2val\n .attr(\"height\", candleWidth)\n .attr(\"width\", q3x - q1x)\n .attr(\"display\", this.showValues() ? null : \"none\")\n .attr(\"fill\", this.textColor())\n .attr(\"x\", 0)\n .attr(\"y\", 0)\n .attr(\"transform\", `translate(${q2x}, ${dataBottom + padding})rotate(${lowerTextRotation})scale(${textScale})`)\n .attr(\"font-size\", valueFontSize)\n .attr(\"text-anchor\", valueAnchor)\n .attr(\"alignment-baseline\", \"middle\")\n .text(this.data()[2])\n ;\n this._q3val\n .attr(\"height\", candleWidth)\n .attr(\"width\", q3x - q1x)\n .attr(\"display\", this.showValues() ? null : \"none\")\n .attr(\"fill\", this.textColor())\n .attr(\"x\", 0)\n .attr(\"y\", 0)\n .attr(\"transform\", `translate(${q3x}, ${dataBottom + padding})rotate(${lowerTextRotation})scale(${textScale})`)\n .attr(\"font-size\", valueFontSize)\n .attr(\"text-anchor\", valueAnchor)\n .attr(\"alignment-baseline\", \"middle\")\n .text(this.data()[3])\n ;\n this._q4val\n .attr(\"height\", candleWidth)\n .attr(\"width\", q3x - q1x)\n .attr(\"display\", this.showValues() ? null : \"none\")\n .attr(\"fill\", this.textColor())\n .attr(\"x\", 0)\n .attr(\"y\", 0)\n .attr(\"transform\", `translate(${q4x + lineWidth}, ${dataBottom + padding})rotate(${lowerTextRotation})scale(${textScale})`)\n .attr(\"font-size\", valueFontSize)\n .attr(\"text-anchor\", valueAnchor)\n .attr(\"alignment-baseline\", \"baseline\")\n .text(this.data()[4])\n ;\n }\n}\nQuartileCandlestick.prototype._class += \" chart_QuartileCandlestick\";\n\nexport interface QuartileCandlestick {\n orientation(): \"horizontal\" | \"vertical\";\n orientation(_: \"horizontal\" | \"vertical\"): this;\n textPadding(): number;\n textPadding(_: number): this;\n edgePadding(): number;\n edgePadding(_: number): this;\n candleWidth(): number;\n candleWidth(_: number): this;\n candleWidth_exists(): boolean;\n lineWidth(): number;\n lineWidth(_: number): this;\n lineColor(): string;\n lineColor(_: string): this;\n innerRectColor(): string;\n innerRectColor(_: string): this;\n lowerTextRotation(): number;\n lowerTextRotation(_: number): this;\n upperTextRotation(): number;\n upperTextRotation(_: number): this;\n roundedCorners(): number;\n roundedCorners(_: number): this;\n labelFontSize(): number;\n labelFontSize(_: number): this;\n valueFontSize(): number;\n valueFontSize(_: number): this;\n textColor(): string;\n textColor(_: string): this;\n showLabels(): boolean;\n showLabels(_: boolean): this;\n showValues(): boolean;\n showValues(_: boolean): this;\n}\nQuartileCandlestick.prototype.publish(\"textColor\", \"black\", \"html-color\", \"Color of label and value text\");\nQuartileCandlestick.prototype.publish(\"showLabels\", true, \"boolean\", \"If true, labels will be shown\");\nQuartileCandlestick.prototype.publish(\"showValues\", true, \"boolean\", \"If true, values will be shown\");\nQuartileCandlestick.prototype.publish(\"orientation\", \"horizontal\", \"set\", \"Determines layout\", [\"horizontal\", \"vertical\"]);\nQuartileCandlestick.prototype.publish(\"valueFontSize\", 12, \"number\", \"Font size of value text (pixels)\");\nQuartileCandlestick.prototype.publish(\"labelFontSize\", 12, \"number\", \"Font size of label text (pixels)\");\nQuartileCandlestick.prototype.publish(\"roundedCorners\", 8, \"number\", \"Radius of rounded rect corners (pixels)\");\nQuartileCandlestick.prototype.publish(\"lineWidth\", 4, \"number\", \"Width of lines (pixels)\");\nQuartileCandlestick.prototype.publish(\"candleWidth\", null, \"number\", \"Height of outer rect (pixels)\", null, {optional: true});\nQuartileCandlestick.prototype.publish(\"textPadding\", 8, \"number\", \"Padding between outer rect and text (pixels)\");\nQuartileCandlestick.prototype.publish(\"edgePadding\", 30, \"number\", \"Padding between outer rect and left/right sides (pixels)\");\nQuartileCandlestick.prototype.publish(\"lineColor\", \"#333\", \"html-color\", \"Color of outer rect and lines\");\nQuartileCandlestick.prototype.publish(\"innerRectColor\", \"white\", \"html-color\", \"Color of the inner rects\");\nQuartileCandlestick.prototype.publish(\"upperTextRotation\", -60, \"number\", \"Rotation of label text (degrees)\");\nQuartileCandlestick.prototype.publish(\"lowerTextRotation\", -60, \"number\", \"Rotation of value text (degrees)\");\n","import { INDChart, ITooltip } from \"@hpcc-js/api\";\nimport { SVGWidget, Utility } from \"@hpcc-js/common\";\nimport { select as d3Select } from \"d3-selection\";\n\nimport \"../src/Radar.css\";\nexport class Radar extends SVGWidget {\n\n constructor() {\n super();\n INDChart.call(this);\n ITooltip.call(this);\n Utility.SimpleSelectionMixin.call(this);\n }\n\n mapShape(shape) {\n switch (shape) {\n case \"rectangle\":\n return \"rect\";\n case \"circle\":\n return \"circle\";\n case \"cross\":\n return \"path\";\n default:\n }\n }\n setPointAttributes(element, x, y) {\n const shape = this.mapShape(this.pointShape());\n const context = this;\n switch (shape) {\n case \"rect\":\n element\n .attr(\"width\", context.pointSize())\n .attr(\"height\", context.pointSize())\n .style(\"fill\", d => this.strokeColor(d.data, d.column, d.value))\n ;\n break;\n case \"circle\":\n element\n .attr(\"r\", context.pointSize() / 2)\n .attr(\"cx\", x)\n .attr(\"cy\", y)\n .style(\"fill\", d => this.strokeColor(d.data, d.column, d.value))\n ;\n break;\n case \"path\":\n const half_size = context.pointSize() / 2;\n element\n .attr(\"d\", function (d: any) {\n return \"M\" + (x - half_size) + \" \" + (y - half_size) + \" \" +\n \"L\" + (x + half_size) + \" \" + (y + half_size) + \" \" +\n \"M\" + (x - half_size) + \" \" + (y + half_size) + \" \" +\n \"L\" + (x + half_size) + \" \" + (y - half_size);\n })\n .style(\"stroke\", d => this.strokeColor(d.data, d.column, d.value))\n ;\n break;\n default:\n }\n }\n enter(domNode, element) {\n super.enter(domNode, element);\n this._selection.widgetElement(element);\n\n this\n .tooltipHTML(d => {\n return this.tooltipFormat({ label: d.label, series: d.column, value: d.value });\n })\n ;\n }\n update(domNode, element) {\n super.update(domNode, element);\n this._palette = this._palette.switch(this.paletteID());\n const context = this;\n const h = this.height();\n const w = this.width();\n const half_h = (h / 2);\n const half_w = (w / 2);\n\n const columns = this.columns();\n const data = this.data();\n const flatData = this.flattenData(columns, data).map((d: any, idx: number) => {\n d.shape = this.mapShape(this.pointShape());\n d.column = columns[d.colIdx];\n d.row = data[idx];\n return d;\n });\n const domain_points = [];\n const arc = this.degrees2radians(360 / this.data().length);\n const max_label_h = this.fontSize();\n let max_label_w = 0;\n flatData.filter(n => n.colIdx === 1).forEach(n => {\n const isize = super.textSize(n.label, `${this.fontFamily()}`, this.fontSize());\n if (max_label_w < isize.width) max_label_w = isize.width;\n });\n const radius = Math.min(half_h - max_label_h, half_w - max_label_w);\n const labels = element\n .selectAll(\".label\")\n .data(flatData.filter(n => n.colIdx === 1))\n ;\n const max_val = Math.max.apply(context, flatData.map(n => n.value));\n labels.enter()\n .append(\"text\")\n .attr(\"class\", \"label\")\n .attr(\"text-anchor\", \"middle\")\n .merge(labels)\n .attr(\"font-size\", this.fontSize())\n .attr(\"font-family\", this.fontFamily())\n .each(function (this: SVGElement, n, i) {\n const xy = context.polar2cartesian(radius, (i * arc) - (Math.PI / 2));\n domain_points.push(xy.map(n => n * context.labelPaddingRatio()));\n let text_anchor = \"middle\";\n const _x = Math.round(xy[0]);\n text_anchor = _x > 0 ? \"start\" : text_anchor;\n text_anchor = _x < 0 ? \"end\" : text_anchor;\n d3Select(this)\n .attr(\"text-anchor\", text_anchor)\n .attr(\"x\", xy[0])\n .attr(\"y\", xy[1])\n ;\n })\n .text(n => n.label)\n ;\n labels.exit().remove();\n const domains = element\n .selectAll(\".domain\")\n .data(flatData.filter(n => n.colIdx === 1));\n domains.enter()\n .append(\"line\")\n .classed(\"domain\", true)\n .style(\"stroke\", \"#000\")\n .style(\"stroke-opacity\", \"0.75\")\n .style(\"stroke-width\", \"1px\")\n .merge(domains)\n .attr(\"x1\", 0)\n .attr(\"y1\", 0)\n .attr(\"x2\", (n, i) => domain_points[i][0])\n .attr(\"y2\", (n, i) => domain_points[i][1]);\n domains.exit().remove();\n const value_guides = element\n .selectAll(\".value_guide\")\n .data(this.valueGuideRatios())\n ;\n value_guides.enter()\n .append(\"polygon\")\n .classed(\"value_guide\", true)\n .style(\"stroke\", \"grey\")\n .style(\"stroke-opacity\", \"0.75\")\n .style(\"stroke-width\", \"0.3px\")\n .merge(value_guides)\n .each(function (mult, i) {\n const poly_points = [];\n domain_points.forEach((domain_point, row_idx) => {\n poly_points.push([\n domain_point[0] * mult,\n domain_point[1] * mult\n ]);\n });\n d3Select(this)\n .attr(\"points\", poly_points.join(\" \"))\n .attr(\"stroke\", \"rgb(0, 0, 0)\")\n .attr(\"stroke-opacity\", 0.75)\n .attr(\"stroke-width\", 0.3)\n .attr(\"fill-opacity\", 0)\n ;\n })\n ;\n value_guides.exit().remove();\n\n const value_guide_text = element\n .selectAll(\".value_guide_text\")\n .data(this.valueGuideRatios())\n ;\n value_guide_text.enter()\n .append(\"text\")\n .attr(\"class\", \"value_guide_text\")\n .attr(\"text-anchor\", \"start\")\n .attr(\"font-size\", this.fontSize())\n .attr(\"font-family\", this.fontFamily())\n .merge(value_guide_text)\n .attr(\"x\", 2)\n .attr(\"y\", mult => domain_points[0][1] * mult)\n .text((mult, i) => Math.round(mult * max_val))\n ;\n value_guides.exit().remove();\n\n // Polygon shapes ---\n const series_polygons = element\n .selectAll(\".area\")\n .data(columns.filter((n, i) => i > 0));\n series_polygons.enter()\n .append(\"polygon\")\n .attr(\"class\", \"area\")\n .style(\"stroke-opacity\", \"0.75\")\n .style(\"stroke-width\", \"0.3px\")\n .merge(series_polygons)\n .style(\"stroke\", d => this.strokeColor([], d, 0))\n .style(\"fill\", d => this.fillColor([], d, 0))\n .style(\"fill-opacity\", this.fillOpacity())\n .attr(\"points\", (d, col_idx) => {\n return domain_points.map((domain_point, row_idx) => {\n const val = data[row_idx][col_idx + 1];\n const val_mult = val === 0 ? 0 : val / max_val;\n return domain_point[0] * val_mult + \",\" + domain_point[1] * val_mult;\n }).join(\" \");\n });\n series_polygons.exit().remove();\n\n // Points ---\n const point_elm = element\n .selectAll(\".point\")\n .data(flatData);\n point_elm.enter()\n .append(\"g\")\n .attr(\"class\", \"point\")\n .on(\"mouseout.tooltip\", context.tooltip.hide)\n .on(\"mousemove.tooltip\", context.tooltip.show)\n .on(\"click\", function (d: any, _idx) {\n const data_row = context.data()[d.rowIdx];\n const row_obj = context.rowToObj(data_row);\n const selected = context._selection.selected(this);\n context.click(row_obj, context.columns()[d.colIdx], selected);\n })\n .on(\"dblclick\", function (d: any, _idx) {\n context.dblclick(context.rowToObj(context.data()[d.rowIdx]), d.column, context._selection.selected(this));\n })\n .each(function (d) {\n const element = d3Select(this);\n element.append(\"circle\")\n .attr(\"class\", \"pointSelection\")\n .attr(\"r\", context.pointSize())\n .call(context._selection.enter.bind(context._selection))\n ;\n element.append(context.mapShape(context.pointShape()))\n .attr(\"class\", \"pointShape\")\n ;\n })\n .merge(point_elm)\n .each(function (d) {\n const element = d3Select(this);\n const val_mult = d.value === 0 ? 0 : d.value / max_val;\n const x = domain_points[d.rowIdx][0] * val_mult;\n const y = domain_points[d.rowIdx][1] * val_mult;\n element.select(\".pointSelection\")\n .attr(\"cx\", x)\n .attr(\"cy\", y)\n ;\n\n const pointElement = element.select(\".pointShape\")\n .style(\"stroke\", context.strokeColor(d.row, d.column, d.value))\n .style(\"fill\", context.fillColor(d.row, d.column, d.value))\n ;\n context.setPointAttributes(pointElement, x, y);\n })\n ;\n point_elm.exit().remove();\n }\n\n polar2cartesian(r, theta) {\n return [r * Math.cos(theta), r * Math.sin(theta)];\n }\n cartesian2polar(x, y) {\n return [Math.atan2(y, x), Math.sqrt(x * x + y * y)];\n }\n degrees2radians(d) {\n return d / 57.295779513;\n }\n radians2degrees(r) {\n return r * 57.295779513;\n }\n point_in_polygon(point, vs) {\n const x = point[0];\n const y = point[1];\n let inside = false;\n for (let i = 0, j = vs.length - 1; i < vs.length; j = i++) {\n const xi = vs[i][0];\n const yi = vs[i][1];\n const xj = vs[j][0];\n const yj = vs[j][1];\n const intersect = ((yi > y) !== (yj > y))\n && (x < (xj - xi) * (y - yi) / (yj - yi) + xi);\n if (intersect) inside = !inside;\n }\n return inside;\n }\n}\nRadar.prototype._class += \" chart_Radar\";\nRadar.prototype.implements(INDChart.prototype);\nRadar.prototype.implements(ITooltip.prototype);\nRadar.prototype.mixin(Utility.SimpleSelectionMixin);\n\nexport interface Radar {\n labelPaddingRatio(): number;\n labelPaddingRatio(_: number): this;\n fillOpacity(): number;\n fillOpacity(_: number): this;\n fontFamily(): string;\n fontFamily(_: string): this;\n fontSize(): number;\n fontSize(_: number): this;\n valueGuideRatios(): any;\n valueGuideRatios(_: any): this;\n valueGuideFontSize(): number;\n valueGuideFontSize(_: number): this;\n valueGuideFontFamily(): string;\n valueGuideFontFamily(_: string): this;\n paletteID(): string;\n paletteID(_: string): this;\n pointShape(): string;\n pointShape(_: string): this;\n pointSize(): number;\n pointSize(_: number): this;\n\n // INDChart\n _palette;\n fillColor(row, column, value): string;\n strokeColor(row, column, value): string;\n textColor(row, column, value): string;\n click(row, column, selected): void;\n dblclick(row, column, selected): void;\n\n // ITooltip\n tooltip;\n tooltipHTML(_): string;\n tooltipFormat(_): string;\n\n _selection;\n}\n\nRadar.prototype.publish(\"paletteID\", \"default\", \"set\", \"Color palette for this widget\", Radar.prototype._palette.switch());\nRadar.prototype.publish(\"pointShape\", \"cross\", \"set\", \"pointShape\", [\"circle\", \"rectangle\", \"cross\"]);\nRadar.prototype.publish(\"pointSize\", 6, \"number\", \"Point Size\", null, { range: { min: 1, step: 1, max: 200 } });\nRadar.prototype.publish(\"valueGuideRatios\", [0.2, 0.4, 0.6, 0.8, 1], \"array\", \"Array of values between 0 and 1 that are multiplied by the widget radius to produce guide lines\");\nRadar.prototype.publish(\"fillOpacity\", 0.66, \"number\", \"Opacity of the data polygon(s)\");\nRadar.prototype.publish(\"fontFamily\", \"\", \"string\", \"fontFamily\");\nRadar.prototype.publish(\"fontSize\", 16, \"number\", \"fontSize\");\nRadar.prototype.publish(\"labelPaddingRatio\", 0.9, \"number\", \"labelPaddingRatio\");\n","import { INDChart, ITooltip } from \"@hpcc-js/api\";\nimport { InputField, SVGWidget, Utility } from \"@hpcc-js/common\";\nimport { interpolate as d3Interpolate } from \"d3-interpolate\";\nimport { scaleBand as d3ScaleBand, scaleLinear as d3ScaleLinear } from \"d3-scale\";\nimport { arc as d3Arc } from \"d3-shape\";\n\nimport \"../src/RadialBar.css\";\n\nexport class RadialBar extends SVGWidget {\n static __inputs: InputField[] = [{\n id: \"label\",\n type: \"any\"\n }, {\n id: \"values\",\n type: \"number\"\n }];\n\n private _domainScale = d3ScaleBand();\n private _valueScale = d3ScaleLinear();\n private _d3Arc = d3Arc<[string, number]>()\n .startAngle(0)\n .endAngle((d) => this._valueScale(d[1]))\n ;\n\n protected _arcs;\n protected _axialAxis;\n protected _radialAxis;\n\n constructor() {\n super();\n INDChart.call(this);\n ITooltip.call(this);\n Utility.SimpleSelectionMixin.call(this);\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n this._selection.widgetElement(element);\n this.tooltipHTML(d => {\n return this.tooltipFormat({ label: d[0], value: d[1] });\n });\n\n this._radialAxis = element.append(\"g\")\n .attr(\"class\", \"r axis\")\n ;\n this._axialAxis = element.append(\"g\")\n .attr(\"class\", \"a axis\")\n ;\n this._arcs = element.append(\"g\")\n .attr(\"class\", \"data\")\n ;\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n const context = this;\n const maxValue = Math.max(this.valueDomainHigh_exists() ? this.valueDomainHigh() : 0, ...this.data().map(d => d[1]));\n\n this._valueScale\n .domain([0, maxValue])\n .range([0, this.radians(this.valueMaxAngle())])\n ;\n\n const ticks = this._valueScale.ticks(this.tickCount());\n\n const maxTextWidth = this.textSize(ticks.map(d => \"\" + d), \"Verdana\", 12).width;\n const chartRadius = (Math.min(this.width() - (10 + maxTextWidth) * 2, this.height() - (10 + 12) * 2) / 2);\n\n // Domain Axis (x-axis) ---\n const domainData = this.data().map(d => d[0]);\n\n this._domainScale\n .domain(domainData)\n .range([0, chartRadius])\n .padding(this.domainPadding())\n ;\n const domainPadding = this._domainScale.step() * this._domainScale.padding();\n\n const domainCircles = this._radialAxis.selectAll(\"circle\").data(domainData);\n domainCircles.enter().append(\"circle\")\n .attr(\"fill\", \"transparent\")\n .merge(domainCircles)\n .attr(\"r\", d => this._domainScale(d) + this._domainScale.step() - domainPadding / 2)\n ;\n domainCircles.exit().remove();\n\n const domainText = this._radialAxis.selectAll(\".arc-text\").data(domainData);\n domainText.enter().append(\"text\")\n .attr(\"class\", \"arc-text\")\n .attr(\"x\", -4)\n .attr(\"alignment-baseline\", \"middle\")\n .attr(\"text-anchor\", \"end\")\n .merge(domainText)\n .attr(\"y\", d => -this._domainScale(d) - this._domainScale.bandwidth() / 2)\n .text(d => d);\n domainText.exit().remove();\n\n // Value Axis (y-axis) ---\n const valueLines = this._axialAxis.selectAll(\"line\").data(ticks);\n valueLines.enter().append(\"line\")\n .merge(valueLines)\n .attr(\"x2\", d => chartRadius * Math.cos(this._valueScale(d) - this.radians(90)))\n .attr(\"y2\", d => chartRadius * Math.sin(this._valueScale(d) - this.radians(90)))\n ;\n valueLines.exit().remove();\n\n const valueText = this._axialAxis.selectAll(\"text\").data(ticks);\n valueText.enter().append(\"text\")\n .style(\"dominant-baseline\", \"central\")\n .merge(valueText)\n .attr(\"x\", d => (chartRadius + 10) * Math.cos(this._valueScale(d) - this.radians(90)))\n .attr(\"y\", d => (chartRadius + 10) * Math.sin(this._valueScale(d) - this.radians(90)))\n .style(\"text-anchor\", d => {\n const middleZone = 20;\n const angle = this.degrees(this._valueScale(d));\n if (angle >= 0 && angle <= middleZone ||\n angle >= 180 - middleZone && angle <= 180 + middleZone ||\n angle >= 360 - middleZone && angle <= 360\n ) {\n return \"middle\";\n } else if (angle >= 180 && angle <= 360) {\n return \"end\";\n } else {\n return null;\n }\n })\n .text(d => d)\n ;\n valueText.exit().remove();\n\n const valueColumn = this.columns().length > 1 ? this.columns()[1] : \"\";\n // Data (arcs) ---\n this._d3Arc\n .innerRadius(d => this._domainScale(d[0]))\n .outerRadius(d => this._domainScale(d[0]) + this._domainScale.bandwidth())\n ;\n const arcs = this._arcs.selectAll(\"path\").data(this.data(), d => d[0]);\n arcs.enter().append(\"path\")\n .attr(\"class\", \"arc\")\n .call(this._selection.enter.bind(this._selection))\n .on(\"mouseout.tooltip\", this.tooltip.hide)\n .on(\"mousemove.tooltip\", this.tooltip.show)\n .on(\"click\", function (d: any, _idx) {\n context.click(context.rowToObj(d), valueColumn, context._selection.selected(this));\n })\n .on(\"dblclick\", function (d: any, _idx) {\n context.dblclick(context.rowToObj(d), valueColumn, context._selection.selected(this));\n })\n .merge(arcs)\n .style(\"fill\", (d, i) => this.fillColor(d, d[0], d[1]))\n .transition()\n .delay((d, i) => i * this.transitionDelay())\n .duration(this.transitionDuration())\n .attrTween(\"d\", (d, indx) => {\n const interpolate = d3Interpolate(d._current || 0, d[1]);\n d._current = d[1];\n return t => this._d3Arc([d[0], interpolate(t)], indx);\n })\n ;\n arcs.exit().remove();\n }\n\n degrees(radians) {\n return radians * 180 / Math.PI;\n }\n\n radians(degrees) {\n return degrees * Math.PI / 180;\n }\n\n}\nRadialBar.prototype._class += \" chart_RadialBar\";\nRadialBar.prototype.implements(INDChart.prototype);\nRadialBar.prototype.implements(ITooltip.prototype);\nRadialBar.prototype.mixin(Utility.SimpleSelectionMixin);\n\nexport interface RadialBar {\n paletteID(): string;\n paletteID(_: string): this;\n tickCount(): number;\n tickCount(_: number): this;\n domainPadding(): number;\n domainPadding(_: number): this;\n valueMaxAngle(): number;\n valueMaxAngle(_: number): this;\n valueDomainHigh(): number;\n valueDomainHigh(_: number): this;\n valueDomainHigh_exists(): boolean;\n transitionDelay(): number;\n transitionDelay(_: number): this;\n transitionDuration(): number;\n transitionDuration(_: number): this;\n\n // INDChart\n _palette;\n fillColor(row, column, value): string;\n strokeColor(row, column, value): string;\n textColor(row, column, value): string;\n click(row, column, selected): void;\n dblclick(row, column, selected): void;\n\n // ITooltip\n tooltip;\n tooltipHTML(_): string;\n tooltipFormat(_): string;\n\n // SimpleSelectionMixin\n _selection;\n}\n\nRadialBar.prototype.publish(\"paletteID\", \"default\", \"set\", \"Color palette for this widget\", RadialBar.prototype._palette.switch());\nRadialBar.prototype.publish(\"tickCount\", 10, \"number\", \"Number of ticks to display\");\nRadialBar.prototype.publish(\"domainPadding\", 0.25, \"number\", \"Padding between chart edge and container edge (0..1)\");\nRadialBar.prototype.publish(\"valueMaxAngle\", 270, \"number\", \"Maximum angular length of a bar (degrees)\");\nRadialBar.prototype.publish(\"valueDomainHigh\", null, \"number\", \"Value domain high\", undefined, { optional: true });\nRadialBar.prototype.publish(\"transitionDelay\", 100, \"number\", \"Delay between the start of each row animation (ms)\");\nRadialBar.prototype.publish(\"transitionDuration\", 750, \"number\", \"Duration of a row's animation (ms)\");\n","import { format as d3Format, HTMLWidget, Palette } from \"@hpcc-js/common\";\nimport { QuartileCandlestick } from \"./QuartileCandlestick.ts\";\nimport { Scatter } from \"./Scatter.ts\";\n\nconst rainbow = Palette.rainbow(\"Blues\");\nconst palette = Palette.ordinal(\"Quartile\", [rainbow(100, 0, 100), rainbow(50, 0, 100), rainbow(50, 0, 100), rainbow(75, 0, 100)]);\npalette(\"Std. Dev.\");\npalette(\"MinMax\");\npalette(\"25%\");\npalette(\"50%\");\n\ntype View = \"min_max\" | \"25_75\" | \"normal\";\ntype Tick = { label: string, value: number };\ntype Ticks = Tick[];\ntype AxisTick = { label: string, value: string };\ntype AxisTicks = AxisTick[];\n\nfunction myFormatter(format: string): (num: number) => string {\n const formatter = d3Format(format);\n return function (num: number) {\n const strVal = (Math.round(num * 100) / 100).toString();\n if (strVal.length <= 4) return strVal;\n return formatter(num);\n };\n}\n\nexport type StatChartView = \"min_max\" | \"25_75\" | \"normal\";\nexport type Quartiles = [number, number, number, number, number];\nexport type Data = [[number, number, number, number, number, number, number]];\n\nexport class StatChart extends HTMLWidget {\n\n protected _selectElement: any;\n protected _tickFormatter: (_: number) => string;\n\n protected _bellCurve: Scatter = new Scatter()\n .columns([\"\", \"Std. Dev.\"])\n .paletteID(\"Quartile\")\n .interpolate_default(\"basis\")\n .pointSize(0)\n .xAxisType(\"linear\")\n .xAxisOverlapMode(\"none\")\n .xAxisTickFormat(\",\")\n .yAxisHidden(true)\n .yAxisDomainLow(0)\n .yAxisDomainHigh(110)\n .yAxisGuideLines(false) as Scatter\n ;\n\n protected _candle = new QuartileCandlestick()\n .columns([\"Min\", \"25%\", \"50%\", \"75%\", \"Max\"])\n .edgePadding(0)\n .roundedCorners(1)\n .lineWidth(1)\n .upperTextRotation(-90)\n .lowerTextRotation(-90)\n .labelFontSize(0)\n .valueFontSize(0)\n .lineColor(rainbow(90, 0, 100))\n .innerRectColor(rainbow(10, 0, 100))\n ;\n\n constructor() {\n super();\n this\n .columns([\"Min\", \"25%\", \"50%\", \"75%\", \"Max\", \"Mean\", \"Std. Dev.\"])\n ;\n }\n\n protected stdDev(degrees: number): number {\n return this.mean() + degrees * this.standardDeviation();\n }\n\n protected formatStdDev(degrees: number): string {\n return this._tickFormatter(this.stdDev(degrees));\n }\n\n protected quartile(q: 0 | 1 | 2 | 3 | 4): number {\n return this.quartiles()[q];\n }\n\n protected formatQ(q: 0 | 1 | 2 | 3 | 4): string {\n return this._tickFormatter(this.quartile(q));\n }\n\n protected domain(mode: View): [number, number] {\n switch (mode) {\n case \"25_75\":\n return [this.quartile(1), this.quartile(3)];\n case \"normal\":\n return [this.stdDev(-4), this.stdDev(4)];\n case \"min_max\":\n default:\n return [this.quartile(0), this.quartile(4)];\n }\n }\n\n protected min(): number {\n return this.quartile(0);\n }\n\n protected max(): number {\n return this.quartile(4);\n }\n\n data(): Data;\n data(_: Data): this;\n data(_?: Data): Data | this {\n if (!arguments.length) return [[...this.quartiles(), this.mean(), this.standardDeviation()]];\n const row = _[0];\n this.quartiles([row[0], row[1], row[2], row[3], row[4]]);\n this.mean(row[5]);\n this.standardDeviation(row[6]);\n return this;\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n\n this._bellCurve.target(element.append(\"div\").node());\n\n this._candle.target(element.append(\"div\").node());\n\n this._selectElement = element.append(\"div\")\n .style(\"position\", \"absolute\")\n .style(\"top\", \"0px\")\n .style(\"right\", \"0px\").append(\"select\")\n .on(\"change\", () => {\n this.view(this._selectElement.node().value);\n this.lazyRender();\n })\n ;\n this._selectElement.append(\"option\").attr(\"value\", \"min_max\").text(\"Min / Max\");\n this._selectElement.append(\"option\").attr(\"value\", \"25_75\").text(\"25% / 75%\");\n this._selectElement.append(\"option\").attr(\"value\", \"normal\").text(\"Normal\");\n }\n\n protected bellTicks(mode: View): AxisTicks {\n let ticks: Ticks;\n switch (mode) {\n case \"25_75\":\n ticks = [\n { label: this.formatQ(1), value: this.quartile(1) },\n { label: this.formatQ(2), value: this.quartile(2) },\n { label: this.formatQ(3), value: this.quartile(3) }\n ];\n break;\n case \"normal\":\n ticks = [\n { label: this.formatStdDev(-4), value: this.stdDev(-4) },\n { label: \"-3σ\", value: this.stdDev(-3) },\n { label: \"-2σ\", value: this.stdDev(-2) },\n { label: \"-1σ\", value: this.stdDev(-1) },\n { label: this.formatStdDev(0), value: this.stdDev(0) },\n { label: \"+1σ\", value: this.stdDev(1) },\n { label: \"+2σ\", value: this.stdDev(2) },\n { label: \"+3σ\", value: this.stdDev(3) },\n { label: this.formatStdDev(4), value: this.stdDev(4) }\n ];\n break;\n case \"min_max\":\n default:\n ticks = [\n { label: this.formatQ(0), value: this.quartile(0) },\n { label: this.formatQ(1), value: this.quartile(1) },\n { label: this.formatQ(2), value: this.quartile(2) },\n { label: this.formatQ(3), value: this.quartile(3) },\n { label: this.formatQ(4), value: this.quartile(4) }\n ];\n }\n\n const [domainLow, domainHigh] = this.domain(this._selectElement.node().value);\n return ticks\n .filter(sd => sd.value >= domainLow && sd.value <= domainHigh)\n .map(sd => ({ label: sd.label, value: sd.value.toString() }))\n ;\n }\n\n updateScatter() {\n const mode = this._selectElement.node().value;\n const [domainLow, domainHigh] = this.domain(mode);\n const padding = (domainHigh - domainLow) * (this.domainPadding() / 100);\n\n this._bellCurve\n .xAxisDomainLow(domainLow - padding)\n .xAxisDomainHigh(domainHigh + padding)\n .xAxisTicks(this.bellTicks(mode))\n .data([\n [this.stdDev(-4), 0],\n [this.stdDev(-3), 0.3],\n [this.stdDev(-2), 5],\n [this.stdDev(-1), 68],\n [this.stdDev(0), 100],\n [this.stdDev(1), 68],\n [this.stdDev(2), 5],\n [this.stdDev(3), 0.3],\n [this.stdDev(4), 0]\n ])\n .resize({ width: this.width(), height: this.height() - this.candleHeight() })\n .render()\n ;\n }\n\n updateCandle() {\n const candleX = this._bellCurve.dataPos(this.quartile(0));\n const candleW = this._bellCurve.dataPos(this.quartile(4)) - candleX;\n this._candle\n .resize({ width: this.width(), height: this.candleHeight() })\n .pos({ x: (candleX + candleW / 2) + 2, y: this.candleHeight() / 2 })\n .width(candleW)\n .candleWidth(this.candleHeight())\n .data(this.quartiles())\n .render()\n ;\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n this._tickFormatter = myFormatter(this.tickFormat());\n this._selectElement.node().value = this.view();\n this.updateScatter();\n this.updateCandle();\n }\n\n exit(domNode, element) {\n this._bellCurve.target(null);\n this._candle.target(null);\n this._selectElement.remove();\n\n super.exit(domNode, element);\n }\n}\nStatChart.prototype._class += \" chart_StatChart\";\n\nexport interface StatChart {\n view(): StatChartView;\n view(_: StatChartView): this;\n\n tickFormat(): string;\n tickFormat(_: string): this;\n candleHeight(): number;\n candleHeight(_: number): this;\n domainPadding(): number;\n domainPadding(_: number): this;\n\n mean(): number;\n mean(_: number): this;\n standardDeviation(): number;\n standardDeviation(_: number): this;\n quartiles(): Quartiles;\n quartiles(_: Quartiles): this;\n}\nStatChart.prototype.publish(\"view\", \"min_max\", \"set\", \"View\", [\"min_max\", \"25_75\", \"normal\"]);\n\nStatChart.prototype.publish(\"tickFormat\", \".2e\", \"string\", \"X-Axis Tick Format\");\nStatChart.prototype.publish(\"candleHeight\", 20, \"number\", \"Height of candle widget (pixels)\");\nStatChart.prototype.publish(\"domainPadding\", 10, \"number\", \"Domain value padding\");\n\nStatChart.prototype.publish(\"mean\", .5, \"number\", \"Mean\");\nStatChart.prototype.publish(\"standardDeviation\", .125, \"number\", \"Standard Deviation (σ)\");\nStatChart.prototype.publish(\"quartiles\", [0, .25, .5, .75, 1], \"object\", \"Quartiles (Min, 25%, 50%, 75%, Max)\");\n","import { Scatter } from \"./Scatter.ts\";\n\nexport class Step extends Scatter {\n constructor() {\n super();\n\n this\n .interpolate_default(\"step\")\n ;\n }\n}\nStep.prototype._class += \" chart_Step\";\n","import { I2DChart } from \"@hpcc-js/api\";\nimport { HTMLWidget } from \"@hpcc-js/common\";\nimport { rgb as d3Rgb } from \"d3-color\";\nimport { select as d3Select } from \"d3-selection\";\n\nimport \"../src/Summary.css\";\n\nconst TEXT = \"text\";\nconst HTML = \"html\";\n\nexport class Summary extends HTMLWidget {\n protected _playIntervalIdx = 0;\n protected _mainDiv;\n protected _headerDiv;\n protected _textDiv;\n\n constructor() {\n super();\n this._tag = \"div\";\n\n this._drawStartPos = \"center\";\n this.playInterval(this.playInterval());\n }\n\n lookupFieldIdx(propID, defaultIdx?: number) {\n let retVal = defaultIdx;\n if (this[propID + \"_exists\"]()) {\n retVal = this.columns().indexOf(this[propID]());\n if (retVal < 0) {\n return undefined;\n }\n }\n return retVal;\n }\n\n lookupFieldText(propID, defaultIdx?: number) {\n if (this[propID + \"_exists\"]()) {\n return this[propID]();\n }\n if (defaultIdx !== undefined) {\n return this.columns()[defaultIdx] || \"\";\n }\n return \"\";\n }\n\n currentRow() {\n return this.data()[this._playIntervalIdx];\n }\n\n summaryData() {\n let labelFieldIdx; // undefined\n if (!this.hideLabel()) {\n labelFieldIdx = this.lookupFieldIdx(\"labelColumn\", 0);\n }\n const iconFieldIdx = this.lookupFieldIdx(\"iconColumn\");\n const valueFieldIdx = this.lookupFieldIdx(\"valueColumn\", 1);\n let moreIconIdx; // undefined\n let moreTextIdx; // undefined\n if (!this.hideMore()) {\n moreIconIdx = this.lookupFieldIdx(\"moreIconColumn\");\n moreTextIdx = this.lookupFieldIdx(\"moreTextColumn\");\n }\n const colorFillIdx = this.lookupFieldIdx(\"colorFillColumn\");\n const colorStrokeIdx = this.lookupFieldIdx(\"colorStrokeColumn\");\n return this.formattedData().map(function (row) {\n return {\n icon: iconFieldIdx === undefined ? this.icon() : row[iconFieldIdx],\n label: labelFieldIdx === undefined ? \"\" : row[labelFieldIdx],\n value: row[valueFieldIdx],\n moreIcon: moreIconIdx === undefined ? (this.hideMore() ? \"\" : this.moreIcon()) : row[moreIconIdx],\n moreText: moreTextIdx === undefined ? (this.hideMore() ? \"\" : this.moreText()) : row[moreTextIdx],\n fill: colorFillIdx === undefined ? this.colorFill() : row[colorFillIdx],\n stroke: colorStrokeIdx === undefined ? this.colorStroke() : row[colorStrokeIdx]\n };\n }, this);\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n this._mainDiv = element.append(\"div\")\n ;\n const context = this;\n this._headerDiv = this._mainDiv.append(\"h2\")\n .on(\"click\", function () {\n context.click(context.rowToObj(context.currentRow()), context.lookupFieldText(\"valueColumn\", 1), true);\n })\n .on(\"dblclick\", function () {\n context.dblclick(context.rowToObj(context.currentRow()), context.lookupFieldText(\"valueColumn\", 1), true);\n })\n ;\n this._textDiv = this._mainDiv.append(\"div\")\n .attr(\"class\", \"text\")\n .on(\"click\", function () {\n context.click(context.rowToObj(context.currentRow()), context.lookupFieldText(\"labelColumn\", 0), true);\n })\n .on(\"dblclick\", function () {\n context.dblclick(context.rowToObj(context.currentRow()), context.lookupFieldText(\"labelColumn\", 0), true);\n })\n ;\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n if (this.data().length) {\n\n }\n const data = this.summaryData();\n if (this._playIntervalIdx >= data.length) {\n this._playIntervalIdx = 0;\n }\n const row: any = this._playIntervalIdx < data.length ? data[this._playIntervalIdx] : [\"\", \"\"];\n element\n .style(\"width\", this.fixedSize() ? this.minWidth_exists() ? this.minWidth() + \"px\" : null : \"100%\")\n .style(\"height\", this.fixedSize() ? this.minHeight_exists() ? this.minHeight() + \"px\" : null : \"100%\")\n ;\n this._mainDiv\n .attr(\"class\", \"content bgIcon \" + row.icon)\n .transition()\n .style(\"background-color\", row.fill)\n .style(\"color\", row.stroke)\n .style(\"min-width\", this.minWidth_exists() ? this.minWidth() + \"px\" : null)\n .style(\"min-height\", this.minHeight_exists() ? this.minHeight() + \"px\" : null)\n .style(\"font-size\", this.iconFontSize() + \"px\")\n ;\n this._headerDiv\n .transition()\n .style(\"color\", row.stroke)\n .style(\"font-size\", this.headerFontSize() + \"px\")\n [this.valueHTML() ? HTML : TEXT](row.value)\n ;\n this._textDiv\n .style(\"font-size\", this.textFontSize() + \"px\")\n [this.labelHTML() ? HTML : TEXT](row.label)\n ;\n const context = this;\n const moreDivs = this._mainDiv.selectAll(\".more\").data([row]);\n const moreDivsEnter = moreDivs.enter()\n .append(\"div\")\n .attr(\"class\", \"more\")\n .on(\"click\", function (d) {\n context.click(context.rowToObj(context.currentRow()), context.lookupFieldText(\"moreTextColumn\") || \"more\", true);\n })\n .each(function () {\n const element2 = d3Select(this);\n element2.append(\"i\");\n element2.append(\"span\");\n })\n ;\n const moreDivsUpdate = moreDivsEnter\n .merge(moreDivs)\n .style(\"display\", this.hideMoreWrapper() ? \"none\" : null)\n .style(\"font-size\", this.moreFontSize() + \"px\")\n .style(\"height\", this.moreWrapperHeight_exists() ? this.moreWrapperHeight() + \"px\" : null)\n .transition()\n .style(\"background-color\", d3Rgb(row.fill).darker(0.75).toString())\n ;\n moreDivsUpdate\n .select(\"i\")\n .attr(\"class\", function (d) {\n return \"fa \" + d.moreIcon;\n })\n ;\n if (this.moreTextHTML()) {\n moreDivsUpdate.select(\"span\")\n .each(function (d) {\n this.innerHTML = d.moreText;\n });\n } else {\n moreDivsUpdate.select(\"span\").text(d => d.moreText);\n }\n moreDivs.exit().remove();\n }\n\n exit(domNode, element) {\n super.exit(domNode, element);\n }\n}\nSummary.prototype._class += \" chart_Summary\";\nSummary.prototype.implements(I2DChart.prototype);\n\nexport interface Summary {\n iconColumn(): string;\n iconColumn(_: string): this;\n iconColumn_exists(): boolean;\n icon(): string;\n icon(_: string): this;\n icon_exists(): boolean;\n\n headerFontSize(): number;\n headerFontSize(_: number): this;\n textFontSize(): number;\n textFontSize(_: number): this;\n moreFontSize(): number;\n moreFontSize(_: number): this;\n iconFontSize(): number;\n iconFontSize(_: number): this;\n\n hideLabel(): boolean;\n hideLabel(_: boolean): this;\n hideLabel_exists(): boolean;\n labelColumn(): string;\n labelColumn(_: string): this;\n labelColumn_exists(): boolean;\n labelHTML(): boolean;\n labelHTML(_: boolean): this;\n labelHTML_exists(): boolean;\n\n valueColumn(): string;\n valueColumn(_: string): this;\n valueColumn_exists(): boolean;\n valueHTML(): boolean;\n valueHTML(_: boolean): this;\n valueHTML_exists(): boolean;\n\n hideMore(): boolean;\n hideMore(_: boolean): this;\n hideMore_exists(): boolean;\n hideMoreWrapper(): boolean;\n hideMoreWrapper(_: boolean): this;\n moreWrapperHeight(): number;\n moreWrapperHeight(_: number): this;\n moreWrapperHeight_exists(): boolean;\n moreIconColumn(): string;\n moreIconColumn(_: string): this;\n moreIconColumn_exists(): boolean;\n moreIcon(): string;\n moreIcon(_: string): this;\n moreIcon_exists(): boolean;\n moreTextColumn(): string;\n moreTextColumn(_: string): this;\n moreTextColumn_exists(): boolean;\n moreText(): string;\n moreText(_: string): this;\n moreText_exists(): boolean;\n moreTextHTML(): boolean;\n moreTextHTML(_: boolean): this;\n moreTextHTML_exists(): boolean;\n\n colorFillColumn(): string;\n colorFillColumn(_: string): this;\n colorFillColumn_exists(): boolean;\n colorFill(): string;\n colorFill(_: string): this;\n colorFill_exists(): boolean;\n colorStrokeColumn(): string;\n colorStrokeColumn(_: string): this;\n colorStrokeColumn_exists(): boolean;\n colorStroke(): string;\n colorStroke(_: string): this;\n colorStroke_exists(): boolean;\n\n fixedSize(): boolean;\n fixedSize(_: boolean): this;\n fixedSize_exists(): boolean;\n minWidth(): number;\n minWidth(_: number): this;\n minWidth_exists(): boolean;\n minHeight(): number;\n minHeight(_: number): this;\n minHeight_exists(): boolean;\n playInterval(): number;\n playInterval(_: number): this;\n playInterval_exists(): boolean;\n\n // I2DChart ---\n click(row, column, selected);\n dblclick(row, column, selected);\n}\n\nSummary.prototype.publish(\"iconColumn\", null, \"set\", \"Select Icon Column\", function () { return this.columns(); }, { optional: true });\nSummary.prototype.publish(\"icon\", \"fa-briefcase\", \"string\", \"FA Char icon class\", null, { disable: (w) => w.iconColumn() });\n\nSummary.prototype.publish(\"headerFontSize\", null, \"number\", \"headerFontSize\");\nSummary.prototype.publish(\"textFontSize\", null, \"number\", \"textFontSize\");\nSummary.prototype.publish(\"moreFontSize\", null, \"number\", \"moreFontSize\");\nSummary.prototype.publish(\"iconFontSize\", null, \"number\", \"iconFontSize\");\n\nSummary.prototype.publish(\"hideLabel\", false, \"boolean\", \"Hide label column\");\nSummary.prototype.publish(\"labelColumn\", null, \"set\", \"Select display value\", function () { return this.columns(); }, { optional: true, disable: (w) => w.hideLabel() });\nSummary.prototype.publish(\"labelHTML\", false, \"boolean\", \"Allow HTML\", null, { disable: (w) => w.hideLabel() });\n\nSummary.prototype.publish(\"valueColumn\", null, \"set\", \"Select display value\", function () { return this.columns(); }, { optional: true });\nSummary.prototype.publish(\"valueHTML\", false, \"boolean\", \"Allow HTML\");\n\nSummary.prototype.publish(\"hideMore\", false, \"boolean\", \"Hide More Information\");\nSummary.prototype.publish(\"hideMoreWrapper\", false, \"boolean\", \"Hide More Information Wrapper\");\nSummary.prototype.publish(\"moreWrapperHeight\", null, \"number\", \"Height of the 'more' text wrapper (pixels)\");\nSummary.prototype.publish(\"moreIconColumn\", null, \"set\", \"Select More Icon Column\", function () { return this.columns(); }, { optional: true, disable: (w) => w.hideMore() });\nSummary.prototype.publish(\"moreIcon\", \"fa-info-circle\", \"string\", \"FA Char icon class\", null, { disable: (w) => w.hideMore() || w.moreIconColumn() });\nSummary.prototype.publish(\"moreTextColumn\", null, \"set\", \"Select display value\", function () { return this.columns(); }, { optional: true, disable: (w) => w.hideMore() });\nSummary.prototype.publish(\"moreText\", \"More Info\", \"string\", \"More text\", null, { disable: (w) => w.hideMore() || w.moreTextColumn() });\nSummary.prototype.publish(\"moreTextHTML\", false, \"boolean\", \"Allow HTML\", null, { disable: (w) => w.hideMore() });\n\nSummary.prototype.publish(\"colorFillColumn\", null, \"set\", \"Column for color\", function () { return this.columns(); }, { optional: true });\nSummary.prototype.publish(\"colorFill\", \"#3498db\", \"html-color\", \"Fill Color\", null, { disable: (w) => w.colorFillColumn() });\nSummary.prototype.publish(\"colorStrokeColumn\", null, \"set\", \"Column for color\", function () { return this.columns(); }, { optional: true });\nSummary.prototype.publish(\"colorStroke\", \"#ffffff\", \"html-color\", \"Fill Color\", null, { disable: (w) => w.colorStrokeColumn() });\n\nSummary.prototype.publish(\"fixedSize\", true, \"boolean\", \"Fix Size to Min Width/Height\");\nSummary.prototype.publish(\"minWidth\", 225, \"number\", \"Minimum Width\");\nSummary.prototype.publish(\"minHeight\", 150, \"number\", \"Minimum Height\");\nSummary.prototype.publish(\"playInterval\", null, \"number\", \"Play Interval\", null, { optional: true });\n\nconst playInterval = Summary.prototype.playInterval;\nSummary.prototype.playInterval = function (_?: number): number | any {\n const retVal = playInterval.apply(this, arguments);\n if (arguments.length) {\n if (this._playIntervalHandle) {\n clearInterval(this._playIntervalHandle);\n }\n const context = this;\n if (_) {\n this._playIntervalHandle = setInterval(function () {\n context._playIntervalIdx++;\n if (context._renderCount && context.data().length) {\n context.render();\n }\n }, _);\n }\n }\n return retVal;\n};\n","import { I2DChart } from \"@hpcc-js/api\";\nimport { CanvasWidget, Utility } from \"@hpcc-js/common\";\n\nexport class SummaryC extends CanvasWidget {\n protected _playIntervalIdx = 0;\n\n constructor() {\n super();\n I2DChart.call(this);\n this.playInterval(this.playInterval());\n }\n\n currentRow() {\n return this.data()[this._playIntervalIdx];\n }\n\n enter(domNode, element) {\n super.enter.apply(this, arguments);\n const { width, height } = this.size();\n domNode.height = height;\n domNode.width = width;\n }\n\n update(domNode, element) {\n super.update.apply(this, arguments);\n const context = this;\n if (this._playIntervalIdx >= this.data().length) {\n this._playIntervalIdx = 0;\n }\n const size = this.size();\n const minDimension = Math.min(size.width, size.height);\n const sizeRatio = this.fontSizeRatio();\n const labelIdx = this.columns().indexOf(this.labelColumn());\n const valueIdx = this.columns().indexOf(this.valueColumn());\n const bgColorIdx = this.columns().indexOf(this.colorFillColumn());\n const fontColorIdx = this.columns().indexOf(this.colorStrokeColumn());\n const iconIdx = this.columns().indexOf(this.iconColumn());\n const icon = iconIdx !== -1 ? this.currentRow()[iconIdx] : this.icon();\n const label = labelIdx !== -1 ? this.currentRow()[labelIdx] : \"\";\n const value = valueIdx !== -1 ? this.currentRow()[valueIdx] : \"\";\n const bgColor = bgColorIdx !== -1 ? this.currentRow()[bgColorIdx] : this.colorFill();\n const fontColor = fontColorIdx !== -1 ? this.currentRow()[fontColorIdx] : this.colorStroke();\n\n let mainFontSize = size.height * (sizeRatio - this.paddingSizeRatio());\n const subFontSize = size.height * (1 - sizeRatio - this.paddingSizeRatio());\n const iconSize = size.height * (this.iconSizeRatio() - this.paddingSizeRatio());\n const p = minDimension * this.paddingSizeRatio();\n const ctx = domNode.getContext(\"2d\");\n\n ctx.clearRect(0, 0, size.width, size.height);\n\n const fontFamily = context.fontFamily();\n\n ctx.fillStyle = bgColor;\n ctx.fillRect(0, 0, size.width, size.height);\n\n ctx.globalAlpha = this.iconOpacity();\n drawIcon(Utility.faChar(icon), iconSize, context.iconAnchor());\n\n ctx.globalAlpha = this.valueOpacity();\n mainFontSize = drawText(value, p, mainFontSize, context.valueAnchor());\n\n ctx.globalAlpha = this.labelOpacity();\n drawText(label, mainFontSize + p, subFontSize, context.labelAnchor());\n\n function drawText(text, y, fontSize, anchorMode) {\n ctx.textBaseline = \"top\";\n ctx.font = `${fontSize}px ${fontFamily}`;\n ctx.fillStyle = fontColor;\n let measurement = ctx.measureText(text);\n if (measurement.width > (size.width - (p * 2))) {\n const fontSizeMult = (size.width - (p * 2)) / measurement.width;\n fontSize = fontSize * fontSizeMult;\n ctx.font = `${fontSize}px ${fontFamily}`;\n measurement = ctx.measureText(text);\n }\n const x = getTextOffsetX(measurement.width, anchorMode);\n ctx.fillText(text, x, y);\n return fontSize;\n }\n\n function drawIcon(text, fontSize, anchorMode) {\n if (typeof text === \"undefined\") return;\n ctx.textBaseline = context.iconBaseline();\n ctx.font = `${fontSize}px FontAwesome`;\n ctx.fillStyle = fontColor;\n let measurement = ctx.measureText(text);\n if (measurement.width > (size.width - (p * 2))) {\n const fontSizeMult = (size.width - (p * 2)) / measurement.width;\n ctx.font = `${fontSize * fontSizeMult}px FontAwesome`;\n measurement = ctx.measureText(text);\n }\n const x = getTextOffsetX(measurement.width, anchorMode);\n const y = getTextOffsetY(context.iconBaseline());\n ctx.fillText(text, x, y);\n }\n\n function getTextOffsetX(width, anchorMode) {\n switch (anchorMode) {\n case \"start\":\n return p;\n case \"middle\":\n return (size.width / 2) - (width / 2);\n case \"end\":\n return size.width - width - p;\n }\n }\n function getTextOffsetY(anchorMode) {\n switch (anchorMode) {\n case \"top\":\n return p;\n case \"middle\":\n return size.height / 2;\n case \"bottom\":\n return size.height - p;\n }\n }\n }\n}\nSummaryC.prototype._class += \" chart_SummaryC\";\nSummaryC.prototype.implements(I2DChart.prototype);\n\nexport interface SummaryC {\n iconColumn(): string;\n iconColumn(_: string): this;\n iconColumn_exists(): boolean;\n icon(): string;\n icon(_: string): this;\n icon_exists(): boolean;\n iconOpacity(): number;\n iconOpacity(_: number): this;\n\n fontFamily(): string;\n fontFamily(_: string): this;\n\n labelColumn(): string;\n labelColumn(_: string): this;\n labelColumn_exists(): boolean;\n labelOpacity(): number;\n labelOpacity(_: number): this;\n\n valueColumn(): string;\n valueColumn(_: string): this;\n valueColumn_exists(): boolean;\n valueOpacity(): number;\n valueOpacity(_: number): this;\n\n fontSizeRatio(): number;\n fontSizeRatio(_: number): this;\n\n colorFillColumn(): string;\n colorFillColumn(_: string): this;\n colorFillColumn_exists(): boolean;\n colorFill(): string;\n colorFill(_: string): this;\n colorFill_exists(): boolean;\n colorStrokeColumn(): string;\n colorStrokeColumn(_: string): this;\n colorStrokeColumn_exists(): boolean;\n colorStroke(): string;\n colorStroke(_: string): this;\n colorStroke_exists(): boolean;\n\n fixedSize(): boolean;\n fixedSize(_: boolean): this;\n fixedSize_exists(): boolean;\n minWidth(): number;\n minWidth(_: number): this;\n minWidth_exists(): boolean;\n minHeight(): number;\n minHeight(_: number): this;\n minHeight_exists(): boolean;\n playInterval(): number;\n playInterval(_: number): this;\n playInterval_exists(): boolean;\n paddingSizeRatio(): number;\n paddingSizeRatio(_: number): this;\n iconSizeRatio(): number;\n iconSizeRatio(_: number): this;\n\n iconAnchor(): \"start\" | \"middle\" | \"end\";\n iconAnchor(_: \"start\" | \"middle\" | \"end\"): this;\n labelAnchor(): \"start\" | \"middle\" | \"end\";\n labelAnchor(_: \"start\" | \"middle\" | \"end\"): this;\n valueAnchor(): \"start\" | \"middle\" | \"end\";\n valueAnchor(_: \"start\" | \"middle\" | \"end\"): this;\n\n iconBaseline(): \"top\" | \"middle\" | \"bottom\";\n iconBaseline(_: \"top\" | \"middle\" | \"bottom\"): this;\n}\n\nSummaryC.prototype.publish(\"iconBaseline\", \"bottom\", \"string\", \"Text baseline for the icon\", [\"top\", \"middle\", \"bottom\"]);\nSummaryC.prototype.publish(\"iconAnchor\", \"end\", \"set\", \"Anchors the icon either at the start, middle, or end of the summary\", [\"start\", \"middle\", \"end\"]);\nSummaryC.prototype.publish(\"valueAnchor\", \"start\", \"set\", \"Anchors the value either at the start, middle, or end of the summary\", [\"start\", \"middle\", \"end\"]);\nSummaryC.prototype.publish(\"labelAnchor\", \"start\", \"set\", \"Anchors the label either at the start, middle, or end of the summary\", [\"start\", \"middle\", \"end\"]);\nSummaryC.prototype.publish(\"iconColumn\", null, \"set\", \"Select Icon Column\", function () { return this.columns(); }, { optional: true });\nSummaryC.prototype.publish(\"icon\", \"fa-briefcase\", \"string\", \"FA Char icon class\", null, { disable: (w) => w.iconColumn() });\n\nSummaryC.prototype.publish(\"fontFamily\", \"Arial\", \"string\", \"Font Family\");\n\nSummaryC.prototype.publish(\"labelColumn\", null, \"set\", \"Select display value\", function () { return this.columns(); }, { optional: true });\nSummaryC.prototype.publish(\"valueColumn\", null, \"set\", \"Select display value\", function () { return this.columns(); }, { optional: true });\n\nSummaryC.prototype.publish(\"colorFillColumn\", null, \"set\", \"Column for background color\", function () { return this.columns(); }, { optional: true });\nSummaryC.prototype.publish(\"colorFill\", \"#0097e6\", \"html-color\", \"Background Color\", null, { disable: (w) => w.colorFillColumn() });\nSummaryC.prototype.publish(\"colorStrokeColumn\", null, \"set\", \"Column for font color\", function () { return this.columns(); }, { optional: true });\nSummaryC.prototype.publish(\"colorStroke\", \"#2f3640\", \"html-color\", \"Font Color\", null, { disable: (w) => w.colorStrokeColumn() });\n\nSummaryC.prototype.publish(\"fixedSize\", true, \"boolean\", \"Fix Size to Min Width/Height\");\nSummaryC.prototype.publish(\"minWidth\", 225, \"number\", \"Minimum Width\");\nSummaryC.prototype.publish(\"minHeight\", 150, \"number\", \"Minimum Height\");\nSummaryC.prototype.publish(\"playInterval\", null, \"number\", \"Play Interval\", null, { optional: true });\n\nSummaryC.prototype.publish(\"fontSizeRatio\", 0.618, \"number\", \"Ratio between widget height and value font size\");\nSummaryC.prototype.publish(\"valueOpacity\", 1, \"number\", \"Opacity of value text (0..1)\");\nSummaryC.prototype.publish(\"labelOpacity\", 0.9, \"number\", \"Opacity of label text (0..1)\");\nSummaryC.prototype.publish(\"iconOpacity\", 0.3, \"number\", \"Opacity of icon text (0..1)\");\n\nSummaryC.prototype.publish(\"paddingSizeRatio\", 0.1, \"number\", \"Ratio of the smallest dimension for edge padding (0..1)\");\nSummaryC.prototype.publish(\"iconSizeRatio\", 0.9, \"number\", \"Ratio of the height for icon size (0..1)\");\n\nconst playInterval = SummaryC.prototype.playInterval;\nSummaryC.prototype.playInterval = function (_?: number): number | any {\n const retVal = playInterval.apply(this, arguments);\n if (arguments.length) {\n if (this._playIntervalHandle) {\n clearInterval(this._playIntervalHandle);\n }\n const context = this;\n if (_) {\n this._playIntervalHandle = setInterval(function () {\n context._playIntervalIdx++;\n if (context._renderCount && context.data().length) {\n context.render();\n }\n }, _);\n }\n }\n return retVal;\n};\n","// Word cloud layout by Jason Davies, https://www.jasondavies.com/wordcloud/\n// Algorithm due to Jonathan Feinberg, http://static.mrfeinberg.com/bv_ch03.pdf\n\nimport { dispatch } from \"d3-dispatch\";\n\nconst cloudRadians = Math.PI / 180;\nconst cw = 1 << 11 >> 5;\nconst ch = 1 << 11;\n\nexport function d3Cloud() {\n const event = dispatch(\"word\", \"end\");\n const cloud: any = {};\n\n let size = [256, 256];\n let text = cloudText;\n let font = cloudFont;\n let fontSize = cloudFontSize;\n let fontStyle = cloudFontNormal;\n let fontWeight = cloudFontNormal;\n let rotate = cloudRotate;\n let padding = cloudPadding;\n let words = [];\n let spiral = archimedeanSpiral;\n let timeInterval = Infinity;\n let timer = null;\n let random = Math.random;\n let canvas = cloudCanvas;\n\n cloud.canvas = function (_?) {\n return arguments.length ? (canvas = functor(_), cloud) : canvas;\n };\n\n cloud.start = function () {\n const contextAndRatio = getContext(canvas());\n const board = zeroArray((size[0] >> 5) * size[1]);\n let bounds = null;\n const n = words.length;\n let i = -1;\n const tags = [];\n const data = words.map(function (d, i) {\n d.text = text.call(this, d, i);\n d.font = font.call(this, d, i);\n d.style = fontStyle.call(this, d, i);\n d.weight = fontWeight.call(this, d, i);\n d.rotate = rotate.call(this, d, i);\n d.size = ~~fontSize.call(this, d, i);\n d.padding = padding.call(this, d, i);\n return d;\n }).sort(function (a, b) { return b.size - a.size; });\n\n if (timer) clearInterval(timer);\n timer = setInterval(step, 0);\n step();\n\n return cloud;\n\n function step() {\n const start = Date.now();\n while (Date.now() - start < timeInterval && ++i < n && timer) {\n const d = data[i];\n d.x = (size[0] * (random() + .5)) >> 1;\n d.y = (size[1] * (random() + .5)) >> 1;\n cloudSprite(contextAndRatio, d, data, i);\n if (d.hasText && place(board, d, bounds)) {\n tags.push(d);\n event.call(\"word\", cloud, d);\n if (bounds) cloudBounds(bounds, d);\n else bounds = [{ x: d.x + d.x0, y: d.y + d.y0 }, { x: d.x + d.x1, y: d.y + d.y1 }];\n // Temporary hack\n d.x -= size[0] >> 1;\n d.y -= size[1] >> 1;\n }\n }\n if (i >= n) {\n cloud.stop();\n event.call(\"end\", cloud, tags, bounds);\n }\n }\n };\n\n cloud.stop = function () {\n if (timer) {\n clearInterval(timer);\n timer = null;\n }\n return cloud;\n };\n\n function getContext(canvas) {\n canvas.width = canvas.height = 1;\n const ratio = Math.sqrt(canvas.getContext(\"2d\").getImageData(0, 0, 1, 1).data.length >> 2);\n canvas.width = (cw << 5) / ratio;\n canvas.height = ch / ratio;\n\n const context = canvas.getContext(\"2d\");\n context.fillStyle = context.strokeStyle = \"red\";\n context.textAlign = \"center\";\n\n return { context, ratio };\n }\n\n function place(board, tag, bounds) {\n const startX = tag.x;\n const startY = tag.y;\n const maxDelta = Math.sqrt(size[0] * size[0] + size[1] * size[1]);\n const s = spiral(size);\n const dt = random() < .5 ? 1 : -1;\n let t = -dt;\n let dxdy;\n let dx;\n let dy;\n\n // eslint-disable-next-line no-cond-assign\n while (dxdy = s(t += dt)) {\n dx = ~~dxdy[0];\n dy = ~~dxdy[1];\n\n if (Math.min(Math.abs(dx), Math.abs(dy)) >= maxDelta) break;\n\n tag.x = startX + dx;\n tag.y = startY + dy;\n\n if (tag.x + tag.x0 < 0 || tag.y + tag.y0 < 0 ||\n tag.x + tag.x1 > size[0] || tag.y + tag.y1 > size[1]) continue;\n // TODO only check for collisions within current bounds.\n if (!bounds || !cloudCollide(tag, board, size[0])) {\n if (!bounds || collideRects(tag, bounds)) {\n const sprite = tag.sprite;\n const w = tag.width >> 5;\n const sw = size[0] >> 5;\n const lx = tag.x - (w << 4);\n const sx = lx & 0x7f;\n const msx = 32 - sx;\n const h = tag.y1 - tag.y0;\n let x = (tag.y + tag.y0) * sw + (lx >> 5);\n let last;\n for (let j = 0; j < h; j++) {\n last = 0;\n for (let i = 0; i <= w; i++) {\n board[x + i] |= (last << msx) | (i < w ? (last = sprite[j * w + i]) >>> sx : 0);\n }\n x += sw;\n }\n delete tag.sprite;\n return true;\n }\n }\n }\n return false;\n }\n\n cloud.timeInterval = function (_?) {\n return arguments.length ? (timeInterval = _ == null ? Infinity : _, cloud) : timeInterval;\n };\n\n cloud.words = function (_?) {\n return arguments.length ? (words = _, cloud) : words;\n };\n\n cloud.size = function (_?) {\n return arguments.length ? (size = [+_[0], +_[1]], cloud) : size;\n };\n\n cloud.font = function (_?) {\n return arguments.length ? (font = functor(_), cloud) : font;\n };\n\n cloud.fontStyle = function (_?) {\n return arguments.length ? (fontStyle = functor(_), cloud) : fontStyle;\n };\n\n cloud.fontWeight = function (_?) {\n return arguments.length ? (fontWeight = functor(_), cloud) : fontWeight;\n };\n\n cloud.rotate = function (_?) {\n return arguments.length ? (rotate = functor(_), cloud) : rotate;\n };\n\n cloud.text = function (_?) {\n return arguments.length ? (text = functor(_), cloud) : text;\n };\n\n cloud.spiral = function (_?) {\n return arguments.length ? (spiral = spirals[_] || _, cloud) : spiral;\n };\n\n cloud.fontSize = function (_?) {\n return arguments.length ? (fontSize = functor(_), cloud) : fontSize;\n };\n\n cloud.padding = function (_?) {\n return arguments.length ? (padding = functor(_), cloud) : padding;\n };\n\n cloud.random = function (_?) {\n return arguments.length ? (random = _, cloud) : random;\n };\n\n cloud.on = function () {\n const value = event.on.apply(event, arguments);\n return value === event ? cloud : value;\n };\n\n return cloud;\n}\n\nfunction cloudText(d) {\n return d.text;\n}\n\nfunction cloudFont() {\n return \"serif\";\n}\n\nfunction cloudFontNormal() {\n return \"normal\";\n}\n\nfunction cloudFontSize(d) {\n return Math.sqrt(d.value);\n}\n\nfunction cloudRotate() {\n return (~~(Math.random() * 6) - 3) * 30;\n}\n\nfunction cloudPadding() {\n return 1;\n}\n\n// Fetches a monochrome sprite bitmap for the specified text.\n// Load in batches for speed.\nfunction cloudSprite(contextAndRatio, d, data, di) {\n if (d.sprite) return;\n const c = contextAndRatio.context;\n const ratio = contextAndRatio.ratio;\n\n c.clearRect(0, 0, (cw << 5) / ratio, ch / ratio);\n let x = 0;\n let y = 0;\n let maxh = 0;\n const n = data.length;\n --di;\n while (++di < n) {\n d = data[di];\n c.save();\n c.font = d.style + \" \" + d.weight + \" \" + ~~((d.size + 1) / ratio) + \"px \" + d.font;\n let w = c.measureText(d.text + \"m\").width * ratio;\n let h = d.size << 1;\n if (d.rotate) {\n const sr = Math.sin(d.rotate * cloudRadians);\n const cr = Math.cos(d.rotate * cloudRadians);\n const wcr = w * cr;\n const wsr = w * sr;\n const hcr = h * cr;\n const hsr = h * sr;\n w = (Math.max(Math.abs(wcr + hsr), Math.abs(wcr - hsr)) + 0x1f) >> 5 << 5;\n h = ~~Math.max(Math.abs(wsr + hcr), Math.abs(wsr - hcr));\n } else {\n w = (w + 0x1f) >> 5 << 5;\n }\n if (h > maxh) maxh = h;\n if (x + w >= (cw << 5)) {\n x = 0;\n y += maxh;\n maxh = 0;\n }\n if (y + h >= ch) break;\n c.translate((x + (w >> 1)) / ratio, (y + (h >> 1)) / ratio);\n if (d.rotate) c.rotate(d.rotate * cloudRadians);\n c.fillText(d.text, 0, 0);\n if (d.padding) {\n c.lineWidth = 2 * d.padding;\n c.strokeText(d.text, 0, 0);\n }\n c.restore();\n d.width = w;\n d.height = h;\n d.xoff = x;\n d.yoff = y;\n d.x1 = w >> 1;\n d.y1 = h >> 1;\n d.x0 = -d.x1;\n d.y0 = -d.y1;\n d.hasText = true;\n x += w;\n }\n const pixels = c.getImageData(0, 0, (cw << 5) / ratio, ch / ratio).data;\n const sprite = [];\n while (--di >= 0) {\n d = data[di];\n if (!d.hasText) continue;\n const w = d.width;\n const w32 = w >> 5;\n let h = d.y1 - d.y0;\n // Zero the buffer\n for (let i = 0; i < h * w32; i++) sprite[i] = 0;\n x = d.xoff;\n if (x == null) return;\n y = d.yoff;\n let seen = 0;\n let seenRow = -1;\n for (let j = 0; j < h; j++) {\n for (let i = 0; i < w; i++) {\n const k = w32 * j + (i >> 5);\n const m = pixels[((y + j) * (cw << 5) + (x + i)) << 2] ? 1 << (31 - (i % 32)) : 0;\n sprite[k] |= m;\n seen |= m;\n }\n if (seen) seenRow = j;\n else {\n d.y0++;\n h--;\n j--;\n y++;\n }\n }\n d.y1 = d.y0 + seenRow;\n d.sprite = sprite.slice(0, (d.y1 - d.y0) * w32);\n }\n}\n\n// Use mask-based collision detection.\nfunction cloudCollide(tag, board, sw) {\n sw >>= 5;\n const sprite = tag.sprite;\n const w = tag.width >> 5;\n const lx = tag.x - (w << 4);\n const sx = lx & 0x7f;\n const msx = 32 - sx;\n const h = tag.y1 - tag.y0;\n let x = (tag.y + tag.y0) * sw + (lx >> 5);\n let last;\n for (let j = 0; j < h; j++) {\n last = 0;\n for (let i = 0; i <= w; i++) {\n if (((last << msx) | (i < w ? (last = sprite[j * w + i]) >>> sx : 0))\n & board[x + i]) return true;\n }\n x += sw;\n }\n return false;\n}\n\nfunction cloudBounds(bounds, d) {\n const b0 = bounds[0];\n const b1 = bounds[1];\n if (d.x + d.x0 < b0.x) b0.x = d.x + d.x0;\n if (d.y + d.y0 < b0.y) b0.y = d.y + d.y0;\n if (d.x + d.x1 > b1.x) b1.x = d.x + d.x1;\n if (d.y + d.y1 > b1.y) b1.y = d.y + d.y1;\n}\n\nfunction collideRects(a, b) {\n return a.x + a.x1 > b[0].x && a.x + a.x0 < b[1].x && a.y + a.y1 > b[0].y && a.y + a.y0 < b[1].y;\n}\n\nfunction archimedeanSpiral(size) {\n const e = size[0] / size[1];\n return function (t) {\n return [e * (t *= .1) * Math.cos(t), t * Math.sin(t)];\n };\n}\n\nfunction rectangularSpiral(size) {\n const dy = 4;\n const dx = dy * size[0] / size[1];\n let x = 0;\n let y = 0;\n return function (t) {\n const sign = t < 0 ? -1 : 1;\n // See triangular numbers: T_n = n * (n + 1) / 2.\n switch ((Math.sqrt(1 + 4 * sign * t) - sign) & 3) {\n case 0: x += dx; break;\n case 1: y += dy; break;\n case 2: x -= dx; break;\n default: y -= dy; break;\n }\n return [x, y];\n };\n}\n\n// TODO reuse arrays?\nfunction zeroArray(n) {\n const a = [];\n let i = -1;\n while (++i < n) a[i] = 0;\n return a;\n}\n\nfunction cloudCanvas() {\n return document.createElement(\"canvas\");\n}\n\nfunction functor(d) {\n return typeof d === \"function\" ? d : function () { return d; };\n}\n\nconst spirals = {\n archimedean: archimedeanSpiral,\n rectangular: rectangularSpiral\n};\n","import { I2DChart, ITooltip } from \"@hpcc-js/api\";\nimport { d3Event, InputField, SVGWidget, Utility, zoom as d3Zoom } from \"@hpcc-js/common\";\nimport { extent as d3Extent } from \"d3-array\";\nimport { scaleLinear as d3ScaleLinear, scaleLog as d3ScaleLog, scalePow as d3ScalePow, scaleSqrt as d3ScaleSqrt } from \"d3-scale\";\nimport { d3Cloud } from \"./D3Cloud.ts\";\n\nimport \"../src/WordCloud.css\";\n\nexport class WordCloud extends SVGWidget {\n static __inputs: InputField[] = [{\n id: \"label\",\n type: \"string\"\n }, {\n id: \"value\",\n type: \"number\"\n }];\n\n private _prevOffsetX;\n private _prevOffsetY;\n private _prevZoom;\n private _root;\n private _canvas;\n private _d3Cloud;\n private _d3Zoom;\n\n constructor() {\n super();\n I2DChart.call(this);\n ITooltip.call(this);\n Utility.SimpleSelectionMixin.call(this);\n\n this._prevOffsetX = this.offsetX();\n this._prevOffsetY = this.offsetY();\n this._prevZoom = this.zoom();\n }\n\n calcData() {\n return this.data().map(row => {\n return {\n __viz_label: row[0],\n __viz_weight: row[1],\n __viz_row: row\n };\n });\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n this._selection.widgetElement(element);\n\n this._root = element.append(\"g\");\n this._canvas = document.createElement(\"canvas\");\n\n const context = this;\n this._d3Zoom = d3Zoom()\n .scaleExtent([0.1, 10])\n ;\n this._d3Zoom\n .on(\"zoom\", function (evt) {\n const event = d3Event();\n if (event && event.transform) {\n context.zoomed(context._d3Zoom, [event.transform.x, event.transform.y], event.transform.k);\n }\n })\n ;\n element.call(this._d3Zoom);\n\n this\n .tooltipHTML(function (d) {\n const columns = context.columns();\n const series = columns && columns.length ? columns[0] : \"Word\";\n return context.tooltipFormat({ label: d.__viz_label, series, value: d.__viz_weight });\n })\n ;\n }\n\n update(domNode, element) {\n super.update(domNode, element);\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._d3Cloud = d3Cloud()\n .canvas(() => this._canvas)\n ;\n\n this.zoomed(this, [this.offsetX(), this.offsetY()], this.zoom());\n\n const data = this.calcData();\n const context = this;\n const extent = d3Extent(data, function (d: any) { return d.__viz_weight; });\n let scaler;\n switch (this.scaleMode()) {\n case \"log\":\n scaler = d3ScaleLog;\n break;\n case \"sqrt\":\n scaler = d3ScaleSqrt;\n break;\n case \"pow\":\n scaler = d3ScalePow;\n break;\n case \"linear\":\n default:\n scaler = d3ScaleLinear;\n break;\n }\n const scale = scaler().domain(extent).range([this.fontSizeFrom(), this.fontSizeTo()]);\n const angleDomain = d3ScaleLinear().domain([0, context.angleCount() - 1]).range([context.angleFrom(), context.angleTo()]);\n\n this._d3Cloud.stop()\n .size([this.width(), this.height()])\n .words(data)\n .font(this.fontFamily())\n .padding(this.padding())\n .spiral(this.spiral())\n .text(function (d) {\n return d.__viz_label.trim();\n })\n .fontSize(function (d) {\n return scale(d.__viz_weight);\n })\n .rotate((d, i) => angleDomain(i % context.angleCount()))\n .on(\"word\", w => {\n })\n .on(\"end\", draw)\n .start()\n ;\n\n function draw(data, bounds) {\n const text = context._root.selectAll(\"text\")\n .data(data, function (d) { return d.__viz_label ? d.__viz_label.toLowerCase() : \"\"; })\n ;\n text.enter().append(\"text\")\n .attr(\"text-anchor\", \"middle\")\n .call(context._selection.enter.bind(context._selection))\n .text(function (d) { return d.__viz_label; })\n .on(\"click\", function (d) {\n context.click(context.rowToObj(d.__viz_row), context.columns()[1], context._selection.selected(this));\n })\n .on(\"dblclick\", function (d) {\n context.dblclick(context.rowToObj(d.__viz_row), context.columns()[1], context._selection.selected(this));\n })\n .on(\"mouseout.tooltip\", context.tooltip.hide)\n .on(\"mousemove.tooltip\", context.tooltip.show)\n .style(\"opacity\", 1e-6)\n .merge(text)\n .style(\"font-size\", function (d) { return scale(d.__viz_weight) + \"px\"; })\n .style(\"font-family\", context.fontFamily())\n .transition().duration(1000)\n .attr(\"transform\", function (d) { return \"translate(\" + [d.x, d.y] + \")rotate(\" + d.rotate + \")\"; })\n .style(\"fill\", function (d) { return context._palette(d.__viz_label ? d.__viz_label.toLowerCase() : \"\"); })\n .style(\"opacity\", 1)\n ;\n text.exit().transition().duration(1000)\n .style(\"opacity\", 1e-4)\n .remove()\n ;\n }\n }\n\n zoomed(source, translate, scale) {\n if (translate[0] !== this._prevOffsetX || translate[1] !== this._prevOffsetY || scale !== this._prevZoom) {\n this._root.attr(\"transform\", translate);\n switch (source) {\n case this:\n /*\n this._d3Zoom\n .scale(scale)\n .translate(translate)\n ;\n */\n break;\n case this._d3Zoom:\n this.offsetX(translate[0]);\n this.offsetY(translate[1]);\n this.zoom(scale);\n break;\n }\n this._prevOffsetX = translate[0];\n this._prevOffsetY = translate[1];\n this._prevZoom = scale;\n }\n }\n}\nWordCloud.prototype._class += \" chart_WordCloud\";\nWordCloud.prototype.implements(I2DChart.prototype);\nWordCloud.prototype.implements(ITooltip.prototype);\nWordCloud.prototype.mixin(Utility.SimpleSelectionMixin);\n\nexport interface WordCloud {\n\n paletteID(): string;\n paletteID(_: string): this;\n useClonedPalette(): boolean;\n useClonedPalette(_: boolean): this;\n fontFamily(): string;\n fontFamily(_: string): this;\n fontSizeFrom(): number;\n fontSizeFrom(_: number): this;\n fontSizeTo(): number;\n fontSizeTo(_: number): this;\n angleFrom(): number;\n angleFrom(_: number): this;\n angleTo(): number;\n angleTo(_: number): this;\n angleCount(): number;\n angleCount(_: number): this;\n padding(): number;\n padding(_: number): this;\n scaleMode(): string;\n scaleMode(_: string): this;\n spiral(): string;\n spiral(_: string): this;\n offsetX(): number;\n offsetX(_: number): this;\n offsetY(): number;\n offsetY(_: number): this;\n zoom(): number;\n zoom(_: number): this;\n zoom_exists(): boolean;\n\n // I2DChart\n _palette;\n click(row, column, selected): void;\n dblclick(row, column, selected): void;\n\n // ITooltip ---\n tooltip;\n tooltipHTML(_?): any;\n tooltipFormat(opts): any;\n tooltipStyle(): string;\n tooltipStyle(_: string): this;\n tooltipValueFormat(): string;\n tooltipValueFormat(_: string): this;\n tooltipSeriesColor(): string;\n tooltipSeriesColor(_: string): this;\n tooltipLabelColor(): string;\n tooltipLabelColor(_: string): this;\n tooltipValueColor(): string;\n tooltipValueColor(_: string): this;\n tooltipTick(): boolean;\n tooltipTick(_: boolean): this;\n tooltipOffset(): number;\n tooltipOffset(_: number): this;\n tooltipOffset_exists(): boolean;\n\n // SimpleSelectionMixin\n _selection: Utility.SimpleSelection;\n}\n\nWordCloud.prototype.publish(\"paletteID\", \"default\", \"set\", \"Color palette for this widget\", WordCloud.prototype._palette.switch(), { tags: [\"Basic\", \"Shared\"] });\nWordCloud.prototype.publish(\"useClonedPalette\", false, \"boolean\", \"Enable or disable using a cloned palette\", null, { tags: [\"Intermediate\", \"Shared\"] });\n\nWordCloud.prototype.publish(\"fontFamily\", \"Impact\", \"string\", \"Font Name\", null, { tags: [\"Basic\"] });\nWordCloud.prototype.publish(\"fontSizeFrom\", 6, \"number\", \"Minimum font size (pixels)\", null, { tags: [\"Basic\"] });\nWordCloud.prototype.publish(\"fontSizeTo\", 48, \"number\", \"Maximum font size (pixels)\", null, { tags: [\"Basic\"] });\nWordCloud.prototype.publish(\"angleFrom\", -60, \"number\", \"Minimum angle (degrees)\", null, { tags: [\"Basic\"] });\nWordCloud.prototype.publish(\"angleTo\", 60, \"number\", \"Maximum angle (degrees)\", null, { tags: [\"Basic\"] });\nWordCloud.prototype.publish(\"angleCount\", 5, \"number\", \"Number of different angles\", null, { tags: [\"Basic\"] });\nWordCloud.prototype.publish(\"padding\", 0, \"number\", \"Padding between words (pixels)\", null, { tags: [\"Intermediate\"] });\nWordCloud.prototype.publish(\"scaleMode\", \"linear\", \"set\", \"Text scaling mode\", [\"linear\", \"log\", \"sqrt\", \"pow\"], { tags: [\"Intermediate\"] });\nWordCloud.prototype.publish(\"spiral\", \"archimedean\", \"set\", \"Text scaling mode\", [\"archimedean\", \"rectangular\"], { tags: [\"Intermediate\"] });\nWordCloud.prototype.publish(\"offsetX\", 0, \"number\", \"X offset\", null, { tags: [\"Advanced\"] });\nWordCloud.prototype.publish(\"offsetY\", 0, \"number\", \"Y offset\", null, { tags: [\"Advanced\"] });\nWordCloud.prototype.publish(\"zoom\", 1, \"number\", \"Zoom\", null, { tags: [\"Advanced\"] });\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,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,48,49,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,106],"mappings":"u5BCAA,IAAIA,EAAK,KAAK,GACVC,EAAM,EAAID,EACVE,EAAU,KACV,EAAaD,EAAMC,EAEvB,SAAS,IACP,KAAK,IAAM,KAAK,IAChB,KAAK,IAAM,KAAK,IAAM,KACtB,KAAK,EAAI,GAGX,SAAS,IACP,OAAO,IAAI,EAGb,EAAK,UAAY,EAAK,UAAY,CAChC,YAAa,EACb,OAAQ,SAAS,EAAG,GAClB,KAAK,GAAK,KAAO,KAAK,IAAM,KAAK,KAAOC,GAAK,KAAO,KAAK,IAAM,KAAK,KAAOC,IAE7E,UAAW,WACQ,OAAb,KAAK,MACP,KAAK,IAAM,KAAK,IAAK,KAAK,IAAM,KAAK,IACrC,KAAK,GAAK,MAGd,OAAQ,SAAS,EAAG,GAClB,KAAK,GAAK,KAAO,KAAK,KAAOD,GAAK,KAAO,KAAK,KAAOC,IAEvD,iBAAkB,SAAS,EAAI,EAAI,EAAG,GACpC,KAAK,GAAK,MAAQC,EAAM,MAAQC,EAAM,KAAO,KAAK,KAAOH,GAAK,KAAO,KAAK,KAAOC,IAEnF,cAAe,SAAS,EAAI,EAAI,EAAI,EAAI,EAAG,GACzC,KAAK,GAAK,MAAQC,EAAM,MAAQC,EAAM,MAAQ,EAAM,MAAQ,EAAM,KAAO,KAAK,KAAOH,GAAK,KAAO,KAAK,KAAOC,IAE/G,MAAO,SAAS,EAAI,EAAI,EAAI,EAAI,GAC9B,GAAMC,EAAI,GAAMC,EAAI,GAAM,EAAI,GAAM,EAAI,GAAK,EAC7C,IAAIC,EAAK,KAAK,IACVC,EAAK,KAAK,IACV,EAAM,EAAK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