blob: e967f6ec3df25a68a67f992adfefe0ed56814cf6 [file] [log] [blame]
{
"version": 3,
"sources": ["../../../../node_modules/d3-array/src/ascending.js", "../../../../node_modules/d3-array/src/descending.js", "../../../../node_modules/d3-array/src/bisector.js", "../../../../node_modules/d3-array/src/number.js", "../../../../node_modules/d3-array/src/bisect.js", "../../../../node_modules/d3-array/src/count.js", "../../../../node_modules/d3-array/src/cross.js", "../../../../node_modules/d3-array/src/cumsum.js", "../../../../node_modules/d3-array/src/variance.js", "../../../../node_modules/d3-array/src/deviation.js", "../../../../node_modules/d3-array/src/extent.js", "../../../../node_modules/d3-array/src/fsum.js", "../../../../node_modules/internmap/src/index.js", "../../../../node_modules/d3-array/src/identity.js", "../../../../node_modules/d3-array/src/group.js", "../../../../node_modules/d3-array/src/permute.js", "../../../../node_modules/d3-array/src/sort.js", "../../../../node_modules/d3-array/src/groupSort.js", "../../../../node_modules/d3-array/src/ticks.js", "../../../../node_modules/d3-array/src/threshold/sturges.js", "../../../../node_modules/d3-array/src/max.js", "../../../../node_modules/d3-array/src/maxIndex.js", "../../../../node_modules/d3-array/src/min.js", "../../../../node_modules/d3-array/src/minIndex.js", "../../../../node_modules/d3-array/src/quickselect.js", "../../../../node_modules/d3-array/src/greatest.js", "../../../../node_modules/d3-array/src/quantile.js", "../../../../node_modules/d3-array/src/threshold/freedmanDiaconis.js", "../../../../node_modules/d3-array/src/threshold/scott.js", "../../../../node_modules/d3-array/src/mean.js", "../../../../node_modules/d3-array/src/median.js", "../../../../node_modules/d3-array/src/merge.js", "../../../../node_modules/d3-array/src/mode.js", "../../../../node_modules/d3-array/src/pairs.js", "../../../../node_modules/d3-array/src/range.js", "../../../../node_modules/d3-array/src/sum.js", "../../../../node_modules/d3-array/src/reverse.js", "../../../../node_modules/d3-array/src/union.js", "../../../../node_modules/d3-axis/src/identity.js", "../../../../node_modules/d3-axis/src/axis.js", "../../../../node_modules/d3-dispatch/src/dispatch.js", "../../../../node_modules/d3-selection/src/namespaces.js", "../../../../node_modules/d3-selection/src/namespace.js", "../../../../node_modules/d3-selection/src/creator.js", "../../../../node_modules/d3-selection/src/selector.js", "../../../../node_modules/d3-selection/src/selection/select.js", "../../../../node_modules/d3-selection/src/array.js", "../../../../node_modules/d3-selection/src/selectorAll.js", "../../../../node_modules/d3-selection/src/selection/selectAll.js", "../../../../node_modules/d3-selection/src/matcher.js", "../../../../node_modules/d3-selection/src/selection/selectChild.js", "../../../../node_modules/d3-selection/src/selection/selectChildren.js", "../../../../node_modules/d3-selection/src/selection/filter.js", "../../../../node_modules/d3-selection/src/selection/sparse.js", "../../../../node_modules/d3-selection/src/selection/enter.js", "../../../../node_modules/d3-selection/src/constant.js", "../../../../node_modules/d3-selection/src/selection/data.js", "../../../../node_modules/d3-selection/src/selection/exit.js", "../../../../node_modules/d3-selection/src/selection/join.js", "../../../../node_modules/d3-selection/src/selection/merge.js", "../../../../node_modules/d3-selection/src/selection/order.js", "../../../../node_modules/d3-selection/src/selection/sort.js", "../../../../node_modules/d3-selection/src/selection/call.js", "../../../../node_modules/d3-selection/src/selection/nodes.js", "../../../../node_modules/d3-selection/src/selection/node.js", "../../../../node_modules/d3-selection/src/selection/size.js", "../../../../node_modules/d3-selection/src/selection/empty.js", "../../../../node_modules/d3-selection/src/selection/each.js", "../../../../node_modules/d3-selection/src/selection/attr.js", "../../../../node_modules/d3-selection/src/window.js", "../../../../node_modules/d3-selection/src/selection/style.js", "../../../../node_modules/d3-selection/src/selection/property.js", "../../../../node_modules/d3-selection/src/selection/classed.js", "../../../../node_modules/d3-selection/src/selection/text.js", "../../../../node_modules/d3-selection/src/selection/html.js", "../../../../node_modules/d3-selection/src/selection/raise.js", "../../../../node_modules/d3-selection/src/selection/lower.js", "../../../../node_modules/d3-selection/src/selection/append.js", "../../../../node_modules/d3-selection/src/selection/insert.js", "../../../../node_modules/d3-selection/src/selection/remove.js", "../../../../node_modules/d3-selection/src/selection/clone.js", "../../../../node_modules/d3-selection/src/selection/datum.js", "../../../../node_modules/d3-selection/src/selection/on.js", "../../../../node_modules/d3-selection/src/selection/dispatch.js", "../../../../node_modules/d3-selection/src/selection/iterator.js", "../../../../node_modules/d3-selection/src/selection/index.js", "../../../../node_modules/d3-selection/src/select.js", "../../../../node_modules/d3-selection/src/sourceEvent.js", "../../../../node_modules/d3-selection/src/pointer.js", "../../../../node_modules/d3-color/src/define.js", "../../../../node_modules/d3-color/src/color.js", "../../../../node_modules/d3-color/src/math.js", "../../../../node_modules/d3-color/src/lab.js", "../../../../node_modules/d3-color/src/cubehelix.js", "../../../../node_modules/d3-interpolate/src/basis.js", "../../../../node_modules/d3-interpolate/src/basisClosed.js", "../../../../node_modules/d3-interpolate/src/constant.js", "../../../../node_modules/d3-interpolate/src/color.js", "../../../../node_modules/d3-interpolate/src/rgb.js", "../../../../node_modules/d3-interpolate/src/numberArray.js", "../../../../node_modules/d3-interpolate/src/array.js", "../../../../node_modules/d3-interpolate/src/date.js", "../../../../node_modules/d3-interpolate/src/number.js", "../../../../node_modules/d3-interpolate/src/object.js", "../../../../node_modules/d3-interpolate/src/string.js", "../../../../node_modules/d3-interpolate/src/value.js", "../../../../node_modules/d3-interpolate/src/round.js", "../../../../node_modules/d3-interpolate/src/transform/decompose.js", "../../../../node_modules/d3-interpolate/src/transform/parse.js", "../../../../node_modules/d3-interpolate/src/transform/index.js", "../../../../node_modules/d3-interpolate/src/hsl.js", "../../../../node_modules/d3-interpolate/src/lab.js", "../../../../node_modules/d3-interpolate/src/hcl.js", "../../../../node_modules/d3-interpolate/src/cubehelix.js", "../../../../node_modules/d3-interpolate/src/piecewise.js", "../../../../node_modules/d3-interpolate/src/quantize.js", "../../../../node_modules/d3-timer/src/timer.js", "../../../../node_modules/d3-timer/src/timeout.js", "../../../../node_modules/d3-transition/src/transition/schedule.js", "../../../../node_modules/d3-transition/src/interrupt.js", "../../../../node_modules/d3-transition/src/selection/interrupt.js", "../../../../node_modules/d3-transition/src/transition/tween.js", "../../../../node_modules/d3-transition/src/transition/interpolate.js", "../../../../node_modules/d3-transition/src/transition/attr.js", "../../../../node_modules/d3-transition/src/transition/attrTween.js", "../../../../node_modules/d3-transition/src/transition/delay.js", "../../../../node_modules/d3-transition/src/transition/duration.js", "../../../../node_modules/d3-transition/src/transition/ease.js", "../../../../node_modules/d3-transition/src/transition/easeVarying.js", "../../../../node_modules/d3-transition/src/transition/filter.js", "../../../../node_modules/d3-transition/src/transition/merge.js", "../../../../node_modules/d3-transition/src/transition/on.js", "../../../../node_modules/d3-transition/src/transition/remove.js", "../../../../node_modules/d3-transition/src/transition/select.js", "../../../../node_modules/d3-transition/src/transition/selectAll.js", "../../../../node_modules/d3-transition/src/transition/selection.js", "../../../../node_modules/d3-transition/src/transition/style.js", "../../../../node_modules/d3-transition/src/transition/styleTween.js", "../../../../node_modules/d3-transition/src/transition/text.js", "../../../../node_modules/d3-transition/src/transition/textTween.js", "../../../../node_modules/d3-transition/src/transition/transition.js", "../../../../node_modules/d3-transition/src/transition/end.js", "../../../../node_modules/d3-transition/src/transition/index.js", "../../../../node_modules/d3-ease/src/cubic.js", "../../../../node_modules/d3-transition/src/selection/transition.js", "../../../../node_modules/d3-transition/src/selection/index.js", "../../../../node_modules/d3-brush/src/brush.js", "../../../../node_modules/d3-path/src/path.js", "../../../../node_modules/d3-format/src/formatDecimal.js", "../../../../node_modules/d3-format/src/exponent.js", "../../../../node_modules/d3-format/src/formatGroup.js", "../../../../node_modules/d3-format/src/formatNumerals.js", "../../../../node_modules/d3-format/src/formatSpecifier.js", "../../../../node_modules/d3-format/src/formatTrim.js", "../../../../node_modules/d3-format/src/formatPrefixAuto.js", "../../../../node_modules/d3-format/src/formatRounded.js", "../../../../node_modules/d3-format/src/formatTypes.js", "../../../../node_modules/d3-format/src/identity.js", "../../../../node_modules/d3-format/src/locale.js", "../../../../node_modules/d3-format/src/defaultLocale.js", "../../../../node_modules/d3-format/src/precisionFixed.js", "../../../../node_modules/d3-format/src/precisionPrefix.js", "../../../../node_modules/d3-format/src/precisionRound.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/cartesian.js", "../../../../node_modules/d3-geo/src/compose.js", "../../../../node_modules/d3-geo/src/rotation.js", "../../../../node_modules/d3-geo/src/circle.js", "../../../../node_modules/d3-geo/src/clip/buffer.js", "../../../../node_modules/d3-geo/src/pointEqual.js", "../../../../node_modules/d3-geo/src/clip/rejoin.js", "../../../../node_modules/d3-geo/src/polygonContains.js", "../../../../node_modules/d3-geo/src/clip/index.js", "../../../../node_modules/d3-geo/src/clip/antimeridian.js", "../../../../node_modules/d3-geo/src/clip/circle.js", "../../../../node_modules/d3-geo/src/clip/line.js", "../../../../node_modules/d3-geo/src/clip/rectangle.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", "../../../../node_modules/d3-geo/src/transform.js", "../../../../node_modules/d3-geo/src/projection/fit.js", "../../../../node_modules/d3-geo/src/projection/resample.js", "../../../../node_modules/d3-geo/src/projection/index.js", "../../../../node_modules/d3-geo/src/projection/conic.js", "../../../../node_modules/d3-geo/src/projection/cylindricalEqualArea.js", "../../../../node_modules/d3-geo/src/projection/conicEqualArea.js", "../../../../node_modules/d3-geo/src/projection/albers.js", "../../../../node_modules/d3-geo/src/projection/albersUsa.js", "../../../../node_modules/d3-geo/src/projection/azimuthal.js", "../../../../node_modules/d3-geo/src/projection/azimuthalEqualArea.js", "../../../../node_modules/d3-geo/src/projection/azimuthalEquidistant.js", "../../../../node_modules/d3-geo/src/projection/mercator.js", "../../../../node_modules/d3-geo/src/projection/conicConformal.js", "../../../../node_modules/d3-geo/src/projection/equirectangular.js", "../../../../node_modules/d3-geo/src/projection/conicEquidistant.js", "../../../../node_modules/d3-geo/src/projection/equalEarth.js", "../../../../node_modules/d3-geo/src/projection/gnomonic.js", "../../../../node_modules/d3-geo/src/projection/orthographic.js", "../../../../node_modules/d3-geo/src/projection/stereographic.js", "../../../../node_modules/d3-geo/src/projection/transverseMercator.js", "../../../../node_modules/d3-scale/src/init.js", "../../../../node_modules/d3-scale/src/ordinal.js", "../../../../node_modules/d3-scale/src/band.js", "../../../../node_modules/d3-scale/src/constant.js", "../../../../node_modules/d3-scale/src/number.js", "../../../../node_modules/d3-scale/src/continuous.js", "../../../../node_modules/d3-scale/src/tickFormat.js", "../../../../node_modules/d3-scale/src/linear.js", "../../../../node_modules/d3-scale/src/identity.js", "../../../../node_modules/d3-scale/src/nice.js", "../../../../node_modules/d3-scale/src/log.js", "../../../../node_modules/d3-scale/src/symlog.js", "../../../../node_modules/d3-scale/src/pow.js", "../../../../node_modules/d3-scale/src/quantile.js", "../../../../node_modules/d3-scale/src/threshold.js", "../../../../node_modules/d3-time/src/interval.js", "../../../../node_modules/d3-time/src/millisecond.js", "../../../../node_modules/d3-time/src/second.js", "../../../../node_modules/d3-time/src/minute.js", "../../../../node_modules/d3-time/src/hour.js", "../../../../node_modules/d3-time/src/day.js", "../../../../node_modules/d3-time/src/week.js", "../../../../node_modules/d3-time/src/month.js", "../../../../node_modules/d3-time/src/year.js", "../../../../node_modules/d3-time/src/ticks.js", "../../../../node_modules/d3-time-format/src/locale.js", "../../../../node_modules/d3-time-format/src/defaultLocale.js", "../../../../node_modules/d3-scale/src/time.js", "../../../../node_modules/d3-scale/src/utcTime.js", "../../../../node_modules/d3-scale/src/sequential.js", "../../../../node_modules/d3-scale/src/diverging.js", "../../../../node_modules/d3-scale-chromatic/src/colors.js", "../../../../node_modules/d3-scale-chromatic/src/categorical/category10.js", "../../../../node_modules/d3-scale-chromatic/src/categorical/Accent.js", "../../../../node_modules/d3-scale-chromatic/src/categorical/Dark2.js", "../../../../node_modules/d3-scale-chromatic/src/categorical/Paired.js", "../../../../node_modules/d3-scale-chromatic/src/categorical/Pastel1.js", "../../../../node_modules/d3-scale-chromatic/src/categorical/Pastel2.js", "../../../../node_modules/d3-scale-chromatic/src/categorical/Set1.js", "../../../../node_modules/d3-scale-chromatic/src/categorical/Set2.js", "../../../../node_modules/d3-scale-chromatic/src/categorical/Set3.js", "../../../../node_modules/d3-scale-chromatic/src/categorical/Tableau10.js", "../../../../node_modules/d3-scale-chromatic/src/ramp.js", "../../../../node_modules/d3-scale-chromatic/src/diverging/BrBG.js", "../../../../node_modules/d3-scale-chromatic/src/diverging/PRGn.js", "../../../../node_modules/d3-scale-chromatic/src/diverging/PiYG.js", "../../../../node_modules/d3-scale-chromatic/src/diverging/PuOr.js", "../../../../node_modules/d3-scale-chromatic/src/diverging/RdBu.js", "../../../../node_modules/d3-scale-chromatic/src/diverging/RdGy.js", "../../../../node_modules/d3-scale-chromatic/src/diverging/RdYlBu.js", "../../../../node_modules/d3-scale-chromatic/src/diverging/RdYlGn.js", "../../../../node_modules/d3-scale-chromatic/src/diverging/Spectral.js", "../../../../node_modules/d3-scale-chromatic/src/sequential-multi/BuGn.js", "../../../../node_modules/d3-scale-chromatic/src/sequential-multi/BuPu.js", "../../../../node_modules/d3-scale-chromatic/src/sequential-multi/GnBu.js", "../../../../node_modules/d3-scale-chromatic/src/sequential-multi/OrRd.js", "../../../../node_modules/d3-scale-chromatic/src/sequential-multi/PuBuGn.js", "../../../../node_modules/d3-scale-chromatic/src/sequential-multi/PuBu.js", "../../../../node_modules/d3-scale-chromatic/src/sequential-multi/PuRd.js", "../../../../node_modules/d3-scale-chromatic/src/sequential-multi/RdPu.js", "../../../../node_modules/d3-scale-chromatic/src/sequential-multi/YlGnBu.js", "../../../../node_modules/d3-scale-chromatic/src/sequential-multi/YlGn.js", "../../../../node_modules/d3-scale-chromatic/src/sequential-multi/YlOrBr.js", "../../../../node_modules/d3-scale-chromatic/src/sequential-multi/YlOrRd.js", "../../../../node_modules/d3-scale-chromatic/src/sequential-single/Blues.js", "../../../../node_modules/d3-scale-chromatic/src/sequential-single/Greens.js", "../../../../node_modules/d3-scale-chromatic/src/sequential-single/Greys.js", "../../../../node_modules/d3-scale-chromatic/src/sequential-single/Purples.js", "../../../../node_modules/d3-scale-chromatic/src/sequential-single/Reds.js", "../../../../node_modules/d3-scale-chromatic/src/sequential-single/Oranges.js", "../../../../node_modules/d3-scale-chromatic/src/sequential-multi/cividis.js", "../../../../node_modules/d3-scale-chromatic/src/sequential-multi/cubehelix.js", "../../../../node_modules/d3-scale-chromatic/src/sequential-multi/rainbow.js", "../../../../node_modules/d3-scale-chromatic/src/sequential-multi/sinebow.js", "../../../../node_modules/d3-scale-chromatic/src/sequential-multi/turbo.js", "../../../../node_modules/d3-scale-chromatic/src/sequential-multi/viridis.js", "../../../../node_modules/d3-shape/src/math.js", "../../../../node_modules/d3-shape/src/symbol/asterisk.js", "../../../../node_modules/d3-shape/src/symbol/circle.js", "../../../../node_modules/d3-shape/src/symbol/cross.js", "../../../../node_modules/d3-shape/src/symbol/diamond.js", "../../../../node_modules/d3-shape/src/symbol/diamond2.js", "../../../../node_modules/d3-shape/src/symbol/plus.js", "../../../../node_modules/d3-shape/src/symbol/square.js", "../../../../node_modules/d3-shape/src/symbol/square2.js", "../../../../node_modules/d3-shape/src/symbol/star.js", "../../../../node_modules/d3-shape/src/symbol/triangle.js", "../../../../node_modules/d3-shape/src/symbol/triangle2.js", "../../../../node_modules/d3-shape/src/symbol/wye.js", "../../../../node_modules/d3-shape/src/symbol/times.js", "../../../../node_modules/d3-shape/src/symbol.js", "../../../../node_modules/d3-zoom/src/transform.js", "../../../../node_modules/@observablehq/plot/src/defined.js", "../../../../node_modules/isoformat/src/format.js", "../../../../node_modules/isoformat/src/parse.js", "../../../../node_modules/@observablehq/plot/src/time.js", "../../../../node_modules/@observablehq/plot/src/options.js", "../../../../node_modules/@observablehq/plot/src/scales/index.js", "../../../../node_modules/@observablehq/plot/src/symbol.js", "../../../../node_modules/@observablehq/plot/src/transforms/basic.js", "../../../../node_modules/@observablehq/plot/src/transforms/group.js", "../../../../node_modules/@observablehq/plot/src/channel.js", "../../../../node_modules/@observablehq/plot/src/context.js", "../../../../node_modules/@observablehq/plot/src/warnings.js", "../../../../node_modules/@observablehq/plot/src/projection.js", "../../../../node_modules/@observablehq/plot/src/scales/schemes.js", "../../../../node_modules/@observablehq/plot/src/scales/quantitative.js", "../../../../node_modules/@observablehq/plot/src/scales/diverging.js", "../../../../node_modules/@observablehq/plot/src/scales/temporal.js", "../../../../node_modules/@observablehq/plot/src/scales/ordinal.js", "../../../../node_modules/@observablehq/plot/src/scales.js", "../../../../node_modules/@observablehq/plot/src/memoize.js", "../../../../node_modules/@observablehq/plot/src/format.js", "../../../../node_modules/@observablehq/plot/src/style.js", "../../../../node_modules/@observablehq/plot/src/dimensions.js", "../../../../node_modules/@observablehq/plot/src/facet.js", "../../../../node_modules/@observablehq/plot/src/mark.js", "../../../../node_modules/@observablehq/plot/src/interactions/pointer.js", "../../../../node_modules/@observablehq/plot/src/axes.js", "../../../../node_modules/@observablehq/plot/src/legends/ramp.js", "../../../../node_modules/@observablehq/plot/src/math.js", "../../../../node_modules/@observablehq/plot/src/marker.js", "../../../../node_modules/@observablehq/plot/src/transforms/inset.js", "../../../../node_modules/@observablehq/plot/src/transforms/interval.js", "../../../../node_modules/@observablehq/plot/src/marks/rule.js", "../../../../node_modules/@observablehq/plot/src/template.js", "../../../../node_modules/@observablehq/plot/src/marks/text.js", "../../../../node_modules/@observablehq/plot/src/marks/vector.js", "../../../../node_modules/@observablehq/plot/src/marks/axis.js", "../../../../node_modules/@observablehq/plot/src/legends/swatches.js", "../../../../node_modules/@observablehq/plot/src/legends.js", "../../../../node_modules/@observablehq/plot/src/marks/frame.js", "../../../../node_modules/@observablehq/plot/src/marks/tip.js", "../../../../node_modules/@observablehq/plot/src/plot.js", "../../../../node_modules/@observablehq/plot/src/transforms/bin.js", "../../../../node_modules/@observablehq/plot/src/transforms/identity.js", "../../../../node_modules/@observablehq/plot/src/transforms/stack.js", "../../../../node_modules/@observablehq/plot/src/marks/bar.js", "../charts.ts"],
"sourcesContent": ["export default function ascending(a, b) {\n return a == null || b == null ? NaN : a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n", "export default function descending(a, b) {\n return a == null || b == null ? NaN\n : b < a ? -1\n : b > a ? 1\n : b >= a ? 0\n : NaN;\n}\n", "import ascending from \"./ascending.js\";\nimport descending from \"./descending.js\";\n\nexport default function bisector(f) {\n let compare1, compare2, delta;\n\n // If an accessor is specified, promote it to a comparator. In this case we\n // can test whether the search value is (self-) comparable. We can\u2019t do this\n // for a comparator (except for specific, known comparators) because we can\u2019t\n // tell if the comparator is symmetric, and an asymmetric comparator can\u2019t be\n // used to test whether a single value is comparable.\n if (f.length !== 2) {\n compare1 = ascending;\n compare2 = (d, x) => ascending(f(d), x);\n delta = (d, x) => f(d) - x;\n } else {\n compare1 = f === ascending || f === descending ? f : zero;\n compare2 = f;\n delta = f;\n }\n\n function left(a, x, lo = 0, hi = a.length) {\n if (lo < hi) {\n if (compare1(x, x) !== 0) return hi;\n do {\n const mid = (lo + hi) >>> 1;\n if (compare2(a[mid], x) < 0) lo = mid + 1;\n else hi = mid;\n } while (lo < hi);\n }\n return lo;\n }\n\n function right(a, x, lo = 0, hi = a.length) {\n if (lo < hi) {\n if (compare1(x, x) !== 0) return hi;\n do {\n const mid = (lo + hi) >>> 1;\n if (compare2(a[mid], x) <= 0) lo = mid + 1;\n else hi = mid;\n } while (lo < hi);\n }\n return lo;\n }\n\n function center(a, x, lo = 0, hi = a.length) {\n const i = left(a, x, lo, hi - 1);\n return i > lo && delta(a[i - 1], x) > -delta(a[i], x) ? i - 1 : i;\n }\n\n return {left, center, right};\n}\n\nfunction zero() {\n return 0;\n}\n", "export default function number(x) {\n return x === null ? NaN : +x;\n}\n\nexport function* numbers(values, valueof) {\n if (valueof === undefined) {\n for (let value of values) {\n if (value != null && (value = +value) >= value) {\n yield value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {\n yield value;\n }\n }\n }\n}\n", "import ascending from \"./ascending.js\";\nimport bisector from \"./bisector.js\";\nimport number from \"./number.js\";\n\nconst ascendingBisect = bisector(ascending);\nexport const bisectRight = ascendingBisect.right;\nexport const bisectLeft = ascendingBisect.left;\nexport const bisectCenter = bisector(number).center;\nexport default bisectRight;\n", "export default function count(values, valueof) {\n let count = 0;\n if (valueof === undefined) {\n for (let value of values) {\n if (value != null && (value = +value) >= value) {\n ++count;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {\n ++count;\n }\n }\n }\n return count;\n}\n", "function length(array) {\n return array.length | 0;\n}\n\nfunction empty(length) {\n return !(length > 0);\n}\n\nfunction arrayify(values) {\n return typeof values !== \"object\" || \"length\" in values ? values : Array.from(values);\n}\n\nfunction reducer(reduce) {\n return values => reduce(...values);\n}\n\nexport default function cross(...values) {\n const reduce = typeof values[values.length - 1] === \"function\" && reducer(values.pop());\n values = values.map(arrayify);\n const lengths = values.map(length);\n const j = values.length - 1;\n const index = new Array(j + 1).fill(0);\n const product = [];\n if (j < 0 || lengths.some(empty)) return product;\n while (true) {\n product.push(index.map((j, i) => values[i][j]));\n let i = j;\n while (++index[i] === lengths[i]) {\n if (i === 0) return reduce ? product.map(reduce) : product;\n index[i--] = 0;\n }\n }\n}\n", "export default function cumsum(values, valueof) {\n var sum = 0, index = 0;\n return Float64Array.from(values, valueof === undefined\n ? v => (sum += +v || 0)\n : v => (sum += +valueof(v, index++, values) || 0));\n}", "export default function variance(values, valueof) {\n let count = 0;\n let delta;\n let mean = 0;\n let sum = 0;\n if (valueof === undefined) {\n for (let value of values) {\n if (value != null && (value = +value) >= value) {\n delta = value - mean;\n mean += delta / ++count;\n sum += delta * (value - mean);\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {\n delta = value - mean;\n mean += delta / ++count;\n sum += delta * (value - mean);\n }\n }\n }\n if (count > 1) return sum / (count - 1);\n}\n", "import variance from \"./variance.js\";\n\nexport default function deviation(values, valueof) {\n const v = variance(values, valueof);\n return v ? Math.sqrt(v) : v;\n}\n", "export default function extent(values, valueof) {\n let min;\n let max;\n if (valueof === undefined) {\n for (const value of values) {\n if (value != null) {\n if (min === undefined) {\n if (value >= value) min = max = value;\n } else {\n if (min > value) min = value;\n if (max < value) max = value;\n }\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null) {\n if (min === undefined) {\n if (value >= value) min = max = value;\n } else {\n if (min > value) min = value;\n if (max < value) max = value;\n }\n }\n }\n }\n return [min, max];\n}\n", "// https://github.com/python/cpython/blob/a74eea238f5baba15797e2e8b570d153bc8690a7/Modules/mathmodule.c#L1423\nexport class Adder {\n constructor() {\n this._partials = new Float64Array(32);\n this._n = 0;\n }\n add(x) {\n const p = this._partials;\n let i = 0;\n for (let j = 0; j < this._n && j < 32; j++) {\n const y = p[j],\n hi = x + y,\n lo = Math.abs(x) < Math.abs(y) ? x - (hi - y) : y - (hi - x);\n if (lo) p[i++] = lo;\n x = hi;\n }\n p[i] = x;\n this._n = i + 1;\n return this;\n }\n valueOf() {\n const p = this._partials;\n let n = this._n, x, y, lo, hi = 0;\n if (n > 0) {\n hi = p[--n];\n while (n > 0) {\n x = hi;\n y = p[--n];\n hi = x + y;\n lo = y - (hi - x);\n if (lo) break;\n }\n if (n > 0 && ((lo < 0 && p[n - 1] < 0) || (lo > 0 && p[n - 1] > 0))) {\n y = lo * 2;\n x = hi + y;\n if (y == x - hi) hi = x;\n }\n }\n return hi;\n }\n}\n\nexport function fsum(values, valueof) {\n const adder = new Adder();\n if (valueof === undefined) {\n for (let value of values) {\n if (value = +value) {\n adder.add(value);\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if (value = +valueof(value, ++index, values)) {\n adder.add(value);\n }\n }\n }\n return +adder;\n}\n\nexport function fcumsum(values, valueof) {\n const adder = new Adder();\n let index = -1;\n return Float64Array.from(values, valueof === undefined\n ? v => adder.add(+v || 0)\n : v => adder.add(+valueof(v, ++index, values) || 0)\n );\n}\n", "export class InternMap extends Map {\n constructor(entries, key = keyof) {\n super();\n Object.defineProperties(this, {_intern: {value: new Map()}, _key: {value: key}});\n if (entries != null) for (const [key, value] of entries) this.set(key, value);\n }\n get(key) {\n return super.get(intern_get(this, key));\n }\n has(key) {\n return super.has(intern_get(this, key));\n }\n set(key, value) {\n return super.set(intern_set(this, key), value);\n }\n delete(key) {\n return super.delete(intern_delete(this, key));\n }\n}\n\nexport class InternSet extends Set {\n constructor(values, key = keyof) {\n super();\n Object.defineProperties(this, {_intern: {value: new Map()}, _key: {value: key}});\n if (values != null) for (const value of values) this.add(value);\n }\n has(value) {\n return super.has(intern_get(this, value));\n }\n add(value) {\n return super.add(intern_set(this, value));\n }\n delete(value) {\n return super.delete(intern_delete(this, value));\n }\n}\n\nfunction intern_get({_intern, _key}, value) {\n const key = _key(value);\n return _intern.has(key) ? _intern.get(key) : value;\n}\n\nfunction intern_set({_intern, _key}, value) {\n const key = _key(value);\n if (_intern.has(key)) return _intern.get(key);\n _intern.set(key, value);\n return value;\n}\n\nfunction intern_delete({_intern, _key}, value) {\n const key = _key(value);\n if (_intern.has(key)) {\n value = _intern.get(key);\n _intern.delete(key);\n }\n return value;\n}\n\nfunction keyof(value) {\n return value !== null && typeof value === \"object\" ? value.valueOf() : value;\n}\n", "export default function identity(x) {\n return x;\n}\n", "import {InternMap} from \"internmap\";\nimport identity from \"./identity.js\";\n\nexport default function group(values, ...keys) {\n return nest(values, identity, identity, keys);\n}\n\nexport function groups(values, ...keys) {\n return nest(values, Array.from, identity, keys);\n}\n\nfunction flatten(groups, keys) {\n for (let i = 1, n = keys.length; i < n; ++i) {\n groups = groups.flatMap(g => g.pop().map(([key, value]) => [...g, key, value]));\n }\n return groups;\n}\n\nexport function flatGroup(values, ...keys) {\n return flatten(groups(values, ...keys), keys);\n}\n\nexport function flatRollup(values, reduce, ...keys) {\n return flatten(rollups(values, reduce, ...keys), keys);\n}\n\nexport function rollup(values, reduce, ...keys) {\n return nest(values, identity, reduce, keys);\n}\n\nexport function rollups(values, reduce, ...keys) {\n return nest(values, Array.from, reduce, keys);\n}\n\nexport function index(values, ...keys) {\n return nest(values, identity, unique, keys);\n}\n\nexport function indexes(values, ...keys) {\n return nest(values, Array.from, unique, keys);\n}\n\nfunction unique(values) {\n if (values.length !== 1) throw new Error(\"duplicate key\");\n return values[0];\n}\n\nfunction nest(values, map, reduce, keys) {\n return (function regroup(values, i) {\n if (i >= keys.length) return reduce(values);\n const groups = new InternMap();\n const keyof = keys[i++];\n let index = -1;\n for (const value of values) {\n const key = keyof(value, ++index, values);\n const group = groups.get(key);\n if (group) group.push(value);\n else groups.set(key, [value]);\n }\n for (const [key, values] of groups) {\n groups.set(key, regroup(values, i));\n }\n return map(groups);\n })(values, 0);\n}\n", "export default function permute(source, keys) {\n return Array.from(keys, key => source[key]);\n}\n", "import ascending from \"./ascending.js\";\nimport permute from \"./permute.js\";\n\nexport default function sort(values, ...F) {\n if (typeof values[Symbol.iterator] !== \"function\") throw new TypeError(\"values is not iterable\");\n values = Array.from(values);\n let [f] = F;\n if ((f && f.length !== 2) || F.length > 1) {\n const index = Uint32Array.from(values, (d, i) => i);\n if (F.length > 1) {\n F = F.map(f => values.map(f));\n index.sort((i, j) => {\n for (const f of F) {\n const c = ascendingDefined(f[i], f[j]);\n if (c) return c;\n }\n });\n } else {\n f = values.map(f);\n index.sort((i, j) => ascendingDefined(f[i], f[j]));\n }\n return permute(values, index);\n }\n return values.sort(compareDefined(f));\n}\n\nexport function compareDefined(compare = ascending) {\n if (compare === ascending) return ascendingDefined;\n if (typeof compare !== \"function\") throw new TypeError(\"compare is not a function\");\n return (a, b) => {\n const x = compare(a, b);\n if (x || x === 0) return x;\n return (compare(b, b) === 0) - (compare(a, a) === 0);\n };\n}\n\nexport function ascendingDefined(a, b) {\n return (a == null || !(a >= a)) - (b == null || !(b >= b)) || (a < b ? -1 : a > b ? 1 : 0);\n}\n", "import ascending from \"./ascending.js\";\nimport group, {rollup} from \"./group.js\";\nimport sort from \"./sort.js\";\n\nexport default function groupSort(values, reduce, key) {\n return (reduce.length !== 2\n ? sort(rollup(values, reduce, key), (([ak, av], [bk, bv]) => ascending(av, bv) || ascending(ak, bk)))\n : sort(group(values, key), (([ak, av], [bk, bv]) => reduce(av, bv) || ascending(ak, bk))))\n .map(([key]) => key);\n}\n", "const e10 = Math.sqrt(50),\n e5 = Math.sqrt(10),\n e2 = Math.sqrt(2);\n\nfunction tickSpec(start, stop, count) {\n const step = (stop - start) / Math.max(0, count),\n power = Math.floor(Math.log10(step)),\n error = step / Math.pow(10, power),\n factor = error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1;\n let i1, i2, inc;\n if (power < 0) {\n inc = Math.pow(10, -power) / factor;\n i1 = Math.round(start * inc);\n i2 = Math.round(stop * inc);\n if (i1 / inc < start) ++i1;\n if (i2 / inc > stop) --i2;\n inc = -inc;\n } else {\n inc = Math.pow(10, power) * factor;\n i1 = Math.round(start / inc);\n i2 = Math.round(stop / inc);\n if (i1 * inc < start) ++i1;\n if (i2 * inc > stop) --i2;\n }\n if (i2 < i1 && 0.5 <= count && count < 2) return tickSpec(start, stop, count * 2);\n return [i1, i2, inc];\n}\n\nexport default function ticks(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n if (!(count > 0)) return [];\n if (start === stop) return [start];\n const reverse = stop < start, [i1, i2, inc] = reverse ? tickSpec(stop, start, count) : tickSpec(start, stop, count);\n if (!(i2 >= i1)) return [];\n const n = i2 - i1 + 1, ticks = new Array(n);\n if (reverse) {\n if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) / -inc;\n else for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) * inc;\n } else {\n if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) / -inc;\n else for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) * inc;\n }\n return ticks;\n}\n\nexport function tickIncrement(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n return tickSpec(start, stop, count)[2];\n}\n\nexport function tickStep(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n const reverse = stop < start, inc = reverse ? tickIncrement(stop, start, count) : tickIncrement(start, stop, count);\n return (reverse ? -1 : 1) * (inc < 0 ? 1 / -inc : inc);\n}\n", "import count from \"../count.js\";\n\nexport default function thresholdSturges(values) {\n return Math.max(1, Math.ceil(Math.log(count(values)) / Math.LN2) + 1);\n}\n", "export default function max(values, valueof) {\n let max;\n if (valueof === undefined) {\n for (const value of values) {\n if (value != null\n && (max < value || (max === undefined && value >= value))) {\n max = value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null\n && (max < value || (max === undefined && value >= value))) {\n max = value;\n }\n }\n }\n return max;\n}\n", "export default function maxIndex(values, valueof) {\n let max;\n let maxIndex = -1;\n let index = -1;\n if (valueof === undefined) {\n for (const value of values) {\n ++index;\n if (value != null\n && (max < value || (max === undefined && value >= value))) {\n max = value, maxIndex = index;\n }\n }\n } else {\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null\n && (max < value || (max === undefined && value >= value))) {\n max = value, maxIndex = index;\n }\n }\n }\n return maxIndex;\n}\n", "export default function min(values, valueof) {\n let min;\n if (valueof === undefined) {\n for (const value of values) {\n if (value != null\n && (min > value || (min === undefined && value >= value))) {\n min = value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null\n && (min > value || (min === undefined && value >= value))) {\n min = value;\n }\n }\n }\n return min;\n}\n", "export default function minIndex(values, valueof) {\n let min;\n let minIndex = -1;\n let index = -1;\n if (valueof === undefined) {\n for (const value of values) {\n ++index;\n if (value != null\n && (min > value || (min === undefined && value >= value))) {\n min = value, minIndex = index;\n }\n }\n } else {\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null\n && (min > value || (min === undefined && value >= value))) {\n min = value, minIndex = index;\n }\n }\n }\n return minIndex;\n}\n", "import {ascendingDefined, compareDefined} from \"./sort.js\";\n\n// Based on https://github.com/mourner/quickselect\n// ISC license, Copyright 2018 Vladimir Agafonkin.\nexport default function quickselect(array, k, left = 0, right = Infinity, compare) {\n k = Math.floor(k);\n left = Math.floor(Math.max(0, left));\n right = Math.floor(Math.min(array.length - 1, right));\n\n if (!(left <= k && k <= right)) return array;\n\n compare = compare === undefined ? ascendingDefined : compareDefined(compare);\n\n while (right > left) {\n if (right - left > 600) {\n const n = right - left + 1;\n const m = k - left + 1;\n const z = Math.log(n);\n const s = 0.5 * Math.exp(2 * z / 3);\n const sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);\n const newLeft = Math.max(left, Math.floor(k - m * s / n + sd));\n const newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));\n quickselect(array, k, newLeft, newRight, compare);\n }\n\n const t = array[k];\n let i = left;\n let j = right;\n\n swap(array, left, k);\n if (compare(array[right], t) > 0) swap(array, left, right);\n\n while (i < j) {\n swap(array, i, j), ++i, --j;\n while (compare(array[i], t) < 0) ++i;\n while (compare(array[j], t) > 0) --j;\n }\n\n if (compare(array[left], t) === 0) swap(array, left, j);\n else ++j, swap(array, j, right);\n\n if (j <= k) left = j + 1;\n if (k <= j) right = j - 1;\n }\n\n return array;\n}\n\nfunction swap(array, i, j) {\n const t = array[i];\n array[i] = array[j];\n array[j] = t;\n}\n", "import ascending from \"./ascending.js\";\n\nexport default function greatest(values, compare = ascending) {\n let max;\n let defined = false;\n if (compare.length === 1) {\n let maxValue;\n for (const element of values) {\n const value = compare(element);\n if (defined\n ? ascending(value, maxValue) > 0\n : ascending(value, value) === 0) {\n max = element;\n maxValue = value;\n defined = true;\n }\n }\n } else {\n for (const value of values) {\n if (defined\n ? compare(value, max) > 0\n : compare(value, value) === 0) {\n max = value;\n defined = true;\n }\n }\n }\n return max;\n}\n", "import max from \"./max.js\";\nimport maxIndex from \"./maxIndex.js\";\nimport min from \"./min.js\";\nimport minIndex from \"./minIndex.js\";\nimport quickselect from \"./quickselect.js\";\nimport number, {numbers} from \"./number.js\";\nimport {ascendingDefined} from \"./sort.js\";\nimport greatest from \"./greatest.js\";\n\nexport default function quantile(values, p, valueof) {\n values = Float64Array.from(numbers(values, valueof));\n if (!(n = values.length) || isNaN(p = +p)) return;\n if (p <= 0 || n < 2) return min(values);\n if (p >= 1) return max(values);\n var n,\n i = (n - 1) * p,\n i0 = Math.floor(i),\n value0 = max(quickselect(values, i0).subarray(0, i0 + 1)),\n value1 = min(values.subarray(i0 + 1));\n return value0 + (value1 - value0) * (i - i0);\n}\n\nexport function quantileSorted(values, p, valueof = number) {\n if (!(n = values.length) || isNaN(p = +p)) return;\n if (p <= 0 || n < 2) return +valueof(values[0], 0, values);\n if (p >= 1) return +valueof(values[n - 1], n - 1, values);\n var n,\n i = (n - 1) * p,\n i0 = Math.floor(i),\n value0 = +valueof(values[i0], i0, values),\n value1 = +valueof(values[i0 + 1], i0 + 1, values);\n return value0 + (value1 - value0) * (i - i0);\n}\n\nexport function quantileIndex(values, p, valueof) {\n values = Float64Array.from(numbers(values, valueof));\n if (!(n = values.length) || isNaN(p = +p)) return;\n if (p <= 0 || n < 2) return minIndex(values);\n if (p >= 1) return maxIndex(values);\n var n,\n i = Math.floor((n - 1) * p),\n order = (i, j) => ascendingDefined(values[i], values[j]),\n index = quickselect(Uint32Array.from(values, (_, i) => i), i, 0, n - 1, order);\n return greatest(index.subarray(0, i + 1), i => values[i]);\n}\n", "import count from \"../count.js\";\nimport quantile from \"../quantile.js\";\n\nexport default function thresholdFreedmanDiaconis(values, min, max) {\n const c = count(values), d = quantile(values, 0.75) - quantile(values, 0.25);\n return c && d ? Math.ceil((max - min) / (2 * d * Math.pow(c, -1 / 3))) : 1;\n}\n", "import count from \"../count.js\";\nimport deviation from \"../deviation.js\";\n\nexport default function thresholdScott(values, min, max) {\n const c = count(values), d = deviation(values);\n return c && d ? Math.ceil((max - min) * Math.cbrt(c) / (3.49 * d)) : 1;\n}\n", "export default function mean(values, valueof) {\n let count = 0;\n let sum = 0;\n if (valueof === undefined) {\n for (let value of values) {\n if (value != null && (value = +value) >= value) {\n ++count, sum += value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {\n ++count, sum += value;\n }\n }\n }\n if (count) return sum / count;\n}\n", "import quantile, {quantileIndex} from \"./quantile.js\";\n\nexport default function median(values, valueof) {\n return quantile(values, 0.5, valueof);\n}\n\nexport function medianIndex(values, valueof) {\n return quantileIndex(values, 0.5, valueof);\n}\n", "function* flatten(arrays) {\n for (const array of arrays) {\n yield* array;\n }\n}\n\nexport default function merge(arrays) {\n return Array.from(flatten(arrays));\n}\n", "import {InternMap} from \"internmap\";\n\nexport default function mode(values, valueof) {\n const counts = new InternMap();\n if (valueof === undefined) {\n for (let value of values) {\n if (value != null && value >= value) {\n counts.set(value, (counts.get(value) || 0) + 1);\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null && value >= value) {\n counts.set(value, (counts.get(value) || 0) + 1);\n }\n }\n }\n let modeValue;\n let modeCount = 0;\n for (const [value, count] of counts) {\n if (count > modeCount) {\n modeCount = count;\n modeValue = value;\n }\n }\n return modeValue;\n}\n", "export default function pairs(values, pairof = pair) {\n const pairs = [];\n let previous;\n let first = false;\n for (const value of values) {\n if (first) pairs.push(pairof(previous, value));\n previous = value;\n first = true;\n }\n return pairs;\n}\n\nexport function pair(a, b) {\n return [a, b];\n}\n", "export default function range(start, stop, step) {\n start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step;\n\n var i = -1,\n n = Math.max(0, Math.ceil((stop - start) / step)) | 0,\n range = new Array(n);\n\n while (++i < n) {\n range[i] = start + i * step;\n }\n\n return range;\n}\n", "export default function sum(values, valueof) {\n let sum = 0;\n if (valueof === undefined) {\n for (let value of values) {\n if (value = +value) {\n sum += value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if (value = +valueof(value, ++index, values)) {\n sum += value;\n }\n }\n }\n return sum;\n}\n", "export default function reverse(values) {\n if (typeof values[Symbol.iterator] !== \"function\") throw new TypeError(\"values is not iterable\");\n return Array.from(values).reverse();\n}\n", "import {InternSet} from \"internmap\";\n\nexport default function union(...others) {\n const set = new InternSet();\n for (const other of others) {\n for (const o of other) {\n set.add(o);\n }\n }\n return set;\n}\n", "export default function(x) {\n return x;\n}\n", "import identity from \"./identity.js\";\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)\";\n}\n\nfunction translateY(y) {\n return \"translate(0,\" + y + \")\";\n}\n\nfunction number(scale) {\n return d => +scale(d);\n}\n\nfunction center(scale, offset) {\n offset = Math.max(0, scale.bandwidth() - offset * 2) / 2;\n if (scale.round()) offset = Math.round(offset);\n return d => +scale(d) + offset;\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 offset = typeof window !== \"undefined\" && window.devicePixelRatio > 1 ? 0 : 0.5,\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] + offset,\n range1 = +range[range.length - 1] + offset,\n position = (scale.bandwidth ? center : number)(scale.copy(), offset),\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 + offset) : 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)) + offset); });\n }\n\n tickExit.remove();\n\n path\n .attr(\"d\", orient === left || orient === right\n ? (tickSizeOuter ? \"M\" + k * tickSizeOuter + \",\" + range0 + \"H\" + offset + \"V\" + range1 + \"H\" + k * tickSizeOuter : \"M\" + offset + \",\" + range0 + \"V\" + range1)\n : (tickSizeOuter ? \"M\" + range0 + \",\" + k * tickSizeOuter + \"V\" + offset + \"H\" + range1 + \"V\" + k * tickSizeOuter : \"M\" + range0 + \",\" + offset + \"H\" + range1));\n\n tick\n .attr(\"opacity\", 1)\n .attr(\"transform\", function(d) { return transform(position(d) + offset); });\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 = Array.from(arguments), axis;\n };\n\n axis.tickArguments = function(_) {\n return arguments.length ? (tickArguments = _ == null ? [] : Array.from(_), axis) : tickArguments.slice();\n };\n\n axis.tickValues = function(_) {\n return arguments.length ? (tickValues = _ == null ? null : Array.from(_), 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 axis.offset = function(_) {\n return arguments.length ? (offset = +_, axis) : offset;\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", "var noop = {value: () => {}};\n\nfunction dispatch() {\n for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) {\n if (!(t = arguments[i] + \"\") || (t in _) || /[\\s.]/.test(t)) throw new Error(\"illegal type: \" + t);\n _[t] = [];\n }\n return new Dispatch(_);\n}\n\nfunction Dispatch(_) {\n this._ = _;\n}\n\nfunction parseTypenames(typenames, types) {\n return typenames.trim().split(/^|\\s+/).map(function(t) {\n var name = \"\", i = t.indexOf(\".\");\n if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);\n if (t && !types.hasOwnProperty(t)) throw new Error(\"unknown type: \" + t);\n return {type: t, name: name};\n });\n}\n\nDispatch.prototype = dispatch.prototype = {\n constructor: Dispatch,\n on: function(typename, callback) {\n var _ = this._,\n T = parseTypenames(typename + \"\", _),\n t,\n i = -1,\n n = T.length;\n\n // If no callback was specified, return the callback of the given type and name.\n if (arguments.length < 2) {\n while (++i < n) if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name))) return t;\n return;\n }\n\n // If a type was specified, set the callback for the given type and name.\n // Otherwise, if a null callback was specified, remove callbacks of the given name.\n if (callback != null && typeof callback !== \"function\") throw new Error(\"invalid callback: \" + callback);\n while (++i < n) {\n if (t = (typename = T[i]).type) _[t] = set(_[t], typename.name, callback);\n else if (callback == null) for (t in _) _[t] = set(_[t], typename.name, null);\n }\n\n return this;\n },\n copy: function() {\n var copy = {}, _ = this._;\n for (var t in _) copy[t] = _[t].slice();\n return new Dispatch(copy);\n },\n call: function(type, that) {\n if ((n = arguments.length - 2) > 0) for (var args = new Array(n), i = 0, n, t; i < n; ++i) args[i] = arguments[i + 2];\n if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n for (t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n },\n apply: function(type, that, args) {\n if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n for (var t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n }\n};\n\nfunction get(type, name) {\n for (var i = 0, n = type.length, c; i < n; ++i) {\n if ((c = type[i]).name === name) {\n return c.value;\n }\n }\n}\n\nfunction set(type, name, callback) {\n for (var i = 0, n = type.length; i < n; ++i) {\n if (type[i].name === name) {\n type[i] = noop, type = type.slice(0, i).concat(type.slice(i + 1));\n break;\n }\n }\n if (callback != null) type.push({name: name, value: callback});\n return type;\n}\n\nexport default dispatch;\n", "export var xhtml = \"http://www.w3.org/1999/xhtml\";\n\nexport default {\n svg: \"http://www.w3.org/2000/svg\",\n xhtml: xhtml,\n xlink: \"http://www.w3.org/1999/xlink\",\n xml: \"http://www.w3.org/XML/1998/namespace\",\n xmlns: \"http://www.w3.org/2000/xmlns/\"\n};\n", "import namespaces from \"./namespaces.js\";\n\nexport default function(name) {\n var prefix = name += \"\", i = prefix.indexOf(\":\");\n if (i >= 0 && (prefix = name.slice(0, i)) !== \"xmlns\") name = name.slice(i + 1);\n return namespaces.hasOwnProperty(prefix) ? {space: namespaces[prefix], local: name} : name; // eslint-disable-line no-prototype-builtins\n}\n", "import namespace from \"./namespace.js\";\nimport {xhtml} from \"./namespaces.js\";\n\nfunction creatorInherit(name) {\n return function() {\n var document = this.ownerDocument,\n uri = this.namespaceURI;\n return uri === xhtml && document.documentElement.namespaceURI === xhtml\n ? document.createElement(name)\n : document.createElementNS(uri, name);\n };\n}\n\nfunction creatorFixed(fullname) {\n return function() {\n return this.ownerDocument.createElementNS(fullname.space, fullname.local);\n };\n}\n\nexport default function(name) {\n var fullname = namespace(name);\n return (fullname.local\n ? creatorFixed\n : creatorInherit)(fullname);\n}\n", "function none() {}\n\nexport default function(selector) {\n return selector == null ? none : function() {\n return this.querySelector(selector);\n };\n}\n", "import {Selection} from \"./index.js\";\nimport selector from \"../selector.js\";\n\nexport default function(select) {\n if (typeof select !== \"function\") select = selector(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {\n if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {\n if (\"__data__\" in node) subnode.__data__ = node.__data__;\n subgroup[i] = subnode;\n }\n }\n }\n\n return new Selection(subgroups, this._parents);\n}\n", "// Given something array like (or null), returns something that is strictly an\n// array. This is used to ensure that array-like objects passed to d3.selectAll\n// or selection.selectAll are converted into proper arrays when creating a\n// selection; we don\u2019t ever want to create a selection backed by a live\n// HTMLCollection or NodeList. However, note that selection.selectAll will use a\n// static NodeList as a group, since it safely derived from querySelectorAll.\nexport default function array(x) {\n return x == null ? [] : Array.isArray(x) ? x : Array.from(x);\n}\n", "function empty() {\n return [];\n}\n\nexport default function(selector) {\n return selector == null ? empty : function() {\n return this.querySelectorAll(selector);\n };\n}\n", "import {Selection} from \"./index.js\";\nimport array from \"../array.js\";\nimport selectorAll from \"../selectorAll.js\";\n\nfunction arrayAll(select) {\n return function() {\n return array(select.apply(this, arguments));\n };\n}\n\nexport default function(select) {\n if (typeof select === \"function\") select = arrayAll(select);\n else select = selectorAll(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n subgroups.push(select.call(node, node.__data__, i, group));\n parents.push(node);\n }\n }\n }\n\n return new Selection(subgroups, parents);\n}\n", "export default function(selector) {\n return function() {\n return this.matches(selector);\n };\n}\n\nexport function childMatcher(selector) {\n return function(node) {\n return node.matches(selector);\n };\n}\n\n", "import {childMatcher} from \"../matcher.js\";\n\nvar find = Array.prototype.find;\n\nfunction childFind(match) {\n return function() {\n return find.call(this.children, match);\n };\n}\n\nfunction childFirst() {\n return this.firstElementChild;\n}\n\nexport default function(match) {\n return this.select(match == null ? childFirst\n : childFind(typeof match === \"function\" ? match : childMatcher(match)));\n}\n", "import {childMatcher} from \"../matcher.js\";\n\nvar filter = Array.prototype.filter;\n\nfunction children() {\n return Array.from(this.children);\n}\n\nfunction childrenFilter(match) {\n return function() {\n return filter.call(this.children, match);\n };\n}\n\nexport default function(match) {\n return this.selectAll(match == null ? children\n : childrenFilter(typeof match === \"function\" ? match : childMatcher(match)));\n}\n", "import {Selection} from \"./index.js\";\nimport matcher from \"../matcher.js\";\n\nexport default function(match) {\n if (typeof match !== \"function\") match = matcher(match);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {\n if ((node = group[i]) && match.call(node, node.__data__, i, group)) {\n subgroup.push(node);\n }\n }\n }\n\n return new Selection(subgroups, this._parents);\n}\n", "export default function(update) {\n return new Array(update.length);\n}\n", "import sparse from \"./sparse.js\";\nimport {Selection} from \"./index.js\";\n\nexport default function() {\n return new Selection(this._enter || this._groups.map(sparse), this._parents);\n}\n\nexport function EnterNode(parent, datum) {\n this.ownerDocument = parent.ownerDocument;\n this.namespaceURI = parent.namespaceURI;\n this._next = null;\n this._parent = parent;\n this.__data__ = datum;\n}\n\nEnterNode.prototype = {\n constructor: EnterNode,\n appendChild: function(child) { return this._parent.insertBefore(child, this._next); },\n insertBefore: function(child, next) { return this._parent.insertBefore(child, next); },\n querySelector: function(selector) { return this._parent.querySelector(selector); },\n querySelectorAll: function(selector) { return this._parent.querySelectorAll(selector); }\n};\n", "export default function(x) {\n return function() {\n return x;\n };\n}\n", "import {Selection} from \"./index.js\";\nimport {EnterNode} from \"./enter.js\";\nimport constant from \"../constant.js\";\n\nfunction bindIndex(parent, group, enter, update, exit, data) {\n var i = 0,\n node,\n groupLength = group.length,\n dataLength = data.length;\n\n // Put any non-null nodes that fit into update.\n // Put any null nodes into enter.\n // Put any remaining data into enter.\n for (; i < dataLength; ++i) {\n if (node = group[i]) {\n node.__data__ = data[i];\n update[i] = node;\n } else {\n enter[i] = new EnterNode(parent, data[i]);\n }\n }\n\n // Put any non-null nodes that don\u2019t fit into exit.\n for (; i < groupLength; ++i) {\n if (node = group[i]) {\n exit[i] = node;\n }\n }\n}\n\nfunction bindKey(parent, group, enter, update, exit, data, key) {\n var i,\n node,\n nodeByKeyValue = new Map,\n groupLength = group.length,\n dataLength = data.length,\n keyValues = new Array(groupLength),\n keyValue;\n\n // Compute the key for each node.\n // If multiple nodes have the same key, the duplicates are added to exit.\n for (i = 0; i < groupLength; ++i) {\n if (node = group[i]) {\n keyValues[i] = keyValue = key.call(node, node.__data__, i, group) + \"\";\n if (nodeByKeyValue.has(keyValue)) {\n exit[i] = node;\n } else {\n nodeByKeyValue.set(keyValue, node);\n }\n }\n }\n\n // Compute the key for each datum.\n // If there a node associated with this key, join and add it to update.\n // If there is not (or the key is a duplicate), add it to enter.\n for (i = 0; i < dataLength; ++i) {\n keyValue = key.call(parent, data[i], i, data) + \"\";\n if (node = nodeByKeyValue.get(keyValue)) {\n update[i] = node;\n node.__data__ = data[i];\n nodeByKeyValue.delete(keyValue);\n } else {\n enter[i] = new EnterNode(parent, data[i]);\n }\n }\n\n // Add any remaining nodes that were not bound to data to exit.\n for (i = 0; i < groupLength; ++i) {\n if ((node = group[i]) && (nodeByKeyValue.get(keyValues[i]) === node)) {\n exit[i] = node;\n }\n }\n}\n\nfunction datum(node) {\n return node.__data__;\n}\n\nexport default function(value, key) {\n if (!arguments.length) return Array.from(this, datum);\n\n var bind = key ? bindKey : bindIndex,\n parents = this._parents,\n groups = this._groups;\n\n if (typeof value !== \"function\") value = constant(value);\n\n for (var m = groups.length, update = new Array(m), enter = new Array(m), exit = new Array(m), j = 0; j < m; ++j) {\n var parent = parents[j],\n group = groups[j],\n groupLength = group.length,\n data = arraylike(value.call(parent, parent && parent.__data__, j, parents)),\n dataLength = data.length,\n enterGroup = enter[j] = new Array(dataLength),\n updateGroup = update[j] = new Array(dataLength),\n exitGroup = exit[j] = new Array(groupLength);\n\n bind(parent, group, enterGroup, updateGroup, exitGroup, data, key);\n\n // Now connect the enter nodes to their following update node, such that\n // appendChild can insert the materialized enter node before this node,\n // rather than at the end of the parent node.\n for (var i0 = 0, i1 = 0, previous, next; i0 < dataLength; ++i0) {\n if (previous = enterGroup[i0]) {\n if (i0 >= i1) i1 = i0 + 1;\n while (!(next = updateGroup[i1]) && ++i1 < dataLength);\n previous._next = next || null;\n }\n }\n }\n\n update = new Selection(update, parents);\n update._enter = enter;\n update._exit = exit;\n return update;\n}\n\n// Given some data, this returns an array-like view of it: an object that\n// exposes a length property and allows numeric indexing. Note that unlike\n// selectAll, this isn\u2019t worried about \u201Clive\u201D collections because the resulting\n// array will only be used briefly while data is being bound. (It is possible to\n// cause the data to change while iterating by using a key function, but please\n// don\u2019t; we\u2019d rather avoid a gratuitous copy.)\nfunction arraylike(data) {\n return typeof data === \"object\" && \"length\" in data\n ? data // Array, TypedArray, NodeList, array-like\n : Array.from(data); // Map, Set, iterable, string, or anything else\n}\n", "import sparse from \"./sparse.js\";\nimport {Selection} from \"./index.js\";\n\nexport default function() {\n return new Selection(this._exit || this._groups.map(sparse), this._parents);\n}\n", "export default function(onenter, onupdate, onexit) {\n var enter = this.enter(), update = this, exit = this.exit();\n if (typeof onenter === \"function\") {\n enter = onenter(enter);\n if (enter) enter = enter.selection();\n } else {\n enter = enter.append(onenter + \"\");\n }\n if (onupdate != null) {\n update = onupdate(update);\n if (update) update = update.selection();\n }\n if (onexit == null) exit.remove(); else onexit(exit);\n return enter && update ? enter.merge(update).order() : update;\n}\n", "import {Selection} from \"./index.js\";\n\nexport default function(context) {\n var selection = context.selection ? context.selection() : context;\n\n for (var groups0 = this._groups, groups1 = selection._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {\n for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {\n if (node = group0[i] || group1[i]) {\n merge[i] = node;\n }\n }\n }\n\n for (; j < m0; ++j) {\n merges[j] = groups0[j];\n }\n\n return new Selection(merges, this._parents);\n}\n", "export default function() {\n\n for (var groups = this._groups, j = -1, m = groups.length; ++j < m;) {\n for (var group = groups[j], i = group.length - 1, next = group[i], node; --i >= 0;) {\n if (node = group[i]) {\n if (next && node.compareDocumentPosition(next) ^ 4) next.parentNode.insertBefore(node, next);\n next = node;\n }\n }\n }\n\n return this;\n}\n", "import {Selection} from \"./index.js\";\n\nexport default function(compare) {\n if (!compare) compare = ascending;\n\n function compareNode(a, b) {\n return a && b ? compare(a.__data__, b.__data__) : !a - !b;\n }\n\n for (var groups = this._groups, m = groups.length, sortgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, sortgroup = sortgroups[j] = new Array(n), node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n sortgroup[i] = node;\n }\n }\n sortgroup.sort(compareNode);\n }\n\n return new Selection(sortgroups, this._parents).order();\n}\n\nfunction ascending(a, b) {\n return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n", "export default function() {\n var callback = arguments[0];\n arguments[0] = this;\n callback.apply(null, arguments);\n return this;\n}\n", "export default function() {\n return Array.from(this);\n}\n", "export default function() {\n\n for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {\n for (var group = groups[j], i = 0, n = group.length; i < n; ++i) {\n var node = group[i];\n if (node) return node;\n }\n }\n\n return null;\n}\n", "export default function() {\n let size = 0;\n for (const node of this) ++size; // eslint-disable-line no-unused-vars\n return size;\n}\n", "export default function() {\n return !this.node();\n}\n", "export default function(callback) {\n\n for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {\n for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) {\n if (node = group[i]) callback.call(node, node.__data__, i, group);\n }\n }\n\n return this;\n}\n", "import namespace from \"../namespace.js\";\n\nfunction attrRemove(name) {\n return function() {\n this.removeAttribute(name);\n };\n}\n\nfunction attrRemoveNS(fullname) {\n return function() {\n this.removeAttributeNS(fullname.space, fullname.local);\n };\n}\n\nfunction attrConstant(name, value) {\n return function() {\n this.setAttribute(name, value);\n };\n}\n\nfunction attrConstantNS(fullname, value) {\n return function() {\n this.setAttributeNS(fullname.space, fullname.local, value);\n };\n}\n\nfunction attrFunction(name, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) this.removeAttribute(name);\n else this.setAttribute(name, v);\n };\n}\n\nfunction attrFunctionNS(fullname, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) this.removeAttributeNS(fullname.space, fullname.local);\n else this.setAttributeNS(fullname.space, fullname.local, v);\n };\n}\n\nexport default function(name, value) {\n var fullname = namespace(name);\n\n if (arguments.length < 2) {\n var node = this.node();\n return fullname.local\n ? node.getAttributeNS(fullname.space, fullname.local)\n : node.getAttribute(fullname);\n }\n\n return this.each((value == null\n ? (fullname.local ? attrRemoveNS : attrRemove) : (typeof value === \"function\"\n ? (fullname.local ? attrFunctionNS : attrFunction)\n : (fullname.local ? attrConstantNS : attrConstant)))(fullname, value));\n}\n", "export default function(node) {\n return (node.ownerDocument && node.ownerDocument.defaultView) // node is a Node\n || (node.document && node) // node is a Window\n || node.defaultView; // node is a Document\n}\n", "import defaultView from \"../window.js\";\n\nfunction styleRemove(name) {\n return function() {\n this.style.removeProperty(name);\n };\n}\n\nfunction styleConstant(name, value, priority) {\n return function() {\n this.style.setProperty(name, value, priority);\n };\n}\n\nfunction styleFunction(name, value, priority) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) this.style.removeProperty(name);\n else this.style.setProperty(name, v, priority);\n };\n}\n\nexport default function(name, value, priority) {\n return arguments.length > 1\n ? this.each((value == null\n ? styleRemove : typeof value === \"function\"\n ? styleFunction\n : styleConstant)(name, value, priority == null ? \"\" : priority))\n : styleValue(this.node(), name);\n}\n\nexport function styleValue(node, name) {\n return node.style.getPropertyValue(name)\n || defaultView(node).getComputedStyle(node, null).getPropertyValue(name);\n}\n", "function propertyRemove(name) {\n return function() {\n delete this[name];\n };\n}\n\nfunction propertyConstant(name, value) {\n return function() {\n this[name] = value;\n };\n}\n\nfunction propertyFunction(name, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) delete this[name];\n else this[name] = v;\n };\n}\n\nexport default function(name, value) {\n return arguments.length > 1\n ? this.each((value == null\n ? propertyRemove : typeof value === \"function\"\n ? propertyFunction\n : propertyConstant)(name, value))\n : this.node()[name];\n}\n", "function classArray(string) {\n return string.trim().split(/^|\\s+/);\n}\n\nfunction classList(node) {\n return node.classList || new ClassList(node);\n}\n\nfunction ClassList(node) {\n this._node = node;\n this._names = classArray(node.getAttribute(\"class\") || \"\");\n}\n\nClassList.prototype = {\n add: function(name) {\n var i = this._names.indexOf(name);\n if (i < 0) {\n this._names.push(name);\n this._node.setAttribute(\"class\", this._names.join(\" \"));\n }\n },\n remove: function(name) {\n var i = this._names.indexOf(name);\n if (i >= 0) {\n this._names.splice(i, 1);\n this._node.setAttribute(\"class\", this._names.join(\" \"));\n }\n },\n contains: function(name) {\n return this._names.indexOf(name) >= 0;\n }\n};\n\nfunction classedAdd(node, names) {\n var list = classList(node), i = -1, n = names.length;\n while (++i < n) list.add(names[i]);\n}\n\nfunction classedRemove(node, names) {\n var list = classList(node), i = -1, n = names.length;\n while (++i < n) list.remove(names[i]);\n}\n\nfunction classedTrue(names) {\n return function() {\n classedAdd(this, names);\n };\n}\n\nfunction classedFalse(names) {\n return function() {\n classedRemove(this, names);\n };\n}\n\nfunction classedFunction(names, value) {\n return function() {\n (value.apply(this, arguments) ? classedAdd : classedRemove)(this, names);\n };\n}\n\nexport default function(name, value) {\n var names = classArray(name + \"\");\n\n if (arguments.length < 2) {\n var list = classList(this.node()), i = -1, n = names.length;\n while (++i < n) if (!list.contains(names[i])) return false;\n return true;\n }\n\n return this.each((typeof value === \"function\"\n ? classedFunction : value\n ? classedTrue\n : classedFalse)(names, value));\n}\n", "function textRemove() {\n this.textContent = \"\";\n}\n\nfunction textConstant(value) {\n return function() {\n this.textContent = value;\n };\n}\n\nfunction textFunction(value) {\n return function() {\n var v = value.apply(this, arguments);\n this.textContent = v == null ? \"\" : v;\n };\n}\n\nexport default function(value) {\n return arguments.length\n ? this.each(value == null\n ? textRemove : (typeof value === \"function\"\n ? textFunction\n : textConstant)(value))\n : this.node().textContent;\n}\n", "function htmlRemove() {\n this.innerHTML = \"\";\n}\n\nfunction htmlConstant(value) {\n return function() {\n this.innerHTML = value;\n };\n}\n\nfunction htmlFunction(value) {\n return function() {\n var v = value.apply(this, arguments);\n this.innerHTML = v == null ? \"\" : v;\n };\n}\n\nexport default function(value) {\n return arguments.length\n ? this.each(value == null\n ? htmlRemove : (typeof value === \"function\"\n ? htmlFunction\n : htmlConstant)(value))\n : this.node().innerHTML;\n}\n", "function raise() {\n if (this.nextSibling) this.parentNode.appendChild(this);\n}\n\nexport default function() {\n return this.each(raise);\n}\n", "function lower() {\n if (this.previousSibling) this.parentNode.insertBefore(this, this.parentNode.firstChild);\n}\n\nexport default function() {\n return this.each(lower);\n}\n", "import creator from \"../creator.js\";\n\nexport default function(name) {\n var create = typeof name === \"function\" ? name : creator(name);\n return this.select(function() {\n return this.appendChild(create.apply(this, arguments));\n });\n}\n", "import creator from \"../creator.js\";\nimport selector from \"../selector.js\";\n\nfunction constantNull() {\n return null;\n}\n\nexport default function(name, before) {\n var create = typeof name === \"function\" ? name : creator(name),\n select = before == null ? constantNull : typeof before === \"function\" ? before : selector(before);\n return this.select(function() {\n return this.insertBefore(create.apply(this, arguments), select.apply(this, arguments) || null);\n });\n}\n", "function remove() {\n var parent = this.parentNode;\n if (parent) parent.removeChild(this);\n}\n\nexport default function() {\n return this.each(remove);\n}\n", "function selection_cloneShallow() {\n var clone = this.cloneNode(false), parent = this.parentNode;\n return parent ? parent.insertBefore(clone, this.nextSibling) : clone;\n}\n\nfunction selection_cloneDeep() {\n var clone = this.cloneNode(true), parent = this.parentNode;\n return parent ? parent.insertBefore(clone, this.nextSibling) : clone;\n}\n\nexport default function(deep) {\n return this.select(deep ? selection_cloneDeep : selection_cloneShallow);\n}\n", "export default function(value) {\n return arguments.length\n ? this.property(\"__data__\", value)\n : this.node().__data__;\n}\n", "function contextListener(listener) {\n return function(event) {\n listener.call(this, event, this.__data__);\n };\n}\n\nfunction parseTypenames(typenames) {\n return typenames.trim().split(/^|\\s+/).map(function(t) {\n var name = \"\", i = t.indexOf(\".\");\n if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);\n return {type: t, name: name};\n });\n}\n\nfunction onRemove(typename) {\n return function() {\n var on = this.__on;\n if (!on) return;\n for (var j = 0, i = -1, m = on.length, o; j < m; ++j) {\n if (o = on[j], (!typename.type || o.type === typename.type) && o.name === typename.name) {\n this.removeEventListener(o.type, o.listener, o.options);\n } else {\n on[++i] = o;\n }\n }\n if (++i) on.length = i;\n else delete this.__on;\n };\n}\n\nfunction onAdd(typename, value, options) {\n return function() {\n var on = this.__on, o, listener = contextListener(value);\n if (on) for (var j = 0, m = on.length; j < m; ++j) {\n if ((o = on[j]).type === typename.type && o.name === typename.name) {\n this.removeEventListener(o.type, o.listener, o.options);\n this.addEventListener(o.type, o.listener = listener, o.options = options);\n o.value = value;\n return;\n }\n }\n this.addEventListener(typename.type, listener, options);\n o = {type: typename.type, name: typename.name, value: value, listener: listener, options: options};\n if (!on) this.__on = [o];\n else on.push(o);\n };\n}\n\nexport default function(typename, value, options) {\n var typenames = parseTypenames(typename + \"\"), i, n = typenames.length, t;\n\n if (arguments.length < 2) {\n var on = this.node().__on;\n if (on) for (var j = 0, m = on.length, o; j < m; ++j) {\n for (i = 0, o = on[j]; i < n; ++i) {\n if ((t = typenames[i]).type === o.type && t.name === o.name) {\n return o.value;\n }\n }\n }\n return;\n }\n\n on = value ? onAdd : onRemove;\n for (i = 0; i < n; ++i) this.each(on(typenames[i], value, options));\n return this;\n}\n", "import defaultView from \"../window.js\";\n\nfunction dispatchEvent(node, type, params) {\n var window = defaultView(node),\n event = window.CustomEvent;\n\n if (typeof event === \"function\") {\n event = new event(type, params);\n } else {\n event = window.document.createEvent(\"Event\");\n if (params) event.initEvent(type, params.bubbles, params.cancelable), event.detail = params.detail;\n else event.initEvent(type, false, false);\n }\n\n node.dispatchEvent(event);\n}\n\nfunction dispatchConstant(type, params) {\n return function() {\n return dispatchEvent(this, type, params);\n };\n}\n\nfunction dispatchFunction(type, params) {\n return function() {\n return dispatchEvent(this, type, params.apply(this, arguments));\n };\n}\n\nexport default function(type, params) {\n return this.each((typeof params === \"function\"\n ? dispatchFunction\n : dispatchConstant)(type, params));\n}\n", "export default function*() {\n for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {\n for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) {\n if (node = group[i]) yield node;\n }\n }\n}\n", "import selection_select from \"./select.js\";\nimport selection_selectAll from \"./selectAll.js\";\nimport selection_selectChild from \"./selectChild.js\";\nimport selection_selectChildren from \"./selectChildren.js\";\nimport selection_filter from \"./filter.js\";\nimport selection_data from \"./data.js\";\nimport selection_enter from \"./enter.js\";\nimport selection_exit from \"./exit.js\";\nimport selection_join from \"./join.js\";\nimport selection_merge from \"./merge.js\";\nimport selection_order from \"./order.js\";\nimport selection_sort from \"./sort.js\";\nimport selection_call from \"./call.js\";\nimport selection_nodes from \"./nodes.js\";\nimport selection_node from \"./node.js\";\nimport selection_size from \"./size.js\";\nimport selection_empty from \"./empty.js\";\nimport selection_each from \"./each.js\";\nimport selection_attr from \"./attr.js\";\nimport selection_style from \"./style.js\";\nimport selection_property from \"./property.js\";\nimport selection_classed from \"./classed.js\";\nimport selection_text from \"./text.js\";\nimport selection_html from \"./html.js\";\nimport selection_raise from \"./raise.js\";\nimport selection_lower from \"./lower.js\";\nimport selection_append from \"./append.js\";\nimport selection_insert from \"./insert.js\";\nimport selection_remove from \"./remove.js\";\nimport selection_clone from \"./clone.js\";\nimport selection_datum from \"./datum.js\";\nimport selection_on from \"./on.js\";\nimport selection_dispatch from \"./dispatch.js\";\nimport selection_iterator from \"./iterator.js\";\n\nexport var root = [null];\n\nexport function Selection(groups, parents) {\n this._groups = groups;\n this._parents = parents;\n}\n\nfunction selection() {\n return new Selection([[document.documentElement]], root);\n}\n\nfunction selection_selection() {\n return this;\n}\n\nSelection.prototype = selection.prototype = {\n constructor: Selection,\n select: selection_select,\n selectAll: selection_selectAll,\n selectChild: selection_selectChild,\n selectChildren: selection_selectChildren,\n filter: selection_filter,\n data: selection_data,\n enter: selection_enter,\n exit: selection_exit,\n join: selection_join,\n merge: selection_merge,\n selection: selection_selection,\n order: selection_order,\n sort: selection_sort,\n call: selection_call,\n nodes: selection_nodes,\n node: selection_node,\n size: selection_size,\n empty: selection_empty,\n each: selection_each,\n attr: selection_attr,\n style: selection_style,\n property: selection_property,\n classed: selection_classed,\n text: selection_text,\n html: selection_html,\n raise: selection_raise,\n lower: selection_lower,\n append: selection_append,\n insert: selection_insert,\n remove: selection_remove,\n clone: selection_clone,\n datum: selection_datum,\n on: selection_on,\n dispatch: selection_dispatch,\n [Symbol.iterator]: selection_iterator\n};\n\nexport default selection;\n", "import {Selection, root} from \"./selection/index.js\";\n\nexport default function(selector) {\n return typeof selector === \"string\"\n ? new Selection([[document.querySelector(selector)]], [document.documentElement])\n : new Selection([[selector]], root);\n}\n", "export default function(event) {\n let sourceEvent;\n while (sourceEvent = event.sourceEvent) event = sourceEvent;\n return event;\n}\n", "import sourceEvent from \"./sourceEvent.js\";\n\nexport default function(event, node) {\n event = sourceEvent(event);\n if (node === undefined) node = event.currentTarget;\n if (node) {\n var svg = node.ownerSVGElement || node;\n if (svg.createSVGPoint) {\n var point = svg.createSVGPoint();\n point.x = event.clientX, point.y = event.clientY;\n point = point.matrixTransform(node.getScreenCTM().inverse());\n return [point.x, point.y];\n }\n if (node.getBoundingClientRect) {\n var rect = node.getBoundingClientRect();\n return [event.clientX - rect.left - node.clientLeft, event.clientY - rect.top - node.clientTop];\n }\n }\n return [event.pageX, event.pageY];\n}\n", "export default function(constructor, factory, prototype) {\n constructor.prototype = factory.prototype = prototype;\n prototype.constructor = constructor;\n}\n\nexport function extend(parent, definition) {\n var prototype = Object.create(parent.prototype);\n for (var key in definition) prototype[key] = definition[key];\n return prototype;\n}\n", "import define, {extend} from \"./define.js\";\n\nexport function Color() {}\n\nexport var darker = 0.7;\nexport var brighter = 1 / darker;\n\nvar reI = \"\\\\s*([+-]?\\\\d+)\\\\s*\",\n reN = \"\\\\s*([+-]?(?:\\\\d*\\\\.)?\\\\d+(?:[eE][+-]?\\\\d+)?)\\\\s*\",\n reP = \"\\\\s*([+-]?(?:\\\\d*\\\\.)?\\\\d+(?:[eE][+-]?\\\\d+)?)%\\\\s*\",\n reHex = /^#([0-9a-f]{3,8})$/,\n reRgbInteger = new RegExp(`^rgb\\\\(${reI},${reI},${reI}\\\\)$`),\n reRgbPercent = new RegExp(`^rgb\\\\(${reP},${reP},${reP}\\\\)$`),\n reRgbaInteger = new RegExp(`^rgba\\\\(${reI},${reI},${reI},${reN}\\\\)$`),\n reRgbaPercent = new RegExp(`^rgba\\\\(${reP},${reP},${reP},${reN}\\\\)$`),\n reHslPercent = new RegExp(`^hsl\\\\(${reN},${reP},${reP}\\\\)$`),\n reHslaPercent = new RegExp(`^hsla\\\\(${reN},${reP},${reP},${reN}\\\\)$`);\n\nvar named = {\n aliceblue: 0xf0f8ff,\n antiquewhite: 0xfaebd7,\n aqua: 0x00ffff,\n aquamarine: 0x7fffd4,\n azure: 0xf0ffff,\n beige: 0xf5f5dc,\n bisque: 0xffe4c4,\n black: 0x000000,\n blanchedalmond: 0xffebcd,\n blue: 0x0000ff,\n blueviolet: 0x8a2be2,\n brown: 0xa52a2a,\n burlywood: 0xdeb887,\n cadetblue: 0x5f9ea0,\n chartreuse: 0x7fff00,\n chocolate: 0xd2691e,\n coral: 0xff7f50,\n cornflowerblue: 0x6495ed,\n cornsilk: 0xfff8dc,\n crimson: 0xdc143c,\n cyan: 0x00ffff,\n darkblue: 0x00008b,\n darkcyan: 0x008b8b,\n darkgoldenrod: 0xb8860b,\n darkgray: 0xa9a9a9,\n darkgreen: 0x006400,\n darkgrey: 0xa9a9a9,\n darkkhaki: 0xbdb76b,\n darkmagenta: 0x8b008b,\n darkolivegreen: 0x556b2f,\n darkorange: 0xff8c00,\n darkorchid: 0x9932cc,\n darkred: 0x8b0000,\n darksalmon: 0xe9967a,\n darkseagreen: 0x8fbc8f,\n darkslateblue: 0x483d8b,\n darkslategray: 0x2f4f4f,\n darkslategrey: 0x2f4f4f,\n darkturquoise: 0x00ced1,\n darkviolet: 0x9400d3,\n deeppink: 0xff1493,\n deepskyblue: 0x00bfff,\n dimgray: 0x696969,\n dimgrey: 0x696969,\n dodgerblue: 0x1e90ff,\n firebrick: 0xb22222,\n floralwhite: 0xfffaf0,\n forestgreen: 0x228b22,\n fuchsia: 0xff00ff,\n gainsboro: 0xdcdcdc,\n ghostwhite: 0xf8f8ff,\n gold: 0xffd700,\n goldenrod: 0xdaa520,\n gray: 0x808080,\n green: 0x008000,\n greenyellow: 0xadff2f,\n grey: 0x808080,\n honeydew: 0xf0fff0,\n hotpink: 0xff69b4,\n indianred: 0xcd5c5c,\n indigo: 0x4b0082,\n ivory: 0xfffff0,\n khaki: 0xf0e68c,\n lavender: 0xe6e6fa,\n lavenderblush: 0xfff0f5,\n lawngreen: 0x7cfc00,\n lemonchiffon: 0xfffacd,\n lightblue: 0xadd8e6,\n lightcoral: 0xf08080,\n lightcyan: 0xe0ffff,\n lightgoldenrodyellow: 0xfafad2,\n lightgray: 0xd3d3d3,\n lightgreen: 0x90ee90,\n lightgrey: 0xd3d3d3,\n lightpink: 0xffb6c1,\n lightsalmon: 0xffa07a,\n lightseagreen: 0x20b2aa,\n lightskyblue: 0x87cefa,\n lightslategray: 0x778899,\n lightslategrey: 0x778899,\n lightsteelblue: 0xb0c4de,\n lightyellow: 0xffffe0,\n lime: 0x00ff00,\n limegreen: 0x32cd32,\n linen: 0xfaf0e6,\n magenta: 0xff00ff,\n maroon: 0x800000,\n mediumaquamarine: 0x66cdaa,\n mediumblue: 0x0000cd,\n mediumorchid: 0xba55d3,\n mediumpurple: 0x9370db,\n mediumseagreen: 0x3cb371,\n mediumslateblue: 0x7b68ee,\n mediumspringgreen: 0x00fa9a,\n mediumturquoise: 0x48d1cc,\n mediumvioletred: 0xc71585,\n midnightblue: 0x191970,\n mintcream: 0xf5fffa,\n mistyrose: 0xffe4e1,\n moccasin: 0xffe4b5,\n navajowhite: 0xffdead,\n navy: 0x000080,\n oldlace: 0xfdf5e6,\n olive: 0x808000,\n olivedrab: 0x6b8e23,\n orange: 0xffa500,\n orangered: 0xff4500,\n orchid: 0xda70d6,\n palegoldenrod: 0xeee8aa,\n palegreen: 0x98fb98,\n paleturquoise: 0xafeeee,\n palevioletred: 0xdb7093,\n papayawhip: 0xffefd5,\n peachpuff: 0xffdab9,\n peru: 0xcd853f,\n pink: 0xffc0cb,\n plum: 0xdda0dd,\n powderblue: 0xb0e0e6,\n purple: 0x800080,\n rebeccapurple: 0x663399,\n red: 0xff0000,\n rosybrown: 0xbc8f8f,\n royalblue: 0x4169e1,\n saddlebrown: 0x8b4513,\n salmon: 0xfa8072,\n sandybrown: 0xf4a460,\n seagreen: 0x2e8b57,\n seashell: 0xfff5ee,\n sienna: 0xa0522d,\n silver: 0xc0c0c0,\n skyblue: 0x87ceeb,\n slateblue: 0x6a5acd,\n slategray: 0x708090,\n slategrey: 0x708090,\n snow: 0xfffafa,\n springgreen: 0x00ff7f,\n steelblue: 0x4682b4,\n tan: 0xd2b48c,\n teal: 0x008080,\n thistle: 0xd8bfd8,\n tomato: 0xff6347,\n turquoise: 0x40e0d0,\n violet: 0xee82ee,\n wheat: 0xf5deb3,\n white: 0xffffff,\n whitesmoke: 0xf5f5f5,\n yellow: 0xffff00,\n yellowgreen: 0x9acd32\n};\n\ndefine(Color, color, {\n copy(channels) {\n return Object.assign(new this.constructor, this, channels);\n },\n displayable() {\n return this.rgb().displayable();\n },\n hex: color_formatHex, // Deprecated! Use color.formatHex.\n formatHex: color_formatHex,\n formatHex8: color_formatHex8,\n formatHsl: color_formatHsl,\n formatRgb: color_formatRgb,\n toString: color_formatRgb\n});\n\nfunction color_formatHex() {\n return this.rgb().formatHex();\n}\n\nfunction color_formatHex8() {\n return this.rgb().formatHex8();\n}\n\nfunction color_formatHsl() {\n return hslConvert(this).formatHsl();\n}\n\nfunction color_formatRgb() {\n return this.rgb().formatRgb();\n}\n\nexport default function color(format) {\n var m, l;\n format = (format + \"\").trim().toLowerCase();\n return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000\n : l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00\n : l === 8 ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000\n : l === 4 ? rgba((m >> 12 & 0xf) | (m >> 8 & 0xf0), (m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), (((m & 0xf) << 4) | (m & 0xf)) / 0xff) // #f000\n : null) // invalid hex\n : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0)\n : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)\n : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)\n : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)\n : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)\n : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)\n : named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins\n : format === \"transparent\" ? new Rgb(NaN, NaN, NaN, 0)\n : null;\n}\n\nfunction rgbn(n) {\n return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);\n}\n\nfunction rgba(r, g, b, a) {\n if (a <= 0) r = g = b = NaN;\n return new Rgb(r, g, b, a);\n}\n\nexport function rgbConvert(o) {\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Rgb;\n o = o.rgb();\n return new Rgb(o.r, o.g, o.b, o.opacity);\n}\n\nexport function rgb(r, g, b, opacity) {\n return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);\n}\n\nexport function Rgb(r, g, b, opacity) {\n this.r = +r;\n this.g = +g;\n this.b = +b;\n this.opacity = +opacity;\n}\n\ndefine(Rgb, rgb, extend(Color, {\n brighter(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n darker(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n rgb() {\n return this;\n },\n clamp() {\n return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity));\n },\n displayable() {\n return (-0.5 <= this.r && this.r < 255.5)\n && (-0.5 <= this.g && this.g < 255.5)\n && (-0.5 <= this.b && this.b < 255.5)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n hex: rgb_formatHex, // Deprecated! Use color.formatHex.\n formatHex: rgb_formatHex,\n formatHex8: rgb_formatHex8,\n formatRgb: rgb_formatRgb,\n toString: rgb_formatRgb\n}));\n\nfunction rgb_formatHex() {\n return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`;\n}\n\nfunction rgb_formatHex8() {\n return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;\n}\n\nfunction rgb_formatRgb() {\n const a = clampa(this.opacity);\n return `${a === 1 ? \"rgb(\" : \"rgba(\"}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${a === 1 ? \")\" : `, ${a})`}`;\n}\n\nfunction clampa(opacity) {\n return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity));\n}\n\nfunction clampi(value) {\n return Math.max(0, Math.min(255, Math.round(value) || 0));\n}\n\nfunction hex(value) {\n value = clampi(value);\n return (value < 16 ? \"0\" : \"\") + value.toString(16);\n}\n\nfunction hsla(h, s, l, a) {\n if (a <= 0) h = s = l = NaN;\n else if (l <= 0 || l >= 1) h = s = NaN;\n else if (s <= 0) h = NaN;\n return new Hsl(h, s, l, a);\n}\n\nexport function hslConvert(o) {\n if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Hsl;\n if (o instanceof Hsl) return o;\n o = o.rgb();\n var r = o.r / 255,\n g = o.g / 255,\n b = o.b / 255,\n min = Math.min(r, g, b),\n max = Math.max(r, g, b),\n h = NaN,\n s = max - min,\n l = (max + min) / 2;\n if (s) {\n if (r === max) h = (g - b) / s + (g < b) * 6;\n else if (g === max) h = (b - r) / s + 2;\n else h = (r - g) / s + 4;\n s /= l < 0.5 ? max + min : 2 - max - min;\n h *= 60;\n } else {\n s = l > 0 && l < 1 ? 0 : h;\n }\n return new Hsl(h, s, l, o.opacity);\n}\n\nexport function hsl(h, s, l, opacity) {\n return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);\n}\n\nfunction Hsl(h, s, l, opacity) {\n this.h = +h;\n this.s = +s;\n this.l = +l;\n this.opacity = +opacity;\n}\n\ndefine(Hsl, hsl, extend(Color, {\n brighter(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n darker(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n rgb() {\n var h = this.h % 360 + (this.h < 0) * 360,\n s = isNaN(h) || isNaN(this.s) ? 0 : this.s,\n l = this.l,\n m2 = l + (l < 0.5 ? l : 1 - l) * s,\n m1 = 2 * l - m2;\n return new Rgb(\n hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),\n hsl2rgb(h, m1, m2),\n hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),\n this.opacity\n );\n },\n clamp() {\n return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity));\n },\n displayable() {\n return (0 <= this.s && this.s <= 1 || isNaN(this.s))\n && (0 <= this.l && this.l <= 1)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n formatHsl() {\n const a = clampa(this.opacity);\n return `${a === 1 ? \"hsl(\" : \"hsla(\"}${clamph(this.h)}, ${clampt(this.s) * 100}%, ${clampt(this.l) * 100}%${a === 1 ? \")\" : `, ${a})`}`;\n }\n}));\n\nfunction clamph(value) {\n value = (value || 0) % 360;\n return value < 0 ? value + 360 : value;\n}\n\nfunction clampt(value) {\n return Math.max(0, Math.min(1, value || 0));\n}\n\n/* From FvD 13.37, CSS Color Module Level 3 */\nfunction hsl2rgb(h, m1, m2) {\n return (h < 60 ? m1 + (m2 - m1) * h / 60\n : h < 180 ? m2\n : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60\n : m1) * 255;\n}\n", "export const radians = Math.PI / 180;\nexport const degrees = 180 / Math.PI;\n", "import define, {extend} from \"./define.js\";\nimport {Color, rgbConvert, Rgb} from \"./color.js\";\nimport {degrees, radians} from \"./math.js\";\n\n// https://observablehq.com/@mbostock/lab-and-rgb\nconst K = 18,\n Xn = 0.96422,\n Yn = 1,\n Zn = 0.82521,\n t0 = 4 / 29,\n t1 = 6 / 29,\n t2 = 3 * t1 * t1,\n t3 = t1 * t1 * t1;\n\nfunction labConvert(o) {\n if (o instanceof Lab) return new Lab(o.l, o.a, o.b, o.opacity);\n if (o instanceof Hcl) return hcl2lab(o);\n if (!(o instanceof Rgb)) o = rgbConvert(o);\n var r = rgb2lrgb(o.r),\n g = rgb2lrgb(o.g),\n b = rgb2lrgb(o.b),\n y = xyz2lab((0.2225045 * r + 0.7168786 * g + 0.0606169 * b) / Yn), x, z;\n if (r === g && g === b) x = z = y; else {\n x = xyz2lab((0.4360747 * r + 0.3850649 * g + 0.1430804 * b) / Xn);\n z = xyz2lab((0.0139322 * r + 0.0971045 * g + 0.7141733 * b) / Zn);\n }\n return new Lab(116 * y - 16, 500 * (x - y), 200 * (y - z), o.opacity);\n}\n\nexport function gray(l, opacity) {\n return new Lab(l, 0, 0, opacity == null ? 1 : opacity);\n}\n\nexport default function lab(l, a, b, opacity) {\n return arguments.length === 1 ? labConvert(l) : new Lab(l, a, b, opacity == null ? 1 : opacity);\n}\n\nexport function Lab(l, a, b, opacity) {\n this.l = +l;\n this.a = +a;\n this.b = +b;\n this.opacity = +opacity;\n}\n\ndefine(Lab, lab, extend(Color, {\n brighter(k) {\n return new Lab(this.l + K * (k == null ? 1 : k), this.a, this.b, this.opacity);\n },\n darker(k) {\n return new Lab(this.l - K * (k == null ? 1 : k), this.a, this.b, this.opacity);\n },\n rgb() {\n var y = (this.l + 16) / 116,\n x = isNaN(this.a) ? y : y + this.a / 500,\n z = isNaN(this.b) ? y : y - this.b / 200;\n x = Xn * lab2xyz(x);\n y = Yn * lab2xyz(y);\n z = Zn * lab2xyz(z);\n return new Rgb(\n lrgb2rgb( 3.1338561 * x - 1.6168667 * y - 0.4906146 * z),\n lrgb2rgb(-0.9787684 * x + 1.9161415 * y + 0.0334540 * z),\n lrgb2rgb( 0.0719453 * x - 0.2289914 * y + 1.4052427 * z),\n this.opacity\n );\n }\n}));\n\nfunction xyz2lab(t) {\n return t > t3 ? Math.pow(t, 1 / 3) : t / t2 + t0;\n}\n\nfunction lab2xyz(t) {\n return t > t1 ? t * t * t : t2 * (t - t0);\n}\n\nfunction lrgb2rgb(x) {\n return 255 * (x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055);\n}\n\nfunction rgb2lrgb(x) {\n return (x /= 255) <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4);\n}\n\nfunction hclConvert(o) {\n if (o instanceof Hcl) return new Hcl(o.h, o.c, o.l, o.opacity);\n if (!(o instanceof Lab)) o = labConvert(o);\n if (o.a === 0 && o.b === 0) return new Hcl(NaN, 0 < o.l && o.l < 100 ? 0 : NaN, o.l, o.opacity);\n var h = Math.atan2(o.b, o.a) * degrees;\n return new Hcl(h < 0 ? h + 360 : h, Math.sqrt(o.a * o.a + o.b * o.b), o.l, o.opacity);\n}\n\nexport function lch(l, c, h, opacity) {\n return arguments.length === 1 ? hclConvert(l) : new Hcl(h, c, l, opacity == null ? 1 : opacity);\n}\n\nexport function hcl(h, c, l, opacity) {\n return arguments.length === 1 ? hclConvert(h) : new Hcl(h, c, l, opacity == null ? 1 : opacity);\n}\n\nexport function Hcl(h, c, l, opacity) {\n this.h = +h;\n this.c = +c;\n this.l = +l;\n this.opacity = +opacity;\n}\n\nfunction hcl2lab(o) {\n if (isNaN(o.h)) return new Lab(o.l, 0, 0, o.opacity);\n var h = o.h * radians;\n return new Lab(o.l, Math.cos(h) * o.c, Math.sin(h) * o.c, o.opacity);\n}\n\ndefine(Hcl, hcl, extend(Color, {\n brighter(k) {\n return new Hcl(this.h, this.c, this.l + K * (k == null ? 1 : k), this.opacity);\n },\n darker(k) {\n return new Hcl(this.h, this.c, this.l - K * (k == null ? 1 : k), this.opacity);\n },\n rgb() {\n return hcl2lab(this).rgb();\n }\n}));\n", "import define, {extend} from \"./define.js\";\nimport {Color, rgbConvert, Rgb, darker, brighter} from \"./color.js\";\nimport {degrees, radians} from \"./math.js\";\n\nvar A = -0.14861,\n B = +1.78277,\n C = -0.29227,\n D = -0.90649,\n E = +1.97294,\n ED = E * D,\n EB = E * B,\n BC_DA = B * C - D * A;\n\nfunction cubehelixConvert(o) {\n if (o instanceof Cubehelix) return new Cubehelix(o.h, o.s, o.l, o.opacity);\n if (!(o instanceof Rgb)) o = rgbConvert(o);\n var r = o.r / 255,\n g = o.g / 255,\n b = o.b / 255,\n l = (BC_DA * b + ED * r - EB * g) / (BC_DA + ED - EB),\n bl = b - l,\n k = (E * (g - l) - C * bl) / D,\n s = Math.sqrt(k * k + bl * bl) / (E * l * (1 - l)), // NaN if l=0 or l=1\n h = s ? Math.atan2(k, bl) * degrees - 120 : NaN;\n return new Cubehelix(h < 0 ? h + 360 : h, s, l, o.opacity);\n}\n\nexport default function cubehelix(h, s, l, opacity) {\n return arguments.length === 1 ? cubehelixConvert(h) : new Cubehelix(h, s, l, opacity == null ? 1 : opacity);\n}\n\nexport function Cubehelix(h, s, l, opacity) {\n this.h = +h;\n this.s = +s;\n this.l = +l;\n this.opacity = +opacity;\n}\n\ndefine(Cubehelix, cubehelix, extend(Color, {\n brighter(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Cubehelix(this.h, this.s, this.l * k, this.opacity);\n },\n darker(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Cubehelix(this.h, this.s, this.l * k, this.opacity);\n },\n rgb() {\n var h = isNaN(this.h) ? 0 : (this.h + 120) * radians,\n l = +this.l,\n a = isNaN(this.s) ? 0 : this.s * l * (1 - l),\n cosh = Math.cos(h),\n sinh = Math.sin(h);\n return new Rgb(\n 255 * (l + a * (A * cosh + B * sinh)),\n 255 * (l + a * (C * cosh + D * sinh)),\n 255 * (l + a * (E * cosh)),\n this.opacity\n );\n }\n}));\n", "export function basis(t1, v0, v1, v2, v3) {\n var t2 = t1 * t1, t3 = t2 * t1;\n return ((1 - 3 * t1 + 3 * t2 - t3) * v0\n + (4 - 6 * t2 + 3 * t3) * v1\n + (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2\n + t3 * v3) / 6;\n}\n\nexport default function(values) {\n var n = values.length - 1;\n return function(t) {\n var i = t <= 0 ? (t = 0) : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n),\n v1 = values[i],\n v2 = values[i + 1],\n v0 = i > 0 ? values[i - 1] : 2 * v1 - v2,\n v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1;\n return basis((t - i / n) * n, v0, v1, v2, v3);\n };\n}\n", "import {basis} from \"./basis.js\";\n\nexport default function(values) {\n var n = values.length;\n return function(t) {\n var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n),\n v0 = values[(i + n - 1) % n],\n v1 = values[i % n],\n v2 = values[(i + 1) % n],\n v3 = values[(i + 2) % n];\n return basis((t - i / n) * n, v0, v1, v2, v3);\n };\n}\n", "export default x => () => x;\n", "import constant from \"./constant.js\";\n\nfunction linear(a, d) {\n return function(t) {\n return a + t * d;\n };\n}\n\nfunction exponential(a, b, y) {\n return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) {\n return Math.pow(a + t * b, y);\n };\n}\n\nexport function hue(a, b) {\n var d = b - a;\n return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant(isNaN(a) ? b : a);\n}\n\nexport function gamma(y) {\n return (y = +y) === 1 ? nogamma : function(a, b) {\n return b - a ? exponential(a, b, y) : constant(isNaN(a) ? b : a);\n };\n}\n\nexport default function nogamma(a, b) {\n var d = b - a;\n return d ? linear(a, d) : constant(isNaN(a) ? b : a);\n}\n", "import {rgb as colorRgb} from \"d3-color\";\nimport basis from \"./basis.js\";\nimport basisClosed from \"./basisClosed.js\";\nimport nogamma, {gamma} from \"./color.js\";\n\nexport default (function rgbGamma(y) {\n var color = gamma(y);\n\n function rgb(start, end) {\n var r = color((start = colorRgb(start)).r, (end = colorRgb(end)).r),\n g = color(start.g, end.g),\n b = color(start.b, end.b),\n opacity = nogamma(start.opacity, end.opacity);\n return function(t) {\n start.r = r(t);\n start.g = g(t);\n start.b = b(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n\n rgb.gamma = rgbGamma;\n\n return rgb;\n})(1);\n\nfunction rgbSpline(spline) {\n return function(colors) {\n var n = colors.length,\n r = new Array(n),\n g = new Array(n),\n b = new Array(n),\n i, color;\n for (i = 0; i < n; ++i) {\n color = colorRgb(colors[i]);\n r[i] = color.r || 0;\n g[i] = color.g || 0;\n b[i] = color.b || 0;\n }\n r = spline(r);\n g = spline(g);\n b = spline(b);\n color.opacity = 1;\n return function(t) {\n color.r = r(t);\n color.g = g(t);\n color.b = b(t);\n return color + \"\";\n };\n };\n}\n\nexport var rgbBasis = rgbSpline(basis);\nexport var rgbBasisClosed = rgbSpline(basisClosed);\n", "export default function(a, b) {\n if (!b) b = [];\n var n = a ? Math.min(b.length, a.length) : 0,\n c = b.slice(),\n i;\n return function(t) {\n for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t;\n return c;\n };\n}\n\nexport function isNumberArray(x) {\n return ArrayBuffer.isView(x) && !(x instanceof DataView);\n}\n", "import value from \"./value.js\";\nimport numberArray, {isNumberArray} from \"./numberArray.js\";\n\nexport default function(a, b) {\n return (isNumberArray(b) ? numberArray : genericArray)(a, b);\n}\n\nexport function genericArray(a, b) {\n var nb = b ? b.length : 0,\n na = a ? Math.min(nb, a.length) : 0,\n x = new Array(na),\n c = new Array(nb),\n i;\n\n for (i = 0; i < na; ++i) x[i] = value(a[i], b[i]);\n for (; i < nb; ++i) c[i] = b[i];\n\n return function(t) {\n for (i = 0; i < na; ++i) c[i] = x[i](t);\n return c;\n };\n}\n", "export default function(a, b) {\n var d = new Date;\n return a = +a, b = +b, function(t) {\n return d.setTime(a * (1 - t) + b * t), d;\n };\n}\n", "export default function(a, b) {\n return a = +a, b = +b, function(t) {\n return a * (1 - t) + b * t;\n };\n}\n", "import value from \"./value.js\";\n\nexport default function(a, b) {\n var i = {},\n c = {},\n k;\n\n if (a === null || typeof a !== \"object\") a = {};\n if (b === null || typeof b !== \"object\") b = {};\n\n for (k in b) {\n if (k in a) {\n i[k] = value(a[k], b[k]);\n } else {\n c[k] = b[k];\n }\n }\n\n return function(t) {\n for (k in i) c[k] = i[k](t);\n return c;\n };\n}\n", "import number from \"./number.js\";\n\nvar reA = /[-+]?(?:\\d+\\.?\\d*|\\.?\\d+)(?:[eE][-+]?\\d+)?/g,\n reB = new RegExp(reA.source, \"g\");\n\nfunction zero(b) {\n return function() {\n return b;\n };\n}\n\nfunction one(b) {\n return function(t) {\n return b(t) + \"\";\n };\n}\n\nexport default function(a, b) {\n var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b\n am, // current match in a\n bm, // current match in b\n bs, // string preceding current number in b, if any\n i = -1, // index in s\n s = [], // string constants and placeholders\n q = []; // number interpolators\n\n // Coerce inputs to strings.\n a = a + \"\", b = b + \"\";\n\n // Interpolate pairs of numbers in a & b.\n while ((am = reA.exec(a))\n && (bm = reB.exec(b))) {\n if ((bs = bm.index) > bi) { // a string precedes the next number in b\n bs = b.slice(bi, bs);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match\n if (s[i]) s[i] += bm; // coalesce with previous string\n else s[++i] = bm;\n } else { // interpolate non-matching numbers\n s[++i] = null;\n q.push({i: i, x: number(am, bm)});\n }\n bi = reB.lastIndex;\n }\n\n // Add remains of b.\n if (bi < b.length) {\n bs = b.slice(bi);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n\n // Special optimization for only a single match.\n // Otherwise, interpolate each of the numbers and rejoin the string.\n return s.length < 2 ? (q[0]\n ? one(q[0].x)\n : zero(b))\n : (b = q.length, function(t) {\n for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);\n return s.join(\"\");\n });\n}\n", "import {color} from \"d3-color\";\nimport rgb from \"./rgb.js\";\nimport {genericArray} from \"./array.js\";\nimport date from \"./date.js\";\nimport number from \"./number.js\";\nimport object from \"./object.js\";\nimport string from \"./string.js\";\nimport constant from \"./constant.js\";\nimport numberArray, {isNumberArray} from \"./numberArray.js\";\n\nexport default function(a, b) {\n var t = typeof b, c;\n return b == null || t === \"boolean\" ? constant(b)\n : (t === \"number\" ? number\n : t === \"string\" ? ((c = color(b)) ? (b = c, rgb) : string)\n : b instanceof color ? rgb\n : b instanceof Date ? date\n : isNumberArray(b) ? numberArray\n : Array.isArray(b) ? genericArray\n : typeof b.valueOf !== \"function\" && typeof b.toString !== \"function\" || isNaN(b) ? object\n : number)(a, b);\n}\n", "export default function(a, b) {\n return a = +a, b = +b, function(t) {\n return Math.round(a * (1 - t) + b * t);\n };\n}\n", "var degrees = 180 / Math.PI;\n\nexport var identity = {\n translateX: 0,\n translateY: 0,\n rotate: 0,\n skewX: 0,\n scaleX: 1,\n scaleY: 1\n};\n\nexport default function(a, b, c, d, e, f) {\n var scaleX, scaleY, skewX;\n if (scaleX = Math.sqrt(a * a + b * b)) a /= scaleX, b /= scaleX;\n if (skewX = a * c + b * d) c -= a * skewX, d -= b * skewX;\n if (scaleY = Math.sqrt(c * c + d * d)) c /= scaleY, d /= scaleY, skewX /= scaleY;\n if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX;\n return {\n translateX: e,\n translateY: f,\n rotate: Math.atan2(b, a) * degrees,\n skewX: Math.atan(skewX) * degrees,\n scaleX: scaleX,\n scaleY: scaleY\n };\n}\n", "import decompose, {identity} from \"./decompose.js\";\n\nvar svgNode;\n\n/* eslint-disable no-undef */\nexport function parseCss(value) {\n const m = new (typeof DOMMatrix === \"function\" ? DOMMatrix : WebKitCSSMatrix)(value + \"\");\n return m.isIdentity ? identity : decompose(m.a, m.b, m.c, m.d, m.e, m.f);\n}\n\nexport function parseSvg(value) {\n if (value == null) return identity;\n if (!svgNode) svgNode = document.createElementNS(\"http://www.w3.org/2000/svg\", \"g\");\n svgNode.setAttribute(\"transform\", value);\n if (!(value = svgNode.transform.baseVal.consolidate())) return identity;\n value = value.matrix;\n return decompose(value.a, value.b, value.c, value.d, value.e, value.f);\n}\n", "import number from \"../number.js\";\nimport {parseCss, parseSvg} from \"./parse.js\";\n\nfunction interpolateTransform(parse, pxComma, pxParen, degParen) {\n\n function pop(s) {\n return s.length ? s.pop() + \" \" : \"\";\n }\n\n function translate(xa, ya, xb, yb, s, q) {\n if (xa !== xb || ya !== yb) {\n var i = s.push(\"translate(\", null, pxComma, null, pxParen);\n q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});\n } else if (xb || yb) {\n s.push(\"translate(\" + xb + pxComma + yb + pxParen);\n }\n }\n\n function rotate(a, b, s, q) {\n if (a !== b) {\n if (a - b > 180) b += 360; else if (b - a > 180) a += 360; // shortest path\n q.push({i: s.push(pop(s) + \"rotate(\", null, degParen) - 2, x: number(a, b)});\n } else if (b) {\n s.push(pop(s) + \"rotate(\" + b + degParen);\n }\n }\n\n function skewX(a, b, s, q) {\n if (a !== b) {\n q.push({i: s.push(pop(s) + \"skewX(\", null, degParen) - 2, x: number(a, b)});\n } else if (b) {\n s.push(pop(s) + \"skewX(\" + b + degParen);\n }\n }\n\n function scale(xa, ya, xb, yb, s, q) {\n if (xa !== xb || ya !== yb) {\n var i = s.push(pop(s) + \"scale(\", null, \",\", null, \")\");\n q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});\n } else if (xb !== 1 || yb !== 1) {\n s.push(pop(s) + \"scale(\" + xb + \",\" + yb + \")\");\n }\n }\n\n return function(a, b) {\n var s = [], // string constants and placeholders\n q = []; // number interpolators\n a = parse(a), b = parse(b);\n translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q);\n rotate(a.rotate, b.rotate, s, q);\n skewX(a.skewX, b.skewX, s, q);\n scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q);\n a = b = null; // gc\n return function(t) {\n var i = -1, n = q.length, o;\n while (++i < n) s[(o = q[i]).i] = o.x(t);\n return s.join(\"\");\n };\n };\n}\n\nexport var interpolateTransformCss = interpolateTransform(parseCss, \"px, \", \"px)\", \"deg)\");\nexport var interpolateTransformSvg = interpolateTransform(parseSvg, \", \", \")\", \")\");\n", "import {hsl as colorHsl} from \"d3-color\";\nimport color, {hue} from \"./color.js\";\n\nfunction hsl(hue) {\n return function(start, end) {\n var h = hue((start = colorHsl(start)).h, (end = colorHsl(end)).h),\n s = color(start.s, end.s),\n l = color(start.l, end.l),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.s = s(t);\n start.l = l(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n}\n\nexport default hsl(hue);\nexport var hslLong = hsl(color);\n", "import {lab as colorLab} from \"d3-color\";\nimport color from \"./color.js\";\n\nexport default function lab(start, end) {\n var l = color((start = colorLab(start)).l, (end = colorLab(end)).l),\n a = color(start.a, end.a),\n b = color(start.b, end.b),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.l = l(t);\n start.a = a(t);\n start.b = b(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n}\n", "import {hcl as colorHcl} from \"d3-color\";\nimport color, {hue} from \"./color.js\";\n\nfunction hcl(hue) {\n return function(start, end) {\n var h = hue((start = colorHcl(start)).h, (end = colorHcl(end)).h),\n c = color(start.c, end.c),\n l = color(start.l, end.l),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.c = c(t);\n start.l = l(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n}\n\nexport default hcl(hue);\nexport var hclLong = hcl(color);\n", "import {cubehelix as colorCubehelix} from \"d3-color\";\nimport color, {hue} from \"./color.js\";\n\nfunction cubehelix(hue) {\n return (function cubehelixGamma(y) {\n y = +y;\n\n function cubehelix(start, end) {\n var h = hue((start = colorCubehelix(start)).h, (end = colorCubehelix(end)).h),\n s = color(start.s, end.s),\n l = color(start.l, end.l),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.s = s(t);\n start.l = l(Math.pow(t, y));\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n\n cubehelix.gamma = cubehelixGamma;\n\n return cubehelix;\n })(1);\n}\n\nexport default cubehelix(hue);\nexport var cubehelixLong = cubehelix(color);\n", "import {default as value} from \"./value.js\";\n\nexport default function piecewise(interpolate, values) {\n if (values === undefined) values = interpolate, interpolate = value;\n var i = 0, n = values.length - 1, v = values[0], I = new Array(n < 0 ? 0 : n);\n while (i < n) I[i] = interpolate(v, v = values[++i]);\n return function(t) {\n var i = Math.max(0, Math.min(n - 1, Math.floor(t *= n)));\n return I[i](t - i);\n };\n}\n", "export default function(interpolator, n) {\n var samples = new Array(n);\n for (var i = 0; i < n; ++i) samples[i] = interpolator(i / (n - 1));\n return samples;\n}\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\u2019ve set an alarm, if we haven\u2019t already.\n var t = taskHead, e;\n while (t) {\n if ((e = clockNow - t._time) >= 0) t._call.call(undefined, 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 {Timer} from \"./timer.js\";\n\nexport default function(callback, delay, time) {\n var t = new Timer;\n delay = delay == null ? 0 : +delay;\n t.restart(elapsed => {\n t.stop();\n callback(elapsed + delay);\n }, delay, time);\n return t;\n}\n", "import {dispatch} from \"d3-dispatch\";\nimport {timer, timeout} from \"d3-timer\";\n\nvar emptyOn = dispatch(\"start\", \"end\", \"cancel\", \"interrupt\");\nvar emptyTween = [];\n\nexport var CREATED = 0;\nexport var SCHEDULED = 1;\nexport var STARTING = 2;\nexport var STARTED = 3;\nexport var RUNNING = 4;\nexport var ENDING = 5;\nexport var ENDED = 6;\n\nexport default function(node, name, id, index, group, timing) {\n var schedules = node.__transition;\n if (!schedules) node.__transition = {};\n else if (id in schedules) return;\n create(node, id, {\n name: name,\n index: index, // For context during callback.\n group: group, // For context during callback.\n on: emptyOn,\n tween: emptyTween,\n time: timing.time,\n delay: timing.delay,\n duration: timing.duration,\n ease: timing.ease,\n timer: null,\n state: CREATED\n });\n}\n\nexport function init(node, id) {\n var schedule = get(node, id);\n if (schedule.state > CREATED) throw new Error(\"too late; already scheduled\");\n return schedule;\n}\n\nexport function set(node, id) {\n var schedule = get(node, id);\n if (schedule.state > STARTED) throw new Error(\"too late; already running\");\n return schedule;\n}\n\nexport function get(node, id) {\n var schedule = node.__transition;\n if (!schedule || !(schedule = schedule[id])) throw new Error(\"transition not found\");\n return schedule;\n}\n\nfunction create(node, id, self) {\n var schedules = node.__transition,\n tween;\n\n // Initialize the self timer when the transition is created.\n // Note the actual delay is not known until the first callback!\n schedules[id] = self;\n self.timer = timer(schedule, 0, self.time);\n\n function schedule(elapsed) {\n self.state = SCHEDULED;\n self.timer.restart(start, self.delay, self.time);\n\n // If the elapsed delay is less than our first sleep, start immediately.\n if (self.delay <= elapsed) start(elapsed - self.delay);\n }\n\n function start(elapsed) {\n var i, j, n, o;\n\n // If the state is not SCHEDULED, then we previously errored on start.\n if (self.state !== SCHEDULED) return stop();\n\n for (i in schedules) {\n o = schedules[i];\n if (o.name !== self.name) continue;\n\n // While this element already has a starting transition during this frame,\n // defer starting an interrupting transition until that transition has a\n // chance to tick (and possibly end); see d3/d3-transition#54!\n if (o.state === STARTED) return timeout(start);\n\n // Interrupt the active transition, if any.\n if (o.state === RUNNING) {\n o.state = ENDED;\n o.timer.stop();\n o.on.call(\"interrupt\", node, node.__data__, o.index, o.group);\n delete schedules[i];\n }\n\n // Cancel any pre-empted transitions.\n else if (+i < id) {\n o.state = ENDED;\n o.timer.stop();\n o.on.call(\"cancel\", node, node.__data__, o.index, o.group);\n delete schedules[i];\n }\n }\n\n // Defer the first tick to end of the current frame; see d3/d3#1576.\n // Note the transition may be canceled after start and before the first tick!\n // Note this must be scheduled before the start event; see d3/d3-transition#16!\n // Assuming this is successful, subsequent callbacks go straight to tick.\n timeout(function() {\n if (self.state === STARTED) {\n self.state = RUNNING;\n self.timer.restart(tick, self.delay, self.time);\n tick(elapsed);\n }\n });\n\n // Dispatch the start event.\n // Note this must be done before the tween are initialized.\n self.state = STARTING;\n self.on.call(\"start\", node, node.__data__, self.index, self.group);\n if (self.state !== STARTING) return; // interrupted\n self.state = STARTED;\n\n // Initialize the tween, deleting null tween.\n tween = new Array(n = self.tween.length);\n for (i = 0, j = -1; i < n; ++i) {\n if (o = self.tween[i].value.call(node, node.__data__, self.index, self.group)) {\n tween[++j] = o;\n }\n }\n tween.length = j + 1;\n }\n\n function tick(elapsed) {\n var t = elapsed < self.duration ? self.ease.call(null, elapsed / self.duration) : (self.timer.restart(stop), self.state = ENDING, 1),\n i = -1,\n n = tween.length;\n\n while (++i < n) {\n tween[i].call(node, t);\n }\n\n // Dispatch the end event.\n if (self.state === ENDING) {\n self.on.call(\"end\", node, node.__data__, self.index, self.group);\n stop();\n }\n }\n\n function stop() {\n self.state = ENDED;\n self.timer.stop();\n delete schedules[id];\n for (var i in schedules) return; // eslint-disable-line no-unused-vars\n delete node.__transition;\n }\n}\n", "import {STARTING, ENDING, ENDED} from \"./transition/schedule.js\";\n\nexport default function(node, name) {\n var schedules = node.__transition,\n schedule,\n active,\n empty = true,\n i;\n\n if (!schedules) return;\n\n name = name == null ? null : name + \"\";\n\n for (i in schedules) {\n if ((schedule = schedules[i]).name !== name) { empty = false; continue; }\n active = schedule.state > STARTING && schedule.state < ENDING;\n schedule.state = ENDED;\n schedule.timer.stop();\n schedule.on.call(active ? \"interrupt\" : \"cancel\", node, node.__data__, schedule.index, schedule.group);\n delete schedules[i];\n }\n\n if (empty) delete node.__transition;\n}\n", "import interrupt from \"../interrupt.js\";\n\nexport default function(name) {\n return this.each(function() {\n interrupt(this, name);\n });\n}\n", "import {get, set} from \"./schedule.js\";\n\nfunction tweenRemove(id, name) {\n var tween0, tween1;\n return function() {\n var schedule = set(this, id),\n tween = schedule.tween;\n\n // If this node shared tween with the previous node,\n // just assign the updated shared tween and we\u2019re done!\n // Otherwise, copy-on-write.\n if (tween !== tween0) {\n tween1 = tween0 = tween;\n for (var i = 0, n = tween1.length; i < n; ++i) {\n if (tween1[i].name === name) {\n tween1 = tween1.slice();\n tween1.splice(i, 1);\n break;\n }\n }\n }\n\n schedule.tween = tween1;\n };\n}\n\nfunction tweenFunction(id, name, value) {\n var tween0, tween1;\n if (typeof value !== \"function\") throw new Error;\n return function() {\n var schedule = set(this, id),\n tween = schedule.tween;\n\n // If this node shared tween with the previous node,\n // just assign the updated shared tween and we\u2019re done!\n // Otherwise, copy-on-write.\n if (tween !== tween0) {\n tween1 = (tween0 = tween).slice();\n for (var t = {name: name, value: value}, i = 0, n = tween1.length; i < n; ++i) {\n if (tween1[i].name === name) {\n tween1[i] = t;\n break;\n }\n }\n if (i === n) tween1.push(t);\n }\n\n schedule.tween = tween1;\n };\n}\n\nexport default function(name, value) {\n var id = this._id;\n\n name += \"\";\n\n if (arguments.length < 2) {\n var tween = get(this.node(), id).tween;\n for (var i = 0, n = tween.length, t; i < n; ++i) {\n if ((t = tween[i]).name === name) {\n return t.value;\n }\n }\n return null;\n }\n\n return this.each((value == null ? tweenRemove : tweenFunction)(id, name, value));\n}\n\nexport function tweenValue(transition, name, value) {\n var id = transition._id;\n\n transition.each(function() {\n var schedule = set(this, id);\n (schedule.value || (schedule.value = {}))[name] = value.apply(this, arguments);\n });\n\n return function(node) {\n return get(node, id).value[name];\n };\n}\n", "import {color} from \"d3-color\";\nimport {interpolateNumber, interpolateRgb, interpolateString} from \"d3-interpolate\";\n\nexport default function(a, b) {\n var c;\n return (typeof b === \"number\" ? interpolateNumber\n : b instanceof color ? interpolateRgb\n : (c = color(b)) ? (b = c, interpolateRgb)\n : interpolateString)(a, b);\n}\n", "import {interpolateTransformSvg as interpolateTransform} from \"d3-interpolate\";\nimport {namespace} from \"d3-selection\";\nimport {tweenValue} from \"./tween.js\";\nimport interpolate from \"./interpolate.js\";\n\nfunction attrRemove(name) {\n return function() {\n this.removeAttribute(name);\n };\n}\n\nfunction attrRemoveNS(fullname) {\n return function() {\n this.removeAttributeNS(fullname.space, fullname.local);\n };\n}\n\nfunction attrConstant(name, interpolate, value1) {\n var string00,\n string1 = value1 + \"\",\n interpolate0;\n return function() {\n var string0 = this.getAttribute(name);\n return string0 === string1 ? null\n : string0 === string00 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, value1);\n };\n}\n\nfunction attrConstantNS(fullname, interpolate, value1) {\n var string00,\n string1 = value1 + \"\",\n interpolate0;\n return function() {\n var string0 = this.getAttributeNS(fullname.space, fullname.local);\n return string0 === string1 ? null\n : string0 === string00 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, value1);\n };\n}\n\nfunction attrFunction(name, interpolate, value) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0, value1 = value(this), string1;\n if (value1 == null) return void this.removeAttribute(name);\n string0 = this.getAttribute(name);\n string1 = value1 + \"\";\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));\n };\n}\n\nfunction attrFunctionNS(fullname, interpolate, value) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0, value1 = value(this), string1;\n if (value1 == null) return void this.removeAttributeNS(fullname.space, fullname.local);\n string0 = this.getAttributeNS(fullname.space, fullname.local);\n string1 = value1 + \"\";\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));\n };\n}\n\nexport default function(name, value) {\n var fullname = namespace(name), i = fullname === \"transform\" ? interpolateTransform : interpolate;\n return this.attrTween(name, typeof value === \"function\"\n ? (fullname.local ? attrFunctionNS : attrFunction)(fullname, i, tweenValue(this, \"attr.\" + name, value))\n : value == null ? (fullname.local ? attrRemoveNS : attrRemove)(fullname)\n : (fullname.local ? attrConstantNS : attrConstant)(fullname, i, value));\n}\n", "import {namespace} from \"d3-selection\";\n\nfunction attrInterpolate(name, i) {\n return function(t) {\n this.setAttribute(name, i.call(this, t));\n };\n}\n\nfunction attrInterpolateNS(fullname, i) {\n return function(t) {\n this.setAttributeNS(fullname.space, fullname.local, i.call(this, t));\n };\n}\n\nfunction attrTweenNS(fullname, value) {\n var t0, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t0 = (i0 = i) && attrInterpolateNS(fullname, i);\n return t0;\n }\n tween._value = value;\n return tween;\n}\n\nfunction attrTween(name, value) {\n var t0, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t0 = (i0 = i) && attrInterpolate(name, i);\n return t0;\n }\n tween._value = value;\n return tween;\n}\n\nexport default function(name, value) {\n var key = \"attr.\" + name;\n if (arguments.length < 2) return (key = this.tween(key)) && key._value;\n if (value == null) return this.tween(key, null);\n if (typeof value !== \"function\") throw new Error;\n var fullname = namespace(name);\n return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value));\n}\n", "import {get, init} from \"./schedule.js\";\n\nfunction delayFunction(id, value) {\n return function() {\n init(this, id).delay = +value.apply(this, arguments);\n };\n}\n\nfunction delayConstant(id, value) {\n return value = +value, function() {\n init(this, id).delay = value;\n };\n}\n\nexport default function(value) {\n var id = this._id;\n\n return arguments.length\n ? this.each((typeof value === \"function\"\n ? delayFunction\n : delayConstant)(id, value))\n : get(this.node(), id).delay;\n}\n", "import {get, set} from \"./schedule.js\";\n\nfunction durationFunction(id, value) {\n return function() {\n set(this, id).duration = +value.apply(this, arguments);\n };\n}\n\nfunction durationConstant(id, value) {\n return value = +value, function() {\n set(this, id).duration = value;\n };\n}\n\nexport default function(value) {\n var id = this._id;\n\n return arguments.length\n ? this.each((typeof value === \"function\"\n ? durationFunction\n : durationConstant)(id, value))\n : get(this.node(), id).duration;\n}\n", "import {get, set} from \"./schedule.js\";\n\nfunction easeConstant(id, value) {\n if (typeof value !== \"function\") throw new Error;\n return function() {\n set(this, id).ease = value;\n };\n}\n\nexport default function(value) {\n var id = this._id;\n\n return arguments.length\n ? this.each(easeConstant(id, value))\n : get(this.node(), id).ease;\n}\n", "import {set} from \"./schedule.js\";\n\nfunction easeVarying(id, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (typeof v !== \"function\") throw new Error;\n set(this, id).ease = v;\n };\n}\n\nexport default function(value) {\n if (typeof value !== \"function\") throw new Error;\n return this.each(easeVarying(this._id, value));\n}\n", "import {matcher} from \"d3-selection\";\nimport {Transition} from \"./index.js\";\n\nexport default function(match) {\n if (typeof match !== \"function\") match = matcher(match);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {\n if ((node = group[i]) && match.call(node, node.__data__, i, group)) {\n subgroup.push(node);\n }\n }\n }\n\n return new Transition(subgroups, this._parents, this._name, this._id);\n}\n", "import {Transition} from \"./index.js\";\n\nexport default function(transition) {\n if (transition._id !== this._id) throw new Error;\n\n for (var groups0 = this._groups, groups1 = transition._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {\n for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {\n if (node = group0[i] || group1[i]) {\n merge[i] = node;\n }\n }\n }\n\n for (; j < m0; ++j) {\n merges[j] = groups0[j];\n }\n\n return new Transition(merges, this._parents, this._name, this._id);\n}\n", "import {get, set, init} from \"./schedule.js\";\n\nfunction start(name) {\n return (name + \"\").trim().split(/^|\\s+/).every(function(t) {\n var i = t.indexOf(\".\");\n if (i >= 0) t = t.slice(0, i);\n return !t || t === \"start\";\n });\n}\n\nfunction onFunction(id, name, listener) {\n var on0, on1, sit = start(name) ? init : set;\n return function() {\n var schedule = sit(this, id),\n on = schedule.on;\n\n // If this node shared a dispatch with the previous node,\n // just assign the updated shared dispatch and we\u2019re done!\n // Otherwise, copy-on-write.\n if (on !== on0) (on1 = (on0 = on).copy()).on(name, listener);\n\n schedule.on = on1;\n };\n}\n\nexport default function(name, listener) {\n var id = this._id;\n\n return arguments.length < 2\n ? get(this.node(), id).on.on(name)\n : this.each(onFunction(id, name, listener));\n}\n", "function removeFunction(id) {\n return function() {\n var parent = this.parentNode;\n for (var i in this.__transition) if (+i !== id) return;\n if (parent) parent.removeChild(this);\n };\n}\n\nexport default function() {\n return this.on(\"end.remove\", removeFunction(this._id));\n}\n", "import {selector} from \"d3-selection\";\nimport {Transition} from \"./index.js\";\nimport schedule, {get} from \"./schedule.js\";\n\nexport default function(select) {\n var name = this._name,\n id = this._id;\n\n if (typeof select !== \"function\") select = selector(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {\n if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {\n if (\"__data__\" in node) subnode.__data__ = node.__data__;\n subgroup[i] = subnode;\n schedule(subgroup[i], name, id, i, subgroup, get(node, id));\n }\n }\n }\n\n return new Transition(subgroups, this._parents, name, id);\n}\n", "import {selectorAll} from \"d3-selection\";\nimport {Transition} from \"./index.js\";\nimport schedule, {get} from \"./schedule.js\";\n\nexport default function(select) {\n var name = this._name,\n id = this._id;\n\n if (typeof select !== \"function\") select = selectorAll(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n for (var children = select.call(node, node.__data__, i, group), child, inherit = get(node, id), k = 0, l = children.length; k < l; ++k) {\n if (child = children[k]) {\n schedule(child, name, id, k, children, inherit);\n }\n }\n subgroups.push(children);\n parents.push(node);\n }\n }\n }\n\n return new Transition(subgroups, parents, name, id);\n}\n", "import {selection} from \"d3-selection\";\n\nvar Selection = selection.prototype.constructor;\n\nexport default function() {\n return new Selection(this._groups, this._parents);\n}\n", "import {interpolateTransformCss as interpolateTransform} from \"d3-interpolate\";\nimport {style} from \"d3-selection\";\nimport {set} from \"./schedule.js\";\nimport {tweenValue} from \"./tween.js\";\nimport interpolate from \"./interpolate.js\";\n\nfunction styleNull(name, interpolate) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0 = style(this, name),\n string1 = (this.style.removeProperty(name), style(this, name));\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, string10 = string1);\n };\n}\n\nfunction styleRemove(name) {\n return function() {\n this.style.removeProperty(name);\n };\n}\n\nfunction styleConstant(name, interpolate, value1) {\n var string00,\n string1 = value1 + \"\",\n interpolate0;\n return function() {\n var string0 = style(this, name);\n return string0 === string1 ? null\n : string0 === string00 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, value1);\n };\n}\n\nfunction styleFunction(name, interpolate, value) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0 = style(this, name),\n value1 = value(this),\n string1 = value1 + \"\";\n if (value1 == null) string1 = value1 = (this.style.removeProperty(name), style(this, name));\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));\n };\n}\n\nfunction styleMaybeRemove(id, name) {\n var on0, on1, listener0, key = \"style.\" + name, event = \"end.\" + key, remove;\n return function() {\n var schedule = set(this, id),\n on = schedule.on,\n listener = schedule.value[key] == null ? remove || (remove = styleRemove(name)) : undefined;\n\n // If this node shared a dispatch with the previous node,\n // just assign the updated shared dispatch and we\u2019re done!\n // Otherwise, copy-on-write.\n if (on !== on0 || listener0 !== listener) (on1 = (on0 = on).copy()).on(event, listener0 = listener);\n\n schedule.on = on1;\n };\n}\n\nexport default function(name, value, priority) {\n var i = (name += \"\") === \"transform\" ? interpolateTransform : interpolate;\n return value == null ? this\n .styleTween(name, styleNull(name, i))\n .on(\"end.style.\" + name, styleRemove(name))\n : typeof value === \"function\" ? this\n .styleTween(name, styleFunction(name, i, tweenValue(this, \"style.\" + name, value)))\n .each(styleMaybeRemove(this._id, name))\n : this\n .styleTween(name, styleConstant(name, i, value), priority)\n .on(\"end.style.\" + name, null);\n}\n", "function styleInterpolate(name, i, priority) {\n return function(t) {\n this.style.setProperty(name, i.call(this, t), priority);\n };\n}\n\nfunction styleTween(name, value, priority) {\n var t, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t = (i0 = i) && styleInterpolate(name, i, priority);\n return t;\n }\n tween._value = value;\n return tween;\n}\n\nexport default function(name, value, priority) {\n var key = \"style.\" + (name += \"\");\n if (arguments.length < 2) return (key = this.tween(key)) && key._value;\n if (value == null) return this.tween(key, null);\n if (typeof value !== \"function\") throw new Error;\n return this.tween(key, styleTween(name, value, priority == null ? \"\" : priority));\n}\n", "import {tweenValue} from \"./tween.js\";\n\nfunction textConstant(value) {\n return function() {\n this.textContent = value;\n };\n}\n\nfunction textFunction(value) {\n return function() {\n var value1 = value(this);\n this.textContent = value1 == null ? \"\" : value1;\n };\n}\n\nexport default function(value) {\n return this.tween(\"text\", typeof value === \"function\"\n ? textFunction(tweenValue(this, \"text\", value))\n : textConstant(value == null ? \"\" : value + \"\"));\n}\n", "function textInterpolate(i) {\n return function(t) {\n this.textContent = i.call(this, t);\n };\n}\n\nfunction textTween(value) {\n var t0, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t0 = (i0 = i) && textInterpolate(i);\n return t0;\n }\n tween._value = value;\n return tween;\n}\n\nexport default function(value) {\n var key = \"text\";\n if (arguments.length < 1) return (key = this.tween(key)) && key._value;\n if (value == null) return this.tween(key, null);\n if (typeof value !== \"function\") throw new Error;\n return this.tween(key, textTween(value));\n}\n", "import {Transition, newId} from \"./index.js\";\nimport schedule, {get} from \"./schedule.js\";\n\nexport default function() {\n var name = this._name,\n id0 = this._id,\n id1 = newId();\n\n for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n var inherit = get(node, id0);\n schedule(node, name, id1, i, group, {\n time: inherit.time + inherit.delay + inherit.duration,\n delay: 0,\n duration: inherit.duration,\n ease: inherit.ease\n });\n }\n }\n }\n\n return new Transition(groups, this._parents, name, id1);\n}\n", "import {set} from \"./schedule.js\";\n\nexport default function() {\n var on0, on1, that = this, id = that._id, size = that.size();\n return new Promise(function(resolve, reject) {\n var cancel = {value: reject},\n end = {value: function() { if (--size === 0) resolve(); }};\n\n that.each(function() {\n var schedule = set(this, id),\n on = schedule.on;\n\n // If this node shared a dispatch with the previous node,\n // just assign the updated shared dispatch and we\u2019re done!\n // Otherwise, copy-on-write.\n if (on !== on0) {\n on1 = (on0 = on).copy();\n on1._.cancel.push(cancel);\n on1._.interrupt.push(cancel);\n on1._.end.push(end);\n }\n\n schedule.on = on1;\n });\n\n // The selection was empty, resolve end immediately\n if (size === 0) resolve();\n });\n}\n", "import {selection} from \"d3-selection\";\nimport transition_attr from \"./attr.js\";\nimport transition_attrTween from \"./attrTween.js\";\nimport transition_delay from \"./delay.js\";\nimport transition_duration from \"./duration.js\";\nimport transition_ease from \"./ease.js\";\nimport transition_easeVarying from \"./easeVarying.js\";\nimport transition_filter from \"./filter.js\";\nimport transition_merge from \"./merge.js\";\nimport transition_on from \"./on.js\";\nimport transition_remove from \"./remove.js\";\nimport transition_select from \"./select.js\";\nimport transition_selectAll from \"./selectAll.js\";\nimport transition_selection from \"./selection.js\";\nimport transition_style from \"./style.js\";\nimport transition_styleTween from \"./styleTween.js\";\nimport transition_text from \"./text.js\";\nimport transition_textTween from \"./textTween.js\";\nimport transition_transition from \"./transition.js\";\nimport transition_tween from \"./tween.js\";\nimport transition_end from \"./end.js\";\n\nvar id = 0;\n\nexport function Transition(groups, parents, name, id) {\n this._groups = groups;\n this._parents = parents;\n this._name = name;\n this._id = id;\n}\n\nexport default function transition(name) {\n return selection().transition(name);\n}\n\nexport function newId() {\n return ++id;\n}\n\nvar selection_prototype = selection.prototype;\n\nTransition.prototype = transition.prototype = {\n constructor: Transition,\n select: transition_select,\n selectAll: transition_selectAll,\n selectChild: selection_prototype.selectChild,\n selectChildren: selection_prototype.selectChildren,\n filter: transition_filter,\n merge: transition_merge,\n selection: transition_selection,\n transition: transition_transition,\n call: selection_prototype.call,\n nodes: selection_prototype.nodes,\n node: selection_prototype.node,\n size: selection_prototype.size,\n empty: selection_prototype.empty,\n each: selection_prototype.each,\n on: transition_on,\n attr: transition_attr,\n attrTween: transition_attrTween,\n style: transition_style,\n styleTween: transition_styleTween,\n text: transition_text,\n textTween: transition_textTween,\n remove: transition_remove,\n tween: transition_tween,\n delay: transition_delay,\n duration: transition_duration,\n ease: transition_ease,\n easeVarying: transition_easeVarying,\n end: transition_end,\n [Symbol.iterator]: selection_prototype[Symbol.iterator]\n};\n", "export function cubicIn(t) {\n return t * t * t;\n}\n\nexport function cubicOut(t) {\n return --t * t * t + 1;\n}\n\nexport function cubicInOut(t) {\n return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;\n}\n", "import {Transition, newId} from \"../transition/index.js\";\nimport schedule from \"../transition/schedule.js\";\nimport {easeCubicInOut} from \"d3-ease\";\nimport {now} from \"d3-timer\";\n\nvar defaultTiming = {\n time: null, // Set on use.\n delay: 0,\n duration: 250,\n ease: easeCubicInOut\n};\n\nfunction inherit(node, id) {\n var timing;\n while (!(timing = node.__transition) || !(timing = timing[id])) {\n if (!(node = node.parentNode)) {\n throw new Error(`transition ${id} not found`);\n }\n }\n return timing;\n}\n\nexport default function(name) {\n var id,\n timing;\n\n if (name instanceof Transition) {\n id = name._id, name = name._name;\n } else {\n id = newId(), (timing = defaultTiming).time = now(), name = name == null ? null : name + \"\";\n }\n\n for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n schedule(node, name, id, i, group, timing || inherit(node, id));\n }\n }\n }\n\n return new Transition(groups, this._parents, name, id);\n}\n", "import {selection} from \"d3-selection\";\nimport selection_interrupt from \"./interrupt.js\";\nimport selection_transition from \"./transition.js\";\n\nselection.prototype.interrupt = selection_interrupt;\nselection.prototype.transition = selection_transition;\n", "import {dispatch} from \"d3-dispatch\";\nimport {dragDisable, dragEnable} from \"d3-drag\";\nimport {interpolate} from \"d3-interpolate\";\nimport {pointer, select} from \"d3-selection\";\nimport {interrupt} from \"d3-transition\";\nimport constant from \"./constant.js\";\nimport BrushEvent from \"./event.js\";\nimport noevent, {nopropagation} from \"./noevent.js\";\n\nvar MODE_DRAG = {name: \"drag\"},\n MODE_SPACE = {name: \"space\"},\n MODE_HANDLE = {name: \"handle\"},\n MODE_CENTER = {name: \"center\"};\n\nconst {abs, max, min} = Math;\n\nfunction number1(e) {\n return [+e[0], +e[1]];\n}\n\nfunction number2(e) {\n return [number1(e[0]), number1(e[1])];\n}\n\nvar X = {\n name: \"x\",\n handles: [\"w\", \"e\"].map(type),\n input: function(x, e) { return x == null ? null : [[+x[0], e[0][1]], [+x[1], e[1][1]]]; },\n output: function(xy) { return xy && [xy[0][0], xy[1][0]]; }\n};\n\nvar Y = {\n name: \"y\",\n handles: [\"n\", \"s\"].map(type),\n input: function(y, e) { return y == null ? null : [[e[0][0], +y[0]], [e[1][0], +y[1]]]; },\n output: function(xy) { return xy && [xy[0][1], xy[1][1]]; }\n};\n\nvar XY = {\n name: \"xy\",\n handles: [\"n\", \"w\", \"e\", \"s\", \"nw\", \"ne\", \"sw\", \"se\"].map(type),\n input: function(xy) { return xy == null ? null : number2(xy); },\n output: function(xy) { return xy; }\n};\n\nvar cursors = {\n overlay: \"crosshair\",\n selection: \"move\",\n n: \"ns-resize\",\n e: \"ew-resize\",\n s: \"ns-resize\",\n w: \"ew-resize\",\n nw: \"nwse-resize\",\n ne: \"nesw-resize\",\n se: \"nwse-resize\",\n sw: \"nesw-resize\"\n};\n\nvar flipX = {\n e: \"w\",\n w: \"e\",\n nw: \"ne\",\n ne: \"nw\",\n se: \"sw\",\n sw: \"se\"\n};\n\nvar flipY = {\n n: \"s\",\n s: \"n\",\n nw: \"sw\",\n ne: \"se\",\n se: \"ne\",\n sw: \"nw\"\n};\n\nvar signsX = {\n overlay: +1,\n selection: +1,\n n: null,\n e: +1,\n s: null,\n w: -1,\n nw: -1,\n ne: +1,\n se: +1,\n sw: -1\n};\n\nvar signsY = {\n overlay: +1,\n selection: +1,\n n: -1,\n e: null,\n s: +1,\n w: null,\n nw: -1,\n ne: -1,\n se: +1,\n sw: +1\n};\n\nfunction type(t) {\n return {type: t};\n}\n\n// Ignore right-click, since that should open the context menu.\nfunction defaultFilter(event) {\n return !event.ctrlKey && !event.button;\n}\n\nfunction defaultExtent() {\n var svg = this.ownerSVGElement || this;\n if (svg.hasAttribute(\"viewBox\")) {\n svg = svg.viewBox.baseVal;\n return [[svg.x, svg.y], [svg.x + svg.width, svg.y + svg.height]];\n }\n return [[0, 0], [svg.width.baseVal.value, svg.height.baseVal.value]];\n}\n\nfunction defaultTouchable() {\n return navigator.maxTouchPoints || (\"ontouchstart\" in this);\n}\n\n// Like d3.local, but with the name \u201C__brush\u201D rather than auto-generated.\nfunction local(node) {\n while (!node.__brush) if (!(node = node.parentNode)) return;\n return node.__brush;\n}\n\nfunction empty(extent) {\n return extent[0][0] === extent[1][0]\n || extent[0][1] === extent[1][1];\n}\n\nexport function brushSelection(node) {\n var state = node.__brush;\n return state ? state.dim.output(state.selection) : null;\n}\n\nexport function brushX() {\n return brush(X);\n}\n\nexport function brushY() {\n return brush(Y);\n}\n\nexport default function() {\n return brush(XY);\n}\n\nfunction brush(dim) {\n var extent = defaultExtent,\n filter = defaultFilter,\n touchable = defaultTouchable,\n keys = true,\n listeners = dispatch(\"start\", \"brush\", \"end\"),\n handleSize = 6,\n touchending;\n\n function brush(group) {\n var overlay = group\n .property(\"__brush\", initialize)\n .selectAll(\".overlay\")\n .data([type(\"overlay\")]);\n\n overlay.enter().append(\"rect\")\n .attr(\"class\", \"overlay\")\n .attr(\"pointer-events\", \"all\")\n .attr(\"cursor\", cursors.overlay)\n .merge(overlay)\n .each(function() {\n var extent = local(this).extent;\n select(this)\n .attr(\"x\", extent[0][0])\n .attr(\"y\", extent[0][1])\n .attr(\"width\", extent[1][0] - extent[0][0])\n .attr(\"height\", extent[1][1] - extent[0][1]);\n });\n\n group.selectAll(\".selection\")\n .data([type(\"selection\")])\n .enter().append(\"rect\")\n .attr(\"class\", \"selection\")\n .attr(\"cursor\", cursors.selection)\n .attr(\"fill\", \"#777\")\n .attr(\"fill-opacity\", 0.3)\n .attr(\"stroke\", \"#fff\")\n .attr(\"shape-rendering\", \"crispEdges\");\n\n var handle = group.selectAll(\".handle\")\n .data(dim.handles, function(d) { return d.type; });\n\n handle.exit().remove();\n\n handle.enter().append(\"rect\")\n .attr(\"class\", function(d) { return \"handle handle--\" + d.type; })\n .attr(\"cursor\", function(d) { return cursors[d.type]; });\n\n group\n .each(redraw)\n .attr(\"fill\", \"none\")\n .attr(\"pointer-events\", \"all\")\n .on(\"mousedown.brush\", started)\n .filter(touchable)\n .on(\"touchstart.brush\", started)\n .on(\"touchmove.brush\", touchmoved)\n .on(\"touchend.brush touchcancel.brush\", touchended)\n .style(\"touch-action\", \"none\")\n .style(\"-webkit-tap-highlight-color\", \"rgba(0,0,0,0)\");\n }\n\n brush.move = function(group, selection, event) {\n if (group.tween) {\n group\n .on(\"start.brush\", function(event) { emitter(this, arguments).beforestart().start(event); })\n .on(\"interrupt.brush end.brush\", function(event) { emitter(this, arguments).end(event); })\n .tween(\"brush\", function() {\n var that = this,\n state = that.__brush,\n emit = emitter(that, arguments),\n selection0 = state.selection,\n selection1 = dim.input(typeof selection === \"function\" ? selection.apply(this, arguments) : selection, state.extent),\n i = interpolate(selection0, selection1);\n\n function tween(t) {\n state.selection = t === 1 && selection1 === null ? null : i(t);\n redraw.call(that);\n emit.brush();\n }\n\n return selection0 !== null && selection1 !== null ? tween : tween(1);\n });\n } else {\n group\n .each(function() {\n var that = this,\n args = arguments,\n state = that.__brush,\n selection1 = dim.input(typeof selection === \"function\" ? selection.apply(that, args) : selection, state.extent),\n emit = emitter(that, args).beforestart();\n\n interrupt(that);\n state.selection = selection1 === null ? null : selection1;\n redraw.call(that);\n emit.start(event).brush(event).end(event);\n });\n }\n };\n\n brush.clear = function(group, event) {\n brush.move(group, null, event);\n };\n\n function redraw() {\n var group = select(this),\n selection = local(this).selection;\n\n if (selection) {\n group.selectAll(\".selection\")\n .style(\"display\", null)\n .attr(\"x\", selection[0][0])\n .attr(\"y\", selection[0][1])\n .attr(\"width\", selection[1][0] - selection[0][0])\n .attr(\"height\", selection[1][1] - selection[0][1]);\n\n group.selectAll(\".handle\")\n .style(\"display\", null)\n .attr(\"x\", function(d) { return d.type[d.type.length - 1] === \"e\" ? selection[1][0] - handleSize / 2 : selection[0][0] - handleSize / 2; })\n .attr(\"y\", function(d) { return d.type[0] === \"s\" ? selection[1][1] - handleSize / 2 : selection[0][1] - handleSize / 2; })\n .attr(\"width\", function(d) { return d.type === \"n\" || d.type === \"s\" ? selection[1][0] - selection[0][0] + handleSize : handleSize; })\n .attr(\"height\", function(d) { return d.type === \"e\" || d.type === \"w\" ? selection[1][1] - selection[0][1] + handleSize : handleSize; });\n }\n\n else {\n group.selectAll(\".selection,.handle\")\n .style(\"display\", \"none\")\n .attr(\"x\", null)\n .attr(\"y\", null)\n .attr(\"width\", null)\n .attr(\"height\", null);\n }\n }\n\n function emitter(that, args, clean) {\n var emit = that.__brush.emitter;\n return emit && (!clean || !emit.clean) ? emit : new Emitter(that, args, clean);\n }\n\n function Emitter(that, args, clean) {\n this.that = that;\n this.args = args;\n this.state = that.__brush;\n this.active = 0;\n this.clean = clean;\n }\n\n Emitter.prototype = {\n beforestart: function() {\n if (++this.active === 1) this.state.emitter = this, this.starting = true;\n return this;\n },\n start: function(event, mode) {\n if (this.starting) this.starting = false, this.emit(\"start\", event, mode);\n else this.emit(\"brush\", event);\n return this;\n },\n brush: function(event, mode) {\n this.emit(\"brush\", event, mode);\n return this;\n },\n end: function(event, mode) {\n if (--this.active === 0) delete this.state.emitter, this.emit(\"end\", event, mode);\n return this;\n },\n emit: function(type, event, mode) {\n var d = select(this.that).datum();\n listeners.call(\n type,\n this.that,\n new BrushEvent(type, {\n sourceEvent: event,\n target: brush,\n selection: dim.output(this.state.selection),\n mode,\n dispatch: listeners\n }),\n d\n );\n }\n };\n\n function started(event) {\n if (touchending && !event.touches) return;\n if (!filter.apply(this, arguments)) return;\n\n var that = this,\n type = event.target.__data__.type,\n mode = (keys && event.metaKey ? type = \"overlay\" : type) === \"selection\" ? MODE_DRAG : (keys && event.altKey ? MODE_CENTER : MODE_HANDLE),\n signX = dim === Y ? null : signsX[type],\n signY = dim === X ? null : signsY[type],\n state = local(that),\n extent = state.extent,\n selection = state.selection,\n W = extent[0][0], w0, w1,\n N = extent[0][1], n0, n1,\n E = extent[1][0], e0, e1,\n S = extent[1][1], s0, s1,\n dx = 0,\n dy = 0,\n moving,\n shifting = signX && signY && keys && event.shiftKey,\n lockX,\n lockY,\n points = Array.from(event.touches || [event], t => {\n const i = t.identifier;\n t = pointer(t, that);\n t.point0 = t.slice();\n t.identifier = i;\n return t;\n });\n\n interrupt(that);\n var emit = emitter(that, arguments, true).beforestart();\n\n if (type === \"overlay\") {\n if (selection) moving = true;\n const pts = [points[0], points[1] || points[0]];\n state.selection = selection = [[\n w0 = dim === Y ? W : min(pts[0][0], pts[1][0]),\n n0 = dim === X ? N : min(pts[0][1], pts[1][1])\n ], [\n e0 = dim === Y ? E : max(pts[0][0], pts[1][0]),\n s0 = dim === X ? S : max(pts[0][1], pts[1][1])\n ]];\n if (points.length > 1) move(event);\n } else {\n w0 = selection[0][0];\n n0 = selection[0][1];\n e0 = selection[1][0];\n s0 = selection[1][1];\n }\n\n w1 = w0;\n n1 = n0;\n e1 = e0;\n s1 = s0;\n\n var group = select(that)\n .attr(\"pointer-events\", \"none\");\n\n var overlay = group.selectAll(\".overlay\")\n .attr(\"cursor\", cursors[type]);\n\n if (event.touches) {\n emit.moved = moved;\n emit.ended = ended;\n } else {\n var view = select(event.view)\n .on(\"mousemove.brush\", moved, true)\n .on(\"mouseup.brush\", ended, true);\n if (keys) view\n .on(\"keydown.brush\", keydowned, true)\n .on(\"keyup.brush\", keyupped, true)\n\n dragDisable(event.view);\n }\n\n redraw.call(that);\n emit.start(event, mode.name);\n\n function moved(event) {\n for (const p of event.changedTouches || [event]) {\n for (const d of points)\n if (d.identifier === p.identifier) d.cur = pointer(p, that);\n }\n if (shifting && !lockX && !lockY && points.length === 1) {\n const point = points[0];\n if (abs(point.cur[0] - point[0]) > abs(point.cur[1] - point[1]))\n lockY = true;\n else\n lockX = true;\n }\n for (const point of points)\n if (point.cur) point[0] = point.cur[0], point[1] = point.cur[1];\n moving = true;\n noevent(event);\n move(event);\n }\n\n function move(event) {\n const point = points[0], point0 = point.point0;\n var t;\n\n dx = point[0] - point0[0];\n dy = point[1] - point0[1];\n\n switch (mode) {\n case MODE_SPACE:\n case MODE_DRAG: {\n if (signX) dx = max(W - w0, min(E - e0, dx)), w1 = w0 + dx, e1 = e0 + dx;\n if (signY) dy = max(N - n0, min(S - s0, dy)), n1 = n0 + dy, s1 = s0 + dy;\n break;\n }\n case MODE_HANDLE: {\n if (points[1]) {\n if (signX) w1 = max(W, min(E, points[0][0])), e1 = max(W, min(E, points[1][0])), signX = 1;\n if (signY) n1 = max(N, min(S, points[0][1])), s1 = max(N, min(S, points[1][1])), signY = 1;\n } else {\n if (signX < 0) dx = max(W - w0, min(E - w0, dx)), w1 = w0 + dx, e1 = e0;\n else if (signX > 0) dx = max(W - e0, min(E - e0, dx)), w1 = w0, e1 = e0 + dx;\n if (signY < 0) dy = max(N - n0, min(S - n0, dy)), n1 = n0 + dy, s1 = s0;\n else if (signY > 0) dy = max(N - s0, min(S - s0, dy)), n1 = n0, s1 = s0 + dy;\n }\n break;\n }\n case MODE_CENTER: {\n if (signX) w1 = max(W, min(E, w0 - dx * signX)), e1 = max(W, min(E, e0 + dx * signX));\n if (signY) n1 = max(N, min(S, n0 - dy * signY)), s1 = max(N, min(S, s0 + dy * signY));\n break;\n }\n }\n\n if (e1 < w1) {\n signX *= -1;\n t = w0, w0 = e0, e0 = t;\n t = w1, w1 = e1, e1 = t;\n if (type in flipX) overlay.attr(\"cursor\", cursors[type = flipX[type]]);\n }\n\n if (s1 < n1) {\n signY *= -1;\n t = n0, n0 = s0, s0 = t;\n t = n1, n1 = s1, s1 = t;\n if (type in flipY) overlay.attr(\"cursor\", cursors[type = flipY[type]]);\n }\n\n if (state.selection) selection = state.selection; // May be set by brush.move!\n if (lockX) w1 = selection[0][0], e1 = selection[1][0];\n if (lockY) n1 = selection[0][1], s1 = selection[1][1];\n\n if (selection[0][0] !== w1\n || selection[0][1] !== n1\n || selection[1][0] !== e1\n || selection[1][1] !== s1) {\n state.selection = [[w1, n1], [e1, s1]];\n redraw.call(that);\n emit.brush(event, mode.name);\n }\n }\n\n function ended(event) {\n nopropagation(event);\n if (event.touches) {\n if (event.touches.length) return;\n if (touchending) clearTimeout(touchending);\n touchending = setTimeout(function() { touchending = null; }, 500); // Ghost clicks are delayed!\n } else {\n dragEnable(event.view, moving);\n view.on(\"keydown.brush keyup.brush mousemove.brush mouseup.brush\", null);\n }\n group.attr(\"pointer-events\", \"all\");\n overlay.attr(\"cursor\", cursors.overlay);\n if (state.selection) selection = state.selection; // May be set by brush.move (on start)!\n if (empty(selection)) state.selection = null, redraw.call(that);\n emit.end(event, mode.name);\n }\n\n function keydowned(event) {\n switch (event.keyCode) {\n case 16: { // SHIFT\n shifting = signX && signY;\n break;\n }\n case 18: { // ALT\n if (mode === MODE_HANDLE) {\n if (signX) e0 = e1 - dx * signX, w0 = w1 + dx * signX;\n if (signY) s0 = s1 - dy * signY, n0 = n1 + dy * signY;\n mode = MODE_CENTER;\n move(event);\n }\n break;\n }\n case 32: { // SPACE; takes priority over ALT\n if (mode === MODE_HANDLE || mode === MODE_CENTER) {\n if (signX < 0) e0 = e1 - dx; else if (signX > 0) w0 = w1 - dx;\n if (signY < 0) s0 = s1 - dy; else if (signY > 0) n0 = n1 - dy;\n mode = MODE_SPACE;\n overlay.attr(\"cursor\", cursors.selection);\n move(event);\n }\n break;\n }\n default: return;\n }\n noevent(event);\n }\n\n function keyupped(event) {\n switch (event.keyCode) {\n case 16: { // SHIFT\n if (shifting) {\n lockX = lockY = shifting = false;\n move(event);\n }\n break;\n }\n case 18: { // ALT\n if (mode === MODE_CENTER) {\n if (signX < 0) e0 = e1; else if (signX > 0) w0 = w1;\n if (signY < 0) s0 = s1; else if (signY > 0) n0 = n1;\n mode = MODE_HANDLE;\n move(event);\n }\n break;\n }\n case 32: { // SPACE\n if (mode === MODE_SPACE) {\n if (event.altKey) {\n if (signX) e0 = e1 - dx * signX, w0 = w1 + dx * signX;\n if (signY) s0 = s1 - dy * signY, n0 = n1 + dy * signY;\n mode = MODE_CENTER;\n } else {\n if (signX < 0) e0 = e1; else if (signX > 0) w0 = w1;\n if (signY < 0) s0 = s1; else if (signY > 0) n0 = n1;\n mode = MODE_HANDLE;\n }\n overlay.attr(\"cursor\", cursors[type]);\n move(event);\n }\n break;\n }\n default: return;\n }\n noevent(event);\n }\n }\n\n function touchmoved(event) {\n emitter(this, arguments).moved(event);\n }\n\n function touchended(event) {\n emitter(this, arguments).ended(event);\n }\n\n function initialize() {\n var state = this.__brush || {selection: null};\n state.extent = number2(extent.apply(this, arguments));\n state.dim = dim;\n return state;\n }\n\n brush.extent = function(_) {\n return arguments.length ? (extent = typeof _ === \"function\" ? _ : constant(number2(_)), brush) : extent;\n };\n\n brush.filter = function(_) {\n return arguments.length ? (filter = typeof _ === \"function\" ? _ : constant(!!_), brush) : filter;\n };\n\n brush.touchable = function(_) {\n return arguments.length ? (touchable = typeof _ === \"function\" ? _ : constant(!!_), brush) : touchable;\n };\n\n brush.handleSize = function(_) {\n return arguments.length ? (handleSize = +_, brush) : handleSize;\n };\n\n brush.keyModifiers = function(_) {\n return arguments.length ? (keys = !!_, brush) : keys;\n };\n\n brush.on = function() {\n var value = listeners.on.apply(listeners, arguments);\n return value === listeners ? brush : value;\n };\n\n return brush;\n}\n", "const pi = Math.PI,\n tau = 2 * pi,\n epsilon = 1e-6,\n tauEpsilon = tau - epsilon;\n\nfunction append(strings) {\n this._ += strings[0];\n for (let i = 1, n = strings.length; i < n; ++i) {\n this._ += arguments[i] + strings[i];\n }\n}\n\nfunction appendRound(digits) {\n let d = Math.floor(digits);\n if (!(d >= 0)) throw new Error(`invalid digits: ${digits}`);\n if (d > 15) return append;\n const k = 10 ** d;\n return function(strings) {\n this._ += strings[0];\n for (let i = 1, n = strings.length; i < n; ++i) {\n this._ += Math.round(arguments[i] * k) / k + strings[i];\n }\n };\n}\n\nexport class Path {\n constructor(digits) {\n this._x0 = this._y0 = // start of current subpath\n this._x1 = this._y1 = null; // end of current subpath\n this._ = \"\";\n this._append = digits == null ? append : appendRound(digits);\n }\n moveTo(x, y) {\n this._append`M${this._x0 = this._x1 = +x},${this._y0 = this._y1 = +y}`;\n }\n closePath() {\n if (this._x1 !== null) {\n this._x1 = this._x0, this._y1 = this._y0;\n this._append`Z`;\n }\n }\n lineTo(x, y) {\n this._append`L${this._x1 = +x},${this._y1 = +y}`;\n }\n quadraticCurveTo(x1, y1, x, y) {\n this._append`Q${+x1},${+y1},${this._x1 = +x},${this._y1 = +y}`;\n }\n bezierCurveTo(x1, y1, x2, y2, x, y) {\n this._append`C${+x1},${+y1},${+x2},${+y2},${this._x1 = +x},${this._y1 = +y}`;\n }\n arcTo(x1, y1, x2, y2, r) {\n x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(`negative radius: ${r}`);\n\n let 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 this path empty? Move to (x1,y1).\n if (this._x1 === null) {\n this._append`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._append`L${this._x1 = x1},${this._y1 = y1}`;\n }\n\n // Otherwise, draw an arc!\n else {\n let 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._append`L${x1 + t01 * x01},${y1 + t01 * y01}`;\n }\n\n this._append`A${r},${r},0,0,${+(y01 * x20 > x01 * y20)},${this._x1 = x1 + t21 * x21},${this._y1 = y1 + t21 * y21}`;\n }\n }\n arc(x, y, r, a0, a1, ccw) {\n x = +x, y = +y, r = +r, ccw = !!ccw;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(`negative radius: ${r}`);\n\n let 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 this path empty? Move to (x0,y0).\n if (this._x1 === null) {\n this._append`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._append`L${x0},${y0}`;\n }\n\n // Is this arc empty? We\u2019re 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._append`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._append`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(x, y, w, h) {\n this._append`M${this._x0 = this._x1 = +x},${this._y0 = this._y1 = +y}h${w = +w}v${+h}h${-w}Z`;\n }\n toString() {\n return this._;\n }\n}\n\nexport function path() {\n return new Path;\n}\n\n// Allow instanceof d3.path\npath.prototype = Path.prototype;\n\nexport function pathRound(digits = 3) {\n return new Path(+digits);\n}\n", "export default function(x) {\n return Math.abs(x = Math.round(x)) >= 1e21\n ? x.toLocaleString(\"en\").replace(/,/g, \"\")\n : x.toString(10);\n}\n\n// Computes the decimal coefficient and exponent of the specified number x with\n// significant digits p, where x is positive and p is in [1, 21] or undefined.\n// For example, formatDecimalParts(1.23) returns [\"123\", 0].\nexport function formatDecimalParts(x, p) {\n if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf(\"e\")) < 0) return null; // NaN, \u00B1Infinity\n var i, coefficient = x.slice(0, i);\n\n // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n // (e.g., 1.2e+3) or the form \\de[-+]\\d+ (e.g., 1e+3).\n return [\n coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,\n +x.slice(i + 1)\n ];\n}\n", "import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport default function(x) {\n return x = formatDecimalParts(Math.abs(x)), x ? x[1] : NaN;\n}\n", "export default function(grouping, thousands) {\n return function(value, width) {\n var i = value.length,\n t = [],\n j = 0,\n g = grouping[0],\n length = 0;\n\n while (i > 0 && g > 0) {\n if (length + g + 1 > width) g = Math.max(1, width - length);\n t.push(value.substring(i -= g, i + g));\n if ((length += g + 1) > width) break;\n g = grouping[j = (j + 1) % grouping.length];\n }\n\n return t.reverse().join(thousands);\n };\n}\n", "export default function(numerals) {\n return function(value) {\n return value.replace(/[0-9]/g, function(i) {\n return numerals[+i];\n });\n };\n}\n", "// [[fill]align][sign][symbol][0][width][,][.precision][~][type]\nvar re = /^(?:(.)?([<>=^]))?([+\\-( ])?([$#])?(0)?(\\d+)?(,)?(\\.\\d+)?(~)?([a-z%])?$/i;\n\nexport default function formatSpecifier(specifier) {\n if (!(match = re.exec(specifier))) throw new Error(\"invalid format: \" + specifier);\n var match;\n return new FormatSpecifier({\n fill: match[1],\n align: match[2],\n sign: match[3],\n symbol: match[4],\n zero: match[5],\n width: match[6],\n comma: match[7],\n precision: match[8] && match[8].slice(1),\n trim: match[9],\n type: match[10]\n });\n}\n\nformatSpecifier.prototype = FormatSpecifier.prototype; // instanceof\n\nexport function FormatSpecifier(specifier) {\n this.fill = specifier.fill === undefined ? \" \" : specifier.fill + \"\";\n this.align = specifier.align === undefined ? \">\" : specifier.align + \"\";\n this.sign = specifier.sign === undefined ? \"-\" : specifier.sign + \"\";\n this.symbol = specifier.symbol === undefined ? \"\" : specifier.symbol + \"\";\n this.zero = !!specifier.zero;\n this.width = specifier.width === undefined ? undefined : +specifier.width;\n this.comma = !!specifier.comma;\n this.precision = specifier.precision === undefined ? undefined : +specifier.precision;\n this.trim = !!specifier.trim;\n this.type = specifier.type === undefined ? \"\" : specifier.type + \"\";\n}\n\nFormatSpecifier.prototype.toString = function() {\n return this.fill\n + this.align\n + this.sign\n + this.symbol\n + (this.zero ? \"0\" : \"\")\n + (this.width === undefined ? \"\" : Math.max(1, this.width | 0))\n + (this.comma ? \",\" : \"\")\n + (this.precision === undefined ? \"\" : \".\" + Math.max(0, this.precision | 0))\n + (this.trim ? \"~\" : \"\")\n + this.type;\n};\n", "// Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k.\nexport default function(s) {\n out: for (var n = s.length, i = 1, i0 = -1, i1; i < n; ++i) {\n switch (s[i]) {\n case \".\": i0 = i1 = i; break;\n case \"0\": if (i0 === 0) i0 = i; i1 = i; break;\n default: if (!+s[i]) break out; if (i0 > 0) i0 = 0; break;\n }\n }\n return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s;\n}\n", "import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport var prefixExponent;\n\nexport default function(x, p) {\n var d = formatDecimalParts(x, p);\n if (!d) return x + \"\";\n var coefficient = d[0],\n exponent = d[1],\n i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1,\n n = coefficient.length;\n return i === n ? coefficient\n : i > n ? coefficient + new Array(i - n + 1).join(\"0\")\n : i > 0 ? coefficient.slice(0, i) + \".\" + coefficient.slice(i)\n : \"0.\" + new Array(1 - i).join(\"0\") + formatDecimalParts(x, Math.max(0, p + i - 1))[0]; // less than 1y!\n}\n", "import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport default function(x, p) {\n var d = formatDecimalParts(x, p);\n if (!d) return x + \"\";\n var coefficient = d[0],\n exponent = d[1];\n return exponent < 0 ? \"0.\" + new Array(-exponent).join(\"0\") + coefficient\n : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + \".\" + coefficient.slice(exponent + 1)\n : coefficient + new Array(exponent - coefficient.length + 2).join(\"0\");\n}\n", "import formatDecimal from \"./formatDecimal.js\";\nimport formatPrefixAuto from \"./formatPrefixAuto.js\";\nimport formatRounded from \"./formatRounded.js\";\n\nexport default {\n \"%\": (x, p) => (x * 100).toFixed(p),\n \"b\": (x) => Math.round(x).toString(2),\n \"c\": (x) => x + \"\",\n \"d\": formatDecimal,\n \"e\": (x, p) => x.toExponential(p),\n \"f\": (x, p) => x.toFixed(p),\n \"g\": (x, p) => x.toPrecision(p),\n \"o\": (x) => Math.round(x).toString(8),\n \"p\": (x, p) => formatRounded(x * 100, p),\n \"r\": formatRounded,\n \"s\": formatPrefixAuto,\n \"X\": (x) => Math.round(x).toString(16).toUpperCase(),\n \"x\": (x) => Math.round(x).toString(16)\n};\n", "export default function(x) {\n return x;\n}\n", "import exponent from \"./exponent.js\";\nimport formatGroup from \"./formatGroup.js\";\nimport formatNumerals from \"./formatNumerals.js\";\nimport formatSpecifier from \"./formatSpecifier.js\";\nimport formatTrim from \"./formatTrim.js\";\nimport formatTypes from \"./formatTypes.js\";\nimport {prefixExponent} from \"./formatPrefixAuto.js\";\nimport identity from \"./identity.js\";\n\nvar map = Array.prototype.map,\n prefixes = [\"y\",\"z\",\"a\",\"f\",\"p\",\"n\",\"\u00B5\",\"m\",\"\",\"k\",\"M\",\"G\",\"T\",\"P\",\"E\",\"Z\",\"Y\"];\n\nexport default function(locale) {\n var group = locale.grouping === undefined || locale.thousands === undefined ? identity : formatGroup(map.call(locale.grouping, Number), locale.thousands + \"\"),\n currencyPrefix = locale.currency === undefined ? \"\" : locale.currency[0] + \"\",\n currencySuffix = locale.currency === undefined ? \"\" : locale.currency[1] + \"\",\n decimal = locale.decimal === undefined ? \".\" : locale.decimal + \"\",\n numerals = locale.numerals === undefined ? identity : formatNumerals(map.call(locale.numerals, String)),\n percent = locale.percent === undefined ? \"%\" : locale.percent + \"\",\n minus = locale.minus === undefined ? \"\u2212\" : locale.minus + \"\",\n nan = locale.nan === undefined ? \"NaN\" : locale.nan + \"\";\n\n function newFormat(specifier) {\n specifier = formatSpecifier(specifier);\n\n var fill = specifier.fill,\n align = specifier.align,\n sign = specifier.sign,\n symbol = specifier.symbol,\n zero = specifier.zero,\n width = specifier.width,\n comma = specifier.comma,\n precision = specifier.precision,\n trim = specifier.trim,\n type = specifier.type;\n\n // The \"n\" type is an alias for \",g\".\n if (type === \"n\") comma = true, type = \"g\";\n\n // The \"\" type, and any invalid type, is an alias for \".12~g\".\n else if (!formatTypes[type]) precision === undefined && (precision = 12), trim = true, type = \"g\";\n\n // If zero fill is specified, padding goes after sign and before digits.\n if (zero || (fill === \"0\" && align === \"=\")) zero = true, fill = \"0\", align = \"=\";\n\n // Compute the prefix and suffix.\n // For SI-prefix, the suffix is lazily computed.\n var prefix = symbol === \"$\" ? currencyPrefix : symbol === \"#\" && /[boxX]/.test(type) ? \"0\" + type.toLowerCase() : \"\",\n suffix = symbol === \"$\" ? currencySuffix : /[%p]/.test(type) ? percent : \"\";\n\n // What format function should we use?\n // Is this an integer type?\n // Can this type generate exponential notation?\n var formatType = formatTypes[type],\n maybeSuffix = /[defgprs%]/.test(type);\n\n // Set the default precision if not specified,\n // or clamp the specified precision to the supported range.\n // For significant precision, it must be in [1, 21].\n // For fixed precision, it must be in [0, 20].\n precision = precision === undefined ? 6\n : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision))\n : Math.max(0, Math.min(20, precision));\n\n function format(value) {\n var valuePrefix = prefix,\n valueSuffix = suffix,\n i, n, c;\n\n if (type === \"c\") {\n valueSuffix = formatType(value) + valueSuffix;\n value = \"\";\n } else {\n value = +value;\n\n // Determine the sign. -0 is not less than 0, but 1 / -0 is!\n var valueNegative = value < 0 || 1 / value < 0;\n\n // Perform the initial formatting.\n value = isNaN(value) ? nan : formatType(Math.abs(value), precision);\n\n // Trim insignificant zeros.\n if (trim) value = formatTrim(value);\n\n // If a negative value rounds to zero after formatting, and no explicit positive sign is requested, hide the sign.\n if (valueNegative && +value === 0 && sign !== \"+\") valueNegative = false;\n\n // Compute the prefix and suffix.\n valuePrefix = (valueNegative ? (sign === \"(\" ? sign : minus) : sign === \"-\" || sign === \"(\" ? \"\" : sign) + valuePrefix;\n valueSuffix = (type === \"s\" ? prefixes[8 + prefixExponent / 3] : \"\") + valueSuffix + (valueNegative && sign === \"(\" ? \")\" : \"\");\n\n // Break the formatted value into the integer \u201Cvalue\u201D part that can be\n // grouped, and fractional or exponential \u201Csuffix\u201D part that is not.\n if (maybeSuffix) {\n i = -1, n = value.length;\n while (++i < n) {\n if (c = value.charCodeAt(i), 48 > c || c > 57) {\n valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix;\n value = value.slice(0, i);\n break;\n }\n }\n }\n }\n\n // If the fill character is not \"0\", grouping is applied before padding.\n if (comma && !zero) value = group(value, Infinity);\n\n // Compute the padding.\n var length = valuePrefix.length + value.length + valueSuffix.length,\n padding = length < width ? new Array(width - length + 1).join(fill) : \"\";\n\n // If the fill character is \"0\", grouping is applied after padding.\n if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = \"\";\n\n // Reconstruct the final output based on the desired alignment.\n switch (align) {\n case \"<\": value = valuePrefix + value + valueSuffix + padding; break;\n case \"=\": value = valuePrefix + padding + value + valueSuffix; break;\n case \"^\": value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length); break;\n default: value = padding + valuePrefix + value + valueSuffix; break;\n }\n\n return numerals(value);\n }\n\n format.toString = function() {\n return specifier + \"\";\n };\n\n return format;\n }\n\n function formatPrefix(specifier, value) {\n var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = \"f\", specifier)),\n e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3,\n k = Math.pow(10, -e),\n prefix = prefixes[8 + e / 3];\n return function(value) {\n return f(k * value) + prefix;\n };\n }\n\n return {\n format: newFormat,\n formatPrefix: formatPrefix\n };\n}\n", "import formatLocale from \"./locale.js\";\n\nvar locale;\nexport var format;\nexport var formatPrefix;\n\ndefaultLocale({\n thousands: \",\",\n grouping: [3],\n currency: [\"$\", \"\"]\n});\n\nexport default function defaultLocale(definition) {\n locale = formatLocale(definition);\n format = locale.format;\n formatPrefix = locale.formatPrefix;\n return locale;\n}\n", "import exponent from \"./exponent.js\";\n\nexport default function(step) {\n return Math.max(0, -exponent(Math.abs(step)));\n}\n", "import exponent from \"./exponent.js\";\n\nexport default function(step, value) {\n return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step)));\n}\n", "import exponent from \"./exponent.js\";\n\nexport default function(step, max) {\n step = Math.abs(step), max = Math.abs(max) - step;\n return Math.max(0, exponent(max) - exponent(step)) + 1;\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 hypot = Math.hypot;\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", "import {asin, atan2, cos, sin, sqrt} from \"./math.js\";\n\nexport function spherical(cartesian) {\n return [atan2(cartesian[1], cartesian[0]), asin(cartesian[2])];\n}\n\nexport function cartesian(spherical) {\n var lambda = spherical[0], phi = spherical[1], cosPhi = cos(phi);\n return [cosPhi * cos(lambda), cosPhi * sin(lambda), sin(phi)];\n}\n\nexport function cartesianDot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n}\n\nexport function cartesianCross(a, b) {\n return [a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0]];\n}\n\n// TODO return a\nexport function cartesianAddInPlace(a, b) {\n a[0] += b[0], a[1] += b[1], a[2] += b[2];\n}\n\nexport function cartesianScale(vector, k) {\n return [vector[0] * k, vector[1] * k, vector[2] * k];\n}\n\n// TODO return d\nexport function cartesianNormalizeInPlace(d) {\n var l = sqrt(d[0] * d[0] + d[1] * d[1] + d[2] * d[2]);\n d[0] /= l, d[1] /= l, d[2] /= l;\n}\n", "export default function(a, b) {\n\n function compose(x, y) {\n return x = a(x, y), b(x[0], x[1]);\n }\n\n if (a.invert && b.invert) compose.invert = function(x, y) {\n return x = b.invert(x, y), x && a.invert(x[0], x[1]);\n };\n\n return compose;\n}\n", "import compose from \"./compose.js\";\nimport {abs, asin, atan2, cos, degrees, pi, radians, sin, tau} from \"./math.js\";\n\nfunction rotationIdentity(lambda, phi) {\n if (abs(lambda) > pi) lambda -= Math.round(lambda / tau) * tau;\n return [lambda, phi];\n}\n\nrotationIdentity.invert = rotationIdentity;\n\nexport function rotateRadians(deltaLambda, deltaPhi, deltaGamma) {\n return (deltaLambda %= tau) ? (deltaPhi || deltaGamma ? compose(rotationLambda(deltaLambda), rotationPhiGamma(deltaPhi, deltaGamma))\n : rotationLambda(deltaLambda))\n : (deltaPhi || deltaGamma ? rotationPhiGamma(deltaPhi, deltaGamma)\n : rotationIdentity);\n}\n\nfunction forwardRotationLambda(deltaLambda) {\n return function(lambda, phi) {\n lambda += deltaLambda;\n if (abs(lambda) > pi) lambda -= Math.round(lambda / tau) * tau;\n return [lambda, phi];\n };\n}\n\nfunction rotationLambda(deltaLambda) {\n var rotation = forwardRotationLambda(deltaLambda);\n rotation.invert = forwardRotationLambda(-deltaLambda);\n return rotation;\n}\n\nfunction rotationPhiGamma(deltaPhi, deltaGamma) {\n var cosDeltaPhi = cos(deltaPhi),\n sinDeltaPhi = sin(deltaPhi),\n cosDeltaGamma = cos(deltaGamma),\n sinDeltaGamma = sin(deltaGamma);\n\n function rotation(lambda, phi) {\n var cosPhi = cos(phi),\n x = cos(lambda) * cosPhi,\n y = sin(lambda) * cosPhi,\n z = sin(phi),\n k = z * cosDeltaPhi + x * sinDeltaPhi;\n return [\n atan2(y * cosDeltaGamma - k * sinDeltaGamma, x * cosDeltaPhi - z * sinDeltaPhi),\n asin(k * cosDeltaGamma + y * sinDeltaGamma)\n ];\n }\n\n rotation.invert = function(lambda, phi) {\n var cosPhi = cos(phi),\n x = cos(lambda) * cosPhi,\n y = sin(lambda) * cosPhi,\n z = sin(phi),\n k = z * cosDeltaGamma - y * sinDeltaGamma;\n return [\n atan2(y * cosDeltaGamma + z * sinDeltaGamma, x * cosDeltaPhi + k * sinDeltaPhi),\n asin(k * cosDeltaPhi - x * sinDeltaPhi)\n ];\n };\n\n return rotation;\n}\n\nexport default function(rotate) {\n rotate = rotateRadians(rotate[0] * radians, rotate[1] * radians, rotate.length > 2 ? rotate[2] * radians : 0);\n\n function forward(coordinates) {\n coordinates = rotate(coordinates[0] * radians, coordinates[1] * radians);\n return coordinates[0] *= degrees, coordinates[1] *= degrees, coordinates;\n }\n\n forward.invert = function(coordinates) {\n coordinates = rotate.invert(coordinates[0] * radians, coordinates[1] * radians);\n return coordinates[0] *= degrees, coordinates[1] *= degrees, coordinates;\n };\n\n return forward;\n}\n", "import {cartesian, cartesianNormalizeInPlace, spherical} from \"./cartesian.js\";\nimport constant from \"./constant.js\";\nimport {acos, cos, degrees, epsilon, radians, sin, tau} from \"./math.js\";\nimport {rotateRadians} from \"./rotation.js\";\n\n// Generates a circle centered at [0\u00B0, 0\u00B0], with a given radius and precision.\nexport function circleStream(stream, radius, delta, direction, t0, t1) {\n if (!delta) return;\n var cosRadius = cos(radius),\n sinRadius = sin(radius),\n step = direction * delta;\n if (t0 == null) {\n t0 = radius + direction * tau;\n t1 = radius - step / 2;\n } else {\n t0 = circleRadius(cosRadius, t0);\n t1 = circleRadius(cosRadius, t1);\n if (direction > 0 ? t0 < t1 : t0 > t1) t0 += direction * tau;\n }\n for (var point, t = t0; direction > 0 ? t > t1 : t < t1; t -= step) {\n point = spherical([cosRadius, -sinRadius * cos(t), -sinRadius * sin(t)]);\n stream.point(point[0], point[1]);\n }\n}\n\n// Returns the signed angle of a cartesian point relative to [cosRadius, 0, 0].\nfunction circleRadius(cosRadius, point) {\n point = cartesian(point), point[0] -= cosRadius;\n cartesianNormalizeInPlace(point);\n var radius = acos(-point[1]);\n return ((-point[2] < 0 ? -radius : radius) + tau - epsilon) % tau;\n}\n\nexport default function() {\n var center = constant([0, 0]),\n radius = constant(90),\n precision = constant(6),\n ring,\n rotate,\n stream = {point: point};\n\n function point(x, y) {\n ring.push(x = rotate(x, y));\n x[0] *= degrees, x[1] *= degrees;\n }\n\n function circle() {\n var c = center.apply(this, arguments),\n r = radius.apply(this, arguments) * radians,\n p = precision.apply(this, arguments) * radians;\n ring = [];\n rotate = rotateRadians(-c[0] * radians, -c[1] * radians, 0).invert;\n circleStream(stream, r, p, 1);\n c = {type: \"Polygon\", coordinates: [ring]};\n ring = rotate = null;\n return c;\n }\n\n circle.center = function(_) {\n return arguments.length ? (center = typeof _ === \"function\" ? _ : constant([+_[0], +_[1]]), circle) : center;\n };\n\n circle.radius = function(_) {\n return arguments.length ? (radius = typeof _ === \"function\" ? _ : constant(+_), circle) : radius;\n };\n\n circle.precision = function(_) {\n return arguments.length ? (precision = typeof _ === \"function\" ? _ : constant(+_), circle) : precision;\n };\n\n return circle;\n}\n", "import noop from \"../noop.js\";\n\nexport default function() {\n var lines = [],\n line;\n return {\n point: function(x, y, m) {\n line.push([x, y, m]);\n },\n lineStart: function() {\n lines.push(line = []);\n },\n lineEnd: noop,\n rejoin: function() {\n if (lines.length > 1) lines.push(lines.pop().concat(lines.shift()));\n },\n result: function() {\n var result = lines;\n lines = [];\n line = null;\n return result;\n }\n };\n}\n", "import {abs, epsilon} from \"./math.js\";\n\nexport default function(a, b) {\n return abs(a[0] - b[0]) < epsilon && abs(a[1] - b[1]) < epsilon;\n}\n", "import pointEqual from \"../pointEqual.js\";\nimport {epsilon} from \"../math.js\";\n\nfunction Intersection(point, points, other, entry) {\n this.x = point;\n this.z = points;\n this.o = other; // another intersection\n this.e = entry; // is an entry?\n this.v = false; // visited\n this.n = this.p = null; // next & previous\n}\n\n// A generalized polygon clipping algorithm: given a polygon that has been cut\n// into its visible line segments, and rejoins the segments by interpolating\n// along the clip edge.\nexport default function(segments, compareIntersection, startInside, interpolate, stream) {\n var subject = [],\n clip = [],\n i,\n n;\n\n segments.forEach(function(segment) {\n if ((n = segment.length - 1) <= 0) return;\n var n, p0 = segment[0], p1 = segment[n], x;\n\n if (pointEqual(p0, p1)) {\n if (!p0[2] && !p1[2]) {\n stream.lineStart();\n for (i = 0; i < n; ++i) stream.point((p0 = segment[i])[0], p0[1]);\n stream.lineEnd();\n return;\n }\n // handle degenerate cases by moving the point\n p1[0] += 2 * epsilon;\n }\n\n subject.push(x = new Intersection(p0, segment, null, true));\n clip.push(x.o = new Intersection(p0, null, x, false));\n subject.push(x = new Intersection(p1, segment, null, false));\n clip.push(x.o = new Intersection(p1, null, x, true));\n });\n\n if (!subject.length) return;\n\n clip.sort(compareIntersection);\n link(subject);\n link(clip);\n\n for (i = 0, n = clip.length; i < n; ++i) {\n clip[i].e = startInside = !startInside;\n }\n\n var start = subject[0],\n points,\n point;\n\n while (1) {\n // Find first unvisited intersection.\n var current = start,\n isSubject = true;\n while (current.v) if ((current = current.n) === start) return;\n points = current.z;\n stream.lineStart();\n do {\n current.v = current.o.v = true;\n if (current.e) {\n if (isSubject) {\n for (i = 0, n = points.length; i < n; ++i) stream.point((point = points[i])[0], point[1]);\n } else {\n interpolate(current.x, current.n.x, 1, stream);\n }\n current = current.n;\n } else {\n if (isSubject) {\n points = current.p.z;\n for (i = points.length - 1; i >= 0; --i) stream.point((point = points[i])[0], point[1]);\n } else {\n interpolate(current.x, current.p.x, -1, stream);\n }\n current = current.p;\n }\n current = current.o;\n points = current.z;\n isSubject = !isSubject;\n } while (!current.v);\n stream.lineEnd();\n }\n}\n\nfunction link(array) {\n if (!(n = array.length)) return;\n var n,\n i = 0,\n a = array[0],\n b;\n while (++i < n) {\n a.n = b = array[i];\n b.p = a;\n a = b;\n }\n a.n = b = array[0];\n b.p = a;\n}\n", "import {Adder} from \"d3-array\";\nimport {cartesian, cartesianCross, cartesianNormalizeInPlace} from \"./cartesian.js\";\nimport {abs, asin, atan2, cos, epsilon, epsilon2, halfPi, pi, quarterPi, sign, sin, tau} from \"./math.js\";\n\nfunction longitude(point) {\n return abs(point[0]) <= pi ? point[0] : sign(point[0]) * ((abs(point[0]) + pi) % tau - pi);\n}\n\nexport default function(polygon, point) {\n var lambda = longitude(point),\n phi = point[1],\n sinPhi = sin(phi),\n normal = [sin(lambda), -cos(lambda), 0],\n angle = 0,\n winding = 0;\n\n var sum = new Adder();\n\n if (sinPhi === 1) phi = halfPi + epsilon;\n else if (sinPhi === -1) phi = -halfPi - epsilon;\n\n for (var i = 0, n = polygon.length; i < n; ++i) {\n if (!(m = (ring = polygon[i]).length)) continue;\n var ring,\n m,\n point0 = ring[m - 1],\n lambda0 = longitude(point0),\n phi0 = point0[1] / 2 + quarterPi,\n sinPhi0 = sin(phi0),\n cosPhi0 = cos(phi0);\n\n for (var j = 0; j < m; ++j, lambda0 = lambda1, sinPhi0 = sinPhi1, cosPhi0 = cosPhi1, point0 = point1) {\n var point1 = ring[j],\n lambda1 = longitude(point1),\n phi1 = point1[1] / 2 + quarterPi,\n sinPhi1 = sin(phi1),\n cosPhi1 = cos(phi1),\n delta = lambda1 - lambda0,\n sign = delta >= 0 ? 1 : -1,\n absDelta = sign * delta,\n antimeridian = absDelta > pi,\n k = sinPhi0 * sinPhi1;\n\n sum.add(atan2(k * sign * sin(absDelta), cosPhi0 * cosPhi1 + k * cos(absDelta)));\n angle += antimeridian ? delta + sign * tau : delta;\n\n // Are the longitudes either side of the point\u2019s meridian (lambda),\n // and are the latitudes smaller than the parallel (phi)?\n if (antimeridian ^ lambda0 >= lambda ^ lambda1 >= lambda) {\n var arc = cartesianCross(cartesian(point0), cartesian(point1));\n cartesianNormalizeInPlace(arc);\n var intersection = cartesianCross(normal, arc);\n cartesianNormalizeInPlace(intersection);\n var phiArc = (antimeridian ^ delta >= 0 ? -1 : 1) * asin(intersection[2]);\n if (phi > phiArc || phi === phiArc && (arc[0] || arc[1])) {\n winding += antimeridian ^ delta >= 0 ? 1 : -1;\n }\n }\n }\n }\n\n // First, determine whether the South pole is inside or outside:\n //\n // It is inside if:\n // * the polygon winds around it in a clockwise direction.\n // * the polygon does not (cumulatively) wind around it, but has a negative\n // (counter-clockwise) area.\n //\n // Second, count the (signed) number of times a segment crosses a lambda\n // from the point to the South pole. If it is zero, then the point is the\n // same side as the South pole.\n\n return (angle < -epsilon || angle < epsilon && sum < -epsilon2) ^ (winding & 1);\n}\n", "import clipBuffer from \"./buffer.js\";\nimport clipRejoin from \"./rejoin.js\";\nimport {epsilon, halfPi} from \"../math.js\";\nimport polygonContains from \"../polygonContains.js\";\nimport {merge} from \"d3-array\";\n\nexport default function(pointVisible, clipLine, interpolate, start) {\n return function(sink) {\n var line = clipLine(sink),\n ringBuffer = clipBuffer(),\n ringSink = clipLine(ringBuffer),\n polygonStarted = false,\n polygon,\n segments,\n ring;\n\n var clip = {\n point: point,\n lineStart: lineStart,\n lineEnd: lineEnd,\n polygonStart: function() {\n clip.point = pointRing;\n clip.lineStart = ringStart;\n clip.lineEnd = ringEnd;\n segments = [];\n polygon = [];\n },\n polygonEnd: function() {\n clip.point = point;\n clip.lineStart = lineStart;\n clip.lineEnd = lineEnd;\n segments = merge(segments);\n var startInside = polygonContains(polygon, start);\n if (segments.length) {\n if (!polygonStarted) sink.polygonStart(), polygonStarted = true;\n clipRejoin(segments, compareIntersection, startInside, interpolate, sink);\n } else if (startInside) {\n if (!polygonStarted) sink.polygonStart(), polygonStarted = true;\n sink.lineStart();\n interpolate(null, null, 1, sink);\n sink.lineEnd();\n }\n if (polygonStarted) sink.polygonEnd(), polygonStarted = false;\n segments = polygon = null;\n },\n sphere: function() {\n sink.polygonStart();\n sink.lineStart();\n interpolate(null, null, 1, sink);\n sink.lineEnd();\n sink.polygonEnd();\n }\n };\n\n function point(lambda, phi) {\n if (pointVisible(lambda, phi)) sink.point(lambda, phi);\n }\n\n function pointLine(lambda, phi) {\n line.point(lambda, phi);\n }\n\n function lineStart() {\n clip.point = pointLine;\n line.lineStart();\n }\n\n function lineEnd() {\n clip.point = point;\n line.lineEnd();\n }\n\n function pointRing(lambda, phi) {\n ring.push([lambda, phi]);\n ringSink.point(lambda, phi);\n }\n\n function ringStart() {\n ringSink.lineStart();\n ring = [];\n }\n\n function ringEnd() {\n pointRing(ring[0][0], ring[0][1]);\n ringSink.lineEnd();\n\n var clean = ringSink.clean(),\n ringSegments = ringBuffer.result(),\n i, n = ringSegments.length, m,\n segment,\n point;\n\n ring.pop();\n polygon.push(ring);\n ring = null;\n\n if (!n) return;\n\n // No intersections.\n if (clean & 1) {\n segment = ringSegments[0];\n if ((m = segment.length - 1) > 0) {\n if (!polygonStarted) sink.polygonStart(), polygonStarted = true;\n sink.lineStart();\n for (i = 0; i < m; ++i) sink.point((point = segment[i])[0], point[1]);\n sink.lineEnd();\n }\n return;\n }\n\n // Rejoin connected segments.\n // TODO reuse ringBuffer.rejoin()?\n if (n > 1 && clean & 2) ringSegments.push(ringSegments.pop().concat(ringSegments.shift()));\n\n segments.push(ringSegments.filter(validSegment));\n }\n\n return clip;\n };\n}\n\nfunction validSegment(segment) {\n return segment.length > 1;\n}\n\n// Intersections are sorted along the clip edge. For both antimeridian cutting\n// and circle clipping, the same comparison is used.\nfunction compareIntersection(a, b) {\n return ((a = a.x)[0] < 0 ? a[1] - halfPi - epsilon : halfPi - a[1])\n - ((b = b.x)[0] < 0 ? b[1] - halfPi - epsilon : halfPi - b[1]);\n}\n", "import clip from \"./index.js\";\nimport {abs, atan, cos, epsilon, halfPi, pi, sin} from \"../math.js\";\n\nexport default clip(\n function() { return true; },\n clipAntimeridianLine,\n clipAntimeridianInterpolate,\n [-pi, -halfPi]\n);\n\n// Takes a line and cuts into visible segments. Return values: 0 - there were\n// intersections or the line was empty; 1 - no intersections; 2 - there were\n// intersections, and the first and last segments should be rejoined.\nfunction clipAntimeridianLine(stream) {\n var lambda0 = NaN,\n phi0 = NaN,\n sign0 = NaN,\n clean; // no intersections\n\n return {\n lineStart: function() {\n stream.lineStart();\n clean = 1;\n },\n point: function(lambda1, phi1) {\n var sign1 = lambda1 > 0 ? pi : -pi,\n delta = abs(lambda1 - lambda0);\n if (abs(delta - pi) < epsilon) { // line crosses a pole\n stream.point(lambda0, phi0 = (phi0 + phi1) / 2 > 0 ? halfPi : -halfPi);\n stream.point(sign0, phi0);\n stream.lineEnd();\n stream.lineStart();\n stream.point(sign1, phi0);\n stream.point(lambda1, phi0);\n clean = 0;\n } else if (sign0 !== sign1 && delta >= pi) { // line crosses antimeridian\n if (abs(lambda0 - sign0) < epsilon) lambda0 -= sign0 * epsilon; // handle degeneracies\n if (abs(lambda1 - sign1) < epsilon) lambda1 -= sign1 * epsilon;\n phi0 = clipAntimeridianIntersect(lambda0, phi0, lambda1, phi1);\n stream.point(sign0, phi0);\n stream.lineEnd();\n stream.lineStart();\n stream.point(sign1, phi0);\n clean = 0;\n }\n stream.point(lambda0 = lambda1, phi0 = phi1);\n sign0 = sign1;\n },\n lineEnd: function() {\n stream.lineEnd();\n lambda0 = phi0 = NaN;\n },\n clean: function() {\n return 2 - clean; // if intersections, rejoin first and last segments\n }\n };\n}\n\nfunction clipAntimeridianIntersect(lambda0, phi0, lambda1, phi1) {\n var cosPhi0,\n cosPhi1,\n sinLambda0Lambda1 = sin(lambda0 - lambda1);\n return abs(sinLambda0Lambda1) > epsilon\n ? atan((sin(phi0) * (cosPhi1 = cos(phi1)) * sin(lambda1)\n - sin(phi1) * (cosPhi0 = cos(phi0)) * sin(lambda0))\n / (cosPhi0 * cosPhi1 * sinLambda0Lambda1))\n : (phi0 + phi1) / 2;\n}\n\nfunction clipAntimeridianInterpolate(from, to, direction, stream) {\n var phi;\n if (from == null) {\n phi = direction * halfPi;\n stream.point(-pi, phi);\n stream.point(0, phi);\n stream.point(pi, phi);\n stream.point(pi, 0);\n stream.point(pi, -phi);\n stream.point(0, -phi);\n stream.point(-pi, -phi);\n stream.point(-pi, 0);\n stream.point(-pi, phi);\n } else if (abs(from[0] - to[0]) > epsilon) {\n var lambda = from[0] < to[0] ? pi : -pi;\n phi = direction * lambda / 2;\n stream.point(-lambda, phi);\n stream.point(0, phi);\n stream.point(lambda, phi);\n } else {\n stream.point(to[0], to[1]);\n }\n}\n", "import {cartesian, cartesianAddInPlace, cartesianCross, cartesianDot, cartesianScale, spherical} from \"../cartesian.js\";\nimport {circleStream} from \"../circle.js\";\nimport {abs, cos, epsilon, pi, radians, sqrt} from \"../math.js\";\nimport pointEqual from \"../pointEqual.js\";\nimport clip from \"./index.js\";\n\nexport default function(radius) {\n var cr = cos(radius),\n delta = 6 * radians,\n smallRadius = cr > 0,\n notHemisphere = abs(cr) > epsilon; // TODO optimise for this common case\n\n function interpolate(from, to, direction, stream) {\n circleStream(stream, radius, delta, direction, from, to);\n }\n\n function visible(lambda, phi) {\n return cos(lambda) * cos(phi) > cr;\n }\n\n // Takes a line and cuts into visible segments. Return values used for polygon\n // clipping: 0 - there were intersections or the line was empty; 1 - no\n // intersections 2 - there were intersections, and the first and last segments\n // should be rejoined.\n function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi : -pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2))\n point1[2] = 1;\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1], 2);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1], 3);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }\n\n // Intersects the great circle between a and b with the clip circle.\n function intersect(a, b, two) {\n var pa = cartesian(a),\n pb = cartesian(b);\n\n // We have two planes, n1.p = d1 and n2.p = d2.\n // Find intersection line p(t) = c1 n1 + c2 n2 + t (n1 \u2A2F n2).\n var n1 = [1, 0, 0], // normal\n n2 = cartesianCross(pa, pb),\n n2n2 = cartesianDot(n2, n2),\n n1n2 = n2[0], // cartesianDot(n1, n2),\n determinant = n2n2 - n1n2 * n1n2;\n\n // Two polar points.\n if (!determinant) return !two && a;\n\n var c1 = cr * n2n2 / determinant,\n c2 = -cr * n1n2 / determinant,\n n1xn2 = cartesianCross(n1, n2),\n A = cartesianScale(n1, c1),\n B = cartesianScale(n2, c2);\n cartesianAddInPlace(A, B);\n\n // Solve |p(t)|^2 = 1.\n var u = n1xn2,\n w = cartesianDot(A, u),\n uu = cartesianDot(u, u),\n t2 = w * w - uu * (cartesianDot(A, A) - 1);\n\n if (t2 < 0) return;\n\n var t = sqrt(t2),\n q = cartesianScale(u, (-w - t) / uu);\n cartesianAddInPlace(q, A);\n q = spherical(q);\n\n if (!two) return q;\n\n // Two intersection points.\n var lambda0 = a[0],\n lambda1 = b[0],\n phi0 = a[1],\n phi1 = b[1],\n z;\n\n if (lambda1 < lambda0) z = lambda0, lambda0 = lambda1, lambda1 = z;\n\n var delta = lambda1 - lambda0,\n polar = abs(delta - pi) < epsilon,\n meridian = polar || delta < epsilon;\n\n if (!polar && phi1 < phi0) z = phi0, phi0 = phi1, phi1 = z;\n\n // Check that the first point is between a and b.\n if (meridian\n ? polar\n ? phi0 + phi1 > 0 ^ q[1] < (abs(q[0] - lambda0) < epsilon ? phi0 : phi1)\n : phi0 <= q[1] && q[1] <= phi1\n : delta > pi ^ (lambda0 <= q[0] && q[0] <= lambda1)) {\n var q1 = cartesianScale(u, (-w + t) / uu);\n cartesianAddInPlace(q1, A);\n return [q, spherical(q1)];\n }\n }\n\n // Generates a 4-bit vector representing the location of a point relative to\n // the small circle's bounding box.\n function code(lambda, phi) {\n var r = smallRadius ? radius : pi - radius,\n code = 0;\n if (lambda < -r) code |= 1; // left\n else if (lambda > r) code |= 2; // right\n if (phi < -r) code |= 4; // below\n else if (phi > r) code |= 8; // above\n return code;\n }\n\n return clip(visible, clipLine, interpolate, smallRadius ? [0, -radius] : [-pi, radius - pi]);\n}\n", "export default function(a, b, x0, y0, x1, y1) {\n var ax = a[0],\n ay = a[1],\n bx = b[0],\n by = b[1],\n t0 = 0,\n t1 = 1,\n dx = bx - ax,\n dy = by - ay,\n r;\n\n r = x0 - ax;\n if (!dx && r > 0) return;\n r /= dx;\n if (dx < 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n } else if (dx > 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n }\n\n r = x1 - ax;\n if (!dx && r < 0) return;\n r /= dx;\n if (dx < 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n } else if (dx > 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n }\n\n r = y0 - ay;\n if (!dy && r > 0) return;\n r /= dy;\n if (dy < 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n } else if (dy > 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n }\n\n r = y1 - ay;\n if (!dy && r < 0) return;\n r /= dy;\n if (dy < 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n } else if (dy > 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n }\n\n if (t0 > 0) a[0] = ax + t0 * dx, a[1] = ay + t0 * dy;\n if (t1 < 1) b[0] = ax + t1 * dx, b[1] = ay + t1 * dy;\n return true;\n}\n", "import {abs, epsilon} from \"../math.js\";\nimport clipBuffer from \"./buffer.js\";\nimport clipLine from \"./line.js\";\nimport clipRejoin from \"./rejoin.js\";\nimport {merge} from \"d3-array\";\n\nvar clipMax = 1e9, clipMin = -clipMax;\n\n// TODO Use d3-polygon\u2019s polygonContains here for the ring check?\n// TODO Eliminate duplicate buffering in clipBuffer and polygon.push?\n\nexport default function clipRectangle(x0, y0, x1, y1) {\n\n function visible(x, y) {\n return x0 <= x && x <= x1 && y0 <= y && y <= y1;\n }\n\n function interpolate(from, to, direction, stream) {\n var a = 0, a1 = 0;\n if (from == null\n || (a = corner(from, direction)) !== (a1 = corner(to, direction))\n || comparePoint(from, to) < 0 ^ direction > 0) {\n do stream.point(a === 0 || a === 3 ? x0 : x1, a > 1 ? y1 : y0);\n while ((a = (a + direction + 4) % 4) !== a1);\n } else {\n stream.point(to[0], to[1]);\n }\n }\n\n function corner(p, direction) {\n return abs(p[0] - x0) < epsilon ? direction > 0 ? 0 : 3\n : abs(p[0] - x1) < epsilon ? direction > 0 ? 2 : 1\n : abs(p[1] - y0) < epsilon ? direction > 0 ? 1 : 0\n : direction > 0 ? 3 : 2; // abs(p[1] - y1) < epsilon\n }\n\n function compareIntersection(a, b) {\n return comparePoint(a.x, b.x);\n }\n\n function comparePoint(a, b) {\n var ca = corner(a, 1),\n cb = corner(b, 1);\n return ca !== cb ? ca - cb\n : ca === 0 ? b[1] - a[1]\n : ca === 1 ? a[0] - b[0]\n : ca === 2 ? a[1] - b[1]\n : b[0] - a[0];\n }\n\n return function(stream) {\n var activeStream = stream,\n bufferStream = clipBuffer(),\n segments,\n polygon,\n ring,\n x__, y__, v__, // first point\n x_, y_, v_, // previous point\n first,\n clean;\n\n var clipStream = {\n point: point,\n lineStart: lineStart,\n lineEnd: lineEnd,\n polygonStart: polygonStart,\n polygonEnd: polygonEnd\n };\n\n function point(x, y) {\n if (visible(x, y)) activeStream.point(x, y);\n }\n\n function polygonInside() {\n var winding = 0;\n\n for (var i = 0, n = polygon.length; i < n; ++i) {\n for (var ring = polygon[i], j = 1, m = ring.length, point = ring[0], a0, a1, b0 = point[0], b1 = point[1]; j < m; ++j) {\n a0 = b0, a1 = b1, point = ring[j], b0 = point[0], b1 = point[1];\n if (a1 <= y1) { if (b1 > y1 && (b0 - a0) * (y1 - a1) > (b1 - a1) * (x0 - a0)) ++winding; }\n else { if (b1 <= y1 && (b0 - a0) * (y1 - a1) < (b1 - a1) * (x0 - a0)) --winding; }\n }\n }\n\n return winding;\n }\n\n // Buffer geometry within a polygon and then clip it en masse.\n function polygonStart() {\n activeStream = bufferStream, segments = [], polygon = [], clean = true;\n }\n\n function polygonEnd() {\n var startInside = polygonInside(),\n cleanInside = clean && startInside,\n visible = (segments = merge(segments)).length;\n if (cleanInside || visible) {\n stream.polygonStart();\n if (cleanInside) {\n stream.lineStart();\n interpolate(null, null, 1, stream);\n stream.lineEnd();\n }\n if (visible) {\n clipRejoin(segments, compareIntersection, startInside, interpolate, stream);\n }\n stream.polygonEnd();\n }\n activeStream = stream, segments = polygon = ring = null;\n }\n\n function lineStart() {\n clipStream.point = linePoint;\n if (polygon) polygon.push(ring = []);\n first = true;\n v_ = false;\n x_ = y_ = NaN;\n }\n\n // TODO rather than special-case polygons, simply handle them separately.\n // Ideally, coincident intersection points should be jittered to avoid\n // clipping issues.\n function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }\n\n function linePoint(x, y) {\n var v = visible(x, y);\n if (polygon) ring.push([x, y]);\n if (first) {\n x__ = x, y__ = y, v__ = v;\n first = false;\n if (v) {\n activeStream.lineStart();\n activeStream.point(x, y);\n }\n } else {\n if (v && v_) activeStream.point(x, y);\n else {\n var a = [x_ = Math.max(clipMin, Math.min(clipMax, x_)), y_ = Math.max(clipMin, Math.min(clipMax, y_))],\n b = [x = Math.max(clipMin, Math.min(clipMax, x)), y = Math.max(clipMin, Math.min(clipMax, y))];\n if (clipLine(a, b, x0, y0, x1, y1)) {\n if (!v_) {\n activeStream.lineStart();\n activeStream.point(a[0], a[1]);\n }\n activeStream.point(b[0], b[1]);\n if (!v) activeStream.lineEnd();\n clean = false;\n } else if (v) {\n activeStream.lineStart();\n activeStream.point(x, y);\n clean = false;\n }\n }\n }\n x_ = x, y_ = y, v_ = v;\n }\n\n return clipStream;\n };\n}\n", "export default x => x;\n", "import {Adder} from \"d3-array\";\nimport {abs} from \"../math.js\";\nimport noop from \"../noop.js\";\n\nvar areaSum = new Adder(),\n areaRingSum = new 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 = new Adder();\n },\n result: function() {\n var area = areaSum / 2;\n areaSum = new Adder();\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 \"d3-array\";\nimport {sqrt} from \"../math.js\";\nimport noop from \"../noop.js\";\n\nvar lengthSum = new 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 = new Adder();\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", "// Simple caching for constant-radius points.\nlet cacheDigits, cacheAppend, cacheRadius, cacheCircle;\n\nexport default class PathString {\n constructor(digits) {\n this._append = digits == null ? append : appendRound(digits);\n this._radius = 4.5;\n this._ = \"\";\n }\n pointRadius(_) {\n this._radius = +_;\n return this;\n }\n polygonStart() {\n this._line = 0;\n }\n polygonEnd() {\n this._line = NaN;\n }\n lineStart() {\n this._point = 0;\n }\n lineEnd() {\n if (this._line === 0) this._ += \"Z\";\n this._point = NaN;\n }\n point(x, y) {\n switch (this._point) {\n case 0: {\n this._append`M${x},${y}`;\n this._point = 1;\n break;\n }\n case 1: {\n this._append`L${x},${y}`;\n break;\n }\n default: {\n this._append`M${x},${y}`;\n if (this._radius !== cacheRadius || this._append !== cacheAppend) {\n const r = this._radius;\n const s = this._;\n this._ = \"\"; // stash the old string so we can cache the circle path fragment\n this._append`m0,${r}a${r},${r} 0 1,1 0,${-2 * r}a${r},${r} 0 1,1 0,${2 * r}z`;\n cacheRadius = r;\n cacheAppend = this._append;\n cacheCircle = this._;\n this._ = s;\n }\n this._ += cacheCircle;\n break;\n }\n }\n }\n result() {\n const result = this._;\n this._ = \"\";\n return result.length ? result : null;\n }\n}\n\nfunction append(strings) {\n let i = 1;\n this._ += strings[0];\n for (const j = strings.length; i < j; ++i) {\n this._ += arguments[i] + strings[i];\n }\n}\n\nfunction appendRound(digits) {\n const d = Math.floor(digits);\n if (!(d >= 0)) throw new RangeError(`invalid digits: ${digits}`);\n if (d > 15) return append;\n if (d !== cacheDigits) {\n const k = 10 ** d;\n cacheDigits = d;\n cacheAppend = function append(strings) {\n let i = 1;\n this._ += strings[0];\n for (const j = strings.length; i < j; ++i) {\n this._ += Math.round(arguments[i] * k) / k + strings[i];\n }\n };\n }\n return cacheAppend;\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 let digits = 3,\n 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 if (!arguments.length) return projection;\n projectionStream = _ == null ? (projection = null, identity) : (projection = _).stream;\n return path;\n };\n\n path.context = function(_) {\n if (!arguments.length) return context;\n contextStream = _ == null ? (context = null, new PathString(digits)) : 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 path.digits = function(_) {\n if (!arguments.length) return digits;\n if (_ == null) digits = null;\n else {\n const d = Math.floor(_);\n if (!(d >= 0)) throw new RangeError(`invalid digits: ${_}`);\n digits = d;\n }\n if (context === null) contextStream = new PathString(digits);\n return path;\n };\n\n return path.projection(projection).digits(digits).context(context);\n}\n", "export default function(methods) {\n return {\n stream: transformer(methods)\n };\n}\n\nexport function transformer(methods) {\n return function(stream) {\n var s = new TransformStream;\n for (var key in methods) s[key] = methods[key];\n s.stream = stream;\n return s;\n };\n}\n\nfunction TransformStream() {}\n\nTransformStream.prototype = {\n constructor: TransformStream,\n point: function(x, y) { this.stream.point(x, y); },\n sphere: function() { this.stream.sphere(); },\n lineStart: function() { this.stream.lineStart(); },\n lineEnd: function() { this.stream.lineEnd(); },\n polygonStart: function() { this.stream.polygonStart(); },\n polygonEnd: function() { this.stream.polygonEnd(); }\n};\n", "import {default as geoStream} from \"../stream.js\";\nimport boundsStream from \"../path/bounds.js\";\n\nfunction fit(projection, fitBounds, object) {\n var clip = projection.clipExtent && projection.clipExtent();\n projection.scale(150).translate([0, 0]);\n if (clip != null) projection.clipExtent(null);\n geoStream(object, projection.stream(boundsStream));\n fitBounds(boundsStream.result());\n if (clip != null) projection.clipExtent(clip);\n return projection;\n}\n\nexport function fitExtent(projection, extent, object) {\n return fit(projection, function(b) {\n var w = extent[1][0] - extent[0][0],\n h = extent[1][1] - extent[0][1],\n k = Math.min(w / (b[1][0] - b[0][0]), h / (b[1][1] - b[0][1])),\n x = +extent[0][0] + (w - k * (b[1][0] + b[0][0])) / 2,\n y = +extent[0][1] + (h - k * (b[1][1] + b[0][1])) / 2;\n projection.scale(150 * k).translate([x, y]);\n }, object);\n}\n\nexport function fitSize(projection, size, object) {\n return fitExtent(projection, [[0, 0], size], object);\n}\n\nexport function fitWidth(projection, width, object) {\n return fit(projection, function(b) {\n var w = +width,\n k = w / (b[1][0] - b[0][0]),\n x = (w - k * (b[1][0] + b[0][0])) / 2,\n y = -k * b[0][1];\n projection.scale(150 * k).translate([x, y]);\n }, object);\n}\n\nexport function fitHeight(projection, height, object) {\n return fit(projection, function(b) {\n var h = +height,\n k = h / (b[1][1] - b[0][1]),\n x = -k * b[0][0],\n y = (h - k * (b[1][1] + b[0][1])) / 2;\n projection.scale(150 * k).translate([x, y]);\n }, object);\n}\n", "import {cartesian} from \"../cartesian.js\";\nimport {abs, asin, atan2, cos, epsilon, radians, sqrt} from \"../math.js\";\nimport {transformer} from \"../transform.js\";\n\nvar maxDepth = 16, // maximum depth of subdivision\n cosMinDistance = cos(30 * radians); // cos(minimum angular distance)\n\nexport default function(project, delta2) {\n return +delta2 ? resample(project, delta2) : resampleNone(project);\n}\n\nfunction resampleNone(project) {\n return transformer({\n point: function(x, y) {\n x = project(x, y);\n this.stream.point(x[0], x[1]);\n }\n });\n}\n\nfunction resample(project, delta2) {\n\n function resampleLineTo(x0, y0, lambda0, a0, b0, c0, x1, y1, lambda1, a1, b1, c1, depth, stream) {\n var dx = x1 - x0,\n dy = y1 - y0,\n d2 = dx * dx + dy * dy;\n if (d2 > 4 * delta2 && depth--) {\n var a = a0 + a1,\n b = b0 + b1,\n c = c0 + c1,\n m = sqrt(a * a + b * b + c * c),\n phi2 = asin(c /= m),\n lambda2 = abs(abs(c) - 1) < epsilon || abs(lambda0 - lambda1) < epsilon ? (lambda0 + lambda1) / 2 : atan2(b, a),\n p = project(lambda2, phi2),\n x2 = p[0],\n y2 = p[1],\n dx2 = x2 - x0,\n dy2 = y2 - y0,\n dz = dy * dx2 - dx * dy2;\n if (dz * dz / d2 > delta2 // perpendicular projected distance\n || abs((dx * dx2 + dy * dy2) / d2 - 0.5) > 0.3 // midpoint close to an end\n || a0 * a1 + b0 * b1 + c0 * c1 < cosMinDistance) { // angular distance\n resampleLineTo(x0, y0, lambda0, a0, b0, c0, x2, y2, lambda2, a /= m, b /= m, c, depth, stream);\n stream.point(x2, y2);\n resampleLineTo(x2, y2, lambda2, a, b, c, x1, y1, lambda1, a1, b1, c1, depth, stream);\n }\n }\n }\n return function(stream) {\n var lambda00, x00, y00, a00, b00, c00, // first point\n lambda0, x0, y0, a0, b0, c0; // previous point\n\n var resampleStream = {\n point: point,\n lineStart: lineStart,\n lineEnd: lineEnd,\n polygonStart: function() { stream.polygonStart(); resampleStream.lineStart = ringStart; },\n polygonEnd: function() { stream.polygonEnd(); resampleStream.lineStart = lineStart; }\n };\n\n function point(x, y) {\n x = project(x, y);\n stream.point(x[0], x[1]);\n }\n\n function lineStart() {\n x0 = NaN;\n resampleStream.point = linePoint;\n stream.lineStart();\n }\n\n function linePoint(lambda, phi) {\n var c = cartesian([lambda, phi]), p = project(lambda, phi);\n resampleLineTo(x0, y0, lambda0, a0, b0, c0, x0 = p[0], y0 = p[1], lambda0 = lambda, a0 = c[0], b0 = c[1], c0 = c[2], maxDepth, stream);\n stream.point(x0, y0);\n }\n\n function lineEnd() {\n resampleStream.point = point;\n stream.lineEnd();\n }\n\n function ringStart() {\n lineStart();\n resampleStream.point = ringPoint;\n resampleStream.lineEnd = ringEnd;\n }\n\n function ringPoint(lambda, phi) {\n linePoint(lambda00 = lambda, phi), x00 = x0, y00 = y0, a00 = a0, b00 = b0, c00 = c0;\n resampleStream.point = linePoint;\n }\n\n function ringEnd() {\n resampleLineTo(x0, y0, lambda0, a0, b0, c0, x00, y00, lambda00, a00, b00, c00, maxDepth, stream);\n resampleStream.lineEnd = lineEnd;\n lineEnd();\n }\n\n return resampleStream;\n };\n}\n", "import clipAntimeridian from \"../clip/antimeridian.js\";\nimport clipCircle from \"../clip/circle.js\";\nimport clipRectangle from \"../clip/rectangle.js\";\nimport compose from \"../compose.js\";\nimport identity from \"../identity.js\";\nimport {cos, degrees, radians, sin, sqrt} from \"../math.js\";\nimport {rotateRadians} from \"../rotation.js\";\nimport {transformer} from \"../transform.js\";\nimport {fitExtent, fitSize, fitWidth, fitHeight} from \"./fit.js\";\nimport resample from \"./resample.js\";\n\nvar transformRadians = transformer({\n point: function(x, y) {\n this.stream.point(x * radians, y * radians);\n }\n});\n\nfunction transformRotate(rotate) {\n return transformer({\n point: function(x, y) {\n var r = rotate(x, y);\n return this.stream.point(r[0], r[1]);\n }\n });\n}\n\nfunction scaleTranslate(k, dx, dy, sx, sy) {\n function transform(x, y) {\n x *= sx; y *= sy;\n return [dx + k * x, dy - k * y];\n }\n transform.invert = function(x, y) {\n return [(x - dx) / k * sx, (dy - y) / k * sy];\n };\n return transform;\n}\n\nfunction scaleTranslateRotate(k, dx, dy, sx, sy, alpha) {\n if (!alpha) return scaleTranslate(k, dx, dy, sx, sy);\n var cosAlpha = cos(alpha),\n sinAlpha = sin(alpha),\n a = cosAlpha * k,\n b = sinAlpha * k,\n ai = cosAlpha / k,\n bi = sinAlpha / k,\n ci = (sinAlpha * dy - cosAlpha * dx) / k,\n fi = (sinAlpha * dx + cosAlpha * dy) / k;\n function transform(x, y) {\n x *= sx; y *= sy;\n return [a * x - b * y + dx, dy - b * x - a * y];\n }\n transform.invert = function(x, y) {\n return [sx * (ai * x - bi * y + ci), sy * (fi - bi * x - ai * y)];\n };\n return transform;\n}\n\nexport default function projection(project) {\n return projectionMutator(function() { return project; })();\n}\n\nexport function projectionMutator(projectAt) {\n var project,\n k = 150, // scale\n x = 480, y = 250, // translate\n lambda = 0, phi = 0, // center\n deltaLambda = 0, deltaPhi = 0, deltaGamma = 0, rotate, // pre-rotate\n alpha = 0, // post-rotate angle\n sx = 1, // reflectX\n sy = 1, // reflectX\n theta = null, preclip = clipAntimeridian, // pre-clip angle\n x0 = null, y0, x1, y1, postclip = identity, // post-clip extent\n delta2 = 0.5, // precision\n projectResample,\n projectTransform,\n projectRotateTransform,\n cache,\n cacheStream;\n\n function projection(point) {\n return projectRotateTransform(point[0] * radians, point[1] * radians);\n }\n\n function invert(point) {\n point = projectRotateTransform.invert(point[0], point[1]);\n return point && [point[0] * degrees, point[1] * degrees];\n }\n\n projection.stream = function(stream) {\n return cache && cacheStream === stream ? cache : cache = transformRadians(transformRotate(rotate)(preclip(projectResample(postclip(cacheStream = stream)))));\n };\n\n projection.preclip = function(_) {\n return arguments.length ? (preclip = _, theta = undefined, reset()) : preclip;\n };\n\n projection.postclip = function(_) {\n return arguments.length ? (postclip = _, x0 = y0 = x1 = y1 = null, reset()) : postclip;\n };\n\n projection.clipAngle = function(_) {\n return arguments.length ? (preclip = +_ ? clipCircle(theta = _ * radians) : (theta = null, clipAntimeridian), reset()) : theta * degrees;\n };\n\n projection.clipExtent = function(_) {\n return arguments.length ? (postclip = _ == null ? (x0 = y0 = x1 = y1 = null, identity) : clipRectangle(x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1]), reset()) : x0 == null ? null : [[x0, y0], [x1, y1]];\n };\n\n projection.scale = function(_) {\n return arguments.length ? (k = +_, recenter()) : k;\n };\n\n projection.translate = function(_) {\n return arguments.length ? (x = +_[0], y = +_[1], recenter()) : [x, y];\n };\n\n projection.center = function(_) {\n return arguments.length ? (lambda = _[0] % 360 * radians, phi = _[1] % 360 * radians, recenter()) : [lambda * degrees, phi * degrees];\n };\n\n projection.rotate = function(_) {\n return arguments.length ? (deltaLambda = _[0] % 360 * radians, deltaPhi = _[1] % 360 * radians, deltaGamma = _.length > 2 ? _[2] % 360 * radians : 0, recenter()) : [deltaLambda * degrees, deltaPhi * degrees, deltaGamma * degrees];\n };\n\n projection.angle = function(_) {\n return arguments.length ? (alpha = _ % 360 * radians, recenter()) : alpha * degrees;\n };\n\n projection.reflectX = function(_) {\n return arguments.length ? (sx = _ ? -1 : 1, recenter()) : sx < 0;\n };\n\n projection.reflectY = function(_) {\n return arguments.length ? (sy = _ ? -1 : 1, recenter()) : sy < 0;\n };\n\n projection.precision = function(_) {\n return arguments.length ? (projectResample = resample(projectTransform, delta2 = _ * _), reset()) : sqrt(delta2);\n };\n\n projection.fitExtent = function(extent, object) {\n return fitExtent(projection, extent, object);\n };\n\n projection.fitSize = function(size, object) {\n return fitSize(projection, size, object);\n };\n\n projection.fitWidth = function(width, object) {\n return fitWidth(projection, width, object);\n };\n\n projection.fitHeight = function(height, object) {\n return fitHeight(projection, height, object);\n };\n\n function recenter() {\n var center = scaleTranslateRotate(k, 0, 0, sx, sy, alpha).apply(null, project(lambda, phi)),\n transform = scaleTranslateRotate(k, x - center[0], y - center[1], sx, sy, alpha);\n rotate = rotateRadians(deltaLambda, deltaPhi, deltaGamma);\n projectTransform = compose(project, transform);\n projectRotateTransform = compose(rotate, projectTransform);\n projectResample = resample(projectTransform, delta2);\n return reset();\n }\n\n function reset() {\n cache = cacheStream = null;\n return projection;\n }\n\n return function() {\n project = projectAt.apply(this, arguments);\n projection.invert = project.invert && invert;\n return recenter();\n };\n}\n", "import {degrees, pi, radians} from \"../math.js\";\nimport {projectionMutator} from \"./index.js\";\n\nexport function conicProjection(projectAt) {\n var phi0 = 0,\n phi1 = pi / 3,\n m = projectionMutator(projectAt),\n p = m(phi0, phi1);\n\n p.parallels = function(_) {\n return arguments.length ? m(phi0 = _[0] * radians, phi1 = _[1] * radians) : [phi0 * degrees, phi1 * degrees];\n };\n\n return p;\n}\n", "import {asin, cos, sin} from \"../math.js\";\n\nexport function cylindricalEqualAreaRaw(phi0) {\n var cosPhi0 = cos(phi0);\n\n function forward(lambda, phi) {\n return [lambda * cosPhi0, sin(phi) / cosPhi0];\n }\n\n forward.invert = function(x, y) {\n return [x / cosPhi0, asin(y * cosPhi0)];\n };\n\n return forward;\n}\n", "import {abs, asin, atan2, cos, epsilon, pi, sign, sin, sqrt} from \"../math.js\";\nimport {conicProjection} from \"./conic.js\";\nimport {cylindricalEqualAreaRaw} from \"./cylindricalEqualArea.js\";\n\nexport function conicEqualAreaRaw(y0, y1) {\n var sy0 = sin(y0), n = (sy0 + sin(y1)) / 2;\n\n // Are the parallels symmetrical around the Equator?\n if (abs(n) < epsilon) return cylindricalEqualAreaRaw(y0);\n\n var c = 1 + sy0 * (2 * n - sy0), r0 = sqrt(c) / n;\n\n function project(x, y) {\n var r = sqrt(c - 2 * n * sin(y)) / n;\n return [r * sin(x *= n), r0 - r * cos(x)];\n }\n\n project.invert = function(x, y) {\n var r0y = r0 - y,\n l = atan2(x, abs(r0y)) * sign(r0y);\n if (r0y * n < 0)\n l -= pi * sign(x) * sign(r0y);\n return [l / n, asin((c - (x * x + r0y * r0y) * n * n) / (2 * n))];\n };\n\n return project;\n}\n\nexport default function() {\n return conicProjection(conicEqualAreaRaw)\n .scale(155.424)\n .center([0, 33.6442]);\n}\n", "import conicEqualArea from \"./conicEqualArea.js\";\n\nexport default function() {\n return conicEqualArea()\n .parallels([29.5, 45.5])\n .scale(1070)\n .translate([480, 250])\n .rotate([96, 0])\n .center([-0.6, 38.7]);\n}\n", "import {epsilon} from \"../math.js\";\nimport albers from \"./albers.js\";\nimport conicEqualArea from \"./conicEqualArea.js\";\nimport {fitExtent, fitSize, fitWidth, fitHeight} from \"./fit.js\";\n\n// The projections must have mutually exclusive clip regions on the sphere,\n// as this will avoid emitting interleaving lines and polygons.\nfunction multiplex(streams) {\n var n = streams.length;\n return {\n point: function(x, y) { var i = -1; while (++i < n) streams[i].point(x, y); },\n sphere: function() { var i = -1; while (++i < n) streams[i].sphere(); },\n lineStart: function() { var i = -1; while (++i < n) streams[i].lineStart(); },\n lineEnd: function() { var i = -1; while (++i < n) streams[i].lineEnd(); },\n polygonStart: function() { var i = -1; while (++i < n) streams[i].polygonStart(); },\n polygonEnd: function() { var i = -1; while (++i < n) streams[i].polygonEnd(); }\n };\n}\n\n// A composite projection for the United States, configured by default for\n// 960\u00D7500. The projection also works quite well at 960\u00D7600 if you change the\n// scale to 1285 and adjust the translate accordingly. The set of standard\n// parallels for each region comes from USGS, which is published here:\n// http://egsc.usgs.gov/isb/pubs/MapProjections/projections.html#albers\nexport default function() {\n var cache,\n cacheStream,\n lower48 = albers(), lower48Point,\n alaska = conicEqualArea().rotate([154, 0]).center([-2, 58.5]).parallels([55, 65]), alaskaPoint, // EPSG:3338\n hawaii = conicEqualArea().rotate([157, 0]).center([-3, 19.9]).parallels([8, 18]), hawaiiPoint, // ESRI:102007\n point, pointStream = {point: function(x, y) { point = [x, y]; }};\n\n function albersUsa(coordinates) {\n var x = coordinates[0], y = coordinates[1];\n return point = null,\n (lower48Point.point(x, y), point)\n || (alaskaPoint.point(x, y), point)\n || (hawaiiPoint.point(x, y), point);\n }\n\n albersUsa.invert = function(coordinates) {\n var k = lower48.scale(),\n t = lower48.translate(),\n x = (coordinates[0] - t[0]) / k,\n y = (coordinates[1] - t[1]) / k;\n return (y >= 0.120 && y < 0.234 && x >= -0.425 && x < -0.214 ? alaska\n : y >= 0.166 && y < 0.234 && x >= -0.214 && x < -0.115 ? hawaii\n : lower48).invert(coordinates);\n };\n\n albersUsa.stream = function(stream) {\n return cache && cacheStream === stream ? cache : cache = multiplex([lower48.stream(cacheStream = stream), alaska.stream(stream), hawaii.stream(stream)]);\n };\n\n albersUsa.precision = function(_) {\n if (!arguments.length) return lower48.precision();\n lower48.precision(_), alaska.precision(_), hawaii.precision(_);\n return reset();\n };\n\n albersUsa.scale = function(_) {\n if (!arguments.length) return lower48.scale();\n lower48.scale(_), alaska.scale(_ * 0.35), hawaii.scale(_);\n return albersUsa.translate(lower48.translate());\n };\n\n albersUsa.translate = function(_) {\n if (!arguments.length) return lower48.translate();\n var k = lower48.scale(), x = +_[0], y = +_[1];\n\n lower48Point = lower48\n .translate(_)\n .clipExtent([[x - 0.455 * k, y - 0.238 * k], [x + 0.455 * k, y + 0.238 * k]])\n .stream(pointStream);\n\n alaskaPoint = alaska\n .translate([x - 0.307 * k, y + 0.201 * k])\n .clipExtent([[x - 0.425 * k + epsilon, y + 0.120 * k + epsilon], [x - 0.214 * k - epsilon, y + 0.234 * k - epsilon]])\n .stream(pointStream);\n\n hawaiiPoint = hawaii\n .translate([x - 0.205 * k, y + 0.212 * k])\n .clipExtent([[x - 0.214 * k + epsilon, y + 0.166 * k + epsilon], [x - 0.115 * k - epsilon, y + 0.234 * k - epsilon]])\n .stream(pointStream);\n\n return reset();\n };\n\n albersUsa.fitExtent = function(extent, object) {\n return fitExtent(albersUsa, extent, object);\n };\n\n albersUsa.fitSize = function(size, object) {\n return fitSize(albersUsa, size, object);\n };\n\n albersUsa.fitWidth = function(width, object) {\n return fitWidth(albersUsa, width, object);\n };\n\n albersUsa.fitHeight = function(height, object) {\n return fitHeight(albersUsa, height, object);\n };\n\n function reset() {\n cache = cacheStream = null;\n return albersUsa;\n }\n\n return albersUsa.scale(1070);\n}\n", "import {asin, atan2, cos, sin, sqrt} from \"../math.js\";\n\nexport function azimuthalRaw(scale) {\n return function(x, y) {\n var cx = cos(x),\n cy = cos(y),\n k = scale(cx * cy);\n if (k === Infinity) return [2, 0];\n return [\n k * cy * sin(x),\n k * sin(y)\n ];\n }\n}\n\nexport function azimuthalInvert(angle) {\n return function(x, y) {\n var z = sqrt(x * x + y * y),\n c = angle(z),\n sc = sin(c),\n cc = cos(c);\n return [\n atan2(x * sc, z * cc),\n asin(z && y * sc / z)\n ];\n }\n}\n", "import {asin, sqrt} from \"../math.js\";\nimport {azimuthalRaw, azimuthalInvert} from \"./azimuthal.js\";\nimport projection from \"./index.js\";\n\nexport var azimuthalEqualAreaRaw = azimuthalRaw(function(cxcy) {\n return sqrt(2 / (1 + cxcy));\n});\n\nazimuthalEqualAreaRaw.invert = azimuthalInvert(function(z) {\n return 2 * asin(z / 2);\n});\n\nexport default function() {\n return projection(azimuthalEqualAreaRaw)\n .scale(124.75)\n .clipAngle(180 - 1e-3);\n}\n", "import {acos, sin} from \"../math.js\";\nimport {azimuthalRaw, azimuthalInvert} from \"./azimuthal.js\";\nimport projection from \"./index.js\";\n\nexport var azimuthalEquidistantRaw = azimuthalRaw(function(c) {\n return (c = acos(c)) && c / sin(c);\n});\n\nazimuthalEquidistantRaw.invert = azimuthalInvert(function(z) {\n return z;\n});\n\nexport default function() {\n return projection(azimuthalEquidistantRaw)\n .scale(79.4188)\n .clipAngle(180 - 1e-3);\n}\n", "import {atan, exp, halfPi, log, pi, tan, tau} from \"../math.js\";\nimport rotation from \"../rotation.js\";\nimport projection from \"./index.js\";\n\nexport function mercatorRaw(lambda, phi) {\n return [lambda, log(tan((halfPi + phi) / 2))];\n}\n\nmercatorRaw.invert = function(x, y) {\n return [x, 2 * atan(exp(y)) - halfPi];\n};\n\nexport default function() {\n return mercatorProjection(mercatorRaw)\n .scale(961 / tau);\n}\n\nexport function mercatorProjection(project) {\n var m = projection(project),\n center = m.center,\n scale = m.scale,\n translate = m.translate,\n clipExtent = m.clipExtent,\n x0 = null, y0, x1, y1; // clip extent\n\n m.scale = function(_) {\n return arguments.length ? (scale(_), reclip()) : scale();\n };\n\n m.translate = function(_) {\n return arguments.length ? (translate(_), reclip()) : translate();\n };\n\n m.center = function(_) {\n return arguments.length ? (center(_), reclip()) : center();\n };\n\n m.clipExtent = function(_) {\n return arguments.length ? ((_ == null ? x0 = y0 = x1 = y1 = null : (x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1])), reclip()) : x0 == null ? null : [[x0, y0], [x1, y1]];\n };\n\n function reclip() {\n var k = pi * scale(),\n t = m(rotation(m.rotate()).invert([0, 0]));\n return clipExtent(x0 == null\n ? [[t[0] - k, t[1] - k], [t[0] + k, t[1] + k]] : project === mercatorRaw\n ? [[Math.max(t[0] - k, x0), y0], [Math.min(t[0] + k, x1), y1]]\n : [[x0, Math.max(t[1] - k, y0)], [x1, Math.min(t[1] + k, y1)]]);\n }\n\n return reclip();\n}\n", "import {abs, atan, atan2, cos, epsilon, halfPi, log, pi, pow, sign, sin, sqrt, tan} from \"../math.js\";\nimport {conicProjection} from \"./conic.js\";\nimport {mercatorRaw} from \"./mercator.js\";\n\nfunction tany(y) {\n return tan((halfPi + y) / 2);\n}\n\nexport function conicConformalRaw(y0, y1) {\n var cy0 = cos(y0),\n n = y0 === y1 ? sin(y0) : log(cy0 / cos(y1)) / log(tany(y1) / tany(y0)),\n f = cy0 * pow(tany(y0), n) / n;\n\n if (!n) return mercatorRaw;\n\n function project(x, y) {\n if (f > 0) { if (y < -halfPi + epsilon) y = -halfPi + epsilon; }\n else { if (y > halfPi - epsilon) y = halfPi - epsilon; }\n var r = f / pow(tany(y), n);\n return [r * sin(n * x), f - r * cos(n * x)];\n }\n\n project.invert = function(x, y) {\n var fy = f - y, r = sign(n) * sqrt(x * x + fy * fy),\n l = atan2(x, abs(fy)) * sign(fy);\n if (fy * n < 0)\n l -= pi * sign(x) * sign(fy);\n return [l / n, 2 * atan(pow(f / r, 1 / n)) - halfPi];\n };\n\n return project;\n}\n\nexport default function() {\n return conicProjection(conicConformalRaw)\n .scale(109.5)\n .parallels([30, 30]);\n}\n", "import projection from \"./index.js\";\n\nexport function equirectangularRaw(lambda, phi) {\n return [lambda, phi];\n}\n\nequirectangularRaw.invert = equirectangularRaw;\n\nexport default function() {\n return projection(equirectangularRaw)\n .scale(152.63);\n}\n", "import {abs, atan2, cos, epsilon, pi, sign, sin, sqrt} from \"../math.js\";\nimport {conicProjection} from \"./conic.js\";\nimport {equirectangularRaw} from \"./equirectangular.js\";\n\nexport function conicEquidistantRaw(y0, y1) {\n var cy0 = cos(y0),\n n = y0 === y1 ? sin(y0) : (cy0 - cos(y1)) / (y1 - y0),\n g = cy0 / n + y0;\n\n if (abs(n) < epsilon) return equirectangularRaw;\n\n function project(x, y) {\n var gy = g - y, nx = n * x;\n return [gy * sin(nx), g - gy * cos(nx)];\n }\n\n project.invert = function(x, y) {\n var gy = g - y,\n l = atan2(x, abs(gy)) * sign(gy);\n if (gy * n < 0)\n l -= pi * sign(x) * sign(gy);\n return [l / n, g - sign(n) * sqrt(x * x + gy * gy)];\n };\n\n return project;\n}\n\nexport default function() {\n return conicProjection(conicEquidistantRaw)\n .scale(131.154)\n .center([0, 13.9389]);\n}\n", "import projection from \"./index.js\";\nimport {abs, asin, cos, epsilon2, sin, sqrt} from \"../math.js\";\n\nvar A1 = 1.340264,\n A2 = -0.081106,\n A3 = 0.000893,\n A4 = 0.003796,\n M = sqrt(3) / 2,\n iterations = 12;\n\nexport function equalEarthRaw(lambda, phi) {\n var l = asin(M * sin(phi)), l2 = l * l, l6 = l2 * l2 * l2;\n return [\n lambda * cos(l) / (M * (A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2))),\n l * (A1 + A2 * l2 + l6 * (A3 + A4 * l2))\n ];\n}\n\nequalEarthRaw.invert = function(x, y) {\n var l = y, l2 = l * l, l6 = l2 * l2 * l2;\n for (var i = 0, delta, fy, fpy; i < iterations; ++i) {\n fy = l * (A1 + A2 * l2 + l6 * (A3 + A4 * l2)) - y;\n fpy = A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2);\n l -= delta = fy / fpy, l2 = l * l, l6 = l2 * l2 * l2;\n if (abs(delta) < epsilon2) break;\n }\n return [\n M * x * (A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2)) / cos(l),\n asin(sin(l) / M)\n ];\n};\n\nexport default function() {\n return projection(equalEarthRaw)\n .scale(177.158);\n}\n", "import {atan, cos, sin} from \"../math.js\";\nimport {azimuthalInvert} from \"./azimuthal.js\";\nimport projection from \"./index.js\";\n\nexport function gnomonicRaw(x, y) {\n var cy = cos(y), k = cos(x) * cy;\n return [cy * sin(x) / k, sin(y) / k];\n}\n\ngnomonicRaw.invert = azimuthalInvert(atan);\n\nexport default function() {\n return projection(gnomonicRaw)\n .scale(144.049)\n .clipAngle(60);\n}\n", "import {asin, cos, epsilon, sin} from \"../math.js\";\nimport {azimuthalInvert} from \"./azimuthal.js\";\nimport projection from \"./index.js\";\n\nexport function orthographicRaw(x, y) {\n return [cos(y) * sin(x), sin(y)];\n}\n\northographicRaw.invert = azimuthalInvert(asin);\n\nexport default function() {\n return projection(orthographicRaw)\n .scale(249.5)\n .clipAngle(90 + epsilon);\n}\n", "import {atan, cos, sin} from \"../math.js\";\nimport {azimuthalInvert} from \"./azimuthal.js\";\nimport projection from \"./index.js\";\n\nexport function stereographicRaw(x, y) {\n var cy = cos(y), k = 1 + cos(x) * cy;\n return [cy * sin(x) / k, sin(y) / k];\n}\n\nstereographicRaw.invert = azimuthalInvert(function(z) {\n return 2 * atan(z);\n});\n\nexport default function() {\n return projection(stereographicRaw)\n .scale(250)\n .clipAngle(142);\n}\n", "import {atan, exp, halfPi, log, tan} from \"../math.js\";\nimport {mercatorProjection} from \"./mercator.js\";\n\nexport function transverseMercatorRaw(lambda, phi) {\n return [log(tan((halfPi + phi) / 2)), -lambda];\n}\n\ntransverseMercatorRaw.invert = function(x, y) {\n return [-y, 2 * atan(exp(x)) - halfPi];\n};\n\nexport default function() {\n var m = mercatorProjection(transverseMercatorRaw),\n center = m.center,\n rotate = m.rotate;\n\n m.center = function(_) {\n return arguments.length ? center([-_[1], _[0]]) : (_ = center(), [_[1], -_[0]]);\n };\n\n m.rotate = function(_) {\n return arguments.length ? rotate([_[0], _[1], _.length > 2 ? _[2] + 90 : 90]) : (_ = rotate(), [_[0], _[1], _[2] - 90]);\n };\n\n return rotate([0, 0, 90])\n .scale(159.155);\n}\n", "export function initRange(domain, range) {\n switch (arguments.length) {\n case 0: break;\n case 1: this.range(domain); break;\n default: this.range(range).domain(domain); break;\n }\n return this;\n}\n\nexport function initInterpolator(domain, interpolator) {\n switch (arguments.length) {\n case 0: break;\n case 1: {\n if (typeof domain === \"function\") this.interpolator(domain);\n else this.range(domain);\n break;\n }\n default: {\n this.domain(domain);\n if (typeof interpolator === \"function\") this.interpolator(interpolator);\n else this.range(interpolator);\n break;\n }\n }\n return this;\n}\n", "import {InternMap} from \"d3-array\";\nimport {initRange} from \"./init.js\";\n\nexport const implicit = Symbol(\"implicit\");\n\nexport default function ordinal() {\n var index = new InternMap(),\n domain = [],\n range = [],\n unknown = implicit;\n\n function scale(d) {\n let i = index.get(d);\n if (i === undefined) {\n if (unknown !== implicit) return unknown;\n index.set(d, i = domain.push(d) - 1);\n }\n return range[i % range.length];\n }\n\n scale.domain = function(_) {\n if (!arguments.length) return domain.slice();\n domain = [], index = new InternMap();\n for (const value of _) {\n if (index.has(value)) continue;\n index.set(value, domain.push(value) - 1);\n }\n return scale;\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), scale) : range.slice();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return ordinal(domain, range).unknown(unknown);\n };\n\n initRange.apply(scale, arguments);\n\n return scale;\n}\n", "import {range as sequence} from \"d3-array\";\nimport {initRange} from \"./init.js\";\nimport ordinal from \"./ordinal.js\";\n\nexport default function band() {\n var scale = ordinal().unknown(undefined),\n domain = scale.domain,\n ordinalRange = scale.range,\n r0 = 0,\n r1 = 1,\n step,\n bandwidth,\n round = false,\n paddingInner = 0,\n paddingOuter = 0,\n align = 0.5;\n\n delete scale.unknown;\n\n function rescale() {\n var n = domain().length,\n reverse = r1 < r0,\n start = reverse ? r1 : r0,\n stop = reverse ? r0 : r1;\n step = (stop - start) / Math.max(1, n - paddingInner + paddingOuter * 2);\n if (round) step = Math.floor(step);\n start += (stop - start - step * (n - paddingInner)) * align;\n bandwidth = step * (1 - paddingInner);\n if (round) start = Math.round(start), bandwidth = Math.round(bandwidth);\n var values = sequence(n).map(function(i) { return start + step * i; });\n return ordinalRange(reverse ? values.reverse() : values);\n }\n\n scale.domain = function(_) {\n return arguments.length ? (domain(_), rescale()) : domain();\n };\n\n scale.range = function(_) {\n return arguments.length ? ([r0, r1] = _, r0 = +r0, r1 = +r1, rescale()) : [r0, r1];\n };\n\n scale.rangeRound = function(_) {\n return [r0, r1] = _, r0 = +r0, r1 = +r1, round = true, rescale();\n };\n\n scale.bandwidth = function() {\n return bandwidth;\n };\n\n scale.step = function() {\n return step;\n };\n\n scale.round = function(_) {\n return arguments.length ? (round = !!_, rescale()) : round;\n };\n\n scale.padding = function(_) {\n return arguments.length ? (paddingInner = Math.min(1, paddingOuter = +_), rescale()) : paddingInner;\n };\n\n scale.paddingInner = function(_) {\n return arguments.length ? (paddingInner = Math.min(1, _), rescale()) : paddingInner;\n };\n\n scale.paddingOuter = function(_) {\n return arguments.length ? (paddingOuter = +_, rescale()) : paddingOuter;\n };\n\n scale.align = function(_) {\n return arguments.length ? (align = Math.max(0, Math.min(1, _)), rescale()) : align;\n };\n\n scale.copy = function() {\n return band(domain(), [r0, r1])\n .round(round)\n .paddingInner(paddingInner)\n .paddingOuter(paddingOuter)\n .align(align);\n };\n\n return initRange.apply(rescale(), arguments);\n}\n\nfunction pointish(scale) {\n var copy = scale.copy;\n\n scale.padding = scale.paddingOuter;\n delete scale.paddingInner;\n delete scale.paddingOuter;\n\n scale.copy = function() {\n return pointish(copy());\n };\n\n return scale;\n}\n\nexport function point() {\n return pointish(band.apply(null, arguments).paddingInner(1));\n}\n", "export default function constants(x) {\n return function() {\n return x;\n };\n}\n", "export default function number(x) {\n return +x;\n}\n", "import {bisect} from \"d3-array\";\nimport {interpolate as interpolateValue, interpolateNumber, interpolateRound} from \"d3-interpolate\";\nimport constant from \"./constant.js\";\nimport number from \"./number.js\";\n\nvar unit = [0, 1];\n\nexport function identity(x) {\n return x;\n}\n\nfunction normalize(a, b) {\n return (b -= (a = +a))\n ? function(x) { return (x - a) / b; }\n : constant(isNaN(b) ? NaN : 0.5);\n}\n\nfunction clamper(a, b) {\n var t;\n if (a > b) t = a, a = b, b = t;\n return function(x) { return Math.max(a, Math.min(b, x)); };\n}\n\n// normalize(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1].\n// interpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding range value x in [a,b].\nfunction bimap(domain, range, interpolate) {\n var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1];\n if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0);\n else d0 = normalize(d0, d1), r0 = interpolate(r0, r1);\n return function(x) { return r0(d0(x)); };\n}\n\nfunction polymap(domain, range, interpolate) {\n var j = Math.min(domain.length, range.length) - 1,\n d = new Array(j),\n r = new Array(j),\n i = -1;\n\n // Reverse descending domains.\n if (domain[j] < domain[0]) {\n domain = domain.slice().reverse();\n range = range.slice().reverse();\n }\n\n while (++i < j) {\n d[i] = normalize(domain[i], domain[i + 1]);\n r[i] = interpolate(range[i], range[i + 1]);\n }\n\n return function(x) {\n var i = bisect(domain, x, 1, j) - 1;\n return r[i](d[i](x));\n };\n}\n\nexport function copy(source, target) {\n return target\n .domain(source.domain())\n .range(source.range())\n .interpolate(source.interpolate())\n .clamp(source.clamp())\n .unknown(source.unknown());\n}\n\nexport function transformer() {\n var domain = unit,\n range = unit,\n interpolate = interpolateValue,\n transform,\n untransform,\n unknown,\n clamp = identity,\n piecewise,\n output,\n input;\n\n function rescale() {\n var n = Math.min(domain.length, range.length);\n if (clamp !== identity) clamp = clamper(domain[0], domain[n - 1]);\n piecewise = n > 2 ? polymap : bimap;\n output = input = null;\n return scale;\n }\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : (output || (output = piecewise(domain.map(transform), range, interpolate)))(transform(clamp(x)));\n }\n\n scale.invert = function(y) {\n return clamp(untransform((input || (input = piecewise(range, domain.map(transform), interpolateNumber)))(y)));\n };\n\n scale.domain = function(_) {\n return arguments.length ? (domain = Array.from(_, number), rescale()) : domain.slice();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), rescale()) : range.slice();\n };\n\n scale.rangeRound = function(_) {\n return range = Array.from(_), interpolate = interpolateRound, rescale();\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = _ ? true : identity, rescale()) : clamp !== identity;\n };\n\n scale.interpolate = function(_) {\n return arguments.length ? (interpolate = _, rescale()) : interpolate;\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n return function(t, u) {\n transform = t, untransform = u;\n return rescale();\n };\n}\n\nexport default function continuous() {\n return transformer()(identity, identity);\n}\n", "import {tickStep} from \"d3-array\";\nimport {format, formatPrefix, formatSpecifier, precisionFixed, precisionPrefix, precisionRound} from \"d3-format\";\n\nexport default function tickFormat(start, stop, count, specifier) {\n var step = tickStep(start, stop, count),\n precision;\n specifier = formatSpecifier(specifier == null ? \",f\" : specifier);\n switch (specifier.type) {\n case \"s\": {\n var value = Math.max(Math.abs(start), Math.abs(stop));\n if (specifier.precision == null && !isNaN(precision = precisionPrefix(step, value))) specifier.precision = precision;\n return formatPrefix(specifier, value);\n }\n case \"\":\n case \"e\":\n case \"g\":\n case \"p\":\n case \"r\": {\n if (specifier.precision == null && !isNaN(precision = precisionRound(step, Math.max(Math.abs(start), Math.abs(stop))))) specifier.precision = precision - (specifier.type === \"e\");\n break;\n }\n case \"f\":\n case \"%\": {\n if (specifier.precision == null && !isNaN(precision = precisionFixed(step))) specifier.precision = precision - (specifier.type === \"%\") * 2;\n break;\n }\n }\n return format(specifier);\n}\n", "import {ticks, tickIncrement} from \"d3-array\";\nimport continuous, {copy} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\nimport tickFormat from \"./tickFormat.js\";\n\nexport function linearish(scale) {\n var domain = scale.domain;\n\n scale.ticks = function(count) {\n var d = domain();\n return ticks(d[0], d[d.length - 1], count == null ? 10 : count);\n };\n\n scale.tickFormat = function(count, specifier) {\n var d = domain();\n return tickFormat(d[0], d[d.length - 1], count == null ? 10 : count, specifier);\n };\n\n scale.nice = function(count) {\n if (count == null) count = 10;\n\n var d = domain();\n var i0 = 0;\n var i1 = d.length - 1;\n var start = d[i0];\n var stop = d[i1];\n var prestep;\n var step;\n var maxIter = 10;\n\n if (stop < start) {\n step = start, start = stop, stop = step;\n step = i0, i0 = i1, i1 = step;\n }\n \n while (maxIter-- > 0) {\n step = tickIncrement(start, stop, count);\n if (step === prestep) {\n d[i0] = start\n d[i1] = stop\n return domain(d);\n } else if (step > 0) {\n start = Math.floor(start / step) * step;\n stop = Math.ceil(stop / step) * step;\n } else if (step < 0) {\n start = Math.ceil(start * step) / step;\n stop = Math.floor(stop * step) / step;\n } else {\n break;\n }\n prestep = step;\n }\n\n return scale;\n };\n\n return scale;\n}\n\nexport default function linear() {\n var scale = continuous();\n\n scale.copy = function() {\n return copy(scale, linear());\n };\n\n initRange.apply(scale, arguments);\n\n return linearish(scale);\n}\n", "import {linearish} from \"./linear.js\";\nimport number from \"./number.js\";\n\nexport default function identity(domain) {\n var unknown;\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : x;\n }\n\n scale.invert = scale;\n\n scale.domain = scale.range = function(_) {\n return arguments.length ? (domain = Array.from(_, number), scale) : domain.slice();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return identity(domain).unknown(unknown);\n };\n\n domain = arguments.length ? Array.from(domain, number) : [0, 1];\n\n return linearish(scale);\n}\n", "export default function nice(domain, interval) {\n domain = domain.slice();\n\n var i0 = 0,\n i1 = domain.length - 1,\n x0 = domain[i0],\n x1 = domain[i1],\n t;\n\n if (x1 < x0) {\n t = i0, i0 = i1, i1 = t;\n t = x0, x0 = x1, x1 = t;\n }\n\n domain[i0] = interval.floor(x0);\n domain[i1] = interval.ceil(x1);\n return domain;\n}\n", "import {ticks} from \"d3-array\";\nimport {format, formatSpecifier} from \"d3-format\";\nimport nice from \"./nice.js\";\nimport {copy, transformer} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\n\nfunction transformLog(x) {\n return Math.log(x);\n}\n\nfunction transformExp(x) {\n return Math.exp(x);\n}\n\nfunction transformLogn(x) {\n return -Math.log(-x);\n}\n\nfunction transformExpn(x) {\n return -Math.exp(-x);\n}\n\nfunction pow10(x) {\n return isFinite(x) ? +(\"1e\" + x) : x < 0 ? 0 : x;\n}\n\nfunction powp(base) {\n return base === 10 ? pow10\n : base === Math.E ? Math.exp\n : x => Math.pow(base, x);\n}\n\nfunction logp(base) {\n return base === Math.E ? Math.log\n : base === 10 && Math.log10\n || base === 2 && Math.log2\n || (base = Math.log(base), x => Math.log(x) / base);\n}\n\nfunction reflect(f) {\n return (x, k) => -f(-x, k);\n}\n\nexport function loggish(transform) {\n const scale = transform(transformLog, transformExp);\n const domain = scale.domain;\n let base = 10;\n let logs;\n let pows;\n\n function rescale() {\n logs = logp(base), pows = powp(base);\n if (domain()[0] < 0) {\n logs = reflect(logs), pows = reflect(pows);\n transform(transformLogn, transformExpn);\n } else {\n transform(transformLog, transformExp);\n }\n return scale;\n }\n\n scale.base = function(_) {\n return arguments.length ? (base = +_, rescale()) : base;\n };\n\n scale.domain = function(_) {\n return arguments.length ? (domain(_), rescale()) : domain();\n };\n\n scale.ticks = count => {\n const d = domain();\n let u = d[0];\n let v = d[d.length - 1];\n const r = v < u;\n\n if (r) ([u, v] = [v, u]);\n\n let i = logs(u);\n let j = logs(v);\n let k;\n let t;\n const n = count == null ? 10 : +count;\n let z = [];\n\n if (!(base % 1) && j - i < n) {\n i = Math.floor(i), j = Math.ceil(j);\n if (u > 0) for (; i <= j; ++i) {\n for (k = 1; k < base; ++k) {\n t = i < 0 ? k / pows(-i) : k * pows(i);\n if (t < u) continue;\n if (t > v) break;\n z.push(t);\n }\n } else for (; i <= j; ++i) {\n for (k = base - 1; k >= 1; --k) {\n t = i > 0 ? k / pows(-i) : k * pows(i);\n if (t < u) continue;\n if (t > v) break;\n z.push(t);\n }\n }\n if (z.length * 2 < n) z = ticks(u, v, n);\n } else {\n z = ticks(i, j, Math.min(j - i, n)).map(pows);\n }\n return r ? z.reverse() : z;\n };\n\n scale.tickFormat = (count, specifier) => {\n if (count == null) count = 10;\n if (specifier == null) specifier = base === 10 ? \"s\" : \",\";\n if (typeof specifier !== \"function\") {\n if (!(base % 1) && (specifier = formatSpecifier(specifier)).precision == null) specifier.trim = true;\n specifier = format(specifier);\n }\n if (count === Infinity) return specifier;\n const k = Math.max(1, base * count / scale.ticks().length); // TODO fast estimate?\n return d => {\n let i = d / pows(Math.round(logs(d)));\n if (i * base < base - 0.5) i *= base;\n return i <= k ? specifier(d) : \"\";\n };\n };\n\n scale.nice = () => {\n return domain(nice(domain(), {\n floor: x => pows(Math.floor(logs(x))),\n ceil: x => pows(Math.ceil(logs(x)))\n }));\n };\n\n return scale;\n}\n\nexport default function log() {\n const scale = loggish(transformer()).domain([1, 10]);\n scale.copy = () => copy(scale, log()).base(scale.base());\n initRange.apply(scale, arguments);\n return scale;\n}\n", "import {linearish} from \"./linear.js\";\nimport {copy, transformer} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\n\nfunction transformSymlog(c) {\n return function(x) {\n return Math.sign(x) * Math.log1p(Math.abs(x / c));\n };\n}\n\nfunction transformSymexp(c) {\n return function(x) {\n return Math.sign(x) * Math.expm1(Math.abs(x)) * c;\n };\n}\n\nexport function symlogish(transform) {\n var c = 1, scale = transform(transformSymlog(c), transformSymexp(c));\n\n scale.constant = function(_) {\n return arguments.length ? transform(transformSymlog(c = +_), transformSymexp(c)) : c;\n };\n\n return linearish(scale);\n}\n\nexport default function symlog() {\n var scale = symlogish(transformer());\n\n scale.copy = function() {\n return copy(scale, symlog()).constant(scale.constant());\n };\n\n return initRange.apply(scale, arguments);\n}\n", "import {linearish} from \"./linear.js\";\nimport {copy, identity, transformer} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\n\nfunction transformPow(exponent) {\n return function(x) {\n return x < 0 ? -Math.pow(-x, exponent) : Math.pow(x, exponent);\n };\n}\n\nfunction transformSqrt(x) {\n return x < 0 ? -Math.sqrt(-x) : Math.sqrt(x);\n}\n\nfunction transformSquare(x) {\n return x < 0 ? -x * x : x * x;\n}\n\nexport function powish(transform) {\n var scale = transform(identity, identity),\n exponent = 1;\n\n function rescale() {\n return exponent === 1 ? transform(identity, identity)\n : exponent === 0.5 ? transform(transformSqrt, transformSquare)\n : transform(transformPow(exponent), transformPow(1 / exponent));\n }\n\n scale.exponent = function(_) {\n return arguments.length ? (exponent = +_, rescale()) : exponent;\n };\n\n return linearish(scale);\n}\n\nexport default function pow() {\n var scale = powish(transformer());\n\n scale.copy = function() {\n return copy(scale, pow()).exponent(scale.exponent());\n };\n\n initRange.apply(scale, arguments);\n\n return scale;\n}\n\nexport function sqrt() {\n return pow.apply(null, arguments).exponent(0.5);\n}\n", "import {ascending, bisect, quantileSorted as threshold} from \"d3-array\";\nimport {initRange} from \"./init.js\";\n\nexport default function quantile() {\n var domain = [],\n range = [],\n thresholds = [],\n unknown;\n\n function rescale() {\n var i = 0, n = Math.max(1, range.length);\n thresholds = new Array(n - 1);\n while (++i < n) thresholds[i - 1] = threshold(domain, i / n);\n return scale;\n }\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : range[bisect(thresholds, x)];\n }\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return i < 0 ? [NaN, NaN] : [\n i > 0 ? thresholds[i - 1] : domain[0],\n i < thresholds.length ? thresholds[i] : domain[domain.length - 1]\n ];\n };\n\n scale.domain = function(_) {\n if (!arguments.length) return domain.slice();\n domain = [];\n for (let d of _) if (d != null && !isNaN(d = +d)) domain.push(d);\n domain.sort(ascending);\n return rescale();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), rescale()) : range.slice();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.quantiles = function() {\n return thresholds.slice();\n };\n\n scale.copy = function() {\n return quantile()\n .domain(domain)\n .range(range)\n .unknown(unknown);\n };\n\n return initRange.apply(scale, arguments);\n}\n", "import {bisect} from \"d3-array\";\nimport {initRange} from \"./init.js\";\n\nexport default function threshold() {\n var domain = [0.5],\n range = [0, 1],\n unknown,\n n = 1;\n\n function scale(x) {\n return x != null && x <= x ? range[bisect(domain, x, 0, n)] : unknown;\n }\n\n scale.domain = function(_) {\n return arguments.length ? (domain = Array.from(_), n = Math.min(domain.length, range.length - 1), scale) : domain.slice();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), n = Math.min(domain.length, range.length - 1), scale) : range.slice();\n };\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return [domain[i - 1], domain[i]];\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return threshold()\n .domain(domain)\n .range(range)\n .unknown(unknown);\n };\n\n return initRange.apply(scale, arguments);\n}\n", "const t0 = new Date, t1 = new Date;\n\nexport function timeInterval(floori, offseti, count, field) {\n\n function interval(date) {\n return floori(date = arguments.length === 0 ? new Date : new Date(+date)), date;\n }\n\n interval.floor = (date) => {\n return floori(date = new Date(+date)), date;\n };\n\n interval.ceil = (date) => {\n return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date;\n };\n\n interval.round = (date) => {\n const d0 = interval(date), d1 = interval.ceil(date);\n return date - d0 < d1 - date ? d0 : d1;\n };\n\n interval.offset = (date, step) => {\n return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;\n };\n\n interval.range = (start, stop, step) => {\n const range = [];\n start = interval.ceil(start);\n step = step == null ? 1 : Math.floor(step);\n if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date\n let previous;\n do range.push(previous = new Date(+start)), offseti(start, step), floori(start);\n while (previous < start && start < stop);\n return range;\n };\n\n interval.filter = (test) => {\n return timeInterval((date) => {\n if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1);\n }, (date, step) => {\n if (date >= date) {\n if (step < 0) while (++step <= 0) {\n while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty\n } else while (--step >= 0) {\n while (offseti(date, +1), !test(date)) {} // eslint-disable-line no-empty\n }\n }\n });\n };\n\n if (count) {\n interval.count = (start, end) => {\n t0.setTime(+start), t1.setTime(+end);\n floori(t0), floori(t1);\n return Math.floor(count(t0, t1));\n };\n\n interval.every = (step) => {\n step = Math.floor(step);\n return !isFinite(step) || !(step > 0) ? null\n : !(step > 1) ? interval\n : interval.filter(field\n ? (d) => field(d) % step === 0\n : (d) => interval.count(0, d) % step === 0);\n };\n }\n\n return interval;\n}\n", "import {timeInterval} from \"./interval.js\";\n\nexport const millisecond = timeInterval(() => {\n // noop\n}, (date, step) => {\n date.setTime(+date + step);\n}, (start, end) => {\n return end - start;\n});\n\n// An optimized implementation for this simple case.\nmillisecond.every = (k) => {\n k = Math.floor(k);\n if (!isFinite(k) || !(k > 0)) return null;\n if (!(k > 1)) return millisecond;\n return timeInterval((date) => {\n date.setTime(Math.floor(date / k) * k);\n }, (date, step) => {\n date.setTime(+date + step * k);\n }, (start, end) => {\n return (end - start) / k;\n });\n};\n\nexport const milliseconds = millisecond.range;\n", "import {timeInterval} from \"./interval.js\";\nimport {durationSecond} from \"./duration.js\";\n\nexport const second = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds());\n}, (date, step) => {\n date.setTime(+date + step * durationSecond);\n}, (start, end) => {\n return (end - start) / durationSecond;\n}, (date) => {\n return date.getUTCSeconds();\n});\n\nexport const seconds = second.range;\n", "import {timeInterval} from \"./interval.js\";\nimport {durationMinute, durationSecond} from \"./duration.js\";\n\nexport const timeMinute = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond);\n}, (date, step) => {\n date.setTime(+date + step * durationMinute);\n}, (start, end) => {\n return (end - start) / durationMinute;\n}, (date) => {\n return date.getMinutes();\n});\n\nexport const timeMinutes = timeMinute.range;\n\nexport const utcMinute = timeInterval((date) => {\n date.setUTCSeconds(0, 0);\n}, (date, step) => {\n date.setTime(+date + step * durationMinute);\n}, (start, end) => {\n return (end - start) / durationMinute;\n}, (date) => {\n return date.getUTCMinutes();\n});\n\nexport const utcMinutes = utcMinute.range;\n", "import {timeInterval} from \"./interval.js\";\nimport {durationHour, durationMinute, durationSecond} from \"./duration.js\";\n\nexport const timeHour = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond - date.getMinutes() * durationMinute);\n}, (date, step) => {\n date.setTime(+date + step * durationHour);\n}, (start, end) => {\n return (end - start) / durationHour;\n}, (date) => {\n return date.getHours();\n});\n\nexport const timeHours = timeHour.range;\n\nexport const utcHour = timeInterval((date) => {\n date.setUTCMinutes(0, 0, 0);\n}, (date, step) => {\n date.setTime(+date + step * durationHour);\n}, (start, end) => {\n return (end - start) / durationHour;\n}, (date) => {\n return date.getUTCHours();\n});\n\nexport const utcHours = utcHour.range;\n", "import {timeInterval} from \"./interval.js\";\nimport {durationDay, durationMinute} from \"./duration.js\";\n\nexport const timeDay = timeInterval(\n date => date.setHours(0, 0, 0, 0),\n (date, step) => date.setDate(date.getDate() + step),\n (start, end) => (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay,\n date => date.getDate() - 1\n);\n\nexport const timeDays = timeDay.range;\n\nexport const utcDay = timeInterval((date) => {\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step);\n}, (start, end) => {\n return (end - start) / durationDay;\n}, (date) => {\n return date.getUTCDate() - 1;\n});\n\nexport const utcDays = utcDay.range;\n\nexport const unixDay = timeInterval((date) => {\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step);\n}, (start, end) => {\n return (end - start) / durationDay;\n}, (date) => {\n return Math.floor(date / durationDay);\n});\n\nexport const unixDays = unixDay.range;\n", "import {timeInterval} from \"./interval.js\";\nimport {durationMinute, durationWeek} from \"./duration.js\";\n\nfunction timeWeekday(i) {\n return timeInterval((date) => {\n date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);\n date.setHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setDate(date.getDate() + step * 7);\n }, (start, end) => {\n return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;\n });\n}\n\nexport const timeSunday = timeWeekday(0);\nexport const timeMonday = timeWeekday(1);\nexport const timeTuesday = timeWeekday(2);\nexport const timeWednesday = timeWeekday(3);\nexport const timeThursday = timeWeekday(4);\nexport const timeFriday = timeWeekday(5);\nexport const timeSaturday = timeWeekday(6);\n\nexport const timeSundays = timeSunday.range;\nexport const timeMondays = timeMonday.range;\nexport const timeTuesdays = timeTuesday.range;\nexport const timeWednesdays = timeWednesday.range;\nexport const timeThursdays = timeThursday.range;\nexport const timeFridays = timeFriday.range;\nexport const timeSaturdays = timeSaturday.range;\n\nfunction utcWeekday(i) {\n return timeInterval((date) => {\n date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);\n date.setUTCHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step * 7);\n }, (start, end) => {\n return (end - start) / durationWeek;\n });\n}\n\nexport const utcSunday = utcWeekday(0);\nexport const utcMonday = utcWeekday(1);\nexport const utcTuesday = utcWeekday(2);\nexport const utcWednesday = utcWeekday(3);\nexport const utcThursday = utcWeekday(4);\nexport const utcFriday = utcWeekday(5);\nexport const utcSaturday = utcWeekday(6);\n\nexport const utcSundays = utcSunday.range;\nexport const utcMondays = utcMonday.range;\nexport const utcTuesdays = utcTuesday.range;\nexport const utcWednesdays = utcWednesday.range;\nexport const utcThursdays = utcThursday.range;\nexport const utcFridays = utcFriday.range;\nexport const utcSaturdays = utcSaturday.range;\n", "import {timeInterval} from \"./interval.js\";\n\nexport const timeMonth = timeInterval((date) => {\n date.setDate(1);\n date.setHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setMonth(date.getMonth() + step);\n}, (start, end) => {\n return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;\n}, (date) => {\n return date.getMonth();\n});\n\nexport const timeMonths = timeMonth.range;\n\nexport const utcMonth = timeInterval((date) => {\n date.setUTCDate(1);\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCMonth(date.getUTCMonth() + step);\n}, (start, end) => {\n return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;\n}, (date) => {\n return date.getUTCMonth();\n});\n\nexport const utcMonths = utcMonth.range;\n", "import {timeInterval} from \"./interval.js\";\n\nexport const timeYear = timeInterval((date) => {\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setFullYear(date.getFullYear() + step);\n}, (start, end) => {\n return end.getFullYear() - start.getFullYear();\n}, (date) => {\n return date.getFullYear();\n});\n\n// An optimized implementation for this simple case.\ntimeYear.every = (k) => {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date) => {\n date.setFullYear(Math.floor(date.getFullYear() / k) * k);\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setFullYear(date.getFullYear() + step * k);\n });\n};\n\nexport const timeYears = timeYear.range;\n\nexport const utcYear = timeInterval((date) => {\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCFullYear(date.getUTCFullYear() + step);\n}, (start, end) => {\n return end.getUTCFullYear() - start.getUTCFullYear();\n}, (date) => {\n return date.getUTCFullYear();\n});\n\n// An optimized implementation for this simple case.\nutcYear.every = (k) => {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date) => {\n date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k);\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setUTCFullYear(date.getUTCFullYear() + step * k);\n });\n};\n\nexport const utcYears = utcYear.range;\n", "import {bisector, tickStep} from \"d3-array\";\nimport {durationDay, durationHour, durationMinute, durationMonth, durationSecond, durationWeek, durationYear} from \"./duration.js\";\nimport {millisecond} from \"./millisecond.js\";\nimport {second} from \"./second.js\";\nimport {timeMinute, utcMinute} from \"./minute.js\";\nimport {timeHour, utcHour} from \"./hour.js\";\nimport {timeDay, unixDay} from \"./day.js\";\nimport {timeSunday, utcSunday} from \"./week.js\";\nimport {timeMonth, utcMonth} from \"./month.js\";\nimport {timeYear, utcYear} from \"./year.js\";\n\nfunction ticker(year, month, week, day, hour, minute) {\n\n const tickIntervals = [\n [second, 1, durationSecond],\n [second, 5, 5 * durationSecond],\n [second, 15, 15 * durationSecond],\n [second, 30, 30 * durationSecond],\n [minute, 1, durationMinute],\n [minute, 5, 5 * durationMinute],\n [minute, 15, 15 * durationMinute],\n [minute, 30, 30 * durationMinute],\n [ hour, 1, durationHour ],\n [ hour, 3, 3 * durationHour ],\n [ hour, 6, 6 * durationHour ],\n [ hour, 12, 12 * durationHour ],\n [ day, 1, durationDay ],\n [ day, 2, 2 * durationDay ],\n [ week, 1, durationWeek ],\n [ month, 1, durationMonth ],\n [ month, 3, 3 * durationMonth ],\n [ year, 1, durationYear ]\n ];\n\n function ticks(start, stop, count) {\n const reverse = stop < start;\n if (reverse) [start, stop] = [stop, start];\n const interval = count && typeof count.range === \"function\" ? count : tickInterval(start, stop, count);\n const ticks = interval ? interval.range(start, +stop + 1) : []; // inclusive stop\n return reverse ? ticks.reverse() : ticks;\n }\n\n function tickInterval(start, stop, count) {\n const target = Math.abs(stop - start) / count;\n const i = bisector(([,, step]) => step).right(tickIntervals, target);\n if (i === tickIntervals.length) return year.every(tickStep(start / durationYear, stop / durationYear, count));\n if (i === 0) return millisecond.every(Math.max(tickStep(start, stop, count), 1));\n const [t, step] = tickIntervals[target / tickIntervals[i - 1][2] < tickIntervals[i][2] / target ? i - 1 : i];\n return t.every(step);\n }\n\n return [ticks, tickInterval];\n}\n\nconst [utcTicks, utcTickInterval] = ticker(utcYear, utcMonth, utcSunday, unixDay, utcHour, utcMinute);\nconst [timeTicks, timeTickInterval] = ticker(timeYear, timeMonth, timeSunday, timeDay, timeHour, timeMinute);\n\nexport {utcTicks, utcTickInterval, timeTicks, timeTickInterval};\n", "import {\n timeDay,\n timeSunday,\n timeMonday,\n timeThursday,\n timeYear,\n utcDay,\n utcSunday,\n utcMonday,\n utcThursday,\n utcYear\n} from \"d3-time\";\n\nfunction localDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L);\n date.setFullYear(d.y);\n return date;\n }\n return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L);\n}\n\nfunction utcDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L));\n date.setUTCFullYear(d.y);\n return date;\n }\n return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L));\n}\n\nfunction newDate(y, m, d) {\n return {y: y, m: m, d: d, H: 0, M: 0, S: 0, L: 0};\n}\n\nexport default function formatLocale(locale) {\n var locale_dateTime = locale.dateTime,\n locale_date = locale.date,\n locale_time = locale.time,\n locale_periods = locale.periods,\n locale_weekdays = locale.days,\n locale_shortWeekdays = locale.shortDays,\n locale_months = locale.months,\n locale_shortMonths = locale.shortMonths;\n\n var periodRe = formatRe(locale_periods),\n periodLookup = formatLookup(locale_periods),\n weekdayRe = formatRe(locale_weekdays),\n weekdayLookup = formatLookup(locale_weekdays),\n shortWeekdayRe = formatRe(locale_shortWeekdays),\n shortWeekdayLookup = formatLookup(locale_shortWeekdays),\n monthRe = formatRe(locale_months),\n monthLookup = formatLookup(locale_months),\n shortMonthRe = formatRe(locale_shortMonths),\n shortMonthLookup = formatLookup(locale_shortMonths);\n\n var formats = {\n \"a\": formatShortWeekday,\n \"A\": formatWeekday,\n \"b\": formatShortMonth,\n \"B\": formatMonth,\n \"c\": null,\n \"d\": formatDayOfMonth,\n \"e\": formatDayOfMonth,\n \"f\": formatMicroseconds,\n \"g\": formatYearISO,\n \"G\": formatFullYearISO,\n \"H\": formatHour24,\n \"I\": formatHour12,\n \"j\": formatDayOfYear,\n \"L\": formatMilliseconds,\n \"m\": formatMonthNumber,\n \"M\": formatMinutes,\n \"p\": formatPeriod,\n \"q\": formatQuarter,\n \"Q\": formatUnixTimestamp,\n \"s\": formatUnixTimestampSeconds,\n \"S\": formatSeconds,\n \"u\": formatWeekdayNumberMonday,\n \"U\": formatWeekNumberSunday,\n \"V\": formatWeekNumberISO,\n \"w\": formatWeekdayNumberSunday,\n \"W\": formatWeekNumberMonday,\n \"x\": null,\n \"X\": null,\n \"y\": formatYear,\n \"Y\": formatFullYear,\n \"Z\": formatZone,\n \"%\": formatLiteralPercent\n };\n\n var utcFormats = {\n \"a\": formatUTCShortWeekday,\n \"A\": formatUTCWeekday,\n \"b\": formatUTCShortMonth,\n \"B\": formatUTCMonth,\n \"c\": null,\n \"d\": formatUTCDayOfMonth,\n \"e\": formatUTCDayOfMonth,\n \"f\": formatUTCMicroseconds,\n \"g\": formatUTCYearISO,\n \"G\": formatUTCFullYearISO,\n \"H\": formatUTCHour24,\n \"I\": formatUTCHour12,\n \"j\": formatUTCDayOfYear,\n \"L\": formatUTCMilliseconds,\n \"m\": formatUTCMonthNumber,\n \"M\": formatUTCMinutes,\n \"p\": formatUTCPeriod,\n \"q\": formatUTCQuarter,\n \"Q\": formatUnixTimestamp,\n \"s\": formatUnixTimestampSeconds,\n \"S\": formatUTCSeconds,\n \"u\": formatUTCWeekdayNumberMonday,\n \"U\": formatUTCWeekNumberSunday,\n \"V\": formatUTCWeekNumberISO,\n \"w\": formatUTCWeekdayNumberSunday,\n \"W\": formatUTCWeekNumberMonday,\n \"x\": null,\n \"X\": null,\n \"y\": formatUTCYear,\n \"Y\": formatUTCFullYear,\n \"Z\": formatUTCZone,\n \"%\": formatLiteralPercent\n };\n\n var parses = {\n \"a\": parseShortWeekday,\n \"A\": parseWeekday,\n \"b\": parseShortMonth,\n \"B\": parseMonth,\n \"c\": parseLocaleDateTime,\n \"d\": parseDayOfMonth,\n \"e\": parseDayOfMonth,\n \"f\": parseMicroseconds,\n \"g\": parseYear,\n \"G\": parseFullYear,\n \"H\": parseHour24,\n \"I\": parseHour24,\n \"j\": parseDayOfYear,\n \"L\": parseMilliseconds,\n \"m\": parseMonthNumber,\n \"M\": parseMinutes,\n \"p\": parsePeriod,\n \"q\": parseQuarter,\n \"Q\": parseUnixTimestamp,\n \"s\": parseUnixTimestampSeconds,\n \"S\": parseSeconds,\n \"u\": parseWeekdayNumberMonday,\n \"U\": parseWeekNumberSunday,\n \"V\": parseWeekNumberISO,\n \"w\": parseWeekdayNumberSunday,\n \"W\": parseWeekNumberMonday,\n \"x\": parseLocaleDate,\n \"X\": parseLocaleTime,\n \"y\": parseYear,\n \"Y\": parseFullYear,\n \"Z\": parseZone,\n \"%\": parseLiteralPercent\n };\n\n // These recursive directive definitions must be deferred.\n formats.x = newFormat(locale_date, formats);\n formats.X = newFormat(locale_time, formats);\n formats.c = newFormat(locale_dateTime, formats);\n utcFormats.x = newFormat(locale_date, utcFormats);\n utcFormats.X = newFormat(locale_time, utcFormats);\n utcFormats.c = newFormat(locale_dateTime, utcFormats);\n\n function newFormat(specifier, formats) {\n return function(date) {\n var string = [],\n i = -1,\n j = 0,\n n = specifier.length,\n c,\n pad,\n format;\n\n if (!(date instanceof Date)) date = new Date(+date);\n\n while (++i < n) {\n if (specifier.charCodeAt(i) === 37) {\n string.push(specifier.slice(j, i));\n if ((pad = pads[c = specifier.charAt(++i)]) != null) c = specifier.charAt(++i);\n else pad = c === \"e\" ? \" \" : \"0\";\n if (format = formats[c]) c = format(date, pad);\n string.push(c);\n j = i + 1;\n }\n }\n\n string.push(specifier.slice(j, i));\n return string.join(\"\");\n };\n }\n\n function newParse(specifier, Z) {\n return function(string) {\n var d = newDate(1900, undefined, 1),\n i = parseSpecifier(d, specifier, string += \"\", 0),\n week, day;\n if (i != string.length) return null;\n\n // If a UNIX timestamp is specified, return it.\n if (\"Q\" in d) return new Date(d.Q);\n if (\"s\" in d) return new Date(d.s * 1000 + (\"L\" in d ? d.L : 0));\n\n // If this is utcParse, never use the local timezone.\n if (Z && !(\"Z\" in d)) d.Z = 0;\n\n // The am-pm flag is 0 for AM, and 1 for PM.\n if (\"p\" in d) d.H = d.H % 12 + d.p * 12;\n\n // If the month was not specified, inherit from the quarter.\n if (d.m === undefined) d.m = \"q\" in d ? d.q : 0;\n\n // Convert day-of-week and week-of-year to day-of-year.\n if (\"V\" in d) {\n if (d.V < 1 || d.V > 53) return null;\n if (!(\"w\" in d)) d.w = 1;\n if (\"Z\" in d) {\n week = utcDate(newDate(d.y, 0, 1)), day = week.getUTCDay();\n week = day > 4 || day === 0 ? utcMonday.ceil(week) : utcMonday(week);\n week = utcDay.offset(week, (d.V - 1) * 7);\n d.y = week.getUTCFullYear();\n d.m = week.getUTCMonth();\n d.d = week.getUTCDate() + (d.w + 6) % 7;\n } else {\n week = localDate(newDate(d.y, 0, 1)), day = week.getDay();\n week = day > 4 || day === 0 ? timeMonday.ceil(week) : timeMonday(week);\n week = timeDay.offset(week, (d.V - 1) * 7);\n d.y = week.getFullYear();\n d.m = week.getMonth();\n d.d = week.getDate() + (d.w + 6) % 7;\n }\n } else if (\"W\" in d || \"U\" in d) {\n if (!(\"w\" in d)) d.w = \"u\" in d ? d.u % 7 : \"W\" in d ? 1 : 0;\n day = \"Z\" in d ? utcDate(newDate(d.y, 0, 1)).getUTCDay() : localDate(newDate(d.y, 0, 1)).getDay();\n d.m = 0;\n d.d = \"W\" in d ? (d.w + 6) % 7 + d.W * 7 - (day + 5) % 7 : d.w + d.U * 7 - (day + 6) % 7;\n }\n\n // If a time zone is specified, all fields are interpreted as UTC and then\n // offset according to the specified time zone.\n if (\"Z\" in d) {\n d.H += d.Z / 100 | 0;\n d.M += d.Z % 100;\n return utcDate(d);\n }\n\n // Otherwise, all fields are in local time.\n return localDate(d);\n };\n }\n\n function parseSpecifier(d, specifier, string, j) {\n var i = 0,\n n = specifier.length,\n m = string.length,\n c,\n parse;\n\n while (i < n) {\n if (j >= m) return -1;\n c = specifier.charCodeAt(i++);\n if (c === 37) {\n c = specifier.charAt(i++);\n parse = parses[c in pads ? specifier.charAt(i++) : c];\n if (!parse || ((j = parse(d, string, j)) < 0)) return -1;\n } else if (c != string.charCodeAt(j++)) {\n return -1;\n }\n }\n\n return j;\n }\n\n function parsePeriod(d, string, i) {\n var n = periodRe.exec(string.slice(i));\n return n ? (d.p = periodLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseShortWeekday(d, string, i) {\n var n = shortWeekdayRe.exec(string.slice(i));\n return n ? (d.w = shortWeekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseWeekday(d, string, i) {\n var n = weekdayRe.exec(string.slice(i));\n return n ? (d.w = weekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseShortMonth(d, string, i) {\n var n = shortMonthRe.exec(string.slice(i));\n return n ? (d.m = shortMonthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseMonth(d, string, i) {\n var n = monthRe.exec(string.slice(i));\n return n ? (d.m = monthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseLocaleDateTime(d, string, i) {\n return parseSpecifier(d, locale_dateTime, string, i);\n }\n\n function parseLocaleDate(d, string, i) {\n return parseSpecifier(d, locale_date, string, i);\n }\n\n function parseLocaleTime(d, string, i) {\n return parseSpecifier(d, locale_time, string, i);\n }\n\n function formatShortWeekday(d) {\n return locale_shortWeekdays[d.getDay()];\n }\n\n function formatWeekday(d) {\n return locale_weekdays[d.getDay()];\n }\n\n function formatShortMonth(d) {\n return locale_shortMonths[d.getMonth()];\n }\n\n function formatMonth(d) {\n return locale_months[d.getMonth()];\n }\n\n function formatPeriod(d) {\n return locale_periods[+(d.getHours() >= 12)];\n }\n\n function formatQuarter(d) {\n return 1 + ~~(d.getMonth() / 3);\n }\n\n function formatUTCShortWeekday(d) {\n return locale_shortWeekdays[d.getUTCDay()];\n }\n\n function formatUTCWeekday(d) {\n return locale_weekdays[d.getUTCDay()];\n }\n\n function formatUTCShortMonth(d) {\n return locale_shortMonths[d.getUTCMonth()];\n }\n\n function formatUTCMonth(d) {\n return locale_months[d.getUTCMonth()];\n }\n\n function formatUTCPeriod(d) {\n return locale_periods[+(d.getUTCHours() >= 12)];\n }\n\n function formatUTCQuarter(d) {\n return 1 + ~~(d.getUTCMonth() / 3);\n }\n\n return {\n format: function(specifier) {\n var f = newFormat(specifier += \"\", formats);\n f.toString = function() { return specifier; };\n return f;\n },\n parse: function(specifier) {\n var p = newParse(specifier += \"\", false);\n p.toString = function() { return specifier; };\n return p;\n },\n utcFormat: function(specifier) {\n var f = newFormat(specifier += \"\", utcFormats);\n f.toString = function() { return specifier; };\n return f;\n },\n utcParse: function(specifier) {\n var p = newParse(specifier += \"\", true);\n p.toString = function() { return specifier; };\n return p;\n }\n };\n}\n\nvar pads = {\"-\": \"\", \"_\": \" \", \"0\": \"0\"},\n numberRe = /^\\s*\\d+/, // note: ignores next directive\n percentRe = /^%/,\n requoteRe = /[\\\\^$*+?|[\\]().{}]/g;\n\nfunction pad(value, fill, width) {\n var sign = value < 0 ? \"-\" : \"\",\n string = (sign ? -value : value) + \"\",\n length = string.length;\n return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string);\n}\n\nfunction requote(s) {\n return s.replace(requoteRe, \"\\\\$&\");\n}\n\nfunction formatRe(names) {\n return new RegExp(\"^(?:\" + names.map(requote).join(\"|\") + \")\", \"i\");\n}\n\nfunction formatLookup(names) {\n return new Map(names.map((name, i) => [name.toLowerCase(), i]));\n}\n\nfunction parseWeekdayNumberSunday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.w = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekdayNumberMonday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.u = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberSunday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.U = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberISO(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.V = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberMonday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.W = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseFullYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 4));\n return n ? (d.y = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2000), i + n[0].length) : -1;\n}\n\nfunction parseZone(d, string, i) {\n var n = /^(Z)|([+-]\\d\\d)(?::?(\\d\\d))?/.exec(string.slice(i, i + 6));\n return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || \"00\")), i + n[0].length) : -1;\n}\n\nfunction parseQuarter(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.q = n[0] * 3 - 3, i + n[0].length) : -1;\n}\n\nfunction parseMonthNumber(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.m = n[0] - 1, i + n[0].length) : -1;\n}\n\nfunction parseDayOfMonth(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.d = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseDayOfYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.m = 0, d.d = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseHour24(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.H = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMinutes(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.M = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseSeconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.S = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMilliseconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.L = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMicroseconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 6));\n return n ? (d.L = Math.floor(n[0] / 1000), i + n[0].length) : -1;\n}\n\nfunction parseLiteralPercent(d, string, i) {\n var n = percentRe.exec(string.slice(i, i + 1));\n return n ? i + n[0].length : -1;\n}\n\nfunction parseUnixTimestamp(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.Q = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseUnixTimestampSeconds(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.s = +n[0], i + n[0].length) : -1;\n}\n\nfunction formatDayOfMonth(d, p) {\n return pad(d.getDate(), p, 2);\n}\n\nfunction formatHour24(d, p) {\n return pad(d.getHours(), p, 2);\n}\n\nfunction formatHour12(d, p) {\n return pad(d.getHours() % 12 || 12, p, 2);\n}\n\nfunction formatDayOfYear(d, p) {\n return pad(1 + timeDay.count(timeYear(d), d), p, 3);\n}\n\nfunction formatMilliseconds(d, p) {\n return pad(d.getMilliseconds(), p, 3);\n}\n\nfunction formatMicroseconds(d, p) {\n return formatMilliseconds(d, p) + \"000\";\n}\n\nfunction formatMonthNumber(d, p) {\n return pad(d.getMonth() + 1, p, 2);\n}\n\nfunction formatMinutes(d, p) {\n return pad(d.getMinutes(), p, 2);\n}\n\nfunction formatSeconds(d, p) {\n return pad(d.getSeconds(), p, 2);\n}\n\nfunction formatWeekdayNumberMonday(d) {\n var day = d.getDay();\n return day === 0 ? 7 : day;\n}\n\nfunction formatWeekNumberSunday(d, p) {\n return pad(timeSunday.count(timeYear(d) - 1, d), p, 2);\n}\n\nfunction dISO(d) {\n var day = d.getDay();\n return (day >= 4 || day === 0) ? timeThursday(d) : timeThursday.ceil(d);\n}\n\nfunction formatWeekNumberISO(d, p) {\n d = dISO(d);\n return pad(timeThursday.count(timeYear(d), d) + (timeYear(d).getDay() === 4), p, 2);\n}\n\nfunction formatWeekdayNumberSunday(d) {\n return d.getDay();\n}\n\nfunction formatWeekNumberMonday(d, p) {\n return pad(timeMonday.count(timeYear(d) - 1, d), p, 2);\n}\n\nfunction formatYear(d, p) {\n return pad(d.getFullYear() % 100, p, 2);\n}\n\nfunction formatYearISO(d, p) {\n d = dISO(d);\n return pad(d.getFullYear() % 100, p, 2);\n}\n\nfunction formatFullYear(d, p) {\n return pad(d.getFullYear() % 10000, p, 4);\n}\n\nfunction formatFullYearISO(d, p) {\n var day = d.getDay();\n d = (day >= 4 || day === 0) ? timeThursday(d) : timeThursday.ceil(d);\n return pad(d.getFullYear() % 10000, p, 4);\n}\n\nfunction formatZone(d) {\n var z = d.getTimezoneOffset();\n return (z > 0 ? \"-\" : (z *= -1, \"+\"))\n + pad(z / 60 | 0, \"0\", 2)\n + pad(z % 60, \"0\", 2);\n}\n\nfunction formatUTCDayOfMonth(d, p) {\n return pad(d.getUTCDate(), p, 2);\n}\n\nfunction formatUTCHour24(d, p) {\n return pad(d.getUTCHours(), p, 2);\n}\n\nfunction formatUTCHour12(d, p) {\n return pad(d.getUTCHours() % 12 || 12, p, 2);\n}\n\nfunction formatUTCDayOfYear(d, p) {\n return pad(1 + utcDay.count(utcYear(d), d), p, 3);\n}\n\nfunction formatUTCMilliseconds(d, p) {\n return pad(d.getUTCMilliseconds(), p, 3);\n}\n\nfunction formatUTCMicroseconds(d, p) {\n return formatUTCMilliseconds(d, p) + \"000\";\n}\n\nfunction formatUTCMonthNumber(d, p) {\n return pad(d.getUTCMonth() + 1, p, 2);\n}\n\nfunction formatUTCMinutes(d, p) {\n return pad(d.getUTCMinutes(), p, 2);\n}\n\nfunction formatUTCSeconds(d, p) {\n return pad(d.getUTCSeconds(), p, 2);\n}\n\nfunction formatUTCWeekdayNumberMonday(d) {\n var dow = d.getUTCDay();\n return dow === 0 ? 7 : dow;\n}\n\nfunction formatUTCWeekNumberSunday(d, p) {\n return pad(utcSunday.count(utcYear(d) - 1, d), p, 2);\n}\n\nfunction UTCdISO(d) {\n var day = d.getUTCDay();\n return (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);\n}\n\nfunction formatUTCWeekNumberISO(d, p) {\n d = UTCdISO(d);\n return pad(utcThursday.count(utcYear(d), d) + (utcYear(d).getUTCDay() === 4), p, 2);\n}\n\nfunction formatUTCWeekdayNumberSunday(d) {\n return d.getUTCDay();\n}\n\nfunction formatUTCWeekNumberMonday(d, p) {\n return pad(utcMonday.count(utcYear(d) - 1, d), p, 2);\n}\n\nfunction formatUTCYear(d, p) {\n return pad(d.getUTCFullYear() % 100, p, 2);\n}\n\nfunction formatUTCYearISO(d, p) {\n d = UTCdISO(d);\n return pad(d.getUTCFullYear() % 100, p, 2);\n}\n\nfunction formatUTCFullYear(d, p) {\n return pad(d.getUTCFullYear() % 10000, p, 4);\n}\n\nfunction formatUTCFullYearISO(d, p) {\n var day = d.getUTCDay();\n d = (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);\n return pad(d.getUTCFullYear() % 10000, p, 4);\n}\n\nfunction formatUTCZone() {\n return \"+0000\";\n}\n\nfunction formatLiteralPercent() {\n return \"%\";\n}\n\nfunction formatUnixTimestamp(d) {\n return +d;\n}\n\nfunction formatUnixTimestampSeconds(d) {\n return Math.floor(+d / 1000);\n}\n", "import formatLocale from \"./locale.js\";\n\nvar locale;\nexport var timeFormat;\nexport var timeParse;\nexport var utcFormat;\nexport var utcParse;\n\ndefaultLocale({\n dateTime: \"%x, %X\",\n date: \"%-m/%-d/%Y\",\n time: \"%-I:%M:%S %p\",\n periods: [\"AM\", \"PM\"],\n days: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\n shortDays: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n months: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\n shortMonths: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"]\n});\n\nexport default function defaultLocale(definition) {\n locale = formatLocale(definition);\n timeFormat = locale.format;\n timeParse = locale.parse;\n utcFormat = locale.utcFormat;\n utcParse = locale.utcParse;\n return locale;\n}\n", "import {timeYear, timeMonth, timeWeek, timeDay, timeHour, timeMinute, timeSecond, timeTicks, timeTickInterval} from \"d3-time\";\nimport {timeFormat} from \"d3-time-format\";\nimport continuous, {copy} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\nimport nice from \"./nice.js\";\n\nfunction date(t) {\n return new Date(t);\n}\n\nfunction number(t) {\n return t instanceof Date ? +t : +new Date(+t);\n}\n\nexport function calendar(ticks, tickInterval, year, month, week, day, hour, minute, second, format) {\n var scale = continuous(),\n invert = scale.invert,\n domain = scale.domain;\n\n var formatMillisecond = format(\".%L\"),\n formatSecond = format(\":%S\"),\n formatMinute = format(\"%I:%M\"),\n formatHour = format(\"%I %p\"),\n formatDay = format(\"%a %d\"),\n formatWeek = format(\"%b %d\"),\n formatMonth = format(\"%B\"),\n formatYear = format(\"%Y\");\n\n function tickFormat(date) {\n return (second(date) < date ? formatMillisecond\n : minute(date) < date ? formatSecond\n : hour(date) < date ? formatMinute\n : day(date) < date ? formatHour\n : month(date) < date ? (week(date) < date ? formatDay : formatWeek)\n : year(date) < date ? formatMonth\n : formatYear)(date);\n }\n\n scale.invert = function(y) {\n return new Date(invert(y));\n };\n\n scale.domain = function(_) {\n return arguments.length ? domain(Array.from(_, number)) : domain().map(date);\n };\n\n scale.ticks = function(interval) {\n var d = domain();\n return ticks(d[0], d[d.length - 1], interval == null ? 10 : interval);\n };\n\n scale.tickFormat = function(count, specifier) {\n return specifier == null ? tickFormat : format(specifier);\n };\n\n scale.nice = function(interval) {\n var d = domain();\n if (!interval || typeof interval.range !== \"function\") interval = tickInterval(d[0], d[d.length - 1], interval == null ? 10 : interval);\n return interval ? domain(nice(d, interval)) : scale;\n };\n\n scale.copy = function() {\n return copy(scale, calendar(ticks, tickInterval, year, month, week, day, hour, minute, second, format));\n };\n\n return scale;\n}\n\nexport default function time() {\n return initRange.apply(calendar(timeTicks, timeTickInterval, timeYear, timeMonth, timeWeek, timeDay, timeHour, timeMinute, timeSecond, timeFormat).domain([new Date(2000, 0, 1), new Date(2000, 0, 2)]), arguments);\n}\n", "import {utcYear, utcMonth, utcWeek, utcDay, utcHour, utcMinute, utcSecond, utcTicks, utcTickInterval} from \"d3-time\";\nimport {utcFormat} from \"d3-time-format\";\nimport {calendar} from \"./time.js\";\nimport {initRange} from \"./init.js\";\n\nexport default function utcTime() {\n return initRange.apply(calendar(utcTicks, utcTickInterval, utcYear, utcMonth, utcWeek, utcDay, utcHour, utcMinute, utcSecond, utcFormat).domain([Date.UTC(2000, 0, 1), Date.UTC(2000, 0, 2)]), arguments);\n}\n", "import {interpolate, interpolateRound} from \"d3-interpolate\";\nimport {identity} from \"./continuous.js\";\nimport {initInterpolator} from \"./init.js\";\nimport {linearish} from \"./linear.js\";\nimport {loggish} from \"./log.js\";\nimport {symlogish} from \"./symlog.js\";\nimport {powish} from \"./pow.js\";\n\nfunction transformer() {\n var x0 = 0,\n x1 = 1,\n t0,\n t1,\n k10,\n transform,\n interpolator = identity,\n clamp = false,\n unknown;\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : interpolator(k10 === 0 ? 0.5 : (x = (transform(x) - t0) * k10, clamp ? Math.max(0, Math.min(1, x)) : x));\n }\n\n scale.domain = function(_) {\n return arguments.length ? ([x0, x1] = _, t0 = transform(x0 = +x0), t1 = transform(x1 = +x1), k10 = t0 === t1 ? 0 : 1 / (t1 - t0), scale) : [x0, x1];\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = !!_, scale) : clamp;\n };\n\n scale.interpolator = function(_) {\n return arguments.length ? (interpolator = _, scale) : interpolator;\n };\n\n function range(interpolate) {\n return function(_) {\n var r0, r1;\n return arguments.length ? ([r0, r1] = _, interpolator = interpolate(r0, r1), scale) : [interpolator(0), interpolator(1)];\n };\n }\n\n scale.range = range(interpolate);\n\n scale.rangeRound = range(interpolateRound);\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n return function(t) {\n transform = t, t0 = t(x0), t1 = t(x1), k10 = t0 === t1 ? 0 : 1 / (t1 - t0);\n return scale;\n };\n}\n\nexport function copy(source, target) {\n return target\n .domain(source.domain())\n .interpolator(source.interpolator())\n .clamp(source.clamp())\n .unknown(source.unknown());\n}\n\nexport default function sequential() {\n var scale = linearish(transformer()(identity));\n\n scale.copy = function() {\n return copy(scale, sequential());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function sequentialLog() {\n var scale = loggish(transformer()).domain([1, 10]);\n\n scale.copy = function() {\n return copy(scale, sequentialLog()).base(scale.base());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function sequentialSymlog() {\n var scale = symlogish(transformer());\n\n scale.copy = function() {\n return copy(scale, sequentialSymlog()).constant(scale.constant());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function sequentialPow() {\n var scale = powish(transformer());\n\n scale.copy = function() {\n return copy(scale, sequentialPow()).exponent(scale.exponent());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function sequentialSqrt() {\n return sequentialPow.apply(null, arguments).exponent(0.5);\n}\n", "import {interpolate, interpolateRound, piecewise} from \"d3-interpolate\";\nimport {identity} from \"./continuous.js\";\nimport {initInterpolator} from \"./init.js\";\nimport {linearish} from \"./linear.js\";\nimport {loggish} from \"./log.js\";\nimport {copy} from \"./sequential.js\";\nimport {symlogish} from \"./symlog.js\";\nimport {powish} from \"./pow.js\";\n\nfunction transformer() {\n var x0 = 0,\n x1 = 0.5,\n x2 = 1,\n s = 1,\n t0,\n t1,\n t2,\n k10,\n k21,\n interpolator = identity,\n transform,\n clamp = false,\n unknown;\n\n function scale(x) {\n return isNaN(x = +x) ? unknown : (x = 0.5 + ((x = +transform(x)) - t1) * (s * x < s * t1 ? k10 : k21), interpolator(clamp ? Math.max(0, Math.min(1, x)) : x));\n }\n\n scale.domain = function(_) {\n return arguments.length ? ([x0, x1, x2] = _, t0 = transform(x0 = +x0), t1 = transform(x1 = +x1), t2 = transform(x2 = +x2), k10 = t0 === t1 ? 0 : 0.5 / (t1 - t0), k21 = t1 === t2 ? 0 : 0.5 / (t2 - t1), s = t1 < t0 ? -1 : 1, scale) : [x0, x1, x2];\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = !!_, scale) : clamp;\n };\n\n scale.interpolator = function(_) {\n return arguments.length ? (interpolator = _, scale) : interpolator;\n };\n\n function range(interpolate) {\n return function(_) {\n var r0, r1, r2;\n return arguments.length ? ([r0, r1, r2] = _, interpolator = piecewise(interpolate, [r0, r1, r2]), scale) : [interpolator(0), interpolator(0.5), interpolator(1)];\n };\n }\n\n scale.range = range(interpolate);\n\n scale.rangeRound = range(interpolateRound);\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n return function(t) {\n transform = t, t0 = t(x0), t1 = t(x1), t2 = t(x2), k10 = t0 === t1 ? 0 : 0.5 / (t1 - t0), k21 = t1 === t2 ? 0 : 0.5 / (t2 - t1), s = t1 < t0 ? -1 : 1;\n return scale;\n };\n}\n\nexport default function diverging() {\n var scale = linearish(transformer()(identity));\n\n scale.copy = function() {\n return copy(scale, diverging());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function divergingLog() {\n var scale = loggish(transformer()).domain([0.1, 1, 10]);\n\n scale.copy = function() {\n return copy(scale, divergingLog()).base(scale.base());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function divergingSymlog() {\n var scale = symlogish(transformer());\n\n scale.copy = function() {\n return copy(scale, divergingSymlog()).constant(scale.constant());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function divergingPow() {\n var scale = powish(transformer());\n\n scale.copy = function() {\n return copy(scale, divergingPow()).exponent(scale.exponent());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function divergingSqrt() {\n return divergingPow.apply(null, arguments).exponent(0.5);\n}\n", "export default function(specifier) {\n var n = specifier.length / 6 | 0, colors = new Array(n), i = 0;\n while (i < n) colors[i] = \"#\" + specifier.slice(i * 6, ++i * 6);\n return colors;\n}\n", "import colors from \"../colors.js\";\n\nexport default colors(\"1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf\");\n", "import colors from \"../colors.js\";\n\nexport default colors(\"7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666\");\n", "import colors from \"../colors.js\";\n\nexport default colors(\"1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666\");\n", "import colors from \"../colors.js\";\n\nexport default colors(\"a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928\");\n", "import colors from \"../colors.js\";\n\nexport default colors(\"fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2\");\n", "import colors from \"../colors.js\";\n\nexport default colors(\"b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc\");\n", "import colors from \"../colors.js\";\n\nexport default colors(\"e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999\");\n", "import colors from \"../colors.js\";\n\nexport default colors(\"66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3\");\n", "import colors from \"../colors.js\";\n\nexport default colors(\"8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f\");\n", "import colors from \"../colors.js\";\n\nexport default colors(\"4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab\");\n", "import {interpolateRgbBasis} from \"d3-interpolate\";\n\nexport default scheme => interpolateRgbBasis(scheme[scheme.length - 1]);\n", "import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"d8b365f5f5f55ab4ac\",\n \"a6611adfc27d80cdc1018571\",\n \"a6611adfc27df5f5f580cdc1018571\",\n \"8c510ad8b365f6e8c3c7eae55ab4ac01665e\",\n \"8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e\",\n \"8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e\",\n \"8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e\",\n \"5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30\",\n \"5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30\"\n).map(colors);\n\nexport default ramp(scheme);\n", "import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"af8dc3f7f7f77fbf7b\",\n \"7b3294c2a5cfa6dba0008837\",\n \"7b3294c2a5cff7f7f7a6dba0008837\",\n \"762a83af8dc3e7d4e8d9f0d37fbf7b1b7837\",\n \"762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837\",\n \"762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837\",\n \"762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837\",\n \"40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b\",\n \"40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b\"\n).map(colors);\n\nexport default ramp(scheme);\n", "import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"e9a3c9f7f7f7a1d76a\",\n \"d01c8bf1b6dab8e1864dac26\",\n \"d01c8bf1b6daf7f7f7b8e1864dac26\",\n \"c51b7de9a3c9fde0efe6f5d0a1d76a4d9221\",\n \"c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221\",\n \"c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221\",\n \"c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221\",\n \"8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419\",\n \"8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419\"\n).map(colors);\n\nexport default ramp(scheme);\n", "import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"998ec3f7f7f7f1a340\",\n \"5e3c99b2abd2fdb863e66101\",\n \"5e3c99b2abd2f7f7f7fdb863e66101\",\n \"542788998ec3d8daebfee0b6f1a340b35806\",\n \"542788998ec3d8daebf7f7f7fee0b6f1a340b35806\",\n \"5427888073acb2abd2d8daebfee0b6fdb863e08214b35806\",\n \"5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806\",\n \"2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08\",\n \"2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08\"\n).map(colors);\n\nexport default ramp(scheme);\n", "import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"ef8a62f7f7f767a9cf\",\n \"ca0020f4a58292c5de0571b0\",\n \"ca0020f4a582f7f7f792c5de0571b0\",\n \"b2182bef8a62fddbc7d1e5f067a9cf2166ac\",\n \"b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac\",\n \"b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac\",\n \"b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac\",\n \"67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061\",\n \"67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061\"\n).map(colors);\n\nexport default ramp(scheme);\n", "import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"ef8a62ffffff999999\",\n \"ca0020f4a582bababa404040\",\n \"ca0020f4a582ffffffbababa404040\",\n \"b2182bef8a62fddbc7e0e0e09999994d4d4d\",\n \"b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d\",\n \"b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d\",\n \"b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d\",\n \"67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a\",\n \"67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a\"\n).map(colors);\n\nexport default ramp(scheme);\n", "import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"fc8d59ffffbf91bfdb\",\n \"d7191cfdae61abd9e92c7bb6\",\n \"d7191cfdae61ffffbfabd9e92c7bb6\",\n \"d73027fc8d59fee090e0f3f891bfdb4575b4\",\n \"d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4\",\n \"d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4\",\n \"d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4\",\n \"a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695\",\n \"a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695\"\n).map(colors);\n\nexport default ramp(scheme);\n", "import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"fc8d59ffffbf91cf60\",\n \"d7191cfdae61a6d96a1a9641\",\n \"d7191cfdae61ffffbfa6d96a1a9641\",\n \"d73027fc8d59fee08bd9ef8b91cf601a9850\",\n \"d73027fc8d59fee08bffffbfd9ef8b91cf601a9850\",\n \"d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850\",\n \"d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850\",\n \"a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837\",\n \"a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837\"\n).map(colors);\n\nexport default ramp(scheme);\n", "import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"fc8d59ffffbf99d594\",\n \"d7191cfdae61abdda42b83ba\",\n \"d7191cfdae61ffffbfabdda42b83ba\",\n \"d53e4ffc8d59fee08be6f59899d5943288bd\",\n \"d53e4ffc8d59fee08bffffbfe6f59899d5943288bd\",\n \"d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd\",\n \"d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd\",\n \"9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2\",\n \"9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2\"\n).map(colors);\n\nexport default ramp(scheme);\n", "import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"e5f5f999d8c92ca25f\",\n \"edf8fbb2e2e266c2a4238b45\",\n \"edf8fbb2e2e266c2a42ca25f006d2c\",\n \"edf8fbccece699d8c966c2a42ca25f006d2c\",\n \"edf8fbccece699d8c966c2a441ae76238b45005824\",\n \"f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824\",\n \"f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b\"\n).map(colors);\n\nexport default ramp(scheme);\n", "import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"e0ecf49ebcda8856a7\",\n \"edf8fbb3cde38c96c688419d\",\n \"edf8fbb3cde38c96c68856a7810f7c\",\n \"edf8fbbfd3e69ebcda8c96c68856a7810f7c\",\n \"edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b\",\n \"f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b\",\n \"f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b\"\n).map(colors);\n\nexport default ramp(scheme);\n", "import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"e0f3dba8ddb543a2ca\",\n \"f0f9e8bae4bc7bccc42b8cbe\",\n \"f0f9e8bae4bc7bccc443a2ca0868ac\",\n \"f0f9e8ccebc5a8ddb57bccc443a2ca0868ac\",\n \"f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e\",\n \"f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e\",\n \"f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081\"\n).map(colors);\n\nexport default ramp(scheme);\n", "import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"fee8c8fdbb84e34a33\",\n \"fef0d9fdcc8afc8d59d7301f\",\n \"fef0d9fdcc8afc8d59e34a33b30000\",\n \"fef0d9fdd49efdbb84fc8d59e34a33b30000\",\n \"fef0d9fdd49efdbb84fc8d59ef6548d7301f990000\",\n \"fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000\",\n \"fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000\"\n).map(colors);\n\nexport default ramp(scheme);\n", "import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"ece2f0a6bddb1c9099\",\n \"f6eff7bdc9e167a9cf02818a\",\n \"f6eff7bdc9e167a9cf1c9099016c59\",\n \"f6eff7d0d1e6a6bddb67a9cf1c9099016c59\",\n \"f6eff7d0d1e6a6bddb67a9cf3690c002818a016450\",\n \"fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450\",\n \"fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636\"\n).map(colors);\n\nexport default ramp(scheme);\n", "import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"ece7f2a6bddb2b8cbe\",\n \"f1eef6bdc9e174a9cf0570b0\",\n \"f1eef6bdc9e174a9cf2b8cbe045a8d\",\n \"f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d\",\n \"f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b\",\n \"fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b\",\n \"fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858\"\n).map(colors);\n\nexport default ramp(scheme);\n", "import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"e7e1efc994c7dd1c77\",\n \"f1eef6d7b5d8df65b0ce1256\",\n \"f1eef6d7b5d8df65b0dd1c77980043\",\n \"f1eef6d4b9dac994c7df65b0dd1c77980043\",\n \"f1eef6d4b9dac994c7df65b0e7298ace125691003f\",\n \"f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f\",\n \"f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f\"\n).map(colors);\n\nexport default ramp(scheme);\n", "import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"fde0ddfa9fb5c51b8a\",\n \"feebe2fbb4b9f768a1ae017e\",\n \"feebe2fbb4b9f768a1c51b8a7a0177\",\n \"feebe2fcc5c0fa9fb5f768a1c51b8a7a0177\",\n \"feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177\",\n \"fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177\",\n \"fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a\"\n).map(colors);\n\nexport default ramp(scheme);\n", "import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"edf8b17fcdbb2c7fb8\",\n \"ffffcca1dab441b6c4225ea8\",\n \"ffffcca1dab441b6c42c7fb8253494\",\n \"ffffccc7e9b47fcdbb41b6c42c7fb8253494\",\n \"ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84\",\n \"ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84\",\n \"ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58\"\n).map(colors);\n\nexport default ramp(scheme);\n", "import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"f7fcb9addd8e31a354\",\n \"ffffccc2e69978c679238443\",\n \"ffffccc2e69978c67931a354006837\",\n \"ffffccd9f0a3addd8e78c67931a354006837\",\n \"ffffccd9f0a3addd8e78c67941ab5d238443005a32\",\n \"ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32\",\n \"ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529\"\n).map(colors);\n\nexport default ramp(scheme);\n", "import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"fff7bcfec44fd95f0e\",\n \"ffffd4fed98efe9929cc4c02\",\n \"ffffd4fed98efe9929d95f0e993404\",\n \"ffffd4fee391fec44ffe9929d95f0e993404\",\n \"ffffd4fee391fec44ffe9929ec7014cc4c028c2d04\",\n \"ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04\",\n \"ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506\"\n).map(colors);\n\nexport default ramp(scheme);\n", "import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"ffeda0feb24cf03b20\",\n \"ffffb2fecc5cfd8d3ce31a1c\",\n \"ffffb2fecc5cfd8d3cf03b20bd0026\",\n \"ffffb2fed976feb24cfd8d3cf03b20bd0026\",\n \"ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026\",\n \"ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026\",\n \"ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026\"\n).map(colors);\n\nexport default ramp(scheme);\n", "import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"deebf79ecae13182bd\",\n \"eff3ffbdd7e76baed62171b5\",\n \"eff3ffbdd7e76baed63182bd08519c\",\n \"eff3ffc6dbef9ecae16baed63182bd08519c\",\n \"eff3ffc6dbef9ecae16baed64292c62171b5084594\",\n \"f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594\",\n \"f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b\"\n).map(colors);\n\nexport default ramp(scheme);\n", "import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"e5f5e0a1d99b31a354\",\n \"edf8e9bae4b374c476238b45\",\n \"edf8e9bae4b374c47631a354006d2c\",\n \"edf8e9c7e9c0a1d99b74c47631a354006d2c\",\n \"edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32\",\n \"f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32\",\n \"f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b\"\n).map(colors);\n\nexport default ramp(scheme);\n", "import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"f0f0f0bdbdbd636363\",\n \"f7f7f7cccccc969696525252\",\n \"f7f7f7cccccc969696636363252525\",\n \"f7f7f7d9d9d9bdbdbd969696636363252525\",\n \"f7f7f7d9d9d9bdbdbd969696737373525252252525\",\n \"fffffff0f0f0d9d9d9bdbdbd969696737373525252252525\",\n \"fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000\"\n).map(colors);\n\nexport default ramp(scheme);\n", "import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"efedf5bcbddc756bb1\",\n \"f2f0f7cbc9e29e9ac86a51a3\",\n \"f2f0f7cbc9e29e9ac8756bb154278f\",\n \"f2f0f7dadaebbcbddc9e9ac8756bb154278f\",\n \"f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486\",\n \"fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486\",\n \"fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d\"\n).map(colors);\n\nexport default ramp(scheme);\n", "import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"fee0d2fc9272de2d26\",\n \"fee5d9fcae91fb6a4acb181d\",\n \"fee5d9fcae91fb6a4ade2d26a50f15\",\n \"fee5d9fcbba1fc9272fb6a4ade2d26a50f15\",\n \"fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d\",\n \"fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d\",\n \"fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d\"\n).map(colors);\n\nexport default ramp(scheme);\n", "import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"fee6cefdae6be6550d\",\n \"feeddefdbe85fd8d3cd94701\",\n \"feeddefdbe85fd8d3ce6550da63603\",\n \"feeddefdd0a2fdae6bfd8d3ce6550da63603\",\n \"feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04\",\n \"fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04\",\n \"fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704\"\n).map(colors);\n\nexport default ramp(scheme);\n", "export default function(t) {\n t = Math.max(0, Math.min(1, t));\n return \"rgb(\"\n + Math.max(0, Math.min(255, Math.round(-4.54 - t * (35.34 - t * (2381.73 - t * (6402.7 - t * (7024.72 - t * 2710.57))))))) + \", \"\n + Math.max(0, Math.min(255, Math.round(32.49 + t * (170.73 + t * (52.82 - t * (131.46 - t * (176.58 - t * 67.37))))))) + \", \"\n + Math.max(0, Math.min(255, Math.round(81.24 + t * (442.36 - t * (2482.43 - t * (6167.24 - t * (6614.94 - t * 2475.67)))))))\n + \")\";\n}\n", "import {cubehelix} from \"d3-color\";\nimport {interpolateCubehelixLong} from \"d3-interpolate\";\n\nexport default interpolateCubehelixLong(cubehelix(300, 0.5, 0.0), cubehelix(-240, 0.5, 1.0));\n", "import {cubehelix} from \"d3-color\";\nimport {interpolateCubehelixLong} from \"d3-interpolate\";\n\nexport var warm = interpolateCubehelixLong(cubehelix(-100, 0.75, 0.35), cubehelix(80, 1.50, 0.8));\n\nexport var cool = interpolateCubehelixLong(cubehelix(260, 0.75, 0.35), cubehelix(80, 1.50, 0.8));\n\nvar c = cubehelix();\n\nexport default function(t) {\n if (t < 0 || t > 1) t -= Math.floor(t);\n var ts = Math.abs(t - 0.5);\n c.h = 360 * t - 100;\n c.s = 1.5 - 1.5 * ts;\n c.l = 0.8 - 0.9 * ts;\n return c + \"\";\n}\n", "import {rgb} from \"d3-color\";\n\nvar c = rgb(),\n pi_1_3 = Math.PI / 3,\n pi_2_3 = Math.PI * 2 / 3;\n\nexport default function(t) {\n var x;\n t = (0.5 - t) * Math.PI;\n c.r = 255 * (x = Math.sin(t)) * x;\n c.g = 255 * (x = Math.sin(t + pi_1_3)) * x;\n c.b = 255 * (x = Math.sin(t + pi_2_3)) * x;\n return c + \"\";\n}\n", "export default function(t) {\n t = Math.max(0, Math.min(1, t));\n return \"rgb(\"\n + Math.max(0, Math.min(255, Math.round(34.61 + t * (1172.33 - t * (10793.56 - t * (33300.12 - t * (38394.49 - t * 14825.05))))))) + \", \"\n + Math.max(0, Math.min(255, Math.round(23.31 + t * (557.33 + t * (1225.33 - t * (3574.96 - t * (1073.77 + t * 707.56))))))) + \", \"\n + Math.max(0, Math.min(255, Math.round(27.2 + t * (3211.1 - t * (15327.97 - t * (27814 - t * (22569.18 - t * 6838.66)))))))\n + \")\";\n}\n", "import colors from \"../colors.js\";\n\nfunction ramp(range) {\n var n = range.length;\n return function(t) {\n return range[Math.max(0, Math.min(n - 1, Math.floor(t * n)))];\n };\n}\n\nexport default ramp(colors(\"44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725\"));\n\nexport var magma = ramp(colors(\"00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf\"));\n\nexport var inferno = ramp(colors(\"00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4\"));\n\nexport var plasma = ramp(colors(\"0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921\"));\n", "export const abs = Math.abs;\nexport const atan2 = Math.atan2;\nexport const cos = Math.cos;\nexport const max = Math.max;\nexport const min = Math.min;\nexport const sin = Math.sin;\nexport const sqrt = Math.sqrt;\n\nexport const epsilon = 1e-12;\nexport const pi = Math.PI;\nexport const halfPi = pi / 2;\nexport const 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 {min, sqrt} from \"../math.js\";\n\nconst sqrt3 = sqrt(3);\n\nexport default {\n draw(context, size) {\n const r = sqrt(size + min(size / 28, 0.75)) * 0.59436;\n const t = r / 2;\n const u = t * sqrt3;\n context.moveTo(0, r);\n context.lineTo(0, -r);\n context.moveTo(-u, -t);\n context.lineTo(u, t);\n context.moveTo(-u, t);\n context.lineTo(u, -t);\n }\n};\n", "import {pi, sqrt, tau} from \"../math.js\";\n\nexport default {\n draw(context, size) {\n const r = sqrt(size / pi);\n context.moveTo(r, 0);\n context.arc(0, 0, r, 0, tau);\n }\n};\n", "import {sqrt} from \"../math.js\";\n\nexport default {\n draw(context, size) {\n const r = sqrt(size / 5) / 2;\n context.moveTo(-3 * r, -r);\n context.lineTo(-r, -r);\n context.lineTo(-r, -3 * r);\n context.lineTo(r, -3 * r);\n context.lineTo(r, -r);\n context.lineTo(3 * r, -r);\n context.lineTo(3 * r, r);\n context.lineTo(r, r);\n context.lineTo(r, 3 * r);\n context.lineTo(-r, 3 * r);\n context.lineTo(-r, r);\n context.lineTo(-3 * r, r);\n context.closePath();\n }\n};\n", "import {sqrt} from \"../math.js\";\n\nconst tan30 = sqrt(1 / 3);\nconst tan30_2 = tan30 * 2;\n\nexport default {\n draw(context, size) {\n const y = sqrt(size / tan30_2);\n const 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 {sqrt} from \"../math.js\";\n\nexport default {\n draw(context, size) {\n const r = sqrt(size) * 0.62625;\n context.moveTo(0, -r);\n context.lineTo(r, 0);\n context.lineTo(0, r);\n context.lineTo(-r, 0);\n context.closePath();\n }\n};\n", "import {min, sqrt} from \"../math.js\";\n\nexport default {\n draw(context, size) {\n const r = sqrt(size - min(size / 7, 2)) * 0.87559;\n context.moveTo(-r, 0);\n context.lineTo(r, 0);\n context.moveTo(0, r);\n context.lineTo(0, -r);\n }\n};\n", "import {sqrt} from \"../math.js\";\n\nexport default {\n draw(context, size) {\n const w = sqrt(size);\n const x = -w / 2;\n context.rect(x, x, w, w);\n }\n};\n", "import {sqrt} from \"../math.js\";\n\nexport default {\n draw(context, size) {\n const r = sqrt(size) * 0.4431;\n context.moveTo(r, r);\n context.lineTo(r, -r);\n context.lineTo(-r, -r);\n context.lineTo(-r, r);\n context.closePath();\n }\n};\n", "import {sin, cos, sqrt, pi, tau} from \"../math.js\";\n\nconst ka = 0.89081309152928522810;\nconst kr = sin(pi / 10) / sin(7 * pi / 10);\nconst kx = sin(tau / 10) * kr;\nconst ky = -cos(tau / 10) * kr;\n\nexport default {\n draw(context, size) {\n const r = sqrt(size * ka);\n const x = kx * r;\n const y = ky * r;\n context.moveTo(0, -r);\n context.lineTo(x, y);\n for (let i = 1; i < 5; ++i) {\n const a = tau * i / 5;\n const c = cos(a);\n const s = 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", "import {sqrt} from \"../math.js\";\n\nconst sqrt3 = sqrt(3);\n\nexport default {\n draw(context, size) {\n const y = -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", "import {sqrt} from \"../math.js\";\n\nconst sqrt3 = sqrt(3);\n\nexport default {\n draw(context, size) {\n const s = sqrt(size) * 0.6824;\n const t = s / 2;\n const u = (s * sqrt3) / 2; // cos(Math.PI / 6)\n context.moveTo(0, -s);\n context.lineTo(u, t);\n context.lineTo(-u, t);\n context.closePath();\n }\n};\n", "import {sqrt} from \"../math.js\";\n\nconst c = -0.5;\nconst s = sqrt(3) / 2;\nconst k = 1 / sqrt(12);\nconst a = (k / 2 + 1) * 3;\n\nexport default {\n draw(context, size) {\n const r = sqrt(size / a);\n const x0 = r / 2, y0 = r * k;\n const x1 = x0, y1 = r * k + r;\n const x2 = -x1, 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", "import {min, sqrt} from \"../math.js\";\n\nexport default {\n draw(context, size) {\n const r = sqrt(size - min(size / 6, 1.7)) * 0.6189;\n context.moveTo(-r, -r);\n context.lineTo(r, r);\n context.moveTo(-r, r);\n context.lineTo(r, -r);\n }\n};\n", "import constant from \"./constant.js\";\nimport {withPath} from \"./path.js\";\nimport asterisk from \"./symbol/asterisk.js\";\nimport circle from \"./symbol/circle.js\";\nimport cross from \"./symbol/cross.js\";\nimport diamond from \"./symbol/diamond.js\";\nimport diamond2 from \"./symbol/diamond2.js\";\nimport plus from \"./symbol/plus.js\";\nimport square from \"./symbol/square.js\";\nimport square2 from \"./symbol/square2.js\";\nimport star from \"./symbol/star.js\";\nimport triangle from \"./symbol/triangle.js\";\nimport triangle2 from \"./symbol/triangle2.js\";\nimport wye from \"./symbol/wye.js\";\nimport times from \"./symbol/times.js\";\n\n// These symbols are designed to be filled.\nexport const symbolsFill = [\n circle,\n cross,\n diamond,\n square,\n star,\n triangle,\n wye\n];\n\n// These symbols are designed to be stroked (with a width of 1.5px and round caps).\nexport const symbolsStroke = [\n circle,\n plus,\n times,\n triangle2,\n asterisk,\n square2,\n diamond2\n];\n\nexport default function Symbol(type, size) {\n let context = null,\n path = withPath(symbol);\n\n type = typeof type === \"function\" ? type : constant(type || circle);\n size = typeof size === \"function\" ? size : constant(size === undefined ? 64 : +size);\n\n function symbol() {\n let buffer;\n if (!context) context = buffer = path();\n type.apply(this, arguments).draw(context, +size.apply(this, arguments));\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n symbol.type = function(_) {\n return arguments.length ? (type = typeof _ === \"function\" ? _ : constant(_), symbol) : type;\n };\n\n symbol.size = function(_) {\n return arguments.length ? (size = typeof _ === \"function\" ? _ : constant(+_), symbol) : size;\n };\n\n symbol.context = function(_) {\n return arguments.length ? (context = _ == null ? null : _, symbol) : context;\n };\n\n return symbol;\n}\n", "export function Transform(k, x, y) {\n this.k = k;\n this.x = x;\n this.y = y;\n}\n\nTransform.prototype = {\n constructor: Transform,\n scale: function(k) {\n return k === 1 ? this : new Transform(this.k * k, this.x, this.y);\n },\n translate: function(x, y) {\n return x === 0 & y === 0 ? this : new Transform(this.k, this.x + this.k * x, this.y + this.k * y);\n },\n apply: function(point) {\n return [point[0] * this.k + this.x, point[1] * this.k + this.y];\n },\n applyX: function(x) {\n return x * this.k + this.x;\n },\n applyY: function(y) {\n return y * this.k + this.y;\n },\n invert: function(location) {\n return [(location[0] - this.x) / this.k, (location[1] - this.y) / this.k];\n },\n invertX: function(x) {\n return (x - this.x) / this.k;\n },\n invertY: function(y) {\n return (y - this.y) / this.k;\n },\n rescaleX: function(x) {\n return x.copy().domain(x.range().map(this.invertX, this).map(x.invert, x));\n },\n rescaleY: function(y) {\n return y.copy().domain(y.range().map(this.invertY, this).map(y.invert, y));\n },\n toString: function() {\n return \"translate(\" + this.x + \",\" + this.y + \") scale(\" + this.k + \")\";\n }\n};\n\nexport var identity = new Transform(1, 0, 0);\n\ntransform.prototype = Transform.prototype;\n\nexport default function transform(node) {\n while (!node.__zoom) if (!(node = node.parentNode)) return identity;\n return node.__zoom;\n}\n", "import {ascending, descending} from \"d3\";\n\nexport function defined(x) {\n return x != null && !Number.isNaN(x);\n}\n\nexport function ascendingDefined(a, b) {\n return +defined(b) - +defined(a) || ascending(a, b);\n}\n\nexport function descendingDefined(a, b) {\n return +defined(b) - +defined(a) || descending(a, b);\n}\n\nexport function nonempty(x) {\n return x != null && `${x}` !== \"\";\n}\n\nexport function finite(x) {\n return isFinite(x) ? x : NaN;\n}\n\nexport function positive(x) {\n return x > 0 && isFinite(x) ? x : NaN;\n}\n\nexport function negative(x) {\n return x < 0 && isFinite(x) ? x : NaN;\n}\n", "export default function format(date, fallback) {\n if (!(date instanceof Date)) date = new Date(+date);\n if (isNaN(date)) return typeof fallback === \"function\" ? fallback(date) : fallback;\n const hours = date.getUTCHours();\n const minutes = date.getUTCMinutes();\n const seconds = date.getUTCSeconds();\n const milliseconds = date.getUTCMilliseconds();\n return `${formatYear(date.getUTCFullYear(), 4)}-${pad(date.getUTCMonth() + 1, 2)}-${pad(date.getUTCDate(), 2)}${\n hours || minutes || seconds || milliseconds ? `T${pad(hours, 2)}:${pad(minutes, 2)}${\n seconds || milliseconds ? `:${pad(seconds, 2)}${\n milliseconds ? `.${pad(milliseconds, 3)}` : ``\n }` : ``\n }Z` : ``\n }`;\n}\n\nfunction formatYear(year) {\n return year < 0 ? `-${pad(-year, 6)}`\n : year > 9999 ? `+${pad(year, 6)}`\n : pad(year, 4);\n}\n\nfunction pad(value, width) {\n return `${value}`.padStart(width, \"0\");\n}\n", "const re = /^(?:[-+]\\d{2})?\\d{4}(?:-\\d{2}(?:-\\d{2})?)?(?:T\\d{2}:\\d{2}(?::\\d{2}(?:\\.\\d{3})?)?(?:Z|[-+]\\d{2}:?\\d{2})?)?$/;\n\nexport default function parse(string, fallback) {\n if (!re.test(string += \"\")) return typeof fallback === \"function\" ? fallback(string) : fallback;\n return new Date(string);\n}\n", "import {bisector, extent, median, pairs, timeFormat, utcFormat} from \"d3\";\nimport {utcSecond, utcMinute, utcHour, unixDay, utcWeek, utcMonth, utcYear} from \"d3\";\nimport {utcMonday, utcTuesday, utcWednesday, utcThursday, utcFriday, utcSaturday, utcSunday} from \"d3\";\nimport {timeSecond, timeMinute, timeHour, timeDay, timeWeek, timeMonth, timeYear} from \"d3\";\nimport {timeMonday, timeTuesday, timeWednesday, timeThursday, timeFriday, timeSaturday, timeSunday} from \"d3\";\nimport {orderof} from \"./options.js\";\n\nconst durationSecond = 1000;\nconst durationMinute = durationSecond * 60;\nconst durationHour = durationMinute * 60;\nconst durationDay = durationHour * 24;\nconst durationWeek = durationDay * 7;\nconst durationMonth = durationDay * 30;\nconst durationYear = durationDay * 365;\n\n// See https://github.com/d3/d3-time/blob/9e8dc940f38f78d7588aad68a54a25b1f0c2d97b/src/ticks.js#L14-L33\nconst formats = [\n [\"millisecond\", 0.5 * durationSecond],\n [\"second\", durationSecond],\n [\"second\", 30 * durationSecond],\n [\"minute\", durationMinute],\n [\"minute\", 30 * durationMinute],\n [\"hour\", durationHour],\n [\"hour\", 12 * durationHour],\n [\"day\", durationDay],\n [\"day\", 2 * durationDay],\n [\"week\", durationWeek],\n [\"month\", durationMonth],\n [\"month\", 3 * durationMonth],\n [\"year\", durationYear]\n];\n\nconst timeIntervals = new Map([\n [\"second\", timeSecond],\n [\"minute\", timeMinute],\n [\"hour\", timeHour],\n [\"day\", timeDay], // TODO local time equivalent of unixDay?\n [\"week\", timeWeek],\n [\"month\", timeMonth],\n [\"year\", timeYear],\n [\"monday\", timeMonday],\n [\"tuesday\", timeTuesday],\n [\"wednesday\", timeWednesday],\n [\"thursday\", timeThursday],\n [\"friday\", timeFriday],\n [\"saturday\", timeSaturday],\n [\"sunday\", timeSunday]\n]);\n\nconst utcIntervals = new Map([\n [\"second\", utcSecond],\n [\"minute\", utcMinute],\n [\"hour\", utcHour],\n [\"day\", unixDay],\n [\"week\", utcWeek],\n [\"month\", utcMonth],\n [\"year\", utcYear],\n [\"monday\", utcMonday],\n [\"tuesday\", utcTuesday],\n [\"wednesday\", utcWednesday],\n [\"thursday\", utcThursday],\n [\"friday\", utcFriday],\n [\"saturday\", utcSaturday],\n [\"sunday\", utcSunday]\n]);\n\nfunction parseInterval(input, intervals) {\n let name = `${input}`.toLowerCase();\n if (name.endsWith(\"s\")) name = name.slice(0, -1); // drop plural\n let period = 1;\n const match = /^(?:(\\d+)\\s+)/.exec(name);\n if (match) {\n name = name.slice(match[0].length);\n period = +match[1];\n }\n switch (name) {\n case \"quarter\":\n name = \"month\";\n period *= 3;\n break;\n case \"half\":\n name = \"month\";\n period *= 6;\n break;\n }\n let interval = intervals.get(name);\n if (!interval) throw new Error(`unknown interval: ${input}`);\n if (!(period > 1)) return interval;\n if (!interval.every) throw new Error(`non-periodic interval: ${name}`);\n return interval.every(period);\n}\n\nexport function maybeTimeInterval(interval) {\n return parseInterval(interval, timeIntervals);\n}\n\nexport function maybeUtcInterval(interval) {\n return parseInterval(interval, utcIntervals);\n}\n\nexport function isUtcYear(i) {\n if (!i) return false;\n const date = i.floor(new Date(Date.UTC(2000, 11, 31)));\n return utcYear(date) >= date; // coercing equality\n}\n\nexport function isTimeYear(i) {\n if (!i) return false;\n const date = i.floor(new Date(2000, 11, 31));\n return timeYear(date) >= date; // coercing equality\n}\n\nexport function formatTimeTicks(scale, data, ticks, anchor) {\n const format = scale.type === \"time\" ? timeFormat : utcFormat;\n const template =\n anchor === \"left\" || anchor === \"right\"\n ? (f1, f2) => `\\n${f1}\\n${f2}` // extra newline to keep f1 centered\n : anchor === \"top\"\n ? (f1, f2) => `${f2}\\n${f1}`\n : (f1, f2) => `${f1}\\n${f2}`;\n switch (getTimeTicksInterval(scale, data, ticks)) {\n case \"millisecond\":\n return formatConditional(format(\".%L\"), format(\":%M:%S\"), template);\n case \"second\":\n return formatConditional(format(\":%S\"), format(\"%-I:%M\"), template);\n case \"minute\":\n return formatConditional(format(\"%-I:%M\"), format(\"%p\"), template);\n case \"hour\":\n return formatConditional(format(\"%-I %p\"), format(\"%b %-d\"), template);\n case \"day\":\n return formatConditional(format(\"%-d\"), format(\"%b\"), template);\n case \"week\":\n return formatConditional(format(\"%-d\"), format(\"%b\"), template);\n case \"month\":\n return formatConditional(format(\"%b\"), format(\"%Y\"), template);\n case \"year\":\n return format(\"%Y\");\n }\n throw new Error(\"unable to format time ticks\");\n}\n\n// Compute the median difference between adjacent ticks, ignoring repeated\n// ticks; this implies an effective time interval, assuming that ticks are\n// regularly spaced; choose the largest format less than this interval so that\n// the ticks show the field that is changing. If the ticks are not available,\n// fallback to an approximation based on the desired number of ticks.\nfunction getTimeTicksInterval(scale, data, ticks) {\n const medianStep = median(pairs(data, (a, b) => Math.abs(b - a) || NaN));\n if (medianStep > 0) return formats[bisector(([, step]) => step).right(formats, medianStep, 1, formats.length) - 1][0];\n const [start, stop] = extent(scale.domain());\n const count = typeof ticks === \"number\" ? ticks : 10;\n const step = Math.abs(stop - start) / count;\n return formats[bisector(([, step]) => Math.log(step)).center(formats, Math.log(step))][0];\n}\n\nfunction formatConditional(format1, format2, template) {\n return (x, i, X) => {\n const f1 = format1(x, i); // always shown\n const f2 = format2(x, i); // only shown if different\n const j = i - orderof(X); // detect reversed domains\n return i !== j && X[j] !== undefined && f2 === format2(X[j], j) ? f1 : template(f1, f2);\n };\n}\n", "import {color, descending, quantile, range as rangei} from \"d3\";\nimport {parse as isoParse} from \"isoformat\";\nimport {defined} from \"./defined.js\";\nimport {maybeTimeInterval, maybeUtcInterval} from \"./time.js\";\n\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\nexport const TypedArray = Object.getPrototypeOf(Uint8Array);\nconst objectToString = Object.prototype.toString;\n\nexport function valueof(data, value, type) {\n const valueType = typeof value;\n return valueType === \"string\"\n ? maybeTypedMap(data, field(value), type)\n : valueType === \"function\"\n ? maybeTypedMap(data, value, type)\n : valueType === \"number\" || value instanceof Date || valueType === \"boolean\"\n ? map(data, constant(value), type)\n : typeof value?.transform === \"function\"\n ? maybeTypedArrayify(value.transform(data), type)\n : maybeTypedArrayify(value, type);\n}\n\nfunction maybeTypedMap(data, f, type) {\n return map(data, type?.prototype instanceof TypedArray ? floater(f) : f, type);\n}\n\nfunction maybeTypedArrayify(data, type) {\n return type === undefined\n ? arrayify(data) // preserve undefined type\n : data instanceof type\n ? data\n : type.prototype instanceof TypedArray && !(data instanceof TypedArray)\n ? type.from(data, coerceNumber)\n : type.from(data);\n}\n\nfunction floater(f) {\n return (d, i) => coerceNumber(f(d, i));\n}\n\nexport const singleton = [null]; // for data-less decoration marks, e.g. frame\nexport const field = (name) => (d) => d[name];\nexport const indexOf = {transform: range};\nexport const identity = {transform: (d) => d};\nexport const zero = () => 0;\nexport const one = () => 1;\nexport const yes = () => true;\nexport const string = (x) => (x == null ? x : `${x}`);\nexport const number = (x) => (x == null ? x : +x);\nexport const boolean = (x) => (x == null ? x : !!x);\nexport const first = (x) => (x ? x[0] : undefined);\nexport const second = (x) => (x ? x[1] : undefined);\nexport const third = (x) => (x ? x[2] : undefined);\nexport const constant = (x) => () => x;\n\n// Converts a string like \u201Cp25\u201D into a function that takes an index I and an\n// accessor function f, returning the corresponding percentile value.\nexport function percentile(reduce) {\n const p = +`${reduce}`.slice(1) / 100;\n return (I, f) => quantile(I, p, f);\n}\n\n// If the values are specified as a typed array, no coercion is required.\nexport function coerceNumbers(values) {\n return values instanceof TypedArray ? values : map(values, coerceNumber, Float64Array);\n}\n\n// Unlike Mark\u2019s number, here we want to convert null and undefined to NaN since\n// the result will be stored in a Float64Array and we don\u2019t want null to be\n// coerced to zero. We use Number instead of unary + to allow BigInt coercion.\nfunction coerceNumber(x) {\n return x == null ? NaN : Number(x);\n}\n\nexport function coerceDates(values) {\n return map(values, coerceDate);\n}\n\n// When coercing strings to dates, we only want to allow the ISO 8601 format\n// since the built-in string parsing of the Date constructor varies across\n// browsers. (In the future, this could be made more liberal if desired, though\n// it is still generally preferable to do date parsing yourself explicitly,\n// rather than rely on Plot.) Any non-string values are coerced to number first\n// and treated as milliseconds since UNIX epoch.\nexport function coerceDate(x) {\n return x instanceof Date && !isNaN(x)\n ? x\n : typeof x === \"string\"\n ? isoParse(x)\n : x == null || isNaN((x = +x))\n ? undefined\n : new Date(x);\n}\n\n// Some channels may allow a string constant to be specified; to differentiate\n// string constants (e.g., \"red\") from named fields (e.g., \"date\"), this\n// function tests whether the given value is a CSS color string and returns a\n// tuple [channel, constant] where one of the two is undefined, and the other is\n// the given value. If you wish to reference a named field that is also a valid\n// CSS color, use an accessor (d => d.red) instead.\nexport function maybeColorChannel(value, defaultValue) {\n if (value === undefined) value = defaultValue;\n return value === null ? [undefined, \"none\"] : isColor(value) ? [undefined, value] : [value, undefined];\n}\n\n// Similar to maybeColorChannel, this tests whether the given value is a number\n// indicating a constant, and otherwise assumes that it\u2019s a channel value.\nexport function maybeNumberChannel(value, defaultValue) {\n if (value === undefined) value = defaultValue;\n return value === null || typeof value === \"number\" ? [undefined, value] : [value, undefined];\n}\n\n// Validates the specified optional string against the allowed list of keywords.\nexport function maybeKeyword(input, name, allowed) {\n if (input != null) return keyword(input, name, allowed);\n}\n\n// Validates the specified required string against the allowed list of keywords.\nexport function keyword(input, name, allowed) {\n const i = `${input}`.toLowerCase();\n if (!allowed.includes(i)) throw new Error(`invalid ${name}: ${input}`);\n return i;\n}\n\n// Promotes the specified data to an array as needed.\nexport function arrayify(data) {\n return data == null || data instanceof Array || data instanceof TypedArray ? data : Array.from(data);\n}\n\n// An optimization of type.from(values, f): if the given values are already an\n// instanceof the desired array type, the faster values.map method is used.\nexport function map(values, f, type = Array) {\n return values == null ? values : values instanceof type ? values.map(f) : type.from(values, f);\n}\n\n// An optimization of type.from(values): if the given values are already an\n// instanceof the desired array type, the faster values.slice method is used.\nexport function slice(values, type = Array) {\n return values instanceof type ? values.slice() : type.from(values);\n}\n\n// Returns true if any of x, x1, or x2 is not (strictly) undefined.\nexport function hasX({x, x1, x2}) {\n return x !== undefined || x1 !== undefined || x2 !== undefined;\n}\n\n// Returns true if any of y, y1, or y2 is not (strictly) undefined.\nexport function hasY({y, y1, y2}) {\n return y !== undefined || y1 !== undefined || y2 !== undefined;\n}\n\n// Returns true if has x or y, or if interval is not (strictly) undefined.\nexport function hasXY(options) {\n return hasX(options) || hasY(options) || options.interval !== undefined;\n}\n\n// Disambiguates an options object (e.g., {y: \"x2\"}) from a primitive value.\nexport function isObject(option) {\n return option?.toString === objectToString;\n}\n\n// Disambiguates a scale options object (e.g., {color: {type: \"linear\"}}) from\n// some other option (e.g., {color: \"red\"}). When creating standalone legends,\n// this is used to test whether a scale is defined; this should be consistent\n// with inferScaleType when there are no channels associated with the scale, and\n// if this returns true, then normalizeScale must return non-null.\nexport function isScaleOptions(option) {\n return isObject(option) && (option.type !== undefined || option.domain !== undefined);\n}\n\n// Disambiguates an options object (e.g., {y: \"x2\"}) from a channel value\n// definition expressed as a channel transform (e.g., {transform: \u2026}).\nexport function isOptions(option) {\n return isObject(option) && typeof option.transform !== \"function\";\n}\n\n// Disambiguates a sort transform (e.g., {sort: \"date\"}) from a channel domain\n// sort definition (e.g., {sort: {y: \"x\"}}).\nexport function isDomainSort(sort) {\n return isOptions(sort) && sort.value === undefined && sort.channel === undefined;\n}\n\n// For marks specified either as [0, x] or [x1, x2], such as areas and bars.\nexport function maybeZero(x, x1, x2, x3 = identity) {\n if (x1 === undefined && x2 === undefined) {\n // {x} or {}\n (x1 = 0), (x2 = x === undefined ? x3 : x);\n } else if (x1 === undefined) {\n // {x, x2} or {x2}\n x1 = x === undefined ? 0 : x;\n } else if (x2 === undefined) {\n // {x, x1} or {x1}\n x2 = x === undefined ? 0 : x;\n }\n return [x1, x2];\n}\n\n// For marks that have x and y channels (e.g., cell, dot, line, text).\nexport function maybeTuple(x, y) {\n return x === undefined && y === undefined ? [first, second] : [x, y];\n}\n\n// A helper for extracting the z channel, if it is variable. Used by transforms\n// that require series, such as moving average and normalize.\nexport function maybeZ({z, fill, stroke} = {}) {\n if (z === undefined) [z] = maybeColorChannel(fill);\n if (z === undefined) [z] = maybeColorChannel(stroke);\n return z;\n}\n\n// Returns a Uint32Array with elements [0, 1, 2, \u2026 data.length - 1].\nexport function range(data) {\n const n = data.length;\n const r = new Uint32Array(n);\n for (let i = 0; i < n; ++i) r[i] = i;\n return r;\n}\n\n// Returns a filtered range of data given the test function.\nexport function where(data, test) {\n return range(data).filter((i) => test(data[i], i, data));\n}\n\n// Returns an array [values[index[0]], values[index[1]], \u2026].\nexport function take(values, index) {\n return map(index, (i) => values[i]);\n}\n\n// If f does not take exactly one argument, wraps it in a function that uses take.\nexport function taker(f) {\n return f.length === 1 ? (index, values) => f(take(values, index)) : f;\n}\n\n// Uses subarray if available, and otherwise slice.\nexport function subarray(I, i, j) {\n return I.subarray ? I.subarray(i, j) : I.slice(i, j);\n}\n\n// Based on InternMap (d3.group).\nexport function keyof(value) {\n return value !== null && typeof value === \"object\" ? value.valueOf() : value;\n}\n\nexport function maybeInput(key, options) {\n if (options[key] !== undefined) return options[key];\n switch (key) {\n case \"x1\":\n case \"x2\":\n key = \"x\";\n break;\n case \"y1\":\n case \"y2\":\n key = \"y\";\n break;\n }\n return options[key];\n}\n\nexport function column(source) {\n // Defines a column whose values are lazily populated by calling the returned\n // setter. If the given source is labeled, the label is propagated to the\n // returned column definition.\n let value;\n return [\n {\n transform: () => value,\n label: labelof(source)\n },\n (v) => (value = v)\n ];\n}\n\n// Like column, but allows the source to be null.\nexport function maybeColumn(source) {\n return source == null ? [source] : column(source);\n}\n\nexport function labelof(value, defaultValue) {\n return typeof value === \"string\" ? value : value && value.label !== undefined ? value.label : defaultValue;\n}\n\n// Assuming that both x1 and x2 and lazy columns (per above), this derives a new\n// a column that\u2019s the average of the two, and which inherits the column label\n// (if any). Both input columns are assumed to be quantitative. If either column\n// is temporal, the returned column is also temporal.\nexport function mid(x1, x2) {\n return {\n transform(data) {\n const X1 = x1.transform(data);\n const X2 = x2.transform(data);\n return isTemporal(X1) || isTemporal(X2)\n ? map(X1, (_, i) => new Date((+X1[i] + +X2[i]) / 2))\n : map(X1, (_, i) => (+X1[i] + +X2[i]) / 2, Float64Array);\n },\n label: x1.label\n };\n}\n\n// If the scale options declare an interval, applies it to the values V.\nexport function maybeApplyInterval(V, scale) {\n const t = maybeIntervalTransform(scale?.interval, scale?.type);\n return t ? map(V, t) : V;\n}\n\n// Returns the equivalent scale transform for the specified interval option.\nexport function maybeIntervalTransform(interval, type) {\n const i = maybeInterval(interval, type);\n return i && ((v) => (defined(v) ? i.floor(v) : v));\n}\n\n// If interval is not nullish, converts interval shorthand such as a number (for\n// multiples) or a time interval name (such as \u201Cday\u201D) to a {floor, offset,\n// range} object similar to a D3 time interval.\nexport function maybeInterval(interval, type) {\n if (interval == null) return;\n if (typeof interval === \"number\") {\n if (0 < interval && interval < 1 && Number.isInteger(1 / interval)) interval = -1 / interval;\n const n = Math.abs(interval);\n return interval < 0\n ? {\n floor: (d) => Math.floor(d * n) / n,\n offset: (d) => (d * n + 1) / n, // note: no optional step for simplicity\n range: (lo, hi) => rangei(Math.ceil(lo * n), hi * n).map((x) => x / n)\n }\n : {\n floor: (d) => Math.floor(d / n) * n,\n offset: (d) => d + n, // note: no optional step for simplicity\n range: (lo, hi) => rangei(Math.ceil(lo / n), hi / n).map((x) => x * n)\n };\n }\n if (typeof interval === \"string\") return (type === \"time\" ? maybeTimeInterval : maybeUtcInterval)(interval);\n if (typeof interval.floor !== \"function\") throw new Error(\"invalid interval; missing floor method\");\n if (typeof interval.offset !== \"function\") throw new Error(\"invalid interval; missing offset method\");\n return interval;\n}\n\n// Like maybeInterval, but requires a range method too.\nexport function maybeRangeInterval(interval, type) {\n interval = maybeInterval(interval, type);\n if (interval && typeof interval.range !== \"function\") throw new Error(\"invalid interval: missing range method\");\n return interval;\n}\n\n// Like maybeRangeInterval, but requires a ceil method too.\nexport function maybeNiceInterval(interval, type) {\n interval = maybeRangeInterval(interval, type);\n if (interval && typeof interval.ceil !== \"function\") throw new Error(\"invalid interval: missing ceil method\");\n return interval;\n}\n\n// This distinguishes between per-dimension options and a standalone value.\nexport function maybeValue(value) {\n return value === undefined || isOptions(value) ? value : {value};\n}\n\n// Coerces the given channel values (if any) to numbers. This is useful when\n// values will be interpolated into other code, such as an SVG transform, and\n// where we don\u2019t wish to allow unexpected behavior for weird input.\nexport function numberChannel(source) {\n return source == null\n ? null\n : {\n transform: (data) => valueof(data, source, Float64Array),\n label: labelof(source)\n };\n}\n\nexport function isTuples(data) {\n if (!isIterable(data)) return false;\n for (const d of data) {\n if (d == null) continue;\n return typeof d === \"object\" && \"0\" in d && \"1\" in d;\n }\n}\n\nexport function isIterable(value) {\n return value && typeof value[Symbol.iterator] === \"function\";\n}\n\nexport function isTextual(values) {\n for (const value of values) {\n if (value == null) continue;\n return typeof value !== \"object\" || value instanceof Date;\n }\n}\n\nexport function isOrdinal(values) {\n for (const value of values) {\n if (value == null) continue;\n const type = typeof value;\n return type === \"string\" || type === \"boolean\";\n }\n}\n\nexport function isTemporal(values) {\n for (const value of values) {\n if (value == null) continue;\n return value instanceof Date;\n }\n}\n\n// Are these strings that might represent dates? This is stricter than ISO 8601\n// because we want to ignore false positives on numbers; for example, the string\n// \"1192\" is more likely to represent a number than a date even though it is\n// valid ISO 8601 representing 1192-01-01.\nexport function isTemporalString(values) {\n for (const value of values) {\n if (value == null) continue;\n return typeof value === \"string\" && isNaN(value) && isoParse(value);\n }\n}\n\n// Are these strings that might represent numbers? This is stricter than\n// coercion because we want to ignore false positives on e.g. empty strings.\nexport function isNumericString(values) {\n for (const value of values) {\n if (value == null) continue;\n if (typeof value !== \"string\") return false;\n if (!value.trim()) continue;\n return !isNaN(value);\n }\n}\n\nexport function isNumeric(values) {\n for (const value of values) {\n if (value == null) continue;\n return typeof value === \"number\";\n }\n}\n\n// Returns true if every non-null value in the specified iterable of values\n// passes the specified predicate, and there is at least one non-null value;\n// returns false if at least one non-null value does not pass the specified\n// predicate; otherwise returns undefined (as if all values are null).\nexport function isEvery(values, is) {\n let every;\n for (const value of values) {\n if (value == null) continue;\n if (!is(value)) return false;\n every = true;\n }\n return every;\n}\n\n// Mostly relies on d3-color, with a few extra color keywords. Currently this\n// strictly requires that the value be a string; we might want to apply string\n// coercion here, though note that d3-color instances would need to support\n// valueOf to work correctly with InternMap.\n// https://www.w3.org/TR/SVG11/painting.html#SpecifyingPaint\nexport function isColor(value) {\n if (typeof value !== \"string\") return false;\n value = value.toLowerCase().trim();\n return (\n value === \"none\" ||\n value === \"currentcolor\" ||\n (value.startsWith(\"url(\") && value.endsWith(\")\")) || // <funciri>, e.g. pattern or gradient\n (value.startsWith(\"var(\") && value.endsWith(\")\")) || // CSS variable\n color(value) !== null\n );\n}\n\nexport function isOpacity(value) {\n return typeof value === \"number\" && ((0 <= value && value <= 1) || isNaN(value));\n}\n\nexport function isNoneish(value) {\n return value == null || isNone(value);\n}\n\nexport function isNone(value) {\n return /^\\s*none\\s*$/i.test(value);\n}\n\nexport function isRound(value) {\n return /^\\s*round\\s*$/i.test(value);\n}\n\nexport function maybeAnchor(value, name) {\n return maybeKeyword(value, name, [\n \"middle\",\n \"top-left\",\n \"top\",\n \"top-right\",\n \"right\",\n \"bottom-right\",\n \"bottom\",\n \"bottom-left\",\n \"left\"\n ]);\n}\n\nexport function maybeFrameAnchor(value = \"middle\") {\n return maybeAnchor(value, \"frameAnchor\");\n}\n\n// Like a sort comparator, returns a positive value if the given array of values\n// is in ascending order, a negative value if the values are in descending\n// order. Assumes monotonicity; only tests the first and last values.\nexport function orderof(values) {\n if (values == null) return;\n const first = values[0];\n const last = values[values.length - 1];\n return descending(first, last);\n}\n\n// Unlike {...defaults, ...options}, this ensures that any undefined (but\n// present) properties in options inherit the given default value.\nexport function inherit(options = {}, ...rest) {\n let o = options;\n for (const defaults of rest) {\n for (const key in defaults) {\n if (o[key] === undefined) {\n const value = defaults[key];\n if (o === options) o = {...o, [key]: value};\n else o[key] = value;\n }\n }\n }\n return o;\n}\n\n// Given an iterable of named things (objects with a name property), returns a\n// corresponding object with properties associated with the given name.\nexport function named(things) {\n console.warn(\"named iterables are deprecated; please use an object instead\");\n const names = new Set();\n return Object.fromEntries(\n Array.from(things, (thing) => {\n const {name} = thing;\n if (name == null) throw new Error(\"missing name\");\n const key = `${name}`;\n if (key === \"__proto__\") throw new Error(`illegal name: ${key}`);\n if (names.has(key)) throw new Error(`duplicate name: ${key}`);\n names.add(key);\n return [name, thing];\n })\n );\n}\n\nexport function maybeNamed(things) {\n return isIterable(things) ? named(things) : things;\n}\n", "// Positional scales have associated axes, and for ordinal data, a point or band\n// scale is used instead of an ordinal scale.\nexport const position = Symbol(\"position\");\n\n// Color scales default to the turbo interpolator for quantitative data, and to\n// the Tableau10 scheme for ordinal data. Color scales may also have an\n// associated legend.\nexport const color = Symbol(\"color\");\n\n// Radius scales default to the sqrt type, have a default range of [0, 3], and a\n// default domain from 0 to the median first quartile of associated channels.\nexport const radius = Symbol(\"radius\");\n\n// Length scales default to the linear type, have a default range of [0, 12],\n// and a default domain from 0 to the median median of associated channels.\nexport const length = Symbol(\"length\");\n\n// Opacity scales have a default range of [0, 1], and a default domain from 0 to\n// the maximum value of associated channels.\nexport const opacity = Symbol(\"opacity\");\n\n// Symbol scales have a default range of categorical symbols.\nexport const symbol = Symbol(\"symbol\");\n\n// There isn\u2019t really a projection scale; this represents x and y for geometry.\nexport const projection = Symbol(\"projection\");\n\n// TODO Rather than hard-coding the list of known scale names, collect the names\n// and categories for each plot specification, so that custom marks can register\n// custom scales.\nexport const registry = new Map([\n [\"x\", position],\n [\"y\", position],\n [\"fx\", position],\n [\"fy\", position],\n [\"r\", radius],\n [\"color\", color],\n [\"opacity\", opacity],\n [\"symbol\", symbol],\n [\"length\", length],\n [\"projection\", projection]\n]);\n", "import {symbolAsterisk, symbolDiamond2, symbolPlus, symbolSquare2, symbolTriangle2, symbolTimes} from \"d3\";\nimport {symbolCircle, symbolCross, symbolDiamond, symbolSquare, symbolStar, symbolTriangle, symbolWye} from \"d3\";\n\nexport const sqrt3 = Math.sqrt(3);\nexport const sqrt4_3 = 2 / sqrt3;\n\nconst symbolHexagon = {\n draw(context, size) {\n const rx = Math.sqrt(size / Math.PI),\n ry = rx * sqrt4_3,\n hy = ry / 2;\n context.moveTo(0, ry);\n context.lineTo(rx, hy);\n context.lineTo(rx, -hy);\n context.lineTo(0, -ry);\n context.lineTo(-rx, -hy);\n context.lineTo(-rx, hy);\n context.closePath();\n }\n};\n\nconst symbols = new Map([\n [\"asterisk\", symbolAsterisk],\n [\"circle\", symbolCircle],\n [\"cross\", symbolCross],\n [\"diamond\", symbolDiamond],\n [\"diamond2\", symbolDiamond2],\n [\"hexagon\", symbolHexagon],\n [\"plus\", symbolPlus],\n [\"square\", symbolSquare],\n [\"square2\", symbolSquare2],\n [\"star\", symbolStar],\n [\"times\", symbolTimes],\n [\"triangle\", symbolTriangle],\n [\"triangle2\", symbolTriangle2],\n [\"wye\", symbolWye]\n]);\n\nfunction isSymbolObject(value) {\n return value && typeof value.draw === \"function\";\n}\n\nexport function isSymbol(value) {\n if (isSymbolObject(value)) return true;\n if (typeof value !== \"string\") return false;\n return symbols.has(value.toLowerCase());\n}\n\nexport function maybeSymbol(symbol) {\n if (symbol == null || isSymbolObject(symbol)) return symbol;\n const value = symbols.get(`${symbol}`.toLowerCase());\n if (value) return value;\n throw new Error(`invalid symbol: ${symbol}`);\n}\n\nexport function maybeSymbolChannel(symbol) {\n if (symbol == null || isSymbolObject(symbol)) return [undefined, symbol];\n if (typeof symbol === \"string\") {\n const value = symbols.get(`${symbol}`.toLowerCase());\n if (value) return [undefined, value];\n }\n return [symbol, undefined];\n}\n", "import {randomLcg} from \"d3\";\nimport {ascendingDefined, descendingDefined} from \"../defined.js\";\nimport {arrayify, isDomainSort, isOptions, maybeValue, valueof} from \"../options.js\";\n\nexport function basic({filter: f1, sort: s1, reverse: r1, transform: t1, initializer: i1, ...options} = {}, transform) {\n // If both t1 and t2 are defined, returns a composite transform that first\n // applies t1 and then applies t2.\n if (t1 === undefined) {\n // explicit transform overrides filter, sort, and reverse\n if (f1 != null) t1 = filterTransform(f1);\n if (s1 != null && !isDomainSort(s1)) t1 = composeTransform(t1, sortTransform(s1));\n if (r1) t1 = composeTransform(t1, reverseTransform);\n }\n if (transform != null && i1 != null) throw new Error(\"transforms cannot be applied after initializers\");\n return {\n ...options,\n ...((s1 === null || isDomainSort(s1)) && {sort: s1}),\n transform: composeTransform(t1, transform)\n };\n}\n\nexport function initializer({filter: f1, sort: s1, reverse: r1, initializer: i1, ...options} = {}, initializer) {\n // If both i1 and i2 are defined, returns a composite initializer that first\n // applies i1 and then applies i2.\n if (i1 === undefined) {\n // explicit initializer overrides filter, sort, and reverse\n if (f1 != null) i1 = filterTransform(f1);\n if (s1 != null && !isDomainSort(s1)) i1 = composeInitializer(i1, sortTransform(s1));\n if (r1) i1 = composeInitializer(i1, reverseTransform);\n }\n return {\n ...options,\n ...((s1 === null || isDomainSort(s1)) && {sort: s1}),\n initializer: composeInitializer(i1, initializer)\n };\n}\n\nfunction composeTransform(t1, t2) {\n if (t1 == null) return t2 === null ? undefined : t2;\n if (t2 == null) return t1 === null ? undefined : t1;\n return function (data, facets, plotOptions) {\n ({data, facets} = t1.call(this, data, facets, plotOptions));\n return t2.call(this, arrayify(data), facets, plotOptions);\n };\n}\n\nfunction composeInitializer(i1, i2) {\n if (i1 == null) return i2 === null ? undefined : i2;\n if (i2 == null) return i1 === null ? undefined : i1;\n return function (data, facets, channels, ...args) {\n let c1, d1, f1, c2, d2, f2;\n ({data: d1 = data, facets: f1 = facets, channels: c1} = i1.call(this, data, facets, channels, ...args));\n ({data: d2 = d1, facets: f2 = f1, channels: c2} = i2.call(this, d1, f1, {...channels, ...c1}, ...args));\n return {data: d2, facets: f2, channels: {...c1, ...c2}};\n };\n}\n\nfunction apply(options, t) {\n return (options.initializer != null ? initializer : basic)(options, t);\n}\n\nexport function filter(test, options) {\n return apply(options, filterTransform(test));\n}\n\nfunction filterTransform(value) {\n return (data, facets) => {\n const V = valueof(data, value);\n return {data, facets: facets.map((I) => I.filter((i) => V[i]))};\n };\n}\n\nexport function reverse({sort, ...options} = {}) {\n return {\n ...apply(options, reverseTransform),\n sort: isDomainSort(sort) ? sort : null\n };\n}\n\nfunction reverseTransform(data, facets) {\n return {data, facets: facets.map((I) => I.slice().reverse())};\n}\n\nexport function shuffle({seed, sort, ...options} = {}) {\n return {\n ...apply(options, sortValue(seed == null ? Math.random : randomLcg(seed))),\n sort: isDomainSort(sort) ? sort : null\n };\n}\n\nexport function sort(order, {sort, ...options} = {}) {\n return {\n ...(isOptions(order) && order.channel !== undefined ? initializer : apply)(options, sortTransform(order)),\n sort: isDomainSort(sort) ? sort : null\n };\n}\n\nfunction sortTransform(value) {\n return (typeof value === \"function\" && value.length !== 1 ? sortData : sortValue)(value);\n}\n\nfunction sortData(compare) {\n return (data, facets) => {\n const compareData = (i, j) => compare(data[i], data[j]);\n return {data, facets: facets.map((I) => I.slice().sort(compareData))};\n };\n}\n\nfunction sortValue(value) {\n let channel, order;\n ({channel, value, order} = {...maybeValue(value)});\n const negate = channel?.startsWith(\"-\");\n if (negate) channel = channel.slice(1);\n if (order === undefined) order = negate ? descendingDefined : ascendingDefined;\n if (typeof order !== \"function\") {\n switch (`${order}`.toLowerCase()) {\n case \"ascending\":\n order = ascendingDefined;\n break;\n case \"descending\":\n order = descendingDefined;\n break;\n default:\n throw new Error(`invalid order: ${order}`);\n }\n }\n return (data, facets, channels) => {\n let V;\n if (channel === undefined) {\n V = valueof(data, value);\n } else {\n if (channels === undefined) throw new Error(\"channel sort requires an initializer\");\n V = channels[channel];\n if (!V) return {}; // ignore missing channel\n V = V.value;\n }\n const compareValue = (i, j) => order(V[i], V[j]);\n return {data, facets: facets.map((I) => I.slice().sort(compareValue))};\n };\n}\n", "import {\n InternSet,\n deviation,\n group as grouper,\n max,\n maxIndex,\n mean,\n median,\n min,\n minIndex,\n mode,\n rollup,\n sort,\n sum,\n variance\n} from \"d3\";\nimport {ascendingDefined} from \"../defined.js\";\nimport {\n column,\n first,\n identity,\n isObject,\n isTemporal,\n labelof,\n maybeApplyInterval,\n maybeColorChannel,\n maybeColumn,\n maybeInput,\n maybeTuple,\n percentile,\n range,\n second,\n take,\n valueof\n} from \"../options.js\";\nimport {basic} from \"./basic.js\";\n\n// Group on {z, fill, stroke}.\nexport function groupZ(outputs, options) {\n return groupn(null, null, outputs, options);\n}\n\n// Group on {z, fill, stroke}, then on x.\nexport function groupX(outputs = {y: \"count\"}, options = {}) {\n const {x = identity} = options;\n if (x == null) throw new Error(\"missing channel: x\");\n return groupn(x, null, outputs, options);\n}\n\n// Group on {z, fill, stroke}, then on y.\nexport function groupY(outputs = {x: \"count\"}, options = {}) {\n const {y = identity} = options;\n if (y == null) throw new Error(\"missing channel: y\");\n return groupn(null, y, outputs, options);\n}\n\n// Group on {z, fill, stroke}, then on x and y.\nexport function group(outputs = {fill: \"count\"}, options = {}) {\n let {x, y} = options;\n [x, y] = maybeTuple(x, y);\n if (x == null) throw new Error(\"missing channel: x\");\n if (y == null) throw new Error(\"missing channel: y\");\n return groupn(x, y, outputs, options);\n}\n\nfunction groupn(\n x, // optionally group on x\n y, // optionally group on y\n {\n data: reduceData = reduceIdentity,\n filter,\n sort,\n reverse,\n ...outputs // output channel definitions\n } = {},\n inputs = {} // input channels and options\n) {\n // Compute the outputs.\n outputs = maybeOutputs(outputs, inputs);\n reduceData = maybeReduce(reduceData, identity);\n sort = sort == null ? undefined : maybeOutput(\"sort\", sort, inputs);\n filter = filter == null ? undefined : maybeEvaluator(\"filter\", filter, inputs);\n\n // Produce x and y output channels as appropriate.\n const [GX, setGX] = maybeColumn(x);\n const [GY, setGY] = maybeColumn(y);\n\n // Greedily materialize the z, fill, and stroke channels (if channels and not\n // constants) so that we can reference them for subdividing groups without\n // computing them more than once.\n const {\n z,\n fill,\n stroke,\n x1,\n x2, // consumed if x is an output\n y1,\n y2, // consumed if y is an output\n ...options\n } = inputs;\n const [GZ, setGZ] = maybeColumn(z);\n const [vfill] = maybeColorChannel(fill);\n const [vstroke] = maybeColorChannel(stroke);\n const [GF, setGF] = maybeColumn(vfill);\n const [GS, setGS] = maybeColumn(vstroke);\n\n return {\n ...(\"z\" in inputs && {z: GZ || z}),\n ...(\"fill\" in inputs && {fill: GF || fill}),\n ...(\"stroke\" in inputs && {stroke: GS || stroke}),\n ...basic(options, (data, facets, plotOptions) => {\n const X = maybeApplyInterval(valueof(data, x), plotOptions?.x);\n const Y = maybeApplyInterval(valueof(data, y), plotOptions?.y);\n const Z = valueof(data, z);\n const F = valueof(data, vfill);\n const S = valueof(data, vstroke);\n const G = maybeSubgroup(outputs, {z: Z, fill: F, stroke: S});\n const groupFacets = [];\n const groupData = [];\n const GX = X && setGX([]);\n const GY = Y && setGY([]);\n const GZ = Z && setGZ([]);\n const GF = F && setGF([]);\n const GS = S && setGS([]);\n let i = 0;\n for (const o of outputs) o.initialize(data);\n if (sort) sort.initialize(data);\n if (filter) filter.initialize(data);\n for (const facet of facets) {\n const groupFacet = [];\n for (const o of outputs) o.scope(\"facet\", facet);\n if (sort) sort.scope(\"facet\", facet);\n if (filter) filter.scope(\"facet\", facet);\n for (const [f, I] of maybeGroup(facet, G)) {\n for (const [y, gg] of maybeGroup(I, Y)) {\n for (const [x, g] of maybeGroup(gg, X)) {\n if (filter && !filter.reduce(g)) continue;\n groupFacet.push(i++);\n groupData.push(reduceData.reduceIndex(g, data));\n if (X) GX.push(x);\n if (Y) GY.push(y);\n if (Z) GZ.push(G === Z ? f : Z[g[0]]);\n if (F) GF.push(G === F ? f : F[g[0]]);\n if (S) GS.push(G === S ? f : S[g[0]]);\n for (const o of outputs) o.reduce(g);\n if (sort) sort.reduce(g);\n }\n }\n }\n groupFacets.push(groupFacet);\n }\n maybeSort(groupFacets, sort, reverse);\n return {data: groupData, facets: groupFacets};\n }),\n ...(!hasOutput(outputs, \"x\") && (GX ? {x: GX} : {x1, x2})),\n ...(!hasOutput(outputs, \"y\") && (GY ? {y: GY} : {y1, y2})),\n ...Object.fromEntries(outputs.map(({name, output}) => [name, output]))\n };\n}\n\nexport function hasOutput(outputs, ...names) {\n for (const {name} of outputs) {\n if (names.includes(name)) {\n return true;\n }\n }\n return false;\n}\n\nexport function maybeOutputs(outputs, inputs, asOutput = maybeOutput) {\n const entries = Object.entries(outputs);\n // Propagate standard mark channels by default.\n if (inputs.title != null && outputs.title === undefined) entries.push([\"title\", reduceTitle]);\n if (inputs.href != null && outputs.href === undefined) entries.push([\"href\", reduceFirst]);\n return entries\n .filter(([, reduce]) => reduce !== undefined)\n .map(([name, reduce]) => (reduce === null ? nullOutput(name) : asOutput(name, reduce, inputs)));\n}\n\nexport function maybeOutput(name, reduce, inputs, asEvaluator = maybeEvaluator) {\n let scale; // optional per-channel scale override\n if (isObject(reduce) && \"reduce\" in reduce) (scale = reduce.scale), (reduce = reduce.reduce); // N.B. array.reduce\n const evaluator = asEvaluator(name, reduce, inputs);\n const [output, setOutput] = column(evaluator.label);\n let O;\n return {\n name,\n output: scale === undefined ? output : {value: output, scale},\n initialize(data) {\n evaluator.initialize(data);\n O = setOutput([]);\n },\n scope(scope, I) {\n evaluator.scope(scope, I);\n },\n reduce(I, extent) {\n O.push(evaluator.reduce(I, extent));\n }\n };\n}\n\nfunction nullOutput(name) {\n return {name, initialize() {}, scope() {}, reduce() {}};\n}\n\nexport function maybeEvaluator(name, reduce, inputs, asReduce = maybeReduce) {\n const input = maybeInput(name, inputs);\n const reducer = asReduce(reduce, input);\n let V, context;\n return {\n label: labelof(reducer === reduceCount ? null : input, reducer.label),\n initialize(data) {\n V = input === undefined ? data : valueof(data, input);\n if (reducer.scope === \"data\") {\n context = reducer.reduceIndex(range(data), V);\n }\n },\n scope(scope, I) {\n if (reducer.scope === scope) {\n context = reducer.reduceIndex(I, V);\n }\n },\n reduce(I, extent) {\n return reducer.scope == null ? reducer.reduceIndex(I, V, extent) : reducer.reduceIndex(I, V, context, extent);\n }\n };\n}\n\nexport function maybeGroup(I, X) {\n return X\n ? sort(\n grouper(I, (i) => X[i]),\n first\n )\n : [[, I]];\n}\n\nexport function maybeReduce(reduce, value, fallback = invalidReduce) {\n if (reduce == null) return fallback(reduce);\n if (typeof reduce.reduceIndex === \"function\") return reduce;\n if (typeof reduce.reduce === \"function\" && isObject(reduce)) return reduceReduce(reduce); // N.B. array.reduce\n if (typeof reduce === \"function\") return reduceFunction(reduce);\n if (/^p\\d{2}$/i.test(reduce)) return reduceAccessor(percentile(reduce));\n switch (`${reduce}`.toLowerCase()) {\n case \"first\":\n return reduceFirst;\n case \"last\":\n return reduceLast;\n case \"identity\":\n return reduceIdentity;\n case \"count\":\n return reduceCount;\n case \"distinct\":\n return reduceDistinct;\n case \"sum\":\n return value == null ? reduceCount : reduceSum;\n case \"proportion\":\n return reduceProportion(value, \"data\");\n case \"proportion-facet\":\n return reduceProportion(value, \"facet\");\n case \"deviation\":\n return reduceAccessor(deviation);\n case \"min\":\n return reduceAccessor(min);\n case \"min-index\":\n return reduceAccessor(minIndex);\n case \"max\":\n return reduceAccessor(max);\n case \"max-index\":\n return reduceAccessor(maxIndex);\n case \"mean\":\n return reduceMaybeTemporalAccessor(mean);\n case \"median\":\n return reduceMaybeTemporalAccessor(median);\n case \"variance\":\n return reduceAccessor(variance);\n case \"mode\":\n return reduceAccessor(mode);\n }\n return fallback(reduce);\n}\n\nfunction invalidReduce(reduce) {\n throw new Error(`invalid reduce: ${reduce}`);\n}\n\nexport function maybeSubgroup(outputs, inputs) {\n for (const name in inputs) {\n const value = inputs[name];\n if (value !== undefined && !outputs.some((o) => o.name === name)) {\n return value;\n }\n }\n}\n\nexport function maybeSort(facets, sort, reverse) {\n if (sort) {\n const S = sort.output.transform();\n const compare = (i, j) => ascendingDefined(S[i], S[j]);\n facets.forEach((f) => f.sort(compare));\n }\n if (reverse) {\n facets.forEach((f) => f.reverse());\n }\n}\n\nfunction reduceReduce(reduce) {\n console.warn(\"deprecated reduce interface; implement reduceIndex instead.\");\n return {...reduce, reduceIndex: reduce.reduce.bind(reduce)};\n}\n\nfunction reduceFunction(f) {\n return {\n reduceIndex(I, X, extent) {\n return f(take(X, I), extent);\n }\n };\n}\n\nfunction reduceAccessor(f) {\n return {\n reduceIndex(I, X) {\n return f(I, (i) => X[i]);\n }\n };\n}\n\nfunction reduceMaybeTemporalAccessor(f) {\n return {\n reduceIndex(I, X) {\n const x = f(I, (i) => X[i]);\n return isTemporal(X) ? new Date(x) : x;\n }\n };\n}\n\nexport const reduceIdentity = {\n reduceIndex(I, X) {\n return take(X, I);\n }\n};\n\nexport const reduceFirst = {\n reduceIndex(I, X) {\n return X[I[0]];\n }\n};\n\nconst reduceTitle = {\n reduceIndex(I, X) {\n const n = 5;\n const groups = sort(\n rollup(\n I,\n (V) => V.length,\n (i) => X[i]\n ),\n second\n );\n const top = groups.slice(-n).reverse();\n if (top.length < groups.length) {\n const bottom = groups.slice(0, 1 - n);\n top[n - 1] = [`\u2026 ${bottom.length.toLocaleString(\"en-US\")} more`, sum(bottom, second)];\n }\n return top.map(([key, value]) => `${key} (${value.toLocaleString(\"en-US\")})`).join(\"\\n\");\n }\n};\n\nconst reduceLast = {\n reduceIndex(I, X) {\n return X[I[I.length - 1]];\n }\n};\n\nexport const reduceCount = {\n label: \"Frequency\",\n reduceIndex(I) {\n return I.length;\n }\n};\n\nconst reduceDistinct = {\n label: \"Distinct\",\n reduceIndex(I, X) {\n const s = new InternSet();\n for (const i of I) s.add(X[i]);\n return s.size;\n }\n};\n\nconst reduceSum = reduceAccessor(sum);\n\nfunction reduceProportion(value, scope) {\n return value == null\n ? {scope, label: \"Frequency\", reduceIndex: (I, V, basis = 1) => I.length / basis}\n : {scope, reduceIndex: (I, V, basis = 1) => sum(I, (i) => V[i]) / basis};\n}\n", "import {InternSet, rollups} from \"d3\";\nimport {ascendingDefined, descendingDefined} from \"./defined.js\";\nimport {first, isColor, isEvery, isIterable, isOpacity, labelof, map, maybeValue, range, valueof} from \"./options.js\";\nimport {registry} from \"./scales/index.js\";\nimport {isSymbol, maybeSymbol} from \"./symbol.js\";\nimport {maybeReduce} from \"./transforms/group.js\";\n\nexport function createChannel(data, {scale, type, value, filter, hint}, name) {\n if (hint === undefined && typeof value?.transform === \"function\") hint = value.hint;\n return inferChannelScale(name, {\n scale,\n type,\n value: valueof(data, value),\n label: labelof(value),\n filter,\n hint\n });\n}\n\nexport function createChannels(channels, data) {\n return Object.fromEntries(\n Object.entries(channels).map(([name, channel]) => [name, createChannel(data, channel, name)])\n );\n}\n\n// TODO Use Float64Array for scales with numeric ranges, e.g. position?\nexport function valueObject(channels, scales) {\n const values = Object.fromEntries(\n Object.entries(channels).map(([name, {scale: scaleName, value}]) => {\n const scale = scaleName == null ? null : scales[scaleName];\n return [name, scale == null ? value : map(value, scale)];\n })\n );\n values.channels = channels; // expose channel state for advanced usage\n return values;\n}\n\n// If the channel uses the \"auto\" scale (or equivalently true), infer the scale\n// from the channel name and the provided values. For color and symbol channels,\n// no scale is applied if the values are literal; however for symbols, we must\n// promote symbol names (e.g., \"plus\") to symbol implementations (symbolPlus).\n// Note: mutates channel!\nexport function inferChannelScale(name, channel) {\n const {scale, value} = channel;\n if (scale === true || scale === \"auto\") {\n switch (name) {\n case \"fill\":\n case \"stroke\":\n case \"color\":\n channel.scale = scale !== true && isEvery(value, isColor) ? null : \"color\";\n break;\n case \"fillOpacity\":\n case \"strokeOpacity\":\n case \"opacity\":\n channel.scale = scale !== true && isEvery(value, isOpacity) ? null : \"opacity\";\n break;\n case \"symbol\":\n if (scale !== true && isEvery(value, isSymbol)) {\n channel.scale = null;\n channel.value = map(value, maybeSymbol);\n } else {\n channel.scale = \"symbol\";\n }\n break;\n default:\n channel.scale = registry.has(name) ? name : null;\n break;\n }\n } else if (scale === false) {\n channel.scale = null;\n } else if (scale != null && !registry.has(scale)) {\n throw new Error(`unknown scale: ${scale}`);\n }\n return channel;\n}\n\n// Note: mutates channel.domain! This is set to a function so that it is lazily\n// computed; i.e., if the scale\u2019s domain is set explicitly, that takes priority\n// over the sort option, and we don\u2019t need to do additional work.\nexport function channelDomain(data, facets, channels, facetChannels, options) {\n const {order: defaultOrder, reverse: defaultReverse, reduce: defaultReduce = true, limit: defaultLimit} = options;\n for (const x in options) {\n if (!registry.has(x)) continue; // ignore unknown scale keys (including generic options)\n let {value: y, order = defaultOrder, reverse = defaultReverse, reduce = defaultReduce, limit = defaultLimit} = maybeValue(options[x]); // prettier-ignore\n const negate = y?.startsWith(\"-\");\n if (negate) y = y.slice(1);\n order = order === undefined ? negate !== (y === \"width\" || y === \"height\") ? descendingGroup : ascendingGroup : maybeOrder(order); // prettier-ignore\n if (reduce == null || reduce === false) continue; // disabled reducer\n const X = x === \"fx\" || x === \"fy\" ? reindexFacetChannel(facets, facetChannels[x]) : findScaleChannel(channels, x);\n if (!X) throw new Error(`missing channel for scale: ${x}`);\n const XV = X.value;\n const [lo = 0, hi = Infinity] = isIterable(limit) ? limit : limit < 0 ? [limit] : [0, limit];\n if (y == null) {\n X.domain = () => {\n let domain = Array.from(new InternSet(XV)); // remove any duplicates\n if (reverse) domain = domain.reverse();\n if (lo !== 0 || hi !== Infinity) domain = domain.slice(lo, hi);\n return domain;\n };\n } else {\n const YV =\n y === \"data\"\n ? data\n : y === \"height\"\n ? difference(channels, \"y1\", \"y2\")\n : y === \"width\"\n ? difference(channels, \"x1\", \"x2\")\n : values(channels, y, y === \"y\" ? \"y2\" : y === \"x\" ? \"x2\" : undefined);\n const reducer = maybeReduce(reduce === true ? \"max\" : reduce, YV);\n X.domain = () => {\n let domain = rollups(\n range(XV),\n (I) => reducer.reduceIndex(I, YV),\n (i) => XV[i]\n );\n if (order) domain.sort(order);\n if (reverse) domain.reverse();\n if (lo !== 0 || hi !== Infinity) domain = domain.slice(lo, hi);\n return domain.map(first);\n };\n }\n }\n}\n\nfunction findScaleChannel(channels, scale) {\n for (const name in channels) {\n const channel = channels[name];\n if (channel.scale === scale) return channel;\n }\n}\n\n// Facet channels are not affected by transforms; so, to compute the domain of a\n// facet scale, we must first re-index the facet channel according to the\n// transformed mark index. Note: mutates channel, but that should be safe here?\nfunction reindexFacetChannel(facets, channel) {\n const originalFacets = facets.original;\n if (originalFacets === facets) return channel; // not transformed\n const V1 = channel.value;\n const V2 = (channel.value = []); // mutates channel!\n for (let i = 0; i < originalFacets.length; ++i) {\n const vi = V1[originalFacets[i][0]];\n for (const j of facets[i]) V2[j] = vi;\n }\n return channel;\n}\n\nfunction difference(channels, k1, k2) {\n const X1 = values(channels, k1);\n const X2 = values(channels, k2);\n return map(X2, (x2, i) => Math.abs(x2 - X1[i]), Float64Array);\n}\n\nfunction values(channels, name, alias) {\n let channel = channels[name];\n if (!channel && alias !== undefined) channel = channels[alias];\n if (channel) return channel.value;\n throw new Error(`missing channel: ${name}`);\n}\n\nfunction maybeOrder(order) {\n if (order == null || typeof order === \"function\") return order;\n switch (`${order}`.toLowerCase()) {\n case \"ascending\":\n return ascendingGroup;\n case \"descending\":\n return descendingGroup;\n }\n throw new Error(`invalid order: ${order}`);\n}\n\nfunction ascendingGroup([ak, av], [bk, bv]) {\n return ascendingDefined(av, bv) || ascendingDefined(ak, bk);\n}\n\nfunction descendingGroup([ak, av], [bk, bv]) {\n return descendingDefined(av, bv) || ascendingDefined(ak, bk);\n}\n\nexport function getSource(channels, key) {\n let channel = channels[key];\n if (!channel) return;\n while (channel.source) channel = channel.source;\n return channel.source === null ? null : channel;\n}\n", "import {creator, select} from \"d3\";\n\nexport function createContext(options = {}) {\n const {document = typeof window !== \"undefined\" ? window.document : undefined} = options;\n return {document};\n}\n\nexport function create(name, {document}) {\n return select(creator(name).call(document.documentElement));\n}\n", "let warnings = 0;\n\nexport function consumeWarnings() {\n const w = warnings;\n warnings = 0;\n return w;\n}\n\nexport function warn(message) {\n console.warn(message);\n ++warnings;\n}\n", "import {\n geoAlbers,\n geoAlbersUsa,\n geoAzimuthalEqualArea,\n geoAzimuthalEquidistant,\n geoClipRectangle,\n geoConicConformal,\n geoConicEqualArea,\n geoConicEquidistant,\n geoEqualEarth,\n geoEquirectangular,\n geoGnomonic,\n geoMercator,\n geoOrthographic,\n geoPath,\n geoStereographic,\n geoStream,\n geoTransform,\n geoTransverseMercator\n} from \"d3\";\nimport {valueObject} from \"./channel.js\";\nimport {coerceNumbers, constant, isObject} from \"./options.js\";\nimport {warn} from \"./warnings.js\";\n\nconst pi = Math.PI;\nconst tau = 2 * pi;\nconst defaultAspectRatio = 0.618;\n\nexport function createProjection(\n {\n projection,\n inset: globalInset = 0,\n insetTop = globalInset,\n insetRight = globalInset,\n insetBottom = globalInset,\n insetLeft = globalInset\n } = {},\n dimensions\n) {\n if (projection == null) return;\n if (typeof projection.stream === \"function\") return projection; // d3 projection\n let options;\n let domain;\n let clip = \"frame\";\n\n // If the projection was specified as an object with additional options,\n // extract those. The order of precedence for insetTop (and other insets) is:\n // projection.insetTop, projection.inset, (global) insetTop, (global) inset.\n // Any other options on this object will be passed through to the initializer.\n if (isObject(projection)) {\n let inset;\n ({\n type: projection,\n domain,\n inset,\n insetTop = inset !== undefined ? inset : insetTop,\n insetRight = inset !== undefined ? inset : insetRight,\n insetBottom = inset !== undefined ? inset : insetBottom,\n insetLeft = inset !== undefined ? inset : insetLeft,\n clip = clip,\n ...options\n } = projection);\n if (projection == null) return;\n }\n\n // For named projections, retrieve the corresponding projection initializer.\n if (typeof projection !== \"function\") ({type: projection} = namedProjection(projection));\n\n // Compute the frame dimensions and invoke the projection initializer.\n const {width, height, marginLeft, marginRight, marginTop, marginBottom} = dimensions;\n const dx = width - marginLeft - marginRight - insetLeft - insetRight;\n const dy = height - marginTop - marginBottom - insetTop - insetBottom;\n projection = projection?.({width: dx, height: dy, clip, ...options});\n\n // The projection initializer might decide to not use a projection.\n if (projection == null) return;\n clip = maybePostClip(clip, marginLeft, marginTop, width - marginRight, height - marginBottom);\n\n // Translate the origin to the top-left corner, respecting margins and insets.\n let tx = marginLeft + insetLeft;\n let ty = marginTop + insetTop;\n let transform;\n\n // If a domain is specified, fit the projection to the frame.\n if (domain != null) {\n const [[x0, y0], [x1, y1]] = geoPath(projection).bounds(domain);\n const k = Math.min(dx / (x1 - x0), dy / (y1 - y0));\n if (k > 0) {\n tx -= (k * (x0 + x1) - dx) / 2;\n ty -= (k * (y0 + y1) - dy) / 2;\n transform = geoTransform({\n point(x, y) {\n this.stream.point(x * k + tx, y * k + ty);\n }\n });\n } else {\n warn(`Warning: the projection could not be fit to the specified domain; using the default scale.`);\n }\n }\n\n transform ??=\n tx === 0 && ty === 0\n ? identity()\n : geoTransform({\n point(x, y) {\n this.stream.point(x + tx, y + ty);\n }\n });\n\n return {stream: (s) => projection.stream(transform.stream(clip(s)))};\n}\n\nfunction namedProjection(projection) {\n switch (`${projection}`.toLowerCase()) {\n case \"albers-usa\":\n return scaleProjection(geoAlbersUsa, 0.7463, 0.4673);\n case \"albers\":\n return conicProjection(geoAlbers, 0.7463, 0.4673);\n case \"azimuthal-equal-area\":\n return scaleProjection(geoAzimuthalEqualArea, 4, 4);\n case \"azimuthal-equidistant\":\n return scaleProjection(geoAzimuthalEquidistant, tau, tau);\n case \"conic-conformal\":\n return conicProjection(geoConicConformal, tau, tau);\n case \"conic-equal-area\":\n return conicProjection(geoConicEqualArea, 6.1702, 2.9781);\n case \"conic-equidistant\":\n return conicProjection(geoConicEquidistant, 7.312, 3.6282);\n case \"equal-earth\":\n return scaleProjection(geoEqualEarth, 5.4133, 2.6347);\n case \"equirectangular\":\n return scaleProjection(geoEquirectangular, tau, pi);\n case \"gnomonic\":\n return scaleProjection(geoGnomonic, 3.4641, 3.4641);\n case \"identity\":\n return {type: identity};\n case \"reflect-y\":\n return {type: reflectY};\n case \"mercator\":\n return scaleProjection(geoMercator, tau, tau);\n case \"orthographic\":\n return scaleProjection(geoOrthographic, 2, 2);\n case \"stereographic\":\n return scaleProjection(geoStereographic, 2, 2);\n case \"transverse-mercator\":\n return scaleProjection(geoTransverseMercator, tau, tau);\n default:\n throw new Error(`unknown projection type: ${projection}`);\n }\n}\n\nfunction maybePostClip(clip, x1, y1, x2, y2) {\n if (clip === false || clip == null || typeof clip === \"number\") return (s) => s;\n if (clip === true) clip = \"frame\";\n switch (`${clip}`.toLowerCase()) {\n case \"frame\":\n return geoClipRectangle(x1, y1, x2, y2);\n default:\n throw new Error(`unknown projection clip type: ${clip}`);\n }\n}\n\nfunction scaleProjection(createProjection, kx, ky) {\n return {\n type: ({width, height, rotate, precision = 0.15, clip}) => {\n const projection = createProjection();\n if (precision != null) projection.precision?.(precision);\n if (rotate != null) projection.rotate?.(rotate);\n if (typeof clip === \"number\") projection.clipAngle?.(clip);\n projection.scale(Math.min(width / kx, height / ky));\n projection.translate([width / 2, height / 2]);\n return projection;\n },\n aspectRatio: ky / kx\n };\n}\n\nfunction conicProjection(createProjection, kx, ky) {\n const {type, aspectRatio} = scaleProjection(createProjection, kx, ky);\n return {\n type: (options) => {\n const {parallels, domain, width, height} = options;\n const projection = type(options);\n if (parallels != null) {\n projection.parallels(parallels);\n if (domain === undefined) {\n projection.fitSize([width, height], {type: \"Sphere\"});\n }\n }\n return projection;\n },\n aspectRatio\n };\n}\n\nconst identity = constant({stream: (stream) => stream});\n\nconst reflectY = constant(\n geoTransform({\n point(x, y) {\n this.stream.point(x, -y);\n }\n })\n);\n\n// Applies a point-wise projection to the given paired x and y channels.\n// Note: mutates values!\nexport function project(cx, cy, values, projection) {\n const x = values[cx];\n const y = values[cy];\n const n = x.length;\n const X = (values[cx] = new Float64Array(n).fill(NaN));\n const Y = (values[cy] = new Float64Array(n).fill(NaN));\n let i;\n const stream = projection.stream({\n point(x, y) {\n X[i] = x;\n Y[i] = y;\n }\n });\n for (i = 0; i < n; ++i) {\n stream.point(x[i], y[i]);\n }\n}\n\n// Returns true if a projection was specified. This should match the logic of\n// createProjection above, and is called before we construct the projection.\n// (Though note that we ignore the edge case where the projection initializer\n// may return null.)\nexport function hasProjection({projection} = {}) {\n if (projection == null) return false;\n if (typeof projection.stream === \"function\") return true;\n if (isObject(projection)) projection = projection.type;\n return projection != null;\n}\n\n// When a named projection is specified, we can use its natural aspect ratio to\n// determine a good value for the projection\u2019s height based on the desired\n// width. When we don\u2019t have a way to know, the golden ratio is our best guess.\n// Due to a circular dependency (we need to know the height before we can\n// construct the projection), we have to test the raw projection option rather\n// than the materialized projection; therefore we must be extremely careful that\n// the logic of this function exactly matches createProjection above!\nexport function projectionAspectRatio(projection) {\n if (typeof projection?.stream === \"function\") return defaultAspectRatio;\n if (isObject(projection)) projection = projection.type;\n if (projection == null) return;\n if (typeof projection !== \"function\") {\n const {aspectRatio} = namedProjection(projection);\n if (aspectRatio) return aspectRatio;\n }\n return defaultAspectRatio;\n}\n\n// Extract the (possibly) scaled values for the x and y channels, and apply the\n// projection if any.\nexport function applyPosition(channels, scales, {projection}) {\n const {x, y} = channels;\n let position = {};\n if (x) position.x = x;\n if (y) position.y = y;\n position = valueObject(position, scales);\n if (projection && x?.scale === \"x\" && y?.scale === \"y\") project(\"x\", \"y\", position, projection);\n if (x) position.x = coerceNumbers(position.x);\n if (y) position.y = coerceNumbers(position.y);\n return position;\n}\n\nexport function getGeometryChannels(channel) {\n const X = [];\n const Y = [];\n const x = {scale: \"x\", value: X};\n const y = {scale: \"y\", value: Y};\n const sink = {\n point(x, y) {\n X.push(x);\n Y.push(y);\n },\n lineStart() {},\n lineEnd() {},\n polygonStart() {},\n polygonEnd() {},\n sphere() {}\n };\n for (const object of channel.value) geoStream(object, sink);\n return [x, y];\n}\n", "import {\n interpolateBlues,\n interpolateBrBG,\n interpolateBuGn,\n interpolateBuPu,\n interpolateGnBu,\n interpolateGreens,\n interpolateGreys,\n interpolateOranges,\n interpolateOrRd,\n interpolatePiYG,\n interpolatePRGn,\n interpolatePuBu,\n interpolatePuBuGn,\n interpolatePuOr,\n interpolatePuRd,\n interpolatePurples,\n interpolateRdBu,\n interpolateRdGy,\n interpolateRdPu,\n interpolateRdYlBu,\n interpolateRdYlGn,\n interpolateReds,\n interpolateSpectral,\n interpolateYlGn,\n interpolateYlGnBu,\n interpolateYlOrBr,\n interpolateYlOrRd,\n interpolateTurbo,\n interpolateViridis,\n interpolateMagma,\n interpolateInferno,\n interpolatePlasma,\n interpolateCividis,\n interpolateCubehelixDefault,\n interpolateWarm,\n interpolateCool,\n interpolateRainbow,\n interpolateSinebow,\n quantize,\n schemeAccent,\n schemeBlues,\n schemeBrBG,\n schemeBuGn,\n schemeBuPu,\n schemeCategory10,\n schemeDark2,\n schemeGnBu,\n schemeGreens,\n schemeGreys,\n schemeOranges,\n schemeOrRd,\n schemePaired,\n schemePastel1,\n schemePastel2,\n schemePiYG,\n schemePRGn,\n schemePuBu,\n schemePuBuGn,\n schemePuOr,\n schemePuRd,\n schemePurples,\n schemeRdBu,\n schemeRdGy,\n schemeRdPu,\n schemeRdYlBu,\n schemeRdYlGn,\n schemeReds,\n schemeSet1,\n schemeSet2,\n schemeSet3,\n schemeSpectral,\n schemeTableau10,\n schemeYlGn,\n schemeYlGnBu,\n schemeYlOrBr,\n schemeYlOrRd\n} from \"d3\";\n\nconst categoricalSchemes = new Map([\n [\"accent\", schemeAccent],\n [\"category10\", schemeCategory10],\n [\"dark2\", schemeDark2],\n [\"paired\", schemePaired],\n [\"pastel1\", schemePastel1],\n [\"pastel2\", schemePastel2],\n [\"set1\", schemeSet1],\n [\"set2\", schemeSet2],\n [\"set3\", schemeSet3],\n [\"tableau10\", schemeTableau10]\n]);\n\nexport function isCategoricalScheme(scheme) {\n return scheme != null && categoricalSchemes.has(`${scheme}`.toLowerCase());\n}\n\nconst ordinalSchemes = new Map([\n ...categoricalSchemes,\n\n // diverging\n [\"brbg\", scheme11(schemeBrBG, interpolateBrBG)],\n [\"prgn\", scheme11(schemePRGn, interpolatePRGn)],\n [\"piyg\", scheme11(schemePiYG, interpolatePiYG)],\n [\"puor\", scheme11(schemePuOr, interpolatePuOr)],\n [\"rdbu\", scheme11(schemeRdBu, interpolateRdBu)],\n [\"rdgy\", scheme11(schemeRdGy, interpolateRdGy)],\n [\"rdylbu\", scheme11(schemeRdYlBu, interpolateRdYlBu)],\n [\"rdylgn\", scheme11(schemeRdYlGn, interpolateRdYlGn)],\n [\"spectral\", scheme11(schemeSpectral, interpolateSpectral)],\n\n // reversed diverging (for temperature data)\n [\"burd\", scheme11r(schemeRdBu, interpolateRdBu)],\n [\"buylrd\", scheme11r(schemeRdYlBu, interpolateRdYlBu)],\n\n // sequential (single-hue)\n [\"blues\", scheme9(schemeBlues, interpolateBlues)],\n [\"greens\", scheme9(schemeGreens, interpolateGreens)],\n [\"greys\", scheme9(schemeGreys, interpolateGreys)],\n [\"oranges\", scheme9(schemeOranges, interpolateOranges)],\n [\"purples\", scheme9(schemePurples, interpolatePurples)],\n [\"reds\", scheme9(schemeReds, interpolateReds)],\n\n // sequential (multi-hue)\n [\"turbo\", schemei(interpolateTurbo)],\n [\"viridis\", schemei(interpolateViridis)],\n [\"magma\", schemei(interpolateMagma)],\n [\"inferno\", schemei(interpolateInferno)],\n [\"plasma\", schemei(interpolatePlasma)],\n [\"cividis\", schemei(interpolateCividis)],\n [\"cubehelix\", schemei(interpolateCubehelixDefault)],\n [\"warm\", schemei(interpolateWarm)],\n [\"cool\", schemei(interpolateCool)],\n [\"bugn\", scheme9(schemeBuGn, interpolateBuGn)],\n [\"bupu\", scheme9(schemeBuPu, interpolateBuPu)],\n [\"gnbu\", scheme9(schemeGnBu, interpolateGnBu)],\n [\"orrd\", scheme9(schemeOrRd, interpolateOrRd)],\n [\"pubu\", scheme9(schemePuBu, interpolatePuBu)],\n [\"pubugn\", scheme9(schemePuBuGn, interpolatePuBuGn)],\n [\"purd\", scheme9(schemePuRd, interpolatePuRd)],\n [\"rdpu\", scheme9(schemeRdPu, interpolateRdPu)],\n [\"ylgn\", scheme9(schemeYlGn, interpolateYlGn)],\n [\"ylgnbu\", scheme9(schemeYlGnBu, interpolateYlGnBu)],\n [\"ylorbr\", scheme9(schemeYlOrBr, interpolateYlOrBr)],\n [\"ylorrd\", scheme9(schemeYlOrRd, interpolateYlOrRd)],\n\n // cyclical\n [\"rainbow\", schemeicyclical(interpolateRainbow)],\n [\"sinebow\", schemeicyclical(interpolateSinebow)]\n]);\n\nfunction scheme9(scheme, interpolate) {\n return ({length: n}) => {\n if (n === 1) return [scheme[3][1]]; // favor midpoint\n if (n === 2) return [scheme[3][1], scheme[3][2]]; // favor darker\n n = Math.max(3, Math.floor(n));\n return n > 9 ? quantize(interpolate, n) : scheme[n];\n };\n}\n\nfunction scheme11(scheme, interpolate) {\n return ({length: n}) => {\n if (n === 2) return [scheme[3][0], scheme[3][2]]; // favor diverging extrema\n n = Math.max(3, Math.floor(n));\n return n > 11 ? quantize(interpolate, n) : scheme[n];\n };\n}\n\nfunction scheme11r(scheme, interpolate) {\n return ({length: n}) => {\n if (n === 2) return [scheme[3][2], scheme[3][0]]; // favor diverging extrema\n n = Math.max(3, Math.floor(n));\n return n > 11 ? quantize((t) => interpolate(1 - t), n) : scheme[n].slice().reverse();\n };\n}\n\nfunction schemei(interpolate) {\n return ({length: n}) => quantize(interpolate, Math.max(2, Math.floor(n)));\n}\n\nfunction schemeicyclical(interpolate) {\n return ({length: n}) => quantize(interpolate, Math.floor(n) + 1).slice(0, -1);\n}\n\nexport function ordinalScheme(scheme) {\n const s = `${scheme}`.toLowerCase();\n if (!ordinalSchemes.has(s)) throw new Error(`unknown ordinal scheme: ${s}`);\n return ordinalSchemes.get(s);\n}\n\nexport function ordinalRange(scheme, length) {\n const s = ordinalScheme(scheme);\n const r = typeof s === \"function\" ? s({length}) : s;\n return r.length !== length ? r.slice(0, length) : r;\n}\n\n// If the specified domain contains only booleans (ignoring null and undefined),\n// returns a corresponding range where false is mapped to the low color and true\n// is mapped to the high color of the specified scheme.\nexport function maybeBooleanRange(domain, scheme = \"greys\") {\n const range = new Set();\n const [f, t] = ordinalRange(scheme, 2);\n for (const value of domain) {\n if (value == null) continue;\n if (value === true) range.add(t);\n else if (value === false) range.add(f);\n else return;\n }\n return [...range];\n}\n\nconst quantitativeSchemes = new Map([\n // diverging\n [\"brbg\", interpolateBrBG],\n [\"prgn\", interpolatePRGn],\n [\"piyg\", interpolatePiYG],\n [\"puor\", interpolatePuOr],\n [\"rdbu\", interpolateRdBu],\n [\"rdgy\", interpolateRdGy],\n [\"rdylbu\", interpolateRdYlBu],\n [\"rdylgn\", interpolateRdYlGn],\n [\"spectral\", interpolateSpectral],\n\n // reversed diverging (for temperature data)\n [\"burd\", (t) => interpolateRdBu(1 - t)],\n [\"buylrd\", (t) => interpolateRdYlBu(1 - t)],\n\n // sequential (single-hue)\n [\"blues\", interpolateBlues],\n [\"greens\", interpolateGreens],\n [\"greys\", interpolateGreys],\n [\"purples\", interpolatePurples],\n [\"reds\", interpolateReds],\n [\"oranges\", interpolateOranges],\n\n // sequential (multi-hue)\n [\"turbo\", interpolateTurbo],\n [\"viridis\", interpolateViridis],\n [\"magma\", interpolateMagma],\n [\"inferno\", interpolateInferno],\n [\"plasma\", interpolatePlasma],\n [\"cividis\", interpolateCividis],\n [\"cubehelix\", interpolateCubehelixDefault],\n [\"warm\", interpolateWarm],\n [\"cool\", interpolateCool],\n [\"bugn\", interpolateBuGn],\n [\"bupu\", interpolateBuPu],\n [\"gnbu\", interpolateGnBu],\n [\"orrd\", interpolateOrRd],\n [\"pubugn\", interpolatePuBuGn],\n [\"pubu\", interpolatePuBu],\n [\"purd\", interpolatePuRd],\n [\"rdpu\", interpolateRdPu],\n [\"ylgnbu\", interpolateYlGnBu],\n [\"ylgn\", interpolateYlGn],\n [\"ylorbr\", interpolateYlOrBr],\n [\"ylorrd\", interpolateYlOrRd],\n\n // cyclical\n [\"rainbow\", interpolateRainbow],\n [\"sinebow\", interpolateSinebow]\n]);\n\nexport function quantitativeScheme(scheme) {\n const s = `${scheme}`.toLowerCase();\n if (!quantitativeSchemes.has(s)) throw new Error(`unknown quantitative scheme: ${s}`);\n return quantitativeSchemes.get(s);\n}\n\nconst divergingSchemes = new Set([\n \"brbg\",\n \"prgn\",\n \"piyg\",\n \"puor\",\n \"rdbu\",\n \"rdgy\",\n \"rdylbu\",\n \"rdylgn\",\n \"spectral\",\n \"burd\",\n \"buylrd\"\n]);\n\nexport function isDivergingScheme(scheme) {\n return scheme != null && divergingSchemes.has(`${scheme}`.toLowerCase());\n}\n", "import {\n descending,\n extent,\n interpolateHcl,\n interpolateHsl,\n interpolateLab,\n interpolateNumber,\n interpolateRgb,\n interpolateRound,\n max,\n median,\n min,\n piecewise,\n quantile,\n quantize,\n reverse as reverseof,\n scaleIdentity,\n scaleLinear,\n scaleLog,\n scalePow,\n scaleQuantile,\n scaleSymlog,\n scaleThreshold,\n ticks\n} from \"d3\";\nimport {finite, negative, positive} from \"../defined.js\";\nimport {arrayify, constant, maybeNiceInterval, maybeRangeInterval, orderof, slice} from \"../options.js\";\nimport {color, length, opacity, radius, registry} from \"./index.js\";\nimport {ordinalRange, quantitativeScheme} from \"./schemes.js\";\n\nexport const flip = (i) => (t) => i(1 - t);\nconst unit = [0, 1];\n\nconst interpolators = new Map([\n // numbers\n [\"number\", interpolateNumber],\n\n // color spaces\n [\"rgb\", interpolateRgb],\n [\"hsl\", interpolateHsl],\n [\"hcl\", interpolateHcl],\n [\"lab\", interpolateLab]\n]);\n\nexport function maybeInterpolator(interpolate) {\n const i = `${interpolate}`.toLowerCase();\n if (!interpolators.has(i)) throw new Error(`unknown interpolator: ${i}`);\n return interpolators.get(i);\n}\n\nexport function createScaleQ(\n key,\n scale,\n channels,\n {\n type,\n nice,\n clamp,\n zero,\n domain = inferAutoDomain(key, channels),\n unknown,\n round,\n scheme,\n interval,\n range = registry.get(key) === radius\n ? inferRadialRange(channels, domain)\n : registry.get(key) === length\n ? inferLengthRange(channels, domain)\n : registry.get(key) === opacity\n ? unit\n : undefined,\n interpolate = registry.get(key) === color\n ? scheme == null && range !== undefined\n ? interpolateRgb\n : quantitativeScheme(scheme !== undefined ? scheme : type === \"cyclical\" ? \"rainbow\" : \"turbo\")\n : round\n ? interpolateRound\n : interpolateNumber,\n reverse\n }\n) {\n interval = maybeRangeInterval(interval, type);\n if (type === \"cyclical\" || type === \"sequential\") type = \"linear\"; // shorthand for color schemes\n if (typeof interpolate !== \"function\") interpolate = maybeInterpolator(interpolate); // named interpolator\n reverse = !!reverse;\n\n // If an explicit range is specified, and it has a different length than the\n // domain, then redistribute the range using a piecewise interpolator.\n if (range !== undefined) {\n const n = (domain = arrayify(domain)).length;\n const m = (range = arrayify(range)).length;\n if (n !== m) {\n if (interpolate.length === 1) throw new Error(\"invalid piecewise interpolator\"); // e.g., turbo\n interpolate = piecewise(interpolate, range);\n range = undefined;\n }\n }\n\n // Disambiguate between a two-argument interpolator that is used in\n // conjunction with the range, and a one-argument \u201Cfixed\u201D interpolator on the\n // [0, 1] interval as with the RdBu color scheme.\n if (interpolate.length === 1) {\n if (reverse) {\n interpolate = flip(interpolate);\n reverse = false;\n }\n if (range === undefined) {\n range = Float64Array.from(domain, (_, i) => i / (domain.length - 1));\n if (range.length === 2) range = unit; // optimize common case of [0, 1]\n }\n scale.interpolate((range === unit ? constant : interpolatePiecewise)(interpolate));\n } else {\n scale.interpolate(interpolate);\n }\n\n // If a zero option is specified, we assume that the domain is numeric, and we\n // want to ensure that the domain crosses zero. However, note that the domain\n // may be reversed (descending) so we shouldn\u2019t assume that the first value is\n // smaller than the last; and also it\u2019s possible that the domain has more than\n // two values for a \u201Cpoly\u201D scale. And lastly be careful not to mutate input!\n if (zero) {\n const [min, max] = extent(domain);\n if (min > 0 || max < 0) {\n domain = slice(domain);\n if (orderof(domain) !== Math.sign(min)) domain[domain.length - 1] = 0; // [2, 1] or [-2, -1]\n else domain[0] = 0; // [1, 2] or [-1, -2]\n }\n }\n\n if (reverse) domain = reverseof(domain);\n scale.domain(domain).unknown(unknown);\n if (nice) scale.nice(maybeNice(nice, type)), (domain = scale.domain());\n if (range !== undefined) scale.range(range);\n if (clamp) scale.clamp(clamp);\n return {type, domain, range, scale, interpolate, interval};\n}\n\nfunction maybeNice(nice, type) {\n return nice === true ? undefined : typeof nice === \"number\" ? nice : maybeNiceInterval(nice, type);\n}\n\nexport function createScaleLinear(key, channels, options) {\n return createScaleQ(key, scaleLinear(), channels, options);\n}\n\nexport function createScaleSqrt(key, channels, options) {\n return createScalePow(key, channels, {...options, exponent: 0.5});\n}\n\nexport function createScalePow(key, channels, {exponent = 1, ...options}) {\n return createScaleQ(key, scalePow().exponent(exponent), channels, {...options, type: \"pow\"});\n}\n\nexport function createScaleLog(key, channels, {base = 10, domain = inferLogDomain(channels), ...options}) {\n return createScaleQ(key, scaleLog().base(base), channels, {...options, domain});\n}\n\nexport function createScaleSymlog(key, channels, {constant = 1, ...options}) {\n return createScaleQ(key, scaleSymlog().constant(constant), channels, options);\n}\n\nexport function createScaleQuantile(\n key,\n channels,\n {\n range,\n quantiles = range === undefined ? 5 : (range = [...range]).length, // deprecated; use n instead\n n = quantiles,\n scheme = \"rdylbu\",\n domain = inferQuantileDomain(channels),\n unknown,\n interpolate,\n reverse\n }\n) {\n if (range === undefined) {\n range =\n interpolate !== undefined\n ? quantize(interpolate, n)\n : registry.get(key) === color\n ? ordinalRange(scheme, n)\n : undefined;\n }\n if (domain.length > 0) {\n domain = scaleQuantile(domain, range === undefined ? {length: n} : range).quantiles();\n }\n return createScaleThreshold(key, channels, {domain, range, reverse, unknown});\n}\n\nexport function createScaleQuantize(\n key,\n channels,\n {\n range,\n n = range === undefined ? 5 : (range = [...range]).length,\n scheme = \"rdylbu\",\n domain = inferAutoDomain(key, channels),\n unknown,\n interpolate,\n reverse\n }\n) {\n const [min, max] = extent(domain);\n let thresholds;\n if (range === undefined) {\n thresholds = ticks(min, max, n); // approximate number of nice, round thresholds\n if (thresholds[0] <= min) thresholds.splice(0, 1); // drop exact lower bound\n if (thresholds[thresholds.length - 1] >= max) thresholds.pop(); // drop exact upper bound\n n = thresholds.length + 1;\n range =\n interpolate !== undefined\n ? quantize(interpolate, n)\n : registry.get(key) === color\n ? ordinalRange(scheme, n)\n : undefined;\n } else {\n thresholds = quantize(interpolateNumber(min, max), n + 1).slice(1, -1); // exactly n - 1 thresholds to match range\n if (min instanceof Date) thresholds = thresholds.map((x) => new Date(x)); // preserve date types\n }\n if (orderof(arrayify(domain)) < 0) thresholds.reverse(); // preserve descending domain\n return createScaleThreshold(key, channels, {domain: thresholds, range, reverse, unknown});\n}\n\nexport function createScaleThreshold(\n key,\n channels,\n {\n domain = [0], // explicit thresholds in ascending order\n unknown,\n scheme = \"rdylbu\",\n interpolate,\n range = interpolate !== undefined\n ? quantize(interpolate, domain.length + 1)\n : registry.get(key) === color\n ? ordinalRange(scheme, domain.length + 1)\n : undefined,\n reverse\n }\n) {\n domain = arrayify(domain);\n const sign = orderof(domain); // preserve descending domain\n if (!isNaN(sign) && !isOrdered(domain, sign)) throw new Error(`the ${key} scale has a non-monotonic domain`);\n if (reverse) range = reverseof(range); // domain ascending, so reverse range\n return {\n type: \"threshold\",\n scale: scaleThreshold(sign < 0 ? reverseof(domain) : domain, range === undefined ? [] : range).unknown(unknown),\n domain,\n range\n };\n}\n\nfunction isOrdered(domain, sign) {\n for (let i = 1, n = domain.length, d = domain[0]; i < n; ++i) {\n const s = descending(d, (d = domain[i]));\n if (s !== 0 && s !== sign) return false;\n }\n return true;\n}\n\nexport function createScaleIdentity() {\n return {type: \"identity\", scale: scaleIdentity()};\n}\n\nexport function inferDomain(channels, f = finite) {\n return channels.length\n ? [\n min(channels, ({value}) => (value === undefined ? value : min(value, f))),\n max(channels, ({value}) => (value === undefined ? value : max(value, f)))\n ]\n : [0, 1];\n}\n\nfunction inferAutoDomain(key, channels) {\n const type = registry.get(key);\n return (type === radius || type === opacity || type === length ? inferZeroDomain : inferDomain)(channels);\n}\n\nfunction inferZeroDomain(channels) {\n return [0, channels.length ? max(channels, ({value}) => (value === undefined ? value : max(value, finite))) : 1];\n}\n\n// We don\u2019t want the upper bound of the radial domain to be zero, as this would\n// be degenerate, so we ignore nonpositive values. We also don\u2019t want the\n// maximum default radius to exceed 30px.\nfunction inferRadialRange(channels, domain) {\n const hint = channels.find(({radius}) => radius !== undefined);\n if (hint !== undefined) return [0, hint.radius]; // a natural maximum radius, e.g. hexbins\n const h25 = quantile(channels, 0.5, ({value}) => (value === undefined ? NaN : quantile(value, 0.25, positive)));\n const range = domain.map((d) => 3 * Math.sqrt(d / h25));\n const k = 30 / max(range);\n return k < 1 ? range.map((r) => r * k) : range;\n}\n\n// We want a length scale\u2019s domain to go from zero to a positive value, and to\n// treat negative lengths if any as inverted vectors of equivalent magnitude. We\n// also don\u2019t want the maximum default length to exceed 60px.\nfunction inferLengthRange(channels, domain) {\n const h50 = median(channels, ({value}) => (value === undefined ? NaN : median(value, Math.abs)));\n const range = domain.map((d) => (12 * d) / h50);\n const k = 60 / max(range);\n return k < 1 ? range.map((r) => r * k) : range;\n}\n\nfunction inferLogDomain(channels) {\n for (const {value} of channels) {\n if (value !== undefined) {\n for (let v of value) {\n if (v > 0) return inferDomain(channels, positive);\n if (v < 0) return inferDomain(channels, negative);\n }\n }\n }\n return [1, 10];\n}\n\nfunction inferQuantileDomain(channels) {\n const domain = [];\n for (const {value} of channels) {\n if (value === undefined) continue;\n for (const v of value) domain.push(v);\n }\n return domain;\n}\n\nexport function interpolatePiecewise(interpolate) {\n return (i, j) => (t) => interpolate(i + t * (j - i));\n}\n", "import {\n descending,\n interpolateNumber,\n interpolateRgb,\n piecewise,\n scaleDiverging,\n scaleDivergingLog,\n scaleDivergingPow,\n scaleDivergingSymlog\n} from \"d3\";\nimport {negative, positive} from \"../defined.js\";\nimport {arrayify} from \"../options.js\";\nimport {warn} from \"../warnings.js\";\nimport {color, registry} from \"./index.js\";\nimport {flip, inferDomain, interpolatePiecewise, maybeInterpolator} from \"./quantitative.js\";\nimport {quantitativeScheme} from \"./schemes.js\";\n\nfunction createScaleD(\n key,\n scale,\n transform,\n channels,\n {\n type,\n nice,\n clamp,\n domain = inferDomain(channels),\n unknown,\n pivot = 0,\n scheme,\n range,\n symmetric = true,\n interpolate = registry.get(key) === color\n ? scheme == null && range !== undefined\n ? interpolateRgb\n : quantitativeScheme(scheme !== undefined ? scheme : \"rdbu\")\n : interpolateNumber,\n reverse\n }\n) {\n pivot = +pivot;\n domain = arrayify(domain);\n let [min, max] = domain;\n if (domain.length > 2) warn(`Warning: the diverging ${key} scale domain contains extra elements.`);\n\n if (descending(min, max) < 0) ([min, max] = [max, min]), (reverse = !reverse);\n min = Math.min(min, pivot);\n max = Math.max(max, pivot);\n\n // Sometimes interpolate is a named interpolator, such as \"lab\" for Lab color\n // space. Other times interpolate is a function that takes two arguments and\n // is used in conjunction with the range. And other times the interpolate\n // function is a \u201Cfixed\u201D interpolator on the [0, 1] interval, as when a\n // color scheme such as interpolateRdBu is used.\n if (typeof interpolate !== \"function\") {\n interpolate = maybeInterpolator(interpolate);\n }\n\n // If an explicit range is specified, promote it to a piecewise interpolator.\n if (range !== undefined) {\n interpolate =\n interpolate.length === 1 ? interpolatePiecewise(interpolate)(...range) : piecewise(interpolate, range);\n }\n\n // Reverse before normalization.\n if (reverse) interpolate = flip(interpolate);\n\n // Normalize the interpolator for symmetric difference around the pivot.\n if (symmetric) {\n const mid = transform.apply(pivot);\n const mindelta = mid - transform.apply(min);\n const maxdelta = transform.apply(max) - mid;\n if (mindelta < maxdelta) min = transform.invert(mid - maxdelta);\n else if (mindelta > maxdelta) max = transform.invert(mid + mindelta);\n }\n\n scale.domain([min, pivot, max]).unknown(unknown).interpolator(interpolate);\n if (clamp) scale.clamp(clamp);\n if (nice) scale.nice(nice);\n return {type, domain: [min, max], pivot, interpolate, scale};\n}\n\nexport function createScaleDiverging(key, channels, options) {\n return createScaleD(key, scaleDiverging(), transformIdentity, channels, options);\n}\n\nexport function createScaleDivergingSqrt(key, channels, options) {\n return createScaleDivergingPow(key, channels, {...options, exponent: 0.5});\n}\n\nexport function createScaleDivergingPow(key, channels, {exponent = 1, ...options}) {\n return createScaleD(key, scaleDivergingPow().exponent((exponent = +exponent)), transformPow(exponent), channels, {\n ...options,\n type: \"diverging-pow\"\n });\n}\n\nexport function createScaleDivergingLog(\n key,\n channels,\n {base = 10, pivot = 1, domain = inferDomain(channels, pivot < 0 ? negative : positive), ...options}\n) {\n return createScaleD(key, scaleDivergingLog().base((base = +base)), transformLog, channels, {\n domain,\n pivot,\n ...options\n });\n}\n\nexport function createScaleDivergingSymlog(key, channels, {constant = 1, ...options}) {\n return createScaleD(\n key,\n scaleDivergingSymlog().constant((constant = +constant)),\n transformSymlog(constant),\n channels,\n options\n );\n}\n\nconst transformIdentity = {\n apply(x) {\n return x;\n },\n invert(x) {\n return x;\n }\n};\n\nconst transformLog = {\n apply: Math.log,\n invert: Math.exp\n};\n\nconst transformSqrt = {\n apply(x) {\n return Math.sign(x) * Math.sqrt(Math.abs(x));\n },\n invert(x) {\n return Math.sign(x) * (x * x);\n }\n};\n\nfunction transformPow(exponent) {\n return exponent === 0.5\n ? transformSqrt\n : {\n apply(x) {\n return Math.sign(x) * Math.pow(Math.abs(x), exponent);\n },\n invert(x) {\n return Math.sign(x) * Math.pow(Math.abs(x), 1 / exponent);\n }\n };\n}\n\nfunction transformSymlog(constant) {\n return {\n apply(x) {\n return Math.sign(x) * Math.log1p(Math.abs(x / constant));\n },\n invert(x) {\n return Math.sign(x) * Math.expm1(Math.abs(x)) * constant;\n }\n };\n}\n", "import {scaleTime, scaleUtc} from \"d3\";\nimport {createScaleQ} from \"./quantitative.js\";\n\nfunction createScaleT(key, scale, channels, options) {\n return createScaleQ(key, scale, channels, options);\n}\n\nexport function createScaleTime(key, channels, options) {\n return createScaleT(key, scaleTime(), channels, options);\n}\n\nexport function createScaleUtc(key, channels, options) {\n return createScaleT(key, scaleUtc(), channels, options);\n}\n", "import {InternSet, extent, quantize, reverse as reverseof, sort, symbolsFill, symbolsStroke} from \"d3\";\nimport {scaleBand, scaleOrdinal, scalePoint, scaleImplicit} from \"d3\";\nimport {ascendingDefined} from \"../defined.js\";\nimport {isNoneish, map, maybeRangeInterval} from \"../options.js\";\nimport {maybeSymbol} from \"../symbol.js\";\nimport {registry, color, position, symbol} from \"./index.js\";\nimport {maybeBooleanRange, ordinalScheme, quantitativeScheme} from \"./schemes.js\";\n\n// This denotes an implicitly ordinal color scale: the scale type was not set,\n// but the associated values are strings or booleans. If the associated defined\n// values are entirely boolean, the range will default to greys. You can opt out\n// of this by setting the type explicitly.\nexport const ordinalImplicit = Symbol(\"ordinal\");\n\nfunction createScaleO(key, scale, channels, {type, interval, domain, range, reverse, hint}) {\n interval = maybeRangeInterval(interval, type);\n if (domain === undefined) domain = inferDomain(channels, interval, key);\n if (type === \"categorical\" || type === ordinalImplicit) type = \"ordinal\"; // shorthand for color schemes\n if (reverse) domain = reverseof(domain);\n scale.domain(domain);\n if (range !== undefined) {\n // If the range is specified as a function, pass it the domain.\n if (typeof range === \"function\") range = range(domain);\n scale.range(range);\n }\n return {type, domain, range, scale, hint, interval};\n}\n\nexport function createScaleOrdinal(key, channels, {type, interval, domain, range, scheme, unknown, ...options}) {\n interval = maybeRangeInterval(interval, type);\n if (domain === undefined) domain = inferDomain(channels, interval, key);\n let hint;\n if (registry.get(key) === symbol) {\n hint = inferSymbolHint(channels);\n range = range === undefined ? inferSymbolRange(hint) : map(range, maybeSymbol);\n } else if (registry.get(key) === color) {\n if (range === undefined && (type === \"ordinal\" || type === ordinalImplicit)) {\n range = maybeBooleanRange(domain, scheme);\n if (range !== undefined) scheme = undefined; // Don\u2019t re-apply scheme.\n }\n if (scheme === undefined && range === undefined) {\n scheme = type === \"ordinal\" ? \"turbo\" : \"tableau10\";\n }\n if (scheme !== undefined) {\n if (range !== undefined) {\n const interpolate = quantitativeScheme(scheme);\n const t0 = range[0],\n d = range[1] - range[0];\n range = ({length: n}) => quantize((t) => interpolate(t0 + d * t), n);\n } else {\n range = ordinalScheme(scheme);\n }\n }\n }\n if (unknown === scaleImplicit) {\n throw new Error(`implicit unknown on ${key} scale is not supported`);\n }\n return createScaleO(key, scaleOrdinal().unknown(unknown), channels, {...options, type, domain, range, hint});\n}\n\nexport function createScalePoint(key, channels, {align = 0.5, padding = 0.5, ...options}) {\n return maybeRound(scalePoint().align(align).padding(padding), channels, options, key);\n}\n\nexport function createScaleBand(\n key,\n channels,\n {\n align = 0.5,\n padding = 0.1,\n paddingInner = padding,\n paddingOuter = key === \"fx\" || key === \"fy\" ? 0 : padding,\n ...options\n }\n) {\n return maybeRound(\n scaleBand().align(align).paddingInner(paddingInner).paddingOuter(paddingOuter),\n channels,\n options,\n key\n );\n}\n\nfunction maybeRound(scale, channels, options, key) {\n let {round} = options;\n if (round !== undefined) scale.round((round = !!round));\n scale = createScaleO(key, scale, channels, options);\n scale.round = round; // preserve for autoScaleRound\n return scale;\n}\n\nfunction inferDomain(channels, interval, key) {\n const values = new InternSet();\n for (const {value, domain} of channels) {\n if (domain !== undefined) return domain(); // see channelDomain\n if (value === undefined) continue;\n for (const v of value) values.add(v);\n }\n if (interval !== undefined) {\n const [min, max] = extent(values).map(interval.floor, interval);\n return interval.range(min, interval.offset(max));\n }\n if (values.size > 10e3 && registry.get(key) === position) {\n throw new Error(`implicit ordinal domain of ${key} scale has more than 10,000 values`);\n }\n return sort(values, ascendingDefined);\n}\n\n// If all channels provide a consistent hint, propagate it to the scale.\nfunction inferHint(channels, key) {\n let value;\n for (const {hint} of channels) {\n const candidate = hint?.[key];\n if (candidate === undefined) continue; // no hint here\n if (value === undefined) value = candidate;\n // first hint\n else if (value !== candidate) return; // inconsistent hint\n }\n return value;\n}\n\nfunction inferSymbolHint(channels) {\n return {\n fill: inferHint(channels, \"fill\"),\n stroke: inferHint(channels, \"stroke\")\n };\n}\n\nfunction inferSymbolRange(hint) {\n return isNoneish(hint.fill) ? symbolsStroke : symbolsFill;\n}\n", "import {\n isOrdinal,\n isTemporal,\n isTemporalString,\n isNumericString,\n isScaleOptions,\n map,\n slice,\n coerceNumbers,\n coerceDates\n} from \"./options.js\";\nimport {registry, color, position, radius, opacity, symbol, length} from \"./scales/index.js\";\nimport {\n createScaleLinear,\n createScaleSqrt,\n createScalePow,\n createScaleLog,\n createScaleSymlog,\n createScaleQuantile,\n createScaleQuantize,\n createScaleThreshold,\n createScaleIdentity\n} from \"./scales/quantitative.js\";\nimport {\n createScaleDiverging,\n createScaleDivergingSqrt,\n createScaleDivergingPow,\n createScaleDivergingLog,\n createScaleDivergingSymlog\n} from \"./scales/diverging.js\";\nimport {isCategoricalScheme, isDivergingScheme} from \"./scales/schemes.js\";\nimport {createScaleTime, createScaleUtc} from \"./scales/temporal.js\";\nimport {createScaleOrdinal, createScalePoint, createScaleBand, ordinalImplicit} from \"./scales/ordinal.js\";\nimport {maybeSymbol} from \"./symbol.js\";\nimport {warn} from \"./warnings.js\";\n\nexport function createScales(\n channelsByScale,\n {\n label: globalLabel,\n inset: globalInset = 0,\n insetTop: globalInsetTop = globalInset,\n insetRight: globalInsetRight = globalInset,\n insetBottom: globalInsetBottom = globalInset,\n insetLeft: globalInsetLeft = globalInset,\n round,\n nice,\n clamp,\n zero,\n align,\n padding,\n projection,\n facet: {label: facetLabel = globalLabel} = {},\n ...options\n } = {}\n) {\n const scales = {};\n for (const [key, channels] of channelsByScale) {\n const scaleOptions = options[key];\n const scale = createScale(key, channels, {\n round: registry.get(key) === position ? round : undefined, // only for position\n nice,\n clamp,\n zero,\n align,\n padding,\n projection,\n ...scaleOptions\n });\n if (scale) {\n // populate generic scale options (percent, transform, insets)\n let {\n label = key === \"fx\" || key === \"fy\" ? facetLabel : globalLabel,\n percent,\n transform,\n inset,\n insetTop = inset !== undefined ? inset : key === \"y\" ? globalInsetTop : 0, // not fy\n insetRight = inset !== undefined ? inset : key === \"x\" ? globalInsetRight : 0, // not fx\n insetBottom = inset !== undefined ? inset : key === \"y\" ? globalInsetBottom : 0, // not fy\n insetLeft = inset !== undefined ? inset : key === \"x\" ? globalInsetLeft : 0 // not fx\n } = scaleOptions || {};\n if (transform == null) transform = undefined;\n else if (typeof transform !== \"function\") throw new Error(\"invalid scale transform; not a function\");\n scale.percent = !!percent;\n scale.label = label === undefined ? inferScaleLabel(channels, scale) : label;\n scale.transform = transform;\n if (key === \"x\" || key === \"fx\") {\n scale.insetLeft = +insetLeft;\n scale.insetRight = +insetRight;\n } else if (key === \"y\" || key === \"fy\") {\n scale.insetTop = +insetTop;\n scale.insetBottom = +insetBottom;\n }\n scales[key] = scale;\n }\n }\n return scales;\n}\n\nexport function createScaleFunctions(scales) {\n return Object.fromEntries(\n Object.entries(scales)\n .filter(([, {scale}]) => scale) // drop identity scales\n .map(([name, {scale, type, interval, label}]) => {\n scale.type = type; // for axis\n if (interval != null) scale.interval = interval; // for axis\n if (label != null) scale.label = label; // for axis\n return [name, scale];\n })\n );\n}\n\n// Mutates scale.range!\nexport function autoScaleRange(scales, dimensions) {\n const {x, y, fx, fy} = scales;\n const superdimensions = fx || fy ? outerDimensions(dimensions) : dimensions;\n if (fx) autoScaleRangeX(fx, superdimensions);\n if (fy) autoScaleRangeY(fy, superdimensions);\n const subdimensions = fx || fy ? innerDimensions(scales, dimensions) : dimensions;\n if (x) autoScaleRangeX(x, subdimensions);\n if (y) autoScaleRangeY(y, subdimensions);\n}\n\n// Channels can have labels; if all the channels for a given scale are\n// consistently labeled (i.e., have the same value if not undefined), and the\n// corresponding scale doesn\u2019t already have an explicit label, then the\n// channels\u2019 label is promoted to the scale. This inferred label should have an\n// orientation-appropriate arrow added when used as an axis, but we don\u2019t want\n// to add the arrow when the label is set explicitly as an option; so, the\n// inferred label is distinguished as an object with an \u201Cinferred\u201D property.\nfunction inferScaleLabel(channels = [], scale) {\n let label;\n for (const {label: l} of channels) {\n if (l === undefined) continue;\n if (label === undefined) label = l;\n else if (label !== l) return;\n }\n if (label === undefined) return;\n if (!isOrdinalScale(scale) && scale.percent) label = `${label} (%)`;\n return {inferred: true, toString: () => label};\n}\n\n// Returns the dimensions of the outer frame; this is subdivided into facets\n// with the margins of each facet collapsing into the outer margins.\nexport function outerDimensions(dimensions) {\n const {\n marginTop,\n marginRight,\n marginBottom,\n marginLeft,\n width,\n height,\n facet: {\n marginTop: facetMarginTop,\n marginRight: facetMarginRight,\n marginBottom: facetMarginBottom,\n marginLeft: facetMarginLeft\n }\n } = dimensions;\n return {\n marginTop: Math.max(marginTop, facetMarginTop),\n marginRight: Math.max(marginRight, facetMarginRight),\n marginBottom: Math.max(marginBottom, facetMarginBottom),\n marginLeft: Math.max(marginLeft, facetMarginLeft),\n width,\n height\n };\n}\n\n// Returns the dimensions of each facet.\nexport function innerDimensions({fx, fy}, dimensions) {\n const {marginTop, marginRight, marginBottom, marginLeft, width, height} = outerDimensions(dimensions);\n return {\n marginTop,\n marginRight,\n marginBottom,\n marginLeft,\n width: fx ? fx.scale.bandwidth() + marginLeft + marginRight : width,\n height: fy ? fy.scale.bandwidth() + marginTop + marginBottom : height,\n facet: {width, height}\n };\n}\n\nfunction autoScaleRangeX(scale, dimensions) {\n if (scale.range === undefined) {\n const {insetLeft, insetRight} = scale;\n const {width, marginLeft = 0, marginRight = 0} = dimensions;\n const left = marginLeft + insetLeft;\n const right = width - marginRight - insetRight;\n scale.range = [left, Math.max(left, right)];\n if (!isOrdinalScale(scale)) scale.range = piecewiseRange(scale);\n scale.scale.range(scale.range);\n }\n autoScaleRound(scale);\n}\n\nfunction autoScaleRangeY(scale, dimensions) {\n if (scale.range === undefined) {\n const {insetTop, insetBottom} = scale;\n const {height, marginTop = 0, marginBottom = 0} = dimensions;\n const top = marginTop + insetTop;\n const bottom = height - marginBottom - insetBottom;\n scale.range = [Math.max(top, bottom), top];\n if (!isOrdinalScale(scale)) scale.range = piecewiseRange(scale);\n else scale.range.reverse();\n scale.scale.range(scale.range);\n }\n autoScaleRound(scale);\n}\n\nfunction autoScaleRound(scale) {\n if (scale.round === undefined && isBandScale(scale) && roundError(scale) <= 30) {\n scale.scale.round(true);\n }\n}\n\n// If we were to turn on rounding for this band or point scale, how much wasted\n// space would it introduce (on both ends of the range)? This must match\n// d3.scaleBand\u2019s rounding behavior:\n// https://github.com/d3/d3-scale/blob/83555bd759c7314420bd4240642beda5e258db9e/src/band.js#L20-L32\nfunction roundError({scale}) {\n const n = scale.domain().length;\n const [start, stop] = scale.range();\n const paddingInner = scale.paddingInner ? scale.paddingInner() : 1;\n const paddingOuter = scale.paddingOuter ? scale.paddingOuter() : scale.padding();\n const m = n - paddingInner;\n const step = Math.abs(stop - start) / Math.max(1, m + paddingOuter * 2);\n return (step - Math.floor(step)) * m;\n}\n\nfunction piecewiseRange(scale) {\n const length = scale.scale.domain().length + isThresholdScale(scale);\n if (!(length > 2)) return scale.range;\n const [start, end] = scale.range;\n return Array.from({length}, (_, i) => start + (i / (length - 1)) * (end - start));\n}\n\nexport function normalizeScale(key, scale, hint) {\n return createScale(key, hint === undefined ? undefined : [{hint}], {...scale});\n}\n\nfunction createScale(key, channels = [], options = {}) {\n const type = inferScaleType(key, channels, options);\n\n // Warn for common misuses of implicit ordinal scales. We disable this test if\n // you specify a scale interval or if you set the domain or range explicitly,\n // since setting the domain or range (typically with a cardinality of more than\n // two) is another indication that you intended for the scale to be ordinal; we\n // also disable it for facet scales since these are always band scales.\n if (\n options.type === undefined &&\n options.domain === undefined &&\n options.range === undefined &&\n options.interval == null &&\n key !== \"fx\" &&\n key !== \"fy\" &&\n isOrdinalScale({type})\n ) {\n const values = channels.map(({value}) => value).filter((value) => value !== undefined);\n if (values.some(isTemporal))\n warn(\n `Warning: some data associated with the ${key} scale are dates. Dates are typically associated with a \"utc\" or \"time\" scale rather than a \"${formatScaleType(\n type\n )}\" scale. If you are using a bar mark, you probably want a rect mark with the interval option instead; if you are using a group transform, you probably want a bin transform instead. If you want to treat this data as ordinal, you can specify the interval of the ${key} scale (e.g., d3.utcDay), or you can suppress this warning by setting the type of the ${key} scale to \"${formatScaleType(\n type\n )}\".`\n );\n else if (values.some(isTemporalString))\n warn(\n `Warning: some data associated with the ${key} scale are strings that appear to be dates (e.g., YYYY-MM-DD). If these strings represent dates, you should parse them to Date objects. Dates are typically associated with a \"utc\" or \"time\" scale rather than a \"${formatScaleType(\n type\n )}\" scale. If you are using a bar mark, you probably want a rect mark with the interval option instead; if you are using a group transform, you probably want a bin transform instead. If you want to treat this data as ordinal, you can suppress this warning by setting the type of the ${key} scale to \"${formatScaleType(\n type\n )}\".`\n );\n else if (values.some(isNumericString))\n warn(\n `Warning: some data associated with the ${key} scale are strings that appear to be numbers. If these strings represent numbers, you should parse or coerce them to numbers. Numbers are typically associated with a \"linear\" scale rather than a \"${formatScaleType(\n type\n )}\" scale. If you want to treat this data as ordinal, you can specify the interval of the ${key} scale (e.g., 1 for integers), or you can suppress this warning by setting the type of the ${key} scale to \"${formatScaleType(\n type\n )}\".`\n );\n }\n\n options.type = type; // Mutates input!\n\n // Once the scale type is known, coerce the associated channel values and any\n // explicitly-specified domain to the expected type.\n switch (type) {\n case \"diverging\":\n case \"diverging-sqrt\":\n case \"diverging-pow\":\n case \"diverging-log\":\n case \"diverging-symlog\":\n case \"cyclical\":\n case \"sequential\":\n case \"linear\":\n case \"sqrt\":\n case \"threshold\":\n case \"quantile\":\n case \"pow\":\n case \"log\":\n case \"symlog\":\n options = coerceType(channels, options, coerceNumbers);\n break;\n case \"identity\":\n switch (registry.get(key)) {\n case position:\n options = coerceType(channels, options, coerceNumbers);\n break;\n case symbol:\n options = coerceType(channels, options, coerceSymbols);\n break;\n }\n break;\n case \"utc\":\n case \"time\":\n options = coerceType(channels, options, coerceDates);\n break;\n }\n\n switch (type) {\n case \"diverging\":\n return createScaleDiverging(key, channels, options);\n case \"diverging-sqrt\":\n return createScaleDivergingSqrt(key, channels, options);\n case \"diverging-pow\":\n return createScaleDivergingPow(key, channels, options);\n case \"diverging-log\":\n return createScaleDivergingLog(key, channels, options);\n case \"diverging-symlog\":\n return createScaleDivergingSymlog(key, channels, options);\n case \"categorical\":\n case \"ordinal\":\n case ordinalImplicit:\n return createScaleOrdinal(key, channels, options);\n case \"cyclical\":\n case \"sequential\":\n case \"linear\":\n return createScaleLinear(key, channels, options);\n case \"sqrt\":\n return createScaleSqrt(key, channels, options);\n case \"threshold\":\n return createScaleThreshold(key, channels, options);\n case \"quantile\":\n return createScaleQuantile(key, channels, options);\n case \"quantize\":\n return createScaleQuantize(key, channels, options);\n case \"pow\":\n return createScalePow(key, channels, options);\n case \"log\":\n return createScaleLog(key, channels, options);\n case \"symlog\":\n return createScaleSymlog(key, channels, options);\n case \"utc\":\n return createScaleUtc(key, channels, options);\n case \"time\":\n return createScaleTime(key, channels, options);\n case \"point\":\n return createScalePoint(key, channels, options);\n case \"band\":\n return createScaleBand(key, channels, options);\n case \"identity\":\n return registry.get(key) === position ? createScaleIdentity() : {type: \"identity\"};\n case undefined:\n return;\n default:\n throw new Error(`unknown scale type: ${type}`);\n }\n}\n\nfunction formatScaleType(type) {\n return typeof type === \"symbol\" ? type.description : type;\n}\n\n// A special type symbol when the x and y scales are replaced with a projection.\nconst typeProjection = {toString: () => \"projection\"};\n\nfunction inferScaleType(key, channels, {type, domain, range, scheme, pivot, projection}) {\n // The facet scales are always band scales; this cannot be changed.\n if (key === \"fx\" || key === \"fy\") return \"band\";\n\n // If a projection is specified, the x- and y-scales are disabled; these\n // channels will be projected rather than scaled. (But still check that none\n // of the associated channels are incompatible with a projection.)\n if ((key === \"x\" || key === \"y\") && projection != null) type = typeProjection;\n\n // If a channel dictates a scale type, make sure that it is consistent with\n // the user-specified scale type (if any) and all other channels. For example,\n // barY requires x to be a band scale and disallows any other scale type.\n for (const {type: t} of channels) {\n if (t === undefined) continue;\n else if (type === undefined) type = t;\n else if (type !== t) throw new Error(`scale incompatible with channel: ${type} !== ${t}`);\n }\n\n // If the scale, a channel, or user specified a (consistent) type, return it.\n if (type === typeProjection) return;\n if (type !== undefined) return type;\n\n // If there\u2019s no data (and no type) associated with this scale, don\u2019t create a scale.\n if (domain === undefined && !channels.some(({value}) => value !== undefined)) return;\n\n // Some scales have default types.\n const kind = registry.get(key);\n if (kind === radius) return \"sqrt\";\n if (kind === opacity || kind === length) return \"linear\";\n if (kind === symbol) return \"ordinal\";\n\n // If the domain or range has more than two values, assume it\u2019s ordinal. You\n // can still use a \u201Cpiecewise\u201D (or \u201Cpolylinear\u201D) scale, but you must set the\n // type explicitly.\n if ((domain || range || []).length > 2) return asOrdinalType(kind);\n\n // Otherwise, infer the scale type from the data! Prefer the domain, if\n // present, over channels. (The domain and channels should be consistently\n // typed, and the domain is more explicit and typically much smaller.) We only\n // check the first defined value for expedience and simplicity; we expect\n // that the types are consistent.\n if (domain !== undefined) {\n if (isOrdinal(domain)) return asOrdinalType(kind);\n if (isTemporal(domain)) return \"utc\";\n } else {\n const values = channels.map(({value}) => value).filter((value) => value !== undefined);\n if (values.some(isOrdinal)) return asOrdinalType(kind);\n if (values.some(isTemporal)) return \"utc\";\n }\n\n // For color scales, take a hint from the color scheme and pivot option.\n if (kind === color) {\n if (pivot != null || isDivergingScheme(scheme)) return \"diverging\";\n if (isCategoricalScheme(scheme)) return \"categorical\";\n }\n\n return \"linear\";\n}\n\n// Positional scales default to a point scale instead of an ordinal scale.\nfunction asOrdinalType(kind) {\n switch (kind) {\n case position:\n return \"point\";\n case color:\n return ordinalImplicit;\n default:\n return \"ordinal\";\n }\n}\n\nexport function isTemporalScale({type}) {\n return type === \"time\" || type === \"utc\";\n}\n\nexport function isOrdinalScale({type}) {\n return type === \"ordinal\" || type === \"point\" || type === \"band\" || type === ordinalImplicit;\n}\n\nexport function isThresholdScale({type}) {\n return type === \"threshold\";\n}\n\nfunction isBandScale({type}) {\n return type === \"point\" || type === \"band\";\n}\n\nexport function isDivergingScale({type}) {\n return /^diverging($|-)/.test(type);\n}\n\n// Certain marks have special behavior if a scale is collapsed, i.e. if the\n// domain is degenerate and represents only a single value such as [3, 3]; for\n// example, a rect will span the full extent of the chart along a collapsed\n// dimension (whereas a dot will simply be drawn in the center).\nexport function isCollapsed(scale) {\n if (scale === undefined) return true; // treat missing scale as collapsed\n const domain = scale.domain();\n const value = scale(domain[0]);\n for (let i = 1, n = domain.length; i < n; ++i) {\n if (scale(domain[i]) - value) {\n return false;\n }\n }\n return true;\n}\n\n// Mutates channel.value!\nfunction coerceType(channels, {domain, ...options}, coerceValues) {\n for (const c of channels) {\n if (c.value !== undefined) {\n c.value = coerceValues(c.value);\n }\n }\n return {\n domain: domain === undefined ? domain : coerceValues(domain),\n ...options\n };\n}\n\nfunction coerceSymbols(values) {\n return map(values, maybeSymbol);\n}\n\nexport function scale(options = {}) {\n let scale;\n for (const key in options) {\n if (!registry.has(key)) continue; // ignore unknown properties\n if (!isScaleOptions(options[key])) continue; // e.g., ignore {color: \"red\"}\n if (scale !== undefined) throw new Error(\"ambiguous scale definition; multiple scales found\");\n scale = exposeScale(normalizeScale(key, options[key]));\n }\n if (scale === undefined) throw new Error(\"invalid scale definition; no scale found\");\n return scale;\n}\n\nexport function exposeScales(scaleDescriptors) {\n return (key) => {\n if (!registry.has((key = `${key}`))) throw new Error(`unknown scale: ${key}`);\n return key in scaleDescriptors ? exposeScale(scaleDescriptors[key]) : undefined;\n };\n}\n\n// Note: axis- and legend-related properties (such as label, ticks and\n// tickFormat) are not included here as they do not affect the scale\u2019s behavior.\nfunction exposeScale({scale, type, domain, range, interpolate, interval, transform, percent, pivot}) {\n if (type === \"identity\") return {type: \"identity\", apply: (d) => d, invert: (d) => d};\n const unknown = scale.unknown ? scale.unknown() : undefined;\n return {\n type,\n domain: slice(domain), // defensive copy\n ...(range !== undefined && {range: slice(range)}), // defensive copy\n ...(transform !== undefined && {transform}),\n ...(percent && {percent}), // only exposed if truthy\n ...(unknown !== undefined && {unknown}),\n ...(interval !== undefined && {interval}),\n\n // quantitative\n ...(interpolate !== undefined && {interpolate}),\n ...(scale.clamp && {clamp: scale.clamp()}),\n\n // diverging (always asymmetric; we never want to apply the symmetric transform twice)\n ...(pivot !== undefined && {pivot, symmetric: false}),\n\n // log, diverging-log\n ...(scale.base && {base: scale.base()}),\n\n // pow, diverging-pow\n ...(scale.exponent && {exponent: scale.exponent()}),\n\n // symlog, diverging-symlog\n ...(scale.constant && {constant: scale.constant()}),\n\n // band, point\n ...(scale.align && {align: scale.align(), round: scale.round()}),\n ...(scale.padding &&\n (scale.paddingInner\n ? {paddingInner: scale.paddingInner(), paddingOuter: scale.paddingOuter()}\n : {padding: scale.padding()})),\n ...(scale.bandwidth && {bandwidth: scale.bandwidth(), step: scale.step()}),\n\n // utilities\n apply: (t) => scale(t),\n ...(scale.invert && {invert: (t) => scale.invert(t)})\n };\n}\n", "export function memoize1(compute) {\n let cacheValue, cacheKeys;\n return (...keys) => {\n if (cacheKeys?.length !== keys.length || cacheKeys.some((k, i) => k !== keys[i])) {\n cacheKeys = keys;\n cacheValue = compute(...keys);\n }\n return cacheValue;\n };\n}\n", "import {format as isoFormat} from \"isoformat\";\nimport {string} from \"./options.js\";\nimport {memoize1} from \"./memoize.js\";\n\nconst numberFormat = memoize1((locale) => {\n return new Intl.NumberFormat(locale);\n});\n\nconst monthFormat = memoize1((locale, month) => {\n return new Intl.DateTimeFormat(locale, {timeZone: \"UTC\", ...(month && {month})});\n});\n\nconst weekdayFormat = memoize1((locale, weekday) => {\n return new Intl.DateTimeFormat(locale, {timeZone: \"UTC\", ...(weekday && {weekday})});\n});\n\nexport function formatNumber(locale = \"en-US\") {\n const format = numberFormat(locale);\n return (i) => (i != null && !isNaN(i) ? format.format(i) : undefined);\n}\n\nexport function formatMonth(locale = \"en-US\", format = \"short\") {\n const fmt = monthFormat(locale, format);\n return (i) => (i != null && !isNaN((i = +new Date(Date.UTC(2000, +i)))) ? fmt.format(i) : undefined);\n}\n\nexport function formatWeekday(locale = \"en-US\", format = \"short\") {\n const fmt = weekdayFormat(locale, format);\n return (i) => (i != null && !isNaN((i = +new Date(Date.UTC(2001, 0, +i)))) ? fmt.format(i) : undefined);\n}\n\nexport function formatIsoDate(date) {\n return isoFormat(date, \"Invalid Date\");\n}\n\nexport function formatAuto(locale = \"en-US\") {\n const number = formatNumber(locale);\n return (v) => (v instanceof Date ? formatIsoDate : typeof v === \"number\" ? number : string)(v);\n}\n\n// TODO When Plot supports a top-level locale option, this should be removed\n// because it lacks context to know which locale to use; formatAuto should be\n// used instead whenever possible.\nexport const formatDefault = formatAuto();\n", "import {geoPath, group, namespaces} from \"d3\";\nimport {create} from \"./context.js\";\nimport {defined, nonempty} from \"./defined.js\";\nimport {formatDefault} from \"./format.js\";\nimport {\n string,\n number,\n maybeColorChannel,\n maybeNumberChannel,\n maybeKeyword,\n isNoneish,\n isNone,\n isRound,\n keyof\n} from \"./options.js\";\nimport {warn} from \"./warnings.js\";\n\nexport const offset = (typeof window !== \"undefined\" ? window.devicePixelRatio > 1 : typeof it === \"undefined\") ? 0 : 0.5; // prettier-ignore\n\nlet nextClipId = 0;\n\nfunction getClipId() {\n return `plot-clip-${++nextClipId}`;\n}\n\nexport function styles(\n mark,\n {\n title,\n href,\n ariaLabel: variaLabel,\n ariaDescription,\n ariaHidden,\n target,\n fill,\n fillOpacity,\n stroke,\n strokeWidth,\n strokeOpacity,\n strokeLinejoin,\n strokeLinecap,\n strokeMiterlimit,\n strokeDasharray,\n strokeDashoffset,\n opacity,\n mixBlendMode,\n imageFilter,\n paintOrder,\n pointerEvents,\n shapeRendering,\n channels\n },\n {\n ariaLabel: cariaLabel,\n fill: defaultFill = \"currentColor\",\n fillOpacity: defaultFillOpacity,\n stroke: defaultStroke = \"none\",\n strokeOpacity: defaultStrokeOpacity,\n strokeWidth: defaultStrokeWidth,\n strokeLinecap: defaultStrokeLinecap,\n strokeLinejoin: defaultStrokeLinejoin,\n strokeMiterlimit: defaultStrokeMiterlimit,\n paintOrder: defaultPaintOrder\n }\n) {\n // Some marks don\u2019t support fill (e.g., tick and rule).\n if (defaultFill === null) {\n fill = null;\n fillOpacity = null;\n }\n\n // Some marks don\u2019t support stroke (e.g., image).\n if (defaultStroke === null) {\n stroke = null;\n strokeOpacity = null;\n }\n\n // Some marks default to fill with no stroke, while others default to stroke\n // with no fill. For example, bar and area default to fill, while dot and line\n // default to stroke. For marks that fill by default, the default fill only\n // applies if the stroke is (constant) none; if you set a stroke, then the\n // default fill becomes none. Similarly for marks that stroke by stroke, the\n // default stroke only applies if the fill is (constant) none.\n if (isNoneish(defaultFill)) {\n if (!isNoneish(defaultStroke) && (!isNoneish(fill) || channels?.fill)) defaultStroke = \"none\";\n } else {\n if (isNoneish(defaultStroke) && (!isNoneish(stroke) || channels?.stroke)) defaultFill = \"none\";\n }\n\n const [vfill, cfill] = maybeColorChannel(fill, defaultFill);\n const [vfillOpacity, cfillOpacity] = maybeNumberChannel(fillOpacity, defaultFillOpacity);\n const [vstroke, cstroke] = maybeColorChannel(stroke, defaultStroke);\n const [vstrokeOpacity, cstrokeOpacity] = maybeNumberChannel(strokeOpacity, defaultStrokeOpacity);\n const [vopacity, copacity] = maybeNumberChannel(opacity);\n\n // For styles that have no effect if there is no stroke, only apply the\n // defaults if the stroke is not the constant none. (If stroke is a channel,\n // then cstroke will be undefined, but there\u2019s still a stroke; hence we don\u2019t\n // use isNoneish here.)\n if (!isNone(cstroke)) {\n if (strokeWidth === undefined) strokeWidth = defaultStrokeWidth;\n if (strokeLinecap === undefined) strokeLinecap = defaultStrokeLinecap;\n if (strokeLinejoin === undefined) strokeLinejoin = defaultStrokeLinejoin;\n\n // The default stroke miterlimit need not be applied if the current stroke\n // is the constant round; this only has effect on miter joins.\n if (strokeMiterlimit === undefined && !isRound(strokeLinejoin)) strokeMiterlimit = defaultStrokeMiterlimit;\n\n // The paint order only takes effect if there is both a fill and a stroke\n // (at least if we ignore markers, which no built-in marks currently use).\n if (!isNone(cfill) && paintOrder === undefined) paintOrder = defaultPaintOrder;\n }\n\n const [vstrokeWidth, cstrokeWidth] = maybeNumberChannel(strokeWidth);\n\n // Some marks don\u2019t support fill (e.g., tick and rule).\n if (defaultFill !== null) {\n mark.fill = impliedString(cfill, \"currentColor\");\n mark.fillOpacity = impliedNumber(cfillOpacity, 1);\n }\n\n // Some marks don\u2019t support stroke (e.g., image).\n if (defaultStroke !== null) {\n mark.stroke = impliedString(cstroke, \"none\");\n mark.strokeWidth = impliedNumber(cstrokeWidth, 1);\n mark.strokeOpacity = impliedNumber(cstrokeOpacity, 1);\n mark.strokeLinejoin = impliedString(strokeLinejoin, \"miter\");\n mark.strokeLinecap = impliedString(strokeLinecap, \"butt\");\n mark.strokeMiterlimit = impliedNumber(strokeMiterlimit, 4);\n mark.strokeDasharray = impliedString(strokeDasharray, \"none\");\n mark.strokeDashoffset = impliedString(strokeDashoffset, \"0\");\n }\n\n mark.target = string(target);\n mark.ariaLabel = string(cariaLabel);\n mark.ariaDescription = string(ariaDescription);\n mark.ariaHidden = string(ariaHidden);\n mark.opacity = impliedNumber(copacity, 1);\n mark.mixBlendMode = impliedString(mixBlendMode, \"normal\");\n mark.imageFilter = impliedString(imageFilter, \"none\");\n mark.paintOrder = impliedString(paintOrder, \"normal\");\n mark.pointerEvents = impliedString(pointerEvents, \"auto\");\n mark.shapeRendering = impliedString(shapeRendering, \"auto\");\n\n return {\n title: {value: title, optional: true, filter: null},\n href: {value: href, optional: true, filter: null},\n ariaLabel: {value: variaLabel, optional: true, filter: null},\n fill: {value: vfill, scale: \"auto\", optional: true},\n fillOpacity: {value: vfillOpacity, scale: \"auto\", optional: true},\n stroke: {value: vstroke, scale: \"auto\", optional: true},\n strokeOpacity: {value: vstrokeOpacity, scale: \"auto\", optional: true},\n strokeWidth: {value: vstrokeWidth, optional: true},\n opacity: {value: vopacity, scale: \"auto\", optional: true}\n };\n}\n\n// Applies the specified titles via selection.call.\nexport function applyTitle(selection, L) {\n if (L)\n selection\n .filter((i) => nonempty(L[i]))\n .append(\"title\")\n .call(applyText, L);\n}\n\n// Like applyTitle, but for grouped data (lines, areas).\nexport function applyTitleGroup(selection, L) {\n if (L)\n selection\n .filter(([i]) => nonempty(L[i]))\n .append(\"title\")\n .call(applyTextGroup, L);\n}\n\nexport function applyText(selection, T) {\n if (T) selection.text((i) => formatDefault(T[i]));\n}\n\nexport function applyTextGroup(selection, T) {\n if (T) selection.text(([i]) => formatDefault(T[i]));\n}\n\nexport function applyChannelStyles(\n selection,\n {target, tip},\n {\n ariaLabel: AL,\n title: T,\n fill: F,\n fillOpacity: FO,\n stroke: S,\n strokeOpacity: SO,\n strokeWidth: SW,\n opacity: O,\n href: H\n }\n) {\n if (AL) applyAttr(selection, \"aria-label\", (i) => AL[i]);\n if (F) applyAttr(selection, \"fill\", (i) => F[i]);\n if (FO) applyAttr(selection, \"fill-opacity\", (i) => FO[i]);\n if (S) applyAttr(selection, \"stroke\", (i) => S[i]);\n if (SO) applyAttr(selection, \"stroke-opacity\", (i) => SO[i]);\n if (SW) applyAttr(selection, \"stroke-width\", (i) => SW[i]);\n if (O) applyAttr(selection, \"opacity\", (i) => O[i]);\n if (H) applyHref(selection, (i) => H[i], target);\n if (!tip) applyTitle(selection, T);\n}\n\nexport function applyGroupedChannelStyles(\n selection,\n {target, tip},\n {\n ariaLabel: AL,\n title: T,\n fill: F,\n fillOpacity: FO,\n stroke: S,\n strokeOpacity: SO,\n strokeWidth: SW,\n opacity: O,\n href: H\n }\n) {\n if (AL) applyAttr(selection, \"aria-label\", ([i]) => AL[i]);\n if (F) applyAttr(selection, \"fill\", ([i]) => F[i]);\n if (FO) applyAttr(selection, \"fill-opacity\", ([i]) => FO[i]);\n if (S) applyAttr(selection, \"stroke\", ([i]) => S[i]);\n if (SO) applyAttr(selection, \"stroke-opacity\", ([i]) => SO[i]);\n if (SW) applyAttr(selection, \"stroke-width\", ([i]) => SW[i]);\n if (O) applyAttr(selection, \"opacity\", ([i]) => O[i]);\n if (H) applyHref(selection, ([i]) => H[i], target);\n if (!tip) applyTitleGroup(selection, T);\n}\n\nfunction groupAesthetics(\n {\n ariaLabel: AL,\n title: T,\n fill: F,\n fillOpacity: FO,\n stroke: S,\n strokeOpacity: SO,\n strokeWidth: SW,\n opacity: O,\n href: H\n },\n {tip}\n) {\n return [AL, tip ? undefined : T, F, FO, S, SO, SW, O, H].filter((c) => c !== undefined);\n}\n\nexport function groupZ(I, Z, z) {\n const G = group(I, (i) => Z[i]);\n if (z === undefined && G.size > (1 + I.length) >> 1) {\n warn(\n `Warning: the implicit z channel has high cardinality. This may occur when the fill or stroke channel is associated with quantitative data rather than ordinal or categorical data. You can suppress this warning by setting the z option explicitly; if this data represents a single series, set z to null.`\n );\n }\n return G.values();\n}\n\nexport function* groupIndex(I, position, mark, channels) {\n const {z} = mark;\n const {z: Z} = channels; // group channel\n const A = groupAesthetics(channels, mark); // aesthetic channels\n const C = [...position, ...A]; // all channels\n\n // Group the current index by Z (if any).\n for (const G of Z ? groupZ(I, Z, z) : [I]) {\n let Ag; // the A-values (aesthetics) of the current group, if any\n let Gg; // the current group index (a subset of G, and I), if any\n out: for (const i of G) {\n // If any channel has an undefined value for this index, skip it.\n for (const c of C) {\n if (!defined(c[i])) {\n if (Gg) Gg.push(-1);\n continue out;\n }\n }\n\n // Otherwise, if this is a new group, record the aesthetics for this\n // group. Yield the current group and start a new one.\n if (Ag === undefined) {\n if (Gg) yield Gg;\n (Ag = A.map((c) => keyof(c[i]))), (Gg = [i]);\n continue;\n }\n\n // Otherwise, add the current index to the current group. Then, if any of\n // the aesthetics don\u2019t match the current group, yield the current group\n // and start a new group of the current index.\n Gg.push(i);\n for (let j = 0; j < A.length; ++j) {\n const k = keyof(A[j][i]);\n if (k !== Ag[j]) {\n yield Gg;\n (Ag = A.map((c) => keyof(c[i]))), (Gg = [i]);\n continue out;\n }\n }\n }\n\n // Yield the current group, if any.\n if (Gg) yield Gg;\n }\n}\n\n// TODO Accept other types of clips (paths, urls, x, y, other marks\u2026)?\n// https://github.com/observablehq/plot/issues/181\nexport function maybeClip(clip) {\n if (clip === true) clip = \"frame\";\n else if (clip === false) clip = null;\n return maybeKeyword(clip, \"clip\", [\"frame\", \"sphere\"]);\n}\n\n// Note: may mutate selection.node!\nfunction applyClip(selection, mark, dimensions, context) {\n let clipUrl;\n switch (mark.clip) {\n case \"frame\": {\n const {width, height, marginLeft, marginRight, marginTop, marginBottom} = dimensions;\n const id = getClipId();\n clipUrl = `url(#${id})`;\n selection = create(\"svg:g\", context)\n .call((g) =>\n g\n .append(\"svg:clipPath\")\n .attr(\"id\", id)\n .append(\"rect\")\n .attr(\"x\", marginLeft)\n .attr(\"y\", marginTop)\n .attr(\"width\", width - marginRight - marginLeft)\n .attr(\"height\", height - marginTop - marginBottom)\n )\n .each(function () {\n this.appendChild(selection.node());\n selection.node = () => this; // Note: mutation!\n });\n break;\n }\n case \"sphere\": {\n const {projection} = context;\n if (!projection) throw new Error(`the \"sphere\" clip option requires a projection`);\n const id = getClipId();\n clipUrl = `url(#${id})`;\n selection\n .append(\"clipPath\")\n .attr(\"id\", id)\n .append(\"path\")\n .attr(\"d\", geoPath(projection)({type: \"Sphere\"}));\n break;\n }\n }\n // Here we\u2019re careful to apply the ARIA attributes to the outer G element when\n // clipping is applied, and to apply the ARIA attributes before any other\n // attributes (for readability).\n applyAttr(selection, \"aria-label\", mark.ariaLabel);\n applyAttr(selection, \"aria-description\", mark.ariaDescription);\n applyAttr(selection, \"aria-hidden\", mark.ariaHidden);\n applyAttr(selection, \"clip-path\", clipUrl);\n}\n\n// Note: may mutate selection.node!\nexport function applyIndirectStyles(selection, mark, dimensions, context) {\n applyClip(selection, mark, dimensions, context);\n applyAttr(selection, \"fill\", mark.fill);\n applyAttr(selection, \"fill-opacity\", mark.fillOpacity);\n applyAttr(selection, \"stroke\", mark.stroke);\n applyAttr(selection, \"stroke-width\", mark.strokeWidth);\n applyAttr(selection, \"stroke-opacity\", mark.strokeOpacity);\n applyAttr(selection, \"stroke-linejoin\", mark.strokeLinejoin);\n applyAttr(selection, \"stroke-linecap\", mark.strokeLinecap);\n applyAttr(selection, \"stroke-miterlimit\", mark.strokeMiterlimit);\n applyAttr(selection, \"stroke-dasharray\", mark.strokeDasharray);\n applyAttr(selection, \"stroke-dashoffset\", mark.strokeDashoffset);\n applyAttr(selection, \"shape-rendering\", mark.shapeRendering);\n applyAttr(selection, \"filter\", mark.imageFilter);\n applyAttr(selection, \"paint-order\", mark.paintOrder);\n const {pointerEvents = context.pointerSticky === false ? \"none\" : undefined} = mark;\n applyAttr(selection, \"pointer-events\", pointerEvents);\n}\n\nexport function applyDirectStyles(selection, mark) {\n applyStyle(selection, \"mix-blend-mode\", mark.mixBlendMode);\n applyAttr(selection, \"opacity\", mark.opacity);\n}\n\nfunction applyHref(selection, href, target) {\n selection.each(function (i) {\n const h = href(i);\n if (h != null) {\n const a = this.ownerDocument.createElementNS(namespaces.svg, \"a\");\n a.setAttribute(\"fill\", \"inherit\");\n a.setAttributeNS(namespaces.xlink, \"href\", h);\n if (target != null) a.setAttribute(\"target\", target);\n this.parentNode.insertBefore(a, this).appendChild(this);\n }\n });\n}\n\nexport function applyAttr(selection, name, value) {\n if (value != null) selection.attr(name, value);\n}\n\nexport function applyStyle(selection, name, value) {\n if (value != null) selection.style(name, value);\n}\n\nexport function applyTransform(selection, mark, {x, y}, tx = offset, ty = offset) {\n tx += mark.dx;\n ty += mark.dy;\n if (x?.bandwidth) tx += x.bandwidth() / 2;\n if (y?.bandwidth) ty += y.bandwidth() / 2;\n if (tx || ty) selection.attr(\"transform\", `translate(${tx},${ty})`);\n}\n\nexport function impliedString(value, impliedValue) {\n if ((value = string(value)) !== impliedValue) return value;\n}\n\nexport function impliedNumber(value, impliedValue) {\n if ((value = number(value)) !== impliedValue) return value;\n}\n\n// https://www.w3.org/TR/CSS21/grammar.html\nconst validClassName =\n /^-?([_a-z]|[\\240-\\377]|\\\\[0-9a-f]{1,6}(\\r\\n|[ \\t\\r\\n\\f])?|\\\\[^\\r\\n\\f0-9a-f])([_a-z0-9-]|[\\240-\\377]|\\\\[0-9a-f]{1,6}(\\r\\n|[ \\t\\r\\n\\f])?|\\\\[^\\r\\n\\f0-9a-f])*$/i;\n\nexport function maybeClassName(name) {\n // The default should be changed whenever the default styles are changed, so\n // as to avoid conflict when multiple versions of Plot are on the page.\n if (name === undefined) return \"plot-d6a7b5\";\n name = `${name}`;\n if (!validClassName.test(name)) throw new Error(`invalid class name: ${name}`);\n return name;\n}\n\nexport function applyInlineStyles(selection, style) {\n if (typeof style === \"string\") {\n selection.property(\"style\", style);\n } else if (style != null) {\n for (const element of selection) {\n Object.assign(element.style, style);\n }\n }\n}\n\nexport function applyFrameAnchor({frameAnchor}, {width, height, marginTop, marginRight, marginBottom, marginLeft}) {\n return [\n /left$/.test(frameAnchor)\n ? marginLeft\n : /right$/.test(frameAnchor)\n ? width - marginRight\n : (marginLeft + width - marginRight) / 2,\n /^top/.test(frameAnchor)\n ? marginTop\n : /^bottom/.test(frameAnchor)\n ? height - marginBottom\n : (marginTop + height - marginBottom) / 2\n ];\n}\n", "import {extent} from \"d3\";\nimport {projectionAspectRatio} from \"./projection.js\";\nimport {isOrdinalScale} from \"./scales.js\";\nimport {offset} from \"./style.js\";\n\nexport function createDimensions(scales, marks, options = {}) {\n // Compute the default margins: the maximum of the marks\u2019 margins. While not\n // always used, they may be needed to compute the default height of the plot.\n let marginTopDefault = 0.5 - offset,\n marginRightDefault = 0.5 + offset,\n marginBottomDefault = 0.5 + offset,\n marginLeftDefault = 0.5 - offset;\n\n for (const {marginTop, marginRight, marginBottom, marginLeft} of marks) {\n if (marginTop > marginTopDefault) marginTopDefault = marginTop;\n if (marginRight > marginRightDefault) marginRightDefault = marginRight;\n if (marginBottom > marginBottomDefault) marginBottomDefault = marginBottom;\n if (marginLeft > marginLeftDefault) marginLeftDefault = marginLeft;\n }\n\n // Compute the actual margins. The order of precedence is: the side-specific\n // margin options, then the global margin option, then the defaults.\n let {\n margin,\n marginTop = margin !== undefined ? margin : marginTopDefault,\n marginRight = margin !== undefined ? margin : marginRightDefault,\n marginBottom = margin !== undefined ? margin : marginBottomDefault,\n marginLeft = margin !== undefined ? margin : marginLeftDefault\n } = options;\n\n // Coerce the margin options to numbers.\n marginTop = +marginTop;\n marginRight = +marginRight;\n marginBottom = +marginBottom;\n marginLeft = +marginLeft;\n\n // Compute the outer dimensions of the plot. If the top and bottom margins are\n // specified explicitly, adjust the automatic height accordingly.\n let {\n width = 640,\n height = autoHeight(scales, options, {\n width,\n marginTopDefault,\n marginRightDefault,\n marginBottomDefault,\n marginLeftDefault\n }) + Math.max(0, marginTop - marginTopDefault + marginBottom - marginBottomDefault)\n } = options;\n\n // Coerce the width and height.\n width = +width;\n height = +height;\n\n const dimensions = {\n width,\n height,\n marginTop,\n marginRight,\n marginBottom,\n marginLeft\n };\n\n // Compute the facet margins.\n if (scales.fx || scales.fy) {\n let {\n margin: facetMargin,\n marginTop: facetMarginTop = facetMargin !== undefined ? facetMargin : marginTop,\n marginRight: facetMarginRight = facetMargin !== undefined ? facetMargin : marginRight,\n marginBottom: facetMarginBottom = facetMargin !== undefined ? facetMargin : marginBottom,\n marginLeft: facetMarginLeft = facetMargin !== undefined ? facetMargin : marginLeft\n } = options.facet ?? {};\n\n // Coerce the facet margin options to numbers.\n facetMarginTop = +facetMarginTop;\n facetMarginRight = +facetMarginRight;\n facetMarginBottom = +facetMarginBottom;\n facetMarginLeft = +facetMarginLeft;\n\n dimensions.facet = {\n marginTop: facetMarginTop,\n marginRight: facetMarginRight,\n marginBottom: facetMarginBottom,\n marginLeft: facetMarginLeft\n };\n }\n\n return dimensions;\n}\n\nfunction autoHeight(\n {x, y, fy, fx},\n {projection, aspectRatio},\n {width, marginTopDefault, marginRightDefault, marginBottomDefault, marginLeftDefault}\n) {\n const nfy = fy ? fy.scale.domain().length : 1;\n\n // If a projection is specified, use its natural aspect ratio (if known).\n const ar = projectionAspectRatio(projection);\n if (ar) {\n const nfx = fx ? fx.scale.domain().length : 1;\n const far = ((1.1 * nfy - 0.1) / (1.1 * nfx - 0.1)) * ar; // 0.1 is default facet padding\n const lar = Math.max(0.1, Math.min(10, far)); // clamp the aspect ratio to a \u201Creasonable\u201D value\n return Math.round((width - marginLeftDefault - marginRightDefault) * lar + marginTopDefault + marginBottomDefault);\n }\n\n const ny = y ? (isOrdinalScale(y) ? y.scale.domain().length : Math.max(7, 17 / nfy)) : 1;\n\n // If a desired aspect ratio is given, compute a default height to match.\n if (aspectRatio != null) {\n aspectRatio = +aspectRatio;\n if (!(isFinite(aspectRatio) && aspectRatio > 0)) throw new Error(`invalid aspectRatio: ${aspectRatio}`);\n const ratio = aspectRatioLength(\"y\", y) / (aspectRatioLength(\"x\", x) * aspectRatio);\n const fxb = fx ? fx.scale.bandwidth() : 1;\n const fyb = fy ? fy.scale.bandwidth() : 1;\n const w = fxb * (width - marginLeftDefault - marginRightDefault) - x.insetLeft - x.insetRight;\n return (ratio * w + y.insetTop + y.insetBottom) / fyb + marginTopDefault + marginBottomDefault;\n }\n\n return !!(y || fy) * Math.max(1, Math.min(60, ny * nfy)) * 20 + !!fx * 30 + 60;\n}\n\nfunction aspectRatioLength(k, scale) {\n if (!scale) throw new Error(`aspectRatio requires ${k} scale`);\n const {type, domain} = scale;\n let transform;\n switch (type) {\n case \"linear\":\n case \"utc\":\n case \"time\":\n transform = Number;\n break;\n case \"pow\": {\n const exponent = scale.scale.exponent();\n transform = (x) => Math.pow(x, exponent);\n break;\n }\n case \"log\":\n transform = Math.log;\n break;\n case \"point\":\n case \"band\":\n return domain.length;\n default:\n throw new Error(`unsupported ${k} scale for aspectRatio: ${type}`);\n }\n const [min, max] = extent(domain);\n return Math.abs(transform(max) - transform(min));\n}\n", "import {InternMap, cross, rollup, sum} from \"d3\";\nimport {keyof, map, range} from \"./options.js\";\nimport {createScales} from \"./scales.js\";\n\n// Returns an array of {x?, y?, i} objects representing the facet domain.\nexport function createFacets(channelsByScale, options) {\n const {fx, fy} = createScales(channelsByScale, options);\n const fxDomain = fx?.scale.domain();\n const fyDomain = fy?.scale.domain();\n return fxDomain && fyDomain\n ? cross(fxDomain, fyDomain).map(([x, y], i) => ({x, y, i}))\n : fxDomain\n ? fxDomain.map((x, i) => ({x, i}))\n : fyDomain\n ? fyDomain.map((y, i) => ({y, i}))\n : undefined;\n}\n\nexport function recreateFacets(facets, {x: X, y: Y}) {\n X &&= facetIndex(X);\n Y &&= facetIndex(Y);\n return facets\n .filter(\n X && Y // remove any facets no longer present in the domain\n ? (f) => X.has(f.x) && Y.has(f.y)\n : X\n ? (f) => X.has(f.x)\n : (f) => Y.has(f.y)\n )\n .sort(\n X && Y // reorder facets to match the new scale domains\n ? (a, b) => X.get(a.x) - X.get(b.x) || Y.get(a.y) - Y.get(b.y)\n : X\n ? (a, b) => X.get(a.x) - X.get(b.x)\n : (a, b) => Y.get(a.y) - Y.get(b.y)\n );\n}\n\n// Returns a (possibly nested) Map of [[key1, index1], [key2, index2], \u2026]\n// representing the data indexes associated with each facet.\nexport function facetGroups(data, {fx, fy}) {\n const I = range(data);\n const FX = fx?.value;\n const FY = fy?.value;\n return fx && fy\n ? rollup(\n I,\n (G) => ((G.fx = FX[G[0]]), (G.fy = FY[G[0]]), G),\n (i) => FX[i],\n (i) => FY[i]\n )\n : fx\n ? rollup(\n I,\n (G) => ((G.fx = FX[G[0]]), G),\n (i) => FX[i]\n )\n : rollup(\n I,\n (G) => ((G.fy = FY[G[0]]), G),\n (i) => FY[i]\n );\n}\n\nexport function facetTranslator(fx, fy, {marginTop, marginLeft}) {\n return fx && fy\n ? ({x, y}) => `translate(${fx(x) - marginLeft},${fy(y) - marginTop})`\n : fx\n ? ({x}) => `translate(${fx(x) - marginLeft},0)`\n : ({y}) => `translate(0,${fy(y) - marginTop})`;\n}\n\n// Returns an index that for each facet lists all the elements present in other\n// facets in the original index. TODO Memoize to avoid repeated work?\nexport function facetExclude(index) {\n const ex = [];\n const e = new Uint32Array(sum(index, (d) => d.length));\n for (const i of index) {\n let n = 0;\n for (const j of index) {\n if (i === j) continue;\n e.set(j, n);\n n += j.length;\n }\n ex.push(e.slice(0, n));\n }\n return ex;\n}\n\nconst facetAnchors = new Map([\n [\"top\", facetAnchorTop],\n [\"right\", facetAnchorRight],\n [\"bottom\", facetAnchorBottom],\n [\"left\", facetAnchorLeft],\n [\"top-left\", and(facetAnchorTop, facetAnchorLeft)],\n [\"top-right\", and(facetAnchorTop, facetAnchorRight)],\n [\"bottom-left\", and(facetAnchorBottom, facetAnchorLeft)],\n [\"bottom-right\", and(facetAnchorBottom, facetAnchorRight)],\n [\"top-empty\", facetAnchorTopEmpty],\n [\"right-empty\", facetAnchorRightEmpty],\n [\"bottom-empty\", facetAnchorBottomEmpty],\n [\"left-empty\", facetAnchorLeftEmpty],\n [\"empty\", facetAnchorEmpty]\n]);\n\nexport function maybeFacetAnchor(facetAnchor) {\n if (facetAnchor == null) return null;\n const anchor = facetAnchors.get(`${facetAnchor}`.toLowerCase());\n if (anchor) return anchor;\n throw new Error(`invalid facet anchor: ${facetAnchor}`);\n}\n\nconst indexCache = new WeakMap();\n\nfunction facetIndex(V) {\n let I = indexCache.get(V);\n if (!I) indexCache.set(V, (I = new InternMap(map(V, (v, i) => [v, i]))));\n return I;\n}\n\n// Like V.indexOf(v), but with the same semantics as InternMap.\nfunction facetIndexOf(V, v) {\n return facetIndex(V).get(v);\n}\n\n// Like facets.find, but with the same semantics as InternMap.\nfunction facetFind(facets, x, y) {\n x = keyof(x);\n y = keyof(y);\n return facets.find((f) => Object.is(keyof(f.x), x) && Object.is(keyof(f.y), y));\n}\n\nfunction facetEmpty(facets, x, y) {\n return facetFind(facets, x, y)?.empty;\n}\n\nfunction facetAnchorTop(facets, {y: Y}, {y}) {\n return Y ? facetIndexOf(Y, y) === 0 : true;\n}\n\nfunction facetAnchorBottom(facets, {y: Y}, {y}) {\n return Y ? facetIndexOf(Y, y) === Y.length - 1 : true;\n}\n\nfunction facetAnchorLeft(facets, {x: X}, {x}) {\n return X ? facetIndexOf(X, x) === 0 : true;\n}\n\nfunction facetAnchorRight(facets, {x: X}, {x}) {\n return X ? facetIndexOf(X, x) === X.length - 1 : true;\n}\n\nfunction facetAnchorTopEmpty(facets, {y: Y}, {x, y, empty}) {\n if (empty) return false;\n if (!Y) return;\n const i = facetIndexOf(Y, y);\n if (i > 0) return facetEmpty(facets, x, Y[i - 1]);\n}\n\nfunction facetAnchorBottomEmpty(facets, {y: Y}, {x, y, empty}) {\n if (empty) return false;\n if (!Y) return;\n const i = facetIndexOf(Y, y);\n if (i < Y.length - 1) return facetEmpty(facets, x, Y[i + 1]);\n}\n\nfunction facetAnchorLeftEmpty(facets, {x: X}, {x, y, empty}) {\n if (empty) return false;\n if (!X) return;\n const i = facetIndexOf(X, x);\n if (i > 0) return facetEmpty(facets, X[i - 1], y);\n}\n\nfunction facetAnchorRightEmpty(facets, {x: X}, {x, y, empty}) {\n if (empty) return false;\n if (!X) return;\n const i = facetIndexOf(X, x);\n if (i < X.length - 1) return facetEmpty(facets, X[i + 1], y);\n}\n\nfunction facetAnchorEmpty(facets, channels, {empty}) {\n return empty;\n}\n\nfunction and(a, b) {\n return function () {\n return a.apply(null, arguments) && b.apply(null, arguments);\n };\n}\n\n// Facet filter, by mark; for now only the \"eq\" filter is provided.\nexport function facetFilter(facets, {channels: {fx, fy}, groups}) {\n return fx && fy\n ? facets.map(({x, y}) => groups.get(x)?.get(y) ?? [])\n : fx\n ? facets.map(({x}) => groups.get(x) ?? [])\n : facets.map(({y}) => groups.get(y) ?? []);\n}\n", "import {channelDomain, createChannels, valueObject} from \"./channel.js\";\nimport {defined} from \"./defined.js\";\nimport {maybeFacetAnchor} from \"./facet.js\";\nimport {maybeKeyword, maybeNamed, maybeValue} from \"./options.js\";\nimport {arrayify, isDomainSort, isOptions, keyword, range, singleton} from \"./options.js\";\nimport {project} from \"./projection.js\";\nimport {maybeClip, styles} from \"./style.js\";\nimport {basic, initializer} from \"./transforms/basic.js\";\n\nexport class Mark {\n constructor(data, channels = {}, options = {}, defaults) {\n const {\n facet = \"auto\",\n facetAnchor,\n fx,\n fy,\n sort,\n dx = 0,\n dy = 0,\n margin = 0,\n marginTop = margin,\n marginRight = margin,\n marginBottom = margin,\n marginLeft = margin,\n clip,\n channels: extraChannels,\n tip,\n render\n } = options;\n this.data = data;\n this.sort = isDomainSort(sort) ? sort : null;\n this.initializer = initializer(options).initializer;\n this.transform = this.initializer ? options.transform : basic(options).transform;\n if (facet === null || facet === false) {\n this.facet = null;\n } else {\n this.facet = keyword(facet === true ? \"include\" : facet, \"facet\", [\"auto\", \"include\", \"exclude\", \"super\"]);\n this.fx = data === singleton && typeof fx === \"string\" ? [fx] : fx;\n this.fy = data === singleton && typeof fy === \"string\" ? [fy] : fy;\n }\n this.facetAnchor = maybeFacetAnchor(facetAnchor);\n channels = maybeNamed(channels);\n if (extraChannels !== undefined) channels = {...maybeChannels(extraChannels), ...channels};\n if (defaults !== undefined) channels = {...styles(this, options, defaults), ...channels};\n this.channels = Object.fromEntries(\n Object.entries(channels)\n .map(([name, channel]) => {\n if (isOptions(channel.value)) {\n // apply scale overrides\n const {value, scale = channel.scale} = channel.value;\n channel = {...channel, scale, value};\n }\n if (data === singleton && typeof channel.value === \"string\") {\n // convert field names to singleton values for decoration marks (e.g., frame)\n const {value} = channel;\n channel = {...channel, value: [value]};\n }\n return [name, channel];\n })\n .filter(([name, {value, optional}]) => {\n if (value != null) return true;\n if (optional) return false;\n throw new Error(`missing channel value: ${name}`);\n })\n );\n this.dx = +dx;\n this.dy = +dy;\n this.marginTop = +marginTop;\n this.marginRight = +marginRight;\n this.marginBottom = +marginBottom;\n this.marginLeft = +marginLeft;\n this.clip = maybeClip(clip);\n this.tip = maybeTip(tip);\n // Super-faceting currently disallow position channels; in the future, we\n // could allow position to be specified in fx and fy in addition to (or\n // instead of) x and y.\n if (this.facet === \"super\") {\n if (fx || fy) throw new Error(`super-faceting cannot use fx or fy`);\n for (const name in this.channels) {\n const {scale} = channels[name];\n if (scale !== \"x\" && scale !== \"y\") continue;\n throw new Error(`super-faceting cannot use x or y`);\n }\n }\n if (render != null) {\n this.render = composeRender(render, this.render);\n }\n }\n initialize(facets, facetChannels, plotOptions) {\n let data = arrayify(this.data);\n if (facets === undefined && data != null) facets = [range(data)];\n const originalFacets = facets;\n if (this.transform != null) ({facets, data} = this.transform(data, facets, plotOptions)), (data = arrayify(data));\n if (facets !== undefined) facets.original = originalFacets; // needed to read facetChannels\n const channels = createChannels(this.channels, data);\n if (this.sort != null) channelDomain(data, facets, channels, facetChannels, this.sort); // mutates facetChannels!\n return {data, facets, channels};\n }\n filter(index, channels, values) {\n for (const name in channels) {\n const {filter = defined} = channels[name];\n if (filter !== null) {\n const value = values[name];\n index = index.filter((i) => filter(value[i]));\n }\n }\n return index;\n }\n // If there is a projection, and there are paired x and y channels associated\n // with the x and y scale respectively (and not already in screen coordinates\n // as with an initializer), then apply the projection, replacing the x and y\n // values. Note that the x and y scales themselves don\u2019t exist if there is a\n // projection, but whether the channels are associated with scales still\n // determines whether the projection should apply; think of the projection as\n // a combination xy-scale.\n project(channels, values, context) {\n for (const cx in channels) {\n if (channels[cx].scale === \"x\" && /^x|x$/.test(cx)) {\n const cy = cx.replace(/^x|x$/, \"y\");\n if (cy in channels && channels[cy].scale === \"y\") {\n project(cx, cy, values, context.projection);\n }\n }\n }\n }\n scale(channels, scales, context) {\n const values = valueObject(channels, scales);\n if (context.projection) this.project(channels, values, context);\n return values;\n }\n}\n\nexport function marks(...marks) {\n marks.plot = Mark.prototype.plot; // Note: depends on side-effect in plot!\n return marks;\n}\n\nexport function composeRender(r1, r2) {\n if (r1 == null) return r2 === null ? undefined : r2;\n if (r2 == null) return r1 === null ? undefined : r1;\n if (typeof r1 !== \"function\") throw new TypeError(`invalid render transform: ${r1}`);\n if (typeof r2 !== \"function\") throw new TypeError(`invalid render transform: ${r2}`);\n return function (i, s, v, d, c, next) {\n return r1.call(this, i, s, v, d, c, (i, s, v, d, c) => {\n return r2.call(this, i, s, v, d, c, next); // preserve this\n });\n };\n}\n\nfunction maybeChannels(channels) {\n return Object.fromEntries(\n Object.entries(maybeNamed(channels)).map(([name, channel]) => {\n channel = maybeValue(channel);\n if (channel.filter === undefined && channel.scale == null) channel = {...channel, filter: null};\n return [name, channel];\n })\n );\n}\n\nfunction maybeTip(tip) {\n return tip === true ? \"xy\" : tip === false ? null : maybeKeyword(tip, \"tip\", [\"x\", \"y\", \"xy\"]);\n}\n\nexport function withTip(options, tip) {\n return options?.tip === true ? {...options, tip} : options;\n}\n", "import {pointer as pointof} from \"d3\";\nimport {composeRender} from \"../mark.js\";\nimport {applyFrameAnchor} from \"../style.js\";\n\nconst states = new WeakMap();\n\nfunction pointerK(kx, ky, {x, y, px, py, maxRadius = 40, channels, render, ...options} = {}) {\n maxRadius = +maxRadius;\n // When px or py is used, register an extra channel that the pointer\n // interaction can use to control which point is focused; this allows pointing\n // to function independently of where the downstream mark (e.g., a tip) is\n // displayed. Also default x or y to null to disable maybeTuple etc.\n if (px != null) (x ??= null), (channels = {...channels, px: {value: px, scale: \"x\"}});\n if (py != null) (y ??= null), (channels = {...channels, py: {value: py, scale: \"y\"}});\n return {\n x,\n y,\n channels,\n ...options,\n // Unlike other composed transforms, the render transform must be the\n // outermost render function because it will re-render dynamically in\n // response to pointer events.\n render: composeRender(function (index, scales, values, dimensions, context, next) {\n context = {...context, pointerSticky: false};\n const svg = context.ownerSVGElement;\n const {data} = context.getMarkState(this);\n\n // Isolate state per-pointer, per-plot; if the pointer is reused by\n // multiple marks, they will share the same state (e.g., sticky modality).\n let state = states.get(svg);\n if (!state) states.set(svg, (state = {sticky: false, roots: [], renders: []}));\n\n // This serves as a unique identifier of the rendered mark per-plot; it is\n // used to record the currently-rendered elements (state.roots) so that we\n // can tell when a rendered element is clicked on.\n let renderIndex = state.renders.push(render) - 1;\n\n // For faceting, we want to compute the local coordinates of each point,\n // which means subtracting out the facet translation, if any. (It\u2019s\n // tempting to do this using the local coordinates in SVG, but that\u2019s\n // complicated by mark-specific transforms such as dx and dy.) Also, since\n // band scales return the upper bound of the band, we have to offset by\n // half the bandwidth.\n const {x, y, fx, fy} = scales;\n let tx = fx ? fx(index.fx) - dimensions.marginLeft : 0;\n let ty = fy ? fy(index.fy) - dimensions.marginTop : 0;\n if (x?.bandwidth) tx += x.bandwidth() / 2;\n if (y?.bandwidth) ty += y.bandwidth() / 2;\n\n // For faceting, we also need to record the closest point per facet per\n // mark (!), since each facet has its own pointer event listeners; we only\n // want the closest point across facets to be visible.\n const faceted = index.fi != null;\n let facetState;\n if (faceted) {\n let facetStates = state.facetStates;\n if (!facetStates) state.facetStates = facetStates = new Map();\n facetState = facetStates.get(this);\n if (!facetState) facetStates.set(this, (facetState = new Map()));\n }\n\n // The order of precedence for the pointer position is: px & py; the\n // middle of x1 & y1 and x2 & y2; or x1 & y1 (e.g., area); or lastly x &\n // y. If a dimension is unspecified, the frame anchor is used.\n const [cx, cy] = applyFrameAnchor(this, dimensions);\n const {px: PX, py: PY} = values;\n const px = PX ? (i) => PX[i] : anchorX(values, cx);\n const py = PY ? (i) => PY[i] : anchorY(values, cy);\n\n let i; // currently focused index\n let g; // currently rendered mark\n let s; // currently rendered stickiness\n let f; // current animation frame\n\n // When faceting, if more than one pointer would be visible, only show\n // this one if it is the closest. We defer rendering using an animation\n // frame to allow all pointer events to be received before deciding which\n // mark to render; although when hiding, we render immediately.\n function update(ii, ri) {\n if (faceted) {\n if (f) f = cancelAnimationFrame(f);\n if (ii == null) facetState.delete(index.fi);\n else {\n facetState.set(index.fi, ri);\n f = requestAnimationFrame(() => {\n f = null;\n for (const r of facetState.values()) {\n if (r < ri) {\n ii = null;\n break;\n }\n }\n render(ii);\n });\n return;\n }\n }\n render(ii);\n }\n\n function render(ii) {\n if (i === ii && s === state.sticky) return; // the tooltip hasn\u2019t moved\n i = ii;\n s = context.pointerSticky = state.sticky;\n const I = i == null ? [] : [i];\n if (faceted) (I.fx = index.fx), (I.fy = index.fy), (I.fi = index.fi);\n const r = next(I, scales, values, dimensions, context);\n if (g) {\n // When faceting, preserve swapped mark and facet transforms; also\n // remove ARIA attributes since these are promoted to the parent. This\n // is perhaps brittle in that it depends on how Plot renders facets,\n // but it produces a cleaner and more accessible SVG structure.\n if (faceted) {\n const p = g.parentNode;\n const ft = g.getAttribute(\"transform\");\n const mt = r.getAttribute(\"transform\");\n ft ? r.setAttribute(\"transform\", ft) : r.removeAttribute(\"transform\");\n mt ? p.setAttribute(\"transform\", mt) : p.removeAttribute(\"transform\");\n r.removeAttribute(\"aria-label\");\n r.removeAttribute(\"aria-description\");\n r.removeAttribute(\"aria-hidden\");\n }\n g.replaceWith(r);\n }\n state.roots[renderIndex] = g = r;\n context.dispatchValue(i == null ? null : data[i]);\n return r;\n }\n\n function pointermove(event) {\n if (state.sticky || (event.pointerType === \"mouse\" && event.buttons === 1)) return; // dragging\n let [xp, yp] = pointof(event);\n (xp -= tx), (yp -= ty); // correct for facets and band scales\n let ii = null;\n let ri = maxRadius * maxRadius;\n for (const j of index) {\n const dx = kx * (px(j) - xp);\n const dy = ky * (py(j) - yp);\n const rj = dx * dx + dy * dy;\n if (rj <= ri) (ii = j), (ri = rj);\n }\n update(ii, ri);\n }\n\n function pointerdown(event) {\n if (event.pointerType !== \"mouse\") return;\n if (i == null) return; // not pointing\n if (state.sticky && state.roots.some((r) => r?.contains(event.target))) return; // stay sticky\n if (state.sticky) (state.sticky = false), state.renders.forEach((r) => r(null)); // clear all pointers\n else (state.sticky = true), render(i);\n event.stopImmediatePropagation(); // suppress other pointers\n }\n\n function pointerleave(event) {\n if (event.pointerType !== \"mouse\") return;\n if (!state.sticky) update(null);\n }\n\n // We listen to the svg element; listening to the window instead would let\n // us receive pointer events from farther away, but would also make it\n // hard to know when to remove the listeners. (Using a mutation observer\n // to watch the entire document is likely too expensive.)\n svg.addEventListener(\"pointerenter\", pointermove);\n svg.addEventListener(\"pointermove\", pointermove);\n svg.addEventListener(\"pointerdown\", pointerdown);\n svg.addEventListener(\"pointerleave\", pointerleave);\n\n return render(null);\n }, render)\n };\n}\n\nexport function pointer(options) {\n return pointerK(1, 1, options);\n}\n\nexport function pointerX(options) {\n return pointerK(1, 0.01, options);\n}\n\nexport function pointerY(options) {\n return pointerK(0.01, 1, options);\n}\n\nexport function anchorX({x1: X1, x2: X2, x: X = X1}, cx) {\n return X1 && X2 ? (i) => (X1[i] + X2[i]) / 2 : X ? (i) => X[i] : () => cx;\n}\n\nexport function anchorY({y1: Y1, y2: Y2, y: Y = Y1}, cy) {\n return Y1 && Y2 ? (i) => (Y1[i] + Y2[i]) / 2 : Y ? (i) => Y[i] : () => cy;\n}\n", "import {isOrdinalScale} from \"./scales.js\";\n\nexport function inferFontVariant(scale) {\n return isOrdinalScale(scale) && scale.interval === undefined ? undefined : \"tabular-nums\";\n}\n", "import {quantize, interpolateNumber, piecewise, format, scaleBand, scaleLinear, axisBottom} from \"d3\";\nimport {inferFontVariant} from \"../axes.js\";\nimport {createContext, create} from \"../context.js\";\nimport {map, maybeNumberChannel} from \"../options.js\";\nimport {interpolatePiecewise} from \"../scales/quantitative.js\";\nimport {applyInlineStyles, impliedString, maybeClassName} from \"../style.js\";\n\nexport function legendRamp(color, options) {\n let {\n label = color.label,\n tickSize = 6,\n width = 240,\n height = 44 + tickSize,\n marginTop = 18,\n marginRight = 0,\n marginBottom = 16 + tickSize,\n marginLeft = 0,\n style,\n ticks = (width - marginLeft - marginRight) / 64,\n tickFormat,\n fontVariant = inferFontVariant(color),\n round = true,\n opacity,\n className\n } = options;\n const context = createContext(options);\n className = maybeClassName(className);\n opacity = maybeNumberChannel(opacity)[1];\n if (tickFormat === null) tickFormat = () => null;\n\n const svg = create(\"svg\", context)\n .attr(\"class\", `${className}-ramp`)\n .attr(\"font-family\", \"system-ui, sans-serif\")\n .attr(\"font-size\", 10)\n .attr(\"width\", width)\n .attr(\"height\", height)\n .attr(\"viewBox\", `0 0 ${width} ${height}`)\n .call((svg) =>\n // Warning: if you edit this, change defaultClassName.\n svg.append(\"style\").text(\n `.${className}-ramp {\n display: block;\n background: white;\n height: auto;\n height: intrinsic;\n max-width: 100%;\n overflow: visible;\n}\n.${className}-ramp text {\n white-space: pre;\n}`\n )\n )\n .call(applyInlineStyles, style);\n\n let tickAdjust = (g) => g.selectAll(\".tick line\").attr(\"y1\", marginTop + marginBottom - height);\n\n let x;\n\n // Some D3 scales use scale.interpolate, some scale.interpolator, and some\n // scale.round; this normalizes the API so it works with all scale types.\n const applyRange = round ? (x, range) => x.rangeRound(range) : (x, range) => x.range(range);\n\n const {type, domain, range, interpolate, scale, pivot} = color;\n\n // Continuous\n if (interpolate) {\n // Often interpolate is a \u201Cfixed\u201D interpolator on the [0, 1] interval, as\n // with a built-in color scheme, but sometimes it is a function that takes\n // two arguments and is used in conjunction with the range.\n const interpolator =\n range === undefined\n ? interpolate\n : piecewise(interpolate.length === 1 ? interpolatePiecewise(interpolate) : interpolate, range);\n\n // Construct a D3 scale of the same type, but with a range that evenly\n // divides the horizontal extent of the legend. (In the common case, the\n // domain.length is two, and so the range is simply the extent.) For a\n // diverging scale, we need an extra point in the range for the pivot such\n // that the pivot is always drawn in the middle.\n x = applyRange(\n scale.copy(),\n quantize(\n interpolateNumber(marginLeft, width - marginRight),\n Math.min(domain.length + (pivot !== undefined), range === undefined ? Infinity : range.length)\n )\n );\n\n // Construct a 256\u00D71 canvas, filling each pixel using the interpolator.\n const n = 256;\n const canvas = context.document.createElement(\"canvas\");\n canvas.width = n;\n canvas.height = 1;\n const context2 = canvas.getContext(\"2d\");\n for (let i = 0, j = n - 1; i < n; ++i) {\n context2.fillStyle = interpolator(i / j);\n context2.fillRect(i, 0, 1, 1);\n }\n\n svg\n .append(\"image\")\n .attr(\"opacity\", opacity)\n .attr(\"x\", marginLeft)\n .attr(\"y\", marginTop)\n .attr(\"width\", width - marginLeft - marginRight)\n .attr(\"height\", height - marginTop - marginBottom)\n .attr(\"preserveAspectRatio\", \"none\")\n .attr(\"xlink:href\", canvas.toDataURL());\n }\n\n // Threshold\n else if (type === \"threshold\") {\n const thresholds = domain;\n\n const thresholdFormat =\n tickFormat === undefined ? (d) => d : typeof tickFormat === \"string\" ? format(tickFormat) : tickFormat;\n\n // Construct a linear scale with evenly-spaced ticks for each of the\n // thresholds; the domain extends one beyond the threshold extent.\n x = applyRange(scaleLinear().domain([-1, range.length - 1]), [marginLeft, width - marginRight]);\n\n svg\n .append(\"g\")\n .attr(\"fill-opacity\", opacity)\n .selectAll()\n .data(range)\n .enter()\n .append(\"rect\")\n .attr(\"x\", (d, i) => x(i - 1))\n .attr(\"y\", marginTop)\n .attr(\"width\", (d, i) => x(i) - x(i - 1))\n .attr(\"height\", height - marginTop - marginBottom)\n .attr(\"fill\", (d) => d);\n\n ticks = map(thresholds, (_, i) => i);\n tickFormat = (i) => thresholdFormat(thresholds[i], i);\n }\n\n // Ordinal (hopefully!)\n else {\n x = applyRange(scaleBand().domain(domain), [marginLeft, width - marginRight]);\n\n svg\n .append(\"g\")\n .attr(\"fill-opacity\", opacity)\n .selectAll()\n .data(domain)\n .enter()\n .append(\"rect\")\n .attr(\"x\", x)\n .attr(\"y\", marginTop)\n .attr(\"width\", Math.max(0, x.bandwidth() - 1))\n .attr(\"height\", height - marginTop - marginBottom)\n .attr(\"fill\", scale);\n\n tickAdjust = () => {};\n }\n\n svg\n .append(\"g\")\n .attr(\"transform\", `translate(0,${height - marginBottom})`)\n .call(\n axisBottom(x)\n .ticks(Array.isArray(ticks) ? null : ticks, typeof tickFormat === \"string\" ? tickFormat : undefined)\n .tickFormat(typeof tickFormat === \"function\" ? tickFormat : undefined)\n .tickSize(tickSize)\n .tickValues(Array.isArray(ticks) ? ticks : null)\n )\n .attr(\"font-size\", null)\n .attr(\"font-family\", null)\n .attr(\"font-variant\", impliedString(fontVariant, \"normal\"))\n .call(tickAdjust)\n .call((g) => g.select(\".domain\").remove());\n\n if (label !== undefined) {\n svg\n .append(\"text\")\n .attr(\"x\", marginLeft)\n .attr(\"y\", marginTop - 6)\n .attr(\"fill\", \"currentColor\") // TODO move to stylesheet?\n .attr(\"font-weight\", \"bold\")\n .text(label);\n }\n\n return svg.node();\n}\n", "export const radians = Math.PI / 180;\n", "import {create} from \"./context.js\";\n\nexport function markers(mark, {marker, markerStart = marker, markerMid = marker, markerEnd = marker} = {}) {\n mark.markerStart = maybeMarker(markerStart);\n mark.markerMid = maybeMarker(markerMid);\n mark.markerEnd = maybeMarker(markerEnd);\n}\n\nfunction maybeMarker(marker) {\n if (marker == null || marker === false) return null;\n if (marker === true) return markerCircleFill;\n if (typeof marker === \"function\") return marker;\n switch (`${marker}`.toLowerCase()) {\n case \"none\":\n return null;\n case \"arrow\":\n return markerArrow(\"auto\");\n case \"arrow-reverse\":\n return markerArrow(\"auto-start-reverse\");\n case \"dot\":\n return markerDot;\n case \"circle\":\n case \"circle-fill\":\n return markerCircleFill;\n case \"circle-stroke\":\n return markerCircleStroke;\n }\n throw new Error(`invalid marker: ${marker}`);\n}\n\nfunction markerArrow(orient) {\n return (color, context) =>\n create(\"svg:marker\", context)\n .attr(\"viewBox\", \"-5 -5 10 10\")\n .attr(\"markerWidth\", 6.67)\n .attr(\"markerHeight\", 6.67)\n .attr(\"orient\", orient)\n .attr(\"fill\", \"none\")\n .attr(\"stroke\", color)\n .attr(\"stroke-width\", 1.5)\n .attr(\"stroke-linecap\", \"round\")\n .attr(\"stroke-linejoin\", \"round\")\n .call((marker) => marker.append(\"path\").attr(\"d\", \"M-1.5,-3l3,3l-3,3\"))\n .node();\n}\n\nfunction markerDot(color, context) {\n return create(\"svg:marker\", context)\n .attr(\"viewBox\", \"-5 -5 10 10\")\n .attr(\"markerWidth\", 6.67)\n .attr(\"markerHeight\", 6.67)\n .attr(\"fill\", color)\n .attr(\"stroke\", \"none\")\n .call((marker) => marker.append(\"circle\").attr(\"r\", 2.5))\n .node();\n}\n\nfunction markerCircleFill(color, context) {\n return create(\"svg:marker\", context)\n .attr(\"viewBox\", \"-5 -5 10 10\")\n .attr(\"markerWidth\", 6.67)\n .attr(\"markerHeight\", 6.67)\n .attr(\"fill\", color)\n .attr(\"stroke\", \"white\")\n .attr(\"stroke-width\", 1.5)\n .call((marker) => marker.append(\"circle\").attr(\"r\", 3))\n .node();\n}\n\nfunction markerCircleStroke(color, context) {\n return create(\"svg:marker\", context)\n .attr(\"viewBox\", \"-5 -5 10 10\")\n .attr(\"markerWidth\", 6.67)\n .attr(\"markerHeight\", 6.67)\n .attr(\"fill\", \"white\")\n .attr(\"stroke\", color)\n .attr(\"stroke-width\", 1.5)\n .call((marker) => marker.append(\"circle\").attr(\"r\", 3))\n .node();\n}\n\nlet nextMarkerId = 0;\n\nexport function applyMarkers(path, mark, {stroke: S}, context) {\n return applyMarkersColor(path, mark, S && ((i) => S[i]), context);\n}\n\nexport function applyGroupedMarkers(path, mark, {stroke: S}, context) {\n return applyMarkersColor(path, mark, S && (([i]) => S[i]), context);\n}\n\nfunction applyMarkersColor(path, {markerStart, markerMid, markerEnd, stroke}, strokeof = () => stroke, context) {\n const iriByMarkerColor = new Map();\n\n function applyMarker(marker) {\n return function (i) {\n const color = strokeof(i);\n let iriByColor = iriByMarkerColor.get(marker);\n if (!iriByColor) iriByMarkerColor.set(marker, (iriByColor = new Map()));\n let iri = iriByColor.get(color);\n if (!iri) {\n const node = this.parentNode.insertBefore(marker(color, context), this);\n const id = `plot-marker-${++nextMarkerId}`;\n node.setAttribute(\"id\", id);\n iriByColor.set(color, (iri = `url(#${id})`));\n }\n return iri;\n };\n }\n\n if (markerStart) path.attr(\"marker-start\", applyMarker(markerStart));\n if (markerMid) path.attr(\"marker-mid\", applyMarker(markerMid));\n if (markerEnd) path.attr(\"marker-end\", applyMarker(markerEnd));\n}\n", "import {offset} from \"../style.js\";\n\nexport function maybeInsetX({inset, insetLeft, insetRight, ...options} = {}) {\n [insetLeft, insetRight] = maybeInset(inset, insetLeft, insetRight);\n return {inset, insetLeft, insetRight, ...options};\n}\n\nexport function maybeInsetY({inset, insetTop, insetBottom, ...options} = {}) {\n [insetTop, insetBottom] = maybeInset(inset, insetTop, insetBottom);\n return {inset, insetTop, insetBottom, ...options};\n}\n\nfunction maybeInset(inset, inset1, inset2) {\n return inset === undefined && inset1 === undefined && inset2 === undefined\n ? offset\n ? [1, 0]\n : [0.5, 0.5]\n : [inset1, inset2];\n}\n", "import {isTemporal, labelof, map, maybeInterval, maybeValue, valueof} from \"../options.js\";\nimport {maybeInsetX, maybeInsetY} from \"./inset.js\";\n\n// The interval may be specified either as x: {value, interval} or as {x,\n// interval}. The former can be used to specify separate intervals for x and y,\n// for example with Plot.rect.\nfunction maybeIntervalValue(value, {interval}) {\n value = {...maybeValue(value)};\n value.interval = maybeInterval(value.interval === undefined ? interval : value.interval);\n return value;\n}\n\nfunction maybeIntervalK(k, maybeInsetK, options, trivial) {\n const {[k]: v, [`${k}1`]: v1, [`${k}2`]: v2} = options;\n const {value, interval} = maybeIntervalValue(v, options);\n if (value == null || (interval == null && !trivial)) return options;\n const label = labelof(v);\n if (interval == null) {\n let V;\n const kv = {transform: (data) => V || (V = valueof(data, value)), label};\n return {\n ...options,\n [k]: undefined,\n [`${k}1`]: v1 === undefined ? kv : v1,\n [`${k}2`]: v2 === undefined ? kv : v2\n };\n }\n let D1, V1;\n function transform(data) {\n if (V1 !== undefined && data === D1) return V1; // memoize\n return (V1 = map(valueof((D1 = data), value), (v) => interval.floor(v)));\n }\n return maybeInsetK({\n ...options,\n [k]: undefined,\n [`${k}1`]: v1 === undefined ? {transform, label} : v1,\n [`${k}2`]: v2 === undefined ? {transform: (data) => transform(data).map((v) => interval.offset(v)), label} : v2\n });\n}\n\nfunction maybeIntervalMidK(k, maybeInsetK, options) {\n const {[k]: v} = options;\n const {value, interval} = maybeIntervalValue(v, options);\n if (value == null || interval == null) return options;\n return maybeInsetK({\n ...options,\n [k]: {\n label: labelof(v),\n transform: (data) => {\n const V1 = map(valueof(data, value), (v) => interval.floor(v));\n const V2 = V1.map((v) => interval.offset(v));\n return V1.map(\n isTemporal(V1)\n ? (v1, v2) =>\n v1 == null || isNaN((v1 = +v1)) || ((v2 = V2[v2]), v2 == null) || isNaN((v2 = +v2))\n ? undefined\n : new Date((v1 + v2) / 2)\n : (v1, v2) => (v1 == null || ((v2 = V2[v2]), v2 == null) ? NaN : (+v1 + +v2) / 2)\n );\n }\n }\n });\n}\n\nexport function maybeTrivialIntervalX(options = {}) {\n return maybeIntervalK(\"x\", maybeInsetX, options, true);\n}\n\nexport function maybeTrivialIntervalY(options = {}) {\n return maybeIntervalK(\"y\", maybeInsetY, options, true);\n}\n\nexport function maybeIntervalX(options = {}) {\n return maybeIntervalK(\"x\", maybeInsetX, options);\n}\n\nexport function maybeIntervalY(options = {}) {\n return maybeIntervalK(\"y\", maybeInsetY, options);\n}\n\nexport function maybeIntervalMidX(options = {}) {\n return maybeIntervalMidK(\"x\", maybeInsetX, options);\n}\n\nexport function maybeIntervalMidY(options = {}) {\n return maybeIntervalMidK(\"y\", maybeInsetY, options);\n}\n", "import {create} from \"../context.js\";\nimport {Mark, withTip} from \"../mark.js\";\nimport {applyMarkers, markers} from \"../marker.js\";\nimport {identity, number} from \"../options.js\";\nimport {isCollapsed} from \"../scales.js\";\nimport {applyChannelStyles, applyDirectStyles, applyIndirectStyles, applyTransform, offset} from \"../style.js\";\nimport {maybeIntervalX, maybeIntervalY} from \"../transforms/interval.js\";\n\nconst defaults = {\n ariaLabel: \"rule\",\n fill: null,\n stroke: \"currentColor\"\n};\n\nexport class RuleX extends Mark {\n constructor(data, options = {}) {\n const {x, y1, y2, inset = 0, insetTop = inset, insetBottom = inset} = options;\n super(\n data,\n {\n x: {value: x, scale: \"x\", optional: true},\n y1: {value: y1, scale: \"y\", optional: true},\n y2: {value: y2, scale: \"y\", optional: true}\n },\n withTip(options, \"x\"),\n defaults\n );\n this.insetTop = number(insetTop);\n this.insetBottom = number(insetBottom);\n markers(this, options);\n }\n render(index, scales, channels, dimensions, context) {\n const {x, y} = scales;\n const {x: X, y1: Y1, y2: Y2} = channels;\n const {width, height, marginTop, marginRight, marginLeft, marginBottom} = dimensions;\n const {insetTop, insetBottom} = this;\n return create(\"svg:g\", context)\n .call(applyIndirectStyles, this, dimensions, context)\n .call(applyTransform, this, {x: X && x}, offset, 0)\n .call((g) =>\n g\n .selectAll()\n .data(index)\n .enter()\n .append(\"line\")\n .call(applyDirectStyles, this)\n .attr(\"x1\", X ? (i) => X[i] : (marginLeft + width - marginRight) / 2)\n .attr(\"x2\", X ? (i) => X[i] : (marginLeft + width - marginRight) / 2)\n .attr(\"y1\", Y1 && !isCollapsed(y) ? (i) => Y1[i] + insetTop : marginTop + insetTop)\n .attr(\n \"y2\",\n Y2 && !isCollapsed(y)\n ? y.bandwidth\n ? (i) => Y2[i] + y.bandwidth() - insetBottom\n : (i) => Y2[i] - insetBottom\n : height - marginBottom - insetBottom\n )\n .call(applyChannelStyles, this, channels)\n .call(applyMarkers, this, channels, context)\n )\n .node();\n }\n}\n\nexport class RuleY extends Mark {\n constructor(data, options = {}) {\n const {x1, x2, y, inset = 0, insetRight = inset, insetLeft = inset} = options;\n super(\n data,\n {\n y: {value: y, scale: \"y\", optional: true},\n x1: {value: x1, scale: \"x\", optional: true},\n x2: {value: x2, scale: \"x\", optional: true}\n },\n withTip(options, \"y\"),\n defaults\n );\n this.insetRight = number(insetRight);\n this.insetLeft = number(insetLeft);\n markers(this, options);\n }\n render(index, scales, channels, dimensions, context) {\n const {x, y} = scales;\n const {y: Y, x1: X1, x2: X2} = channels;\n const {width, height, marginTop, marginRight, marginLeft, marginBottom} = dimensions;\n const {insetLeft, insetRight} = this;\n return create(\"svg:g\", context)\n .call(applyIndirectStyles, this, dimensions, context)\n .call(applyTransform, this, {y: Y && y}, 0, offset)\n .call((g) =>\n g\n .selectAll()\n .data(index)\n .enter()\n .append(\"line\")\n .call(applyDirectStyles, this)\n .attr(\"x1\", X1 && !isCollapsed(x) ? (i) => X1[i] + insetLeft : marginLeft + insetLeft)\n .attr(\n \"x2\",\n X2 && !isCollapsed(x)\n ? x.bandwidth\n ? (i) => X2[i] + x.bandwidth() - insetRight\n : (i) => X2[i] - insetRight\n : width - marginRight - insetRight\n )\n .attr(\"y1\", Y ? (i) => Y[i] : (marginTop + height - marginBottom) / 2)\n .attr(\"y2\", Y ? (i) => Y[i] : (marginTop + height - marginBottom) / 2)\n .call(applyChannelStyles, this, channels)\n .call(applyMarkers, this, channels, context)\n )\n .node();\n }\n}\n\nexport function ruleX(data, options) {\n let {x = identity, y, y1, y2, ...rest} = maybeIntervalY(options);\n [y1, y2] = maybeOptionalZero(y, y1, y2);\n return new RuleX(data, {...rest, x, y1, y2});\n}\n\nexport function ruleY(data, options) {\n let {y = identity, x, x1, x2, ...rest} = maybeIntervalX(options);\n [x1, x2] = maybeOptionalZero(x, x1, x2);\n return new RuleY(data, {...rest, y, x1, x2});\n}\n\n// For marks specified either as [0, x] or [x1, x2], or nothing.\nfunction maybeOptionalZero(x, x1, x2) {\n if (x == null) {\n if (x1 === undefined) {\n if (x2 !== undefined) return [0, x2];\n } else {\n if (x2 === undefined) return [0, x1];\n }\n } else if (x1 === undefined) {\n return x2 === undefined ? [0, x] : [x, x2];\n } else if (x2 === undefined) {\n return [x, x1];\n }\n return [x1, x2];\n}\n", "export function template(strings, ...parts) {\n let n = parts.length;\n\n // If any of the interpolated parameters are strings rather than functions,\n // bake them into the template to optimize performance during render.\n for (let j = 0, copy = true; j < n; ++j) {\n if (typeof parts[j] !== \"function\") {\n if (copy) {\n strings = strings.slice(); // copy before mutate\n copy = false;\n }\n strings.splice(j, 2, strings[j] + parts[j] + strings[j + 1]);\n parts.splice(j, 1);\n --j, --n;\n }\n }\n\n return (i) => {\n let s = strings[0];\n for (let j = 0; j < n; ++j) {\n s += parts[j](i) + strings[j + 1];\n }\n return s;\n };\n}\n", "import {namespaces} from \"d3\";\nimport {create} from \"../context.js\";\nimport {nonempty} from \"../defined.js\";\nimport {formatDefault} from \"../format.js\";\nimport {Mark} from \"../mark.js\";\nimport {\n indexOf,\n identity,\n string,\n maybeNumberChannel,\n maybeTuple,\n numberChannel,\n isNumeric,\n isTemporal,\n keyword,\n maybeFrameAnchor,\n isTextual,\n isIterable\n} from \"../options.js\";\nimport {\n applyChannelStyles,\n applyDirectStyles,\n applyIndirectStyles,\n applyAttr,\n applyTransform,\n impliedString,\n applyFrameAnchor\n} from \"../style.js\";\nimport {template} from \"../template.js\";\nimport {maybeIntervalMidX, maybeIntervalMidY} from \"../transforms/interval.js\";\n\nconst defaults = {\n ariaLabel: \"text\",\n strokeLinejoin: \"round\",\n strokeWidth: 3,\n paintOrder: \"stroke\"\n};\n\nconst softHyphen = \"\\u00ad\";\n\nexport class Text extends Mark {\n constructor(data, options = {}) {\n const {\n x,\n y,\n text = isIterable(data) && isTextual(data) ? identity : indexOf,\n frameAnchor,\n textAnchor = /right$/i.test(frameAnchor) ? \"end\" : /left$/i.test(frameAnchor) ? \"start\" : \"middle\",\n lineAnchor = /^top/i.test(frameAnchor) ? \"top\" : /^bottom/i.test(frameAnchor) ? \"bottom\" : \"middle\",\n lineHeight = 1,\n lineWidth = Infinity,\n textOverflow,\n monospace,\n fontFamily = monospace ? \"ui-monospace, monospace\" : undefined,\n fontSize,\n fontStyle,\n fontVariant,\n fontWeight,\n rotate\n } = options;\n const [vrotate, crotate] = maybeNumberChannel(rotate, 0);\n const [vfontSize, cfontSize] = maybeFontSizeChannel(fontSize);\n super(\n data,\n {\n x: {value: x, scale: \"x\", optional: true},\n y: {value: y, scale: \"y\", optional: true},\n fontSize: {value: vfontSize, optional: true},\n rotate: {value: numberChannel(vrotate), optional: true},\n text: {value: text, filter: nonempty, optional: true}\n },\n options,\n defaults\n );\n this.rotate = crotate;\n this.textAnchor = impliedString(textAnchor, \"middle\");\n this.lineAnchor = keyword(lineAnchor, \"lineAnchor\", [\"top\", \"middle\", \"bottom\"]);\n this.lineHeight = +lineHeight;\n this.lineWidth = +lineWidth;\n this.textOverflow = maybeTextOverflow(textOverflow);\n this.monospace = !!monospace;\n this.fontFamily = string(fontFamily);\n this.fontSize = cfontSize;\n this.fontStyle = string(fontStyle);\n this.fontVariant = string(fontVariant);\n this.fontWeight = string(fontWeight);\n this.frameAnchor = maybeFrameAnchor(frameAnchor);\n if (!(this.lineWidth >= 0)) throw new Error(`invalid lineWidth: ${lineWidth}`);\n this.splitLines = splitter(this);\n this.clipLine = clipper(this);\n }\n render(index, scales, channels, dimensions, context) {\n const {x, y} = scales;\n const {x: X, y: Y, rotate: R, text: T, title: TL, fontSize: FS} = channels;\n const {rotate} = this;\n const [cx, cy] = applyFrameAnchor(this, dimensions);\n return create(\"svg:g\", context)\n .call(applyIndirectStyles, this, dimensions, context)\n .call(applyIndirectTextStyles, this, T, dimensions)\n .call(applyTransform, this, {x: X && x, y: Y && y})\n .call((g) =>\n g\n .selectAll()\n .data(index)\n .enter()\n .append(\"text\")\n .call(applyDirectStyles, this)\n .call(applyMultilineText, this, T, TL)\n .attr(\n \"transform\",\n template`translate(${X ? (i) => X[i] : cx},${Y ? (i) => Y[i] : cy})${\n R ? (i) => ` rotate(${R[i]})` : rotate ? ` rotate(${rotate})` : ``\n }`\n )\n .call(applyAttr, \"font-size\", FS && ((i) => FS[i]))\n .call(applyChannelStyles, this, channels)\n )\n .node();\n }\n}\n\nexport function maybeTextOverflow(textOverflow) {\n return textOverflow == null\n ? null\n : keyword(textOverflow, \"textOverflow\", [\n \"clip\", // shorthand for clip-end\n \"ellipsis\", // \u2026 ellipsis-end\n \"clip-start\",\n \"clip-end\",\n \"ellipsis-start\",\n \"ellipsis-middle\",\n \"ellipsis-end\"\n ]).replace(/^(clip|ellipsis)$/, \"$1-end\");\n}\n\nfunction applyMultilineText(selection, mark, T, TL) {\n if (!T) return;\n const {lineAnchor, lineHeight, textOverflow, splitLines, clipLine} = mark;\n selection.each(function (i) {\n const lines = splitLines(formatDefault(T[i]) ?? \"\").map(clipLine);\n const n = lines.length;\n const y = lineAnchor === \"top\" ? 0.71 : lineAnchor === \"bottom\" ? 1 - n : (164 - n * 100) / 200;\n if (n > 1) {\n let m = 0;\n for (let i = 0; i < n; ++i) {\n ++m;\n if (!lines[i]) continue;\n const tspan = this.ownerDocument.createElementNS(namespaces.svg, \"tspan\");\n tspan.setAttribute(\"x\", 0);\n if (i === m - 1) tspan.setAttribute(\"y\", `${(y + i) * lineHeight}em`);\n else tspan.setAttribute(\"dy\", `${m * lineHeight}em`);\n tspan.textContent = lines[i];\n this.appendChild(tspan);\n m = 0;\n }\n } else {\n if (y) this.setAttribute(\"y\", `${y * lineHeight}em`);\n this.textContent = lines[0];\n }\n if (textOverflow && !TL && lines[0] !== T[i]) {\n const title = this.ownerDocument.createElementNS(namespaces.svg, \"title\");\n title.textContent = T[i];\n this.appendChild(title);\n }\n });\n}\n\nexport function text(data, {x, y, ...options} = {}) {\n if (options.frameAnchor === undefined) [x, y] = maybeTuple(x, y);\n return new Text(data, {...options, x, y});\n}\n\nexport function textX(data, {x = identity, ...options} = {}) {\n return new Text(data, maybeIntervalMidY({...options, x}));\n}\n\nexport function textY(data, {y = identity, ...options} = {}) {\n return new Text(data, maybeIntervalMidX({...options, y}));\n}\n\nexport function applyIndirectTextStyles(selection, mark, T) {\n applyAttr(selection, \"text-anchor\", mark.textAnchor);\n applyAttr(selection, \"font-family\", mark.fontFamily);\n applyAttr(selection, \"font-size\", mark.fontSize);\n applyAttr(selection, \"font-style\", mark.fontStyle);\n applyAttr(selection, \"font-variant\", mark.fontVariant === undefined ? inferFontVariant(T) : mark.fontVariant);\n applyAttr(selection, \"font-weight\", mark.fontWeight);\n}\n\nfunction inferFontVariant(T) {\n return T && (isNumeric(T) || isTemporal(T)) ? \"tabular-nums\" : undefined;\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/CSS/font-size\nconst fontSizes = new Set([\n // global keywords\n \"inherit\",\n \"initial\",\n \"revert\",\n \"unset\",\n // absolute keywords\n \"xx-small\",\n \"x-small\",\n \"small\",\n \"medium\",\n \"large\",\n \"x-large\",\n \"xx-large\",\n \"xxx-large\",\n // relative keywords\n \"larger\",\n \"smaller\"\n]);\n\n// The font size may be expressed as a constant in the following forms:\n// - number in pixels\n// - string keyword: see above\n// - string <length>: e.g., \"12px\"\n// - string <percentage>: e.g., \"80%\"\n// Anything else is assumed to be a channel definition.\nfunction maybeFontSizeChannel(fontSize) {\n if (fontSize == null || typeof fontSize === \"number\") return [undefined, fontSize];\n if (typeof fontSize !== \"string\") return [fontSize, undefined];\n fontSize = fontSize.trim().toLowerCase();\n return fontSizes.has(fontSize) || /^[+-]?\\d*\\.?\\d+(e[+-]?\\d+)?(\\w*|%)$/.test(fontSize)\n ? [undefined, fontSize]\n : [fontSize, undefined];\n}\n\n// This is a greedy algorithm for line wrapping. It would be better to use the\n// Knuth\u2013Plass line breaking algorithm (but that would be much more complex).\n// https://en.wikipedia.org/wiki/Line_wrap_and_word_wrap\nfunction lineWrap(input, maxWidth, widthof) {\n const lines = [];\n let lineStart,\n lineEnd = 0;\n for (const [wordStart, wordEnd, required] of lineBreaks(input)) {\n // Record the start of a line. This isn\u2019t the same as the previous line\u2019s\n // end because we often skip spaces between lines.\n if (lineStart === undefined) lineStart = wordStart;\n\n // If the current line is not empty, and if adding the current word would\n // make the line longer than the allowed width, then break the line at the\n // previous word end.\n if (lineEnd > lineStart && widthof(input, lineStart, wordEnd) > maxWidth) {\n lines.push(input.slice(lineStart, lineEnd) + (input[lineEnd - 1] === softHyphen ? \"-\" : \"\"));\n lineStart = wordStart;\n }\n\n // If this is a required break (a newline), emit the line and reset.\n if (required) {\n lines.push(input.slice(lineStart, wordEnd));\n lineStart = undefined;\n continue;\n }\n\n // Extend the current line to include the new word.\n lineEnd = wordEnd;\n }\n return lines;\n}\n\n// This is a rudimentary (and U.S.-centric) algorithm for finding opportunities\n// to break lines between words. A better and far more comprehensive approach\n// would be to use the official Unicode Line Breaking Algorithm.\n// https://unicode.org/reports/tr14/\nfunction* lineBreaks(input) {\n let i = 0,\n j = 0;\n const n = input.length;\n while (j < n) {\n let k = 1;\n switch (input[j]) {\n case softHyphen:\n case \"-\": // hyphen\n ++j;\n yield [i, j, false];\n i = j;\n break;\n case \" \":\n yield [i, j, false];\n while (input[++j] === \" \"); // skip multiple spaces\n i = j;\n break;\n case \"\\r\":\n if (input[j + 1] === \"\\n\") ++k; // falls through\n case \"\\n\":\n yield [i, j, true];\n j += k;\n i = j;\n break;\n default:\n ++j;\n break;\n }\n }\n yield [i, j, true];\n}\n\n// Computed as round(measureText(text).width * 10) at 10px system-ui. For\n// characters that are not represented in this map, we\u2019d ideally want to use a\n// weighted average of what we expect to see. But since we don\u2019t really know\n// what that is, using \u201Ce\u201D seems reasonable.\nconst defaultWidthMap = {\n a: 56,\n b: 63,\n c: 57,\n d: 63,\n e: 58,\n f: 37,\n g: 62,\n h: 60,\n i: 26,\n j: 26,\n k: 55,\n l: 26,\n m: 88,\n n: 60,\n o: 60,\n p: 62,\n q: 62,\n r: 39,\n s: 54,\n t: 38,\n u: 60,\n v: 55,\n w: 79,\n x: 54,\n y: 55,\n z: 55,\n A: 69,\n B: 67,\n C: 73,\n D: 74,\n E: 61,\n F: 58,\n G: 76,\n H: 75,\n I: 28,\n J: 55,\n K: 67,\n L: 58,\n M: 89,\n N: 75,\n O: 78,\n P: 65,\n Q: 78,\n R: 67,\n S: 65,\n T: 65,\n U: 75,\n V: 69,\n W: 98,\n X: 69,\n Y: 67,\n Z: 67,\n 0: 64,\n 1: 48,\n 2: 62,\n 3: 64,\n 4: 66,\n 5: 63,\n 6: 65,\n 7: 58,\n 8: 65,\n 9: 65,\n \" \": 29,\n \"!\": 32,\n '\"': 49,\n \"'\": 31,\n \"(\": 39,\n \")\": 39,\n \",\": 31,\n \"-\": 48,\n \".\": 31,\n \"/\": 32,\n \":\": 31,\n \";\": 31,\n \"?\": 52,\n \"\u2018\": 31,\n \"\u2019\": 31,\n \"\u201C\": 47,\n \"\u201D\": 47,\n \"\u2026\": 82\n};\n\n// This is a rudimentary (and U.S.-centric) algorithm for measuring the width of\n// a string based on a technique of Gregor Aisch; it assumes that individual\n// characters are laid out independently and does not implement the Unicode\n// grapheme cluster breaking algorithm. It does understand code points, though,\n// and so treats things like emoji as having the width of a lowercase e (and\n// should be equivalent to using for-of to iterate over code points, while also\n// being fast). TODO Optimize this by noting that we often re-measure characters\n// that were previously measured?\n// http://www.unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries\n// https://exploringjs.com/impatient-js/ch_strings.html#atoms-of-text\nexport function defaultWidth(text, start = 0, end = text.length) {\n let sum = 0;\n for (let i = start; i < end; i = readCharacter(text, i)) {\n sum += defaultWidthMap[text[i]] ?? (isPictographic(text, i) ? 120 : defaultWidthMap.e);\n }\n return sum;\n}\n\n// Even for monospaced text, we can\u2019t assume that the number of UTF-16 code\n// points (i.e., the length of a string) corresponds to the number of visible\n// characters; we still have to count graphemes. And note that pictographic\n// characters such as emojis are typically not monospaced!\nexport function monospaceWidth(text, start = 0, end = text.length) {\n let sum = 0;\n for (let i = start; i < end; i = readCharacter(text, i)) {\n sum += isPictographic(text, i) ? 200 : 100;\n }\n return sum;\n}\n\nexport function splitter({monospace, lineWidth, textOverflow}) {\n if (textOverflow != null || lineWidth == Infinity) return (text) => text.split(/\\r\\n?|\\n/g);\n const widthof = monospace ? monospaceWidth : defaultWidth;\n const maxWidth = lineWidth * 100;\n return (text) => lineWrap(text, maxWidth, widthof);\n}\n\nexport function clipper({monospace, lineWidth, textOverflow}) {\n if (textOverflow == null || lineWidth == Infinity) return (text) => text;\n const widthof = monospace ? monospaceWidth : defaultWidth;\n const maxWidth = lineWidth * 100;\n switch (textOverflow) {\n case \"clip-start\":\n return (text) => clipStart(text, maxWidth, widthof, \"\");\n case \"clip-end\":\n return (text) => clipEnd(text, maxWidth, widthof, \"\");\n case \"ellipsis-start\":\n return (text) => clipStart(text, maxWidth, widthof, ellipsis);\n case \"ellipsis-middle\":\n return (text) => clipMiddle(text, maxWidth, widthof, ellipsis);\n case \"ellipsis-end\":\n return (text) => clipEnd(text, maxWidth, widthof, ellipsis);\n }\n}\n\nexport const ellipsis = \"\u2026\";\n\n// Cuts the given text to the given width, using the specified widthof function;\n// the returned [index, error] guarantees text.slice(0, index) fits within the\n// specified width with the given error. If the text fits naturally within the\n// given width, returns [-1, 0]. If the text needs cutting, the given inset\n// specifies how much space (in the same units as width and widthof) to reserve\n// for a possible ellipsis character.\nexport function cut(text, width, widthof, inset) {\n const I = []; // indexes of read character boundaries\n let w = 0; // current line width\n for (let i = 0, j = 0, n = text.length; i < n; i = j) {\n j = readCharacter(text, i); // read the next character\n const l = widthof(text, i, j); // current character width\n if (w + l > width) {\n w += inset;\n while (w > width && i > 0) (j = i), (i = I.pop()), (w -= widthof(text, i, j)); // remove excess\n return [i, width - w];\n }\n w += l;\n I.push(i);\n }\n return [-1, 0];\n}\n\nexport function clipEnd(text, width, widthof, ellipsis) {\n text = text.trim(); // ignore leading and trailing whitespace\n const e = widthof(ellipsis);\n const [i] = cut(text, width, widthof, e);\n return i < 0 ? text : text.slice(0, i).trimEnd() + ellipsis;\n}\n\nexport function clipMiddle(text, width, widthof, ellipsis) {\n text = text.trim(); // ignore leading and trailing whitespace\n const w = widthof(text);\n if (w <= width) return text;\n const e = widthof(ellipsis) / 2;\n const [i, ei] = cut(text, width / 2, widthof, e);\n const [j] = cut(text, w - width / 2 - ei + e, widthof, -e); // TODO read spaces?\n return j < 0 ? ellipsis : text.slice(0, i).trimEnd() + ellipsis + text.slice(readCharacter(text, j)).trimStart();\n}\n\nexport function clipStart(text, width, widthof, ellipsis) {\n text = text.trim(); // ignore leading and trailing whitespace\n const w = widthof(text);\n if (w <= width) return text;\n const e = widthof(ellipsis);\n const [j] = cut(text, w - width + e, widthof, -e); // TODO read spaces?\n return j < 0 ? ellipsis : ellipsis + text.slice(readCharacter(text, j)).trimStart();\n}\n\nconst reCombiner = /[\\p{Combining_Mark}\\p{Emoji_Modifier}]+/uy;\nconst rePictographic = /\\p{Extended_Pictographic}/uy;\n\n// Reads a single \u201Ccharacter\u201D element from the given text starting at the given\n// index, returning the index after the read character. Ideally, this implements\n// the Unicode text segmentation algorithm and understands grapheme cluster\n// boundaries, etc., but in practice this is only smart enough to detect UTF-16\n// surrogate pairs, combining marks, and zero-width joiner (zwj) sequences such\n// as emoji skin color modifiers. https://unicode.org/reports/tr29/\nexport function readCharacter(text, i) {\n i += isSurrogatePair(text, i) ? 2 : 1;\n if (isCombiner(text, i)) i = reCombiner.lastIndex;\n if (isZeroWidthJoiner(text, i)) return readCharacter(text, i + 1);\n return i;\n}\n\n// We avoid more expensive regex tests involving Unicode property classes by\n// first checking for the common case of 7-bit ASCII characters.\nfunction isAscii(text, i) {\n return text.charCodeAt(i) < 0x80;\n}\n\nfunction isSurrogatePair(text, i) {\n const hi = text.charCodeAt(i);\n if (hi >= 0xd800 && hi < 0xdc00) {\n const lo = text.charCodeAt(i + 1);\n return lo >= 0xdc00 && lo < 0xe000;\n }\n return false;\n}\n\nfunction isZeroWidthJoiner(text, i) {\n return text.charCodeAt(i) === 0x200d;\n}\n\nfunction isCombiner(text, i) {\n return isAscii(text, i) ? false : ((reCombiner.lastIndex = i), reCombiner.test(text));\n}\n\nfunction isPictographic(text, i) {\n return isAscii(text, i) ? false : ((rePictographic.lastIndex = i), rePictographic.test(text));\n}\n", "import {pathRound as path} from \"d3\";\nimport {create} from \"../context.js\";\nimport {Mark} from \"../mark.js\";\nimport {maybeFrameAnchor, maybeNumberChannel, maybeTuple, keyword, identity} from \"../options.js\";\nimport {\n applyChannelStyles,\n applyDirectStyles,\n applyFrameAnchor,\n applyIndirectStyles,\n applyTransform\n} from \"../style.js\";\nimport {template} from \"../template.js\";\n\nconst defaults = {\n ariaLabel: \"vector\",\n fill: \"none\",\n stroke: \"currentColor\",\n strokeWidth: 1.5,\n strokeLinejoin: \"round\",\n strokeLinecap: \"round\"\n};\n\nconst defaultRadius = 3.5;\n\n// The size of the arrowhead is proportional to its length, but we still allow\n// the relative size of the head to be controlled via the mark\u2019s width option;\n// doubling the default radius will produce an arrowhead that is twice as big.\n// That said, we\u2019ll probably want a arrow with a fixed head size, too.\nconst wingRatio = defaultRadius * 5;\n\nconst shapeArrow = {\n draw(context, l, r) {\n const wing = (l * r) / wingRatio;\n context.moveTo(0, 0);\n context.lineTo(0, -l);\n context.moveTo(-wing, wing - l);\n context.lineTo(0, -l);\n context.lineTo(wing, wing - l);\n }\n};\n\nconst shapeSpike = {\n draw(context, l, r) {\n context.moveTo(-r, 0);\n context.lineTo(0, -l);\n context.lineTo(r, 0);\n }\n};\n\nconst shapes = new Map([\n [\"arrow\", shapeArrow],\n [\"spike\", shapeSpike]\n]);\n\nfunction isShapeObject(value) {\n return value && typeof value.draw === \"function\";\n}\n\nfunction maybeShape(shape) {\n if (isShapeObject(shape)) return shape;\n const value = shapes.get(`${shape}`.toLowerCase());\n if (value) return value;\n throw new Error(`invalid shape: ${shape}`);\n}\n\nexport class Vector extends Mark {\n constructor(data, options = {}) {\n const {x, y, r = defaultRadius, length, rotate, shape = shapeArrow, anchor = \"middle\", frameAnchor} = options;\n const [vl, cl] = maybeNumberChannel(length, 12);\n const [vr, cr] = maybeNumberChannel(rotate, 0);\n super(\n data,\n {\n x: {value: x, scale: \"x\", optional: true},\n y: {value: y, scale: \"y\", optional: true},\n length: {value: vl, scale: \"length\", optional: true},\n rotate: {value: vr, optional: true}\n },\n options,\n defaults\n );\n this.r = +r;\n this.length = cl;\n this.rotate = cr;\n this.shape = maybeShape(shape);\n this.anchor = keyword(anchor, \"anchor\", [\"start\", \"middle\", \"end\"]);\n this.frameAnchor = maybeFrameAnchor(frameAnchor);\n }\n render(index, scales, channels, dimensions, context) {\n const {x, y} = scales;\n const {x: X, y: Y, length: L, rotate: A} = channels;\n const {length, rotate, anchor, shape, r} = this;\n const [cx, cy] = applyFrameAnchor(this, dimensions);\n return create(\"svg:g\", context)\n .call(applyIndirectStyles, this, dimensions, context)\n .call(applyTransform, this, {x: X && x, y: Y && y})\n .call((g) =>\n g\n .selectAll()\n .data(index)\n .enter()\n .append(\"path\")\n .call(applyDirectStyles, this)\n .attr(\n \"transform\",\n template`translate(${X ? (i) => X[i] : cx},${Y ? (i) => Y[i] : cy})${\n A ? (i) => ` rotate(${A[i]})` : rotate ? ` rotate(${rotate})` : ``\n }${\n anchor === \"start\"\n ? ``\n : anchor === \"end\"\n ? L\n ? (i) => ` translate(0,${L[i]})`\n : ` translate(0,${length})`\n : L\n ? (i) => ` translate(0,${L[i] / 2})`\n : ` translate(0,${length / 2})`\n }`\n )\n .attr(\n \"d\",\n L\n ? (i) => {\n const p = path();\n shape.draw(p, L[i], r);\n return p;\n }\n : (() => {\n const p = path();\n shape.draw(p, length, r);\n return p;\n })()\n )\n .call(applyChannelStyles, this, channels)\n )\n .node();\n }\n}\n\nexport function vector(data, options = {}) {\n let {x, y, ...rest} = options;\n if (options.frameAnchor === undefined) [x, y] = maybeTuple(x, y);\n return new Vector(data, {...rest, x, y});\n}\n\nexport function vectorX(data, options = {}) {\n const {x = identity, ...rest} = options;\n return new Vector(data, {...rest, x});\n}\n\nexport function vectorY(data, options = {}) {\n const {y = identity, ...rest} = options;\n return new Vector(data, {...rest, y});\n}\n\nexport function spike(data, options = {}) {\n const {\n shape = shapeSpike,\n stroke = defaults.stroke,\n strokeWidth = 1,\n fill = stroke,\n fillOpacity = 0.3,\n anchor = \"start\",\n ...rest\n } = options;\n return vector(data, {...rest, shape, stroke, strokeWidth, fill, fillOpacity, anchor});\n}\n", "import {extent, format, timeFormat, utcFormat} from \"d3\";\nimport {formatDefault} from \"../format.js\";\nimport {marks} from \"../mark.js\";\nimport {radians} from \"../math.js\";\nimport {arrayify, constant, identity, keyword, number, range, valueof} from \"../options.js\";\nimport {isIterable, isNoneish, isTemporal, orderof} from \"../options.js\";\nimport {maybeColorChannel, maybeNumberChannel, maybeRangeInterval} from \"../options.js\";\nimport {isTemporalScale} from \"../scales.js\";\nimport {offset} from \"../style.js\";\nimport {formatTimeTicks, isTimeYear, isUtcYear} from \"../time.js\";\nimport {initializer} from \"../transforms/basic.js\";\nimport {ruleX, ruleY} from \"./rule.js\";\nimport {text, textX, textY} from \"./text.js\";\nimport {vectorX, vectorY} from \"./vector.js\";\n\nfunction maybeData(data, options) {\n if (arguments.length < 2 && !isIterable(data)) (options = data), (data = null);\n if (options === undefined) options = {};\n return [data, options];\n}\n\nfunction maybeAnchor({anchor} = {}, anchors) {\n return anchor === undefined ? anchors[0] : keyword(anchor, \"anchor\", anchors);\n}\n\nfunction anchorY(options) {\n return maybeAnchor(options, [\"left\", \"right\"]);\n}\n\nfunction anchorFy(options) {\n return maybeAnchor(options, [\"right\", \"left\"]);\n}\n\nfunction anchorX(options) {\n return maybeAnchor(options, [\"bottom\", \"top\"]);\n}\n\nfunction anchorFx(options) {\n return maybeAnchor(options, [\"top\", \"bottom\"]);\n}\n\nexport function axisY() {\n const [data, options] = maybeData(...arguments);\n return axisKy(\"y\", anchorY(options), data, options);\n}\n\nexport function axisFy() {\n const [data, options] = maybeData(...arguments);\n return axisKy(\"fy\", anchorFy(options), data, options);\n}\n\nexport function axisX() {\n const [data, options] = maybeData(...arguments);\n return axisKx(\"x\", anchorX(options), data, options);\n}\n\nexport function axisFx() {\n const [data, options] = maybeData(...arguments);\n return axisKx(\"fx\", anchorFx(options), data, options);\n}\n\nfunction axisKy(\n k,\n anchor,\n data,\n {\n color = \"currentColor\",\n opacity = 1,\n stroke = color,\n strokeOpacity = opacity,\n strokeWidth = 1,\n fill = color,\n fillOpacity = opacity,\n textAnchor,\n textStroke,\n textStrokeOpacity,\n textStrokeWidth,\n tickSize = k === \"y\" ? 6 : 0,\n tickPadding,\n tickRotate,\n x,\n margin,\n marginTop = margin === undefined ? 20 : margin,\n marginRight = margin === undefined ? (anchor === \"right\" ? 40 : 0) : margin,\n marginBottom = margin === undefined ? 20 : margin,\n marginLeft = margin === undefined ? (anchor === \"left\" ? 40 : 0) : margin,\n label,\n labelAnchor,\n labelArrow,\n labelOffset,\n ...options\n }\n) {\n tickSize = number(tickSize);\n tickPadding = number(tickPadding);\n tickRotate = number(tickRotate);\n if (labelAnchor !== undefined) labelAnchor = keyword(labelAnchor, \"labelAnchor\", [\"center\", \"top\", \"bottom\"]);\n labelArrow = maybeLabelArrow(labelArrow);\n return marks(\n tickSize && !isNoneish(stroke)\n ? axisTickKy(k, anchor, data, {\n stroke,\n strokeOpacity,\n strokeWidth,\n tickSize,\n tickPadding,\n tickRotate,\n x,\n ...options\n })\n : null,\n !isNoneish(fill)\n ? axisTextKy(k, anchor, data, {\n fill,\n fillOpacity,\n stroke: textStroke,\n strokeOpacity: textStrokeOpacity,\n strokeWidth: textStrokeWidth,\n textAnchor,\n tickSize,\n tickPadding,\n tickRotate,\n x,\n marginTop,\n marginRight,\n marginBottom,\n marginLeft,\n ...options\n })\n : null,\n !isNoneish(fill) && label !== null\n ? text(\n [],\n labelOptions({fill, fillOpacity, ...options}, function (data, facets, channels, scales, dimensions) {\n const scale = scales[k];\n const {marginTop, marginRight, marginBottom, marginLeft} = (k === \"y\" && dimensions.inset) || dimensions;\n const cla = labelAnchor ?? (scale.bandwidth ? \"center\" : \"top\");\n const clo = labelOffset ?? (anchor === \"right\" ? marginRight : marginLeft) - 3;\n if (cla === \"center\") {\n this.textAnchor = undefined; // middle\n this.lineAnchor = anchor === \"right\" ? \"bottom\" : \"top\";\n this.frameAnchor = anchor;\n this.rotate = -90;\n } else {\n this.textAnchor = anchor === \"right\" ? \"end\" : \"start\";\n this.lineAnchor = cla;\n this.frameAnchor = `${cla}-${anchor}`;\n this.rotate = 0;\n }\n this.dy = cla === \"top\" ? 3 - marginTop : cla === \"bottom\" ? marginBottom - 3 : 0;\n this.dx = anchor === \"right\" ? clo : -clo;\n this.ariaLabel = `${k}-axis label`;\n return {\n facets: [[0]],\n channels: {text: {value: [formatAxisLabel(k, scale, {anchor, label, labelAnchor: cla, labelArrow})]}}\n };\n })\n )\n : null\n );\n}\n\nfunction axisKx(\n k,\n anchor,\n data,\n {\n color = \"currentColor\",\n opacity = 1,\n stroke = color,\n strokeOpacity = opacity,\n strokeWidth = 1,\n fill = color,\n fillOpacity = opacity,\n textAnchor,\n textStroke,\n textStrokeOpacity,\n textStrokeWidth,\n tickSize = k === \"x\" ? 6 : 0,\n tickPadding,\n tickRotate,\n y,\n margin,\n marginTop = margin === undefined ? (anchor === \"top\" ? 30 : 0) : margin,\n marginRight = margin === undefined ? 20 : margin,\n marginBottom = margin === undefined ? (anchor === \"bottom\" ? 30 : 0) : margin,\n marginLeft = margin === undefined ? 20 : margin,\n label,\n labelAnchor,\n labelArrow,\n labelOffset,\n ...options\n }\n) {\n tickSize = number(tickSize);\n tickPadding = number(tickPadding);\n tickRotate = number(tickRotate);\n if (labelAnchor !== undefined) labelAnchor = keyword(labelAnchor, \"labelAnchor\", [\"center\", \"left\", \"right\"]);\n labelArrow = maybeLabelArrow(labelArrow);\n return marks(\n tickSize && !isNoneish(stroke)\n ? axisTickKx(k, anchor, data, {\n stroke,\n strokeOpacity,\n strokeWidth,\n tickSize,\n tickPadding,\n tickRotate,\n y,\n ...options\n })\n : null,\n !isNoneish(fill)\n ? axisTextKx(k, anchor, data, {\n fill,\n fillOpacity,\n stroke: textStroke,\n strokeOpacity: textStrokeOpacity,\n strokeWidth: textStrokeWidth,\n textAnchor,\n tickSize,\n tickPadding,\n tickRotate,\n y,\n marginTop,\n marginRight,\n marginBottom,\n marginLeft,\n ...options\n })\n : null,\n !isNoneish(fill) && label !== null\n ? text(\n [],\n labelOptions({fill, fillOpacity, ...options}, function (data, facets, channels, scales, dimensions) {\n const scale = scales[k];\n const {marginTop, marginRight, marginBottom, marginLeft} = (k === \"x\" && dimensions.inset) || dimensions;\n const cla = labelAnchor ?? (scale.bandwidth ? \"center\" : \"right\");\n const clo = labelOffset ?? (anchor === \"top\" ? marginTop : marginBottom) - 3;\n if (cla === \"center\") {\n this.frameAnchor = anchor;\n this.textAnchor = undefined; // middle\n } else {\n this.frameAnchor = `${anchor}-${cla}`;\n this.textAnchor = cla === \"right\" ? \"end\" : \"start\";\n }\n this.lineAnchor = anchor;\n this.dy = anchor === \"top\" ? -clo : clo;\n this.dx = cla === \"right\" ? marginRight - 3 : cla === \"left\" ? 3 - marginLeft : 0;\n this.ariaLabel = `${k}-axis label`;\n return {\n facets: [[0]],\n channels: {text: {value: [formatAxisLabel(k, scale, {anchor, label, labelAnchor: cla, labelArrow})]}}\n };\n })\n )\n : null\n );\n}\n\nfunction axisTickKy(\n k,\n anchor,\n data,\n {\n strokeWidth = 1,\n strokeLinecap = null,\n strokeLinejoin = null,\n facetAnchor = anchor + (k === \"y\" ? \"-empty\" : \"\"),\n frameAnchor = anchor,\n tickSize,\n inset = 0,\n insetLeft = inset,\n insetRight = inset,\n dx = 0,\n y = k === \"y\" ? undefined : null,\n ...options\n }\n) {\n return axisMark(vectorY, k, `${k}-axis tick`, data, {\n strokeWidth,\n strokeLinecap,\n strokeLinejoin,\n facetAnchor,\n frameAnchor,\n y,\n ...options,\n dx: anchor === \"left\" ? +dx - offset + +insetLeft : +dx + offset - insetRight,\n anchor: \"start\",\n length: tickSize,\n shape: anchor === \"left\" ? shapeTickLeft : shapeTickRight\n });\n}\n\nfunction axisTickKx(\n k,\n anchor,\n data,\n {\n strokeWidth = 1,\n strokeLinecap = null,\n strokeLinejoin = null,\n facetAnchor = anchor + (k === \"x\" ? \"-empty\" : \"\"),\n frameAnchor = anchor,\n tickSize,\n inset = 0,\n insetTop = inset,\n insetBottom = inset,\n dy = 0,\n x = k === \"x\" ? undefined : null,\n ...options\n }\n) {\n return axisMark(vectorX, k, `${k}-axis tick`, data, {\n strokeWidth,\n strokeLinejoin,\n strokeLinecap,\n facetAnchor,\n frameAnchor,\n x,\n ...options,\n dy: anchor === \"bottom\" ? +dy - offset - insetBottom : +dy + offset + +insetTop,\n anchor: \"start\",\n length: tickSize,\n shape: anchor === \"bottom\" ? shapeTickBottom : shapeTickTop\n });\n}\n\nfunction axisTextKy(\n k,\n anchor,\n data,\n {\n facetAnchor = anchor + (k === \"y\" ? \"-empty\" : \"\"),\n frameAnchor = anchor,\n tickSize,\n tickRotate = 0,\n tickPadding = Math.max(3, 9 - tickSize) + (Math.abs(tickRotate) > 60 ? 4 * Math.cos(tickRotate * radians) : 0),\n tickFormat,\n text = typeof tickFormat === \"function\" ? tickFormat : undefined,\n textAnchor = Math.abs(tickRotate) > 60 ? \"middle\" : anchor === \"left\" ? \"end\" : \"start\",\n lineAnchor = tickRotate > 60 ? \"top\" : tickRotate < -60 ? \"bottom\" : \"middle\",\n fontVariant,\n inset = 0,\n insetLeft = inset,\n insetRight = inset,\n dx = 0,\n y = k === \"y\" ? undefined : null,\n ...options\n }\n) {\n return axisMark(\n textY,\n k,\n `${k}-axis tick label`,\n data,\n {\n facetAnchor,\n frameAnchor,\n text: text === undefined ? null : text,\n textAnchor,\n lineAnchor,\n fontVariant,\n rotate: tickRotate,\n y,\n ...options,\n dx: anchor === \"left\" ? +dx - tickSize - tickPadding + +insetLeft : +dx + +tickSize + +tickPadding - insetRight\n },\n function (scale, data, ticks, channels) {\n if (fontVariant === undefined) this.fontVariant = inferFontVariant(scale);\n if (text === undefined) channels.text = inferTextChannel(scale, data, ticks, tickFormat, anchor);\n }\n );\n}\n\nfunction axisTextKx(\n k,\n anchor,\n data,\n {\n facetAnchor = anchor + (k === \"x\" ? \"-empty\" : \"\"),\n frameAnchor = anchor,\n tickSize,\n tickRotate = 0,\n tickPadding = Math.max(3, 9 - tickSize) + (Math.abs(tickRotate) >= 10 ? 4 * Math.cos(tickRotate * radians) : 0),\n tickFormat,\n text = typeof tickFormat === \"function\" ? tickFormat : undefined,\n textAnchor = Math.abs(tickRotate) >= 10 ? ((tickRotate < 0) ^ (anchor === \"bottom\") ? \"start\" : \"end\") : \"middle\",\n lineAnchor = Math.abs(tickRotate) >= 10 ? \"middle\" : anchor === \"bottom\" ? \"top\" : \"bottom\",\n fontVariant,\n inset = 0,\n insetTop = inset,\n insetBottom = inset,\n dy = 0,\n x = k === \"x\" ? undefined : null,\n ...options\n }\n) {\n return axisMark(\n textX,\n k,\n `${k}-axis tick label`,\n data,\n {\n facetAnchor,\n frameAnchor,\n text: text === undefined ? null : text,\n textAnchor,\n lineAnchor,\n fontVariant,\n rotate: tickRotate,\n x,\n ...options,\n dy: anchor === \"bottom\" ? +dy + +tickSize + +tickPadding - insetBottom : +dy - tickSize - tickPadding + +insetTop\n },\n function (scale, data, ticks, channels) {\n if (fontVariant === undefined) this.fontVariant = inferFontVariant(scale);\n if (text === undefined) channels.text = inferTextChannel(scale, data, ticks, tickFormat, anchor);\n }\n );\n}\n\nexport function gridY() {\n const [data, options] = maybeData(...arguments);\n return gridKy(\"y\", anchorY(options), data, options);\n}\n\nexport function gridFy() {\n const [data, options] = maybeData(...arguments);\n return gridKy(\"fy\", anchorFy(options), data, options);\n}\n\nexport function gridX() {\n const [data, options] = maybeData(...arguments);\n return gridKx(\"x\", anchorX(options), data, options);\n}\n\nexport function gridFx() {\n const [data, options] = maybeData(...arguments);\n return gridKx(\"fx\", anchorFx(options), data, options);\n}\n\nfunction gridKy(\n k,\n anchor,\n data,\n {\n y = k === \"y\" ? undefined : null,\n x = null,\n x1 = anchor === \"left\" ? x : null,\n x2 = anchor === \"right\" ? x : null,\n ...options\n }\n) {\n return axisMark(ruleY, k, `${k}-grid`, data, {y, x1, x2, ...gridDefaults(options)});\n}\n\nfunction gridKx(\n k,\n anchor,\n data,\n {\n x = k === \"x\" ? undefined : null,\n y = null,\n y1 = anchor === \"top\" ? y : null,\n y2 = anchor === \"bottom\" ? y : null,\n ...options\n }\n) {\n return axisMark(ruleX, k, `${k}-grid`, data, {x, y1, y2, ...gridDefaults(options)});\n}\n\nfunction gridDefaults({\n color = \"currentColor\",\n opacity = 0.1,\n stroke = color,\n strokeOpacity = opacity,\n strokeWidth = 1,\n ...options\n}) {\n return {stroke, strokeOpacity, strokeWidth, ...options};\n}\n\nfunction labelOptions(\n {fill, fillOpacity, fontFamily, fontSize, fontStyle, fontWeight, monospace, pointerEvents, shapeRendering},\n initializer\n) {\n // Only propagate these options if constant.\n [, fill] = maybeColorChannel(fill);\n [, fillOpacity] = maybeNumberChannel(fillOpacity);\n return {\n facet: \"super\",\n x: null,\n y: null,\n fill,\n fillOpacity,\n fontFamily,\n fontSize,\n fontStyle,\n fontWeight,\n monospace,\n pointerEvents,\n shapeRendering,\n initializer\n };\n}\n\nfunction axisMark(mark, k, ariaLabel, data, options, initialize) {\n let channels;\n\n function axisInitializer(data, facets, _channels, scales, dimensions, context) {\n const initializeFacets = data == null && (k === \"fx\" || k === \"fy\");\n const {[k]: scale} = scales;\n if (!scale) throw new Error(`missing scale: ${k}`);\n let {ticks, tickSpacing, interval} = options;\n if (isTemporalScale(scale) && typeof ticks === \"string\") (interval = ticks), (ticks = undefined);\n if (data == null) {\n if (isIterable(ticks)) {\n data = arrayify(ticks);\n } else if (scale.ticks) {\n if (ticks !== undefined) {\n data = scale.ticks(ticks);\n } else {\n interval = maybeRangeInterval(interval === undefined ? scale.interval : interval, scale.type);\n if (interval !== undefined) {\n // For time scales, we could pass the interval directly to\n // scale.ticks because it\u2019s supported by d3.utcTicks; but\n // quantitative scales and d3.ticks do not support numeric\n // intervals for scale.ticks, so we compute them here.\n const [min, max] = extent(scale.domain());\n data = interval.range(min, interval.offset(interval.floor(max))); // inclusive max\n } else {\n const [min, max] = extent(scale.range());\n ticks = (max - min) / (tickSpacing === undefined ? (k === \"x\" ? 80 : 35) : tickSpacing);\n data = scale.ticks(ticks);\n }\n }\n } else {\n data = scale.domain();\n }\n if (k === \"y\" || k === \"x\") {\n facets = [range(data)];\n } else {\n channels[k] = {scale: k, value: identity};\n }\n }\n initialize?.call(this, scale, data, ticks, channels);\n const initializedChannels = Object.fromEntries(\n Object.entries(channels).map(([name, channel]) => {\n return [name, {...channel, value: valueof(data, channel.value)}];\n })\n );\n if (initializeFacets) facets = context.filterFacets(data, initializedChannels);\n return {data, facets, channels: initializedChannels};\n }\n\n // Apply any basic initializers after the axis initializer computes the ticks.\n const basicInitializer = initializer(options).initializer;\n const m = mark(data, initializer({...options, initializer: axisInitializer}, basicInitializer));\n if (data == null) {\n channels = m.channels;\n m.channels = {};\n } else {\n channels = {};\n }\n m.ariaLabel = ariaLabel;\n return m;\n}\n\nfunction inferTextChannel(scale, data, ticks, tickFormat, anchor) {\n return {value: inferTickFormat(scale, data, ticks, tickFormat, anchor)};\n}\n\n// D3\u2019s ordinal scales simply use toString by default, but if the ordinal scale\n// domain (or ticks) are numbers or dates (say because we\u2019re applying a time\n// interval to the ordinal scale), we want Plot\u2019s default formatter.\nexport function inferTickFormat(scale, data, ticks, tickFormat, anchor) {\n return tickFormat === undefined && isTemporalScale(scale)\n ? formatTimeTicks(scale, data, ticks, anchor)\n : scale.tickFormat\n ? scale.tickFormat(isIterable(ticks) ? null : ticks, tickFormat)\n : tickFormat === undefined\n ? isUtcYear(scale.interval)\n ? utcFormat(\"%Y\")\n : isTimeYear(scale.interval)\n ? timeFormat(\"%Y\")\n : formatDefault\n : typeof tickFormat === \"string\"\n ? (isTemporal(scale.domain()) ? utcFormat : format)(tickFormat)\n : constant(tickFormat);\n}\n\nconst shapeTickBottom = {\n draw(context, l) {\n context.moveTo(0, 0);\n context.lineTo(0, l);\n }\n};\n\nconst shapeTickTop = {\n draw(context, l) {\n context.moveTo(0, 0);\n context.lineTo(0, -l);\n }\n};\n\nconst shapeTickLeft = {\n draw(context, l) {\n context.moveTo(0, 0);\n context.lineTo(-l, 0);\n }\n};\n\nconst shapeTickRight = {\n draw(context, l) {\n context.moveTo(0, 0);\n context.lineTo(l, 0);\n }\n};\n\n// TODO Unify this with the other inferFontVariant; here we only have a scale\n// function rather than a scale descriptor.\nfunction inferFontVariant(scale) {\n return scale.bandwidth && !scale.interval ? undefined : \"tabular-nums\";\n}\n\n// Determines whether the scale points in the \u201Cpositive\u201D (right or down) or\n// \u201Cnegative\u201D (left or up) direction; if the scale order cannot be determined,\n// returns NaN; used to assign an appropriate label arrow.\nfunction inferScaleOrder(scale) {\n return Math.sign(orderof(scale.domain())) * Math.sign(orderof(scale.range()));\n}\n\n// Takes the scale label, and if this is not an ordinal scale and the label was\n// inferred from an associated channel, adds an orientation-appropriate arrow.\nfunction formatAxisLabel(k, scale, {anchor, label = scale.label, labelAnchor, labelArrow} = {}) {\n if (label == null || (label.inferred && isTemporalish(scale) && /^(date|time|year)$/i.test(label))) return;\n label = String(label); // coerce to a string after checking if inferred\n if (labelArrow === \"auto\") labelArrow = (!scale.bandwidth || scale.interval) && !/[\u2191\u2193\u2192\u2190]/.test(label);\n if (!labelArrow) return label;\n if (labelArrow === true) {\n const order = inferScaleOrder(scale);\n if (order)\n labelArrow =\n /x$/.test(k) || labelAnchor === \"center\"\n ? /x$/.test(k) === order < 0\n ? \"left\"\n : \"right\"\n : order < 0\n ? \"up\"\n : \"down\";\n }\n switch (labelArrow) {\n case \"left\":\n return `\u2190 ${label}`;\n case \"right\":\n return `${label} \u2192`;\n case \"up\":\n return anchor === \"right\" ? `${label} \u2191` : `\u2191 ${label}`;\n case \"down\":\n return anchor === \"right\" ? `${label} \u2193` : `\u2193 ${label}`;\n }\n return label;\n}\n\nfunction maybeLabelArrow(labelArrow = \"auto\") {\n return isNoneish(labelArrow)\n ? false\n : typeof labelArrow === \"boolean\"\n ? labelArrow\n : keyword(labelArrow, \"labelArrow\", [\"auto\", \"up\", \"right\", \"down\", \"left\"]);\n}\n\nfunction isTemporalish(scale) {\n return isTemporalScale(scale) || scale.interval != null;\n}\n", "import {pathRound as path} from \"d3\";\nimport {inferFontVariant} from \"../axes.js\";\nimport {create, createContext} from \"../context.js\";\nimport {isNoneish, maybeColorChannel, maybeNumberChannel} from \"../options.js\";\nimport {isOrdinalScale, isThresholdScale} from \"../scales.js\";\nimport {applyInlineStyles, impliedString, maybeClassName} from \"../style.js\";\nimport {inferTickFormat} from \"../marks/axis.js\";\n\nfunction maybeScale(scale, key) {\n if (key == null) return key;\n const s = scale(key);\n if (!s) throw new Error(`scale not found: ${key}`);\n return s;\n}\n\nexport function legendSwatches(color, {opacity, ...options} = {}) {\n if (!isOrdinalScale(color) && !isThresholdScale(color))\n throw new Error(`swatches legend requires ordinal or threshold color scale (not ${color.type})`);\n return legendItems(color, options, (selection, scale, width, height) =>\n selection\n .append(\"svg\")\n .attr(\"width\", width)\n .attr(\"height\", height)\n .attr(\"fill\", scale.scale)\n .attr(\"fill-opacity\", maybeNumberChannel(opacity)[1])\n .append(\"rect\")\n .attr(\"width\", \"100%\")\n .attr(\"height\", \"100%\")\n );\n}\n\nexport function legendSymbols(\n symbol,\n {\n fill = symbol.hint?.fill !== undefined ? symbol.hint.fill : \"none\",\n fillOpacity = 1,\n stroke = symbol.hint?.stroke !== undefined ? symbol.hint.stroke : isNoneish(fill) ? \"currentColor\" : \"none\",\n strokeOpacity = 1,\n strokeWidth = 1.5,\n r = 4.5,\n ...options\n } = {},\n scale\n) {\n const [vf, cf] = maybeColorChannel(fill);\n const [vs, cs] = maybeColorChannel(stroke);\n const sf = maybeScale(scale, vf);\n const ss = maybeScale(scale, vs);\n const size = r * r * Math.PI;\n fillOpacity = maybeNumberChannel(fillOpacity)[1];\n strokeOpacity = maybeNumberChannel(strokeOpacity)[1];\n strokeWidth = maybeNumberChannel(strokeWidth)[1];\n return legendItems(symbol, options, (selection, scale, width, height) =>\n selection\n .append(\"svg\")\n .attr(\"viewBox\", \"-8 -8 16 16\")\n .attr(\"width\", width)\n .attr(\"height\", height)\n .attr(\"fill\", vf === \"color\" ? (d) => sf.scale(d) : cf)\n .attr(\"fill-opacity\", fillOpacity)\n .attr(\"stroke\", vs === \"color\" ? (d) => ss.scale(d) : cs)\n .attr(\"stroke-opacity\", strokeOpacity)\n .attr(\"stroke-width\", strokeWidth)\n .append(\"path\")\n .attr(\"d\", (d) => {\n const p = path();\n symbol.scale(d).draw(p, size);\n return p;\n })\n );\n}\n\nfunction legendItems(scale, options = {}, swatch) {\n let {\n columns,\n tickFormat,\n fontVariant = inferFontVariant(scale),\n // TODO label,\n swatchSize = 15,\n swatchWidth = swatchSize,\n swatchHeight = swatchSize,\n marginLeft = 0,\n className,\n style,\n width\n } = options;\n const context = createContext(options);\n className = maybeClassName(className);\n if (typeof tickFormat !== \"function\") tickFormat = inferTickFormat(scale.scale, scale.domain, undefined, tickFormat);\n\n const swatches = create(\"div\", context).attr(\n \"class\",\n `${className}-swatches ${className}-swatches-${columns != null ? \"columns\" : \"wrap\"}`\n );\n\n let extraStyle;\n\n if (columns != null) {\n extraStyle = `.${className}-swatches-columns .${className}-swatch {\n display: flex;\n align-items: center;\n break-inside: avoid;\n padding-bottom: 1px;\n}\n.${className}-swatches-columns .${className}-swatch::before {\n flex-shrink: 0;\n}\n.${className}-swatches-columns .${className}-swatch-label {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}`;\n\n swatches\n .style(\"columns\", columns)\n .selectAll()\n .data(scale.domain)\n .enter()\n .append(\"div\")\n .attr(\"class\", `${className}-swatch`)\n .call(swatch, scale, swatchWidth, swatchHeight)\n .call((item) =>\n item.append(\"div\").attr(\"class\", `${className}-swatch-label`).attr(\"title\", tickFormat).text(tickFormat)\n );\n } else {\n extraStyle = `.${className}-swatches-wrap {\n display: flex;\n align-items: center;\n min-height: 33px;\n flex-wrap: wrap;\n}\n.${className}-swatches-wrap .${className}-swatch {\n display: inline-flex;\n align-items: center;\n margin-right: 1em;\n}`;\n\n swatches\n .selectAll()\n .data(scale.domain)\n .enter()\n .append(\"span\")\n .attr(\"class\", `${className}-swatch`)\n .call(swatch, scale, swatchWidth, swatchHeight)\n .append(function () {\n return this.ownerDocument.createTextNode(tickFormat.apply(this, arguments));\n });\n }\n\n return swatches\n .call((div) =>\n div.insert(\"style\", \"*\").text(\n `.${className}-swatches {\n font-family: system-ui, sans-serif;\n font-size: 10px;\n margin-bottom: 0.5em;\n}\n.${className}-swatch > svg {\n margin-right: 0.5em;\n overflow: visible;\n}\n${extraStyle}`\n )\n )\n .style(\"margin-left\", marginLeft ? `${+marginLeft}px` : null)\n .style(\"width\", width === undefined ? null : `${+width}px`)\n .style(\"font-variant\", impliedString(fontVariant, \"normal\"))\n .call(applyInlineStyles, style)\n .node();\n}\n", "import {rgb} from \"d3\";\nimport {createContext} from \"./context.js\";\nimport {legendRamp} from \"./legends/ramp.js\";\nimport {legendSwatches, legendSymbols} from \"./legends/swatches.js\";\nimport {inherit, isScaleOptions} from \"./options.js\";\nimport {normalizeScale} from \"./scales.js\";\n\nconst legendRegistry = new Map([\n [\"symbol\", legendSymbols],\n [\"color\", legendColor],\n [\"opacity\", legendOpacity]\n]);\n\nexport function legend(options = {}) {\n for (const [key, value] of legendRegistry) {\n const scale = options[key];\n if (isScaleOptions(scale)) {\n // e.g., ignore {color: \"red\"}\n const context = createContext(options);\n let hint;\n // For symbol legends, pass a hint to the symbol scale.\n if (key === \"symbol\") {\n const {fill, stroke = fill === undefined && isScaleOptions(options.color) ? \"color\" : undefined} = options;\n hint = {fill, stroke};\n }\n return value(normalizeScale(key, scale, hint), legendOptions(context, scale, options), (key) =>\n isScaleOptions(options[key]) ? normalizeScale(key, options[key]) : null\n );\n }\n }\n throw new Error(\"unknown legend type; no scale found\");\n}\n\nexport function exposeLegends(scales, context, defaults = {}) {\n return (key, options) => {\n if (!legendRegistry.has(key)) throw new Error(`unknown legend type: ${key}`);\n if (!(key in scales)) return;\n return legendRegistry.get(key)(scales[key], legendOptions(context, defaults[key], options), (key) => scales[key]);\n };\n}\n\nfunction legendOptions({className, ...context}, {label, ticks, tickFormat} = {}, options) {\n return inherit(options, {className, ...context}, {label, ticks, tickFormat});\n}\n\nfunction legendColor(color, {legend = true, ...options}) {\n if (legend === true) legend = color.type === \"ordinal\" ? \"swatches\" : \"ramp\";\n if (color.domain === undefined) return;\n switch (`${legend}`.toLowerCase()) {\n case \"swatches\":\n return legendSwatches(color, options);\n case \"ramp\":\n return legendRamp(color, options);\n default:\n throw new Error(`unknown legend type: ${legend}`);\n }\n}\n\nfunction legendOpacity({type, interpolate, ...scale}, {legend = true, color = rgb(0, 0, 0), ...options}) {\n if (!interpolate) throw new Error(`${type} opacity scales are not supported`);\n if (legend === true) legend = \"ramp\";\n if (`${legend}`.toLowerCase() !== \"ramp\") throw new Error(`${legend} opacity legends are not supported`);\n return legendColor({type, ...scale, interpolate: interpolateOpacity(color)}, {legend, ...options});\n}\n\nfunction interpolateOpacity(color) {\n const {r, g, b} = rgb(color) || rgb(0, 0, 0); // treat invalid color as black\n return (t) => `rgba(${r},${g},${b},${t})`;\n}\n\nexport function createLegends(scales, context, options) {\n const legends = [];\n for (const [key, value] of legendRegistry) {\n const o = options[key];\n if (o?.legend && key in scales) {\n const legend = value(scales[key], legendOptions(context, scales[key], o), (key) => scales[key]);\n if (legend != null) legends.push(legend);\n }\n }\n return legends;\n}\n", "import {create} from \"../context.js\";\nimport {Mark} from \"../mark.js\";\nimport {maybeKeyword, number, singleton} from \"../options.js\";\nimport {applyChannelStyles, applyDirectStyles, applyIndirectStyles, applyTransform} from \"../style.js\";\n\nconst defaults = {\n ariaLabel: \"frame\",\n fill: \"none\",\n stroke: \"currentColor\"\n};\n\nconst lineDefaults = {\n ariaLabel: \"frame\",\n fill: null,\n stroke: \"currentColor\",\n strokeLinecap: \"square\"\n};\n\nexport class Frame extends Mark {\n constructor(options = {}) {\n const {\n anchor = null,\n inset = 0,\n insetTop = inset,\n insetRight = inset,\n insetBottom = inset,\n insetLeft = inset,\n rx,\n ry\n } = options;\n super(singleton, undefined, options, anchor == null ? defaults : lineDefaults);\n this.anchor = maybeKeyword(anchor, \"anchor\", [\"top\", \"right\", \"bottom\", \"left\"]);\n this.insetTop = number(insetTop);\n this.insetRight = number(insetRight);\n this.insetBottom = number(insetBottom);\n this.insetLeft = number(insetLeft);\n this.rx = number(rx);\n this.ry = number(ry);\n }\n render(index, scales, channels, dimensions, context) {\n const {marginTop, marginRight, marginBottom, marginLeft, width, height} = dimensions;\n const {anchor, insetTop, insetRight, insetBottom, insetLeft, rx, ry} = this;\n const x1 = marginLeft + insetLeft;\n const x2 = width - marginRight - insetRight;\n const y1 = marginTop + insetTop;\n const y2 = height - marginBottom - insetBottom;\n return create(anchor ? \"svg:line\" : \"svg:rect\", context)\n .datum(0)\n .call(applyIndirectStyles, this, dimensions, context)\n .call(applyDirectStyles, this)\n .call(applyChannelStyles, this, channels)\n .call(applyTransform, this, {})\n .call(\n anchor === \"left\"\n ? (line) => line.attr(\"x1\", x1).attr(\"x2\", x1).attr(\"y1\", y1).attr(\"y2\", y2)\n : anchor === \"right\"\n ? (line) => line.attr(\"x1\", x2).attr(\"x2\", x2).attr(\"y1\", y1).attr(\"y2\", y2)\n : anchor === \"top\"\n ? (line) => line.attr(\"x1\", x1).attr(\"x2\", x2).attr(\"y1\", y1).attr(\"y2\", y1)\n : anchor === \"bottom\"\n ? (line) => line.attr(\"x1\", x1).attr(\"x2\", x2).attr(\"y1\", y2).attr(\"y2\", y2)\n : (rect) =>\n rect\n .attr(\"x\", x1)\n .attr(\"y\", y1)\n .attr(\"width\", x2 - x1)\n .attr(\"height\", y2 - y1)\n .attr(\"rx\", rx)\n .attr(\"ry\", ry)\n )\n .node();\n }\n}\n\nexport function frame(options) {\n return new Frame(options);\n}\n", "import {select} from \"d3\";\nimport {getSource} from \"../channel.js\";\nimport {create} from \"../context.js\";\nimport {defined} from \"../defined.js\";\nimport {formatDefault} from \"../format.js\";\nimport {anchorX, anchorY} from \"../interactions/pointer.js\";\nimport {Mark} from \"../mark.js\";\nimport {maybeAnchor, maybeFrameAnchor, maybeTuple, number, string} from \"../options.js\";\nimport {applyDirectStyles, applyFrameAnchor, applyIndirectStyles, applyTransform, impliedString} from \"../style.js\";\nimport {identity, isIterable, isTextual} from \"../options.js\";\nimport {inferTickFormat} from \"./axis.js\";\nimport {applyIndirectTextStyles, defaultWidth, ellipsis, monospaceWidth} from \"./text.js\";\nimport {cut, clipper, splitter, maybeTextOverflow} from \"./text.js\";\n\nconst defaults = {\n ariaLabel: \"tip\",\n fill: \"white\",\n stroke: \"currentColor\"\n};\n\n// These channels are not displayed in the tip; TODO allow customization.\nconst ignoreChannels = new Set([\"geometry\", \"href\", \"src\", \"ariaLabel\"]);\n\nexport class Tip extends Mark {\n constructor(data, options = {}) {\n if (options.tip) options = {...options, tip: false};\n if (options.title === undefined && isIterable(data) && isTextual(data)) options = {...options, title: identity};\n const {\n x,\n y,\n x1,\n x2,\n y1,\n y2,\n anchor,\n monospace,\n fontFamily = monospace ? \"ui-monospace, monospace\" : undefined,\n fontSize,\n fontStyle,\n fontVariant,\n fontWeight,\n lineHeight = 1,\n lineWidth = 20,\n frameAnchor,\n textAnchor = \"start\",\n textOverflow,\n textPadding = 8,\n title,\n pointerSize = 12,\n pathFilter = \"drop-shadow(0 3px 4px rgba(0,0,0,0.2))\"\n } = options;\n super(\n data,\n {\n x: {value: x1 != null && x2 != null ? null : x, scale: \"x\", optional: true}, // ignore midpoint\n y: {value: y1 != null && y2 != null ? null : y, scale: \"y\", optional: true}, // ignore midpoint\n x1: {value: x1, scale: \"x\", optional: x2 == null},\n y1: {value: y1, scale: \"y\", optional: y2 == null},\n x2: {value: x2, scale: \"x\", optional: x1 == null},\n y2: {value: y2, scale: \"y\", optional: y1 == null},\n title: {value: title, optional: true} // filter: defined\n },\n options,\n defaults\n );\n this.anchor = maybeAnchor(anchor, \"anchor\");\n this.previousAnchor = this.anchor ?? \"top-left\";\n this.frameAnchor = maybeFrameAnchor(frameAnchor);\n this.textAnchor = impliedString(textAnchor, \"middle\");\n this.textPadding = +textPadding;\n this.pointerSize = +pointerSize;\n this.pathFilter = string(pathFilter);\n this.lineHeight = +lineHeight;\n this.lineWidth = +lineWidth;\n this.textOverflow = maybeTextOverflow(textOverflow);\n this.monospace = !!monospace;\n this.fontFamily = string(fontFamily);\n this.fontSize = number(fontSize);\n this.fontStyle = string(fontStyle);\n this.fontVariant = string(fontVariant);\n this.fontWeight = string(fontWeight);\n for (const key in defaults) if (key in this.channels) this[key] = defaults[key]; // apply default even if channel\n this.splitLines = splitter(this);\n this.clipLine = clipper(this);\n }\n render(index, scales, values, dimensions, context) {\n const mark = this;\n const {x, y, fx, fy} = scales;\n const {ownerSVGElement: svg, document} = context;\n const {anchor, monospace, lineHeight, lineWidth} = this;\n const {textPadding: r, pointerSize: m, pathFilter} = this;\n const {marginTop, marginLeft} = dimensions;\n const sources = getSources(values);\n\n // The anchor position is the middle of x1 & y1 and x2 & y2, if available,\n // or x & y; the former is considered more specific because it\u2019s how we\n // disable the implicit stack and interval transforms. If any dimension is\n // unspecified, we fallback to the frame anchor. We also need to know the\n // facet offsets to detect when the tip would draw outside the plot, and\n // thus we need to change the orientation.\n const {x1: X1, y1: Y1, x2: X2, y2: Y2, x: X = X1 ?? X2, y: Y = Y1 ?? Y2} = values;\n const ox = fx ? fx(index.fx) - marginLeft : 0;\n const oy = fy ? fy(index.fy) - marginTop : 0;\n\n // The order of precedence for the anchor position is: the middle of x1 & y1\n // and x2 & y2; or x1 & y1 (e.g., area); or lastly x & y. If a dimension is\n // unspecified, the frame anchor is used.\n const [cx, cy] = applyFrameAnchor(this, dimensions);\n const px = anchorX(values, cx);\n const py = anchorY(values, cy);\n\n // Resolve the text metric implementation. We may need an ellipsis for text\n // truncation, so we optimistically compute the ellipsis width.\n const widthof = monospace ? monospaceWidth : defaultWidth;\n const ee = widthof(ellipsis);\n\n // We borrow the scale\u2019s tick format for facet channels; this is safe for\n // ordinal scales (but not continuous scales where the display value may\n // need higher precision), and generally better than the default format.\n const formatFx = fx && inferTickFormat(fx);\n const formatFy = fy && inferTickFormat(fy);\n\n function* format(sources, i) {\n if (\"title\" in sources) {\n const text = sources.title.value[i];\n for (const line of mark.splitLines(formatDefault(text))) {\n yield {name: \"\", value: mark.clipLine(line)};\n }\n return;\n }\n for (const key in sources) {\n if (key === \"x1\" && \"x2\" in sources) continue;\n if (key === \"y1\" && \"y2\" in sources) continue;\n const channel = sources[key];\n const value = channel.value[i];\n if (!defined(value) && channel.scale == null) continue;\n if (key === \"x2\" && \"x1\" in sources) {\n yield {name: formatLabel(scales, channel, \"x\"), value: formatPair(sources.x1, channel, i)};\n } else if (key === \"y2\" && \"y1\" in sources) {\n yield {name: formatLabel(scales, channel, \"y\"), value: formatPair(sources.y1, channel, i)};\n } else {\n const scale = channel.scale;\n const line = {name: formatLabel(scales, channel, key), value: formatDefault(value)};\n if (scale === \"color\" || scale === \"opacity\") line[scale] = values[key][i];\n yield line;\n }\n }\n if (index.fi != null && fx) yield {name: String(fx.label ?? \"fx\"), value: formatFx(index.fx)};\n if (index.fi != null && fy) yield {name: String(fy.label ?? \"fy\"), value: formatFy(index.fy)};\n }\n\n // We don\u2019t call applyChannelStyles because we only use the channels to\n // derive the content of the tip, not its aesthetics.\n const g = create(\"svg:g\", context)\n .call(applyIndirectStyles, this, dimensions, context)\n .call(applyIndirectTextStyles, this)\n .call(applyTransform, this, {x: X && x, y: Y && y})\n .call((g) =>\n g\n .selectAll()\n .data(index)\n .enter()\n .append(\"g\")\n .attr(\"transform\", (i) => `translate(${Math.round(px(i))},${Math.round(py(i))})`) // crisp edges\n .call(applyDirectStyles, this)\n .call((g) => g.append(\"path\").attr(\"filter\", pathFilter))\n .call((g) =>\n g.append(\"text\").each(function (i) {\n const that = select(this);\n // prevent style inheritance (from path)\n this.setAttribute(\"fill\", \"currentColor\");\n this.setAttribute(\"fill-opacity\", 1);\n this.setAttribute(\"stroke\", \"none\");\n // iteratively render each channel value\n const names = new Set();\n for (const line of format(sources, i)) {\n const name = line.name;\n if (name && names.has(name)) continue;\n else names.add(name);\n renderLine(that, line);\n }\n })\n )\n );\n\n // Renders a single line (a name-value pair) to the tip, truncating the text\n // as needed, and adding a title if the text is truncated. Note that this is\n // just the initial layout of the text; in postrender we will compute the\n // exact text metrics and translate the text as needed once we know the\n // tip\u2019s orientation (anchor).\n function renderLine(selection, {name, value, color, opacity}) {\n const swatch = color != null || opacity != null;\n let title;\n let w = lineWidth * 100;\n const [j] = cut(name, w, widthof, ee);\n if (j >= 0) {\n // name is truncated\n name = name.slice(0, j).trimEnd() + ellipsis;\n title = value.trim();\n value = \"\";\n } else {\n if (name || (!value && !swatch)) value = \" \" + value;\n const [k] = cut(value, w - widthof(name), widthof, ee);\n if (k >= 0) {\n // value is truncated\n value = value.slice(0, k).trimEnd() + ellipsis;\n title = value.trim();\n }\n }\n const line = selection.append(\"tspan\").attr(\"x\", 0).attr(\"dy\", `${lineHeight}em`).text(\"\\u200b\"); // zwsp for double-click\n if (name) line.append(\"tspan\").attr(\"font-weight\", \"bold\").text(name);\n if (value) line.append(() => document.createTextNode(value));\n if (swatch) line.append(\"tspan\").text(\" \u25A0\").attr(\"fill\", color).attr(\"fill-opacity\", opacity).style(\"user-select\", \"none\"); // prettier-ignore\n if (title) line.append(\"title\").text(title);\n }\n\n // Only after the plot is attached to the page can we compute the exact text\n // metrics needed to determine the tip size and orientation (anchor).\n function postrender() {\n const {width, height} = dimensions.facet ?? dimensions;\n g.selectChildren().each(function (i) {\n let {x: tx, width: w, height: h} = this.getBBox();\n (w = Math.round(w)), (h = Math.round(h)); // crisp edges\n let a = anchor; // use the specified anchor, if any\n if (a === undefined) {\n a = mark.previousAnchor; // favor the previous anchor, if it fits\n const x = px(i) + ox;\n const y = py(i) + oy;\n const fitLeft = x + w + r * 2 < width;\n const fitRight = x - w - r * 2 > 0;\n const fitTop = y + h + m + r * 2 + 7 < height;\n const fitBottom = y - h - m - r * 2 > 0;\n const ax = (/-left$/.test(a) ? fitLeft || !fitRight : fitLeft && !fitRight) ? \"left\" : \"right\";\n const ay = (/^top-/.test(a) ? fitTop || !fitBottom : fitTop && !fitBottom) ? \"top\" : \"bottom\";\n a = mark.previousAnchor = `${ay}-${ax}`;\n }\n const path = this.firstChild; // note: assumes exactly two children!\n const text = this.lastChild; // note: assumes exactly two children!\n path.setAttribute(\"d\", getPath(a, m, r, w, h));\n if (tx) for (const t of text.childNodes) t.setAttribute(\"x\", -tx);\n text.setAttribute(\"y\", `${+getLineOffset(a, text.childNodes.length, lineHeight).toFixed(6)}em`);\n text.setAttribute(\"transform\", `translate(${getTextTranslate(a, m, r, w, h)})`);\n });\n }\n\n // Wait until the plot is inserted into the page so that we can use getBBox\n // to compute the exact text dimensions. If the SVG is already connected, as\n // when the pointer interaction triggers the re-render, use a faster\n // microtask instead of an animation frame; if this SSR (e.g., JSDOM), skip\n // this step. Perhaps this could be done synchronously; getting the\n // dimensions of the SVG is easy, and although accurate text metrics are\n // hard, we could use approximate heuristics.\n if (svg.isConnected) Promise.resolve().then(postrender);\n else if (typeof requestAnimationFrame !== \"undefined\") requestAnimationFrame(postrender);\n\n return g.node();\n }\n}\n\nexport function tip(data, {x, y, ...options} = {}) {\n if (options.frameAnchor === undefined) [x, y] = maybeTuple(x, y);\n return new Tip(data, {...options, x, y});\n}\n\nfunction getLineOffset(anchor, length, lineHeight) {\n return /^top(?:-|$)/.test(anchor)\n ? 0.94 - lineHeight\n : /^bottom(?:-|$)/\n ? -0.29 - length * lineHeight\n : (length / 2) * lineHeight;\n}\n\nfunction getTextTranslate(anchor, m, r, width, height) {\n switch (anchor) {\n case \"middle\":\n return [-width / 2, height / 2];\n case \"top-left\":\n return [r, m + r];\n case \"top\":\n return [-width / 2, m / 2 + r];\n case \"top-right\":\n return [-width - r, m + r];\n case \"right\":\n return [-m / 2 - width - r, height / 2];\n case \"bottom-left\":\n return [r, -m - r];\n case \"bottom\":\n return [-width / 2, -m / 2 - r];\n case \"bottom-right\":\n return [-width - r, -m - r];\n case \"left\":\n return [r + m / 2, height / 2];\n }\n}\n\nfunction getPath(anchor, m, r, width, height) {\n const w = width + r * 2;\n const h = height + r * 2;\n switch (anchor) {\n case \"middle\":\n return `M${-w / 2},${-h / 2}h${w}v${h}h${-w}z`;\n case \"top-left\":\n return `M0,0l${m},${m}h${w - m}v${h}h${-w}z`;\n case \"top\":\n return `M0,0l${m / 2},${m / 2}h${(w - m) / 2}v${h}h${-w}v${-h}h${(w - m) / 2}z`;\n case \"top-right\":\n return `M0,0l${-m},${m}h${m - w}v${h}h${w}z`;\n case \"right\":\n return `M0,0l${-m / 2},${-m / 2}v${m / 2 - h / 2}h${-w}v${h}h${w}v${m / 2 - h / 2}z`;\n case \"bottom-left\":\n return `M0,0l${m},${-m}h${w - m}v${-h}h${-w}z`;\n case \"bottom\":\n return `M0,0l${m / 2},${-m / 2}h${(w - m) / 2}v${-h}h${-w}v${h}h${(w - m) / 2}z`;\n case \"bottom-right\":\n return `M0,0l${-m},${-m}h${m - w}v${-h}h${w}z`;\n case \"left\":\n return `M0,0l${m / 2},${-m / 2}v${m / 2 - h / 2}h${w}v${h}h${-w}v${m / 2 - h / 2}z`;\n }\n}\n\nfunction getSources({channels}) {\n const sources = {};\n for (const key in channels) {\n if (ignoreChannels.has(key)) continue;\n const source = getSource(channels, key);\n if (source) sources[key] = source;\n }\n return sources;\n}\n\nfunction formatPair(c1, c2, i) {\n return c2.hint?.length // e.g., stackY\u2019s y1 and y2\n ? `${formatDefault(c2.value[i] - c1.value[i])}`\n : `${formatDefault(c1.value[i])}\u2013${formatDefault(c2.value[i])}`;\n}\n\nfunction formatLabel(scales, c, defaultLabel) {\n return String(scales[c.scale]?.label ?? c?.label ?? defaultLabel);\n}\n", "import {creator, select} from \"d3\";\nimport {createChannel, inferChannelScale} from \"./channel.js\";\nimport {createContext} from \"./context.js\";\nimport {createDimensions} from \"./dimensions.js\";\nimport {createFacets, recreateFacets, facetExclude, facetGroups, facetTranslator, facetFilter} from \"./facet.js\";\nimport {pointer, pointerX, pointerY} from \"./interactions/pointer.js\";\nimport {createLegends, exposeLegends} from \"./legends.js\";\nimport {Mark} from \"./mark.js\";\nimport {axisFx, axisFy, axisX, axisY, gridFx, gridFy, gridX, gridY} from \"./marks/axis.js\";\nimport {frame} from \"./marks/frame.js\";\nimport {tip} from \"./marks/tip.js\";\nimport {isColor, isIterable, isNone, isScaleOptions} from \"./options.js\";\nimport {arrayify, map, yes, maybeIntervalTransform, subarray} from \"./options.js\";\nimport {createProjection, getGeometryChannels, hasProjection} from \"./projection.js\";\nimport {createScales, createScaleFunctions, autoScaleRange, exposeScales} from \"./scales.js\";\nimport {innerDimensions, outerDimensions} from \"./scales.js\";\nimport {position, registry as scaleRegistry} from \"./scales/index.js\";\nimport {applyInlineStyles, maybeClassName} from \"./style.js\";\nimport {initializer} from \"./transforms/basic.js\";\nimport {consumeWarnings, warn} from \"./warnings.js\";\n\nexport function plot(options = {}) {\n const {facet, style, caption, ariaLabel, ariaDescription} = options;\n\n // className for inline styles\n const className = maybeClassName(options.className);\n\n // Flatten any nested marks.\n const marks = options.marks === undefined ? [] : flatMarks(options.marks);\n\n // Add implicit tips.\n marks.push(...inferTips(marks));\n\n // Compute the top-level facet state. This has roughly the same structure as\n // mark-specific facet state, except there isn\u2019t a facetsIndex, and there\u2019s a\n // data and dataLength so we can warn the user if a different data of the same\n // length is used in a mark.\n const topFacetState = maybeTopFacet(facet, options);\n\n // Construct a map from (faceted) Mark instance to facet state, including:\n // channels - an {fx?, fy?} object to add to the fx and fy scale\n // groups - a possibly-nested map from facet values to indexes in the data array\n // facetsIndex - a sparse nested array of indices corresponding to the valid facets\n const facetStateByMark = new Map();\n for (const mark of marks) {\n const facetState = maybeMarkFacet(mark, topFacetState, options);\n if (facetState) facetStateByMark.set(mark, facetState);\n }\n\n // Compute a Map from scale name to an array of associated channels.\n const channelsByScale = new Map();\n if (topFacetState) addScaleChannels(channelsByScale, [topFacetState], options);\n addScaleChannels(channelsByScale, facetStateByMark, options);\n\n // Add implicit axis marks. Because this happens after faceting (because it\n // depends on whether faceting is present), we must initialize the facet state\n // of any implicit axes, too.\n const axes = flatMarks(inferAxes(marks, channelsByScale, options));\n for (const mark of axes) {\n const facetState = maybeMarkFacet(mark, topFacetState, options);\n if (facetState) facetStateByMark.set(mark, facetState);\n }\n marks.unshift(...axes);\n\n // All the possible facets are given by the domains of the fx or fy scales, or\n // the cross-product of these domains if we facet by both x and y. We sort\n // them in order to apply the facet filters afterwards.\n let facets = createFacets(channelsByScale, options);\n\n if (facets !== undefined) {\n const topFacetsIndex = topFacetState ? facetFilter(facets, topFacetState) : undefined;\n\n // Compute a facet index for each mark, parallel to the facets array. For\n // mark-level facets, compute an index for that mark\u2019s data and options.\n // Otherwise, use the top-level facet index.\n for (const mark of marks) {\n if (mark.facet === null || mark.facet === \"super\") continue;\n const facetState = facetStateByMark.get(mark);\n if (facetState === undefined) continue;\n facetState.facetsIndex = mark.fx != null || mark.fy != null ? facetFilter(facets, facetState) : topFacetsIndex;\n }\n\n // The cross product of the domains of fx and fy can include fx-fy\n // combinations for which no mark has an instance associated with that\n // combination, and therefore we don\u2019t want to render this facet (not even\n // the frame). The same can occur if you specify the domain of fx and fy\n // explicitly, but there is no mark instance associated with some values in\n // the domain. Expunge empty facets, and clear the corresponding elements\n // from the nested index in each mark.\n const nonEmpty = new Set();\n for (const {facetsIndex} of facetStateByMark.values()) {\n facetsIndex?.forEach((index, i) => {\n if (index?.length > 0) {\n nonEmpty.add(i);\n }\n });\n }\n\n // If all the facets are empty (as when none of the marks are actually\n // faceted), none of them are empty.\n facets.forEach(\n 0 < nonEmpty.size && nonEmpty.size < facets.length\n ? (f, i) => (f.empty = !nonEmpty.has(i))\n : (f) => (f.empty = false)\n );\n\n // For any mark using the \u201Cexclude\u201D facet mode, invert the index.\n for (const mark of marks) {\n if (mark.facet === \"exclude\") {\n const facetState = facetStateByMark.get(mark);\n if (facetState !== undefined) facetState.facetsIndex = facetExclude(facetState.facetsIndex);\n }\n }\n }\n\n // If a scale is explicitly declared in options, initialize its associated\n // channels to the empty array; this will guarantee that a corresponding scale\n // will be created later (even if there are no other channels). Ignore facet\n // scale declarations, which are handled above.\n for (const key of scaleRegistry.keys()) {\n if (isScaleOptions(options[key]) && key !== \"fx\" && key !== \"fy\") {\n channelsByScale.set(key, []);\n }\n }\n\n // A Map from Mark instance to its render state, including:\n // index - the data index e.g. [0, 1, 2, 3, \u2026]\n // channels - an array of materialized channels e.g. [[\"x\", {value}], \u2026]\n // faceted - a boolean indicating whether this mark is faceted\n // values - an object of scaled values e.g. {x: [40, 32, \u2026], \u2026}\n const stateByMark = new Map();\n\n // Initialize the marks\u2019 state.\n for (const mark of marks) {\n if (stateByMark.has(mark)) throw new Error(\"duplicate mark; each mark must be unique\");\n const {facetsIndex, channels: facetChannels} = facetStateByMark.get(mark) ?? {};\n const {data, facets, channels} = mark.initialize(facetsIndex, facetChannels, options);\n applyScaleTransforms(channels, options);\n stateByMark.set(mark, {data, facets, channels});\n }\n\n // Initalize the scales and dimensions.\n const scaleDescriptors = createScales(addScaleChannels(channelsByScale, stateByMark, options), options);\n const scales = createScaleFunctions(scaleDescriptors);\n const dimensions = createDimensions(scaleDescriptors, marks, options);\n\n autoScaleRange(scaleDescriptors, dimensions);\n\n const {fx, fy} = scales;\n const subdimensions = fx || fy ? innerDimensions(scaleDescriptors, dimensions) : dimensions;\n const superdimensions = fx || fy ? actualDimensions(scales, dimensions) : dimensions;\n\n // Initialize the context.\n const context = createContext(options);\n const document = context.document;\n const svg = creator(\"svg\").call(document.documentElement);\n let figure = svg; // replaced with the figure element, if any\n context.ownerSVGElement = svg;\n context.className = className;\n context.projection = createProjection(options, subdimensions);\n\n // Allows e.g. the axis mark to determine faceting lazily.\n context.filterFacets = (data, channels) => {\n return facetFilter(facets, {channels, groups: facetGroups(data, channels)});\n };\n\n // Allows e.g. the tip mark to reference channels and data on other marks.\n context.getMarkState = (mark) => {\n const state = stateByMark.get(mark);\n const facetState = facetStateByMark.get(mark);\n return {...state, channels: {...state.channels, ...facetState?.channels}};\n };\n\n // Allows e.g. the pointer transform to support viewof.\n context.dispatchValue = (value) => {\n if (figure.value === value) return;\n figure.value = value;\n figure.dispatchEvent(new Event(\"input\", {bubbles: true}));\n };\n\n // Reinitialize; for deriving channels dependent on other channels.\n const newByScale = new Set();\n for (const [mark, state] of stateByMark) {\n if (mark.initializer != null) {\n const dimensions = mark.facet === \"super\" ? superdimensions : subdimensions;\n const update = mark.initializer(state.data, state.facets, state.channels, scales, dimensions, context);\n if (update.data !== undefined) {\n state.data = update.data;\n }\n if (update.facets !== undefined) {\n state.facets = update.facets;\n }\n if (update.channels !== undefined) {\n const {fx, fy, ...channels} = update.channels; // separate facet channels\n inferChannelScales(channels);\n Object.assign(state.channels, channels);\n for (const channel of Object.values(channels)) {\n const {scale} = channel;\n // Initializers aren\u2019t allowed to redefine position scales as this\n // would introduce a circular dependency; so simply scale these\n // channels as-is rather than creating new scales, and assume that\n // they already have the scale\u2019s transform applied, if any (e.g., when\n // generating ticks for the axis mark).\n if (scale != null && scaleRegistry.get(scale) !== position) {\n applyScaleTransform(channel, options);\n newByScale.add(scale);\n }\n }\n // If the initializer returns new mark-level facet channels, we must\n // record that the mark is now faceted. Note: we aren\u2019t actually\n // populating the facet state, but subsequently we won\u2019t need it.\n if (fx != null || fy != null) facetStateByMark.set(mark, true);\n }\n }\n }\n\n // Reconstruct scales if new scaled channels were created during\n // reinitialization. Preserve existing scale labels, if any.\n if (newByScale.size) {\n const newChannelsByScale = new Map();\n addScaleChannels(newChannelsByScale, stateByMark, options, (key) => newByScale.has(key));\n addScaleChannels(channelsByScale, stateByMark, options, (key) => newByScale.has(key));\n const newScaleDescriptors = inheritScaleLabels(createScales(newChannelsByScale, options), scaleDescriptors);\n const newScales = createScaleFunctions(newScaleDescriptors);\n Object.assign(scaleDescriptors, newScaleDescriptors);\n Object.assign(scales, newScales);\n }\n\n // Sort and filter the facets to match the fx and fy domains; this is needed\n // because the facets were constructed prior to the fx and fy scales.\n let facetDomains, facetTranslate;\n if (facets !== undefined) {\n facetDomains = {x: fx?.domain(), y: fy?.domain()};\n facets = recreateFacets(facets, facetDomains);\n facetTranslate = facetTranslator(fx, fy, dimensions);\n }\n\n // Compute value objects, applying scales and projection as needed.\n for (const [mark, state] of stateByMark) {\n state.values = mark.scale(state.channels, scales, context);\n }\n\n const {width, height} = dimensions;\n\n select(svg)\n .attr(\"class\", className)\n .attr(\"fill\", \"currentColor\")\n .attr(\"font-family\", \"system-ui, sans-serif\")\n .attr(\"font-size\", 10)\n .attr(\"text-anchor\", \"middle\")\n .attr(\"width\", width)\n .attr(\"height\", height)\n .attr(\"viewBox\", `0 0 ${width} ${height}`)\n .attr(\"aria-label\", ariaLabel)\n .attr(\"aria-description\", ariaDescription)\n .call((svg) =>\n // Warning: if you edit this, change defaultClassName.\n svg.append(\"style\").text(\n `.${className} {\n display: block;\n background: white;\n height: auto;\n height: intrinsic;\n max-width: 100%;\n}\n.${className} text,\n.${className} tspan {\n white-space: pre;\n}`\n )\n )\n .call(applyInlineStyles, style);\n\n // Render marks.\n for (const mark of marks) {\n const {channels, values, facets: indexes} = stateByMark.get(mark);\n\n // Render a non-faceted mark.\n if (facets === undefined || mark.facet === \"super\") {\n let index = null;\n if (indexes) {\n index = indexes[0];\n index = mark.filter(index, channels, values);\n if (index.length === 0) continue;\n }\n const node = mark.render(index, scales, values, superdimensions, context);\n if (node == null) continue;\n svg.appendChild(node);\n }\n\n // Render a faceted mark.\n else {\n let g;\n for (const f of facets) {\n if (!(mark.facetAnchor?.(facets, facetDomains, f) ?? !f.empty)) continue;\n let index = null;\n if (indexes) {\n const faceted = facetStateByMark.has(mark);\n index = indexes[faceted ? f.i : 0];\n index = mark.filter(index, channels, values);\n if (index.length === 0) continue;\n if (!faceted && index === indexes[0]) index = subarray(index); // copy before assigning fx, fy, fi\n (index.fx = f.x), (index.fy = f.y), (index.fi = f.i);\n }\n const node = mark.render(index, scales, values, subdimensions, context);\n if (node == null) continue;\n // Lazily construct the shared group (to drop empty marks).\n (g ??= select(svg).append(\"g\")).append(() => node).datum(f);\n // Promote ARIA attributes and mark transform to avoid repetition on\n // each facet; this assumes that these attributes are consistent across\n // facets, but that should be the case!\n for (const name of [\"aria-label\", \"aria-description\", \"aria-hidden\", \"transform\"]) {\n if (node.hasAttribute(name)) {\n g.attr(name, node.getAttribute(name));\n node.removeAttribute(name);\n }\n }\n }\n g?.selectChildren().attr(\"transform\", facetTranslate);\n }\n }\n\n // Wrap the plot in a figure with a caption, if desired.\n const legends = createLegends(scaleDescriptors, context, options);\n if (caption != null || legends.length > 0) {\n figure = document.createElement(\"figure\");\n figure.style.maxWidth = \"initial\";\n for (const legend of legends) figure.appendChild(legend);\n figure.appendChild(svg);\n if (caption != null) {\n const figcaption = document.createElement(\"figcaption\");\n figcaption.appendChild(caption?.ownerDocument ? caption : document.createTextNode(caption));\n figure.appendChild(figcaption);\n }\n }\n\n figure.scale = exposeScales(scaleDescriptors);\n figure.legend = exposeLegends(scaleDescriptors, context, options);\n\n const w = consumeWarnings();\n if (w > 0) {\n select(svg)\n .append(\"text\")\n .attr(\"x\", width)\n .attr(\"y\", 20)\n .attr(\"dy\", \"-1em\")\n .attr(\"text-anchor\", \"end\")\n .attr(\"font-family\", \"initial\") // fix emoji rendering in Chrome\n .text(\"\\u26a0\\ufe0f\") // emoji variation selector\n .append(\"title\")\n .text(`${w.toLocaleString(\"en-US\")} warning${w === 1 ? \"\" : \"s\"}. Please check the console.`);\n }\n\n return figure;\n}\n\nfunction plotThis({marks = [], ...options} = {}) {\n return plot({...options, marks: [...marks, this]});\n}\n\n// Note: This side-effect avoids a circular dependency.\nMark.prototype.plot = plotThis;\n\nfunction flatMarks(marks) {\n return marks\n .flat(Infinity)\n .filter((mark) => mark != null)\n .map(markify);\n}\n\nfunction markify(mark) {\n return typeof mark.render === \"function\" ? mark : new Render(mark);\n}\n\nclass Render extends Mark {\n constructor(render) {\n if (typeof render !== \"function\") throw new TypeError(\"invalid mark; missing render function\");\n super();\n this.render = render;\n }\n render() {}\n}\n\n// Note: mutates channel.value to apply the scale transform, if any.\nfunction applyScaleTransforms(channels, options) {\n for (const name in channels) applyScaleTransform(channels[name], options);\n return channels;\n}\n\n// Note: mutates channel.value to apply the scale transform, if any. Also sets\n// channel.transform to false to prevent duplicate transform application.\nfunction applyScaleTransform(channel, options) {\n const {scale, transform: t = true} = channel;\n if (scale == null || !t) return;\n const {\n type,\n percent,\n interval,\n transform = percent ? (x) => x * 100 : maybeIntervalTransform(interval, type)\n } = options[scale] ?? {};\n if (transform == null) return;\n channel.value = map(channel.value, transform);\n channel.transform = false;\n}\n\n// An initializer may generate channels without knowing how the downstream mark\n// will use them. Marks are typically responsible associated scales with\n// channels, but here we assume common behavior across marks.\nfunction inferChannelScales(channels) {\n for (const name in channels) {\n inferChannelScale(name, channels[name]);\n }\n}\n\nfunction addScaleChannels(channelsByScale, stateByMark, options, filter = yes) {\n for (const {channels} of stateByMark.values()) {\n for (const name in channels) {\n const channel = channels[name];\n const {scale} = channel;\n if (scale != null && filter(scale)) {\n // Geo marks affect the default x and y domains if there is no\n // projection. Skip this (as an optimization) when a projection is\n // specified, or when the domains for x and y are specified.\n if (scale === \"projection\") {\n if (!hasProjection(options)) {\n const gx = options.x?.domain === undefined;\n const gy = options.y?.domain === undefined;\n if (gx || gy) {\n const [x, y] = getGeometryChannels(channel);\n if (gx) addScaleChannel(channelsByScale, \"x\", x);\n if (gy) addScaleChannel(channelsByScale, \"y\", y);\n }\n }\n } else {\n addScaleChannel(channelsByScale, scale, channel);\n }\n }\n }\n }\n return channelsByScale;\n}\n\nfunction addScaleChannel(channelsByScale, scale, channel) {\n const scaleChannels = channelsByScale.get(scale);\n if (scaleChannels !== undefined) scaleChannels.push(channel);\n else channelsByScale.set(scale, [channel]);\n}\n\n// Returns the facet groups, and possibly fx and fy channels, associated with\n// the top-level facet option {data, x, y}.\nfunction maybeTopFacet(facet, options) {\n if (facet == null) return;\n const {x, y} = facet;\n if (x == null && y == null) return;\n const data = arrayify(facet.data);\n if (data == null) throw new Error(\"missing facet data\");\n const channels = {};\n if (x != null) channels.fx = createChannel(data, {value: x, scale: \"fx\"});\n if (y != null) channels.fy = createChannel(data, {value: y, scale: \"fy\"});\n applyScaleTransforms(channels, options);\n const groups = facetGroups(data, channels);\n return {channels, groups, data: facet.data};\n}\n\n// Returns the facet groups, and possibly fx and fy channels, associated with a\n// mark, either through top-level faceting or mark-level facet options {fx, fy}.\nfunction maybeMarkFacet(mark, topFacetState, options) {\n if (mark.facet === null || mark.facet === \"super\") return;\n\n // This mark defines a mark-level facet. TODO There\u2019s some code duplication\n // here with maybeTopFacet that we could reduce.\n const {fx, fy} = mark;\n if (fx != null || fy != null) {\n const data = arrayify(mark.data ?? fx ?? fy);\n if (data === undefined) throw new Error(`missing facet data in ${mark.ariaLabel}`);\n if (data === null) return; // ignore channel definitions if no data is provided TODO this right?\n const channels = {};\n if (fx != null) channels.fx = createChannel(data, {value: fx, scale: \"fx\"});\n if (fy != null) channels.fy = createChannel(data, {value: fy, scale: \"fy\"});\n applyScaleTransforms(channels, options);\n return {channels, groups: facetGroups(data, channels)};\n }\n\n // This mark links to a top-level facet, if present.\n if (topFacetState === undefined) return;\n\n // TODO Can we link the top-level facet channels here?\n const {channels, groups, data} = topFacetState;\n if (mark.facet !== \"auto\" || mark.data === data) return {channels, groups};\n\n // Warn for the common pitfall of wanting to facet mapped data with the\n // top-level facet option.\n if (\n data.length > 0 &&\n (groups.size > 1 || (groups.size === 1 && channels.fx && channels.fy && [...groups][0][1].size > 1)) &&\n arrayify(mark.data)?.length === data.length\n ) {\n warn(\n `Warning: the ${mark.ariaLabel} mark appears to use faceted data, but isn\u2019t faceted. The mark data has the same length as the facet data and the mark facet option is \"auto\", but the mark data and facet data are distinct. If this mark should be faceted, set the mark facet option to true; otherwise, suppress this warning by setting the mark facet option to false.`\n );\n }\n}\n\nfunction derive(mark, options = {}) {\n return initializer({...options, x: null, y: null}, (data, facets, channels, scales, dimensions, context) => {\n return context.getMarkState(mark);\n });\n}\n\nfunction inferTips(marks) {\n const tips = [];\n for (const mark of marks) {\n const t = mark.tip;\n if (t) {\n const p = t === \"x\" ? pointerX : t === \"y\" ? pointerY : pointer;\n const options = p(derive(mark)); // TODO tip options?\n options.title = null; // prevent implicit title for primitive data\n tips.push(tip(mark.data, options));\n }\n }\n return tips;\n}\n\nfunction inferAxes(marks, channelsByScale, options) {\n let {\n projection,\n x = {},\n y = {},\n fx = {},\n fy = {},\n axis,\n grid,\n facet = {},\n facet: {axis: facetAxis = axis, grid: facetGrid} = facet,\n x: {axis: xAxis = axis, grid: xGrid = xAxis === null ? null : grid} = x,\n y: {axis: yAxis = axis, grid: yGrid = yAxis === null ? null : grid} = y,\n fx: {axis: fxAxis = facetAxis, grid: fxGrid = fxAxis === null ? null : facetGrid} = fx,\n fy: {axis: fyAxis = facetAxis, grid: fyGrid = fyAxis === null ? null : facetGrid} = fy\n } = options;\n\n // Disable axes if the corresponding scale is not present.\n if (projection || (!isScaleOptions(x) && !hasPositionChannel(\"x\", marks))) xAxis = xGrid = null;\n if (projection || (!isScaleOptions(y) && !hasPositionChannel(\"y\", marks))) yAxis = yGrid = null;\n if (!channelsByScale.has(\"fx\")) fxAxis = fxGrid = null;\n if (!channelsByScale.has(\"fy\")) fyAxis = fyGrid = null;\n\n // Resolve the default implicit axes by checking for explicit ones.\n if (xAxis === undefined) xAxis = !hasAxis(marks, \"x\");\n if (yAxis === undefined) yAxis = !hasAxis(marks, \"y\");\n if (fxAxis === undefined) fxAxis = !hasAxis(marks, \"fx\");\n if (fyAxis === undefined) fyAxis = !hasAxis(marks, \"fy\");\n\n // Resolve the default orientation of axes.\n if (xAxis === true) xAxis = \"bottom\";\n if (yAxis === true) yAxis = \"left\";\n if (fxAxis === true) fxAxis = xAxis === \"top\" || xAxis === null ? \"bottom\" : \"top\";\n if (fyAxis === true) fyAxis = yAxis === \"right\" || yAxis === null ? \"left\" : \"right\";\n\n const axes = [];\n maybeGrid(axes, fyGrid, gridFy, fy);\n maybeAxis(axes, fyAxis, axisFy, \"right\", \"left\", facet, fy);\n maybeGrid(axes, fxGrid, gridFx, fx);\n maybeAxis(axes, fxAxis, axisFx, \"top\", \"bottom\", facet, fx);\n maybeGrid(axes, yGrid, gridY, y);\n maybeAxis(axes, yAxis, axisY, \"left\", \"right\", options, y);\n maybeGrid(axes, xGrid, gridX, x);\n maybeAxis(axes, xAxis, axisX, \"bottom\", \"top\", options, x);\n return axes;\n}\n\nfunction maybeAxis(axes, axis, axisType, primary, secondary, defaults, options) {\n if (!axis) return;\n const both = isBoth(axis);\n options = axisOptions(both ? primary : axis, defaults, options);\n const {line} = options;\n if ((axisType === axisY || axisType === axisX) && line && !isNone(line)) axes.push(frame(lineOptions(options)));\n axes.push(axisType(options));\n if (both) axes.push(axisType({...options, anchor: secondary, label: null}));\n}\n\nfunction maybeGrid(axes, grid, gridType, options) {\n if (!grid || isNone(grid)) return;\n axes.push(gridType(gridOptions(grid, options)));\n}\n\nfunction isBoth(value) {\n return /^\\s*both\\s*$/i.test(value);\n}\n\nfunction axisOptions(\n anchor,\n defaults,\n {\n line = defaults.line,\n ticks,\n tickSize,\n tickSpacing,\n tickPadding,\n tickFormat,\n tickRotate,\n fontVariant,\n ariaLabel,\n ariaDescription,\n label = defaults.label,\n labelAnchor,\n labelArrow = defaults.labelArrow,\n labelOffset\n }\n) {\n return {\n anchor,\n line,\n ticks,\n tickSize,\n tickSpacing,\n tickPadding,\n tickFormat,\n tickRotate,\n fontVariant,\n ariaLabel,\n ariaDescription,\n label,\n labelAnchor,\n labelArrow,\n labelOffset\n };\n}\n\nfunction lineOptions(options) {\n const {anchor, line} = options;\n return {anchor, facetAnchor: anchor + \"-empty\", stroke: line === true ? undefined : line};\n}\n\nfunction gridOptions(\n grid,\n {\n stroke = isColor(grid) ? grid : undefined,\n ticks = isGridTicks(grid) ? grid : undefined,\n tickSpacing,\n ariaLabel,\n ariaDescription\n }\n) {\n return {\n stroke,\n ticks,\n tickSpacing,\n ariaLabel,\n ariaDescription\n };\n}\n\nfunction isGridTicks(grid) {\n switch (typeof grid) {\n case \"number\":\n return true;\n case \"string\":\n return !isColor(grid);\n }\n return isIterable(grid) || typeof grid?.range === \"function\";\n}\n\n// Is there an explicit axis already present? TODO We probably want a more\n// explicit test than looking for the ARIA label, but it does afford some\n// flexibility in axis implementation which is nice.\nfunction hasAxis(marks, k) {\n const prefix = `${k}-axis `;\n return marks.some((m) => m.ariaLabel?.startsWith(prefix));\n}\n\nfunction hasPositionChannel(k, marks) {\n for (const mark of marks) {\n for (const key in mark.channels) {\n const {scale} = mark.channels[key];\n if (scale === k || scale === \"projection\") {\n return true;\n }\n }\n }\n return false;\n}\n\nfunction inheritScaleLabels(newScales, scales) {\n for (const key in newScales) {\n const newScale = newScales[key];\n const scale = scales[key];\n if (newScale.label === undefined && scale) {\n newScale.label = scale.label;\n }\n }\n return newScales;\n}\n\n// This differs from the other outerDimensions in that it accounts for rounding\n// and outer padding in the fact scales; we want the frame to align exactly with\n// the actual range, not the desired range.\nfunction actualDimensions({fx, fy}, dimensions) {\n const {marginTop, marginRight, marginBottom, marginLeft, width, height} = outerDimensions(dimensions);\n const fxr = fx && outerRange(fx);\n const fyr = fy && outerRange(fy);\n return {\n marginTop: fy ? fyr[0] : marginTop,\n marginRight: fx ? width - fxr[1] : marginRight,\n marginBottom: fy ? height - fyr[1] : marginBottom,\n marginLeft: fx ? fxr[0] : marginLeft,\n // Some marks, namely the x- and y-axis labels, want to know what the\n // desired (rather than actual) margins are for positioning.\n inset: {\n marginTop: dimensions.marginTop,\n marginRight: dimensions.marginRight,\n marginBottom: dimensions.marginBottom,\n marginLeft: dimensions.marginLeft\n },\n width,\n height\n };\n}\n\nfunction outerRange(scale) {\n const domain = scale.domain();\n let x1 = scale(domain[0]);\n let x2 = scale(domain[domain.length - 1]);\n if (x2 < x1) [x1, x2] = [x2, x1];\n return [x1, x2 + scale.bandwidth()];\n}\n", "import {\n bisect,\n extent,\n thresholdFreedmanDiaconis,\n thresholdScott,\n thresholdSturges,\n tickIncrement,\n ticks,\n utcTickInterval\n} from \"d3\";\nimport {withTip} from \"../mark.js\";\nimport {\n coerceDate,\n coerceNumbers,\n identity,\n isIterable,\n isTemporal,\n labelof,\n map,\n maybeApplyInterval,\n maybeColorChannel,\n maybeColumn,\n maybeRangeInterval,\n maybeTuple,\n maybeValue,\n mid,\n valueof\n} from \"../options.js\";\nimport {maybeUtcInterval} from \"../time.js\";\nimport {basic} from \"./basic.js\";\nimport {\n hasOutput,\n maybeEvaluator,\n maybeGroup,\n maybeOutput,\n maybeOutputs,\n maybeReduce,\n maybeSort,\n maybeSubgroup,\n reduceCount,\n reduceFirst,\n reduceIdentity\n} from \"./group.js\";\nimport {maybeInsetX, maybeInsetY} from \"./inset.js\";\n\n// Group on {z, fill, stroke}, then optionally on y, then bin x.\nexport function binX(outputs = {y: \"count\"}, options = {}) {\n [outputs, options] = mergeOptions(outputs, options);\n const {x, y} = options;\n return binn(maybeBinValue(x, options, identity), null, null, y, outputs, maybeInsetX(options));\n}\n\n// Group on {z, fill, stroke}, then optionally on x, then bin y.\nexport function binY(outputs = {x: \"count\"}, options = {}) {\n [outputs, options] = mergeOptions(outputs, options);\n const {x, y} = options;\n return binn(null, maybeBinValue(y, options, identity), x, null, outputs, maybeInsetY(options));\n}\n\n// Group on {z, fill, stroke}, then bin on x and y.\nexport function bin(outputs = {fill: \"count\"}, options = {}) {\n [outputs, options] = mergeOptions(outputs, options);\n const {x, y} = maybeBinValueTuple(options);\n return binn(x, y, null, null, outputs, maybeInsetX(maybeInsetY(options)));\n}\n\nfunction maybeDenseInterval(bin, k, options = {}) {\n return options?.interval == null\n ? options\n : bin({[k]: options?.reduce === undefined ? reduceFirst : options.reduce, filter: null}, options);\n}\n\nexport function maybeDenseIntervalX(options = {}) {\n return maybeDenseInterval(binX, \"y\", withTip(options, \"x\"));\n}\n\nexport function maybeDenseIntervalY(options = {}) {\n return maybeDenseInterval(binY, \"x\", withTip(options, \"y\"));\n}\n\nfunction binn(\n bx, // optionally bin on x (exclusive with gx)\n by, // optionally bin on y (exclusive with gy)\n gx, // optionally group on x (exclusive with bx and gy)\n gy, // optionally group on y (exclusive with by and gx)\n {\n data: reduceData = reduceIdentity, // TODO avoid materializing when unused?\n filter = reduceCount, // return only non-empty bins by default\n sort,\n reverse,\n ...outputs // output channel definitions\n } = {},\n inputs = {} // input channels and options\n) {\n bx = maybeBin(bx);\n by = maybeBin(by);\n\n // Compute the outputs.\n outputs = maybeBinOutputs(outputs, inputs);\n reduceData = maybeBinReduce(reduceData, identity);\n sort = sort == null ? undefined : maybeBinOutput(\"sort\", sort, inputs);\n filter = filter == null ? undefined : maybeBinEvaluator(\"filter\", filter, inputs);\n\n // Don\u2019t group on a channel if an output requires it as an input!\n if (gx != null && hasOutput(outputs, \"x\", \"x1\", \"x2\")) gx = null;\n if (gy != null && hasOutput(outputs, \"y\", \"y1\", \"y2\")) gy = null;\n\n // Produce x1, x2, y1, and y2 output channels as appropriate (when binning).\n const [BX1, setBX1] = maybeColumn(bx);\n const [BX2, setBX2] = maybeColumn(bx);\n const [BY1, setBY1] = maybeColumn(by);\n const [BY2, setBY2] = maybeColumn(by);\n\n // Produce x or y output channels as appropriate (when grouping).\n const [k, gk] = gx != null ? [gx, \"x\"] : gy != null ? [gy, \"y\"] : [];\n const [GK, setGK] = maybeColumn(k);\n\n // Greedily materialize the z, fill, and stroke channels (if channels and not\n // constants) so that we can reference them for subdividing groups without\n // computing them more than once. We also want to consume options that should\n // only apply to this transform rather than passing them through to the next.\n const {\n x,\n y,\n z,\n fill,\n stroke,\n x1,\n x2, // consumed if x is an output\n y1,\n y2, // consumed if y is an output\n domain,\n cumulative,\n thresholds,\n interval,\n ...options\n } = inputs;\n const [GZ, setGZ] = maybeColumn(z);\n const [vfill] = maybeColorChannel(fill);\n const [vstroke] = maybeColorChannel(stroke);\n const [GF, setGF] = maybeColumn(vfill);\n const [GS, setGS] = maybeColumn(vstroke);\n\n return {\n ...(\"z\" in inputs && {z: GZ || z}),\n ...(\"fill\" in inputs && {fill: GF || fill}),\n ...(\"stroke\" in inputs && {stroke: GS || stroke}),\n ...basic(options, (data, facets, plotOptions) => {\n const K = maybeApplyInterval(valueof(data, k), plotOptions?.[gk]);\n const Z = valueof(data, z);\n const F = valueof(data, vfill);\n const S = valueof(data, vstroke);\n const G = maybeSubgroup(outputs, {z: Z, fill: F, stroke: S});\n const groupFacets = [];\n const groupData = [];\n const GK = K && setGK([]);\n const GZ = Z && setGZ([]);\n const GF = F && setGF([]);\n const GS = S && setGS([]);\n const BX1 = bx && setBX1([]);\n const BX2 = bx && setBX2([]);\n const BY1 = by && setBY1([]);\n const BY2 = by && setBY2([]);\n const bin = bing(bx?.(data), by?.(data));\n let i = 0;\n for (const o of outputs) o.initialize(data);\n if (sort) sort.initialize(data);\n if (filter) filter.initialize(data);\n for (const facet of facets) {\n const groupFacet = [];\n for (const o of outputs) o.scope(\"facet\", facet);\n if (sort) sort.scope(\"facet\", facet);\n if (filter) filter.scope(\"facet\", facet);\n for (const [f, I] of maybeGroup(facet, G)) {\n for (const [k, g] of maybeGroup(I, K)) {\n for (const [b, extent] of bin(g)) {\n if (filter && !filter.reduce(b, extent)) continue;\n groupFacet.push(i++);\n groupData.push(reduceData.reduceIndex(b, data, extent));\n if (K) GK.push(k);\n if (Z) GZ.push(G === Z ? f : Z[b[0]]);\n if (F) GF.push(G === F ? f : F[b[0]]);\n if (S) GS.push(G === S ? f : S[b[0]]);\n if (BX1) BX1.push(extent.x1), BX2.push(extent.x2);\n if (BY1) BY1.push(extent.y1), BY2.push(extent.y2);\n for (const o of outputs) o.reduce(b, extent);\n if (sort) sort.reduce(b);\n }\n }\n }\n groupFacets.push(groupFacet);\n }\n maybeSort(groupFacets, sort, reverse);\n return {data: groupData, facets: groupFacets};\n }),\n ...(!hasOutput(outputs, \"x\") && (BX1 ? {x1: BX1, x2: BX2, x: mid(BX1, BX2)} : {x, x1, x2})),\n ...(!hasOutput(outputs, \"y\") && (BY1 ? {y1: BY1, y2: BY2, y: mid(BY1, BY2)} : {y, y1, y2})),\n ...(GK && {[gk]: GK}),\n ...Object.fromEntries(outputs.map(({name, output}) => [name, output]))\n };\n}\n\n// Allow bin options to be specified as part of outputs; merge them into options.\nfunction mergeOptions({cumulative, domain, thresholds, interval, ...outputs}, options) {\n return [outputs, {cumulative, domain, thresholds, interval, ...options}];\n}\n\nfunction maybeBinValue(value, {cumulative, domain, thresholds, interval}, defaultValue) {\n value = {...maybeValue(value)};\n if (value.domain === undefined) value.domain = domain;\n if (value.cumulative === undefined) value.cumulative = cumulative;\n if (value.thresholds === undefined) value.thresholds = thresholds;\n if (value.interval === undefined) value.interval = interval;\n if (value.value === undefined) value.value = defaultValue;\n value.thresholds = maybeThresholds(value.thresholds, value.interval);\n return value;\n}\n\nfunction maybeBinValueTuple(options) {\n let {x, y} = options;\n x = maybeBinValue(x, options);\n y = maybeBinValue(y, options);\n [x.value, y.value] = maybeTuple(x.value, y.value);\n return {x, y};\n}\n\nfunction maybeBin(options) {\n if (options == null) return;\n const {value, cumulative, domain = extent, thresholds} = options;\n const bin = (data) => {\n let V = valueof(data, value);\n let T; // bin thresholds\n if (isTemporal(V) || isTimeThresholds(thresholds)) {\n V = map(V, coerceDate, Float64Array); // like coerceDates, but faster\n let [min, max] = typeof domain === \"function\" ? domain(V) : domain;\n let t = typeof thresholds === \"function\" && !isInterval(thresholds) ? thresholds(V, min, max) : thresholds;\n if (typeof t === \"number\") t = utcTickInterval(min, max, t);\n if (isInterval(t)) {\n if (domain === extent) {\n min = t.floor(min);\n max = t.offset(t.floor(max));\n }\n t = t.range(min, t.offset(max));\n }\n T = t;\n } else {\n V = coerceNumbers(V);\n let [min, max] = typeof domain === \"function\" ? domain(V) : domain;\n let t = typeof thresholds === \"function\" && !isInterval(thresholds) ? thresholds(V, min, max) : thresholds;\n if (typeof t === \"number\") {\n // This differs from d3.ticks with regard to exclusive bounds: we want a\n // first threshold less than or equal to the minimum, and a last\n // threshold (strictly) greater than the maximum.\n if (domain === extent) {\n let step = tickIncrement(min, max, t);\n if (isFinite(step)) {\n if (step > 0) {\n let r0 = Math.round(min / step);\n let r1 = Math.round(max / step);\n if (!(r0 * step <= min)) --r0;\n if (!(r1 * step > max)) ++r1;\n let n = r1 - r0 + 1;\n t = new Float64Array(n);\n for (let i = 0; i < n; ++i) t[i] = (r0 + i) * step;\n } else if (step < 0) {\n step = -step;\n let r0 = Math.round(min * step);\n let r1 = Math.round(max * step);\n if (!(r0 / step <= min)) --r0;\n if (!(r1 / step > max)) ++r1;\n let n = r1 - r0 + 1;\n t = new Float64Array(n);\n for (let i = 0; i < n; ++i) t[i] = (r0 + i) / step;\n } else {\n t = [min];\n }\n } else {\n t = [min];\n }\n } else {\n t = ticks(min, max, t);\n }\n } else if (isInterval(t)) {\n if (domain === extent) {\n min = t.floor(min);\n max = t.offset(t.floor(max));\n }\n t = t.range(min, t.offset(max));\n }\n T = t;\n }\n const E = [];\n if (T.length === 1) E.push([T[0], T[0]]); // collapsed domain\n else for (let i = 1; i < T.length; ++i) E.push([T[i - 1], T[i]]);\n E.bin = (cumulative < 0 ? bin1cn : cumulative > 0 ? bin1cp : bin1)(E, T, V);\n return E;\n };\n bin.label = labelof(value);\n return bin;\n}\n\nexport function maybeThresholds(thresholds, interval, defaultThresholds = thresholdAuto) {\n if (thresholds === undefined) {\n return interval === undefined ? defaultThresholds : maybeRangeInterval(interval);\n }\n if (typeof thresholds === \"string\") {\n switch (thresholds.toLowerCase()) {\n case \"freedman-diaconis\":\n return thresholdFreedmanDiaconis;\n case \"scott\":\n return thresholdScott;\n case \"sturges\":\n return thresholdSturges;\n case \"auto\":\n return thresholdAuto;\n }\n return maybeUtcInterval(thresholds);\n }\n return thresholds; // pass array, count, or function to bin.thresholds\n}\n\nfunction maybeBinOutputs(outputs, inputs) {\n return maybeOutputs(outputs, inputs, maybeBinOutput);\n}\n\nfunction maybeBinOutput(name, reduce, inputs) {\n return maybeOutput(name, reduce, inputs, maybeBinEvaluator);\n}\n\nfunction maybeBinEvaluator(name, reduce, inputs) {\n return maybeEvaluator(name, reduce, inputs, maybeBinReduce);\n}\n\nfunction maybeBinReduce(reduce, value) {\n return maybeReduce(reduce, value, maybeBinReduceFallback);\n}\n\nfunction maybeBinReduceFallback(reduce) {\n switch (`${reduce}`.toLowerCase()) {\n case \"x\":\n return reduceX;\n case \"x1\":\n return reduceX1;\n case \"x2\":\n return reduceX2;\n case \"y\":\n return reduceY;\n case \"y1\":\n return reduceY1;\n case \"y2\":\n return reduceY2;\n }\n throw new Error(`invalid bin reduce: ${reduce}`);\n}\n\nfunction thresholdAuto(values, min, max) {\n return Math.min(200, thresholdScott(values, min, max));\n}\n\nfunction isTimeThresholds(t) {\n return isTimeInterval(t) || (isIterable(t) && isTemporal(t));\n}\n\nfunction isTimeInterval(t) {\n return isInterval(t) && typeof t === \"function\" && t() instanceof Date;\n}\n\nfunction isInterval(t) {\n return typeof t?.range === \"function\";\n}\n\nfunction bing(EX, EY) {\n return EX && EY\n ? function* (I) {\n const X = EX.bin(I); // first bin on x\n for (const [ix, [x1, x2]] of EX.entries()) {\n const Y = EY.bin(X[ix]); // then bin on y\n for (const [iy, [y1, y2]] of EY.entries()) {\n yield [Y[iy], {x1, y1, x2, y2}];\n }\n }\n }\n : EX\n ? function* (I) {\n const X = EX.bin(I);\n for (const [i, [x1, x2]] of EX.entries()) {\n yield [X[i], {x1, x2}];\n }\n }\n : function* (I) {\n const Y = EY.bin(I);\n for (const [i, [y1, y2]] of EY.entries()) {\n yield [Y[i], {y1, y2}];\n }\n };\n}\n\n// non-cumulative distribution\nfunction bin1(E, T, V) {\n T = coerceNumbers(T); // for faster bisection\n return (I) => {\n const B = E.map(() => []);\n for (const i of I) B[bisect(T, V[i]) - 1]?.push(i); // TODO quantization?\n return B;\n };\n}\n\n// cumulative distribution\nfunction bin1cp(E, T, V) {\n const bin = bin1(E, T, V);\n return (I) => {\n const B = bin(I);\n for (let i = 1, n = B.length; i < n; ++i) {\n const C = B[i - 1];\n const b = B[i];\n for (const j of C) b.push(j);\n }\n return B;\n };\n}\n\n// complementary cumulative distribution\nfunction bin1cn(E, T, V) {\n const bin = bin1(E, T, V);\n return (I) => {\n const B = bin(I);\n for (let i = B.length - 2; i >= 0; --i) {\n const C = B[i + 1];\n const b = B[i];\n for (const j of C) b.push(j);\n }\n return B;\n };\n}\n\nfunction mid1(x1, x2) {\n const m = (+x1 + +x2) / 2;\n return x1 instanceof Date ? new Date(m) : m;\n}\n\nconst reduceX = {\n reduceIndex(I, X, {x1, x2}) {\n return mid1(x1, x2);\n }\n};\n\nconst reduceY = {\n reduceIndex(I, X, {y1, y2}) {\n return mid1(y1, y2);\n }\n};\n\nconst reduceX1 = {\n reduceIndex(I, X, {x1}) {\n return x1;\n }\n};\n\nconst reduceX2 = {\n reduceIndex(I, X, {x2}) {\n return x2;\n }\n};\n\nconst reduceY1 = {\n reduceIndex(I, X, {y1}) {\n return y1;\n }\n};\n\nconst reduceY2 = {\n reduceIndex(I, X, {y2}) {\n return y2;\n }\n};\n", "import {hasX, hasY, identity} from \"../options.js\";\n\nexport function maybeIdentityX(options = {}) {\n return hasX(options) ? options : {...options, x: identity};\n}\n\nexport function maybeIdentityY(options = {}) {\n return hasY(options) ? options : {...options, y: identity};\n}\n", "import {InternMap, cumsum, greatest, group, groupSort, max, min, rollup, sum} from \"d3\";\nimport {ascendingDefined, descendingDefined} from \"../defined.js\";\nimport {withTip} from \"../mark.js\";\nimport {maybeApplyInterval, maybeColumn, maybeZ, maybeZero} from \"../options.js\";\nimport {column, field, mid, one, range, valueof} from \"../options.js\";\nimport {basic} from \"./basic.js\";\n\nexport function stackX(stackOptions = {}, options = {}) {\n if (arguments.length === 1) [stackOptions, options] = mergeOptions(stackOptions);\n const {y1, y = y1, x, ...rest} = options; // note: consumes x!\n const [transform, Y, x1, x2] = stack(y, x, \"y\", \"x\", stackOptions, rest);\n return {...transform, y1, y: Y, x1, x2, x: mid(x1, x2)};\n}\n\nexport function stackX1(stackOptions = {}, options = {}) {\n if (arguments.length === 1) [stackOptions, options] = mergeOptions(stackOptions);\n const {y1, y = y1, x} = options;\n const [transform, Y, X] = stack(y, x, \"y\", \"x\", stackOptions, options);\n return {...transform, y1, y: Y, x: X};\n}\n\nexport function stackX2(stackOptions = {}, options = {}) {\n if (arguments.length === 1) [stackOptions, options] = mergeOptions(stackOptions);\n const {y1, y = y1, x} = options;\n const [transform, Y, , X] = stack(y, x, \"y\", \"x\", stackOptions, options);\n return {...transform, y1, y: Y, x: X};\n}\n\nexport function stackY(stackOptions = {}, options = {}) {\n if (arguments.length === 1) [stackOptions, options] = mergeOptions(stackOptions);\n const {x1, x = x1, y, ...rest} = options; // note: consumes y!\n const [transform, X, y1, y2] = stack(x, y, \"x\", \"y\", stackOptions, rest);\n return {...transform, x1, x: X, y1, y2, y: mid(y1, y2)};\n}\n\nexport function stackY1(stackOptions = {}, options = {}) {\n if (arguments.length === 1) [stackOptions, options] = mergeOptions(stackOptions);\n const {x1, x = x1, y} = options;\n const [transform, X, Y] = stack(x, y, \"x\", \"y\", stackOptions, options);\n return {...transform, x1, x: X, y: Y};\n}\n\nexport function stackY2(stackOptions = {}, options = {}) {\n if (arguments.length === 1) [stackOptions, options] = mergeOptions(stackOptions);\n const {x1, x = x1, y} = options;\n const [transform, X, , Y] = stack(x, y, \"x\", \"y\", stackOptions, options);\n return {...transform, x1, x: X, y: Y};\n}\n\nexport function maybeStackX({x, x1, x2, ...options} = {}) {\n options = withTip(options, \"y\");\n if (x1 === undefined && x2 === undefined) return stackX({x, ...options});\n [x1, x2] = maybeZero(x, x1, x2);\n return {...options, x1, x2};\n}\n\nexport function maybeStackY({y, y1, y2, ...options} = {}) {\n options = withTip(options, \"x\");\n if (y1 === undefined && y2 === undefined) return stackY({y, ...options});\n [y1, y2] = maybeZero(y, y1, y2);\n return {...options, y1, y2};\n}\n\n// The reverse option is ambiguous: it is both a stack option and a basic\n// transform. If only one options object is specified, we interpret it as a\n// stack option, and therefore must remove it from the propagated options.\nfunction mergeOptions(options) {\n const {offset, order, reverse, ...rest} = options;\n return [{offset, order, reverse}, rest];\n}\n\n// This is a hint to the tooltip mark that the y1 and y2 channels (for stackY,\n// or conversely x1 and x2 for stackX) represent a stacked length, and that the\n// tooltip should therefore show y2-y1 instead of an extent.\nconst lengthy = {length: true};\n\nfunction stack(x, y = one, kx, ky, {offset, order, reverse}, options) {\n const z = maybeZ(options);\n const [X, setX] = maybeColumn(x);\n const [Y1, setY1] = column(y);\n const [Y2, setY2] = column(y);\n Y1.hint = Y2.hint = lengthy;\n offset = maybeOffset(offset);\n order = maybeOrder(order, offset, ky);\n return [\n basic(options, (data, facets, plotOptions) => {\n const X = x == null ? undefined : setX(maybeApplyInterval(valueof(data, x), plotOptions?.[kx]));\n const Y = valueof(data, y, Float64Array);\n const Z = valueof(data, z);\n const compare = order && order(data, X, Y, Z);\n const n = data.length;\n const Y1 = setY1(new Float64Array(n));\n const Y2 = setY2(new Float64Array(n));\n const facetstacks = [];\n for (const facet of facets) {\n const stacks = X ? Array.from(group(facet, (i) => X[i]).values()) : [facet];\n if (compare) for (const stack of stacks) stack.sort(compare);\n for (const stack of stacks) {\n let yn = 0;\n let yp = 0;\n if (reverse) stack.reverse();\n for (const i of stack) {\n const y = Y[i];\n if (y < 0) yn = Y2[i] = (Y1[i] = yn) + y;\n else if (y > 0) yp = Y2[i] = (Y1[i] = yp) + y;\n else Y2[i] = Y1[i] = yp; // NaN or zero\n }\n }\n facetstacks.push(stacks);\n }\n if (offset) offset(facetstacks, Y1, Y2, Z);\n return {data, facets};\n }),\n X,\n Y1,\n Y2\n ];\n}\n\nfunction maybeOffset(offset) {\n if (offset == null) return;\n if (typeof offset === \"function\") return offset;\n switch (`${offset}`.toLowerCase()) {\n case \"expand\":\n case \"normalize\":\n return offsetExpand;\n case \"center\":\n case \"silhouette\":\n return offsetCenter;\n case \"wiggle\":\n return offsetWiggle;\n }\n throw new Error(`unknown offset: ${offset}`);\n}\n\n// Given a single stack, returns the minimum and maximum values from the given\n// Y2 column. Note that this relies on Y2 always being the outer column for\n// diverging values.\nfunction extent(stack, Y2) {\n let min = 0,\n max = 0;\n for (const i of stack) {\n const y = Y2[i];\n if (y < min) min = y;\n if (y > max) max = y;\n }\n return [min, max];\n}\n\nfunction offsetExpand(facetstacks, Y1, Y2) {\n for (const stacks of facetstacks) {\n for (const stack of stacks) {\n const [yn, yp] = extent(stack, Y2);\n for (const i of stack) {\n const m = 1 / (yp - yn || 1);\n Y1[i] = m * (Y1[i] - yn);\n Y2[i] = m * (Y2[i] - yn);\n }\n }\n }\n}\n\nfunction offsetCenter(facetstacks, Y1, Y2) {\n for (const stacks of facetstacks) {\n for (const stack of stacks) {\n const [yn, yp] = extent(stack, Y2);\n for (const i of stack) {\n const m = (yp + yn) / 2;\n Y1[i] -= m;\n Y2[i] -= m;\n }\n }\n offsetZero(stacks, Y1, Y2);\n }\n offsetCenterFacets(facetstacks, Y1, Y2);\n}\n\nfunction offsetWiggle(facetstacks, Y1, Y2, Z) {\n for (const stacks of facetstacks) {\n const prev = new InternMap();\n let y = 0;\n for (const stack of stacks) {\n let j = -1;\n const Fi = stack.map((i) => Math.abs(Y2[i] - Y1[i]));\n const Df = stack.map((i) => {\n j = Z ? Z[i] : ++j;\n const value = Y2[i] - Y1[i];\n const diff = prev.has(j) ? value - prev.get(j) : 0;\n prev.set(j, value);\n return diff;\n });\n const Cf1 = [0, ...cumsum(Df)];\n for (const i of stack) {\n Y1[i] += y;\n Y2[i] += y;\n }\n const s1 = sum(Fi);\n if (s1) y -= sum(Fi, (d, i) => (Df[i] / 2 + Cf1[i]) * d) / s1;\n }\n offsetZero(stacks, Y1, Y2);\n }\n offsetCenterFacets(facetstacks, Y1, Y2);\n}\n\nfunction offsetZero(stacks, Y1, Y2) {\n const m = min(stacks, (stack) => min(stack, (i) => Y1[i]));\n for (const stack of stacks) {\n for (const i of stack) {\n Y1[i] -= m;\n Y2[i] -= m;\n }\n }\n}\n\nfunction offsetCenterFacets(facetstacks, Y1, Y2) {\n const n = facetstacks.length;\n if (n === 1) return;\n const facets = facetstacks.map((stacks) => stacks.flat());\n const m = facets.map((I) => (min(I, (i) => Y1[i]) + max(I, (i) => Y2[i])) / 2);\n const m0 = min(m);\n for (let j = 0; j < n; j++) {\n const p = m0 - m[j];\n for (const i of facets[j]) {\n Y1[i] += p;\n Y2[i] += p;\n }\n }\n}\n\nfunction maybeOrder(order, offset, ky) {\n if (order === undefined && offset === offsetWiggle) return orderInsideOut(ascendingDefined);\n if (order == null) return;\n if (typeof order === \"string\") {\n const negate = order.startsWith(\"-\");\n const compare = negate ? descendingDefined : ascendingDefined;\n switch ((negate ? order.slice(1) : order).toLowerCase()) {\n case \"value\":\n case ky:\n return orderY(compare);\n case \"z\":\n return orderZ(compare);\n case \"sum\":\n return orderSum(compare);\n case \"appearance\":\n return orderAppearance(compare);\n case \"inside-out\":\n return orderInsideOut(compare);\n }\n return orderAccessor(field(order));\n }\n if (typeof order === \"function\") return (order.length === 1 ? orderAccessor : orderComparator)(order);\n if (Array.isArray(order)) return orderGiven(order);\n throw new Error(`invalid order: ${order}`);\n}\n\n// by value\nfunction orderY(compare) {\n return (data, X, Y) => (i, j) => compare(Y[i], Y[j]);\n}\n\n// by location\nfunction orderZ(compare) {\n return (data, X, Y, Z) => (i, j) => compare(Z[i], Z[j]);\n}\n\n// by sum of value (a.k.a. \u201Cascending\u201D)\nfunction orderSum(compare) {\n return orderZDomain(compare, (data, X, Y, Z) =>\n groupSort(\n range(data),\n (I) => sum(I, (i) => Y[i]),\n (i) => Z[i]\n )\n );\n}\n\n// by x = argmax of value\nfunction orderAppearance(compare) {\n return orderZDomain(compare, (data, X, Y, Z) =>\n groupSort(\n range(data),\n (I) => X[greatest(I, (i) => Y[i])],\n (i) => Z[i]\n )\n );\n}\n\n// by x = argmax of value, but rearranged inside-out by alternating series\n// according to the sign of a running divergence of sums\nfunction orderInsideOut(compare) {\n return orderZDomain(compare, (data, X, Y, Z) => {\n const I = range(data);\n const K = groupSort(\n I,\n (I) => X[greatest(I, (i) => Y[i])],\n (i) => Z[i]\n );\n const sums = rollup(\n I,\n (I) => sum(I, (i) => Y[i]),\n (i) => Z[i]\n );\n const Kp = [],\n Kn = [];\n let s = 0;\n for (const k of K) {\n if (s < 0) {\n s += sums.get(k);\n Kp.push(k);\n } else {\n s -= sums.get(k);\n Kn.push(k);\n }\n }\n return Kn.reverse().concat(Kp);\n });\n}\n\nfunction orderAccessor(f) {\n return (data) => {\n const O = valueof(data, f);\n return (i, j) => ascendingDefined(O[i], O[j]);\n };\n}\n\nfunction orderComparator(f) {\n return (data) => (i, j) => f(data[i], data[j]);\n}\n\nfunction orderGiven(domain) {\n return orderZDomain(ascendingDefined, () => domain);\n}\n\n// Given an ordering (domain) of distinct values in z that can be derived from\n// the data, returns a comparator that can be used to sort stacks. Note that\n// this is a series order: it will be consistent across stacks.\nfunction orderZDomain(compare, domain) {\n return (data, X, Y, Z) => {\n if (!Z) throw new Error(\"missing channel: z\");\n const map = new InternMap(domain(data, X, Y, Z).map((d, i) => [d, i]));\n return (i, j) => compare(map.get(Z[i]), map.get(Z[j]));\n };\n}\n", "import {create} from \"../context.js\";\nimport {Mark} from \"../mark.js\";\nimport {hasXY, identity, indexOf, number} from \"../options.js\";\nimport {isCollapsed} from \"../scales.js\";\nimport {applyAttr, applyChannelStyles, applyDirectStyles, applyIndirectStyles, applyTransform} from \"../style.js\";\nimport {impliedString} from \"../style.js\";\nimport {maybeIdentityX, maybeIdentityY} from \"../transforms/identity.js\";\nimport {maybeIntervalX, maybeIntervalY} from \"../transforms/interval.js\";\nimport {maybeStackX, maybeStackY} from \"../transforms/stack.js\";\n\nexport class AbstractBar extends Mark {\n constructor(data, channels, options = {}, defaults) {\n super(data, channels, options, defaults);\n const {inset = 0, insetTop = inset, insetRight = inset, insetBottom = inset, insetLeft = inset, rx, ry} = options;\n this.insetTop = number(insetTop);\n this.insetRight = number(insetRight);\n this.insetBottom = number(insetBottom);\n this.insetLeft = number(insetLeft);\n this.rx = impliedString(rx, \"auto\"); // number or percentage\n this.ry = impliedString(ry, \"auto\");\n }\n render(index, scales, channels, dimensions, context) {\n const {rx, ry} = this;\n return create(\"svg:g\", context)\n .call(applyIndirectStyles, this, dimensions, context)\n .call(this._transform, this, scales)\n .call((g) =>\n g\n .selectAll()\n .data(index)\n .enter()\n .append(\"rect\")\n .call(applyDirectStyles, this)\n .attr(\"x\", this._x(scales, channels, dimensions))\n .attr(\"width\", this._width(scales, channels, dimensions))\n .attr(\"y\", this._y(scales, channels, dimensions))\n .attr(\"height\", this._height(scales, channels, dimensions))\n .call(applyAttr, \"rx\", rx)\n .call(applyAttr, \"ry\", ry)\n .call(applyChannelStyles, this, channels)\n )\n .node();\n }\n _x(scales, {x: X}, {marginLeft}) {\n const {insetLeft} = this;\n return X ? (i) => X[i] + insetLeft : marginLeft + insetLeft;\n }\n _y(scales, {y: Y}, {marginTop}) {\n const {insetTop} = this;\n return Y ? (i) => Y[i] + insetTop : marginTop + insetTop;\n }\n _width({x}, {x: X}, {marginRight, marginLeft, width}) {\n const {insetLeft, insetRight} = this;\n const bandwidth = X && x ? x.bandwidth() : width - marginRight - marginLeft;\n return Math.max(0, bandwidth - insetLeft - insetRight);\n }\n _height({y}, {y: Y}, {marginTop, marginBottom, height}) {\n const {insetTop, insetBottom} = this;\n const bandwidth = Y && y ? y.bandwidth() : height - marginTop - marginBottom;\n return Math.max(0, bandwidth - insetTop - insetBottom);\n }\n}\n\nconst defaults = {\n ariaLabel: \"bar\"\n};\n\nexport class BarX extends AbstractBar {\n constructor(data, options = {}) {\n const {x1, x2, y} = options;\n super(\n data,\n {\n x1: {value: x1, scale: \"x\"},\n x2: {value: x2, scale: \"x\"},\n y: {value: y, scale: \"y\", type: \"band\", optional: true}\n },\n options,\n defaults\n );\n }\n _transform(selection, mark, {x}) {\n selection.call(applyTransform, mark, {x}, 0, 0);\n }\n _x({x}, {x1: X1, x2: X2}, {marginLeft}) {\n const {insetLeft} = this;\n return isCollapsed(x) ? marginLeft + insetLeft : (i) => Math.min(X1[i], X2[i]) + insetLeft;\n }\n _width({x}, {x1: X1, x2: X2}, {marginRight, marginLeft, width}) {\n const {insetLeft, insetRight} = this;\n return isCollapsed(x)\n ? width - marginRight - marginLeft - insetLeft - insetRight\n : (i) => Math.max(0, Math.abs(X2[i] - X1[i]) - insetLeft - insetRight);\n }\n}\n\nexport class BarY extends AbstractBar {\n constructor(data, options = {}) {\n const {x, y1, y2} = options;\n super(\n data,\n {\n y1: {value: y1, scale: \"y\"},\n y2: {value: y2, scale: \"y\"},\n x: {value: x, scale: \"x\", type: \"band\", optional: true}\n },\n options,\n defaults\n );\n }\n _transform(selection, mark, {y}) {\n selection.call(applyTransform, mark, {y}, 0, 0);\n }\n _y({y}, {y1: Y1, y2: Y2}, {marginTop}) {\n const {insetTop} = this;\n return isCollapsed(y) ? marginTop + insetTop : (i) => Math.min(Y1[i], Y2[i]) + insetTop;\n }\n _height({y}, {y1: Y1, y2: Y2}, {marginTop, marginBottom, height}) {\n const {insetTop, insetBottom} = this;\n return isCollapsed(y)\n ? height - marginTop - marginBottom - insetTop - insetBottom\n : (i) => Math.max(0, Math.abs(Y2[i] - Y1[i]) - insetTop - insetBottom);\n }\n}\n\nexport function barX(data, options = {}) {\n if (!hasXY(options)) options = {...options, y: indexOf, x2: identity};\n return new BarX(data, maybeStackX(maybeIntervalX(maybeIdentityX(options))));\n}\n\nexport function barY(data, options = {}) {\n if (!hasXY(options)) options = {...options, x: indexOf, y2: identity};\n return new BarY(data, maybeStackY(maybeIntervalY(maybeIdentityY(options))));\n}\n", "/**\n * @license\n * Copyright 2023 The Go Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\ninterface Page {\n Charts: ChartData;\n}\n\ninterface ChartData {\n Programs: Program[];\n}\n\ninterface Program {\n ID: string;\n Name: string;\n Charts: Chart[];\n}\n\ninterface Chart {\n ID: string;\n Name: string;\n Type: string;\n Data: Datum[] | null;\n}\n\ninterface Datum {\n Key: string;\n Value: number;\n}\n\ndeclare const Page: Page;\n\nimport * as d3 from \"d3\";\nimport * as Plot from \"@observablehq/plot\";\n\nfor (const program of Page.Charts.Programs) {\n for (const counter of program.Charts) {\n if (!counter) {\n continue;\n }\n switch (counter.Type) {\n case \"partition\":\n document\n .querySelector(`[data-chart-id=\"${counter.ID}\"]`)\n ?.append(partition(counter));\n\n break;\n case \"histogram\":\n document\n .querySelector(`[data-chart-id=\"${counter.ID}\"]`)\n ?.append(histogram(counter));\n\n break;\n default:\n console.error(\"unknown chart type\");\n break;\n }\n }\n}\n\nfunction partition({ Data, Name }: Chart) {\n Data ??= [];\n return Plot.plot({\n color: {\n type: \"ordinal\",\n scheme: \"Spectral\",\n },\n nice: true,\n x: {\n label: Name,\n labelOffset: Number.MAX_SAFE_INTEGER,\n tickRotate: 45,\n domain: Data.map((d) => d.Key),\n },\n y: {\n label: \"Frequency\",\n domain: [0, 1],\n },\n width: 1024,\n style: \"overflow:visible;background:transparent;margin-bottom:3rem;\",\n marks: [\n Plot.barY(Data, {\n tip: true,\n fill: (d) => (isNaN(Number(d.Key)) ? d.Key : Number(d.Key)),\n x: (d) => d.Key,\n y: (d) => d.Value,\n }),\n Plot.frame(),\n ],\n });\n}\n\nfunction histogram({ Data }: Chart) {\n Data ??= [];\n const n = 3; // number of facet columns\n const fixKey = (k: string) => (isNaN(Number(k)) ? k : Number(k));\n const keys = Array.from(d3.union(Data.map((d) => fixKey(d.Key))));\n const index = new Map(keys.map((key, i) => [key, i]));\n const fx = (key: string | number) => (index.get(key) ?? 0) % n;\n const fy = (key: string | number) => Math.floor((index.get(key) ?? 0) / n);\n\n return Plot.plot({\n marginLeft: 60,\n width: 1024,\n grid: true,\n nice: true,\n x: {\n label: \"Distribution\",\n },\n color: {\n type: \"ordinal\",\n legend: true,\n scheme: \"Spectral\",\n label: \"Counter\",\n },\n y: {\n insetTop: 16,\n domain: [0, 1],\n },\n fx: {\n ticks: [],\n },\n fy: {\n ticks: [],\n },\n style: \"background:transparent;\",\n marks: [\n Plot.barY(\n Data,\n Plot.binX(\n { y: \"proportion-facet\", x: \"x1\", interval: 0.1, cumulative: 1 },\n {\n tip: true,\n fill: (d: Datum) => fixKey(d.Key),\n x: (d: Datum) => d.Value,\n fx: (d: Datum) => fx(fixKey(d.Key)),\n fy: (d: Datum) => fy(fixKey(d.Key)),\n }\n )\n ),\n Plot.text(keys, {\n frameAnchor: \"top\",\n dy: 3,\n fx,\n fy,\n }),\n Plot.axisX({ anchor: \"bottom\", tickSpacing: 35 }),\n Plot.axisX({ anchor: \"top\", tickSpacing: 35 }),\n Plot.frame(),\n ],\n });\n}\n\nexport {};\n"],
"mappings": ";mBAAe,SAARA,GAA2BC,EAAGC,EAAG,CACtC,OAAOD,GAAK,MAAQC,GAAK,KAAO,IAAMD,EAAIC,EAAI,GAAKD,EAAIC,EAAI,EAAID,GAAKC,EAAI,EAAI,GAC9E,CCFe,SAARC,GAA4BC,EAAGC,EAAG,CACvC,OAAOD,GAAK,MAAQC,GAAK,KAAO,IAC5BA,EAAID,EAAI,GACRC,EAAID,EAAI,EACRC,GAAKD,EAAI,EACT,GACN,CCHe,SAARE,GAA0BC,EAAG,CAClC,IAAIC,EAAUC,EAAUC,EAOpBH,EAAE,SAAW,GACfC,EAAWG,GACXF,EAAW,CAACG,EAAGC,IAAMF,GAAUJ,EAAEK,CAAC,EAAGC,CAAC,EACtCH,EAAQ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G,CACD,MAAO,cACT,EACA,MAAO,CACL,KAAM,UACN,OAAQ,GACR,OAAQ,WACR,MAAO,SACT,EACA,EAAG,CACD,SAAU,GACV,OAAQ,CAAC,EAAG,CAAC,CACf,EACA,GAAI,CACF,MAAO,CAAC,CACV,EACA,GAAI,CACF,MAAO,CAAC,CACV,EACA,MAAO,0BACP,MAAO,CACAE,GACHJ,EACKgB,GACH,CAAE,EAAG,mBAAoB,EAAG,KAAM,SAAU,GAAK,WAAY,CAAE,EAC/D,CACE,IAAK,GACL,KAAOb,GAAaI,EAAOJ,EAAE,GAAG,EAChC,EAAIA,GAAaA,EAAE,MACnB,GAAKA,GAAaW,EAAGP,EAAOJ,EAAE,GAAG,CAAC,EAClC,GAAKA,GAAaY,EAAGR,EAAOJ,EAAE,GAAG,CAAC,CACpC,CACF,CACF,EACKc,GAAKR,EAAM,CACd,YAAa,MACb,GAAI,EACJ,GAAAK,EACA,GAAAC,CACF,CAAC,EACIG,GAAM,CAAE,OAAQ,SAAU,YAAa,EAAG,CAAC,EAC3CA,GAAM,CAAE,OAAQ,MAAO,YAAa,EAAG,CAAC,EACxCb,GAAM,CACb,CACF,CAAC,CACH",
"names": ["ascending", "a", "b", "descending", "a", "b", "bisector", "f", "compare1", "compare2", "delta", "ascending", "d", "x", "descending", "zero", "left", "a", "lo", "hi", "mid", "right", "center", "i", "number", "x", "numbers", "values", "valueof", "value", "index", "ascendingBisect", "bisector", "ascending", "bisectRight", "bisectLeft", "bisectCenter", "number", "bisect_default", "count", "values", "valueof", "value", "index", "length", "array", "empty", "arrayify", "values", "reducer", "reduce", "cross", "lengths", "j", "index", "product", "i", "cumsum", "values", "valueof", "sum", "index", "v", "variance", "values", "valueof", "count", "delta", "mean", "sum", "value", "index", "deviation", "values", "valueof", "v", "variance", "extent", "values", "valueof", "min", "max", "value", "index", "Adder", "x", "p", "i", "j", "y", "hi", "lo", "InternMap", "entries", "key", "keyof", "value", "intern_get", "intern_set", "intern_delete", "InternSet", "values", "_intern", "_key", "identity", "x", "group", "values", "keys", "nest", "identity", "rollup", "values", "reduce", "keys", "nest", "identity", "rollups", "nest", "values", "map", "reduce", "keys", "regroup", "i", "groups", "InternMap", "keyof", "index", "value", "key", "group", "permute", "source", "keys", "key", "sort", "values", "F", "f", "index", "d", "i", "j", "c", "ascendingDefined", "permute", "compareDefined", "compare", "ascending", "a", "b", "x", "groupSort", "values", "reduce", "key", "sort", "rollup", "ak", "av", "bk", "bv", "ascending", "group", "e10", "e5", "e2", "tickSpec", "start", "stop", "count", "step", "power", "error", "factor", "i1", "i2", "inc", "ticks", "reverse", "n", "i", "tickIncrement", "tickStep", "thresholdSturges", "values", "count", "max", "values", "valueof", "value", "index", "maxIndex", "values", "valueof", "max", "index", "value", "min", "values", "valueof", "value", "index", "minIndex", "values", "valueof", "min", "index", "value", "quickselect", "array", "k", "left", "right", "compare", "ascendingDefined", "compareDefined", "n", "m", "z", "s", "sd", "newLeft", "newRight", "t", "i", "j", "swap", "greatest", "values", "compare", "ascending", "max", "defined", "maxValue", "element", "value", "quantile", "values", "p", "valueof", "numbers", "n", "min", "max", "i", "i0", "value0", "quickselect", "value1", "quantileSorted", "number", "thresholdFreedmanDiaconis", "values", "min", "max", "c", "count", "d", "quantile", "thresholdScott", "values", "min", "max", "c", "count", "d", "deviation", "mean", "values", "valueof", "count", "sum", "value", "index", "median", "values", "valueof", "quantile", "flatten", "arrays", "array", "merge", "mode", "values", "valueof", "counts", "InternMap", "value", "index", "modeValue", "modeCount", "count", "pairs", "values", "pairof", "pair", "previous", "first", "value", "a", "b", "range", "start", "stop", "step", "n", "i", "sum", "values", "valueof", "value", "index", "reverse", "values", "union", "others", "set", "InternSet", "other", "o", "identity_default", "x", "top", "right", "bottom", "left", "epsilon", "translateX", "x", "translateY", "y", "number", "scale", "d", "center", "offset", "entering", "axis", "orient", "tickArguments", "tickValues", "tickFormat", "tickSizeInner", "tickSizeOuter", "tickPadding", "k", "transform", "context", "values", "format", "identity_default", "spacing", "range", "range0", "range1", "position", "selection", "path", "tick", "tickExit", "tickEnter", "line", "text", "p", "_", "axisBottom", "scale", "axis", "bottom", "noop", "dispatch", "i", "n", "_", "t", "Dispatch", "parseTypenames", "typenames", "types", "name", "typename", "callback", "T", "get", "set", "copy", "type", "that", "args", "c", "dispatch_default", "xhtml", "namespaces_default", "namespace_default", "name", "prefix", "i", "namespaces_default", "creatorInherit", "name", "document", "uri", "xhtml", "creatorFixed", "fullname", "creator_default", "namespace_default", "none", "selector_default", "selector", "select_default", "select", "selector_default", "groups", "m", "subgroups", "j", "group", "n", "subgroup", "node", "subnode", "i", "Selection", "array", "x", "empty", "selectorAll_default", "selector", "arrayAll", "select", "array", "selectAll_default", "selectorAll_default", "groups", "m", "subgroups", "parents", "j", "group", "n", "node", "i", "Selection", "matcher_default", "selector", "childMatcher", "node", "find", "childFind", "match", "childFirst", "selectChild_default", "childMatcher", "filter", "children", "childrenFilter", "match", "selectChildren_default", "childMatcher", "filter_default", "match", "matcher_default", "groups", "m", "subgroups", "j", "group", "n", "subgroup", "node", "i", "Selection", "sparse_default", "update", "enter_default", "Selection", "sparse_default", "EnterNode", "parent", "datum", "child", "next", "selector", "constant_default", "x", "bindIndex", "parent", "group", "enter", "update", "exit", "data", "i", "node", "groupLength", "dataLength", "EnterNode", "bindKey", "key", "nodeByKeyValue", "keyValues", "keyValue", "datum", "data_default", "value", "bind", "parents", "groups", "constant_default", "m", "j", "arraylike", "enterGroup", "updateGroup", "exitGroup", "i0", "i1", "previous", "next", "Selection", "exit_default", "Selection", "sparse_default", "join_default", "onenter", "onupdate", "onexit", "enter", "update", "exit", "merge_default", "context", "selection", "groups0", "groups1", "m0", "m1", "m", "merges", "j", "group0", "group1", "n", "merge", "node", "i", "Selection", "order_default", "groups", "j", "m", "group", "i", "next", "node", "sort_default", "compare", "ascending", "compareNode", "a", "b", "groups", "m", "sortgroups", "j", "group", "n", "sortgroup", "node", "i", "Selection", "call_default", "callback", "nodes_default", "node_default", "groups", "j", "m", "group", "i", "n", "node", "size_default", "size", "node", "empty_default", "each_default", "callback", "groups", "j", "m", "group", "n", "node", "attrRemove", "name", "attrRemoveNS", "fullname", "attrConstant", "value", "attrConstantNS", "attrFunction", "v", "attrFunctionNS", "attr_default", "namespace_default", "node", "window_default", "node", "styleRemove", "name", "styleConstant", "value", "priority", "styleFunction", "v", "style_default", "styleValue", "node", "window_default", "propertyRemove", "name", "propertyConstant", "value", "propertyFunction", "v", "property_default", "classArray", "string", "classList", "node", "ClassList", "name", "i", "classedAdd", "names", "list", "n", "classedRemove", "classedTrue", "classedFalse", "classedFunction", "value", "classed_default", "textRemove", "textConstant", "value", "textFunction", "v", "text_default", "htmlRemove", "htmlConstant", "value", "htmlFunction", "v", "html_default", "raise", "raise_default", "lower", "lower_default", "append_default", "name", "create", "creator_default", "constantNull", "insert_default", "name", "before", "create", "creator_default", "select", "selector_default", "remove", "parent", "remove_default", "selection_cloneShallow", "clone", "parent", "selection_cloneDeep", "clone_default", "deep", "datum_default", "value", "contextListener", "listener", "event", "parseTypenames", "typenames", "t", "name", "i", "onRemove", "typename", "on", "j", "m", "o", "onAdd", "value", "options", "on_default", "n", "dispatchEvent", "node", "type", "params", "window", "window_default", "event", "dispatchConstant", "dispatchFunction", "dispatch_default", "iterator_default", "groups", "j", "m", "group", "i", "n", "node", "root", "Selection", "groups", "parents", "selection", "selection_selection", "select_default", "selectAll_default", "selectChild_default", "selectChildren_default", "filter_default", "data_default", "enter_default", "exit_default", "join_default", "merge_default", "order_default", "sort_default", "call_default", "nodes_default", "node_default", "size_default", "empty_default", "each_default", "attr_default", "style_default", "property_default", "classed_default", "text_default", "html_default", "raise_default", "lower_default", "append_default", "insert_default", "remove_default", "clone_default", "datum_default", "on_default", "dispatch_default", "iterator_default", "selection_default", "select_default", "selector", "Selection", "root", "sourceEvent_default", "event", "sourceEvent", "pointer_default", "event", "node", "sourceEvent_default", "svg", "point", "rect", "define_default", "constructor", "factory", "prototype", "extend", "parent", "definition", "key", "Color", "darker", "brighter", "reI", "reN", "reP", "reHex", "reRgbInteger", "reRgbPercent", "reRgbaInteger", "reRgbaPercent", "reHslPercent", "reHslaPercent", "named", "define_default", "color", "channels", "color_formatHex", "color_formatHex8", "color_formatHsl", "color_formatRgb", "hslConvert", "format", "m", "l", "rgbn", "Rgb", "rgba", "hsla", "n", "r", "g", "b", "a", "rgbConvert", "o", "rgb", "opacity", "extend", "k", "clampi", "clampa", "rgb_formatHex", "rgb_formatHex8", "rgb_formatRgb", "hex", "value", "h", "s", "Hsl", "min", "max", "hsl", "m2", "m1", "hsl2rgb", "clamph", "clampt", "radians", "degrees", "K", "Xn", "Yn", "Zn", "t0", "t1", "t2", "t3", "labConvert", "o", "Lab", "Hcl", "hcl2lab", "Rgb", "rgbConvert", "r", "rgb2lrgb", "g", "b", "y", "xyz2lab", "x", "z", "lab", "l", "a", "b", "opacity", "labConvert", "Lab", "define_default", "extend", "Color", "k", "K", "y", "x", "z", "Xn", "lab2xyz", "Yn", "Zn", "Rgb", "lrgb2rgb", "xyz2lab", "t3", "t2", "t0", "t1", "rgb2lrgb", "hclConvert", "o", "Hcl", "h", "degrees", "hcl", "h", "c", "l", "opacity", "hclConvert", "Hcl", "hcl2lab", "o", "Lab", "radians", "define_default", "extend", "Color", "k", "K", "A", "B", "C", "D", "E", "ED", "EB", "BC_DA", "cubehelixConvert", "o", "Cubehelix", "Rgb", "rgbConvert", "r", "g", "b", "l", "bl", "k", "s", "h", "degrees", "cubehelix", "opacity", "define_default", "extend", "Color", "brighter", "darker", "radians", "a", "cosh", "sinh", "basis", "t1", "v0", "v1", "v2", "v3", "t2", "t3", "basis_default", "values", "n", "t", "i", "basisClosed_default", "values", "n", "t", "i", "v0", "v1", "v2", "v3", "basis", "constant_default", "x", "linear", "a", "d", "t", "exponential", "b", "y", "hue", "constant_default", "gamma", "nogamma", "rgb_default", "rgbGamma", "y", "color", "gamma", "rgb", "start", "end", "r", "g", "b", "opacity", "nogamma", "t", "rgbSpline", "spline", "colors", "i", "rgbBasis", "basis_default", "rgbBasisClosed", "basisClosed_default", "numberArray_default", "a", "b", "c", "i", "t", "isNumberArray", "x", "genericArray", "a", "b", "nb", "na", "x", "c", "i", "value_default", "t", "date_default", "a", "b", "d", "t", "number_default", "a", "b", "t", "object_default", "a", "b", "i", "c", "k", "value_default", "t", "reA", "reB", "zero", "b", "one", "t", "string_default", "a", "bi", "am", "bm", "bs", "i", "s", "q", "number_default", "o", "value_default", "a", "b", "t", "c", "constant_default", "number_default", "color", "rgb_default", "string_default", "date_default", "isNumberArray", "numberArray_default", "genericArray", "object_default", "round_default", "a", "b", "t", "degrees", "identity", "decompose_default", "a", "b", "c", "d", "e", "f", "scaleX", "scaleY", "skewX", "svgNode", "parseCss", "value", "m", "identity", "decompose_default", "parseSvg", "interpolateTransform", "parse", "pxComma", "pxParen", "degParen", "pop", "s", "translate", "xa", "ya", "xb", "yb", "q", "i", "number_default", "rotate", "a", "b", "skewX", "scale", "t", "n", "o", "interpolateTransformCss", "parseCss", "interpolateTransformSvg", "parseSvg", "hsl", "hue", "start", "end", "h", "s", "nogamma", "l", "opacity", "t", "hsl_default", "hslLong", "lab", "start", "end", "l", "nogamma", "a", "b", "opacity", "t", "hcl", "hue", "start", "end", "h", "c", "nogamma", "l", "opacity", "t", "hcl_default", "hclLong", "cubehelix", "hue", "cubehelixGamma", "y", "start", "end", "h", "s", "nogamma", "l", "opacity", "t", "cubehelix_default", "cubehelixLong", "piecewise", "interpolate", "values", "value_default", "i", "n", "v", "I", "t", "quantize_default", "interpolator", "n", "samples", "i", "frame", "timeout", "interval", "pokeDelay", "taskHead", "taskTail", "clockLast", "clockNow", "clockSkew", "clock", "setFrame", "f", "now", "clearNow", "Timer", "timer", "callback", "delay", "time", "sleep", "t", "timerFlush", "wake", "nap", "poke", "t0", "t1", "t2", "timeout_default", "callback", "delay", "time", "t", "Timer", "elapsed", "emptyOn", "dispatch_default", "emptyTween", "CREATED", "SCHEDULED", "STARTING", "STARTED", "RUNNING", "ENDING", "ENDED", "schedule_default", "node", "name", "id", "index", "group", "timing", "schedules", "create", "init", "schedule", "get", "set", "self", "tween", "timer", "elapsed", "start", "i", "j", "n", "o", "stop", "timeout_default", "tick", "t", "interrupt_default", "node", "name", "schedules", "schedule", "active", "empty", "i", "STARTING", "ENDING", "ENDED", "interrupt_default", "name", "tweenRemove", "id", "name", "tween0", "tween1", "schedule", "set", "tween", "i", "n", "tweenFunction", "value", "t", "tween_default", "get", "tweenValue", "transition", "node", "interpolate_default", "a", "b", "c", "number_default", "color", "rgb_default", "string_default", "attrRemove", "name", "attrRemoveNS", "fullname", "attrConstant", "interpolate", "value1", "string00", "string1", "interpolate0", "string0", "attrConstantNS", "attrFunction", "value", "string10", "attrFunctionNS", "attr_default", "namespace_default", "i", "interpolateTransformSvg", "interpolate_default", "tweenValue", "attrInterpolate", "name", "i", "t", "attrInterpolateNS", "fullname", "attrTweenNS", "value", "t0", "i0", "tween", "attrTween", "attrTween_default", "key", "namespace_default", "delayFunction", "id", "value", "init", "delayConstant", "delay_default", "get", "durationFunction", "id", "value", "set", "durationConstant", "duration_default", "get", "easeConstant", "id", "value", "set", "ease_default", "get", "easeVarying", "id", "value", "v", "set", "easeVarying_default", "filter_default", "match", "matcher_default", "groups", "m", "subgroups", "j", "group", "n", "subgroup", "node", "i", "Transition", "merge_default", "transition", "groups0", "groups1", "m0", "m1", "m", "merges", "j", "group0", "group1", "n", "merge", "node", "i", "Transition", "start", "name", "t", "i", "onFunction", "id", "listener", "on0", "on1", "sit", "init", "set", "schedule", "on", "on_default", "get", "removeFunction", "id", "parent", "i", "remove_default", "select_default", "select", "name", "id", "selector_default", "groups", "m", "subgroups", "j", "group", "n", "subgroup", "node", "subnode", "i", "schedule_default", "get", "Transition", "selectAll_default", "select", "name", "id", "selectorAll_default", "groups", "m", "subgroups", "parents", "j", "group", "n", "node", "i", "children", "child", "inherit", "get", "k", "l", "schedule_default", "Transition", "Selection", "selection_default", "styleNull", "name", "interpolate", "string00", "string10", "interpolate0", "string0", "styleValue", "string1", "styleRemove", "styleConstant", "value1", "styleFunction", "value", "styleMaybeRemove", "id", "on0", "on1", "listener0", "key", "event", "remove", "schedule", "set", "on", "listener", "style_default", "priority", "i", "interpolateTransformCss", "interpolate_default", "tweenValue", "styleInterpolate", "name", "i", "priority", "t", "styleTween", "value", "i0", "tween", "styleTween_default", "key", "textConstant", "value", "textFunction", "value1", "text_default", "tweenValue", "textInterpolate", "i", "t", "textTween", "value", "t0", "i0", "tween", "textTween_default", "key", "transition_default", "name", "id0", "id1", "newId", "groups", "m", "j", "group", "n", "node", "i", "inherit", "get", "schedule_default", "Transition", "end_default", "on0", "on1", "that", "id", "size", "resolve", "reject", "cancel", "end", "schedule", "set", "on", "id", "Transition", "groups", "parents", "name", "transition", "selection_default", "newId", "selection_prototype", "select_default", "selectAll_default", "filter_default", "merge_default", "transition_default", "on_default", "attr_default", "attrTween_default", "style_default", "styleTween_default", "text_default", "textTween_default", "remove_default", "tween_default", "delay_default", "duration_default", "ease_default", "easeVarying_default", "end_default", "cubicInOut", "defaultTiming", "cubicInOut", "inherit", "node", "id", "timing", "transition_default", "name", "Transition", "newId", "now", "groups", "m", "j", "group", "n", "i", "schedule_default", "selection_default", "interrupt_default", "transition_default", "abs", "max", "min", "number1", "e", "number2", "X", "type", "x", "xy", "Y", "y", "XY", "type", "pi", "tau", "epsilon", "tauEpsilon", "append", "strings", "i", "appendRound", "digits", "d", "k", "n", "Path", "x", "y", "x1", "y1", "x2", "y2", "r", "x0", "y0", "x21", "y21", "x01", "y01", "l01_2", "x20", "y20", "l21_2", "l20_2", "l21", "l01", "l", "t01", "t21", "a0", "a1", "ccw", "dx", "dy", "cw", "da", "w", "h", "path", "pathRound", "formatDecimal_default", "x", "formatDecimalParts", "p", "i", "coefficient", "exponent_default", "x", "formatDecimalParts", "formatGroup_default", "grouping", "thousands", "value", "width", "i", "t", "j", "g", "length", "formatNumerals_default", "numerals", "value", "i", "re", "formatSpecifier", "specifier", "match", "FormatSpecifier", "formatTrim_default", "s", "out", "n", "i", "i0", "i1", "prefixExponent", "formatPrefixAuto_default", "x", "p", "d", "formatDecimalParts", "coefficient", "exponent", "n", "formatRounded_default", "x", "p", "d", "formatDecimalParts", "coefficient", "exponent", "formatTypes_default", "x", "p", "formatDecimal_default", "formatRounded_default", "formatPrefixAuto_default", "identity_default", "x", "map", "prefixes", "locale_default", "locale", "group", "identity_default", "formatGroup_default", "currencyPrefix", "currencySuffix", "decimal", "numerals", "formatNumerals_default", "percent", "minus", "nan", "newFormat", "specifier", "formatSpecifier", "fill", "align", "sign", "symbol", "zero", "width", "comma", "precision", "trim", "type", "formatTypes_default", "prefix", "suffix", "formatType", "maybeSuffix", "format", "value", "valuePrefix", "valueSuffix", "i", "n", "c", "valueNegative", "formatTrim_default", "prefixExponent", "length", "padding", "formatPrefix", "f", "e", "exponent_default", "k", "locale", "format", "formatPrefix", "defaultLocale", "definition", "locale_default", "precisionFixed_default", "step", "exponent_default", "precisionPrefix_default", "step", "value", "exponent_default", "precisionRound_default", "step", "max", "exponent_default", "epsilon", "epsilon2", "pi", "halfPi", "quarterPi", "tau", "degrees", "radians", "abs", "atan", "atan2", "cos", "exp", "log", "pow", "sin", "sign", "x", "sqrt", "tan", "acos", "pi", "asin", "halfPi", "noop", "streamGeometry", "geometry", "stream", "streamGeometryType", "streamObjectType", "object", "features", "i", "n", "coordinates", "streamLine", "streamPolygon", "geometries", "closed", "coordinate", "stream_default", "spherical", "cartesian", "atan2", "asin", "lambda", "phi", "cosPhi", "cos", "sin", "cartesianDot", "a", "b", "cartesianCross", "cartesianAddInPlace", "cartesianScale", "vector", "k", "cartesianNormalizeInPlace", "d", "l", "sqrt", "compose_default", "a", "b", "compose", "x", "y", "rotationIdentity", "lambda", "phi", "abs", "pi", "tau", "rotateRadians", "deltaLambda", "deltaPhi", "deltaGamma", "compose_default", "rotationLambda", "rotationPhiGamma", "forwardRotationLambda", "rotation", "cosDeltaPhi", "cos", "sinDeltaPhi", "sin", "cosDeltaGamma", "sinDeltaGamma", "cosPhi", "x", "y", "z", "k", "atan2", "asin", "rotation_default", "rotate", "radians", "forward", "coordinates", "degrees", "circleStream", "stream", "radius", "delta", "direction", "t0", "t1", "cosRadius", "cos", "sinRadius", "sin", "step", "tau", "circleRadius", "point", "t", "spherical", "cartesian", "cartesianNormalizeInPlace", "acos", "epsilon", "buffer_default", "lines", "line", "x", "y", "m", "noop", "result", "pointEqual_default", "a", "b", "abs", "epsilon", "Intersection", "point", "points", "other", "entry", "rejoin_default", "segments", "compareIntersection", "startInside", "interpolate", "stream", "subject", "clip", "i", "n", "segment", "p0", "p1", "pointEqual_default", "epsilon", "link", "start", "current", "isSubject", "array", "a", "b", "longitude", "point", "abs", "pi", "sign", "tau", "polygonContains_default", "polygon", "lambda", "phi", "sinPhi", "sin", "normal", "cos", "angle", "winding", "sum", "Adder", "halfPi", "epsilon", "i", "n", "m", "ring", "point0", "lambda0", "phi0", "quarterPi", "sinPhi0", "cosPhi0", "j", "lambda1", "sinPhi1", "cosPhi1", "point1", "phi1", "delta", "absDelta", "antimeridian", "k", "atan2", "arc", "cartesianCross", "cartesian", "cartesianNormalizeInPlace", "intersection", "phiArc", "asin", "epsilon2", "clip_default", "pointVisible", "clipLine", "interpolate", "start", "sink", "line", "ringBuffer", "buffer_default", "ringSink", "polygonStarted", "polygon", "segments", "ring", "clip", "point", "lineStart", "lineEnd", "pointRing", "ringStart", "ringEnd", "merge", "startInside", "polygonContains_default", "rejoin_default", "compareIntersection", "lambda", "phi", "pointLine", "clean", "ringSegments", "i", "n", "m", "segment", "validSegment", "a", "b", "halfPi", "epsilon", "antimeridian_default", "clip_default", "clipAntimeridianLine", "clipAntimeridianInterpolate", "pi", "halfPi", "stream", "lambda0", "phi0", "sign0", "clean", "lambda1", "phi1", "sign1", "delta", "abs", "epsilon", "clipAntimeridianIntersect", "cosPhi0", "cosPhi1", "sinLambda0Lambda1", "sin", "atan", "cos", "from", "to", "direction", "phi", "lambda", "circle_default", "radius", "cr", "cos", "delta", "radians", "smallRadius", "notHemisphere", "abs", "epsilon", "interpolate", "from", "to", "direction", "stream", "circleStream", "visible", "lambda", "phi", "clipLine", "point0", "c0", "v0", "v00", "clean", "point1", "point2", "v", "c", "code", "pi", "intersect", "pointEqual_default", "t", "a", "b", "two", "pa", "cartesian", "pb", "n1", "n2", "cartesianCross", "n2n2", "cartesianDot", "n1n2", "determinant", "c1", "c2", "n1xn2", "A", "cartesianScale", "B", "cartesianAddInPlace", "u", "w", "uu", "t2", "sqrt", "q", "spherical", "lambda0", "lambda1", "phi0", "phi1", "z", "polar", "meridian", "q1", "r", "clip_default", "line_default", "a", "b", "x0", "y0", "x1", "y1", "ax", "ay", "bx", "by", "t0", "t1", "dx", "dy", "r", "clipMax", "clipMin", "clipRectangle", "x0", "y0", "x1", "y1", "visible", "x", "y", "interpolate", "from", "to", "direction", "stream", "a", "a1", "corner", "comparePoint", "p", "abs", "epsilon", "compareIntersection", "b", "ca", "cb", "activeStream", "bufferStream", "buffer_default", "segments", "polygon", "ring", "x__", "y__", "v__", "x_", "y_", "v_", "first", "clean", "clipStream", "point", "lineStart", "lineEnd", "polygonStart", "polygonEnd", "polygonInside", "winding", "i", "n", "j", "m", "a0", "b0", "b1", "startInside", "cleanInside", "merge", "rejoin_default", "linePoint", "v", "line_default", "identity_default", "x", "areaSum", "Adder", "areaRingSum", "x00", "y00", "x0", "y0", "areaStream", "noop", "areaRingStart", "areaRingEnd", "abs", "area", "areaPointFirst", "x", "y", "areaPoint", "area_default", "x0", "y0", "x1", "y1", "boundsStream", "boundsPoint", "noop", "bounds", "x", "y", "bounds_default", "X0", "Y0", "Z0", "X1", "Y1", "Z1", "X2", "Y2", "Z2", "x00", "y00", "x0", "y0", "centroidStream", "centroidPoint", "centroidLineStart", "centroidLineEnd", "centroidRingStart", "centroidRingEnd", "centroid", "x", "y", "centroidPointFirstLine", "centroidPointLine", "dx", "dy", "z", "sqrt", "centroidPointFirstRing", "centroidPointRing", "centroid_default", "PathContext", "context", "_", "x", "y", "tau", "noop", "lengthSum", "Adder", "lengthRing", "x00", "y00", "x0", "y0", "lengthStream", "noop", "lengthPointFirst", "lengthPoint", "length", "x", "y", "sqrt", "measure_default", "cacheDigits", "cacheAppend", "cacheRadius", "cacheCircle", "PathString", "digits", "append", "appendRound", "_", "x", "y", "s", "result", "strings", "i", "j", "d", "k", "path_default", "projection", "context", "digits", "pointRadius", "projectionStream", "contextStream", "path", "object", "stream_default", "area_default", "measure_default", "bounds_default", "centroid_default", "_", "identity_default", "PathString", "PathContext", "d", "transform_default", "methods", "transformer", "stream", "s", "TransformStream", "key", "x", "y", "fit", "projection", "fitBounds", "object", "clip", "stream_default", "bounds_default", "fitExtent", "extent", "b", "w", "h", "k", "x", "y", "fitSize", "size", "fitWidth", "width", "fitHeight", "height", "maxDepth", "cosMinDistance", "cos", "radians", "resample_default", "project", "delta2", "resample", "resampleNone", "transformer", "x", "y", "resampleLineTo", "x0", "y0", "lambda0", "a0", "b0", "c0", "x1", "y1", "lambda1", "a1", "b1", "c1", "depth", "stream", "dx", "dy", "d2", "a", "b", "c", "m", "sqrt", "phi2", "asin", "lambda2", "abs", "epsilon", "atan2", "p", "x2", "y2", "dx2", "dy2", "dz", "lambda00", "x00", "y00", "a00", "b00", "c00", "resampleStream", "point", "lineStart", "lineEnd", "ringStart", "linePoint", "lambda", "phi", "cartesian", "ringPoint", "ringEnd", "transformRadians", "transformer", "x", "y", "radians", "transformRotate", "rotate", "scaleTranslate", "k", "dx", "dy", "sx", "sy", "transform", "scaleTranslateRotate", "alpha", "cosAlpha", "cos", "sinAlpha", "sin", "a", "b", "ai", "bi", "ci", "fi", "projection", "project", "projectionMutator", "projectAt", "lambda", "phi", "deltaLambda", "deltaPhi", "deltaGamma", "theta", "preclip", "antimeridian_default", "x0", "y0", "x1", "y1", "postclip", "identity_default", "delta2", "projectResample", "projectTransform", "projectRotateTransform", "cache", "cacheStream", "point", "invert", "degrees", "stream", "_", "reset", "circle_default", "clipRectangle", "recenter", "resample_default", "sqrt", "extent", "object", "fitExtent", "size", "fitSize", "width", "fitWidth", "height", "fitHeight", "center", "rotateRadians", "compose_default", "conicProjection", "projectAt", "phi0", "phi1", "pi", "m", "projectionMutator", "p", "_", "radians", "degrees", "cylindricalEqualAreaRaw", "phi0", "cosPhi0", "cos", "forward", "lambda", "phi", "sin", "x", "y", "asin", "conicEqualAreaRaw", "y0", "y1", "sy0", "sin", "n", "abs", "epsilon", "cylindricalEqualAreaRaw", "c", "r0", "sqrt", "project", "x", "y", "r", "cos", "r0y", "l", "atan2", "sign", "pi", "asin", "conicEqualArea_default", "conicProjection", "albers_default", "conicEqualArea_default", "multiplex", "streams", "n", "x", "y", "i", "albersUsa_default", "cache", "cacheStream", "lower48", "albers_default", "lower48Point", "alaska", "conicEqualArea_default", "alaskaPoint", "hawaii", "hawaiiPoint", "point", "pointStream", "albersUsa", "coordinates", "k", "t", "stream", "_", "reset", "epsilon", "extent", "object", "fitExtent", "size", "fitSize", "width", "fitWidth", "height", "fitHeight", "azimuthalRaw", "scale", "x", "y", "cx", "cos", "cy", "k", "sin", "azimuthalInvert", "angle", "z", "sqrt", "c", "sc", "cc", "atan2", "asin", "azimuthalEqualAreaRaw", "azimuthalRaw", "cxcy", "sqrt", "azimuthalInvert", "z", "asin", "azimuthalEqualArea_default", "projection", "azimuthalEquidistantRaw", "azimuthalRaw", "c", "acos", "sin", "azimuthalInvert", "z", "azimuthalEquidistant_default", "projection", "mercatorRaw", "lambda", "phi", "log", "tan", "halfPi", "x", "y", "atan", "exp", "mercator_default", "mercatorProjection", "tau", "project", "m", "projection", "center", "scale", "translate", "clipExtent", "x0", "y0", "x1", "y1", "_", "reclip", "k", "pi", "t", "rotation_default", "tany", "y", "tan", "halfPi", "conicConformalRaw", "y0", "y1", "cy0", "cos", "n", "sin", "log", "f", "pow", "mercatorRaw", "project", "x", "epsilon", "r", "fy", "sign", "sqrt", "l", "atan2", "abs", "pi", "atan", "conicConformal_default", "conicProjection", "equirectangularRaw", "lambda", "phi", "equirectangular_default", "projection", "conicEquidistantRaw", "y0", "y1", "cy0", "cos", "n", "sin", "g", "abs", "epsilon", "equirectangularRaw", "project", "x", "y", "gy", "nx", "l", "atan2", "sign", "pi", "sqrt", "conicEquidistant_default", "conicProjection", "A1", "A2", "A3", "A4", "M", "sqrt", "iterations", "equalEarthRaw", "lambda", "phi", "l", "asin", "sin", "l2", "l6", "cos", "x", "y", "delta", "fy", "fpy", "abs", "epsilon2", "equalEarth_default", "projection", "gnomonicRaw", "x", "y", "cy", "cos", "k", "sin", "azimuthalInvert", "atan", "gnomonic_default", "projection", "orthographicRaw", "x", "y", "cos", "sin", "azimuthalInvert", "asin", "orthographic_default", "projection", "epsilon", "stereographicRaw", "x", "y", "cy", "cos", "k", "sin", "azimuthalInvert", "z", "atan", "stereographic_default", "projection", "transverseMercatorRaw", "lambda", "phi", "log", "tan", "halfPi", "x", "y", "atan", "exp", "transverseMercator_default", "m", "mercatorProjection", "center", "rotate", "_", "initRange", "domain", "range", "initInterpolator", "interpolator", "implicit", "ordinal", "index", "InternMap", "domain", "range", "unknown", "scale", "d", "i", "_", "value", "initRange", "band", "scale", "ordinal", "domain", "ordinalRange", "r0", "r1", "step", "bandwidth", "round", "paddingInner", "paddingOuter", "align", "rescale", "n", "reverse", "start", "stop", "values", "range", "i", "_", "initRange", "pointish", "copy", "point", "constants", "x", "number", "x", "unit", "identity", "x", "normalize", "a", "b", "constants", "clamper", "t", "bimap", "domain", "range", "interpolate", "d0", "d1", "r0", "r1", "polymap", "j", "d", "r", "i", "bisect_default", "copy", "source", "target", "transformer", "value_default", "transform", "untransform", "unknown", "clamp", "piecewise", "output", "input", "rescale", "n", "scale", "y", "number_default", "_", "number", "round_default", "u", "continuous", "tickFormat", "start", "stop", "count", "specifier", "step", "tickStep", "precision", "formatSpecifier", "value", "precisionPrefix_default", "formatPrefix", "precisionRound_default", "precisionFixed_default", "format", "linearish", "scale", "domain", "count", "d", "ticks", "specifier", "tickFormat", "i0", "i1", "start", "stop", "prestep", "step", "maxIter", "tickIncrement", "linear", "continuous", "copy", "initRange", "identity", "domain", "unknown", "scale", "x", "_", "number", "linearish", "nice", "domain", "interval", "i0", "i1", "x0", "x1", "t", "transformLog", "x", "transformExp", "transformLogn", "transformExpn", "pow10", "powp", "base", "logp", "reflect", "f", "k", "loggish", "transform", "scale", "domain", "logs", "pows", "rescale", "_", "count", "d", "u", "v", "r", "i", "j", "t", "n", "z", "ticks", "specifier", "formatSpecifier", "format", "nice", "log", "transformer", "copy", "initRange", "transformSymlog", "c", "x", "transformSymexp", "symlogish", "transform", "scale", "_", "linearish", "symlog", "transformer", "copy", "initRange", "transformPow", "exponent", "x", "transformSqrt", "transformSquare", "powish", "transform", "scale", "identity", "rescale", "_", "linearish", "pow", "transformer", "copy", "initRange", "quantile", "domain", "range", "thresholds", "unknown", "rescale", "i", "n", "quantileSorted", "scale", "x", "bisect_default", "y", "_", "d", "ascending", "initRange", "threshold", "domain", "range", "unknown", "n", "scale", "x", "bisect_default", "_", "y", "i", "initRange", "t0", "t1", "timeInterval", "floori", "offseti", "count", "field", "interval", "date", "d0", "d1", "step", "start", "stop", "range", "previous", "test", "end", "d", "millisecond", "timeInterval", "date", "step", "start", "end", "k", "milliseconds", "second", "timeInterval", "date", "step", "start", "end", "seconds", "timeMinute", "timeInterval", "date", "step", "start", "end", "timeMinutes", "utcMinute", "utcMinutes", "timeHour", "timeInterval", "date", "step", "start", "end", "timeHours", "utcHour", "utcHours", "timeDay", "timeInterval", "date", "step", "start", "end", "timeDays", "utcDay", "utcDays", "unixDay", "unixDays", "timeWeekday", "i", "timeInterval", "date", "step", "start", "end", "timeSunday", "timeMonday", "timeTuesday", "timeWednesday", "timeThursday", "timeFriday", "timeSaturday", "timeSundays", "timeMondays", "timeTuesdays", "timeWednesdays", "timeThursdays", "timeFridays", "timeSaturdays", "utcWeekday", "utcSunday", "utcMonday", "utcTuesday", "utcWednesday", "utcThursday", "utcFriday", "utcSaturday", "utcSundays", "utcMondays", "utcTuesdays", "utcWednesdays", "utcThursdays", "utcFridays", "utcSaturdays", "timeMonth", "timeInterval", "date", "step", "start", "end", "timeMonths", "utcMonth", "utcMonths", "timeYear", "timeInterval", "date", "step", "start", "end", "k", "timeYears", "utcYear", "utcYears", "ticker", "year", "month", "week", "day", "hour", "minute", "tickIntervals", "second", "ticks", "start", "stop", "count", "reverse", "interval", "tickInterval", "target", "i", "bisector", "step", "tickStep", "millisecond", "t", "utcTicks", "utcTickInterval", "utcYear", "utcMonth", "utcSunday", "unixDay", "utcHour", "utcMinute", "timeTicks", "timeTickInterval", "timeYear", "timeMonth", "timeSunday", "timeDay", "timeHour", "timeMinute", "localDate", "d", "date", "utcDate", "newDate", "y", "m", "formatLocale", "locale", "locale_dateTime", "locale_date", "locale_time", "locale_periods", "locale_weekdays", "locale_shortWeekdays", "locale_months", "locale_shortMonths", "periodRe", "formatRe", "periodLookup", "formatLookup", "weekdayRe", "weekdayLookup", "shortWeekdayRe", "shortWeekdayLookup", "monthRe", "monthLookup", "shortMonthRe", "shortMonthLookup", "formats", "formatShortWeekday", "formatWeekday", "formatShortMonth", "formatMonth", "formatDayOfMonth", "formatMicroseconds", "formatYearISO", "formatFullYearISO", "formatHour24", "formatHour12", "formatDayOfYear", "formatMilliseconds", "formatMonthNumber", "formatMinutes", "formatPeriod", "formatQuarter", "formatUnixTimestamp", "formatUnixTimestampSeconds", "formatSeconds", "formatWeekdayNumberMonday", "formatWeekNumberSunday", "formatWeekNumberISO", "formatWeekdayNumberSunday", "formatWeekNumberMonday", "formatYear", "formatFullYear", "formatZone", "formatLiteralPercent", "utcFormats", "formatUTCShortWeekday", "formatUTCWeekday", "formatUTCShortMonth", "formatUTCMonth", "formatUTCDayOfMonth", "formatUTCMicroseconds", "formatUTCYearISO", "formatUTCFullYearISO", "formatUTCHour24", "formatUTCHour12", "formatUTCDayOfYear", "formatUTCMilliseconds", "formatUTCMonthNumber", "formatUTCMinutes", "formatUTCPeriod", "formatUTCQuarter", "formatUTCSeconds", "formatUTCWeekdayNumberMonday", "formatUTCWeekNumberSunday", "formatUTCWeekNumberISO", "formatUTCWeekdayNumberSunday", "formatUTCWeekNumberMonday", "formatUTCYear", "formatUTCFullYear", "formatUTCZone", "parses", "parseShortWeekday", "parseWeekday", "parseShortMonth", "parseMonth", "parseLocaleDateTime", "parseDayOfMonth", "parseMicroseconds", "parseYear", "parseFullYear", "parseHour24", "parseDayOfYear", "parseMilliseconds", "parseMonthNumber", "parseMinutes", "parsePeriod", "parseQuarter", "parseUnixTimestamp", "parseUnixTimestampSeconds", "parseSeconds", "parseWeekdayNumberMonday", "parseWeekNumberSunday", "parseWeekNumberISO", "parseWeekdayNumberSunday", "parseWeekNumberMonday", "parseLocaleDate", "parseLocaleTime", "parseZone", "parseLiteralPercent", "newFormat", "specifier", "string", "i", "j", "n", "c", "pad", "format", "pads", "newParse", "Z", "parseSpecifier", "week", "day", "utcMonday", "utcDay", "timeMonday", "timeDay", "parse", "f", "p", "numberRe", "percentRe", "requoteRe", "value", "fill", "width", "sign", "length", "requote", "s", "names", "name", "timeYear", "timeSunday", "dISO", "timeThursday", "z", "utcYear", "dow", "utcSunday", "UTCdISO", "utcThursday", "locale", "timeFormat", "timeParse", "utcFormat", "utcParse", "defaultLocale", "definition", "formatLocale", "date", "number", "calendar", "ticks", "tickInterval", "year", "month", "week", "day", "hour", "minute", "second", "format", "scale", "continuous", "invert", "domain", "formatMillisecond", "formatSecond", "formatMinute", "formatHour", "formatDay", "formatWeek", "formatMonth", "formatYear", "tickFormat", "y", "_", "interval", "d", "count", "specifier", "nice", "copy", "time", "initRange", "timeTicks", "timeTickInterval", "timeYear", "timeMonth", "timeSunday", "timeDay", "timeHour", "timeMinute", "timeFormat", "utcTime", "initRange", "calendar", "utcTicks", "utcTickInterval", "utcYear", "utcMonth", "utcSunday", "utcDay", "utcHour", "utcMinute", "second", "utcFormat", "copy", "source", "target", "transformer", "x0", "x1", "x2", "s", "t0", "t1", "t2", "k10", "k21", "interpolator", "identity", "transform", "clamp", "unknown", "scale", "x", "_", "range", "interpolate", "r0", "r1", "r2", "piecewise", "value_default", "round_default", "t", "diverging", "linearish", "copy", "initInterpolator", "divergingLog", "loggish", "divergingSymlog", "symlogish", "divergingPow", "powish", "colors_default", "specifier", "n", "colors", "i", "category10_default", "colors_default", "Accent_default", "colors_default", "Dark2_default", "colors_default", "Paired_default", "colors_default", "Pastel1_default", "colors_default", "Pastel2_default", "colors_default", "Set1_default", "colors_default", "Set2_default", "colors_default", "Set3_default", "colors_default", "Tableau10_default", "colors_default", "ramp_default", "scheme", "rgbBasis", "scheme", "colors_default", "BrBG_default", "ramp_default", "scheme", "colors_default", "PRGn_default", "ramp_default", "scheme", "colors_default", "PiYG_default", "ramp_default", "scheme", "colors_default", "PuOr_default", "ramp_default", "scheme", "colors_default", "RdBu_default", "ramp_default", "scheme", "colors_default", "RdGy_default", "ramp_default", "scheme", "colors_default", "RdYlBu_default", "ramp_default", "scheme", "colors_default", "RdYlGn_default", "ramp_default", "scheme", "colors_default", "Spectral_default", "ramp_default", "scheme", "colors_default", "BuGn_default", "ramp_default", "scheme", "colors_default", "BuPu_default", "ramp_default", "scheme", "colors_default", "GnBu_default", "ramp_default", "scheme", "colors_default", "OrRd_default", "ramp_default", "scheme", "colors_default", "PuBuGn_default", "ramp_default", "scheme", "colors_default", "PuBu_default", "ramp_default", "scheme", "colors_default", "PuRd_default", "ramp_default", "scheme", "colors_default", "RdPu_default", "ramp_default", "scheme", "colors_default", "YlGnBu_default", "ramp_default", "scheme", "colors_default", "YlGn_default", "ramp_default", "scheme", "colors_default", "YlOrBr_default", "ramp_default", "scheme", "colors_default", "YlOrRd_default", "ramp_default", "scheme", "colors_default", "Blues_default", "ramp_default", "scheme", "colors_default", "Greens_default", "ramp_default", "scheme", "colors_default", "Greys_default", "ramp_default", "scheme", "colors_default", "Purples_default", "ramp_default", "scheme", "colors_default", "Reds_default", "ramp_default", "scheme", "colors_default", "Oranges_default", "ramp_default", "cividis_default", "cubehelix_default", "cubehelixLong", "cubehelix", "warm", "cubehelixLong", "cubehelix", "cool", "c", "rainbow_default", "ts", "c", "rgb", "pi_1_3", "pi_2_3", "sinebow_default", "x", "turbo_default", "ramp", "range", "n", "t", "viridis_default", "colors_default", "magma", "inferno", "plasma", "cos", "min", "sin", "sqrt", "pi", "halfPi", "tau", "sqrt3", "sqrt", "asterisk_default", "context", "size", "r", "min", "t", "u", "circle_default", "context", "size", "r", "sqrt", "pi", "tau", "cross_default", "context", "size", "r", "sqrt", "tan30", "sqrt", "tan30_2", "diamond_default", "context", "size", "y", "x", "diamond2_default", "context", "size", "r", "sqrt", "plus_default", "context", "size", "r", "sqrt", "min", "square_default", "context", "size", "w", "sqrt", "x", "square2_default", "context", "size", "r", "sqrt", "ka", "kr", "sin", "pi", "kx", "tau", "ky", "cos", "star_default", "context", "size", "r", "sqrt", "x", "y", "c", "s", "sqrt3", "sqrt", "triangle_default", "context", "size", "y", "sqrt3", "sqrt", "triangle2_default", "context", "size", "s", "t", "u", "c", "s", "sqrt", "k", "a", "wye_default", "context", "size", "r", "x0", "y0", "x1", "y1", "x2", "y2", "times_default", "context", "size", "r", "sqrt", "min", "symbolsFill", "circle_default", "cross_default", "diamond_default", "square_default", "star_default", "triangle_default", "wye_default", "symbolsStroke", "plus_default", "times_default", "triangle2_default", "asterisk_default", "square2_default", "diamond2_default", "Transform", "k", "x", "y", "point", "location", "identity", "transform", "node", "defined", "x", "ascendingDefined", "a", "b", "ascending", "descendingDefined", "descending", "nonempty", "finite", "positive", "negative", "format", "date", "fallback", "hours", "minutes", "seconds", "milliseconds", "formatYear", "pad", "year", "value", "width", "re", "parse", "string", "fallback", "durationSecond", "durationMinute", "durationHour", "durationDay", "durationWeek", "durationMonth", "durationYear", "formats", "timeIntervals", "second", "timeMinute", "timeHour", "timeDay", "timeSunday", "timeMonth", "timeYear", "timeMonday", "timeTuesday", "timeWednesday", "timeThursday", "timeFriday", "timeSaturday", "utcIntervals", "utcMinute", "utcHour", "unixDay", "utcSunday", "utcMonth", "utcYear", "utcMonday", "utcTuesday", "utcWednesday", "utcThursday", "utcFriday", "utcSaturday", "parseInterval", "input", "intervals", "name", "period", "match", "interval", "maybeTimeInterval", "maybeUtcInterval", "isUtcYear", "i", "date", "isTimeYear", "formatTimeTicks", "scale", "data", "ticks", "anchor", "format", "timeFormat", "utcFormat", "template", "f1", "f2", "getTimeTicksInterval", "formatConditional", "medianStep", "median", "pairs", "a", "b", "bisector", "step", "start", "stop", "extent", "count", "format1", "format2", "x", "X", "j", "orderof", "TypedArray", "objectToString", "valueof", "data", "value", "type", "valueType", "maybeTypedMap", "field", "map", "constant", "maybeTypedArrayify", "f", "floater", "arrayify", "coerceNumber", "d", "i", "singleton", "name", "indexOf", "range", "identity", "one", "yes", "string", "x", "number", "first", "x", "second", "constant", "x", "percentile", "reduce", "p", "I", "f", "quantile", "coerceNumbers", "values", "TypedArray", "map", "coerceNumber", "coerceDates", "coerceDate", "parse", "maybeColorChannel", "value", "defaultValue", "isColor", "maybeNumberChannel", "maybeKeyword", "input", "name", "allowed", "keyword", "i", "arrayify", "data", "type", "slice", "hasX", "x1", "x2", "hasY", "y", "y1", "y2", "hasXY", "options", "isObject", "option", "objectToString", "isScaleOptions", "isOptions", "isDomainSort", "sort", "maybeZero", "x3", "identity", "maybeTuple", "first", "second", "maybeZ", "z", "fill", "stroke", "range", "n", "r", "take", "values", "index", "map", "i", "subarray", "I", "i", "j", "keyof", "value", "maybeInput", "key", "options", "column", "source", "labelof", "v", "maybeColumn", "defaultValue", "mid", "x1", "x2", "data", "X1", "X2", "isTemporal", "map", "_", "maybeApplyInterval", "V", "scale", "t", "maybeIntervalTransform", "interval", "type", "maybeInterval", "defined", "d", "lo", "hi", "range", "x", "maybeTimeInterval", "maybeUtcInterval", "maybeRangeInterval", "maybeNiceInterval", "maybeValue", "isOptions", "numberChannel", "valueof", "isIterable", "value", "isTextual", "values", "isOrdinal", "type", "isTemporal", "isTemporalString", "parse", "isNumericString", "isNumeric", "isEvery", "is", "every", "isColor", "color", "isOpacity", "isNoneish", "isNone", "isRound", "maybeAnchor", "name", "maybeKeyword", "maybeFrameAnchor", "orderof", "first", "last", "descending", "inherit", "options", "rest", "o", "defaults", "key", "named", "things", "names", "thing", "maybeNamed", "position", "color", "radius", "length", "opacity", "symbol", "projection", "registry", "sqrt3", "sqrt4_3", "symbolHexagon", "context", "size", "rx", "ry", "hy", "symbols", "asterisk_default", "circle_default", "cross_default", "diamond_default", "diamond2_default", "plus_default", "square_default", "square2_default", "star_default", "times_default", "triangle_default", "triangle2_default", "wye_default", "isSymbolObject", "value", "isSymbol", "maybeSymbol", "symbol", "basic", "f1", "s1", "r1", "t1", "i1", "options", "transform", "filterTransform", "isDomainSort", "composeTransform", "sortTransform", "reverseTransform", "initializer", "composeInitializer", "t2", "data", "facets", "plotOptions", "arrayify", "i2", "channels", "args", "c1", "d1", "c2", "d2", "f2", "filterTransform", "value", "data", "facets", "V", "valueof", "I", "reverseTransform", "data", "facets", "I", "sortTransform", "value", "sortData", "sortValue", "compare", "data", "facets", "compareData", "i", "j", "I", "channel", "order", "maybeValue", "negate", "descendingDefined", "ascendingDefined", "channels", "V", "valueof", "compareValue", "hasOutput", "outputs", "names", "name", "maybeOutputs", "inputs", "asOutput", "maybeOutput", "entries", "reduceTitle", "reduceFirst", "reduce", "nullOutput", "asEvaluator", "maybeEvaluator", "scale", "isObject", "evaluator", "output", "setOutput", "column", "O", "data", "scope", "I", "extent", "asReduce", "maybeReduce", "input", "maybeInput", "reducer", "V", "context", "labelof", "reduceCount", "valueof", "range", "maybeGroup", "X", "sort", "group", "i", "first", "value", "fallback", "invalidReduce", "reduceReduce", "reduceFunction", "reduceAccessor", "percentile", "reduceLast", "reduceIdentity", "reduceDistinct", "reduceSum", "reduceProportion", "deviation", "min", "minIndex", "max", "maxIndex", "reduceMaybeTemporalAccessor", "mean", "median", "variance", "mode", "maybeSubgroup", "maybeSort", "facets", "reverse", "S", "compare", "j", "ascendingDefined", "f", "take", "x", "isTemporal", "groups", "rollup", "second", "top", "bottom", "sum", "key", "s", "InternSet", "basis", "createChannel", "data", "scale", "type", "value", "filter", "hint", "name", "inferChannelScale", "valueof", "labelof", "createChannels", "channels", "channel", "valueObject", "scales", "values", "scaleName", "map", "isEvery", "isColor", "isOpacity", "isSymbol", "maybeSymbol", "registry", "channelDomain", "facets", "facetChannels", "options", "defaultOrder", "defaultReverse", "defaultReduce", "defaultLimit", "x", "y", "order", "reverse", "reduce", "limit", "maybeValue", "negate", "descendingGroup", "ascendingGroup", "maybeOrder", "X", "reindexFacetChannel", "findScaleChannel", "XV", "lo", "hi", "isIterable", "domain", "InternSet", "YV", "difference", "reducer", "maybeReduce", "rollups", "range", "I", "i", "first", "originalFacets", "V1", "V2", "vi", "j", "k1", "k2", "X1", "X2", "x2", "alias", "ak", "av", "bk", "bv", "ascendingDefined", "descendingDefined", "getSource", "key", "createContext", "options", "document", "create", "name", "select_default", "creator_default", "warnings", "consumeWarnings", "w", "warn", "message", "pi", "tau", "defaultAspectRatio", "createProjection", "projection", "globalInset", "insetTop", "insetRight", "insetBottom", "insetLeft", "dimensions", "options", "domain", "clip", "isObject", "inset", "namedProjection", "width", "height", "marginLeft", "marginRight", "marginTop", "marginBottom", "dx", "dy", "maybePostClip", "tx", "ty", "transform", "x0", "y0", "x1", "y1", "path_default", "k", "transform_default", "x", "y", "warn", "identity", "s", "scaleProjection", "albersUsa_default", "conicProjection", "albers_default", "azimuthalEqualArea_default", "azimuthalEquidistant_default", "conicConformal_default", "conicEqualArea_default", "conicEquidistant_default", "equalEarth_default", "equirectangular_default", "gnomonic_default", "reflectY", "mercator_default", "orthographic_default", "stereographic_default", "transverseMercator_default", "x2", "y2", "clipRectangle", "kx", "ky", "rotate", "precision", "type", "aspectRatio", "parallels", "constant", "stream", "project", "cx", "cy", "values", "n", "X", "Y", "i", "hasProjection", "projectionAspectRatio", "getGeometryChannels", "channel", "X", "Y", "x", "y", "sink", "object", "stream_default", "categoricalSchemes", "Accent_default", "category10_default", "Dark2_default", "Paired_default", "Pastel1_default", "Pastel2_default", "Set1_default", "Set2_default", "Set3_default", "Tableau10_default", "isCategoricalScheme", "scheme", "ordinalSchemes", "scheme11", "BrBG_default", "PRGn_default", "PiYG_default", "PuOr_default", "RdBu_default", "RdGy_default", "RdYlBu_default", "RdYlGn_default", "Spectral_default", "scheme11r", "scheme9", "Blues_default", "Greens_default", "Greys_default", "Oranges_default", "Purples_default", "Reds_default", "schemei", "turbo_default", "viridis_default", "magma", "inferno", "plasma", "cividis_default", "cubehelix_default", "warm", "cool", "BuGn_default", "BuPu_default", "GnBu_default", "OrRd_default", "PuBu_default", "PuBuGn_default", "PuRd_default", "RdPu_default", "YlGn_default", "YlGnBu_default", "YlOrBr_default", "YlOrRd_default", "schemeicyclical", "rainbow_default", "sinebow_default", "interpolate", "quantize_default", "t", "n", "ordinalScheme", "s", "ordinalRange", "length", "maybeBooleanRange", "domain", "range", "f", "value", "quantitativeSchemes", "quantitativeScheme", "divergingSchemes", "isDivergingScheme", "flip", "i", "t", "unit", "interpolators", "number_default", "rgb_default", "hsl_default", "hcl_default", "lab", "maybeInterpolator", "interpolate", "createScaleQ", "key", "scale", "channels", "type", "nice", "clamp", "zero", "domain", "inferAutoDomain", "unknown", "round", "scheme", "interval", "range", "registry", "radius", "inferRadialRange", "length", "inferLengthRange", "opacity", "color", "quantitativeScheme", "round_default", "reverse", "maybeRangeInterval", "n", "arrayify", "m", "piecewise", "_", "constant", "interpolatePiecewise", "min", "max", "extent", "slice", "orderof", "maybeNice", "maybeNiceInterval", "createScaleLinear", "options", "linear", "createScaleSqrt", "createScalePow", "exponent", "pow", "createScaleLog", "base", "inferLogDomain", "log", "createScaleSymlog", "symlog", "createScaleQuantile", "quantiles", "inferQuantileDomain", "quantize_default", "ordinalRange", "quantile", "createScaleThreshold", "createScaleQuantize", "thresholds", "ticks", "x", "sign", "isOrdered", "threshold", "d", "s", "descending", "createScaleIdentity", "identity", "inferDomain", "f", "finite", "value", "inferZeroDomain", "hint", "h25", "positive", "k", "r", "h50", "median", "v", "negative", "j", "createScaleD", "key", "scale", "transform", "channels", "type", "nice", "clamp", "domain", "inferDomain", "unknown", "pivot", "scheme", "range", "symmetric", "interpolate", "registry", "color", "rgb_default", "quantitativeScheme", "number_default", "reverse", "arrayify", "min", "max", "warn", "descending", "maybeInterpolator", "interpolatePiecewise", "piecewise", "flip", "mid", "mindelta", "maxdelta", "createScaleDiverging", "options", "diverging", "transformIdentity", "createScaleDivergingSqrt", "createScaleDivergingPow", "exponent", "divergingPow", "transformPow", "createScaleDivergingLog", "base", "negative", "positive", "divergingLog", "transformLog", "createScaleDivergingSymlog", "constant", "divergingSymlog", "transformSymlog", "x", "transformSqrt", "createScaleT", "key", "scale", "channels", "options", "createScaleQ", "createScaleTime", "time", "createScaleUtc", "utcTime", "ordinalImplicit", "createScaleO", "key", "scale", "channels", "type", "interval", "domain", "range", "reverse", "hint", "maybeRangeInterval", "inferDomain", "createScaleOrdinal", "scheme", "unknown", "options", "registry", "symbol", "inferSymbolHint", "inferSymbolRange", "map", "maybeSymbol", "color", "maybeBooleanRange", "interpolate", "quantitativeScheme", "t0", "d", "n", "quantize_default", "t", "ordinalScheme", "implicit", "ordinal", "createScalePoint", "align", "padding", "maybeRound", "point", "createScaleBand", "paddingInner", "paddingOuter", "band", "round", "values", "InternSet", "value", "v", "min", "max", "extent", "position", "sort", "ascendingDefined", "inferHint", "candidate", "isNoneish", "symbolsStroke", "symbolsFill", "createScales", "channelsByScale", "globalLabel", "globalInset", "globalInsetTop", "globalInsetRight", "globalInsetBottom", "globalInsetLeft", "round", "nice", "clamp", "zero", "align", "padding", "projection", "facetLabel", "options", "scales", "key", "channels", "scaleOptions", "scale", "createScale", "registry", "position", "label", "percent", "transform", "inset", "insetTop", "insetRight", "insetBottom", "insetLeft", "inferScaleLabel", "createScaleFunctions", "name", "type", "interval", "autoScaleRange", "dimensions", "x", "y", "fx", "fy", "superdimensions", "outerDimensions", "autoScaleRangeX", "autoScaleRangeY", "subdimensions", "innerDimensions", "l", "isOrdinalScale", "marginTop", "marginRight", "marginBottom", "marginLeft", "width", "height", "facetMarginTop", "facetMarginRight", "facetMarginBottom", "facetMarginLeft", "left", "right", "piecewiseRange", "autoScaleRound", "top", "bottom", "isBandScale", "roundError", "n", "start", "stop", "paddingInner", "paddingOuter", "m", "step", "length", "isThresholdScale", "end", "_", "createScale", "key", "channels", "options", "type", "inferScaleType", "isOrdinalScale", "values", "value", "isTemporal", "warn", "formatScaleType", "isTemporalString", "isNumericString", "coerceType", "coerceNumbers", "registry", "position", "symbol", "coerceSymbols", "coerceDates", "createScaleDiverging", "createScaleDivergingSqrt", "createScaleDivergingPow", "createScaleDivergingLog", "createScaleDivergingSymlog", "ordinalImplicit", "createScaleOrdinal", "createScaleLinear", "createScaleSqrt", "createScaleThreshold", "createScaleQuantile", "createScaleQuantize", "createScalePow", "createScaleLog", "createScaleSymlog", "createScaleUtc", "createScaleTime", "createScalePoint", "createScaleBand", "createScaleIdentity", "typeProjection", "domain", "range", "scheme", "pivot", "projection", "t", "kind", "radius", "opacity", "length", "asOrdinalType", "isOrdinal", "color", "isDivergingScheme", "isCategoricalScheme", "isTemporalScale", "isThresholdScale", "isBandScale", "isCollapsed", "scale", "domain", "value", "i", "n", "coerceType", "channels", "options", "coerceValues", "c", "coerceSymbols", "values", "map", "maybeSymbol", "exposeScales", "scaleDescriptors", "key", "registry", "exposeScale", "scale", "type", "domain", "range", "interpolate", "interval", "transform", "percent", "pivot", "d", "unknown", "slice", "t", "memoize1", "compute", "cacheValue", "cacheKeys", "keys", "k", "numberFormat", "memoize1", "locale", "monthFormat", "month", "weekdayFormat", "weekday", "formatNumber", "format", "i", "formatIsoDate", "date", "format", "formatAuto", "locale", "number", "formatNumber", "v", "string", "formatDefault", "offset", "nextClipId", "getClipId", "styles", "mark", "title", "href", "variaLabel", "ariaDescription", "ariaHidden", "target", "fill", "fillOpacity", "stroke", "strokeWidth", "strokeOpacity", "strokeLinejoin", "strokeLinecap", "strokeMiterlimit", "strokeDasharray", "strokeDashoffset", "opacity", "mixBlendMode", "imageFilter", "paintOrder", "pointerEvents", "shapeRendering", "channels", "cariaLabel", "defaultFill", "defaultFillOpacity", "defaultStroke", "defaultStrokeOpacity", "defaultStrokeWidth", "defaultStrokeLinecap", "defaultStrokeLinejoin", "defaultStrokeMiterlimit", "defaultPaintOrder", "isNoneish", "vfill", "cfill", "maybeColorChannel", "vfillOpacity", "cfillOpacity", "maybeNumberChannel", "vstroke", "cstroke", "vstrokeOpacity", "cstrokeOpacity", "vopacity", "copacity", "isNone", "isRound", "vstrokeWidth", "cstrokeWidth", "impliedString", "impliedNumber", "string", "applyTitle", "selection", "L", "i", "nonempty", "applyText", "applyText", "selection", "T", "i", "formatDefault", "applyChannelStyles", "selection", "target", "tip", "AL", "T", "F", "FO", "S", "SO", "SW", "O", "H", "applyAttr", "i", "applyHref", "applyTitle", "maybeClip", "clip", "maybeKeyword", "applyClip", "selection", "mark", "dimensions", "context", "clipUrl", "width", "height", "marginLeft", "marginRight", "marginTop", "marginBottom", "id", "getClipId", "create", "g", "projection", "path_default", "applyAttr", "applyIndirectStyles", "pointerEvents", "applyDirectStyles", "applyStyle", "applyHref", "href", "target", "i", "h", "a", "namespaces_default", "name", "value", "applyTransform", "x", "y", "tx", "offset", "ty", "impliedString", "impliedValue", "string", "impliedNumber", "number", "validClassName", "maybeClassName", "applyInlineStyles", "style", "element", "applyFrameAnchor", "frameAnchor", "createDimensions", "scales", "marks", "options", "marginTopDefault", "offset", "marginRightDefault", "marginBottomDefault", "marginLeftDefault", "marginTop", "marginRight", "marginBottom", "marginLeft", "margin", "width", "height", "autoHeight", "dimensions", "facetMargin", "facetMarginTop", "facetMarginRight", "facetMarginBottom", "facetMarginLeft", "x", "y", "fy", "fx", "projection", "aspectRatio", "nfy", "ar", "projectionAspectRatio", "nfx", "far", "lar", "ny", "isOrdinalScale", "ratio", "aspectRatioLength", "fxb", "fyb", "w", "k", "scale", "type", "domain", "transform", "exponent", "min", "max", "extent", "createFacets", "channelsByScale", "options", "fx", "fy", "createScales", "fxDomain", "fyDomain", "cross", "x", "y", "i", "recreateFacets", "facets", "X", "Y", "facetIndex", "f", "a", "b", "facetGroups", "data", "I", "range", "FX", "FY", "rollup", "G", "facetTranslator", "marginTop", "marginLeft", "facetExclude", "index", "ex", "e", "sum", "d", "n", "j", "facetAnchors", "facetAnchorTop", "facetAnchorRight", "facetAnchorBottom", "facetAnchorLeft", "and", "facetAnchorTopEmpty", "facetAnchorRightEmpty", "facetAnchorBottomEmpty", "facetAnchorLeftEmpty", "facetAnchorEmpty", "maybeFacetAnchor", "facetAnchor", "anchor", "indexCache", "V", "InternMap", "map", "v", "facetIndexOf", "facetFind", "keyof", "facetEmpty", "empty", "channels", "facetFilter", "groups", "Mark", "data", "channels", "options", "defaults", "facet", "facetAnchor", "fx", "fy", "sort", "dx", "dy", "margin", "marginTop", "marginRight", "marginBottom", "marginLeft", "clip", "extraChannels", "tip", "render", "isDomainSort", "initializer", "basic", "keyword", "singleton", "maybeFacetAnchor", "maybeNamed", "maybeChannels", "styles", "name", "channel", "isOptions", "value", "scale", "optional", "maybeClip", "maybeTip", "composeRender", "facets", "facetChannels", "plotOptions", "arrayify", "range", "originalFacets", "createChannels", "channelDomain", "index", "values", "filter", "defined", "i", "context", "cx", "cy", "project", "scales", "valueObject", "marks", "r1", "r2", "s", "v", "d", "c", "next", "maybeValue", "maybeKeyword", "withTip", "states", "pointerK", "kx", "ky", "x", "y", "px", "py", "maxRadius", "channels", "render", "options", "composeRender", "index", "scales", "values", "dimensions", "context", "next", "svg", "data", "state", "renderIndex", "fx", "fy", "tx", "ty", "faceted", "facetState", "facetStates", "cx", "cy", "applyFrameAnchor", "PX", "PY", "i", "anchorX", "anchorY", "g", "s", "f", "update", "ii", "ri", "r", "I", "p", "ft", "mt", "pointermove", "event", "xp", "yp", "pointer_default", "j", "dx", "dy", "rj", "pointerdown", "pointerleave", "pointer", "pointerX", "pointerY", "X1", "X2", "X", "Y1", "Y2", "Y", "inferFontVariant", "scale", "isOrdinalScale", "legendRamp", "color", "options", "label", "tickSize", "width", "height", "marginTop", "marginRight", "marginBottom", "marginLeft", "style", "ticks", "tickFormat", "fontVariant", "inferFontVariant", "round", "opacity", "className", "context", "createContext", "maybeClassName", "maybeNumberChannel", "svg", "create", "applyInlineStyles", "tickAdjust", "g", "x", "applyRange", "range", "type", "domain", "interpolate", "scale", "pivot", "interpolator", "piecewise", "interpolatePiecewise", "quantize_default", "number_default", "n", "canvas", "context2", "i", "j", "thresholds", "thresholdFormat", "d", "format", "linear", "map", "_", "band", "axisBottom", "impliedString", "radians", "markers", "mark", "marker", "markerStart", "markerMid", "markerEnd", "maybeMarker", "markerCircleFill", "markerArrow", "markerDot", "markerCircleStroke", "orient", "color", "context", "create", "nextMarkerId", "applyMarkers", "path", "S", "applyMarkersColor", "i", "applyMarkersColor", "path", "markerStart", "markerMid", "markerEnd", "stroke", "strokeof", "context", "iriByMarkerColor", "applyMarker", "marker", "i", "color", "iriByColor", "iri", "node", "id", "nextMarkerId", "maybeInsetX", "inset", "insetLeft", "insetRight", "options", "maybeInset", "maybeInsetY", "insetTop", "insetBottom", "inset1", "inset2", "offset", "maybeIntervalValue", "value", "interval", "maybeValue", "maybeInterval", "maybeIntervalK", "k", "maybeInsetK", "options", "trivial", "v", "v1", "v2", "label", "labelof", "V", "kv", "data", "valueof", "D1", "V1", "transform", "map", "maybeIntervalMidK", "V2", "isTemporal", "maybeIntervalX", "options", "maybeIntervalK", "maybeInsetX", "maybeIntervalY", "maybeInsetY", "maybeIntervalMidX", "maybeIntervalMidK", "maybeIntervalMidY", "defaults", "RuleX", "Mark", "data", "options", "x", "y1", "y2", "inset", "insetTop", "insetBottom", "withTip", "number", "markers", "index", "scales", "channels", "dimensions", "context", "y", "X", "Y1", "Y2", "width", "height", "marginTop", "marginRight", "marginLeft", "marginBottom", "create", "applyIndirectStyles", "applyTransform", "offset", "g", "applyDirectStyles", "i", "isCollapsed", "applyChannelStyles", "applyMarkers", "RuleY", "x1", "x2", "insetRight", "insetLeft", "Y", "X1", "X2", "ruleX", "identity", "rest", "maybeIntervalY", "maybeOptionalZero", "ruleY", "maybeIntervalX", "template", "strings", "parts", "j", "copy", "i", "s", "defaults", "softHyphen", "Text", "Mark", "data", "options", "x", "y", "text", "isIterable", "isTextual", "identity", "indexOf", "frameAnchor", "textAnchor", "lineAnchor", "lineHeight", "lineWidth", "textOverflow", "monospace", "fontFamily", "fontSize", "fontStyle", "fontVariant", "fontWeight", "rotate", "vrotate", "crotate", "maybeNumberChannel", "vfontSize", "cfontSize", "maybeFontSizeChannel", "numberChannel", "nonempty", "impliedString", "keyword", "maybeTextOverflow", "string", "maybeFrameAnchor", "splitter", "clipper", "index", "scales", "channels", "dimensions", "context", "X", "Y", "R", "T", "TL", "FS", "cx", "cy", "applyFrameAnchor", "create", "applyIndirectStyles", "applyIndirectTextStyles", "applyTransform", "g", "applyDirectStyles", "applyMultilineText", "template", "i", "applyAttr", "applyChannelStyles", "selection", "mark", "splitLines", "clipLine", "lines", "formatDefault", "n", "m", "tspan", "namespaces_default", "title", "maybeTuple", "textX", "maybeIntervalMidY", "textY", "maybeIntervalMidX", "inferFontVariant", "isNumeric", "isTemporal", "fontSizes", "lineWrap", "input", "maxWidth", "widthof", "lineStart", "lineEnd", "wordStart", "wordEnd", "required", "lineBreaks", "j", "k", "defaultWidthMap", "defaultWidth", "start", "end", "sum", "readCharacter", "isPictographic", "monospaceWidth", "clipStart", "clipEnd", "ellipsis", "clipMiddle", "cut", "width", "inset", "I", "w", "l", "e", "ei", "reCombiner", "rePictographic", "isSurrogatePair", "isCombiner", "isZeroWidthJoiner", "isAscii", "hi", "lo", "defaults", "defaultRadius", "wingRatio", "shapeArrow", "context", "l", "r", "wing", "shapeSpike", "shapes", "isShapeObject", "value", "maybeShape", "shape", "Vector", "Mark", "data", "options", "x", "y", "length", "rotate", "anchor", "frameAnchor", "vl", "cl", "maybeNumberChannel", "vr", "cr", "keyword", "maybeFrameAnchor", "index", "scales", "channels", "dimensions", "X", "Y", "L", "A", "cx", "cy", "applyFrameAnchor", "create", "applyIndirectStyles", "applyTransform", "g", "applyDirectStyles", "template", "i", "p", "pathRound", "applyChannelStyles", "vectorX", "data", "options", "x", "identity", "rest", "Vector", "vectorY", "y", "maybeData", "data", "options", "isIterable", "maybeAnchor", "anchor", "anchors", "keyword", "anchorY", "anchorFy", "anchorX", "anchorFx", "axisY", "axisKy", "axisFy", "axisX", "axisKx", "axisFx", "k", "color", "opacity", "stroke", "strokeOpacity", "strokeWidth", "fill", "fillOpacity", "textAnchor", "textStroke", "textStrokeOpacity", "textStrokeWidth", "tickSize", "tickPadding", "tickRotate", "x", "margin", "marginTop", "marginRight", "marginBottom", "marginLeft", "label", "labelAnchor", "labelArrow", "labelOffset", "number", "maybeLabelArrow", "marks", "isNoneish", "axisTickKy", "axisTextKy", "text", "labelOptions", "facets", "channels", "scales", "dimensions", "scale", "cla", "clo", "formatAxisLabel", "y", "axisTickKx", "axisTextKx", "strokeLinecap", "strokeLinejoin", "facetAnchor", "frameAnchor", "inset", "insetLeft", "insetRight", "dx", "axisMark", "vectorY", "offset", "shapeTickLeft", "shapeTickRight", "insetTop", "insetBottom", "dy", "vectorX", "shapeTickBottom", "shapeTickTop", "radians", "tickFormat", "lineAnchor", "fontVariant", "textY", "ticks", "inferFontVariant", "inferTextChannel", "textX", "gridY", "gridKy", "gridFy", "gridX", "gridKx", "gridFx", "x1", "x2", "ruleY", "gridDefaults", "y1", "y2", "ruleX", "fontFamily", "fontSize", "fontStyle", "fontWeight", "monospace", "pointerEvents", "shapeRendering", "initializer", "maybeColorChannel", "maybeNumberChannel", "mark", "ariaLabel", "initialize", "axisInitializer", "_channels", "context", "initializeFacets", "tickSpacing", "interval", "isTemporalScale", "arrayify", "maybeRangeInterval", "min", "max", "extent", "range", "identity", "initializedChannels", "name", "channel", "valueof", "basicInitializer", "m", "inferTickFormat", "formatTimeTicks", "isUtcYear", "utcFormat", "isTimeYear", "timeFormat", "formatDefault", "isTemporal", "format", "constant", "l", "inferScaleOrder", "orderof", "isTemporalish", "order", "maybeScale", "scale", "key", "s", "legendSwatches", "color", "opacity", "options", "isOrdinalScale", "isThresholdScale", "legendItems", "selection", "width", "height", "maybeNumberChannel", "legendSymbols", "symbol", "fill", "fillOpacity", "stroke", "isNoneish", "strokeOpacity", "strokeWidth", "r", "vf", "cf", "maybeColorChannel", "vs", "cs", "sf", "ss", "size", "d", "p", "pathRound", "swatch", "columns", "tickFormat", "fontVariant", "inferFontVariant", "swatchSize", "swatchWidth", "swatchHeight", "marginLeft", "className", "style", "context", "createContext", "maybeClassName", "inferTickFormat", "swatches", "create", "extraStyle", "item", "div", "impliedString", "applyInlineStyles", "legendRegistry", "legendSymbols", "legendColor", "legendOpacity", "exposeLegends", "scales", "context", "defaults", "key", "options", "legendRegistry", "legendOptions", "className", "label", "ticks", "tickFormat", "inherit", "legendColor", "color", "legend", "legendSwatches", "legendRamp", "legendOpacity", "type", "interpolate", "scale", "rgb", "interpolateOpacity", "r", "g", "b", "t", "createLegends", "legends", "value", "o", "defaults", "lineDefaults", "Frame", "Mark", "options", "anchor", "inset", "insetTop", "insetRight", "insetBottom", "insetLeft", "rx", "ry", "singleton", "maybeKeyword", "number", "index", "scales", "channels", "dimensions", "context", "marginTop", "marginRight", "marginBottom", "marginLeft", "width", "height", "x1", "x2", "y1", "y2", "create", "applyIndirectStyles", "applyDirectStyles", "applyChannelStyles", "applyTransform", "line", "rect", "frame", "defaults", "ignoreChannels", "Tip", "Mark", "data", "options", "isIterable", "isTextual", "identity", "x", "y", "x1", "x2", "y1", "y2", "anchor", "monospace", "fontFamily", "fontSize", "fontStyle", "fontVariant", "fontWeight", "lineHeight", "lineWidth", "frameAnchor", "textAnchor", "textOverflow", "textPadding", "title", "pointerSize", "pathFilter", "maybeAnchor", "maybeFrameAnchor", "impliedString", "string", "maybeTextOverflow", "number", "key", "splitter", "clipper", "index", "scales", "values", "dimensions", "context", "mark", "fx", "fy", "svg", "document", "r", "m", "marginTop", "marginLeft", "sources", "getSources", "X1", "Y1", "X2", "Y2", "X", "Y", "ox", "oy", "cx", "cy", "applyFrameAnchor", "px", "anchorX", "py", "anchorY", "widthof", "monospaceWidth", "defaultWidth", "ee", "ellipsis", "formatFx", "inferTickFormat", "formatFy", "format", "i", "text", "line", "formatDefault", "channel", "value", "defined", "formatLabel", "formatPair", "scale", "g", "create", "applyIndirectStyles", "applyIndirectTextStyles", "applyTransform", "applyDirectStyles", "that", "select_default", "names", "name", "renderLine", "selection", "color", "opacity", "swatch", "w", "j", "cut", "k", "postrender", "width", "height", "tx", "h", "a", "fitLeft", "fitRight", "fitTop", "fitBottom", "ax", "ay", "path", "getPath", "t", "getLineOffset", "getTextTranslate", "tip", "maybeTuple", "length", "channels", "source", "getSource", "c1", "c2", "c", "defaultLabel", "plot", "options", "facet", "style", "caption", "ariaLabel", "ariaDescription", "className", "maybeClassName", "marks", "flatMarks", "inferTips", "topFacetState", "maybeTopFacet", "facetStateByMark", "mark", "facetState", "maybeMarkFacet", "channelsByScale", "addScaleChannels", "axes", "inferAxes", "facets", "createFacets", "topFacetsIndex", "facetFilter", "nonEmpty", "facetsIndex", "index", "i", "f", "facetExclude", "key", "registry", "isScaleOptions", "stateByMark", "facetChannels", "data", "channels", "applyScaleTransforms", "scaleDescriptors", "createScales", "scales", "createScaleFunctions", "dimensions", "createDimensions", "autoScaleRange", "fx", "fy", "subdimensions", "innerDimensions", "superdimensions", "actualDimensions", "context", "createContext", "document", "svg", "creator_default", "figure", "createProjection", "facetGroups", "state", "value", "newByScale", "update", "inferChannelScales", "channel", "scale", "position", "applyScaleTransform", "newChannelsByScale", "newScaleDescriptors", "inheritScaleLabels", "newScales", "facetDomains", "facetTranslate", "recreateFacets", "facetTranslator", "width", "height", "select_default", "applyInlineStyles", "values", "indexes", "node", "g", "faceted", "subarray", "name", "legends", "createLegends", "legend", "figcaption", "exposeScales", "exposeLegends", "w", "consumeWarnings", "plotThis", "Mark", "markify", "Render", "render", "t", "type", "percent", "interval", "transform", "x", "maybeIntervalTransform", "map", "inferChannelScale", "filter", "yes", "hasProjection", "gx", "gy", "y", "getGeometryChannels", "addScaleChannel", "scaleChannels", "arrayify", "createChannel", "groups", "warn", "derive", "initializer", "tips", "pointerX", "pointerY", "pointer", "tip", "projection", "axis", "grid", "facetAxis", "facetGrid", "xAxis", "xGrid", "yAxis", "yGrid", "fxAxis", "fxGrid", "fyAxis", "fyGrid", "hasPositionChannel", "hasAxis", "maybeGrid", "gridFy", "maybeAxis", "axisFy", "gridFx", "axisFx", "gridY", "axisY", "gridX", "axisX", "axisType", "primary", "secondary", "defaults", "both", "isBoth", "axisOptions", "line", "isNone", "frame", "lineOptions", "gridType", "gridOptions", "anchor", "ticks", "tickSize", "tickSpacing", "tickPadding", "tickFormat", "tickRotate", "fontVariant", "label", "labelAnchor", "labelArrow", "labelOffset", "stroke", "isColor", "isGridTicks", "isIterable", "k", "prefix", "m", "newScale", "marginTop", "marginRight", "marginBottom", "marginLeft", "outerDimensions", "fxr", "outerRange", "fyr", "domain", "x1", "x2", "binX", "outputs", "options", "mergeOptions", "x", "y", "binn", "maybeBinValue", "identity", "maybeInsetX", "binn", "bx", "by", "gx", "gy", "reduceData", "reduceIdentity", "filter", "reduceCount", "sort", "reverse", "outputs", "inputs", "maybeBin", "maybeBinOutputs", "maybeBinReduce", "identity", "maybeBinOutput", "maybeBinEvaluator", "hasOutput", "BX1", "setBX1", "maybeColumn", "BX2", "setBX2", "BY1", "setBY1", "BY2", "setBY2", "k", "gk", "GK", "setGK", "x", "y", "z", "fill", "stroke", "x1", "x2", "y1", "y2", "domain", "cumulative", "thresholds", "interval", "options", "GZ", "setGZ", "vfill", "maybeColorChannel", "vstroke", "GF", "setGF", "GS", "setGS", "basic", "data", "facets", "plotOptions", "K", "maybeApplyInterval", "valueof", "Z", "F", "S", "G", "maybeSubgroup", "groupFacets", "groupData", "bin", "bing", "i", "o", "facet", "groupFacet", "f", "I", "maybeGroup", "g", "b", "extent", "maybeSort", "mid", "name", "output", "mergeOptions", "maybeBinValue", "value", "defaultValue", "maybeValue", "maybeThresholds", "maybeBin", "options", "value", "cumulative", "domain", "extent", "thresholds", "bin", "data", "V", "valueof", "T", "isTemporal", "isTimeThresholds", "map", "coerceDate", "min", "max", "t", "isInterval", "utcTickInterval", "coerceNumbers", "step", "tickIncrement", "r0", "r1", "n", "i", "ticks", "E", "bin1cn", "bin1cp", "bin1", "labelof", "maybeThresholds", "interval", "defaultThresholds", "thresholdAuto", "maybeRangeInterval", "thresholdFreedmanDiaconis", "thresholdScott", "thresholdSturges", "maybeUtcInterval", "maybeBinOutputs", "outputs", "inputs", "maybeOutputs", "maybeBinOutput", "name", "reduce", "maybeOutput", "maybeBinEvaluator", "maybeEvaluator", "maybeBinReduce", "maybeReduce", "maybeBinReduceFallback", "reduceX", "reduceX1", "reduceX2", "reduceY", "reduceY1", "reduceY2", "values", "isTimeInterval", "isIterable", "bing", "EX", "EY", "I", "X", "ix", "x1", "x2", "Y", "iy", "y1", "y2", "B", "bisect_default", "C", "b", "j", "mid1", "m", "maybeIdentityY", "options", "hasY", "identity", "stackY", "stackOptions", "options", "mergeOptions", "x1", "x", "y", "rest", "transform", "X", "y1", "y2", "stack", "mid", "maybeStackY", "y", "y1", "y2", "options", "withTip", "stackY", "maybeZero", "mergeOptions", "offset", "order", "reverse", "rest", "lengthy", "stack", "x", "one", "kx", "ky", "z", "maybeZ", "X", "setX", "maybeColumn", "Y1", "setY1", "column", "Y2", "setY2", "maybeOffset", "maybeOrder", "basic", "data", "facets", "plotOptions", "maybeApplyInterval", "valueof", "Y", "Z", "compare", "n", "facetstacks", "facet", "stacks", "group", "i", "yn", "yp", "offsetExpand", "offsetCenter", "offsetWiggle", "extent", "min", "max", "m", "offsetZero", "offsetCenterFacets", "prev", "InternMap", "j", "Fi", "Df", "value", "diff", "Cf1", "cumsum", "s1", "sum", "d", "I", "m0", "p", "orderInsideOut", "ascendingDefined", "negate", "descendingDefined", "orderY", "orderZ", "orderSum", "orderAppearance", "orderAccessor", "field", "orderComparator", "orderGiven", "orderZDomain", "groupSort", "range", "greatest", "K", "sums", "rollup", "Kp", "Kn", "k", "f", "O", "domain", "map", "AbstractBar", "Mark", "data", "channels", "options", "defaults", "inset", "insetTop", "insetRight", "insetBottom", "insetLeft", "rx", "ry", "number", "impliedString", "index", "scales", "dimensions", "context", "create", "applyIndirectStyles", "g", "applyDirectStyles", "applyAttr", "applyChannelStyles", "X", "marginLeft", "Y", "marginTop", "x", "marginRight", "width", "bandwidth", "y", "marginBottom", "height", "BarY", "AbstractBar", "data", "options", "x", "y1", "y2", "defaults", "selection", "mark", "y", "applyTransform", "Y1", "Y2", "marginTop", "insetTop", "isCollapsed", "i", "marginBottom", "height", "insetBottom", "barY", "data", "options", "hasXY", "indexOf", "identity", "BarY", "maybeStackY", "maybeIntervalY", "maybeIdentityY", "program", "counter", "partition", "histogram", "Data", "Name", "plot", "d", "barY", "frame", "n", "fixKey", "k", "keys", "union", "index", "key", "i", "fx", "fy", "binX", "text", "axisX"]
}