{"version":3,"file":"vega.min.js","sources":["../../vega-util/build/vega-util.module.js","../../../node_modules/d3-dsv/src/dsv.js","../../../node_modules/topojson-client/src/identity.js","../../../node_modules/topojson-client/src/feature.js","../../../node_modules/topojson-client/src/transform.js","../../../node_modules/topojson-client/src/reverse.js","../../../node_modules/topojson-client/src/stitch.js","../../../node_modules/topojson-client/src/mesh.js","../../../node_modules/d3-array/src/ascending.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/deviation.js","../../../node_modules/d3-array/src/variance.js","../../../node_modules/d3-array/src/fsum.js","../../../node_modules/internmap/src/index.js","../../../node_modules/d3-array/src/sort.js","../../../node_modules/d3-array/src/ticks.js","../../../node_modules/d3-array/src/max.js","../../../node_modules/d3-array/src/min.js","../../../node_modules/d3-array/src/quickselect.js","../../../node_modules/d3-array/src/quantile.js","../../../node_modules/d3-array/src/median.js","../../../node_modules/d3-array/src/merge.js","../../../node_modules/d3-array/src/range.js","../../../node_modules/d3-array/src/sum.js","../../../node_modules/d3-array/src/intersection.js","../../../node_modules/d3-format/src/formatDecimal.js","../../../node_modules/d3-format/src/exponent.js","../../../node_modules/d3-format/src/formatSpecifier.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/formatGroup.js","../../../node_modules/d3-format/src/formatNumerals.js","../../../node_modules/d3-format/src/formatTrim.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-time/src/interval.js","../../../node_modules/d3-time/src/millisecond.js","../../../node_modules/d3-time/src/duration.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/utcMinute.js","../../../node_modules/d3-time/src/utcHour.js","../../../node_modules/d3-time/src/utcDay.js","../../../node_modules/d3-time/src/utcWeek.js","../../../node_modules/d3-time/src/utcMonth.js","../../../node_modules/d3-time/src/utcYear.js","../../../node_modules/d3-time/src/ticks.js","../../vega-time/build/vega-time.module.js","../../../node_modules/d3-time-format/src/locale.js","../../../node_modules/d3-time-format/src/defaultLocale.js","../../vega-format/build/vega-format.module.js","../../vega-loader/build/vega-loader.browser.module.js","../../vega-dataflow/build/vega-dataflow.module.js","../../vega-statistics/build/vega-statistics.module.js","../../vega-transforms/build/vega-transforms.module.js","../../../node_modules/d3-array/src/mean.js","../../../node_modules/d3-path/src/path.js","../../../node_modules/d3-shape/src/constant.js","../../../node_modules/d3-shape/src/math.js","../../../node_modules/d3-shape/src/arc.js","../../../node_modules/d3-shape/src/array.js","../../../node_modules/d3-shape/src/curve/linear.js","../../../node_modules/d3-shape/src/point.js","../../../node_modules/d3-shape/src/line.js","../../../node_modules/d3-shape/src/area.js","../../../node_modules/d3-shape/src/symbol/circle.js","../../../node_modules/d3-shape/src/noop.js","../../../node_modules/d3-shape/src/curve/basis.js","../../../node_modules/d3-shape/src/curve/basisClosed.js","../../../node_modules/d3-shape/src/curve/basisOpen.js","../../../node_modules/d3-shape/src/curve/bundle.js","../../../node_modules/d3-shape/src/curve/cardinal.js","../../../node_modules/d3-shape/src/curve/cardinalClosed.js","../../../node_modules/d3-shape/src/curve/cardinalOpen.js","../../../node_modules/d3-shape/src/curve/catmullRom.js","../../../node_modules/d3-shape/src/curve/catmullRomClosed.js","../../../node_modules/d3-shape/src/curve/catmullRomOpen.js","../../../node_modules/d3-shape/src/curve/linearClosed.js","../../../node_modules/d3-shape/src/curve/monotone.js","../../../node_modules/d3-shape/src/curve/natural.js","../../../node_modules/d3-shape/src/curve/step.js","../../vega-canvas/build/vega-canvas.browser.module.js","../../../node_modules/d3-scale/src/init.js","../../../node_modules/d3-scale/src/ordinal.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/zoom.js","../../../node_modules/d3-interpolate/src/hsl.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/discrete.js","../../../node_modules/d3-interpolate/src/hue.js","../../../node_modules/d3-interpolate/src/lab.js","../../../node_modules/d3-interpolate/src/quantize.js","../../../node_modules/d3-scale/src/number.js","../../../node_modules/d3-scale/src/continuous.js","../../../node_modules/d3-scale/src/constant.js","../../../node_modules/d3-scale/src/tickFormat.js","../../../node_modules/d3-scale/src/linear.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/time.js","../../../node_modules/d3-scale/src/sequential.js","../../../node_modules/d3-scale/src/diverging.js","../../vega-scale/build/vega-scale.module.js","../../../node_modules/d3-scale/src/identity.js","../../../node_modules/d3-scale/src/utcTime.js","../../../node_modules/d3-scale/src/quantile.js","../../../node_modules/d3-scale/src/quantize.js","../../../node_modules/d3-scale/src/threshold.js","../../vega-scenegraph/build/vega-scenegraph.module.js","../../../node_modules/d3-shape/src/symbol.js","../../vega-view-transforms/build/vega-view-transforms.module.js","../../vega-encode/build/vega-encode.module.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/area.js","../../../node_modules/d3-geo/src/bounds.js","../../../node_modules/d3-geo/src/cartesian.js","../../../node_modules/d3-geo/src/centroid.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/rectangle.js","../../../node_modules/d3-geo/src/clip/line.js","../../../node_modules/d3-geo/src/graticule.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/conicEqualArea.js","../../../node_modules/d3-geo/src/projection/cylindricalEqualArea.js","../../../node_modules/d3-geo/src/projection/albers.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/naturalEarth1.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-geo-projection/src/math.js","../../../node_modules/d3-geo-projection/src/mollweide.js","../../vega-projection/build/vega-projection.module.js","../../../node_modules/d3-geo/src/projection/albersUsa.js","../../../node_modules/d3-geo/src/projection/identity.js","../../vega-geo/build/vega-geo.module.js","../../../node_modules/d3-quadtree/src/add.js","../../../node_modules/d3-quadtree/src/quad.js","../../../node_modules/d3-quadtree/src/x.js","../../../node_modules/d3-quadtree/src/y.js","../../../node_modules/d3-quadtree/src/quadtree.js","../../../node_modules/d3-force/src/constant.js","../../../node_modules/d3-force/src/jiggle.js","../../../node_modules/d3-force/src/collide.js","../../../node_modules/d3-force/src/link.js","../../../node_modules/d3-quadtree/src/cover.js","../../../node_modules/d3-quadtree/src/data.js","../../../node_modules/d3-quadtree/src/extent.js","../../../node_modules/d3-quadtree/src/find.js","../../../node_modules/d3-quadtree/src/remove.js","../../../node_modules/d3-quadtree/src/root.js","../../../node_modules/d3-quadtree/src/size.js","../../../node_modules/d3-quadtree/src/visit.js","../../../node_modules/d3-quadtree/src/visitAfter.js","../../../node_modules/d3-dispatch/src/dispatch.js","../../../node_modules/d3-timer/src/timer.js","../../../node_modules/d3-force/src/lcg.js","../../../node_modules/d3-force/src/simulation.js","../../vega-force/build/vega-force.module.js","../../../node_modules/d3-force/src/center.js","../../../node_modules/d3-force/src/manyBody.js","../../../node_modules/d3-force/src/x.js","../../../node_modules/d3-force/src/y.js","../../../node_modules/d3-hierarchy/src/cluster.js","../../../node_modules/d3-hierarchy/src/hierarchy/count.js","../../../node_modules/d3-hierarchy/src/hierarchy/iterator.js","../../../node_modules/d3-hierarchy/src/hierarchy/index.js","../../../node_modules/d3-hierarchy/src/pack/enclose.js","../../../node_modules/d3-hierarchy/src/array.js","../../../node_modules/d3-hierarchy/src/pack/siblings.js","../../../node_modules/d3-hierarchy/src/accessors.js","../../../node_modules/d3-hierarchy/src/constant.js","../../../node_modules/d3-hierarchy/src/pack/index.js","../../../node_modules/d3-hierarchy/src/treemap/round.js","../../../node_modules/d3-hierarchy/src/treemap/dice.js","../../../node_modules/d3-hierarchy/src/hierarchy/each.js","../../../node_modules/d3-hierarchy/src/hierarchy/eachAfter.js","../../../node_modules/d3-hierarchy/src/hierarchy/eachBefore.js","../../../node_modules/d3-hierarchy/src/hierarchy/find.js","../../../node_modules/d3-hierarchy/src/hierarchy/sum.js","../../../node_modules/d3-hierarchy/src/hierarchy/sort.js","../../../node_modules/d3-hierarchy/src/hierarchy/path.js","../../../node_modules/d3-hierarchy/src/hierarchy/ancestors.js","../../../node_modules/d3-hierarchy/src/hierarchy/descendants.js","../../../node_modules/d3-hierarchy/src/hierarchy/leaves.js","../../../node_modules/d3-hierarchy/src/hierarchy/links.js","../../../node_modules/d3-hierarchy/src/stratify.js","../../../node_modules/d3-hierarchy/src/tree.js","../../../node_modules/d3-hierarchy/src/treemap/slice.js","../../../node_modules/d3-hierarchy/src/treemap/squarify.js","../../../node_modules/d3-hierarchy/src/treemap/resquarify.js","../../vega-hierarchy/build/vega-hierarchy.module.js","../../../node_modules/d3-hierarchy/src/partition.js","../../../node_modules/d3-hierarchy/src/treemap/binary.js","../../../node_modules/d3-hierarchy/src/treemap/sliceDice.js","../../../node_modules/d3-hierarchy/src/treemap/index.js","../../vega-label/build/vega-label.module.js","../../vega-regression/build/vega-regression.module.js","../../../node_modules/robust-predicates/esm/util.js","../../../node_modules/robust-predicates/esm/orient2d.js","../../../node_modules/delaunator/index.js","../../../node_modules/d3-delaunay/src/path.js","../../../node_modules/d3-delaunay/src/polygon.js","../../../node_modules/d3-delaunay/src/voronoi.js","../../../node_modules/d3-delaunay/src/delaunay.js","../../vega-voronoi/build/vega-voronoi.module.js","../../vega-wordcloud/build/vega-wordcloud.module.js","../../vega-crossfilter/build/vega-crossfilter.module.js","../../../node_modules/d3-array/src/permute.js","../../vega-expression/build/vega-expression.module.js","../../vega-selections/build/vega-selection.module.js","../../../node_modules/d3-array/src/union.js","../../vega-functions/build/vega-functions.module.js","../../vega-runtime/build/vega-runtime.module.js","../../vega-view/build/vega-view.module.js","../../../node_modules/d3-timer/src/interval.js","../../vega-event-selector/build/vega-event-selector.module.js","../../vega-parser/build/vega-parser.module.js","../index.js"],"sourcesContent":["function accessor (fn, fields, name) {\n fn.fields = fields || [];\n fn.fname = name;\n return fn;\n}\nfunction accessorName(fn) {\n return fn == null ? null : fn.fname;\n}\nfunction accessorFields(fn) {\n return fn == null ? null : fn.fields;\n}\n\nfunction getter (path) {\n return path.length === 1 ? get1(path[0]) : getN(path);\n}\n\nconst get1 = field => function (obj) {\n return obj[field];\n};\n\nconst getN = path => {\n const len = path.length;\n return function (obj) {\n for (let i = 0; i < len; ++i) {\n obj = obj[path[i]];\n }\n\n return obj;\n };\n};\n\nfunction error (message) {\n throw Error(message);\n}\n\nfunction splitAccessPath (p) {\n const path = [],\n n = p.length;\n let q = null,\n b = 0,\n s = '',\n i,\n j,\n c;\n p = p + '';\n\n function push() {\n path.push(s + p.substring(i, j));\n s = '';\n i = j + 1;\n }\n\n for (i = j = 0; j < n; ++j) {\n c = p[j];\n\n if (c === '\\\\') {\n s += p.substring(i, j);\n s += p.substring(++j, ++j);\n i = j;\n } else if (c === q) {\n push();\n q = null;\n b = -1;\n } else if (q) {\n continue;\n } else if (i === b && c === '\"') {\n i = j + 1;\n q = c;\n } else if (i === b && c === \"'\") {\n i = j + 1;\n q = c;\n } else if (c === '.' && !b) {\n if (j > i) {\n push();\n } else {\n i = j + 1;\n }\n } else if (c === '[') {\n if (j > i) push();\n b = i = j + 1;\n } else if (c === ']') {\n if (!b) error('Access path missing open bracket: ' + p);\n if (b > 0) push();\n b = 0;\n i = j + 1;\n }\n }\n\n if (b) error('Access path missing closing bracket: ' + p);\n if (q) error('Access path missing closing quote: ' + p);\n\n if (j > i) {\n j++;\n push();\n }\n\n return path;\n}\n\nfunction field (field, name, opt) {\n const path = splitAccessPath(field);\n field = path.length === 1 ? path[0] : field;\n return accessor((opt && opt.get || getter)(path), [field], name || field);\n}\n\nconst id = field('id');\nconst identity = accessor(_ => _, [], 'identity');\nconst zero = accessor(() => 0, [], 'zero');\nconst one = accessor(() => 1, [], 'one');\nconst truthy = accessor(() => true, [], 'true');\nconst falsy = accessor(() => false, [], 'false');\n\nfunction log$1(method, level, input) {\n const args = [level].concat([].slice.call(input));\n console[method].apply(console, args); // eslint-disable-line no-console\n}\n\nconst None = 0;\nconst Error$1 = 1;\nconst Warn = 2;\nconst Info = 3;\nconst Debug = 4;\nfunction logger (_, method) {\n let handler = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : log$1;\n let level = _ || None;\n return {\n level(_) {\n if (arguments.length) {\n level = +_;\n return this;\n } else {\n return level;\n }\n },\n\n error() {\n if (level >= Error$1) handler(method || 'error', 'ERROR', arguments);\n return this;\n },\n\n warn() {\n if (level >= Warn) handler(method || 'warn', 'WARN', arguments);\n return this;\n },\n\n info() {\n if (level >= Info) handler(method || 'log', 'INFO', arguments);\n return this;\n },\n\n debug() {\n if (level >= Debug) handler(method || 'log', 'DEBUG', arguments);\n return this;\n }\n\n };\n}\n\nvar isArray = Array.isArray;\n\nfunction isObject (_) {\n return _ === Object(_);\n}\n\nconst isLegalKey = key => key !== '__proto__';\n\nfunction mergeConfig() {\n for (var _len = arguments.length, configs = new Array(_len), _key = 0; _key < _len; _key++) {\n configs[_key] = arguments[_key];\n }\n\n return configs.reduce((out, source) => {\n for (const key in source) {\n if (key === 'signals') {\n // for signals, we merge the signals arrays\n // source signals take precedence over\n // existing signals with the same name\n out.signals = mergeNamed(out.signals, source.signals);\n } else {\n // otherwise, merge objects subject to recursion constraints\n // for legend block, recurse for the layout entry only\n // for style block, recurse for all properties\n // otherwise, no recursion: objects overwrite, no merging\n const r = key === 'legend' ? {\n layout: 1\n } : key === 'style' ? true : null;\n writeConfig(out, key, source[key], r);\n }\n }\n\n return out;\n }, {});\n}\nfunction writeConfig(output, key, value, recurse) {\n if (!isLegalKey(key)) return;\n let k, o;\n\n if (isObject(value) && !isArray(value)) {\n o = isObject(output[key]) ? output[key] : output[key] = {};\n\n for (k in value) {\n if (recurse && (recurse === true || recurse[k])) {\n writeConfig(o, k, value[k]);\n } else if (isLegalKey(k)) {\n o[k] = value[k];\n }\n }\n } else {\n output[key] = value;\n }\n}\n\nfunction mergeNamed(a, b) {\n if (a == null) return b;\n const map = {},\n out = [];\n\n function add(_) {\n if (!map[_.name]) {\n map[_.name] = 1;\n out.push(_);\n }\n }\n\n b.forEach(add);\n a.forEach(add);\n return out;\n}\n\nfunction peek (array) {\n return array[array.length - 1];\n}\n\nfunction toNumber (_) {\n return _ == null || _ === '' ? null : +_;\n}\n\nconst exp = sign => x => sign * Math.exp(x);\n\nconst log = sign => x => Math.log(sign * x);\n\nconst symlog = c => x => Math.sign(x) * Math.log1p(Math.abs(x / c));\n\nconst symexp = c => x => Math.sign(x) * Math.expm1(Math.abs(x)) * c;\n\nconst pow = exponent => x => x < 0 ? -Math.pow(-x, exponent) : Math.pow(x, exponent);\n\nfunction pan(domain, delta, lift, ground) {\n const d0 = lift(domain[0]),\n d1 = lift(peek(domain)),\n dd = (d1 - d0) * delta;\n return [ground(d0 - dd), ground(d1 - dd)];\n}\n\nfunction panLinear(domain, delta) {\n return pan(domain, delta, toNumber, identity);\n}\nfunction panLog(domain, delta) {\n var sign = Math.sign(domain[0]);\n return pan(domain, delta, log(sign), exp(sign));\n}\nfunction panPow(domain, delta, exponent) {\n return pan(domain, delta, pow(exponent), pow(1 / exponent));\n}\nfunction panSymlog(domain, delta, constant) {\n return pan(domain, delta, symlog(constant), symexp(constant));\n}\n\nfunction zoom(domain, anchor, scale, lift, ground) {\n const d0 = lift(domain[0]),\n d1 = lift(peek(domain)),\n da = anchor != null ? lift(anchor) : (d0 + d1) / 2;\n return [ground(da + (d0 - da) * scale), ground(da + (d1 - da) * scale)];\n}\n\nfunction zoomLinear(domain, anchor, scale) {\n return zoom(domain, anchor, scale, toNumber, identity);\n}\nfunction zoomLog(domain, anchor, scale) {\n const sign = Math.sign(domain[0]);\n return zoom(domain, anchor, scale, log(sign), exp(sign));\n}\nfunction zoomPow(domain, anchor, scale, exponent) {\n return zoom(domain, anchor, scale, pow(exponent), pow(1 / exponent));\n}\nfunction zoomSymlog(domain, anchor, scale, constant) {\n return zoom(domain, anchor, scale, symlog(constant), symexp(constant));\n}\n\nfunction quarter(date) {\n return 1 + ~~(new Date(date).getMonth() / 3);\n}\nfunction utcquarter(date) {\n return 1 + ~~(new Date(date).getUTCMonth() / 3);\n}\n\nfunction array (_) {\n return _ != null ? isArray(_) ? _ : [_] : [];\n}\n\n/**\n * Span-preserving range clamp. If the span of the input range is less\n * than (max - min) and an endpoint exceeds either the min or max value,\n * the range is translated such that the span is preserved and one\n * endpoint touches the boundary of the min/max range.\n * If the span exceeds (max - min), the range [min, max] is returned.\n */\nfunction clampRange (range, min, max) {\n let lo = range[0],\n hi = range[1],\n span;\n\n if (hi < lo) {\n span = hi;\n hi = lo;\n lo = span;\n }\n\n span = hi - lo;\n return span >= max - min ? [min, max] : [lo = Math.min(Math.max(lo, min), max - span), lo + span];\n}\n\nfunction isFunction (_) {\n return typeof _ === 'function';\n}\n\nconst DESCENDING = 'descending';\nfunction compare (fields, orders, opt) {\n opt = opt || {};\n orders = array(orders) || [];\n const ord = [],\n get = [],\n fmap = {},\n gen = opt.comparator || comparator;\n array(fields).forEach((f, i) => {\n if (f == null) return;\n ord.push(orders[i] === DESCENDING ? -1 : 1);\n get.push(f = isFunction(f) ? f : field(f, null, opt));\n (accessorFields(f) || []).forEach(_ => fmap[_] = 1);\n });\n return get.length === 0 ? null : accessor(gen(get, ord), Object.keys(fmap));\n}\nconst ascending = (u, v) => (u < v || u == null) && v != null ? -1 : (u > v || v == null) && u != null ? 1 : (v = v instanceof Date ? +v : v, u = u instanceof Date ? +u : u) !== u && v === v ? -1 : v !== v && u === u ? 1 : 0;\n\nconst comparator = (fields, orders) => fields.length === 1 ? compare1(fields[0], orders[0]) : compareN(fields, orders, fields.length);\n\nconst compare1 = (field, order) => function (a, b) {\n return ascending(field(a), field(b)) * order;\n};\n\nconst compareN = (fields, orders, n) => {\n orders.push(0); // pad zero for convenient lookup\n\n return function (a, b) {\n let f,\n c = 0,\n i = -1;\n\n while (c === 0 && ++i < n) {\n f = fields[i];\n c = ascending(f(a), f(b));\n }\n\n return c * orders[i];\n };\n};\n\nfunction constant (_) {\n return isFunction(_) ? _ : () => _;\n}\n\nfunction debounce (delay, handler) {\n let tid;\n return e => {\n if (tid) clearTimeout(tid);\n tid = setTimeout(() => (handler(e), tid = null), delay);\n };\n}\n\nfunction extend (_) {\n for (let x, k, i = 1, len = arguments.length; i < len; ++i) {\n x = arguments[i];\n\n for (k in x) {\n _[k] = x[k];\n }\n }\n\n return _;\n}\n\n/**\n * Return an array with minimum and maximum values, in the\n * form [min, max]. Ignores null, undefined, and NaN values.\n */\nfunction extent (array, f) {\n let i = 0,\n n,\n v,\n min,\n max;\n\n if (array && (n = array.length)) {\n if (f == null) {\n // find first valid value\n for (v = array[i]; i < n && (v == null || v !== v); v = array[++i]);\n\n min = max = v; // visit all other values\n\n for (; i < n; ++i) {\n v = array[i]; // skip null/undefined; NaN will fail all comparisons\n\n if (v != null) {\n if (v < min) min = v;\n if (v > max) max = v;\n }\n }\n } else {\n // find first valid value\n for (v = f(array[i]); i < n && (v == null || v !== v); v = f(array[++i]));\n\n min = max = v; // visit all other values\n\n for (; i < n; ++i) {\n v = f(array[i]); // skip null/undefined; NaN will fail all comparisons\n\n if (v != null) {\n if (v < min) min = v;\n if (v > max) max = v;\n }\n }\n }\n }\n\n return [min, max];\n}\n\nfunction extentIndex (array, f) {\n const n = array.length;\n let i = -1,\n a,\n b,\n c,\n u,\n v;\n\n if (f == null) {\n while (++i < n) {\n b = array[i];\n\n if (b != null && b >= b) {\n a = c = b;\n break;\n }\n }\n\n if (i === n) return [-1, -1];\n u = v = i;\n\n while (++i < n) {\n b = array[i];\n\n if (b != null) {\n if (a > b) {\n a = b;\n u = i;\n }\n\n if (c < b) {\n c = b;\n v = i;\n }\n }\n }\n } else {\n while (++i < n) {\n b = f(array[i], i, array);\n\n if (b != null && b >= b) {\n a = c = b;\n break;\n }\n }\n\n if (i === n) return [-1, -1];\n u = v = i;\n\n while (++i < n) {\n b = f(array[i], i, array);\n\n if (b != null) {\n if (a > b) {\n a = b;\n u = i;\n }\n\n if (c < b) {\n c = b;\n v = i;\n }\n }\n }\n }\n\n return [u, v];\n}\n\nconst hop = Object.prototype.hasOwnProperty;\nfunction has (object, property) {\n return hop.call(object, property);\n}\n\nconst NULL = {};\nfunction fastmap (input) {\n let obj = {},\n test;\n\n function has$1(key) {\n return has(obj, key) && obj[key] !== NULL;\n }\n\n const map = {\n size: 0,\n empty: 0,\n object: obj,\n has: has$1,\n\n get(key) {\n return has$1(key) ? obj[key] : undefined;\n },\n\n set(key, value) {\n if (!has$1(key)) {\n ++map.size;\n if (obj[key] === NULL) --map.empty;\n }\n\n obj[key] = value;\n return this;\n },\n\n delete(key) {\n if (has$1(key)) {\n --map.size;\n ++map.empty;\n obj[key] = NULL;\n }\n\n return this;\n },\n\n clear() {\n map.size = map.empty = 0;\n map.object = obj = {};\n },\n\n test(_) {\n if (arguments.length) {\n test = _;\n return map;\n } else {\n return test;\n }\n },\n\n clean() {\n const next = {};\n let size = 0;\n\n for (const key in obj) {\n const value = obj[key];\n\n if (value !== NULL && (!test || !test(value))) {\n next[key] = value;\n ++size;\n }\n }\n\n map.size = size;\n map.empty = 0;\n map.object = obj = next;\n }\n\n };\n if (input) Object.keys(input).forEach(key => {\n map.set(key, input[key]);\n });\n return map;\n}\n\nfunction flush (range, value, threshold, left, right, center) {\n if (!threshold && threshold !== 0) return center;\n const t = +threshold;\n let a = range[0],\n b = peek(range),\n l; // swap endpoints if range is reversed\n\n if (b < a) {\n l = a;\n a = b;\n b = l;\n } // compare value to endpoints\n\n\n l = Math.abs(value - a);\n const r = Math.abs(b - value); // adjust if value is within threshold distance of endpoint\n\n return l < r && l <= t ? left : r <= t ? right : center;\n}\n\nfunction inherits (child, parent, members) {\n const proto = child.prototype = Object.create(parent.prototype);\n Object.defineProperty(proto, 'constructor', {\n value: child,\n writable: true,\n enumerable: true,\n configurable: true\n });\n return extend(proto, members);\n}\n\n/**\n * Predicate that returns true if the value lies within the span\n * of the given range. The left and right flags control the use\n * of inclusive (true) or exclusive (false) comparisons.\n */\nfunction inrange (value, range, left, right) {\n let r0 = range[0],\n r1 = range[range.length - 1],\n t;\n\n if (r0 > r1) {\n t = r0;\n r0 = r1;\n r1 = t;\n }\n\n left = left === undefined || left;\n right = right === undefined || right;\n return (left ? r0 <= value : r0 < value) && (right ? value <= r1 : value < r1);\n}\n\nfunction isBoolean (_) {\n return typeof _ === 'boolean';\n}\n\nfunction isDate (_) {\n return Object.prototype.toString.call(_) === '[object Date]';\n}\n\nfunction isIterable (_) {\n return _ && isFunction(_[Symbol.iterator]);\n}\n\nfunction isNumber (_) {\n return typeof _ === 'number';\n}\n\nfunction isRegExp (_) {\n return Object.prototype.toString.call(_) === '[object RegExp]';\n}\n\nfunction isString (_) {\n return typeof _ === 'string';\n}\n\nfunction key (fields, flat, opt) {\n if (fields) {\n fields = flat ? array(fields).map(f => f.replace(/\\\\(.)/g, '$1')) : array(fields);\n }\n\n const len = fields && fields.length,\n gen = opt && opt.get || getter,\n map = f => gen(flat ? [f] : splitAccessPath(f));\n\n let fn;\n\n if (!len) {\n fn = function () {\n return '';\n };\n } else if (len === 1) {\n const get = map(fields[0]);\n\n fn = function (_) {\n return '' + get(_);\n };\n } else {\n const get = fields.map(map);\n\n fn = function (_) {\n let s = '' + get[0](_),\n i = 0;\n\n while (++i < len) s += '|' + get[i](_);\n\n return s;\n };\n }\n\n return accessor(fn, fields, 'key');\n}\n\nfunction lerp (array, frac) {\n const lo = array[0],\n hi = peek(array),\n f = +frac;\n return !f ? lo : f === 1 ? hi : lo + f * (hi - lo);\n}\n\nconst DEFAULT_MAX_SIZE = 10000; // adapted from https://github.com/dominictarr/hashlru/ (MIT License)\n\nfunction lruCache (maxsize) {\n maxsize = +maxsize || DEFAULT_MAX_SIZE;\n let curr, prev, size;\n\n const clear = () => {\n curr = {};\n prev = {};\n size = 0;\n };\n\n const update = (key, value) => {\n if (++size > maxsize) {\n prev = curr;\n curr = {};\n size = 1;\n }\n\n return curr[key] = value;\n };\n\n clear();\n return {\n clear,\n has: key => has(curr, key) || has(prev, key),\n get: key => has(curr, key) ? curr[key] : has(prev, key) ? update(key, prev[key]) : undefined,\n set: (key, value) => has(curr, key) ? curr[key] = value : update(key, value)\n };\n}\n\nfunction merge (compare, array0, array1, output) {\n const n0 = array0.length,\n n1 = array1.length;\n if (!n1) return array0;\n if (!n0) return array1;\n const merged = output || new array0.constructor(n0 + n1);\n let i0 = 0,\n i1 = 0,\n i = 0;\n\n for (; i0 < n0 && i1 < n1; ++i) {\n merged[i] = compare(array0[i0], array1[i1]) > 0 ? array1[i1++] : array0[i0++];\n }\n\n for (; i0 < n0; ++i0, ++i) {\n merged[i] = array0[i0];\n }\n\n for (; i1 < n1; ++i1, ++i) {\n merged[i] = array1[i1];\n }\n\n return merged;\n}\n\nfunction repeat (str, reps) {\n let s = '';\n\n while (--reps >= 0) s += str;\n\n return s;\n}\n\nfunction pad (str, length, padchar, align) {\n const c = padchar || ' ',\n s = str + '',\n n = length - s.length;\n return n <= 0 ? s : align === 'left' ? repeat(c, n) + s : align === 'center' ? repeat(c, ~~(n / 2)) + s + repeat(c, Math.ceil(n / 2)) : s + repeat(c, n);\n}\n\n/**\n * Return the numerical span of an array: the difference between\n * the last and first values.\n */\n\nfunction span (array) {\n return array && peek(array) - array[0] || 0;\n}\n\nfunction $(x) {\n return isArray(x) ? '[' + x.map($) + ']' : isObject(x) || isString(x) ? // Output valid JSON and JS source strings.\n // See http://timelessrepo.com/json-isnt-a-javascript-subset\n JSON.stringify(x).replace('\\u2028', '\\\\u2028').replace('\\u2029', '\\\\u2029') : x;\n}\n\nfunction toBoolean (_) {\n return _ == null || _ === '' ? null : !_ || _ === 'false' || _ === '0' ? false : !!_;\n}\n\nconst defaultParser = _ => isNumber(_) ? _ : isDate(_) ? _ : Date.parse(_);\n\nfunction toDate (_, parser) {\n parser = parser || defaultParser;\n return _ == null || _ === '' ? null : parser(_);\n}\n\nfunction toString (_) {\n return _ == null || _ === '' ? null : _ + '';\n}\n\nfunction toSet (_) {\n const s = {},\n n = _.length;\n\n for (let i = 0; i < n; ++i) s[_[i]] = true;\n\n return s;\n}\n\nfunction truncate (str, length, align, ellipsis) {\n const e = ellipsis != null ? ellipsis : '\\u2026',\n s = str + '',\n n = s.length,\n l = Math.max(0, length - e.length);\n return n <= length ? s : align === 'left' ? e + s.slice(n - l) : align === 'center' ? s.slice(0, Math.ceil(l / 2)) + e + s.slice(n - ~~(l / 2)) : s.slice(0, l) + e;\n}\n\nfunction visitArray (array, filter, visitor) {\n if (array) {\n if (filter) {\n const n = array.length;\n\n for (let i = 0; i < n; ++i) {\n const t = filter(array[i]);\n if (t) visitor(t, i, array);\n }\n } else {\n array.forEach(visitor);\n }\n }\n}\n\nexport { Debug, Error$1 as Error, Info, None, Warn, accessor, accessorFields, accessorName, array, ascending, clampRange, compare, constant, debounce, error, extend, extent, extentIndex, falsy, fastmap, field, flush, has as hasOwnProperty, id, identity, inherits, inrange, isArray, isBoolean, isDate, isFunction, isIterable, isNumber, isObject, isRegExp, isString, key, lerp, logger, lruCache, merge, mergeConfig, one, pad, panLinear, panLog, panPow, panSymlog, peek, quarter, repeat, span, splitAccessPath, $ as stringValue, toBoolean, toDate, toNumber, toSet, toString, truncate, truthy, utcquarter, visitArray, writeConfig, zero, zoomLinear, zoomLog, zoomPow, zoomSymlog };\n","var EOL = {},\n EOF = {},\n QUOTE = 34,\n NEWLINE = 10,\n RETURN = 13;\n\nfunction objectConverter(columns) {\n return new Function(\"d\", \"return {\" + columns.map(function(name, i) {\n return JSON.stringify(name) + \": d[\" + i + \"] || \\\"\\\"\";\n }).join(\",\") + \"}\");\n}\n\nfunction customConverter(columns, f) {\n var object = objectConverter(columns);\n return function(row, i) {\n return f(object(row), i, columns);\n };\n}\n\n// Compute unique columns in order of discovery.\nfunction inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}\n\nfunction pad(value, width) {\n var s = value + \"\", length = s.length;\n return length < width ? new Array(width - length + 1).join(0) + s : s;\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 formatDate(date) {\n var hours = date.getUTCHours(),\n minutes = date.getUTCMinutes(),\n seconds = date.getUTCSeconds(),\n milliseconds = date.getUTCMilliseconds();\n return isNaN(date) ? \"Invalid Date\"\n : formatYear(date.getUTCFullYear(), 4) + \"-\" + pad(date.getUTCMonth() + 1, 2) + \"-\" + pad(date.getUTCDate(), 2)\n + (milliseconds ? \"T\" + pad(hours, 2) + \":\" + pad(minutes, 2) + \":\" + pad(seconds, 2) + \".\" + pad(milliseconds, 3) + \"Z\"\n : seconds ? \"T\" + pad(hours, 2) + \":\" + pad(minutes, 2) + \":\" + pad(seconds, 2) + \"Z\"\n : minutes || hours ? \"T\" + pad(hours, 2) + \":\" + pad(minutes, 2) + \"Z\"\n : \"\");\n}\n\nexport default function(delimiter) {\n var reFormat = new RegExp(\"[\\\"\" + delimiter + \"\\n\\r]\"),\n DELIMITER = delimiter.charCodeAt(0);\n\n function parse(text, f) {\n var convert, columns, rows = parseRows(text, function(row, i) {\n if (convert) return convert(row, i - 1);\n columns = row, convert = f ? customConverter(row, f) : objectConverter(row);\n });\n rows.columns = columns || [];\n return rows;\n }\n\n function parseRows(text, f) {\n var rows = [], // output rows\n N = text.length,\n I = 0, // current character index\n n = 0, // current line number\n t, // current token\n eof = N <= 0, // current token followed by EOF?\n eol = false; // current token followed by EOL?\n\n // Strip the trailing newline.\n if (text.charCodeAt(N - 1) === NEWLINE) --N;\n if (text.charCodeAt(N - 1) === RETURN) --N;\n\n function token() {\n if (eof) return EOF;\n if (eol) return eol = false, EOL;\n\n // Unescape quotes.\n var i, j = I, c;\n if (text.charCodeAt(j) === QUOTE) {\n while (I++ < N && text.charCodeAt(I) !== QUOTE || text.charCodeAt(++I) === QUOTE);\n if ((i = I) >= N) eof = true;\n else if ((c = text.charCodeAt(I++)) === NEWLINE) eol = true;\n else if (c === RETURN) { eol = true; if (text.charCodeAt(I) === NEWLINE) ++I; }\n return text.slice(j + 1, i - 1).replace(/\"\"/g, \"\\\"\");\n }\n\n // Find next delimiter or newline.\n while (I < N) {\n if ((c = text.charCodeAt(i = I++)) === NEWLINE) eol = true;\n else if (c === RETURN) { eol = true; if (text.charCodeAt(I) === NEWLINE) ++I; }\n else if (c !== DELIMITER) continue;\n return text.slice(j, i);\n }\n\n // Return last token before EOF.\n return eof = true, text.slice(j, N);\n }\n\n while ((t = token()) !== EOF) {\n var row = [];\n while (t !== EOL && t !== EOF) row.push(t), t = token();\n if (f && (row = f(row, n++)) == null) continue;\n rows.push(row);\n }\n\n return rows;\n }\n\n function preformatBody(rows, columns) {\n return rows.map(function(row) {\n return columns.map(function(column) {\n return formatValue(row[column]);\n }).join(delimiter);\n });\n }\n\n function format(rows, columns) {\n if (columns == null) columns = inferColumns(rows);\n return [columns.map(formatValue).join(delimiter)].concat(preformatBody(rows, columns)).join(\"\\n\");\n }\n\n function formatBody(rows, columns) {\n if (columns == null) columns = inferColumns(rows);\n return preformatBody(rows, columns).join(\"\\n\");\n }\n\n function formatRows(rows) {\n return rows.map(formatRow).join(\"\\n\");\n }\n\n function formatRow(row) {\n return row.map(formatValue).join(delimiter);\n }\n\n function formatValue(value) {\n return value == null ? \"\"\n : value instanceof Date ? formatDate(value)\n : reFormat.test(value += \"\") ? \"\\\"\" + value.replace(/\"/g, \"\\\"\\\"\") + \"\\\"\"\n : value;\n }\n\n return {\n parse: parse,\n parseRows: parseRows,\n format: format,\n formatBody: formatBody,\n formatRows: formatRows,\n formatRow: formatRow,\n formatValue: formatValue\n };\n}\n","export default function(x) {\n return x;\n}\n","import reverse from \"./reverse.js\";\nimport transform from \"./transform.js\";\n\nexport default function(topology, o) {\n if (typeof o === \"string\") o = topology.objects[o];\n return o.type === \"GeometryCollection\"\n ? {type: \"FeatureCollection\", features: o.geometries.map(function(o) { return feature(topology, o); })}\n : feature(topology, o);\n}\n\nfunction feature(topology, o) {\n var id = o.id,\n bbox = o.bbox,\n properties = o.properties == null ? {} : o.properties,\n geometry = object(topology, o);\n return id == null && bbox == null ? {type: \"Feature\", properties: properties, geometry: geometry}\n : bbox == null ? {type: \"Feature\", id: id, properties: properties, geometry: geometry}\n : {type: \"Feature\", id: id, bbox: bbox, properties: properties, geometry: geometry};\n}\n\nexport function object(topology, o) {\n var transformPoint = transform(topology.transform),\n arcs = topology.arcs;\n\n function arc(i, points) {\n if (points.length) points.pop();\n for (var a = arcs[i < 0 ? ~i : i], k = 0, n = a.length; k < n; ++k) {\n points.push(transformPoint(a[k], k));\n }\n if (i < 0) reverse(points, n);\n }\n\n function point(p) {\n return transformPoint(p);\n }\n\n function line(arcs) {\n var points = [];\n for (var i = 0, n = arcs.length; i < n; ++i) arc(arcs[i], points);\n if (points.length < 2) points.push(points[0]); // This should never happen per the specification.\n return points;\n }\n\n function ring(arcs) {\n var points = line(arcs);\n while (points.length < 4) points.push(points[0]); // This may happen if an arc has only two points.\n return points;\n }\n\n function polygon(arcs) {\n return arcs.map(ring);\n }\n\n function geometry(o) {\n var type = o.type, coordinates;\n switch (type) {\n case \"GeometryCollection\": return {type: type, geometries: o.geometries.map(geometry)};\n case \"Point\": coordinates = point(o.coordinates); break;\n case \"MultiPoint\": coordinates = o.coordinates.map(point); break;\n case \"LineString\": coordinates = line(o.arcs); break;\n case \"MultiLineString\": coordinates = o.arcs.map(line); break;\n case \"Polygon\": coordinates = polygon(o.arcs); break;\n case \"MultiPolygon\": coordinates = o.arcs.map(polygon); break;\n default: return null;\n }\n return {type: type, coordinates: coordinates};\n }\n\n return geometry(o);\n}\n","import identity from \"./identity.js\";\n\nexport default function(transform) {\n if (transform == null) return identity;\n var x0,\n y0,\n kx = transform.scale[0],\n ky = transform.scale[1],\n dx = transform.translate[0],\n dy = transform.translate[1];\n return function(input, i) {\n if (!i) x0 = y0 = 0;\n var j = 2, n = input.length, output = new Array(n);\n output[0] = (x0 += input[0]) * kx + dx;\n output[1] = (y0 += input[1]) * ky + dy;\n while (j < n) output[j] = input[j], ++j;\n return output;\n };\n}\n","export default function(array, n) {\n var t, j = array.length, i = j - n;\n while (i < --j) t = array[i], array[i++] = array[j], array[j] = t;\n}\n","export default function(topology, arcs) {\n var stitchedArcs = {},\n fragmentByStart = {},\n fragmentByEnd = {},\n fragments = [],\n emptyIndex = -1;\n\n // Stitch empty arcs first, since they may be subsumed by other arcs.\n arcs.forEach(function(i, j) {\n var arc = topology.arcs[i < 0 ? ~i : i], t;\n if (arc.length < 3 && !arc[1][0] && !arc[1][1]) {\n t = arcs[++emptyIndex], arcs[emptyIndex] = i, arcs[j] = t;\n }\n });\n\n arcs.forEach(function(i) {\n var e = ends(i),\n start = e[0],\n end = e[1],\n f, g;\n\n if (f = fragmentByEnd[start]) {\n delete fragmentByEnd[f.end];\n f.push(i);\n f.end = end;\n if (g = fragmentByStart[end]) {\n delete fragmentByStart[g.start];\n var fg = g === f ? f : f.concat(g);\n fragmentByStart[fg.start = f.start] = fragmentByEnd[fg.end = g.end] = fg;\n } else {\n fragmentByStart[f.start] = fragmentByEnd[f.end] = f;\n }\n } else if (f = fragmentByStart[end]) {\n delete fragmentByStart[f.start];\n f.unshift(i);\n f.start = start;\n if (g = fragmentByEnd[start]) {\n delete fragmentByEnd[g.end];\n var gf = g === f ? f : g.concat(f);\n fragmentByStart[gf.start = g.start] = fragmentByEnd[gf.end = f.end] = gf;\n } else {\n fragmentByStart[f.start] = fragmentByEnd[f.end] = f;\n }\n } else {\n f = [i];\n fragmentByStart[f.start = start] = fragmentByEnd[f.end = end] = f;\n }\n });\n\n function ends(i) {\n var arc = topology.arcs[i < 0 ? ~i : i], p0 = arc[0], p1;\n if (topology.transform) p1 = [0, 0], arc.forEach(function(dp) { p1[0] += dp[0], p1[1] += dp[1]; });\n else p1 = arc[arc.length - 1];\n return i < 0 ? [p1, p0] : [p0, p1];\n }\n\n function flush(fragmentByEnd, fragmentByStart) {\n for (var k in fragmentByEnd) {\n var f = fragmentByEnd[k];\n delete fragmentByStart[f.start];\n delete f.start;\n delete f.end;\n f.forEach(function(i) { stitchedArcs[i < 0 ? ~i : i] = 1; });\n fragments.push(f);\n }\n }\n\n flush(fragmentByEnd, fragmentByStart);\n flush(fragmentByStart, fragmentByEnd);\n arcs.forEach(function(i) { if (!stitchedArcs[i < 0 ? ~i : i]) fragments.push([i]); });\n\n return fragments;\n}\n","import {object} from \"./feature.js\";\nimport stitch from \"./stitch.js\";\n\nexport default function(topology) {\n return object(topology, meshArcs.apply(this, arguments));\n}\n\nexport function meshArcs(topology, object, filter) {\n var arcs, i, n;\n if (arguments.length > 1) arcs = extractArcs(topology, object, filter);\n else for (i = 0, arcs = new Array(n = topology.arcs.length); i < n; ++i) arcs[i] = i;\n return {type: \"MultiLineString\", arcs: stitch(topology, arcs)};\n}\n\nfunction extractArcs(topology, object, filter) {\n var arcs = [],\n geomsByArc = [],\n geom;\n\n function extract0(i) {\n var j = i < 0 ? ~i : i;\n (geomsByArc[j] || (geomsByArc[j] = [])).push({i: i, g: geom});\n }\n\n function extract1(arcs) {\n arcs.forEach(extract0);\n }\n\n function extract2(arcs) {\n arcs.forEach(extract1);\n }\n\n function extract3(arcs) {\n arcs.forEach(extract2);\n }\n\n function geometry(o) {\n switch (geom = o, o.type) {\n case \"GeometryCollection\": o.geometries.forEach(geometry); break;\n case \"LineString\": extract1(o.arcs); break;\n case \"MultiLineString\": case \"Polygon\": extract2(o.arcs); break;\n case \"MultiPolygon\": extract3(o.arcs); break;\n }\n }\n\n geometry(object);\n\n geomsByArc.forEach(filter == null\n ? function(geoms) { arcs.push(geoms[0].i); }\n : function(geoms) { if (filter(geoms[0].g, geoms[geoms.length - 1].g)) arcs.push(geoms[0].i); });\n\n return arcs;\n}\n","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","import ascending from \"./ascending.js\";\n\nexport default function bisector(f) {\n let delta = f;\n let compare1 = f;\n let compare2 = f;\n\n if (f.length !== 2) {\n delta = (d, x) => f(d) - x;\n compare1 = ascending;\n compare2 = (d, x) => ascending(f(d), x);\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","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","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 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","// 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","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","var e10 = Math.sqrt(50),\n e5 = Math.sqrt(10),\n e2 = Math.sqrt(2);\n\nexport default function ticks(start, stop, count) {\n var reverse,\n i = -1,\n n,\n ticks,\n step;\n\n stop = +stop, start = +start, count = +count;\n if (start === stop && count > 0) return [start];\n if (reverse = stop < start) n = start, start = stop, stop = n;\n if ((step = tickIncrement(start, stop, count)) === 0 || !isFinite(step)) return [];\n\n if (step > 0) {\n let r0 = Math.round(start / step), r1 = Math.round(stop / step);\n if (r0 * step < start) ++r0;\n if (r1 * step > stop) --r1;\n ticks = new Array(n = r1 - r0 + 1);\n while (++i < n) ticks[i] = (r0 + i) * step;\n } else {\n step = -step;\n let r0 = Math.round(start * step), r1 = Math.round(stop * step);\n if (r0 / step < start) ++r0;\n if (r1 / step > stop) --r1;\n ticks = new Array(n = r1 - r0 + 1);\n while (++i < n) ticks[i] = (r0 + i) / step;\n }\n\n if (reverse) ticks.reverse();\n\n return ticks;\n}\n\nexport function tickIncrement(start, stop, count) {\n var step = (stop - start) / Math.max(0, count),\n power = Math.floor(Math.log(step) / Math.LN10),\n error = step / Math.pow(10, power);\n return power >= 0\n ? (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1) * Math.pow(10, power)\n : -Math.pow(10, -power) / (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1);\n}\n\nexport function tickStep(start, stop, count) {\n var step0 = Math.abs(stop - start) / Math.max(0, count),\n step1 = Math.pow(10, Math.floor(Math.log(step0) / Math.LN10)),\n error = step0 / step1;\n if (error >= e10) step1 *= 10;\n else if (error >= e5) step1 *= 5;\n else if (error >= e2) step1 *= 2;\n return stop < start ? -step1 : step1;\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 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","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 = array.length - 1, compare) {\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 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 max from \"./max.js\";\nimport min from \"./min.js\";\nimport quickselect from \"./quickselect.js\";\nimport number, {numbers} from \"./number.js\";\n\nexport default function quantile(values, p, valueof) {\n values = Float64Array.from(numbers(values, valueof));\n if (!(n = values.length)) return;\n if ((p = +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)) return;\n if ((p = +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","import quantile from \"./quantile.js\";\n\nexport default function median(values, valueof) {\n return quantile(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","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","import {InternSet} from \"internmap\";\n\nexport default function intersection(values, ...others) {\n values = new InternSet(values);\n others = others.map(set);\n out: for (const value of values) {\n for (const other of others) {\n if (!other.has(value)) {\n values.delete(value);\n continue out;\n }\n }\n }\n return values;\n}\n\nfunction set(values) {\n return values instanceof InternSet ? values : new InternSet(values);\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, ±Infinity\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","// [[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","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\",\"µ\",\"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 ? \"−\" : 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 “value” part that can be\n // grouped, and fractional or exponential “suffix” 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","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","// 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 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","var t0 = new Date,\n t1 = new Date;\n\nexport default function newInterval(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 = function(date) {\n return floori(date = new Date(+date)), date;\n };\n\n interval.ceil = function(date) {\n return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date;\n };\n\n interval.round = function(date) {\n var d0 = interval(date),\n d1 = interval.ceil(date);\n return date - d0 < d1 - date ? d0 : d1;\n };\n\n interval.offset = function(date, step) {\n return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;\n };\n\n interval.range = function(start, stop, step) {\n var range = [], previous;\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 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 = function(test) {\n return newInterval(function(date) {\n if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1);\n }, function(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 = function(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 = function(step) {\n step = Math.floor(step);\n return !isFinite(step) || !(step > 0) ? null\n : !(step > 1) ? interval\n : interval.filter(field\n ? function(d) { return field(d) % step === 0; }\n : function(d) { return interval.count(0, d) % step === 0; });\n };\n }\n\n return interval;\n}\n","import interval from \"./interval.js\";\n\nvar millisecond = interval(function() {\n // noop\n}, function(date, step) {\n date.setTime(+date + step);\n}, function(start, end) {\n return end - start;\n});\n\n// An optimized implementation for this simple case.\nmillisecond.every = function(k) {\n k = Math.floor(k);\n if (!isFinite(k) || !(k > 0)) return null;\n if (!(k > 1)) return millisecond;\n return interval(function(date) {\n date.setTime(Math.floor(date / k) * k);\n }, function(date, step) {\n date.setTime(+date + step * k);\n }, function(start, end) {\n return (end - start) / k;\n });\n};\n\nexport default millisecond;\nexport var milliseconds = millisecond.range;\n","export const durationSecond = 1000;\nexport const durationMinute = durationSecond * 60;\nexport const durationHour = durationMinute * 60;\nexport const durationDay = durationHour * 24;\nexport const durationWeek = durationDay * 7;\nexport const durationMonth = durationDay * 30;\nexport const durationYear = durationDay * 365;\n","import interval from \"./interval.js\";\nimport {durationSecond} from \"./duration.js\";\n\nvar second = interval(function(date) {\n date.setTime(date - date.getMilliseconds());\n}, function(date, step) {\n date.setTime(+date + step * durationSecond);\n}, function(start, end) {\n return (end - start) / durationSecond;\n}, function(date) {\n return date.getUTCSeconds();\n});\n\nexport default second;\nexport var seconds = second.range;\n","import interval from \"./interval.js\";\nimport {durationMinute, durationSecond} from \"./duration.js\";\n\nvar minute = interval(function(date) {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond);\n}, function(date, step) {\n date.setTime(+date + step * durationMinute);\n}, function(start, end) {\n return (end - start) / durationMinute;\n}, function(date) {\n return date.getMinutes();\n});\n\nexport default minute;\nexport var minutes = minute.range;\n","import interval from \"./interval.js\";\nimport {durationHour, durationMinute, durationSecond} from \"./duration.js\";\n\nvar hour = interval(function(date) {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond - date.getMinutes() * durationMinute);\n}, function(date, step) {\n date.setTime(+date + step * durationHour);\n}, function(start, end) {\n return (end - start) / durationHour;\n}, function(date) {\n return date.getHours();\n});\n\nexport default hour;\nexport var hours = hour.range;\n","import interval from \"./interval.js\";\nimport {durationDay, durationMinute} from \"./duration.js\";\n\nvar day = interval(\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 default day;\nexport var days = day.range;\n","import interval from \"./interval.js\";\nimport {durationMinute, durationWeek} from \"./duration.js\";\n\nfunction weekday(i) {\n return interval(function(date) {\n date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);\n date.setHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setDate(date.getDate() + step * 7);\n }, function(start, end) {\n return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;\n });\n}\n\nexport var sunday = weekday(0);\nexport var monday = weekday(1);\nexport var tuesday = weekday(2);\nexport var wednesday = weekday(3);\nexport var thursday = weekday(4);\nexport var friday = weekday(5);\nexport var saturday = weekday(6);\n\nexport var sundays = sunday.range;\nexport var mondays = monday.range;\nexport var tuesdays = tuesday.range;\nexport var wednesdays = wednesday.range;\nexport var thursdays = thursday.range;\nexport var fridays = friday.range;\nexport var saturdays = saturday.range;\n","import interval from \"./interval.js\";\n\nvar month = interval(function(date) {\n date.setDate(1);\n date.setHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setMonth(date.getMonth() + step);\n}, function(start, end) {\n return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;\n}, function(date) {\n return date.getMonth();\n});\n\nexport default month;\nexport var months = month.range;\n","import interval from \"./interval.js\";\n\nvar year = interval(function(date) {\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setFullYear(date.getFullYear() + step);\n}, function(start, end) {\n return end.getFullYear() - start.getFullYear();\n}, function(date) {\n return date.getFullYear();\n});\n\n// An optimized implementation for this simple case.\nyear.every = function(k) {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : interval(function(date) {\n date.setFullYear(Math.floor(date.getFullYear() / k) * k);\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setFullYear(date.getFullYear() + step * k);\n });\n};\n\nexport default year;\nexport var years = year.range;\n","import interval from \"./interval.js\";\nimport {durationMinute} from \"./duration.js\";\n\nvar utcMinute = interval(function(date) {\n date.setUTCSeconds(0, 0);\n}, function(date, step) {\n date.setTime(+date + step * durationMinute);\n}, function(start, end) {\n return (end - start) / durationMinute;\n}, function(date) {\n return date.getUTCMinutes();\n});\n\nexport default utcMinute;\nexport var utcMinutes = utcMinute.range;\n","import interval from \"./interval.js\";\nimport {durationHour} from \"./duration.js\";\n\nvar utcHour = interval(function(date) {\n date.setUTCMinutes(0, 0, 0);\n}, function(date, step) {\n date.setTime(+date + step * durationHour);\n}, function(start, end) {\n return (end - start) / durationHour;\n}, function(date) {\n return date.getUTCHours();\n});\n\nexport default utcHour;\nexport var utcHours = utcHour.range;\n","import interval from \"./interval.js\";\nimport {durationDay} from \"./duration.js\";\n\nvar utcDay = interval(function(date) {\n date.setUTCHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setUTCDate(date.getUTCDate() + step);\n}, function(start, end) {\n return (end - start) / durationDay;\n}, function(date) {\n return date.getUTCDate() - 1;\n});\n\nexport default utcDay;\nexport var utcDays = utcDay.range;\n","import interval from \"./interval.js\";\nimport {durationWeek} from \"./duration.js\";\n\nfunction utcWeekday(i) {\n return interval(function(date) {\n date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);\n date.setUTCHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setUTCDate(date.getUTCDate() + step * 7);\n }, function(start, end) {\n return (end - start) / durationWeek;\n });\n}\n\nexport var utcSunday = utcWeekday(0);\nexport var utcMonday = utcWeekday(1);\nexport var utcTuesday = utcWeekday(2);\nexport var utcWednesday = utcWeekday(3);\nexport var utcThursday = utcWeekday(4);\nexport var utcFriday = utcWeekday(5);\nexport var utcSaturday = utcWeekday(6);\n\nexport var utcSundays = utcSunday.range;\nexport var utcMondays = utcMonday.range;\nexport var utcTuesdays = utcTuesday.range;\nexport var utcWednesdays = utcWednesday.range;\nexport var utcThursdays = utcThursday.range;\nexport var utcFridays = utcFriday.range;\nexport var utcSaturdays = utcSaturday.range;\n","import interval from \"./interval.js\";\n\nvar utcMonth = interval(function(date) {\n date.setUTCDate(1);\n date.setUTCHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setUTCMonth(date.getUTCMonth() + step);\n}, function(start, end) {\n return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;\n}, function(date) {\n return date.getUTCMonth();\n});\n\nexport default utcMonth;\nexport var utcMonths = utcMonth.range;\n","import interval from \"./interval.js\";\n\nvar utcYear = interval(function(date) {\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setUTCFullYear(date.getUTCFullYear() + step);\n}, function(start, end) {\n return end.getUTCFullYear() - start.getUTCFullYear();\n}, function(date) {\n return date.getUTCFullYear();\n});\n\n// An optimized implementation for this simple case.\nutcYear.every = function(k) {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : interval(function(date) {\n date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k);\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setUTCFullYear(date.getUTCFullYear() + step * k);\n });\n};\n\nexport default utcYear;\nexport var 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 minute from \"./minute.js\";\nimport hour from \"./hour.js\";\nimport day from \"./day.js\";\nimport {sunday as week} from \"./week.js\";\nimport month from \"./month.js\";\nimport year from \"./year.js\";\nimport utcMinute from \"./utcMinute.js\";\nimport utcHour from \"./utcHour.js\";\nimport utcDay from \"./utcDay.js\";\nimport {utcSunday as utcWeek} from \"./utcWeek.js\";\nimport utcMonth from \"./utcMonth.js\";\nimport utcYear from \"./utcYear.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, utcWeek, utcDay, utcHour, utcMinute);\nconst [timeTicks, timeTickInterval] = ticker(year, month, week, day, hour, minute);\n\nexport {utcTicks, utcTickInterval, timeTicks, timeTickInterval};\n","import { array, error, hasOwnProperty, extend, peek, toSet, constant, zero, one, span } from 'vega-util';\nimport { timeDay, timeWeek, utcDay, utcWeek, timeYear, timeMonth, timeHour, timeMinute, timeSecond, timeMillisecond, utcYear, utcMonth, utcHour, utcMinute, utcSecond, utcMillisecond } from 'd3-time';\nimport { bisector, tickStep } from 'd3-array';\n\nconst YEAR = 'year';\nconst QUARTER = 'quarter';\nconst MONTH = 'month';\nconst WEEK = 'week';\nconst DATE = 'date';\nconst DAY = 'day';\nconst DAYOFYEAR = 'dayofyear';\nconst HOURS = 'hours';\nconst MINUTES = 'minutes';\nconst SECONDS = 'seconds';\nconst MILLISECONDS = 'milliseconds';\nconst TIME_UNITS = [YEAR, QUARTER, MONTH, WEEK, DATE, DAY, DAYOFYEAR, HOURS, MINUTES, SECONDS, MILLISECONDS];\nconst UNITS = TIME_UNITS.reduce((o, u, i) => (o[u] = 1 + i, o), {});\nfunction timeUnits(units) {\n const u = array(units).slice(),\n m = {}; // check validity\n\n if (!u.length) error('Missing time unit.');\n u.forEach(unit => {\n if (hasOwnProperty(UNITS, unit)) {\n m[unit] = 1;\n } else {\n error(\"Invalid time unit: \".concat(unit, \".\"));\n }\n });\n const numTypes = (m[WEEK] || m[DAY] ? 1 : 0) + (m[QUARTER] || m[MONTH] || m[DATE] ? 1 : 0) + (m[DAYOFYEAR] ? 1 : 0);\n\n if (numTypes > 1) {\n error(\"Incompatible time units: \".concat(units));\n } // ensure proper sort order\n\n\n u.sort((a, b) => UNITS[a] - UNITS[b]);\n return u;\n}\nconst defaultSpecifiers = {\n [YEAR]: '%Y ',\n [QUARTER]: 'Q%q ',\n [MONTH]: '%b ',\n [DATE]: '%d ',\n [WEEK]: 'W%U ',\n [DAY]: '%a ',\n [DAYOFYEAR]: '%j ',\n [HOURS]: '%H:00',\n [MINUTES]: '00:%M',\n [SECONDS]: ':%S',\n [MILLISECONDS]: '.%L',\n [\"\".concat(YEAR, \"-\").concat(MONTH)]: '%Y-%m ',\n [\"\".concat(YEAR, \"-\").concat(MONTH, \"-\").concat(DATE)]: '%Y-%m-%d ',\n [\"\".concat(HOURS, \"-\").concat(MINUTES)]: '%H:%M'\n};\nfunction timeUnitSpecifier(units, specifiers) {\n const s = extend({}, defaultSpecifiers, specifiers),\n u = timeUnits(units),\n n = u.length;\n let fmt = '',\n start = 0,\n end,\n key;\n\n for (start = 0; start < n;) {\n for (end = u.length; end > start; --end) {\n key = u.slice(start, end).join('-');\n\n if (s[key] != null) {\n fmt += s[key];\n start = end;\n break;\n }\n }\n }\n\n return fmt.trim();\n}\n\nconst t0 = new Date();\n\nfunction localYear(y) {\n t0.setFullYear(y);\n t0.setMonth(0);\n t0.setDate(1);\n t0.setHours(0, 0, 0, 0);\n return t0;\n}\n\nfunction dayofyear(d) {\n return localDayOfYear(new Date(d));\n}\nfunction week(d) {\n return localWeekNum(new Date(d));\n}\nfunction localDayOfYear(d) {\n return timeDay.count(localYear(d.getFullYear()) - 1, d);\n}\nfunction localWeekNum(d) {\n return timeWeek.count(localYear(d.getFullYear()) - 1, d);\n}\nfunction localFirst(y) {\n return localYear(y).getDay();\n}\nfunction localDate(y, m, d, H, M, S, L) {\n if (0 <= y && y < 100) {\n const date = new Date(-1, m, d, H, M, S, L);\n date.setFullYear(y);\n return date;\n }\n\n return new Date(y, m, d, H, M, S, L);\n}\nfunction utcdayofyear(d) {\n return utcDayOfYear(new Date(d));\n}\nfunction utcweek(d) {\n return utcWeekNum(new Date(d));\n}\nfunction utcDayOfYear(d) {\n const y = Date.UTC(d.getUTCFullYear(), 0, 1);\n return utcDay.count(y - 1, d);\n}\nfunction utcWeekNum(d) {\n const y = Date.UTC(d.getUTCFullYear(), 0, 1);\n return utcWeek.count(y - 1, d);\n}\nfunction utcFirst(y) {\n t0.setTime(Date.UTC(y, 0, 1));\n return t0.getUTCDay();\n}\nfunction utcDate(y, m, d, H, M, S, L) {\n if (0 <= y && y < 100) {\n const date = new Date(Date.UTC(-1, m, d, H, M, S, L));\n date.setUTCFullYear(d.y);\n return date;\n }\n\n return new Date(Date.UTC(y, m, d, H, M, S, L));\n}\n\nfunction floor(units, step, get, inv, newDate) {\n const s = step || 1,\n b = peek(units),\n _ = (unit, p, key) => {\n key = key || unit;\n return getUnit(get[key], inv[key], unit === b && s, p);\n };\n\n const t = new Date(),\n u = toSet(units),\n y = u[YEAR] ? _(YEAR) : constant(2012),\n m = u[MONTH] ? _(MONTH) : u[QUARTER] ? _(QUARTER) : zero,\n d = u[WEEK] && u[DAY] ? _(DAY, 1, WEEK + DAY) : u[WEEK] ? _(WEEK, 1) : u[DAY] ? _(DAY, 1) : u[DATE] ? _(DATE, 1) : u[DAYOFYEAR] ? _(DAYOFYEAR, 1) : one,\n H = u[HOURS] ? _(HOURS) : zero,\n M = u[MINUTES] ? _(MINUTES) : zero,\n S = u[SECONDS] ? _(SECONDS) : zero,\n L = u[MILLISECONDS] ? _(MILLISECONDS) : zero;\n return function (v) {\n t.setTime(+v);\n const year = y(t);\n return newDate(year, m(t), d(t, year), H(t), M(t), S(t), L(t));\n };\n}\n\nfunction getUnit(f, inv, step, phase) {\n const u = step <= 1 ? f : phase ? (d, y) => phase + step * Math.floor((f(d, y) - phase) / step) : (d, y) => step * Math.floor(f(d, y) / step);\n return inv ? (d, y) => inv(u(d, y), y) : u;\n} // returns the day of the year based on week number, day of week,\n// and the day of the week for the first day of the year\n\n\nfunction weekday(week, day, firstDay) {\n return day + week * 7 - (firstDay + 6) % 7;\n} // -- LOCAL TIME --\n\n\nconst localGet = {\n [YEAR]: d => d.getFullYear(),\n [QUARTER]: d => Math.floor(d.getMonth() / 3),\n [MONTH]: d => d.getMonth(),\n [DATE]: d => d.getDate(),\n [HOURS]: d => d.getHours(),\n [MINUTES]: d => d.getMinutes(),\n [SECONDS]: d => d.getSeconds(),\n [MILLISECONDS]: d => d.getMilliseconds(),\n [DAYOFYEAR]: d => localDayOfYear(d),\n [WEEK]: d => localWeekNum(d),\n [WEEK + DAY]: (d, y) => weekday(localWeekNum(d), d.getDay(), localFirst(y)),\n [DAY]: (d, y) => weekday(1, d.getDay(), localFirst(y))\n};\nconst localInv = {\n [QUARTER]: q => 3 * q,\n [WEEK]: (w, y) => weekday(w, 0, localFirst(y))\n};\nfunction timeFloor(units, step) {\n return floor(units, step || 1, localGet, localInv, localDate);\n} // -- UTC TIME --\n\nconst utcGet = {\n [YEAR]: d => d.getUTCFullYear(),\n [QUARTER]: d => Math.floor(d.getUTCMonth() / 3),\n [MONTH]: d => d.getUTCMonth(),\n [DATE]: d => d.getUTCDate(),\n [HOURS]: d => d.getUTCHours(),\n [MINUTES]: d => d.getUTCMinutes(),\n [SECONDS]: d => d.getUTCSeconds(),\n [MILLISECONDS]: d => d.getUTCMilliseconds(),\n [DAYOFYEAR]: d => utcDayOfYear(d),\n [WEEK]: d => utcWeekNum(d),\n [DAY]: (d, y) => weekday(1, d.getUTCDay(), utcFirst(y)),\n [WEEK + DAY]: (d, y) => weekday(utcWeekNum(d), d.getUTCDay(), utcFirst(y))\n};\nconst utcInv = {\n [QUARTER]: q => 3 * q,\n [WEEK]: (w, y) => weekday(w, 0, utcFirst(y))\n};\nfunction utcFloor(units, step) {\n return floor(units, step || 1, utcGet, utcInv, utcDate);\n}\n\nconst timeIntervals = {\n [YEAR]: timeYear,\n [QUARTER]: timeMonth.every(3),\n [MONTH]: timeMonth,\n [WEEK]: timeWeek,\n [DATE]: timeDay,\n [DAY]: timeDay,\n [DAYOFYEAR]: timeDay,\n [HOURS]: timeHour,\n [MINUTES]: timeMinute,\n [SECONDS]: timeSecond,\n [MILLISECONDS]: timeMillisecond\n};\nconst utcIntervals = {\n [YEAR]: utcYear,\n [QUARTER]: utcMonth.every(3),\n [MONTH]: utcMonth,\n [WEEK]: utcWeek,\n [DATE]: utcDay,\n [DAY]: utcDay,\n [DAYOFYEAR]: utcDay,\n [HOURS]: utcHour,\n [MINUTES]: utcMinute,\n [SECONDS]: utcSecond,\n [MILLISECONDS]: utcMillisecond\n};\nfunction timeInterval(unit) {\n return timeIntervals[unit];\n}\nfunction utcInterval(unit) {\n return utcIntervals[unit];\n}\n\nfunction offset(ival, date, step) {\n return ival ? ival.offset(date, step) : undefined;\n}\n\nfunction timeOffset(unit, date, step) {\n return offset(timeInterval(unit), date, step);\n}\nfunction utcOffset(unit, date, step) {\n return offset(utcInterval(unit), date, step);\n}\n\nfunction sequence(ival, start, stop, step) {\n return ival ? ival.range(start, stop, step) : undefined;\n}\n\nfunction timeSequence(unit, start, stop, step) {\n return sequence(timeInterval(unit), start, stop, step);\n}\nfunction utcSequence(unit, start, stop, step) {\n return sequence(utcInterval(unit), start, stop, step);\n}\n\nconst durationSecond = 1000,\n durationMinute = durationSecond * 60,\n durationHour = durationMinute * 60,\n durationDay = durationHour * 24,\n durationWeek = durationDay * 7,\n durationMonth = durationDay * 30,\n durationYear = durationDay * 365;\nconst Milli = [YEAR, MONTH, DATE, HOURS, MINUTES, SECONDS, MILLISECONDS],\n Seconds = Milli.slice(0, -1),\n Minutes = Seconds.slice(0, -1),\n Hours = Minutes.slice(0, -1),\n Day = Hours.slice(0, -1),\n Week = [YEAR, WEEK],\n Month = [YEAR, MONTH],\n Year = [YEAR];\nconst intervals = [[Seconds, 1, durationSecond], [Seconds, 5, 5 * durationSecond], [Seconds, 15, 15 * durationSecond], [Seconds, 30, 30 * durationSecond], [Minutes, 1, durationMinute], [Minutes, 5, 5 * durationMinute], [Minutes, 15, 15 * durationMinute], [Minutes, 30, 30 * durationMinute], [Hours, 1, durationHour], [Hours, 3, 3 * durationHour], [Hours, 6, 6 * durationHour], [Hours, 12, 12 * durationHour], [Day, 1, durationDay], [Week, 1, durationWeek], [Month, 1, durationMonth], [Month, 3, 3 * durationMonth], [Year, 1, durationYear]];\nfunction bin (opt) {\n const ext = opt.extent,\n max = opt.maxbins || 40,\n target = Math.abs(span(ext)) / max;\n let i = bisector(i => i[2]).right(intervals, target),\n units,\n step;\n\n if (i === intervals.length) {\n units = Year, step = tickStep(ext[0] / durationYear, ext[1] / durationYear, max);\n } else if (i) {\n i = intervals[target / intervals[i - 1][2] < intervals[i][2] / target ? i - 1 : i];\n units = i[0];\n step = i[1];\n } else {\n units = Milli;\n step = Math.max(tickStep(ext[0], ext[1], max), 1);\n }\n\n return {\n units,\n step\n };\n}\n\nexport { DATE, DAY, DAYOFYEAR, HOURS, MILLISECONDS, MINUTES, MONTH, QUARTER, SECONDS, TIME_UNITS, WEEK, YEAR, dayofyear, bin as timeBin, timeFloor, timeInterval, timeOffset, timeSequence, timeUnitSpecifier, timeUnits, utcFloor, utcInterval, utcOffset, utcSequence, utcdayofyear, utcweek, week };\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 { tickStep } from 'd3-array';\nimport { formatSpecifier, precisionFixed, precisionRound, precisionPrefix, format, formatPrefix, formatLocale } from 'd3-format';\nimport { SECONDS, MINUTES, HOURS, DATE, WEEK, MONTH, QUARTER, YEAR, MILLISECONDS, DAY, timeInterval, utcInterval } from 'vega-time';\nimport { isString, isObject, error, extend } from 'vega-util';\nimport { timeFormat, timeParse, utcFormat, utcParse, timeFormatLocale as timeFormatLocale$1 } from 'd3-time-format';\n\nfunction memoize (method) {\n const cache = {};\n return spec => cache[spec] || (cache[spec] = method(spec));\n}\n\nfunction trimZeroes(numberFormat, decimalChar) {\n return x => {\n const str = numberFormat(x),\n dec = str.indexOf(decimalChar);\n if (dec < 0) return str;\n let idx = rightmostDigit(str, dec);\n const end = idx < str.length ? str.slice(idx) : '';\n\n while (--idx > dec) if (str[idx] !== '0') {\n ++idx;\n break;\n }\n\n return str.slice(0, idx) + end;\n };\n}\n\nfunction rightmostDigit(str, dec) {\n let i = str.lastIndexOf('e'),\n c;\n if (i > 0) return i;\n\n for (i = str.length; --i > dec;) {\n c = str.charCodeAt(i);\n if (c >= 48 && c <= 57) return i + 1; // is digit\n }\n}\n\nfunction numberLocale(locale) {\n const format = memoize(locale.format),\n formatPrefix = locale.formatPrefix;\n return {\n format,\n formatPrefix,\n\n formatFloat(spec) {\n const s = formatSpecifier(spec || ',');\n\n if (s.precision == null) {\n s.precision = 12;\n\n switch (s.type) {\n case '%':\n s.precision -= 2;\n break;\n\n case 'e':\n s.precision -= 1;\n break;\n }\n\n return trimZeroes(format(s), // number format\n format('.1f')(1)[1] // decimal point character\n );\n } else {\n return format(s);\n }\n },\n\n formatSpan(start, stop, count, specifier) {\n specifier = formatSpecifier(specifier == null ? ',f' : specifier);\n const step = tickStep(start, stop, count),\n value = Math.max(Math.abs(start), Math.abs(stop));\n let precision;\n\n if (specifier.precision == null) {\n switch (specifier.type) {\n case 's':\n {\n if (!isNaN(precision = precisionPrefix(step, value))) {\n specifier.precision = precision;\n }\n\n return formatPrefix(specifier, value);\n }\n\n case '':\n case 'e':\n case 'g':\n case 'p':\n case 'r':\n {\n if (!isNaN(precision = precisionRound(step, value))) {\n specifier.precision = precision - (specifier.type === 'e');\n }\n\n break;\n }\n\n case 'f':\n case '%':\n {\n if (!isNaN(precision = precisionFixed(step))) {\n specifier.precision = precision - (specifier.type === '%') * 2;\n }\n\n break;\n }\n }\n }\n\n return format(specifier);\n }\n\n };\n}\n\nlet defaultNumberLocale;\nresetNumberFormatDefaultLocale();\nfunction resetNumberFormatDefaultLocale() {\n return defaultNumberLocale = numberLocale({\n format: format,\n formatPrefix: formatPrefix\n });\n}\nfunction numberFormatLocale(definition) {\n return numberLocale(formatLocale(definition));\n}\nfunction numberFormatDefaultLocale(definition) {\n return arguments.length ? defaultNumberLocale = numberFormatLocale(definition) : defaultNumberLocale;\n}\n\nfunction timeMultiFormat(format, interval, spec) {\n spec = spec || {};\n\n if (!isObject(spec)) {\n error(\"Invalid time multi-format specifier: \".concat(spec));\n }\n\n const second = interval(SECONDS),\n minute = interval(MINUTES),\n hour = interval(HOURS),\n day = interval(DATE),\n week = interval(WEEK),\n month = interval(MONTH),\n quarter = interval(QUARTER),\n year = interval(YEAR),\n L = format(spec[MILLISECONDS] || '.%L'),\n S = format(spec[SECONDS] || ':%S'),\n M = format(spec[MINUTES] || '%I:%M'),\n H = format(spec[HOURS] || '%I %p'),\n d = format(spec[DATE] || spec[DAY] || '%a %d'),\n w = format(spec[WEEK] || '%b %d'),\n m = format(spec[MONTH] || '%B'),\n q = format(spec[QUARTER] || '%B'),\n y = format(spec[YEAR] || '%Y');\n return date => (second(date) < date ? L : minute(date) < date ? S : hour(date) < date ? M : day(date) < date ? H : month(date) < date ? week(date) < date ? d : w : year(date) < date ? quarter(date) < date ? m : q : y)(date);\n}\n\nfunction timeLocale(locale) {\n const timeFormat = memoize(locale.format),\n utcFormat = memoize(locale.utcFormat);\n return {\n timeFormat: spec => isString(spec) ? timeFormat(spec) : timeMultiFormat(timeFormat, timeInterval, spec),\n utcFormat: spec => isString(spec) ? utcFormat(spec) : timeMultiFormat(utcFormat, utcInterval, spec),\n timeParse: memoize(locale.parse),\n utcParse: memoize(locale.utcParse)\n };\n}\n\nlet defaultTimeLocale;\nresetTimeFormatDefaultLocale();\nfunction resetTimeFormatDefaultLocale() {\n return defaultTimeLocale = timeLocale({\n format: timeFormat,\n parse: timeParse,\n utcFormat: utcFormat,\n utcParse: utcParse\n });\n}\nfunction timeFormatLocale(definition) {\n return timeLocale(timeFormatLocale$1(definition));\n}\nfunction timeFormatDefaultLocale(definition) {\n return arguments.length ? defaultTimeLocale = timeFormatLocale(definition) : defaultTimeLocale;\n}\n\nconst createLocale = (number, time) => extend({}, number, time);\n\nfunction locale(numberSpec, timeSpec) {\n const number = numberSpec ? numberFormatLocale(numberSpec) : numberFormatDefaultLocale();\n const time = timeSpec ? timeFormatLocale(timeSpec) : timeFormatDefaultLocale();\n return createLocale(number, time);\n}\nfunction defaultLocale(numberSpec, timeSpec) {\n const args = arguments.length;\n\n if (args && args !== 2) {\n error('defaultLocale expects either zero or two arguments.');\n }\n\n return args ? createLocale(numberFormatDefaultLocale(numberSpec), timeFormatDefaultLocale(timeSpec)) : createLocale(numberFormatDefaultLocale(), timeFormatDefaultLocale());\n}\nfunction resetDefaultLocale() {\n resetNumberFormatDefaultLocale();\n resetTimeFormatDefaultLocale();\n return defaultLocale();\n}\n\nexport { defaultLocale, locale, numberFormatDefaultLocale, numberFormatLocale, resetDefaultLocale, resetNumberFormatDefaultLocale, resetTimeFormatDefaultLocale, timeFormatDefaultLocale, timeFormatLocale };\n","import { extend, error, isFunction, stringValue, toBoolean, toNumber, toDate, toString, identity, field, isObject, isArray, isIterable, hasOwnProperty } from 'vega-util';\nimport { dsvFormat } from 'd3-dsv';\nimport { feature, mesh } from 'topojson-client';\nimport { timeFormatDefaultLocale } from 'vega-format';\n\n// https://... file://... //...\n\nconst protocol_re = /^(data:|([A-Za-z]+:)?\\/\\/)/; // Matches allowed URIs. From https://github.com/cure53/DOMPurify/blob/master/src/regexp.js with added file://\n\nconst allowed_re = /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i; // eslint-disable-line no-useless-escape\n\nconst whitespace_re = /[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205f\\u3000]/g; // eslint-disable-line no-control-regex\n// Special treatment in node.js for the file: protocol\n\nconst fileProtocol = 'file://';\n/**\n * Factory for a loader constructor that provides methods for requesting\n * files from either the network or disk, and for sanitizing request URIs.\n * @param {function} fetch - The Fetch API for HTTP network requests.\n * If null or undefined, HTTP loading will be disabled.\n * @param {object} fs - The file system interface for file loading.\n * If null or undefined, local file loading will be disabled.\n * @return {function} A loader constructor with the following signature:\n * param {object} [options] - Optional default loading options to use.\n * return {object} - A new loader instance.\n */\n\nfunction loaderFactory (fetch, fs) {\n return options => ({\n options: options || {},\n sanitize: sanitize,\n load: load,\n fileAccess: !!fs,\n file: fileLoader(fs),\n http: httpLoader(fetch)\n });\n}\n/**\n * Load an external resource, typically either from the web or from the local\n * filesystem. This function uses {@link sanitize} to first sanitize the uri,\n * then calls either {@link http} (for web requests) or {@link file} (for\n * filesystem loading).\n * @param {string} uri - The resource indicator (e.g., URL or filename).\n * @param {object} [options] - Optional loading options. These options will\n * override any existing default options.\n * @return {Promise} - A promise that resolves to the loaded content.\n */\n\nasync function load(uri, options) {\n const opt = await this.sanitize(uri, options),\n url = opt.href;\n return opt.localFile ? this.file(url) : this.http(url, options);\n}\n/**\n * URI sanitizer function.\n * @param {string} uri - The uri (url or filename) to check.\n * @param {object} options - An options hash.\n * @return {Promise} - A promise that resolves to an object containing\n * sanitized uri data, or rejects it the input uri is deemed invalid.\n * The properties of the resolved object are assumed to be\n * valid attributes for an HTML 'a' tag. The sanitized uri *must* be\n * provided by the 'href' property of the returned object.\n */\n\n\nasync function sanitize(uri, options) {\n options = extend({}, this.options, options);\n const fileAccess = this.fileAccess,\n result = {\n href: null\n };\n let isFile, loadFile, base;\n const isAllowed = allowed_re.test(uri.replace(whitespace_re, ''));\n\n if (uri == null || typeof uri !== 'string' || !isAllowed) {\n error('Sanitize failure, invalid URI: ' + stringValue(uri));\n }\n\n const hasProtocol = protocol_re.test(uri); // if relative url (no protocol/host), prepend baseURL\n\n if ((base = options.baseURL) && !hasProtocol) {\n // Ensure that there is a slash between the baseURL (e.g. hostname) and url\n if (!uri.startsWith('/') && !base.endsWith('/')) {\n uri = '/' + uri;\n }\n\n uri = base + uri;\n } // should we load from file system?\n\n\n loadFile = (isFile = uri.startsWith(fileProtocol)) || options.mode === 'file' || options.mode !== 'http' && !hasProtocol && fileAccess;\n\n if (isFile) {\n // strip file protocol\n uri = uri.slice(fileProtocol.length);\n } else if (uri.startsWith('//')) {\n if (options.defaultProtocol === 'file') {\n // if is file, strip protocol and set loadFile flag\n uri = uri.slice(2);\n loadFile = true;\n } else {\n // if relative protocol (starts with '//'), prepend default protocol\n uri = (options.defaultProtocol || 'http') + ':' + uri;\n }\n } // set non-enumerable mode flag to indicate local file load\n\n\n Object.defineProperty(result, 'localFile', {\n value: !!loadFile\n }); // set uri\n\n result.href = uri; // set default result target, if specified\n\n if (options.target) {\n result.target = options.target + '';\n } // set default result rel, if specified (#1542)\n\n\n if (options.rel) {\n result.rel = options.rel + '';\n } // provide control over cross-origin image handling (#2238)\n // https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image\n\n\n if (options.context === 'image' && options.crossOrigin) {\n result.crossOrigin = options.crossOrigin + '';\n } // return\n\n\n return result;\n}\n/**\n * File system loader factory.\n * @param {object} fs - The file system interface.\n * @return {function} - A file loader with the following signature:\n * param {string} filename - The file system path to load.\n * param {string} filename - The file system path to load.\n * return {Promise} A promise that resolves to the file contents.\n */\n\n\nfunction fileLoader(fs) {\n return fs ? filename => new Promise((accept, reject) => {\n fs.readFile(filename, (error, data) => {\n if (error) reject(error);else accept(data);\n });\n }) : fileReject;\n}\n/**\n * Default file system loader that simply rejects.\n */\n\n\nasync function fileReject() {\n error('No file system access.');\n}\n/**\n * HTTP request handler factory.\n * @param {function} fetch - The Fetch API method.\n * @return {function} - An http loader with the following signature:\n * param {string} url - The url to request.\n * param {object} options - An options hash.\n * return {Promise} - A promise that resolves to the file contents.\n */\n\n\nfunction httpLoader(fetch) {\n return fetch ? async function (url, options) {\n const opt = extend({}, this.options.http, options),\n type = options && options.response,\n response = await fetch(url, opt);\n return !response.ok ? error(response.status + '' + response.statusText) : isFunction(response[type]) ? response[type]() : response.text();\n } : httpReject;\n}\n/**\n * Default http request handler that simply rejects.\n */\n\n\nasync function httpReject() {\n error('No HTTP fetch method available.');\n}\n\nconst isValid = _ => _ != null && _ === _;\n\nconst isBoolean = _ => _ === 'true' || _ === 'false' || _ === true || _ === false;\n\nconst isDate = _ => !Number.isNaN(Date.parse(_));\n\nconst isNumber = _ => !Number.isNaN(+_) && !(_ instanceof Date);\n\nconst isInteger = _ => isNumber(_) && Number.isInteger(+_);\n\nconst typeParsers = {\n boolean: toBoolean,\n integer: toNumber,\n number: toNumber,\n date: toDate,\n string: toString,\n unknown: identity\n};\nconst typeTests = [isBoolean, isInteger, isNumber, isDate];\nconst typeList = ['boolean', 'integer', 'number', 'date'];\nfunction inferType(values, field) {\n if (!values || !values.length) return 'unknown';\n const n = values.length,\n m = typeTests.length,\n a = typeTests.map((_, i) => i + 1);\n\n for (let i = 0, t = 0, j, value; i < n; ++i) {\n value = field ? values[i][field] : values[i];\n\n for (j = 0; j < m; ++j) {\n if (a[j] && isValid(value) && !typeTests[j](value)) {\n a[j] = 0;\n ++t;\n if (t === typeTests.length) return 'string';\n }\n }\n }\n\n return typeList[a.reduce((u, v) => u === 0 ? v : u, 0) - 1];\n}\nfunction inferTypes(data, fields) {\n return fields.reduce((types, field) => {\n types[field] = inferType(data, field);\n return types;\n }, {});\n}\n\nfunction delimitedFormat(delimiter) {\n const parse = function (data, format) {\n const delim = {\n delimiter: delimiter\n };\n return dsv(data, format ? extend(format, delim) : delim);\n };\n\n parse.responseType = 'text';\n return parse;\n}\nfunction dsv(data, format) {\n if (format.header) {\n data = format.header.map(stringValue).join(format.delimiter) + '\\n' + data;\n }\n\n return dsvFormat(format.delimiter).parse(data + '');\n}\ndsv.responseType = 'text';\n\nfunction isBuffer(_) {\n return typeof Buffer === 'function' && isFunction(Buffer.isBuffer) ? Buffer.isBuffer(_) : false;\n}\n\nfunction json(data, format) {\n const prop = format && format.property ? field(format.property) : identity;\n return isObject(data) && !isBuffer(data) ? parseJSON(prop(data), format) : prop(JSON.parse(data));\n}\njson.responseType = 'json';\n\nfunction parseJSON(data, format) {\n if (!isArray(data) && isIterable(data)) {\n data = [...data];\n }\n\n return format && format.copy ? JSON.parse(JSON.stringify(data)) : data;\n}\n\nconst filters = {\n interior: (a, b) => a !== b,\n exterior: (a, b) => a === b\n};\nfunction topojson(data, format) {\n let method, object, property, filter;\n data = json(data, format);\n\n if (format && format.feature) {\n method = feature;\n property = format.feature;\n } else if (format && format.mesh) {\n method = mesh;\n property = format.mesh;\n filter = filters[format.filter];\n } else {\n error('Missing TopoJSON feature or mesh parameter.');\n }\n\n object = (object = data.objects[property]) ? method(data, object, filter) : error('Invalid TopoJSON object: ' + property);\n return object && object.features || [object];\n}\ntopojson.responseType = 'json';\n\nconst format = {\n dsv: dsv,\n csv: delimitedFormat(','),\n tsv: delimitedFormat('\\t'),\n json: json,\n topojson: topojson\n};\nfunction formats(name, reader) {\n if (arguments.length > 1) {\n format[name] = reader;\n return this;\n } else {\n return hasOwnProperty(format, name) ? format[name] : null;\n }\n}\nfunction responseType(type) {\n const f = formats(type);\n return f && f.responseType || 'text';\n}\n\nfunction read (data, schema, timeParser, utcParser) {\n schema = schema || {};\n const reader = formats(schema.type || 'json');\n if (!reader) error('Unknown data format type: ' + schema.type);\n data = reader(data, schema);\n if (schema.parse) parse(data, schema.parse, timeParser, utcParser);\n if (hasOwnProperty(data, 'columns')) delete data.columns;\n return data;\n}\n\nfunction parse(data, types, timeParser, utcParser) {\n if (!data.length) return; // early exit for empty data\n\n const locale = timeFormatDefaultLocale();\n timeParser = timeParser || locale.timeParse;\n utcParser = utcParser || locale.utcParse;\n let fields = data.columns || Object.keys(data[0]),\n datum,\n field,\n i,\n j,\n n,\n m;\n if (types === 'auto') types = inferTypes(data, fields);\n fields = Object.keys(types);\n const parsers = fields.map(field => {\n const type = types[field];\n let parts, pattern;\n\n if (type && (type.startsWith('date:') || type.startsWith('utc:'))) {\n parts = type.split(/:(.+)?/, 2); // split on first :\n\n pattern = parts[1];\n\n if (pattern[0] === '\\'' && pattern[pattern.length - 1] === '\\'' || pattern[0] === '\"' && pattern[pattern.length - 1] === '\"') {\n pattern = pattern.slice(1, -1);\n }\n\n const parse = parts[0] === 'utc' ? utcParser : timeParser;\n return parse(pattern);\n }\n\n if (!typeParsers[type]) {\n throw Error('Illegal format pattern: ' + field + ':' + type);\n }\n\n return typeParsers[type];\n });\n\n for (i = 0, n = data.length, m = fields.length; i < n; ++i) {\n datum = data[i];\n\n for (j = 0; j < m; ++j) {\n field = fields[j];\n datum[field] = parsers[j](datum[field]);\n }\n }\n}\n\nconst loader = loaderFactory(typeof fetch !== 'undefined' && fetch, // use built-in fetch API\nnull // no file system access\n);\n\nexport { format, formats, inferType, inferTypes, loader, read, responseType, typeParsers };\n","import { identity, array, isFunction, constant, isArray, id, error, truthy, debounce, extend, visitArray, inherits, logger, Error, hasOwnProperty } from 'vega-util';\nimport { read, responseType, loader } from 'vega-loader';\nimport { defaultLocale } from 'vega-format';\n\nfunction UniqueList(idFunc) {\n const $ = idFunc || identity,\n list = [],\n ids = {};\n\n list.add = _ => {\n const id = $(_);\n\n if (!ids[id]) {\n ids[id] = 1;\n list.push(_);\n }\n\n return list;\n };\n\n list.remove = _ => {\n const id = $(_);\n\n if (ids[id]) {\n ids[id] = 0;\n const idx = list.indexOf(_);\n if (idx >= 0) list.splice(idx, 1);\n }\n\n return list;\n };\n\n return list;\n}\n\n/**\n * Invoke and await a potentially async callback function. If\n * an error occurs, trap it and route to Dataflow.error.\n * @param {Dataflow} df - The dataflow instance\n * @param {function} callback - A callback function to invoke\n * and then await. The dataflow will be passed as the single\n * argument to the function.\n */\nasync function asyncCallback (df, callback) {\n try {\n await callback(df);\n } catch (err) {\n df.error(err);\n }\n}\n\nconst TUPLE_ID_KEY = Symbol('vega_id');\nlet TUPLE_ID = 1;\n/**\n * Checks if an input value is a registered tuple.\n * @param {*} t - The value to check.\n * @return {boolean} True if the input is a tuple, false otherwise.\n */\n\nfunction isTuple(t) {\n return !!(t && tupleid(t));\n}\n/**\n * Returns the id of a tuple.\n * @param {object} t - The input tuple.\n * @return {*} the tuple id.\n */\n\nfunction tupleid(t) {\n return t[TUPLE_ID_KEY];\n}\n/**\n * Sets the id of a tuple.\n * @param {object} t - The input tuple.\n * @param {*} id - The id value to set.\n * @return {object} the input tuple.\n */\n\nfunction setid(t, id) {\n t[TUPLE_ID_KEY] = id;\n return t;\n}\n/**\n * Ingest an object or value as a data tuple.\n * If the input value is an object, an id field will be added to it. For\n * efficiency, the input object is modified directly. A copy is not made.\n * If the input value is a literal, it will be wrapped in a new object\n * instance, with the value accessible as the 'data' property.\n * @param datum - The value to ingest.\n * @return {object} The ingested data tuple.\n */\n\n\nfunction ingest$1(datum) {\n const t = datum === Object(datum) ? datum : {\n data: datum\n };\n return tupleid(t) ? t : setid(t, TUPLE_ID++);\n}\n/**\n * Given a source tuple, return a derived copy.\n * @param {object} t - The source tuple.\n * @return {object} The derived tuple.\n */\n\nfunction derive(t) {\n return rederive(t, ingest$1({}));\n}\n/**\n * Rederive a derived tuple by copying values from the source tuple.\n * @param {object} t - The source tuple.\n * @param {object} d - The derived tuple.\n * @return {object} The derived tuple.\n */\n\nfunction rederive(t, d) {\n for (const k in t) d[k] = t[k];\n\n return d;\n}\n/**\n * Replace an existing tuple with a new tuple.\n * @param {object} t - The existing data tuple.\n * @param {object} d - The new tuple that replaces the old.\n * @return {object} The new tuple.\n */\n\nfunction replace(t, d) {\n return setid(d, tupleid(t));\n}\n/**\n * Generate an augmented comparator function that provides stable\n * sorting by tuple id when the given comparator produces ties.\n * @param {function} cmp - The comparator to augment.\n * @param {function} [f] - Optional tuple accessor function.\n * @return {function} An augmented comparator function.\n */\n\nfunction stableCompare(cmp, f) {\n return !cmp ? null : f ? (a, b) => cmp(a, b) || tupleid(f(a)) - tupleid(f(b)) : (a, b) => cmp(a, b) || tupleid(a) - tupleid(b);\n}\n\nfunction isChangeSet(v) {\n return v && v.constructor === changeset;\n}\nfunction changeset() {\n const add = [],\n // insert tuples\n rem = [],\n // remove tuples\n mod = [],\n // modify tuples\n remp = [],\n // remove by predicate\n modp = []; // modify by predicate\n\n let clean = null,\n reflow = false;\n return {\n constructor: changeset,\n\n insert(t) {\n const d = array(t),\n n = d.length;\n\n for (let i = 0; i < n; ++i) add.push(d[i]);\n\n return this;\n },\n\n remove(t) {\n const a = isFunction(t) ? remp : rem,\n d = array(t),\n n = d.length;\n\n for (let i = 0; i < n; ++i) a.push(d[i]);\n\n return this;\n },\n\n modify(t, field, value) {\n const m = {\n field: field,\n value: constant(value)\n };\n\n if (isFunction(t)) {\n m.filter = t;\n modp.push(m);\n } else {\n m.tuple = t;\n mod.push(m);\n }\n\n return this;\n },\n\n encode(t, set) {\n if (isFunction(t)) modp.push({\n filter: t,\n field: set\n });else mod.push({\n tuple: t,\n field: set\n });\n return this;\n },\n\n clean(value) {\n clean = value;\n return this;\n },\n\n reflow() {\n reflow = true;\n return this;\n },\n\n pulse(pulse, tuples) {\n const cur = {},\n out = {};\n let i, n, m, f, t, id; // build lookup table of current tuples\n\n for (i = 0, n = tuples.length; i < n; ++i) {\n cur[tupleid(tuples[i])] = 1;\n } // process individual tuples to remove\n\n\n for (i = 0, n = rem.length; i < n; ++i) {\n t = rem[i];\n cur[tupleid(t)] = -1;\n } // process predicate-based removals\n\n\n for (i = 0, n = remp.length; i < n; ++i) {\n f = remp[i];\n tuples.forEach(t => {\n if (f(t)) cur[tupleid(t)] = -1;\n });\n } // process all add tuples\n\n\n for (i = 0, n = add.length; i < n; ++i) {\n t = add[i];\n id = tupleid(t);\n\n if (cur[id]) {\n // tuple already resides in dataset\n // if flagged for both add and remove, cancel\n cur[id] = 1;\n } else {\n // tuple does not reside in dataset, add\n pulse.add.push(ingest$1(add[i]));\n }\n } // populate pulse rem list\n\n\n for (i = 0, n = tuples.length; i < n; ++i) {\n t = tuples[i];\n if (cur[tupleid(t)] < 0) pulse.rem.push(t);\n } // modify helper method\n\n\n function modify(t, f, v) {\n if (v) {\n t[f] = v(t);\n } else {\n pulse.encode = f;\n }\n\n if (!reflow) out[tupleid(t)] = t;\n } // process individual tuples to modify\n\n\n for (i = 0, n = mod.length; i < n; ++i) {\n m = mod[i];\n t = m.tuple;\n f = m.field;\n id = cur[tupleid(t)];\n\n if (id > 0) {\n modify(t, f, m.value);\n pulse.modifies(f);\n }\n } // process predicate-based modifications\n\n\n for (i = 0, n = modp.length; i < n; ++i) {\n m = modp[i];\n f = m.filter;\n tuples.forEach(t => {\n if (f(t) && cur[tupleid(t)] > 0) {\n modify(t, m.field, m.value);\n }\n });\n pulse.modifies(m.field);\n } // upon reflow request, populate mod with all non-removed tuples\n // otherwise, populate mod with modified tuples only\n\n\n if (reflow) {\n pulse.mod = rem.length || remp.length ? tuples.filter(t => cur[tupleid(t)] > 0) : tuples.slice();\n } else {\n for (id in out) pulse.mod.push(out[id]);\n } // set pulse garbage collection request\n\n\n if (clean || clean == null && (rem.length || remp.length)) {\n pulse.clean(true);\n }\n\n return pulse;\n }\n\n };\n}\n\nconst CACHE = '_:mod:_';\n/**\n * Hash that tracks modifications to assigned values.\n * Callers *must* use the set method to update values.\n */\n\nfunction Parameters() {\n Object.defineProperty(this, CACHE, {\n writable: true,\n value: {}\n });\n}\nParameters.prototype = {\n /**\n * Set a parameter value. If the parameter value changes, the parameter\n * will be recorded as modified.\n * @param {string} name - The parameter name.\n * @param {number} index - The index into an array-value parameter. Ignored if\n * the argument is undefined, null or less than zero.\n * @param {*} value - The parameter value to set.\n * @param {boolean} [force=false] - If true, records the parameter as modified\n * even if the value is unchanged.\n * @return {Parameters} - This parameter object.\n */\n set(name, index, value, force) {\n const o = this,\n v = o[name],\n mod = o[CACHE];\n\n if (index != null && index >= 0) {\n if (v[index] !== value || force) {\n v[index] = value;\n mod[index + ':' + name] = -1;\n mod[name] = -1;\n }\n } else if (v !== value || force) {\n o[name] = value;\n mod[name] = isArray(value) ? 1 + value.length : -1;\n }\n\n return o;\n },\n\n /**\n * Tests if one or more parameters has been modified. If invoked with no\n * arguments, returns true if any parameter value has changed. If the first\n * argument is array, returns trues if any parameter name in the array has\n * changed. Otherwise, tests if the given name and optional array index has\n * changed.\n * @param {string} name - The parameter name to test.\n * @param {number} [index=undefined] - The parameter array index to test.\n * @return {boolean} - Returns true if a queried parameter was modified.\n */\n modified(name, index) {\n const mod = this[CACHE];\n\n if (!arguments.length) {\n for (const k in mod) {\n if (mod[k]) return true;\n }\n\n return false;\n } else if (isArray(name)) {\n for (let k = 0; k < name.length; ++k) {\n if (mod[name[k]]) return true;\n }\n\n return false;\n }\n\n return index != null && index >= 0 ? index + 1 < mod[name] || !!mod[index + ':' + name] : !!mod[name];\n },\n\n /**\n * Clears the modification records. After calling this method,\n * all parameters are considered unmodified.\n */\n clear() {\n this[CACHE] = {};\n return this;\n }\n\n};\n\nlet OP_ID = 0;\nconst PULSE = 'pulse',\n NO_PARAMS = new Parameters(); // Boolean Flags\n\nconst SKIP$1 = 1,\n MODIFIED = 2;\n/**\n * An Operator is a processing node in a dataflow graph.\n * Each operator stores a value and an optional value update function.\n * Operators can accept a hash of named parameters. Parameter values can\n * either be direct (JavaScript literals, arrays, objects) or indirect\n * (other operators whose values will be pulled dynamically). Operators\n * included as parameters will have this operator added as a dependency.\n * @constructor\n * @param {*} [init] - The initial value for this operator.\n * @param {function(object, Pulse)} [update] - An update function. Upon\n * evaluation of this operator, the update function will be invoked and the\n * return value will be used as the new value of this operator.\n * @param {object} [params] - The parameters for this operator.\n * @param {boolean} [react=true] - Flag indicating if this operator should\n * listen for changes to upstream operators included as parameters.\n * @see parameters\n */\n\nfunction Operator(init, update, params, react) {\n this.id = ++OP_ID;\n this.value = init;\n this.stamp = -1;\n this.rank = -1;\n this.qrank = -1;\n this.flags = 0;\n\n if (update) {\n this._update = update;\n }\n\n if (params) this.parameters(params, react);\n}\n\nfunction flag(bit) {\n return function (state) {\n const f = this.flags;\n if (arguments.length === 0) return !!(f & bit);\n this.flags = state ? f | bit : f & ~bit;\n return this;\n };\n}\n\nOperator.prototype = {\n /**\n * Returns a list of target operators dependent on this operator.\n * If this list does not exist, it is created and then returned.\n * @return {UniqueList}\n */\n targets() {\n return this._targets || (this._targets = UniqueList(id));\n },\n\n /**\n * Sets the value of this operator.\n * @param {*} value - the value to set.\n * @return {Number} Returns 1 if the operator value has changed\n * according to strict equality, returns 0 otherwise.\n */\n set(value) {\n if (this.value !== value) {\n this.value = value;\n return 1;\n } else {\n return 0;\n }\n },\n\n /**\n * Indicates that operator evaluation should be skipped on the next pulse.\n * This operator will still propagate incoming pulses, but its update function\n * will not be invoked. The skip flag is reset after every pulse, so calling\n * this method will affect processing of the next pulse only.\n */\n skip: flag(SKIP$1),\n\n /**\n * Indicates that this operator's value has been modified on its most recent\n * pulse. Normally modification is checked via strict equality; however, in\n * some cases it is more efficient to update the internal state of an object.\n * In those cases, the modified flag can be used to trigger propagation. Once\n * set, the modification flag persists across pulses until unset. The flag can\n * be used with the last timestamp to test if a modification is recent.\n */\n modified: flag(MODIFIED),\n\n /**\n * Sets the parameters for this operator. The parameter values are analyzed for\n * operator instances. If found, this operator will be added as a dependency\n * of the parameterizing operator. Operator values are dynamically marshalled\n * from each operator parameter prior to evaluation. If a parameter value is\n * an array, the array will also be searched for Operator instances. However,\n * the search does not recurse into sub-arrays or object properties.\n * @param {object} params - A hash of operator parameters.\n * @param {boolean} [react=true] - A flag indicating if this operator should\n * automatically update (react) when parameter values change. In other words,\n * this flag determines if the operator registers itself as a listener on\n * any upstream operators included in the parameters.\n * @param {boolean} [initonly=false] - A flag indicating if this operator\n * should calculate an update only upon its initial evaluation, then\n * deregister dependencies and suppress all future update invocations.\n * @return {Operator[]} - An array of upstream dependencies.\n */\n parameters(params, react, initonly) {\n react = react !== false;\n const argval = this._argval = this._argval || new Parameters(),\n argops = this._argops = this._argops || [],\n deps = [];\n let name, value, n, i;\n\n const add = (name, index, value) => {\n if (value instanceof Operator) {\n if (value !== this) {\n if (react) value.targets().add(this);\n deps.push(value);\n }\n\n argops.push({\n op: value,\n name: name,\n index: index\n });\n } else {\n argval.set(name, index, value);\n }\n };\n\n for (name in params) {\n value = params[name];\n\n if (name === PULSE) {\n array(value).forEach(op => {\n if (!(op instanceof Operator)) {\n error('Pulse parameters must be operator instances.');\n } else if (op !== this) {\n op.targets().add(this);\n deps.push(op);\n }\n });\n this.source = value;\n } else if (isArray(value)) {\n argval.set(name, -1, Array(n = value.length));\n\n for (i = 0; i < n; ++i) add(name, i, value[i]);\n } else {\n add(name, -1, value);\n }\n }\n\n this.marshall().clear(); // initialize values\n\n if (initonly) argops.initonly = true;\n return deps;\n },\n\n /**\n * Internal method for marshalling parameter values.\n * Visits each operator dependency to pull the latest value.\n * @return {Parameters} A Parameters object to pass to the update function.\n */\n marshall(stamp) {\n const argval = this._argval || NO_PARAMS,\n argops = this._argops;\n let item, i, op, mod;\n\n if (argops) {\n const n = argops.length;\n\n for (i = 0; i < n; ++i) {\n item = argops[i];\n op = item.op;\n mod = op.modified() && op.stamp === stamp;\n argval.set(item.name, item.index, op.value, mod);\n }\n\n if (argops.initonly) {\n for (i = 0; i < n; ++i) {\n item = argops[i];\n item.op.targets().remove(this);\n }\n\n this._argops = null;\n this._update = null;\n }\n }\n\n return argval;\n },\n\n /**\n * Detach this operator from the dataflow.\n * Unregisters listeners on upstream dependencies.\n */\n detach() {\n const argops = this._argops;\n let i, n, item, op;\n\n if (argops) {\n for (i = 0, n = argops.length; i < n; ++i) {\n item = argops[i];\n op = item.op;\n\n if (op._targets) {\n op._targets.remove(this);\n }\n }\n } // remove references to the source and pulse object,\n // if present, to prevent memory leaks of old data.\n\n\n this.pulse = null;\n this.source = null;\n },\n\n /**\n * Delegate method to perform operator processing.\n * Subclasses can override this method to perform custom processing.\n * By default, it marshalls parameters and calls the update function\n * if that function is defined. If the update function does not\n * change the operator value then StopPropagation is returned.\n * If no update function is defined, this method does nothing.\n * @param {Pulse} pulse - the current dataflow pulse.\n * @return The output pulse or StopPropagation. A falsy return value\n * (including undefined) will let the input pulse pass through.\n */\n evaluate(pulse) {\n const update = this._update;\n\n if (update) {\n const params = this.marshall(pulse.stamp),\n v = update.call(this, params, pulse);\n params.clear();\n\n if (v !== this.value) {\n this.value = v;\n } else if (!this.modified()) {\n return pulse.StopPropagation;\n }\n }\n },\n\n /**\n * Run this operator for the current pulse. If this operator has already\n * been run at (or after) the pulse timestamp, returns StopPropagation.\n * Internally, this method calls {@link evaluate} to perform processing.\n * If {@link evaluate} returns a falsy value, the input pulse is returned.\n * This method should NOT be overridden, instead overrride {@link evaluate}.\n * @param {Pulse} pulse - the current dataflow pulse.\n * @return the output pulse for this operator (or StopPropagation)\n */\n run(pulse) {\n if (pulse.stamp < this.stamp) return pulse.StopPropagation;\n let rv;\n\n if (this.skip()) {\n this.skip(false);\n rv = 0;\n } else {\n rv = this.evaluate(pulse);\n }\n\n return this.pulse = rv || pulse;\n }\n\n};\n\n/**\n * Add an operator to the dataflow graph. This function accepts a\n * variety of input argument types. The basic signature supports an\n * initial value, update function and parameters. If the first parameter\n * is an Operator instance, it will be added directly. If it is a\n * constructor for an Operator subclass, a new instance will be instantiated.\n * Otherwise, if the first parameter is a function instance, it will be used\n * as the update function and a null initial value is assumed.\n * @param {*} init - One of: the operator to add, the initial value of\n * the operator, an operator class to instantiate, or an update function.\n * @param {function} [update] - The operator update function.\n * @param {object} [params] - The operator parameters.\n * @param {boolean} [react=true] - Flag indicating if this operator should\n * listen for changes to upstream operators included as parameters.\n * @return {Operator} - The added operator.\n */\n\nfunction add (init, update, params, react) {\n let shift = 1,\n op;\n\n if (init instanceof Operator) {\n op = init;\n } else if (init && init.prototype instanceof Operator) {\n op = new init();\n } else if (isFunction(init)) {\n op = new Operator(null, init);\n } else {\n shift = 0;\n op = new Operator(init, update);\n }\n\n this.rank(op);\n\n if (shift) {\n react = params;\n params = update;\n }\n\n if (params) this.connect(op, op.parameters(params, react));\n this.touch(op);\n return op;\n}\n\n/**\n * Connect a target operator as a dependent of source operators.\n * If necessary, this method will rerank the target operator and its\n * dependents to ensure propagation proceeds in a topologically sorted order.\n * @param {Operator} target - The target operator.\n * @param {Array} - The source operators that should propagate\n * to the target operator.\n */\nfunction connect (target, sources) {\n const targetRank = target.rank,\n n = sources.length;\n\n for (let i = 0; i < n; ++i) {\n if (targetRank < sources[i].rank) {\n this.rerank(target);\n return;\n }\n }\n}\n\nlet STREAM_ID = 0;\n/**\n * Models an event stream.\n * @constructor\n * @param {function(Object, number): boolean} [filter] - Filter predicate.\n * Events pass through when truthy, events are suppressed when falsy.\n * @param {function(Object): *} [apply] - Applied to input events to produce\n * new event values.\n * @param {function(Object)} [receive] - Event callback function to invoke\n * upon receipt of a new event. Use to override standard event processing.\n */\n\nfunction EventStream(filter, apply, receive) {\n this.id = ++STREAM_ID;\n this.value = null;\n if (receive) this.receive = receive;\n if (filter) this._filter = filter;\n if (apply) this._apply = apply;\n}\n/**\n * Creates a new event stream instance with the provided\n * (optional) filter, apply and receive functions.\n * @param {function(Object, number): boolean} [filter] - Filter predicate.\n * Events pass through when truthy, events are suppressed when falsy.\n * @param {function(Object): *} [apply] - Applied to input events to produce\n * new event values.\n * @see EventStream\n */\n\nfunction stream(filter, apply, receive) {\n return new EventStream(filter, apply, receive);\n}\nEventStream.prototype = {\n _filter: truthy,\n _apply: identity,\n\n targets() {\n return this._targets || (this._targets = UniqueList(id));\n },\n\n consume(_) {\n if (!arguments.length) return !!this._consume;\n this._consume = !!_;\n return this;\n },\n\n receive(evt) {\n if (this._filter(evt)) {\n const val = this.value = this._apply(evt),\n trg = this._targets,\n n = trg ? trg.length : 0;\n\n for (let i = 0; i < n; ++i) trg[i].receive(val);\n\n if (this._consume) {\n evt.preventDefault();\n evt.stopPropagation();\n }\n }\n },\n\n filter(filter) {\n const s = stream(filter);\n this.targets().add(s);\n return s;\n },\n\n apply(apply) {\n const s = stream(null, apply);\n this.targets().add(s);\n return s;\n },\n\n merge() {\n const s = stream();\n this.targets().add(s);\n\n for (let i = 0, n = arguments.length; i < n; ++i) {\n arguments[i].targets().add(s);\n }\n\n return s;\n },\n\n throttle(pause) {\n let t = -1;\n return this.filter(() => {\n const now = Date.now();\n\n if (now - t > pause) {\n t = now;\n return 1;\n } else {\n return 0;\n }\n });\n },\n\n debounce(delay) {\n const s = stream();\n this.targets().add(stream(null, null, debounce(delay, e => {\n const df = e.dataflow;\n s.receive(e);\n if (df && df.run) df.run();\n })));\n return s;\n },\n\n between(a, b) {\n let active = false;\n a.targets().add(stream(null, null, () => active = true));\n b.targets().add(stream(null, null, () => active = false));\n return this.filter(() => active);\n },\n\n detach() {\n // ensures compatibility with operators (#2753)\n // remove references to other streams and filter functions that may\n // be bound to subcontexts that need to be garbage collected.\n this._filter = truthy;\n this._targets = null;\n }\n\n};\n\n/**\n * Create a new event stream from an event source.\n * @param {object} source - The event source to monitor. The input must\n * support the addEventListener method.\n * @param {string} type - The event type.\n * @param {function(object): boolean} [filter] - Event filter function.\n * @param {function(object): *} [apply] - Event application function.\n * If provided, this function will be invoked and the result will be\n * used as the downstream event value.\n * @return {EventStream}\n */\n\nfunction events (source, type, filter, apply) {\n const df = this,\n s = stream(filter, apply),\n send = function (e) {\n e.dataflow = df;\n\n try {\n s.receive(e);\n } catch (error) {\n df.error(error);\n } finally {\n df.run();\n }\n };\n\n let sources;\n\n if (typeof source === 'string' && typeof document !== 'undefined') {\n sources = document.querySelectorAll(source);\n } else {\n sources = array(source);\n }\n\n const n = sources.length;\n\n for (let i = 0; i < n; ++i) {\n sources[i].addEventListener(type, send);\n }\n\n return s;\n}\n\nfunction parse(data, format) {\n const locale = this.locale();\n return read(data, format, locale.timeParse, locale.utcParse);\n}\n/**\n * Ingests new data into the dataflow. First parses the data using the\n * vega-loader read method, then pulses a changeset to the target operator.\n * @param {Operator} target - The Operator to target with ingested data,\n * typically a Collect transform instance.\n * @param {*} data - The input data, prior to parsing. For JSON this may\n * be a string or an object. For CSV, TSV, etc should be a string.\n * @param {object} format - The data format description for parsing\n * loaded data. This object is passed to the vega-loader read method.\n * @returns {Dataflow}\n */\n\nfunction ingest(target, data, format) {\n data = this.parse(data, format);\n return this.pulse(target, this.changeset().insert(data));\n}\n/**\n * Request data from an external source, parse it, and return a Promise.\n * @param {string} url - The URL from which to load the data. This string\n * is passed to the vega-loader load method.\n * @param {object} [format] - The data format description for parsing\n * loaded data. This object is passed to the vega-loader read method.\n * @return {Promise} A Promise that resolves upon completion of the request.\n * The resolved object contains the following properties:\n * - data: an array of parsed data (or null upon error)\n * - status: a code for success (0), load fail (-1), or parse fail (-2)\n */\n\nasync function request(url, format) {\n const df = this;\n let status = 0,\n data;\n\n try {\n data = await df.loader().load(url, {\n context: 'dataflow',\n response: responseType(format && format.type)\n });\n\n try {\n data = df.parse(data, format);\n } catch (err) {\n status = -2;\n df.warn('Data ingestion failed', url, err);\n }\n } catch (err) {\n status = -1;\n df.warn('Loading failed', url, err);\n }\n\n return {\n data,\n status\n };\n}\nasync function preload(target, url, format) {\n const df = this,\n pending = df._pending || loadPending(df);\n pending.requests += 1;\n const res = await df.request(url, format);\n df.pulse(target, df.changeset().remove(truthy).insert(res.data || []));\n pending.done();\n return res;\n}\n\nfunction loadPending(df) {\n let accept;\n const pending = new Promise(a => accept = a);\n pending.requests = 0;\n\n pending.done = () => {\n if (--pending.requests === 0) {\n df._pending = null;\n accept(df);\n }\n };\n\n return df._pending = pending;\n}\n\nconst SKIP = {\n skip: true\n};\n/**\n * Perform operator updates in response to events. Applies an\n * update function to compute a new operator value. If the update function\n * returns a {@link ChangeSet}, the operator will be pulsed with those tuple\n * changes. Otherwise, the operator value will be updated to the return value.\n * @param {EventStream|Operator} source - The event source to react to.\n * This argument can be either an EventStream or an Operator.\n * @param {Operator|function(object):Operator} target - The operator to update.\n * This argument can either be an Operator instance or (if the source\n * argument is an EventStream), a function that accepts an event object as\n * input and returns an Operator to target.\n * @param {function(Parameters,Event): *} [update] - Optional update function\n * to compute the new operator value, or a literal value to set. Update\n * functions expect to receive a parameter object and event as arguments.\n * This function can either return a new operator value or (if the source\n * argument is an EventStream) a {@link ChangeSet} instance to pulse\n * the target operator with tuple changes.\n * @param {object} [params] - The update function parameters.\n * @param {object} [options] - Additional options hash. If not overridden,\n * updated operators will be skipped by default.\n * @param {boolean} [options.skip] - If true, the operator will\n * be skipped: it will not be evaluated, but its dependents will be.\n * @param {boolean} [options.force] - If true, the operator will\n * be re-evaluated even if its value has not changed.\n * @return {Dataflow}\n */\n\nfunction on (source, target, update, params, options) {\n const fn = source instanceof Operator ? onOperator : onStream;\n fn(this, source, target, update, params, options);\n return this;\n}\n\nfunction onStream(df, stream, target, update, params, options) {\n const opt = extend({}, options, SKIP);\n let func, op;\n if (!isFunction(target)) target = constant(target);\n\n if (update === undefined) {\n func = e => df.touch(target(e));\n } else if (isFunction(update)) {\n op = new Operator(null, update, params, false);\n\n func = e => {\n op.evaluate(e);\n const t = target(e),\n v = op.value;\n isChangeSet(v) ? df.pulse(t, v, options) : df.update(t, v, opt);\n };\n } else {\n func = e => df.update(target(e), update, opt);\n }\n\n stream.apply(func);\n}\n\nfunction onOperator(df, source, target, update, params, options) {\n if (update === undefined) {\n source.targets().add(target);\n } else {\n const opt = options || {},\n op = new Operator(null, updater(target, update), params, false);\n op.modified(opt.force);\n op.rank = source.rank; // immediately follow source\n\n source.targets().add(op); // add dependency\n\n if (target) {\n op.skip(true); // skip first invocation\n\n op.value = target.value; // initialize value\n\n op.targets().add(target); // chain dependencies\n\n df.connect(target, [op]); // rerank as needed, #1672\n }\n }\n}\n\nfunction updater(target, update) {\n update = isFunction(update) ? update : constant(update);\n return target ? function (_, pulse) {\n const value = update(_, pulse);\n\n if (!target.skip()) {\n target.skip(value !== this.value).value = value;\n }\n\n return value;\n } : update;\n}\n\n/**\n * Assigns a rank to an operator. Ranks are assigned in increasing order\n * by incrementing an internal rank counter.\n * @param {Operator} op - The operator to assign a rank.\n */\n\nfunction rank(op) {\n op.rank = ++this._rank;\n}\n/**\n * Re-ranks an operator and all downstream target dependencies. This\n * is necessary when upstream dependencies of higher rank are added to\n * a target operator.\n * @param {Operator} op - The operator to re-rank.\n */\n\nfunction rerank(op) {\n const queue = [op];\n let cur, list, i;\n\n while (queue.length) {\n this.rank(cur = queue.pop());\n\n if (list = cur._targets) {\n for (i = list.length; --i >= 0;) {\n queue.push(cur = list[i]);\n if (cur === op) error('Cycle detected in dataflow graph.');\n }\n }\n }\n}\n\n/**\n * Sentinel value indicating pulse propagation should stop.\n */\n\nconst StopPropagation = {}; // Pulse visit type flags\n\nconst ADD = 1 << 0,\n REM = 1 << 1,\n MOD = 1 << 2,\n ADD_REM = ADD | REM,\n ADD_MOD = ADD | MOD,\n ALL = ADD | REM | MOD,\n REFLOW = 1 << 3,\n SOURCE = 1 << 4,\n NO_SOURCE = 1 << 5,\n NO_FIELDS = 1 << 6;\n/**\n * A Pulse enables inter-operator communication during a run of the\n * dataflow graph. In addition to the current timestamp, a pulse may also\n * contain a change-set of added, removed or modified data tuples, as well as\n * a pointer to a full backing data source. Tuple change sets may not\n * be fully materialized; for example, to prevent needless array creation\n * a change set may include larger arrays and corresponding filter functions.\n * The pulse provides a {@link visit} method to enable proper and efficient\n * iteration over requested data tuples.\n *\n * In addition, each pulse can track modification flags for data tuple fields.\n * Responsible transform operators should call the {@link modifies} method to\n * indicate changes to data fields. The {@link modified} method enables\n * querying of this modification state.\n *\n * @constructor\n * @param {Dataflow} dataflow - The backing dataflow instance.\n * @param {number} stamp - The current propagation timestamp.\n * @param {string} [encode] - An optional encoding set name, which is then\n * accessible as Pulse.encode. Operators can respond to (or ignore) this\n * setting as appropriate. This parameter can be used in conjunction with\n * the Encode transform in the vega-encode module.\n */\n\nfunction Pulse(dataflow, stamp, encode) {\n this.dataflow = dataflow;\n this.stamp = stamp == null ? -1 : stamp;\n this.add = [];\n this.rem = [];\n this.mod = [];\n this.fields = null;\n this.encode = encode || null;\n}\n\nfunction materialize(data, filter) {\n const out = [];\n visitArray(data, filter, _ => out.push(_));\n return out;\n}\n\nfunction filter(pulse, flags) {\n const map = {};\n pulse.visit(flags, t => {\n map[tupleid(t)] = 1;\n });\n return t => map[tupleid(t)] ? null : t;\n}\n\nfunction addFilter(a, b) {\n return a ? (t, i) => a(t, i) && b(t, i) : b;\n}\n\nPulse.prototype = {\n /**\n * Sentinel value indicating pulse propagation should stop.\n */\n StopPropagation,\n\n /**\n * Boolean flag indicating ADD (added) tuples.\n */\n ADD,\n\n /**\n * Boolean flag indicating REM (removed) tuples.\n */\n REM,\n\n /**\n * Boolean flag indicating MOD (modified) tuples.\n */\n MOD,\n\n /**\n * Boolean flag indicating ADD (added) and REM (removed) tuples.\n */\n ADD_REM,\n\n /**\n * Boolean flag indicating ADD (added) and MOD (modified) tuples.\n */\n ADD_MOD,\n\n /**\n * Boolean flag indicating ADD, REM and MOD tuples.\n */\n ALL,\n\n /**\n * Boolean flag indicating all tuples in a data source\n * except for the ADD, REM and MOD tuples.\n */\n REFLOW,\n\n /**\n * Boolean flag indicating a 'pass-through' to a\n * backing data source, ignoring ADD, REM and MOD tuples.\n */\n SOURCE,\n\n /**\n * Boolean flag indicating that source data should be\n * suppressed when creating a forked pulse.\n */\n NO_SOURCE,\n\n /**\n * Boolean flag indicating that field modifications should be\n * suppressed when creating a forked pulse.\n */\n NO_FIELDS,\n\n /**\n * Creates a new pulse based on the values of this pulse.\n * The dataflow, time stamp and field modification values are copied over.\n * By default, new empty ADD, REM and MOD arrays are created.\n * @param {number} flags - Integer of boolean flags indicating which (if any)\n * tuple arrays should be copied to the new pulse. The supported flag values\n * are ADD, REM and MOD. Array references are copied directly: new array\n * instances are not created.\n * @return {Pulse} - The forked pulse instance.\n * @see init\n */\n fork(flags) {\n return new Pulse(this.dataflow).init(this, flags);\n },\n\n /**\n * Creates a copy of this pulse with new materialized array\n * instances for the ADD, REM, MOD, and SOURCE arrays.\n * The dataflow, time stamp and field modification values are copied over.\n * @return {Pulse} - The cloned pulse instance.\n * @see init\n */\n clone() {\n const p = this.fork(ALL);\n p.add = p.add.slice();\n p.rem = p.rem.slice();\n p.mod = p.mod.slice();\n if (p.source) p.source = p.source.slice();\n return p.materialize(ALL | SOURCE);\n },\n\n /**\n * Returns a pulse that adds all tuples from a backing source. This is\n * useful for cases where operators are added to a dataflow after an\n * upstream data pipeline has already been processed, ensuring that\n * new operators can observe all tuples within a stream.\n * @return {Pulse} - A pulse instance with all source tuples included\n * in the add array. If the current pulse already has all source\n * tuples in its add array, it is returned directly. If the current\n * pulse does not have a backing source, it is returned directly.\n */\n addAll() {\n let p = this;\n const reuse = !p.source || p.add === p.rem // special case for indexed set (e.g., crossfilter)\n || !p.rem.length && p.source.length === p.add.length;\n\n if (reuse) {\n return p;\n } else {\n p = new Pulse(this.dataflow).init(this);\n p.add = p.source;\n p.rem = []; // new operators can ignore rem #2769\n\n return p;\n }\n },\n\n /**\n * Initialize this pulse based on the values of another pulse. This method\n * is used internally by {@link fork} to initialize a new forked tuple.\n * The dataflow, time stamp and field modification values are copied over.\n * By default, new empty ADD, REM and MOD arrays are created.\n * @param {Pulse} src - The source pulse to copy from.\n * @param {number} flags - Integer of boolean flags indicating which (if any)\n * tuple arrays should be copied to the new pulse. The supported flag values\n * are ADD, REM and MOD. Array references are copied directly: new array\n * instances are not created. By default, source data arrays are copied\n * to the new pulse. Use the NO_SOURCE flag to enforce a null source.\n * @return {Pulse} - Returns this Pulse instance.\n */\n init(src, flags) {\n const p = this;\n p.stamp = src.stamp;\n p.encode = src.encode;\n\n if (src.fields && !(flags & NO_FIELDS)) {\n p.fields = src.fields;\n }\n\n if (flags & ADD) {\n p.addF = src.addF;\n p.add = src.add;\n } else {\n p.addF = null;\n p.add = [];\n }\n\n if (flags & REM) {\n p.remF = src.remF;\n p.rem = src.rem;\n } else {\n p.remF = null;\n p.rem = [];\n }\n\n if (flags & MOD) {\n p.modF = src.modF;\n p.mod = src.mod;\n } else {\n p.modF = null;\n p.mod = [];\n }\n\n if (flags & NO_SOURCE) {\n p.srcF = null;\n p.source = null;\n } else {\n p.srcF = src.srcF;\n p.source = src.source;\n if (src.cleans) p.cleans = src.cleans;\n }\n\n return p;\n },\n\n /**\n * Schedules a function to run after pulse propagation completes.\n * @param {function} func - The function to run.\n */\n runAfter(func) {\n this.dataflow.runAfter(func);\n },\n\n /**\n * Indicates if tuples have been added, removed or modified.\n * @param {number} [flags] - The tuple types (ADD, REM or MOD) to query.\n * Defaults to ALL, returning true if any tuple type has changed.\n * @return {boolean} - Returns true if one or more queried tuple types have\n * changed, false otherwise.\n */\n changed(flags) {\n const f = flags || ALL;\n return f & ADD && this.add.length || f & REM && this.rem.length || f & MOD && this.mod.length;\n },\n\n /**\n * Forces a \"reflow\" of tuple values, such that all tuples in the backing\n * source are added to the MOD set, unless already present in the ADD set.\n * @param {boolean} [fork=false] - If true, returns a forked copy of this\n * pulse, and invokes reflow on that derived pulse.\n * @return {Pulse} - The reflowed pulse instance.\n */\n reflow(fork) {\n if (fork) return this.fork(ALL).reflow();\n const len = this.add.length,\n src = this.source && this.source.length;\n\n if (src && src !== len) {\n this.mod = this.source;\n if (len) this.filter(MOD, filter(this, ADD));\n }\n\n return this;\n },\n\n /**\n * Get/set metadata to pulse requesting garbage collection\n * to reclaim currently unused resources.\n */\n clean(value) {\n if (arguments.length) {\n this.cleans = !!value;\n return this;\n } else {\n return this.cleans;\n }\n },\n\n /**\n * Marks one or more data field names as modified to assist dependency\n * tracking and incremental processing by transform operators.\n * @param {string|Array} _ - The field(s) to mark as modified.\n * @return {Pulse} - This pulse instance.\n */\n modifies(_) {\n const hash = this.fields || (this.fields = {});\n\n if (isArray(_)) {\n _.forEach(f => hash[f] = true);\n } else {\n hash[_] = true;\n }\n\n return this;\n },\n\n /**\n * Checks if one or more data fields have been modified during this pulse\n * propagation timestamp.\n * @param {string|Array} _ - The field(s) to check for modified.\n * @param {boolean} nomod - If true, will check the modified flag even if\n * no mod tuples exist. If false (default), mod tuples must be present.\n * @return {boolean} - Returns true if any of the provided fields has been\n * marked as modified, false otherwise.\n */\n modified(_, nomod) {\n const fields = this.fields;\n return !((nomod || this.mod.length) && fields) ? false : !arguments.length ? !!fields : isArray(_) ? _.some(f => fields[f]) : fields[_];\n },\n\n /**\n * Adds a filter function to one more tuple sets. Filters are applied to\n * backing tuple arrays, to determine the actual set of tuples considered\n * added, removed or modified. They can be used to delay materialization of\n * a tuple set in order to avoid expensive array copies. In addition, the\n * filter functions can serve as value transformers: unlike standard predicate\n * function (which return boolean values), Pulse filters should return the\n * actual tuple value to process. If a tuple set is already filtered, the\n * new filter function will be appended into a conjuntive ('and') query.\n * @param {number} flags - Flags indicating the tuple set(s) to filter.\n * @param {function(*):object} filter - Filter function that will be applied\n * to the tuple set array, and should return a data tuple if the value\n * should be included in the tuple set, and falsy (or null) otherwise.\n * @return {Pulse} - Returns this pulse instance.\n */\n filter(flags, filter) {\n const p = this;\n if (flags & ADD) p.addF = addFilter(p.addF, filter);\n if (flags & REM) p.remF = addFilter(p.remF, filter);\n if (flags & MOD) p.modF = addFilter(p.modF, filter);\n if (flags & SOURCE) p.srcF = addFilter(p.srcF, filter);\n return p;\n },\n\n /**\n * Materialize one or more tuple sets in this pulse. If the tuple set(s) have\n * a registered filter function, it will be applied and the tuple set(s) will\n * be replaced with materialized tuple arrays.\n * @param {number} flags - Flags indicating the tuple set(s) to materialize.\n * @return {Pulse} - Returns this pulse instance.\n */\n materialize(flags) {\n flags = flags || ALL;\n const p = this;\n\n if (flags & ADD && p.addF) {\n p.add = materialize(p.add, p.addF);\n p.addF = null;\n }\n\n if (flags & REM && p.remF) {\n p.rem = materialize(p.rem, p.remF);\n p.remF = null;\n }\n\n if (flags & MOD && p.modF) {\n p.mod = materialize(p.mod, p.modF);\n p.modF = null;\n }\n\n if (flags & SOURCE && p.srcF) {\n p.source = p.source.filter(p.srcF);\n p.srcF = null;\n }\n\n return p;\n },\n\n /**\n * Visit one or more tuple sets in this pulse.\n * @param {number} flags - Flags indicating the tuple set(s) to visit.\n * Legal values are ADD, REM, MOD and SOURCE (if a backing data source\n * has been set).\n * @param {function(object):*} - Visitor function invoked per-tuple.\n * @return {Pulse} - Returns this pulse instance.\n */\n visit(flags, visitor) {\n const p = this,\n v = visitor;\n\n if (flags & SOURCE) {\n visitArray(p.source, p.srcF, v);\n return p;\n }\n\n if (flags & ADD) visitArray(p.add, p.addF, v);\n if (flags & REM) visitArray(p.rem, p.remF, v);\n if (flags & MOD) visitArray(p.mod, p.modF, v);\n const src = p.source;\n\n if (flags & REFLOW && src) {\n const sum = p.add.length + p.mod.length;\n\n if (sum === src.length) ; else if (sum) {\n visitArray(src, filter(p, ADD_MOD), v);\n } else {\n // if no add/rem/mod tuples, visit source\n visitArray(src, p.srcF, v);\n }\n }\n\n return p;\n }\n\n};\n\n/**\n * Represents a set of multiple pulses. Used as input for operators\n * that accept multiple pulses at a time. Contained pulses are\n * accessible via the public \"pulses\" array property. This pulse doe\n * not carry added, removed or modified tuples directly. However,\n * the visit method can be used to traverse all such tuples contained\n * in sub-pulses with a timestamp matching this parent multi-pulse.\n * @constructor\n * @param {Dataflow} dataflow - The backing dataflow instance.\n * @param {number} stamp - The timestamp.\n * @param {Array} pulses - The sub-pulses for this multi-pulse.\n */\n\nfunction MultiPulse(dataflow, stamp, pulses, encode) {\n const p = this;\n let c = 0;\n this.dataflow = dataflow;\n this.stamp = stamp;\n this.fields = null;\n this.encode = encode || null;\n this.pulses = pulses;\n\n for (const pulse of pulses) {\n if (pulse.stamp !== stamp) continue;\n\n if (pulse.fields) {\n const hash = p.fields || (p.fields = {});\n\n for (const f in pulse.fields) {\n hash[f] = 1;\n }\n }\n\n if (pulse.changed(p.ADD)) c |= p.ADD;\n if (pulse.changed(p.REM)) c |= p.REM;\n if (pulse.changed(p.MOD)) c |= p.MOD;\n }\n\n this.changes = c;\n}\ninherits(MultiPulse, Pulse, {\n /**\n * Creates a new pulse based on the values of this pulse.\n * The dataflow, time stamp and field modification values are copied over.\n * @return {Pulse}\n */\n fork(flags) {\n const p = new Pulse(this.dataflow).init(this, flags & this.NO_FIELDS);\n\n if (flags !== undefined) {\n if (flags & p.ADD) this.visit(p.ADD, t => p.add.push(t));\n if (flags & p.REM) this.visit(p.REM, t => p.rem.push(t));\n if (flags & p.MOD) this.visit(p.MOD, t => p.mod.push(t));\n }\n\n return p;\n },\n\n changed(flags) {\n return this.changes & flags;\n },\n\n modified(_) {\n const p = this,\n fields = p.fields;\n return !(fields && p.changes & p.MOD) ? 0 : isArray(_) ? _.some(f => fields[f]) : fields[_];\n },\n\n filter() {\n error('MultiPulse does not support filtering.');\n },\n\n materialize() {\n error('MultiPulse does not support materialization.');\n },\n\n visit(flags, visitor) {\n const p = this,\n pulses = p.pulses,\n n = pulses.length;\n let i = 0;\n\n if (flags & p.SOURCE) {\n for (; i < n; ++i) {\n pulses[i].visit(flags, visitor);\n }\n } else {\n for (; i < n; ++i) {\n if (pulses[i].stamp === p.stamp) {\n pulses[i].visit(flags, visitor);\n }\n }\n }\n\n return p;\n }\n\n});\n\n/* eslint-disable require-atomic-updates */\n/**\n * Evaluates the dataflow and returns a Promise that resolves when pulse\n * propagation completes. This method will increment the current timestamp\n * and process all updated, pulsed and touched operators. When invoked for\n * the first time, all registered operators will be processed. This method\n * should not be invoked by third-party clients, use {@link runAsync} or\n * {@link run} instead.\n * @param {string} [encode] - The name of an encoding set to invoke during\n * propagation. This value is added to generated Pulse instances;\n * operators can then respond to (or ignore) this setting as appropriate.\n * This parameter can be used in conjunction with the Encode transform in\n * the vega-encode package.\n * @param {function} [prerun] - An optional callback function to invoke\n * immediately before dataflow evaluation commences.\n * @param {function} [postrun] - An optional callback function to invoke\n * after dataflow evaluation completes. The callback will be invoked\n * after those registered via {@link runAfter}.\n * @return {Promise} - A promise that resolves to this dataflow after\n * evaluation completes.\n */\n\nasync function evaluate(encode, prerun, postrun) {\n const df = this,\n async = []; // if the pulse value is set, this is a re-entrant call\n\n if (df._pulse) return reentrant(df); // wait for pending datasets to load\n\n if (df._pending) await df._pending; // invoke prerun function, if provided\n\n if (prerun) await asyncCallback(df, prerun); // exit early if there are no updates\n\n if (!df._touched.length) {\n df.debug('Dataflow invoked, but nothing to do.');\n return df;\n } // increment timestamp clock\n\n\n const stamp = ++df._clock; // set the current pulse\n\n df._pulse = new Pulse(df, stamp, encode); // initialize priority queue, reset touched operators\n\n df._touched.forEach(op => df._enqueue(op, true));\n\n df._touched = UniqueList(id);\n let count = 0,\n op,\n next,\n error;\n\n try {\n while (df._heap.size() > 0) {\n // dequeue operator with highest priority\n op = df._heap.pop(); // re-queue if rank changed\n\n if (op.rank !== op.qrank) {\n df._enqueue(op, true);\n\n continue;\n } // otherwise, evaluate the operator\n\n\n next = op.run(df._getPulse(op, encode));\n\n if (next.then) {\n // await if operator returns a promise directly\n next = await next;\n } else if (next.async) {\n // queue parallel asynchronous execution\n async.push(next.async);\n next = StopPropagation;\n } // propagate evaluation, enqueue dependent operators\n\n\n if (next !== StopPropagation) {\n if (op._targets) op._targets.forEach(op => df._enqueue(op));\n } // increment visit counter\n\n\n ++count;\n }\n } catch (err) {\n df._heap.clear();\n\n error = err;\n } // reset pulse map\n\n\n df._input = {};\n df._pulse = null;\n df.debug(\"Pulse \".concat(stamp, \": \").concat(count, \" operators\"));\n\n if (error) {\n df._postrun = [];\n df.error(error);\n } // invoke callbacks queued via runAfter\n\n\n if (df._postrun.length) {\n const pr = df._postrun.sort((a, b) => b.priority - a.priority);\n\n df._postrun = [];\n\n for (let i = 0; i < pr.length; ++i) {\n await asyncCallback(df, pr[i].callback);\n }\n } // invoke postrun function, if provided\n\n\n if (postrun) await asyncCallback(df, postrun); // handle non-blocking asynchronous callbacks\n\n if (async.length) {\n Promise.all(async).then(cb => df.runAsync(null, () => {\n cb.forEach(f => {\n try {\n f(df);\n } catch (err) {\n df.error(err);\n }\n });\n }));\n }\n\n return df;\n}\n/**\n * Queues dataflow evaluation to run once any other queued evaluations have\n * completed and returns a Promise that resolves when the queued pulse\n * propagation completes. If provided, a callback function will be invoked\n * immediately before evaluation commences. This method will ensure a\n * separate evaluation is invoked for each time it is called.\n * @param {string} [encode] - The name of an encoding set to invoke during\n * propagation. This value is added to generated Pulse instances;\n * operators can then respond to (or ignore) this setting as appropriate.\n * This parameter can be used in conjunction with the Encode transform in\n * the vega-encode package.\n * @param {function} [prerun] - An optional callback function to invoke\n * immediately before dataflow evaluation commences.\n * @param {function} [postrun] - An optional callback function to invoke\n * after dataflow evaluation completes. The callback will be invoked\n * after those registered via {@link runAfter}.\n * @return {Promise} - A promise that resolves to this dataflow after\n * evaluation completes.\n */\n\nasync function runAsync(encode, prerun, postrun) {\n // await previously queued functions\n while (this._running) await this._running; // run dataflow, manage running promise\n\n\n const clear = () => this._running = null;\n\n (this._running = this.evaluate(encode, prerun, postrun)).then(clear, clear);\n return this._running;\n}\n/**\n * Requests dataflow evaluation and the immediately returns this dataflow\n * instance. If there are pending data loading or other asynchronous\n * operations, the dataflow will evaluate asynchronously after this method\n * has been invoked. To track when dataflow evaluation completes, use the\n * {@link runAsync} method instead. This method will raise an error if\n * invoked while the dataflow is already in the midst of evaluation.\n * @param {string} [encode] - The name of an encoding set to invoke during\n * propagation. This value is added to generated Pulse instances;\n * operators can then respond to (or ignore) this setting as appropriate.\n * This parameter can be used in conjunction with the Encode transform in\n * the vega-encode module.\n * @param {function} [prerun] - An optional callback function to invoke\n * immediately before dataflow evaluation commences.\n * @param {function} [postrun] - An optional callback function to invoke\n * after dataflow evaluation completes. The callback will be invoked\n * after those registered via {@link runAfter}.\n * @return {Dataflow} - This dataflow instance.\n */\n\nfunction run(encode, prerun, postrun) {\n return this._pulse ? reentrant(this) : (this.evaluate(encode, prerun, postrun), this);\n}\n/**\n * Schedules a callback function to be invoked after the current pulse\n * propagation completes. If no propagation is currently occurring,\n * the function is invoked immediately. Callbacks scheduled via runAfter\n * are invoked immediately upon completion of the current cycle, before\n * any request queued via runAsync. This method is primarily intended for\n * internal use. Third-party callers using runAfter to schedule a callback\n * that invokes {@link run} or {@link runAsync} should not use this method,\n * but instead use {@link runAsync} with prerun or postrun arguments.\n * @param {function(Dataflow)} callback - The callback function to run.\n * The callback will be invoked with this Dataflow instance as its\n * sole argument.\n * @param {boolean} enqueue - A boolean flag indicating that the\n * callback should be queued up to run after the next propagation\n * cycle, suppressing immediate invocation when propagation is not\n * currently occurring.\n * @param {number} [priority] - A priority value used to sort registered\n * callbacks to determine execution order. This argument is intended\n * for internal Vega use only.\n */\n\nfunction runAfter(callback, enqueue, priority) {\n if (this._pulse || enqueue) {\n // pulse propagation is currently running, queue to run after\n this._postrun.push({\n priority: priority || 0,\n callback: callback\n });\n } else {\n // pulse propagation already complete, invoke immediately\n try {\n callback(this);\n } catch (err) {\n this.error(err);\n }\n }\n}\n/**\n * Raise an error for re-entrant dataflow evaluation.\n */\n\nfunction reentrant(df) {\n df.error('Dataflow already running. Use runAsync() to chain invocations.');\n return df;\n}\n/**\n * Enqueue an operator into the priority queue for evaluation. The operator\n * will be enqueued if it has no registered pulse for the current cycle, or if\n * the force argument is true. Upon enqueue, this method also sets the\n * operator's qrank to the current rank value.\n * @param {Operator} op - The operator to enqueue.\n * @param {boolean} [force] - A flag indicating if the operator should be\n * forceably added to the queue, even if it has already been previously\n * enqueued during the current pulse propagation. This is useful when the\n * dataflow graph is dynamically modified and the operator rank changes.\n */\n\n\nfunction enqueue(op, force) {\n const q = op.stamp < this._clock;\n if (q) op.stamp = this._clock;\n\n if (q || force) {\n op.qrank = op.rank;\n\n this._heap.push(op);\n }\n}\n/**\n * Provide a correct pulse for evaluating an operator. If the operator has an\n * explicit source operator, we will try to pull the pulse(s) from it.\n * If there is an array of source operators, we build a multi-pulse.\n * Otherwise, we return a current pulse with correct source data.\n * If the pulse is the pulse map has an explicit target set, we use that.\n * Else if the pulse on the upstream source operator is current, we use that.\n * Else we use the pulse from the pulse map, but copy the source tuple array.\n * @param {Operator} op - The operator for which to get an input pulse.\n * @param {string} [encode] - An (optional) encoding set name with which to\n * annotate the returned pulse. See {@link run} for more information.\n */\n\nfunction getPulse(op, encode) {\n const s = op.source,\n stamp = this._clock;\n return s && isArray(s) ? new MultiPulse(this, stamp, s.map(_ => _.pulse), encode) : this._input[op.id] || singlePulse(this._pulse, s && s.pulse);\n}\n\nfunction singlePulse(p, s) {\n if (s && s.stamp === p.stamp) {\n return s;\n }\n\n p = p.fork();\n\n if (s && s !== StopPropagation) {\n p.source = s.source;\n }\n\n return p;\n}\n\nconst NO_OPT = {\n skip: false,\n force: false\n};\n/**\n * Touches an operator, scheduling it to be evaluated. If invoked outside of\n * a pulse propagation, the operator will be evaluated the next time this\n * dataflow is run. If invoked in the midst of pulse propagation, the operator\n * will be queued for evaluation if and only if the operator has not yet been\n * evaluated on the current propagation timestamp.\n * @param {Operator} op - The operator to touch.\n * @param {object} [options] - Additional options hash.\n * @param {boolean} [options.skip] - If true, the operator will\n * be skipped: it will not be evaluated, but its dependents will be.\n * @return {Dataflow}\n */\n\nfunction touch(op, options) {\n const opt = options || NO_OPT;\n\n if (this._pulse) {\n // if in midst of propagation, add to priority queue\n this._enqueue(op);\n } else {\n // otherwise, queue for next propagation\n this._touched.add(op);\n }\n\n if (opt.skip) op.skip(true);\n return this;\n}\n/**\n * Updates the value of the given operator.\n * @param {Operator} op - The operator to update.\n * @param {*} value - The value to set.\n * @param {object} [options] - Additional options hash.\n * @param {boolean} [options.force] - If true, the operator will\n * be re-evaluated even if its value has not changed.\n * @param {boolean} [options.skip] - If true, the operator will\n * be skipped: it will not be evaluated, but its dependents will be.\n * @return {Dataflow}\n */\n\nfunction update(op, value, options) {\n const opt = options || NO_OPT;\n\n if (op.set(value) || opt.force) {\n this.touch(op, opt);\n }\n\n return this;\n}\n/**\n * Pulses an operator with a changeset of tuples. If invoked outside of\n * a pulse propagation, the pulse will be applied the next time this\n * dataflow is run. If invoked in the midst of pulse propagation, the pulse\n * will be added to the set of active pulses and will be applied if and\n * only if the target operator has not yet been evaluated on the current\n * propagation timestamp.\n * @param {Operator} op - The operator to pulse.\n * @param {ChangeSet} value - The tuple changeset to apply.\n * @param {object} [options] - Additional options hash.\n * @param {boolean} [options.skip] - If true, the operator will\n * be skipped: it will not be evaluated, but its dependents will be.\n * @return {Dataflow}\n */\n\nfunction pulse(op, changeset, options) {\n this.touch(op, options || NO_OPT);\n const p = new Pulse(this, this._clock + (this._pulse ? 0 : 1)),\n t = op.pulse && op.pulse.source || [];\n p.target = op;\n this._input[op.id] = changeset.pulse(p, t);\n return this;\n}\n\nfunction Heap(cmp) {\n let nodes = [];\n return {\n clear: () => nodes = [],\n size: () => nodes.length,\n peek: () => nodes[0],\n push: x => {\n nodes.push(x);\n return siftdown(nodes, 0, nodes.length - 1, cmp);\n },\n pop: () => {\n const last = nodes.pop();\n let item;\n\n if (nodes.length) {\n item = nodes[0];\n nodes[0] = last;\n siftup(nodes, 0, cmp);\n } else {\n item = last;\n }\n\n return item;\n }\n };\n}\n\nfunction siftdown(array, start, idx, cmp) {\n let parent, pidx;\n const item = array[idx];\n\n while (idx > start) {\n pidx = idx - 1 >> 1;\n parent = array[pidx];\n\n if (cmp(item, parent) < 0) {\n array[idx] = parent;\n idx = pidx;\n continue;\n }\n\n break;\n }\n\n return array[idx] = item;\n}\n\nfunction siftup(array, idx, cmp) {\n const start = idx,\n end = array.length,\n item = array[idx];\n let cidx = (idx << 1) + 1,\n ridx;\n\n while (cidx < end) {\n ridx = cidx + 1;\n\n if (ridx < end && cmp(array[cidx], array[ridx]) >= 0) {\n cidx = ridx;\n }\n\n array[idx] = array[cidx];\n idx = cidx;\n cidx = (idx << 1) + 1;\n }\n\n array[idx] = item;\n return siftdown(array, start, idx, cmp);\n}\n\n/**\n * A dataflow graph for reactive processing of data streams.\n * @constructor\n */\n\nfunction Dataflow() {\n this.logger(logger());\n this.logLevel(Error);\n this._clock = 0;\n this._rank = 0;\n this._locale = defaultLocale();\n\n try {\n this._loader = loader();\n } catch (e) {// do nothing if loader module is unavailable\n }\n\n this._touched = UniqueList(id);\n this._input = {};\n this._pulse = null;\n this._heap = Heap((a, b) => a.qrank - b.qrank);\n this._postrun = [];\n}\n\nfunction logMethod(method) {\n return function () {\n return this._log[method].apply(this, arguments);\n };\n}\n\nDataflow.prototype = {\n /**\n * The current timestamp of this dataflow. This value reflects the\n * timestamp of the previous dataflow run. The dataflow is initialized\n * with a stamp value of 0. The initial run of the dataflow will have\n * a timestap of 1, and so on. This value will match the\n * {@link Pulse.stamp} property.\n * @return {number} - The current timestamp value.\n */\n stamp() {\n return this._clock;\n },\n\n /**\n * Gets or sets the loader instance to use for data file loading. A\n * loader object must provide a \"load\" method for loading files and a\n * \"sanitize\" method for checking URL/filename validity. Both methods\n * should accept a URI and options hash as arguments, and return a Promise\n * that resolves to the loaded file contents (load) or a hash containing\n * sanitized URI data with the sanitized url assigned to the \"href\" property\n * (sanitize).\n * @param {object} _ - The loader instance to use.\n * @return {object|Dataflow} - If no arguments are provided, returns\n * the current loader instance. Otherwise returns this Dataflow instance.\n */\n loader(_) {\n if (arguments.length) {\n this._loader = _;\n return this;\n } else {\n return this._loader;\n }\n },\n\n /**\n * Gets or sets the locale instance to use for formatting and parsing\n * string values. The locale object should be provided by the\n * vega-format library, and include methods such as format, timeFormat,\n * utcFormat, timeParse, and utcParse.\n * @param {object} _ - The locale instance to use.\n * @return {object|Dataflow} - If no arguments are provided, returns\n * the current locale instance. Otherwise returns this Dataflow instance.\n */\n locale(_) {\n if (arguments.length) {\n this._locale = _;\n return this;\n } else {\n return this._locale;\n }\n },\n\n /**\n * Get or set the logger instance used to log messages. If no arguments are\n * provided, returns the current logger instance. Otherwise, sets the logger\n * and return this Dataflow instance. Provided loggers must support the full\n * API of logger objects generated by the vega-util logger method. Note that\n * by default the log level of the new logger will be used; use the logLevel\n * method to adjust the log level as needed.\n */\n logger(logger) {\n if (arguments.length) {\n this._log = logger;\n return this;\n } else {\n return this._log;\n }\n },\n\n /**\n * Logs an error message. By default, logged messages are written to console\n * output. The message will only be logged if the current log level is high\n * enough to permit error messages.\n */\n error: logMethod('error'),\n\n /**\n * Logs a warning message. By default, logged messages are written to console\n * output. The message will only be logged if the current log level is high\n * enough to permit warning messages.\n */\n warn: logMethod('warn'),\n\n /**\n * Logs a information message. By default, logged messages are written to\n * console output. The message will only be logged if the current log level is\n * high enough to permit information messages.\n */\n info: logMethod('info'),\n\n /**\n * Logs a debug message. By default, logged messages are written to console\n * output. The message will only be logged if the current log level is high\n * enough to permit debug messages.\n */\n debug: logMethod('debug'),\n\n /**\n * Get or set the current log level. If an argument is provided, it\n * will be used as the new log level.\n * @param {number} [level] - Should be one of None, Warn, Info\n * @return {number} - The current log level.\n */\n logLevel: logMethod('level'),\n\n /**\n * Empty entry threshold for garbage cleaning. Map data structures will\n * perform cleaning once the number of empty entries exceeds this value.\n */\n cleanThreshold: 1e4,\n // OPERATOR REGISTRATION\n add,\n connect,\n rank,\n rerank,\n // OPERATOR UPDATES\n pulse,\n touch,\n update,\n changeset,\n // DATA LOADING\n ingest,\n parse,\n preload,\n request,\n // EVENT HANDLING\n events,\n on,\n // PULSE PROPAGATION\n evaluate,\n run,\n runAsync,\n runAfter,\n _enqueue: enqueue,\n _getPulse: getPulse\n};\n\n/**\n * Abstract class for operators that process data tuples.\n * Subclasses must provide a {@link transform} method for operator processing.\n * @constructor\n * @param {*} [init] - The initial value for this operator.\n * @param {object} [params] - The parameters for this operator.\n * @param {Operator} [source] - The operator from which to receive pulses.\n */\n\nfunction Transform(init, params) {\n Operator.call(this, init, null, params);\n}\ninherits(Transform, Operator, {\n /**\n * Overrides {@link Operator.evaluate} for transform operators.\n * Internally, this method calls {@link evaluate} to perform processing.\n * If {@link evaluate} returns a falsy value, the input pulse is returned.\n * This method should NOT be overridden, instead overrride {@link evaluate}.\n * @param {Pulse} pulse - the current dataflow pulse.\n * @return the output pulse for this operator (or StopPropagation)\n */\n run(pulse) {\n if (pulse.stamp < this.stamp) return pulse.StopPropagation;\n let rv;\n\n if (this.skip()) {\n this.skip(false);\n } else {\n rv = this.evaluate(pulse);\n }\n\n rv = rv || pulse;\n\n if (rv.then) {\n rv = rv.then(_ => this.pulse = _);\n } else if (rv !== pulse.StopPropagation) {\n this.pulse = rv;\n }\n\n return rv;\n },\n\n /**\n * Overrides {@link Operator.evaluate} for transform operators.\n * Marshalls parameter values and then invokes {@link transform}.\n * @param {Pulse} pulse - the current dataflow pulse.\n * @return {Pulse} The output pulse (or StopPropagation). A falsy return\n value (including undefined) will let the input pulse pass through.\n */\n evaluate(pulse) {\n const params = this.marshall(pulse.stamp),\n out = this.transform(params, pulse);\n params.clear();\n return out;\n },\n\n /**\n * Process incoming pulses.\n * Subclasses should override this method to implement transforms.\n * @param {Parameters} _ - The operator parameter values.\n * @param {Pulse} pulse - The current dataflow pulse.\n * @return {Pulse} The output pulse (or StopPropagation). A falsy return\n * value (including undefined) will let the input pulse pass through.\n */\n transform() {}\n\n});\n\nconst transforms = {};\nfunction definition(type) {\n const t = transform(type);\n return t && t.Definition || null;\n}\nfunction transform(type) {\n type = type && type.toLowerCase();\n return hasOwnProperty(transforms, type) ? transforms[type] : null;\n}\n\nexport { Dataflow, EventStream, MultiPulse, Operator, Parameters, Pulse, Transform, UniqueList, asyncCallback, changeset, definition, derive, ingest$1 as ingest, isChangeSet, isTuple, rederive, replace, stableCompare, transform, transforms, tupleid };\n","import { ascending, quantileSorted, deviation, quantile, median } from 'd3-array';\n\nfunction* numbers (values, valueof) {\n if (valueof == null) {\n for (let value of values) {\n if (value != null && value !== '' && (value = +value) >= value) {\n yield value;\n }\n }\n } else {\n let index = -1;\n\n for (let value of values) {\n value = valueof(value, ++index, values);\n\n if (value != null && value !== '' && (value = +value) >= value) {\n yield value;\n }\n }\n }\n}\n\nfunction quantiles (array, p, f) {\n const values = Float64Array.from(numbers(array, f)); // don't depend on return value from typed array sort call\n // protects against undefined sort results in Safari (vega/vega-lite#4964)\n\n values.sort(ascending);\n return p.map(_ => quantileSorted(values, _));\n}\n\nfunction quartiles (array, f) {\n return quantiles(array, [0.25, 0.50, 0.75], f);\n}\n\n// Theory, Practice, and Visualization. Wiley.\n\nfunction estimateBandwidth (array, f) {\n const n = array.length,\n d = deviation(array, f),\n q = quartiles(array, f),\n h = (q[2] - q[0]) / 1.34,\n v = Math.min(d, h) || d || Math.abs(q[0]) || 1;\n return 1.06 * v * Math.pow(n, -0.2);\n}\n\nfunction bin (_) {\n // determine range\n const maxb = _.maxbins || 20,\n base = _.base || 10,\n logb = Math.log(base),\n div = _.divide || [5, 2];\n let min = _.extent[0],\n max = _.extent[1],\n step,\n level,\n minstep,\n v,\n i,\n n;\n const span = _.span || max - min || Math.abs(min) || 1;\n\n if (_.step) {\n // if step size is explicitly given, use that\n step = _.step;\n } else if (_.steps) {\n // if provided, limit choice to acceptable step sizes\n v = span / maxb;\n\n for (i = 0, n = _.steps.length; i < n && _.steps[i] < v; ++i);\n\n step = _.steps[Math.max(0, i - 1)];\n } else {\n // else use span to determine step size\n level = Math.ceil(Math.log(maxb) / logb);\n minstep = _.minstep || 0;\n step = Math.max(minstep, Math.pow(base, Math.round(Math.log(span) / logb) - level)); // increase step size if too many bins\n\n while (Math.ceil(span / step) > maxb) {\n step *= base;\n } // decrease step size if allowed\n\n\n for (i = 0, n = div.length; i < n; ++i) {\n v = step / div[i];\n if (v >= minstep && span / v <= maxb) step = v;\n }\n } // update precision, min and max\n\n\n v = Math.log(step);\n const precision = v >= 0 ? 0 : ~~(-v / logb) + 1,\n eps = Math.pow(base, -precision - 1);\n\n if (_.nice || _.nice === undefined) {\n v = Math.floor(min / step + eps) * step;\n min = min < v ? v - step : v;\n max = Math.ceil(max / step) * step;\n }\n\n return {\n start: min,\n stop: max === min ? min + step : max,\n step: step\n };\n}\n\nvar random = Math.random;\nfunction setRandom(r) {\n random = r;\n}\n\nfunction bootstrapCI (array, samples, alpha, f) {\n if (!array.length) return [undefined, undefined];\n const values = Float64Array.from(numbers(array, f)),\n n = values.length,\n m = samples;\n let a, i, j, mu;\n\n for (j = 0, mu = Array(m); j < m; ++j) {\n for (a = 0, i = 0; i < n; ++i) {\n a += values[~~(random() * n)];\n }\n\n mu[j] = a / n;\n }\n\n mu.sort(ascending);\n return [quantile(mu, alpha / 2), quantile(mu, 1 - alpha / 2)];\n}\n\n// Dot density binning for dot plot construction.\n// Based on Leland Wilkinson, Dot Plots, The American Statistician, 1999.\n// https://www.cs.uic.edu/~wilkinson/Publications/dotplots.pdf\nfunction dotbin (array, step, smooth, f) {\n f = f || (_ => _);\n\n const n = array.length,\n v = new Float64Array(n);\n let i = 0,\n j = 1,\n a = f(array[0]),\n b = a,\n w = a + step,\n x;\n\n for (; j < n; ++j) {\n x = f(array[j]);\n\n if (x >= w) {\n b = (a + b) / 2;\n\n for (; i < j; ++i) v[i] = b;\n\n w = x + step;\n a = x;\n }\n\n b = x;\n }\n\n b = (a + b) / 2;\n\n for (; i < j; ++i) v[i] = b;\n\n return smooth ? smoothing(v, step + step / 4) : v;\n} // perform smoothing to reduce variance\n// swap points between \"adjacent\" stacks\n// Wilkinson defines adjacent as within step/4 units\n\nfunction smoothing(v, thresh) {\n const n = v.length;\n let a = 0,\n b = 1,\n c,\n d; // get left stack\n\n while (v[a] === v[b]) ++b;\n\n while (b < n) {\n // get right stack\n c = b + 1;\n\n while (v[b] === v[c]) ++c; // are stacks adjacent?\n // if so, compare sizes and swap as needed\n\n\n if (v[b] - v[b - 1] < thresh) {\n d = b + (a + c - b - b >> 1);\n\n while (d < b) v[d++] = v[b];\n\n while (d > b) v[d--] = v[a];\n } // update left stack indices\n\n\n a = b;\n b = c;\n }\n\n return v;\n}\n\nfunction lcg (seed) {\n // Random numbers using a Linear Congruential Generator with seed value\n // Uses glibc values from https://en.wikipedia.org/wiki/Linear_congruential_generator\n return function () {\n seed = (1103515245 * seed + 12345) % 2147483647;\n return seed / 2147483647;\n };\n}\n\nfunction integer (min, max) {\n if (max == null) {\n max = min;\n min = 0;\n }\n\n let a, b, d;\n const dist = {\n min(_) {\n if (arguments.length) {\n a = _ || 0;\n d = b - a;\n return dist;\n } else {\n return a;\n }\n },\n\n max(_) {\n if (arguments.length) {\n b = _ || 0;\n d = b - a;\n return dist;\n } else {\n return b;\n }\n },\n\n sample() {\n return a + Math.floor(d * random());\n },\n\n pdf(x) {\n return x === Math.floor(x) && x >= a && x < b ? 1 / d : 0;\n },\n\n cdf(x) {\n const v = Math.floor(x);\n return v < a ? 0 : v >= b ? 1 : (v - a + 1) / d;\n },\n\n icdf(p) {\n return p >= 0 && p <= 1 ? a - 1 + Math.floor(p * d) : NaN;\n }\n\n };\n return dist.min(min).max(max);\n}\n\nconst SQRT2PI = Math.sqrt(2 * Math.PI);\nconst SQRT2 = Math.SQRT2;\n\nlet nextSample = NaN;\nfunction sampleNormal(mean, stdev) {\n mean = mean || 0;\n stdev = stdev == null ? 1 : stdev;\n let x = 0,\n y = 0,\n rds,\n c;\n\n if (nextSample === nextSample) {\n x = nextSample;\n nextSample = NaN;\n } else {\n do {\n x = random() * 2 - 1;\n y = random() * 2 - 1;\n rds = x * x + y * y;\n } while (rds === 0 || rds > 1);\n\n c = Math.sqrt(-2 * Math.log(rds) / rds); // Box-Muller transform\n\n x *= c;\n nextSample = y * c;\n }\n\n return mean + x * stdev;\n}\nfunction densityNormal(value, mean, stdev) {\n stdev = stdev == null ? 1 : stdev;\n const z = (value - (mean || 0)) / stdev;\n return Math.exp(-0.5 * z * z) / (stdev * SQRT2PI);\n} // Approximation from West (2009)\n// Better Approximations to Cumulative Normal Functions\n\nfunction cumulativeNormal(value, mean, stdev) {\n mean = mean || 0;\n stdev = stdev == null ? 1 : stdev;\n const z = (value - mean) / stdev,\n Z = Math.abs(z);\n let cd;\n\n if (Z > 37) {\n cd = 0;\n } else {\n const exp = Math.exp(-Z * Z / 2);\n let sum;\n\n if (Z < 7.07106781186547) {\n sum = 3.52624965998911e-02 * Z + 0.700383064443688;\n sum = sum * Z + 6.37396220353165;\n sum = sum * Z + 33.912866078383;\n sum = sum * Z + 112.079291497871;\n sum = sum * Z + 221.213596169931;\n sum = sum * Z + 220.206867912376;\n cd = exp * sum;\n sum = 8.83883476483184e-02 * Z + 1.75566716318264;\n sum = sum * Z + 16.064177579207;\n sum = sum * Z + 86.7807322029461;\n sum = sum * Z + 296.564248779674;\n sum = sum * Z + 637.333633378831;\n sum = sum * Z + 793.826512519948;\n sum = sum * Z + 440.413735824752;\n cd = cd / sum;\n } else {\n sum = Z + 0.65;\n sum = Z + 4 / sum;\n sum = Z + 3 / sum;\n sum = Z + 2 / sum;\n sum = Z + 1 / sum;\n cd = exp / sum / 2.506628274631;\n }\n }\n\n return z > 0 ? 1 - cd : cd;\n} // Approximation of Probit function using inverse error function.\n\nfunction quantileNormal(p, mean, stdev) {\n if (p < 0 || p > 1) return NaN;\n return (mean || 0) + (stdev == null ? 1 : stdev) * SQRT2 * erfinv(2 * p - 1);\n} // Approximate inverse error function. Implementation from \"Approximating\n// the erfinv function\" by Mike Giles, GPU Computing Gems, volume 2, 2010.\n// Ported from Apache Commons Math, http://www.apache.org/licenses/LICENSE-2.0\n\nfunction erfinv(x) {\n // beware that the logarithm argument must be\n // commputed as (1.0 - x) * (1.0 + x),\n // it must NOT be simplified as 1.0 - x * x as this\n // would induce rounding errors near the boundaries +/-1\n let w = -Math.log((1 - x) * (1 + x)),\n p;\n\n if (w < 6.25) {\n w -= 3.125;\n p = -3.6444120640178196996e-21;\n p = -1.685059138182016589e-19 + p * w;\n p = 1.2858480715256400167e-18 + p * w;\n p = 1.115787767802518096e-17 + p * w;\n p = -1.333171662854620906e-16 + p * w;\n p = 2.0972767875968561637e-17 + p * w;\n p = 6.6376381343583238325e-15 + p * w;\n p = -4.0545662729752068639e-14 + p * w;\n p = -8.1519341976054721522e-14 + p * w;\n p = 2.6335093153082322977e-12 + p * w;\n p = -1.2975133253453532498e-11 + p * w;\n p = -5.4154120542946279317e-11 + p * w;\n p = 1.051212273321532285e-09 + p * w;\n p = -4.1126339803469836976e-09 + p * w;\n p = -2.9070369957882005086e-08 + p * w;\n p = 4.2347877827932403518e-07 + p * w;\n p = -1.3654692000834678645e-06 + p * w;\n p = -1.3882523362786468719e-05 + p * w;\n p = 0.0001867342080340571352 + p * w;\n p = -0.00074070253416626697512 + p * w;\n p = -0.0060336708714301490533 + p * w;\n p = 0.24015818242558961693 + p * w;\n p = 1.6536545626831027356 + p * w;\n } else if (w < 16.0) {\n w = Math.sqrt(w) - 3.25;\n p = 2.2137376921775787049e-09;\n p = 9.0756561938885390979e-08 + p * w;\n p = -2.7517406297064545428e-07 + p * w;\n p = 1.8239629214389227755e-08 + p * w;\n p = 1.5027403968909827627e-06 + p * w;\n p = -4.013867526981545969e-06 + p * w;\n p = 2.9234449089955446044e-06 + p * w;\n p = 1.2475304481671778723e-05 + p * w;\n p = -4.7318229009055733981e-05 + p * w;\n p = 6.8284851459573175448e-05 + p * w;\n p = 2.4031110387097893999e-05 + p * w;\n p = -0.0003550375203628474796 + p * w;\n p = 0.00095328937973738049703 + p * w;\n p = -0.0016882755560235047313 + p * w;\n p = 0.0024914420961078508066 + p * w;\n p = -0.0037512085075692412107 + p * w;\n p = 0.005370914553590063617 + p * w;\n p = 1.0052589676941592334 + p * w;\n p = 3.0838856104922207635 + p * w;\n } else if (Number.isFinite(w)) {\n w = Math.sqrt(w) - 5.0;\n p = -2.7109920616438573243e-11;\n p = -2.5556418169965252055e-10 + p * w;\n p = 1.5076572693500548083e-09 + p * w;\n p = -3.7894654401267369937e-09 + p * w;\n p = 7.6157012080783393804e-09 + p * w;\n p = -1.4960026627149240478e-08 + p * w;\n p = 2.9147953450901080826e-08 + p * w;\n p = -6.7711997758452339498e-08 + p * w;\n p = 2.2900482228026654717e-07 + p * w;\n p = -9.9298272942317002539e-07 + p * w;\n p = 4.5260625972231537039e-06 + p * w;\n p = -1.9681778105531670567e-05 + p * w;\n p = 7.5995277030017761139e-05 + p * w;\n p = -0.00021503011930044477347 + p * w;\n p = -0.00013871931833623122026 + p * w;\n p = 1.0103004648645343977 + p * w;\n p = 4.8499064014085844221 + p * w;\n } else {\n p = Infinity;\n }\n\n return p * x;\n}\n\nfunction gaussian (mean, stdev) {\n let mu, sigma;\n const dist = {\n mean(_) {\n if (arguments.length) {\n mu = _ || 0;\n return dist;\n } else {\n return mu;\n }\n },\n\n stdev(_) {\n if (arguments.length) {\n sigma = _ == null ? 1 : _;\n return dist;\n } else {\n return sigma;\n }\n },\n\n sample: () => sampleNormal(mu, sigma),\n pdf: value => densityNormal(value, mu, sigma),\n cdf: value => cumulativeNormal(value, mu, sigma),\n icdf: p => quantileNormal(p, mu, sigma)\n };\n return dist.mean(mean).stdev(stdev);\n}\n\nfunction kde (support, bandwidth) {\n const kernel = gaussian();\n let n = 0;\n const dist = {\n data(_) {\n if (arguments.length) {\n support = _;\n n = _ ? _.length : 0;\n return dist.bandwidth(bandwidth);\n } else {\n return support;\n }\n },\n\n bandwidth(_) {\n if (!arguments.length) return bandwidth;\n bandwidth = _;\n if (!bandwidth && support) bandwidth = estimateBandwidth(support);\n return dist;\n },\n\n sample() {\n return support[~~(random() * n)] + bandwidth * kernel.sample();\n },\n\n pdf(x) {\n let y = 0,\n i = 0;\n\n for (; i < n; ++i) {\n y += kernel.pdf((x - support[i]) / bandwidth);\n }\n\n return y / bandwidth / n;\n },\n\n cdf(x) {\n let y = 0,\n i = 0;\n\n for (; i < n; ++i) {\n y += kernel.cdf((x - support[i]) / bandwidth);\n }\n\n return y / n;\n },\n\n icdf() {\n throw Error('KDE icdf not supported.');\n }\n\n };\n return dist.data(support);\n}\n\nfunction sampleLogNormal(mean, stdev) {\n mean = mean || 0;\n stdev = stdev == null ? 1 : stdev;\n return Math.exp(mean + sampleNormal() * stdev);\n}\nfunction densityLogNormal(value, mean, stdev) {\n if (value <= 0) return 0;\n mean = mean || 0;\n stdev = stdev == null ? 1 : stdev;\n const z = (Math.log(value) - mean) / stdev;\n return Math.exp(-0.5 * z * z) / (stdev * SQRT2PI * value);\n}\nfunction cumulativeLogNormal(value, mean, stdev) {\n return cumulativeNormal(Math.log(value), mean, stdev);\n}\nfunction quantileLogNormal(p, mean, stdev) {\n return Math.exp(quantileNormal(p, mean, stdev));\n}\nfunction lognormal (mean, stdev) {\n let mu, sigma;\n const dist = {\n mean(_) {\n if (arguments.length) {\n mu = _ || 0;\n return dist;\n } else {\n return mu;\n }\n },\n\n stdev(_) {\n if (arguments.length) {\n sigma = _ == null ? 1 : _;\n return dist;\n } else {\n return sigma;\n }\n },\n\n sample: () => sampleLogNormal(mu, sigma),\n pdf: value => densityLogNormal(value, mu, sigma),\n cdf: value => cumulativeLogNormal(value, mu, sigma),\n icdf: p => quantileLogNormal(p, mu, sigma)\n };\n return dist.mean(mean).stdev(stdev);\n}\n\nfunction mixture (dists, weights) {\n let m = 0,\n w;\n\n function normalize(x) {\n const w = [];\n let sum = 0,\n i;\n\n for (i = 0; i < m; ++i) {\n sum += w[i] = x[i] == null ? 1 : +x[i];\n }\n\n for (i = 0; i < m; ++i) {\n w[i] /= sum;\n }\n\n return w;\n }\n\n const dist = {\n weights(_) {\n if (arguments.length) {\n w = normalize(weights = _ || []);\n return dist;\n }\n\n return weights;\n },\n\n distributions(_) {\n if (arguments.length) {\n if (_) {\n m = _.length;\n dists = _;\n } else {\n m = 0;\n dists = [];\n }\n\n return dist.weights(weights);\n }\n\n return dists;\n },\n\n sample() {\n const r = random();\n let d = dists[m - 1],\n v = w[0],\n i = 0; // first select distribution\n\n for (; i < m - 1; v += w[++i]) {\n if (r < v) {\n d = dists[i];\n break;\n }\n } // then sample from it\n\n\n return d.sample();\n },\n\n pdf(x) {\n let p = 0,\n i = 0;\n\n for (; i < m; ++i) {\n p += w[i] * dists[i].pdf(x);\n }\n\n return p;\n },\n\n cdf(x) {\n let p = 0,\n i = 0;\n\n for (; i < m; ++i) {\n p += w[i] * dists[i].cdf(x);\n }\n\n return p;\n },\n\n icdf() {\n throw Error('Mixture icdf not supported.');\n }\n\n };\n return dist.distributions(dists).weights(weights);\n}\n\nfunction sampleUniform(min, max) {\n if (max == null) {\n max = min == null ? 1 : min;\n min = 0;\n }\n\n return min + (max - min) * random();\n}\nfunction densityUniform(value, min, max) {\n if (max == null) {\n max = min == null ? 1 : min;\n min = 0;\n }\n\n return value >= min && value <= max ? 1 / (max - min) : 0;\n}\nfunction cumulativeUniform(value, min, max) {\n if (max == null) {\n max = min == null ? 1 : min;\n min = 0;\n }\n\n return value < min ? 0 : value > max ? 1 : (value - min) / (max - min);\n}\nfunction quantileUniform(p, min, max) {\n if (max == null) {\n max = min == null ? 1 : min;\n min = 0;\n }\n\n return p >= 0 && p <= 1 ? min + p * (max - min) : NaN;\n}\nfunction uniform (min, max) {\n let a, b;\n const dist = {\n min(_) {\n if (arguments.length) {\n a = _ || 0;\n return dist;\n } else {\n return a;\n }\n },\n\n max(_) {\n if (arguments.length) {\n b = _ == null ? 1 : _;\n return dist;\n } else {\n return b;\n }\n },\n\n sample: () => sampleUniform(a, b),\n pdf: value => densityUniform(value, a, b),\n cdf: value => cumulativeUniform(value, a, b),\n icdf: p => quantileUniform(p, a, b)\n };\n\n if (max == null) {\n max = min == null ? 1 : min;\n min = 0;\n }\n\n return dist.min(min).max(max);\n}\n\n// Ordinary Least Squares\nfunction ols (uX, uY, uXY, uX2) {\n const delta = uX2 - uX * uX,\n slope = Math.abs(delta) < 1e-24 ? 0 : (uXY - uX * uY) / delta,\n intercept = uY - slope * uX;\n return [intercept, slope];\n}\n\nfunction points(data, x, y, sort) {\n data = data.filter(d => {\n let u = x(d),\n v = y(d);\n return u != null && (u = +u) >= u && v != null && (v = +v) >= v;\n });\n\n if (sort) {\n data.sort((a, b) => x(a) - x(b));\n }\n\n const n = data.length,\n X = new Float64Array(n),\n Y = new Float64Array(n); // extract values, calculate means\n\n let i = 0,\n ux = 0,\n uy = 0,\n xv,\n yv,\n d;\n\n for (d of data) {\n X[i] = xv = +x(d);\n Y[i] = yv = +y(d);\n ++i;\n ux += (xv - ux) / i;\n uy += (yv - uy) / i;\n } // mean center the data\n\n\n for (i = 0; i < n; ++i) {\n X[i] -= ux;\n Y[i] -= uy;\n }\n\n return [X, Y, ux, uy];\n}\nfunction visitPoints(data, x, y, callback) {\n let i = -1,\n u,\n v;\n\n for (const d of data) {\n u = x(d);\n v = y(d);\n\n if (u != null && (u = +u) >= u && v != null && (v = +v) >= v) {\n callback(u, v, ++i);\n }\n }\n}\n\n// License: https://github.com/HarryStevens/d3-regression/blob/master/LICENSE\n\nfunction rSquared (data, x, y, uY, predict) {\n let SSE = 0,\n SST = 0;\n visitPoints(data, x, y, (dx, dy) => {\n const sse = dy - predict(dx),\n sst = dy - uY;\n SSE += sse * sse;\n SST += sst * sst;\n });\n return 1 - SSE / SST;\n}\n\n// License: https://github.com/HarryStevens/d3-regression/blob/master/LICENSE\n\nfunction linear (data, x, y) {\n let X = 0,\n Y = 0,\n XY = 0,\n X2 = 0,\n n = 0;\n visitPoints(data, x, y, (dx, dy) => {\n ++n;\n X += (dx - X) / n;\n Y += (dy - Y) / n;\n XY += (dx * dy - XY) / n;\n X2 += (dx * dx - X2) / n;\n });\n\n const coef = ols(X, Y, XY, X2),\n predict = x => coef[0] + coef[1] * x;\n\n return {\n coef: coef,\n predict: predict,\n rSquared: rSquared(data, x, y, Y, predict)\n };\n}\n\n// License: https://github.com/HarryStevens/d3-regression/blob/master/LICENSE\n\nfunction log (data, x, y) {\n let X = 0,\n Y = 0,\n XY = 0,\n X2 = 0,\n n = 0;\n visitPoints(data, x, y, (dx, dy) => {\n ++n;\n dx = Math.log(dx);\n X += (dx - X) / n;\n Y += (dy - Y) / n;\n XY += (dx * dy - XY) / n;\n X2 += (dx * dx - X2) / n;\n });\n\n const coef = ols(X, Y, XY, X2),\n predict = x => coef[0] + coef[1] * Math.log(x);\n\n return {\n coef: coef,\n predict: predict,\n rSquared: rSquared(data, x, y, Y, predict)\n };\n}\n\nfunction exp (data, x, y) {\n // eslint-disable-next-line no-unused-vars\n const [xv, yv, ux, uy] = points(data, x, y);\n let YL = 0,\n XY = 0,\n XYL = 0,\n X2Y = 0,\n n = 0,\n dx,\n ly,\n xy;\n visitPoints(data, x, y, (_, dy) => {\n dx = xv[n++];\n ly = Math.log(dy);\n xy = dx * dy;\n YL += (dy * ly - YL) / n;\n XY += (xy - XY) / n;\n XYL += (xy * ly - XYL) / n;\n X2Y += (dx * xy - X2Y) / n;\n });\n\n const [c0, c1] = ols(XY / uy, YL / uy, XYL / uy, X2Y / uy),\n predict = x => Math.exp(c0 + c1 * (x - ux));\n\n return {\n coef: [Math.exp(c0 - c1 * ux), c1],\n predict: predict,\n rSquared: rSquared(data, x, y, uy, predict)\n };\n}\n\n// License: https://github.com/HarryStevens/d3-regression/blob/master/LICENSE\n\nfunction pow (data, x, y) {\n let X = 0,\n Y = 0,\n XY = 0,\n X2 = 0,\n YS = 0,\n n = 0;\n visitPoints(data, x, y, (dx, dy) => {\n const lx = Math.log(dx),\n ly = Math.log(dy);\n ++n;\n X += (lx - X) / n;\n Y += (ly - Y) / n;\n XY += (lx * ly - XY) / n;\n X2 += (lx * lx - X2) / n;\n YS += (dy - YS) / n;\n });\n\n const coef = ols(X, Y, XY, X2),\n predict = x => coef[0] * Math.pow(x, coef[1]);\n\n coef[0] = Math.exp(coef[0]);\n return {\n coef: coef,\n predict: predict,\n rSquared: rSquared(data, x, y, YS, predict)\n };\n}\n\nfunction quad (data, x, y) {\n const [xv, yv, ux, uy] = points(data, x, y),\n n = xv.length;\n let X2 = 0,\n X3 = 0,\n X4 = 0,\n XY = 0,\n X2Y = 0,\n i,\n dx,\n dy,\n x2;\n\n for (i = 0; i < n;) {\n dx = xv[i];\n dy = yv[i++];\n x2 = dx * dx;\n X2 += (x2 - X2) / i;\n X3 += (x2 * dx - X3) / i;\n X4 += (x2 * x2 - X4) / i;\n XY += (dx * dy - XY) / i;\n X2Y += (x2 * dy - X2Y) / i;\n }\n\n const X2X2 = X4 - X2 * X2,\n d = X2 * X2X2 - X3 * X3,\n a = (X2Y * X2 - XY * X3) / d,\n b = (XY * X2X2 - X2Y * X3) / d,\n c = -a * X2,\n predict = x => {\n x = x - ux;\n return a * x * x + b * x + c + uy;\n }; // transform coefficients back from mean-centered space\n\n\n return {\n coef: [c - b * ux + a * ux * ux + uy, b - 2 * a * ux, a],\n predict: predict,\n rSquared: rSquared(data, x, y, uy, predict)\n };\n}\n\n// License: https://github.com/HarryStevens/d3-regression/blob/master/LICENSE\n// ... which was adapted from regression-js by Tom Alexander\n// Source: https://github.com/Tom-Alexander/regression-js/blob/master/src/regression.js#L246\n// License: https://github.com/Tom-Alexander/regression-js/blob/master/LICENSE\n\nfunction poly (data, x, y, order) {\n // use more efficient methods for lower orders\n if (order === 1) return linear(data, x, y);\n if (order === 2) return quad(data, x, y);\n const [xv, yv, ux, uy] = points(data, x, y),\n n = xv.length,\n lhs = [],\n rhs = [],\n k = order + 1;\n let i, j, l, v, c;\n\n for (i = 0; i < k; ++i) {\n for (l = 0, v = 0; l < n; ++l) {\n v += Math.pow(xv[l], i) * yv[l];\n }\n\n lhs.push(v);\n c = new Float64Array(k);\n\n for (j = 0; j < k; ++j) {\n for (l = 0, v = 0; l < n; ++l) {\n v += Math.pow(xv[l], i + j);\n }\n\n c[j] = v;\n }\n\n rhs.push(c);\n }\n\n rhs.push(lhs);\n\n const coef = gaussianElimination(rhs),\n predict = x => {\n x -= ux;\n let y = uy + coef[0] + coef[1] * x + coef[2] * x * x;\n\n for (i = 3; i < k; ++i) y += coef[i] * Math.pow(x, i);\n\n return y;\n };\n\n return {\n coef: uncenter(k, coef, -ux, uy),\n predict: predict,\n rSquared: rSquared(data, x, y, uy, predict)\n };\n}\n\nfunction uncenter(k, a, x, y) {\n const z = Array(k);\n let i, j, v, c; // initialize to zero\n\n for (i = 0; i < k; ++i) z[i] = 0; // polynomial expansion\n\n\n for (i = k - 1; i >= 0; --i) {\n v = a[i];\n c = 1;\n z[i] += v;\n\n for (j = 1; j <= i; ++j) {\n c *= (i + 1 - j) / j; // binomial coefficent\n\n z[i - j] += v * Math.pow(x, j) * c;\n }\n } // bias term\n\n\n z[0] += y;\n return z;\n} // Given an array for a two-dimensional matrix and the polynomial order,\n// solve A * x = b using Gaussian elimination.\n\n\nfunction gaussianElimination(matrix) {\n const n = matrix.length - 1,\n coef = [];\n let i, j, k, r, t;\n\n for (i = 0; i < n; ++i) {\n r = i; // max row\n\n for (j = i + 1; j < n; ++j) {\n if (Math.abs(matrix[i][j]) > Math.abs(matrix[i][r])) {\n r = j;\n }\n }\n\n for (k = i; k < n + 1; ++k) {\n t = matrix[k][i];\n matrix[k][i] = matrix[k][r];\n matrix[k][r] = t;\n }\n\n for (j = i + 1; j < n; ++j) {\n for (k = n; k >= i; k--) {\n matrix[k][j] -= matrix[k][i] * matrix[i][j] / matrix[i][i];\n }\n }\n }\n\n for (j = n - 1; j >= 0; --j) {\n t = 0;\n\n for (k = j + 1; k < n; ++k) {\n t += matrix[k][j] * coef[k];\n }\n\n coef[j] = (matrix[n][j] - t) / matrix[j][j];\n }\n\n return coef;\n}\n\nconst maxiters = 2,\n epsilon = 1e-12; // Adapted from science.js by Jason Davies\n// Source: https://github.com/jasondavies/science.js/blob/master/src/stats/loess.js\n// License: https://github.com/jasondavies/science.js/blob/master/LICENSE\n\nfunction loess (data, x, y, bandwidth) {\n const [xv, yv, ux, uy] = points(data, x, y, true),\n n = xv.length,\n bw = Math.max(2, ~~(bandwidth * n)),\n // # nearest neighbors\n yhat = new Float64Array(n),\n residuals = new Float64Array(n),\n robustWeights = new Float64Array(n).fill(1);\n\n for (let iter = -1; ++iter <= maxiters;) {\n const interval = [0, bw - 1];\n\n for (let i = 0; i < n; ++i) {\n const dx = xv[i],\n i0 = interval[0],\n i1 = interval[1],\n edge = dx - xv[i0] > xv[i1] - dx ? i0 : i1;\n let W = 0,\n X = 0,\n Y = 0,\n XY = 0,\n X2 = 0;\n const denom = 1 / Math.abs(xv[edge] - dx || 1); // avoid singularity!\n\n for (let k = i0; k <= i1; ++k) {\n const xk = xv[k],\n yk = yv[k],\n w = tricube(Math.abs(dx - xk) * denom) * robustWeights[k],\n xkw = xk * w;\n W += w;\n X += xkw;\n Y += yk * w;\n XY += yk * xkw;\n X2 += xk * xkw;\n } // linear regression fit\n\n\n const [a, b] = ols(X / W, Y / W, XY / W, X2 / W);\n yhat[i] = a + b * dx;\n residuals[i] = Math.abs(yv[i] - yhat[i]);\n updateInterval(xv, i + 1, interval);\n }\n\n if (iter === maxiters) {\n break;\n }\n\n const medianResidual = median(residuals);\n if (Math.abs(medianResidual) < epsilon) break;\n\n for (let i = 0, arg, w; i < n; ++i) {\n arg = residuals[i] / (6 * medianResidual); // default to epsilon (rather than zero) for large deviations\n // keeping weights tiny but non-zero prevents singularites\n\n robustWeights[i] = arg >= 1 ? epsilon : (w = 1 - arg * arg) * w;\n }\n }\n\n return output(xv, yhat, ux, uy);\n} // weighting kernel for local regression\n\nfunction tricube(x) {\n return (x = 1 - x * x * x) * x * x;\n} // advance sliding window interval of nearest neighbors\n\n\nfunction updateInterval(xv, i, interval) {\n const val = xv[i];\n let left = interval[0],\n right = interval[1] + 1;\n if (right >= xv.length) return; // step right if distance to new right edge is <= distance to old left edge\n // step when distance is equal to ensure movement over duplicate x values\n\n while (i > left && xv[right] - val <= val - xv[left]) {\n interval[0] = ++left;\n interval[1] = right;\n ++right;\n }\n} // generate smoothed output points\n// average points with repeated x values\n\n\nfunction output(xv, yhat, ux, uy) {\n const n = xv.length,\n out = [];\n let i = 0,\n cnt = 0,\n prev = [],\n v;\n\n for (; i < n; ++i) {\n v = xv[i] + ux;\n\n if (prev[0] === v) {\n // average output values via online update\n prev[1] += (yhat[i] - prev[1]) / ++cnt;\n } else {\n // add new output point\n cnt = 0;\n prev[1] += uy;\n prev = [v, yhat[i]];\n out.push(prev);\n }\n }\n\n prev[1] += uy;\n return out;\n}\n\n// subdivide up to accuracy of 0.5 degrees\nconst MIN_RADIANS = 0.5 * Math.PI / 180; // Adaptively sample an interpolated function over a domain extent\n\nfunction sampleCurve (f, extent, minSteps, maxSteps) {\n minSteps = minSteps || 25;\n maxSteps = Math.max(minSteps, maxSteps || 200);\n\n const point = x => [x, f(x)],\n minX = extent[0],\n maxX = extent[1],\n span = maxX - minX,\n stop = span / maxSteps,\n prev = [point(minX)],\n next = [];\n\n if (minSteps === maxSteps) {\n // no adaptation, sample uniform grid directly and return\n for (let i = 1; i < maxSteps; ++i) {\n prev.push(point(minX + i / minSteps * span));\n }\n\n prev.push(point(maxX));\n return prev;\n } else {\n // sample minimum points on uniform grid\n // then move on to perform adaptive refinement\n next.push(point(maxX));\n\n for (let i = minSteps; --i > 0;) {\n next.push(point(minX + i / minSteps * span));\n }\n }\n\n let p0 = prev[0];\n let p1 = next[next.length - 1];\n const sx = 1 / span;\n const sy = scaleY(p0[1], next);\n\n while (p1) {\n // midpoint for potential curve subdivision\n const pm = point((p0[0] + p1[0]) / 2);\n const dx = pm[0] - p0[0] >= stop;\n\n if (dx && angleDelta(p0, pm, p1, sx, sy) > MIN_RADIANS) {\n // maximum resolution has not yet been met, and\n // subdivision midpoint is sufficiently different from endpoint\n // save subdivision, push midpoint onto the visitation stack\n next.push(pm);\n } else {\n // subdivision midpoint sufficiently similar to endpoint\n // skip subdivision, store endpoint, move to next point on the stack\n p0 = p1;\n prev.push(p1);\n next.pop();\n }\n\n p1 = next[next.length - 1];\n }\n\n return prev;\n}\n\nfunction scaleY(init, points) {\n let ymin = init;\n let ymax = init;\n const n = points.length;\n\n for (let i = 0; i < n; ++i) {\n const y = points[i][1];\n if (y < ymin) ymin = y;\n if (y > ymax) ymax = y;\n }\n\n return 1 / (ymax - ymin);\n}\n\nfunction angleDelta(p, q, r, sx, sy) {\n const a0 = Math.atan2(sy * (r[1] - p[1]), sx * (r[0] - p[0])),\n a1 = Math.atan2(sy * (q[1] - p[1]), sx * (q[0] - p[0]));\n return Math.abs(a0 - a1);\n}\n\nexport { estimateBandwidth as bandwidthNRD, bin, bootstrapCI, cumulativeLogNormal, cumulativeNormal, cumulativeUniform, densityLogNormal, densityNormal, densityUniform, dotbin, quantileLogNormal, quantileNormal, quantileUniform, quantiles, quartiles, random, integer as randomInteger, kde as randomKDE, lcg as randomLCG, lognormal as randomLogNormal, mixture as randomMixture, gaussian as randomNormal, uniform as randomUniform, exp as regressionExp, linear as regressionLinear, loess as regressionLoess, log as regressionLog, poly as regressionPoly, pow as regressionPow, quad as regressionQuad, sampleCurve, sampleLogNormal, sampleNormal, sampleUniform, setRandom };\n","import { extend, identity, field, hasOwnProperty, extentIndex, inherits, array, accessorName, error, accessorFields, accessor, toNumber, merge, compare, truthy, extent, span, fastmap, isArray, key, ascending, peek, zero, constant } from 'vega-util';\nimport { tupleid, Transform, replace, ingest, stableCompare, Operator, derive, rederive } from 'vega-dataflow';\nimport { quartiles, bootstrapCI, bin, randomKDE, randomMixture, randomNormal, randomLogNormal, randomUniform, sampleCurve, dotbin, quantiles, random } from 'vega-statistics';\nimport { median, mean, min, max, range, bisector } from 'd3-array';\nimport { utcInterval, timeInterval, timeBin, timeUnits, utcFloor, timeFloor, TIME_UNITS } from 'vega-time';\n\nfunction multikey(f) {\n return x => {\n const n = f.length;\n let i = 1,\n k = String(f[0](x));\n\n for (; i < n; ++i) {\n k += '|' + f[i](x);\n }\n\n return k;\n };\n}\nfunction groupkey(fields) {\n return !fields || !fields.length ? function () {\n return '';\n } : fields.length === 1 ? fields[0] : multikey(fields);\n}\n\nfunction measureName(op, field, as) {\n return as || op + (!field ? '' : '_' + field);\n}\n\nconst noop = () => {};\n\nconst base_op = {\n init: noop,\n add: noop,\n rem: noop,\n idx: 0\n};\nconst AggregateOps = {\n values: {\n init: m => m.cell.store = true,\n value: m => m.cell.data.values(),\n idx: -1\n },\n count: {\n value: m => m.cell.num\n },\n __count__: {\n value: m => m.missing + m.valid\n },\n missing: {\n value: m => m.missing\n },\n valid: {\n value: m => m.valid\n },\n sum: {\n init: m => m.sum = 0,\n value: m => m.sum,\n add: (m, v) => m.sum += +v,\n rem: (m, v) => m.sum -= v\n },\n product: {\n init: m => m.product = 1,\n value: m => m.valid ? m.product : undefined,\n add: (m, v) => m.product *= v,\n rem: (m, v) => m.product /= v\n },\n mean: {\n init: m => m.mean = 0,\n value: m => m.valid ? m.mean : undefined,\n add: (m, v) => (m.mean_d = v - m.mean, m.mean += m.mean_d / m.valid),\n rem: (m, v) => (m.mean_d = v - m.mean, m.mean -= m.valid ? m.mean_d / m.valid : m.mean)\n },\n average: {\n value: m => m.valid ? m.mean : undefined,\n req: ['mean'],\n idx: 1\n },\n variance: {\n init: m => m.dev = 0,\n value: m => m.valid > 1 ? m.dev / (m.valid - 1) : undefined,\n add: (m, v) => m.dev += m.mean_d * (v - m.mean),\n rem: (m, v) => m.dev -= m.mean_d * (v - m.mean),\n req: ['mean'],\n idx: 1\n },\n variancep: {\n value: m => m.valid > 1 ? m.dev / m.valid : undefined,\n req: ['variance'],\n idx: 2\n },\n stdev: {\n value: m => m.valid > 1 ? Math.sqrt(m.dev / (m.valid - 1)) : undefined,\n req: ['variance'],\n idx: 2\n },\n stdevp: {\n value: m => m.valid > 1 ? Math.sqrt(m.dev / m.valid) : undefined,\n req: ['variance'],\n idx: 2\n },\n stderr: {\n value: m => m.valid > 1 ? Math.sqrt(m.dev / (m.valid * (m.valid - 1))) : undefined,\n req: ['variance'],\n idx: 2\n },\n distinct: {\n value: m => m.cell.data.distinct(m.get),\n req: ['values'],\n idx: 3\n },\n ci0: {\n value: m => m.cell.data.ci0(m.get),\n req: ['values'],\n idx: 3\n },\n ci1: {\n value: m => m.cell.data.ci1(m.get),\n req: ['values'],\n idx: 3\n },\n median: {\n value: m => m.cell.data.q2(m.get),\n req: ['values'],\n idx: 3\n },\n q1: {\n value: m => m.cell.data.q1(m.get),\n req: ['values'],\n idx: 3\n },\n q3: {\n value: m => m.cell.data.q3(m.get),\n req: ['values'],\n idx: 3\n },\n min: {\n init: m => m.min = undefined,\n value: m => m.min = Number.isNaN(m.min) ? m.cell.data.min(m.get) : m.min,\n add: (m, v) => {\n if (v < m.min || m.min === undefined) m.min = v;\n },\n rem: (m, v) => {\n if (v <= m.min) m.min = NaN;\n },\n req: ['values'],\n idx: 4\n },\n max: {\n init: m => m.max = undefined,\n value: m => m.max = Number.isNaN(m.max) ? m.cell.data.max(m.get) : m.max,\n add: (m, v) => {\n if (v > m.max || m.max === undefined) m.max = v;\n },\n rem: (m, v) => {\n if (v >= m.max) m.max = NaN;\n },\n req: ['values'],\n idx: 4\n },\n argmin: {\n init: m => m.argmin = undefined,\n value: m => m.argmin || m.cell.data.argmin(m.get),\n add: (m, v, t) => {\n if (v < m.min) m.argmin = t;\n },\n rem: (m, v) => {\n if (v <= m.min) m.argmin = undefined;\n },\n req: ['min', 'values'],\n idx: 3\n },\n argmax: {\n init: m => m.argmax = undefined,\n value: m => m.argmax || m.cell.data.argmax(m.get),\n add: (m, v, t) => {\n if (v > m.max) m.argmax = t;\n },\n rem: (m, v) => {\n if (v >= m.max) m.argmax = undefined;\n },\n req: ['max', 'values'],\n idx: 3\n }\n};\nconst ValidAggregateOps = Object.keys(AggregateOps);\n\nfunction measure(key, value) {\n return out => extend({\n name: key,\n out: out || key\n }, base_op, value);\n}\n\nValidAggregateOps.forEach(key => {\n AggregateOps[key] = measure(key, AggregateOps[key]);\n});\nfunction createMeasure(op, name) {\n return AggregateOps[op](name);\n}\n\nfunction compareIndex(a, b) {\n return a.idx - b.idx;\n}\n\nfunction resolve(agg) {\n const map = {};\n agg.forEach(a => map[a.name] = a);\n\n const getreqs = a => {\n if (!a.req) return;\n a.req.forEach(key => {\n if (!map[key]) getreqs(map[key] = AggregateOps[key]());\n });\n };\n\n agg.forEach(getreqs);\n return Object.values(map).sort(compareIndex);\n}\n\nfunction init() {\n this.valid = 0;\n this.missing = 0;\n\n this._ops.forEach(op => op.init(this));\n}\n\nfunction add(v, t) {\n if (v == null || v === '') {\n ++this.missing;\n return;\n }\n\n if (v !== v) return;\n ++this.valid;\n\n this._ops.forEach(op => op.add(this, v, t));\n}\n\nfunction rem(v, t) {\n if (v == null || v === '') {\n --this.missing;\n return;\n }\n\n if (v !== v) return;\n --this.valid;\n\n this._ops.forEach(op => op.rem(this, v, t));\n}\n\nfunction set(t) {\n this._out.forEach(op => t[op.out] = op.value(this));\n\n return t;\n}\n\nfunction compileMeasures(agg, field) {\n const get = field || identity,\n ops = resolve(agg),\n out = agg.slice().sort(compareIndex);\n\n function ctr(cell) {\n this._ops = ops;\n this._out = out;\n this.cell = cell;\n this.init();\n }\n\n ctr.prototype.init = init;\n ctr.prototype.add = add;\n ctr.prototype.rem = rem;\n ctr.prototype.set = set;\n ctr.prototype.get = get;\n ctr.fields = agg.map(op => op.out);\n return ctr;\n}\n\nfunction TupleStore(key) {\n this._key = key ? field(key) : tupleid;\n this.reset();\n}\nconst prototype$1 = TupleStore.prototype;\n\nprototype$1.reset = function () {\n this._add = [];\n this._rem = [];\n this._ext = null;\n this._get = null;\n this._q = null;\n};\n\nprototype$1.add = function (v) {\n this._add.push(v);\n};\n\nprototype$1.rem = function (v) {\n this._rem.push(v);\n};\n\nprototype$1.values = function () {\n this._get = null;\n if (this._rem.length === 0) return this._add;\n const a = this._add,\n r = this._rem,\n k = this._key,\n n = a.length,\n m = r.length,\n x = Array(n - m),\n map = {};\n let i, j, v; // use unique key field to clear removed values\n\n for (i = 0; i < m; ++i) {\n map[k(r[i])] = 1;\n }\n\n for (i = 0, j = 0; i < n; ++i) {\n if (map[k(v = a[i])]) {\n map[k(v)] = 0;\n } else {\n x[j++] = v;\n }\n }\n\n this._rem = [];\n return this._add = x;\n}; // memoizing statistics methods\n\n\nprototype$1.distinct = function (get) {\n const v = this.values(),\n map = {};\n let n = v.length,\n count = 0,\n s;\n\n while (--n >= 0) {\n s = get(v[n]) + '';\n\n if (!hasOwnProperty(map, s)) {\n map[s] = 1;\n ++count;\n }\n }\n\n return count;\n};\n\nprototype$1.extent = function (get) {\n if (this._get !== get || !this._ext) {\n const v = this.values(),\n i = extentIndex(v, get);\n this._ext = [v[i[0]], v[i[1]]];\n this._get = get;\n }\n\n return this._ext;\n};\n\nprototype$1.argmin = function (get) {\n return this.extent(get)[0] || {};\n};\n\nprototype$1.argmax = function (get) {\n return this.extent(get)[1] || {};\n};\n\nprototype$1.min = function (get) {\n const m = this.extent(get)[0];\n return m != null ? get(m) : undefined;\n};\n\nprototype$1.max = function (get) {\n const m = this.extent(get)[1];\n return m != null ? get(m) : undefined;\n};\n\nprototype$1.quartile = function (get) {\n if (this._get !== get || !this._q) {\n this._q = quartiles(this.values(), get);\n this._get = get;\n }\n\n return this._q;\n};\n\nprototype$1.q1 = function (get) {\n return this.quartile(get)[0];\n};\n\nprototype$1.q2 = function (get) {\n return this.quartile(get)[1];\n};\n\nprototype$1.q3 = function (get) {\n return this.quartile(get)[2];\n};\n\nprototype$1.ci = function (get) {\n if (this._get !== get || !this._ci) {\n this._ci = bootstrapCI(this.values(), 1000, 0.05, get);\n this._get = get;\n }\n\n return this._ci;\n};\n\nprototype$1.ci0 = function (get) {\n return this.ci(get)[0];\n};\n\nprototype$1.ci1 = function (get) {\n return this.ci(get)[1];\n};\n\n/**\n * Group-by aggregation operator.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} [params.groupby] - An array of accessors to groupby.\n * @param {Array} [params.fields] - An array of accessors to aggregate.\n * @param {Array} [params.ops] - An array of strings indicating aggregation operations.\n * @param {Array} [params.as] - An array of output field names for aggregated values.\n * @param {boolean} [params.cross=false] - A flag indicating that the full\n * cross-product of groupby values should be generated, including empty cells.\n * If true, the drop parameter is ignored and empty cells are retained.\n * @param {boolean} [params.drop=true] - A flag indicating if empty cells should be removed.\n */\n\nfunction Aggregate(params) {\n Transform.call(this, null, params);\n this._adds = []; // array of added output tuples\n\n this._mods = []; // array of modified output tuples\n\n this._alen = 0; // number of active added tuples\n\n this._mlen = 0; // number of active modified tuples\n\n this._drop = true; // should empty aggregation cells be removed\n\n this._cross = false; // produce full cross-product of group-by values\n\n this._dims = []; // group-by dimension accessors\n\n this._dnames = []; // group-by dimension names\n\n this._measures = []; // collection of aggregation monoids\n\n this._countOnly = false; // flag indicating only count aggregation\n\n this._counts = null; // collection of count fields\n\n this._prev = null; // previous aggregation cells\n\n this._inputs = null; // array of dependent input tuple field names\n\n this._outputs = null; // array of output tuple field names\n}\nAggregate.Definition = {\n 'type': 'Aggregate',\n 'metadata': {\n 'generates': true,\n 'changes': true\n },\n 'params': [{\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'ops',\n 'type': 'enum',\n 'array': true,\n 'values': ValidAggregateOps\n }, {\n 'name': 'fields',\n 'type': 'field',\n 'null': true,\n 'array': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'null': true,\n 'array': true\n }, {\n 'name': 'drop',\n 'type': 'boolean',\n 'default': true\n }, {\n 'name': 'cross',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'key',\n 'type': 'field'\n }]\n};\ninherits(Aggregate, Transform, {\n transform(_, pulse) {\n const aggr = this,\n out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS),\n mod = _.modified();\n\n aggr.stamp = out.stamp;\n\n if (aggr.value && (mod || pulse.modified(aggr._inputs, true))) {\n aggr._prev = aggr.value;\n aggr.value = mod ? aggr.init(_) : {};\n pulse.visit(pulse.SOURCE, t => aggr.add(t));\n } else {\n aggr.value = aggr.value || aggr.init(_);\n pulse.visit(pulse.REM, t => aggr.rem(t));\n pulse.visit(pulse.ADD, t => aggr.add(t));\n } // Indicate output fields and return aggregate tuples.\n\n\n out.modifies(aggr._outputs); // Should empty cells be dropped?\n\n aggr._drop = _.drop !== false; // If domain cross-product requested, generate empty cells as needed\n // and ensure that empty cells are not dropped\n\n if (_.cross && aggr._dims.length > 1) {\n aggr._drop = false;\n aggr.cross();\n }\n\n if (pulse.clean() && aggr._drop) {\n out.clean(true).runAfter(() => this.clean());\n }\n\n return aggr.changes(out);\n },\n\n cross() {\n const aggr = this,\n curr = aggr.value,\n dims = aggr._dnames,\n vals = dims.map(() => ({})),\n n = dims.length; // collect all group-by domain values\n\n function collect(cells) {\n let key, i, t, v;\n\n for (key in cells) {\n t = cells[key].tuple;\n\n for (i = 0; i < n; ++i) {\n vals[i][v = t[dims[i]]] = v;\n }\n }\n }\n\n collect(aggr._prev);\n collect(curr); // iterate over key cross-product, create cells as needed\n\n function generate(base, tuple, index) {\n const name = dims[index],\n v = vals[index++];\n\n for (const k in v) {\n const key = base ? base + '|' + k : k;\n tuple[name] = v[k];\n if (index < n) generate(key, tuple, index);else if (!curr[key]) aggr.cell(key, tuple);\n }\n }\n\n generate('', {}, 0);\n },\n\n init(_) {\n // initialize input and output fields\n const inputs = this._inputs = [],\n outputs = this._outputs = [],\n inputMap = {};\n\n function inputVisit(get) {\n const fields = array(accessorFields(get)),\n n = fields.length;\n let i = 0,\n f;\n\n for (; i < n; ++i) {\n if (!inputMap[f = fields[i]]) {\n inputMap[f] = 1;\n inputs.push(f);\n }\n }\n } // initialize group-by dimensions\n\n\n this._dims = array(_.groupby);\n this._dnames = this._dims.map(d => {\n const dname = accessorName(d);\n inputVisit(d);\n outputs.push(dname);\n return dname;\n });\n this.cellkey = _.key ? _.key : groupkey(this._dims); // initialize aggregate measures\n\n this._countOnly = true;\n this._counts = [];\n this._measures = [];\n const fields = _.fields || [null],\n ops = _.ops || ['count'],\n as = _.as || [],\n n = fields.length,\n map = {};\n let field, op, m, mname, outname, i;\n\n if (n !== ops.length) {\n error('Unmatched number of fields and aggregate ops.');\n }\n\n for (i = 0; i < n; ++i) {\n field = fields[i];\n op = ops[i];\n\n if (field == null && op !== 'count') {\n error('Null aggregate field specified.');\n }\n\n mname = accessorName(field);\n outname = measureName(op, mname, as[i]);\n outputs.push(outname);\n\n if (op === 'count') {\n this._counts.push(outname);\n\n continue;\n }\n\n m = map[mname];\n\n if (!m) {\n inputVisit(field);\n m = map[mname] = [];\n m.field = field;\n\n this._measures.push(m);\n }\n\n if (op !== 'count') this._countOnly = false;\n m.push(createMeasure(op, outname));\n }\n\n this._measures = this._measures.map(m => compileMeasures(m, m.field));\n return {}; // aggregation cells (this.value)\n },\n\n // -- Cell Management -----\n cellkey: groupkey(),\n\n cell(key, t) {\n let cell = this.value[key];\n\n if (!cell) {\n cell = this.value[key] = this.newcell(key, t);\n this._adds[this._alen++] = cell;\n } else if (cell.num === 0 && this._drop && cell.stamp < this.stamp) {\n cell.stamp = this.stamp;\n this._adds[this._alen++] = cell;\n } else if (cell.stamp < this.stamp) {\n cell.stamp = this.stamp;\n this._mods[this._mlen++] = cell;\n }\n\n return cell;\n },\n\n newcell(key, t) {\n const cell = {\n key: key,\n num: 0,\n agg: null,\n tuple: this.newtuple(t, this._prev && this._prev[key]),\n stamp: this.stamp,\n store: false\n };\n\n if (!this._countOnly) {\n const measures = this._measures,\n n = measures.length;\n cell.agg = Array(n);\n\n for (let i = 0; i < n; ++i) {\n cell.agg[i] = new measures[i](cell);\n }\n }\n\n if (cell.store) {\n cell.data = new TupleStore();\n }\n\n return cell;\n },\n\n newtuple(t, p) {\n const names = this._dnames,\n dims = this._dims,\n n = dims.length,\n x = {};\n\n for (let i = 0; i < n; ++i) {\n x[names[i]] = dims[i](t);\n }\n\n return p ? replace(p.tuple, x) : ingest(x);\n },\n\n clean() {\n const cells = this.value;\n\n for (const key in cells) {\n if (cells[key].num === 0) {\n delete cells[key];\n }\n }\n },\n\n // -- Process Tuples -----\n add(t) {\n const key = this.cellkey(t),\n cell = this.cell(key, t);\n cell.num += 1;\n if (this._countOnly) return;\n if (cell.store) cell.data.add(t);\n const agg = cell.agg;\n\n for (let i = 0, n = agg.length; i < n; ++i) {\n agg[i].add(agg[i].get(t), t);\n }\n },\n\n rem(t) {\n const key = this.cellkey(t),\n cell = this.cell(key, t);\n cell.num -= 1;\n if (this._countOnly) return;\n if (cell.store) cell.data.rem(t);\n const agg = cell.agg;\n\n for (let i = 0, n = agg.length; i < n; ++i) {\n agg[i].rem(agg[i].get(t), t);\n }\n },\n\n celltuple(cell) {\n const tuple = cell.tuple,\n counts = this._counts; // consolidate stored values\n\n if (cell.store) {\n cell.data.values();\n } // update tuple properties\n\n\n for (let i = 0, n = counts.length; i < n; ++i) {\n tuple[counts[i]] = cell.num;\n }\n\n if (!this._countOnly) {\n const agg = cell.agg;\n\n for (let i = 0, n = agg.length; i < n; ++i) {\n agg[i].set(tuple);\n }\n }\n\n return tuple;\n },\n\n changes(out) {\n const adds = this._adds,\n mods = this._mods,\n prev = this._prev,\n drop = this._drop,\n add = out.add,\n rem = out.rem,\n mod = out.mod;\n let cell, key, i, n;\n if (prev) for (key in prev) {\n cell = prev[key];\n if (!drop || cell.num) rem.push(cell.tuple);\n }\n\n for (i = 0, n = this._alen; i < n; ++i) {\n add.push(this.celltuple(adds[i]));\n adds[i] = null; // for garbage collection\n }\n\n for (i = 0, n = this._mlen; i < n; ++i) {\n cell = mods[i];\n (cell.num === 0 && drop ? rem : mod).push(this.celltuple(cell));\n mods[i] = null; // for garbage collection\n }\n\n this._alen = this._mlen = 0; // reset list of active cells\n\n this._prev = null;\n return out;\n }\n\n});\n\nconst EPSILON$1 = 1e-14;\n/**\n * Generates a binning function for discretizing data.\n * @constructor\n * @param {object} params - The parameters for this operator. The\n * provided values should be valid options for the {@link bin} function.\n * @param {function(object): *} params.field - The data field to bin.\n */\n\nfunction Bin(params) {\n Transform.call(this, null, params);\n}\nBin.Definition = {\n 'type': 'Bin',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'interval',\n 'type': 'boolean',\n 'default': true\n }, {\n 'name': 'anchor',\n 'type': 'number'\n }, {\n 'name': 'maxbins',\n 'type': 'number',\n 'default': 20\n }, {\n 'name': 'base',\n 'type': 'number',\n 'default': 10\n }, {\n 'name': 'divide',\n 'type': 'number',\n 'array': true,\n 'default': [5, 2]\n }, {\n 'name': 'extent',\n 'type': 'number',\n 'array': true,\n 'length': 2,\n 'required': true\n }, {\n 'name': 'span',\n 'type': 'number'\n }, {\n 'name': 'step',\n 'type': 'number'\n }, {\n 'name': 'steps',\n 'type': 'number',\n 'array': true\n }, {\n 'name': 'minstep',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'nice',\n 'type': 'boolean',\n 'default': true\n }, {\n 'name': 'name',\n 'type': 'string'\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': 2,\n 'default': ['bin0', 'bin1']\n }]\n};\ninherits(Bin, Transform, {\n transform(_, pulse) {\n const band = _.interval !== false,\n bins = this._bins(_),\n start = bins.start,\n step = bins.step,\n as = _.as || ['bin0', 'bin1'],\n b0 = as[0],\n b1 = as[1];\n\n let flag;\n\n if (_.modified()) {\n pulse = pulse.reflow(true);\n flag = pulse.SOURCE;\n } else {\n flag = pulse.modified(accessorFields(_.field)) ? pulse.ADD_MOD : pulse.ADD;\n }\n\n pulse.visit(flag, band ? t => {\n const v = bins(t); // minimum bin value (inclusive)\n\n t[b0] = v; // maximum bin value (exclusive)\n // use convoluted math for better floating point agreement\n // see https://github.com/vega/vega/issues/830\n // infinite values propagate through this formula! #2227\n\n t[b1] = v == null ? null : start + step * (1 + (v - start) / step);\n } : t => t[b0] = bins(t));\n return pulse.modifies(band ? as : b0);\n },\n\n _bins(_) {\n if (this.value && !_.modified()) {\n return this.value;\n }\n\n const field = _.field,\n bins = bin(_),\n step = bins.step;\n let start = bins.start,\n stop = start + Math.ceil((bins.stop - start) / step) * step,\n a,\n d;\n\n if ((a = _.anchor) != null) {\n d = a - (start + step * Math.floor((a - start) / step));\n start += d;\n stop += d;\n }\n\n const f = function (t) {\n let v = toNumber(field(t));\n return v == null ? null : v < start ? -Infinity : v > stop ? +Infinity : (v = Math.max(start, Math.min(v, stop - step)), start + step * Math.floor(EPSILON$1 + (v - start) / step));\n };\n\n f.start = start;\n f.stop = bins.stop;\n f.step = step;\n return this.value = accessor(f, accessorFields(field), _.name || 'bin_' + accessorName(field));\n }\n\n});\n\nfunction SortedList (idFunc, source, input) {\n const $ = idFunc;\n let data = source || [],\n add = input || [],\n rem = {},\n cnt = 0;\n return {\n add: t => add.push(t),\n remove: t => rem[$(t)] = ++cnt,\n size: () => data.length,\n data: (compare, resort) => {\n if (cnt) {\n data = data.filter(t => !rem[$(t)]);\n rem = {};\n cnt = 0;\n }\n\n if (resort && compare) {\n data.sort(compare);\n }\n\n if (add.length) {\n data = compare ? merge(compare, data, add.sort(compare)) : data.concat(add);\n add = [];\n }\n\n return data;\n }\n };\n}\n\n/**\n * Collects all data tuples that pass through this operator.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(*,*): number} [params.sort] - An optional\n * comparator function for additionally sorting the collected tuples.\n */\n\nfunction Collect(params) {\n Transform.call(this, [], params);\n}\nCollect.Definition = {\n 'type': 'Collect',\n 'metadata': {\n 'source': true\n },\n 'params': [{\n 'name': 'sort',\n 'type': 'compare'\n }]\n};\ninherits(Collect, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.ALL),\n list = SortedList(tupleid, this.value, out.materialize(out.ADD).add),\n sort = _.sort,\n mod = pulse.changed() || sort && (_.modified('sort') || pulse.modified(sort.fields));\n out.visit(out.REM, list.remove);\n this.modified(mod);\n this.value = out.source = list.data(stableCompare(sort), mod); // propagate tree root if defined\n\n if (pulse.source && pulse.source.root) {\n this.value.root = pulse.source.root;\n }\n\n return out;\n }\n\n});\n\n/**\n * Generates a comparator function.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} params.fields - The fields to compare.\n * @param {Array} [params.orders] - The sort orders.\n * Each entry should be one of \"ascending\" (default) or \"descending\".\n */\n\nfunction Compare(params) {\n Operator.call(this, null, update$5, params);\n}\ninherits(Compare, Operator);\n\nfunction update$5(_) {\n return this.value && !_.modified() ? this.value : compare(_.fields, _.orders);\n}\n\n/**\n * Count regexp-defined pattern occurrences in a text field.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - An accessor for the text field.\n * @param {string} [params.pattern] - RegExp string defining the text pattern.\n * @param {string} [params.case] - One of 'lower', 'upper' or null (mixed) case.\n * @param {string} [params.stopwords] - RegExp string of words to ignore.\n */\n\nfunction CountPattern(params) {\n Transform.call(this, null, params);\n}\nCountPattern.Definition = {\n 'type': 'CountPattern',\n 'metadata': {\n 'generates': true,\n 'changes': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'case',\n 'type': 'enum',\n 'values': ['upper', 'lower', 'mixed'],\n 'default': 'mixed'\n }, {\n 'name': 'pattern',\n 'type': 'string',\n 'default': '[\\\\w\"]+'\n }, {\n 'name': 'stopwords',\n 'type': 'string',\n 'default': ''\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': 2,\n 'default': ['text', 'count']\n }]\n};\n\nfunction tokenize(text, tcase, match) {\n switch (tcase) {\n case 'upper':\n text = text.toUpperCase();\n break;\n\n case 'lower':\n text = text.toLowerCase();\n break;\n }\n\n return text.match(match);\n}\n\ninherits(CountPattern, Transform, {\n transform(_, pulse) {\n const process = update => tuple => {\n var tokens = tokenize(get(tuple), _.case, match) || [],\n t;\n\n for (var i = 0, n = tokens.length; i < n; ++i) {\n if (!stop.test(t = tokens[i])) update(t);\n }\n };\n\n const init = this._parameterCheck(_, pulse),\n counts = this._counts,\n match = this._match,\n stop = this._stop,\n get = _.field,\n as = _.as || ['text', 'count'],\n add = process(t => counts[t] = 1 + (counts[t] || 0)),\n rem = process(t => counts[t] -= 1);\n\n if (init) {\n pulse.visit(pulse.SOURCE, add);\n } else {\n pulse.visit(pulse.ADD, add);\n pulse.visit(pulse.REM, rem);\n }\n\n return this._finish(pulse, as); // generate output tuples\n },\n\n _parameterCheck(_, pulse) {\n let init = false;\n\n if (_.modified('stopwords') || !this._stop) {\n this._stop = new RegExp('^' + (_.stopwords || '') + '$', 'i');\n init = true;\n }\n\n if (_.modified('pattern') || !this._match) {\n this._match = new RegExp(_.pattern || '[\\\\w\\']+', 'g');\n init = true;\n }\n\n if (_.modified('field') || pulse.modified(_.field.fields)) {\n init = true;\n }\n\n if (init) this._counts = {};\n return init;\n },\n\n _finish(pulse, as) {\n const counts = this._counts,\n tuples = this._tuples || (this._tuples = {}),\n text = as[0],\n count = as[1],\n out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS);\n let w, t, c;\n\n for (w in counts) {\n t = tuples[w];\n c = counts[w] || 0;\n\n if (!t && c) {\n tuples[w] = t = ingest({});\n t[text] = w;\n t[count] = c;\n out.add.push(t);\n } else if (c === 0) {\n if (t) out.rem.push(t);\n counts[w] = null;\n tuples[w] = null;\n } else if (t[count] !== c) {\n t[count] = c;\n out.mod.push(t);\n }\n }\n\n return out.modifies(as);\n }\n\n});\n\n/**\n * Perform a cross-product of a tuple stream with itself.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object):boolean} [params.filter] - An optional filter\n * function for selectively including tuples in the cross product.\n * @param {Array} [params.as] - The names of the output fields.\n */\n\nfunction Cross(params) {\n Transform.call(this, null, params);\n}\nCross.Definition = {\n 'type': 'Cross',\n 'metadata': {\n 'generates': true\n },\n 'params': [{\n 'name': 'filter',\n 'type': 'expr'\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': 2,\n 'default': ['a', 'b']\n }]\n};\ninherits(Cross, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.NO_SOURCE),\n as = _.as || ['a', 'b'],\n a = as[0],\n b = as[1],\n reset = !this.value || pulse.changed(pulse.ADD_REM) || _.modified('as') || _.modified('filter');\n\n let data = this.value;\n\n if (reset) {\n if (data) out.rem = data;\n data = pulse.materialize(pulse.SOURCE).source;\n out.add = this.value = cross(data, a, b, _.filter || truthy);\n } else {\n out.mod = data;\n }\n\n out.source = this.value;\n return out.modifies(as);\n }\n\n});\n\nfunction cross(input, a, b, filter) {\n var data = [],\n t = {},\n n = input.length,\n i = 0,\n j,\n left;\n\n for (; i < n; ++i) {\n t[a] = left = input[i];\n\n for (j = 0; j < n; ++j) {\n t[b] = input[j];\n\n if (filter(t)) {\n data.push(ingest(t));\n t = {};\n t[a] = left;\n }\n }\n }\n\n return data;\n}\n\nconst Distributions = {\n kde: randomKDE,\n mixture: randomMixture,\n normal: randomNormal,\n lognormal: randomLogNormal,\n uniform: randomUniform\n};\nconst DISTRIBUTIONS = 'distributions',\n FUNCTION = 'function',\n FIELD = 'field';\n/**\n * Parse a parameter object for a probability distribution.\n * @param {object} def - The distribution parameter object.\n * @param {function():Array} - A method for requesting\n * source data. Used for distributions (such as KDE) that\n * require sample data points. This method will only be\n * invoked if the 'from' parameter for a target data source\n * is not provided. Typically this method returns backing\n * source data for a Pulse object.\n * @return {object} - The output distribution object.\n */\n\nfunction parse(def, data) {\n const func = def[FUNCTION];\n\n if (!hasOwnProperty(Distributions, func)) {\n error('Unknown distribution function: ' + func);\n }\n\n const d = Distributions[func]();\n\n for (const name in def) {\n // if data field, extract values\n if (name === FIELD) {\n d.data((def.from || data()).map(def[name]));\n } // if distribution mixture, recurse to parse each definition\n else if (name === DISTRIBUTIONS) {\n d[name](def[name].map(_ => parse(_, data)));\n } // otherwise, simply set the parameter\n else if (typeof d[name] === FUNCTION) {\n d[name](def[name]);\n }\n }\n\n return d;\n}\n\n/**\n * Grid sample points for a probability density. Given a distribution and\n * a sampling extent, will generate points suitable for plotting either\n * PDF (probability density function) or CDF (cumulative distribution\n * function) curves.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {object} params.distribution - The probability distribution. This\n * is an object parameter dependent on the distribution type.\n * @param {string} [params.method='pdf'] - The distribution method to sample.\n * One of 'pdf' or 'cdf'.\n * @param {Array} [params.extent] - The [min, max] extent over which\n * to sample the distribution. This argument is required in most cases, but\n * can be omitted if the distribution (e.g., 'kde') supports a 'data' method\n * that returns numerical sample points from which the extent can be deduced.\n * @param {number} [params.minsteps=25] - The minimum number of curve samples\n * for plotting the density.\n * @param {number} [params.maxsteps=200] - The maximum number of curve samples\n * for plotting the density.\n * @param {number} [params.steps] - The exact number of curve samples for\n * plotting the density. If specified, overrides both minsteps and maxsteps\n * to set an exact number of uniform samples. Useful in conjunction with\n * a fixed extent to ensure consistent sample points for stacked densities.\n */\n\nfunction Density(params) {\n Transform.call(this, null, params);\n}\nconst distributions = [{\n 'key': {\n 'function': 'normal'\n },\n 'params': [{\n 'name': 'mean',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'stdev',\n 'type': 'number',\n 'default': 1\n }]\n}, {\n 'key': {\n 'function': 'lognormal'\n },\n 'params': [{\n 'name': 'mean',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'stdev',\n 'type': 'number',\n 'default': 1\n }]\n}, {\n 'key': {\n 'function': 'uniform'\n },\n 'params': [{\n 'name': 'min',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'max',\n 'type': 'number',\n 'default': 1\n }]\n}, {\n 'key': {\n 'function': 'kde'\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'from',\n 'type': 'data'\n }, {\n 'name': 'bandwidth',\n 'type': 'number',\n 'default': 0\n }]\n}];\nconst mixture = {\n 'key': {\n 'function': 'mixture'\n },\n 'params': [{\n 'name': 'distributions',\n 'type': 'param',\n 'array': true,\n 'params': distributions\n }, {\n 'name': 'weights',\n 'type': 'number',\n 'array': true\n }]\n};\nDensity.Definition = {\n 'type': 'Density',\n 'metadata': {\n 'generates': true\n },\n 'params': [{\n 'name': 'extent',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'steps',\n 'type': 'number'\n }, {\n 'name': 'minsteps',\n 'type': 'number',\n 'default': 25\n }, {\n 'name': 'maxsteps',\n 'type': 'number',\n 'default': 200\n }, {\n 'name': 'method',\n 'type': 'string',\n 'default': 'pdf',\n 'values': ['pdf', 'cdf']\n }, {\n 'name': 'distribution',\n 'type': 'param',\n 'params': distributions.concat(mixture)\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'default': ['value', 'density']\n }]\n};\ninherits(Density, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS);\n\n if (!this.value || pulse.changed() || _.modified()) {\n const dist = parse(_.distribution, source(pulse)),\n minsteps = _.steps || _.minsteps || 25,\n maxsteps = _.steps || _.maxsteps || 200;\n let method = _.method || 'pdf';\n\n if (method !== 'pdf' && method !== 'cdf') {\n error('Invalid density method: ' + method);\n }\n\n if (!_.extent && !dist.data) {\n error('Missing density extent parameter.');\n }\n\n method = dist[method];\n const as = _.as || ['value', 'density'],\n domain = _.extent || extent(dist.data()),\n values = sampleCurve(method, domain, minsteps, maxsteps).map(v => {\n const tuple = {};\n tuple[as[0]] = v[0];\n tuple[as[1]] = v[1];\n return ingest(tuple);\n });\n if (this.value) out.rem = this.value;\n this.value = out.add = out.source = values;\n }\n\n return out;\n }\n\n});\n\nfunction source(pulse) {\n return () => pulse.materialize(pulse.SOURCE).source;\n}\n\nfunction fieldNames(fields, as) {\n if (!fields) return null;\n return fields.map((f, i) => as[i] || accessorName(f));\n}\nfunction partition$1(data, groupby, field) {\n const groups = [],\n get = f => f(t);\n\n let map, i, n, t, k, g; // partition data points into groups\n\n if (groupby == null) {\n groups.push(data.map(field));\n } else {\n for (map = {}, i = 0, n = data.length; i < n; ++i) {\n t = data[i];\n k = groupby.map(get);\n g = map[k];\n\n if (!g) {\n map[k] = g = [];\n g.dims = k;\n groups.push(g);\n }\n\n g.push(field(t));\n }\n }\n\n return groups;\n}\n\nconst Output = 'bin';\n/**\n * Dot density binning for dot plot construction.\n * Based on Leland Wilkinson, Dot Plots, The American Statistician, 1999.\n * https://www.cs.uic.edu/~wilkinson/Publications/dotplots.pdf\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The value field to bin.\n * @param {Array} [params.groupby] - An array of accessors to groupby.\n * @param {number} [params.step] - The step size (bin width) within which dots should be\n * stacked. Defaults to 1/30 of the extent of the data *field*.\n * @param {boolean} [params.smooth=false] - A boolean flag indicating if dot density\n * stacks should be smoothed to reduce variance.\n */\n\nfunction DotBin(params) {\n Transform.call(this, null, params);\n}\nDotBin.Definition = {\n 'type': 'DotBin',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'step',\n 'type': 'number'\n }, {\n 'name': 'smooth',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'as',\n 'type': 'string',\n 'default': Output\n }]\n};\n\nconst autostep = (data, field) => span(extent(data, field)) / 30;\n\ninherits(DotBin, Transform, {\n transform(_, pulse) {\n if (this.value && !(_.modified() || pulse.changed())) {\n return pulse; // early exit\n }\n\n const source = pulse.materialize(pulse.SOURCE).source,\n groups = partition$1(pulse.source, _.groupby, identity),\n smooth = _.smooth || false,\n field = _.field,\n step = _.step || autostep(source, field),\n sort = stableCompare((a, b) => field(a) - field(b)),\n as = _.as || Output,\n n = groups.length; // compute dotplot bins per group\n\n let min = Infinity,\n max = -Infinity,\n i = 0,\n j;\n\n for (; i < n; ++i) {\n const g = groups[i].sort(sort);\n j = -1;\n\n for (const v of dotbin(g, step, smooth, field)) {\n if (v < min) min = v;\n if (v > max) max = v;\n g[++j][as] = v;\n }\n }\n\n this.value = {\n start: min,\n stop: max,\n step: step\n };\n return pulse.reflow(true).modifies(as);\n }\n\n});\n\n/**\n * Wraps an expression function with access to external parameters.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function} params.expr - The expression function. The\n * function should accept both a datum and a parameter object.\n * This operator's value will be a new function that wraps the\n * expression function with access to this operator's parameters.\n */\n\nfunction Expression(params) {\n Operator.call(this, null, update$4, params);\n this.modified(true);\n}\ninherits(Expression, Operator);\n\nfunction update$4(_) {\n const expr = _.expr;\n return this.value && !_.modified('expr') ? this.value : accessor(datum => expr(datum, _), accessorFields(expr), accessorName(expr));\n}\n\n/**\n * Computes extents (min/max) for a data field.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The field over which to compute extends.\n */\n\nfunction Extent(params) {\n Transform.call(this, [undefined, undefined], params);\n}\nExtent.Definition = {\n 'type': 'Extent',\n 'metadata': {},\n 'params': [{\n 'name': 'field',\n 'type': 'field',\n 'required': true\n }]\n};\ninherits(Extent, Transform, {\n transform(_, pulse) {\n const extent = this.value,\n field = _.field,\n mod = pulse.changed() || pulse.modified(field.fields) || _.modified('field');\n\n let min = extent[0],\n max = extent[1];\n\n if (mod || min == null) {\n min = +Infinity;\n max = -Infinity;\n }\n\n pulse.visit(mod ? pulse.SOURCE : pulse.ADD, t => {\n const v = toNumber(field(t));\n\n if (v != null) {\n // NaNs will fail all comparisons!\n if (v < min) min = v;\n if (v > max) max = v;\n }\n });\n\n if (!Number.isFinite(min) || !Number.isFinite(max)) {\n let name = accessorName(field);\n if (name) name = \" for field \\\"\".concat(name, \"\\\"\");\n pulse.dataflow.warn(\"Infinite extent\".concat(name, \": [\").concat(min, \", \").concat(max, \"]\"));\n min = max = undefined;\n }\n\n this.value = [min, max];\n }\n\n});\n\n/**\n * Provides a bridge between a parent transform and a target subflow that\n * consumes only a subset of the tuples that pass through the parent.\n * @constructor\n * @param {Pulse} pulse - A pulse to use as the value of this operator.\n * @param {Transform} parent - The parent transform (typically a Facet instance).\n */\n\nfunction Subflow(pulse, parent) {\n Operator.call(this, pulse);\n this.parent = parent;\n this.count = 0;\n}\ninherits(Subflow, Operator, {\n /**\n * Routes pulses from this subflow to a target transform.\n * @param {Transform} target - A transform that receives the subflow of tuples.\n */\n connect(target) {\n this.detachSubflow = target.detachSubflow;\n this.targets().add(target);\n return target.source = this;\n },\n\n /**\n * Add an 'add' tuple to the subflow pulse.\n * @param {Tuple} t - The tuple being added.\n */\n add(t) {\n this.count += 1;\n this.value.add.push(t);\n },\n\n /**\n * Add a 'rem' tuple to the subflow pulse.\n * @param {Tuple} t - The tuple being removed.\n */\n rem(t) {\n this.count -= 1;\n this.value.rem.push(t);\n },\n\n /**\n * Add a 'mod' tuple to the subflow pulse.\n * @param {Tuple} t - The tuple being modified.\n */\n mod(t) {\n this.value.mod.push(t);\n },\n\n /**\n * Re-initialize this operator's pulse value.\n * @param {Pulse} pulse - The pulse to copy from.\n * @see Pulse.init\n */\n init(pulse) {\n this.value.init(pulse, pulse.NO_SOURCE);\n },\n\n /**\n * Evaluate this operator. This method overrides the\n * default behavior to simply return the contained pulse value.\n * @return {Pulse}\n */\n evaluate() {\n // assert: this.value.stamp === pulse.stamp\n return this.value;\n }\n\n});\n\n/**\n * Facets a dataflow into a set of subflows based on a key.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(Dataflow, string): Operator} params.subflow - A function\n * that generates a subflow of operators and returns its root operator.\n * @param {function(object): *} params.key - The key field to facet by.\n */\n\nfunction Facet(params) {\n Transform.call(this, {}, params);\n this._keys = fastmap(); // cache previously calculated key values\n // keep track of active subflows, use as targets array for listeners\n // this allows us to limit propagation to only updated subflows\n\n const a = this._targets = [];\n a.active = 0;\n\n a.forEach = f => {\n for (let i = 0, n = a.active; i < n; ++i) {\n f(a[i], i, a);\n }\n };\n}\ninherits(Facet, Transform, {\n activate(flow) {\n this._targets[this._targets.active++] = flow;\n },\n\n // parent argument provided by PreFacet subclass\n subflow(key, flow, pulse, parent) {\n const flows = this.value;\n let sf = hasOwnProperty(flows, key) && flows[key],\n df,\n p;\n\n if (!sf) {\n p = parent || (p = this._group[key]) && p.tuple;\n df = pulse.dataflow;\n sf = new Subflow(pulse.fork(pulse.NO_SOURCE), this);\n df.add(sf).connect(flow(df, key, p));\n flows[key] = sf;\n this.activate(sf);\n } else if (sf.value.stamp < pulse.stamp) {\n sf.init(pulse);\n this.activate(sf);\n }\n\n return sf;\n },\n\n clean() {\n const flows = this.value;\n let detached = 0;\n\n for (const key in flows) {\n if (flows[key].count === 0) {\n const detach = flows[key].detachSubflow;\n if (detach) detach();\n delete flows[key];\n ++detached;\n }\n } // remove inactive targets from the active targets array\n\n\n if (detached) {\n const active = this._targets.filter(sf => sf && sf.count > 0);\n\n this.initTargets(active);\n }\n },\n\n initTargets(act) {\n const a = this._targets,\n n = a.length,\n m = act ? act.length : 0;\n let i = 0;\n\n for (; i < m; ++i) {\n a[i] = act[i];\n }\n\n for (; i < n && a[i] != null; ++i) {\n a[i] = null; // ensure old flows can be garbage collected\n }\n\n a.active = m;\n },\n\n transform(_, pulse) {\n const df = pulse.dataflow,\n key = _.key,\n flow = _.subflow,\n cache = this._keys,\n rekey = _.modified('key'),\n subflow = key => this.subflow(key, flow, pulse);\n\n this._group = _.group || {};\n this.initTargets(); // reset list of active subflows\n\n pulse.visit(pulse.REM, t => {\n const id = tupleid(t),\n k = cache.get(id);\n\n if (k !== undefined) {\n cache.delete(id);\n subflow(k).rem(t);\n }\n });\n pulse.visit(pulse.ADD, t => {\n const k = key(t);\n cache.set(tupleid(t), k);\n subflow(k).add(t);\n });\n\n if (rekey || pulse.modified(key.fields)) {\n pulse.visit(pulse.MOD, t => {\n const id = tupleid(t),\n k0 = cache.get(id),\n k1 = key(t);\n\n if (k0 === k1) {\n subflow(k1).mod(t);\n } else {\n cache.set(id, k1);\n subflow(k0).rem(t);\n subflow(k1).add(t);\n }\n });\n } else if (pulse.changed(pulse.MOD)) {\n pulse.visit(pulse.MOD, t => {\n subflow(cache.get(tupleid(t))).mod(t);\n });\n }\n\n if (rekey) {\n pulse.visit(pulse.REFLOW, t => {\n const id = tupleid(t),\n k0 = cache.get(id),\n k1 = key(t);\n\n if (k0 !== k1) {\n cache.set(id, k1);\n subflow(k0).rem(t);\n subflow(k1).add(t);\n }\n });\n }\n\n if (pulse.clean()) {\n df.runAfter(() => {\n this.clean();\n cache.clean();\n });\n } else if (cache.empty > df.cleanThreshold) {\n df.runAfter(cache.clean);\n }\n\n return pulse;\n }\n\n});\n\n/**\n * Generates one or more field accessor functions.\n * If the 'name' parameter is an array, an array of field accessors\n * will be created and the 'as' parameter will be ignored.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {string} params.name - The field name(s) to access.\n * @param {string} params.as - The accessor function name.\n */\n\nfunction Field(params) {\n Operator.call(this, null, update$3, params);\n}\ninherits(Field, Operator);\n\nfunction update$3(_) {\n return this.value && !_.modified() ? this.value : isArray(_.name) ? array(_.name).map(f => field(f)) : field(_.name, _.as);\n}\n\n/**\n * Filters data tuples according to a predicate function.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.expr - The predicate expression function\n * that determines a tuple's filter status. Truthy values pass the filter.\n */\n\nfunction Filter(params) {\n Transform.call(this, fastmap(), params);\n}\nFilter.Definition = {\n 'type': 'Filter',\n 'metadata': {\n 'changes': true\n },\n 'params': [{\n 'name': 'expr',\n 'type': 'expr',\n 'required': true\n }]\n};\ninherits(Filter, Transform, {\n transform(_, pulse) {\n const df = pulse.dataflow,\n cache = this.value,\n // cache ids of filtered tuples\n output = pulse.fork(),\n add = output.add,\n rem = output.rem,\n mod = output.mod,\n test = _.expr;\n let isMod = true;\n pulse.visit(pulse.REM, t => {\n const id = tupleid(t);\n if (!cache.has(id)) rem.push(t);else cache.delete(id);\n });\n pulse.visit(pulse.ADD, t => {\n if (test(t, _)) add.push(t);else cache.set(tupleid(t), 1);\n });\n\n function revisit(t) {\n const id = tupleid(t),\n b = test(t, _),\n s = cache.get(id);\n\n if (b && s) {\n cache.delete(id);\n add.push(t);\n } else if (!b && !s) {\n cache.set(id, 1);\n rem.push(t);\n } else if (isMod && b && !s) {\n mod.push(t);\n }\n }\n\n pulse.visit(pulse.MOD, revisit);\n\n if (_.modified()) {\n isMod = false;\n pulse.visit(pulse.REFLOW, revisit);\n }\n\n if (cache.empty > df.cleanThreshold) df.runAfter(cache.clean);\n return output;\n }\n\n});\n\n/**\n * Flattens array-typed field values into new data objects.\n * If multiple fields are specified, they are treated as parallel arrays,\n * with output values included for each matching index (or null if missing).\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} params.fields - An array of field\n * accessors for the tuple fields that should be flattened.\n * @param {string} [params.index] - Optional output field name for index\n * value. If unspecified, no index field is included in the output.\n * @param {Array} [params.as] - Output field names for flattened\n * array fields. Any unspecified fields will use the field name provided\n * by the fields accessors.\n */\n\nfunction Flatten(params) {\n Transform.call(this, [], params);\n}\nFlatten.Definition = {\n 'type': 'Flatten',\n 'metadata': {\n 'generates': true\n },\n 'params': [{\n 'name': 'fields',\n 'type': 'field',\n 'array': true,\n 'required': true\n }, {\n 'name': 'index',\n 'type': 'string'\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true\n }]\n};\ninherits(Flatten, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.NO_SOURCE),\n fields = _.fields,\n as = fieldNames(fields, _.as || []),\n index = _.index || null,\n m = as.length; // remove any previous results\n\n out.rem = this.value; // generate flattened tuples\n\n pulse.visit(pulse.SOURCE, t => {\n const arrays = fields.map(f => f(t)),\n maxlen = arrays.reduce((l, a) => Math.max(l, a.length), 0);\n let i = 0,\n j,\n d,\n v;\n\n for (; i < maxlen; ++i) {\n d = derive(t);\n\n for (j = 0; j < m; ++j) {\n d[as[j]] = (v = arrays[j][i]) == null ? null : v;\n }\n\n if (index) {\n d[index] = i;\n }\n\n out.add.push(d);\n }\n });\n this.value = out.source = out.add;\n if (index) out.modifies(index);\n return out.modifies(as);\n }\n\n});\n\n/**\n * Folds one more tuple fields into multiple tuples in which the field\n * name and values are available under new 'key' and 'value' fields.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.fields - An array of field accessors\n * for the tuple fields that should be folded.\n * @param {Array} [params.as] - Output field names for folded key\n * and value fields, defaults to ['key', 'value'].\n */\n\nfunction Fold(params) {\n Transform.call(this, [], params);\n}\nFold.Definition = {\n 'type': 'Fold',\n 'metadata': {\n 'generates': true\n },\n 'params': [{\n 'name': 'fields',\n 'type': 'field',\n 'array': true,\n 'required': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': 2,\n 'default': ['key', 'value']\n }]\n};\ninherits(Fold, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.NO_SOURCE),\n fields = _.fields,\n fnames = fields.map(accessorName),\n as = _.as || ['key', 'value'],\n k = as[0],\n v = as[1],\n n = fields.length;\n out.rem = this.value;\n pulse.visit(pulse.SOURCE, t => {\n for (let i = 0, d; i < n; ++i) {\n d = derive(t);\n d[k] = fnames[i];\n d[v] = fields[i](t);\n out.add.push(d);\n }\n });\n this.value = out.source = out.add;\n return out.modifies(as);\n }\n\n});\n\n/**\n * Invokes a function for each data tuple and saves the results as a new field.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.expr - The formula function to invoke for each tuple.\n * @param {string} params.as - The field name under which to save the result.\n * @param {boolean} [params.initonly=false] - If true, the formula is applied to\n * added tuples only, and does not update in response to modifications.\n */\n\nfunction Formula(params) {\n Transform.call(this, null, params);\n}\nFormula.Definition = {\n 'type': 'Formula',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'expr',\n 'type': 'expr',\n 'required': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'required': true\n }, {\n 'name': 'initonly',\n 'type': 'boolean'\n }]\n};\ninherits(Formula, Transform, {\n transform(_, pulse) {\n const func = _.expr,\n as = _.as,\n mod = _.modified(),\n flag = _.initonly ? pulse.ADD : mod ? pulse.SOURCE : pulse.modified(func.fields) || pulse.modified(as) ? pulse.ADD_MOD : pulse.ADD;\n\n if (mod) {\n // parameters updated, need to reflow\n pulse = pulse.materialize().reflow(true);\n }\n\n if (!_.initonly) {\n pulse.modifies(as);\n }\n\n return pulse.visit(flag, t => t[as] = func(t, _));\n }\n\n});\n\n/**\n * Generates data tuples using a provided generator function.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(Parameters): object} params.generator - A tuple generator\n * function. This function is given the operator parameters as input.\n * Changes to any additional parameters will not trigger re-calculation\n * of previously generated tuples. Only future tuples are affected.\n * @param {number} params.size - The number of tuples to produce.\n */\n\nfunction Generate(params) {\n Transform.call(this, [], params);\n}\ninherits(Generate, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.ALL),\n gen = _.generator;\n let data = this.value,\n num = _.size - data.length,\n add,\n rem,\n t;\n\n if (num > 0) {\n // need more tuples, generate and add\n for (add = []; --num >= 0;) {\n add.push(t = ingest(gen(_)));\n data.push(t);\n }\n\n out.add = out.add.length ? out.materialize(out.ADD).add.concat(add) : add;\n } else {\n // need fewer tuples, remove\n rem = data.slice(0, -num);\n out.rem = out.rem.length ? out.materialize(out.REM).rem.concat(rem) : rem;\n data = data.slice(-num);\n }\n\n out.source = this.value = data;\n return out;\n }\n\n});\n\nconst Methods = {\n value: 'value',\n median: median,\n mean: mean,\n min: min,\n max: max\n};\nconst Empty = [];\n/**\n * Impute missing values.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The value field to impute.\n * @param {Array} [params.groupby] - An array of\n * accessors to determine series within which to perform imputation.\n * @param {function(object): *} params.key - An accessor for a key value.\n * Each key value should be unique within a group. New tuples will be\n * imputed for any key values that are not found within a group.\n * @param {Array<*>} [params.keyvals] - Optional array of required key\n * values. New tuples will be imputed for any key values that are not\n * found within a group. In addition, these values will be automatically\n * augmented with the key values observed in the input data.\n * @param {string} [method='value'] - The imputation method to use. One of\n * 'value', 'mean', 'median', 'max', 'min'.\n * @param {*} [value=0] - The constant value to use for imputation\n * when using method 'value'.\n */\n\nfunction Impute(params) {\n Transform.call(this, [], params);\n}\nImpute.Definition = {\n 'type': 'Impute',\n 'metadata': {\n 'changes': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'key',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'keyvals',\n 'array': true\n }, {\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'method',\n 'type': 'enum',\n 'default': 'value',\n 'values': ['value', 'mean', 'median', 'max', 'min']\n }, {\n 'name': 'value',\n 'default': 0\n }]\n};\n\nfunction getValue(_) {\n var m = _.method || Methods.value,\n v;\n\n if (Methods[m] == null) {\n error('Unrecognized imputation method: ' + m);\n } else if (m === Methods.value) {\n v = _.value !== undefined ? _.value : 0;\n return () => v;\n } else {\n return Methods[m];\n }\n}\n\nfunction getField(_) {\n const f = _.field;\n return t => t ? f(t) : NaN;\n}\n\ninherits(Impute, Transform, {\n transform(_, pulse) {\n var out = pulse.fork(pulse.ALL),\n impute = getValue(_),\n field = getField(_),\n fName = accessorName(_.field),\n kName = accessorName(_.key),\n gNames = (_.groupby || []).map(accessorName),\n groups = partition(pulse.source, _.groupby, _.key, _.keyvals),\n curr = [],\n prev = this.value,\n m = groups.domain.length,\n group,\n value,\n gVals,\n kVal,\n g,\n i,\n j,\n l,\n n,\n t;\n\n for (g = 0, l = groups.length; g < l; ++g) {\n group = groups[g];\n gVals = group.values;\n value = NaN; // add tuples for missing values\n\n for (j = 0; j < m; ++j) {\n if (group[j] != null) continue;\n kVal = groups.domain[j];\n t = {\n _impute: true\n };\n\n for (i = 0, n = gVals.length; i < n; ++i) t[gNames[i]] = gVals[i];\n\n t[kName] = kVal;\n t[fName] = Number.isNaN(value) ? value = impute(group, field) : value;\n curr.push(ingest(t));\n }\n } // update pulse with imputed tuples\n\n\n if (curr.length) out.add = out.materialize(out.ADD).add.concat(curr);\n if (prev.length) out.rem = out.materialize(out.REM).rem.concat(prev);\n this.value = curr;\n return out;\n }\n\n});\n\nfunction partition(data, groupby, key, keyvals) {\n var get = f => f(t),\n groups = [],\n domain = keyvals ? keyvals.slice() : [],\n kMap = {},\n gMap = {},\n gVals,\n gKey,\n group,\n i,\n j,\n k,\n n,\n t;\n\n domain.forEach((k, i) => kMap[k] = i + 1);\n\n for (i = 0, n = data.length; i < n; ++i) {\n t = data[i];\n k = key(t);\n j = kMap[k] || (kMap[k] = domain.push(k));\n gKey = (gVals = groupby ? groupby.map(get) : Empty) + '';\n\n if (!(group = gMap[gKey])) {\n group = gMap[gKey] = [];\n groups.push(group);\n group.values = gVals;\n }\n\n group[j - 1] = t;\n }\n\n groups.domain = domain;\n return groups;\n}\n\n/**\n * Extend input tuples with aggregate values.\n * Calcuates aggregate values and joins them with the input stream.\n * @constructor\n */\n\nfunction JoinAggregate(params) {\n Aggregate.call(this, params);\n}\nJoinAggregate.Definition = {\n 'type': 'JoinAggregate',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'fields',\n 'type': 'field',\n 'null': true,\n 'array': true\n }, {\n 'name': 'ops',\n 'type': 'enum',\n 'array': true,\n 'values': ValidAggregateOps\n }, {\n 'name': 'as',\n 'type': 'string',\n 'null': true,\n 'array': true\n }, {\n 'name': 'key',\n 'type': 'field'\n }]\n};\ninherits(JoinAggregate, Aggregate, {\n transform(_, pulse) {\n const aggr = this,\n mod = _.modified();\n\n let cells; // process all input tuples to calculate aggregates\n\n if (aggr.value && (mod || pulse.modified(aggr._inputs, true))) {\n cells = aggr.value = mod ? aggr.init(_) : {};\n pulse.visit(pulse.SOURCE, t => aggr.add(t));\n } else {\n cells = aggr.value = aggr.value || this.init(_);\n pulse.visit(pulse.REM, t => aggr.rem(t));\n pulse.visit(pulse.ADD, t => aggr.add(t));\n } // update aggregation cells\n\n\n aggr.changes(); // write aggregate values to input tuples\n\n pulse.visit(pulse.SOURCE, t => {\n extend(t, cells[aggr.cellkey(t)].tuple);\n });\n return pulse.reflow(mod).modifies(this._outputs);\n },\n\n changes() {\n const adds = this._adds,\n mods = this._mods;\n let i, n;\n\n for (i = 0, n = this._alen; i < n; ++i) {\n this.celltuple(adds[i]);\n adds[i] = null; // for garbage collection\n }\n\n for (i = 0, n = this._mlen; i < n; ++i) {\n this.celltuple(mods[i]);\n mods[i] = null; // for garbage collection\n }\n\n this._alen = this._mlen = 0; // reset list of active cells\n }\n\n});\n\n/**\n * Compute kernel density estimates (KDE) for one or more data groups.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} [params.groupby] - An array of accessors\n * to groupby.\n * @param {function(object): *} params.field - An accessor for the data field\n * to estimate.\n * @param {number} [params.bandwidth=0] - The KDE kernel bandwidth.\n * If zero or unspecified, the bandwidth is automatically determined.\n * @param {boolean} [params.counts=false] - A boolean flag indicating if the\n * output values should be probability estimates (false, default) or\n * smoothed counts (true).\n * @param {string} [params.cumulative=false] - A boolean flag indicating if a\n * density (false) or cumulative distribution (true) should be generated.\n * @param {Array} [params.extent] - The domain extent over which to\n * plot the density. If unspecified, the [min, max] data extent is used.\n * @param {string} [params.resolve='independent'] - Indicates how parameters for\n * multiple densities should be resolved. If \"independent\" (the default), each\n * density may have its own domain extent and dynamic number of curve sample\n * steps. If \"shared\", the KDE transform will ensure that all densities are\n * defined over a shared domain and curve steps, enabling stacking.\n * @param {number} [params.minsteps=25] - The minimum number of curve samples\n * for plotting the density.\n * @param {number} [params.maxsteps=200] - The maximum number of curve samples\n * for plotting the density.\n * @param {number} [params.steps] - The exact number of curve samples for\n * plotting the density. If specified, overrides both minsteps and maxsteps\n * to set an exact number of uniform samples. Useful in conjunction with\n * a fixed extent to ensure consistent sample points for stacked densities.\n */\n\nfunction KDE(params) {\n Transform.call(this, null, params);\n}\nKDE.Definition = {\n 'type': 'KDE',\n 'metadata': {\n 'generates': true\n },\n 'params': [{\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'field',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'cumulative',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'counts',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'bandwidth',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'extent',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'resolve',\n 'type': 'enum',\n 'values': ['shared', 'independent'],\n 'default': 'independent'\n }, {\n 'name': 'steps',\n 'type': 'number'\n }, {\n 'name': 'minsteps',\n 'type': 'number',\n 'default': 25\n }, {\n 'name': 'maxsteps',\n 'type': 'number',\n 'default': 200\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'default': ['value', 'density']\n }]\n};\ninherits(KDE, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS);\n\n if (!this.value || pulse.changed() || _.modified()) {\n const source = pulse.materialize(pulse.SOURCE).source,\n groups = partition$1(source, _.groupby, _.field),\n names = (_.groupby || []).map(accessorName),\n bandwidth = _.bandwidth,\n method = _.cumulative ? 'cdf' : 'pdf',\n as = _.as || ['value', 'density'],\n values = [];\n let domain = _.extent,\n minsteps = _.steps || _.minsteps || 25,\n maxsteps = _.steps || _.maxsteps || 200;\n\n if (method !== 'pdf' && method !== 'cdf') {\n error('Invalid density method: ' + method);\n }\n\n if (_.resolve === 'shared') {\n if (!domain) domain = extent(source, _.field);\n minsteps = maxsteps = _.steps || maxsteps;\n }\n\n groups.forEach(g => {\n const density = randomKDE(g, bandwidth)[method],\n scale = _.counts ? g.length : 1,\n local = domain || extent(g);\n sampleCurve(density, local, minsteps, maxsteps).forEach(v => {\n const t = {};\n\n for (let i = 0; i < names.length; ++i) {\n t[names[i]] = g.dims[i];\n }\n\n t[as[0]] = v[0];\n t[as[1]] = v[1] * scale;\n values.push(ingest(t));\n });\n });\n if (this.value) out.rem = this.value;\n this.value = out.add = out.source = values;\n }\n\n return out;\n }\n\n});\n\n/**\n * Generates a key function.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} params.fields - The field name(s) for the key function.\n * @param {boolean} params.flat - A boolean flag indicating if the field names\n * should be treated as flat property names, side-stepping nested field\n * lookups normally indicated by dot or bracket notation.\n */\n\nfunction Key(params) {\n Operator.call(this, null, update$2, params);\n}\ninherits(Key, Operator);\n\nfunction update$2(_) {\n return this.value && !_.modified() ? this.value : key(_.fields, _.flat);\n}\n\n/**\n * Load and parse data from an external source. Marshalls parameter\n * values and then invokes the Dataflow request method.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {string} params.url - The URL to load from.\n * @param {object} params.format - The data format options.\n */\n\nfunction Load(params) {\n Transform.call(this, [], params);\n this._pending = null;\n}\ninherits(Load, Transform, {\n transform(_, pulse) {\n const df = pulse.dataflow;\n\n if (this._pending) {\n // update state and return pulse\n return output(this, pulse, this._pending);\n }\n\n if (stop(_)) return pulse.StopPropagation;\n\n if (_.values) {\n // parse and ingest values, return output pulse\n return output(this, pulse, df.parse(_.values, _.format));\n } else if (_.async) {\n // return promise for non-blocking async loading\n const p = df.request(_.url, _.format).then(res => {\n this._pending = array(res.data);\n return df => df.touch(this);\n });\n return {\n async: p\n };\n } else {\n // return promise for synchronous loading\n return df.request(_.url, _.format).then(res => output(this, pulse, array(res.data)));\n }\n }\n\n});\n\nfunction stop(_) {\n return _.modified('async') && !(_.modified('values') || _.modified('url') || _.modified('format'));\n}\n\nfunction output(op, pulse, data) {\n data.forEach(ingest);\n const out = pulse.fork(pulse.NO_FIELDS & pulse.NO_SOURCE);\n out.rem = op.value;\n op.value = out.source = out.add = data;\n op._pending = null;\n if (out.rem.length) out.clean(true);\n return out;\n}\n\n/**\n * Extend tuples by joining them with values from a lookup table.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Map} params.index - The lookup table map.\n * @param {Array} params.as - Output field names for each lookup value.\n * @param {*} [params.default] - A default value to use if lookup fails.\n */\n\nfunction Lookup(params) {\n Transform.call(this, {}, params);\n}\nLookup.Definition = {\n 'type': 'Lookup',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'index',\n 'type': 'index',\n 'params': [{\n 'name': 'from',\n 'type': 'data',\n 'required': true\n }, {\n 'name': 'key',\n 'type': 'field',\n 'required': true\n }]\n }, {\n 'name': 'values',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'fields',\n 'type': 'field',\n 'array': true,\n 'required': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true\n }, {\n 'name': 'default',\n 'default': null\n }]\n};\ninherits(Lookup, Transform, {\n transform(_, pulse) {\n const keys = _.fields,\n index = _.index,\n values = _.values,\n defaultValue = _.default == null ? null : _.default,\n reset = _.modified(),\n n = keys.length;\n\n let flag = reset ? pulse.SOURCE : pulse.ADD,\n out = pulse,\n as = _.as,\n set,\n m,\n mods;\n\n if (values) {\n m = values.length;\n\n if (n > 1 && !as) {\n error('Multi-field lookup requires explicit \"as\" parameter.');\n }\n\n if (as && as.length !== n * m) {\n error('The \"as\" parameter has too few output field names.');\n }\n\n as = as || values.map(accessorName);\n\n set = function (t) {\n for (var i = 0, k = 0, j, v; i < n; ++i) {\n v = index.get(keys[i](t));\n if (v == null) for (j = 0; j < m; ++j, ++k) t[as[k]] = defaultValue;else for (j = 0; j < m; ++j, ++k) t[as[k]] = values[j](v);\n }\n };\n } else {\n if (!as) {\n error('Missing output field names.');\n }\n\n set = function (t) {\n for (var i = 0, v; i < n; ++i) {\n v = index.get(keys[i](t));\n t[as[i]] = v == null ? defaultValue : v;\n }\n };\n }\n\n if (reset) {\n out = pulse.reflow(true);\n } else {\n mods = keys.some(k => pulse.modified(k.fields));\n flag |= mods ? pulse.MOD : 0;\n }\n\n pulse.visit(flag, set);\n return out.modifies(as);\n }\n\n});\n\n/**\n * Computes global min/max extents over a collection of extents.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array>} params.extents - The input extents.\n */\n\nfunction MultiExtent(params) {\n Operator.call(this, null, update$1, params);\n}\ninherits(MultiExtent, Operator);\n\nfunction update$1(_) {\n if (this.value && !_.modified()) {\n return this.value;\n }\n\n const ext = _.extents,\n n = ext.length;\n let min = +Infinity,\n max = -Infinity,\n i,\n e;\n\n for (i = 0; i < n; ++i) {\n e = ext[i];\n if (e[0] < min) min = e[0];\n if (e[1] > max) max = e[1];\n }\n\n return [min, max];\n}\n\n/**\n * Merge a collection of value arrays.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array>} params.values - The input value arrrays.\n */\n\nfunction MultiValues(params) {\n Operator.call(this, null, update, params);\n}\ninherits(MultiValues, Operator);\n\nfunction update(_) {\n return this.value && !_.modified() ? this.value : _.values.reduce((data, _) => data.concat(_), []);\n}\n\n/**\n * Operator whose value is simply its parameter hash. This operator is\n * useful for enabling reactive updates to values of nested objects.\n * @constructor\n * @param {object} params - The parameters for this operator.\n */\n\nfunction Params(params) {\n Transform.call(this, null, params);\n}\ninherits(Params, Transform, {\n transform(_, pulse) {\n this.modified(_.modified());\n this.value = _;\n return pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS); // do not pass tuples\n }\n\n});\n\n/**\n * Aggregate and pivot selected field values to become new fields.\n * This operator is useful to construction cross-tabulations.\n * @constructor\n * @param {Array} [params.groupby] - An array of accessors\n * to groupby. These fields act just like groupby fields of an Aggregate transform.\n * @param {function(object): *} params.field - The field to pivot on. The unique\n * values of this field become new field names in the output stream.\n * @param {function(object): *} params.value - The field to populate pivoted fields.\n * The aggregate values of this field become the values of the new pivoted fields.\n * @param {string} [params.op] - The aggregation operation for the value field,\n * applied per cell in the output stream. The default is \"sum\".\n * @param {number} [params.limit] - An optional parameter indicating the maximum\n * number of pivoted fields to generate. The pivoted field names are sorted in\n * ascending order prior to enforcing the limit.\n */\n\nfunction Pivot(params) {\n Aggregate.call(this, params);\n}\nPivot.Definition = {\n 'type': 'Pivot',\n 'metadata': {\n 'generates': true,\n 'changes': true\n },\n 'params': [{\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'field',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'value',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'op',\n 'type': 'enum',\n 'values': ValidAggregateOps,\n 'default': 'sum'\n }, {\n 'name': 'limit',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'key',\n 'type': 'field'\n }]\n};\ninherits(Pivot, Aggregate, {\n _transform: Aggregate.prototype.transform,\n\n transform(_, pulse) {\n return this._transform(aggregateParams(_, pulse), pulse);\n }\n\n}); // Shoehorn a pivot transform into an aggregate transform!\n// First collect all unique pivot field values.\n// Then generate aggregate fields for each output pivot field.\n\nfunction aggregateParams(_, pulse) {\n const key = _.field,\n value = _.value,\n op = (_.op === 'count' ? '__count__' : _.op) || 'sum',\n fields = accessorFields(key).concat(accessorFields(value)),\n keys = pivotKeys(key, _.limit || 0, pulse); // if data stream content changes, pivot fields may change\n // flag parameter modification to ensure re-initialization\n\n if (pulse.changed()) _.set('__pivot__', null, null, true);\n return {\n key: _.key,\n groupby: _.groupby,\n ops: keys.map(() => op),\n fields: keys.map(k => get(k, key, value, fields)),\n as: keys.map(k => k + ''),\n modified: _.modified.bind(_)\n };\n} // Generate aggregate field accessor.\n// Output NaN for non-existent values; aggregator will ignore!\n\n\nfunction get(k, key, value, fields) {\n return accessor(d => key(d) === k ? value(d) : NaN, fields, k + '');\n} // Collect (and optionally limit) all unique pivot values.\n\n\nfunction pivotKeys(key, limit, pulse) {\n const map = {},\n list = [];\n pulse.visit(pulse.SOURCE, t => {\n const k = key(t);\n\n if (!map[k]) {\n map[k] = 1;\n list.push(k);\n }\n });\n list.sort(ascending);\n return limit ? list.slice(0, limit) : list;\n}\n\n/**\n * Partitions pre-faceted data into tuple subflows.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(Dataflow, string): Operator} params.subflow - A function\n * that generates a subflow of operators and returns its root operator.\n * @param {function(object): Array} params.field - The field\n * accessor for an array of subflow tuple objects.\n */\n\nfunction PreFacet(params) {\n Facet.call(this, params);\n}\ninherits(PreFacet, Facet, {\n transform(_, pulse) {\n const flow = _.subflow,\n field = _.field,\n subflow = t => this.subflow(tupleid(t), flow, pulse, t);\n\n if (_.modified('field') || field && pulse.modified(accessorFields(field))) {\n error('PreFacet does not support field modification.');\n }\n\n this.initTargets(); // reset list of active subflows\n\n if (field) {\n pulse.visit(pulse.MOD, t => {\n const sf = subflow(t);\n field(t).forEach(_ => sf.mod(_));\n });\n pulse.visit(pulse.ADD, t => {\n const sf = subflow(t);\n field(t).forEach(_ => sf.add(ingest(_)));\n });\n pulse.visit(pulse.REM, t => {\n const sf = subflow(t);\n field(t).forEach(_ => sf.rem(_));\n });\n } else {\n pulse.visit(pulse.MOD, t => subflow(t).mod(t));\n pulse.visit(pulse.ADD, t => subflow(t).add(t));\n pulse.visit(pulse.REM, t => subflow(t).rem(t));\n }\n\n if (pulse.clean()) {\n pulse.runAfter(() => this.clean());\n }\n\n return pulse;\n }\n\n});\n\n/**\n * Performs a relational projection, copying selected fields from source\n * tuples to a new set of derived tuples.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} [params.as] - Output field names for each projected\n * field. Any unspecified fields will use the field name provided by\n * the field accessor.\n */\n\nfunction Project(params) {\n Transform.call(this, null, params);\n}\nProject.Definition = {\n 'type': 'Project',\n 'metadata': {\n 'generates': true,\n 'changes': true\n },\n 'params': [{\n 'name': 'fields',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'null': true,\n 'array': true\n }]\n};\ninherits(Project, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.NO_SOURCE),\n fields = _.fields,\n as = fieldNames(_.fields, _.as || []),\n derive = fields ? (s, t) => project(s, t, fields, as) : rederive;\n let lut;\n\n if (this.value) {\n lut = this.value;\n } else {\n pulse = pulse.addAll();\n lut = this.value = {};\n }\n\n pulse.visit(pulse.REM, t => {\n const id = tupleid(t);\n out.rem.push(lut[id]);\n lut[id] = null;\n });\n pulse.visit(pulse.ADD, t => {\n const dt = derive(t, ingest({}));\n lut[tupleid(t)] = dt;\n out.add.push(dt);\n });\n pulse.visit(pulse.MOD, t => {\n out.mod.push(derive(t, lut[tupleid(t)]));\n });\n return out;\n }\n\n});\n\nfunction project(s, t, fields, as) {\n for (let i = 0, n = fields.length; i < n; ++i) {\n t[as[i]] = fields[i](s);\n }\n\n return t;\n}\n\n/**\n * Proxy the value of another operator as a pure signal value.\n * Ensures no tuples are propagated.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {*} params.value - The value to proxy, becomes the value of this operator.\n */\n\nfunction Proxy(params) {\n Transform.call(this, null, params);\n}\ninherits(Proxy, Transform, {\n transform(_, pulse) {\n this.value = _.value;\n return _.modified('value') ? pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS) : pulse.StopPropagation;\n }\n\n});\n\n/**\n * Generates sample quantile values from an input data stream.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - An accessor for the data field\n * over which to calculate quantile values.\n * @param {Array} [params.groupby] - An array of accessors\n * to groupby.\n * @param {Array} [params.probs] - An array of probabilities in\n * the range (0, 1) for which to compute quantile values. If not specified,\n * the *step* parameter will be used.\n * @param {Array} [params.step=0.01] - A probability step size for\n * sampling quantile values. All values from one-half the step size up to\n * 1 (exclusive) will be sampled. This parameter is only used if the\n * *quantiles* parameter is not provided.\n */\n\nfunction Quantile(params) {\n Transform.call(this, null, params);\n}\nQuantile.Definition = {\n 'type': 'Quantile',\n 'metadata': {\n 'generates': true,\n 'changes': true\n },\n 'params': [{\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'field',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'probs',\n 'type': 'number',\n 'array': true\n }, {\n 'name': 'step',\n 'type': 'number',\n 'default': 0.01\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'default': ['prob', 'value']\n }]\n};\nconst EPSILON = 1e-14;\ninherits(Quantile, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS),\n as = _.as || ['prob', 'value'];\n\n if (this.value && !_.modified() && !pulse.changed()) {\n out.source = this.value;\n return out;\n }\n\n const source = pulse.materialize(pulse.SOURCE).source,\n groups = partition$1(source, _.groupby, _.field),\n names = (_.groupby || []).map(accessorName),\n values = [],\n step = _.step || 0.01,\n p = _.probs || range(step / 2, 1 - EPSILON, step),\n n = p.length;\n groups.forEach(g => {\n const q = quantiles(g, p);\n\n for (let i = 0; i < n; ++i) {\n const t = {};\n\n for (let i = 0; i < names.length; ++i) {\n t[names[i]] = g.dims[i];\n }\n\n t[as[0]] = p[i];\n t[as[1]] = q[i];\n values.push(ingest(t));\n }\n });\n if (this.value) out.rem = this.value;\n this.value = out.add = out.source = values;\n return out;\n }\n\n});\n\n/**\n * Relays a data stream between data processing pipelines.\n * If the derive parameter is set, this transform will create derived\n * copies of observed tuples. This provides derived data streams in which\n * modifications to the tuples do not pollute an upstream data source.\n * @param {object} params - The parameters for this operator.\n * @param {number} [params.derive=false] - Boolean flag indicating if\n * the transform should make derived copies of incoming tuples.\n * @constructor\n */\n\nfunction Relay(params) {\n Transform.call(this, null, params);\n}\ninherits(Relay, Transform, {\n transform(_, pulse) {\n let out, lut;\n\n if (this.value) {\n lut = this.value;\n } else {\n out = pulse = pulse.addAll();\n lut = this.value = {};\n }\n\n if (_.derive) {\n out = pulse.fork(pulse.NO_SOURCE);\n pulse.visit(pulse.REM, t => {\n const id = tupleid(t);\n out.rem.push(lut[id]);\n lut[id] = null;\n });\n pulse.visit(pulse.ADD, t => {\n const dt = derive(t);\n lut[tupleid(t)] = dt;\n out.add.push(dt);\n });\n pulse.visit(pulse.MOD, t => {\n const dt = lut[tupleid(t)];\n\n for (const k in t) {\n dt[k] = t[k]; // down stream writes may overwrite re-derived tuples\n // conservatively mark all source fields as modified\n\n out.modifies(k);\n }\n\n out.mod.push(dt);\n });\n }\n\n return out;\n }\n\n});\n\n/**\n * Samples tuples passing through this operator.\n * Uses reservoir sampling to maintain a representative sample.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {number} [params.size=1000] - The maximum number of samples.\n */\n\nfunction Sample(params) {\n Transform.call(this, [], params);\n this.count = 0;\n}\nSample.Definition = {\n 'type': 'Sample',\n 'metadata': {},\n 'params': [{\n 'name': 'size',\n 'type': 'number',\n 'default': 1000\n }]\n};\ninherits(Sample, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.NO_SOURCE),\n mod = _.modified('size'),\n num = _.size,\n map = this.value.reduce((m, t) => (m[tupleid(t)] = 1, m), {});\n\n let res = this.value,\n cnt = this.count,\n cap = 0; // sample reservoir update function\n\n function update(t) {\n let p, idx;\n\n if (res.length < num) {\n res.push(t);\n } else {\n idx = ~~((cnt + 1) * random());\n\n if (idx < res.length && idx >= cap) {\n p = res[idx];\n if (map[tupleid(p)]) out.rem.push(p); // eviction\n\n res[idx] = t;\n }\n }\n\n ++cnt;\n }\n\n if (pulse.rem.length) {\n // find all tuples that should be removed, add to output\n pulse.visit(pulse.REM, t => {\n const id = tupleid(t);\n\n if (map[id]) {\n map[id] = -1;\n out.rem.push(t);\n }\n\n --cnt;\n }); // filter removed tuples out of the sample reservoir\n\n res = res.filter(t => map[tupleid(t)] !== -1);\n }\n\n if ((pulse.rem.length || mod) && res.length < num && pulse.source) {\n // replenish sample if backing data source is available\n cap = cnt = res.length;\n pulse.visit(pulse.SOURCE, t => {\n // update, but skip previously sampled tuples\n if (!map[tupleid(t)]) update(t);\n });\n cap = -1;\n }\n\n if (mod && res.length > num) {\n const n = res.length - num;\n\n for (let i = 0; i < n; ++i) {\n map[tupleid(res[i])] = -1;\n out.rem.push(res[i]);\n }\n\n res = res.slice(n);\n }\n\n if (pulse.mod.length) {\n // propagate modified tuples in the sample reservoir\n pulse.visit(pulse.MOD, t => {\n if (map[tupleid(t)]) out.mod.push(t);\n });\n }\n\n if (pulse.add.length) {\n // update sample reservoir\n pulse.visit(pulse.ADD, update);\n }\n\n if (pulse.add.length || cap < 0) {\n // output newly added tuples\n out.add = res.filter(t => !map[tupleid(t)]);\n }\n\n this.count = cnt;\n this.value = out.source = res;\n return out;\n }\n\n});\n\n/**\n * Generates data tuples for a specified sequence range of numbers.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {number} params.start - The first number in the sequence.\n * @param {number} params.stop - The last number (exclusive) in the sequence.\n * @param {number} [params.step=1] - The step size between numbers in the sequence.\n */\n\nfunction Sequence(params) {\n Transform.call(this, null, params);\n}\nSequence.Definition = {\n 'type': 'Sequence',\n 'metadata': {\n 'generates': true,\n 'changes': true\n },\n 'params': [{\n 'name': 'start',\n 'type': 'number',\n 'required': true\n }, {\n 'name': 'stop',\n 'type': 'number',\n 'required': true\n }, {\n 'name': 'step',\n 'type': 'number',\n 'default': 1\n }, {\n 'name': 'as',\n 'type': 'string',\n 'default': 'data'\n }]\n};\ninherits(Sequence, Transform, {\n transform(_, pulse) {\n if (this.value && !_.modified()) return;\n const out = pulse.materialize().fork(pulse.MOD),\n as = _.as || 'data';\n out.rem = this.value ? pulse.rem.concat(this.value) : pulse.rem;\n this.value = range(_.start, _.stop, _.step || 1).map(v => {\n const t = {};\n t[as] = v;\n return ingest(t);\n });\n out.add = pulse.add.concat(this.value);\n return out;\n }\n\n});\n\n/**\n * Propagates a new pulse without any tuples so long as the input\n * pulse contains some added, removed or modified tuples.\n * @param {object} params - The parameters for this operator.\n * @constructor\n */\n\nfunction Sieve(params) {\n Transform.call(this, null, params);\n this.modified(true); // always treat as modified\n}\ninherits(Sieve, Transform, {\n transform(_, pulse) {\n this.value = pulse.source;\n return pulse.changed() ? pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS) : pulse.StopPropagation;\n }\n\n});\n\n/**\n * Discretize dates to specific time units.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The data field containing date/time values.\n */\n\nfunction TimeUnit(params) {\n Transform.call(this, null, params);\n}\nconst OUTPUT = ['unit0', 'unit1'];\nTimeUnit.Definition = {\n 'type': 'TimeUnit',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'interval',\n 'type': 'boolean',\n 'default': true\n }, {\n 'name': 'units',\n 'type': 'enum',\n 'values': TIME_UNITS,\n 'array': true\n }, {\n 'name': 'step',\n 'type': 'number',\n 'default': 1\n }, {\n 'name': 'maxbins',\n 'type': 'number',\n 'default': 40\n }, {\n 'name': 'extent',\n 'type': 'date',\n 'array': true\n }, {\n 'name': 'timezone',\n 'type': 'enum',\n 'default': 'local',\n 'values': ['local', 'utc']\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': 2,\n 'default': OUTPUT\n }]\n};\ninherits(TimeUnit, Transform, {\n transform(_, pulse) {\n const field = _.field,\n band = _.interval !== false,\n utc = _.timezone === 'utc',\n floor = this._floor(_, pulse),\n offset = (utc ? utcInterval : timeInterval)(floor.unit).offset,\n as = _.as || OUTPUT,\n u0 = as[0],\n u1 = as[1],\n step = floor.step;\n\n let min = floor.start || Infinity,\n max = floor.stop || -Infinity,\n flag = pulse.ADD;\n\n if (_.modified() || pulse.changed(pulse.REM) || pulse.modified(accessorFields(field))) {\n pulse = pulse.reflow(true);\n flag = pulse.SOURCE;\n min = Infinity;\n max = -Infinity;\n }\n\n pulse.visit(flag, t => {\n const v = field(t);\n let a, b;\n\n if (v == null) {\n t[u0] = null;\n if (band) t[u1] = null;\n } else {\n t[u0] = a = b = floor(v);\n if (band) t[u1] = b = offset(a, step);\n if (a < min) min = a;\n if (b > max) max = b;\n }\n });\n floor.start = min;\n floor.stop = max;\n return pulse.modifies(band ? as : u0);\n },\n\n _floor(_, pulse) {\n const utc = _.timezone === 'utc'; // get parameters\n\n const {\n units,\n step\n } = _.units ? {\n units: _.units,\n step: _.step || 1\n } : timeBin({\n extent: _.extent || extent(pulse.materialize(pulse.SOURCE).source, _.field),\n maxbins: _.maxbins\n }); // check / standardize time units\n\n const tunits = timeUnits(units),\n prev = this.value || {},\n floor = (utc ? utcFloor : timeFloor)(tunits, step);\n floor.unit = peek(tunits);\n floor.units = tunits;\n floor.step = step;\n floor.start = prev.start;\n floor.stop = prev.stop;\n return this.value = floor;\n }\n\n});\n\n/**\n * An index that maps from unique, string-coerced, field values to tuples.\n * Assumes that the field serves as a unique key with no duplicate values.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The field accessor to index.\n */\n\nfunction TupleIndex(params) {\n Transform.call(this, fastmap(), params);\n}\ninherits(TupleIndex, Transform, {\n transform(_, pulse) {\n const df = pulse.dataflow,\n field = _.field,\n index = this.value,\n set = t => index.set(field(t), t);\n\n let mod = true;\n\n if (_.modified('field') || pulse.modified(field.fields)) {\n index.clear();\n pulse.visit(pulse.SOURCE, set);\n } else if (pulse.changed()) {\n pulse.visit(pulse.REM, t => index.delete(field(t)));\n pulse.visit(pulse.ADD, set);\n } else {\n mod = false;\n }\n\n this.modified(mod);\n if (index.empty > df.cleanThreshold) df.runAfter(index.clean);\n return pulse.fork();\n }\n\n});\n\n/**\n * Extracts an array of values. Assumes the source data has already been\n * reduced as needed (e.g., by an upstream Aggregate transform).\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The domain field to extract.\n * @param {function(*,*): number} [params.sort] - An optional\n * comparator function for sorting the values. The comparator will be\n * applied to backing tuples prior to value extraction.\n */\n\nfunction Values(params) {\n Transform.call(this, null, params);\n}\ninherits(Values, Transform, {\n transform(_, pulse) {\n const run = !this.value || _.modified('field') || _.modified('sort') || pulse.changed() || _.sort && pulse.modified(_.sort.fields);\n\n if (run) {\n this.value = (_.sort ? pulse.source.slice().sort(stableCompare(_.sort)) : pulse.source).map(_.field);\n }\n }\n\n});\n\nfunction WindowOp(op, field, param, as) {\n const fn = WindowOps[op](field, param);\n return {\n init: fn.init || zero,\n update: function (w, t) {\n t[as] = fn.next(w);\n }\n };\n}\nconst WindowOps = {\n row_number: function () {\n return {\n next: w => w.index + 1\n };\n },\n rank: function () {\n let rank;\n return {\n init: () => rank = 1,\n next: w => {\n const i = w.index,\n data = w.data;\n return i && w.compare(data[i - 1], data[i]) ? rank = i + 1 : rank;\n }\n };\n },\n dense_rank: function () {\n let drank;\n return {\n init: () => drank = 1,\n next: w => {\n const i = w.index,\n d = w.data;\n return i && w.compare(d[i - 1], d[i]) ? ++drank : drank;\n }\n };\n },\n percent_rank: function () {\n const rank = WindowOps.rank(),\n next = rank.next;\n return {\n init: rank.init,\n next: w => (next(w) - 1) / (w.data.length - 1)\n };\n },\n cume_dist: function () {\n let cume;\n return {\n init: () => cume = 0,\n next: w => {\n const d = w.data,\n c = w.compare;\n let i = w.index;\n\n if (cume < i) {\n while (i + 1 < d.length && !c(d[i], d[i + 1])) ++i;\n\n cume = i;\n }\n\n return (1 + cume) / d.length;\n }\n };\n },\n ntile: function (field, num) {\n num = +num;\n if (!(num > 0)) error('ntile num must be greater than zero.');\n const cume = WindowOps.cume_dist(),\n next = cume.next;\n return {\n init: cume.init,\n next: w => Math.ceil(num * next(w))\n };\n },\n lag: function (field, offset) {\n offset = +offset || 1;\n return {\n next: w => {\n const i = w.index - offset;\n return i >= 0 ? field(w.data[i]) : null;\n }\n };\n },\n lead: function (field, offset) {\n offset = +offset || 1;\n return {\n next: w => {\n const i = w.index + offset,\n d = w.data;\n return i < d.length ? field(d[i]) : null;\n }\n };\n },\n first_value: function (field) {\n return {\n next: w => field(w.data[w.i0])\n };\n },\n last_value: function (field) {\n return {\n next: w => field(w.data[w.i1 - 1])\n };\n },\n nth_value: function (field, nth) {\n nth = +nth;\n if (!(nth > 0)) error('nth_value nth must be greater than zero.');\n return {\n next: w => {\n const i = w.i0 + (nth - 1);\n return i < w.i1 ? field(w.data[i]) : null;\n }\n };\n },\n prev_value: function (field) {\n let prev;\n return {\n init: () => prev = null,\n next: w => {\n const v = field(w.data[w.index]);\n return v != null ? prev = v : prev;\n }\n };\n },\n next_value: function (field) {\n let v, i;\n return {\n init: () => (v = null, i = -1),\n next: w => {\n const d = w.data;\n return w.index <= i ? v : (i = find(field, d, w.index)) < 0 ? (i = d.length, v = null) : v = field(d[i]);\n }\n };\n }\n};\n\nfunction find(field, data, index) {\n for (let n = data.length; index < n; ++index) {\n const v = field(data[index]);\n if (v != null) return index;\n }\n\n return -1;\n}\n\nconst ValidWindowOps = Object.keys(WindowOps);\n\nfunction WindowState(_) {\n const ops = array(_.ops),\n fields = array(_.fields),\n params = array(_.params),\n as = array(_.as),\n outputs = this.outputs = [],\n windows = this.windows = [],\n inputs = {},\n map = {},\n counts = [],\n measures = [];\n let countOnly = true;\n\n function visitInputs(f) {\n array(accessorFields(f)).forEach(_ => inputs[_] = 1);\n }\n\n visitInputs(_.sort);\n ops.forEach((op, i) => {\n const field = fields[i],\n mname = accessorName(field),\n name = measureName(op, mname, as[i]);\n visitInputs(field);\n outputs.push(name); // Window operation\n\n if (hasOwnProperty(WindowOps, op)) {\n windows.push(WindowOp(op, fields[i], params[i], name));\n } // Aggregate operation\n else {\n if (field == null && op !== 'count') {\n error('Null aggregate field specified.');\n }\n\n if (op === 'count') {\n counts.push(name);\n return;\n }\n\n countOnly = false;\n let m = map[mname];\n\n if (!m) {\n m = map[mname] = [];\n m.field = field;\n measures.push(m);\n }\n\n m.push(createMeasure(op, name));\n }\n });\n\n if (counts.length || measures.length) {\n this.cell = cell(measures, counts, countOnly);\n }\n\n this.inputs = Object.keys(inputs);\n}\nconst prototype = WindowState.prototype;\n\nprototype.init = function () {\n this.windows.forEach(_ => _.init());\n if (this.cell) this.cell.init();\n};\n\nprototype.update = function (w, t) {\n const cell = this.cell,\n wind = this.windows,\n data = w.data,\n m = wind && wind.length;\n let j;\n\n if (cell) {\n for (j = w.p0; j < w.i0; ++j) cell.rem(data[j]);\n\n for (j = w.p1; j < w.i1; ++j) cell.add(data[j]);\n\n cell.set(t);\n }\n\n for (j = 0; j < m; ++j) wind[j].update(w, t);\n};\n\nfunction cell(measures, counts, countOnly) {\n measures = measures.map(m => compileMeasures(m, m.field));\n const cell = {\n num: 0,\n agg: null,\n store: false,\n count: counts\n };\n\n if (!countOnly) {\n var n = measures.length,\n a = cell.agg = Array(n),\n i = 0;\n\n for (; i < n; ++i) a[i] = new measures[i](cell);\n }\n\n if (cell.store) {\n var store = cell.data = new TupleStore();\n }\n\n cell.add = function (t) {\n cell.num += 1;\n if (countOnly) return;\n if (store) store.add(t);\n\n for (let i = 0; i < n; ++i) {\n a[i].add(a[i].get(t), t);\n }\n };\n\n cell.rem = function (t) {\n cell.num -= 1;\n if (countOnly) return;\n if (store) store.rem(t);\n\n for (let i = 0; i < n; ++i) {\n a[i].rem(a[i].get(t), t);\n }\n };\n\n cell.set = function (t) {\n let i, n; // consolidate stored values\n\n if (store) store.values(); // update tuple properties\n\n for (i = 0, n = counts.length; i < n; ++i) t[counts[i]] = cell.num;\n\n if (!countOnly) for (i = 0, n = a.length; i < n; ++i) a[i].set(t);\n };\n\n cell.init = function () {\n cell.num = 0;\n if (store) store.reset();\n\n for (let i = 0; i < n; ++i) a[i].init();\n };\n\n return cell;\n}\n\n/**\n * Perform window calculations and write results to the input stream.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(*,*): number} [params.sort] - A comparator function for sorting tuples within a window.\n * @param {Array} [params.groupby] - An array of accessors by which to partition tuples into separate windows.\n * @param {Array} params.ops - An array of strings indicating window operations to perform.\n * @param {Array} [params.fields] - An array of accessors\n * for data fields to use as inputs to window operations.\n * @param {Array<*>} [params.params] - An array of parameter values for window operations.\n * @param {Array} [params.as] - An array of output field names for window operations.\n * @param {Array} [params.frame] - Window frame definition as two-element array.\n * @param {boolean} [params.ignorePeers=false] - If true, base window frame boundaries on row\n * number alone, ignoring peers with identical sort values. If false (default),\n * the window boundaries will be adjusted to include peer values.\n */\n\nfunction Window(params) {\n Transform.call(this, {}, params);\n this._mlen = 0;\n this._mods = [];\n}\nWindow.Definition = {\n 'type': 'Window',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'sort',\n 'type': 'compare'\n }, {\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'ops',\n 'type': 'enum',\n 'array': true,\n 'values': ValidWindowOps.concat(ValidAggregateOps)\n }, {\n 'name': 'params',\n 'type': 'number',\n 'null': true,\n 'array': true\n }, {\n 'name': 'fields',\n 'type': 'field',\n 'null': true,\n 'array': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'null': true,\n 'array': true\n }, {\n 'name': 'frame',\n 'type': 'number',\n 'null': true,\n 'array': true,\n 'length': 2,\n 'default': [null, 0]\n }, {\n 'name': 'ignorePeers',\n 'type': 'boolean',\n 'default': false\n }]\n};\ninherits(Window, Transform, {\n transform(_, pulse) {\n this.stamp = pulse.stamp;\n\n const mod = _.modified(),\n cmp = stableCompare(_.sort),\n key = groupkey(_.groupby),\n group = t => this.group(key(t)); // initialize window state\n\n\n let state = this.state;\n\n if (!state || mod) {\n state = this.state = new WindowState(_);\n } // partition input tuples\n\n\n if (mod || pulse.modified(state.inputs)) {\n this.value = {};\n pulse.visit(pulse.SOURCE, t => group(t).add(t));\n } else {\n pulse.visit(pulse.REM, t => group(t).remove(t));\n pulse.visit(pulse.ADD, t => group(t).add(t));\n } // perform window calculations for each modified partition\n\n\n for (let i = 0, n = this._mlen; i < n; ++i) {\n processPartition(this._mods[i], state, cmp, _);\n }\n\n this._mlen = 0;\n this._mods = []; // TODO don't reflow everything?\n\n return pulse.reflow(mod).modifies(state.outputs);\n },\n\n group(key) {\n let group = this.value[key];\n\n if (!group) {\n group = this.value[key] = SortedList(tupleid);\n group.stamp = -1;\n }\n\n if (group.stamp < this.stamp) {\n group.stamp = this.stamp;\n this._mods[this._mlen++] = group;\n }\n\n return group;\n }\n\n});\n\nfunction processPartition(list, state, cmp, _) {\n const sort = _.sort,\n range = sort && !_.ignorePeers,\n frame = _.frame || [null, 0],\n data = list.data(cmp),\n // use cmp for stable sort\n n = data.length,\n b = range ? bisector(sort) : null,\n w = {\n i0: 0,\n i1: 0,\n p0: 0,\n p1: 0,\n index: 0,\n data: data,\n compare: sort || constant(-1)\n };\n state.init();\n\n for (let i = 0; i < n; ++i) {\n setWindow(w, frame, i, n);\n if (range) adjustRange(w, b);\n state.update(w, data[i]);\n }\n}\n\nfunction setWindow(w, f, i, n) {\n w.p0 = w.i0;\n w.p1 = w.i1;\n w.i0 = f[0] == null ? 0 : Math.max(0, i - Math.abs(f[0]));\n w.i1 = f[1] == null ? n : Math.min(n, i + Math.abs(f[1]) + 1);\n w.index = i;\n} // if frame type is 'range', adjust window for peer values\n\n\nfunction adjustRange(w, bisect) {\n const r0 = w.i0,\n r1 = w.i1 - 1,\n c = w.compare,\n d = w.data,\n n = d.length - 1;\n if (r0 > 0 && !c(d[r0], d[r0 - 1])) w.i0 = bisect.left(d, d[r0]);\n if (r1 < n && !c(d[r1], d[r1 + 1])) w.i1 = bisect.right(d, d[r1]);\n}\n\nexport { Aggregate as aggregate, Bin as bin, Collect as collect, Compare as compare, CountPattern as countpattern, Cross as cross, Density as density, DotBin as dotbin, Expression as expression, Extent as extent, Facet as facet, Field as field, Filter as filter, Flatten as flatten, Fold as fold, Formula as formula, Generate as generate, Impute as impute, JoinAggregate as joinaggregate, KDE as kde, Key as key, Load as load, Lookup as lookup, MultiExtent as multiextent, MultiValues as multivalues, Params as params, Pivot as pivot, PreFacet as prefacet, Project as project, Proxy as proxy, Quantile as quantile, Relay as relay, Sample as sample, Sequence as sequence, Sieve as sieve, Subflow as subflow, TimeUnit as timeunit, TupleIndex as tupleindex, Values as values, Window as window };\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","const pi = Math.PI,\n tau = 2 * pi,\n epsilon = 1e-6,\n tauEpsilon = tau - epsilon;\n\nfunction Path() {\n this._x0 = this._y0 = // start of current subpath\n this._x1 = this._y1 = null; // end of current subpath\n this._ = \"\";\n}\n\nfunction path() {\n return new Path;\n}\n\nPath.prototype = path.prototype = {\n constructor: Path,\n moveTo: function(x, y) {\n this._ += \"M\" + (this._x0 = this._x1 = +x) + \",\" + (this._y0 = this._y1 = +y);\n },\n closePath: function() {\n if (this._x1 !== null) {\n this._x1 = this._x0, this._y1 = this._y0;\n this._ += \"Z\";\n }\n },\n lineTo: function(x, y) {\n this._ += \"L\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n quadraticCurveTo: function(x1, y1, x, y) {\n this._ += \"Q\" + (+x1) + \",\" + (+y1) + \",\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n bezierCurveTo: function(x1, y1, x2, y2, x, y) {\n this._ += \"C\" + (+x1) + \",\" + (+y1) + \",\" + (+x2) + \",\" + (+y2) + \",\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n arcTo: function(x1, y1, x2, y2, r) {\n x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;\n var x0 = this._x1,\n y0 = this._y1,\n x21 = x2 - x1,\n y21 = y2 - y1,\n x01 = x0 - x1,\n y01 = y0 - y1,\n l01_2 = x01 * x01 + y01 * y01;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(\"negative radius: \" + r);\n\n // Is this path empty? Move to (x1,y1).\n if (this._x1 === null) {\n this._ += \"M\" + (this._x1 = x1) + \",\" + (this._y1 = y1);\n }\n\n // Or, is (x1,y1) coincident with (x0,y0)? Do nothing.\n else if (!(l01_2 > epsilon));\n\n // Or, are (x0,y0), (x1,y1) and (x2,y2) collinear?\n // Equivalently, is (x1,y1) coincident with (x2,y2)?\n // Or, is the radius zero? Line to (x1,y1).\n else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) {\n this._ += \"L\" + (this._x1 = x1) + \",\" + (this._y1 = y1);\n }\n\n // Otherwise, draw an arc!\n else {\n var x20 = x2 - x0,\n y20 = y2 - y0,\n l21_2 = x21 * x21 + y21 * y21,\n l20_2 = x20 * x20 + y20 * y20,\n l21 = Math.sqrt(l21_2),\n l01 = Math.sqrt(l01_2),\n l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2),\n t01 = l / l01,\n t21 = l / l21;\n\n // If the start tangent is not coincident with (x0,y0), line to.\n if (Math.abs(t01 - 1) > epsilon) {\n this._ += \"L\" + (x1 + t01 * x01) + \",\" + (y1 + t01 * y01);\n }\n\n this._ += \"A\" + r + \",\" + r + \",0,0,\" + (+(y01 * x20 > x01 * y20)) + \",\" + (this._x1 = x1 + t21 * x21) + \",\" + (this._y1 = y1 + t21 * y21);\n }\n },\n arc: function(x, y, r, a0, a1, ccw) {\n x = +x, y = +y, r = +r, ccw = !!ccw;\n var dx = r * Math.cos(a0),\n dy = r * Math.sin(a0),\n x0 = x + dx,\n y0 = y + dy,\n cw = 1 ^ ccw,\n da = ccw ? a0 - a1 : a1 - a0;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(\"negative radius: \" + r);\n\n // Is this path empty? Move to (x0,y0).\n if (this._x1 === null) {\n this._ += \"M\" + x0 + \",\" + y0;\n }\n\n // Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0).\n else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) {\n this._ += \"L\" + x0 + \",\" + y0;\n }\n\n // Is this arc empty? We’re done.\n if (!r) return;\n\n // Does the angle go the wrong way? Flip the direction.\n if (da < 0) da = da % tau + tau;\n\n // Is this a complete circle? Draw two arcs to complete the circle.\n if (da > tauEpsilon) {\n this._ += \"A\" + r + \",\" + r + \",0,1,\" + cw + \",\" + (x - dx) + \",\" + (y - dy) + \"A\" + r + \",\" + r + \",0,1,\" + cw + \",\" + (this._x1 = x0) + \",\" + (this._y1 = y0);\n }\n\n // Is this arc non-empty? Draw an arc!\n else if (da > epsilon) {\n this._ += \"A\" + r + \",\" + r + \",0,\" + (+(da >= pi)) + \",\" + cw + \",\" + (this._x1 = x + r * Math.cos(a1)) + \",\" + (this._y1 = y + r * Math.sin(a1));\n }\n },\n rect: function(x, y, w, h) {\n this._ += \"M\" + (this._x0 = this._x1 = +x) + \",\" + (this._y0 = this._y1 = +y) + \"h\" + (+w) + \"v\" + (+h) + \"h\" + (-w) + \"Z\";\n },\n toString: function() {\n return this._;\n }\n};\n\nexport default path;\n","export default function(x) {\n return function constant() {\n return x;\n };\n}\n","export 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 {path} from \"d3-path\";\nimport constant from \"./constant.js\";\nimport {abs, acos, asin, atan2, cos, epsilon, halfPi, max, min, pi, sin, sqrt, tau} from \"./math.js\";\n\nfunction arcInnerRadius(d) {\n return d.innerRadius;\n}\n\nfunction arcOuterRadius(d) {\n return d.outerRadius;\n}\n\nfunction arcStartAngle(d) {\n return d.startAngle;\n}\n\nfunction arcEndAngle(d) {\n return d.endAngle;\n}\n\nfunction arcPadAngle(d) {\n return d && d.padAngle; // Note: optional!\n}\n\nfunction intersect(x0, y0, x1, y1, x2, y2, x3, y3) {\n var x10 = x1 - x0, y10 = y1 - y0,\n x32 = x3 - x2, y32 = y3 - y2,\n t = y32 * x10 - x32 * y10;\n if (t * t < epsilon) return;\n t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;\n return [x0 + t * x10, y0 + t * y10];\n}\n\n// Compute perpendicular offset line of length rc.\n// http://mathworld.wolfram.com/Circle-LineIntersection.html\nfunction cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * sqrt(max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}\n\nexport default function() {\n var innerRadius = arcInnerRadius,\n outerRadius = arcOuterRadius,\n cornerRadius = constant(0),\n padRadius = null,\n startAngle = arcStartAngle,\n endAngle = arcEndAngle,\n padAngle = arcPadAngle,\n context = null;\n\n function arc() {\n var buffer,\n r,\n r0 = +innerRadius.apply(this, arguments),\n r1 = +outerRadius.apply(this, arguments),\n a0 = startAngle.apply(this, arguments) - halfPi,\n a1 = endAngle.apply(this, arguments) - halfPi,\n da = abs(a1 - a0),\n cw = a1 > a0;\n\n if (!context) context = buffer = path();\n\n // Ensure that the outer radius is always larger than the inner radius.\n if (r1 < r0) r = r1, r1 = r0, r0 = r;\n\n // Is it a point?\n if (!(r1 > epsilon)) context.moveTo(0, 0);\n\n // Or is it a circle or annulus?\n else if (da > tau - epsilon) {\n context.moveTo(r1 * cos(a0), r1 * sin(a0));\n context.arc(0, 0, r1, a0, a1, !cw);\n if (r0 > epsilon) {\n context.moveTo(r0 * cos(a1), r0 * sin(a1));\n context.arc(0, 0, r0, a1, a0, cw);\n }\n }\n\n // Or is it a circular or annular sector?\n else {\n var a01 = a0,\n a11 = a1,\n a00 = a0,\n a10 = a1,\n da0 = da,\n da1 = da,\n ap = padAngle.apply(this, arguments) / 2,\n rp = (ap > epsilon) && (padRadius ? +padRadius.apply(this, arguments) : sqrt(r0 * r0 + r1 * r1)),\n rc = min(abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments)),\n rc0 = rc,\n rc1 = rc,\n t0,\n t1;\n\n // Apply padding? Note that since r1 ≥ r0, da1 ≥ da0.\n if (rp > epsilon) {\n var p0 = asin(rp / r0 * sin(ap)),\n p1 = asin(rp / r1 * sin(ap));\n if ((da0 -= p0 * 2) > epsilon) p0 *= (cw ? 1 : -1), a00 += p0, a10 -= p0;\n else da0 = 0, a00 = a10 = (a0 + a1) / 2;\n if ((da1 -= p1 * 2) > epsilon) p1 *= (cw ? 1 : -1), a01 += p1, a11 -= p1;\n else da1 = 0, a01 = a11 = (a0 + a1) / 2;\n }\n\n var x01 = r1 * cos(a01),\n y01 = r1 * sin(a01),\n x10 = r0 * cos(a10),\n y10 = r0 * sin(a10);\n\n // Apply rounded corners?\n if (rc > epsilon) {\n var x11 = r1 * cos(a11),\n y11 = r1 * sin(a11),\n x00 = r0 * cos(a00),\n y00 = r0 * sin(a00),\n oc;\n\n // Restrict the corner radius according to the sector angle.\n if (da < pi && (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10))) {\n var ax = x01 - oc[0],\n ay = y01 - oc[1],\n bx = x11 - oc[0],\n by = y11 - oc[1],\n kc = 1 / sin(acos((ax * bx + ay * by) / (sqrt(ax * ax + ay * ay) * sqrt(bx * bx + by * by))) / 2),\n lc = sqrt(oc[0] * oc[0] + oc[1] * oc[1]);\n rc0 = min(rc, (r0 - lc) / (kc - 1));\n rc1 = min(rc, (r1 - lc) / (kc + 1));\n }\n }\n\n // Is the sector collapsed to a line?\n if (!(da1 > epsilon)) context.moveTo(x01, y01);\n\n // Does the sector’s outer ring have rounded corners?\n else if (rc1 > epsilon) {\n t0 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw);\n t1 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw);\n\n context.moveTo(t0.cx + t0.x01, t0.cy + t0.y01);\n\n // Have the corners merged?\n if (rc1 < rc) context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);\n\n // Otherwise, draw the two corners and the ring.\n else {\n context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r1, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), !cw);\n context.arc(t1.cx, t1.cy, rc1, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);\n }\n }\n\n // Or is the outer ring just a circular arc?\n else context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw);\n\n // Is there no inner ring, and it’s a circular sector?\n // Or perhaps it’s an annular sector collapsed due to padding?\n if (!(r0 > epsilon) || !(da0 > epsilon)) context.lineTo(x10, y10);\n\n // Does the sector’s inner ring (or point) have rounded corners?\n else if (rc0 > epsilon) {\n t0 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw);\n t1 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw);\n\n context.lineTo(t0.cx + t0.x01, t0.cy + t0.y01);\n\n // Have the corners merged?\n if (rc0 < rc) context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);\n\n // Otherwise, draw the two corners and the ring.\n else {\n context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r0, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), cw);\n context.arc(t1.cx, t1.cy, rc0, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);\n }\n }\n\n // Or is the inner ring just a circular arc?\n else context.arc(0, 0, r0, a10, a00, cw);\n }\n\n context.closePath();\n\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n arc.centroid = function() {\n var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2,\n a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - pi / 2;\n return [cos(a) * r, sin(a) * r];\n };\n\n arc.innerRadius = function(_) {\n return arguments.length ? (innerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : innerRadius;\n };\n\n arc.outerRadius = function(_) {\n return arguments.length ? (outerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : outerRadius;\n };\n\n arc.cornerRadius = function(_) {\n return arguments.length ? (cornerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : cornerRadius;\n };\n\n arc.padRadius = function(_) {\n return arguments.length ? (padRadius = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), arc) : padRadius;\n };\n\n arc.startAngle = function(_) {\n return arguments.length ? (startAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : startAngle;\n };\n\n arc.endAngle = function(_) {\n return arguments.length ? (endAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : endAngle;\n };\n\n arc.padAngle = function(_) {\n return arguments.length ? (padAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : padAngle;\n };\n\n arc.context = function(_) {\n return arguments.length ? ((context = _ == null ? null : _), arc) : context;\n };\n\n return arc;\n}\n","export var slice = Array.prototype.slice;\n\nexport default function(x) {\n return typeof x === \"object\" && \"length\" in x\n ? x // Array, TypedArray, NodeList, array-like\n : Array.from(x); // Map, Set, iterable, string, or anything else\n}\n","function Linear(context) {\n this._context = context;\n}\n\nLinear.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // falls through\n default: this._context.lineTo(x, y); break;\n }\n }\n};\n\nexport default function(context) {\n return new Linear(context);\n}\n","export function x(p) {\n return p[0];\n}\n\nexport function y(p) {\n return p[1];\n}\n","import {path} from \"d3-path\";\nimport array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport curveLinear from \"./curve/linear.js\";\nimport {x as pointX, y as pointY} from \"./point.js\";\n\nexport default function(x, y) {\n var defined = constant(true),\n context = null,\n curve = curveLinear,\n output = null;\n\n x = typeof x === \"function\" ? x : (x === undefined) ? pointX : constant(x);\n y = typeof y === \"function\" ? y : (y === undefined) ? pointY : constant(y);\n\n function line(data) {\n var i,\n n = (data = array(data)).length,\n d,\n defined0 = false,\n buffer;\n\n if (context == null) output = curve(buffer = path());\n\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) output.lineStart();\n else output.lineEnd();\n }\n if (defined0) output.point(+x(d, i, data), +y(d, i, data));\n }\n\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n line.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : constant(+_), line) : x;\n };\n\n line.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : constant(+_), line) : y;\n };\n\n line.defined = function(_) {\n return arguments.length ? (defined = typeof _ === \"function\" ? _ : constant(!!_), line) : defined;\n };\n\n line.curve = function(_) {\n return arguments.length ? (curve = _, context != null && (output = curve(context)), line) : curve;\n };\n\n line.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), line) : context;\n };\n\n return line;\n}\n","import {path} from \"d3-path\";\nimport array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport curveLinear from \"./curve/linear.js\";\nimport line from \"./line.js\";\nimport {x as pointX, y as pointY} from \"./point.js\";\n\nexport default function(x0, y0, y1) {\n var x1 = null,\n defined = constant(true),\n context = null,\n curve = curveLinear,\n output = null;\n\n x0 = typeof x0 === \"function\" ? x0 : (x0 === undefined) ? pointX : constant(+x0);\n y0 = typeof y0 === \"function\" ? y0 : (y0 === undefined) ? constant(0) : constant(+y0);\n y1 = typeof y1 === \"function\" ? y1 : (y1 === undefined) ? pointY : constant(+y1);\n\n function area(data) {\n var i,\n j,\n k,\n n = (data = array(data)).length,\n d,\n defined0 = false,\n buffer,\n x0z = new Array(n),\n y0z = new Array(n);\n\n if (context == null) output = curve(buffer = path());\n\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) {\n j = i;\n output.areaStart();\n output.lineStart();\n } else {\n output.lineEnd();\n output.lineStart();\n for (k = i - 1; k >= j; --k) {\n output.point(x0z[k], y0z[k]);\n }\n output.lineEnd();\n output.areaEnd();\n }\n }\n if (defined0) {\n x0z[i] = +x0(d, i, data), y0z[i] = +y0(d, i, data);\n output.point(x1 ? +x1(d, i, data) : x0z[i], y1 ? +y1(d, i, data) : y0z[i]);\n }\n }\n\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n function arealine() {\n return line().defined(defined).curve(curve).context(context);\n }\n\n area.x = function(_) {\n return arguments.length ? (x0 = typeof _ === \"function\" ? _ : constant(+_), x1 = null, area) : x0;\n };\n\n area.x0 = function(_) {\n return arguments.length ? (x0 = typeof _ === \"function\" ? _ : constant(+_), area) : x0;\n };\n\n area.x1 = function(_) {\n return arguments.length ? (x1 = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), area) : x1;\n };\n\n area.y = function(_) {\n return arguments.length ? (y0 = typeof _ === \"function\" ? _ : constant(+_), y1 = null, area) : y0;\n };\n\n area.y0 = function(_) {\n return arguments.length ? (y0 = typeof _ === \"function\" ? _ : constant(+_), area) : y0;\n };\n\n area.y1 = function(_) {\n return arguments.length ? (y1 = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), area) : y1;\n };\n\n area.lineX0 =\n area.lineY0 = function() {\n return arealine().x(x0).y(y0);\n };\n\n area.lineY1 = function() {\n return arealine().x(x0).y(y1);\n };\n\n area.lineX1 = function() {\n return arealine().x(x1).y(y0);\n };\n\n area.defined = function(_) {\n return arguments.length ? (defined = typeof _ === \"function\" ? _ : constant(!!_), area) : defined;\n };\n\n area.curve = function(_) {\n return arguments.length ? (curve = _, context != null && (output = curve(context)), area) : curve;\n };\n\n area.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), area) : context;\n };\n\n return area;\n}\n","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","export default function() {}\n","export function point(that, x, y) {\n that._context.bezierCurveTo(\n (2 * that._x0 + that._x1) / 3,\n (2 * that._y0 + that._y1) / 3,\n (that._x0 + 2 * that._x1) / 3,\n (that._y0 + 2 * that._y1) / 3,\n (that._x0 + 4 * that._x1 + x) / 6,\n (that._y0 + 4 * that._y1 + y) / 6\n );\n}\n\nexport function Basis(context) {\n this._context = context;\n}\n\nBasis.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 3: point(this, this._x1, this._y1); // falls through\n case 2: this._context.lineTo(this._x1, this._y1); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6); // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new Basis(context);\n}\n","import noop from \"../noop.js\";\nimport {point} from \"./basis.js\";\n\nfunction BasisClosed(context) {\n this._context = context;\n}\n\nBasisClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x2, this._y2);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3);\n this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x2, this._y2);\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._x2 = x, this._y2 = y; break;\n case 1: this._point = 2; this._x3 = x, this._y3 = y; break;\n case 2: this._point = 3; this._x4 = x, this._y4 = y; this._context.moveTo((this._x0 + 4 * this._x1 + x) / 6, (this._y0 + 4 * this._y1 + y) / 6); break;\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new BasisClosed(context);\n}\n","import {point} from \"./basis.js\";\n\nfunction BasisOpen(context) {\n this._context = context;\n}\n\nBasisOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; var x0 = (this._x0 + 4 * this._x1 + x) / 6, y0 = (this._y0 + 4 * this._y1 + y) / 6; this._line ? this._context.lineTo(x0, y0) : this._context.moveTo(x0, y0); break;\n case 3: this._point = 4; // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new BasisOpen(context);\n}\n","import {Basis} from \"./basis.js\";\n\nfunction Bundle(context, beta) {\n this._basis = new Basis(context);\n this._beta = beta;\n}\n\nBundle.prototype = {\n lineStart: function() {\n this._x = [];\n this._y = [];\n this._basis.lineStart();\n },\n lineEnd: function() {\n var x = this._x,\n y = this._y,\n j = x.length - 1;\n\n if (j > 0) {\n var x0 = x[0],\n y0 = y[0],\n dx = x[j] - x0,\n dy = y[j] - y0,\n i = -1,\n t;\n\n while (++i <= j) {\n t = i / j;\n this._basis.point(\n this._beta * x[i] + (1 - this._beta) * (x0 + t * dx),\n this._beta * y[i] + (1 - this._beta) * (y0 + t * dy)\n );\n }\n }\n\n this._x = this._y = null;\n this._basis.lineEnd();\n },\n point: function(x, y) {\n this._x.push(+x);\n this._y.push(+y);\n }\n};\n\nexport default (function custom(beta) {\n\n function bundle(context) {\n return beta === 1 ? new Basis(context) : new Bundle(context, beta);\n }\n\n bundle.beta = function(beta) {\n return custom(+beta);\n };\n\n return bundle;\n})(0.85);\n","export function point(that, x, y) {\n that._context.bezierCurveTo(\n that._x1 + that._k * (that._x2 - that._x0),\n that._y1 + that._k * (that._y2 - that._y0),\n that._x2 + that._k * (that._x1 - x),\n that._y2 + that._k * (that._y1 - y),\n that._x2,\n that._y2\n );\n}\n\nexport function Cardinal(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinal.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x2, this._y2); break;\n case 3: point(this, this._x1, this._y1); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; this._x1 = x, this._y1 = y; break;\n case 2: this._point = 3; // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new Cardinal(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n","import noop from \"../noop.js\";\nimport {point} from \"./cardinal.js\";\n\nexport function CardinalClosed(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinalClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.lineTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n this.point(this._x5, this._y5);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._x3 = x, this._y3 = y; break;\n case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break;\n case 2: this._point = 3; this._x5 = x, this._y5 = y; break;\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new CardinalClosed(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n","import {point} from \"./cardinal.js\";\n\nexport function CardinalOpen(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinalOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break;\n case 3: this._point = 4; // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new CardinalOpen(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n","import {epsilon} from \"../math.js\";\nimport {Cardinal} from \"./cardinal.js\";\n\nexport function point(that, x, y) {\n var x1 = that._x1,\n y1 = that._y1,\n x2 = that._x2,\n y2 = that._y2;\n\n if (that._l01_a > epsilon) {\n var a = 2 * that._l01_2a + 3 * that._l01_a * that._l12_a + that._l12_2a,\n n = 3 * that._l01_a * (that._l01_a + that._l12_a);\n x1 = (x1 * a - that._x0 * that._l12_2a + that._x2 * that._l01_2a) / n;\n y1 = (y1 * a - that._y0 * that._l12_2a + that._y2 * that._l01_2a) / n;\n }\n\n if (that._l23_a > epsilon) {\n var b = 2 * that._l23_2a + 3 * that._l23_a * that._l12_a + that._l12_2a,\n m = 3 * that._l23_a * (that._l23_a + that._l12_a);\n x2 = (x2 * b + that._x1 * that._l23_2a - x * that._l12_2a) / m;\n y2 = (y2 * b + that._y1 * that._l23_2a - y * that._l12_2a) / m;\n }\n\n that._context.bezierCurveTo(x1, y1, x2, y2, that._x2, that._y2);\n}\n\nfunction CatmullRom(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRom.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x2, this._y2); break;\n case 3: this.point(this._x2, this._y2); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; // falls through\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRom(context, alpha) : new Cardinal(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n","import {CardinalClosed} from \"./cardinalClosed.js\";\nimport noop from \"../noop.js\";\nimport {point} from \"./catmullRom.js\";\n\nfunction CatmullRomClosed(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRomClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.lineTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n this.point(this._x5, this._y5);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; this._x3 = x, this._y3 = y; break;\n case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break;\n case 2: this._point = 3; this._x5 = x, this._y5 = y; break;\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRomClosed(context, alpha) : new CardinalClosed(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n","import {CardinalOpen} from \"./cardinalOpen.js\";\nimport {point} from \"./catmullRom.js\";\n\nfunction CatmullRomOpen(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRomOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break;\n case 3: this._point = 4; // falls through\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRomOpen(context, alpha) : new CardinalOpen(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n","import noop from \"../noop.js\";\n\nfunction LinearClosed(context) {\n this._context = context;\n}\n\nLinearClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._point) this._context.closePath();\n },\n point: function(x, y) {\n x = +x, y = +y;\n if (this._point) this._context.lineTo(x, y);\n else this._point = 1, this._context.moveTo(x, y);\n }\n};\n\nexport default function(context) {\n return new LinearClosed(context);\n}\n","function sign(x) {\n return x < 0 ? -1 : 1;\n}\n\n// Calculate the slopes of the tangents (Hermite-type interpolation) based on\n// the following paper: Steffen, M. 1990. A Simple Method for Monotonic\n// Interpolation in One Dimension. Astronomy and Astrophysics, Vol. 239, NO.\n// NOV(II), P. 443, 1990.\nfunction slope3(that, x2, y2) {\n var h0 = that._x1 - that._x0,\n h1 = x2 - that._x1,\n s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0),\n s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0),\n p = (s0 * h1 + s1 * h0) / (h0 + h1);\n return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;\n}\n\n// Calculate a one-sided slope.\nfunction slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}\n\n// According to https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Representations\n// \"you can express cubic Hermite interpolation in terms of cubic Bézier curves\n// with respect to the four values p0, p0 + m0 / 3, p1 - m1 / 3, p1\".\nfunction point(that, t0, t1) {\n var x0 = that._x0,\n y0 = that._y0,\n x1 = that._x1,\n y1 = that._y1,\n dx = (x1 - x0) / 3;\n that._context.bezierCurveTo(x0 + dx, y0 + dx * t0, x1 - dx, y1 - dx * t1, x1, y1);\n}\n\nfunction MonotoneX(context) {\n this._context = context;\n}\n\nMonotoneX.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 =\n this._t0 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x1, this._y1); break;\n case 3: point(this, this._t0, slope2(this, this._t0)); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n var t1 = NaN;\n\n x = +x, y = +y;\n if (x === this._x1 && y === this._y1) return; // Ignore coincident points.\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; point(this, slope2(this, t1 = slope3(this, x, y)), t1); break;\n default: point(this, this._t0, t1 = slope3(this, x, y)); break;\n }\n\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n this._t0 = t1;\n }\n}\n\nfunction MonotoneY(context) {\n this._context = new ReflectContext(context);\n}\n\n(MonotoneY.prototype = Object.create(MonotoneX.prototype)).point = function(x, y) {\n MonotoneX.prototype.point.call(this, y, x);\n};\n\nfunction ReflectContext(context) {\n this._context = context;\n}\n\nReflectContext.prototype = {\n moveTo: function(x, y) { this._context.moveTo(y, x); },\n closePath: function() { this._context.closePath(); },\n lineTo: function(x, y) { this._context.lineTo(y, x); },\n bezierCurveTo: function(x1, y1, x2, y2, x, y) { this._context.bezierCurveTo(y1, x1, y2, x2, y, x); }\n};\n\nexport function monotoneX(context) {\n return new MonotoneX(context);\n}\n\nexport function monotoneY(context) {\n return new MonotoneY(context);\n}\n","function Natural(context) {\n this._context = context;\n}\n\nNatural.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x = [];\n this._y = [];\n },\n lineEnd: function() {\n var x = this._x,\n y = this._y,\n n = x.length;\n\n if (n) {\n this._line ? this._context.lineTo(x[0], y[0]) : this._context.moveTo(x[0], y[0]);\n if (n === 2) {\n this._context.lineTo(x[1], y[1]);\n } else {\n var px = controlPoints(x),\n py = controlPoints(y);\n for (var i0 = 0, i1 = 1; i1 < n; ++i0, ++i1) {\n this._context.bezierCurveTo(px[0][i0], py[0][i0], px[1][i0], py[1][i0], x[i1], y[i1]);\n }\n }\n }\n\n if (this._line || (this._line !== 0 && n === 1)) this._context.closePath();\n this._line = 1 - this._line;\n this._x = this._y = null;\n },\n point: function(x, y) {\n this._x.push(+x);\n this._y.push(+y);\n }\n};\n\n// See https://www.particleincell.com/2012/bezier-splines/ for derivation.\nfunction controlPoints(x) {\n var i,\n n = x.length - 1,\n m,\n a = new Array(n),\n b = new Array(n),\n r = new Array(n);\n a[0] = 0, b[0] = 2, r[0] = x[0] + 2 * x[1];\n for (i = 1; i < n - 1; ++i) a[i] = 1, b[i] = 4, r[i] = 4 * x[i] + 2 * x[i + 1];\n a[n - 1] = 2, b[n - 1] = 7, r[n - 1] = 8 * x[n - 1] + x[n];\n for (i = 1; i < n; ++i) m = a[i] / b[i - 1], b[i] -= m, r[i] -= m * r[i - 1];\n a[n - 1] = r[n - 1] / b[n - 1];\n for (i = n - 2; i >= 0; --i) a[i] = (r[i] - a[i + 1]) / b[i];\n b[n - 1] = (x[n] + a[n - 1]) / 2;\n for (i = 0; i < n - 1; ++i) b[i] = 2 * x[i + 1] - a[i + 1];\n return [a, b];\n}\n\nexport default function(context) {\n return new Natural(context);\n}\n","function Step(context, t) {\n this._context = context;\n this._t = t;\n}\n\nStep.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x = this._y = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (0 < this._t && this._t < 1 && this._point === 2) this._context.lineTo(this._x, this._y);\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n if (this._line >= 0) this._t = 1 - this._t, this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // falls through\n default: {\n if (this._t <= 0) {\n this._context.lineTo(this._x, y);\n this._context.lineTo(x, y);\n } else {\n var x1 = this._x * (1 - this._t) + x * this._t;\n this._context.lineTo(x1, this._y);\n this._context.lineTo(x1, y);\n }\n break;\n }\n }\n this._x = x, this._y = y;\n }\n};\n\nexport default function(context) {\n return new Step(context, 0.5);\n}\n\nexport function stepBefore(context) {\n return new Step(context, 0);\n}\n\nexport function stepAfter(context) {\n return new Step(context, 1);\n}\n","function domCanvas(w, h) {\n if (typeof document !== 'undefined' && document.createElement) {\n const c = document.createElement('canvas');\n\n if (c && c.getContext) {\n c.width = w;\n c.height = h;\n return c;\n }\n }\n\n return null;\n}\nconst domImage = () => typeof Image !== 'undefined' ? Image : null;\n\nexport { domCanvas as canvas, domCanvas, domImage as image };\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","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: function(channels) {\n return Object.assign(new this.constructor, this, channels);\n },\n displayable: function() {\n return this.rgb().displayable();\n },\n hex: color_formatHex, // Deprecated! Use color.formatHex.\n formatHex: color_formatHex,\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_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: function(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: function(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: function() {\n return this;\n },\n displayable: function() {\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 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_formatRgb() {\n var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a));\n return (a === 1 ? \"rgb(\" : \"rgba(\")\n + Math.max(0, Math.min(255, Math.round(this.r) || 0)) + \", \"\n + Math.max(0, Math.min(255, Math.round(this.g) || 0)) + \", \"\n + Math.max(0, Math.min(255, Math.round(this.b) || 0))\n + (a === 1 ? \")\" : \", \" + a + \")\");\n}\n\nfunction hex(value) {\n value = Math.max(0, Math.min(255, Math.round(value) || 0));\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: function(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: function(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: function() {\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 displayable: function() {\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: function() {\n var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a));\n return (a === 1 ? \"hsl(\" : \"hsla(\")\n + (this.h || 0) + \", \"\n + (this.s || 0) * 100 + \"%, \"\n + (this.l || 0) * 100 + \"%\"\n + (a === 1 ? \")\" : \", \" + a + \")\");\n }\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: function(k) {\n return new Lab(this.l + K * (k == null ? 1 : k), this.a, this.b, this.opacity);\n },\n darker: function(k) {\n return new Lab(this.l - K * (k == null ? 1 : k), this.a, this.b, this.opacity);\n },\n rgb: function() {\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: function(k) {\n return new Hcl(this.h, this.c, this.l + K * (k == null ? 1 : k), this.opacity);\n },\n darker: function(k) {\n return new Hcl(this.h, this.c, this.l - K * (k == null ? 1 : k), this.opacity);\n },\n rgb: function() {\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: function(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: function(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: function() {\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","var epsilon2 = 1e-12;\n\nfunction cosh(x) {\n return ((x = Math.exp(x)) + 1 / x) / 2;\n}\n\nfunction sinh(x) {\n return ((x = Math.exp(x)) - 1 / x) / 2;\n}\n\nfunction tanh(x) {\n return ((x = Math.exp(2 * x)) - 1) / (x + 1);\n}\n\nexport default (function zoomRho(rho, rho2, rho4) {\n\n // p0 = [ux0, uy0, w0]\n // p1 = [ux1, uy1, w1]\n function zoom(p0, p1) {\n var ux0 = p0[0], uy0 = p0[1], w0 = p0[2],\n ux1 = p1[0], uy1 = p1[1], w1 = p1[2],\n dx = ux1 - ux0,\n dy = uy1 - uy0,\n d2 = dx * dx + dy * dy,\n i,\n S;\n\n // Special case for u0 ≅ u1.\n if (d2 < epsilon2) {\n S = Math.log(w1 / w0) / rho;\n i = function(t) {\n return [\n ux0 + t * dx,\n uy0 + t * dy,\n w0 * Math.exp(rho * t * S)\n ];\n }\n }\n\n // General case.\n else {\n var d1 = Math.sqrt(d2),\n b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1),\n b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1),\n r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0),\n r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);\n S = (r1 - r0) / rho;\n i = function(t) {\n var s = t * S,\n coshr0 = cosh(r0),\n u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0));\n return [\n ux0 + u * dx,\n uy0 + u * dy,\n w0 * coshr0 / cosh(rho * s + r0)\n ];\n }\n }\n\n i.duration = S * 1000 * rho / Math.SQRT2;\n\n return i;\n }\n\n zoom.rho = function(_) {\n var _1 = Math.max(1e-3, +_), _2 = _1 * _1, _4 = _2 * _2;\n return zoomRho(_1, _2, _4);\n };\n\n return zoom;\n})(Math.SQRT2, 2, 4);\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 {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(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","import {hue} from \"./color.js\";\n\nexport default function(a, b) {\n var i = hue(+a, +b);\n return function(t) {\n var x = i(t);\n return x - 360 * Math.floor(x / 360);\n };\n}\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","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","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","export default function constants(x) {\n return function() {\n return x;\n };\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","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 {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 {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","import { toNumber, peek, hasOwnProperty, toSet, array, constant, isNumber, span, isObject, isString, error, isArray } from 'vega-util';\nimport { bisectRight, range, bisect } from 'd3-array';\nimport * as $ from 'd3-scale';\nimport { scaleOrdinal, tickFormat as tickFormat$1 } from 'd3-scale';\nexport { scaleImplicit } from 'd3-scale';\nimport * as $$1 from 'd3-interpolate';\nimport { timeInterval, utcInterval } from 'vega-time';\n\nfunction bandSpace (count, paddingInner, paddingOuter) {\n const space = count - paddingInner + paddingOuter * 2;\n return count ? space > 0 ? space : 1 : 0;\n}\n\nconst Identity = 'identity';\nconst Linear = 'linear';\nconst Log = 'log';\nconst Pow = 'pow';\nconst Sqrt = 'sqrt';\nconst Symlog = 'symlog';\nconst Time = 'time';\nconst UTC = 'utc';\nconst Sequential = 'sequential';\nconst Diverging = 'diverging';\nconst Quantile = 'quantile';\nconst Quantize = 'quantize';\nconst Threshold = 'threshold';\nconst Ordinal = 'ordinal';\nconst Point = 'point';\nconst Band = 'band';\nconst BinOrdinal = 'bin-ordinal'; // categories\n\nconst Continuous = 'continuous';\nconst Discrete = 'discrete';\nconst Discretizing = 'discretizing';\nconst Interpolating = 'interpolating';\nconst Temporal = 'temporal';\n\nfunction invertRange (scale) {\n return function (_) {\n let lo = _[0],\n hi = _[1],\n t;\n\n if (hi < lo) {\n t = lo;\n lo = hi;\n hi = t;\n }\n\n return [scale.invert(lo), scale.invert(hi)];\n };\n}\n\nfunction invertRangeExtent (scale) {\n return function (_) {\n const range = scale.range();\n let lo = _[0],\n hi = _[1],\n min = -1,\n max,\n t,\n i,\n n;\n\n if (hi < lo) {\n t = lo;\n lo = hi;\n hi = t;\n }\n\n for (i = 0, n = range.length; i < n; ++i) {\n if (range[i] >= lo && range[i] <= hi) {\n if (min < 0) min = i;\n max = i;\n }\n }\n\n if (min < 0) return undefined;\n lo = scale.invertExtent(range[min]);\n hi = scale.invertExtent(range[max]);\n return [lo[0] === undefined ? lo[1] : lo[0], hi[1] === undefined ? hi[0] : hi[1]];\n };\n}\n\nfunction band() {\n const scale = scaleOrdinal().unknown(undefined),\n domain = scale.domain,\n ordinalRange = scale.range;\n let range$1 = [0, 1],\n step,\n bandwidth,\n round = false,\n paddingInner = 0,\n paddingOuter = 0,\n align = 0.5;\n delete scale.unknown;\n\n function rescale() {\n const n = domain().length,\n reverse = range$1[1] < range$1[0],\n stop = range$1[1 - reverse],\n space = bandSpace(n, paddingInner, paddingOuter);\n let start = range$1[reverse - 0];\n step = (stop - start) / (space || 1);\n\n if (round) {\n step = Math.floor(step);\n }\n\n start += (stop - start - step * (n - paddingInner)) * align;\n bandwidth = step * (1 - paddingInner);\n\n if (round) {\n start = Math.round(start);\n bandwidth = Math.round(bandwidth);\n }\n\n const values = range(n).map(i => start + step * i);\n return ordinalRange(reverse ? values.reverse() : values);\n }\n\n scale.domain = function (_) {\n if (arguments.length) {\n domain(_);\n return rescale();\n } else {\n return domain();\n }\n };\n\n scale.range = function (_) {\n if (arguments.length) {\n range$1 = [+_[0], +_[1]];\n return rescale();\n } else {\n return range$1.slice();\n }\n };\n\n scale.rangeRound = function (_) {\n range$1 = [+_[0], +_[1]];\n round = true;\n return 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 if (arguments.length) {\n round = !!_;\n return rescale();\n } else {\n return round;\n }\n };\n\n scale.padding = function (_) {\n if (arguments.length) {\n paddingOuter = Math.max(0, Math.min(1, _));\n paddingInner = paddingOuter;\n return rescale();\n } else {\n return paddingInner;\n }\n };\n\n scale.paddingInner = function (_) {\n if (arguments.length) {\n paddingInner = Math.max(0, Math.min(1, _));\n return rescale();\n } else {\n return paddingInner;\n }\n };\n\n scale.paddingOuter = function (_) {\n if (arguments.length) {\n paddingOuter = Math.max(0, Math.min(1, _));\n return rescale();\n } else {\n return paddingOuter;\n }\n };\n\n scale.align = function (_) {\n if (arguments.length) {\n align = Math.max(0, Math.min(1, _));\n return rescale();\n } else {\n return align;\n }\n };\n\n scale.invertRange = function (_) {\n // bail if range has null or undefined values\n if (_[0] == null || _[1] == null) return;\n const reverse = range$1[1] < range$1[0],\n values = reverse ? ordinalRange().reverse() : ordinalRange(),\n n = values.length - 1;\n let lo = +_[0],\n hi = +_[1],\n a,\n b,\n t; // bail if either range endpoint is invalid\n\n if (lo !== lo || hi !== hi) return; // order range inputs, bail if outside of scale range\n\n if (hi < lo) {\n t = lo;\n lo = hi;\n hi = t;\n }\n\n if (hi < values[0] || lo > range$1[1 - reverse]) return; // binary search to index into scale range\n\n a = Math.max(0, bisectRight(values, lo) - 1);\n b = lo === hi ? a : bisectRight(values, hi) - 1; // increment index a if lo is within padding gap\n\n if (lo - values[a] > bandwidth + 1e-10) ++a;\n\n if (reverse) {\n // map + swap\n t = a;\n a = n - b;\n b = n - t;\n }\n\n return a > b ? undefined : domain().slice(a, b + 1);\n };\n\n scale.invert = function (_) {\n const value = scale.invertRange([_, _]);\n return value ? value[0] : value;\n };\n\n scale.copy = function () {\n return band().domain(domain()).range(range$1).round(round).paddingInner(paddingInner).paddingOuter(paddingOuter).align(align);\n };\n\n return rescale();\n}\n\nfunction pointish(scale) {\n const copy = scale.copy;\n scale.padding = scale.paddingOuter;\n delete scale.paddingInner;\n\n scale.copy = function () {\n return pointish(copy());\n };\n\n return scale;\n}\n\nfunction point() {\n return pointish(band().paddingInner(1));\n}\n\nvar map = Array.prototype.map;\nfunction numbers(_) {\n return map.call(_, toNumber);\n}\n\nconst slice = Array.prototype.slice;\n\nfunction scaleBinOrdinal() {\n let domain = [],\n range = [];\n\n function scale(x) {\n return x == null || x !== x ? undefined : range[(bisect(domain, x) - 1) % range.length];\n }\n\n scale.domain = function (_) {\n if (arguments.length) {\n domain = numbers(_);\n return scale;\n } else {\n return domain.slice();\n }\n };\n\n scale.range = function (_) {\n if (arguments.length) {\n range = slice.call(_);\n return scale;\n } else {\n return range.slice();\n }\n };\n\n scale.tickFormat = function (count, specifier) {\n return tickFormat$1(domain[0], peek(domain), count == null ? 10 : count, specifier);\n };\n\n scale.copy = function () {\n return scaleBinOrdinal().domain(scale.domain()).range(scale.range());\n };\n\n return scale;\n}\n\nconst scales = {};\n/**\n * Augment scales with their type and needed inverse methods.\n */\n\nfunction create(type, constructor, metadata) {\n const ctr = function scale() {\n const s = constructor();\n\n if (!s.invertRange) {\n s.invertRange = s.invert ? invertRange(s) : s.invertExtent ? invertRangeExtent(s) : undefined;\n }\n\n s.type = type;\n return s;\n };\n\n ctr.metadata = toSet(array(metadata));\n return ctr;\n}\n\nfunction scale(type, scale, metadata) {\n if (arguments.length > 1) {\n scales[type] = create(type, scale, metadata);\n return this;\n } else {\n return isValidScaleType(type) ? scales[type] : undefined;\n }\n} // identity scale\n\nscale(Identity, $.scaleIdentity); // continuous scales\n\nscale(Linear, $.scaleLinear, Continuous);\nscale(Log, $.scaleLog, [Continuous, Log]);\nscale(Pow, $.scalePow, Continuous);\nscale(Sqrt, $.scaleSqrt, Continuous);\nscale(Symlog, $.scaleSymlog, Continuous);\nscale(Time, $.scaleTime, [Continuous, Temporal]);\nscale(UTC, $.scaleUtc, [Continuous, Temporal]); // sequential scales\n\nscale(Sequential, $.scaleSequential, [Continuous, Interpolating]); // backwards compat\n\nscale(\"\".concat(Sequential, \"-\").concat(Linear), $.scaleSequential, [Continuous, Interpolating]);\nscale(\"\".concat(Sequential, \"-\").concat(Log), $.scaleSequentialLog, [Continuous, Interpolating, Log]);\nscale(\"\".concat(Sequential, \"-\").concat(Pow), $.scaleSequentialPow, [Continuous, Interpolating]);\nscale(\"\".concat(Sequential, \"-\").concat(Sqrt), $.scaleSequentialSqrt, [Continuous, Interpolating]);\nscale(\"\".concat(Sequential, \"-\").concat(Symlog), $.scaleSequentialSymlog, [Continuous, Interpolating]); // diverging scales\n\nscale(\"\".concat(Diverging, \"-\").concat(Linear), $.scaleDiverging, [Continuous, Interpolating]);\nscale(\"\".concat(Diverging, \"-\").concat(Log), $.scaleDivergingLog, [Continuous, Interpolating, Log]);\nscale(\"\".concat(Diverging, \"-\").concat(Pow), $.scaleDivergingPow, [Continuous, Interpolating]);\nscale(\"\".concat(Diverging, \"-\").concat(Sqrt), $.scaleDivergingSqrt, [Continuous, Interpolating]);\nscale(\"\".concat(Diverging, \"-\").concat(Symlog), $.scaleDivergingSymlog, [Continuous, Interpolating]); // discretizing scales\n\nscale(Quantile, $.scaleQuantile, [Discretizing, Quantile]);\nscale(Quantize, $.scaleQuantize, Discretizing);\nscale(Threshold, $.scaleThreshold, Discretizing); // discrete scales\n\nscale(BinOrdinal, scaleBinOrdinal, [Discrete, Discretizing]);\nscale(Ordinal, $.scaleOrdinal, Discrete);\nscale(Band, band, Discrete);\nscale(Point, point, Discrete);\nfunction isValidScaleType(type) {\n return hasOwnProperty(scales, type);\n}\n\nfunction hasType(key, type) {\n const s = scales[key];\n return s && s.metadata[type];\n}\n\nfunction isContinuous(key) {\n return hasType(key, Continuous);\n}\nfunction isDiscrete(key) {\n return hasType(key, Discrete);\n}\nfunction isDiscretizing(key) {\n return hasType(key, Discretizing);\n}\nfunction isLogarithmic(key) {\n return hasType(key, Log);\n}\nfunction isTemporal(key) {\n return hasType(key, Temporal);\n}\nfunction isInterpolating(key) {\n return hasType(key, Interpolating);\n}\nfunction isQuantile(key) {\n return hasType(key, Quantile);\n}\n\nconst scaleProps = ['clamp', 'base', 'constant', 'exponent'];\nfunction interpolateRange(interpolator, range) {\n const start = range[0],\n span = peek(range) - start;\n return function (i) {\n return interpolator(start + i * span);\n };\n}\nfunction interpolateColors(colors, type, gamma) {\n return $$1.piecewise(interpolate(type || 'rgb', gamma), colors);\n}\nfunction quantizeInterpolator(interpolator, count) {\n const samples = new Array(count),\n n = count + 1;\n\n for (let i = 0; i < count;) samples[i] = interpolator(++i / n);\n\n return samples;\n}\nfunction scaleCopy(scale) {\n const t = scale.type,\n s = scale.copy();\n s.type = t;\n return s;\n}\nfunction scaleFraction(scale$1, min, max) {\n const delta = max - min;\n let i, t, s;\n\n if (!delta || !Number.isFinite(delta)) {\n return constant(0.5);\n } else {\n i = (t = scale$1.type).indexOf('-');\n t = i < 0 ? t : t.slice(i + 1);\n s = scale(t)().domain([min, max]).range([0, 1]);\n scaleProps.forEach(m => scale$1[m] ? s[m](scale$1[m]()) : 0);\n return s;\n }\n}\nfunction interpolate(type, gamma) {\n const interp = $$1[method(type)];\n return gamma != null && interp && interp.gamma ? interp.gamma(gamma) : interp;\n}\n\nfunction method(type) {\n return 'interpolate' + type.toLowerCase().split('-').map(s => s[0].toUpperCase() + s.slice(1)).join('');\n}\n\nconst continuous = {\n blues: 'cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90',\n greens: 'd3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429',\n greys: 'e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e',\n oranges: 'fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303',\n purples: 'e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c',\n reds: 'fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13',\n blueGreen: 'd5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429',\n bluePurple: 'ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71',\n greenBlue: 'd3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1',\n orangeRed: 'fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403',\n purpleBlue: 'dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281',\n purpleBlueGreen: 'dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353',\n purpleRed: 'dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a',\n redPurple: 'fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174',\n yellowGreen: 'e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034',\n yellowOrangeBrown: 'feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204',\n yellowOrangeRed: 'fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225',\n blueOrange: '134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07',\n brownBlueGreen: '704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147',\n purpleGreen: '5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29',\n purpleOrange: '4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07',\n redBlue: '8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85',\n redGrey: '8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434',\n yellowGreenBlue: 'eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185',\n redYellowBlue: 'a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695',\n redYellowGreen: 'a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837',\n pinkYellowGreen: '8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419',\n spectral: '9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2',\n viridis: '440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725',\n magma: '0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf',\n inferno: '0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4',\n plasma: '0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921',\n cividis: '00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647',\n rainbow: '6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa',\n sinebow: 'ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040',\n turbo: '23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00',\n browns: 'eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632',\n tealBlues: 'bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985',\n teals: 'bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667',\n warmGreys: 'dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e',\n goldGreen: 'f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36',\n goldOrange: 'f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26',\n goldRed: 'f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e',\n lightGreyRed: 'efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b',\n lightGreyTeal: 'e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc',\n lightMulti: 'e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c',\n lightOrange: 'f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b',\n lightTealBlue: 'e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988',\n darkBlue: '3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff',\n darkGold: '3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff',\n darkGreen: '3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa',\n darkMulti: '3737371f5287197d8c29a86995ce3fffe800ffffff',\n darkRed: '3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c'\n};\nconst discrete = {\n category10: '1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf',\n category20: '1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5',\n category20b: '393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6',\n category20c: '3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9',\n tableau10: '4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac',\n tableau20: '4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5',\n accent: '7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666',\n dark2: '1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666',\n paired: 'a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928',\n pastel1: 'fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2',\n pastel2: 'b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc',\n set1: 'e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999',\n set2: '66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3',\n set3: '8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f'\n};\n\nfunction colors(palette) {\n const n = palette.length / 6 | 0,\n c = new Array(n);\n\n for (let i = 0; i < n;) {\n c[i] = '#' + palette.slice(i * 6, ++i * 6);\n }\n\n return c;\n}\n\nfunction apply(_, f) {\n for (const k in _) scheme(k, f(_[k]));\n}\n\nconst schemes = {};\napply(discrete, colors);\napply(continuous, _ => interpolateColors(colors(_)));\nfunction scheme(name, scheme) {\n name = name && name.toLowerCase();\n\n if (arguments.length > 1) {\n schemes[name] = scheme;\n return this;\n } else {\n return schemes[name];\n }\n}\n\nconst SymbolLegend = 'symbol';\nconst DiscreteLegend = 'discrete';\nconst GradientLegend = 'gradient';\n\nconst defaultFormatter = value => isArray(value) ? value.map(v => String(v)) : String(value);\n\nconst ascending = (a, b) => a[1] - b[1];\n\nconst descending = (a, b) => b[1] - a[1];\n/**\n * Determine the tick count or interval function.\n * @param {Scale} scale - The scale for which to generate tick values.\n * @param {*} count - The desired tick count or interval specifier.\n * @param {number} minStep - The desired minimum step between tick values.\n * @return {*} - The tick count or interval function.\n */\n\n\nfunction tickCount(scale, count, minStep) {\n let step;\n\n if (isNumber(count)) {\n if (scale.bins) {\n count = Math.max(count, scale.bins.length);\n }\n\n if (minStep != null) {\n count = Math.min(count, Math.floor(span(scale.domain()) / minStep || 1));\n }\n }\n\n if (isObject(count)) {\n step = count.step;\n count = count.interval;\n }\n\n if (isString(count)) {\n count = scale.type === Time ? timeInterval(count) : scale.type == UTC ? utcInterval(count) : error('Only time and utc scales accept interval strings.');\n if (step) count = count.every(step);\n }\n\n return count;\n}\n/**\n * Filter a set of candidate tick values, ensuring that only tick values\n * that lie within the scale range are included.\n * @param {Scale} scale - The scale for which to generate tick values.\n * @param {Array<*>} ticks - The candidate tick values.\n * @param {*} count - The tick count or interval function.\n * @return {Array<*>} - The filtered tick values.\n */\n\nfunction validTicks(scale, ticks, count) {\n let range = scale.range(),\n lo = range[0],\n hi = peek(range),\n cmp = ascending;\n\n if (lo > hi) {\n range = hi;\n hi = lo;\n lo = range;\n cmp = descending;\n }\n\n lo = Math.floor(lo);\n hi = Math.ceil(hi); // filter ticks to valid values within the range\n // additionally sort ticks in range order (#2579)\n\n ticks = ticks.map(v => [v, scale(v)]).filter(_ => lo <= _[1] && _[1] <= hi).sort(cmp).map(_ => _[0]);\n\n if (count > 0 && ticks.length > 1) {\n const endpoints = [ticks[0], peek(ticks)];\n\n while (ticks.length > count && ticks.length >= 3) {\n ticks = ticks.filter((_, i) => !(i % 2));\n }\n\n if (ticks.length < 3) {\n ticks = endpoints;\n }\n }\n\n return ticks;\n}\n/**\n * Generate tick values for the given scale and approximate tick count or\n * interval value. If the scale has a 'ticks' method, it will be used to\n * generate the ticks, with the count argument passed as a parameter. If the\n * scale lacks a 'ticks' method, the full scale domain will be returned.\n * @param {Scale} scale - The scale for which to generate tick values.\n * @param {*} [count] - The approximate number of desired ticks.\n * @return {Array<*>} - The generated tick values.\n */\n\nfunction tickValues(scale, count) {\n return scale.bins ? validTicks(scale, scale.bins) : scale.ticks ? scale.ticks(count) : scale.domain();\n}\n/**\n * Generate a label format function for a scale. If the scale has a\n * 'tickFormat' method, it will be used to generate the formatter, with the\n * count and specifier arguments passed as parameters. If the scale lacks a\n * 'tickFormat' method, the returned formatter performs simple string coercion.\n * If the input scale is a logarithmic scale and the format specifier does not\n * indicate a desired decimal precision, a special variable precision formatter\n * that automatically trims trailing zeroes will be generated.\n * @param {Scale} scale - The scale for which to generate the label formatter.\n * @param {*} [count] - The approximate number of desired ticks.\n * @param {string} [specifier] - The format specifier. Must be a legal d3\n * specifier string (see https://github.com/d3/d3-format#formatSpecifier) or\n * time multi-format specifier object.\n * @return {function(*):string} - The generated label formatter.\n */\n\nfunction tickFormat(locale, scale, count, specifier, formatType, noSkip) {\n const type = scale.type;\n let format = defaultFormatter;\n\n if (type === Time || formatType === Time) {\n format = locale.timeFormat(specifier);\n } else if (type === UTC || formatType === UTC) {\n format = locale.utcFormat(specifier);\n } else if (isLogarithmic(type)) {\n const varfmt = locale.formatFloat(specifier);\n\n if (noSkip || scale.bins) {\n format = varfmt;\n } else {\n const test = tickLog(scale, count, false);\n\n format = _ => test(_) ? varfmt(_) : '';\n }\n } else if (scale.tickFormat) {\n // if d3 scale has tickFormat, it must be continuous\n const d = scale.domain();\n format = locale.formatSpan(d[0], d[d.length - 1], count, specifier);\n } else if (specifier) {\n format = locale.format(specifier);\n }\n\n return format;\n}\nfunction tickLog(scale, count, values) {\n const ticks = tickValues(scale, count),\n base = scale.base(),\n logb = Math.log(base),\n k = Math.max(1, base * count / ticks.length); // apply d3-scale's log format filter criteria\n\n const test = d => {\n let i = d / Math.pow(base, Math.round(Math.log(d) / logb));\n if (i * base < base - 0.5) i *= base;\n return i <= k;\n };\n\n return values ? ticks.filter(test) : test;\n}\n\nconst symbols = {\n [Quantile]: 'quantiles',\n [Quantize]: 'thresholds',\n [Threshold]: 'domain'\n};\nconst formats = {\n [Quantile]: 'quantiles',\n [Quantize]: 'domain'\n};\nfunction labelValues(scale, count) {\n return scale.bins ? binValues(scale.bins) : scale.type === Log ? tickLog(scale, count, true) : symbols[scale.type] ? thresholdValues(scale[symbols[scale.type]]()) : tickValues(scale, count);\n}\nfunction thresholdFormat(locale, scale, specifier) {\n const _ = scale[formats[scale.type]](),\n n = _.length;\n\n let d = n > 1 ? _[1] - _[0] : _[0],\n i;\n\n for (i = 1; i < n; ++i) {\n d = Math.min(d, _[i] - _[i - 1]);\n } // tickCount = 3 ticks times 10 for increased resolution\n\n\n return locale.formatSpan(0, d, 3 * 10, specifier);\n}\n\nfunction thresholdValues(thresholds) {\n const values = [-Infinity].concat(thresholds);\n values.max = +Infinity;\n return values;\n}\n\nfunction binValues(bins) {\n const values = bins.slice(0, -1);\n values.max = peek(bins);\n return values;\n}\n\nconst isDiscreteRange = scale => symbols[scale.type] || scale.bins;\n\nfunction labelFormat(locale, scale, count, type, specifier, formatType, noSkip) {\n const format = formats[scale.type] && formatType !== Time && formatType !== UTC ? thresholdFormat(locale, scale, specifier) : tickFormat(locale, scale, count, specifier, formatType, noSkip);\n return type === SymbolLegend && isDiscreteRange(scale) ? formatRange(format) : type === DiscreteLegend ? formatDiscrete(format) : formatPoint(format);\n}\n\nconst formatRange = format => (value, index, array) => {\n const limit = get(array[index + 1], get(array.max, +Infinity)),\n lo = formatValue(value, format),\n hi = formatValue(limit, format);\n return lo && hi ? lo + ' \\u2013 ' + hi : hi ? '< ' + hi : '\\u2265 ' + lo;\n};\n\nconst get = (value, dflt) => value != null ? value : dflt;\n\nconst formatDiscrete = format => (value, index) => index ? format(value) : null;\n\nconst formatPoint = format => value => format(value);\n\nconst formatValue = (value, format) => Number.isFinite(value) ? format(value) : null;\n\nfunction labelFraction(scale) {\n const domain = scale.domain(),\n count = domain.length - 1;\n let lo = +domain[0],\n hi = +peek(domain),\n span = hi - lo;\n\n if (scale.type === Threshold) {\n const adjust = count ? span / count : 0.1;\n lo -= adjust;\n hi += adjust;\n span = hi - lo;\n }\n\n return value => (value - lo) / span;\n}\n\nfunction format(locale, scale, specifier, formatType) {\n const type = formatType || scale.type; // replace abbreviated time specifiers to improve screen reader experience\n\n if (isString(specifier) && isTemporal(type)) {\n specifier = specifier.replace(/%a/g, '%A').replace(/%b/g, '%B');\n }\n\n return !specifier && type === Time ? locale.timeFormat('%A, %d %B %Y, %X') : !specifier && type === UTC ? locale.utcFormat('%A, %d %B %Y, %X UTC') : labelFormat(locale, scale, 5, null, specifier, formatType, true);\n}\n\nfunction domainCaption(locale, scale, opt) {\n opt = opt || {};\n const max = Math.max(3, opt.maxlen || 7),\n fmt = format(locale, scale, opt.format, opt.formatType); // if scale breaks domain into bins, describe boundaries\n\n if (isDiscretizing(scale.type)) {\n const v = labelValues(scale).slice(1).map(fmt),\n n = v.length;\n return \"\".concat(n, \" boundar\").concat(n === 1 ? 'y' : 'ies', \": \").concat(v.join(', '));\n } // if scale domain is discrete, list values\n else if (isDiscrete(scale.type)) {\n const d = scale.domain(),\n n = d.length,\n v = n > max ? d.slice(0, max - 2).map(fmt).join(', ') + ', ending with ' + d.slice(-1).map(fmt) : d.map(fmt).join(', ');\n return \"\".concat(n, \" value\").concat(n === 1 ? '' : 's', \": \").concat(v);\n } // if scale domain is continuous, describe value range\n else {\n const d = scale.domain();\n return \"values from \".concat(fmt(d[0]), \" to \").concat(fmt(peek(d)));\n }\n}\n\nexport { Band, BinOrdinal, DiscreteLegend, Diverging, GradientLegend, Identity, Linear, Log, Ordinal, Point, Pow, Quantile, Quantize, Sequential, Sqrt, SymbolLegend, Symlog, Threshold, Time, UTC, bandSpace, domainCaption, interpolate, interpolateColors, interpolateRange, isContinuous, isDiscrete, isDiscretizing, isInterpolating, isLogarithmic, isQuantile, isTemporal, isValidScaleType, labelFormat, labelFraction, labelValues, quantizeInterpolator, scale, scaleCopy, scaleFraction, scheme, tickCount, tickFormat, tickValues, validTicks };\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","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 {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 {linearish} from \"./linear.js\";\nimport {initRange} from \"./init.js\";\n\nexport default function quantize() {\n var x0 = 0,\n x1 = 1,\n n = 1,\n domain = [0.5],\n range = [0, 1],\n unknown;\n\n function scale(x) {\n return x != null && x <= x ? range[bisect(domain, x, 0, n)] : unknown;\n }\n\n function rescale() {\n var i = -1;\n domain = new Array(n);\n while (++i < n) domain[i] = ((i + 1) * x1 - (i - n) * x0) / (n + 1);\n return scale;\n }\n\n scale.domain = function(_) {\n return arguments.length ? ([x0, x1] = _, x0 = +x0, x1 = +x1, rescale()) : [x0, x1];\n };\n\n scale.range = function(_) {\n return arguments.length ? (n = (range = Array.from(_)).length - 1, rescale()) : range.slice();\n };\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return i < 0 ? [NaN, NaN]\n : i < 1 ? [x0, domain[0]]\n : i >= n ? [domain[n - 1], x1]\n : [domain[i - 1], domain[i]];\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : scale;\n };\n\n scale.thresholds = function() {\n return domain.slice();\n };\n\n scale.copy = function() {\n return quantize()\n .domain([x0, x1])\n .range(range)\n .unknown(unknown);\n };\n\n return initRange.apply(linearish(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","import { hasOwnProperty, isFunction, inherits, truthy, lruCache, isArray, error, toSet, array, peek, extend, isNumber, isObject } from 'vega-util';\nimport { curveBasis, curveBasisClosed, curveBasisOpen, curveBundle, curveCardinal, curveCardinalOpen, curveCardinalClosed, curveCatmullRom, curveCatmullRomClosed, curveCatmullRomOpen, curveLinear, curveLinearClosed, curveMonotoneY, curveMonotoneX, curveNatural, curveStep, curveStepAfter, curveStepBefore, arc as arc$2, area as area$2, line as line$2, symbol as symbol$2 } from 'd3-shape';\nimport { path as path$3 } from 'd3-path';\nexport { path } from 'd3-path';\nimport { image as image$1, canvas } from 'vega-canvas';\nimport { loader } from 'vega-loader';\nimport { isDiscrete, domainCaption } from 'vega-scale';\n\nlet gradient_id = 0;\nfunction resetSVGGradientId() {\n gradient_id = 0;\n}\nconst patternPrefix = 'p_';\nfunction isGradient(value) {\n return value && value.gradient;\n}\nfunction gradientRef(g, defs, base) {\n const type = g.gradient;\n let id = g.id,\n prefix = type === 'radial' ? patternPrefix : ''; // check id, assign default values as needed\n\n if (!id) {\n id = g.id = 'gradient_' + gradient_id++;\n\n if (type === 'radial') {\n g.x1 = get(g.x1, 0.5);\n g.y1 = get(g.y1, 0.5);\n g.r1 = get(g.r1, 0);\n g.x2 = get(g.x2, 0.5);\n g.y2 = get(g.y2, 0.5);\n g.r2 = get(g.r2, 0.5);\n prefix = patternPrefix;\n } else {\n g.x1 = get(g.x1, 0);\n g.y1 = get(g.y1, 0);\n g.x2 = get(g.x2, 1);\n g.y2 = get(g.y2, 0);\n }\n } // register definition\n\n\n defs[id] = g; // return url reference\n\n return 'url(' + (base || '') + '#' + prefix + id + ')';\n}\n\nfunction get(val, def) {\n return val != null ? val : def;\n}\n\nfunction Gradient (p0, p1) {\n var stops = [],\n gradient;\n return gradient = {\n gradient: 'linear',\n x1: p0 ? p0[0] : 0,\n y1: p0 ? p0[1] : 0,\n x2: p1 ? p1[0] : 1,\n y2: p1 ? p1[1] : 0,\n stops: stops,\n stop: function (offset, color) {\n stops.push({\n offset: offset,\n color: color\n });\n return gradient;\n }\n };\n}\n\nconst lookup = {\n 'basis': {\n curve: curveBasis\n },\n 'basis-closed': {\n curve: curveBasisClosed\n },\n 'basis-open': {\n curve: curveBasisOpen\n },\n 'bundle': {\n curve: curveBundle,\n tension: 'beta',\n value: 0.85\n },\n 'cardinal': {\n curve: curveCardinal,\n tension: 'tension',\n value: 0\n },\n 'cardinal-open': {\n curve: curveCardinalOpen,\n tension: 'tension',\n value: 0\n },\n 'cardinal-closed': {\n curve: curveCardinalClosed,\n tension: 'tension',\n value: 0\n },\n 'catmull-rom': {\n curve: curveCatmullRom,\n tension: 'alpha',\n value: 0.5\n },\n 'catmull-rom-closed': {\n curve: curveCatmullRomClosed,\n tension: 'alpha',\n value: 0.5\n },\n 'catmull-rom-open': {\n curve: curveCatmullRomOpen,\n tension: 'alpha',\n value: 0.5\n },\n 'linear': {\n curve: curveLinear\n },\n 'linear-closed': {\n curve: curveLinearClosed\n },\n 'monotone': {\n horizontal: curveMonotoneY,\n vertical: curveMonotoneX\n },\n 'natural': {\n curve: curveNatural\n },\n 'step': {\n curve: curveStep\n },\n 'step-after': {\n curve: curveStepAfter\n },\n 'step-before': {\n curve: curveStepBefore\n }\n};\nfunction curves(type, orientation, tension) {\n var entry = hasOwnProperty(lookup, type) && lookup[type],\n curve = null;\n\n if (entry) {\n curve = entry.curve || entry[orientation || 'vertical'];\n\n if (entry.tension && tension != null) {\n curve = curve[entry.tension](tension);\n }\n }\n\n return curve;\n}\n\nconst paramCounts = {\n m: 2,\n l: 2,\n h: 1,\n v: 1,\n z: 0,\n c: 6,\n s: 4,\n q: 4,\n t: 2,\n a: 7\n};\nconst commandPattern = /[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi;\nconst numberPattern = /^[+-]?(([0-9]*\\.[0-9]+)|([0-9]+\\.)|([0-9]+))([eE][+-]?[0-9]+)?/;\nconst spacePattern = /^((\\s+,?\\s*)|(,\\s*))/;\nconst flagPattern = /^[01]/;\nfunction parse(path) {\n const commands = [];\n const matches = path.match(commandPattern) || [];\n matches.forEach(str => {\n let cmd = str[0];\n const type = cmd.toLowerCase(); // parse parameters\n\n const paramCount = paramCounts[type];\n const params = parseParams(type, paramCount, str.slice(1).trim());\n const count = params.length; // error checking based on parameter count\n\n if (count < paramCount || count && count % paramCount !== 0) {\n throw Error('Invalid SVG path, incorrect parameter count');\n } // register the command\n\n\n commands.push([cmd, ...params.slice(0, paramCount)]); // exit now if we're done, also handles zero-param 'z'\n\n if (count === paramCount) {\n return;\n } // handle implicit line-to\n\n\n if (type === 'm') {\n cmd = cmd === 'M' ? 'L' : 'l';\n } // repeat command when given extended param list\n\n\n for (let i = paramCount; i < count; i += paramCount) {\n commands.push([cmd, ...params.slice(i, i + paramCount)]);\n }\n });\n return commands;\n}\n\nfunction parseParams(type, paramCount, segment) {\n const params = [];\n\n for (let index = 0; paramCount && index < segment.length;) {\n for (let i = 0; i < paramCount; ++i) {\n const pattern = type === 'a' && (i === 3 || i === 4) ? flagPattern : numberPattern;\n const match = segment.slice(index).match(pattern);\n\n if (match === null) {\n throw Error('Invalid SVG path, incorrect parameter type');\n }\n\n index += match[0].length;\n params.push(+match[0]);\n const ws = segment.slice(index).match(spacePattern);\n\n if (ws !== null) {\n index += ws[0].length;\n }\n }\n }\n\n return params;\n}\n\nconst DegToRad = Math.PI / 180;\nconst Epsilon = 1e-14;\nconst HalfPi = Math.PI / 2;\nconst Tau = Math.PI * 2;\nconst HalfSqrt3 = Math.sqrt(3) / 2;\n\nvar segmentCache = {};\nvar bezierCache = {};\nvar join = [].join; // Copied from Inkscape svgtopdf, thanks!\n\nfunction segments(x, y, rx, ry, large, sweep, rotateX, ox, oy) {\n const key = join.call(arguments);\n\n if (segmentCache[key]) {\n return segmentCache[key];\n }\n\n const th = rotateX * DegToRad;\n const sin_th = Math.sin(th);\n const cos_th = Math.cos(th);\n rx = Math.abs(rx);\n ry = Math.abs(ry);\n const px = cos_th * (ox - x) * 0.5 + sin_th * (oy - y) * 0.5;\n const py = cos_th * (oy - y) * 0.5 - sin_th * (ox - x) * 0.5;\n let pl = px * px / (rx * rx) + py * py / (ry * ry);\n\n if (pl > 1) {\n pl = Math.sqrt(pl);\n rx *= pl;\n ry *= pl;\n }\n\n const a00 = cos_th / rx;\n const a01 = sin_th / rx;\n const a10 = -sin_th / ry;\n const a11 = cos_th / ry;\n const x0 = a00 * ox + a01 * oy;\n const y0 = a10 * ox + a11 * oy;\n const x1 = a00 * x + a01 * y;\n const y1 = a10 * x + a11 * y;\n const d = (x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0);\n let sfactor_sq = 1 / d - 0.25;\n if (sfactor_sq < 0) sfactor_sq = 0;\n let sfactor = Math.sqrt(sfactor_sq);\n if (sweep == large) sfactor = -sfactor;\n const xc = 0.5 * (x0 + x1) - sfactor * (y1 - y0);\n const yc = 0.5 * (y0 + y1) + sfactor * (x1 - x0);\n const th0 = Math.atan2(y0 - yc, x0 - xc);\n const th1 = Math.atan2(y1 - yc, x1 - xc);\n let th_arc = th1 - th0;\n\n if (th_arc < 0 && sweep === 1) {\n th_arc += Tau;\n } else if (th_arc > 0 && sweep === 0) {\n th_arc -= Tau;\n }\n\n const segs = Math.ceil(Math.abs(th_arc / (HalfPi + 0.001)));\n const result = [];\n\n for (let i = 0; i < segs; ++i) {\n const th2 = th0 + i * th_arc / segs;\n const th3 = th0 + (i + 1) * th_arc / segs;\n result[i] = [xc, yc, th2, th3, rx, ry, sin_th, cos_th];\n }\n\n return segmentCache[key] = result;\n}\nfunction bezier(params) {\n const key = join.call(params);\n\n if (bezierCache[key]) {\n return bezierCache[key];\n }\n\n var cx = params[0],\n cy = params[1],\n th0 = params[2],\n th1 = params[3],\n rx = params[4],\n ry = params[5],\n sin_th = params[6],\n cos_th = params[7];\n const a00 = cos_th * rx;\n const a01 = -sin_th * ry;\n const a10 = sin_th * rx;\n const a11 = cos_th * ry;\n const cos_th0 = Math.cos(th0);\n const sin_th0 = Math.sin(th0);\n const cos_th1 = Math.cos(th1);\n const sin_th1 = Math.sin(th1);\n const th_half = 0.5 * (th1 - th0);\n const sin_th_h2 = Math.sin(th_half * 0.5);\n const t = 8 / 3 * sin_th_h2 * sin_th_h2 / Math.sin(th_half);\n const x1 = cx + cos_th0 - t * sin_th0;\n const y1 = cy + sin_th0 + t * cos_th0;\n const x3 = cx + cos_th1;\n const y3 = cy + sin_th1;\n const x2 = x3 + t * sin_th1;\n const y2 = y3 - t * cos_th1;\n return bezierCache[key] = [a00 * x1 + a01 * y1, a10 * x1 + a11 * y1, a00 * x2 + a01 * y2, a10 * x2 + a11 * y2, a00 * x3 + a01 * y3, a10 * x3 + a11 * y3];\n}\n\nconst temp = ['l', 0, 0, 0, 0, 0, 0, 0];\n\nfunction scale$1(current, sX, sY) {\n const c = temp[0] = current[0];\n\n if (c === 'a' || c === 'A') {\n temp[1] = sX * current[1];\n temp[2] = sY * current[2];\n temp[3] = current[3];\n temp[4] = current[4];\n temp[5] = current[5];\n temp[6] = sX * current[6];\n temp[7] = sY * current[7];\n } else if (c === 'h' || c === 'H') {\n temp[1] = sX * current[1];\n } else if (c === 'v' || c === 'V') {\n temp[1] = sY * current[1];\n } else {\n for (var i = 1, n = current.length; i < n; ++i) {\n temp[i] = (i % 2 == 1 ? sX : sY) * current[i];\n }\n }\n\n return temp;\n}\n\nfunction pathRender (context, path, l, t, sX, sY) {\n var current,\n // current instruction\n previous = null,\n x = 0,\n // current x\n y = 0,\n // current y\n controlX = 0,\n // current control point x\n controlY = 0,\n // current control point y\n tempX,\n tempY,\n tempControlX,\n tempControlY,\n anchorX = 0,\n anchorY = 0;\n if (l == null) l = 0;\n if (t == null) t = 0;\n if (sX == null) sX = 1;\n if (sY == null) sY = sX;\n if (context.beginPath) context.beginPath();\n\n for (var i = 0, len = path.length; i < len; ++i) {\n current = path[i];\n\n if (sX !== 1 || sY !== 1) {\n current = scale$1(current, sX, sY);\n }\n\n switch (current[0]) {\n // first letter\n case 'l':\n // lineto, relative\n x += current[1];\n y += current[2];\n context.lineTo(x + l, y + t);\n break;\n\n case 'L':\n // lineto, absolute\n x = current[1];\n y = current[2];\n context.lineTo(x + l, y + t);\n break;\n\n case 'h':\n // horizontal lineto, relative\n x += current[1];\n context.lineTo(x + l, y + t);\n break;\n\n case 'H':\n // horizontal lineto, absolute\n x = current[1];\n context.lineTo(x + l, y + t);\n break;\n\n case 'v':\n // vertical lineto, relative\n y += current[1];\n context.lineTo(x + l, y + t);\n break;\n\n case 'V':\n // verical lineto, absolute\n y = current[1];\n context.lineTo(x + l, y + t);\n break;\n\n case 'm':\n // moveTo, relative\n x += current[1];\n y += current[2];\n anchorX = x;\n anchorY = y;\n context.moveTo(x + l, y + t);\n break;\n\n case 'M':\n // moveTo, absolute\n x = current[1];\n y = current[2];\n anchorX = x;\n anchorY = y;\n context.moveTo(x + l, y + t);\n break;\n\n case 'c':\n // bezierCurveTo, relative\n tempX = x + current[5];\n tempY = y + current[6];\n controlX = x + current[3];\n controlY = y + current[4];\n context.bezierCurveTo(x + current[1] + l, // x1\n y + current[2] + t, // y1\n controlX + l, // x2\n controlY + t, // y2\n tempX + l, tempY + t);\n x = tempX;\n y = tempY;\n break;\n\n case 'C':\n // bezierCurveTo, absolute\n x = current[5];\n y = current[6];\n controlX = current[3];\n controlY = current[4];\n context.bezierCurveTo(current[1] + l, current[2] + t, controlX + l, controlY + t, x + l, y + t);\n break;\n\n case 's':\n // shorthand cubic bezierCurveTo, relative\n // transform to absolute x,y\n tempX = x + current[3];\n tempY = y + current[4]; // calculate reflection of previous control points\n\n controlX = 2 * x - controlX;\n controlY = 2 * y - controlY;\n context.bezierCurveTo(controlX + l, controlY + t, x + current[1] + l, y + current[2] + t, tempX + l, tempY + t); // set control point to 2nd one of this command\n // the first control point is assumed to be the reflection of\n // the second control point on the previous command relative\n // to the current point.\n\n controlX = x + current[1];\n controlY = y + current[2];\n x = tempX;\n y = tempY;\n break;\n\n case 'S':\n // shorthand cubic bezierCurveTo, absolute\n tempX = current[3];\n tempY = current[4]; // calculate reflection of previous control points\n\n controlX = 2 * x - controlX;\n controlY = 2 * y - controlY;\n context.bezierCurveTo(controlX + l, controlY + t, current[1] + l, current[2] + t, tempX + l, tempY + t);\n x = tempX;\n y = tempY; // set control point to 2nd one of this command\n // the first control point is assumed to be the reflection of\n // the second control point on the previous command relative\n // to the current point.\n\n controlX = current[1];\n controlY = current[2];\n break;\n\n case 'q':\n // quadraticCurveTo, relative\n // transform to absolute x,y\n tempX = x + current[3];\n tempY = y + current[4];\n controlX = x + current[1];\n controlY = y + current[2];\n context.quadraticCurveTo(controlX + l, controlY + t, tempX + l, tempY + t);\n x = tempX;\n y = tempY;\n break;\n\n case 'Q':\n // quadraticCurveTo, absolute\n tempX = current[3];\n tempY = current[4];\n context.quadraticCurveTo(current[1] + l, current[2] + t, tempX + l, tempY + t);\n x = tempX;\n y = tempY;\n controlX = current[1];\n controlY = current[2];\n break;\n\n case 't':\n // shorthand quadraticCurveTo, relative\n // transform to absolute x,y\n tempX = x + current[1];\n tempY = y + current[2];\n\n if (previous[0].match(/[QqTt]/) === null) {\n // If there is no previous command or if the previous command was not a Q, q, T or t,\n // assume the control point is coincident with the current point\n controlX = x;\n controlY = y;\n } else if (previous[0] === 't') {\n // calculate reflection of previous control points for t\n controlX = 2 * x - tempControlX;\n controlY = 2 * y - tempControlY;\n } else if (previous[0] === 'q') {\n // calculate reflection of previous control points for q\n controlX = 2 * x - controlX;\n controlY = 2 * y - controlY;\n }\n\n tempControlX = controlX;\n tempControlY = controlY;\n context.quadraticCurveTo(controlX + l, controlY + t, tempX + l, tempY + t);\n x = tempX;\n y = tempY;\n controlX = x + current[1];\n controlY = y + current[2];\n break;\n\n case 'T':\n tempX = current[1];\n tempY = current[2]; // calculate reflection of previous control points\n\n controlX = 2 * x - controlX;\n controlY = 2 * y - controlY;\n context.quadraticCurveTo(controlX + l, controlY + t, tempX + l, tempY + t);\n x = tempX;\n y = tempY;\n break;\n\n case 'a':\n drawArc(context, x + l, y + t, [current[1], current[2], current[3], current[4], current[5], current[6] + x + l, current[7] + y + t]);\n x += current[6];\n y += current[7];\n break;\n\n case 'A':\n drawArc(context, x + l, y + t, [current[1], current[2], current[3], current[4], current[5], current[6] + l, current[7] + t]);\n x = current[6];\n y = current[7];\n break;\n\n case 'z':\n case 'Z':\n x = anchorX;\n y = anchorY;\n context.closePath();\n break;\n }\n\n previous = current;\n }\n}\n\nfunction drawArc(context, x, y, coords) {\n const seg = segments(coords[5], // end x\n coords[6], // end y\n coords[0], // radius x\n coords[1], // radius y\n coords[3], // large flag\n coords[4], // sweep flag\n coords[2], // rotation\n x, y);\n\n for (let i = 0; i < seg.length; ++i) {\n const bez = bezier(seg[i]);\n context.bezierCurveTo(bez[0], bez[1], bez[2], bez[3], bez[4], bez[5]);\n }\n}\n\nconst Tan30 = 0.5773502691896257;\nconst builtins = {\n 'circle': {\n draw: function (context, size) {\n const r = Math.sqrt(size) / 2;\n context.moveTo(r, 0);\n context.arc(0, 0, r, 0, Tau);\n }\n },\n 'cross': {\n draw: function (context, size) {\n var r = Math.sqrt(size) / 2,\n s = r / 2.5;\n context.moveTo(-r, -s);\n context.lineTo(-r, s);\n context.lineTo(-s, s);\n context.lineTo(-s, r);\n context.lineTo(s, r);\n context.lineTo(s, s);\n context.lineTo(r, s);\n context.lineTo(r, -s);\n context.lineTo(s, -s);\n context.lineTo(s, -r);\n context.lineTo(-s, -r);\n context.lineTo(-s, -s);\n context.closePath();\n }\n },\n 'diamond': {\n draw: function (context, size) {\n const r = Math.sqrt(size) / 2;\n context.moveTo(-r, 0);\n context.lineTo(0, -r);\n context.lineTo(r, 0);\n context.lineTo(0, r);\n context.closePath();\n }\n },\n 'square': {\n draw: function (context, size) {\n var w = Math.sqrt(size),\n x = -w / 2;\n context.rect(x, x, w, w);\n }\n },\n 'arrow': {\n draw: function (context, size) {\n var r = Math.sqrt(size) / 2,\n s = r / 7,\n t = r / 2.5,\n v = r / 8;\n context.moveTo(-s, r);\n context.lineTo(s, r);\n context.lineTo(s, -v);\n context.lineTo(t, -v);\n context.lineTo(0, -r);\n context.lineTo(-t, -v);\n context.lineTo(-s, -v);\n context.closePath();\n }\n },\n 'wedge': {\n draw: function (context, size) {\n var r = Math.sqrt(size) / 2,\n h = HalfSqrt3 * r,\n o = h - r * Tan30,\n b = r / 4;\n context.moveTo(0, -h - o);\n context.lineTo(-b, h - o);\n context.lineTo(b, h - o);\n context.closePath();\n }\n },\n 'triangle': {\n draw: function (context, size) {\n var r = Math.sqrt(size) / 2,\n h = HalfSqrt3 * r,\n o = h - r * Tan30;\n context.moveTo(0, -h - o);\n context.lineTo(-r, h - o);\n context.lineTo(r, h - o);\n context.closePath();\n }\n },\n 'triangle-up': {\n draw: function (context, size) {\n var r = Math.sqrt(size) / 2,\n h = HalfSqrt3 * r;\n context.moveTo(0, -h);\n context.lineTo(-r, h);\n context.lineTo(r, h);\n context.closePath();\n }\n },\n 'triangle-down': {\n draw: function (context, size) {\n var r = Math.sqrt(size) / 2,\n h = HalfSqrt3 * r;\n context.moveTo(0, h);\n context.lineTo(-r, -h);\n context.lineTo(r, -h);\n context.closePath();\n }\n },\n 'triangle-right': {\n draw: function (context, size) {\n var r = Math.sqrt(size) / 2,\n h = HalfSqrt3 * r;\n context.moveTo(h, 0);\n context.lineTo(-h, -r);\n context.lineTo(-h, r);\n context.closePath();\n }\n },\n 'triangle-left': {\n draw: function (context, size) {\n var r = Math.sqrt(size) / 2,\n h = HalfSqrt3 * r;\n context.moveTo(-h, 0);\n context.lineTo(h, -r);\n context.lineTo(h, r);\n context.closePath();\n }\n },\n 'stroke': {\n draw: function (context, size) {\n const r = Math.sqrt(size) / 2;\n context.moveTo(-r, 0);\n context.lineTo(r, 0);\n }\n }\n};\nfunction symbols(_) {\n return hasOwnProperty(builtins, _) ? builtins[_] : customSymbol(_);\n}\nvar custom = {};\n\nfunction customSymbol(path) {\n if (!hasOwnProperty(custom, path)) {\n const parsed = parse(path);\n custom[path] = {\n draw: function (context, size) {\n pathRender(context, parsed, 0, 0, Math.sqrt(size) / 2);\n }\n };\n }\n\n return custom[path];\n}\n\nconst C = 0.448084975506; // C = 1 - c\n\nfunction rectangleX(d) {\n return d.x;\n}\n\nfunction rectangleY(d) {\n return d.y;\n}\n\nfunction rectangleWidth(d) {\n return d.width;\n}\n\nfunction rectangleHeight(d) {\n return d.height;\n}\n\nfunction number(_) {\n return typeof _ === 'function' ? _ : () => +_;\n}\n\nfunction clamp(value, min, max) {\n return Math.max(min, Math.min(value, max));\n}\n\nfunction vg_rect () {\n var x = rectangleX,\n y = rectangleY,\n width = rectangleWidth,\n height = rectangleHeight,\n crTL = number(0),\n crTR = crTL,\n crBL = crTL,\n crBR = crTL,\n context = null;\n\n function rectangle(_, x0, y0) {\n var buffer,\n x1 = x0 != null ? x0 : +x.call(this, _),\n y1 = y0 != null ? y0 : +y.call(this, _),\n w = +width.call(this, _),\n h = +height.call(this, _),\n s = Math.min(w, h) / 2,\n tl = clamp(+crTL.call(this, _), 0, s),\n tr = clamp(+crTR.call(this, _), 0, s),\n bl = clamp(+crBL.call(this, _), 0, s),\n br = clamp(+crBR.call(this, _), 0, s);\n if (!context) context = buffer = path$3();\n\n if (tl <= 0 && tr <= 0 && bl <= 0 && br <= 0) {\n context.rect(x1, y1, w, h);\n } else {\n var x2 = x1 + w,\n y2 = y1 + h;\n context.moveTo(x1 + tl, y1);\n context.lineTo(x2 - tr, y1);\n context.bezierCurveTo(x2 - C * tr, y1, x2, y1 + C * tr, x2, y1 + tr);\n context.lineTo(x2, y2 - br);\n context.bezierCurveTo(x2, y2 - C * br, x2 - C * br, y2, x2 - br, y2);\n context.lineTo(x1 + bl, y2);\n context.bezierCurveTo(x1 + C * bl, y2, x1, y2 - C * bl, x1, y2 - bl);\n context.lineTo(x1, y1 + tl);\n context.bezierCurveTo(x1, y1 + C * tl, x1 + C * tl, y1, x1 + tl, y1);\n context.closePath();\n }\n\n if (buffer) {\n context = null;\n return buffer + '' || null;\n }\n }\n\n rectangle.x = function (_) {\n if (arguments.length) {\n x = number(_);\n return rectangle;\n } else {\n return x;\n }\n };\n\n rectangle.y = function (_) {\n if (arguments.length) {\n y = number(_);\n return rectangle;\n } else {\n return y;\n }\n };\n\n rectangle.width = function (_) {\n if (arguments.length) {\n width = number(_);\n return rectangle;\n } else {\n return width;\n }\n };\n\n rectangle.height = function (_) {\n if (arguments.length) {\n height = number(_);\n return rectangle;\n } else {\n return height;\n }\n };\n\n rectangle.cornerRadius = function (tl, tr, br, bl) {\n if (arguments.length) {\n crTL = number(tl);\n crTR = tr != null ? number(tr) : crTL;\n crBR = br != null ? number(br) : crTL;\n crBL = bl != null ? number(bl) : crTR;\n return rectangle;\n } else {\n return crTL;\n }\n };\n\n rectangle.context = function (_) {\n if (arguments.length) {\n context = _ == null ? null : _;\n return rectangle;\n } else {\n return context;\n }\n };\n\n return rectangle;\n}\n\nfunction vg_trail () {\n var x,\n y,\n size,\n defined,\n context = null,\n ready,\n x1,\n y1,\n r1;\n\n function point(x2, y2, w2) {\n const r2 = w2 / 2;\n\n if (ready) {\n var ux = y1 - y2,\n uy = x2 - x1;\n\n if (ux || uy) {\n // get normal vector\n var ud = Math.sqrt(ux * ux + uy * uy),\n rx = (ux /= ud) * r1,\n ry = (uy /= ud) * r1,\n t = Math.atan2(uy, ux); // draw segment\n\n context.moveTo(x1 - rx, y1 - ry);\n context.lineTo(x2 - ux * r2, y2 - uy * r2);\n context.arc(x2, y2, r2, t - Math.PI, t);\n context.lineTo(x1 + rx, y1 + ry);\n context.arc(x1, y1, r1, t, t + Math.PI);\n } else {\n context.arc(x2, y2, r2, 0, Tau);\n }\n\n context.closePath();\n } else {\n ready = 1;\n }\n\n x1 = x2;\n y1 = y2;\n r1 = r2;\n }\n\n function trail(data) {\n var i,\n n = data.length,\n d,\n defined0 = false,\n buffer;\n if (context == null) context = buffer = path$3();\n\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) ready = 0;\n }\n\n if (defined0) point(+x(d, i, data), +y(d, i, data), +size(d, i, data));\n }\n\n if (buffer) {\n context = null;\n return buffer + '' || null;\n }\n }\n\n trail.x = function (_) {\n if (arguments.length) {\n x = _;\n return trail;\n } else {\n return x;\n }\n };\n\n trail.y = function (_) {\n if (arguments.length) {\n y = _;\n return trail;\n } else {\n return y;\n }\n };\n\n trail.size = function (_) {\n if (arguments.length) {\n size = _;\n return trail;\n } else {\n return size;\n }\n };\n\n trail.defined = function (_) {\n if (arguments.length) {\n defined = _;\n return trail;\n } else {\n return defined;\n }\n };\n\n trail.context = function (_) {\n if (arguments.length) {\n if (_ == null) {\n context = null;\n } else {\n context = _;\n }\n\n return trail;\n } else {\n return context;\n }\n };\n\n return trail;\n}\n\nfunction value$1(a, b) {\n return a != null ? a : b;\n}\n\nconst x = item => item.x || 0,\n y = item => item.y || 0,\n w = item => item.width || 0,\n h = item => item.height || 0,\n xw = item => (item.x || 0) + (item.width || 0),\n yh = item => (item.y || 0) + (item.height || 0),\n sa = item => item.startAngle || 0,\n ea = item => item.endAngle || 0,\n pa = item => item.padAngle || 0,\n ir = item => item.innerRadius || 0,\n or = item => item.outerRadius || 0,\n cr = item => item.cornerRadius || 0,\n tl = item => value$1(item.cornerRadiusTopLeft, item.cornerRadius) || 0,\n tr = item => value$1(item.cornerRadiusTopRight, item.cornerRadius) || 0,\n br = item => value$1(item.cornerRadiusBottomRight, item.cornerRadius) || 0,\n bl = item => value$1(item.cornerRadiusBottomLeft, item.cornerRadius) || 0,\n sz = item => value$1(item.size, 64),\n ts = item => item.size || 1,\n def = item => !(item.defined === false),\n type = item => symbols(item.shape || 'circle');\n\nconst arcShape = arc$2().startAngle(sa).endAngle(ea).padAngle(pa).innerRadius(ir).outerRadius(or).cornerRadius(cr),\n areavShape = area$2().x(x).y1(y).y0(yh).defined(def),\n areahShape = area$2().y(y).x1(x).x0(xw).defined(def),\n lineShape = line$2().x(x).y(y).defined(def),\n rectShape = vg_rect().x(x).y(y).width(w).height(h).cornerRadius(tl, tr, br, bl),\n symbolShape = symbol$2().type(type).size(sz),\n trailShape = vg_trail().x(x).y(y).defined(def).size(ts);\nfunction hasCornerRadius(item) {\n return item.cornerRadius || item.cornerRadiusTopLeft || item.cornerRadiusTopRight || item.cornerRadiusBottomRight || item.cornerRadiusBottomLeft;\n}\nfunction arc$1(context, item) {\n return arcShape.context(context)(item);\n}\nfunction area$1(context, items) {\n const item = items[0],\n interp = item.interpolate || 'linear';\n return (item.orient === 'horizontal' ? areahShape : areavShape).curve(curves(interp, item.orient, item.tension)).context(context)(items);\n}\nfunction line$1(context, items) {\n const item = items[0],\n interp = item.interpolate || 'linear';\n return lineShape.curve(curves(interp, item.orient, item.tension)).context(context)(items);\n}\nfunction rectangle(context, item, x, y) {\n return rectShape.context(context)(item, x, y);\n}\nfunction shape$1(context, item) {\n return (item.mark.shape || item.shape).context(context)(item);\n}\nfunction symbol$1(context, item) {\n return symbolShape.context(context)(item);\n}\nfunction trail$1(context, items) {\n return trailShape.context(context)(items);\n}\n\nvar clip_id = 1;\nfunction resetSVGClipId() {\n clip_id = 1;\n}\nfunction clip$1 (renderer, item, size) {\n var clip = item.clip,\n defs = renderer._defs,\n id = item.clip_id || (item.clip_id = 'clip' + clip_id++),\n c = defs.clipping[id] || (defs.clipping[id] = {\n id: id\n });\n\n if (isFunction(clip)) {\n c.path = clip(null);\n } else if (hasCornerRadius(size)) {\n c.path = rectangle(null, size, 0, 0);\n } else {\n c.width = size.width || 0;\n c.height = size.height || 0;\n }\n\n return 'url(#' + id + ')';\n}\n\nfunction Bounds(b) {\n this.clear();\n if (b) this.union(b);\n}\nBounds.prototype = {\n clone() {\n return new Bounds(this);\n },\n\n clear() {\n this.x1 = +Number.MAX_VALUE;\n this.y1 = +Number.MAX_VALUE;\n this.x2 = -Number.MAX_VALUE;\n this.y2 = -Number.MAX_VALUE;\n return this;\n },\n\n empty() {\n return this.x1 === +Number.MAX_VALUE && this.y1 === +Number.MAX_VALUE && this.x2 === -Number.MAX_VALUE && this.y2 === -Number.MAX_VALUE;\n },\n\n equals(b) {\n return this.x1 === b.x1 && this.y1 === b.y1 && this.x2 === b.x2 && this.y2 === b.y2;\n },\n\n set(x1, y1, x2, y2) {\n if (x2 < x1) {\n this.x2 = x1;\n this.x1 = x2;\n } else {\n this.x1 = x1;\n this.x2 = x2;\n }\n\n if (y2 < y1) {\n this.y2 = y1;\n this.y1 = y2;\n } else {\n this.y1 = y1;\n this.y2 = y2;\n }\n\n return this;\n },\n\n add(x, y) {\n if (x < this.x1) this.x1 = x;\n if (y < this.y1) this.y1 = y;\n if (x > this.x2) this.x2 = x;\n if (y > this.y2) this.y2 = y;\n return this;\n },\n\n expand(d) {\n this.x1 -= d;\n this.y1 -= d;\n this.x2 += d;\n this.y2 += d;\n return this;\n },\n\n round() {\n this.x1 = Math.floor(this.x1);\n this.y1 = Math.floor(this.y1);\n this.x2 = Math.ceil(this.x2);\n this.y2 = Math.ceil(this.y2);\n return this;\n },\n\n scale(s) {\n this.x1 *= s;\n this.y1 *= s;\n this.x2 *= s;\n this.y2 *= s;\n return this;\n },\n\n translate(dx, dy) {\n this.x1 += dx;\n this.x2 += dx;\n this.y1 += dy;\n this.y2 += dy;\n return this;\n },\n\n rotate(angle, x, y) {\n const p = this.rotatedPoints(angle, x, y);\n return this.clear().add(p[0], p[1]).add(p[2], p[3]).add(p[4], p[5]).add(p[6], p[7]);\n },\n\n rotatedPoints(angle, x, y) {\n var {\n x1,\n y1,\n x2,\n y2\n } = this,\n cos = Math.cos(angle),\n sin = Math.sin(angle),\n cx = x - x * cos + y * sin,\n cy = y - x * sin - y * cos;\n return [cos * x1 - sin * y1 + cx, sin * x1 + cos * y1 + cy, cos * x1 - sin * y2 + cx, sin * x1 + cos * y2 + cy, cos * x2 - sin * y1 + cx, sin * x2 + cos * y1 + cy, cos * x2 - sin * y2 + cx, sin * x2 + cos * y2 + cy];\n },\n\n union(b) {\n if (b.x1 < this.x1) this.x1 = b.x1;\n if (b.y1 < this.y1) this.y1 = b.y1;\n if (b.x2 > this.x2) this.x2 = b.x2;\n if (b.y2 > this.y2) this.y2 = b.y2;\n return this;\n },\n\n intersect(b) {\n if (b.x1 > this.x1) this.x1 = b.x1;\n if (b.y1 > this.y1) this.y1 = b.y1;\n if (b.x2 < this.x2) this.x2 = b.x2;\n if (b.y2 < this.y2) this.y2 = b.y2;\n return this;\n },\n\n encloses(b) {\n return b && this.x1 <= b.x1 && this.x2 >= b.x2 && this.y1 <= b.y1 && this.y2 >= b.y2;\n },\n\n alignsWith(b) {\n return b && (this.x1 == b.x1 || this.x2 == b.x2 || this.y1 == b.y1 || this.y2 == b.y2);\n },\n\n intersects(b) {\n return b && !(this.x2 < b.x1 || this.x1 > b.x2 || this.y2 < b.y1 || this.y1 > b.y2);\n },\n\n contains(x, y) {\n return !(x < this.x1 || x > this.x2 || y < this.y1 || y > this.y2);\n },\n\n width() {\n return this.x2 - this.x1;\n },\n\n height() {\n return this.y2 - this.y1;\n }\n\n};\n\nfunction Item(mark) {\n this.mark = mark;\n this.bounds = this.bounds || new Bounds();\n}\n\nfunction GroupItem(mark) {\n Item.call(this, mark);\n this.items = this.items || [];\n}\ninherits(GroupItem, Item);\n\nfunction ResourceLoader(customLoader) {\n this._pending = 0;\n this._loader = customLoader || loader();\n}\n\nfunction increment(loader) {\n loader._pending += 1;\n}\n\nfunction decrement(loader) {\n loader._pending -= 1;\n}\n\nResourceLoader.prototype = {\n pending() {\n return this._pending;\n },\n\n sanitizeURL(uri) {\n const loader = this;\n increment(loader);\n return loader._loader.sanitize(uri, {\n context: 'href'\n }).then(opt => {\n decrement(loader);\n return opt;\n }).catch(() => {\n decrement(loader);\n return null;\n });\n },\n\n loadImage(uri) {\n const loader = this,\n Image = image$1();\n increment(loader);\n return loader._loader.sanitize(uri, {\n context: 'image'\n }).then(opt => {\n const url = opt.href;\n if (!url || !Image) throw {\n url: url\n };\n const img = new Image(); // set crossOrigin only if cors is defined; empty string sets anonymous mode\n // https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/crossOrigin\n\n const cors = hasOwnProperty(opt, 'crossOrigin') ? opt.crossOrigin : 'anonymous';\n if (cors != null) img.crossOrigin = cors; // attempt to load image resource\n\n img.onload = () => decrement(loader);\n\n img.onerror = () => decrement(loader);\n\n img.src = url;\n return img;\n }).catch(e => {\n decrement(loader);\n return {\n complete: false,\n width: 0,\n height: 0,\n src: e && e.url || ''\n };\n });\n },\n\n ready() {\n const loader = this;\n return new Promise(accept => {\n function poll(value) {\n if (!loader.pending()) accept(value);else setTimeout(() => {\n poll(true);\n }, 10);\n }\n\n poll(false);\n });\n }\n\n};\n\nfunction boundStroke (bounds, item, miter) {\n if (item.stroke && item.opacity !== 0 && item.strokeOpacity !== 0) {\n const sw = item.strokeWidth != null ? +item.strokeWidth : 1;\n bounds.expand(sw + (miter ? miterAdjustment(item, sw) : 0));\n }\n\n return bounds;\n}\n\nfunction miterAdjustment(item, strokeWidth) {\n // TODO: more sophisticated adjustment? Or miter support in boundContext?\n return item.strokeJoin && item.strokeJoin !== 'miter' ? 0 : strokeWidth;\n}\n\nconst circleThreshold = Tau - 1e-8;\nlet bounds, lx, ly, rot, ma, mb, mc, md;\n\nconst add = (x, y) => bounds.add(x, y);\n\nconst addL = (x, y) => add(lx = x, ly = y);\n\nconst addX = x => add(x, bounds.y1);\n\nconst addY = y => add(bounds.x1, y);\n\nconst px = (x, y) => ma * x + mc * y;\n\nconst py = (x, y) => mb * x + md * y;\n\nconst addp = (x, y) => add(px(x, y), py(x, y));\n\nconst addpL = (x, y) => addL(px(x, y), py(x, y));\n\nfunction boundContext (_, deg) {\n bounds = _;\n\n if (deg) {\n rot = deg * DegToRad;\n ma = md = Math.cos(rot);\n mb = Math.sin(rot);\n mc = -mb;\n } else {\n ma = md = 1;\n rot = mb = mc = 0;\n }\n\n return context$1;\n}\nconst context$1 = {\n beginPath() {},\n\n closePath() {},\n\n moveTo: addpL,\n lineTo: addpL,\n\n rect(x, y, w, h) {\n if (rot) {\n addp(x + w, y);\n addp(x + w, y + h);\n addp(x, y + h);\n addpL(x, y);\n } else {\n add(x + w, y + h);\n addL(x, y);\n }\n },\n\n quadraticCurveTo(x1, y1, x2, y2) {\n const px1 = px(x1, y1),\n py1 = py(x1, y1),\n px2 = px(x2, y2),\n py2 = py(x2, y2);\n quadExtrema(lx, px1, px2, addX);\n quadExtrema(ly, py1, py2, addY);\n addL(px2, py2);\n },\n\n bezierCurveTo(x1, y1, x2, y2, x3, y3) {\n const px1 = px(x1, y1),\n py1 = py(x1, y1),\n px2 = px(x2, y2),\n py2 = py(x2, y2),\n px3 = px(x3, y3),\n py3 = py(x3, y3);\n cubicExtrema(lx, px1, px2, px3, addX);\n cubicExtrema(ly, py1, py2, py3, addY);\n addL(px3, py3);\n },\n\n arc(cx, cy, r, sa, ea, ccw) {\n sa += rot;\n ea += rot; // store last point on path\n\n lx = r * Math.cos(ea) + cx;\n ly = r * Math.sin(ea) + cy;\n\n if (Math.abs(ea - sa) > circleThreshold) {\n // treat as full circle\n add(cx - r, cy - r);\n add(cx + r, cy + r);\n } else {\n const update = a => add(r * Math.cos(a) + cx, r * Math.sin(a) + cy);\n\n let s, i; // sample end points\n\n update(sa);\n update(ea); // sample interior points aligned with 90 degrees\n\n if (ea !== sa) {\n sa = sa % Tau;\n if (sa < 0) sa += Tau;\n ea = ea % Tau;\n if (ea < 0) ea += Tau;\n\n if (ea < sa) {\n ccw = !ccw; // flip direction\n\n s = sa;\n sa = ea;\n ea = s; // swap end-points\n }\n\n if (ccw) {\n ea -= Tau;\n s = sa - sa % HalfPi;\n\n for (i = 0; i < 4 && s > ea; ++i, s -= HalfPi) update(s);\n } else {\n s = sa - sa % HalfPi + HalfPi;\n\n for (i = 0; i < 4 && s < ea; ++i, s = s + HalfPi) update(s);\n }\n }\n }\n }\n\n};\n\nfunction quadExtrema(x0, x1, x2, cb) {\n const t = (x0 - x1) / (x0 + x2 - 2 * x1);\n if (0 < t && t < 1) cb(x0 + (x1 - x0) * t);\n}\n\nfunction cubicExtrema(x0, x1, x2, x3, cb) {\n const a = x3 - x0 + 3 * x1 - 3 * x2,\n b = x0 + x2 - 2 * x1,\n c = x0 - x1;\n let t0 = 0,\n t1 = 0,\n r; // solve for parameter t\n\n if (Math.abs(a) > Epsilon) {\n // quadratic equation\n r = b * b + c * a;\n\n if (r >= 0) {\n r = Math.sqrt(r);\n t0 = (-b + r) / a;\n t1 = (-b - r) / a;\n }\n } else {\n // linear equation\n t0 = 0.5 * c / b;\n } // calculate position\n\n\n if (0 < t0 && t0 < 1) cb(cubic(t0, x0, x1, x2, x3));\n if (0 < t1 && t1 < 1) cb(cubic(t1, x0, x1, x2, x3));\n}\n\nfunction cubic(t, x0, x1, x2, x3) {\n const s = 1 - t,\n s2 = s * s,\n t2 = t * t;\n return s2 * s * x0 + 3 * s2 * t * x1 + 3 * s * t2 * x2 + t2 * t * x3;\n}\n\nvar context = (context = canvas(1, 1)) ? context.getContext('2d') : null;\n\nconst b = new Bounds();\nfunction intersectPath(draw) {\n return function (item, brush) {\n // rely on (inaccurate) bounds intersection if no context\n if (!context) return true; // add path to offscreen graphics context\n\n draw(context, item); // get bounds intersection region\n\n b.clear().union(item.bounds).intersect(brush).round();\n const {\n x1,\n y1,\n x2,\n y2\n } = b; // iterate over intersection region\n // perform fine grained inclusion test\n\n for (let y = y1; y <= y2; ++y) {\n for (let x = x1; x <= x2; ++x) {\n if (context.isPointInPath(x, y)) {\n return true;\n }\n }\n } // false if no hits in intersection region\n\n\n return false;\n };\n}\nfunction intersectPoint(item, box) {\n return box.contains(item.x || 0, item.y || 0);\n}\nfunction intersectRect(item, box) {\n const x = item.x || 0,\n y = item.y || 0,\n w = item.width || 0,\n h = item.height || 0;\n return box.intersects(b.set(x, y, x + w, y + h));\n}\nfunction intersectRule(item, box) {\n const x = item.x || 0,\n y = item.y || 0,\n x2 = item.x2 != null ? item.x2 : x,\n y2 = item.y2 != null ? item.y2 : y;\n return intersectBoxLine(box, x, y, x2, y2);\n}\nfunction intersectBoxLine(box, x, y, u, v) {\n const {\n x1,\n y1,\n x2,\n y2\n } = box,\n dx = u - x,\n dy = v - y;\n let t0 = 0,\n t1 = 1,\n p,\n q,\n r,\n e;\n\n for (e = 0; e < 4; ++e) {\n if (e === 0) {\n p = -dx;\n q = -(x1 - x);\n }\n\n if (e === 1) {\n p = dx;\n q = x2 - x;\n }\n\n if (e === 2) {\n p = -dy;\n q = -(y1 - y);\n }\n\n if (e === 3) {\n p = dy;\n q = y2 - y;\n }\n\n if (Math.abs(p) < 1e-10 && q < 0) return false;\n r = q / p;\n\n if (p < 0) {\n if (r > t1) return false;else if (r > t0) t0 = r;\n } else if (p > 0) {\n if (r < t0) return false;else if (r < t1) t1 = r;\n }\n }\n\n return true;\n}\n\nfunction blend (context, item) {\n context.globalCompositeOperation = item.blend || 'source-over';\n}\n\nfunction value (value, dflt) {\n return value == null ? dflt : value;\n}\n\nfunction addStops(gradient, stops) {\n const n = stops.length;\n\n for (let i = 0; i < n; ++i) {\n gradient.addColorStop(stops[i].offset, stops[i].color);\n }\n\n return gradient;\n}\n\nfunction gradient (context, spec, bounds) {\n const w = bounds.width(),\n h = bounds.height();\n let gradient;\n\n if (spec.gradient === 'radial') {\n gradient = context.createRadialGradient(bounds.x1 + value(spec.x1, 0.5) * w, bounds.y1 + value(spec.y1, 0.5) * h, Math.max(w, h) * value(spec.r1, 0), bounds.x1 + value(spec.x2, 0.5) * w, bounds.y1 + value(spec.y2, 0.5) * h, Math.max(w, h) * value(spec.r2, 0.5));\n } else {\n // linear gradient\n const x1 = value(spec.x1, 0),\n y1 = value(spec.y1, 0),\n x2 = value(spec.x2, 1),\n y2 = value(spec.y2, 0);\n\n if (x1 === x2 || y1 === y2 || w === h) {\n // axis aligned: use normal gradient\n gradient = context.createLinearGradient(bounds.x1 + x1 * w, bounds.y1 + y1 * h, bounds.x1 + x2 * w, bounds.y1 + y2 * h);\n } else {\n // not axis aligned: render gradient into a pattern (#2365)\n // this allows us to use normalized bounding box coordinates\n const image = canvas(Math.ceil(w), Math.ceil(h)),\n ictx = image.getContext('2d');\n ictx.scale(w, h);\n ictx.fillStyle = addStops(ictx.createLinearGradient(x1, y1, x2, y2), spec.stops);\n ictx.fillRect(0, 0, w, h);\n return context.createPattern(image, 'no-repeat');\n }\n }\n\n return addStops(gradient, spec.stops);\n}\n\nfunction color (context, item, value) {\n return isGradient(value) ? gradient(context, value, item.bounds) : value;\n}\n\nfunction fill (context, item, opacity) {\n opacity *= item.fillOpacity == null ? 1 : item.fillOpacity;\n\n if (opacity > 0) {\n context.globalAlpha = opacity;\n context.fillStyle = color(context, item, item.fill);\n return true;\n } else {\n return false;\n }\n}\n\nvar Empty = [];\nfunction stroke (context, item, opacity) {\n var lw = (lw = item.strokeWidth) != null ? lw : 1;\n if (lw <= 0) return false;\n opacity *= item.strokeOpacity == null ? 1 : item.strokeOpacity;\n\n if (opacity > 0) {\n context.globalAlpha = opacity;\n context.strokeStyle = color(context, item, item.stroke);\n context.lineWidth = lw;\n context.lineCap = item.strokeCap || 'butt';\n context.lineJoin = item.strokeJoin || 'miter';\n context.miterLimit = item.strokeMiterLimit || 10;\n\n if (context.setLineDash) {\n context.setLineDash(item.strokeDash || Empty);\n context.lineDashOffset = item.strokeDashOffset || 0;\n }\n\n return true;\n } else {\n return false;\n }\n}\n\nfunction compare(a, b) {\n return a.zindex - b.zindex || a.index - b.index;\n}\n\nfunction zorder(scene) {\n if (!scene.zdirty) return scene.zitems;\n var items = scene.items,\n output = [],\n item,\n i,\n n;\n\n for (i = 0, n = items.length; i < n; ++i) {\n item = items[i];\n item.index = i;\n if (item.zindex) output.push(item);\n }\n\n scene.zdirty = false;\n return scene.zitems = output.sort(compare);\n}\nfunction visit(scene, visitor) {\n var items = scene.items,\n i,\n n;\n if (!items || !items.length) return;\n const zitems = zorder(scene);\n\n if (zitems && zitems.length) {\n for (i = 0, n = items.length; i < n; ++i) {\n if (!items[i].zindex) visitor(items[i]);\n }\n\n items = zitems;\n }\n\n for (i = 0, n = items.length; i < n; ++i) {\n visitor(items[i]);\n }\n}\nfunction pickVisit(scene, visitor) {\n var items = scene.items,\n hit,\n i;\n if (!items || !items.length) return null;\n const zitems = zorder(scene);\n if (zitems && zitems.length) items = zitems;\n\n for (i = items.length; --i >= 0;) {\n if (hit = visitor(items[i])) return hit;\n }\n\n if (items === zitems) {\n for (items = scene.items, i = items.length; --i >= 0;) {\n if (!items[i].zindex) {\n if (hit = visitor(items[i])) return hit;\n }\n }\n }\n\n return null;\n}\n\nfunction drawAll(path) {\n return function (context, scene, bounds) {\n visit(scene, item => {\n if (!bounds || bounds.intersects(item.bounds)) {\n drawPath(path, context, item, item);\n }\n });\n };\n}\nfunction drawOne(path) {\n return function (context, scene, bounds) {\n if (scene.items.length && (!bounds || bounds.intersects(scene.bounds))) {\n drawPath(path, context, scene.items[0], scene.items);\n }\n };\n}\n\nfunction drawPath(path, context, item, items) {\n var opacity = item.opacity == null ? 1 : item.opacity;\n if (opacity === 0) return;\n if (path(context, items)) return;\n blend(context, item);\n\n if (item.fill && fill(context, item, opacity)) {\n context.fill();\n }\n\n if (item.stroke && stroke(context, item, opacity)) {\n context.stroke();\n }\n}\n\nfunction pick$1(test) {\n test = test || truthy;\n return function (context, scene, x, y, gx, gy) {\n x *= context.pixelRatio;\n y *= context.pixelRatio;\n return pickVisit(scene, item => {\n const b = item.bounds; // first hit test against bounding box\n\n if (b && !b.contains(gx, gy) || !b) return; // if in bounding box, perform more careful test\n\n if (test(context, item, x, y, gx, gy)) return item;\n });\n };\n}\nfunction hitPath(path, filled) {\n return function (context, o, x, y) {\n var item = Array.isArray(o) ? o[0] : o,\n fill = filled == null ? item.fill : filled,\n stroke = item.stroke && context.isPointInStroke,\n lw,\n lc;\n\n if (stroke) {\n lw = item.strokeWidth;\n lc = item.strokeCap;\n context.lineWidth = lw != null ? lw : 1;\n context.lineCap = lc != null ? lc : 'butt';\n }\n\n return path(context, o) ? false : fill && context.isPointInPath(x, y) || stroke && context.isPointInStroke(x, y);\n };\n}\nfunction pickPath(path) {\n return pick$1(hitPath(path));\n}\n\nfunction translate(x, y) {\n return 'translate(' + x + ',' + y + ')';\n}\nfunction rotate(a) {\n return 'rotate(' + a + ')';\n}\nfunction scale(scaleX, scaleY) {\n return 'scale(' + scaleX + ',' + scaleY + ')';\n}\nfunction translateItem(item) {\n return translate(item.x || 0, item.y || 0);\n}\nfunction rotateItem(item) {\n return translate(item.x || 0, item.y || 0) + (item.angle ? ' ' + rotate(item.angle) : '');\n}\nfunction transformItem(item) {\n return translate(item.x || 0, item.y || 0) + (item.angle ? ' ' + rotate(item.angle) : '') + (item.scaleX || item.scaleY ? ' ' + scale(item.scaleX || 1, item.scaleY || 1) : '');\n}\n\nfunction markItemPath (type, shape, isect) {\n function attr(emit, item) {\n emit('transform', rotateItem(item));\n emit('d', shape(null, item));\n }\n\n function bound(bounds, item) {\n shape(boundContext(bounds, item.angle), item);\n return boundStroke(bounds, item).translate(item.x || 0, item.y || 0);\n }\n\n function draw(context, item) {\n var x = item.x || 0,\n y = item.y || 0,\n a = item.angle || 0;\n context.translate(x, y);\n if (a) context.rotate(a *= DegToRad);\n context.beginPath();\n shape(context, item);\n if (a) context.rotate(-a);\n context.translate(-x, -y);\n }\n\n return {\n type: type,\n tag: 'path',\n nested: false,\n attr: attr,\n bound: bound,\n draw: drawAll(draw),\n pick: pickPath(draw),\n isect: isect || intersectPath(draw)\n };\n}\n\nvar arc = markItemPath('arc', arc$1);\n\nfunction pickArea(a, p) {\n var v = a[0].orient === 'horizontal' ? p[1] : p[0],\n z = a[0].orient === 'horizontal' ? 'y' : 'x',\n i = a.length,\n min = +Infinity,\n hit,\n d;\n\n while (--i >= 0) {\n if (a[i].defined === false) continue;\n d = Math.abs(a[i][z] - v);\n\n if (d < min) {\n min = d;\n hit = a[i];\n }\n }\n\n return hit;\n}\nfunction pickLine(a, p) {\n var t = Math.pow(a[0].strokeWidth || 1, 2),\n i = a.length,\n dx,\n dy,\n dd;\n\n while (--i >= 0) {\n if (a[i].defined === false) continue;\n dx = a[i].x - p[0];\n dy = a[i].y - p[1];\n dd = dx * dx + dy * dy;\n if (dd < t) return a[i];\n }\n\n return null;\n}\nfunction pickTrail(a, p) {\n var i = a.length,\n dx,\n dy,\n dd;\n\n while (--i >= 0) {\n if (a[i].defined === false) continue;\n dx = a[i].x - p[0];\n dy = a[i].y - p[1];\n dd = dx * dx + dy * dy;\n dx = a[i].size || 1;\n if (dd < dx * dx) return a[i];\n }\n\n return null;\n}\n\nfunction markMultiItemPath (type, shape, tip) {\n function attr(emit, item) {\n var items = item.mark.items;\n if (items.length) emit('d', shape(null, items));\n }\n\n function bound(bounds, mark) {\n var items = mark.items;\n\n if (items.length === 0) {\n return bounds;\n } else {\n shape(boundContext(bounds), items);\n return boundStroke(bounds, items[0]);\n }\n }\n\n function draw(context, items) {\n context.beginPath();\n shape(context, items);\n }\n\n const hit = hitPath(draw);\n\n function pick(context, scene, x, y, gx, gy) {\n var items = scene.items,\n b = scene.bounds;\n\n if (!items || !items.length || b && !b.contains(gx, gy)) {\n return null;\n }\n\n x *= context.pixelRatio;\n y *= context.pixelRatio;\n return hit(context, items, x, y) ? items[0] : null;\n }\n\n return {\n type: type,\n tag: 'path',\n nested: true,\n attr: attr,\n bound: bound,\n draw: drawOne(draw),\n pick: pick,\n isect: intersectPoint,\n tip: tip\n };\n}\n\nvar area = markMultiItemPath('area', area$1, pickArea);\n\nfunction clip (context, scene) {\n var clip = scene.clip;\n context.save();\n\n if (isFunction(clip)) {\n context.beginPath();\n clip(context);\n context.clip();\n } else {\n clipGroup(context, scene.group);\n }\n}\nfunction clipGroup(context, group) {\n context.beginPath();\n hasCornerRadius(group) ? rectangle(context, group, 0, 0) : context.rect(0, 0, group.width || 0, group.height || 0);\n context.clip();\n}\n\nfunction offset$1(item) {\n const sw = value(item.strokeWidth, 1);\n return item.strokeOffset != null ? item.strokeOffset : item.stroke && sw > 0.5 && sw < 1.5 ? 0.5 - Math.abs(sw - 1) : 0;\n}\n\nfunction attr$5(emit, item) {\n emit('transform', translateItem(item));\n}\n\nfunction emitRectangle(emit, item) {\n const off = offset$1(item);\n emit('d', rectangle(null, item, off, off));\n}\n\nfunction background(emit, item) {\n emit('class', 'background');\n emit('aria-hidden', true);\n emitRectangle(emit, item);\n}\n\nfunction foreground(emit, item) {\n emit('class', 'foreground');\n emit('aria-hidden', true);\n\n if (item.strokeForeground) {\n emitRectangle(emit, item);\n } else {\n emit('d', '');\n }\n}\n\nfunction content(emit, item, renderer) {\n const url = item.clip ? clip$1(renderer, item, item) : null;\n emit('clip-path', url);\n}\n\nfunction bound$5(bounds, group) {\n if (!group.clip && group.items) {\n const items = group.items,\n m = items.length;\n\n for (let j = 0; j < m; ++j) {\n bounds.union(items[j].bounds);\n }\n }\n\n if ((group.clip || group.width || group.height) && !group.noBound) {\n bounds.add(0, 0).add(group.width || 0, group.height || 0);\n }\n\n boundStroke(bounds, group);\n return bounds.translate(group.x || 0, group.y || 0);\n}\n\nfunction rectanglePath(context, group, x, y) {\n const off = offset$1(group);\n context.beginPath();\n rectangle(context, group, (x || 0) + off, (y || 0) + off);\n}\n\nconst hitBackground = hitPath(rectanglePath);\nconst hitForeground = hitPath(rectanglePath, false);\nconst hitCorner = hitPath(rectanglePath, true);\n\nfunction draw$4(context, scene, bounds) {\n visit(scene, group => {\n const gx = group.x || 0,\n gy = group.y || 0,\n fore = group.strokeForeground,\n opacity = group.opacity == null ? 1 : group.opacity; // draw group background\n\n if ((group.stroke || group.fill) && opacity) {\n rectanglePath(context, group, gx, gy);\n blend(context, group);\n\n if (group.fill && fill(context, group, opacity)) {\n context.fill();\n }\n\n if (group.stroke && !fore && stroke(context, group, opacity)) {\n context.stroke();\n }\n } // setup graphics context, set clip and bounds\n\n\n context.save();\n context.translate(gx, gy);\n if (group.clip) clipGroup(context, group);\n if (bounds) bounds.translate(-gx, -gy); // draw group contents\n\n visit(group, item => {\n this.draw(context, item, bounds);\n }); // restore graphics context\n\n if (bounds) bounds.translate(gx, gy);\n context.restore(); // draw group foreground\n\n if (fore && group.stroke && opacity) {\n rectanglePath(context, group, gx, gy);\n blend(context, group);\n\n if (stroke(context, group, opacity)) {\n context.stroke();\n }\n }\n });\n}\n\nfunction pick(context, scene, x, y, gx, gy) {\n if (scene.bounds && !scene.bounds.contains(gx, gy) || !scene.items) {\n return null;\n }\n\n const cx = x * context.pixelRatio,\n cy = y * context.pixelRatio;\n return pickVisit(scene, group => {\n let hit, dx, dy; // first hit test bounding box\n\n const b = group.bounds;\n if (b && !b.contains(gx, gy)) return; // passed bounds check, test rectangular clip\n\n dx = group.x || 0;\n dy = group.y || 0;\n const dw = dx + (group.width || 0),\n dh = dy + (group.height || 0),\n c = group.clip;\n if (c && (gx < dx || gx > dw || gy < dy || gy > dh)) return; // adjust coordinate system\n\n context.save();\n context.translate(dx, dy);\n dx = gx - dx;\n dy = gy - dy; // test background for rounded corner clip\n\n if (c && hasCornerRadius(group) && !hitCorner(context, group, cx, cy)) {\n context.restore();\n return null;\n }\n\n const fore = group.strokeForeground,\n ix = scene.interactive !== false; // hit test against group foreground\n\n if (ix && fore && group.stroke && hitForeground(context, group, cx, cy)) {\n context.restore();\n return group;\n } // hit test against contained marks\n\n\n hit = pickVisit(group, mark => pickMark(mark, dx, dy) ? this.pick(mark, x, y, dx, dy) : null); // hit test against group background\n\n if (!hit && ix && (group.fill || !fore && group.stroke) && hitBackground(context, group, cx, cy)) {\n hit = group;\n } // restore state and return\n\n\n context.restore();\n return hit || null;\n });\n}\n\nfunction pickMark(mark, x, y) {\n return (mark.interactive !== false || mark.marktype === 'group') && mark.bounds && mark.bounds.contains(x, y);\n}\n\nvar group = {\n type: 'group',\n tag: 'g',\n nested: false,\n attr: attr$5,\n bound: bound$5,\n draw: draw$4,\n pick: pick,\n isect: intersectRect,\n content: content,\n background: background,\n foreground: foreground\n};\n\nvar metadata = {\n 'xmlns': 'http://www.w3.org/2000/svg',\n 'xmlns:xlink': 'http://www.w3.org/1999/xlink',\n 'version': '1.1'\n};\n\nfunction getImage(item, renderer) {\n var image = item.image;\n\n if (!image || item.url && item.url !== image.url) {\n image = {\n complete: false,\n width: 0,\n height: 0\n };\n renderer.loadImage(item.url).then(image => {\n item.image = image;\n item.image.url = item.url;\n });\n }\n\n return image;\n}\n\nfunction imageWidth(item, image) {\n return item.width != null ? item.width : !image || !image.width ? 0 : item.aspect !== false && item.height ? item.height * image.width / image.height : image.width;\n}\n\nfunction imageHeight(item, image) {\n return item.height != null ? item.height : !image || !image.height ? 0 : item.aspect !== false && item.width ? item.width * image.height / image.width : image.height;\n}\n\nfunction imageXOffset(align, w) {\n return align === 'center' ? w / 2 : align === 'right' ? w : 0;\n}\n\nfunction imageYOffset(baseline, h) {\n return baseline === 'middle' ? h / 2 : baseline === 'bottom' ? h : 0;\n}\n\nfunction attr$4(emit, item, renderer) {\n const img = getImage(item, renderer),\n w = imageWidth(item, img),\n h = imageHeight(item, img),\n x = (item.x || 0) - imageXOffset(item.align, w),\n y = (item.y || 0) - imageYOffset(item.baseline, h),\n i = !img.src && img.toDataURL ? img.toDataURL() : img.src || '';\n emit('href', i, metadata['xmlns:xlink'], 'xlink:href');\n emit('transform', translate(x, y));\n emit('width', w);\n emit('height', h);\n emit('preserveAspectRatio', item.aspect === false ? 'none' : 'xMidYMid');\n}\n\nfunction bound$4(bounds, item) {\n const img = item.image,\n w = imageWidth(item, img),\n h = imageHeight(item, img),\n x = (item.x || 0) - imageXOffset(item.align, w),\n y = (item.y || 0) - imageYOffset(item.baseline, h);\n return bounds.set(x, y, x + w, y + h);\n}\n\nfunction draw$3(context, scene, bounds) {\n visit(scene, item => {\n if (bounds && !bounds.intersects(item.bounds)) return; // bounds check\n\n const img = getImage(item, this);\n let w = imageWidth(item, img);\n let h = imageHeight(item, img);\n if (w === 0 || h === 0) return; // early exit\n\n let x = (item.x || 0) - imageXOffset(item.align, w),\n y = (item.y || 0) - imageYOffset(item.baseline, h),\n opacity,\n ar0,\n ar1,\n t;\n\n if (item.aspect !== false) {\n ar0 = img.width / img.height;\n ar1 = item.width / item.height;\n\n if (ar0 === ar0 && ar1 === ar1 && ar0 !== ar1) {\n if (ar1 < ar0) {\n t = w / ar0;\n y += (h - t) / 2;\n h = t;\n } else {\n t = h * ar0;\n x += (w - t) / 2;\n w = t;\n }\n }\n }\n\n if (img.complete || img.toDataURL) {\n blend(context, item);\n context.globalAlpha = (opacity = item.opacity) != null ? opacity : 1;\n context.imageSmoothingEnabled = item.smooth !== false;\n context.drawImage(img, x, y, w, h);\n }\n });\n}\n\nvar image = {\n type: 'image',\n tag: 'image',\n nested: false,\n attr: attr$4,\n bound: bound$4,\n draw: draw$3,\n pick: pick$1(),\n isect: truthy,\n // bounds check is sufficient\n get: getImage,\n xOffset: imageXOffset,\n yOffset: imageYOffset\n};\n\nvar line = markMultiItemPath('line', line$1, pickLine);\n\nfunction attr$3(emit, item) {\n var sx = item.scaleX || 1,\n sy = item.scaleY || 1;\n\n if (sx !== 1 || sy !== 1) {\n emit('vector-effect', 'non-scaling-stroke');\n }\n\n emit('transform', transformItem(item));\n emit('d', item.path);\n}\n\nfunction path$1(context, item) {\n var path = item.path;\n if (path == null) return true;\n var x = item.x || 0,\n y = item.y || 0,\n sx = item.scaleX || 1,\n sy = item.scaleY || 1,\n a = (item.angle || 0) * DegToRad,\n cache = item.pathCache;\n\n if (!cache || cache.path !== path) {\n (item.pathCache = cache = parse(path)).path = path;\n }\n\n if (a && context.rotate && context.translate) {\n context.translate(x, y);\n context.rotate(a);\n pathRender(context, cache, 0, 0, sx, sy);\n context.rotate(-a);\n context.translate(-x, -y);\n } else {\n pathRender(context, cache, x, y, sx, sy);\n }\n}\n\nfunction bound$3(bounds, item) {\n return path$1(boundContext(bounds, item.angle), item) ? bounds.set(0, 0, 0, 0) : boundStroke(bounds, item, true);\n}\n\nvar path$2 = {\n type: 'path',\n tag: 'path',\n nested: false,\n attr: attr$3,\n bound: bound$3,\n draw: drawAll(path$1),\n pick: pickPath(path$1),\n isect: intersectPath(path$1)\n};\n\nfunction attr$2(emit, item) {\n emit('d', rectangle(null, item));\n}\n\nfunction bound$2(bounds, item) {\n var x, y;\n return boundStroke(bounds.set(x = item.x || 0, y = item.y || 0, x + item.width || 0, y + item.height || 0), item);\n}\n\nfunction draw$2(context, item) {\n context.beginPath();\n rectangle(context, item);\n}\n\nvar rect = {\n type: 'rect',\n tag: 'path',\n nested: false,\n attr: attr$2,\n bound: bound$2,\n draw: drawAll(draw$2),\n pick: pickPath(draw$2),\n isect: intersectRect\n};\n\nfunction attr$1(emit, item) {\n emit('transform', translateItem(item));\n emit('x2', item.x2 != null ? item.x2 - (item.x || 0) : 0);\n emit('y2', item.y2 != null ? item.y2 - (item.y || 0) : 0);\n}\n\nfunction bound$1(bounds, item) {\n var x1, y1;\n return boundStroke(bounds.set(x1 = item.x || 0, y1 = item.y || 0, item.x2 != null ? item.x2 : x1, item.y2 != null ? item.y2 : y1), item);\n}\n\nfunction path(context, item, opacity) {\n var x1, y1, x2, y2;\n\n if (item.stroke && stroke(context, item, opacity)) {\n x1 = item.x || 0;\n y1 = item.y || 0;\n x2 = item.x2 != null ? item.x2 : x1;\n y2 = item.y2 != null ? item.y2 : y1;\n context.beginPath();\n context.moveTo(x1, y1);\n context.lineTo(x2, y2);\n return true;\n }\n\n return false;\n}\n\nfunction draw$1(context, scene, bounds) {\n visit(scene, item => {\n if (bounds && !bounds.intersects(item.bounds)) return; // bounds check\n\n var opacity = item.opacity == null ? 1 : item.opacity;\n\n if (opacity && path(context, item, opacity)) {\n blend(context, item);\n context.stroke();\n }\n });\n}\n\nfunction hit$1(context, item, x, y) {\n if (!context.isPointInStroke) return false;\n return path(context, item, 1) && context.isPointInStroke(x, y);\n}\n\nvar rule = {\n type: 'rule',\n tag: 'line',\n nested: false,\n attr: attr$1,\n bound: bound$1,\n draw: draw$1,\n pick: pick$1(hit$1),\n isect: intersectRule\n};\n\nvar shape = markItemPath('shape', shape$1);\n\nvar symbol = markItemPath('symbol', symbol$1, intersectPoint);\n\nconst widthCache = lruCache();\nvar textMetrics = {\n height: fontSize,\n measureWidth: measureWidth,\n estimateWidth: estimateWidth,\n width: estimateWidth,\n canvas: useCanvas\n};\nuseCanvas(true);\n\nfunction useCanvas(use) {\n textMetrics.width = use && context ? measureWidth : estimateWidth;\n} // make simple estimate if no canvas is available\n\n\nfunction estimateWidth(item, text) {\n return _estimateWidth(textValue(item, text), fontSize(item));\n}\n\nfunction _estimateWidth(text, currentFontHeight) {\n return ~~(0.8 * text.length * currentFontHeight);\n} // measure text width if canvas is available\n\n\nfunction measureWidth(item, text) {\n return fontSize(item) <= 0 || !(text = textValue(item, text)) ? 0 : _measureWidth(text, font(item));\n}\n\nfunction _measureWidth(text, currentFont) {\n const key = \"(\".concat(currentFont, \") \").concat(text);\n let width = widthCache.get(key);\n\n if (width === undefined) {\n context.font = currentFont;\n width = context.measureText(text).width;\n widthCache.set(key, width);\n }\n\n return width;\n}\n\nfunction fontSize(item) {\n return item.fontSize != null ? +item.fontSize || 0 : 11;\n}\nfunction lineHeight(item) {\n return item.lineHeight != null ? item.lineHeight : fontSize(item) + 2;\n}\n\nfunction lineArray(_) {\n return isArray(_) ? _.length > 1 ? _ : _[0] : _;\n}\n\nfunction textLines(item) {\n return lineArray(item.lineBreak && item.text && !isArray(item.text) ? item.text.split(item.lineBreak) : item.text);\n}\nfunction multiLineOffset(item) {\n const tl = textLines(item);\n return (isArray(tl) ? tl.length - 1 : 0) * lineHeight(item);\n}\nfunction textValue(item, line) {\n const text = line == null ? '' : (line + '').trim();\n return item.limit > 0 && text.length ? truncate(item, text) : text;\n}\n\nfunction widthGetter(item) {\n if (textMetrics.width === measureWidth) {\n // we are using canvas\n const currentFont = font(item);\n return text => _measureWidth(text, currentFont);\n } else {\n // we are relying on estimates\n const currentFontHeight = fontSize(item);\n return text => _estimateWidth(text, currentFontHeight);\n }\n}\n\nfunction truncate(item, text) {\n var limit = +item.limit,\n width = widthGetter(item);\n if (width(text) < limit) return text;\n var ellipsis = item.ellipsis || '\\u2026',\n rtl = item.dir === 'rtl',\n lo = 0,\n hi = text.length,\n mid;\n limit -= width(ellipsis);\n\n if (rtl) {\n while (lo < hi) {\n mid = lo + hi >>> 1;\n if (width(text.slice(mid)) > limit) lo = mid + 1;else hi = mid;\n }\n\n return ellipsis + text.slice(lo);\n } else {\n while (lo < hi) {\n mid = 1 + (lo + hi >>> 1);\n if (width(text.slice(0, mid)) < limit) lo = mid;else hi = mid - 1;\n }\n\n return text.slice(0, lo) + ellipsis;\n }\n}\n\nfunction fontFamily(item, quote) {\n var font = item.font;\n return (quote && font ? String(font).replace(/\"/g, '\\'') : font) || 'sans-serif';\n}\nfunction font(item, quote) {\n return '' + (item.fontStyle ? item.fontStyle + ' ' : '') + (item.fontVariant ? item.fontVariant + ' ' : '') + (item.fontWeight ? item.fontWeight + ' ' : '') + fontSize(item) + 'px ' + fontFamily(item, quote);\n}\nfunction offset(item) {\n // perform our own font baseline calculation\n // why? not all browsers support SVG 1.1 'alignment-baseline' :(\n // this also ensures consistent layout across renderers\n var baseline = item.baseline,\n h = fontSize(item);\n return Math.round(baseline === 'top' ? 0.79 * h : baseline === 'middle' ? 0.30 * h : baseline === 'bottom' ? -0.21 * h : baseline === 'line-top' ? 0.29 * h + 0.5 * lineHeight(item) : baseline === 'line-bottom' ? 0.29 * h - 0.5 * lineHeight(item) : 0);\n}\n\nconst textAlign = {\n 'left': 'start',\n 'center': 'middle',\n 'right': 'end'\n};\nconst tempBounds = new Bounds();\n\nfunction anchorPoint(item) {\n var x = item.x || 0,\n y = item.y || 0,\n r = item.radius || 0,\n t;\n\n if (r) {\n t = (item.theta || 0) - HalfPi;\n x += r * Math.cos(t);\n y += r * Math.sin(t);\n }\n\n tempBounds.x1 = x;\n tempBounds.y1 = y;\n return tempBounds;\n}\n\nfunction attr(emit, item) {\n var dx = item.dx || 0,\n dy = (item.dy || 0) + offset(item),\n p = anchorPoint(item),\n x = p.x1,\n y = p.y1,\n a = item.angle || 0,\n t;\n emit('text-anchor', textAlign[item.align] || 'start');\n\n if (a) {\n t = translate(x, y) + ' ' + rotate(a);\n if (dx || dy) t += ' ' + translate(dx, dy);\n } else {\n t = translate(x + dx, y + dy);\n }\n\n emit('transform', t);\n}\n\nfunction bound(bounds, item, mode) {\n var h = textMetrics.height(item),\n a = item.align,\n p = anchorPoint(item),\n x = p.x1,\n y = p.y1,\n dx = item.dx || 0,\n dy = (item.dy || 0) + offset(item) - Math.round(0.8 * h),\n // use 4/5 offset\n tl = textLines(item),\n w; // get dimensions\n\n if (isArray(tl)) {\n // multi-line text\n h += lineHeight(item) * (tl.length - 1);\n w = tl.reduce((w, t) => Math.max(w, textMetrics.width(item, t)), 0);\n } else {\n // single-line text\n w = textMetrics.width(item, tl);\n } // horizontal alignment\n\n\n if (a === 'center') {\n dx -= w / 2;\n } else if (a === 'right') {\n dx -= w;\n } else ;\n\n bounds.set(dx += x, dy += y, dx + w, dy + h);\n\n if (item.angle && !mode) {\n bounds.rotate(item.angle * DegToRad, x, y);\n } else if (mode === 2) {\n return bounds.rotatedPoints(item.angle * DegToRad, x, y);\n }\n\n return bounds;\n}\n\nfunction draw(context, scene, bounds) {\n visit(scene, item => {\n var opacity = item.opacity == null ? 1 : item.opacity,\n p,\n x,\n y,\n i,\n lh,\n tl,\n str;\n if (bounds && !bounds.intersects(item.bounds) || // bounds check\n opacity === 0 || item.fontSize <= 0 || item.text == null || item.text.length === 0) return;\n context.font = font(item);\n context.textAlign = item.align || 'left';\n p = anchorPoint(item);\n x = p.x1, y = p.y1;\n\n if (item.angle) {\n context.save();\n context.translate(x, y);\n context.rotate(item.angle * DegToRad);\n x = y = 0; // reset x, y\n }\n\n x += item.dx || 0;\n y += (item.dy || 0) + offset(item);\n tl = textLines(item);\n blend(context, item);\n\n if (isArray(tl)) {\n lh = lineHeight(item);\n\n for (i = 0; i < tl.length; ++i) {\n str = textValue(item, tl[i]);\n\n if (item.fill && fill(context, item, opacity)) {\n context.fillText(str, x, y);\n }\n\n if (item.stroke && stroke(context, item, opacity)) {\n context.strokeText(str, x, y);\n }\n\n y += lh;\n }\n } else {\n str = textValue(item, tl);\n\n if (item.fill && fill(context, item, opacity)) {\n context.fillText(str, x, y);\n }\n\n if (item.stroke && stroke(context, item, opacity)) {\n context.strokeText(str, x, y);\n }\n }\n\n if (item.angle) context.restore();\n });\n}\n\nfunction hit(context, item, x, y, gx, gy) {\n if (item.fontSize <= 0) return false;\n if (!item.angle) return true; // bounds sufficient if no rotation\n // project point into space of unrotated bounds\n\n var p = anchorPoint(item),\n ax = p.x1,\n ay = p.y1,\n b = bound(tempBounds, item, 1),\n a = -item.angle * DegToRad,\n cos = Math.cos(a),\n sin = Math.sin(a),\n px = cos * gx - sin * gy + (ax - cos * ax + sin * ay),\n py = sin * gx + cos * gy + (ay - sin * ax - cos * ay);\n return b.contains(px, py);\n}\n\nfunction intersectText(item, box) {\n const p = bound(tempBounds, item, 2);\n return intersectBoxLine(box, p[0], p[1], p[2], p[3]) || intersectBoxLine(box, p[0], p[1], p[4], p[5]) || intersectBoxLine(box, p[4], p[5], p[6], p[7]) || intersectBoxLine(box, p[2], p[3], p[6], p[7]);\n}\n\nvar text = {\n type: 'text',\n tag: 'text',\n nested: false,\n attr: attr,\n bound: bound,\n draw: draw,\n pick: pick$1(hit),\n isect: intersectText\n};\n\nvar trail = markMultiItemPath('trail', trail$1, pickTrail);\n\nvar Marks = {\n arc: arc,\n area: area,\n group: group,\n image: image,\n line: line,\n path: path$2,\n rect: rect,\n rule: rule,\n shape: shape,\n symbol: symbol,\n text: text,\n trail: trail\n};\n\nfunction boundItem (item, func, opt) {\n var type = Marks[item.mark.marktype],\n bound = func || type.bound;\n if (type.nested) item = item.mark;\n return bound(item.bounds || (item.bounds = new Bounds()), item, opt);\n}\n\nvar DUMMY = {\n mark: null\n};\nfunction boundMark (mark, bounds, opt) {\n var type = Marks[mark.marktype],\n bound = type.bound,\n items = mark.items,\n hasItems = items && items.length,\n i,\n n,\n item,\n b;\n\n if (type.nested) {\n if (hasItems) {\n item = items[0];\n } else {\n // no items, fake it\n DUMMY.mark = mark;\n item = DUMMY;\n }\n\n b = boundItem(item, bound, opt);\n bounds = bounds && bounds.union(b) || b;\n return bounds;\n }\n\n bounds = bounds || mark.bounds && mark.bounds.clear() || new Bounds();\n\n if (hasItems) {\n for (i = 0, n = items.length; i < n; ++i) {\n bounds.union(boundItem(items[i], bound, opt));\n }\n }\n\n return mark.bounds = bounds;\n}\n\nconst keys = ['marktype', 'name', 'role', 'interactive', 'clip', 'items', 'zindex', 'x', 'y', 'width', 'height', 'align', 'baseline', // layout\n'fill', 'fillOpacity', 'opacity', 'blend', // fill\n'stroke', 'strokeOpacity', 'strokeWidth', 'strokeCap', // stroke\n'strokeDash', 'strokeDashOffset', // stroke dash\n'strokeForeground', 'strokeOffset', // group\n'startAngle', 'endAngle', 'innerRadius', 'outerRadius', // arc\n'cornerRadius', 'padAngle', // arc, rect\n'cornerRadiusTopLeft', 'cornerRadiusTopRight', // rect, group\n'cornerRadiusBottomLeft', 'cornerRadiusBottomRight', 'interpolate', 'tension', 'orient', 'defined', // area, line\n'url', 'aspect', 'smooth', // image\n'path', 'scaleX', 'scaleY', // path\n'x2', 'y2', // rule\n'size', 'shape', // symbol\n'text', 'angle', 'theta', 'radius', 'dir', 'dx', 'dy', // text\n'ellipsis', 'limit', 'lineBreak', 'lineHeight', 'font', 'fontSize', 'fontWeight', 'fontStyle', 'fontVariant', // font\n'description', 'aria', 'ariaRole', 'ariaRoleDescription' // aria\n];\nfunction sceneToJSON(scene, indent) {\n return JSON.stringify(scene, keys, indent);\n}\nfunction sceneFromJSON(json) {\n const scene = typeof json === 'string' ? JSON.parse(json) : json;\n return initialize(scene);\n}\n\nfunction initialize(scene) {\n var type = scene.marktype,\n items = scene.items,\n parent,\n i,\n n;\n\n if (items) {\n for (i = 0, n = items.length; i < n; ++i) {\n parent = type ? 'mark' : 'group';\n items[i][parent] = scene;\n if (items[i].zindex) items[i][parent].zdirty = true;\n if ('group' === (type || parent)) initialize(items[i]);\n }\n }\n\n if (type) boundMark(scene);\n return scene;\n}\n\nfunction Scenegraph(scene) {\n if (arguments.length) {\n this.root = sceneFromJSON(scene);\n } else {\n this.root = createMark({\n marktype: 'group',\n name: 'root',\n role: 'frame'\n });\n this.root.items = [new GroupItem(this.root)];\n }\n}\nScenegraph.prototype = {\n toJSON(indent) {\n return sceneToJSON(this.root, indent || 0);\n },\n\n mark(markdef, group, index) {\n group = group || this.root.items[0];\n const mark = createMark(markdef, group);\n group.items[index] = mark;\n if (mark.zindex) mark.group.zdirty = true;\n return mark;\n }\n\n};\n\nfunction createMark(def, group) {\n const mark = {\n bounds: new Bounds(),\n clip: !!def.clip,\n group: group,\n interactive: def.interactive === false ? false : true,\n items: [],\n marktype: def.marktype,\n name: def.name || undefined,\n role: def.role || undefined,\n zindex: def.zindex || 0\n }; // add accessibility properties if defined\n\n if (def.aria != null) {\n mark.aria = def.aria;\n }\n\n if (def.description) {\n mark.description = def.description;\n }\n\n return mark;\n}\n\n// create a new DOM element\nfunction domCreate(doc, tag, ns) {\n if (!doc && typeof document !== 'undefined' && document.createElement) {\n doc = document;\n }\n\n return doc ? ns ? doc.createElementNS(ns, tag) : doc.createElement(tag) : null;\n} // find first child element with matching tag\n\nfunction domFind(el, tag) {\n tag = tag.toLowerCase();\n var nodes = el.childNodes,\n i = 0,\n n = nodes.length;\n\n for (; i < n; ++i) if (nodes[i].tagName.toLowerCase() === tag) {\n return nodes[i];\n }\n} // retrieve child element at given index\n// create & insert if doesn't exist or if tags do not match\n\nfunction domChild(el, index, tag, ns) {\n var a = el.childNodes[index],\n b;\n\n if (!a || a.tagName.toLowerCase() !== tag.toLowerCase()) {\n b = a || null;\n a = domCreate(el.ownerDocument, tag, ns);\n el.insertBefore(a, b);\n }\n\n return a;\n} // remove all child elements at or above the given index\n\nfunction domClear(el, index) {\n var nodes = el.childNodes,\n curr = nodes.length;\n\n while (curr > index) el.removeChild(nodes[--curr]);\n\n return el;\n} // generate css class name for mark\n\nfunction cssClass(mark) {\n return 'mark-' + mark.marktype + (mark.role ? ' role-' + mark.role : '') + (mark.name ? ' ' + mark.name : '');\n}\n\nfunction point (event, el) {\n const rect = el.getBoundingClientRect();\n return [event.clientX - rect.left - (el.clientLeft || 0), event.clientY - rect.top - (el.clientTop || 0)];\n}\n\nfunction resolveItem (item, event, el, origin) {\n var mark = item && item.mark,\n mdef,\n p;\n\n if (mark && (mdef = Marks[mark.marktype]).tip) {\n p = point(event, el);\n p[0] -= origin[0];\n p[1] -= origin[1];\n\n while (item = item.mark.group) {\n p[0] -= item.x || 0;\n p[1] -= item.y || 0;\n }\n\n item = mdef.tip(mark.items, p);\n }\n\n return item;\n}\n\n/**\n * Create a new Handler instance.\n * @param {object} [customLoader] - Optional loader instance for\n * href URL sanitization. If not specified, a standard loader\n * instance will be generated.\n * @param {function} [customTooltip] - Optional tooltip handler\n * function for custom tooltip display.\n * @constructor\n */\n\nfunction Handler(customLoader, customTooltip) {\n this._active = null;\n this._handlers = {};\n this._loader = customLoader || loader();\n this._tooltip = customTooltip || defaultTooltip;\n} // The default tooltip display handler.\n// Sets the HTML title attribute on the visualization container.\n\nfunction defaultTooltip(handler, event, item, value) {\n handler.element().setAttribute('title', value || '');\n}\n\nHandler.prototype = {\n /**\n * Initialize a new Handler instance.\n * @param {DOMElement} el - The containing DOM element for the display.\n * @param {Array} origin - The origin of the display, in pixels.\n * The coordinate system will be translated to this point.\n * @param {object} [obj] - Optional context object that should serve as\n * the \"this\" context for event callbacks.\n * @return {Handler} - This handler instance.\n */\n initialize(el, origin, obj) {\n this._el = el;\n this._obj = obj || null;\n return this.origin(origin);\n },\n\n /**\n * Returns the parent container element for a visualization.\n * @return {DOMElement} - The containing DOM element.\n */\n element() {\n return this._el;\n },\n\n /**\n * Returns the scene element (e.g., canvas or SVG) of the visualization\n * Subclasses must override if the first child is not the scene element.\n * @return {DOMElement} - The scene (e.g., canvas or SVG) element.\n */\n canvas() {\n return this._el && this._el.firstChild;\n },\n\n /**\n * Get / set the origin coordinates of the visualization.\n */\n origin(origin) {\n if (arguments.length) {\n this._origin = origin || [0, 0];\n return this;\n } else {\n return this._origin.slice();\n }\n },\n\n /**\n * Get / set the scenegraph root.\n */\n scene(scene) {\n if (!arguments.length) return this._scene;\n this._scene = scene;\n return this;\n },\n\n /**\n * Add an event handler. Subclasses should override this method.\n */\n on() {},\n\n /**\n * Remove an event handler. Subclasses should override this method.\n */\n off() {},\n\n /**\n * Utility method for finding the array index of an event handler.\n * @param {Array} h - An array of registered event handlers.\n * @param {string} type - The event type.\n * @param {function} handler - The event handler instance to find.\n * @return {number} - The handler's array index or -1 if not registered.\n */\n _handlerIndex(h, type, handler) {\n for (let i = h ? h.length : 0; --i >= 0;) {\n if (h[i].type === type && (!handler || h[i].handler === handler)) {\n return i;\n }\n }\n\n return -1;\n },\n\n /**\n * Returns an array with registered event handlers.\n * @param {string} [type] - The event type to query. Any annotations\n * are ignored; for example, for the argument \"click.foo\", \".foo\" will\n * be ignored and the method returns all \"click\" handlers. If type is\n * null or unspecified, this method returns handlers for all types.\n * @return {Array} - A new array containing all registered event handlers.\n */\n handlers(type) {\n const h = this._handlers,\n a = [];\n\n if (type) {\n a.push(...h[this.eventName(type)]);\n } else {\n for (const k in h) {\n a.push(...h[k]);\n }\n }\n\n return a;\n },\n\n /**\n * Parses an event name string to return the specific event type.\n * For example, given \"click.foo\" returns \"click\"\n * @param {string} name - The input event type string.\n * @return {string} - A string with the event type only.\n */\n eventName(name) {\n const i = name.indexOf('.');\n return i < 0 ? name : name.slice(0, i);\n },\n\n /**\n * Handle hyperlink navigation in response to an item.href value.\n * @param {Event} event - The event triggering hyperlink navigation.\n * @param {Item} item - The scenegraph item.\n * @param {string} href - The URL to navigate to.\n */\n handleHref(event, item, href) {\n this._loader.sanitize(href, {\n context: 'href'\n }).then(opt => {\n const e = new MouseEvent(event.type, event),\n a = domCreate(null, 'a');\n\n for (const name in opt) a.setAttribute(name, opt[name]);\n\n a.dispatchEvent(e);\n }).catch(() => {\n /* do nothing */\n });\n },\n\n /**\n * Handle tooltip display in response to an item.tooltip value.\n * @param {Event} event - The event triggering tooltip display.\n * @param {Item} item - The scenegraph item.\n * @param {boolean} show - A boolean flag indicating whether\n * to show or hide a tooltip for the given item.\n */\n handleTooltip(event, item, show) {\n if (item && item.tooltip != null) {\n item = resolveItem(item, event, this.canvas(), this._origin);\n const value = show && item && item.tooltip || null;\n\n this._tooltip.call(this._obj, this, event, item, value);\n }\n },\n\n /**\n * Returns the size of a scenegraph item and its position relative\n * to the viewport.\n * @param {Item} item - The scenegraph item.\n * @return {object} - A bounding box object (compatible with the\n * DOMRect type) consisting of x, y, width, heigh, top, left,\n * right, and bottom properties.\n */\n getItemBoundingClientRect(item) {\n const el = this.canvas();\n if (!el) return;\n const rect = el.getBoundingClientRect(),\n origin = this._origin,\n bounds = item.bounds,\n width = bounds.width(),\n height = bounds.height();\n let x = bounds.x1 + origin[0] + rect.left,\n y = bounds.y1 + origin[1] + rect.top; // translate coordinate for each parent group\n\n while (item.mark && (item = item.mark.group)) {\n x += item.x || 0;\n y += item.y || 0;\n } // return DOMRect-compatible bounding box\n\n\n return {\n x,\n y,\n width,\n height,\n left: x,\n top: y,\n right: x + width,\n bottom: y + height\n };\n }\n\n};\n\n/**\n * Create a new Renderer instance.\n * @param {object} [loader] - Optional loader instance for\n * image and href URL sanitization. If not specified, a\n * standard loader instance will be generated.\n * @constructor\n */\n\nfunction Renderer(loader) {\n this._el = null;\n this._bgcolor = null;\n this._loader = new ResourceLoader(loader);\n}\nRenderer.prototype = {\n /**\n * Initialize a new Renderer instance.\n * @param {DOMElement} el - The containing DOM element for the display.\n * @param {number} width - The coordinate width of the display, in pixels.\n * @param {number} height - The coordinate height of the display, in pixels.\n * @param {Array} origin - The origin of the display, in pixels.\n * The coordinate system will be translated to this point.\n * @param {number} [scaleFactor=1] - Optional scaleFactor by which to multiply\n * the width and height to determine the final pixel size.\n * @return {Renderer} - This renderer instance.\n */\n initialize(el, width, height, origin, scaleFactor) {\n this._el = el;\n return this.resize(width, height, origin, scaleFactor);\n },\n\n /**\n * Returns the parent container element for a visualization.\n * @return {DOMElement} - The containing DOM element.\n */\n element() {\n return this._el;\n },\n\n /**\n * Returns the scene element (e.g., canvas or SVG) of the visualization\n * Subclasses must override if the first child is not the scene element.\n * @return {DOMElement} - The scene (e.g., canvas or SVG) element.\n */\n canvas() {\n return this._el && this._el.firstChild;\n },\n\n /**\n * Get / set the background color.\n */\n background(bgcolor) {\n if (arguments.length === 0) return this._bgcolor;\n this._bgcolor = bgcolor;\n return this;\n },\n\n /**\n * Resize the display.\n * @param {number} width - The new coordinate width of the display, in pixels.\n * @param {number} height - The new coordinate height of the display, in pixels.\n * @param {Array} origin - The new origin of the display, in pixels.\n * The coordinate system will be translated to this point.\n * @param {number} [scaleFactor=1] - Optional scaleFactor by which to multiply\n * the width and height to determine the final pixel size.\n * @return {Renderer} - This renderer instance;\n */\n resize(width, height, origin, scaleFactor) {\n this._width = width;\n this._height = height;\n this._origin = origin || [0, 0];\n this._scale = scaleFactor || 1;\n return this;\n },\n\n /**\n * Report a dirty item whose bounds should be redrawn.\n * This base class method does nothing. Subclasses that perform\n * incremental should implement this method.\n * @param {Item} item - The dirty item whose bounds should be redrawn.\n */\n dirty() {},\n\n /**\n * Render an input scenegraph, potentially with a set of dirty items.\n * This method will perform an immediate rendering with available resources.\n * The renderer may also need to perform image loading to perform a complete\n * render. This process can lead to asynchronous re-rendering of the scene\n * after this method returns. To receive notification when rendering is\n * complete, use the renderAsync method instead.\n * @param {object} scene - The root mark of a scenegraph to render.\n * @return {Renderer} - This renderer instance.\n */\n render(scene) {\n const r = this; // bind arguments into a render call, and cache it\n // this function may be subsequently called for async redraw\n\n r._call = function () {\n r._render(scene);\n }; // invoke the renderer\n\n\n r._call(); // clear the cached call for garbage collection\n // async redraws will stash their own copy\n\n\n r._call = null;\n return r;\n },\n\n /**\n * Internal rendering method. Renderer subclasses should override this\n * method to actually perform rendering.\n * @param {object} scene - The root mark of a scenegraph to render.\n */\n _render() {// subclasses to override\n },\n\n /**\n * Asynchronous rendering method. Similar to render, but returns a Promise\n * that resolves when all rendering is completed. Sometimes a renderer must\n * perform image loading to get a complete rendering. The returned\n * Promise will not resolve until this process completes.\n * @param {object} scene - The root mark of a scenegraph to render.\n * @return {Promise} - A Promise that resolves when rendering is complete.\n */\n renderAsync(scene) {\n const r = this.render(scene);\n return this._ready ? this._ready.then(() => r) : Promise.resolve(r);\n },\n\n /**\n * Internal method for asynchronous resource loading.\n * Proxies method calls to the ImageLoader, and tracks loading\n * progress to invoke a re-render once complete.\n * @param {string} method - The method name to invoke on the ImageLoader.\n * @param {string} uri - The URI for the requested resource.\n * @return {Promise} - A Promise that resolves to the requested resource.\n */\n _load(method, uri) {\n var r = this,\n p = r._loader[method](uri);\n\n if (!r._ready) {\n // re-render the scene when loading completes\n const call = r._call;\n r._ready = r._loader.ready().then(redraw => {\n if (redraw) call();\n r._ready = null;\n });\n }\n\n return p;\n },\n\n /**\n * Sanitize a URL to include as a hyperlink in the rendered scene.\n * This method proxies a call to ImageLoader.sanitizeURL, but also tracks\n * image loading progress and invokes a re-render once complete.\n * @param {string} uri - The URI string to sanitize.\n * @return {Promise} - A Promise that resolves to the sanitized URL.\n */\n sanitizeURL(uri) {\n return this._load('sanitizeURL', uri);\n },\n\n /**\n * Requests an image to include in the rendered scene.\n * This method proxies a call to ImageLoader.loadImage, but also tracks\n * image loading progress and invokes a re-render once complete.\n * @param {string} uri - The URI string of the image.\n * @return {Promise} - A Promise that resolves to the loaded Image.\n */\n loadImage(uri) {\n return this._load('loadImage', uri);\n }\n\n};\n\nconst KeyDownEvent = 'keydown';\nconst KeyPressEvent = 'keypress';\nconst KeyUpEvent = 'keyup';\nconst DragEnterEvent = 'dragenter';\nconst DragLeaveEvent = 'dragleave';\nconst DragOverEvent = 'dragover';\nconst MouseDownEvent = 'mousedown';\nconst MouseUpEvent = 'mouseup';\nconst MouseMoveEvent = 'mousemove';\nconst MouseOutEvent = 'mouseout';\nconst MouseOverEvent = 'mouseover';\nconst ClickEvent = 'click';\nconst DoubleClickEvent = 'dblclick';\nconst WheelEvent = 'wheel';\nconst MouseWheelEvent = 'mousewheel';\nconst TouchStartEvent = 'touchstart';\nconst TouchMoveEvent = 'touchmove';\nconst TouchEndEvent = 'touchend';\nconst Events = [KeyDownEvent, KeyPressEvent, KeyUpEvent, DragEnterEvent, DragLeaveEvent, DragOverEvent, MouseDownEvent, MouseUpEvent, MouseMoveEvent, MouseOutEvent, MouseOverEvent, ClickEvent, DoubleClickEvent, WheelEvent, MouseWheelEvent, TouchStartEvent, TouchMoveEvent, TouchEndEvent];\nconst TooltipShowEvent = MouseMoveEvent;\nconst TooltipHideEvent = MouseOutEvent;\nconst HrefEvent = ClickEvent;\n\nfunction CanvasHandler(loader, tooltip) {\n Handler.call(this, loader, tooltip);\n this._down = null;\n this._touch = null;\n this._first = true;\n this._events = {};\n}\n\nconst eventBundle = type => type === TouchStartEvent || type === TouchMoveEvent || type === TouchEndEvent ? [TouchStartEvent, TouchMoveEvent, TouchEndEvent] : [type]; // lazily add listeners to the canvas as needed\n\n\nfunction eventListenerCheck(handler, type) {\n eventBundle(type).forEach(_ => addEventListener(handler, _));\n}\n\nfunction addEventListener(handler, type) {\n const canvas = handler.canvas();\n\n if (canvas && !handler._events[type]) {\n handler._events[type] = 1;\n canvas.addEventListener(type, handler[type] ? evt => handler[type](evt) : evt => handler.fire(type, evt));\n }\n}\n\nfunction move(moveEvent, overEvent, outEvent) {\n return function (evt) {\n const a = this._active,\n p = this.pickEvent(evt);\n\n if (p === a) {\n // active item and picked item are the same\n this.fire(moveEvent, evt); // fire move\n } else {\n // active item and picked item are different\n if (!a || !a.exit) {\n // fire out for prior active item\n // suppress if active item was removed from scene\n this.fire(outEvent, evt);\n }\n\n this._active = p; // set new active item\n\n this.fire(overEvent, evt); // fire over for new active item\n\n this.fire(moveEvent, evt); // fire move for new active item\n }\n };\n}\n\nfunction inactive(type) {\n return function (evt) {\n this.fire(type, evt);\n this._active = null;\n };\n}\n\ninherits(CanvasHandler, Handler, {\n initialize(el, origin, obj) {\n this._canvas = el && domFind(el, 'canvas'); // add minimal events required for proper state management\n\n [ClickEvent, MouseDownEvent, MouseMoveEvent, MouseOutEvent, DragLeaveEvent].forEach(type => eventListenerCheck(this, type));\n return Handler.prototype.initialize.call(this, el, origin, obj);\n },\n\n // return the backing canvas instance\n canvas() {\n return this._canvas;\n },\n\n // retrieve the current canvas context\n context() {\n return this._canvas.getContext('2d');\n },\n\n // supported events\n events: Events,\n\n // to keep old versions of firefox happy\n DOMMouseScroll(evt) {\n this.fire(MouseWheelEvent, evt);\n },\n\n mousemove: move(MouseMoveEvent, MouseOverEvent, MouseOutEvent),\n dragover: move(DragOverEvent, DragEnterEvent, DragLeaveEvent),\n mouseout: inactive(MouseOutEvent),\n dragleave: inactive(DragLeaveEvent),\n\n mousedown(evt) {\n this._down = this._active;\n this.fire(MouseDownEvent, evt);\n },\n\n click(evt) {\n if (this._down === this._active) {\n this.fire(ClickEvent, evt);\n this._down = null;\n }\n },\n\n touchstart(evt) {\n this._touch = this.pickEvent(evt.changedTouches[0]);\n\n if (this._first) {\n this._active = this._touch;\n this._first = false;\n }\n\n this.fire(TouchStartEvent, evt, true);\n },\n\n touchmove(evt) {\n this.fire(TouchMoveEvent, evt, true);\n },\n\n touchend(evt) {\n this.fire(TouchEndEvent, evt, true);\n this._touch = null;\n },\n\n // fire an event\n fire(type, evt, touch) {\n const a = touch ? this._touch : this._active,\n h = this._handlers[type]; // set event type relative to scenegraph items\n\n evt.vegaType = type; // handle hyperlinks and tooltips first\n\n if (type === HrefEvent && a && a.href) {\n this.handleHref(evt, a, a.href);\n } else if (type === TooltipShowEvent || type === TooltipHideEvent) {\n this.handleTooltip(evt, a, type !== TooltipHideEvent);\n } // invoke all registered handlers\n\n\n if (h) {\n for (let i = 0, len = h.length; i < len; ++i) {\n h[i].handler.call(this._obj, evt, a);\n }\n }\n },\n\n // add an event handler\n on(type, handler) {\n const name = this.eventName(type),\n h = this._handlers,\n i = this._handlerIndex(h[name], type, handler);\n\n if (i < 0) {\n eventListenerCheck(this, type);\n (h[name] || (h[name] = [])).push({\n type: type,\n handler: handler\n });\n }\n\n return this;\n },\n\n // remove an event handler\n off(type, handler) {\n const name = this.eventName(type),\n h = this._handlers[name],\n i = this._handlerIndex(h, type, handler);\n\n if (i >= 0) {\n h.splice(i, 1);\n }\n\n return this;\n },\n\n pickEvent(evt) {\n const p = point(evt, this._canvas),\n o = this._origin;\n return this.pick(this._scene, p[0], p[1], p[0] - o[0], p[1] - o[1]);\n },\n\n // find the scenegraph item at the current mouse position\n // x, y -- the absolute x, y mouse coordinates on the canvas element\n // gx, gy -- the relative coordinates within the current group\n pick(scene, x, y, gx, gy) {\n const g = this.context(),\n mark = Marks[scene.marktype];\n return mark.pick.call(this, g, scene, x, y, gx, gy);\n }\n\n});\n\nfunction devicePixelRatio() {\n return typeof window !== 'undefined' ? window.devicePixelRatio || 1 : 1;\n}\n\nvar pixelRatio = devicePixelRatio();\nfunction resize (canvas, width, height, origin, scaleFactor, opt) {\n const inDOM = typeof HTMLElement !== 'undefined' && canvas instanceof HTMLElement && canvas.parentNode != null,\n context = canvas.getContext('2d'),\n ratio = inDOM ? pixelRatio : scaleFactor;\n canvas.width = width * ratio;\n canvas.height = height * ratio;\n\n for (const key in opt) {\n context[key] = opt[key];\n }\n\n if (inDOM && ratio !== 1) {\n canvas.style.width = width + 'px';\n canvas.style.height = height + 'px';\n }\n\n context.pixelRatio = ratio;\n context.setTransform(ratio, 0, 0, ratio, ratio * origin[0], ratio * origin[1]);\n return canvas;\n}\n\nfunction CanvasRenderer(loader) {\n Renderer.call(this, loader);\n this._options = {};\n this._redraw = false;\n this._dirty = new Bounds();\n this._tempb = new Bounds();\n}\nconst base$1 = Renderer.prototype;\n\nconst viewBounds = (origin, width, height) => new Bounds().set(0, 0, width, height).translate(-origin[0], -origin[1]);\n\nfunction clipToBounds(g, b, origin) {\n // expand bounds by 1 pixel, then round to pixel boundaries\n b.expand(1).round(); // align to base pixel grid in case of non-integer scaling (#2425)\n\n if (g.pixelRatio % 1) {\n b.scale(g.pixelRatio).round().scale(1 / g.pixelRatio);\n } // to avoid artifacts translate if origin has fractional pixels\n\n\n b.translate(-(origin[0] % 1), -(origin[1] % 1)); // set clip path\n\n g.beginPath();\n g.rect(b.x1, b.y1, b.width(), b.height());\n g.clip();\n return b;\n}\n\ninherits(CanvasRenderer, Renderer, {\n initialize(el, width, height, origin, scaleFactor, options) {\n this._options = options || {};\n this._canvas = this._options.externalContext ? null : canvas(1, 1, this._options.type); // instantiate a small canvas\n\n if (el && this._canvas) {\n domClear(el, 0).appendChild(this._canvas);\n\n this._canvas.setAttribute('class', 'marks');\n } // this method will invoke resize to size the canvas appropriately\n\n\n return base$1.initialize.call(this, el, width, height, origin, scaleFactor);\n },\n\n resize(width, height, origin, scaleFactor) {\n base$1.resize.call(this, width, height, origin, scaleFactor);\n\n if (this._canvas) {\n // configure canvas size and transform\n resize(this._canvas, this._width, this._height, this._origin, this._scale, this._options.context);\n } else {\n // external context needs to be scaled and positioned to origin\n const ctx = this._options.externalContext;\n if (!ctx) error('CanvasRenderer is missing a valid canvas or context');\n ctx.scale(this._scale, this._scale);\n ctx.translate(this._origin[0], this._origin[1]);\n }\n\n this._redraw = true;\n return this;\n },\n\n canvas() {\n return this._canvas;\n },\n\n context() {\n return this._options.externalContext || (this._canvas ? this._canvas.getContext('2d') : null);\n },\n\n dirty(item) {\n const b = this._tempb.clear().union(item.bounds);\n\n let g = item.mark.group;\n\n while (g) {\n b.translate(g.x || 0, g.y || 0);\n g = g.mark.group;\n }\n\n this._dirty.union(b);\n },\n\n _render(scene) {\n const g = this.context(),\n o = this._origin,\n w = this._width,\n h = this._height,\n db = this._dirty,\n vb = viewBounds(o, w, h); // setup\n\n g.save();\n const b = this._redraw || db.empty() ? (this._redraw = false, vb.expand(1)) : clipToBounds(g, vb.intersect(db), o);\n this.clear(-o[0], -o[1], w, h); // render\n\n this.draw(g, scene, b); // takedown\n\n g.restore();\n db.clear();\n return this;\n },\n\n draw(ctx, scene, bounds) {\n const mark = Marks[scene.marktype];\n if (scene.clip) clip(ctx, scene);\n mark.draw.call(this, ctx, scene, bounds);\n if (scene.clip) ctx.restore();\n },\n\n clear(x, y, w, h) {\n const opt = this._options,\n g = this.context();\n\n if (opt.type !== 'pdf' && !opt.externalContext) {\n // calling clear rect voids vector output in pdf mode\n // and could remove external context content (#2615)\n g.clearRect(x, y, w, h);\n }\n\n if (this._bgcolor != null) {\n g.fillStyle = this._bgcolor;\n g.fillRect(x, y, w, h);\n }\n }\n\n});\n\nfunction SVGHandler(loader, tooltip) {\n Handler.call(this, loader, tooltip);\n const h = this;\n h._hrefHandler = listener(h, (evt, item) => {\n if (item && item.href) h.handleHref(evt, item, item.href);\n });\n h._tooltipHandler = listener(h, (evt, item) => {\n h.handleTooltip(evt, item, evt.type !== TooltipHideEvent);\n });\n} // wrap an event listener for the SVG DOM\n\nconst listener = (context, handler) => evt => {\n let item = evt.target.__data__;\n item = Array.isArray(item) ? item[0] : item;\n evt.vegaType = evt.type;\n handler.call(context._obj, evt, item);\n};\n\ninherits(SVGHandler, Handler, {\n initialize(el, origin, obj) {\n let svg = this._svg;\n\n if (svg) {\n svg.removeEventListener(HrefEvent, this._hrefHandler);\n svg.removeEventListener(TooltipShowEvent, this._tooltipHandler);\n svg.removeEventListener(TooltipHideEvent, this._tooltipHandler);\n }\n\n this._svg = svg = el && domFind(el, 'svg');\n\n if (svg) {\n svg.addEventListener(HrefEvent, this._hrefHandler);\n svg.addEventListener(TooltipShowEvent, this._tooltipHandler);\n svg.addEventListener(TooltipHideEvent, this._tooltipHandler);\n }\n\n return Handler.prototype.initialize.call(this, el, origin, obj);\n },\n\n canvas() {\n return this._svg;\n },\n\n // add an event handler\n on(type, handler) {\n const name = this.eventName(type),\n h = this._handlers,\n i = this._handlerIndex(h[name], type, handler);\n\n if (i < 0) {\n const x = {\n type,\n handler,\n listener: listener(this, handler)\n };\n (h[name] || (h[name] = [])).push(x);\n\n if (this._svg) {\n this._svg.addEventListener(name, x.listener);\n }\n }\n\n return this;\n },\n\n // remove an event handler\n off(type, handler) {\n const name = this.eventName(type),\n h = this._handlers[name],\n i = this._handlerIndex(h, type, handler);\n\n if (i >= 0) {\n if (this._svg) {\n this._svg.removeEventListener(name, h[i].listener);\n }\n\n h.splice(i, 1);\n }\n\n return this;\n }\n\n});\n\nconst ARIA_HIDDEN = 'aria-hidden';\nconst ARIA_LABEL = 'aria-label';\nconst ARIA_ROLE = 'role';\nconst ARIA_ROLEDESCRIPTION = 'aria-roledescription';\nconst GRAPHICS_OBJECT = 'graphics-object';\nconst GRAPHICS_SYMBOL = 'graphics-symbol';\n\nconst bundle = (role, roledesc, label) => ({\n [ARIA_ROLE]: role,\n [ARIA_ROLEDESCRIPTION]: roledesc,\n [ARIA_LABEL]: label || undefined\n}); // these roles are covered by related roles\n// we can ignore them, no need to generate attributes\n\n\nconst AriaIgnore = toSet(['axis-domain', 'axis-grid', 'axis-label', 'axis-tick', 'axis-title', 'legend-band', 'legend-entry', 'legend-gradient', 'legend-label', 'legend-title', 'legend-symbol', 'title']); // aria attribute generators for guide roles\n\nconst AriaGuides = {\n 'axis': {\n desc: 'axis',\n caption: axisCaption\n },\n 'legend': {\n desc: 'legend',\n caption: legendCaption\n },\n 'title-text': {\n desc: 'title',\n caption: item => \"Title text '\".concat(titleCaption(item), \"'\")\n },\n 'title-subtitle': {\n desc: 'subtitle',\n caption: item => \"Subtitle text '\".concat(titleCaption(item), \"'\")\n }\n}; // aria properties generated for mark item encoding channels\n\nconst AriaEncode = {\n ariaRole: ARIA_ROLE,\n ariaRoleDescription: ARIA_ROLEDESCRIPTION,\n description: ARIA_LABEL\n};\nfunction ariaItemAttributes(emit, item) {\n const hide = item.aria === false;\n emit(ARIA_HIDDEN, hide || undefined);\n\n if (hide || item.description == null) {\n for (const prop in AriaEncode) {\n emit(AriaEncode[prop], undefined);\n }\n } else {\n const type = item.mark.marktype;\n emit(ARIA_LABEL, item.description);\n emit(ARIA_ROLE, item.ariaRole || (type === 'group' ? GRAPHICS_OBJECT : GRAPHICS_SYMBOL));\n emit(ARIA_ROLEDESCRIPTION, item.ariaRoleDescription || \"\".concat(type, \" mark\"));\n }\n}\nfunction ariaMarkAttributes(mark) {\n return mark.aria === false ? {\n [ARIA_HIDDEN]: true\n } : AriaIgnore[mark.role] ? null : AriaGuides[mark.role] ? ariaGuide(mark, AriaGuides[mark.role]) : ariaMark(mark);\n}\n\nfunction ariaMark(mark) {\n const type = mark.marktype;\n const recurse = type === 'group' || type === 'text' || mark.items.some(_ => _.description != null && _.aria !== false);\n return bundle(recurse ? GRAPHICS_OBJECT : GRAPHICS_SYMBOL, \"\".concat(type, \" mark container\"), mark.description);\n}\n\nfunction ariaGuide(mark, opt) {\n try {\n const item = mark.items[0],\n caption = opt.caption || (() => '');\n\n return bundle(opt.role || GRAPHICS_SYMBOL, opt.desc, item.description || caption(item));\n } catch (err) {\n return null;\n }\n}\n\nfunction titleCaption(item) {\n return array(item.text).join(' ');\n}\n\nfunction axisCaption(item) {\n const datum = item.datum,\n orient = item.orient,\n title = datum.title ? extractTitle(item) : null,\n ctx = item.context,\n scale = ctx.scales[datum.scale].value,\n locale = ctx.dataflow.locale(),\n type = scale.type,\n xy = orient === 'left' || orient === 'right' ? 'Y' : 'X';\n return \"\".concat(xy, \"-axis\") + (title ? \" titled '\".concat(title, \"'\") : '') + \" for a \".concat(isDiscrete(type) ? 'discrete' : type, \" scale\") + \" with \".concat(domainCaption(locale, scale, item));\n}\n\nfunction legendCaption(item) {\n const datum = item.datum,\n title = datum.title ? extractTitle(item) : null,\n type = \"\".concat(datum.type || '', \" legend\").trim(),\n scales = datum.scales,\n props = Object.keys(scales),\n ctx = item.context,\n scale = ctx.scales[scales[props[0]]].value,\n locale = ctx.dataflow.locale();\n return capitalize(type) + (title ? \" titled '\".concat(title, \"'\") : '') + \" for \".concat(channelCaption(props)) + \" with \".concat(domainCaption(locale, scale, item));\n}\n\nfunction extractTitle(item) {\n try {\n return array(peek(item.items).items[0].text).join(' ');\n } catch (err) {\n return null;\n }\n}\n\nfunction channelCaption(props) {\n props = props.map(p => p + (p === 'fill' || p === 'stroke' ? ' color' : ''));\n return props.length < 2 ? props[0] : props.slice(0, -1).join(', ') + ' and ' + peek(props);\n}\n\nfunction capitalize(s) {\n return s.length ? s[0].toUpperCase() + s.slice(1) : s;\n}\n\nconst innerText = val => (val + '').replace(/&/g, '&').replace(//g, '>');\n\nconst attrText = val => innerText(val).replace(/\"/g, '"').replace(/\\t/g, ' ').replace(/\\n/g, ' ').replace(/\\r/g, ' ');\n\nfunction markup() {\n let buf = '',\n outer = '',\n inner = '';\n\n const stack = [],\n clear = () => outer = inner = '',\n push = tag => {\n if (outer) {\n buf += \"\".concat(outer, \">\").concat(inner);\n clear();\n }\n\n stack.push(tag);\n },\n attr = (name, value) => {\n if (value != null) outer += \" \".concat(name, \"=\\\"\").concat(attrText(value), \"\\\"\");\n return m;\n },\n m = {\n open(tag) {\n push(tag);\n outer = '<' + tag;\n\n for (var _len = arguments.length, attrs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n attrs[_key - 1] = arguments[_key];\n }\n\n for (const set of attrs) {\n for (const key in set) attr(key, set[key]);\n }\n\n return m;\n },\n\n close() {\n const tag = stack.pop();\n\n if (outer) {\n buf += outer + (inner ? \">\".concat(inner, \"\") : '/>');\n } else {\n buf += \"\");\n }\n\n clear();\n return m;\n },\n\n attr,\n text: t => (inner += innerText(t), m),\n toString: () => buf\n };\n\n return m;\n}\nconst serializeXML = node => _serialize(markup(), node) + '';\n\nfunction _serialize(m, node) {\n m.open(node.tagName);\n\n if (node.hasAttributes()) {\n const attrs = node.attributes,\n n = attrs.length;\n\n for (let i = 0; i < n; ++i) {\n m.attr(attrs[i].name, attrs[i].value);\n }\n }\n\n if (node.hasChildNodes()) {\n const children = node.childNodes;\n\n for (const child of children) {\n child.nodeType === 3 // text node\n ? m.text(child.nodeValue) : _serialize(m, child);\n }\n }\n\n return m.close();\n}\n\nconst stylesAttr = {\n fill: 'fill',\n fillOpacity: 'fill-opacity',\n stroke: 'stroke',\n strokeOpacity: 'stroke-opacity',\n strokeWidth: 'stroke-width',\n strokeCap: 'stroke-linecap',\n strokeJoin: 'stroke-linejoin',\n strokeDash: 'stroke-dasharray',\n strokeDashOffset: 'stroke-dashoffset',\n strokeMiterLimit: 'stroke-miterlimit',\n opacity: 'opacity'\n};\nconst stylesCss = {\n blend: 'mix-blend-mode'\n}; // ensure miter limit default is consistent with canvas (#2498)\n\nconst rootAttributes = {\n 'fill': 'none',\n 'stroke-miterlimit': 10\n};\n\nconst RootIndex = 0,\n xmlns = 'http://www.w3.org/2000/xmlns/',\n svgns = metadata.xmlns;\nfunction SVGRenderer(loader) {\n Renderer.call(this, loader);\n this._dirtyID = 0;\n this._dirty = [];\n this._svg = null;\n this._root = null;\n this._defs = null;\n}\nconst base = Renderer.prototype;\ninherits(SVGRenderer, Renderer, {\n /**\n * Initialize a new SVGRenderer instance.\n * @param {DOMElement} el - The containing DOM element for the display.\n * @param {number} width - The coordinate width of the display, in pixels.\n * @param {number} height - The coordinate height of the display, in pixels.\n * @param {Array} origin - The origin of the display, in pixels.\n * The coordinate system will be translated to this point.\n * @param {number} [scaleFactor=1] - Optional scaleFactor by which to multiply\n * the width and height to determine the final pixel size.\n * @return {SVGRenderer} - This renderer instance.\n */\n initialize(el, width, height, origin, scaleFactor) {\n // create the svg definitions cache\n this._defs = {};\n\n this._clearDefs();\n\n if (el) {\n this._svg = domChild(el, 0, 'svg', svgns);\n\n this._svg.setAttributeNS(xmlns, 'xmlns', svgns);\n\n this._svg.setAttributeNS(xmlns, 'xmlns:xlink', metadata['xmlns:xlink']);\n\n this._svg.setAttribute('version', metadata['version']);\n\n this._svg.setAttribute('class', 'marks');\n\n domClear(el, 1); // set the svg root group\n\n this._root = domChild(this._svg, RootIndex, 'g', svgns);\n setAttributes(this._root, rootAttributes); // ensure no additional child elements\n\n domClear(this._svg, RootIndex + 1);\n } // set background color if defined\n\n\n this.background(this._bgcolor);\n return base.initialize.call(this, el, width, height, origin, scaleFactor);\n },\n\n /**\n * Get / set the background color.\n */\n background(bgcolor) {\n if (arguments.length && this._svg) {\n this._svg.style.setProperty('background-color', bgcolor);\n }\n\n return base.background.apply(this, arguments);\n },\n\n /**\n * Resize the display.\n * @param {number} width - The new coordinate width of the display, in pixels.\n * @param {number} height - The new coordinate height of the display, in pixels.\n * @param {Array} origin - The new origin of the display, in pixels.\n * The coordinate system will be translated to this point.\n * @param {number} [scaleFactor=1] - Optional scaleFactor by which to multiply\n * the width and height to determine the final pixel size.\n * @return {SVGRenderer} - This renderer instance;\n */\n resize(width, height, origin, scaleFactor) {\n base.resize.call(this, width, height, origin, scaleFactor);\n\n if (this._svg) {\n setAttributes(this._svg, {\n width: this._width * this._scale,\n height: this._height * this._scale,\n viewBox: \"0 0 \".concat(this._width, \" \").concat(this._height)\n });\n\n this._root.setAttribute('transform', \"translate(\".concat(this._origin, \")\"));\n }\n\n this._dirty = [];\n return this;\n },\n\n /**\n * Returns the SVG element of the visualization.\n * @return {DOMElement} - The SVG element.\n */\n canvas() {\n return this._svg;\n },\n\n /**\n * Returns an SVG text string for the rendered content,\n * or null if this renderer is currently headless.\n */\n svg() {\n const svg = this._svg,\n bg = this._bgcolor;\n if (!svg) return null;\n let node;\n\n if (bg) {\n svg.removeAttribute('style');\n node = domChild(svg, RootIndex, 'rect', svgns);\n setAttributes(node, {\n width: this._width,\n height: this._height,\n fill: bg\n });\n }\n\n const text = serializeXML(svg);\n\n if (bg) {\n svg.removeChild(node);\n\n this._svg.style.setProperty('background-color', bg);\n }\n\n return text;\n },\n\n /**\n * Internal rendering method.\n * @param {object} scene - The root mark of a scenegraph to render.\n */\n _render(scene) {\n // perform spot updates and re-render markup\n if (this._dirtyCheck()) {\n if (this._dirtyAll) this._clearDefs();\n this.mark(this._root, scene);\n domClear(this._root, 1);\n }\n\n this.defs();\n this._dirty = [];\n ++this._dirtyID;\n return this;\n },\n\n // -- Manage rendering of items marked as dirty --\n\n /**\n * Flag a mark item as dirty.\n * @param {Item} item - The mark item.\n */\n dirty(item) {\n if (item.dirty !== this._dirtyID) {\n item.dirty = this._dirtyID;\n\n this._dirty.push(item);\n }\n },\n\n /**\n * Check if a mark item is considered dirty.\n * @param {Item} item - The mark item.\n */\n isDirty(item) {\n return this._dirtyAll || !item._svg || !item._svg.ownerSVGElement || item.dirty === this._dirtyID;\n },\n\n /**\n * Internal method to check dirty status and, if possible,\n * make targetted updates without a full rendering pass.\n */\n _dirtyCheck() {\n this._dirtyAll = true;\n const items = this._dirty;\n if (!items.length || !this._dirtyID) return true;\n const id = ++this._dirtyID;\n let item, mark, type, mdef, i, n, o;\n\n for (i = 0, n = items.length; i < n; ++i) {\n item = items[i];\n mark = item.mark;\n\n if (mark.marktype !== type) {\n // memoize mark instance lookup\n type = mark.marktype;\n mdef = Marks[type];\n }\n\n if (mark.zdirty && mark.dirty !== id) {\n this._dirtyAll = false;\n dirtyParents(item, id);\n mark.items.forEach(i => {\n i.dirty = id;\n });\n }\n\n if (mark.zdirty) continue; // handle in standard drawing pass\n\n if (item.exit) {\n // EXIT\n if (mdef.nested && mark.items.length) {\n // if nested mark with remaining points, update instead\n o = mark.items[0];\n if (o._svg) this._update(mdef, o._svg, o);\n } else if (item._svg) {\n // otherwise remove from DOM\n o = item._svg.parentNode;\n if (o) o.removeChild(item._svg);\n }\n\n item._svg = null;\n continue;\n }\n\n item = mdef.nested ? mark.items[0] : item;\n if (item._update === id) continue; // already visited\n\n if (!item._svg || !item._svg.ownerSVGElement) {\n // ENTER\n this._dirtyAll = false;\n dirtyParents(item, id);\n } else {\n // IN-PLACE UPDATE\n this._update(mdef, item._svg, item);\n }\n\n item._update = id;\n }\n\n return !this._dirtyAll;\n },\n\n // -- Construct & maintain scenegraph to SVG mapping ---\n\n /**\n * Render a set of mark items.\n * @param {SVGElement} el - The parent element in the SVG tree.\n * @param {object} scene - The mark parent to render.\n * @param {SVGElement} prev - The previous sibling in the SVG tree.\n */\n mark(el, scene, prev) {\n if (!this.isDirty(scene)) {\n return scene._svg;\n }\n\n const svg = this._svg,\n mdef = Marks[scene.marktype],\n events = scene.interactive === false ? 'none' : null,\n isGroup = mdef.tag === 'g';\n const parent = bind(scene, el, prev, 'g', svg);\n parent.setAttribute('class', cssClass(scene)); // apply aria attributes to parent container element\n\n const aria = ariaMarkAttributes(scene);\n\n for (const key in aria) setAttribute(parent, key, aria[key]);\n\n if (!isGroup) {\n setAttribute(parent, 'pointer-events', events);\n }\n\n setAttribute(parent, 'clip-path', scene.clip ? clip$1(this, scene, scene.group) : null);\n let sibling = null,\n i = 0;\n\n const process = item => {\n const dirty = this.isDirty(item),\n node = bind(item, parent, sibling, mdef.tag, svg);\n\n if (dirty) {\n this._update(mdef, node, item);\n\n if (isGroup) recurse(this, node, item);\n }\n\n sibling = node;\n ++i;\n };\n\n if (mdef.nested) {\n if (scene.items.length) process(scene.items[0]);\n } else {\n visit(scene, process);\n }\n\n domClear(parent, i);\n return parent;\n },\n\n /**\n * Update the attributes of an SVG element for a mark item.\n * @param {object} mdef - The mark definition object\n * @param {SVGElement} el - The SVG element.\n * @param {Item} item - The mark item.\n */\n _update(mdef, el, item) {\n // set dom element and values cache\n // provides access to emit method\n element = el;\n values = el.__values__; // apply aria-specific properties\n\n ariaItemAttributes(emit, item); // apply svg attributes\n\n mdef.attr(emit, item, this); // some marks need special treatment\n\n const extra = mark_extras[mdef.type];\n if (extra) extra.call(this, mdef, el, item); // apply svg style attributes\n // note: element state may have been modified by 'extra' method\n\n if (element) this.style(element, item);\n },\n\n /**\n * Update the presentation attributes of an SVG element for a mark item.\n * @param {SVGElement} el - The SVG element.\n * @param {Item} item - The mark item.\n */\n style(el, item) {\n if (item == null) return;\n\n for (const prop in stylesAttr) {\n let value = prop === 'font' ? fontFamily(item) : item[prop];\n if (value === values[prop]) continue;\n const name = stylesAttr[prop];\n\n if (value == null) {\n el.removeAttribute(name);\n } else {\n if (isGradient(value)) {\n value = gradientRef(value, this._defs.gradient, href());\n }\n\n el.setAttribute(name, value + '');\n }\n\n values[prop] = value;\n }\n\n for (const prop in stylesCss) {\n setStyle(el, stylesCss[prop], item[prop]);\n }\n },\n\n /**\n * Render SVG defs, as needed.\n * Must be called *after* marks have been processed to ensure the\n * collected state is current and accurate.\n */\n defs() {\n const svg = this._svg,\n defs = this._defs;\n let el = defs.el,\n index = 0;\n\n for (const id in defs.gradient) {\n if (!el) defs.el = el = domChild(svg, RootIndex + 1, 'defs', svgns);\n index = updateGradient(el, defs.gradient[id], index);\n }\n\n for (const id in defs.clipping) {\n if (!el) defs.el = el = domChild(svg, RootIndex + 1, 'defs', svgns);\n index = updateClipping(el, defs.clipping[id], index);\n } // clean-up\n\n\n if (el) {\n index === 0 ? (svg.removeChild(el), defs.el = null) : domClear(el, index);\n }\n },\n\n /**\n * Clear defs caches.\n */\n _clearDefs() {\n const def = this._defs;\n def.gradient = {};\n def.clipping = {};\n }\n\n}); // mark ancestor chain with a dirty id\n\nfunction dirtyParents(item, id) {\n for (; item && item.dirty !== id; item = item.mark.group) {\n item.dirty = id;\n\n if (item.mark && item.mark.dirty !== id) {\n item.mark.dirty = id;\n } else return;\n }\n} // update gradient definitions\n\n\nfunction updateGradient(el, grad, index) {\n let i, n, stop;\n\n if (grad.gradient === 'radial') {\n // SVG radial gradients automatically transform to normalized bbox\n // coordinates, in a way that is cumbersome to replicate in canvas.\n // We wrap the radial gradient in a pattern element, allowing us to\n // maintain a circular gradient that matches what canvas provides.\n let pt = domChild(el, index++, 'pattern', svgns);\n setAttributes(pt, {\n id: patternPrefix + grad.id,\n viewBox: '0,0,1,1',\n width: '100%',\n height: '100%',\n preserveAspectRatio: 'xMidYMid slice'\n });\n pt = domChild(pt, 0, 'rect', svgns);\n setAttributes(pt, {\n width: 1,\n height: 1,\n fill: \"url(\".concat(href(), \"#\").concat(grad.id, \")\")\n });\n el = domChild(el, index++, 'radialGradient', svgns);\n setAttributes(el, {\n id: grad.id,\n fx: grad.x1,\n fy: grad.y1,\n fr: grad.r1,\n cx: grad.x2,\n cy: grad.y2,\n r: grad.r2\n });\n } else {\n el = domChild(el, index++, 'linearGradient', svgns);\n setAttributes(el, {\n id: grad.id,\n x1: grad.x1,\n x2: grad.x2,\n y1: grad.y1,\n y2: grad.y2\n });\n }\n\n for (i = 0, n = grad.stops.length; i < n; ++i) {\n stop = domChild(el, i, 'stop', svgns);\n stop.setAttribute('offset', grad.stops[i].offset);\n stop.setAttribute('stop-color', grad.stops[i].color);\n }\n\n domClear(el, i);\n return index;\n} // update clipping path definitions\n\n\nfunction updateClipping(el, clip, index) {\n let mask;\n el = domChild(el, index, 'clipPath', svgns);\n el.setAttribute('id', clip.id);\n\n if (clip.path) {\n mask = domChild(el, 0, 'path', svgns);\n mask.setAttribute('d', clip.path);\n } else {\n mask = domChild(el, 0, 'rect', svgns);\n setAttributes(mask, {\n x: 0,\n y: 0,\n width: clip.width,\n height: clip.height\n });\n }\n\n domClear(el, 1);\n return index + 1;\n} // Recursively process group contents.\n\n\nfunction recurse(renderer, el, group) {\n // child 'g' element is second to last among children (path, g, path)\n // other children here are foreground and background path elements\n el = el.lastChild.previousSibling;\n let prev,\n idx = 0;\n visit(group, item => {\n prev = renderer.mark(el, item, prev);\n ++idx;\n }); // remove any extraneous DOM elements\n\n domClear(el, 1 + idx);\n} // Bind a scenegraph item to an SVG DOM element.\n// Create new SVG elements as needed.\n\n\nfunction bind(item, el, sibling, tag, svg) {\n let node = item._svg,\n doc; // create a new dom node if needed\n\n if (!node) {\n doc = el.ownerDocument;\n node = domCreate(doc, tag, svgns);\n item._svg = node;\n\n if (item.mark) {\n node.__data__ = item;\n node.__values__ = {\n fill: 'default'\n }; // if group, create background, content, and foreground elements\n\n if (tag === 'g') {\n const bg = domCreate(doc, 'path', svgns);\n node.appendChild(bg);\n bg.__data__ = item;\n const cg = domCreate(doc, 'g', svgns);\n node.appendChild(cg);\n cg.__data__ = item;\n const fg = domCreate(doc, 'path', svgns);\n node.appendChild(fg);\n fg.__data__ = item;\n fg.__values__ = {\n fill: 'default'\n };\n }\n }\n } // (re-)insert if (a) not contained in SVG or (b) sibling order has changed\n\n\n if (node.ownerSVGElement !== svg || siblingCheck(node, sibling)) {\n el.insertBefore(node, sibling ? sibling.nextSibling : el.firstChild);\n }\n\n return node;\n} // check if two nodes are ordered siblings\n\n\nfunction siblingCheck(node, sibling) {\n return node.parentNode && node.parentNode.childNodes.length > 1 && node.previousSibling != sibling; // treat null/undefined the same\n} // -- Set attributes & styles on SVG elements ---\n\n\nlet element = null,\n // temp var for current SVG element\nvalues = null; // temp var for current values hash\n// Extra configuration for certain mark types\n\nconst mark_extras = {\n group(mdef, el, item) {\n const fg = element = el.childNodes[2];\n values = fg.__values__;\n mdef.foreground(emit, item, this);\n values = el.__values__; // use parent's values hash\n\n element = el.childNodes[1];\n mdef.content(emit, item, this);\n const bg = element = el.childNodes[0];\n mdef.background(emit, item, this);\n const value = item.mark.interactive === false ? 'none' : null;\n\n if (value !== values.events) {\n setAttribute(fg, 'pointer-events', value);\n setAttribute(bg, 'pointer-events', value);\n values.events = value;\n }\n\n if (item.strokeForeground && item.stroke) {\n const fill = item.fill;\n setAttribute(fg, 'display', null); // set style of background\n\n this.style(bg, item);\n setAttribute(bg, 'stroke', null); // set style of foreground\n\n if (fill) item.fill = null;\n values = fg.__values__;\n this.style(fg, item);\n if (fill) item.fill = fill; // leave element null to prevent downstream styling\n\n element = null;\n } else {\n // ensure foreground is ignored\n setAttribute(fg, 'display', 'none');\n }\n },\n\n image(mdef, el, item) {\n if (item.smooth === false) {\n setStyle(el, 'image-rendering', 'optimizeSpeed');\n setStyle(el, 'image-rendering', 'pixelated');\n } else {\n setStyle(el, 'image-rendering', null);\n }\n },\n\n text(mdef, el, item) {\n const tl = textLines(item);\n let key, value, doc, lh;\n\n if (isArray(tl)) {\n // multi-line text\n value = tl.map(_ => textValue(item, _));\n key = value.join('\\n'); // content cache key\n\n if (key !== values.text) {\n domClear(el, 0);\n doc = el.ownerDocument;\n lh = lineHeight(item);\n value.forEach((t, i) => {\n const ts = domCreate(doc, 'tspan', svgns);\n ts.__data__ = item; // data binding\n\n ts.textContent = t;\n\n if (i) {\n ts.setAttribute('x', 0);\n ts.setAttribute('dy', lh);\n }\n\n el.appendChild(ts);\n });\n values.text = key;\n }\n } else {\n // single-line text\n value = textValue(item, tl);\n\n if (value !== values.text) {\n el.textContent = value;\n values.text = value;\n }\n }\n\n setAttribute(el, 'font-family', fontFamily(item));\n setAttribute(el, 'font-size', fontSize(item) + 'px');\n setAttribute(el, 'font-style', item.fontStyle);\n setAttribute(el, 'font-variant', item.fontVariant);\n setAttribute(el, 'font-weight', item.fontWeight);\n }\n\n};\n\nfunction emit(name, value, ns) {\n // early exit if value is unchanged\n if (value === values[name]) return; // use appropriate method given namespace (ns)\n\n if (ns) {\n setAttributeNS(element, name, value, ns);\n } else {\n setAttribute(element, name, value);\n } // note current value for future comparison\n\n\n values[name] = value;\n}\n\nfunction setStyle(el, name, value) {\n if (value !== values[name]) {\n if (value == null) {\n el.style.removeProperty(name);\n } else {\n el.style.setProperty(name, value + '');\n }\n\n values[name] = value;\n }\n}\n\nfunction setAttributes(el, attrs) {\n for (const key in attrs) {\n setAttribute(el, key, attrs[key]);\n }\n}\n\nfunction setAttribute(el, name, value) {\n if (value != null) {\n // if value is provided, update DOM attribute\n el.setAttribute(name, value);\n } else {\n // else remove DOM attribute\n el.removeAttribute(name);\n }\n}\n\nfunction setAttributeNS(el, name, value, ns) {\n if (value != null) {\n // if value is provided, update DOM attribute\n el.setAttributeNS(ns, name, value);\n } else {\n // else remove DOM attribute\n el.removeAttributeNS(ns, name);\n }\n}\n\nfunction href() {\n let loc;\n return typeof window === 'undefined' ? '' : (loc = window.location).hash ? loc.href.slice(0, -loc.hash.length) : loc.href;\n}\n\nfunction SVGStringRenderer(loader) {\n Renderer.call(this, loader);\n this._text = null;\n this._defs = {\n gradient: {},\n clipping: {}\n };\n}\ninherits(SVGStringRenderer, Renderer, {\n /**\n * Returns the rendered SVG text string,\n * or null if rendering has not yet occurred.\n */\n svg() {\n return this._text;\n },\n\n /**\n * Internal rendering method.\n * @param {object} scene - The root mark of a scenegraph to render.\n */\n _render(scene) {\n const m = markup(); // svg tag\n\n m.open('svg', extend({}, metadata, {\n class: 'marks',\n width: this._width * this._scale,\n height: this._height * this._scale,\n viewBox: \"0 0 \".concat(this._width, \" \").concat(this._height)\n })); // background, if defined\n\n const bg = this._bgcolor;\n\n if (bg && bg !== 'transparent' && bg !== 'none') {\n m.open('rect', {\n width: this._width,\n height: this._height,\n fill: bg\n }).close();\n } // root content group\n\n\n m.open('g', rootAttributes, {\n transform: 'translate(' + this._origin + ')'\n });\n this.mark(m, scene);\n m.close(); // \n // defs\n\n this.defs(m); // get SVG text string\n\n this._text = m.close() + '';\n return this;\n },\n\n /**\n * Render a set of mark items.\n * @param {object} m - The markup context.\n * @param {object} scene - The mark parent to render.\n */\n mark(m, scene) {\n const mdef = Marks[scene.marktype],\n tag = mdef.tag,\n attrList = [ariaItemAttributes, mdef.attr]; // render opening group tag\n\n m.open('g', {\n 'class': cssClass(scene),\n 'clip-path': scene.clip ? clip$1(this, scene, scene.group) : null\n }, ariaMarkAttributes(scene), {\n 'pointer-events': tag !== 'g' && scene.interactive === false ? 'none' : null\n }); // render contained elements\n\n const process = item => {\n const href = this.href(item);\n if (href) m.open('a', href);\n m.open(tag, this.attr(scene, item, attrList, tag !== 'g' ? tag : null));\n\n if (tag === 'text') {\n const tl = textLines(item);\n\n if (isArray(tl)) {\n // multi-line text\n const attrs = {\n x: 0,\n dy: lineHeight(item)\n };\n\n for (let i = 0; i < tl.length; ++i) {\n m.open('tspan', i ? attrs : null).text(textValue(item, tl[i])).close();\n }\n } else {\n // single-line text\n m.text(textValue(item, tl));\n }\n } else if (tag === 'g') {\n const fore = item.strokeForeground,\n fill = item.fill,\n stroke = item.stroke;\n\n if (fore && stroke) {\n item.stroke = null;\n }\n\n m.open('path', this.attr(scene, item, mdef.background, 'bgrect')).close(); // recurse for group content\n\n m.open('g', this.attr(scene, item, mdef.content));\n visit(item, scene => this.mark(m, scene));\n m.close();\n\n if (fore && stroke) {\n if (fill) item.fill = null;\n item.stroke = stroke;\n m.open('path', this.attr(scene, item, mdef.foreground, 'bgrect')).close();\n if (fill) item.fill = fill;\n } else {\n m.open('path', this.attr(scene, item, mdef.foreground, 'bgfore')).close();\n }\n }\n\n m.close(); // \n\n if (href) m.close(); // \n };\n\n if (mdef.nested) {\n if (scene.items && scene.items.length) process(scene.items[0]);\n } else {\n visit(scene, process);\n } // render closing group tag\n\n\n return m.close(); // \n },\n\n /**\n * Get href attributes for a hyperlinked mark item.\n * @param {Item} item - The mark item.\n */\n href(item) {\n const href = item.href;\n let attr;\n\n if (href) {\n if (attr = this._hrefs && this._hrefs[href]) {\n return attr;\n } else {\n this.sanitizeURL(href).then(attr => {\n // rewrite to use xlink namespace\n attr['xlink:href'] = attr.href;\n attr.href = null;\n (this._hrefs || (this._hrefs = {}))[href] = attr;\n });\n }\n }\n\n return null;\n },\n\n /**\n * Get an object of SVG attributes for a mark item.\n * @param {object} scene - The mark parent.\n * @param {Item} item - The mark item.\n * @param {array|function} attrs - One or more attribute emitters.\n * @param {string} tag - The tag being rendered.\n */\n attr(scene, item, attrs, tag) {\n const object = {},\n emit = (name, value, ns, prefixed) => {\n object[prefixed || name] = value;\n }; // apply mark specific attributes\n\n\n if (Array.isArray(attrs)) {\n attrs.forEach(fn => fn(emit, item, this));\n } else {\n attrs(emit, item, this);\n } // apply style attributes\n\n\n if (tag) {\n style(object, item, scene, tag, this._defs);\n }\n\n return object;\n },\n\n /**\n * Render SVG defs, as needed.\n * Must be called *after* marks have been processed to ensure the\n * collected state is current and accurate.\n * @param {object} m - The markup context.\n */\n defs(m) {\n const gradient = this._defs.gradient,\n clipping = this._defs.clipping,\n count = Object.keys(gradient).length + Object.keys(clipping).length;\n if (count === 0) return; // nothing to do\n\n m.open('defs');\n\n for (const id in gradient) {\n const def = gradient[id],\n stops = def.stops;\n\n if (def.gradient === 'radial') {\n // SVG radial gradients automatically transform to normalized bbox\n // coordinates, in a way that is cumbersome to replicate in canvas.\n // We wrap the radial gradient in a pattern element, allowing us to\n // maintain a circular gradient that matches what canvas provides.\n m.open('pattern', {\n id: patternPrefix + id,\n viewBox: '0,0,1,1',\n width: '100%',\n height: '100%',\n preserveAspectRatio: 'xMidYMid slice'\n });\n m.open('rect', {\n width: '1',\n height: '1',\n fill: 'url(#' + id + ')'\n }).close();\n m.close(); // \n\n m.open('radialGradient', {\n id: id,\n fx: def.x1,\n fy: def.y1,\n fr: def.r1,\n cx: def.x2,\n cy: def.y2,\n r: def.r2\n });\n } else {\n m.open('linearGradient', {\n id: id,\n x1: def.x1,\n x2: def.x2,\n y1: def.y1,\n y2: def.y2\n });\n }\n\n for (let i = 0; i < stops.length; ++i) {\n m.open('stop', {\n offset: stops[i].offset,\n 'stop-color': stops[i].color\n }).close();\n }\n\n m.close();\n }\n\n for (const id in clipping) {\n const def = clipping[id];\n m.open('clipPath', {\n id: id\n });\n\n if (def.path) {\n m.open('path', {\n d: def.path\n }).close();\n } else {\n m.open('rect', {\n x: 0,\n y: 0,\n width: def.width,\n height: def.height\n }).close();\n }\n\n m.close();\n }\n\n m.close();\n }\n\n}); // Helper function for attr for style presentation attributes\n\nfunction style(s, item, scene, tag, defs) {\n let styleList;\n if (item == null) return s;\n\n if (tag === 'bgrect' && scene.interactive === false) {\n s['pointer-events'] = 'none';\n }\n\n if (tag === 'bgfore') {\n if (scene.interactive === false) {\n s['pointer-events'] = 'none';\n }\n\n s.display = 'none';\n if (item.fill !== null) return s;\n }\n\n if (tag === 'image' && item.smooth === false) {\n styleList = ['image-rendering: optimizeSpeed;', 'image-rendering: pixelated;'];\n }\n\n if (tag === 'text') {\n s['font-family'] = fontFamily(item);\n s['font-size'] = fontSize(item) + 'px';\n s['font-style'] = item.fontStyle;\n s['font-variant'] = item.fontVariant;\n s['font-weight'] = item.fontWeight;\n }\n\n for (const prop in stylesAttr) {\n let value = item[prop];\n const name = stylesAttr[prop];\n\n if (value === 'transparent' && (name === 'fill' || name === 'stroke')) ; else if (value != null) {\n if (isGradient(value)) {\n value = gradientRef(value, defs.gradient, '');\n }\n\n s[name] = value;\n }\n }\n\n for (const prop in stylesCss) {\n const value = item[prop];\n\n if (value != null) {\n styleList = styleList || [];\n styleList.push(\"\".concat(stylesCss[prop], \": \").concat(value, \";\"));\n }\n }\n\n if (styleList) {\n s.style = styleList.join(' ');\n }\n\n return s;\n}\n\nconst Canvas = 'canvas';\nconst PNG = 'png';\nconst SVG = 'svg';\nconst None = 'none';\nconst RenderType = {\n Canvas: Canvas,\n PNG: PNG,\n SVG: SVG,\n None: None\n};\nconst modules = {};\nmodules[Canvas] = modules[PNG] = {\n renderer: CanvasRenderer,\n headless: CanvasRenderer,\n handler: CanvasHandler\n};\nmodules[SVG] = {\n renderer: SVGRenderer,\n headless: SVGStringRenderer,\n handler: SVGHandler\n};\nmodules[None] = {};\nfunction renderModule(name, _) {\n name = String(name || '').toLowerCase();\n\n if (arguments.length > 1) {\n modules[name] = _;\n return this;\n } else {\n return modules[name];\n }\n}\n\nfunction intersect(scene, bounds, filter) {\n const hits = [],\n // intersection results\n box = new Bounds().union(bounds),\n // defensive copy\n type = scene.marktype;\n return type ? intersectMark(scene, box, filter, hits) : type === 'group' ? intersectGroup(scene, box, filter, hits) : error('Intersect scene must be mark node or group item.');\n}\n\nfunction intersectMark(mark, box, filter, hits) {\n if (visitMark(mark, box, filter)) {\n const items = mark.items,\n type = mark.marktype,\n n = items.length;\n let i = 0;\n\n if (type === 'group') {\n for (; i < n; ++i) {\n intersectGroup(items[i], box, filter, hits);\n }\n } else {\n for (const test = Marks[type].isect; i < n; ++i) {\n const item = items[i];\n if (intersectItem(item, box, test)) hits.push(item);\n }\n }\n }\n\n return hits;\n}\n\nfunction visitMark(mark, box, filter) {\n // process if bounds intersect and if\n // (1) mark is a group mark (so we must recurse), or\n // (2) mark is interactive and passes filter\n return mark.bounds && box.intersects(mark.bounds) && (mark.marktype === 'group' || mark.interactive !== false && (!filter || filter(mark)));\n}\n\nfunction intersectGroup(group, box, filter, hits) {\n // test intersect against group\n // skip groups by default unless filter says otherwise\n if (filter && filter(group.mark) && intersectItem(group, box, Marks.group.isect)) {\n hits.push(group);\n } // recursively test children marks\n // translate box to group coordinate space\n\n\n const marks = group.items,\n n = marks && marks.length;\n\n if (n) {\n const x = group.x || 0,\n y = group.y || 0;\n box.translate(-x, -y);\n\n for (let i = 0; i < n; ++i) {\n intersectMark(marks[i], box, filter, hits);\n }\n\n box.translate(x, y);\n }\n\n return hits;\n}\n\nfunction intersectItem(item, box, test) {\n // test bounds enclosure, bounds intersection, then detailed test\n const bounds = item.bounds;\n return box.encloses(bounds) || box.intersects(bounds) && test(item, box);\n}\n\nconst clipBounds = new Bounds();\nfunction boundClip (mark) {\n const clip = mark.clip;\n\n if (isFunction(clip)) {\n clip(boundContext(clipBounds.clear()));\n } else if (clip) {\n clipBounds.set(0, 0, mark.group.width, mark.group.height);\n } else return;\n\n mark.bounds.intersect(clipBounds);\n}\n\nconst TOLERANCE = 1e-9;\nfunction sceneEqual(a, b, key) {\n return a === b ? true : key === 'path' ? pathEqual(a, b) : a instanceof Date && b instanceof Date ? +a === +b : isNumber(a) && isNumber(b) ? Math.abs(a - b) <= TOLERANCE : !a || !b || !isObject(a) && !isObject(b) ? a == b : objectEqual(a, b);\n}\nfunction pathEqual(a, b) {\n return sceneEqual(parse(a), parse(b));\n}\n\nfunction objectEqual(a, b) {\n var ka = Object.keys(a),\n kb = Object.keys(b),\n key,\n i;\n if (ka.length !== kb.length) return false;\n ka.sort();\n kb.sort();\n\n for (i = ka.length - 1; i >= 0; i--) {\n if (ka[i] != kb[i]) return false;\n }\n\n for (i = ka.length - 1; i >= 0; i--) {\n key = ka[i];\n if (!sceneEqual(a[key], b[key], key)) return false;\n }\n\n return typeof a === typeof b;\n}\n\nfunction resetSVGDefIds() {\n resetSVGClipId();\n resetSVGGradientId();\n}\n\nexport { Bounds, CanvasHandler, CanvasRenderer, Gradient, GroupItem, Handler, Item, Marks, RenderType, Renderer, ResourceLoader, SVGHandler, SVGRenderer, SVGStringRenderer, Scenegraph, boundClip, boundContext, boundItem, boundMark, boundStroke, domChild, domClear, domCreate, domFind, font, fontFamily, fontSize, intersect, intersectBoxLine, intersectPath, intersectPoint, intersectRule, lineHeight, markup, multiLineOffset, curves as pathCurves, pathEqual, parse as pathParse, vg_rect as pathRectangle, pathRender, symbols as pathSymbols, vg_trail as pathTrail, point, renderModule, resetSVGClipId, resetSVGDefIds, sceneEqual, sceneFromJSON, pickVisit as scenePickVisit, sceneToJSON, visit as sceneVisit, zorder as sceneZOrder, serializeXML, textMetrics };\n","import {path} from \"d3-path\";\nimport constant from \"./constant.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 x from \"./symbol/x.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 x,\n triangle2,\n asterisk,\n square2,\n diamond2\n];\n\nexport default function Symbol(type, size) {\n let context = null;\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","import { Transform } from 'vega-dataflow';\nimport { Marks, boundClip, GroupItem, Item, Bounds, multiLineOffset, boundStroke } from 'vega-scenegraph';\nimport { inherits, peek, isObject } from 'vega-util';\n\nconst Top = 'top';\nconst Left = 'left';\nconst Right = 'right';\nconst Bottom = 'bottom';\nconst TopLeft = 'top-left';\nconst TopRight = 'top-right';\nconst BottomLeft = 'bottom-left';\nconst BottomRight = 'bottom-right';\nconst Start = 'start';\nconst Middle = 'middle';\nconst End = 'end';\nconst X = 'x';\nconst Y = 'y';\nconst Group = 'group';\nconst AxisRole = 'axis';\nconst TitleRole = 'title';\nconst FrameRole = 'frame';\nconst ScopeRole = 'scope';\nconst LegendRole = 'legend';\nconst RowHeader = 'row-header';\nconst RowFooter = 'row-footer';\nconst RowTitle = 'row-title';\nconst ColHeader = 'column-header';\nconst ColFooter = 'column-footer';\nconst ColTitle = 'column-title';\nconst Padding = 'padding';\nconst Symbols = 'symbol';\nconst Fit = 'fit';\nconst FitX = 'fit-x';\nconst FitY = 'fit-y';\nconst Pad = 'pad';\nconst None = 'none';\nconst All = 'all';\nconst Each = 'each';\nconst Flush = 'flush';\nconst Column = 'column';\nconst Row = 'row';\n\n/**\n * Calculate bounding boxes for scenegraph items.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {object} params.mark - The scenegraph mark instance to bound.\n */\n\nfunction Bound(params) {\n Transform.call(this, null, params);\n}\ninherits(Bound, Transform, {\n transform(_, pulse) {\n const view = pulse.dataflow,\n mark = _.mark,\n type = mark.marktype,\n entry = Marks[type],\n bound = entry.bound;\n let markBounds = mark.bounds,\n rebound;\n\n if (entry.nested) {\n // multi-item marks have a single bounds instance\n if (mark.items.length) view.dirty(mark.items[0]);\n markBounds = boundItem(mark, bound);\n mark.items.forEach(item => {\n item.bounds.clear().union(markBounds);\n });\n } else if (type === Group || _.modified()) {\n // operator parameters modified -> re-bound all items\n // updates group bounds in response to modified group content\n pulse.visit(pulse.MOD, item => view.dirty(item));\n markBounds.clear();\n mark.items.forEach(item => markBounds.union(boundItem(item, bound))); // force reflow for axes/legends/titles to propagate any layout changes\n\n switch (mark.role) {\n case AxisRole:\n case LegendRole:\n case TitleRole:\n pulse.reflow();\n }\n } else {\n // incrementally update bounds, re-bound mark as needed\n rebound = pulse.changed(pulse.REM);\n pulse.visit(pulse.ADD, item => {\n markBounds.union(boundItem(item, bound));\n });\n pulse.visit(pulse.MOD, item => {\n rebound = rebound || markBounds.alignsWith(item.bounds);\n view.dirty(item);\n markBounds.union(boundItem(item, bound));\n });\n\n if (rebound) {\n markBounds.clear();\n mark.items.forEach(item => markBounds.union(item.bounds));\n }\n } // ensure mark bounds do not exceed any clipping region\n\n\n boundClip(mark);\n return pulse.modifies('bounds');\n }\n\n});\n\nfunction boundItem(item, bound, opt) {\n return bound(item.bounds.clear(), item, opt);\n}\n\nconst COUNTER_NAME = ':vega_identifier:';\n/**\n * Adds a unique identifier to all added tuples.\n * This transform creates a new signal that serves as an id counter.\n * As a result, the id counter is shared across all instances of this\n * transform, generating unique ids across multiple data streams. In\n * addition, this signal value can be included in a snapshot of the\n * dataflow state, enabling correct resumption of id allocation.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {string} params.as - The field name for the generated identifier.\n */\n\nfunction Identifier(params) {\n Transform.call(this, 0, params);\n}\nIdentifier.Definition = {\n 'type': 'Identifier',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'as',\n 'type': 'string',\n 'required': true\n }]\n};\ninherits(Identifier, Transform, {\n transform(_, pulse) {\n const counter = getCounter(pulse.dataflow),\n as = _.as;\n let id = counter.value;\n pulse.visit(pulse.ADD, t => t[as] = t[as] || ++id);\n counter.set(this.value = id);\n return pulse;\n }\n\n});\n\nfunction getCounter(view) {\n return view._signals[COUNTER_NAME] || (view._signals[COUNTER_NAME] = view.add(0));\n}\n\n/**\n * Bind scenegraph items to a scenegraph mark instance.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {object} params.markdef - The mark definition for creating the mark.\n * This is an object of legal scenegraph mark properties which *must* include\n * the 'marktype' property.\n */\n\nfunction Mark(params) {\n Transform.call(this, null, params);\n}\ninherits(Mark, Transform, {\n transform(_, pulse) {\n let mark = this.value; // acquire mark on first invocation, bind context and group\n\n if (!mark) {\n mark = pulse.dataflow.scenegraph().mark(_.markdef, lookup$1(_), _.index);\n mark.group.context = _.context;\n if (!_.context.group) _.context.group = mark.group;\n mark.source = this.source; // point to upstream collector\n\n mark.clip = _.clip;\n mark.interactive = _.interactive;\n this.value = mark;\n } // initialize entering items\n\n\n const Init = mark.marktype === Group ? GroupItem : Item;\n pulse.visit(pulse.ADD, item => Init.call(item, mark)); // update clipping and/or interactive status\n\n if (_.modified('clip') || _.modified('interactive')) {\n mark.clip = _.clip;\n mark.interactive = !!_.interactive;\n mark.zdirty = true; // force scenegraph re-eval\n\n pulse.reflow();\n } // bind items array to scenegraph mark\n\n\n mark.items = pulse.source;\n return pulse;\n }\n\n});\n\nfunction lookup$1(_) {\n const g = _.groups,\n p = _.parent;\n return g && g.size === 1 ? g.get(Object.keys(g.object)[0]) : g && p ? g.lookup(p) : null;\n}\n\n/**\n * Analyze items for overlap, changing opacity to hide items with\n * overlapping bounding boxes. This transform will preserve at least\n * two items (e.g., first and last) even if overlap persists.\n * @param {object} params - The parameters for this operator.\n * @param {function(*,*): number} [params.sort] - A comparator\n * function for sorting items.\n * @param {object} [params.method] - The overlap removal method to apply.\n * One of 'parity' (default, hide every other item until there is no\n * more overlap) or 'greedy' (sequentially scan and hide and items that\n * overlap with the last visible item).\n * @param {object} [params.boundScale] - A scale whose range should be used\n * to bound the items. Items exceeding the bounds of the scale range\n * will be treated as overlapping. If null or undefined, no bounds check\n * will be applied.\n * @param {object} [params.boundOrient] - The orientation of the scale\n * (top, bottom, left, or right) used to bound items. This parameter is\n * ignored if boundScale is null or undefined.\n * @param {object} [params.boundTolerance] - The tolerance in pixels for\n * bound inclusion testing (default 1). This specifies by how many pixels\n * an item's bounds may exceed the scale range bounds and not be culled.\n * @constructor\n */\n\nfunction Overlap(params) {\n Transform.call(this, null, params);\n}\nconst methods = {\n parity: items => items.filter((item, i) => i % 2 ? item.opacity = 0 : 1),\n greedy: (items, sep) => {\n let a;\n return items.filter((b, i) => !i || !intersect(a.bounds, b.bounds, sep) ? (a = b, 1) : b.opacity = 0);\n }\n}; // compute bounding box intersection\n// including padding pixels of separation\n\nconst intersect = (a, b, sep) => sep > Math.max(b.x1 - a.x2, a.x1 - b.x2, b.y1 - a.y2, a.y1 - b.y2);\n\nconst hasOverlap = (items, pad) => {\n for (var i = 1, n = items.length, a = items[0].bounds, b; i < n; a = b, ++i) {\n if (intersect(a, b = items[i].bounds, pad)) return true;\n }\n};\n\nconst hasBounds = item => {\n const b = item.bounds;\n return b.width() > 1 && b.height() > 1;\n};\n\nconst boundTest = (scale, orient, tolerance) => {\n var range = scale.range(),\n b = new Bounds();\n\n if (orient === Top || orient === Bottom) {\n b.set(range[0], -Infinity, range[1], +Infinity);\n } else {\n b.set(-Infinity, range[0], +Infinity, range[1]);\n }\n\n b.expand(tolerance || 1);\n return item => b.encloses(item.bounds);\n}; // reset all items to be fully opaque\n\n\nconst reset = source => {\n source.forEach(item => item.opacity = 1);\n return source;\n}; // add all tuples to mod, fork pulse if parameters were modified\n// fork prevents cross-stream tuple pollution (e.g., pulse from scale)\n\n\nconst reflow = (pulse, _) => pulse.reflow(_.modified()).modifies('opacity');\n\ninherits(Overlap, Transform, {\n transform(_, pulse) {\n const reduce = methods[_.method] || methods.parity,\n sep = _.separation || 0;\n let source = pulse.materialize(pulse.SOURCE).source,\n items,\n test;\n if (!source || !source.length) return;\n\n if (!_.method) {\n // early exit if method is falsy\n if (_.modified('method')) {\n reset(source);\n pulse = reflow(pulse, _);\n }\n\n return pulse;\n } // skip labels with no content\n\n\n source = source.filter(hasBounds); // early exit, nothing to do\n\n if (!source.length) return;\n\n if (_.sort) {\n source = source.slice().sort(_.sort);\n }\n\n items = reset(source);\n pulse = reflow(pulse, _);\n\n if (items.length >= 3 && hasOverlap(items, sep)) {\n do {\n items = reduce(items, sep);\n } while (items.length >= 3 && hasOverlap(items, sep));\n\n if (items.length < 3 && !peek(source).opacity) {\n if (items.length > 1) peek(items).opacity = 0;\n peek(source).opacity = 1;\n }\n }\n\n if (_.boundScale && _.boundTolerance >= 0) {\n test = boundTest(_.boundScale, _.boundOrient, +_.boundTolerance);\n source.forEach(item => {\n if (!test(item)) item.opacity = 0;\n });\n } // re-calculate mark bounds\n\n\n const bounds = items[0].mark.bounds.clear();\n source.forEach(item => {\n if (item.opacity) bounds.union(item.bounds);\n });\n return pulse;\n }\n\n});\n\n/**\n * Queue modified scenegraph items for rendering.\n * @constructor\n */\n\nfunction Render(params) {\n Transform.call(this, null, params);\n}\ninherits(Render, Transform, {\n transform(_, pulse) {\n const view = pulse.dataflow;\n pulse.visit(pulse.ALL, item => view.dirty(item)); // set z-index dirty flag as needed\n\n if (pulse.fields && pulse.fields['zindex']) {\n const item = pulse.source && pulse.source[0];\n if (item) item.mark.zdirty = true;\n }\n }\n\n});\n\nconst tempBounds = new Bounds();\nfunction set(item, property, value) {\n return item[property] === value ? 0 : (item[property] = value, 1);\n}\n\nfunction isYAxis(mark) {\n var orient = mark.items[0].orient;\n return orient === Left || orient === Right;\n}\n\nfunction axisIndices(datum) {\n let index = +datum.grid;\n return [datum.ticks ? index++ : -1, // ticks index\n datum.labels ? index++ : -1, // labels index\n index + +datum.domain // title index\n ];\n}\n\nfunction axisLayout(view, axis, width, height) {\n var item = axis.items[0],\n datum = item.datum,\n delta = item.translate != null ? item.translate : 0.5,\n orient = item.orient,\n indices = axisIndices(datum),\n range = item.range,\n offset = item.offset,\n position = item.position,\n minExtent = item.minExtent,\n maxExtent = item.maxExtent,\n title = datum.title && item.items[indices[2]].items[0],\n titlePadding = item.titlePadding,\n bounds = item.bounds,\n dl = title && multiLineOffset(title),\n x = 0,\n y = 0,\n i,\n s;\n tempBounds.clear().union(bounds);\n bounds.clear();\n if ((i = indices[0]) > -1) bounds.union(item.items[i].bounds);\n if ((i = indices[1]) > -1) bounds.union(item.items[i].bounds); // position axis group and title\n\n switch (orient) {\n case Top:\n x = position || 0;\n y = -offset;\n s = Math.max(minExtent, Math.min(maxExtent, -bounds.y1));\n bounds.add(0, -s).add(range, 0);\n if (title) axisTitleLayout(view, title, s, titlePadding, dl, 0, -1, bounds);\n break;\n\n case Left:\n x = -offset;\n y = position || 0;\n s = Math.max(minExtent, Math.min(maxExtent, -bounds.x1));\n bounds.add(-s, 0).add(0, range);\n if (title) axisTitleLayout(view, title, s, titlePadding, dl, 1, -1, bounds);\n break;\n\n case Right:\n x = width + offset;\n y = position || 0;\n s = Math.max(minExtent, Math.min(maxExtent, bounds.x2));\n bounds.add(0, 0).add(s, range);\n if (title) axisTitleLayout(view, title, s, titlePadding, dl, 1, 1, bounds);\n break;\n\n case Bottom:\n x = position || 0;\n y = height + offset;\n s = Math.max(minExtent, Math.min(maxExtent, bounds.y2));\n bounds.add(0, 0).add(range, s);\n if (title) axisTitleLayout(view, title, s, titlePadding, 0, 0, 1, bounds);\n break;\n\n default:\n x = item.x;\n y = item.y;\n } // update bounds\n\n\n boundStroke(bounds.translate(x, y), item);\n\n if (set(item, 'x', x + delta) | set(item, 'y', y + delta)) {\n item.bounds = tempBounds;\n view.dirty(item);\n item.bounds = bounds;\n view.dirty(item);\n }\n\n return item.mark.bounds.clear().union(bounds);\n}\n\nfunction axisTitleLayout(view, title, offset, pad, dl, isYAxis, sign, bounds) {\n const b = title.bounds;\n\n if (title.auto) {\n const v = sign * (offset + dl + pad);\n let dx = 0,\n dy = 0;\n view.dirty(title);\n isYAxis ? dx = (title.x || 0) - (title.x = v) : dy = (title.y || 0) - (title.y = v);\n title.mark.bounds.clear().union(b.translate(-dx, -dy));\n view.dirty(title);\n }\n\n bounds.union(b);\n}\n\nconst min = (a, b) => Math.floor(Math.min(a, b));\n\nconst max = (a, b) => Math.ceil(Math.max(a, b));\n\nfunction gridLayoutGroups(group) {\n var groups = group.items,\n n = groups.length,\n i = 0,\n mark,\n items;\n const views = {\n marks: [],\n rowheaders: [],\n rowfooters: [],\n colheaders: [],\n colfooters: [],\n rowtitle: null,\n coltitle: null\n }; // layout axes, gather legends, collect bounds\n\n for (; i < n; ++i) {\n mark = groups[i];\n items = mark.items;\n\n if (mark.marktype === Group) {\n switch (mark.role) {\n case AxisRole:\n case LegendRole:\n case TitleRole:\n break;\n\n case RowHeader:\n views.rowheaders.push(...items);\n break;\n\n case RowFooter:\n views.rowfooters.push(...items);\n break;\n\n case ColHeader:\n views.colheaders.push(...items);\n break;\n\n case ColFooter:\n views.colfooters.push(...items);\n break;\n\n case RowTitle:\n views.rowtitle = items[0];\n break;\n\n case ColTitle:\n views.coltitle = items[0];\n break;\n\n default:\n views.marks.push(...items);\n }\n }\n }\n\n return views;\n}\n\nfunction bboxFlush(item) {\n return new Bounds().set(0, 0, item.width || 0, item.height || 0);\n}\n\nfunction bboxFull(item) {\n const b = item.bounds.clone();\n return b.empty() ? b.set(0, 0, 0, 0) : b.translate(-(item.x || 0), -(item.y || 0));\n}\n\nfunction get(opt, key, d) {\n const v = isObject(opt) ? opt[key] : opt;\n return v != null ? v : d !== undefined ? d : 0;\n}\n\nfunction offsetValue(v) {\n return v < 0 ? Math.ceil(-v) : 0;\n}\n\nfunction gridLayout(view, groups, opt) {\n var dirty = !opt.nodirty,\n bbox = opt.bounds === Flush ? bboxFlush : bboxFull,\n bounds = tempBounds.set(0, 0, 0, 0),\n alignCol = get(opt.align, Column),\n alignRow = get(opt.align, Row),\n padCol = get(opt.padding, Column),\n padRow = get(opt.padding, Row),\n ncols = opt.columns || groups.length,\n nrows = ncols <= 0 ? 1 : Math.ceil(groups.length / ncols),\n n = groups.length,\n xOffset = Array(n),\n xExtent = Array(ncols),\n xMax = 0,\n yOffset = Array(n),\n yExtent = Array(nrows),\n yMax = 0,\n dx = Array(n),\n dy = Array(n),\n boxes = Array(n),\n m,\n i,\n c,\n r,\n b,\n g,\n px,\n py,\n x,\n y,\n offset;\n\n for (i = 0; i < ncols; ++i) xExtent[i] = 0;\n\n for (i = 0; i < nrows; ++i) yExtent[i] = 0; // determine offsets for each group\n\n\n for (i = 0; i < n; ++i) {\n g = groups[i];\n b = boxes[i] = bbox(g);\n g.x = g.x || 0;\n dx[i] = 0;\n g.y = g.y || 0;\n dy[i] = 0;\n c = i % ncols;\n r = ~~(i / ncols);\n xMax = Math.max(xMax, px = Math.ceil(b.x2));\n yMax = Math.max(yMax, py = Math.ceil(b.y2));\n xExtent[c] = Math.max(xExtent[c], px);\n yExtent[r] = Math.max(yExtent[r], py);\n xOffset[i] = padCol + offsetValue(b.x1);\n yOffset[i] = padRow + offsetValue(b.y1);\n if (dirty) view.dirty(groups[i]);\n } // set initial alignment offsets\n\n\n for (i = 0; i < n; ++i) {\n if (i % ncols === 0) xOffset[i] = 0;\n if (i < ncols) yOffset[i] = 0;\n } // enforce column alignment constraints\n\n\n if (alignCol === Each) {\n for (c = 1; c < ncols; ++c) {\n for (offset = 0, i = c; i < n; i += ncols) {\n if (offset < xOffset[i]) offset = xOffset[i];\n }\n\n for (i = c; i < n; i += ncols) {\n xOffset[i] = offset + xExtent[c - 1];\n }\n }\n } else if (alignCol === All) {\n for (offset = 0, i = 0; i < n; ++i) {\n if (i % ncols && offset < xOffset[i]) offset = xOffset[i];\n }\n\n for (i = 0; i < n; ++i) {\n if (i % ncols) xOffset[i] = offset + xMax;\n }\n } else {\n for (alignCol = false, c = 1; c < ncols; ++c) {\n for (i = c; i < n; i += ncols) {\n xOffset[i] += xExtent[c - 1];\n }\n }\n } // enforce row alignment constraints\n\n\n if (alignRow === Each) {\n for (r = 1; r < nrows; ++r) {\n for (offset = 0, i = r * ncols, m = i + ncols; i < m; ++i) {\n if (offset < yOffset[i]) offset = yOffset[i];\n }\n\n for (i = r * ncols; i < m; ++i) {\n yOffset[i] = offset + yExtent[r - 1];\n }\n }\n } else if (alignRow === All) {\n for (offset = 0, i = ncols; i < n; ++i) {\n if (offset < yOffset[i]) offset = yOffset[i];\n }\n\n for (i = ncols; i < n; ++i) {\n yOffset[i] = offset + yMax;\n }\n } else {\n for (alignRow = false, r = 1; r < nrows; ++r) {\n for (i = r * ncols, m = i + ncols; i < m; ++i) {\n yOffset[i] += yExtent[r - 1];\n }\n }\n } // perform horizontal grid layout\n\n\n for (x = 0, i = 0; i < n; ++i) {\n x = xOffset[i] + (i % ncols ? x : 0);\n dx[i] += x - groups[i].x;\n } // perform vertical grid layout\n\n\n for (c = 0; c < ncols; ++c) {\n for (y = 0, i = c; i < n; i += ncols) {\n y += yOffset[i];\n dy[i] += y - groups[i].y;\n }\n } // perform horizontal centering\n\n\n if (alignCol && get(opt.center, Column) && nrows > 1) {\n for (i = 0; i < n; ++i) {\n b = alignCol === All ? xMax : xExtent[i % ncols];\n x = b - boxes[i].x2 - groups[i].x - dx[i];\n if (x > 0) dx[i] += x / 2;\n }\n } // perform vertical centering\n\n\n if (alignRow && get(opt.center, Row) && ncols !== 1) {\n for (i = 0; i < n; ++i) {\n b = alignRow === All ? yMax : yExtent[~~(i / ncols)];\n y = b - boxes[i].y2 - groups[i].y - dy[i];\n if (y > 0) dy[i] += y / 2;\n }\n } // position grid relative to anchor\n\n\n for (i = 0; i < n; ++i) {\n bounds.union(boxes[i].translate(dx[i], dy[i]));\n }\n\n x = get(opt.anchor, X);\n y = get(opt.anchor, Y);\n\n switch (get(opt.anchor, Column)) {\n case End:\n x -= bounds.width();\n break;\n\n case Middle:\n x -= bounds.width() / 2;\n }\n\n switch (get(opt.anchor, Row)) {\n case End:\n y -= bounds.height();\n break;\n\n case Middle:\n y -= bounds.height() / 2;\n }\n\n x = Math.round(x);\n y = Math.round(y); // update mark positions, bounds, dirty\n\n bounds.clear();\n\n for (i = 0; i < n; ++i) {\n groups[i].mark.bounds.clear();\n }\n\n for (i = 0; i < n; ++i) {\n g = groups[i];\n g.x += dx[i] += x;\n g.y += dy[i] += y;\n bounds.union(g.mark.bounds.union(g.bounds.translate(dx[i], dy[i])));\n if (dirty) view.dirty(g);\n }\n\n return bounds;\n}\nfunction trellisLayout(view, group, opt) {\n var views = gridLayoutGroups(group),\n groups = views.marks,\n bbox = opt.bounds === Flush ? boundFlush : boundFull,\n off = opt.offset,\n ncols = opt.columns || groups.length,\n nrows = ncols <= 0 ? 1 : Math.ceil(groups.length / ncols),\n cells = nrows * ncols,\n x,\n y,\n x2,\n y2,\n anchor,\n band,\n offset; // -- initial grid layout\n\n const bounds = gridLayout(view, groups, opt);\n if (bounds.empty()) bounds.set(0, 0, 0, 0); // empty grid\n // -- layout grid headers and footers --\n // perform row header layout\n\n if (views.rowheaders) {\n band = get(opt.headerBand, Row, null);\n x = layoutHeaders(view, views.rowheaders, groups, ncols, nrows, -get(off, 'rowHeader'), min, 0, bbox, 'x1', 0, ncols, 1, band);\n } // perform column header layout\n\n\n if (views.colheaders) {\n band = get(opt.headerBand, Column, null);\n y = layoutHeaders(view, views.colheaders, groups, ncols, ncols, -get(off, 'columnHeader'), min, 1, bbox, 'y1', 0, 1, ncols, band);\n } // perform row footer layout\n\n\n if (views.rowfooters) {\n band = get(opt.footerBand, Row, null);\n x2 = layoutHeaders(view, views.rowfooters, groups, ncols, nrows, get(off, 'rowFooter'), max, 0, bbox, 'x2', ncols - 1, ncols, 1, band);\n } // perform column footer layout\n\n\n if (views.colfooters) {\n band = get(opt.footerBand, Column, null);\n y2 = layoutHeaders(view, views.colfooters, groups, ncols, ncols, get(off, 'columnFooter'), max, 1, bbox, 'y2', cells - ncols, 1, ncols, band);\n } // perform row title layout\n\n\n if (views.rowtitle) {\n anchor = get(opt.titleAnchor, Row);\n offset = get(off, 'rowTitle');\n offset = anchor === End ? x2 + offset : x - offset;\n band = get(opt.titleBand, Row, 0.5);\n layoutTitle(view, views.rowtitle, offset, 0, bounds, band);\n } // perform column title layout\n\n\n if (views.coltitle) {\n anchor = get(opt.titleAnchor, Column);\n offset = get(off, 'columnTitle');\n offset = anchor === End ? y2 + offset : y - offset;\n band = get(opt.titleBand, Column, 0.5);\n layoutTitle(view, views.coltitle, offset, 1, bounds, band);\n }\n}\n\nfunction boundFlush(item, field) {\n return field === 'x1' ? item.x || 0 : field === 'y1' ? item.y || 0 : field === 'x2' ? (item.x || 0) + (item.width || 0) : field === 'y2' ? (item.y || 0) + (item.height || 0) : undefined;\n}\n\nfunction boundFull(item, field) {\n return item.bounds[field];\n}\n\nfunction layoutHeaders(view, headers, groups, ncols, limit, offset, agg, isX, bound, bf, start, stride, back, band) {\n var n = groups.length,\n init = 0,\n edge = 0,\n i,\n j,\n k,\n m,\n b,\n h,\n g,\n x,\n y; // if no groups, early exit and return 0\n\n if (!n) return init; // compute margin\n\n for (i = start; i < n; i += stride) {\n if (groups[i]) init = agg(init, bound(groups[i], bf));\n } // if no headers, return margin calculation\n\n\n if (!headers.length) return init; // check if number of headers exceeds number of rows or columns\n\n if (headers.length > limit) {\n view.warn('Grid headers exceed limit: ' + limit);\n headers = headers.slice(0, limit);\n } // apply offset\n\n\n init += offset; // clear mark bounds for all headers\n\n for (j = 0, m = headers.length; j < m; ++j) {\n view.dirty(headers[j]);\n headers[j].mark.bounds.clear();\n } // layout each header\n\n\n for (i = start, j = 0, m = headers.length; j < m; ++j, i += stride) {\n h = headers[j];\n b = h.mark.bounds; // search for nearest group to align to\n // necessary if table has empty cells\n\n for (k = i; k >= 0 && (g = groups[k]) == null; k -= back); // assign coordinates and update bounds\n\n\n if (isX) {\n x = band == null ? g.x : Math.round(g.bounds.x1 + band * g.bounds.width());\n y = init;\n } else {\n x = init;\n y = band == null ? g.y : Math.round(g.bounds.y1 + band * g.bounds.height());\n }\n\n b.union(h.bounds.translate(x - (h.x || 0), y - (h.y || 0)));\n h.x = x;\n h.y = y;\n view.dirty(h); // update current edge of layout bounds\n\n edge = agg(edge, b[bf]);\n }\n\n return edge;\n}\n\nfunction layoutTitle(view, g, offset, isX, bounds, band) {\n if (!g) return;\n view.dirty(g); // compute title coordinates\n\n var x = offset,\n y = offset;\n isX ? x = Math.round(bounds.x1 + band * bounds.width()) : y = Math.round(bounds.y1 + band * bounds.height()); // assign coordinates and update bounds\n\n g.bounds.translate(x - (g.x || 0), y - (g.y || 0));\n g.mark.bounds.clear().union(g.bounds);\n g.x = x;\n g.y = y; // queue title for redraw\n\n view.dirty(g);\n}\n\nfunction lookup(config, orient) {\n const opt = config[orient] || {};\n return (key, d) => opt[key] != null ? opt[key] : config[key] != null ? config[key] : d;\n} // if legends specify offset directly, use the maximum specified value\n\n\nfunction offsets(legends, value) {\n let max = -Infinity;\n legends.forEach(item => {\n if (item.offset != null) max = Math.max(max, item.offset);\n });\n return max > -Infinity ? max : value;\n}\n\nfunction legendParams(g, orient, config, xb, yb, w, h) {\n const _ = lookup(config, orient),\n offset = offsets(g, _('offset', 0)),\n anchor = _('anchor', Start),\n mult = anchor === End ? 1 : anchor === Middle ? 0.5 : 0;\n\n const p = {\n align: Each,\n bounds: _('bounds', Flush),\n columns: _('direction') === 'vertical' ? 1 : g.length,\n padding: _('margin', 8),\n center: _('center'),\n nodirty: true\n };\n\n switch (orient) {\n case Left:\n p.anchor = {\n x: Math.floor(xb.x1) - offset,\n column: End,\n y: mult * (h || xb.height() + 2 * xb.y1),\n row: anchor\n };\n break;\n\n case Right:\n p.anchor = {\n x: Math.ceil(xb.x2) + offset,\n y: mult * (h || xb.height() + 2 * xb.y1),\n row: anchor\n };\n break;\n\n case Top:\n p.anchor = {\n y: Math.floor(yb.y1) - offset,\n row: End,\n x: mult * (w || yb.width() + 2 * yb.x1),\n column: anchor\n };\n break;\n\n case Bottom:\n p.anchor = {\n y: Math.ceil(yb.y2) + offset,\n x: mult * (w || yb.width() + 2 * yb.x1),\n column: anchor\n };\n break;\n\n case TopLeft:\n p.anchor = {\n x: offset,\n y: offset\n };\n break;\n\n case TopRight:\n p.anchor = {\n x: w - offset,\n y: offset,\n column: End\n };\n break;\n\n case BottomLeft:\n p.anchor = {\n x: offset,\n y: h - offset,\n row: End\n };\n break;\n\n case BottomRight:\n p.anchor = {\n x: w - offset,\n y: h - offset,\n column: End,\n row: End\n };\n break;\n }\n\n return p;\n}\nfunction legendLayout(view, legend) {\n var item = legend.items[0],\n datum = item.datum,\n orient = item.orient,\n bounds = item.bounds,\n x = item.x,\n y = item.y,\n w,\n h; // cache current bounds for later comparison\n\n item._bounds ? item._bounds.clear().union(bounds) : item._bounds = bounds.clone();\n bounds.clear(); // adjust legend to accommodate padding and title\n\n legendGroupLayout(view, item, item.items[0].items[0]); // aggregate bounds to determine size, and include origin\n\n bounds = legendBounds(item, bounds);\n w = 2 * item.padding;\n h = 2 * item.padding;\n\n if (!bounds.empty()) {\n w = Math.ceil(bounds.width() + w);\n h = Math.ceil(bounds.height() + h);\n }\n\n if (datum.type === Symbols) {\n legendEntryLayout(item.items[0].items[0].items[0].items);\n }\n\n if (orient !== None) {\n item.x = x = 0;\n item.y = y = 0;\n }\n\n item.width = w;\n item.height = h;\n boundStroke(bounds.set(x, y, x + w, y + h), item);\n item.mark.bounds.clear().union(bounds);\n return item;\n}\n\nfunction legendBounds(item, b) {\n // aggregate item bounds\n item.items.forEach(_ => b.union(_.bounds)); // anchor to legend origin\n\n b.x1 = item.padding;\n b.y1 = item.padding;\n return b;\n}\n\nfunction legendGroupLayout(view, item, entry) {\n var pad = item.padding,\n ex = pad - entry.x,\n ey = pad - entry.y;\n\n if (!item.datum.title) {\n if (ex || ey) translate(view, entry, ex, ey);\n } else {\n var title = item.items[1].items[0],\n anchor = title.anchor,\n tpad = item.titlePadding || 0,\n tx = pad - title.x,\n ty = pad - title.y;\n\n switch (title.orient) {\n case Left:\n ex += Math.ceil(title.bounds.width()) + tpad;\n break;\n\n case Right:\n case Bottom:\n break;\n\n default:\n ey += title.bounds.height() + tpad;\n }\n\n if (ex || ey) translate(view, entry, ex, ey);\n\n switch (title.orient) {\n case Left:\n ty += legendTitleOffset(item, entry, title, anchor, 1, 1);\n break;\n\n case Right:\n tx += legendTitleOffset(item, entry, title, End, 0, 0) + tpad;\n ty += legendTitleOffset(item, entry, title, anchor, 1, 1);\n break;\n\n case Bottom:\n tx += legendTitleOffset(item, entry, title, anchor, 0, 0);\n ty += legendTitleOffset(item, entry, title, End, -1, 0, 1) + tpad;\n break;\n\n default:\n tx += legendTitleOffset(item, entry, title, anchor, 0, 0);\n }\n\n if (tx || ty) translate(view, title, tx, ty); // translate legend if title pushes into negative coordinates\n\n if ((tx = Math.round(title.bounds.x1 - pad)) < 0) {\n translate(view, entry, -tx, 0);\n translate(view, title, -tx, 0);\n }\n }\n}\n\nfunction legendTitleOffset(item, entry, title, anchor, y, lr, noBar) {\n const grad = item.datum.type !== 'symbol',\n vgrad = title.datum.vgrad,\n e = grad && (lr || !vgrad) && !noBar ? entry.items[0] : entry,\n s = e.bounds[y ? 'y2' : 'x2'] - item.padding,\n u = vgrad && lr ? s : 0,\n v = vgrad && lr ? 0 : s,\n o = y <= 0 ? 0 : multiLineOffset(title);\n return Math.round(anchor === Start ? u : anchor === End ? v - o : 0.5 * (s - o));\n}\n\nfunction translate(view, item, dx, dy) {\n item.x += dx;\n item.y += dy;\n item.bounds.translate(dx, dy);\n item.mark.bounds.translate(dx, dy);\n view.dirty(item);\n}\n\nfunction legendEntryLayout(entries) {\n // get max widths for each column\n const widths = entries.reduce((w, g) => {\n w[g.column] = Math.max(g.bounds.x2 - g.x, w[g.column] || 0);\n return w;\n }, {}); // set dimensions of legend entry groups\n\n entries.forEach(g => {\n g.width = widths[g.column];\n g.height = g.bounds.y2 - g.y;\n });\n}\n\nfunction titleLayout(view, mark, width, height, viewBounds) {\n var group = mark.items[0],\n frame = group.frame,\n orient = group.orient,\n anchor = group.anchor,\n offset = group.offset,\n padding = group.padding,\n title = group.items[0].items[0],\n subtitle = group.items[1] && group.items[1].items[0],\n end = orient === Left || orient === Right ? height : width,\n start = 0,\n x = 0,\n y = 0,\n sx = 0,\n sy = 0,\n pos;\n\n if (frame !== Group) {\n orient === Left ? (start = viewBounds.y2, end = viewBounds.y1) : orient === Right ? (start = viewBounds.y1, end = viewBounds.y2) : (start = viewBounds.x1, end = viewBounds.x2);\n } else if (orient === Left) {\n start = height, end = 0;\n }\n\n pos = anchor === Start ? start : anchor === End ? end : (start + end) / 2;\n\n if (subtitle && subtitle.text) {\n // position subtitle\n switch (orient) {\n case Top:\n case Bottom:\n sy = title.bounds.height() + padding;\n break;\n\n case Left:\n sx = title.bounds.width() + padding;\n break;\n\n case Right:\n sx = -title.bounds.width() - padding;\n break;\n }\n\n tempBounds.clear().union(subtitle.bounds);\n tempBounds.translate(sx - (subtitle.x || 0), sy - (subtitle.y || 0));\n\n if (set(subtitle, 'x', sx) | set(subtitle, 'y', sy)) {\n view.dirty(subtitle);\n subtitle.bounds.clear().union(tempBounds);\n subtitle.mark.bounds.clear().union(tempBounds);\n view.dirty(subtitle);\n }\n\n tempBounds.clear().union(subtitle.bounds);\n } else {\n tempBounds.clear();\n }\n\n tempBounds.union(title.bounds); // position title group\n\n switch (orient) {\n case Top:\n x = pos;\n y = viewBounds.y1 - tempBounds.height() - offset;\n break;\n\n case Left:\n x = viewBounds.x1 - tempBounds.width() - offset;\n y = pos;\n break;\n\n case Right:\n x = viewBounds.x2 + tempBounds.width() + offset;\n y = pos;\n break;\n\n case Bottom:\n x = pos;\n y = viewBounds.y2 + offset;\n break;\n\n default:\n x = group.x;\n y = group.y;\n }\n\n if (set(group, 'x', x) | set(group, 'y', y)) {\n tempBounds.translate(x, y);\n view.dirty(group);\n group.bounds.clear().union(tempBounds);\n mark.bounds.clear().union(tempBounds);\n view.dirty(group);\n }\n\n return group.bounds;\n}\n\n/**\n * Layout view elements such as axes and legends.\n * Also performs size adjustments.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {object} params.mark - Scenegraph mark of groups to layout.\n */\n\nfunction ViewLayout(params) {\n Transform.call(this, null, params);\n}\ninherits(ViewLayout, Transform, {\n transform(_, pulse) {\n const view = pulse.dataflow;\n\n _.mark.items.forEach(group => {\n if (_.layout) trellisLayout(view, group, _.layout);\n layoutGroup(view, group, _);\n });\n\n return shouldReflow(_.mark.group) ? pulse.reflow() : pulse;\n }\n\n});\n\nfunction shouldReflow(group) {\n // We typically should reflow if layout is invoked (#2568), as child items\n // may have resized and reflow ensures group bounds are re-calculated.\n // However, legend entries have a special exception to avoid instability.\n // For example, if a selected legend symbol gains a stroke on hover,\n // we don't want to re-position subsequent elements in the legend.\n return group && group.mark.role !== 'legend-entry';\n}\n\nfunction layoutGroup(view, group, _) {\n var items = group.items,\n width = Math.max(0, group.width || 0),\n height = Math.max(0, group.height || 0),\n viewBounds = new Bounds().set(0, 0, width, height),\n xBounds = viewBounds.clone(),\n yBounds = viewBounds.clone(),\n legends = [],\n title,\n mark,\n orient,\n b,\n i,\n n; // layout axes, gather legends, collect bounds\n\n for (i = 0, n = items.length; i < n; ++i) {\n mark = items[i];\n\n switch (mark.role) {\n case AxisRole:\n b = isYAxis(mark) ? xBounds : yBounds;\n b.union(axisLayout(view, mark, width, height));\n break;\n\n case TitleRole:\n title = mark;\n break;\n\n case LegendRole:\n legends.push(legendLayout(view, mark));\n break;\n\n case FrameRole:\n case ScopeRole:\n case RowHeader:\n case RowFooter:\n case RowTitle:\n case ColHeader:\n case ColFooter:\n case ColTitle:\n xBounds.union(mark.bounds);\n yBounds.union(mark.bounds);\n break;\n\n default:\n viewBounds.union(mark.bounds);\n }\n } // layout legends, adjust viewBounds\n\n\n if (legends.length) {\n // group legends by orient\n const l = {};\n legends.forEach(item => {\n orient = item.orient || Right;\n if (orient !== None) (l[orient] || (l[orient] = [])).push(item);\n }); // perform grid layout for each orient group\n\n for (const orient in l) {\n const g = l[orient];\n gridLayout(view, g, legendParams(g, orient, _.legends, xBounds, yBounds, width, height));\n } // update view bounds\n\n\n legends.forEach(item => {\n const b = item.bounds;\n\n if (!b.equals(item._bounds)) {\n item.bounds = item._bounds;\n view.dirty(item); // dirty previous location\n\n item.bounds = b;\n view.dirty(item);\n }\n\n if (_.autosize && _.autosize.type === Fit) {\n // For autosize fit, incorporate the orthogonal dimension only.\n // Legends that overrun the chart area will then be clipped;\n // otherwise the chart area gets reduced to nothing!\n switch (item.orient) {\n case Left:\n case Right:\n viewBounds.add(b.x1, 0).add(b.x2, 0);\n break;\n\n case Top:\n case Bottom:\n viewBounds.add(0, b.y1).add(0, b.y2);\n }\n } else {\n viewBounds.union(b);\n }\n });\n } // combine bounding boxes\n\n\n viewBounds.union(xBounds).union(yBounds); // layout title, adjust bounds\n\n if (title) {\n viewBounds.union(titleLayout(view, title, width, height, viewBounds));\n } // override aggregated view bounds if content is clipped\n\n\n if (group.clip) {\n viewBounds.set(0, 0, group.width || 0, group.height || 0);\n } // perform size adjustment\n\n\n viewSizeLayout(view, group, viewBounds, _);\n}\n\nfunction viewSizeLayout(view, group, viewBounds, _) {\n const auto = _.autosize || {},\n type = auto.type;\n if (view._autosize < 1 || !type) return;\n let viewWidth = view._width,\n viewHeight = view._height,\n width = Math.max(0, group.width || 0),\n left = Math.max(0, Math.ceil(-viewBounds.x1)),\n height = Math.max(0, group.height || 0),\n top = Math.max(0, Math.ceil(-viewBounds.y1));\n const right = Math.max(0, Math.ceil(viewBounds.x2 - width)),\n bottom = Math.max(0, Math.ceil(viewBounds.y2 - height));\n\n if (auto.contains === Padding) {\n const padding = view.padding();\n viewWidth -= padding.left + padding.right;\n viewHeight -= padding.top + padding.bottom;\n }\n\n if (type === None) {\n left = 0;\n top = 0;\n width = viewWidth;\n height = viewHeight;\n } else if (type === Fit) {\n width = Math.max(0, viewWidth - left - right);\n height = Math.max(0, viewHeight - top - bottom);\n } else if (type === FitX) {\n width = Math.max(0, viewWidth - left - right);\n viewHeight = height + top + bottom;\n } else if (type === FitY) {\n viewWidth = width + left + right;\n height = Math.max(0, viewHeight - top - bottom);\n } else if (type === Pad) {\n viewWidth = width + left + right;\n viewHeight = height + top + bottom;\n }\n\n view._resizeView(viewWidth, viewHeight, width, height, [left, top], auto.resize);\n}\n\nexport { Bound as bound, Identifier as identifier, Mark as mark, Overlap as overlap, Render as render, ViewLayout as viewlayout };\n","import { Transform, ingest, tupleid, stableCompare } from 'vega-dataflow';\nimport { tickCount, tickFormat, validTicks, tickValues, SymbolLegend, labelFormat, labelValues, GradientLegend, scaleFraction, labelFraction, scale, isContinuous, Sequential, Linear, Time, UTC, Pow, Sqrt, Ordinal, scaleImplicit, Log, Symlog, isLogarithmic, BinOrdinal, bandSpace, isInterpolating, interpolateRange, quantizeInterpolator, interpolateColors, interpolate, Band, Point, scheme, Threshold, Quantile, Quantize, Diverging } from 'vega-scale';\nimport { inherits, isArray, error, fastmap, falsy, isFunction, constant, peek, one, toSet, isString, zoomLog, zoomPow, zoomSymlog, zoomLinear, stringValue } from 'vega-util';\nimport { sum, range } from 'd3-array';\nimport { interpolateRound, interpolate as interpolate$1 } from 'd3-interpolate';\n\n/**\n * Generates axis ticks for visualizing a spatial scale.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Scale} params.scale - The scale to generate ticks for.\n * @param {*} [params.count=10] - The approximate number of ticks, or\n * desired tick interval, to use.\n * @param {Array<*>} [params.values] - The exact tick values to use.\n * These must be legal domain values for the provided scale.\n * If provided, the count argument is ignored.\n * @param {function(*):string} [params.formatSpecifier] - A format specifier\n * to use in conjunction with scale.tickFormat. Legal values are\n * any valid d3 4.0 format specifier.\n * @param {function(*):string} [params.format] - The format function to use.\n * If provided, the formatSpecifier argument is ignored.\n */\n\nfunction AxisTicks(params) {\n Transform.call(this, null, params);\n}\ninherits(AxisTicks, Transform, {\n transform(_, pulse) {\n if (this.value && !_.modified()) {\n return pulse.StopPropagation;\n }\n\n var locale = pulse.dataflow.locale(),\n out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS),\n ticks = this.value,\n scale = _.scale,\n tally = _.count == null ? _.values ? _.values.length : 10 : _.count,\n count = tickCount(scale, tally, _.minstep),\n format = _.format || tickFormat(locale, scale, count, _.formatSpecifier, _.formatType, !!_.values),\n values = _.values ? validTicks(scale, _.values, count) : tickValues(scale, count);\n if (ticks) out.rem = ticks;\n ticks = values.map((value, i) => ingest({\n index: i / (values.length - 1 || 1),\n value: value,\n label: format(value)\n }));\n\n if (_.extra && ticks.length) {\n // add an extra tick pegged to the initial domain value\n // this is used to generate axes with 'binned' domains\n ticks.push(ingest({\n index: -1,\n extra: {\n value: ticks[0].value\n },\n label: ''\n }));\n }\n\n out.source = ticks;\n out.add = ticks;\n this.value = ticks;\n return out;\n }\n\n});\n\n/**\n * Joins a set of data elements against a set of visual items.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): object} [params.item] - An item generator function.\n * @param {function(object): *} [params.key] - The key field associating data and visual items.\n */\n\nfunction DataJoin(params) {\n Transform.call(this, null, params);\n}\n\nfunction defaultItemCreate() {\n return ingest({});\n}\n\nfunction newMap(key) {\n const map = fastmap().test(t => t.exit);\n\n map.lookup = t => map.get(key(t));\n\n return map;\n}\n\ninherits(DataJoin, Transform, {\n transform(_, pulse) {\n var df = pulse.dataflow,\n out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS),\n item = _.item || defaultItemCreate,\n key = _.key || tupleid,\n map = this.value; // prevent transient (e.g., hover) requests from\n // cascading across marks derived from marks\n\n if (isArray(out.encode)) {\n out.encode = null;\n }\n\n if (map && (_.modified('key') || pulse.modified(key))) {\n error('DataJoin does not support modified key function or fields.');\n }\n\n if (!map) {\n pulse = pulse.addAll();\n this.value = map = newMap(key);\n }\n\n pulse.visit(pulse.ADD, t => {\n const k = key(t);\n let x = map.get(k);\n\n if (x) {\n if (x.exit) {\n map.empty--;\n out.add.push(x);\n } else {\n out.mod.push(x);\n }\n } else {\n x = item(t);\n map.set(k, x);\n out.add.push(x);\n }\n\n x.datum = t;\n x.exit = false;\n });\n pulse.visit(pulse.MOD, t => {\n const k = key(t),\n x = map.get(k);\n\n if (x) {\n x.datum = t;\n out.mod.push(x);\n }\n });\n pulse.visit(pulse.REM, t => {\n const k = key(t),\n x = map.get(k);\n\n if (t === x.datum && !x.exit) {\n out.rem.push(x);\n x.exit = true;\n ++map.empty;\n }\n });\n if (pulse.changed(pulse.ADD_MOD)) out.modifies('datum');\n\n if (pulse.clean() || _.clean && map.empty > df.cleanThreshold) {\n df.runAfter(map.clean);\n }\n\n return out;\n }\n\n});\n\n/**\n * Invokes encoding functions for visual items.\n * @constructor\n * @param {object} params - The parameters to the encoding functions. This\n * parameter object will be passed through to all invoked encoding functions.\n * @param {object} [params.mod=false] - Flag indicating if tuples in the input\n * mod set that are unmodified by encoders should be included in the output.\n * @param {object} param.encoders - The encoding functions\n * @param {function(object, object): boolean} [param.encoders.update] - Update encoding set\n * @param {function(object, object): boolean} [param.encoders.enter] - Enter encoding set\n * @param {function(object, object): boolean} [param.encoders.exit] - Exit encoding set\n */\n\nfunction Encode(params) {\n Transform.call(this, null, params);\n}\ninherits(Encode, Transform, {\n transform(_, pulse) {\n var out = pulse.fork(pulse.ADD_REM),\n fmod = _.mod || false,\n encoders = _.encoders,\n encode = pulse.encode; // if an array, the encode directive includes additional sets\n // that must be defined in order for the primary set to be invoked\n // e.g., only run the update set if the hover set is defined\n\n if (isArray(encode)) {\n if (out.changed() || encode.every(e => encoders[e])) {\n encode = encode[0];\n out.encode = null; // consume targeted encode directive\n } else {\n return pulse.StopPropagation;\n }\n } // marshall encoder functions\n\n\n var reenter = encode === 'enter',\n update = encoders.update || falsy,\n enter = encoders.enter || falsy,\n exit = encoders.exit || falsy,\n set = (encode && !reenter ? encoders[encode] : update) || falsy;\n\n if (pulse.changed(pulse.ADD)) {\n pulse.visit(pulse.ADD, t => {\n enter(t, _);\n update(t, _);\n });\n out.modifies(enter.output);\n out.modifies(update.output);\n\n if (set !== falsy && set !== update) {\n pulse.visit(pulse.ADD, t => {\n set(t, _);\n });\n out.modifies(set.output);\n }\n }\n\n if (pulse.changed(pulse.REM) && exit !== falsy) {\n pulse.visit(pulse.REM, t => {\n exit(t, _);\n });\n out.modifies(exit.output);\n }\n\n if (reenter || set !== falsy) {\n const flag = pulse.MOD | (_.modified() ? pulse.REFLOW : 0);\n\n if (reenter) {\n pulse.visit(flag, t => {\n const mod = enter(t, _) || fmod;\n if (set(t, _) || mod) out.mod.push(t);\n });\n if (out.mod.length) out.modifies(enter.output);\n } else {\n pulse.visit(flag, t => {\n if (set(t, _) || fmod) out.mod.push(t);\n });\n }\n\n if (out.mod.length) out.modifies(set.output);\n }\n\n return out.changed() ? out : pulse.StopPropagation;\n }\n\n});\n\n/**\n * Generates legend entries for visualizing a scale.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Scale} params.scale - The scale to generate items for.\n * @param {*} [params.count=5] - The approximate number of items, or\n * desired tick interval, to use.\n * @param {*} [params.limit] - The maximum number of entries to\n * include in a symbol legend.\n * @param {Array<*>} [params.values] - The exact tick values to use.\n * These must be legal domain values for the provided scale.\n * If provided, the count argument is ignored.\n * @param {string} [params.formatSpecifier] - A format specifier\n * to use in conjunction with scale.tickFormat. Legal values are\n * any valid D3 format specifier string.\n * @param {function(*):string} [params.format] - The format function to use.\n * If provided, the formatSpecifier argument is ignored.\n */\n\nfunction LegendEntries(params) {\n Transform.call(this, [], params);\n}\ninherits(LegendEntries, Transform, {\n transform(_, pulse) {\n if (this.value != null && !_.modified()) {\n return pulse.StopPropagation;\n }\n\n var locale = pulse.dataflow.locale(),\n out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS),\n items = this.value,\n type = _.type || SymbolLegend,\n scale = _.scale,\n limit = +_.limit,\n count = tickCount(scale, _.count == null ? 5 : _.count, _.minstep),\n lskip = !!_.values || type === SymbolLegend,\n format = _.format || labelFormat(locale, scale, count, type, _.formatSpecifier, _.formatType, lskip),\n values = _.values || labelValues(scale, count),\n domain,\n fraction,\n size,\n offset,\n ellipsis;\n if (items) out.rem = items;\n\n if (type === SymbolLegend) {\n if (limit && values.length > limit) {\n pulse.dataflow.warn('Symbol legend count exceeds limit, filtering items.');\n items = values.slice(0, limit - 1);\n ellipsis = true;\n } else {\n items = values;\n }\n\n if (isFunction(size = _.size)) {\n // if first value maps to size zero, remove from list (vega#717)\n if (!_.values && scale(items[0]) === 0) {\n items = items.slice(1);\n } // compute size offset for legend entries\n\n\n offset = items.reduce((max, value) => Math.max(max, size(value, _)), 0);\n } else {\n size = constant(offset = size || 8);\n }\n\n items = items.map((value, index) => ingest({\n index: index,\n label: format(value, index, items),\n value: value,\n offset: offset,\n size: size(value, _)\n }));\n\n if (ellipsis) {\n ellipsis = values[items.length];\n items.push(ingest({\n index: items.length,\n label: \"\\u2026\".concat(values.length - items.length, \" entries\"),\n value: ellipsis,\n offset: offset,\n size: size(ellipsis, _)\n }));\n }\n } else if (type === GradientLegend) {\n domain = scale.domain(), fraction = scaleFraction(scale, domain[0], peek(domain)); // if automatic label generation produces 2 or fewer values,\n // use the domain end points instead (fixes vega/vega#1364)\n\n if (values.length < 3 && !_.values && domain[0] !== peek(domain)) {\n values = [domain[0], peek(domain)];\n }\n\n items = values.map((value, index) => ingest({\n index: index,\n label: format(value, index, values),\n value: value,\n perc: fraction(value)\n }));\n } else {\n size = values.length - 1;\n fraction = labelFraction(scale);\n items = values.map((value, index) => ingest({\n index: index,\n label: format(value, index, values),\n value: value,\n perc: index ? fraction(value) : 0,\n perc2: index === size ? 1 : fraction(values[index + 1])\n }));\n }\n\n out.source = items;\n out.add = items;\n this.value = items;\n return out;\n }\n\n});\n\nconst sourceX = t => t.source.x;\n\nconst sourceY = t => t.source.y;\n\nconst targetX = t => t.target.x;\n\nconst targetY = t => t.target.y;\n/**\n * Layout paths linking source and target elements.\n * @constructor\n * @param {object} params - The parameters for this operator.\n */\n\n\nfunction LinkPath(params) {\n Transform.call(this, {}, params);\n}\nLinkPath.Definition = {\n 'type': 'LinkPath',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'sourceX',\n 'type': 'field',\n 'default': 'source.x'\n }, {\n 'name': 'sourceY',\n 'type': 'field',\n 'default': 'source.y'\n }, {\n 'name': 'targetX',\n 'type': 'field',\n 'default': 'target.x'\n }, {\n 'name': 'targetY',\n 'type': 'field',\n 'default': 'target.y'\n }, {\n 'name': 'orient',\n 'type': 'enum',\n 'default': 'vertical',\n 'values': ['horizontal', 'vertical', 'radial']\n }, {\n 'name': 'shape',\n 'type': 'enum',\n 'default': 'line',\n 'values': ['line', 'arc', 'curve', 'diagonal', 'orthogonal']\n }, {\n 'name': 'require',\n 'type': 'signal'\n }, {\n 'name': 'as',\n 'type': 'string',\n 'default': 'path'\n }]\n};\ninherits(LinkPath, Transform, {\n transform(_, pulse) {\n var sx = _.sourceX || sourceX,\n sy = _.sourceY || sourceY,\n tx = _.targetX || targetX,\n ty = _.targetY || targetY,\n as = _.as || 'path',\n orient = _.orient || 'vertical',\n shape = _.shape || 'line',\n path = Paths.get(shape + '-' + orient) || Paths.get(shape);\n\n if (!path) {\n error('LinkPath unsupported type: ' + _.shape + (_.orient ? '-' + _.orient : ''));\n }\n\n pulse.visit(pulse.SOURCE, t => {\n t[as] = path(sx(t), sy(t), tx(t), ty(t));\n });\n return pulse.reflow(_.modified()).modifies(as);\n }\n\n});\n\nconst line = (sx, sy, tx, ty) => 'M' + sx + ',' + sy + 'L' + tx + ',' + ty;\n\nconst lineR = (sa, sr, ta, tr) => line(sr * Math.cos(sa), sr * Math.sin(sa), tr * Math.cos(ta), tr * Math.sin(ta));\n\nconst arc = (sx, sy, tx, ty) => {\n var dx = tx - sx,\n dy = ty - sy,\n rr = Math.sqrt(dx * dx + dy * dy) / 2,\n ra = 180 * Math.atan2(dy, dx) / Math.PI;\n return 'M' + sx + ',' + sy + 'A' + rr + ',' + rr + ' ' + ra + ' 0 1' + ' ' + tx + ',' + ty;\n};\n\nconst arcR = (sa, sr, ta, tr) => arc(sr * Math.cos(sa), sr * Math.sin(sa), tr * Math.cos(ta), tr * Math.sin(ta));\n\nconst curve = (sx, sy, tx, ty) => {\n const dx = tx - sx,\n dy = ty - sy,\n ix = 0.2 * (dx + dy),\n iy = 0.2 * (dy - dx);\n return 'M' + sx + ',' + sy + 'C' + (sx + ix) + ',' + (sy + iy) + ' ' + (tx + iy) + ',' + (ty - ix) + ' ' + tx + ',' + ty;\n};\n\nconst curveR = (sa, sr, ta, tr) => curve(sr * Math.cos(sa), sr * Math.sin(sa), tr * Math.cos(ta), tr * Math.sin(ta));\n\nconst orthoX = (sx, sy, tx, ty) => 'M' + sx + ',' + sy + 'V' + ty + 'H' + tx;\n\nconst orthoY = (sx, sy, tx, ty) => 'M' + sx + ',' + sy + 'H' + tx + 'V' + ty;\n\nconst orthoR = (sa, sr, ta, tr) => {\n const sc = Math.cos(sa),\n ss = Math.sin(sa),\n tc = Math.cos(ta),\n ts = Math.sin(ta),\n sf = Math.abs(ta - sa) > Math.PI ? ta <= sa : ta > sa;\n return 'M' + sr * sc + ',' + sr * ss + 'A' + sr + ',' + sr + ' 0 0,' + (sf ? 1 : 0) + ' ' + sr * tc + ',' + sr * ts + 'L' + tr * tc + ',' + tr * ts;\n};\n\nconst diagonalX = (sx, sy, tx, ty) => {\n const m = (sx + tx) / 2;\n return 'M' + sx + ',' + sy + 'C' + m + ',' + sy + ' ' + m + ',' + ty + ' ' + tx + ',' + ty;\n};\n\nconst diagonalY = (sx, sy, tx, ty) => {\n const m = (sy + ty) / 2;\n return 'M' + sx + ',' + sy + 'C' + sx + ',' + m + ' ' + tx + ',' + m + ' ' + tx + ',' + ty;\n};\n\nconst diagonalR = (sa, sr, ta, tr) => {\n const sc = Math.cos(sa),\n ss = Math.sin(sa),\n tc = Math.cos(ta),\n ts = Math.sin(ta),\n mr = (sr + tr) / 2;\n return 'M' + sr * sc + ',' + sr * ss + 'C' + mr * sc + ',' + mr * ss + ' ' + mr * tc + ',' + mr * ts + ' ' + tr * tc + ',' + tr * ts;\n};\n\nconst Paths = fastmap({\n 'line': line,\n 'line-radial': lineR,\n 'arc': arc,\n 'arc-radial': arcR,\n 'curve': curve,\n 'curve-radial': curveR,\n 'orthogonal-horizontal': orthoX,\n 'orthogonal-vertical': orthoY,\n 'orthogonal-radial': orthoR,\n 'diagonal-horizontal': diagonalX,\n 'diagonal-vertical': diagonalY,\n 'diagonal-radial': diagonalR\n});\n\n/**\n * Pie and donut chart layout.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The value field to size pie segments.\n * @param {number} [params.startAngle=0] - The start angle (in radians) of the layout.\n * @param {number} [params.endAngle=2π] - The end angle (in radians) of the layout.\n * @param {boolean} [params.sort] - Boolean flag for sorting sectors by value.\n */\n\nfunction Pie(params) {\n Transform.call(this, null, params);\n}\nPie.Definition = {\n 'type': 'Pie',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field'\n }, {\n 'name': 'startAngle',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'endAngle',\n 'type': 'number',\n 'default': 6.283185307179586\n }, {\n 'name': 'sort',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': 2,\n 'default': ['startAngle', 'endAngle']\n }]\n};\ninherits(Pie, Transform, {\n transform(_, pulse) {\n var as = _.as || ['startAngle', 'endAngle'],\n startAngle = as[0],\n endAngle = as[1],\n field = _.field || one,\n start = _.startAngle || 0,\n stop = _.endAngle != null ? _.endAngle : 2 * Math.PI,\n data = pulse.source,\n values = data.map(field),\n n = values.length,\n a = start,\n k = (stop - start) / sum(values),\n index = range(n),\n i,\n t,\n v;\n\n if (_.sort) {\n index.sort((a, b) => values[a] - values[b]);\n }\n\n for (i = 0; i < n; ++i) {\n v = values[index[i]];\n t = data[index[i]];\n t[startAngle] = a;\n t[endAngle] = a += v * k;\n }\n\n this.value = values;\n return pulse.reflow(_.modified()).modifies(as);\n }\n\n});\n\nconst DEFAULT_COUNT = 5;\n\nfunction includeZero(scale) {\n const type = scale.type;\n return !scale.bins && (type === Linear || type === Pow || type === Sqrt);\n}\n\nfunction includePad(type) {\n return isContinuous(type) && type !== Sequential;\n}\n\nconst SKIP = toSet(['set', 'modified', 'clear', 'type', 'scheme', 'schemeExtent', 'schemeCount', 'domain', 'domainMin', 'domainMid', 'domainMax', 'domainRaw', 'domainImplicit', 'nice', 'zero', 'bins', 'range', 'rangeStep', 'round', 'reverse', 'interpolate', 'interpolateGamma']);\n/**\n * Maintains a scale function mapping data values to visual channels.\n * @constructor\n * @param {object} params - The parameters for this operator.\n */\n\nfunction Scale(params) {\n Transform.call(this, null, params);\n this.modified(true); // always treat as modified\n}\ninherits(Scale, Transform, {\n transform(_, pulse) {\n var df = pulse.dataflow,\n scale$1 = this.value,\n key = scaleKey(_);\n\n if (!scale$1 || key !== scale$1.type) {\n this.value = scale$1 = scale(key)();\n }\n\n for (key in _) if (!SKIP[key]) {\n // padding is a scale property for band/point but not others\n if (key === 'padding' && includePad(scale$1.type)) continue; // invoke scale property setter, raise warning if not found\n\n isFunction(scale$1[key]) ? scale$1[key](_[key]) : df.warn('Unsupported scale property: ' + key);\n }\n\n configureRange(scale$1, _, configureBins(scale$1, _, configureDomain(scale$1, _, df)));\n return pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS);\n }\n\n});\n\nfunction scaleKey(_) {\n var t = _.type,\n d = '',\n n; // backwards compatibility pre Vega 5.\n\n if (t === Sequential) return Sequential + '-' + Linear;\n\n if (isContinuousColor(_)) {\n n = _.rawDomain ? _.rawDomain.length : _.domain ? _.domain.length + +(_.domainMid != null) : 0;\n d = n === 2 ? Sequential + '-' : n === 3 ? Diverging + '-' : '';\n }\n\n return (d + t || Linear).toLowerCase();\n}\n\nfunction isContinuousColor(_) {\n const t = _.type;\n return isContinuous(t) && t !== Time && t !== UTC && (_.scheme || _.range && _.range.length && _.range.every(isString));\n}\n\nfunction configureDomain(scale, _, df) {\n // check raw domain, if provided use that and exit early\n const raw = rawDomain(scale, _.domainRaw, df);\n if (raw > -1) return raw;\n var domain = _.domain,\n type = scale.type,\n zero = _.zero || _.zero === undefined && includeZero(scale),\n n,\n mid;\n if (!domain) return 0; // adjust continuous domain for minimum pixel padding\n\n if (includePad(type) && _.padding && domain[0] !== peek(domain)) {\n domain = padDomain(type, domain, _.range, _.padding, _.exponent, _.constant);\n } // adjust domain based on zero, min, max settings\n\n\n if (zero || _.domainMin != null || _.domainMax != null || _.domainMid != null) {\n n = (domain = domain.slice()).length - 1 || 1;\n\n if (zero) {\n if (domain[0] > 0) domain[0] = 0;\n if (domain[n] < 0) domain[n] = 0;\n }\n\n if (_.domainMin != null) domain[0] = _.domainMin;\n if (_.domainMax != null) domain[n] = _.domainMax;\n\n if (_.domainMid != null) {\n mid = _.domainMid;\n const i = mid > domain[n] ? n + 1 : mid < domain[0] ? 0 : n;\n if (i !== n) df.warn('Scale domainMid exceeds domain min or max.', mid);\n domain.splice(i, 0, mid);\n }\n } // set the scale domain\n\n\n scale.domain(domainCheck(type, domain, df)); // if ordinal scale domain is defined, prevent implicit\n // domain construction as side-effect of scale lookup\n\n if (type === Ordinal) {\n scale.unknown(_.domainImplicit ? scaleImplicit : undefined);\n } // perform 'nice' adjustment as requested\n\n\n if (_.nice && scale.nice) {\n scale.nice(_.nice !== true && tickCount(scale, _.nice) || null);\n } // return the cardinality of the domain\n\n\n return domain.length;\n}\n\nfunction rawDomain(scale, raw, df) {\n if (raw) {\n scale.domain(domainCheck(scale.type, raw, df));\n return raw.length;\n } else {\n return -1;\n }\n}\n\nfunction padDomain(type, domain, range, pad, exponent, constant) {\n var span = Math.abs(peek(range) - range[0]),\n frac = span / (span - 2 * pad),\n d = type === Log ? zoomLog(domain, null, frac) : type === Sqrt ? zoomPow(domain, null, frac, 0.5) : type === Pow ? zoomPow(domain, null, frac, exponent || 1) : type === Symlog ? zoomSymlog(domain, null, frac, constant || 1) : zoomLinear(domain, null, frac);\n domain = domain.slice();\n domain[0] = d[0];\n domain[domain.length - 1] = d[1];\n return domain;\n}\n\nfunction domainCheck(type, domain, df) {\n if (isLogarithmic(type)) {\n // sum signs of domain values\n // if all pos or all neg, abs(sum) === domain.length\n var s = Math.abs(domain.reduce((s, v) => s + (v < 0 ? -1 : v > 0 ? 1 : 0), 0));\n\n if (s !== domain.length) {\n df.warn('Log scale domain includes zero: ' + stringValue(domain));\n }\n }\n\n return domain;\n}\n\nfunction configureBins(scale, _, count) {\n let bins = _.bins;\n\n if (bins && !isArray(bins)) {\n // generate bin boundary array\n const domain = scale.domain(),\n lo = domain[0],\n hi = peek(domain),\n step = bins.step;\n let start = bins.start == null ? lo : bins.start,\n stop = bins.stop == null ? hi : bins.stop;\n if (!step) error('Scale bins parameter missing step property.');\n if (start < lo) start = step * Math.ceil(lo / step);\n if (stop > hi) stop = step * Math.floor(hi / step);\n bins = range(start, stop + step / 2, step);\n }\n\n if (bins) {\n // assign bin boundaries to scale instance\n scale.bins = bins;\n } else if (scale.bins) {\n // no current bins, remove bins if previously set\n delete scale.bins;\n } // special handling for bin-ordinal scales\n\n\n if (scale.type === BinOrdinal) {\n if (!bins) {\n // the domain specifies the bins\n scale.bins = scale.domain();\n } else if (!_.domain && !_.domainRaw) {\n // the bins specify the domain\n scale.domain(bins);\n count = bins.length;\n }\n } // return domain cardinality\n\n\n return count;\n}\n\nfunction configureRange(scale, _, count) {\n var type = scale.type,\n round = _.round || false,\n range = _.range; // if range step specified, calculate full range extent\n\n if (_.rangeStep != null) {\n range = configureRangeStep(type, _, count);\n } // else if a range scheme is defined, use that\n else if (_.scheme) {\n range = configureScheme(type, _, count);\n\n if (isFunction(range)) {\n if (scale.interpolator) {\n return scale.interpolator(range);\n } else {\n error(\"Scale type \".concat(type, \" does not support interpolating color schemes.\"));\n }\n }\n } // given a range array for an interpolating scale, convert to interpolator\n\n\n if (range && isInterpolating(type)) {\n return scale.interpolator(interpolateColors(flip(range, _.reverse), _.interpolate, _.interpolateGamma));\n } // configure rounding / interpolation\n\n\n if (range && _.interpolate && scale.interpolate) {\n scale.interpolate(interpolate(_.interpolate, _.interpolateGamma));\n } else if (isFunction(scale.round)) {\n scale.round(round);\n } else if (isFunction(scale.rangeRound)) {\n scale.interpolate(round ? interpolateRound : interpolate$1);\n }\n\n if (range) scale.range(flip(range, _.reverse));\n}\n\nfunction configureRangeStep(type, _, count) {\n if (type !== Band && type !== Point) {\n error('Only band and point scales support rangeStep.');\n } // calculate full range based on requested step size and padding\n\n\n var outer = (_.paddingOuter != null ? _.paddingOuter : _.padding) || 0,\n inner = type === Point ? 1 : (_.paddingInner != null ? _.paddingInner : _.padding) || 0;\n return [0, _.rangeStep * bandSpace(count, inner, outer)];\n}\n\nfunction configureScheme(type, _, count) {\n var extent = _.schemeExtent,\n name,\n scheme$1;\n\n if (isArray(_.scheme)) {\n scheme$1 = interpolateColors(_.scheme, _.interpolate, _.interpolateGamma);\n } else {\n name = _.scheme.toLowerCase();\n scheme$1 = scheme(name);\n if (!scheme$1) error(\"Unrecognized scheme name: \".concat(_.scheme));\n } // determine size for potential discrete range\n\n\n count = type === Threshold ? count + 1 : type === BinOrdinal ? count - 1 : type === Quantile || type === Quantize ? +_.schemeCount || DEFAULT_COUNT : count; // adjust and/or quantize scheme as appropriate\n\n return isInterpolating(type) ? adjustScheme(scheme$1, extent, _.reverse) : isFunction(scheme$1) ? quantizeInterpolator(adjustScheme(scheme$1, extent), count) : type === Ordinal ? scheme$1 : scheme$1.slice(0, count);\n}\n\nfunction adjustScheme(scheme, extent, reverse) {\n return isFunction(scheme) && (extent || reverse) ? interpolateRange(scheme, flip(extent || [0, 1], reverse)) : scheme;\n}\n\nfunction flip(array, reverse) {\n return reverse ? array.slice().reverse() : array;\n}\n\n/**\n * Sorts scenegraph items in the pulse source array.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(*,*): number} [params.sort] - A comparator\n * function for sorting tuples.\n */\n\nfunction SortItems(params) {\n Transform.call(this, null, params);\n}\ninherits(SortItems, Transform, {\n transform(_, pulse) {\n const mod = _.modified('sort') || pulse.changed(pulse.ADD) || pulse.modified(_.sort.fields) || pulse.modified('datum');\n if (mod) pulse.source.sort(stableCompare(_.sort));\n this.modified(mod);\n return pulse;\n }\n\n});\n\nconst Zero = 'zero',\n Center = 'center',\n Normalize = 'normalize',\n DefOutput = ['y0', 'y1'];\n/**\n * Stack layout for visualization elements.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The value field to stack.\n * @param {Array} [params.groupby] - An array of accessors to groupby.\n * @param {function(object,object): number} [params.sort] - A comparator for stack sorting.\n * @param {string} [offset='zero'] - Stack baseline offset. One of 'zero', 'center', 'normalize'.\n */\n\nfunction Stack(params) {\n Transform.call(this, null, params);\n}\nStack.Definition = {\n 'type': 'Stack',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field'\n }, {\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'sort',\n 'type': 'compare'\n }, {\n 'name': 'offset',\n 'type': 'enum',\n 'default': Zero,\n 'values': [Zero, Center, Normalize]\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': 2,\n 'default': DefOutput\n }]\n};\ninherits(Stack, Transform, {\n transform(_, pulse) {\n var as = _.as || DefOutput,\n y0 = as[0],\n y1 = as[1],\n sort = stableCompare(_.sort),\n field = _.field || one,\n stack = _.offset === Center ? stackCenter : _.offset === Normalize ? stackNormalize : stackZero,\n groups,\n i,\n n,\n max; // partition, sum, and sort the stack groups\n\n groups = partition(pulse.source, _.groupby, sort, field); // compute stack layouts per group\n\n for (i = 0, n = groups.length, max = groups.max; i < n; ++i) {\n stack(groups[i], max, field, y0, y1);\n }\n\n return pulse.reflow(_.modified()).modifies(as);\n }\n\n});\n\nfunction stackCenter(group, max, field, y0, y1) {\n var last = (max - group.sum) / 2,\n m = group.length,\n j = 0,\n t;\n\n for (; j < m; ++j) {\n t = group[j];\n t[y0] = last;\n t[y1] = last += Math.abs(field(t));\n }\n}\n\nfunction stackNormalize(group, max, field, y0, y1) {\n var scale = 1 / group.sum,\n last = 0,\n m = group.length,\n j = 0,\n v = 0,\n t;\n\n for (; j < m; ++j) {\n t = group[j];\n t[y0] = last;\n t[y1] = last = scale * (v += Math.abs(field(t)));\n }\n}\n\nfunction stackZero(group, max, field, y0, y1) {\n var lastPos = 0,\n lastNeg = 0,\n m = group.length,\n j = 0,\n v,\n t;\n\n for (; j < m; ++j) {\n t = group[j];\n v = +field(t);\n\n if (v < 0) {\n t[y0] = lastNeg;\n t[y1] = lastNeg += v;\n } else {\n t[y0] = lastPos;\n t[y1] = lastPos += v;\n }\n }\n}\n\nfunction partition(data, groupby, sort, field) {\n var groups = [],\n get = f => f(t),\n map,\n i,\n n,\n m,\n t,\n k,\n g,\n s,\n max; // partition data points into stack groups\n\n\n if (groupby == null) {\n groups.push(data.slice());\n } else {\n for (map = {}, i = 0, n = data.length; i < n; ++i) {\n t = data[i];\n k = groupby.map(get);\n g = map[k];\n\n if (!g) {\n map[k] = g = [];\n groups.push(g);\n }\n\n g.push(t);\n }\n } // compute sums of groups, sort groups as needed\n\n\n for (k = 0, max = 0, m = groups.length; k < m; ++k) {\n g = groups[k];\n\n for (i = 0, s = 0, n = g.length; i < n; ++i) {\n s += Math.abs(field(g[i]));\n }\n\n g.sum = s;\n if (s > max) max = s;\n if (sort) g.sort(sort);\n }\n\n groups.max = max;\n return groups;\n}\n\nexport { AxisTicks as axisticks, DataJoin as datajoin, Encode as encode, LegendEntries as legendentries, LinkPath as linkpath, Pie as pie, Scale as scale, SortItems as sortitems, Stack as stack };\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 {Adder} from \"d3-array\";\nimport {atan2, cos, quarterPi, radians, sin, tau} from \"./math.js\";\nimport noop from \"./noop.js\";\nimport stream from \"./stream.js\";\n\nexport var areaRingSum = new Adder();\n\n// hello?\n\nvar areaSum = new Adder(),\n lambda00,\n phi00,\n lambda0,\n cosPhi0,\n sinPhi0;\n\nexport var areaStream = {\n point: noop,\n lineStart: noop,\n lineEnd: noop,\n polygonStart: function() {\n areaRingSum = new Adder();\n areaStream.lineStart = areaRingStart;\n areaStream.lineEnd = areaRingEnd;\n },\n polygonEnd: function() {\n var areaRing = +areaRingSum;\n areaSum.add(areaRing < 0 ? tau + areaRing : areaRing);\n this.lineStart = this.lineEnd = this.point = noop;\n },\n sphere: function() {\n areaSum.add(tau);\n }\n};\n\nfunction areaRingStart() {\n areaStream.point = areaPointFirst;\n}\n\nfunction areaRingEnd() {\n areaPoint(lambda00, phi00);\n}\n\nfunction areaPointFirst(lambda, phi) {\n areaStream.point = areaPoint;\n lambda00 = lambda, phi00 = phi;\n lambda *= radians, phi *= radians;\n lambda0 = lambda, cosPhi0 = cos(phi = phi / 2 + quarterPi), sinPhi0 = sin(phi);\n}\n\nfunction areaPoint(lambda, phi) {\n lambda *= radians, phi *= radians;\n phi = phi / 2 + quarterPi; // half the angular distance from south pole\n\n // Spherical excess E for a spherical triangle with vertices: south pole,\n // previous point, current point. Uses a formula derived from Cagnoli’s\n // theorem. See Todhunter, Spherical Trig. (1871), Sec. 103, Eq. (2).\n var dLambda = lambda - lambda0,\n sdLambda = dLambda >= 0 ? 1 : -1,\n adLambda = sdLambda * dLambda,\n cosPhi = cos(phi),\n sinPhi = sin(phi),\n k = sinPhi0 * sinPhi,\n u = cosPhi0 * cosPhi + k * cos(adLambda),\n v = k * sdLambda * sin(adLambda);\n areaRingSum.add(atan2(v, u));\n\n // Advance the previous points.\n lambda0 = lambda, cosPhi0 = cosPhi, sinPhi0 = sinPhi;\n}\n\nexport default function(object) {\n areaSum = new Adder();\n stream(object, areaStream);\n return areaSum * 2;\n}\n","import {Adder} from \"d3-array\";\nimport {areaStream, areaRingSum} from \"./area.js\";\nimport {cartesian, cartesianCross, cartesianNormalizeInPlace, spherical} from \"./cartesian.js\";\nimport {abs, degrees, epsilon, radians} from \"./math.js\";\nimport stream from \"./stream.js\";\n\nvar lambda0, phi0, lambda1, phi1, // bounds\n lambda2, // previous lambda-coordinate\n lambda00, phi00, // first point\n p0, // previous 3D point\n deltaSum,\n ranges,\n range;\n\nvar boundsStream = {\n point: boundsPoint,\n lineStart: boundsLineStart,\n lineEnd: boundsLineEnd,\n polygonStart: function() {\n boundsStream.point = boundsRingPoint;\n boundsStream.lineStart = boundsRingStart;\n boundsStream.lineEnd = boundsRingEnd;\n deltaSum = new Adder();\n areaStream.polygonStart();\n },\n polygonEnd: function() {\n areaStream.polygonEnd();\n boundsStream.point = boundsPoint;\n boundsStream.lineStart = boundsLineStart;\n boundsStream.lineEnd = boundsLineEnd;\n if (areaRingSum < 0) lambda0 = -(lambda1 = 180), phi0 = -(phi1 = 90);\n else if (deltaSum > epsilon) phi1 = 90;\n else if (deltaSum < -epsilon) phi0 = -90;\n range[0] = lambda0, range[1] = lambda1;\n },\n sphere: function() {\n lambda0 = -(lambda1 = 180), phi0 = -(phi1 = 90);\n }\n};\n\nfunction boundsPoint(lambda, phi) {\n ranges.push(range = [lambda0 = lambda, lambda1 = lambda]);\n if (phi < phi0) phi0 = phi;\n if (phi > phi1) phi1 = phi;\n}\n\nfunction linePoint(lambda, phi) {\n var p = cartesian([lambda * radians, phi * radians]);\n if (p0) {\n var normal = cartesianCross(p0, p),\n equatorial = [normal[1], -normal[0], 0],\n inflection = cartesianCross(equatorial, normal);\n cartesianNormalizeInPlace(inflection);\n inflection = spherical(inflection);\n var delta = lambda - lambda2,\n sign = delta > 0 ? 1 : -1,\n lambdai = inflection[0] * degrees * sign,\n phii,\n antimeridian = abs(delta) > 180;\n if (antimeridian ^ (sign * lambda2 < lambdai && lambdai < sign * lambda)) {\n phii = inflection[1] * degrees;\n if (phii > phi1) phi1 = phii;\n } else if (lambdai = (lambdai + 360) % 360 - 180, antimeridian ^ (sign * lambda2 < lambdai && lambdai < sign * lambda)) {\n phii = -inflection[1] * degrees;\n if (phii < phi0) phi0 = phii;\n } else {\n if (phi < phi0) phi0 = phi;\n if (phi > phi1) phi1 = phi;\n }\n if (antimeridian) {\n if (lambda < lambda2) {\n if (angle(lambda0, lambda) > angle(lambda0, lambda1)) lambda1 = lambda;\n } else {\n if (angle(lambda, lambda1) > angle(lambda0, lambda1)) lambda0 = lambda;\n }\n } else {\n if (lambda1 >= lambda0) {\n if (lambda < lambda0) lambda0 = lambda;\n if (lambda > lambda1) lambda1 = lambda;\n } else {\n if (lambda > lambda2) {\n if (angle(lambda0, lambda) > angle(lambda0, lambda1)) lambda1 = lambda;\n } else {\n if (angle(lambda, lambda1) > angle(lambda0, lambda1)) lambda0 = lambda;\n }\n }\n }\n } else {\n ranges.push(range = [lambda0 = lambda, lambda1 = lambda]);\n }\n if (phi < phi0) phi0 = phi;\n if (phi > phi1) phi1 = phi;\n p0 = p, lambda2 = lambda;\n}\n\nfunction boundsLineStart() {\n boundsStream.point = linePoint;\n}\n\nfunction boundsLineEnd() {\n range[0] = lambda0, range[1] = lambda1;\n boundsStream.point = boundsPoint;\n p0 = null;\n}\n\nfunction boundsRingPoint(lambda, phi) {\n if (p0) {\n var delta = lambda - lambda2;\n deltaSum.add(abs(delta) > 180 ? delta + (delta > 0 ? 360 : -360) : delta);\n } else {\n lambda00 = lambda, phi00 = phi;\n }\n areaStream.point(lambda, phi);\n linePoint(lambda, phi);\n}\n\nfunction boundsRingStart() {\n areaStream.lineStart();\n}\n\nfunction boundsRingEnd() {\n boundsRingPoint(lambda00, phi00);\n areaStream.lineEnd();\n if (abs(deltaSum) > epsilon) lambda0 = -(lambda1 = 180);\n range[0] = lambda0, range[1] = lambda1;\n p0 = null;\n}\n\n// Finds the left-right distance between two longitudes.\n// This is almost the same as (lambda1 - lambda0 + 360°) % 360°, except that we want\n// the distance between ±180° to be 360°.\nfunction angle(lambda0, lambda1) {\n return (lambda1 -= lambda0) < 0 ? lambda1 + 360 : lambda1;\n}\n\nfunction rangeCompare(a, b) {\n return a[0] - b[0];\n}\n\nfunction rangeContains(range, x) {\n return range[0] <= range[1] ? range[0] <= x && x <= range[1] : x < range[0] || range[1] < x;\n}\n\nexport default function(feature) {\n var i, n, a, b, merged, deltaMax, delta;\n\n phi1 = lambda1 = -(lambda0 = phi0 = Infinity);\n ranges = [];\n stream(feature, boundsStream);\n\n // First, sort ranges by their minimum longitudes.\n if (n = ranges.length) {\n ranges.sort(rangeCompare);\n\n // Then, merge any ranges that overlap.\n for (i = 1, a = ranges[0], merged = [a]; i < n; ++i) {\n b = ranges[i];\n if (rangeContains(a, b[0]) || rangeContains(a, b[1])) {\n if (angle(a[0], b[1]) > angle(a[0], a[1])) a[1] = b[1];\n if (angle(b[0], a[1]) > angle(a[0], a[1])) a[0] = b[0];\n } else {\n merged.push(a = b);\n }\n }\n\n // Finally, find the largest gap between the merged ranges.\n // The final bounding box will be the inverse of this gap.\n for (deltaMax = -Infinity, n = merged.length - 1, i = 0, a = merged[n]; i <= n; a = b, ++i) {\n b = merged[i];\n if ((delta = angle(a[1], b[0])) > deltaMax) deltaMax = delta, lambda0 = b[0], lambda1 = a[1];\n }\n }\n\n ranges = range = null;\n\n return lambda0 === Infinity || phi0 === Infinity\n ? [[NaN, NaN], [NaN, NaN]]\n : [[lambda0, phi0], [lambda1, phi1]];\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","import {Adder} from \"d3-array\";\nimport {asin, atan2, cos, degrees, epsilon, epsilon2, hypot, radians, sin, sqrt} from \"./math.js\";\nimport noop from \"./noop.js\";\nimport stream from \"./stream.js\";\n\nvar W0, W1,\n X0, Y0, Z0,\n X1, Y1, Z1,\n X2, Y2, Z2,\n lambda00, phi00, // first point\n x0, y0, z0; // previous point\n\nvar centroidStream = {\n sphere: noop,\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.lineStart = centroidLineStart;\n centroidStream.lineEnd = centroidLineEnd;\n }\n};\n\n// Arithmetic mean of Cartesian vectors.\nfunction centroidPoint(lambda, phi) {\n lambda *= radians, phi *= radians;\n var cosPhi = cos(phi);\n centroidPointCartesian(cosPhi * cos(lambda), cosPhi * sin(lambda), sin(phi));\n}\n\nfunction centroidPointCartesian(x, y, z) {\n ++W0;\n X0 += (x - X0) / W0;\n Y0 += (y - Y0) / W0;\n Z0 += (z - Z0) / W0;\n}\n\nfunction centroidLineStart() {\n centroidStream.point = centroidLinePointFirst;\n}\n\nfunction centroidLinePointFirst(lambda, phi) {\n lambda *= radians, phi *= radians;\n var cosPhi = cos(phi);\n x0 = cosPhi * cos(lambda);\n y0 = cosPhi * sin(lambda);\n z0 = sin(phi);\n centroidStream.point = centroidLinePoint;\n centroidPointCartesian(x0, y0, z0);\n}\n\nfunction centroidLinePoint(lambda, phi) {\n lambda *= radians, phi *= radians;\n var cosPhi = cos(phi),\n x = cosPhi * cos(lambda),\n y = cosPhi * sin(lambda),\n z = sin(phi),\n w = atan2(sqrt((w = y0 * z - z0 * y) * w + (w = z0 * x - x0 * z) * w + (w = x0 * y - y0 * x) * w), x0 * x + y0 * y + z0 * z);\n W1 += w;\n X1 += w * (x0 + (x0 = x));\n Y1 += w * (y0 + (y0 = y));\n Z1 += w * (z0 + (z0 = z));\n centroidPointCartesian(x0, y0, z0);\n}\n\nfunction centroidLineEnd() {\n centroidStream.point = centroidPoint;\n}\n\n// See J. E. Brock, The Inertia Tensor for a Spherical Triangle,\n// J. Applied Mechanics 42, 239 (1975).\nfunction centroidRingStart() {\n centroidStream.point = centroidRingPointFirst;\n}\n\nfunction centroidRingEnd() {\n centroidRingPoint(lambda00, phi00);\n centroidStream.point = centroidPoint;\n}\n\nfunction centroidRingPointFirst(lambda, phi) {\n lambda00 = lambda, phi00 = phi;\n lambda *= radians, phi *= radians;\n centroidStream.point = centroidRingPoint;\n var cosPhi = cos(phi);\n x0 = cosPhi * cos(lambda);\n y0 = cosPhi * sin(lambda);\n z0 = sin(phi);\n centroidPointCartesian(x0, y0, z0);\n}\n\nfunction centroidRingPoint(lambda, phi) {\n lambda *= radians, phi *= radians;\n var cosPhi = cos(phi),\n x = cosPhi * cos(lambda),\n y = cosPhi * sin(lambda),\n z = sin(phi),\n cx = y0 * z - z0 * y,\n cy = z0 * x - x0 * z,\n cz = x0 * y - y0 * x,\n m = hypot(cx, cy, cz),\n w = asin(m), // line weight = angle\n v = m && -w / m; // area weight multiplier\n X2.add(v * cx);\n Y2.add(v * cy);\n Z2.add(v * cz);\n W1 += w;\n X1 += w * (x0 + (x0 = x));\n Y1 += w * (y0 + (y0 = y));\n Z1 += w * (z0 + (z0 = z));\n centroidPointCartesian(x0, y0, z0);\n}\n\nexport default function(object) {\n W0 = W1 =\n X0 = Y0 = Z0 =\n X1 = Y1 = Z1 = 0;\n X2 = new Adder();\n Y2 = new Adder();\n Z2 = new Adder();\n stream(object, centroidStream);\n\n var x = +X2,\n y = +Y2,\n z = +Z2,\n m = hypot(x, y, z);\n\n // If the area-weighted ccentroid is undefined, fall back to length-weighted ccentroid.\n if (m < epsilon2) {\n x = X1, y = Y1, z = Z1;\n // If the feature has zero length, fall back to arithmetic mean of point vectors.\n if (W1 < epsilon) x = X0, y = Y0, z = Z0;\n m = hypot(x, y, z);\n // If the feature still has an undefined ccentroid, then return.\n if (m < epsilon2) return [NaN, NaN];\n }\n\n return [atan2(y, x) * degrees, asin(z / m) * degrees];\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 return [abs(lambda) > pi ? lambda + Math.round(-lambda / tau) * tau : 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 return lambda += deltaLambda, [lambda > pi ? lambda - tau : lambda < -pi ? lambda + tau : 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°, 0°], 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’s 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 ⨯ 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","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’s 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 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 {range} from \"d3-array\";\nimport {abs, ceil, epsilon} from \"./math.js\";\n\nfunction graticuleX(y0, y1, dy) {\n var y = range(y0, y1 - epsilon, dy).concat(y1);\n return function(x) { return y.map(function(y) { return [x, y]; }); };\n}\n\nfunction graticuleY(x0, x1, dx) {\n var x = range(x0, x1 - epsilon, dx).concat(x1);\n return function(y) { return x.map(function(x) { return [x, y]; }); };\n}\n\nexport default function graticule() {\n var x1, x0, X1, X0,\n y1, y0, Y1, Y0,\n dx = 10, dy = dx, DX = 90, DY = 360,\n x, y, X, Y,\n precision = 2.5;\n\n function graticule() {\n return {type: \"MultiLineString\", coordinates: lines()};\n }\n\n function lines() {\n return range(ceil(X0 / DX) * DX, X1, DX).map(X)\n .concat(range(ceil(Y0 / DY) * DY, Y1, DY).map(Y))\n .concat(range(ceil(x0 / dx) * dx, x1, dx).filter(function(x) { return abs(x % DX) > epsilon; }).map(x))\n .concat(range(ceil(y0 / dy) * dy, y1, dy).filter(function(y) { return abs(y % DY) > epsilon; }).map(y));\n }\n\n graticule.lines = function() {\n return lines().map(function(coordinates) { return {type: \"LineString\", coordinates: coordinates}; });\n };\n\n graticule.outline = function() {\n return {\n type: \"Polygon\",\n coordinates: [\n X(X0).concat(\n Y(Y1).slice(1),\n X(X1).reverse().slice(1),\n Y(Y0).reverse().slice(1))\n ]\n };\n };\n\n graticule.extent = function(_) {\n if (!arguments.length) return graticule.extentMinor();\n return graticule.extentMajor(_).extentMinor(_);\n };\n\n graticule.extentMajor = function(_) {\n if (!arguments.length) return [[X0, Y0], [X1, Y1]];\n X0 = +_[0][0], X1 = +_[1][0];\n Y0 = +_[0][1], Y1 = +_[1][1];\n if (X0 > X1) _ = X0, X0 = X1, X1 = _;\n if (Y0 > Y1) _ = Y0, Y0 = Y1, Y1 = _;\n return graticule.precision(precision);\n };\n\n graticule.extentMinor = function(_) {\n if (!arguments.length) return [[x0, y0], [x1, y1]];\n x0 = +_[0][0], x1 = +_[1][0];\n y0 = +_[0][1], y1 = +_[1][1];\n if (x0 > x1) _ = x0, x0 = x1, x1 = _;\n if (y0 > y1) _ = y0, y0 = y1, y1 = _;\n return graticule.precision(precision);\n };\n\n graticule.step = function(_) {\n if (!arguments.length) return graticule.stepMinor();\n return graticule.stepMajor(_).stepMinor(_);\n };\n\n graticule.stepMajor = function(_) {\n if (!arguments.length) return [DX, DY];\n DX = +_[0], DY = +_[1];\n return graticule;\n };\n\n graticule.stepMinor = function(_) {\n if (!arguments.length) return [dx, dy];\n dx = +_[0], dy = +_[1];\n return graticule;\n };\n\n graticule.precision = function(_) {\n if (!arguments.length) return precision;\n precision = +_;\n x = graticuleX(y0, y1, 90);\n y = graticuleY(x0, x1, precision);\n X = graticuleX(Y0, Y1, 90);\n Y = graticuleY(X0, X1, precision);\n return graticule;\n };\n\n return graticule\n .extentMajor([[-180, -90 + epsilon], [180, 90 - epsilon]])\n .extentMinor([[-180, -80 - epsilon], [180, 80 + epsilon]]);\n}\n\nexport function graticule10() {\n return graticule()();\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","export default function PathString() {\n this._string = [];\n}\n\nPathString.prototype = {\n _radius: 4.5,\n _circle: circle(4.5),\n pointRadius: function(_) {\n if ((_ = +_) !== this._radius) this._radius = _, this._circle = null;\n return this;\n },\n polygonStart: function() {\n this._line = 0;\n },\n polygonEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line === 0) this._string.push(\"Z\");\n this._point = NaN;\n },\n point: function(x, y) {\n switch (this._point) {\n case 0: {\n this._string.push(\"M\", x, \",\", y);\n this._point = 1;\n break;\n }\n case 1: {\n this._string.push(\"L\", x, \",\", y);\n break;\n }\n default: {\n if (this._circle == null) this._circle = circle(this._radius);\n this._string.push(\"M\", x, \",\", y, this._circle);\n break;\n }\n }\n },\n result: function() {\n if (this._string.length) {\n var result = this._string.join(\"\");\n this._string = [];\n return result;\n } else {\n return null;\n }\n }\n};\n\nfunction circle(radius) {\n return \"m0,\" + radius\n + \"a\" + radius + \",\" + radius + \" 0 1,1 0,\" + -2 * radius\n + \"a\" + radius + \",\" + radius + \" 0 1,1 0,\" + 2 * radius\n + \"z\";\n}\n","import identity from \"../identity.js\";\nimport stream from \"../stream.js\";\nimport pathArea from \"./area.js\";\nimport pathBounds from \"./bounds.js\";\nimport pathCentroid from \"./centroid.js\";\nimport PathContext from \"./context.js\";\nimport pathMeasure from \"./measure.js\";\nimport PathString from \"./string.js\";\n\nexport default function(projection, context) {\n var pointRadius = 4.5,\n projectionStream,\n contextStream;\n\n function path(object) {\n if (object) {\n if (typeof pointRadius === \"function\") contextStream.pointRadius(+pointRadius.apply(this, arguments));\n stream(object, projectionStream(contextStream));\n }\n return contextStream.result();\n }\n\n path.area = function(object) {\n stream(object, projectionStream(pathArea));\n return pathArea.result();\n };\n\n path.measure = function(object) {\n stream(object, projectionStream(pathMeasure));\n return pathMeasure.result();\n };\n\n path.bounds = function(object) {\n stream(object, projectionStream(pathBounds));\n return pathBounds.result();\n };\n\n path.centroid = function(object) {\n stream(object, projectionStream(pathCentroid));\n return pathCentroid.result();\n };\n\n path.projection = function(_) {\n return arguments.length ? (projectionStream = _ == null ? (projection = null, identity) : (projection = _).stream, path) : projection;\n };\n\n path.context = function(_) {\n if (!arguments.length) return context;\n contextStream = _ == null ? (context = null, new PathString) : new PathContext(context = _);\n if (typeof pointRadius !== \"function\") contextStream.pointRadius(pointRadius);\n return path;\n };\n\n path.pointRadius = function(_) {\n if (!arguments.length) return pointRadius;\n pointRadius = typeof _ === \"function\" ? _ : (contextStream.pointRadius(+_), +_);\n return path;\n };\n\n return path.projection(projection).context(context);\n}\n","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 {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 {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 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 {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 projection from \"./index.js\";\nimport {abs, epsilon} from \"../math.js\";\n\nexport function naturalEarth1Raw(lambda, phi) {\n var phi2 = phi * phi, phi4 = phi2 * phi2;\n return [\n lambda * (0.8707 - 0.131979 * phi2 + phi4 * (-0.013791 + phi4 * (0.003971 * phi2 - 0.001529 * phi4))),\n phi * (1.007226 + phi2 * (0.015085 + phi4 * (-0.044475 + 0.028874 * phi2 - 0.005916 * phi4)))\n ];\n}\n\nnaturalEarth1Raw.invert = function(x, y) {\n var phi = y, i = 25, delta;\n do {\n var phi2 = phi * phi, phi4 = phi2 * phi2;\n phi -= delta = (phi * (1.007226 + phi2 * (0.015085 + phi4 * (-0.044475 + 0.028874 * phi2 - 0.005916 * phi4))) - y) /\n (1.007226 + phi2 * (0.015085 * 3 + phi4 * (-0.044475 * 7 + 0.028874 * 9 * phi2 - 0.005916 * 11 * phi4)));\n } while (abs(delta) > epsilon && --i > 0);\n return [\n x / (0.8707 + (phi2 = phi * phi) * (-0.131979 + phi2 * (-0.013791 + phi2 * phi2 * phi2 * (0.003971 - 0.001529 * phi2)))),\n phi\n ];\n};\n\nexport default function() {\n return projection(naturalEarth1Raw)\n .scale(175.295);\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 var abs = Math.abs;\nexport var atan = Math.atan;\nexport var atan2 = Math.atan2;\nexport var ceil = Math.ceil;\nexport var cos = Math.cos;\nexport var exp = Math.exp;\nexport var floor = Math.floor;\nexport var log = Math.log;\nexport var max = Math.max;\nexport var min = Math.min;\nexport var pow = Math.pow;\nexport var round = Math.round;\nexport var sign = Math.sign || function(x) { return x > 0 ? 1 : x < 0 ? -1 : 0; };\nexport var sin = Math.sin;\nexport var tan = Math.tan;\n\nexport 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 sqrt1_2 = Math.SQRT1_2;\nexport var sqrt2 = sqrt(2);\nexport var sqrtPi = sqrt(pi);\nexport var tau = pi * 2;\nexport var degrees = 180 / pi;\nexport var radians = pi / 180;\n\nexport function sinci(x) {\n return x ? x / Math.sin(x) : 1;\n}\n\nexport function asin(x) {\n return x > 1 ? halfPi : x < -1 ? -halfPi : Math.asin(x);\n}\n\nexport function acos(x) {\n return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);\n}\n\nexport function sqrt(x) {\n return x > 0 ? Math.sqrt(x) : 0;\n}\n\nexport function tanh(x) {\n x = exp(2 * x);\n return (x - 1) / (x + 1);\n}\n\nexport function sinh(x) {\n return (exp(x) - exp(-x)) / 2;\n}\n\nexport function cosh(x) {\n return (exp(x) + exp(-x)) / 2;\n}\n\nexport function arsinh(x) {\n return log(x + sqrt(x * x + 1));\n}\n\nexport function arcosh(x) {\n return log(x + sqrt(x * x - 1));\n}\n","import {geoProjection as projection} from \"d3-geo\";\nimport {abs, asin, cos, epsilon, halfPi, pi, sin, sqrt2} from \"./math.js\";\n\nexport function mollweideBromleyTheta(cp, phi) {\n var cpsinPhi = cp * sin(phi), i = 30, delta;\n do phi -= delta = (phi + sin(phi) - cpsinPhi) / (1 + cos(phi));\n while (abs(delta) > epsilon && --i > 0);\n return phi / 2;\n}\n\nexport function mollweideBromleyRaw(cx, cy, cp) {\n\n function forward(lambda, phi) {\n return [cx * lambda * cos(phi = mollweideBromleyTheta(cp, phi)), cy * sin(phi)];\n }\n\n forward.invert = function(x, y) {\n return y = asin(y / cy), [x / (cx * cos(y)), asin((2 * y + sin(2 * y)) / cp)];\n };\n\n return forward;\n}\n\nexport var mollweideRaw = mollweideBromleyRaw(sqrt2 / halfPi, sqrt2, pi);\n\nexport default function() {\n return projection(mollweideRaw)\n .scale(169.529);\n}\n","import { geoPath, geoAlbers, geoAlbersUsa, geoAzimuthalEqualArea, geoAzimuthalEquidistant, geoConicConformal, geoConicEqualArea, geoConicEquidistant, geoEqualEarth, geoEquirectangular, geoGnomonic, geoIdentity, geoMercator, geoNaturalEarth1, geoOrthographic, geoStereographic, geoTransverseMercator } from 'd3-geo';\nimport { geoMollweide } from 'd3-geo-projection';\n\nconst defaultPath = geoPath();\nconst projectionProperties = [// standard properties in d3-geo\n'clipAngle', 'clipExtent', 'scale', 'translate', 'center', 'rotate', 'parallels', 'precision', 'reflectX', 'reflectY', // extended properties in d3-geo-projections\n'coefficient', 'distance', 'fraction', 'lobes', 'parallel', 'radius', 'ratio', 'spacing', 'tilt'];\n/**\n * Augment projections with their type and a copy method.\n */\n\nfunction create(type, constructor) {\n return function projection() {\n const p = constructor();\n p.type = type;\n p.path = geoPath().projection(p);\n\n p.copy = p.copy || function () {\n const c = projection();\n projectionProperties.forEach(prop => {\n if (p[prop]) c[prop](p[prop]());\n });\n c.path.pointRadius(p.path.pointRadius());\n return c;\n };\n\n return p;\n };\n}\n\nfunction projection(type, proj) {\n if (!type || typeof type !== 'string') {\n throw new Error('Projection type must be a name string.');\n }\n\n type = type.toLowerCase();\n\n if (arguments.length > 1) {\n projections[type] = create(type, proj);\n return this;\n } else {\n return projections[type] || null;\n }\n}\nfunction getProjectionPath(proj) {\n return proj && proj.path || defaultPath;\n}\nconst projections = {\n // base d3-geo projection types\n albers: geoAlbers,\n albersusa: geoAlbersUsa,\n azimuthalequalarea: geoAzimuthalEqualArea,\n azimuthalequidistant: geoAzimuthalEquidistant,\n conicconformal: geoConicConformal,\n conicequalarea: geoConicEqualArea,\n conicequidistant: geoConicEquidistant,\n equalEarth: geoEqualEarth,\n equirectangular: geoEquirectangular,\n gnomonic: geoGnomonic,\n identity: geoIdentity,\n mercator: geoMercator,\n mollweide: geoMollweide,\n naturalEarth1: geoNaturalEarth1,\n orthographic: geoOrthographic,\n stereographic: geoStereographic,\n transversemercator: geoTransverseMercator\n};\n\nfor (const key in projections) {\n projection(key, projections[key]);\n}\n\nexport { getProjectionPath, projection, projectionProperties };\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×500. The projection also works quite well at 960×600 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 clipRectangle from \"../clip/rectangle.js\";\nimport identity from \"../identity.js\";\nimport {transformer} from \"../transform.js\";\nimport {fitExtent, fitSize, fitWidth, fitHeight} from \"./fit.js\";\nimport {cos, degrees, radians, sin} from \"../math.js\";\n\nexport default function() {\n var k = 1, tx = 0, ty = 0, sx = 1, sy = 1, // scale, translate and reflect\n alpha = 0, ca, sa, // angle\n x0 = null, y0, x1, y1, // clip extent\n kx = 1, ky = 1,\n transform = transformer({\n point: function(x, y) {\n var p = projection([x, y])\n this.stream.point(p[0], p[1]);\n }\n }),\n postclip = identity,\n cache,\n cacheStream;\n\n function reset() {\n kx = k * sx;\n ky = k * sy;\n cache = cacheStream = null;\n return projection;\n }\n\n function projection (p) {\n var x = p[0] * kx, y = p[1] * ky;\n if (alpha) {\n var t = y * ca - x * sa;\n x = x * ca + y * sa;\n y = t;\n } \n return [x + tx, y + ty];\n }\n projection.invert = function(p) {\n var x = p[0] - tx, y = p[1] - ty;\n if (alpha) {\n var t = y * ca + x * sa;\n x = x * ca - y * sa;\n y = t;\n }\n return [x / kx, y / ky];\n };\n projection.stream = function(stream) {\n return cache && cacheStream === stream ? cache : cache = transform(postclip(cacheStream = stream));\n };\n projection.postclip = function(_) {\n return arguments.length ? (postclip = _, x0 = y0 = x1 = y1 = null, reset()) : postclip;\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 projection.scale = function(_) {\n return arguments.length ? (k = +_, reset()) : k;\n };\n projection.translate = function(_) {\n return arguments.length ? (tx = +_[0], ty = +_[1], reset()) : [tx, ty];\n }\n projection.angle = function(_) {\n return arguments.length ? (alpha = _ % 360 * radians, sa = sin(alpha), ca = cos(alpha), reset()) : alpha * degrees;\n };\n projection.reflectX = function(_) {\n return arguments.length ? (sx = _ ? -1 : 1, reset()) : sx < 0;\n };\n projection.reflectY = function(_) {\n return arguments.length ? (sy = _ ? -1 : 1, reset()) : sy < 0;\n };\n projection.fitExtent = function(extent, object) {\n return fitExtent(projection, extent, object);\n };\n projection.fitSize = function(size, object) {\n return fitSize(projection, size, object);\n };\n projection.fitWidth = function(width, object) {\n return fitWidth(projection, width, object);\n };\n projection.fitHeight = function(height, object) {\n return fitHeight(projection, height, object);\n };\n\n return projection;\n}\n","import { Transform, rederive, ingest, replace } from 'vega-dataflow';\nimport { error, extent, inherits, identity, isArray, isFunction, isNumber, constant, array, one, accessorName, accessorFields, field, extend, toSet, zero } from 'vega-util';\nimport { tickStep, range, max, sum } from 'd3-array';\nimport { bandwidthNRD } from 'vega-statistics';\nimport { getProjectionPath, projectionProperties, projection } from 'vega-projection';\nimport { geoGraticule } from 'd3-geo';\nimport { rgb } from 'd3-color';\nimport { canvas } from 'vega-canvas';\n\nfunction noop() {}\n\nconst cases = [[], [[[1.0, 1.5], [0.5, 1.0]]], [[[1.5, 1.0], [1.0, 1.5]]], [[[1.5, 1.0], [0.5, 1.0]]], [[[1.0, 0.5], [1.5, 1.0]]], [[[1.0, 1.5], [0.5, 1.0]], [[1.0, 0.5], [1.5, 1.0]]], [[[1.0, 0.5], [1.0, 1.5]]], [[[1.0, 0.5], [0.5, 1.0]]], [[[0.5, 1.0], [1.0, 0.5]]], [[[1.0, 1.5], [1.0, 0.5]]], [[[0.5, 1.0], [1.0, 0.5]], [[1.5, 1.0], [1.0, 1.5]]], [[[1.5, 1.0], [1.0, 0.5]]], [[[0.5, 1.0], [1.5, 1.0]]], [[[1.0, 1.5], [1.5, 1.0]]], [[[0.5, 1.0], [1.0, 1.5]]], []]; // Implementation adapted from d3/d3-contour. Thanks!\n\nfunction contours () {\n var dx = 1,\n dy = 1,\n smooth = smoothLinear;\n\n function contours(values, tz) {\n return tz.map(value => contour(values, value));\n } // Accumulate, smooth contour rings, assign holes to exterior rings.\n // Based on https://github.com/mbostock/shapefile/blob/v0.6.2/shp/polygon.js\n\n\n function contour(values, value) {\n var polygons = [],\n holes = [];\n isorings(values, value, ring => {\n smooth(ring, values, value);\n if (area(ring) > 0) polygons.push([ring]);else holes.push(ring);\n });\n holes.forEach(hole => {\n for (var i = 0, n = polygons.length, polygon; i < n; ++i) {\n if (contains((polygon = polygons[i])[0], hole) !== -1) {\n polygon.push(hole);\n return;\n }\n }\n });\n return {\n type: 'MultiPolygon',\n value: value,\n coordinates: polygons\n };\n } // Marching squares with isolines stitched into rings.\n // Based on https://github.com/topojson/topojson-client/blob/v3.0.0/src/stitch.js\n\n\n function isorings(values, value, callback) {\n var fragmentByStart = new Array(),\n fragmentByEnd = new Array(),\n x,\n y,\n t0,\n t1,\n t2,\n t3; // Special case for the first row (y = -1, t2 = t3 = 0).\n\n x = y = -1;\n t1 = values[0] >= value;\n cases[t1 << 1].forEach(stitch);\n\n while (++x < dx - 1) {\n t0 = t1, t1 = values[x + 1] >= value;\n cases[t0 | t1 << 1].forEach(stitch);\n }\n\n cases[t1 << 0].forEach(stitch); // General case for the intermediate rows.\n\n while (++y < dy - 1) {\n x = -1;\n t1 = values[y * dx + dx] >= value;\n t2 = values[y * dx] >= value;\n cases[t1 << 1 | t2 << 2].forEach(stitch);\n\n while (++x < dx - 1) {\n t0 = t1, t1 = values[y * dx + dx + x + 1] >= value;\n t3 = t2, t2 = values[y * dx + x + 1] >= value;\n cases[t0 | t1 << 1 | t2 << 2 | t3 << 3].forEach(stitch);\n }\n\n cases[t1 | t2 << 3].forEach(stitch);\n } // Special case for the last row (y = dy - 1, t0 = t1 = 0).\n\n\n x = -1;\n t2 = values[y * dx] >= value;\n cases[t2 << 2].forEach(stitch);\n\n while (++x < dx - 1) {\n t3 = t2, t2 = values[y * dx + x + 1] >= value;\n cases[t2 << 2 | t3 << 3].forEach(stitch);\n }\n\n cases[t2 << 3].forEach(stitch);\n\n function stitch(line) {\n var start = [line[0][0] + x, line[0][1] + y],\n end = [line[1][0] + x, line[1][1] + y],\n startIndex = index(start),\n endIndex = index(end),\n f,\n g;\n\n if (f = fragmentByEnd[startIndex]) {\n if (g = fragmentByStart[endIndex]) {\n delete fragmentByEnd[f.end];\n delete fragmentByStart[g.start];\n\n if (f === g) {\n f.ring.push(end);\n callback(f.ring);\n } else {\n fragmentByStart[f.start] = fragmentByEnd[g.end] = {\n start: f.start,\n end: g.end,\n ring: f.ring.concat(g.ring)\n };\n }\n } else {\n delete fragmentByEnd[f.end];\n f.ring.push(end);\n fragmentByEnd[f.end = endIndex] = f;\n }\n } else if (f = fragmentByStart[endIndex]) {\n if (g = fragmentByEnd[startIndex]) {\n delete fragmentByStart[f.start];\n delete fragmentByEnd[g.end];\n\n if (f === g) {\n f.ring.push(end);\n callback(f.ring);\n } else {\n fragmentByStart[g.start] = fragmentByEnd[f.end] = {\n start: g.start,\n end: f.end,\n ring: g.ring.concat(f.ring)\n };\n }\n } else {\n delete fragmentByStart[f.start];\n f.ring.unshift(start);\n fragmentByStart[f.start = startIndex] = f;\n }\n } else {\n fragmentByStart[startIndex] = fragmentByEnd[endIndex] = {\n start: startIndex,\n end: endIndex,\n ring: [start, end]\n };\n }\n }\n }\n\n function index(point) {\n return point[0] * 2 + point[1] * (dx + 1) * 4;\n }\n\n function smoothLinear(ring, values, value) {\n ring.forEach(point => {\n var x = point[0],\n y = point[1],\n xt = x | 0,\n yt = y | 0,\n v0,\n v1 = values[yt * dx + xt];\n\n if (x > 0 && x < dx && xt === x) {\n v0 = values[yt * dx + xt - 1];\n point[0] = x + (value - v0) / (v1 - v0) - 0.5;\n }\n\n if (y > 0 && y < dy && yt === y) {\n v0 = values[(yt - 1) * dx + xt];\n point[1] = y + (value - v0) / (v1 - v0) - 0.5;\n }\n });\n }\n\n contours.contour = contour;\n\n contours.size = function (_) {\n if (!arguments.length) return [dx, dy];\n\n var _0 = Math.floor(_[0]),\n _1 = Math.floor(_[1]);\n\n if (!(_0 >= 0 && _1 >= 0)) error('invalid size');\n return dx = _0, dy = _1, contours;\n };\n\n contours.smooth = function (_) {\n return arguments.length ? (smooth = _ ? smoothLinear : noop, contours) : smooth === smoothLinear;\n };\n\n return contours;\n}\n\nfunction area(ring) {\n var i = 0,\n n = ring.length,\n area = ring[n - 1][1] * ring[0][0] - ring[n - 1][0] * ring[0][1];\n\n while (++i < n) area += ring[i - 1][1] * ring[i][0] - ring[i - 1][0] * ring[i][1];\n\n return area;\n}\n\nfunction contains(ring, hole) {\n var i = -1,\n n = hole.length,\n c;\n\n while (++i < n) if (c = ringContains(ring, hole[i])) return c;\n\n return 0;\n}\n\nfunction ringContains(ring, point) {\n var x = point[0],\n y = point[1],\n contains = -1;\n\n for (var i = 0, n = ring.length, j = n - 1; i < n; j = i++) {\n var pi = ring[i],\n xi = pi[0],\n yi = pi[1],\n pj = ring[j],\n xj = pj[0],\n yj = pj[1];\n if (segmentContains(pi, pj, point)) return 0;\n if (yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi) contains = -contains;\n }\n\n return contains;\n}\n\nfunction segmentContains(a, b, c) {\n var i;\n return collinear(a, b, c) && within(a[i = +(a[0] === b[0])], c[i], b[i]);\n}\n\nfunction collinear(a, b, c) {\n return (b[0] - a[0]) * (c[1] - a[1]) === (c[0] - a[0]) * (b[1] - a[1]);\n}\n\nfunction within(p, q, r) {\n return p <= q && q <= r || r <= q && q <= p;\n}\n\nfunction quantize (k, nice, zero) {\n return function (values) {\n var ex = extent(values),\n start = zero ? Math.min(ex[0], 0) : ex[0],\n stop = ex[1],\n span = stop - start,\n step = nice ? tickStep(start, stop, k) : span / (k + 1);\n return range(start + step, stop, step);\n };\n}\n\n/**\n * Generate isocontours (level sets) based on input raster grid data.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} [params.field] - The field with raster grid\n * data. If unspecified, the tuple itself is interpreted as a raster grid.\n * @param {Array} [params.thresholds] - Contour threshold array. If\n * specified, the levels, nice, resolve, and zero parameters are ignored.\n * @param {number} [params.levels] - The desired number of contour levels.\n * @param {boolean} [params.nice] - Boolean flag indicating if the contour\n * threshold values should be automatically aligned to \"nice\"\n * human-friendly values. Setting this flag may cause the number of\n * thresholds to deviate from the specified levels.\n * @param {string} [params.resolve] - The method for resolving thresholds\n * across multiple input grids. If 'independent' (the default), threshold\n * calculation will be performed separately for each grid. If 'shared', a\n * single set of threshold values will be used for all input grids.\n * @param {boolean} [params.zero] - Boolean flag indicating if the contour\n * threshold values should include zero.\n * @param {boolean} [params.smooth] - Boolean flag indicating if the contour\n * polygons should be smoothed using linear interpolation. The default is\n * true. The parameter is ignored when using density estimation.\n * @param {boolean} [params.scale] - Optional numerical value by which to\n * scale the output isocontour coordinates. This parameter can be useful\n * to scale the contours to match a desired output resolution.\n * @param {string} [params.as='contour'] - The output field in which to store\n * the generated isocontour data (default 'contour').\n */\n\nfunction Isocontour(params) {\n Transform.call(this, null, params);\n}\nIsocontour.Definition = {\n 'type': 'Isocontour',\n 'metadata': {\n 'generates': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field'\n }, {\n 'name': 'thresholds',\n 'type': 'number',\n 'array': true\n }, {\n 'name': 'levels',\n 'type': 'number'\n }, {\n 'name': 'nice',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'resolve',\n 'type': 'enum',\n 'values': ['shared', 'independent'],\n 'default': 'independent'\n }, {\n 'name': 'zero',\n 'type': 'boolean',\n 'default': true\n }, {\n 'name': 'smooth',\n 'type': 'boolean',\n 'default': true\n }, {\n 'name': 'scale',\n 'type': 'number',\n 'expr': true\n }, {\n 'name': 'translate',\n 'type': 'number',\n 'array': true,\n 'expr': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'null': true,\n 'default': 'contour'\n }]\n};\ninherits(Isocontour, Transform, {\n transform(_, pulse) {\n if (this.value && !pulse.changed() && !_.modified()) {\n return pulse.StopPropagation;\n }\n\n var out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS),\n source = pulse.materialize(pulse.SOURCE).source,\n field = _.field || identity,\n contour = contours().smooth(_.smooth !== false),\n tz = _.thresholds || levels(source, field, _),\n as = _.as === null ? null : _.as || 'contour',\n values = [];\n source.forEach(t => {\n const grid = field(t); // generate contour paths in GeoJSON format\n\n const paths = contour.size([grid.width, grid.height])(grid.values, isArray(tz) ? tz : tz(grid.values)); // adjust contour path coordinates as needed\n\n transformPaths(paths, grid, t, _); // ingest; copy source data properties to output\n\n paths.forEach(p => {\n values.push(rederive(t, ingest(as != null ? {\n [as]: p\n } : p)));\n });\n });\n if (this.value) out.rem = this.value;\n this.value = out.source = out.add = values;\n return out;\n }\n\n});\n\nfunction levels(values, f, _) {\n const q = quantize(_.levels || 10, _.nice, _.zero !== false);\n return _.resolve !== 'shared' ? q : q(values.map(t => max(f(t).values)));\n}\n\nfunction transformPaths(paths, grid, datum, _) {\n let s = _.scale || grid.scale,\n t = _.translate || grid.translate;\n if (isFunction(s)) s = s(datum, _);\n if (isFunction(t)) t = t(datum, _);\n if ((s === 1 || s == null) && !t) return;\n const sx = (isNumber(s) ? s : s[0]) || 1,\n sy = (isNumber(s) ? s : s[1]) || 1,\n tx = t && t[0] || 0,\n ty = t && t[1] || 0;\n paths.forEach(transform(grid, sx, sy, tx, ty));\n}\n\nfunction transform(grid, sx, sy, tx, ty) {\n const x1 = grid.x1 || 0,\n y1 = grid.y1 || 0,\n flip = sx * sy < 0;\n\n function transformPolygon(coordinates) {\n coordinates.forEach(transformRing);\n }\n\n function transformRing(coordinates) {\n if (flip) coordinates.reverse(); // maintain winding order\n\n coordinates.forEach(transformPoint);\n }\n\n function transformPoint(coordinates) {\n coordinates[0] = (coordinates[0] - x1) * sx + tx;\n coordinates[1] = (coordinates[1] - y1) * sy + ty;\n }\n\n return function (geometry) {\n geometry.coordinates.forEach(transformPolygon);\n return geometry;\n };\n}\n\nfunction radius(bw, data, f) {\n const v = bw >= 0 ? bw : bandwidthNRD(data, f);\n return Math.round((Math.sqrt(4 * v * v + 1) - 1) / 2);\n}\n\nfunction number(_) {\n return isFunction(_) ? _ : constant(+_);\n} // Implementation adapted from d3/d3-contour. Thanks!\n\n\nfunction density2D () {\n var x = d => d[0],\n y = d => d[1],\n weight = one,\n bandwidth = [-1, -1],\n dx = 960,\n dy = 500,\n k = 2; // log2(cellSize)\n\n\n function density(data, counts) {\n const rx = radius(bandwidth[0], data, x) >> k,\n // blur x-radius\n ry = radius(bandwidth[1], data, y) >> k,\n // blur y-radius\n ox = rx ? rx + 2 : 0,\n // x-offset padding for blur\n oy = ry ? ry + 2 : 0,\n // y-offset padding for blur\n n = 2 * ox + (dx >> k),\n // grid width\n m = 2 * oy + (dy >> k),\n // grid height\n values0 = new Float32Array(n * m),\n values1 = new Float32Array(n * m);\n let values = values0;\n data.forEach(d => {\n const xi = ox + (+x(d) >> k),\n yi = oy + (+y(d) >> k);\n\n if (xi >= 0 && xi < n && yi >= 0 && yi < m) {\n values0[xi + yi * n] += +weight(d);\n }\n });\n\n if (rx > 0 && ry > 0) {\n blurX(n, m, values0, values1, rx);\n blurY(n, m, values1, values0, ry);\n blurX(n, m, values0, values1, rx);\n blurY(n, m, values1, values0, ry);\n blurX(n, m, values0, values1, rx);\n blurY(n, m, values1, values0, ry);\n } else if (rx > 0) {\n blurX(n, m, values0, values1, rx);\n blurX(n, m, values1, values0, rx);\n blurX(n, m, values0, values1, rx);\n values = values1;\n } else if (ry > 0) {\n blurY(n, m, values0, values1, ry);\n blurY(n, m, values1, values0, ry);\n blurY(n, m, values0, values1, ry);\n values = values1;\n } // scale density estimates\n // density in points per square pixel or probability density\n\n\n const s = counts ? Math.pow(2, -2 * k) : 1 / sum(values);\n\n for (let i = 0, sz = n * m; i < sz; ++i) values[i] *= s;\n\n return {\n values: values,\n scale: 1 << k,\n width: n,\n height: m,\n x1: ox,\n y1: oy,\n x2: ox + (dx >> k),\n y2: oy + (dy >> k)\n };\n }\n\n density.x = function (_) {\n return arguments.length ? (x = number(_), density) : x;\n };\n\n density.y = function (_) {\n return arguments.length ? (y = number(_), density) : y;\n };\n\n density.weight = function (_) {\n return arguments.length ? (weight = number(_), density) : weight;\n };\n\n density.size = function (_) {\n if (!arguments.length) return [dx, dy];\n\n var _0 = +_[0],\n _1 = +_[1];\n\n if (!(_0 >= 0 && _1 >= 0)) error('invalid size');\n return dx = _0, dy = _1, density;\n };\n\n density.cellSize = function (_) {\n if (!arguments.length) return 1 << k;\n if (!((_ = +_) >= 1)) error('invalid cell size');\n k = Math.floor(Math.log(_) / Math.LN2);\n return density;\n };\n\n density.bandwidth = function (_) {\n if (!arguments.length) return bandwidth;\n _ = array(_);\n if (_.length === 1) _ = [+_[0], +_[0]];\n if (_.length !== 2) error('invalid bandwidth');\n return bandwidth = _, density;\n };\n\n return density;\n}\n\nfunction blurX(n, m, source, target, r) {\n const w = (r << 1) + 1;\n\n for (let j = 0; j < m; ++j) {\n for (let i = 0, sr = 0; i < n + r; ++i) {\n if (i < n) {\n sr += source[i + j * n];\n }\n\n if (i >= r) {\n if (i >= w) {\n sr -= source[i - w + j * n];\n }\n\n target[i - r + j * n] = sr / Math.min(i + 1, n - 1 + w - i, w);\n }\n }\n }\n}\n\nfunction blurY(n, m, source, target, r) {\n const w = (r << 1) + 1;\n\n for (let i = 0; i < n; ++i) {\n for (let j = 0, sr = 0; j < m + r; ++j) {\n if (j < m) {\n sr += source[i + j * n];\n }\n\n if (j >= r) {\n if (j >= w) {\n sr -= source[i + (j - w) * n];\n }\n\n target[i + (j - r) * n] = sr / Math.min(j + 1, m - 1 + w - j, w);\n }\n }\n }\n}\n\n/**\n * Perform 2D kernel-density estimation of point data.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} params.size - The [width, height] extent (in\n * units of input pixels) over which to perform density estimation.\n * @param {function(object): number} params.x - The x-coordinate accessor.\n * @param {function(object): number} params.y - The y-coordinate accessor.\n * @param {function(object): number} [params.weight] - The weight accessor.\n * @param {Array} [params.groupby] - An array of accessors\n * to groupby.\n * @param {number} [params.cellSize] - Contour density calculation cell size.\n * This parameter determines the level of spatial approximation. For example,\n * the default value of 4 maps to 2x reductions in both x- and y- dimensions.\n * A value of 1 will result in an output raster grid whose dimensions exactly\n * matches the size parameter.\n * @param {Array} [params.bandwidth] - The KDE kernel bandwidths,\n * in pixels. The input can be a two-element array specifying separate\n * x and y bandwidths, or a single-element array specifying both. If the\n * bandwidth is unspecified or less than zero, the bandwidth will be\n * automatically determined.\n * @param {boolean} [params.counts=false] - A boolean flag indicating if the\n * output values should be probability estimates (false, default) or\n * smoothed counts (true).\n * @param {string} [params.as='grid'] - The output field in which to store\n * the generated raster grid (default 'grid').\n */\n\nfunction KDE2D(params) {\n Transform.call(this, null, params);\n}\nKDE2D.Definition = {\n 'type': 'KDE2D',\n 'metadata': {\n 'generates': true\n },\n 'params': [{\n 'name': 'size',\n 'type': 'number',\n 'array': true,\n 'length': 2,\n 'required': true\n }, {\n 'name': 'x',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'y',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'weight',\n 'type': 'field'\n }, {\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'cellSize',\n 'type': 'number'\n }, {\n 'name': 'bandwidth',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'counts',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'as',\n 'type': 'string',\n 'default': 'grid'\n }]\n};\nconst PARAMS = ['x', 'y', 'weight', 'size', 'cellSize', 'bandwidth'];\nfunction params(obj, _) {\n PARAMS.forEach(param => _[param] != null ? obj[param](_[param]) : 0);\n return obj;\n}\ninherits(KDE2D, Transform, {\n transform(_, pulse) {\n if (this.value && !pulse.changed() && !_.modified()) return pulse.StopPropagation;\n var out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS),\n source = pulse.materialize(pulse.SOURCE).source,\n groups = partition(source, _.groupby),\n names = (_.groupby || []).map(accessorName),\n kde = params(density2D(), _),\n as = _.as || 'grid',\n values = [];\n\n function set(t, vals) {\n for (let i = 0; i < names.length; ++i) t[names[i]] = vals[i];\n\n return t;\n } // generate density raster grids\n\n\n values = groups.map(g => ingest(set({\n [as]: kde(g, _.counts)\n }, g.dims)));\n if (this.value) out.rem = this.value;\n this.value = out.source = out.add = values;\n return out;\n }\n\n});\nfunction partition(data, groupby) {\n var groups = [],\n get = f => f(t),\n map,\n i,\n n,\n t,\n k,\n g; // partition data points into groups\n\n\n if (groupby == null) {\n groups.push(data);\n } else {\n for (map = {}, i = 0, n = data.length; i < n; ++i) {\n t = data[i];\n k = groupby.map(get);\n g = map[k];\n\n if (!g) {\n map[k] = g = [];\n g.dims = k;\n groups.push(g);\n }\n\n g.push(t);\n }\n }\n\n return groups;\n}\n\n/**\n * Generate contours based on kernel-density estimation of point data.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} params.size - The dimensions [width, height] over which to compute contours.\n * If the values parameter is provided, this must be the dimensions of the input data.\n * If density estimation is performed, this is the output view dimensions in pixels.\n * @param {Array} [params.values] - An array of numeric values representing an\n * width x height grid of values over which to compute contours. If unspecified, this\n * transform will instead attempt to compute contours for the kernel density estimate\n * using values drawn from data tuples in the input pulse.\n * @param {function(object): number} [params.x] - The pixel x-coordinate accessor for density estimation.\n * @param {function(object): number} [params.y] - The pixel y-coordinate accessor for density estimation.\n * @param {function(object): number} [params.weight] - The data point weight accessor for density estimation.\n * @param {number} [params.cellSize] - Contour density calculation cell size.\n * @param {number} [params.bandwidth] - Kernel density estimation bandwidth.\n * @param {Array} [params.thresholds] - Contour threshold array. If\n * this parameter is set, the count and nice parameters will be ignored.\n * @param {number} [params.count] - The desired number of contours.\n * @param {boolean} [params.nice] - Boolean flag indicating if the contour\n * threshold values should be automatically aligned to \"nice\"\n * human-friendly values. Setting this flag may cause the number of\n * thresholds to deviate from the specified count.\n * @param {boolean} [params.smooth] - Boolean flag indicating if the contour\n * polygons should be smoothed using linear interpolation. The default is\n * true. The parameter is ignored when using density estimation.\n */\n\nfunction Contour(params) {\n Transform.call(this, null, params);\n}\nContour.Definition = {\n 'type': 'Contour',\n 'metadata': {\n 'generates': true\n },\n 'params': [{\n 'name': 'size',\n 'type': 'number',\n 'array': true,\n 'length': 2,\n 'required': true\n }, {\n 'name': 'values',\n 'type': 'number',\n 'array': true\n }, {\n 'name': 'x',\n 'type': 'field'\n }, {\n 'name': 'y',\n 'type': 'field'\n }, {\n 'name': 'weight',\n 'type': 'field'\n }, {\n 'name': 'cellSize',\n 'type': 'number'\n }, {\n 'name': 'bandwidth',\n 'type': 'number'\n }, {\n 'name': 'count',\n 'type': 'number'\n }, {\n 'name': 'nice',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'thresholds',\n 'type': 'number',\n 'array': true\n }, {\n 'name': 'smooth',\n 'type': 'boolean',\n 'default': true\n }]\n};\ninherits(Contour, Transform, {\n transform(_, pulse) {\n if (this.value && !pulse.changed() && !_.modified()) {\n return pulse.StopPropagation;\n }\n\n var out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS),\n contour = contours().smooth(_.smooth !== false),\n values = _.values,\n thresh = _.thresholds || quantize(_.count || 10, _.nice, !!values),\n size = _.size,\n grid,\n post;\n\n if (!values) {\n values = pulse.materialize(pulse.SOURCE).source;\n grid = params(density2D(), _)(values, true);\n post = transform(grid, grid.scale || 1, grid.scale || 1, 0, 0);\n size = [grid.width, grid.height];\n values = grid.values;\n }\n\n thresh = isArray(thresh) ? thresh : thresh(values);\n values = contour.size(size)(values, thresh);\n if (post) values.forEach(post);\n if (this.value) out.rem = this.value;\n this.value = out.source = out.add = (values || []).map(ingest);\n return out;\n }\n\n});\n\nconst Feature = 'Feature';\nconst FeatureCollection = 'FeatureCollection';\nconst MultiPoint = 'MultiPoint';\n\n/**\n * Consolidate an array of [longitude, latitude] points or GeoJSON features\n * into a combined GeoJSON object. This transform is particularly useful for\n * combining geo data for a Projection's fit argument. The resulting GeoJSON\n * data is available as this transform's value. Input pulses are unchanged.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} [params.fields] - A two-element array\n * of field accessors for the longitude and latitude values.\n * @param {function(object): *} params.geojson - A field accessor for\n * retrieving GeoJSON feature data.\n */\n\nfunction GeoJSON(params) {\n Transform.call(this, null, params);\n}\nGeoJSON.Definition = {\n 'type': 'GeoJSON',\n 'metadata': {},\n 'params': [{\n 'name': 'fields',\n 'type': 'field',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'geojson',\n 'type': 'field'\n }]\n};\ninherits(GeoJSON, Transform, {\n transform(_, pulse) {\n var features = this._features,\n points = this._points,\n fields = _.fields,\n lon = fields && fields[0],\n lat = fields && fields[1],\n geojson = _.geojson || !fields && identity,\n flag = pulse.ADD,\n mod;\n mod = _.modified() || pulse.changed(pulse.REM) || pulse.modified(accessorFields(geojson)) || lon && pulse.modified(accessorFields(lon)) || lat && pulse.modified(accessorFields(lat));\n\n if (!this.value || mod) {\n flag = pulse.SOURCE;\n this._features = features = [];\n this._points = points = [];\n }\n\n if (geojson) {\n pulse.visit(flag, t => features.push(geojson(t)));\n }\n\n if (lon && lat) {\n pulse.visit(flag, t => {\n var x = lon(t),\n y = lat(t);\n\n if (x != null && y != null && (x = +x) === x && (y = +y) === y) {\n points.push([x, y]);\n }\n });\n features = features.concat({\n type: Feature,\n geometry: {\n type: MultiPoint,\n coordinates: points\n }\n });\n }\n\n this.value = {\n type: FeatureCollection,\n features: features\n };\n }\n\n});\n\n/**\n * Map GeoJSON data to an SVG path string.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(number, number): *} params.projection - The cartographic\n * projection to apply.\n * @param {function(object): *} [params.field] - The field with GeoJSON data,\n * or null if the tuple itself is a GeoJSON feature.\n * @param {string} [params.as='path'] - The output field in which to store\n * the generated path data (default 'path').\n */\n\nfunction GeoPath(params) {\n Transform.call(this, null, params);\n}\nGeoPath.Definition = {\n 'type': 'GeoPath',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'projection',\n 'type': 'projection'\n }, {\n 'name': 'field',\n 'type': 'field'\n }, {\n 'name': 'pointRadius',\n 'type': 'number',\n 'expr': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'default': 'path'\n }]\n};\ninherits(GeoPath, Transform, {\n transform(_, pulse) {\n var out = pulse.fork(pulse.ALL),\n path = this.value,\n field = _.field || identity,\n as = _.as || 'path',\n flag = out.SOURCE;\n\n if (!path || _.modified()) {\n // parameters updated, reset and reflow\n this.value = path = getProjectionPath(_.projection);\n out.materialize().reflow();\n } else {\n flag = field === identity || pulse.modified(field.fields) ? out.ADD_MOD : out.ADD;\n }\n\n const prev = initPath(path, _.pointRadius);\n out.visit(flag, t => t[as] = path(field(t)));\n path.pointRadius(prev);\n return out.modifies(as);\n }\n\n});\n\nfunction initPath(path, pointRadius) {\n const prev = path.pointRadius();\n path.context(null);\n\n if (pointRadius != null) {\n path.pointRadius(pointRadius);\n }\n\n return prev;\n}\n\n/**\n * Geo-code a longitude/latitude point to an x/y coordinate.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(number, number): *} params.projection - The cartographic\n * projection to apply.\n * @param {Array} params.fields - A two-element array of\n * field accessors for the longitude and latitude values.\n * @param {Array} [params.as] - A two-element array of field names\n * under which to store the result. Defaults to ['x','y'].\n */\n\nfunction GeoPoint(params) {\n Transform.call(this, null, params);\n}\nGeoPoint.Definition = {\n 'type': 'GeoPoint',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'projection',\n 'type': 'projection',\n 'required': true\n }, {\n 'name': 'fields',\n 'type': 'field',\n 'array': true,\n 'required': true,\n 'length': 2\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': 2,\n 'default': ['x', 'y']\n }]\n};\ninherits(GeoPoint, Transform, {\n transform(_, pulse) {\n var proj = _.projection,\n lon = _.fields[0],\n lat = _.fields[1],\n as = _.as || ['x', 'y'],\n x = as[0],\n y = as[1],\n mod;\n\n function set(t) {\n const xy = proj([lon(t), lat(t)]);\n\n if (xy) {\n t[x] = xy[0];\n t[y] = xy[1];\n } else {\n t[x] = undefined;\n t[y] = undefined;\n }\n }\n\n if (_.modified()) {\n // parameters updated, reflow\n pulse = pulse.materialize().reflow(true).visit(pulse.SOURCE, set);\n } else {\n mod = pulse.modified(lon.fields) || pulse.modified(lat.fields);\n pulse.visit(mod ? pulse.ADD_MOD : pulse.ADD, set);\n }\n\n return pulse.modifies(as);\n }\n\n});\n\n/**\n * Annotate items with a geopath shape generator.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(number, number): *} params.projection - The cartographic\n * projection to apply.\n * @param {function(object): *} [params.field] - The field with GeoJSON data,\n * or null if the tuple itself is a GeoJSON feature.\n * @param {string} [params.as='shape'] - The output field in which to store\n * the generated path data (default 'shape').\n */\n\nfunction GeoShape(params) {\n Transform.call(this, null, params);\n}\nGeoShape.Definition = {\n 'type': 'GeoShape',\n 'metadata': {\n 'modifies': true,\n 'nomod': true\n },\n 'params': [{\n 'name': 'projection',\n 'type': 'projection'\n }, {\n 'name': 'field',\n 'type': 'field',\n 'default': 'datum'\n }, {\n 'name': 'pointRadius',\n 'type': 'number',\n 'expr': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'default': 'shape'\n }]\n};\ninherits(GeoShape, Transform, {\n transform(_, pulse) {\n var out = pulse.fork(pulse.ALL),\n shape = this.value,\n as = _.as || 'shape',\n flag = out.ADD;\n\n if (!shape || _.modified()) {\n // parameters updated, reset and reflow\n this.value = shape = shapeGenerator(getProjectionPath(_.projection), _.field || field('datum'), _.pointRadius);\n out.materialize().reflow();\n flag = out.SOURCE;\n }\n\n out.visit(flag, t => t[as] = shape);\n return out.modifies(as);\n }\n\n});\n\nfunction shapeGenerator(path, field, pointRadius) {\n const shape = pointRadius == null ? _ => path(field(_)) : _ => {\n var prev = path.pointRadius(),\n value = path.pointRadius(pointRadius)(field(_));\n path.pointRadius(prev);\n return value;\n };\n\n shape.context = _ => {\n path.context(_);\n return shape;\n };\n\n return shape;\n}\n\n/**\n * GeoJSON feature generator for creating graticules.\n * @constructor\n */\n\nfunction Graticule(params) {\n Transform.call(this, [], params);\n this.generator = geoGraticule();\n}\nGraticule.Definition = {\n 'type': 'Graticule',\n 'metadata': {\n 'changes': true,\n 'generates': true\n },\n 'params': [{\n 'name': 'extent',\n 'type': 'array',\n 'array': true,\n 'length': 2,\n 'content': {\n 'type': 'number',\n 'array': true,\n 'length': 2\n }\n }, {\n 'name': 'extentMajor',\n 'type': 'array',\n 'array': true,\n 'length': 2,\n 'content': {\n 'type': 'number',\n 'array': true,\n 'length': 2\n }\n }, {\n 'name': 'extentMinor',\n 'type': 'array',\n 'array': true,\n 'length': 2,\n 'content': {\n 'type': 'number',\n 'array': true,\n 'length': 2\n }\n }, {\n 'name': 'step',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'stepMajor',\n 'type': 'number',\n 'array': true,\n 'length': 2,\n 'default': [90, 360]\n }, {\n 'name': 'stepMinor',\n 'type': 'number',\n 'array': true,\n 'length': 2,\n 'default': [10, 10]\n }, {\n 'name': 'precision',\n 'type': 'number',\n 'default': 2.5\n }]\n};\ninherits(Graticule, Transform, {\n transform(_, pulse) {\n var src = this.value,\n gen = this.generator,\n t;\n\n if (!src.length || _.modified()) {\n for (const prop in _) {\n if (isFunction(gen[prop])) {\n gen[prop](_[prop]);\n }\n }\n }\n\n t = gen();\n\n if (src.length) {\n pulse.mod.push(replace(src[0], t));\n } else {\n pulse.add.push(ingest(t));\n }\n\n src[0] = t;\n return pulse;\n }\n\n});\n\n/**\n * Render a heatmap image for input raster grid data.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} [params.field] - The field with raster grid\n * data. If unspecified, the tuple itself is interpreted as a raster grid.\n * @param {string} [params.color] - A constant color value or function for\n * individual pixel color. If a function, it will be invoked with an input\n * object that includes $x, $y, $value, and $max fields for the grid.\n * @param {number} [params.opacity] - A constant opacity value or function for\n * individual pixel opacity. If a function, it will be invoked with an input\n * object that includes $x, $y, $value, and $max fields for the grid.\n * @param {string} [params.resolve] - The method for resolving maximum values\n * across multiple input grids. If 'independent' (the default), maximum\n * calculation will be performed separately for each grid. If 'shared',\n * a single global maximum will be used for all input grids.\n * @param {string} [params.as='image'] - The output field in which to store\n * the generated bitmap canvas images (default 'image').\n */\n\nfunction Heatmap(params) {\n Transform.call(this, null, params);\n}\nHeatmap.Definition = {\n 'type': 'heatmap',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field'\n }, {\n 'name': 'color',\n 'type': 'string',\n 'expr': true\n }, {\n 'name': 'opacity',\n 'type': 'number',\n 'expr': true\n }, {\n 'name': 'resolve',\n 'type': 'enum',\n 'values': ['shared', 'independent'],\n 'default': 'independent'\n }, {\n 'name': 'as',\n 'type': 'string',\n 'default': 'image'\n }]\n};\ninherits(Heatmap, Transform, {\n transform(_, pulse) {\n if (!pulse.changed() && !_.modified()) {\n return pulse.StopPropagation;\n }\n\n var source = pulse.materialize(pulse.SOURCE).source,\n shared = _.resolve === 'shared',\n field = _.field || identity,\n opacity = opacity_(_.opacity, _),\n color = color_(_.color, _),\n as = _.as || 'image',\n obj = {\n $x: 0,\n $y: 0,\n $value: 0,\n $max: shared ? max(source.map(t => max(field(t).values))) : 0\n };\n source.forEach(t => {\n const v = field(t); // build proxy data object\n\n const o = extend({}, t, obj); // set maximum value if not globally shared\n\n if (!shared) o.$max = max(v.values || []); // generate canvas image\n // optimize color/opacity if not pixel-dependent\n\n t[as] = toCanvas(v, o, color.dep ? color : constant(color(o)), opacity.dep ? opacity : constant(opacity(o)));\n });\n return pulse.reflow(true).modifies(as);\n }\n\n}); // get image color function\n\nfunction color_(color, _) {\n let f;\n\n if (isFunction(color)) {\n f = obj => rgb(color(obj, _));\n\n f.dep = dependency(color);\n } else {\n // default to mid-grey\n f = constant(rgb(color || '#888'));\n }\n\n return f;\n} // get image opacity function\n\n\nfunction opacity_(opacity, _) {\n let f;\n\n if (isFunction(opacity)) {\n f = obj => opacity(obj, _);\n\n f.dep = dependency(opacity);\n } else if (opacity) {\n f = constant(opacity);\n } else {\n // default to [0, max] opacity gradient\n f = obj => obj.$value / obj.$max || 0;\n\n f.dep = true;\n }\n\n return f;\n} // check if function depends on individual pixel data\n\n\nfunction dependency(f) {\n if (!isFunction(f)) return false;\n const set = toSet(accessorFields(f));\n return set.$x || set.$y || set.$value || set.$max;\n} // render raster grid to canvas\n\n\nfunction toCanvas(grid, obj, color, opacity) {\n const n = grid.width,\n m = grid.height,\n x1 = grid.x1 || 0,\n y1 = grid.y1 || 0,\n x2 = grid.x2 || n,\n y2 = grid.y2 || m,\n val = grid.values,\n value = val ? i => val[i] : zero,\n can = canvas(x2 - x1, y2 - y1),\n ctx = can.getContext('2d'),\n img = ctx.getImageData(0, 0, x2 - x1, y2 - y1),\n pix = img.data;\n\n for (let j = y1, k = 0; j < y2; ++j) {\n obj.$y = j - y1;\n\n for (let i = x1, r = j * n; i < x2; ++i, k += 4) {\n obj.$x = i - x1;\n obj.$value = value(i + r);\n const v = color(obj);\n pix[k + 0] = v.r;\n pix[k + 1] = v.g;\n pix[k + 2] = v.b;\n pix[k + 3] = ~~(255 * opacity(obj));\n }\n }\n\n ctx.putImageData(img, 0, 0);\n return can;\n}\n\n/**\n * Maintains a cartographic projection.\n * @constructor\n * @param {object} params - The parameters for this operator.\n */\n\nfunction Projection(params) {\n Transform.call(this, null, params);\n this.modified(true); // always treat as modified\n}\ninherits(Projection, Transform, {\n transform(_, pulse) {\n let proj = this.value;\n\n if (!proj || _.modified('type')) {\n this.value = proj = create(_.type);\n projectionProperties.forEach(prop => {\n if (_[prop] != null) set(proj, prop, _[prop]);\n });\n } else {\n projectionProperties.forEach(prop => {\n if (_.modified(prop)) set(proj, prop, _[prop]);\n });\n }\n\n if (_.pointRadius != null) proj.path.pointRadius(_.pointRadius);\n if (_.fit) fit(proj, _);\n return pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS);\n }\n\n});\n\nfunction fit(proj, _) {\n const data = collectGeoJSON(_.fit);\n _.extent ? proj.fitExtent(_.extent, data) : _.size ? proj.fitSize(_.size, data) : 0;\n}\n\nfunction create(type) {\n const constructor = projection((type || 'mercator').toLowerCase());\n if (!constructor) error('Unrecognized projection type: ' + type);\n return constructor();\n}\n\nfunction set(proj, key, value) {\n if (isFunction(proj[key])) proj[key](value);\n}\n\nfunction collectGeoJSON(data) {\n data = array(data);\n return data.length === 1 ? data[0] : {\n type: FeatureCollection,\n features: data.reduce((a, f) => a.concat(featurize(f)), [])\n };\n}\n\nfunction featurize(f) {\n return f.type === FeatureCollection ? f.features : array(f).filter(d => d != null).map(d => d.type === Feature ? d : {\n type: Feature,\n geometry: d\n });\n}\n\nexport { Contour as contour, GeoJSON as geojson, GeoPath as geopath, GeoPoint as geopoint, GeoShape as geoshape, Graticule as graticule, Heatmap as heatmap, Isocontour as isocontour, KDE2D as kde2d, Projection as projection };\n","export default function(d) {\n const x = +this._x.call(null, d),\n y = +this._y.call(null, d);\n return add(this.cover(x, y), x, y, d);\n}\n\nfunction add(tree, x, y, d) {\n if (isNaN(x) || isNaN(y)) return tree; // ignore invalid points\n\n var parent,\n node = tree._root,\n leaf = {data: d},\n x0 = tree._x0,\n y0 = tree._y0,\n x1 = tree._x1,\n y1 = tree._y1,\n xm,\n ym,\n xp,\n yp,\n right,\n bottom,\n i,\n j;\n\n // If the tree is empty, initialize the root as a leaf.\n if (!node) return tree._root = leaf, tree;\n\n // Find the existing leaf for the new point, or add it.\n while (node.length) {\n if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm;\n if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym;\n if (parent = node, !(node = node[i = bottom << 1 | right])) return parent[i] = leaf, tree;\n }\n\n // Is the new point is exactly coincident with the existing point?\n xp = +tree._x.call(null, node.data);\n yp = +tree._y.call(null, node.data);\n if (x === xp && y === yp) return leaf.next = node, parent ? parent[i] = leaf : tree._root = leaf, tree;\n\n // Otherwise, split the leaf node until the old and new point are separated.\n do {\n parent = parent ? parent[i] = new Array(4) : tree._root = new Array(4);\n if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm;\n if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym;\n } while ((i = bottom << 1 | right) === (j = (yp >= ym) << 1 | (xp >= xm)));\n return parent[j] = node, parent[i] = leaf, tree;\n}\n\nexport function addAll(data) {\n var d, i, n = data.length,\n x,\n y,\n xz = new Array(n),\n yz = new Array(n),\n x0 = Infinity,\n y0 = Infinity,\n x1 = -Infinity,\n y1 = -Infinity;\n\n // Compute the points and their extent.\n for (i = 0; i < n; ++i) {\n if (isNaN(x = +this._x.call(null, d = data[i])) || isNaN(y = +this._y.call(null, d))) continue;\n xz[i] = x;\n yz[i] = 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\n // If there were no (valid) points, abort.\n if (x0 > x1 || y0 > y1) return this;\n\n // Expand the tree to cover the new points.\n this.cover(x0, y0).cover(x1, y1);\n\n // Add the new points.\n for (i = 0; i < n; ++i) {\n add(this, xz[i], yz[i], data[i]);\n }\n\n return this;\n}\n","export default function(node, x0, y0, x1, y1) {\n this.node = node;\n this.x0 = x0;\n this.y0 = y0;\n this.x1 = x1;\n this.y1 = y1;\n}\n","export function defaultX(d) {\n return d[0];\n}\n\nexport default function(_) {\n return arguments.length ? (this._x = _, this) : this._x;\n}\n","export function defaultY(d) {\n return d[1];\n}\n\nexport default function(_) {\n return arguments.length ? (this._y = _, this) : this._y;\n}\n","import tree_add, {addAll as tree_addAll} from \"./add.js\";\nimport tree_cover from \"./cover.js\";\nimport tree_data from \"./data.js\";\nimport tree_extent from \"./extent.js\";\nimport tree_find from \"./find.js\";\nimport tree_remove, {removeAll as tree_removeAll} from \"./remove.js\";\nimport tree_root from \"./root.js\";\nimport tree_size from \"./size.js\";\nimport tree_visit from \"./visit.js\";\nimport tree_visitAfter from \"./visitAfter.js\";\nimport tree_x, {defaultX} from \"./x.js\";\nimport tree_y, {defaultY} from \"./y.js\";\n\nexport default function quadtree(nodes, x, y) {\n var tree = new Quadtree(x == null ? defaultX : x, y == null ? defaultY : y, NaN, NaN, NaN, NaN);\n return nodes == null ? tree : tree.addAll(nodes);\n}\n\nfunction Quadtree(x, y, x0, y0, x1, y1) {\n this._x = x;\n this._y = y;\n this._x0 = x0;\n this._y0 = y0;\n this._x1 = x1;\n this._y1 = y1;\n this._root = undefined;\n}\n\nfunction leaf_copy(leaf) {\n var copy = {data: leaf.data}, next = copy;\n while (leaf = leaf.next) next = next.next = {data: leaf.data};\n return copy;\n}\n\nvar treeProto = quadtree.prototype = Quadtree.prototype;\n\ntreeProto.copy = function() {\n var copy = new Quadtree(this._x, this._y, this._x0, this._y0, this._x1, this._y1),\n node = this._root,\n nodes,\n child;\n\n if (!node) return copy;\n\n if (!node.length) return copy._root = leaf_copy(node), copy;\n\n nodes = [{source: node, target: copy._root = new Array(4)}];\n while (node = nodes.pop()) {\n for (var i = 0; i < 4; ++i) {\n if (child = node.source[i]) {\n if (child.length) nodes.push({source: child, target: node.target[i] = new Array(4)});\n else node.target[i] = leaf_copy(child);\n }\n }\n }\n\n return copy;\n};\n\ntreeProto.add = tree_add;\ntreeProto.addAll = tree_addAll;\ntreeProto.cover = tree_cover;\ntreeProto.data = tree_data;\ntreeProto.extent = tree_extent;\ntreeProto.find = tree_find;\ntreeProto.remove = tree_remove;\ntreeProto.removeAll = tree_removeAll;\ntreeProto.root = tree_root;\ntreeProto.size = tree_size;\ntreeProto.visit = tree_visit;\ntreeProto.visitAfter = tree_visitAfter;\ntreeProto.x = tree_x;\ntreeProto.y = tree_y;\n","export default function(x) {\n return function() {\n return x;\n };\n}\n","export default function(random) {\n return (random() - 0.5) * 1e-6;\n}\n","import {quadtree} from \"d3-quadtree\";\nimport constant from \"./constant.js\";\nimport jiggle from \"./jiggle.js\";\n\nfunction x(d) {\n return d.x + d.vx;\n}\n\nfunction y(d) {\n return d.y + d.vy;\n}\n\nexport default function(radius) {\n var nodes,\n radii,\n random,\n strength = 1,\n iterations = 1;\n\n if (typeof radius !== \"function\") radius = constant(radius == null ? 1 : +radius);\n\n function force() {\n var i, n = nodes.length,\n tree,\n node,\n xi,\n yi,\n ri,\n ri2;\n\n for (var k = 0; k < iterations; ++k) {\n tree = quadtree(nodes, x, y).visitAfter(prepare);\n for (i = 0; i < n; ++i) {\n node = nodes[i];\n ri = radii[node.index], ri2 = ri * ri;\n xi = node.x + node.vx;\n yi = node.y + node.vy;\n tree.visit(apply);\n }\n }\n\n function apply(quad, x0, y0, x1, y1) {\n var data = quad.data, rj = quad.r, r = ri + rj;\n if (data) {\n if (data.index > node.index) {\n var x = xi - data.x - data.vx,\n y = yi - data.y - data.vy,\n l = x * x + y * y;\n if (l < r * r) {\n if (x === 0) x = jiggle(random), l += x * x;\n if (y === 0) y = jiggle(random), l += y * y;\n l = (r - (l = Math.sqrt(l))) / l * strength;\n node.vx += (x *= l) * (r = (rj *= rj) / (ri2 + rj));\n node.vy += (y *= l) * r;\n data.vx -= x * (r = 1 - r);\n data.vy -= y * r;\n }\n }\n return;\n }\n return x0 > xi + r || x1 < xi - r || y0 > yi + r || y1 < yi - r;\n }\n }\n\n function prepare(quad) {\n if (quad.data) return quad.r = radii[quad.data.index];\n for (var i = quad.r = 0; i < 4; ++i) {\n if (quad[i] && quad[i].r > quad.r) {\n quad.r = quad[i].r;\n }\n }\n }\n\n function initialize() {\n if (!nodes) return;\n var i, n = nodes.length, node;\n radii = new Array(n);\n for (i = 0; i < n; ++i) node = nodes[i], radii[node.index] = +radius(node, i, nodes);\n }\n\n force.initialize = function(_nodes, _random) {\n nodes = _nodes;\n random = _random;\n initialize();\n };\n\n force.iterations = function(_) {\n return arguments.length ? (iterations = +_, force) : iterations;\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = +_, force) : strength;\n };\n\n force.radius = function(_) {\n return arguments.length ? (radius = typeof _ === \"function\" ? _ : constant(+_), initialize(), force) : radius;\n };\n\n return force;\n}\n","import constant from \"./constant.js\";\nimport jiggle from \"./jiggle.js\";\n\nfunction index(d) {\n return d.index;\n}\n\nfunction find(nodeById, nodeId) {\n var node = nodeById.get(nodeId);\n if (!node) throw new Error(\"node not found: \" + nodeId);\n return node;\n}\n\nexport default function(links) {\n var id = index,\n strength = defaultStrength,\n strengths,\n distance = constant(30),\n distances,\n nodes,\n count,\n bias,\n random,\n iterations = 1;\n\n if (links == null) links = [];\n\n function defaultStrength(link) {\n return 1 / Math.min(count[link.source.index], count[link.target.index]);\n }\n\n function force(alpha) {\n for (var k = 0, n = links.length; k < iterations; ++k) {\n for (var i = 0, link, source, target, x, y, l, b; i < n; ++i) {\n link = links[i], source = link.source, target = link.target;\n x = target.x + target.vx - source.x - source.vx || jiggle(random);\n y = target.y + target.vy - source.y - source.vy || jiggle(random);\n l = Math.sqrt(x * x + y * y);\n l = (l - distances[i]) / l * alpha * strengths[i];\n x *= l, y *= l;\n target.vx -= x * (b = bias[i]);\n target.vy -= y * b;\n source.vx += x * (b = 1 - b);\n source.vy += y * b;\n }\n }\n }\n\n function initialize() {\n if (!nodes) return;\n\n var i,\n n = nodes.length,\n m = links.length,\n nodeById = new Map(nodes.map((d, i) => [id(d, i, nodes), d])),\n link;\n\n for (i = 0, count = new Array(n); i < m; ++i) {\n link = links[i], link.index = i;\n if (typeof link.source !== \"object\") link.source = find(nodeById, link.source);\n if (typeof link.target !== \"object\") link.target = find(nodeById, link.target);\n count[link.source.index] = (count[link.source.index] || 0) + 1;\n count[link.target.index] = (count[link.target.index] || 0) + 1;\n }\n\n for (i = 0, bias = new Array(m); i < m; ++i) {\n link = links[i], bias[i] = count[link.source.index] / (count[link.source.index] + count[link.target.index]);\n }\n\n strengths = new Array(m), initializeStrength();\n distances = new Array(m), initializeDistance();\n }\n\n function initializeStrength() {\n if (!nodes) return;\n\n for (var i = 0, n = links.length; i < n; ++i) {\n strengths[i] = +strength(links[i], i, links);\n }\n }\n\n function initializeDistance() {\n if (!nodes) return;\n\n for (var i = 0, n = links.length; i < n; ++i) {\n distances[i] = +distance(links[i], i, links);\n }\n }\n\n force.initialize = function(_nodes, _random) {\n nodes = _nodes;\n random = _random;\n initialize();\n };\n\n force.links = function(_) {\n return arguments.length ? (links = _, initialize(), force) : links;\n };\n\n force.id = function(_) {\n return arguments.length ? (id = _, force) : id;\n };\n\n force.iterations = function(_) {\n return arguments.length ? (iterations = +_, force) : iterations;\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = typeof _ === \"function\" ? _ : constant(+_), initializeStrength(), force) : strength;\n };\n\n force.distance = function(_) {\n return arguments.length ? (distance = typeof _ === \"function\" ? _ : constant(+_), initializeDistance(), force) : distance;\n };\n\n return force;\n}\n","export default function(x, y) {\n if (isNaN(x = +x) || isNaN(y = +y)) return this; // ignore invalid points\n\n var x0 = this._x0,\n y0 = this._y0,\n x1 = this._x1,\n y1 = this._y1;\n\n // If the quadtree has no extent, initialize them.\n // Integer extent are necessary so that if we later double the extent,\n // the existing quadrant boundaries don’t change due to floating point error!\n if (isNaN(x0)) {\n x1 = (x0 = Math.floor(x)) + 1;\n y1 = (y0 = Math.floor(y)) + 1;\n }\n\n // Otherwise, double repeatedly to cover.\n else {\n var z = x1 - x0 || 1,\n node = this._root,\n parent,\n i;\n\n while (x0 > x || x >= x1 || y0 > y || y >= y1) {\n i = (y < y0) << 1 | (x < x0);\n parent = new Array(4), parent[i] = node, node = parent, z *= 2;\n switch (i) {\n case 0: x1 = x0 + z, y1 = y0 + z; break;\n case 1: x0 = x1 - z, y1 = y0 + z; break;\n case 2: x1 = x0 + z, y0 = y1 - z; break;\n case 3: x0 = x1 - z, y0 = y1 - z; break;\n }\n }\n\n if (this._root && this._root.length) this._root = node;\n }\n\n this._x0 = x0;\n this._y0 = y0;\n this._x1 = x1;\n this._y1 = y1;\n return this;\n}\n","export default function() {\n var data = [];\n this.visit(function(node) {\n if (!node.length) do data.push(node.data); while (node = node.next)\n });\n return data;\n}\n","export default function(_) {\n return arguments.length\n ? this.cover(+_[0][0], +_[0][1]).cover(+_[1][0], +_[1][1])\n : isNaN(this._x0) ? undefined : [[this._x0, this._y0], [this._x1, this._y1]];\n}\n","import Quad from \"./quad.js\";\n\nexport default function(x, y, radius) {\n var data,\n x0 = this._x0,\n y0 = this._y0,\n x1,\n y1,\n x2,\n y2,\n x3 = this._x1,\n y3 = this._y1,\n quads = [],\n node = this._root,\n q,\n i;\n\n if (node) quads.push(new Quad(node, x0, y0, x3, y3));\n if (radius == null) radius = Infinity;\n else {\n x0 = x - radius, y0 = y - radius;\n x3 = x + radius, y3 = y + radius;\n radius *= radius;\n }\n\n while (q = quads.pop()) {\n\n // Stop searching if this quadrant can’t contain a closer node.\n if (!(node = q.node)\n || (x1 = q.x0) > x3\n || (y1 = q.y0) > y3\n || (x2 = q.x1) < x0\n || (y2 = q.y1) < y0) continue;\n\n // Bisect the current quadrant.\n if (node.length) {\n var xm = (x1 + x2) / 2,\n ym = (y1 + y2) / 2;\n\n quads.push(\n new Quad(node[3], xm, ym, x2, y2),\n new Quad(node[2], x1, ym, xm, y2),\n new Quad(node[1], xm, y1, x2, ym),\n new Quad(node[0], x1, y1, xm, ym)\n );\n\n // Visit the closest quadrant first.\n if (i = (y >= ym) << 1 | (x >= xm)) {\n q = quads[quads.length - 1];\n quads[quads.length - 1] = quads[quads.length - 1 - i];\n quads[quads.length - 1 - i] = q;\n }\n }\n\n // Visit this point. (Visiting coincident points isn’t necessary!)\n else {\n var dx = x - +this._x.call(null, node.data),\n dy = y - +this._y.call(null, node.data),\n d2 = dx * dx + dy * dy;\n if (d2 < radius) {\n var d = Math.sqrt(radius = d2);\n x0 = x - d, y0 = y - d;\n x3 = x + d, y3 = y + d;\n data = node.data;\n }\n }\n }\n\n return data;\n}\n","export default function(d) {\n if (isNaN(x = +this._x.call(null, d)) || isNaN(y = +this._y.call(null, d))) return this; // ignore invalid points\n\n var parent,\n node = this._root,\n retainer,\n previous,\n next,\n x0 = this._x0,\n y0 = this._y0,\n x1 = this._x1,\n y1 = this._y1,\n x,\n y,\n xm,\n ym,\n right,\n bottom,\n i,\n j;\n\n // If the tree is empty, initialize the root as a leaf.\n if (!node) return this;\n\n // Find the leaf node for the point.\n // While descending, also retain the deepest parent with a non-removed sibling.\n if (node.length) while (true) {\n if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm;\n if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym;\n if (!(parent = node, node = node[i = bottom << 1 | right])) return this;\n if (!node.length) break;\n if (parent[(i + 1) & 3] || parent[(i + 2) & 3] || parent[(i + 3) & 3]) retainer = parent, j = i;\n }\n\n // Find the point to remove.\n while (node.data !== d) if (!(previous = node, node = node.next)) return this;\n if (next = node.next) delete node.next;\n\n // If there are multiple coincident points, remove just the point.\n if (previous) return (next ? previous.next = next : delete previous.next), this;\n\n // If this is the root point, remove it.\n if (!parent) return this._root = next, this;\n\n // Remove this leaf.\n next ? parent[i] = next : delete parent[i];\n\n // If the parent now contains exactly one leaf, collapse superfluous parents.\n if ((node = parent[0] || parent[1] || parent[2] || parent[3])\n && node === (parent[3] || parent[2] || parent[1] || parent[0])\n && !node.length) {\n if (retainer) retainer[j] = node;\n else this._root = node;\n }\n\n return this;\n}\n\nexport function removeAll(data) {\n for (var i = 0, n = data.length; i < n; ++i) this.remove(data[i]);\n return this;\n}\n","export default function() {\n return this._root;\n}\n","export default function() {\n var size = 0;\n this.visit(function(node) {\n if (!node.length) do ++size; while (node = node.next)\n });\n return size;\n}\n","import Quad from \"./quad.js\";\n\nexport default function(callback) {\n var quads = [], q, node = this._root, child, x0, y0, x1, y1;\n if (node) quads.push(new Quad(node, this._x0, this._y0, this._x1, this._y1));\n while (q = quads.pop()) {\n if (!callback(node = q.node, x0 = q.x0, y0 = q.y0, x1 = q.x1, y1 = q.y1) && node.length) {\n var xm = (x0 + x1) / 2, ym = (y0 + y1) / 2;\n if (child = node[3]) quads.push(new Quad(child, xm, ym, x1, y1));\n if (child = node[2]) quads.push(new Quad(child, x0, ym, xm, y1));\n if (child = node[1]) quads.push(new Quad(child, xm, y0, x1, ym));\n if (child = node[0]) quads.push(new Quad(child, x0, y0, xm, ym));\n }\n }\n return this;\n}\n","import Quad from \"./quad.js\";\n\nexport default function(callback) {\n var quads = [], next = [], q;\n if (this._root) quads.push(new Quad(this._root, this._x0, this._y0, this._x1, this._y1));\n while (q = quads.pop()) {\n var node = q.node;\n if (node.length) {\n var child, x0 = q.x0, y0 = q.y0, x1 = q.x1, y1 = q.y1, xm = (x0 + x1) / 2, ym = (y0 + y1) / 2;\n if (child = node[0]) quads.push(new Quad(child, x0, y0, xm, ym));\n if (child = node[1]) quads.push(new Quad(child, xm, y0, x1, ym));\n if (child = node[2]) quads.push(new Quad(child, x0, ym, xm, y1));\n if (child = node[3]) quads.push(new Quad(child, xm, ym, x1, y1));\n }\n next.push(q);\n }\n while (q = next.pop()) {\n callback(q.node, q.x0, q.y0, q.x1, q.y1);\n }\n return this;\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","var frame = 0, // is an animation frame pending?\n timeout = 0, // is a timeout pending?\n interval = 0, // are any timers active?\n pokeDelay = 1000, // how frequently we check for clock skew\n taskHead,\n taskTail,\n clockLast = 0,\n clockNow = 0,\n clockSkew = 0,\n clock = typeof performance === \"object\" && performance.now ? performance : Date,\n setFrame = typeof window === \"object\" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) { setTimeout(f, 17); };\n\nexport function now() {\n return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);\n}\n\nfunction clearNow() {\n clockNow = 0;\n}\n\nexport function Timer() {\n this._call =\n this._time =\n this._next = null;\n}\n\nTimer.prototype = timer.prototype = {\n constructor: Timer,\n restart: function(callback, delay, time) {\n if (typeof callback !== \"function\") throw new TypeError(\"callback is not a function\");\n time = (time == null ? now() : +time) + (delay == null ? 0 : +delay);\n if (!this._next && taskTail !== this) {\n if (taskTail) taskTail._next = this;\n else taskHead = this;\n taskTail = this;\n }\n this._call = callback;\n this._time = time;\n sleep();\n },\n stop: function() {\n if (this._call) {\n this._call = null;\n this._time = Infinity;\n sleep();\n }\n }\n};\n\nexport function timer(callback, delay, time) {\n var t = new Timer;\n t.restart(callback, delay, time);\n return t;\n}\n\nexport function timerFlush() {\n now(); // Get the current time, if not already set.\n ++frame; // Pretend we’ve set an alarm, if we haven’t already.\n var t = taskHead, e;\n while (t) {\n if ((e = clockNow - t._time) >= 0) t._call.call(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","// https://en.wikipedia.org/wiki/Linear_congruential_generator#Parameters_in_common_use\nconst a = 1664525;\nconst c = 1013904223;\nconst m = 4294967296; // 2^32\n\nexport default function() {\n let s = 1;\n return () => (s = (a * s + c) % m) / m;\n}\n","import {dispatch} from \"d3-dispatch\";\nimport {timer} from \"d3-timer\";\nimport lcg from \"./lcg.js\";\n\nexport function x(d) {\n return d.x;\n}\n\nexport function y(d) {\n return d.y;\n}\n\nvar initialRadius = 10,\n initialAngle = Math.PI * (3 - Math.sqrt(5));\n\nexport default function(nodes) {\n var simulation,\n alpha = 1,\n alphaMin = 0.001,\n alphaDecay = 1 - Math.pow(alphaMin, 1 / 300),\n alphaTarget = 0,\n velocityDecay = 0.6,\n forces = new Map(),\n stepper = timer(step),\n event = dispatch(\"tick\", \"end\"),\n random = lcg();\n\n if (nodes == null) nodes = [];\n\n function step() {\n tick();\n event.call(\"tick\", simulation);\n if (alpha < alphaMin) {\n stepper.stop();\n event.call(\"end\", simulation);\n }\n }\n\n function tick(iterations) {\n var i, n = nodes.length, node;\n\n if (iterations === undefined) iterations = 1;\n\n for (var k = 0; k < iterations; ++k) {\n alpha += (alphaTarget - alpha) * alphaDecay;\n\n forces.forEach(function(force) {\n force(alpha);\n });\n\n for (i = 0; i < n; ++i) {\n node = nodes[i];\n if (node.fx == null) node.x += node.vx *= velocityDecay;\n else node.x = node.fx, node.vx = 0;\n if (node.fy == null) node.y += node.vy *= velocityDecay;\n else node.y = node.fy, node.vy = 0;\n }\n }\n\n return simulation;\n }\n\n function initializeNodes() {\n for (var i = 0, n = nodes.length, node; i < n; ++i) {\n node = nodes[i], node.index = i;\n if (node.fx != null) node.x = node.fx;\n if (node.fy != null) node.y = node.fy;\n if (isNaN(node.x) || isNaN(node.y)) {\n var radius = initialRadius * Math.sqrt(0.5 + i), angle = i * initialAngle;\n node.x = radius * Math.cos(angle);\n node.y = radius * Math.sin(angle);\n }\n if (isNaN(node.vx) || isNaN(node.vy)) {\n node.vx = node.vy = 0;\n }\n }\n }\n\n function initializeForce(force) {\n if (force.initialize) force.initialize(nodes, random);\n return force;\n }\n\n initializeNodes();\n\n return simulation = {\n tick: tick,\n\n restart: function() {\n return stepper.restart(step), simulation;\n },\n\n stop: function() {\n return stepper.stop(), simulation;\n },\n\n nodes: function(_) {\n return arguments.length ? (nodes = _, initializeNodes(), forces.forEach(initializeForce), simulation) : nodes;\n },\n\n alpha: function(_) {\n return arguments.length ? (alpha = +_, simulation) : alpha;\n },\n\n alphaMin: function(_) {\n return arguments.length ? (alphaMin = +_, simulation) : alphaMin;\n },\n\n alphaDecay: function(_) {\n return arguments.length ? (alphaDecay = +_, simulation) : +alphaDecay;\n },\n\n alphaTarget: function(_) {\n return arguments.length ? (alphaTarget = +_, simulation) : alphaTarget;\n },\n\n velocityDecay: function(_) {\n return arguments.length ? (velocityDecay = 1 - _, simulation) : 1 - velocityDecay;\n },\n\n randomSource: function(_) {\n return arguments.length ? (random = _, forces.forEach(initializeForce), simulation) : random;\n },\n\n force: function(name, _) {\n return arguments.length > 1 ? ((_ == null ? forces.delete(name) : forces.set(name, initializeForce(_))), simulation) : forces.get(name);\n },\n\n find: function(x, y, radius) {\n var i = 0,\n n = nodes.length,\n dx,\n dy,\n d2,\n node,\n closest;\n\n if (radius == null) radius = Infinity;\n else radius *= radius;\n\n for (i = 0; i < n; ++i) {\n node = nodes[i];\n dx = x - node.x;\n dy = y - node.y;\n d2 = dx * dx + dy * dy;\n if (d2 < radius) closest = node, radius = d2;\n }\n\n return closest;\n },\n\n on: function(name, _) {\n return arguments.length > 1 ? (event.on(name, _), simulation) : event.on(name);\n }\n };\n}\n","import { Transform } from 'vega-dataflow';\nimport { inherits, array, isFunction, accessorFields, hasOwnProperty, error } from 'vega-util';\nimport { forceSimulation, forceCenter, forceCollide, forceManyBody, forceLink, forceX, forceY } from 'd3-force';\n\nconst ForceMap = {\n center: forceCenter,\n collide: forceCollide,\n nbody: forceManyBody,\n link: forceLink,\n x: forceX,\n y: forceY\n};\nconst Forces = 'forces',\n ForceParams = ['alpha', 'alphaMin', 'alphaTarget', 'velocityDecay', 'forces'],\n ForceConfig = ['static', 'iterations'],\n ForceOutput = ['x', 'y', 'vx', 'vy'];\n/**\n * Force simulation layout.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} params.forces - The forces to apply.\n */\n\nfunction Force(params) {\n Transform.call(this, null, params);\n}\nForce.Definition = {\n 'type': 'Force',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'static',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'restart',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'iterations',\n 'type': 'number',\n 'default': 300\n }, {\n 'name': 'alpha',\n 'type': 'number',\n 'default': 1\n }, {\n 'name': 'alphaMin',\n 'type': 'number',\n 'default': 0.001\n }, {\n 'name': 'alphaTarget',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'velocityDecay',\n 'type': 'number',\n 'default': 0.4\n }, {\n 'name': 'forces',\n 'type': 'param',\n 'array': true,\n 'params': [{\n 'key': {\n 'force': 'center'\n },\n 'params': [{\n 'name': 'x',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'y',\n 'type': 'number',\n 'default': 0\n }]\n }, {\n 'key': {\n 'force': 'collide'\n },\n 'params': [{\n 'name': 'radius',\n 'type': 'number',\n 'expr': true\n }, {\n 'name': 'strength',\n 'type': 'number',\n 'default': 0.7\n }, {\n 'name': 'iterations',\n 'type': 'number',\n 'default': 1\n }]\n }, {\n 'key': {\n 'force': 'nbody'\n },\n 'params': [{\n 'name': 'strength',\n 'type': 'number',\n 'default': -30\n }, {\n 'name': 'theta',\n 'type': 'number',\n 'default': 0.9\n }, {\n 'name': 'distanceMin',\n 'type': 'number',\n 'default': 1\n }, {\n 'name': 'distanceMax',\n 'type': 'number'\n }]\n }, {\n 'key': {\n 'force': 'link'\n },\n 'params': [{\n 'name': 'links',\n 'type': 'data'\n }, {\n 'name': 'id',\n 'type': 'field'\n }, {\n 'name': 'distance',\n 'type': 'number',\n 'default': 30,\n 'expr': true\n }, {\n 'name': 'strength',\n 'type': 'number',\n 'expr': true\n }, {\n 'name': 'iterations',\n 'type': 'number',\n 'default': 1\n }]\n }, {\n 'key': {\n 'force': 'x'\n },\n 'params': [{\n 'name': 'strength',\n 'type': 'number',\n 'default': 0.1\n }, {\n 'name': 'x',\n 'type': 'field'\n }]\n }, {\n 'key': {\n 'force': 'y'\n },\n 'params': [{\n 'name': 'strength',\n 'type': 'number',\n 'default': 0.1\n }, {\n 'name': 'y',\n 'type': 'field'\n }]\n }]\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'modify': false,\n 'default': ForceOutput\n }]\n};\ninherits(Force, Transform, {\n transform(_, pulse) {\n var sim = this.value,\n change = pulse.changed(pulse.ADD_REM),\n params = _.modified(ForceParams),\n iters = _.iterations || 300; // configure simulation\n\n\n if (!sim) {\n this.value = sim = simulation(pulse.source, _);\n sim.on('tick', rerun(pulse.dataflow, this));\n\n if (!_.static) {\n change = true;\n sim.tick(); // ensure we run on init\n }\n\n pulse.modifies('index');\n } else {\n if (change) {\n pulse.modifies('index');\n sim.nodes(pulse.source);\n }\n\n if (params || pulse.changed(pulse.MOD)) {\n setup(sim, _, 0, pulse);\n }\n } // run simulation\n\n\n if (params || change || _.modified(ForceConfig) || pulse.changed() && _.restart) {\n sim.alpha(Math.max(sim.alpha(), _.alpha || 1)).alphaDecay(1 - Math.pow(sim.alphaMin(), 1 / iters));\n\n if (_.static) {\n for (sim.stop(); --iters >= 0;) sim.tick();\n } else {\n if (sim.stopped()) sim.restart();\n if (!change) return pulse.StopPropagation; // defer to sim ticks\n }\n }\n\n return this.finish(_, pulse);\n },\n\n finish(_, pulse) {\n const dataflow = pulse.dataflow; // inspect dependencies, touch link source data\n\n for (let args = this._argops, j = 0, m = args.length, arg; j < m; ++j) {\n arg = args[j];\n\n if (arg.name !== Forces || arg.op._argval.force !== 'link') {\n continue;\n }\n\n for (var ops = arg.op._argops, i = 0, n = ops.length, op; i < n; ++i) {\n if (ops[i].name === 'links' && (op = ops[i].op.source)) {\n dataflow.pulse(op, dataflow.changeset().reflow());\n break;\n }\n }\n } // reflow all nodes\n\n\n return pulse.reflow(_.modified()).modifies(ForceOutput);\n }\n\n});\n\nfunction rerun(df, op) {\n return () => df.touch(op).run();\n}\n\nfunction simulation(nodes, _) {\n const sim = forceSimulation(nodes),\n stop = sim.stop,\n restart = sim.restart;\n let stopped = false;\n\n sim.stopped = () => stopped;\n\n sim.restart = () => (stopped = false, restart());\n\n sim.stop = () => (stopped = true, stop());\n\n return setup(sim, _, true).on('end', () => stopped = true);\n}\n\nfunction setup(sim, _, init, pulse) {\n var f = array(_.forces),\n i,\n n,\n p,\n name;\n\n for (i = 0, n = ForceParams.length; i < n; ++i) {\n p = ForceParams[i];\n if (p !== Forces && _.modified(p)) sim[p](_[p]);\n }\n\n for (i = 0, n = f.length; i < n; ++i) {\n name = Forces + i;\n p = init || _.modified(Forces, i) ? getForce(f[i]) : pulse && modified(f[i], pulse) ? sim.force(name) : null;\n if (p) sim.force(name, p);\n }\n\n for (n = sim.numForces || 0; i < n; ++i) {\n sim.force(Forces + i, null); // remove\n }\n\n sim.numForces = f.length;\n return sim;\n}\n\nfunction modified(f, pulse) {\n var k, v;\n\n for (k in f) {\n if (isFunction(v = f[k]) && pulse.modified(accessorFields(v))) return 1;\n }\n\n return 0;\n}\n\nfunction getForce(_) {\n var f, p;\n\n if (!hasOwnProperty(ForceMap, _.force)) {\n error('Unrecognized force: ' + _.force);\n }\n\n f = ForceMap[_.force]();\n\n for (p in _) {\n if (isFunction(f[p])) setForceParam(f[p], _[p], _);\n }\n\n return f;\n}\n\nfunction setForceParam(f, v, _) {\n f(isFunction(v) ? d => v(d, _) : v);\n}\n\nexport { Force as force };\n","export default function(x, y) {\n var nodes, strength = 1;\n\n if (x == null) x = 0;\n if (y == null) y = 0;\n\n function force() {\n var i,\n n = nodes.length,\n node,\n sx = 0,\n sy = 0;\n\n for (i = 0; i < n; ++i) {\n node = nodes[i], sx += node.x, sy += node.y;\n }\n\n for (sx = (sx / n - x) * strength, sy = (sy / n - y) * strength, i = 0; i < n; ++i) {\n node = nodes[i], node.x -= sx, node.y -= sy;\n }\n }\n\n force.initialize = function(_) {\n nodes = _;\n };\n\n force.x = function(_) {\n return arguments.length ? (x = +_, force) : x;\n };\n\n force.y = function(_) {\n return arguments.length ? (y = +_, force) : y;\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = +_, force) : strength;\n };\n\n return force;\n}\n","import {quadtree} from \"d3-quadtree\";\nimport constant from \"./constant.js\";\nimport jiggle from \"./jiggle.js\";\nimport {x, y} from \"./simulation.js\";\n\nexport default function() {\n var nodes,\n node,\n random,\n alpha,\n strength = constant(-30),\n strengths,\n distanceMin2 = 1,\n distanceMax2 = Infinity,\n theta2 = 0.81;\n\n function force(_) {\n var i, n = nodes.length, tree = quadtree(nodes, x, y).visitAfter(accumulate);\n for (alpha = _, i = 0; i < n; ++i) node = nodes[i], tree.visit(apply);\n }\n\n function initialize() {\n if (!nodes) return;\n var i, n = nodes.length, node;\n strengths = new Array(n);\n for (i = 0; i < n; ++i) node = nodes[i], strengths[node.index] = +strength(node, i, nodes);\n }\n\n function accumulate(quad) {\n var strength = 0, q, c, weight = 0, x, y, i;\n\n // For internal nodes, accumulate forces from child quadrants.\n if (quad.length) {\n for (x = y = i = 0; i < 4; ++i) {\n if ((q = quad[i]) && (c = Math.abs(q.value))) {\n strength += q.value, weight += c, x += c * q.x, y += c * q.y;\n }\n }\n quad.x = x / weight;\n quad.y = y / weight;\n }\n\n // For leaf nodes, accumulate forces from coincident quadrants.\n else {\n q = quad;\n q.x = q.data.x;\n q.y = q.data.y;\n do strength += strengths[q.data.index];\n while (q = q.next);\n }\n\n quad.value = strength;\n }\n\n function apply(quad, x1, _, x2) {\n if (!quad.value) return true;\n\n var x = quad.x - node.x,\n y = quad.y - node.y,\n w = x2 - x1,\n l = x * x + y * y;\n\n // Apply the Barnes-Hut approximation if possible.\n // Limit forces for very close nodes; randomize direction if coincident.\n if (w * w / theta2 < l) {\n if (l < distanceMax2) {\n if (x === 0) x = jiggle(random), l += x * x;\n if (y === 0) y = jiggle(random), l += y * y;\n if (l < distanceMin2) l = Math.sqrt(distanceMin2 * l);\n node.vx += x * quad.value * alpha / l;\n node.vy += y * quad.value * alpha / l;\n }\n return true;\n }\n\n // Otherwise, process points directly.\n else if (quad.length || l >= distanceMax2) return;\n\n // Limit forces for very close nodes; randomize direction if coincident.\n if (quad.data !== node || quad.next) {\n if (x === 0) x = jiggle(random), l += x * x;\n if (y === 0) y = jiggle(random), l += y * y;\n if (l < distanceMin2) l = Math.sqrt(distanceMin2 * l);\n }\n\n do if (quad.data !== node) {\n w = strengths[quad.data.index] * alpha / l;\n node.vx += x * w;\n node.vy += y * w;\n } while (quad = quad.next);\n }\n\n force.initialize = function(_nodes, _random) {\n nodes = _nodes;\n random = _random;\n initialize();\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = typeof _ === \"function\" ? _ : constant(+_), initialize(), force) : strength;\n };\n\n force.distanceMin = function(_) {\n return arguments.length ? (distanceMin2 = _ * _, force) : Math.sqrt(distanceMin2);\n };\n\n force.distanceMax = function(_) {\n return arguments.length ? (distanceMax2 = _ * _, force) : Math.sqrt(distanceMax2);\n };\n\n force.theta = function(_) {\n return arguments.length ? (theta2 = _ * _, force) : Math.sqrt(theta2);\n };\n\n return force;\n}\n","import constant from \"./constant.js\";\n\nexport default function(x) {\n var strength = constant(0.1),\n nodes,\n strengths,\n xz;\n\n if (typeof x !== \"function\") x = constant(x == null ? 0 : +x);\n\n function force(alpha) {\n for (var i = 0, n = nodes.length, node; i < n; ++i) {\n node = nodes[i], node.vx += (xz[i] - node.x) * strengths[i] * alpha;\n }\n }\n\n function initialize() {\n if (!nodes) return;\n var i, n = nodes.length;\n strengths = new Array(n);\n xz = new Array(n);\n for (i = 0; i < n; ++i) {\n strengths[i] = isNaN(xz[i] = +x(nodes[i], i, nodes)) ? 0 : +strength(nodes[i], i, nodes);\n }\n }\n\n force.initialize = function(_) {\n nodes = _;\n initialize();\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = typeof _ === \"function\" ? _ : constant(+_), initialize(), force) : strength;\n };\n\n force.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : constant(+_), initialize(), force) : x;\n };\n\n return force;\n}\n","import constant from \"./constant.js\";\n\nexport default function(y) {\n var strength = constant(0.1),\n nodes,\n strengths,\n yz;\n\n if (typeof y !== \"function\") y = constant(y == null ? 0 : +y);\n\n function force(alpha) {\n for (var i = 0, n = nodes.length, node; i < n; ++i) {\n node = nodes[i], node.vy += (yz[i] - node.y) * strengths[i] * alpha;\n }\n }\n\n function initialize() {\n if (!nodes) return;\n var i, n = nodes.length;\n strengths = new Array(n);\n yz = new Array(n);\n for (i = 0; i < n; ++i) {\n strengths[i] = isNaN(yz[i] = +y(nodes[i], i, nodes)) ? 0 : +strength(nodes[i], i, nodes);\n }\n }\n\n force.initialize = function(_) {\n nodes = _;\n initialize();\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = typeof _ === \"function\" ? _ : constant(+_), initialize(), force) : strength;\n };\n\n force.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : constant(+_), initialize(), force) : y;\n };\n\n return force;\n}\n","function defaultSeparation(a, b) {\n return a.parent === b.parent ? 1 : 2;\n}\n\nfunction meanX(children) {\n return children.reduce(meanXReduce, 0) / children.length;\n}\n\nfunction meanXReduce(x, c) {\n return x + c.x;\n}\n\nfunction maxY(children) {\n return 1 + children.reduce(maxYReduce, 0);\n}\n\nfunction maxYReduce(y, c) {\n return Math.max(y, c.y);\n}\n\nfunction leafLeft(node) {\n var children;\n while (children = node.children) node = children[0];\n return node;\n}\n\nfunction leafRight(node) {\n var children;\n while (children = node.children) node = children[children.length - 1];\n return node;\n}\n\nexport default function() {\n var separation = defaultSeparation,\n dx = 1,\n dy = 1,\n nodeSize = false;\n\n function cluster(root) {\n var previousNode,\n x = 0;\n\n // First walk, computing the initial x & y values.\n root.eachAfter(function(node) {\n var children = node.children;\n if (children) {\n node.x = meanX(children);\n node.y = maxY(children);\n } else {\n node.x = previousNode ? x += separation(node, previousNode) : 0;\n node.y = 0;\n previousNode = node;\n }\n });\n\n var left = leafLeft(root),\n right = leafRight(root),\n x0 = left.x - separation(left, right) / 2,\n x1 = right.x + separation(right, left) / 2;\n\n // Second walk, normalizing x & y to the desired size.\n return root.eachAfter(nodeSize ? function(node) {\n node.x = (node.x - root.x) * dx;\n node.y = (root.y - node.y) * dy;\n } : function(node) {\n node.x = (node.x - x0) / (x1 - x0) * dx;\n node.y = (1 - (root.y ? node.y / root.y : 1)) * dy;\n });\n }\n\n cluster.separation = function(x) {\n return arguments.length ? (separation = x, cluster) : separation;\n };\n\n cluster.size = function(x) {\n return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], cluster) : (nodeSize ? null : [dx, dy]);\n };\n\n cluster.nodeSize = function(x) {\n return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], cluster) : (nodeSize ? [dx, dy] : null);\n };\n\n return cluster;\n}\n","function count(node) {\n var sum = 0,\n children = node.children,\n i = children && children.length;\n if (!i) sum = 1;\n else while (--i >= 0) sum += children[i].value;\n node.value = sum;\n}\n\nexport default function() {\n return this.eachAfter(count);\n}\n","export default function*() {\n var node = this, current, next = [node], children, i, n;\n do {\n current = next.reverse(), next = [];\n while (node = current.pop()) {\n yield node;\n if (children = node.children) {\n for (i = 0, n = children.length; i < n; ++i) {\n next.push(children[i]);\n }\n }\n }\n } while (next.length);\n}\n","import node_count from \"./count.js\";\nimport node_each from \"./each.js\";\nimport node_eachBefore from \"./eachBefore.js\";\nimport node_eachAfter from \"./eachAfter.js\";\nimport node_find from \"./find.js\";\nimport node_sum from \"./sum.js\";\nimport node_sort from \"./sort.js\";\nimport node_path from \"./path.js\";\nimport node_ancestors from \"./ancestors.js\";\nimport node_descendants from \"./descendants.js\";\nimport node_leaves from \"./leaves.js\";\nimport node_links from \"./links.js\";\nimport node_iterator from \"./iterator.js\";\n\nexport default function hierarchy(data, children) {\n if (data instanceof Map) {\n data = [undefined, data];\n if (children === undefined) children = mapChildren;\n } else if (children === undefined) {\n children = objectChildren;\n }\n\n var root = new Node(data),\n node,\n nodes = [root],\n child,\n childs,\n i,\n n;\n\n while (node = nodes.pop()) {\n if ((childs = children(node.data)) && (n = (childs = Array.from(childs)).length)) {\n node.children = childs;\n for (i = n - 1; i >= 0; --i) {\n nodes.push(child = childs[i] = new Node(childs[i]));\n child.parent = node;\n child.depth = node.depth + 1;\n }\n }\n }\n\n return root.eachBefore(computeHeight);\n}\n\nfunction node_copy() {\n return hierarchy(this).eachBefore(copyData);\n}\n\nfunction objectChildren(d) {\n return d.children;\n}\n\nfunction mapChildren(d) {\n return Array.isArray(d) ? d[1] : null;\n}\n\nfunction copyData(node) {\n if (node.data.value !== undefined) node.value = node.data.value;\n node.data = node.data.data;\n}\n\nexport function computeHeight(node) {\n var height = 0;\n do node.height = height;\n while ((node = node.parent) && (node.height < ++height));\n}\n\nexport function Node(data) {\n this.data = data;\n this.depth =\n this.height = 0;\n this.parent = null;\n}\n\nNode.prototype = hierarchy.prototype = {\n constructor: Node,\n count: node_count,\n each: node_each,\n eachAfter: node_eachAfter,\n eachBefore: node_eachBefore,\n find: node_find,\n sum: node_sum,\n sort: node_sort,\n path: node_path,\n ancestors: node_ancestors,\n descendants: node_descendants,\n leaves: node_leaves,\n links: node_links,\n copy: node_copy,\n [Symbol.iterator]: node_iterator\n};\n","import {shuffle} from \"../array.js\";\n\nexport default function(circles) {\n var i = 0, n = (circles = shuffle(Array.from(circles))).length, B = [], p, e;\n\n while (i < n) {\n p = circles[i];\n if (e && enclosesWeak(e, p)) ++i;\n else e = encloseBasis(B = extendBasis(B, p)), i = 0;\n }\n\n return e;\n}\n\nfunction extendBasis(B, p) {\n var i, j;\n\n if (enclosesWeakAll(p, B)) return [p];\n\n // If we get here then B must have at least one element.\n for (i = 0; i < B.length; ++i) {\n if (enclosesNot(p, B[i])\n && enclosesWeakAll(encloseBasis2(B[i], p), B)) {\n return [B[i], p];\n }\n }\n\n // If we get here then B must have at least two elements.\n for (i = 0; i < B.length - 1; ++i) {\n for (j = i + 1; j < B.length; ++j) {\n if (enclosesNot(encloseBasis2(B[i], B[j]), p)\n && enclosesNot(encloseBasis2(B[i], p), B[j])\n && enclosesNot(encloseBasis2(B[j], p), B[i])\n && enclosesWeakAll(encloseBasis3(B[i], B[j], p), B)) {\n return [B[i], B[j], p];\n }\n }\n }\n\n // If we get here then something is very wrong.\n throw new Error;\n}\n\nfunction enclosesNot(a, b) {\n var dr = a.r - b.r, dx = b.x - a.x, dy = b.y - a.y;\n return dr < 0 || dr * dr < dx * dx + dy * dy;\n}\n\nfunction enclosesWeak(a, b) {\n var dr = a.r - b.r + Math.max(a.r, b.r, 1) * 1e-9, dx = b.x - a.x, dy = b.y - a.y;\n return dr > 0 && dr * dr > dx * dx + dy * dy;\n}\n\nfunction enclosesWeakAll(a, B) {\n for (var i = 0; i < B.length; ++i) {\n if (!enclosesWeak(a, B[i])) {\n return false;\n }\n }\n return true;\n}\n\nfunction encloseBasis(B) {\n switch (B.length) {\n case 1: return encloseBasis1(B[0]);\n case 2: return encloseBasis2(B[0], B[1]);\n case 3: return encloseBasis3(B[0], B[1], B[2]);\n }\n}\n\nfunction encloseBasis1(a) {\n return {\n x: a.x,\n y: a.y,\n r: a.r\n };\n}\n\nfunction encloseBasis2(a, b) {\n var x1 = a.x, y1 = a.y, r1 = a.r,\n x2 = b.x, y2 = b.y, r2 = b.r,\n x21 = x2 - x1, y21 = y2 - y1, r21 = r2 - r1,\n l = Math.sqrt(x21 * x21 + y21 * y21);\n return {\n x: (x1 + x2 + x21 / l * r21) / 2,\n y: (y1 + y2 + y21 / l * r21) / 2,\n r: (l + r1 + r2) / 2\n };\n}\n\nfunction encloseBasis3(a, b, c) {\n var x1 = a.x, y1 = a.y, r1 = a.r,\n x2 = b.x, y2 = b.y, r2 = b.r,\n x3 = c.x, y3 = c.y, r3 = c.r,\n a2 = x1 - x2,\n a3 = x1 - x3,\n b2 = y1 - y2,\n b3 = y1 - y3,\n c2 = r2 - r1,\n c3 = r3 - r1,\n d1 = x1 * x1 + y1 * y1 - r1 * r1,\n d2 = d1 - x2 * x2 - y2 * y2 + r2 * r2,\n d3 = d1 - x3 * x3 - y3 * y3 + r3 * r3,\n ab = a3 * b2 - a2 * b3,\n xa = (b2 * d3 - b3 * d2) / (ab * 2) - x1,\n xb = (b3 * c2 - b2 * c3) / ab,\n ya = (a3 * d2 - a2 * d3) / (ab * 2) - y1,\n yb = (a2 * c3 - a3 * c2) / ab,\n A = xb * xb + yb * yb - 1,\n B = 2 * (r1 + xa * xb + ya * yb),\n C = xa * xa + ya * ya - r1 * r1,\n r = -(A ? (B + Math.sqrt(B * B - 4 * A * C)) / (2 * A) : C / B);\n return {\n x: x1 + xa + xb * r,\n y: y1 + ya + yb * r,\n r: r\n };\n}\n","export default function(x) {\n return typeof x === \"object\" && \"length\" in x\n ? x // Array, TypedArray, NodeList, array-like\n : Array.from(x); // Map, Set, iterable, string, or anything else\n}\n\nexport function shuffle(array) {\n var m = array.length,\n t,\n i;\n\n while (m) {\n i = Math.random() * m-- | 0;\n t = array[m];\n array[m] = array[i];\n array[i] = t;\n }\n\n return array;\n}\n","import array from \"../array.js\";\nimport enclose from \"./enclose.js\";\n\nfunction place(b, a, c) {\n var dx = b.x - a.x, x, a2,\n dy = b.y - a.y, y, b2,\n d2 = dx * dx + dy * dy;\n if (d2) {\n a2 = a.r + c.r, a2 *= a2;\n b2 = b.r + c.r, b2 *= b2;\n if (a2 > b2) {\n x = (d2 + b2 - a2) / (2 * d2);\n y = Math.sqrt(Math.max(0, b2 / d2 - x * x));\n c.x = b.x - x * dx - y * dy;\n c.y = b.y - x * dy + y * dx;\n } else {\n x = (d2 + a2 - b2) / (2 * d2);\n y = Math.sqrt(Math.max(0, a2 / d2 - x * x));\n c.x = a.x + x * dx - y * dy;\n c.y = a.y + x * dy + y * dx;\n }\n } else {\n c.x = a.x + c.r;\n c.y = a.y;\n }\n}\n\nfunction intersects(a, b) {\n var dr = a.r + b.r - 1e-6, dx = b.x - a.x, dy = b.y - a.y;\n return dr > 0 && dr * dr > dx * dx + dy * dy;\n}\n\nfunction score(node) {\n var a = node._,\n b = node.next._,\n ab = a.r + b.r,\n dx = (a.x * b.r + b.x * a.r) / ab,\n dy = (a.y * b.r + b.y * a.r) / ab;\n return dx * dx + dy * dy;\n}\n\nfunction Node(circle) {\n this._ = circle;\n this.next = null;\n this.previous = null;\n}\n\nexport function packEnclose(circles) {\n if (!(n = (circles = array(circles)).length)) return 0;\n\n var a, b, c, n, aa, ca, i, j, k, sj, sk;\n\n // Place the first circle.\n a = circles[0], a.x = 0, a.y = 0;\n if (!(n > 1)) return a.r;\n\n // Place the second circle.\n b = circles[1], a.x = -b.r, b.x = a.r, b.y = 0;\n if (!(n > 2)) return a.r + b.r;\n\n // Place the third circle.\n place(b, a, c = circles[2]);\n\n // Initialize the front-chain using the first three circles a, b and c.\n a = new Node(a), b = new Node(b), c = new Node(c);\n a.next = c.previous = b;\n b.next = a.previous = c;\n c.next = b.previous = a;\n\n // Attempt to place each remaining circle…\n pack: for (i = 3; i < n; ++i) {\n place(a._, b._, c = circles[i]), c = new Node(c);\n\n // Find the closest intersecting circle on the front-chain, if any.\n // “Closeness” is determined by linear distance along the front-chain.\n // “Ahead” or “behind” is likewise determined by linear distance.\n j = b.next, k = a.previous, sj = b._.r, sk = a._.r;\n do {\n if (sj <= sk) {\n if (intersects(j._, c._)) {\n b = j, a.next = b, b.previous = a, --i;\n continue pack;\n }\n sj += j._.r, j = j.next;\n } else {\n if (intersects(k._, c._)) {\n a = k, a.next = b, b.previous = a, --i;\n continue pack;\n }\n sk += k._.r, k = k.previous;\n }\n } while (j !== k.next);\n\n // Success! Insert the new circle c between a and b.\n c.previous = a, c.next = b, a.next = b.previous = b = c;\n\n // Compute the new closest circle pair to the centroid.\n aa = score(a);\n while ((c = c.next) !== b) {\n if ((ca = score(c)) < aa) {\n a = c, aa = ca;\n }\n }\n b = a.next;\n }\n\n // Compute the enclosing circle of the front chain.\n a = [b._], c = b; while ((c = c.next) !== b) a.push(c._); c = enclose(a);\n\n // Translate the circles to put the enclosing circle around the origin.\n for (i = 0; i < n; ++i) a = circles[i], a.x -= c.x, a.y -= c.y;\n\n return c.r;\n}\n\nexport default function(circles) {\n packEnclose(circles);\n return circles;\n}\n","export function optional(f) {\n return f == null ? null : required(f);\n}\n\nexport function required(f) {\n if (typeof f !== \"function\") throw new Error;\n return f;\n}\n","export function constantZero() {\n return 0;\n}\n\nexport default function(x) {\n return function() {\n return x;\n };\n}\n","import {packEnclose} from \"./siblings.js\";\nimport {optional} from \"../accessors.js\";\nimport constant, {constantZero} from \"../constant.js\";\n\nfunction defaultRadius(d) {\n return Math.sqrt(d.value);\n}\n\nexport default function() {\n var radius = null,\n dx = 1,\n dy = 1,\n padding = constantZero;\n\n function pack(root) {\n root.x = dx / 2, root.y = dy / 2;\n if (radius) {\n root.eachBefore(radiusLeaf(radius))\n .eachAfter(packChildren(padding, 0.5))\n .eachBefore(translateChild(1));\n } else {\n root.eachBefore(radiusLeaf(defaultRadius))\n .eachAfter(packChildren(constantZero, 1))\n .eachAfter(packChildren(padding, root.r / Math.min(dx, dy)))\n .eachBefore(translateChild(Math.min(dx, dy) / (2 * root.r)));\n }\n return root;\n }\n\n pack.radius = function(x) {\n return arguments.length ? (radius = optional(x), pack) : radius;\n };\n\n pack.size = function(x) {\n return arguments.length ? (dx = +x[0], dy = +x[1], pack) : [dx, dy];\n };\n\n pack.padding = function(x) {\n return arguments.length ? (padding = typeof x === \"function\" ? x : constant(+x), pack) : padding;\n };\n\n return pack;\n}\n\nfunction radiusLeaf(radius) {\n return function(node) {\n if (!node.children) {\n node.r = Math.max(0, +radius(node) || 0);\n }\n };\n}\n\nfunction packChildren(padding, k) {\n return function(node) {\n if (children = node.children) {\n var children,\n i,\n n = children.length,\n r = padding(node) * k || 0,\n e;\n\n if (r) for (i = 0; i < n; ++i) children[i].r += r;\n e = packEnclose(children);\n if (r) for (i = 0; i < n; ++i) children[i].r -= r;\n node.r = e + r;\n }\n };\n}\n\nfunction translateChild(k) {\n return function(node) {\n var parent = node.parent;\n node.r *= k;\n if (parent) {\n node.x = parent.x + k * node.x;\n node.y = parent.y + k * node.y;\n }\n };\n}\n","export default function(node) {\n node.x0 = Math.round(node.x0);\n node.y0 = Math.round(node.y0);\n node.x1 = Math.round(node.x1);\n node.y1 = Math.round(node.y1);\n}\n","export default function(parent, x0, y0, x1, y1) {\n var nodes = parent.children,\n node,\n i = -1,\n n = nodes.length,\n k = parent.value && (x1 - x0) / parent.value;\n\n while (++i < n) {\n node = nodes[i], node.y0 = y0, node.y1 = y1;\n node.x0 = x0, node.x1 = x0 += node.value * k;\n }\n}\n","export default function(callback, that) {\n let index = -1;\n for (const node of this) {\n callback.call(that, node, ++index, this);\n }\n return this;\n}\n","export default function(callback, that) {\n var node = this, nodes = [node], next = [], children, i, n, index = -1;\n while (node = nodes.pop()) {\n next.push(node);\n if (children = node.children) {\n for (i = 0, n = children.length; i < n; ++i) {\n nodes.push(children[i]);\n }\n }\n }\n while (node = next.pop()) {\n callback.call(that, node, ++index, this);\n }\n return this;\n}\n","export default function(callback, that) {\n var node = this, nodes = [node], children, i, index = -1;\n while (node = nodes.pop()) {\n callback.call(that, node, ++index, this);\n if (children = node.children) {\n for (i = children.length - 1; i >= 0; --i) {\n nodes.push(children[i]);\n }\n }\n }\n return this;\n}\n","export default function(callback, that) {\n let index = -1;\n for (const node of this) {\n if (callback.call(that, node, ++index, this)) {\n return node;\n }\n }\n}\n","export default function(value) {\n return this.eachAfter(function(node) {\n var sum = +value(node.data) || 0,\n children = node.children,\n i = children && children.length;\n while (--i >= 0) sum += children[i].value;\n node.value = sum;\n });\n}\n","export default function(compare) {\n return this.eachBefore(function(node) {\n if (node.children) {\n node.children.sort(compare);\n }\n });\n}\n","export default function(end) {\n var start = this,\n ancestor = leastCommonAncestor(start, end),\n nodes = [start];\n while (start !== ancestor) {\n start = start.parent;\n nodes.push(start);\n }\n var k = nodes.length;\n while (end !== ancestor) {\n nodes.splice(k, 0, end);\n end = end.parent;\n }\n return nodes;\n}\n\nfunction leastCommonAncestor(a, b) {\n if (a === b) return a;\n var aNodes = a.ancestors(),\n bNodes = b.ancestors(),\n c = null;\n a = aNodes.pop();\n b = bNodes.pop();\n while (a === b) {\n c = a;\n a = aNodes.pop();\n b = bNodes.pop();\n }\n return c;\n}\n","export default function() {\n var node = this, nodes = [node];\n while (node = node.parent) {\n nodes.push(node);\n }\n return nodes;\n}\n","export default function() {\n return Array.from(this);\n}\n","export default function() {\n var leaves = [];\n this.eachBefore(function(node) {\n if (!node.children) {\n leaves.push(node);\n }\n });\n return leaves;\n}\n","export default function() {\n var root = this, links = [];\n root.each(function(node) {\n if (node !== root) { // Don’t include the root’s parent, if any.\n links.push({source: node.parent, target: node});\n }\n });\n return links;\n}\n","import {optional} from \"./accessors.js\";\nimport {Node, computeHeight} from \"./hierarchy/index.js\";\n\nvar preroot = {depth: -1},\n ambiguous = {},\n imputed = {};\n\nfunction defaultId(d) {\n return d.id;\n}\n\nfunction defaultParentId(d) {\n return d.parentId;\n}\n\nexport default function() {\n var id = defaultId,\n parentId = defaultParentId,\n path;\n\n function stratify(data) {\n var nodes = Array.from(data),\n currentId = id,\n currentParentId = parentId,\n n,\n d,\n i,\n root,\n parent,\n node,\n nodeId,\n nodeKey,\n nodeByKey = new Map;\n\n if (path != null) {\n const I = nodes.map((d, i) => normalize(path(d, i, data)));\n const P = I.map(parentof);\n const S = new Set(I).add(\"\");\n for (const i of P) {\n if (!S.has(i)) {\n S.add(i);\n I.push(i);\n P.push(parentof(i));\n nodes.push(imputed);\n }\n }\n currentId = (_, i) => I[i];\n currentParentId = (_, i) => P[i];\n }\n\n for (i = 0, n = nodes.length; i < n; ++i) {\n d = nodes[i], node = nodes[i] = new Node(d);\n if ((nodeId = currentId(d, i, data)) != null && (nodeId += \"\")) {\n nodeKey = node.id = nodeId;\n nodeByKey.set(nodeKey, nodeByKey.has(nodeKey) ? ambiguous : node);\n }\n if ((nodeId = currentParentId(d, i, data)) != null && (nodeId += \"\")) {\n node.parent = nodeId;\n }\n }\n\n for (i = 0; i < n; ++i) {\n node = nodes[i];\n if (nodeId = node.parent) {\n parent = nodeByKey.get(nodeId);\n if (!parent) throw new Error(\"missing: \" + nodeId);\n if (parent === ambiguous) throw new Error(\"ambiguous: \" + nodeId);\n if (parent.children) parent.children.push(node);\n else parent.children = [node];\n node.parent = parent;\n } else {\n if (root) throw new Error(\"multiple roots\");\n root = node;\n }\n }\n\n if (!root) throw new Error(\"no root\");\n\n // When imputing internal nodes, only introduce roots if needed.\n // Then replace the imputed marker data with null.\n if (path != null) {\n while (root.data === imputed && root.children.length === 1) {\n root = root.children[0], --n;\n }\n for (let i = nodes.length - 1; i >= 0; --i) {\n node = nodes[i];\n if (node.data !== imputed) break;\n node.data = null;\n }\n }\n\n root.parent = preroot;\n root.eachBefore(function(node) { node.depth = node.parent.depth + 1; --n; }).eachBefore(computeHeight);\n root.parent = null;\n if (n > 0) throw new Error(\"cycle\");\n\n return root;\n }\n\n stratify.id = function(x) {\n return arguments.length ? (id = optional(x), stratify) : id;\n };\n\n stratify.parentId = function(x) {\n return arguments.length ? (parentId = optional(x), stratify) : parentId;\n };\n\n stratify.path = function(x) {\n return arguments.length ? (path = optional(x), stratify) : path;\n };\n\n return stratify;\n}\n\n// To normalize a path, we coerce to a string, strip the trailing slash if any\n// (as long as the trailing slash is not immediately preceded by another slash),\n// and add leading slash if missing.\nfunction normalize(path) {\n path = `${path}`;\n let i = path.length;\n if (slash(path, i - 1) && !slash(path, i - 2)) path = path.slice(0, -1);\n return path[0] === \"/\" ? path : `/${path}`;\n}\n\n// Walk backwards to find the first slash that is not the leading slash, e.g.:\n// \"/foo/bar\" ⇥ \"/foo\", \"/foo\" ⇥ \"/\", \"/\" ↦ \"\". (The root is special-cased\n// because the id of the root must be a truthy value.)\nfunction parentof(path) {\n let i = path.length;\n if (i < 2) return \"\";\n while (--i > 1) if (slash(path, i)) break;\n return path.slice(0, i);\n}\n\n// Slashes can be escaped; to determine whether a slash is a path delimiter, we\n// count the number of preceding backslashes escaping the forward slash: an odd\n// number indicates an escaped forward slash.\nfunction slash(path, i) {\n if (path[i] === \"/\") {\n let k = 0;\n while (i > 0 && path[--i] === \"\\\\\") ++k;\n if ((k & 1) === 0) return true;\n }\n return false;\n}\n","import {Node} from \"./hierarchy/index.js\";\n\nfunction defaultSeparation(a, b) {\n return a.parent === b.parent ? 1 : 2;\n}\n\n// function radialSeparation(a, b) {\n// return (a.parent === b.parent ? 1 : 2) / a.depth;\n// }\n\n// This function is used to traverse the left contour of a subtree (or\n// subforest). It returns the successor of v on this contour. This successor is\n// either given by the leftmost child of v or by the thread of v. The function\n// returns null if and only if v is on the highest level of its subtree.\nfunction nextLeft(v) {\n var children = v.children;\n return children ? children[0] : v.t;\n}\n\n// This function works analogously to nextLeft.\nfunction nextRight(v) {\n var children = v.children;\n return children ? children[children.length - 1] : v.t;\n}\n\n// Shifts the current subtree rooted at w+. This is done by increasing\n// prelim(w+) and mod(w+) by shift.\nfunction moveSubtree(wm, wp, shift) {\n var change = shift / (wp.i - wm.i);\n wp.c -= change;\n wp.s += shift;\n wm.c += change;\n wp.z += shift;\n wp.m += shift;\n}\n\n// All other shifts, applied to the smaller subtrees between w- and w+, are\n// performed by this function. To prepare the shifts, we have to adjust\n// change(w+), shift(w+), and change(w-).\nfunction executeShifts(v) {\n var shift = 0,\n change = 0,\n children = v.children,\n i = children.length,\n w;\n while (--i >= 0) {\n w = children[i];\n w.z += shift;\n w.m += shift;\n shift += w.s + (change += w.c);\n }\n}\n\n// If vi-’s ancestor is a sibling of v, returns vi-’s ancestor. Otherwise,\n// returns the specified (default) ancestor.\nfunction nextAncestor(vim, v, ancestor) {\n return vim.a.parent === v.parent ? vim.a : ancestor;\n}\n\nfunction TreeNode(node, i) {\n this._ = node;\n this.parent = null;\n this.children = null;\n this.A = null; // default ancestor\n this.a = this; // ancestor\n this.z = 0; // prelim\n this.m = 0; // mod\n this.c = 0; // change\n this.s = 0; // shift\n this.t = null; // thread\n this.i = i; // number\n}\n\nTreeNode.prototype = Object.create(Node.prototype);\n\nfunction treeRoot(root) {\n var tree = new TreeNode(root, 0),\n node,\n nodes = [tree],\n child,\n children,\n i,\n n;\n\n while (node = nodes.pop()) {\n if (children = node._.children) {\n node.children = new Array(n = children.length);\n for (i = n - 1; i >= 0; --i) {\n nodes.push(child = node.children[i] = new TreeNode(children[i], i));\n child.parent = node;\n }\n }\n }\n\n (tree.parent = new TreeNode(null, 0)).children = [tree];\n return tree;\n}\n\n// Node-link tree diagram using the Reingold-Tilford \"tidy\" algorithm\nexport default function() {\n var separation = defaultSeparation,\n dx = 1,\n dy = 1,\n nodeSize = null;\n\n function tree(root) {\n var t = treeRoot(root);\n\n // Compute the layout using Buchheim et al.’s algorithm.\n t.eachAfter(firstWalk), t.parent.m = -t.z;\n t.eachBefore(secondWalk);\n\n // If a fixed node size is specified, scale x and y.\n if (nodeSize) root.eachBefore(sizeNode);\n\n // If a fixed tree size is specified, scale x and y based on the extent.\n // Compute the left-most, right-most, and depth-most nodes for extents.\n else {\n var left = root,\n right = root,\n bottom = root;\n root.eachBefore(function(node) {\n if (node.x < left.x) left = node;\n if (node.x > right.x) right = node;\n if (node.depth > bottom.depth) bottom = node;\n });\n var s = left === right ? 1 : separation(left, right) / 2,\n tx = s - left.x,\n kx = dx / (right.x + s + tx),\n ky = dy / (bottom.depth || 1);\n root.eachBefore(function(node) {\n node.x = (node.x + tx) * kx;\n node.y = node.depth * ky;\n });\n }\n\n return root;\n }\n\n // Computes a preliminary x-coordinate for v. Before that, FIRST WALK is\n // applied recursively to the children of v, as well as the function\n // APPORTION. After spacing out the children by calling EXECUTE SHIFTS, the\n // node v is placed to the midpoint of its outermost children.\n function firstWalk(v) {\n var children = v.children,\n siblings = v.parent.children,\n w = v.i ? siblings[v.i - 1] : null;\n if (children) {\n executeShifts(v);\n var midpoint = (children[0].z + children[children.length - 1].z) / 2;\n if (w) {\n v.z = w.z + separation(v._, w._);\n v.m = v.z - midpoint;\n } else {\n v.z = midpoint;\n }\n } else if (w) {\n v.z = w.z + separation(v._, w._);\n }\n v.parent.A = apportion(v, w, v.parent.A || siblings[0]);\n }\n\n // Computes all real x-coordinates by summing up the modifiers recursively.\n function secondWalk(v) {\n v._.x = v.z + v.parent.m;\n v.m += v.parent.m;\n }\n\n // The core of the algorithm. Here, a new subtree is combined with the\n // previous subtrees. Threads are used to traverse the inside and outside\n // contours of the left and right subtree up to the highest common level. The\n // vertices used for the traversals are vi+, vi-, vo-, and vo+, where the\n // superscript o means outside and i means inside, the subscript - means left\n // subtree and + means right subtree. For summing up the modifiers along the\n // contour, we use respective variables si+, si-, so-, and so+. Whenever two\n // nodes of the inside contours conflict, we compute the left one of the\n // greatest uncommon ancestors using the function ANCESTOR and call MOVE\n // SUBTREE to shift the subtree and prepare the shifts of smaller subtrees.\n // Finally, we add a new thread (if necessary).\n function apportion(v, w, ancestor) {\n if (w) {\n var vip = v,\n vop = v,\n vim = w,\n vom = vip.parent.children[0],\n sip = vip.m,\n sop = vop.m,\n sim = vim.m,\n som = vom.m,\n shift;\n while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) {\n vom = nextLeft(vom);\n vop = nextRight(vop);\n vop.a = v;\n shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);\n if (shift > 0) {\n moveSubtree(nextAncestor(vim, v, ancestor), v, shift);\n sip += shift;\n sop += shift;\n }\n sim += vim.m;\n sip += vip.m;\n som += vom.m;\n sop += vop.m;\n }\n if (vim && !nextRight(vop)) {\n vop.t = vim;\n vop.m += sim - sop;\n }\n if (vip && !nextLeft(vom)) {\n vom.t = vip;\n vom.m += sip - som;\n ancestor = v;\n }\n }\n return ancestor;\n }\n\n function sizeNode(node) {\n node.x *= dx;\n node.y = node.depth * dy;\n }\n\n tree.separation = function(x) {\n return arguments.length ? (separation = x, tree) : separation;\n };\n\n tree.size = function(x) {\n return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], tree) : (nodeSize ? null : [dx, dy]);\n };\n\n tree.nodeSize = function(x) {\n return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], tree) : (nodeSize ? [dx, dy] : null);\n };\n\n return tree;\n}\n","export default function(parent, x0, y0, x1, y1) {\n var nodes = parent.children,\n node,\n i = -1,\n n = nodes.length,\n k = parent.value && (y1 - y0) / parent.value;\n\n while (++i < n) {\n node = nodes[i], node.x0 = x0, node.x1 = x1;\n node.y0 = y0, node.y1 = y0 += node.value * k;\n }\n}\n","import treemapDice from \"./dice.js\";\nimport treemapSlice from \"./slice.js\";\n\nexport var phi = (1 + Math.sqrt(5)) / 2;\n\nexport function squarifyRatio(ratio, parent, x0, y0, x1, y1) {\n var rows = [],\n nodes = parent.children,\n row,\n nodeValue,\n i0 = 0,\n i1 = 0,\n n = nodes.length,\n dx, dy,\n value = parent.value,\n sumValue,\n minValue,\n maxValue,\n newRatio,\n minRatio,\n alpha,\n beta;\n\n while (i0 < n) {\n dx = x1 - x0, dy = y1 - y0;\n\n // Find the next non-empty node.\n do sumValue = nodes[i1++].value; while (!sumValue && i1 < n);\n minValue = maxValue = sumValue;\n alpha = Math.max(dy / dx, dx / dy) / (value * ratio);\n beta = sumValue * sumValue * alpha;\n minRatio = Math.max(maxValue / beta, beta / minValue);\n\n // Keep adding nodes while the aspect ratio maintains or improves.\n for (; i1 < n; ++i1) {\n sumValue += nodeValue = nodes[i1].value;\n if (nodeValue < minValue) minValue = nodeValue;\n if (nodeValue > maxValue) maxValue = nodeValue;\n beta = sumValue * sumValue * alpha;\n newRatio = Math.max(maxValue / beta, beta / minValue);\n if (newRatio > minRatio) { sumValue -= nodeValue; break; }\n minRatio = newRatio;\n }\n\n // Position and record the row orientation.\n rows.push(row = {value: sumValue, dice: dx < dy, children: nodes.slice(i0, i1)});\n if (row.dice) treemapDice(row, x0, y0, x1, value ? y0 += dy * sumValue / value : y1);\n else treemapSlice(row, x0, y0, value ? x0 += dx * sumValue / value : x1, y1);\n value -= sumValue, i0 = i1;\n }\n\n return rows;\n}\n\nexport default (function custom(ratio) {\n\n function squarify(parent, x0, y0, x1, y1) {\n squarifyRatio(ratio, parent, x0, y0, x1, y1);\n }\n\n squarify.ratio = function(x) {\n return custom((x = +x) > 1 ? x : 1);\n };\n\n return squarify;\n})(phi);\n","import treemapDice from \"./dice.js\";\nimport treemapSlice from \"./slice.js\";\nimport {phi, squarifyRatio} from \"./squarify.js\";\n\nexport default (function custom(ratio) {\n\n function resquarify(parent, x0, y0, x1, y1) {\n if ((rows = parent._squarify) && (rows.ratio === ratio)) {\n var rows,\n row,\n nodes,\n i,\n j = -1,\n n,\n m = rows.length,\n value = parent.value;\n\n while (++j < m) {\n row = rows[j], nodes = row.children;\n for (i = row.value = 0, n = nodes.length; i < n; ++i) row.value += nodes[i].value;\n if (row.dice) treemapDice(row, x0, y0, x1, value ? y0 += (y1 - y0) * row.value / value : y1);\n else treemapSlice(row, x0, y0, value ? x0 += (x1 - x0) * row.value / value : x1, y1);\n value -= row.value;\n }\n } else {\n parent._squarify = rows = squarifyRatio(ratio, parent, x0, y0, x1, y1);\n rows.ratio = ratio;\n }\n }\n\n resquarify.ratio = function(x) {\n return custom((x = +x) > 1 ? x : 1);\n };\n\n return resquarify;\n})(phi);\n","import { Transform, isTuple, ingest, tupleid, stableCompare } from 'vega-dataflow';\nimport { inherits, error, array, one, truthy, hasOwnProperty } from 'vega-util';\nimport { hierarchy, pack, partition, stratify, tree, cluster, treemap, treemapBinary, treemapDice, treemapSlice, treemapSliceDice, treemapSquarify, treemapResquarify } from 'd3-hierarchy';\n\n// Build lookup table mapping tuple keys to tree node instances\nfunction lookup (tree, key, filter) {\n const map = {};\n tree.each(node => {\n const t = node.data;\n if (filter(t)) map[key(t)] = node;\n });\n tree.lookup = map;\n return tree;\n}\n\n/**\n * Nest tuples into a tree structure, grouped by key values.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} params.keys - The key fields to nest by, in order.\n * @param {boolean} [params.generate=false] - A boolean flag indicating if\n * non-leaf nodes generated by this transform should be included in the\n * output. The default (false) includes only the input data (leaf nodes)\n * in the data stream.\n */\n\nfunction Nest(params) {\n Transform.call(this, null, params);\n}\nNest.Definition = {\n 'type': 'Nest',\n 'metadata': {\n 'treesource': true,\n 'changes': true\n },\n 'params': [{\n 'name': 'keys',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'generate',\n 'type': 'boolean'\n }]\n};\n\nconst children = n => n.values;\n\ninherits(Nest, Transform, {\n transform(_, pulse) {\n if (!pulse.source) {\n error('Nest transform requires an upstream data source.');\n }\n\n var gen = _.generate,\n mod = _.modified(),\n out = pulse.clone(),\n tree = this.value;\n\n if (!tree || mod || pulse.changed()) {\n // collect nodes to remove\n if (tree) {\n tree.each(node => {\n if (node.children && isTuple(node.data)) {\n out.rem.push(node.data);\n }\n });\n } // generate new tree structure\n\n\n this.value = tree = hierarchy({\n values: array(_.keys).reduce((n, k) => {\n n.key(k);\n return n;\n }, nest()).entries(out.source)\n }, children); // collect nodes to add\n\n if (gen) {\n tree.each(node => {\n if (node.children) {\n node = ingest(node.data);\n out.add.push(node);\n out.source.push(node);\n }\n });\n } // build lookup table\n\n\n lookup(tree, tupleid, tupleid);\n }\n\n out.source.root = tree;\n return out;\n }\n\n});\n\nfunction nest() {\n const keys = [],\n nest = {\n entries: array => entries(apply(array, 0), 0),\n key: d => (keys.push(d), nest)\n };\n\n function apply(array, depth) {\n if (depth >= keys.length) {\n return array;\n }\n\n const n = array.length,\n key = keys[depth++],\n valuesByKey = {},\n result = {};\n let i = -1,\n keyValue,\n value,\n values;\n\n while (++i < n) {\n keyValue = key(value = array[i]) + '';\n\n if (values = valuesByKey[keyValue]) {\n values.push(value);\n } else {\n valuesByKey[keyValue] = [value];\n }\n }\n\n for (keyValue in valuesByKey) {\n result[keyValue] = apply(valuesByKey[keyValue], depth);\n }\n\n return result;\n }\n\n function entries(map, depth) {\n if (++depth > keys.length) return map;\n const array = [];\n\n for (const key in map) {\n array.push({\n key,\n values: entries(map[key], depth)\n });\n }\n\n return array;\n }\n\n return nest;\n}\n\n/**\n * Abstract class for tree layout.\n * @constructor\n * @param {object} params - The parameters for this operator.\n */\n\nfunction HierarchyLayout(params) {\n Transform.call(this, null, params);\n}\n\nconst defaultSeparation = (a, b) => a.parent === b.parent ? 1 : 2;\n\ninherits(HierarchyLayout, Transform, {\n transform(_, pulse) {\n if (!pulse.source || !pulse.source.root) {\n error(this.constructor.name + ' transform requires a backing tree data source.');\n }\n\n const layout = this.layout(_.method),\n fields = this.fields,\n root = pulse.source.root,\n as = _.as || fields;\n if (_.field) root.sum(_.field);else root.count();\n if (_.sort) root.sort(stableCompare(_.sort, d => d.data));\n setParams(layout, this.params, _);\n\n if (layout.separation) {\n layout.separation(_.separation !== false ? defaultSeparation : one);\n }\n\n try {\n this.value = layout(root);\n } catch (err) {\n error(err);\n }\n\n root.each(node => setFields(node, fields, as));\n return pulse.reflow(_.modified()).modifies(as).modifies('leaf');\n }\n\n});\n\nfunction setParams(layout, params, _) {\n for (let p, i = 0, n = params.length; i < n; ++i) {\n p = params[i];\n if (p in _) layout[p](_[p]);\n }\n}\n\nfunction setFields(node, fields, as) {\n const t = node.data,\n n = fields.length - 1;\n\n for (let i = 0; i < n; ++i) {\n t[as[i]] = node[fields[i]];\n }\n\n t[as[n]] = node.children ? node.children.length : 0;\n}\n\nconst Output$3 = ['x', 'y', 'r', 'depth', 'children'];\n/**\n * Packed circle tree layout.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The value field to size nodes.\n */\n\nfunction Pack(params) {\n HierarchyLayout.call(this, params);\n}\nPack.Definition = {\n 'type': 'Pack',\n 'metadata': {\n 'tree': true,\n 'modifies': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field'\n }, {\n 'name': 'sort',\n 'type': 'compare'\n }, {\n 'name': 'padding',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'radius',\n 'type': 'field',\n 'default': null\n }, {\n 'name': 'size',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': Output$3.length,\n 'default': Output$3\n }]\n};\ninherits(Pack, HierarchyLayout, {\n layout: pack,\n params: ['radius', 'size', 'padding'],\n fields: Output$3\n});\n\nconst Output$2 = ['x0', 'y0', 'x1', 'y1', 'depth', 'children'];\n/**\n * Partition tree layout.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The value field to size nodes.\n */\n\nfunction Partition(params) {\n HierarchyLayout.call(this, params);\n}\nPartition.Definition = {\n 'type': 'Partition',\n 'metadata': {\n 'tree': true,\n 'modifies': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field'\n }, {\n 'name': 'sort',\n 'type': 'compare'\n }, {\n 'name': 'padding',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'round',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'size',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': Output$2.length,\n 'default': Output$2\n }]\n};\ninherits(Partition, HierarchyLayout, {\n layout: partition,\n params: ['size', 'round', 'padding'],\n fields: Output$2\n});\n\n/**\n * Stratify a collection of tuples into a tree structure based on\n * id and parent id fields.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.key - Unique key field for each tuple.\n * @param {function(object): *} params.parentKey - Field with key for parent tuple.\n */\n\nfunction Stratify(params) {\n Transform.call(this, null, params);\n}\nStratify.Definition = {\n 'type': 'Stratify',\n 'metadata': {\n 'treesource': true\n },\n 'params': [{\n 'name': 'key',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'parentKey',\n 'type': 'field',\n 'required': true\n }]\n};\ninherits(Stratify, Transform, {\n transform(_, pulse) {\n if (!pulse.source) {\n error('Stratify transform requires an upstream data source.');\n }\n\n let tree = this.value;\n\n const mod = _.modified(),\n out = pulse.fork(pulse.ALL).materialize(pulse.SOURCE),\n run = !tree || mod || pulse.changed(pulse.ADD_REM) || pulse.modified(_.key.fields) || pulse.modified(_.parentKey.fields); // prevent upstream source pollution\n\n\n out.source = out.source.slice();\n\n if (run) {\n tree = out.source.length ? lookup(stratify().id(_.key).parentId(_.parentKey)(out.source), _.key, truthy) : lookup(stratify()([{}]), _.key, _.key);\n }\n\n out.source.root = this.value = tree;\n return out;\n }\n\n});\n\nconst Layouts = {\n tidy: tree,\n cluster: cluster\n};\nconst Output$1 = ['x', 'y', 'depth', 'children'];\n/**\n * Tree layout. Depending on the method parameter, performs either\n * Reingold-Tilford 'tidy' layout or dendrogram 'cluster' layout.\n * @constructor\n * @param {object} params - The parameters for this operator.\n */\n\nfunction Tree(params) {\n HierarchyLayout.call(this, params);\n}\nTree.Definition = {\n 'type': 'Tree',\n 'metadata': {\n 'tree': true,\n 'modifies': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field'\n }, {\n 'name': 'sort',\n 'type': 'compare'\n }, {\n 'name': 'method',\n 'type': 'enum',\n 'default': 'tidy',\n 'values': ['tidy', 'cluster']\n }, {\n 'name': 'size',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'nodeSize',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'separation',\n 'type': 'boolean',\n 'default': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': Output$1.length,\n 'default': Output$1\n }]\n};\ninherits(Tree, HierarchyLayout, {\n /**\n * Tree layout generator. Supports both 'tidy' and 'cluster' layouts.\n */\n layout(method) {\n const m = method || 'tidy';\n if (hasOwnProperty(Layouts, m)) return Layouts[m]();else error('Unrecognized Tree layout method: ' + m);\n },\n\n params: ['size', 'nodeSize'],\n fields: Output$1\n});\n\n/**\n * Generate tuples representing links between tree nodes.\n * The resulting tuples will contain 'source' and 'target' fields,\n * which point to parent and child node tuples, respectively.\n * @constructor\n * @param {object} params - The parameters for this operator.\n */\n\nfunction TreeLinks(params) {\n Transform.call(this, [], params);\n}\nTreeLinks.Definition = {\n 'type': 'TreeLinks',\n 'metadata': {\n 'tree': true,\n 'generates': true,\n 'changes': true\n },\n 'params': []\n};\ninherits(TreeLinks, Transform, {\n transform(_, pulse) {\n const links = this.value,\n tree = pulse.source && pulse.source.root,\n out = pulse.fork(pulse.NO_SOURCE),\n lut = {};\n if (!tree) error('TreeLinks transform requires a tree data source.');\n\n if (pulse.changed(pulse.ADD_REM)) {\n // remove previous links\n out.rem = links; // build lookup table of valid tuples\n\n pulse.visit(pulse.SOURCE, t => lut[tupleid(t)] = 1); // generate links for all edges incident on valid tuples\n\n tree.each(node => {\n const t = node.data,\n p = node.parent && node.parent.data;\n\n if (p && lut[tupleid(t)] && lut[tupleid(p)]) {\n out.add.push(ingest({\n source: p,\n target: t\n }));\n }\n });\n this.value = out.add;\n } else if (pulse.changed(pulse.MOD)) {\n // build lookup table of modified tuples\n pulse.visit(pulse.MOD, t => lut[tupleid(t)] = 1); // gather links incident on modified tuples\n\n links.forEach(link => {\n if (lut[tupleid(link.source)] || lut[tupleid(link.target)]) {\n out.mod.push(link);\n }\n });\n }\n\n return out;\n }\n\n});\n\nconst Tiles = {\n binary: treemapBinary,\n dice: treemapDice,\n slice: treemapSlice,\n slicedice: treemapSliceDice,\n squarify: treemapSquarify,\n resquarify: treemapResquarify\n};\nconst Output = ['x0', 'y0', 'x1', 'y1', 'depth', 'children'];\n/**\n * Treemap layout.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The value field to size nodes.\n */\n\nfunction Treemap(params) {\n HierarchyLayout.call(this, params);\n}\nTreemap.Definition = {\n 'type': 'Treemap',\n 'metadata': {\n 'tree': true,\n 'modifies': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field'\n }, {\n 'name': 'sort',\n 'type': 'compare'\n }, {\n 'name': 'method',\n 'type': 'enum',\n 'default': 'squarify',\n 'values': ['squarify', 'resquarify', 'binary', 'dice', 'slice', 'slicedice']\n }, {\n 'name': 'padding',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'paddingInner',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'paddingOuter',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'paddingTop',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'paddingRight',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'paddingBottom',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'paddingLeft',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'ratio',\n 'type': 'number',\n 'default': 1.618033988749895\n }, {\n 'name': 'round',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'size',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': Output.length,\n 'default': Output\n }]\n};\ninherits(Treemap, HierarchyLayout, {\n /**\n * Treemap layout generator. Adds 'method' and 'ratio' parameters\n * to configure the underlying tile method.\n */\n layout() {\n const x = treemap();\n\n x.ratio = _ => {\n const t = x.tile();\n if (t.ratio) x.tile(t.ratio(_));\n };\n\n x.method = _ => {\n if (hasOwnProperty(Tiles, _)) x.tile(Tiles[_]);else error('Unrecognized Treemap layout method: ' + _);\n };\n\n return x;\n },\n\n params: ['method', 'ratio', 'size', 'round', 'padding', 'paddingInner', 'paddingOuter', 'paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft'],\n fields: Output\n});\n\nexport { Nest as nest, Pack as pack, Partition as partition, Stratify as stratify, Tree as tree, TreeLinks as treelinks, Treemap as treemap };\n","import roundNode from \"./treemap/round.js\";\nimport treemapDice from \"./treemap/dice.js\";\n\nexport default function() {\n var dx = 1,\n dy = 1,\n padding = 0,\n round = false;\n\n function partition(root) {\n var n = root.height + 1;\n root.x0 =\n root.y0 = padding;\n root.x1 = dx;\n root.y1 = dy / n;\n root.eachBefore(positionNode(dy, n));\n if (round) root.eachBefore(roundNode);\n return root;\n }\n\n function positionNode(dy, n) {\n return function(node) {\n if (node.children) {\n treemapDice(node, node.x0, dy * (node.depth + 1) / n, node.x1, dy * (node.depth + 2) / n);\n }\n var x0 = node.x0,\n y0 = node.y0,\n x1 = node.x1 - padding,\n y1 = node.y1 - padding;\n if (x1 < x0) x0 = x1 = (x0 + x1) / 2;\n if (y1 < y0) y0 = y1 = (y0 + y1) / 2;\n node.x0 = x0;\n node.y0 = y0;\n node.x1 = x1;\n node.y1 = y1;\n };\n }\n\n partition.round = function(x) {\n return arguments.length ? (round = !!x, partition) : round;\n };\n\n partition.size = function(x) {\n return arguments.length ? (dx = +x[0], dy = +x[1], partition) : [dx, dy];\n };\n\n partition.padding = function(x) {\n return arguments.length ? (padding = +x, partition) : padding;\n };\n\n return partition;\n}\n","export default function(parent, x0, y0, x1, y1) {\n var nodes = parent.children,\n i, n = nodes.length,\n sum, sums = new Array(n + 1);\n\n for (sums[0] = sum = i = 0; i < n; ++i) {\n sums[i + 1] = sum += nodes[i].value;\n }\n\n partition(0, n, parent.value, x0, y0, x1, y1);\n\n function partition(i, j, value, x0, y0, x1, y1) {\n if (i >= j - 1) {\n var node = nodes[i];\n node.x0 = x0, node.y0 = y0;\n node.x1 = x1, node.y1 = y1;\n return;\n }\n\n var valueOffset = sums[i],\n valueTarget = (value / 2) + valueOffset,\n k = i + 1,\n hi = j - 1;\n\n while (k < hi) {\n var mid = k + hi >>> 1;\n if (sums[mid] < valueTarget) k = mid + 1;\n else hi = mid;\n }\n\n if ((valueTarget - sums[k - 1]) < (sums[k] - valueTarget) && i + 1 < k) --k;\n\n var valueLeft = sums[k] - valueOffset,\n valueRight = value - valueLeft;\n\n if ((x1 - x0) > (y1 - y0)) {\n var xk = value ? (x0 * valueRight + x1 * valueLeft) / value : x1;\n partition(i, k, valueLeft, x0, y0, xk, y1);\n partition(k, j, valueRight, xk, y0, x1, y1);\n } else {\n var yk = value ? (y0 * valueRight + y1 * valueLeft) / value : y1;\n partition(i, k, valueLeft, x0, y0, x1, yk);\n partition(k, j, valueRight, x0, yk, x1, y1);\n }\n }\n}\n","import dice from \"./dice.js\";\nimport slice from \"./slice.js\";\n\nexport default function(parent, x0, y0, x1, y1) {\n (parent.depth & 1 ? slice : dice)(parent, x0, y0, x1, y1);\n}\n","import roundNode from \"./round.js\";\nimport squarify from \"./squarify.js\";\nimport {required} from \"../accessors.js\";\nimport constant, {constantZero} from \"../constant.js\";\n\nexport default function() {\n var tile = squarify,\n round = false,\n dx = 1,\n dy = 1,\n paddingStack = [0],\n paddingInner = constantZero,\n paddingTop = constantZero,\n paddingRight = constantZero,\n paddingBottom = constantZero,\n paddingLeft = constantZero;\n\n function treemap(root) {\n root.x0 =\n root.y0 = 0;\n root.x1 = dx;\n root.y1 = dy;\n root.eachBefore(positionNode);\n paddingStack = [0];\n if (round) root.eachBefore(roundNode);\n return root;\n }\n\n function positionNode(node) {\n var p = paddingStack[node.depth],\n x0 = node.x0 + p,\n y0 = node.y0 + p,\n x1 = node.x1 - p,\n y1 = node.y1 - p;\n if (x1 < x0) x0 = x1 = (x0 + x1) / 2;\n if (y1 < y0) y0 = y1 = (y0 + y1) / 2;\n node.x0 = x0;\n node.y0 = y0;\n node.x1 = x1;\n node.y1 = y1;\n if (node.children) {\n p = paddingStack[node.depth + 1] = paddingInner(node) / 2;\n x0 += paddingLeft(node) - p;\n y0 += paddingTop(node) - p;\n x1 -= paddingRight(node) - p;\n y1 -= paddingBottom(node) - p;\n if (x1 < x0) x0 = x1 = (x0 + x1) / 2;\n if (y1 < y0) y0 = y1 = (y0 + y1) / 2;\n tile(node, x0, y0, x1, y1);\n }\n }\n\n treemap.round = function(x) {\n return arguments.length ? (round = !!x, treemap) : round;\n };\n\n treemap.size = function(x) {\n return arguments.length ? (dx = +x[0], dy = +x[1], treemap) : [dx, dy];\n };\n\n treemap.tile = function(x) {\n return arguments.length ? (tile = required(x), treemap) : tile;\n };\n\n treemap.padding = function(x) {\n return arguments.length ? treemap.paddingInner(x).paddingOuter(x) : treemap.paddingInner();\n };\n\n treemap.paddingInner = function(x) {\n return arguments.length ? (paddingInner = typeof x === \"function\" ? x : constant(+x), treemap) : paddingInner;\n };\n\n treemap.paddingOuter = function(x) {\n return arguments.length ? treemap.paddingTop(x).paddingRight(x).paddingBottom(x).paddingLeft(x) : treemap.paddingTop();\n };\n\n treemap.paddingTop = function(x) {\n return arguments.length ? (paddingTop = typeof x === \"function\" ? x : constant(+x), treemap) : paddingTop;\n };\n\n treemap.paddingRight = function(x) {\n return arguments.length ? (paddingRight = typeof x === \"function\" ? x : constant(+x), treemap) : paddingRight;\n };\n\n treemap.paddingBottom = function(x) {\n return arguments.length ? (paddingBottom = typeof x === \"function\" ? x : constant(+x), treemap) : paddingBottom;\n };\n\n treemap.paddingLeft = function(x) {\n return arguments.length ? (paddingLeft = typeof x === \"function\" ? x : constant(+x), treemap) : paddingLeft;\n };\n\n return treemap;\n}\n","import { Marks, textMetrics } from 'vega-scenegraph';\nimport { canvas } from 'vega-canvas';\nimport { rederive, Transform } from 'vega-dataflow';\nimport { inherits, isFunction, error, array } from 'vega-util';\n\nconst ALPHA_MASK = 0xff000000;\nfunction baseBitmaps($, data) {\n const bitmap = $.bitmap(); // when there is no base mark but data points are to be avoided\n\n (data || []).forEach(d => bitmap.set($(d.boundary[0]), $(d.boundary[3])));\n return [bitmap, undefined];\n}\nfunction markBitmaps($, baseMark, avoidMarks, labelInside, isGroupArea) {\n // create canvas\n const width = $.width,\n height = $.height,\n border = labelInside || isGroupArea,\n context = canvas(width, height).getContext('2d'),\n baseMarkContext = canvas(width, height).getContext('2d'),\n strokeContext = border && canvas(width, height).getContext('2d'); // render all marks to be avoided into canvas\n\n avoidMarks.forEach(items => draw(context, items, false));\n draw(baseMarkContext, baseMark, false);\n\n if (border) {\n draw(strokeContext, baseMark, true);\n } // get canvas buffer, create bitmaps\n\n\n const buffer = getBuffer(context, width, height),\n baseMarkBuffer = getBuffer(baseMarkContext, width, height),\n strokeBuffer = border && getBuffer(strokeContext, width, height),\n layer1 = $.bitmap(),\n layer2 = border && $.bitmap(); // populate bitmap layers\n\n let x, y, u, v, index, alpha, strokeAlpha, baseMarkAlpha;\n\n for (y = 0; y < height; ++y) {\n for (x = 0; x < width; ++x) {\n index = y * width + x;\n alpha = buffer[index] & ALPHA_MASK;\n baseMarkAlpha = baseMarkBuffer[index] & ALPHA_MASK;\n strokeAlpha = border && strokeBuffer[index] & ALPHA_MASK;\n\n if (alpha || strokeAlpha || baseMarkAlpha) {\n u = $(x);\n v = $(y);\n if (!isGroupArea && (alpha || baseMarkAlpha)) layer1.set(u, v); // update interior bitmap\n\n if (border && (alpha || strokeAlpha)) layer2.set(u, v); // update border bitmap\n }\n }\n }\n\n return [layer1, layer2];\n}\n\nfunction getBuffer(context, width, height) {\n return new Uint32Array(context.getImageData(0, 0, width, height).data.buffer);\n}\n\nfunction draw(context, items, interior) {\n if (!items.length) return;\n const type = items[0].mark.marktype;\n\n if (type === 'group') {\n items.forEach(group => {\n group.items.forEach(mark => draw(context, mark.items, interior));\n });\n } else {\n Marks[type].draw(context, {\n items: interior ? items.map(prepare) : items\n });\n }\n}\n/**\n * Prepare item before drawing into canvas (setting stroke and opacity)\n * @param {object} source item to be prepared\n * @returns prepared item\n */\n\n\nfunction prepare(source) {\n const item = rederive(source, {});\n\n if (item.stroke && item.strokeOpacity !== 0 || item.fill && item.fillOpacity !== 0) {\n return { ...item,\n strokeOpacity: 1,\n stroke: '#000',\n fillOpacity: 0\n };\n }\n\n return item;\n}\n\nconst DIV = 5,\n // bit shift from x, y index to bit vector array index\nMOD = 31,\n // bit mask for index lookup within a bit vector\nSIZE = 32,\n // individual bit vector size\nRIGHT0 = new Uint32Array(SIZE + 1),\n // left-anchored bit vectors, full -> 0\nRIGHT1 = new Uint32Array(SIZE + 1); // right-anchored bit vectors, 0 -> full\n\nRIGHT1[0] = 0;\nRIGHT0[0] = ~RIGHT1[0];\n\nfor (let i = 1; i <= SIZE; ++i) {\n RIGHT1[i] = RIGHT1[i - 1] << 1 | 1;\n RIGHT0[i] = ~RIGHT1[i];\n}\n\nfunction Bitmap (w, h) {\n const array = new Uint32Array(~~((w * h + SIZE) / SIZE));\n\n function _set(index, mask) {\n array[index] |= mask;\n }\n\n function _clear(index, mask) {\n array[index] &= mask;\n }\n\n return {\n array: array,\n get: (x, y) => {\n const index = y * w + x;\n return array[index >>> DIV] & 1 << (index & MOD);\n },\n set: (x, y) => {\n const index = y * w + x;\n\n _set(index >>> DIV, 1 << (index & MOD));\n },\n clear: (x, y) => {\n const index = y * w + x;\n\n _clear(index >>> DIV, ~(1 << (index & MOD)));\n },\n getRange: (x, y, x2, y2) => {\n let r = y2,\n start,\n end,\n indexStart,\n indexEnd;\n\n for (; r >= y; --r) {\n start = r * w + x;\n end = r * w + x2;\n indexStart = start >>> DIV;\n indexEnd = end >>> DIV;\n\n if (indexStart === indexEnd) {\n if (array[indexStart] & RIGHT0[start & MOD] & RIGHT1[(end & MOD) + 1]) {\n return true;\n }\n } else {\n if (array[indexStart] & RIGHT0[start & MOD]) return true;\n if (array[indexEnd] & RIGHT1[(end & MOD) + 1]) return true;\n\n for (let i = indexStart + 1; i < indexEnd; ++i) {\n if (array[i]) return true;\n }\n }\n }\n\n return false;\n },\n setRange: (x, y, x2, y2) => {\n let start, end, indexStart, indexEnd, i;\n\n for (; y <= y2; ++y) {\n start = y * w + x;\n end = y * w + x2;\n indexStart = start >>> DIV;\n indexEnd = end >>> DIV;\n\n if (indexStart === indexEnd) {\n _set(indexStart, RIGHT0[start & MOD] & RIGHT1[(end & MOD) + 1]);\n } else {\n _set(indexStart, RIGHT0[start & MOD]);\n\n _set(indexEnd, RIGHT1[(end & MOD) + 1]);\n\n for (i = indexStart + 1; i < indexEnd; ++i) _set(i, 0xffffffff);\n }\n }\n },\n clearRange: (x, y, x2, y2) => {\n let start, end, indexStart, indexEnd, i;\n\n for (; y <= y2; ++y) {\n start = y * w + x;\n end = y * w + x2;\n indexStart = start >>> DIV;\n indexEnd = end >>> DIV;\n\n if (indexStart === indexEnd) {\n _clear(indexStart, RIGHT1[start & MOD] | RIGHT0[(end & MOD) + 1]);\n } else {\n _clear(indexStart, RIGHT1[start & MOD]);\n\n _clear(indexEnd, RIGHT0[(end & MOD) + 1]);\n\n for (i = indexStart + 1; i < indexEnd; ++i) _clear(i, 0);\n }\n }\n },\n outOfBounds: (x, y, x2, y2) => x < 0 || y < 0 || y2 >= h || x2 >= w\n };\n}\n\nfunction scaler (width, height, padding) {\n const ratio = Math.max(1, Math.sqrt(width * height / 1e6)),\n w = ~~((width + 2 * padding + ratio) / ratio),\n h = ~~((height + 2 * padding + ratio) / ratio),\n scale = _ => ~~((_ + padding) / ratio);\n\n scale.invert = _ => _ * ratio - padding;\n\n scale.bitmap = () => Bitmap(w, h);\n\n scale.ratio = ratio;\n scale.padding = padding;\n scale.width = width;\n scale.height = height;\n return scale;\n}\n\nfunction placeAreaLabelNaive ($, bitmaps, avoidBaseMark, markIndex) {\n const width = $.width,\n height = $.height; // try to place a label within an input area mark\n\n return function (d) {\n const items = d.datum.datum.items[markIndex].items,\n // area points\n n = items.length,\n // number of points\n textHeight = d.datum.fontSize,\n // label width\n textWidth = textMetrics.width(d.datum, d.datum.text); // label height\n\n let maxAreaWidth = 0,\n x1,\n x2,\n y1,\n y2,\n x,\n y,\n areaWidth; // for each area sample point\n\n for (let i = 0; i < n; ++i) {\n x1 = items[i].x;\n y1 = items[i].y;\n x2 = items[i].x2 === undefined ? x1 : items[i].x2;\n y2 = items[i].y2 === undefined ? y1 : items[i].y2;\n x = (x1 + x2) / 2;\n y = (y1 + y2) / 2;\n areaWidth = Math.abs(x2 - x1 + y2 - y1);\n\n if (areaWidth >= maxAreaWidth) {\n maxAreaWidth = areaWidth;\n d.x = x;\n d.y = y;\n }\n }\n\n x = textWidth / 2;\n y = textHeight / 2;\n x1 = d.x - x;\n x2 = d.x + x;\n y1 = d.y - y;\n y2 = d.y + y;\n d.align = 'center';\n\n if (x1 < 0 && x2 <= width) {\n d.align = 'left';\n } else if (0 <= x1 && width < x2) {\n d.align = 'right';\n }\n\n d.baseline = 'middle';\n\n if (y1 < 0 && y2 <= height) {\n d.baseline = 'top';\n } else if (0 <= y1 && height < y2) {\n d.baseline = 'bottom';\n }\n\n return true;\n };\n}\n\nfunction outOfBounds(x, y, textWidth, textHeight, width, height) {\n let r = textWidth / 2;\n return x - r < 0 || x + r > width || y - (r = textHeight / 2) < 0 || y + r > height;\n}\nfunction collision($, x, y, textHeight, textWidth, h, bm0, bm1) {\n const w = textWidth * h / (textHeight * 2),\n x1 = $(x - w),\n x2 = $(x + w),\n y1 = $(y - (h = h / 2)),\n y2 = $(y + h);\n return bm0.outOfBounds(x1, y1, x2, y2) || bm0.getRange(x1, y1, x2, y2) || bm1 && bm1.getRange(x1, y1, x2, y2);\n}\n\nfunction placeAreaLabelReducedSearch ($, bitmaps, avoidBaseMark, markIndex) {\n const width = $.width,\n height = $.height,\n bm0 = bitmaps[0],\n // where labels have been placed\n bm1 = bitmaps[1]; // area outlines\n\n function tryLabel(_x, _y, maxSize, textWidth, textHeight) {\n const x = $.invert(_x),\n y = $.invert(_y);\n let lo = maxSize,\n hi = height,\n mid;\n\n if (!outOfBounds(x, y, textWidth, textHeight, width, height) && !collision($, x, y, textHeight, textWidth, lo, bm0, bm1) && !collision($, x, y, textHeight, textWidth, textHeight, bm0, null)) {\n // if the label fits at the current sample point,\n // perform binary search to find the largest font size that fits\n while (hi - lo >= 1) {\n mid = (lo + hi) / 2;\n\n if (collision($, x, y, textHeight, textWidth, mid, bm0, bm1)) {\n hi = mid;\n } else {\n lo = mid;\n }\n } // place label if current lower bound exceeds prior max font size\n\n\n if (lo > maxSize) {\n return [x, y, lo, true];\n }\n }\n } // try to place a label within an input area mark\n\n\n return function (d) {\n const items = d.datum.datum.items[markIndex].items,\n // area points\n n = items.length,\n // number of points\n textHeight = d.datum.fontSize,\n // label width\n textWidth = textMetrics.width(d.datum, d.datum.text); // label height\n\n let maxSize = avoidBaseMark ? textHeight : 0,\n labelPlaced = false,\n labelPlaced2 = false,\n maxAreaWidth = 0,\n x1,\n x2,\n y1,\n y2,\n x,\n y,\n _x,\n _y,\n _x1,\n _xMid,\n _x2,\n _y1,\n _yMid,\n _y2,\n areaWidth,\n result,\n swapTmp; // for each area sample point\n\n\n for (let i = 0; i < n; ++i) {\n x1 = items[i].x;\n y1 = items[i].y;\n x2 = items[i].x2 === undefined ? x1 : items[i].x2;\n y2 = items[i].y2 === undefined ? y1 : items[i].y2;\n\n if (x1 > x2) {\n swapTmp = x1;\n x1 = x2;\n x2 = swapTmp;\n }\n\n if (y1 > y2) {\n swapTmp = y1;\n y1 = y2;\n y2 = swapTmp;\n }\n\n _x1 = $(x1);\n _x2 = $(x2);\n _xMid = ~~((_x1 + _x2) / 2);\n _y1 = $(y1);\n _y2 = $(y2);\n _yMid = ~~((_y1 + _y2) / 2); // search along the line from mid point between the 2 border to lower border\n\n for (_x = _xMid; _x >= _x1; --_x) {\n for (_y = _yMid; _y >= _y1; --_y) {\n result = tryLabel(_x, _y, maxSize, textWidth, textHeight);\n\n if (result) {\n [d.x, d.y, maxSize, labelPlaced] = result;\n }\n }\n } // search along the line from mid point between the 2 border to upper border\n\n\n for (_x = _xMid; _x <= _x2; ++_x) {\n for (_y = _yMid; _y <= _y2; ++_y) {\n result = tryLabel(_x, _y, maxSize, textWidth, textHeight);\n\n if (result) {\n [d.x, d.y, maxSize, labelPlaced] = result;\n }\n }\n } // place label at slice center if not placed through other means\n // and if we're not avoiding overlap with other areas\n\n\n if (!labelPlaced && !avoidBaseMark) {\n // one span is zero, hence we can add\n areaWidth = Math.abs(x2 - x1 + y2 - y1);\n x = (x1 + x2) / 2;\n y = (y1 + y2) / 2; // place label if it fits and improves the max area width\n\n if (areaWidth >= maxAreaWidth && !outOfBounds(x, y, textWidth, textHeight, width, height) && !collision($, x, y, textHeight, textWidth, textHeight, bm0, null)) {\n maxAreaWidth = areaWidth;\n d.x = x;\n d.y = y;\n labelPlaced2 = true;\n }\n }\n } // record current label placement information, update label bitmap\n\n\n if (labelPlaced || labelPlaced2) {\n x = textWidth / 2;\n y = textHeight / 2;\n bm0.setRange($(d.x - x), $(d.y - y), $(d.x + x), $(d.y + y));\n d.align = 'center';\n d.baseline = 'middle';\n return true;\n } else {\n return false;\n }\n };\n}\n\nconst X_DIR = [-1, -1, 1, 1];\nconst Y_DIR = [-1, 1, -1, 1];\nfunction placeAreaLabelFloodFill ($, bitmaps, avoidBaseMark, markIndex) {\n const width = $.width,\n height = $.height,\n bm0 = bitmaps[0],\n // where labels have been placed\n bm1 = bitmaps[1],\n // area outlines\n bm2 = $.bitmap(); // flood-fill visitations\n // try to place a label within an input area mark\n\n return function (d) {\n const items = d.datum.datum.items[markIndex].items,\n // area points\n n = items.length,\n // number of points\n textHeight = d.datum.fontSize,\n // label width\n textWidth = textMetrics.width(d.datum, d.datum.text),\n // label height\n stack = []; // flood fill stack\n\n let maxSize = avoidBaseMark ? textHeight : 0,\n labelPlaced = false,\n labelPlaced2 = false,\n maxAreaWidth = 0,\n x1,\n x2,\n y1,\n y2,\n x,\n y,\n _x,\n _y,\n lo,\n hi,\n mid,\n areaWidth; // for each area sample point\n\n\n for (let i = 0; i < n; ++i) {\n x1 = items[i].x;\n y1 = items[i].y;\n x2 = items[i].x2 === undefined ? x1 : items[i].x2;\n y2 = items[i].y2 === undefined ? y1 : items[i].y2; // add scaled center point to stack\n\n stack.push([$((x1 + x2) / 2), $((y1 + y2) / 2)]); // perform flood fill, visit points\n\n while (stack.length) {\n [_x, _y] = stack.pop(); // exit if point already marked\n\n if (bm0.get(_x, _y) || bm1.get(_x, _y) || bm2.get(_x, _y)) continue; // mark point in flood fill bitmap\n // add search points for all (in bound) directions\n\n bm2.set(_x, _y);\n\n for (let j = 0; j < 4; ++j) {\n x = _x + X_DIR[j];\n y = _y + Y_DIR[j];\n if (!bm2.outOfBounds(x, y, x, y)) stack.push([x, y]);\n } // unscale point back to x, y space\n\n\n x = $.invert(_x);\n y = $.invert(_y);\n lo = maxSize;\n hi = height; // TODO: make this bound smaller\n\n if (!outOfBounds(x, y, textWidth, textHeight, width, height) && !collision($, x, y, textHeight, textWidth, lo, bm0, bm1) && !collision($, x, y, textHeight, textWidth, textHeight, bm0, null)) {\n // if the label fits at the current sample point,\n // perform binary search to find the largest font size that fits\n while (hi - lo >= 1) {\n mid = (lo + hi) / 2;\n\n if (collision($, x, y, textHeight, textWidth, mid, bm0, bm1)) {\n hi = mid;\n } else {\n lo = mid;\n }\n } // place label if current lower bound exceeds prior max font size\n\n\n if (lo > maxSize) {\n d.x = x;\n d.y = y;\n maxSize = lo;\n labelPlaced = true;\n }\n }\n } // place label at slice center if not placed through other means\n // and if we're not avoiding overlap with other areas\n\n\n if (!labelPlaced && !avoidBaseMark) {\n // one span is zero, hence we can add\n areaWidth = Math.abs(x2 - x1 + y2 - y1);\n x = (x1 + x2) / 2;\n y = (y1 + y2) / 2; // place label if it fits and improves the max area width\n\n if (areaWidth >= maxAreaWidth && !outOfBounds(x, y, textWidth, textHeight, width, height) && !collision($, x, y, textHeight, textWidth, textHeight, bm0, null)) {\n maxAreaWidth = areaWidth;\n d.x = x;\n d.y = y;\n labelPlaced2 = true;\n }\n }\n } // record current label placement information, update label bitmap\n\n\n if (labelPlaced || labelPlaced2) {\n x = textWidth / 2;\n y = textHeight / 2;\n bm0.setRange($(d.x - x), $(d.y - y), $(d.x + x), $(d.y + y));\n d.align = 'center';\n d.baseline = 'middle';\n return true;\n } else {\n return false;\n }\n };\n}\n\nconst Aligns = ['right', 'center', 'left'],\n Baselines = ['bottom', 'middle', 'top'];\nfunction placeMarkLabel ($, bitmaps, anchors, offsets) {\n const width = $.width,\n height = $.height,\n bm0 = bitmaps[0],\n bm1 = bitmaps[1],\n n = offsets.length;\n return function (d) {\n var _d$textWidth;\n\n const boundary = d.boundary,\n textHeight = d.datum.fontSize; // can not be placed if the mark is not visible in the graph bound\n\n if (boundary[2] < 0 || boundary[5] < 0 || boundary[0] > width || boundary[3] > height) {\n return false;\n }\n\n let textWidth = (_d$textWidth = d.textWidth) !== null && _d$textWidth !== void 0 ? _d$textWidth : 0,\n dx,\n dy,\n isInside,\n sizeFactor,\n insideFactor,\n x1,\n x2,\n y1,\n y2,\n xc,\n yc,\n _x1,\n _x2,\n _y1,\n _y2; // for each anchor and offset\n\n\n for (let i = 0; i < n; ++i) {\n dx = (anchors[i] & 0x3) - 1;\n dy = (anchors[i] >>> 0x2 & 0x3) - 1;\n isInside = dx === 0 && dy === 0 || offsets[i] < 0;\n sizeFactor = dx && dy ? Math.SQRT1_2 : 1;\n insideFactor = offsets[i] < 0 ? -1 : 1;\n x1 = boundary[1 + dx] + offsets[i] * dx * sizeFactor;\n yc = boundary[4 + dy] + insideFactor * textHeight * dy / 2 + offsets[i] * dy * sizeFactor;\n y1 = yc - textHeight / 2;\n y2 = yc + textHeight / 2;\n _x1 = $(x1);\n _y1 = $(y1);\n _y2 = $(y2);\n\n if (!textWidth) {\n // to avoid finding width of text label,\n if (!test(_x1, _x1, _y1, _y2, bm0, bm1, x1, x1, y1, y2, boundary, isInside)) {\n // skip this anchor/offset option if we fail to place a label with 1px width\n continue;\n } else {\n // Otherwise, find the label width\n textWidth = textMetrics.width(d.datum, d.datum.text);\n }\n }\n\n xc = x1 + insideFactor * textWidth * dx / 2;\n x1 = xc - textWidth / 2;\n x2 = xc + textWidth / 2;\n _x1 = $(x1);\n _x2 = $(x2);\n\n if (test(_x1, _x2, _y1, _y2, bm0, bm1, x1, x2, y1, y2, boundary, isInside)) {\n // place label if the position is placeable\n d.x = !dx ? xc : dx * insideFactor < 0 ? x2 : x1;\n d.y = !dy ? yc : dy * insideFactor < 0 ? y2 : y1;\n d.align = Aligns[dx * insideFactor + 1];\n d.baseline = Baselines[dy * insideFactor + 1];\n bm0.setRange(_x1, _y1, _x2, _y2);\n return true;\n }\n }\n\n return false;\n };\n} // Test if a label with the given dimensions can be added without overlap\n\nfunction test(_x1, _x2, _y1, _y2, bm0, bm1, x1, x2, y1, y2, boundary, isInside) {\n return !(bm0.outOfBounds(_x1, _y1, _x2, _y2) || (isInside && bm1 || bm0).getRange(_x1, _y1, _x2, _y2));\n}\n\nconst TOP = 0x0,\n MIDDLE = 0x4,\n BOTTOM = 0x8,\n LEFT = 0x0,\n CENTER = 0x1,\n RIGHT = 0x2; // Mapping from text anchor to number representation\n\nconst anchorCode = {\n 'top-left': TOP + LEFT,\n 'top': TOP + CENTER,\n 'top-right': TOP + RIGHT,\n 'left': MIDDLE + LEFT,\n 'middle': MIDDLE + CENTER,\n 'right': MIDDLE + RIGHT,\n 'bottom-left': BOTTOM + LEFT,\n 'bottom': BOTTOM + CENTER,\n 'bottom-right': BOTTOM + RIGHT\n};\nconst placeAreaLabel = {\n 'naive': placeAreaLabelNaive,\n 'reduced-search': placeAreaLabelReducedSearch,\n 'floodfill': placeAreaLabelFloodFill\n};\nfunction labelLayout (texts, size, compare, offset, anchor, avoidMarks, avoidBaseMark, lineAnchor, markIndex, padding, method) {\n // early exit for empty data\n if (!texts.length) return texts;\n const positions = Math.max(offset.length, anchor.length),\n offsets = getOffsets(offset, positions),\n anchors = getAnchors(anchor, positions),\n marktype = markType(texts[0].datum),\n grouptype = marktype === 'group' && texts[0].datum.items[markIndex].marktype,\n isGroupArea = grouptype === 'area',\n boundary = markBoundary(marktype, grouptype, lineAnchor, markIndex),\n infPadding = padding === null || padding === Infinity,\n isNaiveGroupArea = isGroupArea && method === 'naive';\n let maxTextWidth = -1,\n maxTextHeight = -1; // prepare text mark data for placing\n\n const data = texts.map(d => {\n const textWidth = infPadding ? textMetrics.width(d, d.text) : undefined;\n maxTextWidth = Math.max(maxTextWidth, textWidth);\n maxTextHeight = Math.max(maxTextHeight, d.fontSize);\n return {\n datum: d,\n opacity: 0,\n x: undefined,\n y: undefined,\n align: undefined,\n baseline: undefined,\n boundary: boundary(d),\n textWidth\n };\n });\n padding = padding === null || padding === Infinity ? Math.max(maxTextWidth, maxTextHeight) + Math.max(...offset) : padding;\n const $ = scaler(size[0], size[1], padding);\n let bitmaps;\n\n if (!isNaiveGroupArea) {\n // sort labels in priority order, if comparator is provided\n if (compare) {\n data.sort((a, b) => compare(a.datum, b.datum));\n } // flag indicating if label can be placed inside its base mark\n\n\n let labelInside = false;\n\n for (let i = 0; i < anchors.length && !labelInside; ++i) {\n // label inside if anchor is at center\n // label inside if offset to be inside the mark bound\n labelInside = anchors[i] === 0x5 || offsets[i] < 0;\n } // extract data information from base mark when base mark is to be avoided\n // base mark is implicitly avoided if it is a group area\n\n\n const baseMark = (marktype && avoidBaseMark || isGroupArea) && texts.map(d => d.datum); // generate bitmaps for layout calculation\n\n bitmaps = avoidMarks.length || baseMark ? markBitmaps($, baseMark || [], avoidMarks, labelInside, isGroupArea) : baseBitmaps($, avoidBaseMark && data);\n } // generate label placement function\n\n\n const place = isGroupArea ? placeAreaLabel[method]($, bitmaps, avoidBaseMark, markIndex) : placeMarkLabel($, bitmaps, anchors, offsets); // place all labels\n\n data.forEach(d => d.opacity = +place(d));\n return data;\n}\n\nfunction getOffsets(_, count) {\n const offsets = new Float64Array(count),\n n = _.length;\n\n for (let i = 0; i < n; ++i) offsets[i] = _[i] || 0;\n\n for (let i = n; i < count; ++i) offsets[i] = offsets[n - 1];\n\n return offsets;\n}\n\nfunction getAnchors(_, count) {\n const anchors = new Int8Array(count),\n n = _.length;\n\n for (let i = 0; i < n; ++i) anchors[i] |= anchorCode[_[i]];\n\n for (let i = n; i < count; ++i) anchors[i] = anchors[n - 1];\n\n return anchors;\n}\n\nfunction markType(item) {\n return item && item.mark && item.mark.marktype;\n}\n/**\n * Factory function for function for getting base mark boundary, depending\n * on mark and group type. When mark type is undefined, line or area: boundary\n * is the coordinate of each data point. When base mark is grouped line,\n * boundary is either at the start or end of the line depending on the\n * value of lineAnchor. Otherwise, use bounds of base mark.\n */\n\n\nfunction markBoundary(marktype, grouptype, lineAnchor, markIndex) {\n const xy = d => [d.x, d.x, d.x, d.y, d.y, d.y];\n\n if (!marktype) {\n return xy; // no reactive geometry\n } else if (marktype === 'line' || marktype === 'area') {\n return d => xy(d.datum);\n } else if (grouptype === 'line') {\n return d => {\n const items = d.datum.items[markIndex].items;\n return xy(items.length ? items[lineAnchor === 'start' ? 0 : items.length - 1] : {\n x: NaN,\n y: NaN\n });\n };\n } else {\n return d => {\n const b = d.datum.bounds;\n return [b.x1, (b.x1 + b.x2) / 2, b.x2, b.y1, (b.y1 + b.y2) / 2, b.y2];\n };\n }\n}\n\nconst Output = ['x', 'y', 'opacity', 'align', 'baseline'];\nconst Anchors = ['top-left', 'left', 'bottom-left', 'top', 'bottom', 'top-right', 'right', 'bottom-right'];\n/**\n * Compute text label layout to annotate marks.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} params.size - The size of the layout, provided as a [width, height] array.\n * @param {function(*,*): number} [params.sort] - An optional\n * comparator function for sorting label data in priority order.\n * @param {Array} [params.anchor] - Label anchor points relative to the base mark bounding box.\n * The available options are 'top-left', 'left', 'bottom-left', 'top',\n * 'bottom', 'top-right', 'right', 'bottom-right', 'middle'.\n * @param {Array} [params.offset] - Label offsets (in pixels) from the base mark bounding box.\n * This parameter is parallel to the list of anchor points.\n * @param {number | null} [params.padding=0] - The amount (in pixels) that a label may exceed the layout size.\n * If this parameter is null, a label may exceed the layout size without any boundary.\n * @param {string} [params.lineAnchor='end'] - For group line mark labels only, indicates the anchor\n * position for labels. One of 'start' or 'end'.\n * @param {string} [params.markIndex=0] - For group mark labels only, an index indicating\n * which mark within the group should be labeled.\n * @param {Array} [params.avoidMarks] - A list of additional mark names for which the label\n * layout should avoid overlap.\n * @param {boolean} [params.avoidBaseMark=true] - Boolean flag indicating if labels should avoid\n * overlap with the underlying base mark being labeled.\n * @param {string} [params.method='naive'] - For area make labels only, a method for\n * place labels. One of 'naive', 'reduced-search', or 'floodfill'.\n * @param {Array} [params.as] - The output fields written by the transform.\n * The default is ['x', 'y', 'opacity', 'align', 'baseline'].\n */\n\nfunction Label(params) {\n Transform.call(this, null, params);\n}\nLabel.Definition = {\n type: 'Label',\n metadata: {\n modifies: true\n },\n params: [{\n name: 'size',\n type: 'number',\n array: true,\n length: 2,\n required: true\n }, {\n name: 'sort',\n type: 'compare'\n }, {\n name: 'anchor',\n type: 'string',\n array: true,\n default: Anchors\n }, {\n name: 'offset',\n type: 'number',\n array: true,\n default: [1]\n }, {\n name: 'padding',\n type: 'number',\n default: 0,\n null: true\n }, {\n name: 'lineAnchor',\n type: 'string',\n values: ['start', 'end'],\n default: 'end'\n }, {\n name: 'markIndex',\n type: 'number',\n default: 0\n }, {\n name: 'avoidBaseMark',\n type: 'boolean',\n default: true\n }, {\n name: 'avoidMarks',\n type: 'data',\n array: true\n }, {\n name: 'method',\n type: 'string',\n default: 'naive'\n }, {\n name: 'as',\n type: 'string',\n array: true,\n length: Output.length,\n default: Output\n }]\n};\ninherits(Label, Transform, {\n transform(_, pulse) {\n function modp(param) {\n const p = _[param];\n return isFunction(p) && pulse.modified(p.fields);\n }\n\n const mod = _.modified();\n\n if (!(mod || pulse.changed(pulse.ADD_REM) || modp('sort'))) return;\n\n if (!_.size || _.size.length !== 2) {\n error('Size parameter should be specified as a [width, height] array.');\n }\n\n const as = _.as || Output; // run label layout\n\n labelLayout(pulse.materialize(pulse.SOURCE).source || [], _.size, _.sort, array(_.offset == null ? 1 : _.offset), array(_.anchor || Anchors), _.avoidMarks || [], _.avoidBaseMark !== false, _.lineAnchor || 'end', _.markIndex || 0, _.padding === undefined ? 0 : _.padding, _.method || 'naive').forEach(l => {\n // write layout results to data stream\n const t = l.datum;\n t[as[0]] = l.x;\n t[as[1]] = l.y;\n t[as[2]] = l.opacity;\n t[as[3]] = l.align;\n t[as[4]] = l.baseline;\n });\n return pulse.reflow(mod).modifies(as);\n }\n\n});\n\nexport { Label as label };\n","import { regressionLoess, sampleCurve, regressionLinear, regressionLog, regressionExp, regressionPow, regressionQuad, regressionPoly } from 'vega-statistics';\nimport { Transform, ingest } from 'vega-dataflow';\nimport { inherits, accessorName, hasOwnProperty, error, extent } from 'vega-util';\n\nfunction partition (data, groupby) {\n var groups = [],\n get = function (f) {\n return f(t);\n },\n map,\n i,\n n,\n t,\n k,\n g; // partition data points into stack groups\n\n\n if (groupby == null) {\n groups.push(data);\n } else {\n for (map = {}, i = 0, n = data.length; i < n; ++i) {\n t = data[i];\n k = groupby.map(get);\n g = map[k];\n\n if (!g) {\n map[k] = g = [];\n g.dims = k;\n groups.push(g);\n }\n\n g.push(t);\n }\n }\n\n return groups;\n}\n\n/**\n * Compute locally-weighted regression fits for one or more data groups.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.x - An accessor for the predictor data field.\n * @param {function(object): *} params.y - An accessor for the predicted data field.\n * @param {Array} [params.groupby] - An array of accessors to groupby.\n * @param {number} [params.bandwidth=0.3] - The loess bandwidth.\n */\n\nfunction Loess(params) {\n Transform.call(this, null, params);\n}\nLoess.Definition = {\n 'type': 'Loess',\n 'metadata': {\n 'generates': true\n },\n 'params': [{\n 'name': 'x',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'y',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'bandwidth',\n 'type': 'number',\n 'default': 0.3\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true\n }]\n};\ninherits(Loess, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS);\n\n if (!this.value || pulse.changed() || _.modified()) {\n const source = pulse.materialize(pulse.SOURCE).source,\n groups = partition(source, _.groupby),\n names = (_.groupby || []).map(accessorName),\n m = names.length,\n as = _.as || [accessorName(_.x), accessorName(_.y)],\n values = [];\n groups.forEach(g => {\n regressionLoess(g, _.x, _.y, _.bandwidth || 0.3).forEach(p => {\n const t = {};\n\n for (let i = 0; i < m; ++i) {\n t[names[i]] = g.dims[i];\n }\n\n t[as[0]] = p[0];\n t[as[1]] = p[1];\n values.push(ingest(t));\n });\n });\n if (this.value) out.rem = this.value;\n this.value = out.add = out.source = values;\n }\n\n return out;\n }\n\n});\n\nconst Methods = {\n linear: regressionLinear,\n log: regressionLog,\n exp: regressionExp,\n pow: regressionPow,\n quad: regressionQuad,\n poly: regressionPoly\n};\n\nconst degreesOfFreedom = (method, order) => method === 'poly' ? order : method === 'quad' ? 2 : 1;\n/**\n * Compute regression fits for one or more data groups.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.x - An accessor for the predictor data field.\n * @param {function(object): *} params.y - An accessor for the predicted data field.\n * @param {string} [params.method='linear'] - The regression method to apply.\n * @param {Array} [params.groupby] - An array of accessors to groupby.\n * @param {Array} [params.extent] - The domain extent over which to plot the regression line.\n * @param {number} [params.order=3] - The polynomial order. Only applies to the 'poly' method.\n */\n\n\nfunction Regression(params) {\n Transform.call(this, null, params);\n}\nRegression.Definition = {\n 'type': 'Regression',\n 'metadata': {\n 'generates': true\n },\n 'params': [{\n 'name': 'x',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'y',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'method',\n 'type': 'string',\n 'default': 'linear',\n 'values': Object.keys(Methods)\n }, {\n 'name': 'order',\n 'type': 'number',\n 'default': 3\n }, {\n 'name': 'extent',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'params',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true\n }]\n};\ninherits(Regression, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS);\n\n if (!this.value || pulse.changed() || _.modified()) {\n const source = pulse.materialize(pulse.SOURCE).source,\n groups = partition(source, _.groupby),\n names = (_.groupby || []).map(accessorName),\n method = _.method || 'linear',\n order = _.order || 3,\n dof = degreesOfFreedom(method, order),\n as = _.as || [accessorName(_.x), accessorName(_.y)],\n fit = Methods[method],\n values = [];\n let domain = _.extent;\n\n if (!hasOwnProperty(Methods, method)) {\n error('Invalid regression method: ' + method);\n }\n\n if (domain != null) {\n if (method === 'log' && domain[0] <= 0) {\n pulse.dataflow.warn('Ignoring extent with values <= 0 for log regression.');\n domain = null;\n }\n }\n\n groups.forEach(g => {\n const n = g.length;\n\n if (n <= dof) {\n pulse.dataflow.warn('Skipping regression with more parameters than data points.');\n return;\n }\n\n const model = fit(g, _.x, _.y, order);\n\n if (_.params) {\n // if parameter vectors requested return those\n values.push(ingest({\n keys: g.dims,\n coef: model.coef,\n rSquared: model.rSquared\n }));\n return;\n }\n\n const dom = domain || extent(g, _.x),\n add = p => {\n const t = {};\n\n for (let i = 0; i < names.length; ++i) {\n t[names[i]] = g.dims[i];\n }\n\n t[as[0]] = p[0];\n t[as[1]] = p[1];\n values.push(ingest(t));\n };\n\n if (method === 'linear') {\n // for linear regression we only need the end points\n dom.forEach(x => add([x, model.predict(x)]));\n } else {\n // otherwise return trend line sample points\n sampleCurve(model.predict, dom, 25, 200).forEach(add);\n }\n });\n if (this.value) out.rem = this.value;\n this.value = out.add = out.source = values;\n }\n\n return out;\n }\n\n});\n\nexport { Loess as loess, Regression as regression };\n","export const epsilon = 1.1102230246251565e-16;\nexport const splitter = 134217729;\nexport const resulterrbound = (3 + 8 * epsilon) * epsilon;\n\n// fast_expansion_sum_zeroelim routine from oritinal code\nexport function sum(elen, e, flen, f, h) {\n let Q, Qnew, hh, bvirt;\n let enow = e[0];\n let fnow = f[0];\n let eindex = 0;\n let findex = 0;\n if ((fnow > enow) === (fnow > -enow)) {\n Q = enow;\n enow = e[++eindex];\n } else {\n Q = fnow;\n fnow = f[++findex];\n }\n let hindex = 0;\n if (eindex < elen && findex < flen) {\n if ((fnow > enow) === (fnow > -enow)) {\n Qnew = enow + Q;\n hh = Q - (Qnew - enow);\n enow = e[++eindex];\n } else {\n Qnew = fnow + Q;\n hh = Q - (Qnew - fnow);\n fnow = f[++findex];\n }\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n while (eindex < elen && findex < flen) {\n if ((fnow > enow) === (fnow > -enow)) {\n Qnew = Q + enow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (enow - bvirt);\n enow = e[++eindex];\n } else {\n Qnew = Q + fnow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (fnow - bvirt);\n fnow = f[++findex];\n }\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n }\n }\n while (eindex < elen) {\n Qnew = Q + enow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (enow - bvirt);\n enow = e[++eindex];\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n }\n while (findex < flen) {\n Qnew = Q + fnow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (fnow - bvirt);\n fnow = f[++findex];\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n }\n if (Q !== 0 || hindex === 0) {\n h[hindex++] = Q;\n }\n return hindex;\n}\n\nexport function sum_three(alen, a, blen, b, clen, c, tmp, out) {\n return sum(sum(alen, a, blen, b, tmp), tmp, clen, c, out);\n}\n\n// scale_expansion_zeroelim routine from oritinal code\nexport function scale(elen, e, b, h) {\n let Q, sum, hh, product1, product0;\n let bvirt, c, ahi, alo, bhi, blo;\n\n c = splitter * b;\n bhi = c - (c - b);\n blo = b - bhi;\n let enow = e[0];\n Q = enow * b;\n c = splitter * enow;\n ahi = c - (c - enow);\n alo = enow - ahi;\n hh = alo * blo - (Q - ahi * bhi - alo * bhi - ahi * blo);\n let hindex = 0;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n for (let i = 1; i < elen; i++) {\n enow = e[i];\n product1 = enow * b;\n c = splitter * enow;\n ahi = c - (c - enow);\n alo = enow - ahi;\n product0 = alo * blo - (product1 - ahi * bhi - alo * bhi - ahi * blo);\n sum = Q + product0;\n bvirt = sum - Q;\n hh = Q - (sum - bvirt) + (product0 - bvirt);\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n Q = product1 + sum;\n hh = sum - (Q - product1);\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n }\n if (Q !== 0 || hindex === 0) {\n h[hindex++] = Q;\n }\n return hindex;\n}\n\nexport function negate(elen, e) {\n for (let i = 0; i < elen; i++) e[i] = -e[i];\n return elen;\n}\n\nexport function estimate(elen, e) {\n let Q = e[0];\n for (let i = 1; i < elen; i++) Q += e[i];\n return Q;\n}\n\nexport function vec(n) {\n return new Float64Array(n);\n}\n","import {epsilon, splitter, resulterrbound, estimate, vec, sum} from './util.js';\n\nconst ccwerrboundA = (3 + 16 * epsilon) * epsilon;\nconst ccwerrboundB = (2 + 12 * epsilon) * epsilon;\nconst ccwerrboundC = (9 + 64 * epsilon) * epsilon * epsilon;\n\nconst B = vec(4);\nconst C1 = vec(8);\nconst C2 = vec(12);\nconst D = vec(16);\nconst u = vec(4);\n\nfunction orient2dadapt(ax, ay, bx, by, cx, cy, detsum) {\n let acxtail, acytail, bcxtail, bcytail;\n let bvirt, c, ahi, alo, bhi, blo, _i, _j, _0, s1, s0, t1, t0, u3;\n\n const acx = ax - cx;\n const bcx = bx - cx;\n const acy = ay - cy;\n const bcy = by - cy;\n\n s1 = acx * bcy;\n c = splitter * acx;\n ahi = c - (c - acx);\n alo = acx - ahi;\n c = splitter * bcy;\n bhi = c - (c - bcy);\n blo = bcy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = acy * bcx;\n c = splitter * acy;\n ahi = c - (c - acy);\n alo = acy - ahi;\n c = splitter * bcx;\n bhi = c - (c - bcx);\n blo = bcx - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n B[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n B[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n B[2] = _j - (u3 - bvirt) + (_i - bvirt);\n B[3] = u3;\n\n let det = estimate(4, B);\n let errbound = ccwerrboundB * detsum;\n if (det >= errbound || -det >= errbound) {\n return det;\n }\n\n bvirt = ax - acx;\n acxtail = ax - (acx + bvirt) + (bvirt - cx);\n bvirt = bx - bcx;\n bcxtail = bx - (bcx + bvirt) + (bvirt - cx);\n bvirt = ay - acy;\n acytail = ay - (acy + bvirt) + (bvirt - cy);\n bvirt = by - bcy;\n bcytail = by - (bcy + bvirt) + (bvirt - cy);\n\n if (acxtail === 0 && acytail === 0 && bcxtail === 0 && bcytail === 0) {\n return det;\n }\n\n errbound = ccwerrboundC * detsum + resulterrbound * Math.abs(det);\n det += (acx * bcytail + bcy * acxtail) - (acy * bcxtail + bcx * acytail);\n if (det >= errbound || -det >= errbound) return det;\n\n s1 = acxtail * bcy;\n c = splitter * acxtail;\n ahi = c - (c - acxtail);\n alo = acxtail - ahi;\n c = splitter * bcy;\n bhi = c - (c - bcy);\n blo = bcy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = acytail * bcx;\n c = splitter * acytail;\n ahi = c - (c - acytail);\n alo = acytail - ahi;\n c = splitter * bcx;\n bhi = c - (c - bcx);\n blo = bcx - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n u[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n u[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n u[2] = _j - (u3 - bvirt) + (_i - bvirt);\n u[3] = u3;\n const C1len = sum(4, B, 4, u, C1);\n\n s1 = acx * bcytail;\n c = splitter * acx;\n ahi = c - (c - acx);\n alo = acx - ahi;\n c = splitter * bcytail;\n bhi = c - (c - bcytail);\n blo = bcytail - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = acy * bcxtail;\n c = splitter * acy;\n ahi = c - (c - acy);\n alo = acy - ahi;\n c = splitter * bcxtail;\n bhi = c - (c - bcxtail);\n blo = bcxtail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n u[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n u[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n u[2] = _j - (u3 - bvirt) + (_i - bvirt);\n u[3] = u3;\n const C2len = sum(C1len, C1, 4, u, C2);\n\n s1 = acxtail * bcytail;\n c = splitter * acxtail;\n ahi = c - (c - acxtail);\n alo = acxtail - ahi;\n c = splitter * bcytail;\n bhi = c - (c - bcytail);\n blo = bcytail - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = acytail * bcxtail;\n c = splitter * acytail;\n ahi = c - (c - acytail);\n alo = acytail - ahi;\n c = splitter * bcxtail;\n bhi = c - (c - bcxtail);\n blo = bcxtail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n u[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n u[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n u[2] = _j - (u3 - bvirt) + (_i - bvirt);\n u[3] = u3;\n const Dlen = sum(C2len, C2, 4, u, D);\n\n return D[Dlen - 1];\n}\n\nexport function orient2d(ax, ay, bx, by, cx, cy) {\n const detleft = (ay - cy) * (bx - cx);\n const detright = (ax - cx) * (by - cy);\n const det = detleft - detright;\n\n if (detleft === 0 || detright === 0 || (detleft > 0) !== (detright > 0)) return det;\n\n const detsum = Math.abs(detleft + detright);\n if (Math.abs(det) >= ccwerrboundA * detsum) return det;\n\n return -orient2dadapt(ax, ay, bx, by, cx, cy, detsum);\n}\n\nexport function orient2dfast(ax, ay, bx, by, cx, cy) {\n return (ay - cy) * (bx - cx) - (ax - cx) * (by - cy);\n}\n","\nconst EPSILON = Math.pow(2, -52);\nconst EDGE_STACK = new Uint32Array(512);\n\nimport {orient2d} from 'robust-predicates';\n\nexport default class Delaunator {\n\n static from(points, getX = defaultGetX, getY = defaultGetY) {\n const n = points.length;\n const coords = new Float64Array(n * 2);\n\n for (let i = 0; i < n; i++) {\n const p = points[i];\n coords[2 * i] = getX(p);\n coords[2 * i + 1] = getY(p);\n }\n\n return new Delaunator(coords);\n }\n\n constructor(coords) {\n const n = coords.length >> 1;\n if (n > 0 && typeof coords[0] !== 'number') throw new Error('Expected coords to contain numbers.');\n\n this.coords = coords;\n\n // arrays that will store the triangulation graph\n const maxTriangles = Math.max(2 * n - 5, 0);\n this._triangles = new Uint32Array(maxTriangles * 3);\n this._halfedges = new Int32Array(maxTriangles * 3);\n\n // temporary arrays for tracking the edges of the advancing convex hull\n this._hashSize = Math.ceil(Math.sqrt(n));\n this._hullPrev = new Uint32Array(n); // edge to prev edge\n this._hullNext = new Uint32Array(n); // edge to next edge\n this._hullTri = new Uint32Array(n); // edge to adjacent triangle\n this._hullHash = new Int32Array(this._hashSize).fill(-1); // angular edge hash\n\n // temporary arrays for sorting points\n this._ids = new Uint32Array(n);\n this._dists = new Float64Array(n);\n\n this.update();\n }\n\n update() {\n const {coords, _hullPrev: hullPrev, _hullNext: hullNext, _hullTri: hullTri, _hullHash: hullHash} = this;\n const n = coords.length >> 1;\n\n // populate an array of point indices; calculate input data bbox\n let minX = Infinity;\n let minY = Infinity;\n let maxX = -Infinity;\n let maxY = -Infinity;\n\n for (let i = 0; i < n; i++) {\n const x = coords[2 * i];\n const y = coords[2 * i + 1];\n if (x < minX) minX = x;\n if (y < minY) minY = y;\n if (x > maxX) maxX = x;\n if (y > maxY) maxY = y;\n this._ids[i] = i;\n }\n const cx = (minX + maxX) / 2;\n const cy = (minY + maxY) / 2;\n\n let minDist = Infinity;\n let i0, i1, i2;\n\n // pick a seed point close to the center\n for (let i = 0; i < n; i++) {\n const d = dist(cx, cy, coords[2 * i], coords[2 * i + 1]);\n if (d < minDist) {\n i0 = i;\n minDist = d;\n }\n }\n const i0x = coords[2 * i0];\n const i0y = coords[2 * i0 + 1];\n\n minDist = Infinity;\n\n // find the point closest to the seed\n for (let i = 0; i < n; i++) {\n if (i === i0) continue;\n const d = dist(i0x, i0y, coords[2 * i], coords[2 * i + 1]);\n if (d < minDist && d > 0) {\n i1 = i;\n minDist = d;\n }\n }\n let i1x = coords[2 * i1];\n let i1y = coords[2 * i1 + 1];\n\n let minRadius = Infinity;\n\n // find the third point which forms the smallest circumcircle with the first two\n for (let i = 0; i < n; i++) {\n if (i === i0 || i === i1) continue;\n const r = circumradius(i0x, i0y, i1x, i1y, coords[2 * i], coords[2 * i + 1]);\n if (r < minRadius) {\n i2 = i;\n minRadius = r;\n }\n }\n let i2x = coords[2 * i2];\n let i2y = coords[2 * i2 + 1];\n\n if (minRadius === Infinity) {\n // order collinear points by dx (or dy if all x are identical)\n // and return the list as a hull\n for (let i = 0; i < n; i++) {\n this._dists[i] = (coords[2 * i] - coords[0]) || (coords[2 * i + 1] - coords[1]);\n }\n quicksort(this._ids, this._dists, 0, n - 1);\n const hull = new Uint32Array(n);\n let j = 0;\n for (let i = 0, d0 = -Infinity; i < n; i++) {\n const id = this._ids[i];\n if (this._dists[id] > d0) {\n hull[j++] = id;\n d0 = this._dists[id];\n }\n }\n this.hull = hull.subarray(0, j);\n this.triangles = new Uint32Array(0);\n this.halfedges = new Uint32Array(0);\n return;\n }\n\n // swap the order of the seed points for counter-clockwise orientation\n if (orient2d(i0x, i0y, i1x, i1y, i2x, i2y) < 0) {\n const i = i1;\n const x = i1x;\n const y = i1y;\n i1 = i2;\n i1x = i2x;\n i1y = i2y;\n i2 = i;\n i2x = x;\n i2y = y;\n }\n\n const center = circumcenter(i0x, i0y, i1x, i1y, i2x, i2y);\n this._cx = center.x;\n this._cy = center.y;\n\n for (let i = 0; i < n; i++) {\n this._dists[i] = dist(coords[2 * i], coords[2 * i + 1], center.x, center.y);\n }\n\n // sort the points by distance from the seed triangle circumcenter\n quicksort(this._ids, this._dists, 0, n - 1);\n\n // set up the seed triangle as the starting hull\n this._hullStart = i0;\n let hullSize = 3;\n\n hullNext[i0] = hullPrev[i2] = i1;\n hullNext[i1] = hullPrev[i0] = i2;\n hullNext[i2] = hullPrev[i1] = i0;\n\n hullTri[i0] = 0;\n hullTri[i1] = 1;\n hullTri[i2] = 2;\n\n hullHash.fill(-1);\n hullHash[this._hashKey(i0x, i0y)] = i0;\n hullHash[this._hashKey(i1x, i1y)] = i1;\n hullHash[this._hashKey(i2x, i2y)] = i2;\n\n this.trianglesLen = 0;\n this._addTriangle(i0, i1, i2, -1, -1, -1);\n\n for (let k = 0, xp, yp; k < this._ids.length; k++) {\n const i = this._ids[k];\n const x = coords[2 * i];\n const y = coords[2 * i + 1];\n\n // skip near-duplicate points\n if (k > 0 && Math.abs(x - xp) <= EPSILON && Math.abs(y - yp) <= EPSILON) continue;\n xp = x;\n yp = y;\n\n // skip seed triangle points\n if (i === i0 || i === i1 || i === i2) continue;\n\n // find a visible edge on the convex hull using edge hash\n let start = 0;\n for (let j = 0, key = this._hashKey(x, y); j < this._hashSize; j++) {\n start = hullHash[(key + j) % this._hashSize];\n if (start !== -1 && start !== hullNext[start]) break;\n }\n\n start = hullPrev[start];\n let e = start, q;\n while (q = hullNext[e], orient2d(x, y, coords[2 * e], coords[2 * e + 1], coords[2 * q], coords[2 * q + 1]) >= 0) {\n e = q;\n if (e === start) {\n e = -1;\n break;\n }\n }\n if (e === -1) continue; // likely a near-duplicate point; skip it\n\n // add the first triangle from the point\n let t = this._addTriangle(e, i, hullNext[e], -1, -1, hullTri[e]);\n\n // recursively flip triangles from the point until they satisfy the Delaunay condition\n hullTri[i] = this._legalize(t + 2);\n hullTri[e] = t; // keep track of boundary triangles on the hull\n hullSize++;\n\n // walk forward through the hull, adding more triangles and flipping recursively\n let n = hullNext[e];\n while (q = hullNext[n], orient2d(x, y, coords[2 * n], coords[2 * n + 1], coords[2 * q], coords[2 * q + 1]) < 0) {\n t = this._addTriangle(n, i, q, hullTri[i], -1, hullTri[n]);\n hullTri[i] = this._legalize(t + 2);\n hullNext[n] = n; // mark as removed\n hullSize--;\n n = q;\n }\n\n // walk backward from the other side, adding more triangles and flipping\n if (e === start) {\n while (q = hullPrev[e], orient2d(x, y, coords[2 * q], coords[2 * q + 1], coords[2 * e], coords[2 * e + 1]) < 0) {\n t = this._addTriangle(q, i, e, -1, hullTri[e], hullTri[q]);\n this._legalize(t + 2);\n hullTri[q] = t;\n hullNext[e] = e; // mark as removed\n hullSize--;\n e = q;\n }\n }\n\n // update the hull indices\n this._hullStart = hullPrev[i] = e;\n hullNext[e] = hullPrev[n] = i;\n hullNext[i] = n;\n\n // save the two new edges in the hash table\n hullHash[this._hashKey(x, y)] = i;\n hullHash[this._hashKey(coords[2 * e], coords[2 * e + 1])] = e;\n }\n\n this.hull = new Uint32Array(hullSize);\n for (let i = 0, e = this._hullStart; i < hullSize; i++) {\n this.hull[i] = e;\n e = hullNext[e];\n }\n\n // trim typed triangle mesh arrays\n this.triangles = this._triangles.subarray(0, this.trianglesLen);\n this.halfedges = this._halfedges.subarray(0, this.trianglesLen);\n }\n\n _hashKey(x, y) {\n return Math.floor(pseudoAngle(x - this._cx, y - this._cy) * this._hashSize) % this._hashSize;\n }\n\n _legalize(a) {\n const {_triangles: triangles, _halfedges: halfedges, coords} = this;\n\n let i = 0;\n let ar = 0;\n\n // recursion eliminated with a fixed-size stack\n while (true) {\n const b = halfedges[a];\n\n /* if the pair of triangles doesn't satisfy the Delaunay condition\n * (p1 is inside the circumcircle of [p0, pl, pr]), flip them,\n * then do the same check/flip recursively for the new pair of triangles\n *\n * pl pl\n * /||\\ / \\\n * al/ || \\bl al/ \\a\n * / || \\ / \\\n * / a||b \\ flip /___ar___\\\n * p0\\ || /p1 => p0\\---bl---/p1\n * \\ || / \\ /\n * ar\\ || /br b\\ /br\n * \\||/ \\ /\n * pr pr\n */\n const a0 = a - a % 3;\n ar = a0 + (a + 2) % 3;\n\n if (b === -1) { // convex hull edge\n if (i === 0) break;\n a = EDGE_STACK[--i];\n continue;\n }\n\n const b0 = b - b % 3;\n const al = a0 + (a + 1) % 3;\n const bl = b0 + (b + 2) % 3;\n\n const p0 = triangles[ar];\n const pr = triangles[a];\n const pl = triangles[al];\n const p1 = triangles[bl];\n\n const illegal = inCircle(\n coords[2 * p0], coords[2 * p0 + 1],\n coords[2 * pr], coords[2 * pr + 1],\n coords[2 * pl], coords[2 * pl + 1],\n coords[2 * p1], coords[2 * p1 + 1]);\n\n if (illegal) {\n triangles[a] = p1;\n triangles[b] = p0;\n\n const hbl = halfedges[bl];\n\n // edge swapped on the other side of the hull (rare); fix the halfedge reference\n if (hbl === -1) {\n let e = this._hullStart;\n do {\n if (this._hullTri[e] === bl) {\n this._hullTri[e] = a;\n break;\n }\n e = this._hullPrev[e];\n } while (e !== this._hullStart);\n }\n this._link(a, hbl);\n this._link(b, halfedges[ar]);\n this._link(ar, bl);\n\n const br = b0 + (b + 1) % 3;\n\n // don't worry about hitting the cap: it can only happen on extremely degenerate input\n if (i < EDGE_STACK.length) {\n EDGE_STACK[i++] = br;\n }\n } else {\n if (i === 0) break;\n a = EDGE_STACK[--i];\n }\n }\n\n return ar;\n }\n\n _link(a, b) {\n this._halfedges[a] = b;\n if (b !== -1) this._halfedges[b] = a;\n }\n\n // add a new triangle given vertex indices and adjacent half-edge ids\n _addTriangle(i0, i1, i2, a, b, c) {\n const t = this.trianglesLen;\n\n this._triangles[t] = i0;\n this._triangles[t + 1] = i1;\n this._triangles[t + 2] = i2;\n\n this._link(t, a);\n this._link(t + 1, b);\n this._link(t + 2, c);\n\n this.trianglesLen += 3;\n\n return t;\n }\n}\n\n// monotonically increases with real angle, but doesn't need expensive trigonometry\nfunction pseudoAngle(dx, dy) {\n const p = dx / (Math.abs(dx) + Math.abs(dy));\n return (dy > 0 ? 3 - p : 1 + p) / 4; // [0..1]\n}\n\nfunction dist(ax, ay, bx, by) {\n const dx = ax - bx;\n const dy = ay - by;\n return dx * dx + dy * dy;\n}\n\nfunction inCircle(ax, ay, bx, by, cx, cy, px, py) {\n const dx = ax - px;\n const dy = ay - py;\n const ex = bx - px;\n const ey = by - py;\n const fx = cx - px;\n const fy = cy - py;\n\n const ap = dx * dx + dy * dy;\n const bp = ex * ex + ey * ey;\n const cp = fx * fx + fy * fy;\n\n return dx * (ey * cp - bp * fy) -\n dy * (ex * cp - bp * fx) +\n ap * (ex * fy - ey * fx) < 0;\n}\n\nfunction circumradius(ax, ay, bx, by, cx, cy) {\n const dx = bx - ax;\n const dy = by - ay;\n const ex = cx - ax;\n const ey = cy - ay;\n\n const bl = dx * dx + dy * dy;\n const cl = ex * ex + ey * ey;\n const d = 0.5 / (dx * ey - dy * ex);\n\n const x = (ey * bl - dy * cl) * d;\n const y = (dx * cl - ex * bl) * d;\n\n return x * x + y * y;\n}\n\nfunction circumcenter(ax, ay, bx, by, cx, cy) {\n const dx = bx - ax;\n const dy = by - ay;\n const ex = cx - ax;\n const ey = cy - ay;\n\n const bl = dx * dx + dy * dy;\n const cl = ex * ex + ey * ey;\n const d = 0.5 / (dx * ey - dy * ex);\n\n const x = ax + (ey * bl - dy * cl) * d;\n const y = ay + (dx * cl - ex * bl) * d;\n\n return {x, y};\n}\n\nfunction quicksort(ids, dists, left, right) {\n if (right - left <= 20) {\n for (let i = left + 1; i <= right; i++) {\n const temp = ids[i];\n const tempDist = dists[temp];\n let j = i - 1;\n while (j >= left && dists[ids[j]] > tempDist) ids[j + 1] = ids[j--];\n ids[j + 1] = temp;\n }\n } else {\n const median = (left + right) >> 1;\n let i = left + 1;\n let j = right;\n swap(ids, median, i);\n if (dists[ids[left]] > dists[ids[right]]) swap(ids, left, right);\n if (dists[ids[i]] > dists[ids[right]]) swap(ids, i, right);\n if (dists[ids[left]] > dists[ids[i]]) swap(ids, left, i);\n\n const temp = ids[i];\n const tempDist = dists[temp];\n while (true) {\n do i++; while (dists[ids[i]] < tempDist);\n do j--; while (dists[ids[j]] > tempDist);\n if (j < i) break;\n swap(ids, i, j);\n }\n ids[left + 1] = ids[j];\n ids[j] = temp;\n\n if (right - i + 1 >= j - left) {\n quicksort(ids, dists, i, right);\n quicksort(ids, dists, left, j - 1);\n } else {\n quicksort(ids, dists, left, j - 1);\n quicksort(ids, dists, i, right);\n }\n }\n}\n\nfunction swap(arr, i, j) {\n const tmp = arr[i];\n arr[i] = arr[j];\n arr[j] = tmp;\n}\n\nfunction defaultGetX(p) {\n return p[0];\n}\nfunction defaultGetY(p) {\n return p[1];\n}\n","const epsilon = 1e-6;\n\nexport default class Path {\n constructor() {\n this._x0 = this._y0 = // start of current subpath\n this._x1 = this._y1 = null; // end of current subpath\n this._ = \"\";\n }\n moveTo(x, y) {\n this._ += `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._ += \"Z\";\n }\n }\n lineTo(x, y) {\n this._ += `L${this._x1 = +x},${this._y1 = +y}`;\n }\n arc(x, y, r) {\n x = +x, y = +y, r = +r;\n const x0 = x + r;\n const y0 = y;\n if (r < 0) throw new Error(\"negative radius\");\n if (this._x1 === null) this._ += `M${x0},${y0}`;\n else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) this._ += \"L\" + x0 + \",\" + y0;\n if (!r) return;\n this._ += `A${r},${r},0,1,1,${x - r},${y}A${r},${r},0,1,1,${this._x1 = x0},${this._y1 = y0}`;\n }\n rect(x, y, w, h) {\n this._ += `M${this._x0 = this._x1 = +x},${this._y0 = this._y1 = +y}h${+w}v${+h}h${-w}Z`;\n }\n value() {\n return this._ || null;\n }\n}\n","export default class Polygon {\n constructor() {\n this._ = [];\n }\n moveTo(x, y) {\n this._.push([x, y]);\n }\n closePath() {\n this._.push(this._[0].slice());\n }\n lineTo(x, y) {\n this._.push([x, y]);\n }\n value() {\n return this._.length ? this._ : null;\n }\n}\n","import Path from \"./path.js\";\nimport Polygon from \"./polygon.js\";\n\nexport default class Voronoi {\n constructor(delaunay, [xmin, ymin, xmax, ymax] = [0, 0, 960, 500]) {\n if (!((xmax = +xmax) >= (xmin = +xmin)) || !((ymax = +ymax) >= (ymin = +ymin))) throw new Error(\"invalid bounds\");\n this.delaunay = delaunay;\n this._circumcenters = new Float64Array(delaunay.points.length * 2);\n this.vectors = new Float64Array(delaunay.points.length * 2);\n this.xmax = xmax, this.xmin = xmin;\n this.ymax = ymax, this.ymin = ymin;\n this._init();\n }\n update() {\n this.delaunay.update();\n this._init();\n return this;\n }\n _init() {\n const {delaunay: {points, hull, triangles}, vectors} = this;\n\n // Compute circumcenters.\n const circumcenters = this.circumcenters = this._circumcenters.subarray(0, triangles.length / 3 * 2);\n for (let i = 0, j = 0, n = triangles.length, x, y; i < n; i += 3, j += 2) {\n const t1 = triangles[i] * 2;\n const t2 = triangles[i + 1] * 2;\n const t3 = triangles[i + 2] * 2;\n const x1 = points[t1];\n const y1 = points[t1 + 1];\n const x2 = points[t2];\n const y2 = points[t2 + 1];\n const x3 = points[t3];\n const y3 = points[t3 + 1];\n\n const dx = x2 - x1;\n const dy = y2 - y1;\n const ex = x3 - x1;\n const ey = y3 - y1;\n const ab = (dx * ey - dy * ex) * 2;\n\n if (Math.abs(ab) < 1e-9) {\n // degenerate case (collinear diagram)\n // almost equal points (degenerate triangle)\n // the circumcenter is at the infinity, in a\n // direction that is:\n // 1. orthogonal to the halfedge.\n let a = 1e9;\n // 2. points away from the center; since the list of triangles starts\n // in the center, the first point of the first triangle\n // will be our reference\n const r = triangles[0] * 2;\n a *= Math.sign((points[r] - x1) * ey - (points[r + 1] - y1) * ex);\n x = (x1 + x3) / 2 - a * ey;\n y = (y1 + y3) / 2 + a * ex;\n } else {\n const d = 1 / ab;\n const bl = dx * dx + dy * dy;\n const cl = ex * ex + ey * ey;\n x = x1 + (ey * bl - dy * cl) * d;\n y = y1 + (dx * cl - ex * bl) * d;\n }\n circumcenters[j] = x;\n circumcenters[j + 1] = y;\n }\n\n // Compute exterior cell rays.\n let h = hull[hull.length - 1];\n let p0, p1 = h * 4;\n let x0, x1 = points[2 * h];\n let y0, y1 = points[2 * h + 1];\n vectors.fill(0);\n for (let i = 0; i < hull.length; ++i) {\n h = hull[i];\n p0 = p1, x0 = x1, y0 = y1;\n p1 = h * 4, x1 = points[2 * h], y1 = points[2 * h + 1];\n vectors[p0 + 2] = vectors[p1] = y0 - y1;\n vectors[p0 + 3] = vectors[p1 + 1] = x1 - x0;\n }\n }\n render(context) {\n const buffer = context == null ? context = new Path : undefined;\n const {delaunay: {halfedges, inedges, hull}, circumcenters, vectors} = this;\n if (hull.length <= 1) return null;\n for (let i = 0, n = halfedges.length; i < n; ++i) {\n const j = halfedges[i];\n if (j < i) continue;\n const ti = Math.floor(i / 3) * 2;\n const tj = Math.floor(j / 3) * 2;\n const xi = circumcenters[ti];\n const yi = circumcenters[ti + 1];\n const xj = circumcenters[tj];\n const yj = circumcenters[tj + 1];\n this._renderSegment(xi, yi, xj, yj, context);\n }\n let h0, h1 = hull[hull.length - 1];\n for (let i = 0; i < hull.length; ++i) {\n h0 = h1, h1 = hull[i];\n const t = Math.floor(inedges[h1] / 3) * 2;\n const x = circumcenters[t];\n const y = circumcenters[t + 1];\n const v = h0 * 4;\n const p = this._project(x, y, vectors[v + 2], vectors[v + 3]);\n if (p) this._renderSegment(x, y, p[0], p[1], context);\n }\n return buffer && buffer.value();\n }\n renderBounds(context) {\n const buffer = context == null ? context = new Path : undefined;\n context.rect(this.xmin, this.ymin, this.xmax - this.xmin, this.ymax - this.ymin);\n return buffer && buffer.value();\n }\n renderCell(i, context) {\n const buffer = context == null ? context = new Path : undefined;\n const points = this._clip(i);\n if (points === null || !points.length) return;\n context.moveTo(points[0], points[1]);\n let n = points.length;\n while (points[0] === points[n-2] && points[1] === points[n-1] && n > 1) n -= 2;\n for (let i = 2; i < n; i += 2) {\n if (points[i] !== points[i-2] || points[i+1] !== points[i-1])\n context.lineTo(points[i], points[i + 1]);\n }\n context.closePath();\n return buffer && buffer.value();\n }\n *cellPolygons() {\n const {delaunay: {points}} = this;\n for (let i = 0, n = points.length / 2; i < n; ++i) {\n const cell = this.cellPolygon(i);\n if (cell) cell.index = i, yield cell;\n }\n }\n cellPolygon(i) {\n const polygon = new Polygon;\n this.renderCell(i, polygon);\n return polygon.value();\n }\n _renderSegment(x0, y0, x1, y1, context) {\n let S;\n const c0 = this._regioncode(x0, y0);\n const c1 = this._regioncode(x1, y1);\n if (c0 === 0 && c1 === 0) {\n context.moveTo(x0, y0);\n context.lineTo(x1, y1);\n } else if (S = this._clipSegment(x0, y0, x1, y1, c0, c1)) {\n context.moveTo(S[0], S[1]);\n context.lineTo(S[2], S[3]);\n }\n }\n contains(i, x, y) {\n if ((x = +x, x !== x) || (y = +y, y !== y)) return false;\n return this.delaunay._step(i, x, y) === i;\n }\n *neighbors(i) {\n const ci = this._clip(i);\n if (ci) for (const j of this.delaunay.neighbors(i)) {\n const cj = this._clip(j);\n // find the common edge\n if (cj) loop: for (let ai = 0, li = ci.length; ai < li; ai += 2) {\n for (let aj = 0, lj = cj.length; aj < lj; aj += 2) {\n if (ci[ai] == cj[aj]\n && ci[ai + 1] == cj[aj + 1]\n && ci[(ai + 2) % li] == cj[(aj + lj - 2) % lj]\n && ci[(ai + 3) % li] == cj[(aj + lj - 1) % lj]\n ) {\n yield j;\n break loop;\n }\n }\n }\n }\n }\n _cell(i) {\n const {circumcenters, delaunay: {inedges, halfedges, triangles}} = this;\n const e0 = inedges[i];\n if (e0 === -1) return null; // coincident point\n const points = [];\n let e = e0;\n do {\n const t = Math.floor(e / 3);\n points.push(circumcenters[t * 2], circumcenters[t * 2 + 1]);\n e = e % 3 === 2 ? e - 2 : e + 1;\n if (triangles[e] !== i) break; // bad triangulation\n e = halfedges[e];\n } while (e !== e0 && e !== -1);\n return points;\n }\n _clip(i) {\n // degenerate case (1 valid point: return the box)\n if (i === 0 && this.delaunay.hull.length === 1) {\n return [this.xmax, this.ymin, this.xmax, this.ymax, this.xmin, this.ymax, this.xmin, this.ymin];\n }\n const points = this._cell(i);\n if (points === null) return null;\n const {vectors: V} = this;\n const v = i * 4;\n return V[v] || V[v + 1]\n ? this._clipInfinite(i, points, V[v], V[v + 1], V[v + 2], V[v + 3])\n : this._clipFinite(i, points);\n }\n _clipFinite(i, points) {\n const n = points.length;\n let P = null;\n let x0, y0, x1 = points[n - 2], y1 = points[n - 1];\n let c0, c1 = this._regioncode(x1, y1);\n let e0, e1 = 0;\n for (let j = 0; j < n; j += 2) {\n x0 = x1, y0 = y1, x1 = points[j], y1 = points[j + 1];\n c0 = c1, c1 = this._regioncode(x1, y1);\n if (c0 === 0 && c1 === 0) {\n e0 = e1, e1 = 0;\n if (P) P.push(x1, y1);\n else P = [x1, y1];\n } else {\n let S, sx0, sy0, sx1, sy1;\n if (c0 === 0) {\n if ((S = this._clipSegment(x0, y0, x1, y1, c0, c1)) === null) continue;\n [sx0, sy0, sx1, sy1] = S;\n } else {\n if ((S = this._clipSegment(x1, y1, x0, y0, c1, c0)) === null) continue;\n [sx1, sy1, sx0, sy0] = S;\n e0 = e1, e1 = this._edgecode(sx0, sy0);\n if (e0 && e1) this._edge(i, e0, e1, P, P.length);\n if (P) P.push(sx0, sy0);\n else P = [sx0, sy0];\n }\n e0 = e1, e1 = this._edgecode(sx1, sy1);\n if (e0 && e1) this._edge(i, e0, e1, P, P.length);\n if (P) P.push(sx1, sy1);\n else P = [sx1, sy1];\n }\n }\n if (P) {\n e0 = e1, e1 = this._edgecode(P[0], P[1]);\n if (e0 && e1) this._edge(i, e0, e1, P, P.length);\n } else if (this.contains(i, (this.xmin + this.xmax) / 2, (this.ymin + this.ymax) / 2)) {\n return [this.xmax, this.ymin, this.xmax, this.ymax, this.xmin, this.ymax, this.xmin, this.ymin];\n }\n return P;\n }\n _clipSegment(x0, y0, x1, y1, c0, c1) {\n while (true) {\n if (c0 === 0 && c1 === 0) return [x0, y0, x1, y1];\n if (c0 & c1) return null;\n let x, y, c = c0 || c1;\n if (c & 0b1000) x = x0 + (x1 - x0) * (this.ymax - y0) / (y1 - y0), y = this.ymax;\n else if (c & 0b0100) x = x0 + (x1 - x0) * (this.ymin - y0) / (y1 - y0), y = this.ymin;\n else if (c & 0b0010) y = y0 + (y1 - y0) * (this.xmax - x0) / (x1 - x0), x = this.xmax;\n else y = y0 + (y1 - y0) * (this.xmin - x0) / (x1 - x0), x = this.xmin;\n if (c0) x0 = x, y0 = y, c0 = this._regioncode(x0, y0);\n else x1 = x, y1 = y, c1 = this._regioncode(x1, y1);\n }\n }\n _clipInfinite(i, points, vx0, vy0, vxn, vyn) {\n let P = Array.from(points), p;\n if (p = this._project(P[0], P[1], vx0, vy0)) P.unshift(p[0], p[1]);\n if (p = this._project(P[P.length - 2], P[P.length - 1], vxn, vyn)) P.push(p[0], p[1]);\n if (P = this._clipFinite(i, P)) {\n for (let j = 0, n = P.length, c0, c1 = this._edgecode(P[n - 2], P[n - 1]); j < n; j += 2) {\n c0 = c1, c1 = this._edgecode(P[j], P[j + 1]);\n if (c0 && c1) j = this._edge(i, c0, c1, P, j), n = P.length;\n }\n } else if (this.contains(i, (this.xmin + this.xmax) / 2, (this.ymin + this.ymax) / 2)) {\n P = [this.xmin, this.ymin, this.xmax, this.ymin, this.xmax, this.ymax, this.xmin, this.ymax];\n }\n return P;\n }\n _edge(i, e0, e1, P, j) {\n while (e0 !== e1) {\n let x, y;\n switch (e0) {\n case 0b0101: e0 = 0b0100; continue; // top-left\n case 0b0100: e0 = 0b0110, x = this.xmax, y = this.ymin; break; // top\n case 0b0110: e0 = 0b0010; continue; // top-right\n case 0b0010: e0 = 0b1010, x = this.xmax, y = this.ymax; break; // right\n case 0b1010: e0 = 0b1000; continue; // bottom-right\n case 0b1000: e0 = 0b1001, x = this.xmin, y = this.ymax; break; // bottom\n case 0b1001: e0 = 0b0001; continue; // bottom-left\n case 0b0001: e0 = 0b0101, x = this.xmin, y = this.ymin; break; // left\n }\n // Note: this implicitly checks for out of bounds: if P[j] or P[j+1] are\n // undefined, the conditional statement will be executed.\n if ((P[j] !== x || P[j + 1] !== y) && this.contains(i, x, y)) {\n P.splice(j, 0, x, y), j += 2;\n }\n }\n if (P.length > 4) {\n for (let i = 0; i < P.length; i+= 2) {\n const j = (i + 2) % P.length, k = (i + 4) % P.length;\n if (P[i] === P[j] && P[j] === P[k]\n || P[i + 1] === P[j + 1] && P[j + 1] === P[k + 1])\n P.splice(j, 2), i -= 2;\n }\n }\n return j;\n }\n _project(x0, y0, vx, vy) {\n let t = Infinity, c, x, y;\n if (vy < 0) { // top\n if (y0 <= this.ymin) return null;\n if ((c = (this.ymin - y0) / vy) < t) y = this.ymin, x = x0 + (t = c) * vx;\n } else if (vy > 0) { // bottom\n if (y0 >= this.ymax) return null;\n if ((c = (this.ymax - y0) / vy) < t) y = this.ymax, x = x0 + (t = c) * vx;\n }\n if (vx > 0) { // right\n if (x0 >= this.xmax) return null;\n if ((c = (this.xmax - x0) / vx) < t) x = this.xmax, y = y0 + (t = c) * vy;\n } else if (vx < 0) { // left\n if (x0 <= this.xmin) return null;\n if ((c = (this.xmin - x0) / vx) < t) x = this.xmin, y = y0 + (t = c) * vy;\n }\n return [x, y];\n }\n _edgecode(x, y) {\n return (x === this.xmin ? 0b0001\n : x === this.xmax ? 0b0010 : 0b0000)\n | (y === this.ymin ? 0b0100\n : y === this.ymax ? 0b1000 : 0b0000);\n }\n _regioncode(x, y) {\n return (x < this.xmin ? 0b0001\n : x > this.xmax ? 0b0010 : 0b0000)\n | (y < this.ymin ? 0b0100\n : y > this.ymax ? 0b1000 : 0b0000);\n }\n}\n","import Delaunator from \"delaunator\";\nimport Path from \"./path.js\";\nimport Polygon from \"./polygon.js\";\nimport Voronoi from \"./voronoi.js\";\n\nconst tau = 2 * Math.PI, pow = Math.pow;\n\nfunction pointX(p) {\n return p[0];\n}\n\nfunction pointY(p) {\n return p[1];\n}\n\n// A triangulation is collinear if all its triangles have a non-null area\nfunction collinear(d) {\n const {triangles, coords} = d;\n for (let i = 0; i < triangles.length; i += 3) {\n const a = 2 * triangles[i],\n b = 2 * triangles[i + 1],\n c = 2 * triangles[i + 2],\n cross = (coords[c] - coords[a]) * (coords[b + 1] - coords[a + 1])\n - (coords[b] - coords[a]) * (coords[c + 1] - coords[a + 1]);\n if (cross > 1e-10) return false;\n }\n return true;\n}\n\nfunction jitter(x, y, r) {\n return [x + Math.sin(x + y) * r, y + Math.cos(x - y) * r];\n}\n\nexport default class Delaunay {\n static from(points, fx = pointX, fy = pointY, that) {\n return new Delaunay(\"length\" in points\n ? flatArray(points, fx, fy, that)\n : Float64Array.from(flatIterable(points, fx, fy, that)));\n }\n constructor(points) {\n this._delaunator = new Delaunator(points);\n this.inedges = new Int32Array(points.length / 2);\n this._hullIndex = new Int32Array(points.length / 2);\n this.points = this._delaunator.coords;\n this._init();\n }\n update() {\n this._delaunator.update();\n this._init();\n return this;\n }\n _init() {\n const d = this._delaunator, points = this.points;\n\n // check for collinear\n if (d.hull && d.hull.length > 2 && collinear(d)) {\n this.collinear = Int32Array.from({length: points.length/2}, (_,i) => i)\n .sort((i, j) => points[2 * i] - points[2 * j] || points[2 * i + 1] - points[2 * j + 1]); // for exact neighbors\n const e = this.collinear[0], f = this.collinear[this.collinear.length - 1],\n bounds = [ points[2 * e], points[2 * e + 1], points[2 * f], points[2 * f + 1] ],\n r = 1e-8 * Math.hypot(bounds[3] - bounds[1], bounds[2] - bounds[0]);\n for (let i = 0, n = points.length / 2; i < n; ++i) {\n const p = jitter(points[2 * i], points[2 * i + 1], r);\n points[2 * i] = p[0];\n points[2 * i + 1] = p[1];\n }\n this._delaunator = new Delaunator(points);\n } else {\n delete this.collinear;\n }\n\n const halfedges = this.halfedges = this._delaunator.halfedges;\n const hull = this.hull = this._delaunator.hull;\n const triangles = this.triangles = this._delaunator.triangles;\n const inedges = this.inedges.fill(-1);\n const hullIndex = this._hullIndex.fill(-1);\n\n // Compute an index from each point to an (arbitrary) incoming halfedge\n // Used to give the first neighbor of each point; for this reason,\n // on the hull we give priority to exterior halfedges\n for (let e = 0, n = halfedges.length; e < n; ++e) {\n const p = triangles[e % 3 === 2 ? e - 2 : e + 1];\n if (halfedges[e] === -1 || inedges[p] === -1) inedges[p] = e;\n }\n for (let i = 0, n = hull.length; i < n; ++i) {\n hullIndex[hull[i]] = i;\n }\n\n // degenerate case: 1 or 2 (distinct) points\n if (hull.length <= 2 && hull.length > 0) {\n this.triangles = new Int32Array(3).fill(-1);\n this.halfedges = new Int32Array(3).fill(-1);\n this.triangles[0] = hull[0];\n inedges[hull[0]] = 1;\n if (hull.length === 2) {\n inedges[hull[1]] = 0;\n this.triangles[1] = hull[1];\n this.triangles[2] = hull[1];\n }\n }\n }\n voronoi(bounds) {\n return new Voronoi(this, bounds);\n }\n *neighbors(i) {\n const {inedges, hull, _hullIndex, halfedges, triangles, collinear} = this;\n\n // degenerate case with several collinear points\n if (collinear) {\n const l = collinear.indexOf(i);\n if (l > 0) yield collinear[l - 1];\n if (l < collinear.length - 1) yield collinear[l + 1];\n return;\n }\n\n const e0 = inedges[i];\n if (e0 === -1) return; // coincident point\n let e = e0, p0 = -1;\n do {\n yield p0 = triangles[e];\n e = e % 3 === 2 ? e - 2 : e + 1;\n if (triangles[e] !== i) return; // bad triangulation\n e = halfedges[e];\n if (e === -1) {\n const p = hull[(_hullIndex[i] + 1) % hull.length];\n if (p !== p0) yield p;\n return;\n }\n } while (e !== e0);\n }\n find(x, y, i = 0) {\n if ((x = +x, x !== x) || (y = +y, y !== y)) return -1;\n const i0 = i;\n let c;\n while ((c = this._step(i, x, y)) >= 0 && c !== i && c !== i0) i = c;\n return c;\n }\n _step(i, x, y) {\n const {inedges, hull, _hullIndex, halfedges, triangles, points} = this;\n if (inedges[i] === -1 || !points.length) return (i + 1) % (points.length >> 1);\n let c = i;\n let dc = pow(x - points[i * 2], 2) + pow(y - points[i * 2 + 1], 2);\n const e0 = inedges[i];\n let e = e0;\n do {\n let t = triangles[e];\n const dt = pow(x - points[t * 2], 2) + pow(y - points[t * 2 + 1], 2);\n if (dt < dc) dc = dt, c = t;\n e = e % 3 === 2 ? e - 2 : e + 1;\n if (triangles[e] !== i) break; // bad triangulation\n e = halfedges[e];\n if (e === -1) {\n e = hull[(_hullIndex[i] + 1) % hull.length];\n if (e !== t) {\n if (pow(x - points[e * 2], 2) + pow(y - points[e * 2 + 1], 2) < dc) return e;\n }\n break;\n }\n } while (e !== e0);\n return c;\n }\n render(context) {\n const buffer = context == null ? context = new Path : undefined;\n const {points, halfedges, triangles} = this;\n for (let i = 0, n = halfedges.length; i < n; ++i) {\n const j = halfedges[i];\n if (j < i) continue;\n const ti = triangles[i] * 2;\n const tj = triangles[j] * 2;\n context.moveTo(points[ti], points[ti + 1]);\n context.lineTo(points[tj], points[tj + 1]);\n }\n this.renderHull(context);\n return buffer && buffer.value();\n }\n renderPoints(context, r) {\n if (r === undefined && (!context || typeof context.moveTo !== \"function\")) r = context, context = null;\n r = r == undefined ? 2 : +r;\n const buffer = context == null ? context = new Path : undefined;\n const {points} = this;\n for (let i = 0, n = points.length; i < n; i += 2) {\n const x = points[i], y = points[i + 1];\n context.moveTo(x + r, y);\n context.arc(x, y, r, 0, tau);\n }\n return buffer && buffer.value();\n }\n renderHull(context) {\n const buffer = context == null ? context = new Path : undefined;\n const {hull, points} = this;\n const h = hull[0] * 2, n = hull.length;\n context.moveTo(points[h], points[h + 1]);\n for (let i = 1; i < n; ++i) {\n const h = 2 * hull[i];\n context.lineTo(points[h], points[h + 1]);\n }\n context.closePath();\n return buffer && buffer.value();\n }\n hullPolygon() {\n const polygon = new Polygon;\n this.renderHull(polygon);\n return polygon.value();\n }\n renderTriangle(i, context) {\n const buffer = context == null ? context = new Path : undefined;\n const {points, triangles} = this;\n const t0 = triangles[i *= 3] * 2;\n const t1 = triangles[i + 1] * 2;\n const t2 = triangles[i + 2] * 2;\n context.moveTo(points[t0], points[t0 + 1]);\n context.lineTo(points[t1], points[t1 + 1]);\n context.lineTo(points[t2], points[t2 + 1]);\n context.closePath();\n return buffer && buffer.value();\n }\n *trianglePolygons() {\n const {triangles} = this;\n for (let i = 0, n = triangles.length / 3; i < n; ++i) {\n yield this.trianglePolygon(i);\n }\n }\n trianglePolygon(i) {\n const polygon = new Polygon;\n this.renderTriangle(i, polygon);\n return polygon.value();\n }\n}\n\nfunction flatArray(points, fx, fy, that) {\n const n = points.length;\n const array = new Float64Array(n * 2);\n for (let i = 0; i < n; ++i) {\n const p = points[i];\n array[i * 2] = fx.call(that, p, i, points);\n array[i * 2 + 1] = fy.call(that, p, i, points);\n }\n return array;\n}\n\nfunction* flatIterable(points, fx, fy, that) {\n let i = 0;\n for (const p of points) {\n yield fx.call(that, p, i, points);\n yield fy.call(that, p, i, points);\n ++i;\n }\n}\n","import { Transform } from 'vega-dataflow';\nimport { inherits } from 'vega-util';\nimport { Delaunay } from 'd3-delaunay';\n\nfunction Voronoi(params) {\n Transform.call(this, null, params);\n}\nVoronoi.Definition = {\n 'type': 'Voronoi',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'x',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'y',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'size',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'extent',\n 'type': 'array',\n 'array': true,\n 'length': 2,\n 'default': [[-1e5, -1e5], [1e5, 1e5]],\n 'content': {\n 'type': 'number',\n 'array': true,\n 'length': 2\n }\n }, {\n 'name': 'as',\n 'type': 'string',\n 'default': 'path'\n }]\n};\nconst defaultExtent = [-1e5, -1e5, 1e5, 1e5];\ninherits(Voronoi, Transform, {\n transform(_, pulse) {\n const as = _.as || 'path',\n data = pulse.source; // nothing to do if no data\n\n if (!data || !data.length) return pulse; // configure and construct voronoi diagram\n\n let s = _.size;\n s = s ? [0, 0, s[0], s[1]] : (s = _.extent) ? [s[0][0], s[0][1], s[1][0], s[1][1]] : defaultExtent;\n const voronoi = this.value = Delaunay.from(data, _.x, _.y).voronoi(s); // map polygons to paths\n\n for (let i = 0, n = data.length; i < n; ++i) {\n const polygon = voronoi.cellPolygon(i);\n data[i][as] = polygon ? toPathString(polygon) : null;\n }\n\n return pulse.reflow(_.modified()).modifies(as);\n }\n\n}); // suppress duplicated end point vertices\n\nfunction toPathString(p) {\n const x = p[0][0],\n y = p[0][1];\n let n = p.length - 1;\n\n for (; p[n][0] === x && p[n][1] === y; --n);\n\n return 'M' + p.slice(0, n + 1).join('L') + 'Z';\n}\n\nexport { Voronoi as voronoi };\n","import { canvas } from 'vega-canvas';\nimport { Transform } from 'vega-dataflow';\nimport { inherits, error, isFunction, constant, extent } from 'vega-util';\nimport { scale } from 'vega-scale';\nimport { random } from 'vega-statistics';\n\n/*\nCopyright (c) 2013, Jason Davies.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright notice, this\n list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above copyright notice,\n this list of conditions and the following disclaimer in the documentation\n and/or other materials provided with the distribution.\n\n * The name Jason Davies may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL JASON DAVIES BE LIABLE FOR ANY DIRECT, INDIRECT,\nINCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\nPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\nLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\nOR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\nADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n// Word cloud layout by Jason Davies, https://www.jasondavies.com/wordcloud/\n// Algorithm due to Jonathan Feinberg, http://static.mrfeinberg.com/bv_ch03.pdf\n\nvar cloudRadians = Math.PI / 180,\n cw = 1 << 11 >> 5,\n ch = 1 << 11;\nfunction cloud () {\n var size = [256, 256],\n text,\n font,\n fontSize,\n fontStyle,\n fontWeight,\n rotate,\n padding,\n spiral = archimedeanSpiral,\n words = [],\n random = Math.random,\n cloud = {};\n\n cloud.layout = function () {\n var contextAndRatio = getContext(canvas()),\n board = zeroArray((size[0] >> 5) * size[1]),\n bounds = null,\n n = words.length,\n i = -1,\n tags = [],\n data = words.map(d => ({\n text: text(d),\n font: font(d),\n style: fontStyle(d),\n weight: fontWeight(d),\n rotate: rotate(d),\n size: ~~(fontSize(d) + 1e-14),\n padding: padding(d),\n xoff: 0,\n yoff: 0,\n x1: 0,\n y1: 0,\n x0: 0,\n y0: 0,\n hasText: false,\n sprite: null,\n datum: d\n })).sort((a, b) => b.size - a.size);\n\n while (++i < n) {\n var d = data[i];\n d.x = size[0] * (random() + .5) >> 1;\n d.y = size[1] * (random() + .5) >> 1;\n cloudSprite(contextAndRatio, d, data, i);\n\n if (d.hasText && place(board, d, bounds)) {\n tags.push(d);\n if (bounds) cloudBounds(bounds, d);else bounds = [{\n x: d.x + d.x0,\n y: d.y + d.y0\n }, {\n x: d.x + d.x1,\n y: d.y + d.y1\n }]; // Temporary hack\n\n d.x -= size[0] >> 1;\n d.y -= size[1] >> 1;\n }\n }\n\n return tags;\n };\n\n function getContext(canvas) {\n canvas.width = canvas.height = 1;\n var ratio = Math.sqrt(canvas.getContext('2d').getImageData(0, 0, 1, 1).data.length >> 2);\n canvas.width = (cw << 5) / ratio;\n canvas.height = ch / ratio;\n var context = canvas.getContext('2d');\n context.fillStyle = context.strokeStyle = 'red';\n context.textAlign = 'center';\n return {\n context: context,\n ratio: ratio\n };\n }\n\n function place(board, tag, bounds) {\n var startX = tag.x,\n startY = tag.y,\n maxDelta = Math.sqrt(size[0] * size[0] + size[1] * size[1]),\n s = spiral(size),\n dt = random() < .5 ? 1 : -1,\n t = -dt,\n dxdy,\n dx,\n dy;\n\n while (dxdy = s(t += dt)) {\n dx = ~~dxdy[0];\n dy = ~~dxdy[1];\n if (Math.min(Math.abs(dx), Math.abs(dy)) >= maxDelta) break;\n tag.x = startX + dx;\n tag.y = startY + dy;\n if (tag.x + tag.x0 < 0 || tag.y + tag.y0 < 0 || tag.x + tag.x1 > size[0] || tag.y + tag.y1 > size[1]) continue; // TODO only check for collisions within current bounds.\n\n if (!bounds || !cloudCollide(tag, board, size[0])) {\n if (!bounds || collideRects(tag, bounds)) {\n var sprite = tag.sprite,\n w = tag.width >> 5,\n sw = size[0] >> 5,\n lx = tag.x - (w << 4),\n sx = lx & 0x7f,\n msx = 32 - sx,\n h = tag.y1 - tag.y0,\n x = (tag.y + tag.y0) * sw + (lx >> 5),\n last;\n\n for (var j = 0; j < h; j++) {\n last = 0;\n\n for (var i = 0; i <= w; i++) {\n board[x + i] |= last << msx | (i < w ? (last = sprite[j * w + i]) >>> sx : 0);\n }\n\n x += sw;\n }\n\n tag.sprite = null;\n return true;\n }\n }\n }\n\n return false;\n }\n\n cloud.words = function (_) {\n if (arguments.length) {\n words = _;\n return cloud;\n } else {\n return words;\n }\n };\n\n cloud.size = function (_) {\n if (arguments.length) {\n size = [+_[0], +_[1]];\n return cloud;\n } else {\n return size;\n }\n };\n\n cloud.font = function (_) {\n if (arguments.length) {\n font = functor(_);\n return cloud;\n } else {\n return font;\n }\n };\n\n cloud.fontStyle = function (_) {\n if (arguments.length) {\n fontStyle = functor(_);\n return cloud;\n } else {\n return fontStyle;\n }\n };\n\n cloud.fontWeight = function (_) {\n if (arguments.length) {\n fontWeight = functor(_);\n return cloud;\n } else {\n return fontWeight;\n }\n };\n\n cloud.rotate = function (_) {\n if (arguments.length) {\n rotate = functor(_);\n return cloud;\n } else {\n return rotate;\n }\n };\n\n cloud.text = function (_) {\n if (arguments.length) {\n text = functor(_);\n return cloud;\n } else {\n return text;\n }\n };\n\n cloud.spiral = function (_) {\n if (arguments.length) {\n spiral = spirals[_] || _;\n return cloud;\n } else {\n return spiral;\n }\n };\n\n cloud.fontSize = function (_) {\n if (arguments.length) {\n fontSize = functor(_);\n return cloud;\n } else {\n return fontSize;\n }\n };\n\n cloud.padding = function (_) {\n if (arguments.length) {\n padding = functor(_);\n return cloud;\n } else {\n return padding;\n }\n };\n\n cloud.random = function (_) {\n if (arguments.length) {\n random = _;\n return cloud;\n } else {\n return random;\n }\n };\n\n return cloud;\n} // Fetches a monochrome sprite bitmap for the specified text.\n// Load in batches for speed.\n\nfunction cloudSprite(contextAndRatio, d, data, di) {\n if (d.sprite) return;\n var c = contextAndRatio.context,\n ratio = contextAndRatio.ratio;\n c.clearRect(0, 0, (cw << 5) / ratio, ch / ratio);\n var x = 0,\n y = 0,\n maxh = 0,\n n = data.length,\n w,\n w32,\n h,\n i,\n j;\n --di;\n\n while (++di < n) {\n d = data[di];\n c.save();\n c.font = d.style + ' ' + d.weight + ' ' + ~~((d.size + 1) / ratio) + 'px ' + d.font;\n w = c.measureText(d.text + 'm').width * ratio;\n h = d.size << 1;\n\n if (d.rotate) {\n var sr = Math.sin(d.rotate * cloudRadians),\n cr = Math.cos(d.rotate * cloudRadians),\n wcr = w * cr,\n wsr = w * sr,\n hcr = h * cr,\n hsr = h * sr;\n w = Math.max(Math.abs(wcr + hsr), Math.abs(wcr - hsr)) + 0x1f >> 5 << 5;\n h = ~~Math.max(Math.abs(wsr + hcr), Math.abs(wsr - hcr));\n } else {\n w = w + 0x1f >> 5 << 5;\n }\n\n if (h > maxh) maxh = h;\n\n if (x + w >= cw << 5) {\n x = 0;\n y += maxh;\n maxh = 0;\n }\n\n if (y + h >= ch) break;\n c.translate((x + (w >> 1)) / ratio, (y + (h >> 1)) / ratio);\n if (d.rotate) c.rotate(d.rotate * cloudRadians);\n c.fillText(d.text, 0, 0);\n\n if (d.padding) {\n c.lineWidth = 2 * d.padding;\n c.strokeText(d.text, 0, 0);\n }\n\n c.restore();\n d.width = w;\n d.height = h;\n d.xoff = x;\n d.yoff = y;\n d.x1 = w >> 1;\n d.y1 = h >> 1;\n d.x0 = -d.x1;\n d.y0 = -d.y1;\n d.hasText = true;\n x += w;\n }\n\n var pixels = c.getImageData(0, 0, (cw << 5) / ratio, ch / ratio).data,\n sprite = [];\n\n while (--di >= 0) {\n d = data[di];\n if (!d.hasText) continue;\n w = d.width;\n w32 = w >> 5;\n h = d.y1 - d.y0; // Zero the buffer\n\n for (i = 0; i < h * w32; i++) sprite[i] = 0;\n\n x = d.xoff;\n if (x == null) return;\n y = d.yoff;\n var seen = 0,\n seenRow = -1;\n\n for (j = 0; j < h; j++) {\n for (i = 0; i < w; i++) {\n var k = w32 * j + (i >> 5),\n m = pixels[(y + j) * (cw << 5) + (x + i) << 2] ? 1 << 31 - i % 32 : 0;\n sprite[k] |= m;\n seen |= m;\n }\n\n if (seen) seenRow = j;else {\n d.y0++;\n h--;\n j--;\n y++;\n }\n }\n\n d.y1 = d.y0 + seenRow;\n d.sprite = sprite.slice(0, (d.y1 - d.y0) * w32);\n }\n} // Use mask-based collision detection.\n\n\nfunction cloudCollide(tag, board, sw) {\n sw >>= 5;\n var sprite = tag.sprite,\n w = tag.width >> 5,\n lx = tag.x - (w << 4),\n sx = lx & 0x7f,\n msx = 32 - sx,\n h = tag.y1 - tag.y0,\n x = (tag.y + tag.y0) * sw + (lx >> 5),\n last;\n\n for (var j = 0; j < h; j++) {\n last = 0;\n\n for (var i = 0; i <= w; i++) {\n if ((last << msx | (i < w ? (last = sprite[j * w + i]) >>> sx : 0)) & board[x + i]) return true;\n }\n\n x += sw;\n }\n\n return false;\n}\n\nfunction cloudBounds(bounds, d) {\n var b0 = bounds[0],\n b1 = bounds[1];\n if (d.x + d.x0 < b0.x) b0.x = d.x + d.x0;\n if (d.y + d.y0 < b0.y) b0.y = d.y + d.y0;\n if (d.x + d.x1 > b1.x) b1.x = d.x + d.x1;\n if (d.y + d.y1 > b1.y) b1.y = d.y + d.y1;\n}\n\nfunction collideRects(a, b) {\n return a.x + a.x1 > b[0].x && a.x + a.x0 < b[1].x && a.y + a.y1 > b[0].y && a.y + a.y0 < b[1].y;\n}\n\nfunction archimedeanSpiral(size) {\n var e = size[0] / size[1];\n return function (t) {\n return [e * (t *= .1) * Math.cos(t), t * Math.sin(t)];\n };\n}\n\nfunction rectangularSpiral(size) {\n var dy = 4,\n dx = dy * size[0] / size[1],\n x = 0,\n y = 0;\n return function (t) {\n var sign = t < 0 ? -1 : 1; // See triangular numbers: T_n = n * (n + 1) / 2.\n\n switch (Math.sqrt(1 + 4 * sign * t) - sign & 3) {\n case 0:\n x += dx;\n break;\n\n case 1:\n y += dy;\n break;\n\n case 2:\n x -= dx;\n break;\n\n default:\n y -= dy;\n break;\n }\n\n return [x, y];\n };\n} // TODO reuse arrays?\n\n\nfunction zeroArray(n) {\n var a = [],\n i = -1;\n\n while (++i < n) a[i] = 0;\n\n return a;\n}\n\nfunction functor(d) {\n return typeof d === 'function' ? d : function () {\n return d;\n };\n}\n\nvar spirals = {\n archimedean: archimedeanSpiral,\n rectangular: rectangularSpiral\n};\n\nconst Output = ['x', 'y', 'font', 'fontSize', 'fontStyle', 'fontWeight', 'angle'];\nconst Params = ['text', 'font', 'rotate', 'fontSize', 'fontStyle', 'fontWeight'];\nfunction Wordcloud(params) {\n Transform.call(this, cloud(), params);\n}\nWordcloud.Definition = {\n 'type': 'Wordcloud',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'size',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'font',\n 'type': 'string',\n 'expr': true,\n 'default': 'sans-serif'\n }, {\n 'name': 'fontStyle',\n 'type': 'string',\n 'expr': true,\n 'default': 'normal'\n }, {\n 'name': 'fontWeight',\n 'type': 'string',\n 'expr': true,\n 'default': 'normal'\n }, {\n 'name': 'fontSize',\n 'type': 'number',\n 'expr': true,\n 'default': 14\n }, {\n 'name': 'fontSizeRange',\n 'type': 'number',\n 'array': 'nullable',\n 'default': [10, 50]\n }, {\n 'name': 'rotate',\n 'type': 'number',\n 'expr': true,\n 'default': 0\n }, {\n 'name': 'text',\n 'type': 'field'\n }, {\n 'name': 'spiral',\n 'type': 'string',\n 'values': ['archimedean', 'rectangular']\n }, {\n 'name': 'padding',\n 'type': 'number',\n 'expr': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': 7,\n 'default': Output\n }]\n};\ninherits(Wordcloud, Transform, {\n transform(_, pulse) {\n if (_.size && !(_.size[0] && _.size[1])) {\n error('Wordcloud size dimensions must be non-zero.');\n }\n\n function modp(param) {\n const p = _[param];\n return isFunction(p) && pulse.modified(p.fields);\n }\n\n const mod = _.modified();\n\n if (!(mod || pulse.changed(pulse.ADD_REM) || Params.some(modp))) return;\n const data = pulse.materialize(pulse.SOURCE).source,\n layout = this.value,\n as = _.as || Output;\n let fontSize = _.fontSize || 14,\n range;\n isFunction(fontSize) ? range = _.fontSizeRange : fontSize = constant(fontSize); // create font size scaling function as needed\n\n if (range) {\n const fsize = fontSize,\n sizeScale = scale('sqrt')().domain(extent(data, fsize)).range(range);\n\n fontSize = x => sizeScale(fsize(x));\n }\n\n data.forEach(t => {\n t[as[0]] = NaN;\n t[as[1]] = NaN;\n t[as[3]] = 0;\n }); // configure layout\n\n const words = layout.words(data).text(_.text).size(_.size || [500, 500]).padding(_.padding || 1).spiral(_.spiral || 'archimedean').rotate(_.rotate || 0).font(_.font || 'sans-serif').fontStyle(_.fontStyle || 'normal').fontWeight(_.fontWeight || 'normal').fontSize(fontSize).random(random).layout();\n const size = layout.size(),\n dx = size[0] >> 1,\n dy = size[1] >> 1,\n n = words.length;\n\n for (let i = 0, w, t; i < n; ++i) {\n w = words[i];\n t = w.datum;\n t[as[0]] = w.x + dx;\n t[as[1]] = w.y + dy;\n t[as[2]] = w.font;\n t[as[3]] = w.size;\n t[as[4]] = w.style;\n t[as[5]] = w.weight;\n t[as[6]] = w.rotate;\n }\n\n return pulse.reflow(mod).modifies(as);\n }\n\n});\n\nexport { Wordcloud as wordcloud };\n","import { permute, bisectLeft, bisectRight } from 'd3-array';\nimport { Transform } from 'vega-dataflow';\nimport { inherits } from 'vega-util';\n\nconst array8 = n => new Uint8Array(n);\nconst array16 = n => new Uint16Array(n);\nconst array32 = n => new Uint32Array(n);\n\n/**\n * Maintains CrossFilter state.\n */\n\nfunction Bitmaps() {\n let width = 8,\n data = [],\n seen = array32(0),\n curr = array(0, width),\n prev = array(0, width);\n return {\n data: () => data,\n seen: () => seen = lengthen(seen, data.length),\n\n add(array) {\n for (let i = 0, j = data.length, n = array.length, t; i < n; ++i) {\n t = array[i];\n t._index = j++;\n data.push(t);\n }\n },\n\n remove(num, map) {\n // map: index -> boolean (true => remove)\n const n = data.length,\n copy = Array(n - num),\n reindex = data; // reuse old data array for index map\n\n let t, i, j; // seek forward to first removal\n\n for (i = 0; !map[i] && i < n; ++i) {\n copy[i] = data[i];\n reindex[i] = i;\n } // condense arrays\n\n\n for (j = i; i < n; ++i) {\n t = data[i];\n\n if (!map[i]) {\n reindex[i] = j;\n curr[j] = curr[i];\n prev[j] = prev[i];\n copy[j] = t;\n t._index = j++;\n } else {\n reindex[i] = -1;\n }\n\n curr[i] = 0; // clear unused bits\n }\n\n data = copy;\n return reindex;\n },\n\n size: () => data.length,\n curr: () => curr,\n prev: () => prev,\n reset: k => prev[k] = curr[k],\n all: () => width < 0x101 ? 0xff : width < 0x10001 ? 0xffff : 0xffffffff,\n\n set(k, one) {\n curr[k] |= one;\n },\n\n clear(k, one) {\n curr[k] &= ~one;\n },\n\n resize(n, m) {\n const k = curr.length;\n\n if (n > k || m > width) {\n width = Math.max(m, width);\n curr = array(n, width, curr);\n prev = array(n, width);\n }\n }\n\n };\n}\n\nfunction lengthen(array, length, copy) {\n if (array.length >= length) return array;\n copy = copy || new array.constructor(length);\n copy.set(array);\n return copy;\n}\n\nfunction array(n, m, array) {\n const copy = (m < 0x101 ? array8 : m < 0x10001 ? array16 : array32)(n);\n if (array) copy.set(array);\n return copy;\n}\n\nfunction Dimension (index, i, query) {\n const bit = 1 << i;\n return {\n one: bit,\n zero: ~bit,\n range: query.slice(),\n bisect: index.bisect,\n index: index.index,\n size: index.size,\n\n onAdd(added, curr) {\n const dim = this,\n range = dim.bisect(dim.range, added.value),\n idx = added.index,\n lo = range[0],\n hi = range[1],\n n1 = idx.length;\n let i;\n\n for (i = 0; i < lo; ++i) curr[idx[i]] |= bit;\n\n for (i = hi; i < n1; ++i) curr[idx[i]] |= bit;\n\n return dim;\n }\n\n };\n}\n\n/**\n * Maintains a list of values, sorted by key.\n */\n\nfunction SortedIndex() {\n let index = array32(0),\n value = [],\n size = 0;\n\n function insert(key, data, base) {\n if (!data.length) return [];\n const n0 = size,\n n1 = data.length,\n addi = array32(n1);\n let addv = Array(n1),\n oldv,\n oldi,\n i;\n\n for (i = 0; i < n1; ++i) {\n addv[i] = key(data[i]);\n addi[i] = i;\n }\n\n addv = sort(addv, addi);\n\n if (n0) {\n oldv = value;\n oldi = index;\n value = Array(n0 + n1);\n index = array32(n0 + n1);\n merge(base, oldv, oldi, n0, addv, addi, n1, value, index);\n } else {\n if (base > 0) for (i = 0; i < n1; ++i) {\n addi[i] += base;\n }\n value = addv;\n index = addi;\n }\n\n size = n0 + n1;\n return {\n index: addi,\n value: addv\n };\n }\n\n function remove(num, map) {\n // map: index -> remove\n const n = size;\n let idx, i, j; // seek forward to first removal\n\n for (i = 0; !map[index[i]] && i < n; ++i); // condense index and value arrays\n\n\n for (j = i; i < n; ++i) {\n if (!map[idx = index[i]]) {\n index[j] = idx;\n value[j] = value[i];\n ++j;\n }\n }\n\n size = n - num;\n }\n\n function reindex(map) {\n for (let i = 0, n = size; i < n; ++i) {\n index[i] = map[index[i]];\n }\n }\n\n function bisect(range, array) {\n let n;\n\n if (array) {\n n = array.length;\n } else {\n array = value;\n n = size;\n }\n\n return [bisectLeft(array, range[0], 0, n), bisectRight(array, range[1], 0, n)];\n }\n\n return {\n insert: insert,\n remove: remove,\n bisect: bisect,\n reindex: reindex,\n index: () => index,\n size: () => size\n };\n}\n\nfunction sort(values, index) {\n values.sort.call(index, (a, b) => {\n const x = values[a],\n y = values[b];\n return x < y ? -1 : x > y ? 1 : 0;\n });\n return permute(values, index);\n}\n\nfunction merge(base, value0, index0, n0, value1, index1, n1, value, index) {\n let i0 = 0,\n i1 = 0,\n i;\n\n for (i = 0; i0 < n0 && i1 < n1; ++i) {\n if (value0[i0] < value1[i1]) {\n value[i] = value0[i0];\n index[i] = index0[i0++];\n } else {\n value[i] = value1[i1];\n index[i] = index1[i1++] + base;\n }\n }\n\n for (; i0 < n0; ++i0, ++i) {\n value[i] = value0[i0];\n index[i] = index0[i0];\n }\n\n for (; i1 < n1; ++i1, ++i) {\n value[i] = value1[i1];\n index[i] = index1[i1] + base;\n }\n}\n\n/**\n * An indexed multi-dimensional filter.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} params.fields - An array of dimension accessors to filter.\n * @param {Array} params.query - An array of per-dimension range queries.\n */\n\nfunction CrossFilter(params) {\n Transform.call(this, Bitmaps(), params);\n this._indices = null;\n this._dims = null;\n}\nCrossFilter.Definition = {\n 'type': 'CrossFilter',\n 'metadata': {},\n 'params': [{\n 'name': 'fields',\n 'type': 'field',\n 'array': true,\n 'required': true\n }, {\n 'name': 'query',\n 'type': 'array',\n 'array': true,\n 'required': true,\n 'content': {\n 'type': 'number',\n 'array': true,\n 'length': 2\n }\n }]\n};\ninherits(CrossFilter, Transform, {\n transform(_, pulse) {\n if (!this._dims) {\n return this.init(_, pulse);\n } else {\n var init = _.modified('fields') || _.fields.some(f => pulse.modified(f.fields));\n\n return init ? this.reinit(_, pulse) : this.eval(_, pulse);\n }\n },\n\n init(_, pulse) {\n const fields = _.fields,\n query = _.query,\n indices = this._indices = {},\n dims = this._dims = [],\n m = query.length;\n let i = 0,\n key,\n index; // instantiate indices and dimensions\n\n for (; i < m; ++i) {\n key = fields[i].fname;\n index = indices[key] || (indices[key] = SortedIndex());\n dims.push(Dimension(index, i, query[i]));\n }\n\n return this.eval(_, pulse);\n },\n\n reinit(_, pulse) {\n const output = pulse.materialize().fork(),\n fields = _.fields,\n query = _.query,\n indices = this._indices,\n dims = this._dims,\n bits = this.value,\n curr = bits.curr(),\n prev = bits.prev(),\n all = bits.all(),\n out = output.rem = output.add,\n mod = output.mod,\n m = query.length,\n adds = {};\n let add, index, key, mods, remMap, modMap, i, n, f; // set prev to current state\n\n prev.set(curr); // if pulse has remove tuples, process them first\n\n if (pulse.rem.length) {\n remMap = this.remove(_, pulse, output);\n } // if pulse has added tuples, add them to state\n\n\n if (pulse.add.length) {\n bits.add(pulse.add);\n } // if pulse has modified tuples, create an index map\n\n\n if (pulse.mod.length) {\n modMap = {};\n\n for (mods = pulse.mod, i = 0, n = mods.length; i < n; ++i) {\n modMap[mods[i]._index] = 1;\n }\n } // re-initialize indices as needed, update curr bitmap\n\n\n for (i = 0; i < m; ++i) {\n f = fields[i];\n\n if (!dims[i] || _.modified('fields', i) || pulse.modified(f.fields)) {\n key = f.fname;\n\n if (!(add = adds[key])) {\n indices[key] = index = SortedIndex();\n adds[key] = add = index.insert(f, pulse.source, 0);\n }\n\n dims[i] = Dimension(index, i, query[i]).onAdd(add, curr);\n }\n } // visit each tuple\n // if filter state changed, push index to add/rem\n // else if in mod and passes a filter, push index to mod\n\n\n for (i = 0, n = bits.data().length; i < n; ++i) {\n if (remMap[i]) {\n // skip if removed tuple\n continue;\n } else if (prev[i] !== curr[i]) {\n // add if state changed\n out.push(i);\n } else if (modMap[i] && curr[i] !== all) {\n // otherwise, pass mods through\n mod.push(i);\n }\n }\n\n bits.mask = (1 << m) - 1;\n return output;\n },\n\n eval(_, pulse) {\n const output = pulse.materialize().fork(),\n m = this._dims.length;\n let mask = 0;\n\n if (pulse.rem.length) {\n this.remove(_, pulse, output);\n mask |= (1 << m) - 1;\n }\n\n if (_.modified('query') && !_.modified('fields')) {\n mask |= this.update(_, pulse, output);\n }\n\n if (pulse.add.length) {\n this.insert(_, pulse, output);\n mask |= (1 << m) - 1;\n }\n\n if (pulse.mod.length) {\n this.modify(pulse, output);\n mask |= (1 << m) - 1;\n }\n\n this.value.mask = mask;\n return output;\n },\n\n insert(_, pulse, output) {\n const tuples = pulse.add,\n bits = this.value,\n dims = this._dims,\n indices = this._indices,\n fields = _.fields,\n adds = {},\n out = output.add,\n n = bits.size() + tuples.length,\n m = dims.length;\n let k = bits.size(),\n j,\n key,\n add; // resize bitmaps and add tuples as needed\n\n bits.resize(n, m);\n bits.add(tuples);\n const curr = bits.curr(),\n prev = bits.prev(),\n all = bits.all(); // add to dimensional indices\n\n for (j = 0; j < m; ++j) {\n key = fields[j].fname;\n add = adds[key] || (adds[key] = indices[key].insert(fields[j], tuples, k));\n dims[j].onAdd(add, curr);\n } // set previous filters, output if passes at least one filter\n\n\n for (; k < n; ++k) {\n prev[k] = all;\n if (curr[k] !== all) out.push(k);\n }\n },\n\n modify(pulse, output) {\n const out = output.mod,\n bits = this.value,\n curr = bits.curr(),\n all = bits.all(),\n tuples = pulse.mod;\n let i, n, k;\n\n for (i = 0, n = tuples.length; i < n; ++i) {\n k = tuples[i]._index;\n if (curr[k] !== all) out.push(k);\n }\n },\n\n remove(_, pulse, output) {\n const indices = this._indices,\n bits = this.value,\n curr = bits.curr(),\n prev = bits.prev(),\n all = bits.all(),\n map = {},\n out = output.rem,\n tuples = pulse.rem;\n let i, n, k, f; // process tuples, output if passes at least one filter\n\n for (i = 0, n = tuples.length; i < n; ++i) {\n k = tuples[i]._index;\n map[k] = 1; // build index map\n\n prev[k] = f = curr[k];\n curr[k] = all;\n if (f !== all) out.push(k);\n } // remove from dimensional indices\n\n\n for (k in indices) {\n indices[k].remove(n, map);\n }\n\n this.reindex(pulse, n, map);\n return map;\n },\n\n // reindex filters and indices after propagation completes\n reindex(pulse, num, map) {\n const indices = this._indices,\n bits = this.value;\n pulse.runAfter(() => {\n const indexMap = bits.remove(num, map);\n\n for (const key in indices) indices[key].reindex(indexMap);\n });\n },\n\n update(_, pulse, output) {\n const dims = this._dims,\n query = _.query,\n stamp = pulse.stamp,\n m = dims.length;\n let mask = 0,\n i,\n q; // survey how many queries have changed\n\n output.filters = 0;\n\n for (q = 0; q < m; ++q) {\n if (_.modified('query', q)) {\n i = q;\n ++mask;\n }\n }\n\n if (mask === 1) {\n // only one query changed, use more efficient update\n mask = dims[i].one;\n this.incrementOne(dims[i], query[i], output.add, output.rem);\n } else {\n // multiple queries changed, perform full record keeping\n for (q = 0, mask = 0; q < m; ++q) {\n if (!_.modified('query', q)) continue;\n mask |= dims[q].one;\n this.incrementAll(dims[q], query[q], stamp, output.add);\n output.rem = output.add; // duplicate add/rem for downstream resolve\n }\n }\n\n return mask;\n },\n\n incrementAll(dim, query, stamp, out) {\n const bits = this.value,\n seen = bits.seen(),\n curr = bits.curr(),\n prev = bits.prev(),\n index = dim.index(),\n old = dim.bisect(dim.range),\n range = dim.bisect(query),\n lo1 = range[0],\n hi1 = range[1],\n lo0 = old[0],\n hi0 = old[1],\n one = dim.one;\n let i, j, k; // Fast incremental update based on previous lo index.\n\n if (lo1 < lo0) {\n for (i = lo1, j = Math.min(lo0, hi1); i < j; ++i) {\n k = index[i];\n\n if (seen[k] !== stamp) {\n prev[k] = curr[k];\n seen[k] = stamp;\n out.push(k);\n }\n\n curr[k] ^= one;\n }\n } else if (lo1 > lo0) {\n for (i = lo0, j = Math.min(lo1, hi0); i < j; ++i) {\n k = index[i];\n\n if (seen[k] !== stamp) {\n prev[k] = curr[k];\n seen[k] = stamp;\n out.push(k);\n }\n\n curr[k] ^= one;\n }\n } // Fast incremental update based on previous hi index.\n\n\n if (hi1 > hi0) {\n for (i = Math.max(lo1, hi0), j = hi1; i < j; ++i) {\n k = index[i];\n\n if (seen[k] !== stamp) {\n prev[k] = curr[k];\n seen[k] = stamp;\n out.push(k);\n }\n\n curr[k] ^= one;\n }\n } else if (hi1 < hi0) {\n for (i = Math.max(lo0, hi1), j = hi0; i < j; ++i) {\n k = index[i];\n\n if (seen[k] !== stamp) {\n prev[k] = curr[k];\n seen[k] = stamp;\n out.push(k);\n }\n\n curr[k] ^= one;\n }\n }\n\n dim.range = query.slice();\n },\n\n incrementOne(dim, query, add, rem) {\n const bits = this.value,\n curr = bits.curr(),\n index = dim.index(),\n old = dim.bisect(dim.range),\n range = dim.bisect(query),\n lo1 = range[0],\n hi1 = range[1],\n lo0 = old[0],\n hi0 = old[1],\n one = dim.one;\n let i, j, k; // Fast incremental update based on previous lo index.\n\n if (lo1 < lo0) {\n for (i = lo1, j = Math.min(lo0, hi1); i < j; ++i) {\n k = index[i];\n curr[k] ^= one;\n add.push(k);\n }\n } else if (lo1 > lo0) {\n for (i = lo0, j = Math.min(lo1, hi0); i < j; ++i) {\n k = index[i];\n curr[k] ^= one;\n rem.push(k);\n }\n } // Fast incremental update based on previous hi index.\n\n\n if (hi1 > hi0) {\n for (i = Math.max(lo1, hi0), j = hi1; i < j; ++i) {\n k = index[i];\n curr[k] ^= one;\n add.push(k);\n }\n } else if (hi1 < hi0) {\n for (i = Math.max(lo0, hi1), j = hi0; i < j; ++i) {\n k = index[i];\n curr[k] ^= one;\n rem.push(k);\n }\n }\n\n dim.range = query.slice();\n }\n\n});\n\n/**\n * Selectively filters tuples by resolving against a filter bitmap.\n * Useful for processing the output of a cross-filter transform.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {object} params.ignore - A bit mask indicating which filters to ignore.\n * @param {object} params.filter - The per-tuple filter bitmaps. Typically this\n * parameter value is a reference to a {@link CrossFilter} transform.\n */\n\nfunction ResolveFilter(params) {\n Transform.call(this, null, params);\n}\nResolveFilter.Definition = {\n 'type': 'ResolveFilter',\n 'metadata': {},\n 'params': [{\n 'name': 'ignore',\n 'type': 'number',\n 'required': true,\n 'description': 'A bit mask indicating which filters to ignore.'\n }, {\n 'name': 'filter',\n 'type': 'object',\n 'required': true,\n 'description': 'Per-tuple filter bitmaps from a CrossFilter transform.'\n }]\n};\ninherits(ResolveFilter, Transform, {\n transform(_, pulse) {\n const ignore = ~(_.ignore || 0),\n // bit mask where zeros -> dims to ignore\n bitmap = _.filter,\n mask = bitmap.mask; // exit early if no relevant filter changes\n\n if ((mask & ignore) === 0) return pulse.StopPropagation;\n\n const output = pulse.fork(pulse.ALL),\n data = bitmap.data(),\n curr = bitmap.curr(),\n prev = bitmap.prev(),\n pass = k => !(curr[k] & ignore) ? data[k] : null; // propagate all mod tuples that pass the filter\n\n\n output.filter(output.MOD, pass); // determine add & rem tuples via filter functions\n // for efficiency, we do *not* populate new arrays,\n // instead we add filter functions applied downstream\n\n if (!(mask & mask - 1)) {\n // only one filter changed\n output.filter(output.ADD, pass);\n output.filter(output.REM, k => (curr[k] & ignore) === mask ? data[k] : null);\n } else {\n // multiple filters changed\n output.filter(output.ADD, k => {\n const c = curr[k] & ignore,\n f = !c && c ^ prev[k] & ignore;\n return f ? data[k] : null;\n });\n output.filter(output.REM, k => {\n const c = curr[k] & ignore,\n f = c && !(c ^ (c ^ prev[k] & ignore));\n return f ? data[k] : null;\n });\n } // add filter to source data in case of reflow...\n\n\n return output.filter(output.SOURCE, t => pass(t._index));\n }\n\n});\n\nexport { CrossFilter as crossfilter, ResolveFilter as resolvefilter };\n","export default function permute(source, keys) {\n return Array.from(keys, key => source[key]);\n}\n","import { error, toSet, isFunction, isString, hasOwnProperty } from 'vega-util';\n\nconst RawCode = 'RawCode';\nconst Literal = 'Literal';\nconst Property = 'Property';\nconst Identifier = 'Identifier';\nconst ArrayExpression = 'ArrayExpression';\nconst BinaryExpression = 'BinaryExpression';\nconst CallExpression = 'CallExpression';\nconst ConditionalExpression = 'ConditionalExpression';\nconst LogicalExpression = 'LogicalExpression';\nconst MemberExpression = 'MemberExpression';\nconst ObjectExpression = 'ObjectExpression';\nconst UnaryExpression = 'UnaryExpression';\nfunction ASTNode(type) {\n this.type = type;\n}\n\nASTNode.prototype.visit = function (visitor) {\n let c, i, n;\n if (visitor(this)) return 1;\n\n for (c = children(this), i = 0, n = c.length; i < n; ++i) {\n if (c[i].visit(visitor)) return 1;\n }\n};\n\nfunction children(node) {\n switch (node.type) {\n case ArrayExpression:\n return node.elements;\n\n case BinaryExpression:\n case LogicalExpression:\n return [node.left, node.right];\n\n case CallExpression:\n return [node.callee].concat(node.arguments);\n\n case ConditionalExpression:\n return [node.test, node.consequent, node.alternate];\n\n case MemberExpression:\n return [node.object, node.property];\n\n case ObjectExpression:\n return node.properties;\n\n case Property:\n return [node.key, node.value];\n\n case UnaryExpression:\n return [node.argument];\n\n case Identifier:\n case Literal:\n case RawCode:\n default:\n return [];\n }\n}\n\n/*\n The following expression parser is based on Esprima (http://esprima.org/).\n Original header comment and license for Esprima is included here:\n\n Copyright (C) 2013 Ariya Hidayat \n Copyright (C) 2013 Thaddee Tyl \n Copyright (C) 2013 Mathias Bynens \n Copyright (C) 2012 Ariya Hidayat \n Copyright (C) 2012 Mathias Bynens \n Copyright (C) 2012 Joost-Wim Boekesteijn \n Copyright (C) 2012 Kris Kowal \n Copyright (C) 2012 Yusuke Suzuki \n Copyright (C) 2012 Arpad Borsos \n Copyright (C) 2011 Ariya Hidayat \n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY\n DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\nvar TokenName, source, index, length, lookahead;\nvar TokenBooleanLiteral = 1,\n TokenEOF = 2,\n TokenIdentifier = 3,\n TokenKeyword = 4,\n TokenNullLiteral = 5,\n TokenNumericLiteral = 6,\n TokenPunctuator = 7,\n TokenStringLiteral = 8,\n TokenRegularExpression = 9;\nTokenName = {};\nTokenName[TokenBooleanLiteral] = 'Boolean';\nTokenName[TokenEOF] = '';\nTokenName[TokenIdentifier] = 'Identifier';\nTokenName[TokenKeyword] = 'Keyword';\nTokenName[TokenNullLiteral] = 'Null';\nTokenName[TokenNumericLiteral] = 'Numeric';\nTokenName[TokenPunctuator] = 'Punctuator';\nTokenName[TokenStringLiteral] = 'String';\nTokenName[TokenRegularExpression] = 'RegularExpression';\nvar SyntaxArrayExpression = 'ArrayExpression',\n SyntaxBinaryExpression = 'BinaryExpression',\n SyntaxCallExpression = 'CallExpression',\n SyntaxConditionalExpression = 'ConditionalExpression',\n SyntaxIdentifier = 'Identifier',\n SyntaxLiteral = 'Literal',\n SyntaxLogicalExpression = 'LogicalExpression',\n SyntaxMemberExpression = 'MemberExpression',\n SyntaxObjectExpression = 'ObjectExpression',\n SyntaxProperty = 'Property',\n SyntaxUnaryExpression = 'UnaryExpression'; // Error messages should be identical to V8.\n\nvar MessageUnexpectedToken = 'Unexpected token %0',\n MessageUnexpectedNumber = 'Unexpected number',\n MessageUnexpectedString = 'Unexpected string',\n MessageUnexpectedIdentifier = 'Unexpected identifier',\n MessageUnexpectedReserved = 'Unexpected reserved word',\n MessageUnexpectedEOS = 'Unexpected end of input',\n MessageInvalidRegExp = 'Invalid regular expression',\n MessageUnterminatedRegExp = 'Invalid regular expression: missing /',\n MessageStrictOctalLiteral = 'Octal literals are not allowed in strict mode.',\n MessageStrictDuplicateProperty = 'Duplicate data property in object literal not allowed in strict mode';\nvar ILLEGAL = 'ILLEGAL',\n DISABLED = 'Disabled.'; // See also tools/generate-unicode-regex.py.\n\nvar RegexNonAsciiIdentifierStart = new RegExp('[\\\\xAA\\\\xB5\\\\xBA\\\\xC0-\\\\xD6\\\\xD8-\\\\xF6\\\\xF8-\\\\u02C1\\\\u02C6-\\\\u02D1\\\\u02E0-\\\\u02E4\\\\u02EC\\\\u02EE\\\\u0370-\\\\u0374\\\\u0376\\\\u0377\\\\u037A-\\\\u037D\\\\u037F\\\\u0386\\\\u0388-\\\\u038A\\\\u038C\\\\u038E-\\\\u03A1\\\\u03A3-\\\\u03F5\\\\u03F7-\\\\u0481\\\\u048A-\\\\u052F\\\\u0531-\\\\u0556\\\\u0559\\\\u0561-\\\\u0587\\\\u05D0-\\\\u05EA\\\\u05F0-\\\\u05F2\\\\u0620-\\\\u064A\\\\u066E\\\\u066F\\\\u0671-\\\\u06D3\\\\u06D5\\\\u06E5\\\\u06E6\\\\u06EE\\\\u06EF\\\\u06FA-\\\\u06FC\\\\u06FF\\\\u0710\\\\u0712-\\\\u072F\\\\u074D-\\\\u07A5\\\\u07B1\\\\u07CA-\\\\u07EA\\\\u07F4\\\\u07F5\\\\u07FA\\\\u0800-\\\\u0815\\\\u081A\\\\u0824\\\\u0828\\\\u0840-\\\\u0858\\\\u08A0-\\\\u08B2\\\\u0904-\\\\u0939\\\\u093D\\\\u0950\\\\u0958-\\\\u0961\\\\u0971-\\\\u0980\\\\u0985-\\\\u098C\\\\u098F\\\\u0990\\\\u0993-\\\\u09A8\\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-\\\\u0D10\\\\u0D12-\\\\u0D3A\\\\u0D3D\\\\u0D4E\\\\u0D60\\\\u0D61\\\\u0D7A-\\\\u0D7F\\\\u0D85-\\\\u0D96\\\\u0D9A-\\\\u0DB1\\\\u0DB3-\\\\u0DBB\\\\u0DBD\\\\u0DC0-\\\\u0DC6\\\\u0E01-\\\\u0E30\\\\u0E32\\\\u0E33\\\\u0E40-\\\\u0E46\\\\u0E81\\\\u0E82\\\\u0E84\\\\u0E87\\\\u0E88\\\\u0E8A\\\\u0E8D\\\\u0E94-\\\\u0E97\\\\u0E99-\\\\u0E9F\\\\u0EA1-\\\\u0EA3\\\\u0EA5\\\\u0EA7\\\\u0EAA\\\\u0EAB\\\\u0EAD-\\\\u0EB0\\\\u0EB2\\\\u0EB3\\\\u0EBD\\\\u0EC0-\\\\u0EC4\\\\u0EC6\\\\u0EDC-\\\\u0EDF\\\\u0F00\\\\u0F40-\\\\u0F47\\\\u0F49-\\\\u0F6C\\\\u0F88-\\\\u0F8C\\\\u1000-\\\\u102A\\\\u103F\\\\u1050-\\\\u1055\\\\u105A-\\\\u105D\\\\u1061\\\\u1065\\\\u1066\\\\u106E-\\\\u1070\\\\u1075-\\\\u1081\\\\u108E\\\\u10A0-\\\\u10C5\\\\u10C7\\\\u10CD\\\\u10D0-\\\\u10FA\\\\u10FC-\\\\u1248\\\\u124A-\\\\u124D\\\\u1250-\\\\u1256\\\\u1258\\\\u125A-\\\\u125D\\\\u1260-\\\\u1288\\\\u128A-\\\\u128D\\\\u1290-\\\\u12B0\\\\u12B2-\\\\u12B5\\\\u12B8-\\\\u12BE\\\\u12C0\\\\u12C2-\\\\u12C5\\\\u12C8-\\\\u12D6\\\\u12D8-\\\\u1310\\\\u1312-\\\\u1315\\\\u1318-\\\\u135A\\\\u1380-\\\\u138F\\\\u13A0-\\\\u13F4\\\\u1401-\\\\u166C\\\\u166F-\\\\u167F\\\\u1681-\\\\u169A\\\\u16A0-\\\\u16EA\\\\u16EE-\\\\u16F8\\\\u1700-\\\\u170C\\\\u170E-\\\\u1711\\\\u1720-\\\\u1731\\\\u1740-\\\\u1751\\\\u1760-\\\\u176C\\\\u176E-\\\\u1770\\\\u1780-\\\\u17B3\\\\u17D7\\\\u17DC\\\\u1820-\\\\u1877\\\\u1880-\\\\u18A8\\\\u18AA\\\\u18B0-\\\\u18F5\\\\u1900-\\\\u191E\\\\u1950-\\\\u196D\\\\u1970-\\\\u1974\\\\u1980-\\\\u19AB\\\\u19C1-\\\\u19C7\\\\u1A00-\\\\u1A16\\\\u1A20-\\\\u1A54\\\\u1AA7\\\\u1B05-\\\\u1B33\\\\u1B45-\\\\u1B4B\\\\u1B83-\\\\u1BA0\\\\u1BAE\\\\u1BAF\\\\u1BBA-\\\\u1BE5\\\\u1C00-\\\\u1C23\\\\u1C4D-\\\\u1C4F\\\\u1C5A-\\\\u1C7D\\\\u1CE9-\\\\u1CEC\\\\u1CEE-\\\\u1CF1\\\\u1CF5\\\\u1CF6\\\\u1D00-\\\\u1DBF\\\\u1E00-\\\\u1F15\\\\u1F18-\\\\u1F1D\\\\u1F20-\\\\u1F45\\\\u1F48-\\\\u1F4D\\\\u1F50-\\\\u1F57\\\\u1F59\\\\u1F5B\\\\u1F5D\\\\u1F5F-\\\\u1F7D\\\\u1F80-\\\\u1FB4\\\\u1FB6-\\\\u1FBC\\\\u1FBE\\\\u1FC2-\\\\u1FC4\\\\u1FC6-\\\\u1FCC\\\\u1FD0-\\\\u1FD3\\\\u1FD6-\\\\u1FDB\\\\u1FE0-\\\\u1FEC\\\\u1FF2-\\\\u1FF4\\\\u1FF6-\\\\u1FFC\\\\u2071\\\\u207F\\\\u2090-\\\\u209C\\\\u2102\\\\u2107\\\\u210A-\\\\u2113\\\\u2115\\\\u2119-\\\\u211D\\\\u2124\\\\u2126\\\\u2128\\\\u212A-\\\\u212D\\\\u212F-\\\\u2139\\\\u213C-\\\\u213F\\\\u2145-\\\\u2149\\\\u214E\\\\u2160-\\\\u2188\\\\u2C00-\\\\u2C2E\\\\u2C30-\\\\u2C5E\\\\u2C60-\\\\u2CE4\\\\u2CEB-\\\\u2CEE\\\\u2CF2\\\\u2CF3\\\\u2D00-\\\\u2D25\\\\u2D27\\\\u2D2D\\\\u2D30-\\\\u2D67\\\\u2D6F\\\\u2D80-\\\\u2D96\\\\u2DA0-\\\\u2DA6\\\\u2DA8-\\\\u2DAE\\\\u2DB0-\\\\u2DB6\\\\u2DB8-\\\\u2DBE\\\\u2DC0-\\\\u2DC6\\\\u2DC8-\\\\u2DCE\\\\u2DD0-\\\\u2DD6\\\\u2DD8-\\\\u2DDE\\\\u2E2F\\\\u3005-\\\\u3007\\\\u3021-\\\\u3029\\\\u3031-\\\\u3035\\\\u3038-\\\\u303C\\\\u3041-\\\\u3096\\\\u309D-\\\\u309F\\\\u30A1-\\\\u30FA\\\\u30FC-\\\\u30FF\\\\u3105-\\\\u312D\\\\u3131-\\\\u318E\\\\u31A0-\\\\u31BA\\\\u31F0-\\\\u31FF\\\\u3400-\\\\u4DB5\\\\u4E00-\\\\u9FCC\\\\uA000-\\\\uA48C\\\\uA4D0-\\\\uA4FD\\\\uA500-\\\\uA60C\\\\uA610-\\\\uA61F\\\\uA62A\\\\uA62B\\\\uA640-\\\\uA66E\\\\uA67F-\\\\uA69D\\\\uA6A0-\\\\uA6EF\\\\uA717-\\\\uA71F\\\\uA722-\\\\uA788\\\\uA78B-\\\\uA78E\\\\uA790-\\\\uA7AD\\\\uA7B0\\\\uA7B1\\\\uA7F7-\\\\uA801\\\\uA803-\\\\uA805\\\\uA807-\\\\uA80A\\\\uA80C-\\\\uA822\\\\uA840-\\\\uA873\\\\uA882-\\\\uA8B3\\\\uA8F2-\\\\uA8F7\\\\uA8FB\\\\uA90A-\\\\uA925\\\\uA930-\\\\uA946\\\\uA960-\\\\uA97C\\\\uA984-\\\\uA9B2\\\\uA9CF\\\\uA9E0-\\\\uA9E4\\\\uA9E6-\\\\uA9EF\\\\uA9FA-\\\\uA9FE\\\\uAA00-\\\\uAA28\\\\uAA40-\\\\uAA42\\\\uAA44-\\\\uAA4B\\\\uAA60-\\\\uAA76\\\\uAA7A\\\\uAA7E-\\\\uAAAF\\\\uAAB1\\\\uAAB5\\\\uAAB6\\\\uAAB9-\\\\uAABD\\\\uAAC0\\\\uAAC2\\\\uAADB-\\\\uAADD\\\\uAAE0-\\\\uAAEA\\\\uAAF2-\\\\uAAF4\\\\uAB01-\\\\uAB06\\\\uAB09-\\\\uAB0E\\\\uAB11-\\\\uAB16\\\\uAB20-\\\\uAB26\\\\uAB28-\\\\uAB2E\\\\uAB30-\\\\uAB5A\\\\uAB5C-\\\\uAB5F\\\\uAB64\\\\uAB65\\\\uABC0-\\\\uABE2\\\\uAC00-\\\\uD7A3\\\\uD7B0-\\\\uD7C6\\\\uD7CB-\\\\uD7FB\\\\uF900-\\\\uFA6D\\\\uFA70-\\\\uFAD9\\\\uFB00-\\\\uFB06\\\\uFB13-\\\\uFB17\\\\uFB1D\\\\uFB1F-\\\\uFB28\\\\uFB2A-\\\\uFB36\\\\uFB38-\\\\uFB3C\\\\uFB3E\\\\uFB40\\\\uFB41\\\\uFB43\\\\uFB44\\\\uFB46-\\\\uFBB1\\\\uFBD3-\\\\uFD3D\\\\uFD50-\\\\uFD8F\\\\uFD92-\\\\uFDC7\\\\uFDF0-\\\\uFDFB\\\\uFE70-\\\\uFE74\\\\uFE76-\\\\uFEFC\\\\uFF21-\\\\uFF3A\\\\uFF41-\\\\uFF5A\\\\uFF66-\\\\uFFBE\\\\uFFC2-\\\\uFFC7\\\\uFFCA-\\\\uFFCF\\\\uFFD2-\\\\uFFD7\\\\uFFDA-\\\\uFFDC]'),\n // eslint-disable-next-line no-misleading-character-class\nRegexNonAsciiIdentifierPart = new RegExp('[\\\\xAA\\\\xB5\\\\xBA\\\\xC0-\\\\xD6\\\\xD8-\\\\xF6\\\\xF8-\\\\u02C1\\\\u02C6-\\\\u02D1\\\\u02E0-\\\\u02E4\\\\u02EC\\\\u02EE\\\\u0300-\\\\u0374\\\\u0376\\\\u0377\\\\u037A-\\\\u037D\\\\u037F\\\\u0386\\\\u0388-\\\\u038A\\\\u038C\\\\u038E-\\\\u03A1\\\\u03A3-\\\\u03F5\\\\u03F7-\\\\u0481\\\\u0483-\\\\u0487\\\\u048A-\\\\u052F\\\\u0531-\\\\u0556\\\\u0559\\\\u0561-\\\\u0587\\\\u0591-\\\\u05BD\\\\u05BF\\\\u05C1\\\\u05C2\\\\u05C4\\\\u05C5\\\\u05C7\\\\u05D0-\\\\u05EA\\\\u05F0-\\\\u05F2\\\\u0610-\\\\u061A\\\\u0620-\\\\u0669\\\\u066E-\\\\u06D3\\\\u06D5-\\\\u06DC\\\\u06DF-\\\\u06E8\\\\u06EA-\\\\u06FC\\\\u06FF\\\\u0710-\\\\u074A\\\\u074D-\\\\u07B1\\\\u07C0-\\\\u07F5\\\\u07FA\\\\u0800-\\\\u082D\\\\u0840-\\\\u085B\\\\u08A0-\\\\u08B2\\\\u08E4-\\\\u0963\\\\u0966-\\\\u096F\\\\u0971-\\\\u0983\\\\u0985-\\\\u098C\\\\u098F\\\\u0990\\\\u0993-\\\\u09A8\\\\u09AA-\\\\u09B0\\\\u09B2\\\\u09B6-\\\\u09B9\\\\u09BC-\\\\u09C4\\\\u09C7\\\\u09C8\\\\u09CB-\\\\u09CE\\\\u09D7\\\\u09DC\\\\u09DD\\\\u09DF-\\\\u09E3\\\\u09E6-\\\\u09F1\\\\u0A01-\\\\u0A03\\\\u0A05-\\\\u0A0A\\\\u0A0F\\\\u0A10\\\\u0A13-\\\\u0A28\\\\u0A2A-\\\\u0A30\\\\u0A32\\\\u0A33\\\\u0A35\\\\u0A36\\\\u0A38\\\\u0A39\\\\u0A3C\\\\u0A3E-\\\\u0A42\\\\u0A47\\\\u0A48\\\\u0A4B-\\\\u0A4D\\\\u0A51\\\\u0A59-\\\\u0A5C\\\\u0A5E\\\\u0A66-\\\\u0A75\\\\u0A81-\\\\u0A83\\\\u0A85-\\\\u0A8D\\\\u0A8F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\\\u109D\\\\u10A0-\\\\u10C5\\\\u10C7\\\\u10CD\\\\u10D0-\\\\u10FA\\\\u10FC-\\\\u1248\\\\u124A-\\\\u124D\\\\u1250-\\\\u1256\\\\u1258\\\\u125A-\\\\u125D\\\\u1260-\\\\u1288\\\\u128A-\\\\u128D\\\\u1290-\\\\u12B0\\\\u12B2-\\\\u12B5\\\\u12B8-\\\\u12BE\\\\u12C0\\\\u12C2-\\\\u12C5\\\\u12C8-\\\\u12D6\\\\u12D8-\\\\u1310\\\\u1312-\\\\u1315\\\\u1318-\\\\u135A\\\\u135D-\\\\u135F\\\\u1380-\\\\u138F\\\\u13A0-\\\\u13F4\\\\u1401-\\\\u166C\\\\u166F-\\\\u167F\\\\u1681-\\\\u169A\\\\u16A0-\\\\u16EA\\\\u16EE-\\\\u16F8\\\\u1700-\\\\u170C\\\\u170E-\\\\u1714\\\\u1720-\\\\u1734\\\\u1740-\\\\u1753\\\\u1760-\\\\u176C\\\\u176E-\\\\u1770\\\\u1772\\\\u1773\\\\u1780-\\\\u17D3\\\\u17D7\\\\u17DC\\\\u17DD\\\\u17E0-\\\\u17E9\\\\u180B-\\\\u180D\\\\u1810-\\\\u1819\\\\u1820-\\\\u1877\\\\u1880-\\\\u18AA\\\\u18B0-\\\\u18F5\\\\u1900-\\\\u191E\\\\u1920-\\\\u192B\\\\u1930-\\\\u193B\\\\u1946-\\\\u196D\\\\u1970-\\\\u1974\\\\u1980-\\\\u19AB\\\\u19B0-\\\\u19C9\\\\u19D0-\\\\u19D9\\\\u1A00-\\\\u1A1B\\\\u1A20-\\\\u1A5E\\\\u1A60-\\\\u1A7C\\\\u1A7F-\\\\u1A89\\\\u1A90-\\\\u1A99\\\\u1AA7\\\\u1AB0-\\\\u1ABD\\\\u1B00-\\\\u1B4B\\\\u1B50-\\\\u1B59\\\\u1B6B-\\\\u1B73\\\\u1B80-\\\\u1BF3\\\\u1C00-\\\\u1C37\\\\u1C40-\\\\u1C49\\\\u1C4D-\\\\u1C7D\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\u3038-\\\\u303C\\\\u3041-\\\\u3096\\\\u3099\\\\u309A\\\\u309D-\\\\u309F\\\\u30A1-\\\\u30FA\\\\u30FC-\\\\u30FF\\\\u3105-\\\\u312D\\\\u3131-\\\\u318E\\\\u31A0-\\\\u31BA\\\\u31F0-\\\\u31FF\\\\u3400-\\\\u4DB5\\\\u4E00-\\\\u9FCC\\\\uA000-\\\\uA48C\\\\uA4D0-\\\\uA4FD\\\\uA500-\\\\uA60C\\\\uA610-\\\\uA62B\\\\uA640-\\\\uA66F\\\\uA674-\\\\uA67D\\\\uA67F-\\\\uA69D\\\\uA69F-\\\\uA6F1\\\\uA717-\\\\uA71F\\\\uA722-\\\\uA788\\\\uA78B-\\\\uA78E\\\\uA790-\\\\uA7AD\\\\uA7B0\\\\uA7B1\\\\uA7F7-\\\\uA827\\\\uA840-\\\\uA873\\\\uA880-\\\\uA8C4\\\\uA8D0-\\\\uA8D9\\\\uA8E0-\\\\uA8F7\\\\uA8FB\\\\uA900-\\\\uA92D\\\\uA930-\\\\uA953\\\\uA960-\\\\uA97C\\\\uA980-\\\\uA9C0\\\\uA9CF-\\\\uA9D9\\\\uA9E0-\\\\uA9FE\\\\uAA00-\\\\uAA36\\\\uAA40-\\\\uAA4D\\\\uAA50-\\\\uAA59\\\\uAA60-\\\\uAA76\\\\uAA7A-\\\\uAAC2\\\\uAADB-\\\\uAADD\\\\uAAE0-\\\\uAAEF\\\\uAAF2-\\\\uAAF6\\\\uAB01-\\\\uAB06\\\\uAB09-\\\\uAB0E\\\\uAB11-\\\\uAB16\\\\uAB20-\\\\uAB26\\\\uAB28-\\\\uAB2E\\\\uAB30-\\\\uAB5A\\\\uAB5C-\\\\uAB5F\\\\uAB64\\\\uAB65\\\\uABC0-\\\\uABEA\\\\uABEC\\\\uABED\\\\uABF0-\\\\uABF9\\\\uAC00-\\\\uD7A3\\\\uD7B0-\\\\uD7C6\\\\uD7CB-\\\\uD7FB\\\\uF900-\\\\uFA6D\\\\uFA70-\\\\uFAD9\\\\uFB00-\\\\uFB06\\\\uFB13-\\\\uFB17\\\\uFB1D-\\\\uFB28\\\\uFB2A-\\\\uFB36\\\\uFB38-\\\\uFB3C\\\\uFB3E\\\\uFB40\\\\uFB41\\\\uFB43\\\\uFB44\\\\uFB46-\\\\uFBB1\\\\uFBD3-\\\\uFD3D\\\\uFD50-\\\\uFD8F\\\\uFD92-\\\\uFDC7\\\\uFDF0-\\\\uFDFB\\\\uFE00-\\\\uFE0F\\\\uFE20-\\\\uFE2D\\\\uFE33\\\\uFE34\\\\uFE4D-\\\\uFE4F\\\\uFE70-\\\\uFE74\\\\uFE76-\\\\uFEFC\\\\uFF10-\\\\uFF19\\\\uFF21-\\\\uFF3A\\\\uFF3F\\\\uFF41-\\\\uFF5A\\\\uFF66-\\\\uFFBE\\\\uFFC2-\\\\uFFC7\\\\uFFCA-\\\\uFFCF\\\\uFFD2-\\\\uFFD7\\\\uFFDA-\\\\uFFDC]'); // Ensure the condition is true, otherwise throw an error.\n// This is only to have a better contract semantic, i.e. another safety net\n// to catch a logic error. The condition shall be fulfilled in normal case.\n// Do NOT use this to enforce a certain condition on any user input.\n\nfunction assert(condition, message) {\n /* istanbul ignore next */\n if (!condition) {\n throw new Error('ASSERT: ' + message);\n }\n}\n\nfunction isDecimalDigit(ch) {\n return ch >= 0x30 && ch <= 0x39; // 0..9\n}\n\nfunction isHexDigit(ch) {\n return '0123456789abcdefABCDEF'.indexOf(ch) >= 0;\n}\n\nfunction isOctalDigit(ch) {\n return '01234567'.indexOf(ch) >= 0;\n} // 7.2 White Space\n\n\nfunction isWhiteSpace(ch) {\n return ch === 0x20 || ch === 0x09 || ch === 0x0B || ch === 0x0C || ch === 0xA0 || ch >= 0x1680 && [0x1680, 0x180E, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(ch) >= 0;\n} // 7.3 Line Terminators\n\n\nfunction isLineTerminator(ch) {\n return ch === 0x0A || ch === 0x0D || ch === 0x2028 || ch === 0x2029;\n} // 7.6 Identifier Names and Identifiers\n\n\nfunction isIdentifierStart(ch) {\n return ch === 0x24 || ch === 0x5F || // $ (dollar) and _ (underscore)\n ch >= 0x41 && ch <= 0x5A || // A..Z\n ch >= 0x61 && ch <= 0x7A || // a..z\n ch === 0x5C || // \\ (backslash)\n ch >= 0x80 && RegexNonAsciiIdentifierStart.test(String.fromCharCode(ch));\n}\n\nfunction isIdentifierPart(ch) {\n return ch === 0x24 || ch === 0x5F || // $ (dollar) and _ (underscore)\n ch >= 0x41 && ch <= 0x5A || // A..Z\n ch >= 0x61 && ch <= 0x7A || // a..z\n ch >= 0x30 && ch <= 0x39 || // 0..9\n ch === 0x5C || // \\ (backslash)\n ch >= 0x80 && RegexNonAsciiIdentifierPart.test(String.fromCharCode(ch));\n} // 7.6.1.1 Keywords\n\n\nconst keywords = {\n 'if': 1,\n 'in': 1,\n 'do': 1,\n 'var': 1,\n 'for': 1,\n 'new': 1,\n 'try': 1,\n 'let': 1,\n 'this': 1,\n 'else': 1,\n 'case': 1,\n 'void': 1,\n 'with': 1,\n 'enum': 1,\n 'while': 1,\n 'break': 1,\n 'catch': 1,\n 'throw': 1,\n 'const': 1,\n 'yield': 1,\n 'class': 1,\n 'super': 1,\n 'return': 1,\n 'typeof': 1,\n 'delete': 1,\n 'switch': 1,\n 'export': 1,\n 'import': 1,\n 'public': 1,\n 'static': 1,\n 'default': 1,\n 'finally': 1,\n 'extends': 1,\n 'package': 1,\n 'private': 1,\n 'function': 1,\n 'continue': 1,\n 'debugger': 1,\n 'interface': 1,\n 'protected': 1,\n 'instanceof': 1,\n 'implements': 1\n};\n\nfunction skipComment() {\n while (index < length) {\n const ch = source.charCodeAt(index);\n\n if (isWhiteSpace(ch) || isLineTerminator(ch)) {\n ++index;\n } else {\n break;\n }\n }\n}\n\nfunction scanHexEscape(prefix) {\n var i,\n len,\n ch,\n code = 0;\n len = prefix === 'u' ? 4 : 2;\n\n for (i = 0; i < len; ++i) {\n if (index < length && isHexDigit(source[index])) {\n ch = source[index++];\n code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase());\n } else {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n }\n\n return String.fromCharCode(code);\n}\n\nfunction scanUnicodeCodePointEscape() {\n var ch, code, cu1, cu2;\n ch = source[index];\n code = 0; // At least, one hex digit is required.\n\n if (ch === '}') {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n while (index < length) {\n ch = source[index++];\n\n if (!isHexDigit(ch)) {\n break;\n }\n\n code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase());\n }\n\n if (code > 0x10FFFF || ch !== '}') {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n } // UTF-16 Encoding\n\n\n if (code <= 0xFFFF) {\n return String.fromCharCode(code);\n }\n\n cu1 = (code - 0x10000 >> 10) + 0xD800;\n cu2 = (code - 0x10000 & 1023) + 0xDC00;\n return String.fromCharCode(cu1, cu2);\n}\n\nfunction getEscapedIdentifier() {\n var ch, id;\n ch = source.charCodeAt(index++);\n id = String.fromCharCode(ch); // '\\u' (U+005C, U+0075) denotes an escaped character.\n\n if (ch === 0x5C) {\n if (source.charCodeAt(index) !== 0x75) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n ++index;\n ch = scanHexEscape('u');\n\n if (!ch || ch === '\\\\' || !isIdentifierStart(ch.charCodeAt(0))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n id = ch;\n }\n\n while (index < length) {\n ch = source.charCodeAt(index);\n\n if (!isIdentifierPart(ch)) {\n break;\n }\n\n ++index;\n id += String.fromCharCode(ch); // '\\u' (U+005C, U+0075) denotes an escaped character.\n\n if (ch === 0x5C) {\n id = id.substr(0, id.length - 1);\n\n if (source.charCodeAt(index) !== 0x75) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n ++index;\n ch = scanHexEscape('u');\n\n if (!ch || ch === '\\\\' || !isIdentifierPart(ch.charCodeAt(0))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n id += ch;\n }\n }\n\n return id;\n}\n\nfunction getIdentifier() {\n var start, ch;\n start = index++;\n\n while (index < length) {\n ch = source.charCodeAt(index);\n\n if (ch === 0x5C) {\n // Blackslash (U+005C) marks Unicode escape sequence.\n index = start;\n return getEscapedIdentifier();\n }\n\n if (isIdentifierPart(ch)) {\n ++index;\n } else {\n break;\n }\n }\n\n return source.slice(start, index);\n}\n\nfunction scanIdentifier() {\n var start, id, type;\n start = index; // Backslash (U+005C) starts an escaped character.\n\n id = source.charCodeAt(index) === 0x5C ? getEscapedIdentifier() : getIdentifier(); // There is no keyword or literal with only one character.\n // Thus, it must be an identifier.\n\n if (id.length === 1) {\n type = TokenIdentifier;\n } else if (keywords.hasOwnProperty(id)) {\n // eslint-disable-line no-prototype-builtins\n type = TokenKeyword;\n } else if (id === 'null') {\n type = TokenNullLiteral;\n } else if (id === 'true' || id === 'false') {\n type = TokenBooleanLiteral;\n } else {\n type = TokenIdentifier;\n }\n\n return {\n type: type,\n value: id,\n start: start,\n end: index\n };\n} // 7.7 Punctuators\n\n\nfunction scanPunctuator() {\n var start = index,\n code = source.charCodeAt(index),\n code2,\n ch1 = source[index],\n ch2,\n ch3,\n ch4;\n\n switch (code) {\n // Check for most common single-character punctuators.\n case 0x2E: // . dot\n\n case 0x28: // ( open bracket\n\n case 0x29: // ) close bracket\n\n case 0x3B: // ; semicolon\n\n case 0x2C: // , comma\n\n case 0x7B: // { open curly brace\n\n case 0x7D: // } close curly brace\n\n case 0x5B: // [\n\n case 0x5D: // ]\n\n case 0x3A: // :\n\n case 0x3F: // ?\n\n case 0x7E:\n // ~\n ++index;\n return {\n type: TokenPunctuator,\n value: String.fromCharCode(code),\n start: start,\n end: index\n };\n\n default:\n code2 = source.charCodeAt(index + 1); // '=' (U+003D) marks an assignment or comparison operator.\n\n if (code2 === 0x3D) {\n switch (code) {\n case 0x2B: // +\n\n case 0x2D: // -\n\n case 0x2F: // /\n\n case 0x3C: // <\n\n case 0x3E: // >\n\n case 0x5E: // ^\n\n case 0x7C: // |\n\n case 0x25: // %\n\n case 0x26: // &\n\n case 0x2A:\n // *\n index += 2;\n return {\n type: TokenPunctuator,\n value: String.fromCharCode(code) + String.fromCharCode(code2),\n start: start,\n end: index\n };\n\n case 0x21: // !\n\n case 0x3D:\n // =\n index += 2; // !== and ===\n\n if (source.charCodeAt(index) === 0x3D) {\n ++index;\n }\n\n return {\n type: TokenPunctuator,\n value: source.slice(start, index),\n start: start,\n end: index\n };\n }\n }\n\n } // 4-character punctuator: >>>=\n\n\n ch4 = source.substr(index, 4);\n\n if (ch4 === '>>>=') {\n index += 4;\n return {\n type: TokenPunctuator,\n value: ch4,\n start: start,\n end: index\n };\n } // 3-character punctuators: === !== >>> <<= >>=\n\n\n ch3 = ch4.substr(0, 3);\n\n if (ch3 === '>>>' || ch3 === '<<=' || ch3 === '>>=') {\n index += 3;\n return {\n type: TokenPunctuator,\n value: ch3,\n start: start,\n end: index\n };\n } // Other 2-character punctuators: ++ -- << >> && ||\n\n\n ch2 = ch3.substr(0, 2);\n\n if (ch1 === ch2[1] && '+-<>&|'.indexOf(ch1) >= 0 || ch2 === '=>') {\n index += 2;\n return {\n type: TokenPunctuator,\n value: ch2,\n start: start,\n end: index\n };\n }\n\n if (ch2 === '//') {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n } // 1-character punctuators: < > = ! + - * % & | ^ /\n\n\n if ('<>=!+-*%&|^/'.indexOf(ch1) >= 0) {\n ++index;\n return {\n type: TokenPunctuator,\n value: ch1,\n start: start,\n end: index\n };\n }\n\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n} // 7.8.3 Numeric Literals\n\n\nfunction scanHexLiteral(start) {\n let number = '';\n\n while (index < length) {\n if (!isHexDigit(source[index])) {\n break;\n }\n\n number += source[index++];\n }\n\n if (number.length === 0) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n if (isIdentifierStart(source.charCodeAt(index))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n return {\n type: TokenNumericLiteral,\n value: parseInt('0x' + number, 16),\n start: start,\n end: index\n };\n}\n\nfunction scanOctalLiteral(start) {\n let number = '0' + source[index++];\n\n while (index < length) {\n if (!isOctalDigit(source[index])) {\n break;\n }\n\n number += source[index++];\n }\n\n if (isIdentifierStart(source.charCodeAt(index)) || isDecimalDigit(source.charCodeAt(index))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n return {\n type: TokenNumericLiteral,\n value: parseInt(number, 8),\n octal: true,\n start: start,\n end: index\n };\n}\n\nfunction scanNumericLiteral() {\n var number, start, ch;\n ch = source[index];\n assert(isDecimalDigit(ch.charCodeAt(0)) || ch === '.', 'Numeric literal must start with a decimal digit or a decimal point');\n start = index;\n number = '';\n\n if (ch !== '.') {\n number = source[index++];\n ch = source[index]; // Hex number starts with '0x'.\n // Octal number starts with '0'.\n\n if (number === '0') {\n if (ch === 'x' || ch === 'X') {\n ++index;\n return scanHexLiteral(start);\n }\n\n if (isOctalDigit(ch)) {\n return scanOctalLiteral(start);\n } // decimal number starts with '0' such as '09' is illegal.\n\n\n if (ch && isDecimalDigit(ch.charCodeAt(0))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n }\n\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n\n ch = source[index];\n }\n\n if (ch === '.') {\n number += source[index++];\n\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n\n ch = source[index];\n }\n\n if (ch === 'e' || ch === 'E') {\n number += source[index++];\n ch = source[index];\n\n if (ch === '+' || ch === '-') {\n number += source[index++];\n }\n\n if (isDecimalDigit(source.charCodeAt(index))) {\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n } else {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n }\n\n if (isIdentifierStart(source.charCodeAt(index))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n return {\n type: TokenNumericLiteral,\n value: parseFloat(number),\n start: start,\n end: index\n };\n} // 7.8.4 String Literals\n\n\nfunction scanStringLiteral() {\n var str = '',\n quote,\n start,\n ch,\n code,\n octal = false;\n quote = source[index];\n assert(quote === '\\'' || quote === '\"', 'String literal must starts with a quote');\n start = index;\n ++index;\n\n while (index < length) {\n ch = source[index++];\n\n if (ch === quote) {\n quote = '';\n break;\n } else if (ch === '\\\\') {\n ch = source[index++];\n\n if (!ch || !isLineTerminator(ch.charCodeAt(0))) {\n switch (ch) {\n case 'u':\n case 'x':\n if (source[index] === '{') {\n ++index;\n str += scanUnicodeCodePointEscape();\n } else {\n str += scanHexEscape(ch);\n }\n\n break;\n\n case 'n':\n str += '\\n';\n break;\n\n case 'r':\n str += '\\r';\n break;\n\n case 't':\n str += '\\t';\n break;\n\n case 'b':\n str += '\\b';\n break;\n\n case 'f':\n str += '\\f';\n break;\n\n case 'v':\n str += '\\x0B';\n break;\n\n default:\n if (isOctalDigit(ch)) {\n code = '01234567'.indexOf(ch); // \\0 is not octal escape sequence\n\n if (code !== 0) {\n octal = true;\n }\n\n if (index < length && isOctalDigit(source[index])) {\n octal = true;\n code = code * 8 + '01234567'.indexOf(source[index++]); // 3 digits are only allowed when string starts\n // with 0, 1, 2, 3\n\n if ('0123'.indexOf(ch) >= 0 && index < length && isOctalDigit(source[index])) {\n code = code * 8 + '01234567'.indexOf(source[index++]);\n }\n }\n\n str += String.fromCharCode(code);\n } else {\n str += ch;\n }\n\n break;\n }\n } else {\n if (ch === '\\r' && source[index] === '\\n') {\n ++index;\n }\n }\n } else if (isLineTerminator(ch.charCodeAt(0))) {\n break;\n } else {\n str += ch;\n }\n }\n\n if (quote !== '') {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n return {\n type: TokenStringLiteral,\n value: str,\n octal: octal,\n start: start,\n end: index\n };\n}\n\nfunction testRegExp(pattern, flags) {\n let tmp = pattern;\n\n if (flags.indexOf('u') >= 0) {\n // Replace each astral symbol and every Unicode code point\n // escape sequence with a single ASCII symbol to avoid throwing on\n // regular expressions that are only valid in combination with the\n // `/u` flag.\n // Note: replacing with the ASCII symbol `x` might cause false\n // negatives in unlikely scenarios. For example, `[\\u{61}-b]` is a\n // perfectly valid pattern that is equivalent to `[a-b]`, but it\n // would be replaced by `[x-b]` which throws an error.\n tmp = tmp.replace(/\\\\u\\{([0-9a-fA-F]+)\\}/g, ($0, $1) => {\n if (parseInt($1, 16) <= 0x10FFFF) {\n return 'x';\n }\n\n throwError({}, MessageInvalidRegExp);\n }).replace(/[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g, 'x');\n } // First, detect invalid regular expressions.\n\n\n try {\n new RegExp(tmp);\n } catch (e) {\n throwError({}, MessageInvalidRegExp);\n } // Return a regular expression object for this pattern-flag pair, or\n // `null` in case the current environment doesn't support the flags it\n // uses.\n\n\n try {\n return new RegExp(pattern, flags);\n } catch (exception) {\n return null;\n }\n}\n\nfunction scanRegExpBody() {\n var ch, str, classMarker, terminated, body;\n ch = source[index];\n assert(ch === '/', 'Regular expression literal must start with a slash');\n str = source[index++];\n classMarker = false;\n terminated = false;\n\n while (index < length) {\n ch = source[index++];\n str += ch;\n\n if (ch === '\\\\') {\n ch = source[index++]; // ECMA-262 7.8.5\n\n if (isLineTerminator(ch.charCodeAt(0))) {\n throwError({}, MessageUnterminatedRegExp);\n }\n\n str += ch;\n } else if (isLineTerminator(ch.charCodeAt(0))) {\n throwError({}, MessageUnterminatedRegExp);\n } else if (classMarker) {\n if (ch === ']') {\n classMarker = false;\n }\n } else {\n if (ch === '/') {\n terminated = true;\n break;\n } else if (ch === '[') {\n classMarker = true;\n }\n }\n }\n\n if (!terminated) {\n throwError({}, MessageUnterminatedRegExp);\n } // Exclude leading and trailing slash.\n\n\n body = str.substr(1, str.length - 2);\n return {\n value: body,\n literal: str\n };\n}\n\nfunction scanRegExpFlags() {\n var ch, str, flags;\n str = '';\n flags = '';\n\n while (index < length) {\n ch = source[index];\n\n if (!isIdentifierPart(ch.charCodeAt(0))) {\n break;\n }\n\n ++index;\n\n if (ch === '\\\\' && index < length) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n } else {\n flags += ch;\n str += ch;\n }\n }\n\n if (flags.search(/[^gimuy]/g) >= 0) {\n throwError({}, MessageInvalidRegExp, flags);\n }\n\n return {\n value: flags,\n literal: str\n };\n}\n\nfunction scanRegExp() {\n var start, body, flags, value;\n lookahead = null;\n skipComment();\n start = index;\n body = scanRegExpBody();\n flags = scanRegExpFlags();\n value = testRegExp(body.value, flags.value);\n return {\n literal: body.literal + flags.literal,\n value: value,\n regex: {\n pattern: body.value,\n flags: flags.value\n },\n start: start,\n end: index\n };\n}\n\nfunction isIdentifierName(token) {\n return token.type === TokenIdentifier || token.type === TokenKeyword || token.type === TokenBooleanLiteral || token.type === TokenNullLiteral;\n}\n\nfunction advance() {\n skipComment();\n\n if (index >= length) {\n return {\n type: TokenEOF,\n start: index,\n end: index\n };\n }\n\n const ch = source.charCodeAt(index);\n\n if (isIdentifierStart(ch)) {\n return scanIdentifier();\n } // Very common: ( and ) and ;\n\n\n if (ch === 0x28 || ch === 0x29 || ch === 0x3B) {\n return scanPunctuator();\n } // String literal starts with single quote (U+0027) or double quote (U+0022).\n\n\n if (ch === 0x27 || ch === 0x22) {\n return scanStringLiteral();\n } // Dot (.) U+002E can also start a floating-point number, hence the need\n // to check the next character.\n\n\n if (ch === 0x2E) {\n if (isDecimalDigit(source.charCodeAt(index + 1))) {\n return scanNumericLiteral();\n }\n\n return scanPunctuator();\n }\n\n if (isDecimalDigit(ch)) {\n return scanNumericLiteral();\n }\n\n return scanPunctuator();\n}\n\nfunction lex() {\n const token = lookahead;\n index = token.end;\n lookahead = advance();\n index = token.end;\n return token;\n}\n\nfunction peek() {\n const pos = index;\n lookahead = advance();\n index = pos;\n}\n\nfunction finishArrayExpression(elements) {\n const node = new ASTNode(SyntaxArrayExpression);\n node.elements = elements;\n return node;\n}\n\nfunction finishBinaryExpression(operator, left, right) {\n const node = new ASTNode(operator === '||' || operator === '&&' ? SyntaxLogicalExpression : SyntaxBinaryExpression);\n node.operator = operator;\n node.left = left;\n node.right = right;\n return node;\n}\n\nfunction finishCallExpression(callee, args) {\n const node = new ASTNode(SyntaxCallExpression);\n node.callee = callee;\n node.arguments = args;\n return node;\n}\n\nfunction finishConditionalExpression(test, consequent, alternate) {\n const node = new ASTNode(SyntaxConditionalExpression);\n node.test = test;\n node.consequent = consequent;\n node.alternate = alternate;\n return node;\n}\n\nfunction finishIdentifier(name) {\n const node = new ASTNode(SyntaxIdentifier);\n node.name = name;\n return node;\n}\n\nfunction finishLiteral(token) {\n const node = new ASTNode(SyntaxLiteral);\n node.value = token.value;\n node.raw = source.slice(token.start, token.end);\n\n if (token.regex) {\n if (node.raw === '//') {\n node.raw = '/(?:)/';\n }\n\n node.regex = token.regex;\n }\n\n return node;\n}\n\nfunction finishMemberExpression(accessor, object, property) {\n const node = new ASTNode(SyntaxMemberExpression);\n node.computed = accessor === '[';\n node.object = object;\n node.property = property;\n if (!node.computed) property.member = true;\n return node;\n}\n\nfunction finishObjectExpression(properties) {\n const node = new ASTNode(SyntaxObjectExpression);\n node.properties = properties;\n return node;\n}\n\nfunction finishProperty(kind, key, value) {\n const node = new ASTNode(SyntaxProperty);\n node.key = key;\n node.value = value;\n node.kind = kind;\n return node;\n}\n\nfunction finishUnaryExpression(operator, argument) {\n const node = new ASTNode(SyntaxUnaryExpression);\n node.operator = operator;\n node.argument = argument;\n node.prefix = true;\n return node;\n} // Throw an exception\n\n\nfunction throwError(token, messageFormat) {\n var error,\n args = Array.prototype.slice.call(arguments, 2),\n msg = messageFormat.replace(/%(\\d)/g, (whole, index) => {\n assert(index < args.length, 'Message reference must be in range');\n return args[index];\n });\n error = new Error(msg);\n error.index = index;\n error.description = msg;\n throw error;\n} // Throw an exception because of the token.\n\n\nfunction throwUnexpected(token) {\n if (token.type === TokenEOF) {\n throwError(token, MessageUnexpectedEOS);\n }\n\n if (token.type === TokenNumericLiteral) {\n throwError(token, MessageUnexpectedNumber);\n }\n\n if (token.type === TokenStringLiteral) {\n throwError(token, MessageUnexpectedString);\n }\n\n if (token.type === TokenIdentifier) {\n throwError(token, MessageUnexpectedIdentifier);\n }\n\n if (token.type === TokenKeyword) {\n throwError(token, MessageUnexpectedReserved);\n } // BooleanLiteral, NullLiteral, or Punctuator.\n\n\n throwError(token, MessageUnexpectedToken, token.value);\n} // Expect the next token to match the specified punctuator.\n// If not, an exception will be thrown.\n\n\nfunction expect(value) {\n const token = lex();\n\n if (token.type !== TokenPunctuator || token.value !== value) {\n throwUnexpected(token);\n }\n} // Return true if the next token matches the specified punctuator.\n\n\nfunction match(value) {\n return lookahead.type === TokenPunctuator && lookahead.value === value;\n} // Return true if the next token matches the specified keyword\n\n\nfunction matchKeyword(keyword) {\n return lookahead.type === TokenKeyword && lookahead.value === keyword;\n} // 11.1.4 Array Initialiser\n\n\nfunction parseArrayInitialiser() {\n const elements = [];\n index = lookahead.start;\n expect('[');\n\n while (!match(']')) {\n if (match(',')) {\n lex();\n elements.push(null);\n } else {\n elements.push(parseConditionalExpression());\n\n if (!match(']')) {\n expect(',');\n }\n }\n }\n\n lex();\n return finishArrayExpression(elements);\n} // 11.1.5 Object Initialiser\n\n\nfunction parseObjectPropertyKey() {\n index = lookahead.start;\n const token = lex(); // Note: This function is called only from parseObjectProperty(), where\n // EOF and Punctuator tokens are already filtered out.\n\n if (token.type === TokenStringLiteral || token.type === TokenNumericLiteral) {\n if (token.octal) {\n throwError(token, MessageStrictOctalLiteral);\n }\n\n return finishLiteral(token);\n }\n\n return finishIdentifier(token.value);\n}\n\nfunction parseObjectProperty() {\n var token, key, id, value;\n index = lookahead.start;\n token = lookahead;\n\n if (token.type === TokenIdentifier) {\n id = parseObjectPropertyKey();\n expect(':');\n value = parseConditionalExpression();\n return finishProperty('init', id, value);\n }\n\n if (token.type === TokenEOF || token.type === TokenPunctuator) {\n throwUnexpected(token);\n } else {\n key = parseObjectPropertyKey();\n expect(':');\n value = parseConditionalExpression();\n return finishProperty('init', key, value);\n }\n}\n\nfunction parseObjectInitialiser() {\n var properties = [],\n property,\n name,\n key,\n map = {},\n toString = String;\n index = lookahead.start;\n expect('{');\n\n while (!match('}')) {\n property = parseObjectProperty();\n\n if (property.key.type === SyntaxIdentifier) {\n name = property.key.name;\n } else {\n name = toString(property.key.value);\n }\n\n key = '$' + name;\n\n if (Object.prototype.hasOwnProperty.call(map, key)) {\n throwError({}, MessageStrictDuplicateProperty);\n } else {\n map[key] = true;\n }\n\n properties.push(property);\n\n if (!match('}')) {\n expect(',');\n }\n }\n\n expect('}');\n return finishObjectExpression(properties);\n} // 11.1.6 The Grouping Operator\n\n\nfunction parseGroupExpression() {\n expect('(');\n const expr = parseExpression();\n expect(')');\n return expr;\n} // 11.1 Primary Expressions\n\n\nconst legalKeywords = {\n 'if': 1\n};\n\nfunction parsePrimaryExpression() {\n var type, token, expr;\n\n if (match('(')) {\n return parseGroupExpression();\n }\n\n if (match('[')) {\n return parseArrayInitialiser();\n }\n\n if (match('{')) {\n return parseObjectInitialiser();\n }\n\n type = lookahead.type;\n index = lookahead.start;\n\n if (type === TokenIdentifier || legalKeywords[lookahead.value]) {\n expr = finishIdentifier(lex().value);\n } else if (type === TokenStringLiteral || type === TokenNumericLiteral) {\n if (lookahead.octal) {\n throwError(lookahead, MessageStrictOctalLiteral);\n }\n\n expr = finishLiteral(lex());\n } else if (type === TokenKeyword) {\n throw new Error(DISABLED);\n } else if (type === TokenBooleanLiteral) {\n token = lex();\n token.value = token.value === 'true';\n expr = finishLiteral(token);\n } else if (type === TokenNullLiteral) {\n token = lex();\n token.value = null;\n expr = finishLiteral(token);\n } else if (match('/') || match('/=')) {\n expr = finishLiteral(scanRegExp());\n peek();\n } else {\n throwUnexpected(lex());\n }\n\n return expr;\n} // 11.2 Left-Hand-Side Expressions\n\n\nfunction parseArguments() {\n const args = [];\n expect('(');\n\n if (!match(')')) {\n while (index < length) {\n args.push(parseConditionalExpression());\n\n if (match(')')) {\n break;\n }\n\n expect(',');\n }\n }\n\n expect(')');\n return args;\n}\n\nfunction parseNonComputedProperty() {\n index = lookahead.start;\n const token = lex();\n\n if (!isIdentifierName(token)) {\n throwUnexpected(token);\n }\n\n return finishIdentifier(token.value);\n}\n\nfunction parseNonComputedMember() {\n expect('.');\n return parseNonComputedProperty();\n}\n\nfunction parseComputedMember() {\n expect('[');\n const expr = parseExpression();\n expect(']');\n return expr;\n}\n\nfunction parseLeftHandSideExpressionAllowCall() {\n var expr, args, property;\n expr = parsePrimaryExpression();\n\n for (;;) {\n if (match('.')) {\n property = parseNonComputedMember();\n expr = finishMemberExpression('.', expr, property);\n } else if (match('(')) {\n args = parseArguments();\n expr = finishCallExpression(expr, args);\n } else if (match('[')) {\n property = parseComputedMember();\n expr = finishMemberExpression('[', expr, property);\n } else {\n break;\n }\n }\n\n return expr;\n} // 11.3 Postfix Expressions\n\n\nfunction parsePostfixExpression() {\n const expr = parseLeftHandSideExpressionAllowCall();\n\n if (lookahead.type === TokenPunctuator) {\n if (match('++') || match('--')) {\n throw new Error(DISABLED);\n }\n }\n\n return expr;\n} // 11.4 Unary Operators\n\n\nfunction parseUnaryExpression() {\n var token, expr;\n\n if (lookahead.type !== TokenPunctuator && lookahead.type !== TokenKeyword) {\n expr = parsePostfixExpression();\n } else if (match('++') || match('--')) {\n throw new Error(DISABLED);\n } else if (match('+') || match('-') || match('~') || match('!')) {\n token = lex();\n expr = parseUnaryExpression();\n expr = finishUnaryExpression(token.value, expr);\n } else if (matchKeyword('delete') || matchKeyword('void') || matchKeyword('typeof')) {\n throw new Error(DISABLED);\n } else {\n expr = parsePostfixExpression();\n }\n\n return expr;\n}\n\nfunction binaryPrecedence(token) {\n let prec = 0;\n\n if (token.type !== TokenPunctuator && token.type !== TokenKeyword) {\n return 0;\n }\n\n switch (token.value) {\n case '||':\n prec = 1;\n break;\n\n case '&&':\n prec = 2;\n break;\n\n case '|':\n prec = 3;\n break;\n\n case '^':\n prec = 4;\n break;\n\n case '&':\n prec = 5;\n break;\n\n case '==':\n case '!=':\n case '===':\n case '!==':\n prec = 6;\n break;\n\n case '<':\n case '>':\n case '<=':\n case '>=':\n case 'instanceof':\n case 'in':\n prec = 7;\n break;\n\n case '<<':\n case '>>':\n case '>>>':\n prec = 8;\n break;\n\n case '+':\n case '-':\n prec = 9;\n break;\n\n case '*':\n case '/':\n case '%':\n prec = 11;\n break;\n }\n\n return prec;\n} // 11.5 Multiplicative Operators\n// 11.6 Additive Operators\n// 11.7 Bitwise Shift Operators\n// 11.8 Relational Operators\n// 11.9 Equality Operators\n// 11.10 Binary Bitwise Operators\n// 11.11 Binary Logical Operators\n\n\nfunction parseBinaryExpression() {\n var marker, markers, expr, token, prec, stack, right, operator, left, i;\n marker = lookahead;\n left = parseUnaryExpression();\n token = lookahead;\n prec = binaryPrecedence(token);\n\n if (prec === 0) {\n return left;\n }\n\n token.prec = prec;\n lex();\n markers = [marker, lookahead];\n right = parseUnaryExpression();\n stack = [left, token, right];\n\n while ((prec = binaryPrecedence(lookahead)) > 0) {\n // Reduce: make a binary expression from the three topmost entries.\n while (stack.length > 2 && prec <= stack[stack.length - 2].prec) {\n right = stack.pop();\n operator = stack.pop().value;\n left = stack.pop();\n markers.pop();\n expr = finishBinaryExpression(operator, left, right);\n stack.push(expr);\n } // Shift.\n\n\n token = lex();\n token.prec = prec;\n stack.push(token);\n markers.push(lookahead);\n expr = parseUnaryExpression();\n stack.push(expr);\n } // Final reduce to clean-up the stack.\n\n\n i = stack.length - 1;\n expr = stack[i];\n markers.pop();\n\n while (i > 1) {\n markers.pop();\n expr = finishBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n i -= 2;\n }\n\n return expr;\n} // 11.12 Conditional Operator\n\n\nfunction parseConditionalExpression() {\n var expr, consequent, alternate;\n expr = parseBinaryExpression();\n\n if (match('?')) {\n lex();\n consequent = parseConditionalExpression();\n expect(':');\n alternate = parseConditionalExpression();\n expr = finishConditionalExpression(expr, consequent, alternate);\n }\n\n return expr;\n} // 11.14 Comma Operator\n\n\nfunction parseExpression() {\n const expr = parseConditionalExpression();\n\n if (match(',')) {\n throw new Error(DISABLED); // no sequence expressions\n }\n\n return expr;\n}\n\nfunction parser (code) {\n source = code;\n index = 0;\n length = source.length;\n lookahead = null;\n peek();\n const expr = parseExpression();\n\n if (lookahead.type !== TokenEOF) {\n throw new Error('Unexpect token after expression.');\n }\n\n return expr;\n}\n\nvar Constants = {\n NaN: 'NaN',\n E: 'Math.E',\n LN2: 'Math.LN2',\n LN10: 'Math.LN10',\n LOG2E: 'Math.LOG2E',\n LOG10E: 'Math.LOG10E',\n PI: 'Math.PI',\n SQRT1_2: 'Math.SQRT1_2',\n SQRT2: 'Math.SQRT2',\n MIN_VALUE: 'Number.MIN_VALUE',\n MAX_VALUE: 'Number.MAX_VALUE'\n};\n\nfunction Functions (codegen) {\n function fncall(name, args, cast, type) {\n let obj = codegen(args[0]);\n\n if (cast) {\n obj = cast + '(' + obj + ')';\n if (cast.lastIndexOf('new ', 0) === 0) obj = '(' + obj + ')';\n }\n\n return obj + '.' + name + (type < 0 ? '' : type === 0 ? '()' : '(' + args.slice(1).map(codegen).join(',') + ')');\n }\n\n function fn(name, cast, type) {\n return args => fncall(name, args, cast, type);\n }\n\n const DATE = 'new Date',\n STRING = 'String',\n REGEXP = 'RegExp';\n return {\n // MATH functions\n isNaN: 'Number.isNaN',\n isFinite: 'Number.isFinite',\n abs: 'Math.abs',\n acos: 'Math.acos',\n asin: 'Math.asin',\n atan: 'Math.atan',\n atan2: 'Math.atan2',\n ceil: 'Math.ceil',\n cos: 'Math.cos',\n exp: 'Math.exp',\n floor: 'Math.floor',\n log: 'Math.log',\n max: 'Math.max',\n min: 'Math.min',\n pow: 'Math.pow',\n random: 'Math.random',\n round: 'Math.round',\n sin: 'Math.sin',\n sqrt: 'Math.sqrt',\n tan: 'Math.tan',\n clamp: function (args) {\n if (args.length < 3) error('Missing arguments to clamp function.');\n if (args.length > 3) error('Too many arguments to clamp function.');\n const a = args.map(codegen);\n return 'Math.max(' + a[1] + ', Math.min(' + a[2] + ',' + a[0] + '))';\n },\n // DATE functions\n now: 'Date.now',\n utc: 'Date.UTC',\n datetime: DATE,\n date: fn('getDate', DATE, 0),\n day: fn('getDay', DATE, 0),\n year: fn('getFullYear', DATE, 0),\n month: fn('getMonth', DATE, 0),\n hours: fn('getHours', DATE, 0),\n minutes: fn('getMinutes', DATE, 0),\n seconds: fn('getSeconds', DATE, 0),\n milliseconds: fn('getMilliseconds', DATE, 0),\n time: fn('getTime', DATE, 0),\n timezoneoffset: fn('getTimezoneOffset', DATE, 0),\n utcdate: fn('getUTCDate', DATE, 0),\n utcday: fn('getUTCDay', DATE, 0),\n utcyear: fn('getUTCFullYear', DATE, 0),\n utcmonth: fn('getUTCMonth', DATE, 0),\n utchours: fn('getUTCHours', DATE, 0),\n utcminutes: fn('getUTCMinutes', DATE, 0),\n utcseconds: fn('getUTCSeconds', DATE, 0),\n utcmilliseconds: fn('getUTCMilliseconds', DATE, 0),\n // sequence functions\n length: fn('length', null, -1),\n // STRING functions\n parseFloat: 'parseFloat',\n parseInt: 'parseInt',\n upper: fn('toUpperCase', STRING, 0),\n lower: fn('toLowerCase', STRING, 0),\n substring: fn('substring', STRING),\n split: fn('split', STRING),\n trim: fn('trim', STRING, 0),\n // REGEXP functions\n regexp: REGEXP,\n test: fn('test', REGEXP),\n // Control Flow functions\n if: function (args) {\n if (args.length < 3) error('Missing arguments to if function.');\n if (args.length > 3) error('Too many arguments to if function.');\n const a = args.map(codegen);\n return '(' + a[0] + '?' + a[1] + ':' + a[2] + ')';\n }\n };\n}\n\nfunction stripQuotes(s) {\n const n = s && s.length - 1;\n return n && (s[0] === '\"' && s[n] === '\"' || s[0] === '\\'' && s[n] === '\\'') ? s.slice(1, -1) : s;\n}\n\nfunction codegen (opt) {\n opt = opt || {};\n const allowed = opt.allowed ? toSet(opt.allowed) : {},\n forbidden = opt.forbidden ? toSet(opt.forbidden) : {},\n constants = opt.constants || Constants,\n functions = (opt.functions || Functions)(visit),\n globalvar = opt.globalvar,\n fieldvar = opt.fieldvar,\n outputGlobal = isFunction(globalvar) ? globalvar : id => \"\".concat(globalvar, \"[\\\"\").concat(id, \"\\\"]\");\n let globals = {},\n fields = {},\n memberDepth = 0;\n\n function visit(ast) {\n if (isString(ast)) return ast;\n const generator = Generators[ast.type];\n if (generator == null) error('Unsupported type: ' + ast.type);\n return generator(ast);\n }\n\n const Generators = {\n Literal: n => n.raw,\n Identifier: n => {\n const id = n.name;\n\n if (memberDepth > 0) {\n return id;\n } else if (hasOwnProperty(forbidden, id)) {\n return error('Illegal identifier: ' + id);\n } else if (hasOwnProperty(constants, id)) {\n return constants[id];\n } else if (hasOwnProperty(allowed, id)) {\n return id;\n } else {\n globals[id] = 1;\n return outputGlobal(id);\n }\n },\n MemberExpression: n => {\n const d = !n.computed,\n o = visit(n.object);\n if (d) memberDepth += 1;\n const p = visit(n.property);\n\n if (o === fieldvar) {\n // strip quotes to sanitize field name (#1653)\n fields[stripQuotes(p)] = 1;\n }\n\n if (d) memberDepth -= 1;\n return o + (d ? '.' + p : '[' + p + ']');\n },\n CallExpression: n => {\n if (n.callee.type !== 'Identifier') {\n error('Illegal callee type: ' + n.callee.type);\n }\n\n const callee = n.callee.name,\n args = n.arguments,\n fn = hasOwnProperty(functions, callee) && functions[callee];\n if (!fn) error('Unrecognized function: ' + callee);\n return isFunction(fn) ? fn(args) : fn + '(' + args.map(visit).join(',') + ')';\n },\n ArrayExpression: n => '[' + n.elements.map(visit).join(',') + ']',\n BinaryExpression: n => '(' + visit(n.left) + ' ' + n.operator + ' ' + visit(n.right) + ')',\n UnaryExpression: n => '(' + n.operator + visit(n.argument) + ')',\n ConditionalExpression: n => '(' + visit(n.test) + '?' + visit(n.consequent) + ':' + visit(n.alternate) + ')',\n LogicalExpression: n => '(' + visit(n.left) + n.operator + visit(n.right) + ')',\n ObjectExpression: n => '{' + n.properties.map(visit).join(',') + '}',\n Property: n => {\n memberDepth += 1;\n const k = visit(n.key);\n memberDepth -= 1;\n return k + ':' + visit(n.value);\n }\n };\n\n function codegen(ast) {\n const result = {\n code: visit(ast),\n globals: Object.keys(globals),\n fields: Object.keys(fields)\n };\n globals = {};\n fields = {};\n return result;\n }\n\n codegen.functions = functions;\n codegen.constants = constants;\n return codegen;\n}\n\nexport { ASTNode, ArrayExpression, BinaryExpression, CallExpression, ConditionalExpression, Identifier, Literal, LogicalExpression, MemberExpression, ObjectExpression, Property, RawCode, UnaryExpression, codegen as codegenExpression, Constants as constants, Functions as functions, parser as parseExpression };\n","import { bisector, union, intersection } from 'd3-array';\nimport { field, isDate, toNumber, isArray, inrange, extend, array, error, peek, hasOwnProperty } from 'vega-util';\nimport { Literal } from 'vega-expression';\n\nconst Intersect = 'intersect';\nconst Union = 'union';\nconst VlMulti = 'vlMulti';\nconst VlPoint = 'vlPoint';\nconst Or = 'or';\nconst And = 'and';\nconst SelectionId = '_vgsid_';\nconst $selectionId = field(SelectionId);\n\nconst TYPE_ENUM = 'E',\n TYPE_RANGE_INC = 'R',\n TYPE_RANGE_EXC = 'R-E',\n TYPE_RANGE_LE = 'R-LE',\n TYPE_RANGE_RE = 'R-RE',\n UNIT_INDEX = 'index:unit'; // TODO: revisit date coercion?\n\nfunction testPoint(datum, entry) {\n var fields = entry.fields,\n values = entry.values,\n n = fields.length,\n i = 0,\n dval,\n f;\n\n for (; i < n; ++i) {\n f = fields[i];\n f.getter = field.getter || field(f.field);\n dval = f.getter(datum);\n if (isDate(dval)) dval = toNumber(dval);\n if (isDate(values[i])) values[i] = toNumber(values[i]);\n if (isDate(values[i][0])) values[i] = values[i].map(toNumber);\n\n if (f.type === TYPE_ENUM) {\n // Enumerated fields can either specify individual values (single/multi selections)\n // or an array of values (interval selections).\n if (isArray(values[i]) ? values[i].indexOf(dval) < 0 : dval !== values[i]) {\n return false;\n }\n } else {\n if (f.type === TYPE_RANGE_INC) {\n if (!inrange(dval, values[i])) return false;\n } else if (f.type === TYPE_RANGE_RE) {\n // Discrete selection of bins test within the range [bin_start, bin_end).\n if (!inrange(dval, values[i], true, false)) return false;\n } else if (f.type === TYPE_RANGE_EXC) {\n // 'R-E'/'R-LE' included for completeness.\n if (!inrange(dval, values[i], false, false)) return false;\n } else if (f.type === TYPE_RANGE_LE) {\n if (!inrange(dval, values[i], false, true)) return false;\n }\n }\n }\n\n return true;\n}\n/**\n * Tests if a tuple is contained within an interactive selection.\n * @param {string} name - The name of the data set representing the selection.\n * Tuples in the dataset are of the form\n * {unit: string, fields: array, values: array<*>}.\n * Fielddef is of the form\n * {field: string, channel: string, type: 'E' | 'R'} where\n * 'type' identifies whether tuples in the dataset enumerate\n * values for the field, or specify a continuous range.\n * @param {object} datum - The tuple to test for inclusion.\n * @param {string} op - The set operation for combining selections.\n * One of 'intersect' or 'union' (default).\n * @return {boolean} - True if the datum is in the selection, false otherwise.\n */\n\n\nfunction selectionTest(name, datum, op) {\n var data = this.context.data[name],\n entries = data ? data.values.value : [],\n unitIdx = data ? data[UNIT_INDEX] && data[UNIT_INDEX].value : undefined,\n intersect = op === Intersect,\n n = entries.length,\n i = 0,\n entry,\n miss,\n count,\n unit,\n b;\n\n for (; i < n; ++i) {\n entry = entries[i];\n\n if (unitIdx && intersect) {\n // multi selections union within the same unit and intersect across units.\n miss = miss || {};\n count = miss[unit = entry.unit] || 0; // if we've already matched this unit, skip.\n\n if (count === -1) continue;\n b = testPoint(datum, entry);\n miss[unit] = b ? -1 : ++count; // if we match and there are no other units return true\n // if we've missed against all tuples in this unit return false\n\n if (b && unitIdx.size === 1) return true;\n if (!b && count === unitIdx.get(unit).count) return false;\n } else {\n b = testPoint(datum, entry); // if we find a miss and we do require intersection return false\n // if we find a match and we don't require intersection return true\n\n if (intersect ^ b) return b;\n }\n } // if intersecting and we made it here, then we saw no misses\n // if not intersecting, then we saw no matches\n // if no active selections, return false\n\n\n return n && intersect;\n}\nconst bisect = bisector($selectionId),\n bisectLeft = bisect.left,\n bisectRight = bisect.right;\nfunction selectionIdTest(name, datum, op) {\n const data = this.context.data[name],\n entries = data ? data.values.value : [],\n unitIdx = data ? data[UNIT_INDEX] && data[UNIT_INDEX].value : undefined,\n intersect = op === Intersect,\n value = $selectionId(datum),\n index = bisectLeft(entries, value);\n if (index === entries.length) return false;\n if ($selectionId(entries[index]) !== value) return false;\n\n if (unitIdx && intersect) {\n if (unitIdx.size === 1) return true;\n if (bisectRight(entries, value) - index < unitIdx.size) return false;\n }\n\n return true;\n}\n\n/**\n * Maps an array of scene graph items to an array of selection tuples.\n * @param {string} name - The name of the dataset representing the selection.\n * @param {string} base - The base object that generated tuples extend.\n *\n * @returns {array} An array of selection entries for the given unit.\n */\n\nfunction selectionTuples(array, base) {\n return array.map(x => extend(base.fields ? {\n values: base.fields.map(f => (f.getter || (f.getter = field(f.field)))(x.datum))\n } : {\n [SelectionId]: $selectionId(x.datum)\n }, base));\n}\n\n/**\n * Resolves selection for use as a scale domain or reads via the API.\n * @param {string} name - The name of the dataset representing the selection\n * @param {string} [op='union'] - The set operation for combining selections.\n * One of 'intersect' or 'union' (default).\n * @param {boolean} isMulti - Identifies a \"multi\" selection to perform more\n * expensive resolution computation.\n * @param {boolean} vl5 - With Vega-Lite v5, \"multi\" selections are now called \"point\"\n * selections, and thus the resolved tuple should reflect this name.\n * This parameter allows us to reflect this change without triggering\n * a major version bump for Vega.\n * @returns {object} An object of selected fields and values.\n */\n\nfunction selectionResolve(name, op, isMulti, vl5) {\n var data = this.context.data[name],\n entries = data ? data.values.value : [],\n resolved = {},\n multiRes = {},\n types = {},\n entry,\n fields,\n values,\n unit,\n field,\n value,\n res,\n resUnit,\n type,\n union,\n n = entries.length,\n i = 0,\n j,\n m; // First union all entries within the same unit.\n\n for (; i < n; ++i) {\n entry = entries[i];\n unit = entry.unit;\n fields = entry.fields;\n values = entry.values;\n\n if (fields && values) {\n // Intentional selection stores\n for (j = 0, m = fields.length; j < m; ++j) {\n field = fields[j];\n res = resolved[field.field] || (resolved[field.field] = {});\n resUnit = res[unit] || (res[unit] = []);\n types[field.field] = type = field.type.charAt(0);\n union = ops[\"\".concat(type, \"_union\")];\n res[unit] = union(resUnit, array(values[j]));\n } // If the same multi-selection is repeated over views and projected over\n // an encoding, it may operate over different fields making it especially\n // tricky to reliably resolve it. At best, we can de-dupe identical entries\n // but doing so may be more computationally expensive than it is worth.\n // Instead, for now, we simply transform our store representation into\n // a more human-friendly one.\n\n\n if (isMulti) {\n resUnit = multiRes[unit] || (multiRes[unit] = []);\n resUnit.push(array(values).reduce((obj, curr, j) => (obj[fields[j].field] = curr, obj), {}));\n }\n } else {\n // Short circuit extensional selectionId stores which hold sorted IDs unique to each unit.\n field = SelectionId;\n value = $selectionId(entry);\n res = resolved[field] || (resolved[field] = {});\n resUnit = res[unit] || (res[unit] = []);\n resUnit.push(value);\n\n if (isMulti) {\n resUnit = multiRes[unit] || (multiRes[unit] = []);\n resUnit.push({\n [SelectionId]: value\n });\n }\n }\n } // Then resolve fields across units as per the op.\n\n\n op = op || Union;\n\n if (resolved[SelectionId]) {\n resolved[SelectionId] = ops[\"\".concat(SelectionId, \"_\").concat(op)](...Object.values(resolved[SelectionId]));\n } else {\n Object.keys(resolved).forEach(field => {\n resolved[field] = Object.keys(resolved[field]).map(unit => resolved[field][unit]).reduce((acc, curr) => acc === undefined ? curr : ops[\"\".concat(types[field], \"_\").concat(op)](acc, curr));\n });\n }\n\n entries = Object.keys(multiRes);\n\n if (isMulti && entries.length) {\n const key = vl5 ? VlPoint : VlMulti;\n resolved[key] = op === Union ? {\n [Or]: entries.reduce((acc, k) => (acc.push(...multiRes[k]), acc), [])\n } : {\n [And]: entries.map(k => ({\n [Or]: multiRes[k]\n }))\n };\n }\n\n return resolved;\n}\nvar ops = {\n [\"\".concat(SelectionId, \"_union\")]: union,\n [\"\".concat(SelectionId, \"_intersect\")]: intersection,\n E_union: function (base, value) {\n if (!base.length) return value;\n var i = 0,\n n = value.length;\n\n for (; i < n; ++i) if (base.indexOf(value[i]) < 0) base.push(value[i]);\n\n return base;\n },\n E_intersect: function (base, value) {\n return !base.length ? value : base.filter(v => value.indexOf(v) >= 0);\n },\n R_union: function (base, value) {\n var lo = toNumber(value[0]),\n hi = toNumber(value[1]);\n\n if (lo > hi) {\n lo = value[1];\n hi = value[0];\n }\n\n if (!base.length) return [lo, hi];\n if (base[0] > lo) base[0] = lo;\n if (base[1] < hi) base[1] = hi;\n return base;\n },\n R_intersect: function (base, value) {\n var lo = toNumber(value[0]),\n hi = toNumber(value[1]);\n\n if (lo > hi) {\n lo = value[1];\n hi = value[0];\n }\n\n if (!base.length) return [lo, hi];\n\n if (hi < base[0] || base[1] < lo) {\n return [];\n } else {\n if (base[0] < lo) base[0] = lo;\n if (base[1] > hi) base[1] = hi;\n }\n\n return base;\n }\n};\n\nconst DataPrefix = ':',\n IndexPrefix = '@';\nfunction selectionVisitor(name, args, scope, params) {\n if (args[0].type !== Literal) error('First argument to selection functions must be a string literal.');\n const data = args[0].value,\n op = args.length >= 2 && peek(args).value,\n field = 'unit',\n indexName = IndexPrefix + field,\n dataName = DataPrefix + data; // eslint-disable-next-line no-prototype-builtins\n\n if (op === Intersect && !hasOwnProperty(params, indexName)) {\n params[indexName] = scope.getData(data).indataRef(scope, field);\n } // eslint-disable-next-line no-prototype-builtins\n\n\n if (!hasOwnProperty(params, dataName)) {\n params[dataName] = scope.getData(data).tuplesRef();\n }\n}\n\nexport { selectionIdTest, selectionResolve, selectionTest, selectionTuples, selectionVisitor };\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","import { truthy, error, hasOwnProperty, isFunction, isString, stringValue, extend, isArray, isObject, field, peek, identity, array as array$1, isBoolean, isDate, isNumber, isRegExp, toBoolean, toDate, toNumber, toString, flush, lerp, pad, span, inrange, truncate, quarter, utcquarter, extent, clampRange, panLinear, panLog, panPow, panSymlog, zoomLinear, zoomLog, zoomPow, zoomSymlog } from 'vega-util';\nimport { Literal, codegenExpression, constants, functions, parseExpression, CallExpression } from 'vega-expression';\nimport { geoBounds as geoBounds$1, geoCentroid as geoCentroid$1, geoArea as geoArea$1 } from 'd3-geo';\nimport { rgb, lab, hcl, hsl } from 'd3-color';\nimport { isTuple } from 'vega-dataflow';\nimport { bandSpace, scale as scale$1, scaleFraction } from 'vega-scale';\nimport { Gradient, pathRender, pathParse, Bounds, intersect as intersect$1 } from 'vega-scenegraph';\nimport { selectionVisitor, selectionTest, selectionIdTest, selectionResolve, selectionTuples } from 'vega-selections';\nimport { random, cumulativeNormal, cumulativeLogNormal, cumulativeUniform, densityNormal, densityLogNormal, densityUniform, quantileNormal, quantileLogNormal, quantileUniform, sampleNormal, sampleLogNormal, sampleUniform } from 'vega-statistics';\nimport { utcOffset, utcSequence, timeOffset, timeSequence, timeUnitSpecifier, week, utcweek, dayofyear, utcdayofyear } from 'vega-time';\nimport { range as range$1 } from 'd3-array';\n\nfunction data(name) {\n const data = this.context.data[name];\n return data ? data.values.value : [];\n}\nfunction indata(name, field, value) {\n const index = this.context.data[name]['index:' + field],\n entry = index ? index.value.get(value) : undefined;\n return entry ? entry.count : entry;\n}\nfunction setdata(name, tuples) {\n const df = this.context.dataflow,\n data = this.context.data[name],\n input = data.input;\n df.pulse(input, df.changeset().remove(truthy).insert(tuples));\n return 1;\n}\n\nfunction encode (item, name, retval) {\n if (item) {\n const df = this.context.dataflow,\n target = item.mark.source;\n df.pulse(target, df.changeset().encode(item, name));\n }\n\n return retval !== undefined ? retval : item;\n}\n\nconst wrap = method => function (value, spec) {\n const locale = this.context.dataflow.locale();\n return locale[method](spec)(value);\n};\n\nconst format = wrap('format');\nconst timeFormat = wrap('timeFormat');\nconst utcFormat = wrap('utcFormat');\nconst timeParse = wrap('timeParse');\nconst utcParse = wrap('utcParse');\nconst dateObj = new Date(2000, 0, 1);\n\nfunction time(month, day, specifier) {\n if (!Number.isInteger(month) || !Number.isInteger(day)) return '';\n dateObj.setYear(2000);\n dateObj.setMonth(month);\n dateObj.setDate(day);\n return timeFormat.call(this, dateObj, specifier);\n}\n\nfunction monthFormat(month) {\n return time.call(this, month, 1, '%B');\n}\nfunction monthAbbrevFormat(month) {\n return time.call(this, month, 1, '%b');\n}\nfunction dayFormat(day) {\n return time.call(this, 0, 2 + day, '%A');\n}\nfunction dayAbbrevFormat(day) {\n return time.call(this, 0, 2 + day, '%a');\n}\n\nconst DataPrefix = ':';\nconst IndexPrefix = '@';\nconst ScalePrefix = '%';\nconst SignalPrefix = '$';\n\nfunction dataVisitor(name, args, scope, params) {\n if (args[0].type !== Literal) {\n error('First argument to data functions must be a string literal.');\n }\n\n const data = args[0].value,\n dataName = DataPrefix + data;\n\n if (!hasOwnProperty(dataName, params)) {\n try {\n params[dataName] = scope.getData(data).tuplesRef();\n } catch (err) {// if data set does not exist, there's nothing to track\n }\n }\n}\nfunction indataVisitor(name, args, scope, params) {\n if (args[0].type !== Literal) error('First argument to indata must be a string literal.');\n if (args[1].type !== Literal) error('Second argument to indata must be a string literal.');\n const data = args[0].value,\n field = args[1].value,\n indexName = IndexPrefix + field;\n\n if (!hasOwnProperty(indexName, params)) {\n params[indexName] = scope.getData(data).indataRef(scope, field);\n }\n}\nfunction scaleVisitor(name, args, scope, params) {\n if (args[0].type === Literal) {\n // add scale dependency\n addScaleDependency(scope, params, args[0].value);\n } else {\n // indirect scale lookup; add all scales as parameters\n for (name in scope.scales) {\n addScaleDependency(scope, params, name);\n }\n }\n}\n\nfunction addScaleDependency(scope, params, name) {\n const scaleName = ScalePrefix + name;\n\n if (!hasOwnProperty(params, scaleName)) {\n try {\n params[scaleName] = scope.scaleRef(name);\n } catch (err) {// TODO: error handling? warning?\n }\n }\n}\n\nfunction getScale(name, ctx) {\n let s;\n return isFunction(name) ? name : isString(name) ? (s = ctx.scales[name]) && s.value : undefined;\n}\nfunction internalScaleFunctions(codegen, fnctx, visitors) {\n // add helper method to the 'this' expression function context\n fnctx.__bandwidth = s => s && s.bandwidth ? s.bandwidth() : 0; // register AST visitors for internal scale functions\n\n\n visitors._bandwidth = scaleVisitor;\n visitors._range = scaleVisitor;\n visitors._scale = scaleVisitor; // resolve scale reference directly to the signal hash argument\n\n const ref = arg => '_[' + (arg.type === Literal ? stringValue(ScalePrefix + arg.value) : stringValue(ScalePrefix) + '+' + codegen(arg)) + ']'; // define and return internal scale function code generators\n // these internal functions are called by mark encoders\n\n\n return {\n _bandwidth: args => \"this.__bandwidth(\".concat(ref(args[0]), \")\"),\n _range: args => \"\".concat(ref(args[0]), \".range()\"),\n _scale: args => \"\".concat(ref(args[0]), \"(\").concat(codegen(args[1]), \")\")\n };\n}\n\nfunction geoMethod(methodName, globalMethod) {\n return function (projection, geojson, group) {\n if (projection) {\n // projection defined, use it\n const p = getScale(projection, (group || this).context);\n return p && p.path[methodName](geojson);\n } else {\n // projection undefined, use global method\n return globalMethod(geojson);\n }\n };\n}\n\nconst geoArea = geoMethod('area', geoArea$1);\nconst geoBounds = geoMethod('bounds', geoBounds$1);\nconst geoCentroid = geoMethod('centroid', geoCentroid$1);\n\nfunction inScope (item) {\n const group = this.context.group;\n let value = false;\n if (group) while (item) {\n if (item === group) {\n value = true;\n break;\n }\n\n item = item.mark.group;\n }\n return value;\n}\n\nfunction log(df, method, args) {\n try {\n df[method].apply(df, ['EXPRESSION'].concat([].slice.call(args)));\n } catch (err) {\n df.warn(err);\n }\n\n return args[args.length - 1];\n}\n\nfunction warn() {\n return log(this.context.dataflow, 'warn', arguments);\n}\nfunction info() {\n return log(this.context.dataflow, 'info', arguments);\n}\nfunction debug() {\n return log(this.context.dataflow, 'debug', arguments);\n}\n\nfunction channel_luminance_value(channelValue) {\n const val = channelValue / 255;\n\n if (val <= 0.03928) {\n return val / 12.92;\n }\n\n return Math.pow((val + 0.055) / 1.055, 2.4);\n}\n\nfunction luminance(color) {\n const c = rgb(color),\n r = channel_luminance_value(c.r),\n g = channel_luminance_value(c.g),\n b = channel_luminance_value(c.b);\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n} // https://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef\n\nfunction contrast(color1, color2) {\n const lum1 = luminance(color1),\n lum2 = luminance(color2),\n lumL = Math.max(lum1, lum2),\n lumD = Math.min(lum1, lum2);\n return (lumL + 0.05) / (lumD + 0.05);\n}\n\nfunction merge () {\n const args = [].slice.call(arguments);\n args.unshift({});\n return extend(...args);\n}\n\nfunction equal(a, b) {\n return a === b || a !== a && b !== b ? true : isArray(a) ? isArray(b) && a.length === b.length ? equalArray(a, b) : false : isObject(a) && isObject(b) ? equalObject(a, b) : false;\n}\n\nfunction equalArray(a, b) {\n for (let i = 0, n = a.length; i < n; ++i) {\n if (!equal(a[i], b[i])) return false;\n }\n\n return true;\n}\n\nfunction equalObject(a, b) {\n for (const key in a) {\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n}\n\nfunction removePredicate(props) {\n return _ => equalObject(props, _);\n}\n\nfunction modify (name, insert, remove, toggle, modify, values) {\n const df = this.context.dataflow,\n data = this.context.data[name],\n input = data.input,\n stamp = df.stamp();\n let changes = data.changes,\n predicate,\n key;\n\n if (df._trigger === false || !(input.value.length || insert || toggle)) {\n // nothing to do!\n return 0;\n }\n\n if (!changes || changes.stamp < stamp) {\n data.changes = changes = df.changeset();\n changes.stamp = stamp;\n df.runAfter(() => {\n data.modified = true;\n df.pulse(input, changes).run();\n }, true, 1);\n }\n\n if (remove) {\n predicate = remove === true ? truthy : isArray(remove) || isTuple(remove) ? remove : removePredicate(remove);\n changes.remove(predicate);\n }\n\n if (insert) {\n changes.insert(insert);\n }\n\n if (toggle) {\n predicate = removePredicate(toggle);\n\n if (input.value.some(predicate)) {\n changes.remove(predicate);\n } else {\n changes.insert(toggle);\n }\n }\n\n if (modify) {\n for (key in values) {\n changes.modify(modify, key, values[key]);\n }\n }\n\n return 1;\n}\n\nfunction pinchDistance(event) {\n const t = event.touches,\n dx = t[0].clientX - t[1].clientX,\n dy = t[0].clientY - t[1].clientY;\n return Math.sqrt(dx * dx + dy * dy);\n}\nfunction pinchAngle(event) {\n const t = event.touches;\n return Math.atan2(t[0].clientY - t[1].clientY, t[0].clientX - t[1].clientX);\n}\n\nconst accessors = {};\nfunction pluck (data, name) {\n const accessor = accessors[name] || (accessors[name] = field(name));\n return isArray(data) ? data.map(accessor) : accessor(data);\n}\n\nfunction array(seq) {\n return isArray(seq) || ArrayBuffer.isView(seq) ? seq : null;\n}\n\nfunction sequence(seq) {\n return array(seq) || (isString(seq) ? seq : null);\n}\n\nfunction join(seq) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n return array(seq).join(...args);\n}\nfunction indexof(seq) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n return sequence(seq).indexOf(...args);\n}\nfunction lastindexof(seq) {\n for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {\n args[_key3 - 1] = arguments[_key3];\n }\n\n return sequence(seq).lastIndexOf(...args);\n}\nfunction slice(seq) {\n for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {\n args[_key4 - 1] = arguments[_key4];\n }\n\n return sequence(seq).slice(...args);\n}\nfunction replace(str, pattern, repl) {\n if (isFunction(repl)) error('Function argument passed to replace.');\n return String(str).replace(pattern, repl);\n}\nfunction reverse(seq) {\n return array(seq).slice().reverse();\n}\n\nfunction bandspace(count, paddingInner, paddingOuter) {\n return bandSpace(count || 0, paddingInner || 0, paddingOuter || 0);\n}\nfunction bandwidth(name, group) {\n const s = getScale(name, (group || this).context);\n return s && s.bandwidth ? s.bandwidth() : 0;\n}\nfunction copy(name, group) {\n const s = getScale(name, (group || this).context);\n return s ? s.copy() : undefined;\n}\nfunction domain(name, group) {\n const s = getScale(name, (group || this).context);\n return s ? s.domain() : [];\n}\nfunction invert(name, range, group) {\n const s = getScale(name, (group || this).context);\n return !s ? undefined : isArray(range) ? (s.invertRange || s.invert)(range) : (s.invert || s.invertExtent)(range);\n}\nfunction range(name, group) {\n const s = getScale(name, (group || this).context);\n return s && s.range ? s.range() : [];\n}\nfunction scale(name, value, group) {\n const s = getScale(name, (group || this).context);\n return s ? s(value) : undefined;\n}\n\nfunction scaleGradient (scale, p0, p1, count, group) {\n scale = getScale(scale, (group || this).context);\n const gradient = Gradient(p0, p1);\n let stops = scale.domain(),\n min = stops[0],\n max = peek(stops),\n fraction = identity;\n\n if (!(max - min)) {\n // expand scale if domain has zero span, fix #1479\n scale = (scale.interpolator ? scale$1('sequential')().interpolator(scale.interpolator()) : scale$1('linear')().interpolate(scale.interpolate()).range(scale.range())).domain([min = 0, max = 1]);\n } else {\n fraction = scaleFraction(scale, min, max);\n }\n\n if (scale.ticks) {\n stops = scale.ticks(+count || 15);\n if (min !== stops[0]) stops.unshift(min);\n if (max !== peek(stops)) stops.push(max);\n }\n\n stops.forEach(_ => gradient.stop(fraction(_), scale(_)));\n return gradient;\n}\n\nfunction geoShape(projection, geojson, group) {\n const p = getScale(projection, (group || this).context);\n return function (context) {\n return p ? p.path.context(context)(geojson) : '';\n };\n}\nfunction pathShape(path) {\n let p = null;\n return function (context) {\n return context ? pathRender(context, p = p || pathParse(path)) : path;\n };\n}\n\nconst datum = d => d.data;\n\nfunction treeNodes(name, context) {\n const tree = data.call(context, name);\n return tree.root && tree.root.lookup || {};\n}\n\nfunction treePath(name, source, target) {\n const nodes = treeNodes(name, this),\n s = nodes[source],\n t = nodes[target];\n return s && t ? s.path(t).map(datum) : undefined;\n}\nfunction treeAncestors(name, node) {\n const n = treeNodes(name, this)[node];\n return n ? n.ancestors().map(datum) : undefined;\n}\n\nconst _window = () => typeof window !== 'undefined' && window || null;\n\nfunction screen() {\n const w = _window();\n\n return w ? w.screen : {};\n}\nfunction windowSize() {\n const w = _window();\n\n return w ? [w.innerWidth, w.innerHeight] : [undefined, undefined];\n}\nfunction containerSize() {\n const view = this.context.dataflow,\n el = view.container && view.container();\n return el ? [el.clientWidth, el.clientHeight] : [undefined, undefined];\n}\n\nfunction intersect (b, opt, group) {\n if (!b) return [];\n const [u, v] = b,\n box = new Bounds().set(u[0], u[1], v[0], v[1]),\n scene = group || this.context.dataflow.scenegraph().root;\n return intersect$1(scene, box, filter(opt));\n}\n\nfunction filter(opt) {\n let p = null;\n\n if (opt) {\n const types = array$1(opt.marktype),\n names = array$1(opt.markname);\n\n p = _ => (!types.length || types.some(t => _.marktype === t)) && (!names.length || names.some(s => _.name === s));\n }\n\n return p;\n}\n\n/**\n * Appends a new point to the lasso\n * \n * @param {*} lasso the lasso in pixel space\n * @param {*} x the x coordinate in pixel space\n * @param {*} y the y coordinate in pixel space\n * @param {*} minDist the minimum distance, in pixels, that thenew point needs to be apart from the last point\n * @returns a new array containing the lasso with the new point\n */\n\nfunction lassoAppend(lasso, x, y) {\n let minDist = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 5;\n const last = lasso[lasso.length - 1]; // Add point to lasso if distance to last point exceed minDist or its the first point\n\n if (last === undefined || Math.sqrt((last[0] - x) ** 2 + (last[1] - y) ** 2) > minDist) {\n lasso.push([x, y]);\n return [...lasso];\n }\n\n return lasso;\n}\n/**\n * Generates a svg path command which draws a lasso\n * \n * @param {*} lasso the lasso in pixel space in the form [[x,y], [x,y], ...]\n * @returns the svg path command that draws the lasso\n */\n\nfunction lassoPath(lasso) {\n return (lasso !== null && lasso !== void 0 ? lasso : []).reduce((svg, _ref, i) => {\n let [x, y] = _ref;\n return svg += i == 0 ? \"M \".concat(x, \",\").concat(y, \" \") : i === lasso.length - 1 ? ' Z' : \"L \".concat(x, \",\").concat(y, \" \");\n }, '');\n}\n/**\n * Inverts the lasso from pixel space to an array of vega scenegraph tuples\n * \n * @param {*} data the dataset\n * @param {*} pixelLasso the lasso in pixel space, [[x,y], [x,y], ...]\n * @param {*} unit the unit where the lasso is defined\n * \n * @returns an array of vega scenegraph tuples\n */\n\nfunction intersectLasso(markname, pixelLasso, unit) {\n const {\n x,\n y,\n mark\n } = unit;\n const bb = new Bounds().set(Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER, Number.MIN_SAFE_INTEGER, Number.MIN_SAFE_INTEGER); // Get bounding box around lasso\n\n for (const [px, py] of pixelLasso) {\n if (px < bb.x1) bb.x1 = px;\n if (px > bb.x2) bb.x2 = px;\n if (py < bb.y1) bb.y1 = py;\n if (py > bb.y2) bb.y2 = py;\n } // Translate bb against unit coordinates\n\n\n bb.translate(x, y);\n const intersection = intersect([[bb.x1, bb.y1], [bb.x2, bb.y2]], markname, mark); // Check every point against the lasso\n\n return intersection.filter(tuple => pointInPolygon(tuple.x, tuple.y, pixelLasso));\n}\n/**\n * Performs a test if a point is inside a polygon based on the idea from\n * https://wrf.ecse.rpi.edu/Research/Short_Notes/pnpoly.html\n * \n * This method will not need the same start/end point since it wraps around the edges of the array\n * \n * @param {*} test a point to test against\n * @param {*} polygon a polygon in the form [[x,y], [x,y], ...]\n * @returns true if the point lies inside the polygon, false otherwise\n */\n\nfunction pointInPolygon(testx, testy, polygon) {\n let intersections = 0;\n\n for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {\n const [prevX, prevY] = polygon[j];\n const [x, y] = polygon[i]; // count intersections\n\n if (y > testy != prevY > testy && testx < (prevX - x) * (testy - y) / (prevY - y) + x) {\n intersections++;\n }\n } // point is in polygon if intersection count is odd\n\n\n return intersections & 1;\n}\n\nconst functionContext = {\n random() {\n return random();\n },\n\n // override default\n cumulativeNormal,\n cumulativeLogNormal,\n cumulativeUniform,\n densityNormal,\n densityLogNormal,\n densityUniform,\n quantileNormal,\n quantileLogNormal,\n quantileUniform,\n sampleNormal,\n sampleLogNormal,\n sampleUniform,\n isArray,\n isBoolean,\n isDate,\n\n isDefined(_) {\n return _ !== undefined;\n },\n\n isNumber,\n isObject,\n isRegExp,\n isString,\n isTuple,\n\n isValid(_) {\n return _ != null && _ === _;\n },\n\n toBoolean,\n\n toDate(_) {\n return toDate(_);\n },\n\n // suppress extra arguments\n toNumber,\n toString,\n indexof,\n join,\n lastindexof,\n replace,\n reverse,\n slice,\n flush,\n lerp,\n merge,\n pad,\n peek,\n pluck,\n span,\n inrange,\n truncate,\n rgb,\n lab,\n hcl,\n hsl,\n luminance,\n contrast,\n sequence: range$1,\n format,\n utcFormat,\n utcParse,\n utcOffset,\n utcSequence,\n timeFormat,\n timeParse,\n timeOffset,\n timeSequence,\n timeUnitSpecifier,\n monthFormat,\n monthAbbrevFormat,\n dayFormat,\n dayAbbrevFormat,\n quarter,\n utcquarter,\n week,\n utcweek,\n dayofyear,\n utcdayofyear,\n warn,\n info,\n debug,\n\n extent(_) {\n return extent(_);\n },\n\n // suppress extra arguments\n inScope,\n intersect,\n clampRange,\n pinchDistance,\n pinchAngle,\n screen,\n containerSize,\n windowSize,\n bandspace,\n setdata,\n pathShape,\n panLinear,\n panLog,\n panPow,\n panSymlog,\n zoomLinear,\n zoomLog,\n zoomPow,\n zoomSymlog,\n encode,\n modify,\n lassoAppend,\n lassoPath,\n intersectLasso\n};\nconst eventFunctions = ['view', 'item', 'group', 'xy', 'x', 'y'],\n // event functions\neventPrefix = 'event.vega.',\n // event function prefix\nthisPrefix = 'this.',\n // function context prefix\nastVisitors = {}; // AST visitors for dependency analysis\n// export code generator parameters\n\nconst codegenParams = {\n forbidden: ['_'],\n allowed: ['datum', 'event', 'item'],\n fieldvar: 'datum',\n globalvar: id => \"_[\".concat(stringValue(SignalPrefix + id), \"]\"),\n functions: buildFunctions,\n constants: constants,\n visitors: astVisitors\n}; // export code generator\n\nconst codeGenerator = codegenExpression(codegenParams); // Build expression function registry\n\nfunction buildFunctions(codegen) {\n const fn = functions(codegen);\n eventFunctions.forEach(name => fn[name] = eventPrefix + name);\n\n for (const name in functionContext) {\n fn[name] = thisPrefix + name;\n }\n\n extend(fn, internalScaleFunctions(codegen, functionContext, astVisitors));\n return fn;\n} // Register an expression function\n\n\nfunction expressionFunction(name, fn, visitor) {\n if (arguments.length === 1) {\n return functionContext[name];\n } // register with the functionContext\n\n\n functionContext[name] = fn; // if there is an astVisitor register that, too\n\n if (visitor) astVisitors[name] = visitor; // if the code generator has already been initialized,\n // we need to also register the function with it\n\n if (codeGenerator) codeGenerator.functions[name] = thisPrefix + name;\n return this;\n} // register expression functions with ast visitors\n\nexpressionFunction('bandwidth', bandwidth, scaleVisitor);\nexpressionFunction('copy', copy, scaleVisitor);\nexpressionFunction('domain', domain, scaleVisitor);\nexpressionFunction('range', range, scaleVisitor);\nexpressionFunction('invert', invert, scaleVisitor);\nexpressionFunction('scale', scale, scaleVisitor);\nexpressionFunction('gradient', scaleGradient, scaleVisitor);\nexpressionFunction('geoArea', geoArea, scaleVisitor);\nexpressionFunction('geoBounds', geoBounds, scaleVisitor);\nexpressionFunction('geoCentroid', geoCentroid, scaleVisitor);\nexpressionFunction('geoShape', geoShape, scaleVisitor);\nexpressionFunction('indata', indata, indataVisitor);\nexpressionFunction('data', data, dataVisitor);\nexpressionFunction('treePath', treePath, dataVisitor);\nexpressionFunction('treeAncestors', treeAncestors, dataVisitor); // register Vega-Lite selection functions\n\nexpressionFunction('vlSelectionTest', selectionTest, selectionVisitor);\nexpressionFunction('vlSelectionIdTest', selectionIdTest, selectionVisitor);\nexpressionFunction('vlSelectionResolve', selectionResolve, selectionVisitor);\nexpressionFunction('vlSelectionTuples', selectionTuples);\n\nfunction parser (expr, scope) {\n const params = {}; // parse the expression to an abstract syntax tree (ast)\n\n let ast;\n\n try {\n expr = isString(expr) ? expr : stringValue(expr) + '';\n ast = parseExpression(expr);\n } catch (err) {\n error('Expression parse error: ' + expr);\n } // analyze ast function calls for dependencies\n\n\n ast.visit(node => {\n if (node.type !== CallExpression) return;\n const name = node.callee.name,\n visit = codegenParams.visitors[name];\n if (visit) visit(name, node.arguments, scope, params);\n }); // perform code generation\n\n const gen = codeGenerator(ast); // collect signal dependencies\n\n gen.globals.forEach(name => {\n const signalName = SignalPrefix + name;\n\n if (!hasOwnProperty(params, signalName) && scope.getSignal(name)) {\n params[signalName] = scope.signalRef(name);\n }\n }); // return generated expression code and dependencies\n\n return {\n $expr: extend({\n code: gen.code\n }, scope.options.ast ? {\n ast\n } : null),\n $fields: gen.fields,\n $params: params\n };\n}\n\nexport { DataPrefix, IndexPrefix, ScalePrefix, SignalPrefix, bandspace, bandwidth, codeGenerator, codegenParams, containerSize, contrast, copy, data, dataVisitor, dayAbbrevFormat, dayFormat, debug, domain, encode, expressionFunction, format, functionContext, geoArea, geoBounds, geoCentroid, geoShape, inScope, indata, indataVisitor, indexof, info, invert, join, lastindexof, luminance, merge, modify, monthAbbrevFormat, monthFormat, parser as parseExpression, pathShape, pinchAngle, pinchDistance, pluck, range, replace, reverse, scale, scaleGradient, scaleVisitor, screen, setdata, slice, timeFormat, timeParse, treeAncestors, treePath, utcFormat, utcParse, warn, windowSize };\n","import { toSet, stringValue, error, isArray, isObject, hasOwnProperty, accessor, key, field, array, compare, truthy } from 'vega-util';\nimport { tupleid } from 'vega-dataflow';\n\n/**\n * Parse a serialized dataflow specification.\n */\nfunction parse (spec) {\n const ctx = this,\n operators = spec.operators || []; // parse background\n\n if (spec.background) {\n ctx.background = spec.background;\n } // parse event configuration\n\n\n if (spec.eventConfig) {\n ctx.eventConfig = spec.eventConfig;\n } // parse locale configuration\n\n\n if (spec.locale) {\n ctx.locale = spec.locale;\n } // parse operators\n\n\n operators.forEach(entry => ctx.parseOperator(entry)); // parse operator parameters\n\n operators.forEach(entry => ctx.parseOperatorParameters(entry)); // parse streams\n\n (spec.streams || []).forEach(entry => ctx.parseStream(entry)); // parse updates\n\n (spec.updates || []).forEach(entry => ctx.parseUpdate(entry));\n return ctx.resolve();\n}\n\nconst Skip = toSet(['rule']),\n Swap = toSet(['group', 'image', 'rect']);\nfunction adjustSpatial(encode, marktype) {\n let code = '';\n if (Skip[marktype]) return code;\n\n if (encode.x2) {\n if (encode.x) {\n if (Swap[marktype]) {\n code += 'if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;';\n }\n\n code += 'o.width=o.x2-o.x;';\n } else {\n code += 'o.x=o.x2-(o.width||0);';\n }\n }\n\n if (encode.xc) {\n code += 'o.x=o.xc-(o.width||0)/2;';\n }\n\n if (encode.y2) {\n if (encode.y) {\n if (Swap[marktype]) {\n code += 'if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;';\n }\n\n code += 'o.height=o.y2-o.y;';\n } else {\n code += 'o.y=o.y2-(o.height||0);';\n }\n }\n\n if (encode.yc) {\n code += 'o.y=o.yc-(o.height||0)/2;';\n }\n\n return code;\n}\nfunction canonicalType(type) {\n return (type + '').toLowerCase();\n}\nfunction isOperator(type) {\n return canonicalType(type) === 'operator';\n}\nfunction isCollect(type) {\n return canonicalType(type) === 'collect';\n}\n\nfunction expression(ctx, args, code) {\n // wrap code in return statement if expression does not terminate\n if (!code.endsWith(';')) {\n code = 'return(' + code + ');';\n }\n\n const fn = Function(...args.concat(code));\n return ctx && ctx.functions ? fn.bind(ctx.functions) : fn;\n} // generate code for comparing a single field\n\n\nfunction _compare(u, v, lt, gt) {\n return \"((u = \".concat(u, \") < (v = \").concat(v, \") || u == null) && v != null ? \").concat(lt, \"\\n : (u > v || v == null) && u != null ? \").concat(gt, \"\\n : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? \").concat(lt, \"\\n : v !== v && u === u ? \").concat(gt, \" : \");\n}\n\nvar expressionCodegen = {\n /**\n * Parse an expression used to update an operator value.\n */\n operator: (ctx, expr) => expression(ctx, ['_'], expr.code),\n\n /**\n * Parse an expression provided as an operator parameter value.\n */\n parameter: (ctx, expr) => expression(ctx, ['datum', '_'], expr.code),\n\n /**\n * Parse an expression applied to an event stream.\n */\n event: (ctx, expr) => expression(ctx, ['event'], expr.code),\n\n /**\n * Parse an expression used to handle an event-driven operator update.\n */\n handler: (ctx, expr) => {\n const code = \"var datum=event.item&&event.item.datum;return \".concat(expr.code, \";\");\n return expression(ctx, ['_', 'event'], code);\n },\n\n /**\n * Parse an expression that performs visual encoding.\n */\n encode: (ctx, encode) => {\n const {\n marktype,\n channels\n } = encode;\n let code = 'var o=item,datum=o.datum,m=0,$;';\n\n for (const name in channels) {\n const o = 'o[' + stringValue(name) + ']';\n code += \"$=\".concat(channels[name].code, \";if(\").concat(o, \"!==$)\").concat(o, \"=$,m=1;\");\n }\n\n code += adjustSpatial(channels, marktype);\n code += 'return m;';\n return expression(ctx, ['item', '_'], code);\n },\n\n /**\n * Optimized code generators for access and comparison.\n */\n codegen: {\n get(path) {\n const ref = \"[\".concat(path.map(stringValue).join(']['), \"]\");\n const get = Function('_', \"return _\".concat(ref, \";\"));\n get.path = ref;\n return get;\n },\n\n comparator(fields, orders) {\n let t;\n\n const map = (f, i) => {\n const o = orders[i];\n let u, v;\n\n if (f.path) {\n u = \"a\".concat(f.path);\n v = \"b\".concat(f.path);\n } else {\n (t = t || {})['f' + i] = f;\n u = \"this.f\".concat(i, \"(a)\");\n v = \"this.f\".concat(i, \"(b)\");\n }\n\n return _compare(u, v, -o, o);\n };\n\n const fn = Function('a', 'b', 'var u, v; return ' + fields.map(map).join('') + '0;');\n return t ? fn.bind(t) : fn;\n }\n\n }\n};\n\n/**\n * Parse a dataflow operator.\n */\n\nfunction parseOperator(spec) {\n const ctx = this;\n\n if (isOperator(spec.type) || !spec.type) {\n ctx.operator(spec, spec.update ? ctx.operatorExpression(spec.update) : null);\n } else {\n ctx.transform(spec, spec.type);\n }\n}\n/**\n * Parse and assign operator parameters.\n */\n\nfunction parseOperatorParameters(spec) {\n const ctx = this;\n\n if (spec.params) {\n const op = ctx.get(spec.id);\n if (!op) error('Invalid operator id: ' + spec.id);\n ctx.dataflow.connect(op, op.parameters(ctx.parseParameters(spec.params), spec.react, spec.initonly));\n }\n}\n\n/**\n * Parse a set of operator parameters.\n */\n\nfunction parseParameters(spec, params) {\n params = params || {};\n const ctx = this;\n\n for (const key in spec) {\n const value = spec[key];\n params[key] = isArray(value) ? value.map(v => parseParameter(v, ctx, params)) : parseParameter(value, ctx, params);\n }\n\n return params;\n}\n/**\n * Parse a single parameter.\n */\n\nfunction parseParameter(spec, ctx, params) {\n if (!spec || !isObject(spec)) return spec;\n\n for (let i = 0, n = PARSERS.length, p; i < n; ++i) {\n p = PARSERS[i];\n\n if (hasOwnProperty(spec, p.key)) {\n return p.parse(spec, ctx, params);\n }\n }\n\n return spec;\n}\n/** Reference parsers. */\n\n\nvar PARSERS = [{\n key: '$ref',\n parse: getOperator\n}, {\n key: '$key',\n parse: getKey\n}, {\n key: '$expr',\n parse: getExpression\n}, {\n key: '$field',\n parse: getField\n}, {\n key: '$encode',\n parse: getEncode\n}, {\n key: '$compare',\n parse: getCompare\n}, {\n key: '$context',\n parse: getContext\n}, {\n key: '$subflow',\n parse: getSubflow\n}, {\n key: '$tupleid',\n parse: getTupleId\n}];\n/**\n * Resolve an operator reference.\n */\n\nfunction getOperator(_, ctx) {\n return ctx.get(_.$ref) || error('Operator not defined: ' + _.$ref);\n}\n/**\n * Resolve an expression reference.\n */\n\n\nfunction getExpression(_, ctx, params) {\n if (_.$params) {\n // parse expression parameters\n ctx.parseParameters(_.$params, params);\n }\n\n const k = 'e:' + _.$expr.code;\n return ctx.fn[k] || (ctx.fn[k] = accessor(ctx.parameterExpression(_.$expr), _.$fields));\n}\n/**\n * Resolve a key accessor reference.\n */\n\n\nfunction getKey(_, ctx) {\n const k = 'k:' + _.$key + '_' + !!_.$flat;\n return ctx.fn[k] || (ctx.fn[k] = key(_.$key, _.$flat, ctx.expr.codegen));\n}\n/**\n * Resolve a field accessor reference.\n */\n\n\nfunction getField(_, ctx) {\n if (!_.$field) return null;\n const k = 'f:' + _.$field + '_' + _.$name;\n return ctx.fn[k] || (ctx.fn[k] = field(_.$field, _.$name, ctx.expr.codegen));\n}\n/**\n * Resolve a comparator function reference.\n */\n\n\nfunction getCompare(_, ctx) {\n // As of Vega 5.5.3, $tupleid sort is no longer used.\n // Keep here for now for backwards compatibility.\n const k = 'c:' + _.$compare + '_' + _.$order,\n c = array(_.$compare).map(_ => _ && _.$tupleid ? tupleid : _);\n return ctx.fn[k] || (ctx.fn[k] = compare(c, _.$order, ctx.expr.codegen));\n}\n/**\n * Resolve an encode operator reference.\n */\n\n\nfunction getEncode(_, ctx) {\n const spec = _.$encode,\n encode = {};\n\n for (const name in spec) {\n const enc = spec[name];\n encode[name] = accessor(ctx.encodeExpression(enc.$expr), enc.$fields);\n encode[name].output = enc.$output;\n }\n\n return encode;\n}\n/**\n * Resolve a context reference.\n */\n\n\nfunction getContext(_, ctx) {\n return ctx;\n}\n/**\n * Resolve a recursive subflow specification.\n */\n\n\nfunction getSubflow(_, ctx) {\n const spec = _.$subflow;\n return function (dataflow, key, parent) {\n const subctx = ctx.fork().parse(spec),\n op = subctx.get(spec.operators[0].id),\n p = subctx.signals.parent;\n if (p) p.set(parent);\n\n op.detachSubflow = () => ctx.detach(subctx);\n\n return op;\n };\n}\n/**\n * Resolve a tuple id reference.\n */\n\n\nfunction getTupleId() {\n return tupleid;\n}\n\n/**\n * Parse an event stream specification.\n */\n\nfunction parseStream (spec) {\n var ctx = this,\n filter = spec.filter != null ? ctx.eventExpression(spec.filter) : undefined,\n stream = spec.stream != null ? ctx.get(spec.stream) : undefined,\n args;\n\n if (spec.source) {\n stream = ctx.events(spec.source, spec.type, filter);\n } else if (spec.merge) {\n args = spec.merge.map(_ => ctx.get(_));\n stream = args[0].merge.apply(args[0], args.slice(1));\n }\n\n if (spec.between) {\n args = spec.between.map(_ => ctx.get(_));\n stream = stream.between(args[0], args[1]);\n }\n\n if (spec.filter) {\n stream = stream.filter(filter);\n }\n\n if (spec.throttle != null) {\n stream = stream.throttle(+spec.throttle);\n }\n\n if (spec.debounce != null) {\n stream = stream.debounce(+spec.debounce);\n }\n\n if (stream == null) {\n error('Invalid stream definition: ' + JSON.stringify(spec));\n }\n\n if (spec.consume) stream.consume(true);\n ctx.stream(spec, stream);\n}\n\n/**\n * Parse an event-driven operator update.\n */\n\nfunction parseUpdate (spec) {\n var ctx = this,\n srcid = isObject(srcid = spec.source) ? srcid.$ref : srcid,\n source = ctx.get(srcid),\n target = null,\n update = spec.update,\n params = undefined;\n if (!source) error('Source not defined: ' + spec.source);\n target = spec.target && spec.target.$expr ? ctx.eventExpression(spec.target.$expr) : ctx.get(spec.target);\n\n if (update && update.$expr) {\n if (update.$params) {\n params = ctx.parseParameters(update.$params);\n }\n\n update = ctx.handlerExpression(update.$expr);\n }\n\n ctx.update(spec, source, target, update, params);\n}\n\nconst SKIP = {\n skip: true\n};\nfunction getState(options) {\n var ctx = this,\n state = {};\n\n if (options.signals) {\n var signals = state.signals = {};\n Object.keys(ctx.signals).forEach(key => {\n const op = ctx.signals[key];\n\n if (options.signals(key, op)) {\n signals[key] = op.value;\n }\n });\n }\n\n if (options.data) {\n var data = state.data = {};\n Object.keys(ctx.data).forEach(key => {\n const dataset = ctx.data[key];\n\n if (options.data(key, dataset)) {\n data[key] = dataset.input.value;\n }\n });\n }\n\n if (ctx.subcontext && options.recurse !== false) {\n state.subcontext = ctx.subcontext.map(ctx => ctx.getState(options));\n }\n\n return state;\n}\nfunction setState(state) {\n var ctx = this,\n df = ctx.dataflow,\n data = state.data,\n signals = state.signals;\n Object.keys(signals || {}).forEach(key => {\n df.update(ctx.signals[key], signals[key], SKIP);\n });\n Object.keys(data || {}).forEach(key => {\n df.pulse(ctx.data[key].input, df.changeset().remove(truthy).insert(data[key]));\n });\n (state.subcontext || []).forEach((substate, i) => {\n const subctx = ctx.subcontext[i];\n if (subctx) subctx.setState(substate);\n });\n}\n\n/**\n * Context objects store the current parse state.\n * Enables lookup of parsed operators, event streams, accessors, etc.\n * Provides a 'fork' method for creating child contexts for subflows.\n */\n\nfunction context (df, transforms, functions, expr) {\n return new Context(df, transforms, functions, expr);\n}\n\nfunction Context(df, transforms, functions, expr) {\n this.dataflow = df;\n this.transforms = transforms;\n this.events = df.events.bind(df);\n this.expr = expr || expressionCodegen, this.signals = {};\n this.scales = {};\n this.nodes = {};\n this.data = {};\n this.fn = {};\n\n if (functions) {\n this.functions = Object.create(functions);\n this.functions.context = this;\n }\n}\n\nfunction Subcontext(ctx) {\n this.dataflow = ctx.dataflow;\n this.transforms = ctx.transforms;\n this.events = ctx.events;\n this.expr = ctx.expr;\n this.signals = Object.create(ctx.signals);\n this.scales = Object.create(ctx.scales);\n this.nodes = Object.create(ctx.nodes);\n this.data = Object.create(ctx.data);\n this.fn = Object.create(ctx.fn);\n\n if (ctx.functions) {\n this.functions = Object.create(ctx.functions);\n this.functions.context = this;\n }\n}\n\nContext.prototype = Subcontext.prototype = {\n fork() {\n const ctx = new Subcontext(this);\n (this.subcontext || (this.subcontext = [])).push(ctx);\n return ctx;\n },\n\n detach(ctx) {\n this.subcontext = this.subcontext.filter(c => c !== ctx); // disconnect all nodes in the subcontext\n // wipe out targets first for better efficiency\n\n const keys = Object.keys(ctx.nodes);\n\n for (const key of keys) ctx.nodes[key]._targets = null;\n\n for (const key of keys) ctx.nodes[key].detach();\n\n ctx.nodes = null;\n },\n\n get(id) {\n return this.nodes[id];\n },\n\n set(id, node) {\n return this.nodes[id] = node;\n },\n\n add(spec, op) {\n const ctx = this,\n df = ctx.dataflow,\n data = spec.value;\n ctx.set(spec.id, op);\n\n if (isCollect(spec.type) && data) {\n if (data.$ingest) {\n df.ingest(op, data.$ingest, data.$format);\n } else if (data.$request) {\n df.preload(op, data.$request, data.$format);\n } else {\n df.pulse(op, df.changeset().insert(data));\n }\n }\n\n if (spec.root) {\n ctx.root = op;\n }\n\n if (spec.parent) {\n let p = ctx.get(spec.parent.$ref);\n\n if (p) {\n df.connect(p, [op]);\n op.targets().add(p);\n } else {\n (ctx.unresolved = ctx.unresolved || []).push(() => {\n p = ctx.get(spec.parent.$ref);\n df.connect(p, [op]);\n op.targets().add(p);\n });\n }\n }\n\n if (spec.signal) {\n ctx.signals[spec.signal] = op;\n }\n\n if (spec.scale) {\n ctx.scales[spec.scale] = op;\n }\n\n if (spec.data) {\n for (const name in spec.data) {\n const data = ctx.data[name] || (ctx.data[name] = {});\n spec.data[name].forEach(role => data[role] = op);\n }\n }\n },\n\n resolve() {\n (this.unresolved || []).forEach(fn => fn());\n delete this.unresolved;\n return this;\n },\n\n operator(spec, update) {\n this.add(spec, this.dataflow.add(spec.value, update));\n },\n\n transform(spec, type) {\n this.add(spec, this.dataflow.add(this.transforms[canonicalType(type)]));\n },\n\n stream(spec, stream) {\n this.set(spec.id, stream);\n },\n\n update(spec, stream, target, update, params) {\n this.dataflow.on(stream, target, update, params, spec.options);\n },\n\n // expression parsing\n operatorExpression(expr) {\n return this.expr.operator(this, expr);\n },\n\n parameterExpression(expr) {\n return this.expr.parameter(this, expr);\n },\n\n eventExpression(expr) {\n return this.expr.event(this, expr);\n },\n\n handlerExpression(expr) {\n return this.expr.handler(this, expr);\n },\n\n encodeExpression(encode) {\n return this.expr.encode(this, encode);\n },\n\n // parse methods\n parse,\n parseOperator,\n parseOperatorParameters,\n parseParameters,\n parseStream,\n parseUpdate,\n // state methods\n getState,\n setState\n};\n\nexport { context };\n","import { isString, hasOwnProperty, error, truthy, constant, extend, array, isObject, isArray, toSet, debounce, isDate, inherits, stringValue } from 'vega-util';\nimport { changeset, isChangeSet, EventStream, transforms, Dataflow, asyncCallback } from 'vega-dataflow';\nimport { point, renderModule, CanvasHandler, RenderType, Scenegraph } from 'vega-scenegraph';\nimport { tickStep } from 'd3-array';\nimport { functionContext } from 'vega-functions';\nimport { context } from 'vega-runtime';\nimport { interval } from 'd3-timer';\nimport { locale } from 'vega-format';\n\n// initialize aria role and label attributes\nfunction initializeAria(view) {\n const el = view.container();\n\n if (el) {\n el.setAttribute('role', 'graphics-document');\n el.setAttribute('aria-roleDescription', 'visualization');\n ariaLabel(el, view.description());\n }\n} // update aria-label if we have a DOM container element\n\nfunction ariaLabel(el, desc) {\n if (el) desc == null ? el.removeAttribute('aria-label') : el.setAttribute('aria-label', desc);\n}\n\nfunction background (view) {\n // respond to background signal\n view.add(null, _ => {\n view._background = _.bg;\n view._resize = 1;\n return _.bg;\n }, {\n bg: view._signals.background\n });\n}\n\nconst Default = 'default';\nfunction cursor (view) {\n // get cursor signal, add to dataflow if needed\n const cursor = view._signals.cursor || (view._signals.cursor = view.add({\n user: Default,\n item: null\n })); // evaluate cursor on each mousemove event\n\n view.on(view.events('view', 'mousemove'), cursor, (_, event) => {\n const value = cursor.value,\n user = value ? isString(value) ? value : value.user : Default,\n item = event.item && event.item.cursor || null;\n return value && user === value.user && item == value.item ? value : {\n user: user,\n item: item\n };\n }); // when cursor signal updates, set visible cursor\n\n view.add(null, function (_) {\n let user = _.cursor,\n item = this.value;\n\n if (!isString(user)) {\n item = user.item;\n user = user.user;\n }\n\n setCursor(view, user && user !== Default ? user : item || user);\n return item;\n }, {\n cursor: cursor\n });\n}\nfunction setCursor(view, cursor) {\n const el = view.globalCursor() ? typeof document !== 'undefined' && document.body : view.container();\n\n if (el) {\n return cursor == null ? el.style.removeProperty('cursor') : el.style.cursor = cursor;\n }\n}\n\nfunction dataref(view, name) {\n var data = view._runtime.data;\n\n if (!hasOwnProperty(data, name)) {\n error('Unrecognized data set: ' + name);\n }\n\n return data[name];\n}\nfunction data(name, values) {\n return arguments.length < 2 ? dataref(this, name).values.value : change.call(this, name, changeset().remove(truthy).insert(values));\n}\nfunction change(name, changes) {\n if (!isChangeSet(changes)) {\n error('Second argument to changes must be a changeset.');\n }\n\n const dataset = dataref(this, name);\n dataset.modified = true;\n return this.pulse(dataset.input, changes);\n}\nfunction insert(name, _) {\n return change.call(this, name, changeset().insert(_));\n}\nfunction remove(name, _) {\n return change.call(this, name, changeset().remove(_));\n}\n\nfunction width(view) {\n var padding = view.padding();\n return Math.max(0, view._viewWidth + padding.left + padding.right);\n}\nfunction height(view) {\n var padding = view.padding();\n return Math.max(0, view._viewHeight + padding.top + padding.bottom);\n}\nfunction offset(view) {\n var padding = view.padding(),\n origin = view._origin;\n return [padding.left + origin[0], padding.top + origin[1]];\n}\nfunction resizeRenderer(view) {\n var origin = offset(view),\n w = width(view),\n h = height(view);\n\n view._renderer.background(view.background());\n\n view._renderer.resize(w, h, origin);\n\n view._handler.origin(origin);\n\n view._resizeListeners.forEach(handler => {\n try {\n handler(w, h);\n } catch (error) {\n view.error(error);\n }\n });\n}\n\n/**\n * Extend an event with additional view-specific methods.\n * Adds a new property ('vega') to an event that provides a number\n * of methods for querying information about the current interaction.\n * The vega object provides the following methods:\n * view - Returns the backing View instance.\n * item - Returns the currently active scenegraph item (if any).\n * group - Returns the currently active scenegraph group (if any).\n * This method accepts a single string-typed argument indicating the name\n * of the desired parent group. The scenegraph will be traversed from\n * the item up towards the root to search for a matching group. If no\n * argument is provided the enclosing group for the active item is\n * returned, unless the item it itself a group, in which case it is\n * returned directly.\n * xy - Returns a two-element array containing the x and y coordinates for\n * mouse or touch events. For touch events, this is based on the first\n * elements in the changedTouches array. This method accepts a single\n * argument: either an item instance or mark name that should serve as\n * the reference coordinate system. If no argument is provided the\n * top-level view coordinate system is assumed.\n * x - Returns the current x-coordinate, accepts the same arguments as xy.\n * y - Returns the current y-coordinate, accepts the same arguments as xy.\n * @param {Event} event - The input event to extend.\n * @param {Item} item - The currently active scenegraph item (if any).\n * @return {Event} - The extended input event.\n */\n\nfunction eventExtend (view, event, item) {\n var r = view._renderer,\n el = r && r.canvas(),\n p,\n e,\n translate;\n\n if (el) {\n translate = offset(view);\n e = event.changedTouches ? event.changedTouches[0] : event;\n p = point(e, el);\n p[0] -= translate[0];\n p[1] -= translate[1];\n }\n\n event.dataflow = view;\n event.item = item;\n event.vega = extension(view, item, p);\n return event;\n}\n\nfunction extension(view, item, point) {\n const itemGroup = item ? item.mark.marktype === 'group' ? item : item.mark.group : null;\n\n function group(name) {\n var g = itemGroup,\n i;\n if (name) for (i = item; i; i = i.mark.group) {\n if (i.mark.name === name) {\n g = i;\n break;\n }\n }\n return g && g.mark && g.mark.interactive ? g : {};\n }\n\n function xy(item) {\n if (!item) return point;\n if (isString(item)) item = group(item);\n const p = point.slice();\n\n while (item) {\n p[0] -= item.x || 0;\n p[1] -= item.y || 0;\n item = item.mark && item.mark.group;\n }\n\n return p;\n }\n\n return {\n view: constant(view),\n item: constant(item || {}),\n group: group,\n xy: xy,\n x: item => xy(item)[0],\n y: item => xy(item)[1]\n };\n}\n\nconst VIEW = 'view',\n TIMER = 'timer',\n WINDOW = 'window',\n NO_TRAP = {\n trap: false\n};\n/**\n * Initialize event handling configuration.\n * @param {object} config - The configuration settings.\n * @return {object}\n */\n\nfunction initializeEventConfig(config) {\n const events = extend({\n defaults: {}\n }, config);\n\n const unpack = (obj, keys) => {\n keys.forEach(k => {\n if (isArray(obj[k])) obj[k] = toSet(obj[k]);\n });\n };\n\n unpack(events.defaults, ['prevent', 'allow']);\n unpack(events, ['view', 'window', 'selector']);\n return events;\n}\nfunction trackEventListener(view, sources, type, handler) {\n view._eventListeners.push({\n type: type,\n sources: array(sources),\n handler: handler\n });\n}\n\nfunction prevent(view, type) {\n var def = view._eventConfig.defaults,\n prevent = def.prevent,\n allow = def.allow;\n return prevent === false || allow === true ? false : prevent === true || allow === false ? true : prevent ? prevent[type] : allow ? !allow[type] : view.preventDefault();\n}\n\nfunction permit(view, key, type) {\n const rule = view._eventConfig && view._eventConfig[key];\n\n if (rule === false || isObject(rule) && !rule[type]) {\n view.warn(\"Blocked \".concat(key, \" \").concat(type, \" event listener.\"));\n return false;\n }\n\n return true;\n}\n/**\n * Create a new event stream from an event source.\n * @param {object} source - The event source to monitor.\n * @param {string} type - The event type.\n * @param {function(object): boolean} [filter] - Event filter function.\n * @return {EventStream}\n */\n\n\nfunction events(source, type, filter) {\n var view = this,\n s = new EventStream(filter),\n send = function (e, item) {\n view.runAsync(null, () => {\n if (source === VIEW && prevent(view, type)) {\n e.preventDefault();\n }\n\n s.receive(eventExtend(view, e, item));\n });\n },\n sources;\n\n if (source === TIMER) {\n if (permit(view, 'timer', type)) {\n view.timer(send, type);\n }\n } else if (source === VIEW) {\n if (permit(view, 'view', type)) {\n // send traps errors, so use {trap: false} option\n view.addEventListener(type, send, NO_TRAP);\n }\n } else {\n if (source === WINDOW) {\n if (permit(view, 'window', type) && typeof window !== 'undefined') {\n sources = [window];\n }\n } else if (typeof document !== 'undefined') {\n if (permit(view, 'selector', type)) {\n sources = document.querySelectorAll(source);\n }\n }\n\n if (!sources) {\n view.warn('Can not resolve event source: ' + source);\n } else {\n for (var i = 0, n = sources.length; i < n; ++i) {\n sources[i].addEventListener(type, send);\n }\n\n trackEventListener(view, sources, type, send);\n }\n }\n\n return s;\n}\n\nfunction itemFilter(event) {\n return event.item;\n}\n\nfunction markTarget(event) {\n // grab upstream collector feeding the mark operator\n return event.item.mark.source;\n}\n\nfunction invoke(name) {\n return function (_, event) {\n return event.vega.view().changeset().encode(event.item, name);\n };\n}\n\nfunction hover (hoverSet, leaveSet) {\n hoverSet = [hoverSet || 'hover'];\n leaveSet = [leaveSet || 'update', hoverSet[0]]; // invoke hover set upon mouseover\n\n this.on(this.events('view', 'mouseover', itemFilter), markTarget, invoke(hoverSet)); // invoke leave set upon mouseout\n\n this.on(this.events('view', 'mouseout', itemFilter), markTarget, invoke(leaveSet));\n return this;\n}\n\n/**\n * Finalize a View instance that is being removed.\n * Cancel any running timers.\n * Remove all external event listeners.\n * Remove any currently displayed tooltip.\n */\nfunction finalize () {\n var tooltip = this._tooltip,\n timers = this._timers,\n listeners = this._eventListeners,\n n,\n m,\n e;\n n = timers.length;\n\n while (--n >= 0) {\n timers[n].stop();\n }\n\n n = listeners.length;\n\n while (--n >= 0) {\n e = listeners[n];\n m = e.sources.length;\n\n while (--m >= 0) {\n e.sources[m].removeEventListener(e.type, e.handler);\n }\n }\n\n if (tooltip) {\n tooltip.call(this, this._handler, null, null, null);\n }\n\n return this;\n}\n\nfunction element (tag, attr, text) {\n const el = document.createElement(tag);\n\n for (const key in attr) el.setAttribute(key, attr[key]);\n\n if (text != null) el.textContent = text;\n return el;\n}\n\nconst BindClass = 'vega-bind',\n NameClass = 'vega-bind-name',\n RadioClass = 'vega-bind-radio';\n/**\n * Bind a signal to an external HTML input element. The resulting two-way\n * binding will propagate input changes to signals, and propagate signal\n * changes to the input element state. If this view instance has no parent\n * element, we assume the view is headless and no bindings are created.\n * @param {Element|string} el - The parent DOM element to which the input\n * element should be appended as a child. If string-valued, this argument\n * will be treated as a CSS selector. If null or undefined, the parent\n * element of this view will be used as the element.\n * @param {object} param - The binding parameters which specify the signal\n * to bind to, the input element type, and type-specific configuration.\n * @return {View} - This view instance.\n */\n\nfunction bind (view, el, binding) {\n if (!el) return;\n const param = binding.param;\n let bind = binding.state;\n\n if (!bind) {\n bind = binding.state = {\n elements: null,\n active: false,\n set: null,\n update: value => {\n if (value != view.signal(param.signal)) {\n view.runAsync(null, () => {\n bind.source = true;\n view.signal(param.signal, value);\n });\n }\n }\n };\n\n if (param.debounce) {\n bind.update = debounce(param.debounce, bind.update);\n }\n }\n\n const create = param.input == null && param.element ? target : generate;\n create(bind, el, param, view);\n\n if (!bind.active) {\n view.on(view._signals[param.signal], null, () => {\n bind.source ? bind.source = false : bind.set(view.signal(param.signal));\n });\n bind.active = true;\n }\n\n return bind;\n}\n/**\n * Bind the signal to an external EventTarget.\n */\n\nfunction target(bind, node, param, view) {\n const type = param.event || 'input';\n\n const handler = () => bind.update(node.value); // initialize signal value to external input value\n\n\n view.signal(param.signal, node.value); // listen for changes on the element\n\n node.addEventListener(type, handler); // register with view, so we can remove it upon finalization\n\n trackEventListener(view, node, type, handler); // propagate change to element\n\n bind.set = value => {\n node.value = value;\n node.dispatchEvent(event(type));\n };\n}\n\nfunction event(type) {\n return typeof Event !== 'undefined' ? new Event(type) : {\n type\n };\n}\n/**\n * Generate an HTML input form element and bind it to a signal.\n */\n\n\nfunction generate(bind, el, param, view) {\n const value = view.signal(param.signal);\n const div = element('div', {\n 'class': BindClass\n });\n const wrapper = param.input === 'radio' ? div : div.appendChild(element('label'));\n wrapper.appendChild(element('span', {\n 'class': NameClass\n }, param.name || param.signal));\n el.appendChild(div);\n let input = form;\n\n switch (param.input) {\n case 'checkbox':\n input = checkbox;\n break;\n\n case 'select':\n input = select;\n break;\n\n case 'radio':\n input = radio;\n break;\n\n case 'range':\n input = range;\n break;\n }\n\n input(bind, wrapper, param, value);\n}\n/**\n * Generates an arbitrary input form element.\n * The input type is controlled via user-provided parameters.\n */\n\n\nfunction form(bind, el, param, value) {\n const node = element('input');\n\n for (const key in param) {\n if (key !== 'signal' && key !== 'element') {\n node.setAttribute(key === 'input' ? 'type' : key, param[key]);\n }\n }\n\n node.setAttribute('name', param.signal);\n node.value = value;\n el.appendChild(node);\n node.addEventListener('input', () => bind.update(node.value));\n bind.elements = [node];\n\n bind.set = value => node.value = value;\n}\n/**\n * Generates a checkbox input element.\n */\n\n\nfunction checkbox(bind, el, param, value) {\n const attr = {\n type: 'checkbox',\n name: param.signal\n };\n if (value) attr.checked = true;\n const node = element('input', attr);\n el.appendChild(node);\n node.addEventListener('change', () => bind.update(node.checked));\n bind.elements = [node];\n\n bind.set = value => node.checked = !!value || null;\n}\n/**\n * Generates a selection list input element.\n */\n\n\nfunction select(bind, el, param, value) {\n const node = element('select', {\n name: param.signal\n }),\n labels = param.labels || [];\n param.options.forEach((option, i) => {\n const attr = {\n value: option\n };\n if (valuesEqual(option, value)) attr.selected = true;\n node.appendChild(element('option', attr, (labels[i] || option) + ''));\n });\n el.appendChild(node);\n node.addEventListener('change', () => {\n bind.update(param.options[node.selectedIndex]);\n });\n bind.elements = [node];\n\n bind.set = value => {\n for (let i = 0, n = param.options.length; i < n; ++i) {\n if (valuesEqual(param.options[i], value)) {\n node.selectedIndex = i;\n return;\n }\n }\n };\n}\n/**\n * Generates a radio button group.\n */\n\n\nfunction radio(bind, el, param, value) {\n const group = element('span', {\n 'class': RadioClass\n }),\n labels = param.labels || [];\n el.appendChild(group);\n bind.elements = param.options.map((option, i) => {\n const attr = {\n type: 'radio',\n name: param.signal,\n value: option\n };\n if (valuesEqual(option, value)) attr.checked = true;\n const input = element('input', attr);\n input.addEventListener('change', () => bind.update(option));\n const label = element('label', {}, (labels[i] || option) + '');\n label.prepend(input);\n group.appendChild(label);\n return input;\n });\n\n bind.set = value => {\n const nodes = bind.elements,\n n = nodes.length;\n\n for (let i = 0; i < n; ++i) {\n if (valuesEqual(nodes[i].value, value)) nodes[i].checked = true;\n }\n };\n}\n/**\n * Generates a slider input element.\n */\n\n\nfunction range(bind, el, param, value) {\n value = value !== undefined ? value : (+param.max + +param.min) / 2;\n const max = param.max != null ? param.max : Math.max(100, +value) || 100,\n min = param.min || Math.min(0, max, +value) || 0,\n step = param.step || tickStep(min, max, 100);\n const node = element('input', {\n type: 'range',\n name: param.signal,\n min: min,\n max: max,\n step: step\n });\n node.value = value;\n const span = element('span', {}, +value);\n el.appendChild(node);\n el.appendChild(span);\n\n const update = () => {\n span.textContent = node.value;\n bind.update(+node.value);\n }; // subscribe to both input and change\n\n\n node.addEventListener('input', update);\n node.addEventListener('change', update);\n bind.elements = [node];\n\n bind.set = value => {\n node.value = value;\n span.textContent = value;\n };\n}\n\nfunction valuesEqual(a, b) {\n return a === b || a + '' === b + '';\n}\n\nfunction initializeRenderer (view, r, el, constructor, scaleFactor, opt) {\n r = r || new constructor(view.loader());\n return r.initialize(el, width(view), height(view), offset(view), scaleFactor, opt).background(view.background());\n}\n\nfunction trap (view, fn) {\n return !fn ? null : function () {\n try {\n fn.apply(this, arguments);\n } catch (error) {\n view.error(error);\n }\n };\n}\n\nfunction initializeHandler (view, prevHandler, el, constructor) {\n // instantiate scenegraph handler\n const handler = new constructor(view.loader(), trap(view, view.tooltip())).scene(view.scenegraph().root).initialize(el, offset(view), view); // transfer event handlers\n\n if (prevHandler) {\n prevHandler.handlers().forEach(h => {\n handler.on(h.type, h.handler);\n });\n }\n\n return handler;\n}\n\nfunction initialize (el, elBind) {\n const view = this,\n type = view._renderType,\n config = view._eventConfig.bind,\n module = renderModule(type); // containing dom element\n\n el = view._el = el ? lookup(view, el, true) : null; // initialize aria attributes\n\n initializeAria(view); // select appropriate renderer & handler\n\n if (!module) view.error('Unrecognized renderer type: ' + type);\n const Handler = module.handler || CanvasHandler,\n Renderer = el ? module.renderer : module.headless; // initialize renderer and input handler\n\n view._renderer = !Renderer ? null : initializeRenderer(view, view._renderer, el, Renderer);\n view._handler = initializeHandler(view, view._handler, el, Handler);\n view._redraw = true; // initialize signal bindings\n\n if (el && config !== 'none') {\n elBind = elBind ? view._elBind = lookup(view, elBind, true) : el.appendChild(element('form', {\n 'class': 'vega-bindings'\n }));\n\n view._bind.forEach(_ => {\n if (_.param.element && config !== 'container') {\n _.element = lookup(view, _.param.element, !!_.param.input);\n }\n });\n\n view._bind.forEach(_ => {\n bind(view, _.element || elBind, _);\n });\n }\n\n return view;\n}\n\nfunction lookup(view, el, clear) {\n if (typeof el === 'string') {\n if (typeof document !== 'undefined') {\n el = document.querySelector(el);\n\n if (!el) {\n view.error('Signal bind element not found: ' + el);\n return null;\n }\n } else {\n view.error('DOM document instance not found.');\n return null;\n }\n }\n\n if (el && clear) {\n try {\n el.textContent = '';\n } catch (e) {\n el = null;\n view.error(e);\n }\n }\n\n return el;\n}\n\nconst number = _ => +_ || 0;\n\nconst paddingObject = _ => ({\n top: _,\n bottom: _,\n left: _,\n right: _\n});\n\nfunction padding (_) {\n return isObject(_) ? {\n top: number(_.top),\n bottom: number(_.bottom),\n left: number(_.left),\n right: number(_.right)\n } : paddingObject(number(_));\n}\n\n/**\n * Render the current scene in a headless fashion.\n * This method is asynchronous, returning a Promise instance.\n * @return {Promise} - A Promise that resolves to a renderer.\n */\n\nasync function renderHeadless (view, type, scaleFactor, opt) {\n const module = renderModule(type),\n ctr = module && module.headless;\n if (!ctr) error('Unrecognized renderer type: ' + type);\n await view.runAsync();\n return initializeRenderer(view, null, null, ctr, scaleFactor, opt).renderAsync(view._scenegraph.root);\n}\n\n/**\n * Produce an image URL for the visualization. Depending on the type\n * parameter, the generated URL contains data for either a PNG or SVG image.\n * The URL can be used (for example) to download images of the visualization.\n * This method is asynchronous, returning a Promise instance.\n * @param {string} type - The image type. One of 'svg', 'png' or 'canvas'.\n * The 'canvas' and 'png' types are synonyms for a PNG image.\n * @return {Promise} - A promise that resolves to an image URL.\n */\n\nasync function renderToImageURL (type, scaleFactor) {\n if (type !== RenderType.Canvas && type !== RenderType.SVG && type !== RenderType.PNG) {\n error('Unrecognized image type: ' + type);\n }\n\n const r = await renderHeadless(this, type, scaleFactor);\n return type === RenderType.SVG ? toBlobURL(r.svg(), 'image/svg+xml') : r.canvas().toDataURL('image/png');\n}\n\nfunction toBlobURL(data, mime) {\n const blob = new Blob([data], {\n type: mime\n });\n return window.URL.createObjectURL(blob);\n}\n\n/**\n * Produce a Canvas instance containing a rendered visualization.\n * This method is asynchronous, returning a Promise instance.\n * @return {Promise} - A promise that resolves to a Canvas instance.\n */\n\nasync function renderToCanvas (scaleFactor, opt) {\n const r = await renderHeadless(this, RenderType.Canvas, scaleFactor, opt);\n return r.canvas();\n}\n\n/**\n * Produce a rendered SVG string of the visualization.\n * This method is asynchronous, returning a Promise instance.\n * @return {Promise} - A promise that resolves to an SVG string.\n */\n\nasync function renderToSVG (scaleFactor) {\n const r = await renderHeadless(this, RenderType.SVG, scaleFactor);\n return r.svg();\n}\n\nfunction runtime (view, spec, expr) {\n return context(view, transforms, functionContext, expr).parse(spec);\n}\n\nfunction scale(name) {\n var scales = this._runtime.scales;\n\n if (!hasOwnProperty(scales, name)) {\n error('Unrecognized scale or projection: ' + name);\n }\n\n return scales[name].value;\n}\n\nvar Width = 'width',\n Height = 'height',\n Padding = 'padding',\n Skip = {\n skip: true\n};\nfunction viewWidth(view, width) {\n var a = view.autosize(),\n p = view.padding();\n return width - (a && a.contains === Padding ? p.left + p.right : 0);\n}\nfunction viewHeight(view, height) {\n var a = view.autosize(),\n p = view.padding();\n return height - (a && a.contains === Padding ? p.top + p.bottom : 0);\n}\nfunction initializeResize(view) {\n var s = view._signals,\n w = s[Width],\n h = s[Height],\n p = s[Padding];\n\n function resetSize() {\n view._autosize = view._resize = 1;\n } // respond to width signal\n\n\n view._resizeWidth = view.add(null, _ => {\n view._width = _.size;\n view._viewWidth = viewWidth(view, _.size);\n resetSize();\n }, {\n size: w\n }); // respond to height signal\n\n view._resizeHeight = view.add(null, _ => {\n view._height = _.size;\n view._viewHeight = viewHeight(view, _.size);\n resetSize();\n }, {\n size: h\n }); // respond to padding signal\n\n const resizePadding = view.add(null, resetSize, {\n pad: p\n }); // set rank to run immediately after source signal\n\n view._resizeWidth.rank = w.rank + 1;\n view._resizeHeight.rank = h.rank + 1;\n resizePadding.rank = p.rank + 1;\n}\nfunction resizeView(viewWidth, viewHeight, width, height, origin, auto) {\n this.runAfter(view => {\n let rerun = 0; // reset autosize flag\n\n view._autosize = 0; // width value changed: update signal, skip resize op\n\n if (view.width() !== width) {\n rerun = 1;\n view.signal(Width, width, Skip); // set width, skip update calc\n\n view._resizeWidth.skip(true); // skip width resize handler\n\n } // height value changed: update signal, skip resize op\n\n\n if (view.height() !== height) {\n rerun = 1;\n view.signal(Height, height, Skip); // set height, skip update calc\n\n view._resizeHeight.skip(true); // skip height resize handler\n\n } // view width changed: update view property, set resize flag\n\n\n if (view._viewWidth !== viewWidth) {\n view._resize = 1;\n view._viewWidth = viewWidth;\n } // view height changed: update view property, set resize flag\n\n\n if (view._viewHeight !== viewHeight) {\n view._resize = 1;\n view._viewHeight = viewHeight;\n } // origin changed: update view property, set resize flag\n\n\n if (view._origin[0] !== origin[0] || view._origin[1] !== origin[1]) {\n view._resize = 1;\n view._origin = origin;\n } // run dataflow on width/height signal change\n\n\n if (rerun) view.run('enter');\n if (auto) view.runAfter(v => v.resize());\n }, false, 1);\n}\n\n/**\n * Get the current view state, consisting of signal values and/or data sets.\n * @param {object} [options] - Options flags indicating which state to export.\n * If unspecified, all signals and data sets will be exported.\n * @param {function(string, Operator):boolean} [options.signals] - Optional\n * predicate function for testing if a signal should be included in the\n * exported state. If unspecified, all signals will be included, except for\n * those named 'parent' or those which refer to a Transform value.\n * @param {function(string, object):boolean} [options.data] - Optional\n * predicate function for testing if a data set's input should be included\n * in the exported state. If unspecified, all data sets that have been\n * explicitly modified will be included.\n * @param {boolean} [options.recurse=true] - Flag indicating if the exported\n * state should recursively include state from group mark sub-contexts.\n * @return {object} - An object containing the exported state values.\n */\n\nfunction getState(options) {\n return this._runtime.getState(options || {\n data: dataTest,\n signals: signalTest,\n recurse: true\n });\n}\n\nfunction dataTest(name, data) {\n return data.modified && isArray(data.input.value) && name.indexOf('_:vega:_');\n}\n\nfunction signalTest(name, op) {\n return !(name === 'parent' || op instanceof transforms.proxy);\n}\n/**\n * Sets the current view state and updates the view by invoking run.\n * @param {object} state - A state object containing signal and/or\n * data set values, following the format used by the getState method.\n * @return {View} - This view instance.\n */\n\n\nfunction setState(state) {\n this.runAsync(null, v => {\n v._trigger = false;\n\n v._runtime.setState(state);\n }, v => {\n v._trigger = true;\n });\n return this;\n}\n\nfunction timer (callback, delay) {\n function tick(elapsed) {\n callback({\n timestamp: Date.now(),\n elapsed: elapsed\n });\n }\n\n this._timers.push(interval(tick, delay));\n}\n\nfunction defaultTooltip (handler, event, item, value) {\n const el = handler.element();\n if (el) el.setAttribute('title', formatTooltip(value));\n}\n\nfunction formatTooltip(value) {\n return value == null ? '' : isArray(value) ? formatArray(value) : isObject(value) && !isDate(value) ? formatObject(value) : value + '';\n}\n\nfunction formatObject(obj) {\n return Object.keys(obj).map(key => {\n const v = obj[key];\n return key + ': ' + (isArray(v) ? formatArray(v) : formatValue(v));\n }).join('\\n');\n}\n\nfunction formatArray(value) {\n return '[' + value.map(formatValue).join(', ') + ']';\n}\n\nfunction formatValue(value) {\n return isArray(value) ? '[\\u2026]' : isObject(value) && !isDate(value) ? '{\\u2026}' : value;\n}\n\n/**\n * Create a new View instance from a Vega dataflow runtime specification.\n * The generated View will not immediately be ready for display. Callers\n * should also invoke the initialize method (e.g., to set the parent\n * DOM element in browser-based deployment) and then invoke the run\n * method to evaluate the dataflow graph. Rendering will automatically\n * be performed upon dataflow runs.\n * @constructor\n * @param {object} spec - The Vega dataflow runtime specification.\n */\n\nfunction View(spec, options) {\n const view = this;\n options = options || {};\n Dataflow.call(view);\n if (options.loader) view.loader(options.loader);\n if (options.logger) view.logger(options.logger);\n if (options.logLevel != null) view.logLevel(options.logLevel);\n\n if (options.locale || spec.locale) {\n const loc = extend({}, spec.locale, options.locale);\n view.locale(locale(loc.number, loc.time));\n }\n\n view._el = null;\n view._elBind = null;\n view._renderType = options.renderer || RenderType.Canvas;\n view._scenegraph = new Scenegraph();\n const root = view._scenegraph.root; // initialize renderer, handler and event management\n\n view._renderer = null;\n view._tooltip = options.tooltip || defaultTooltip, view._redraw = true;\n view._handler = new CanvasHandler().scene(root);\n view._globalCursor = false;\n view._preventDefault = false;\n view._timers = [];\n view._eventListeners = [];\n view._resizeListeners = []; // initialize event configuration\n\n view._eventConfig = initializeEventConfig(spec.eventConfig);\n view.globalCursor(view._eventConfig.globalCursor); // initialize dataflow graph\n\n const ctx = runtime(view, spec, options.expr);\n view._runtime = ctx;\n view._signals = ctx.signals;\n view._bind = (spec.bindings || []).map(_ => ({\n state: null,\n param: extend({}, _)\n })); // initialize scenegraph\n\n if (ctx.root) ctx.root.set(root);\n root.source = ctx.data.root.input;\n view.pulse(ctx.data.root.input, view.changeset().insert(root.items)); // initialize view size\n\n view._width = view.width();\n view._height = view.height();\n view._viewWidth = viewWidth(view, view._width);\n view._viewHeight = viewHeight(view, view._height);\n view._origin = [0, 0];\n view._resize = 0;\n view._autosize = 1;\n initializeResize(view); // initialize background color\n\n background(view); // initialize cursor\n\n cursor(view); // initialize view description\n\n view.description(spec.description); // initialize hover proessing, if requested\n\n if (options.hover) view.hover(); // initialize DOM container(s) and renderer\n\n if (options.container) view.initialize(options.container, options.bind);\n}\n\nfunction lookupSignal(view, name) {\n return hasOwnProperty(view._signals, name) ? view._signals[name] : error('Unrecognized signal name: ' + stringValue(name));\n}\n\nfunction findOperatorHandler(op, handler) {\n const h = (op._targets || []).filter(op => op._update && op._update.handler === handler);\n return h.length ? h[0] : null;\n}\n\nfunction addOperatorListener(view, name, op, handler) {\n let h = findOperatorHandler(op, handler);\n\n if (!h) {\n h = trap(view, () => handler(name, op.value));\n h.handler = handler;\n view.on(op, null, h);\n }\n\n return view;\n}\n\nfunction removeOperatorListener(view, op, handler) {\n const h = findOperatorHandler(op, handler);\n if (h) op._targets.remove(h);\n return view;\n}\n\ninherits(View, Dataflow, {\n // -- DATAFLOW / RENDERING ----\n async evaluate(encode, prerun, postrun) {\n // evaluate dataflow and prerun\n await Dataflow.prototype.evaluate.call(this, encode, prerun); // render as needed\n\n if (this._redraw || this._resize) {\n try {\n if (this._renderer) {\n if (this._resize) {\n this._resize = 0;\n resizeRenderer(this);\n }\n\n await this._renderer.renderAsync(this._scenegraph.root);\n }\n\n this._redraw = false;\n } catch (e) {\n this.error(e);\n }\n } // evaluate postrun\n\n\n if (postrun) asyncCallback(this, postrun);\n return this;\n },\n\n dirty(item) {\n this._redraw = true;\n this._renderer && this._renderer.dirty(item);\n },\n\n // -- GET / SET ----\n description(text) {\n if (arguments.length) {\n const desc = text != null ? text + '' : null;\n if (desc !== this._desc) ariaLabel(this._el, this._desc = desc);\n return this;\n }\n\n return this._desc;\n },\n\n container() {\n return this._el;\n },\n\n scenegraph() {\n return this._scenegraph;\n },\n\n origin() {\n return this._origin.slice();\n },\n\n signal(name, value, options) {\n const op = lookupSignal(this, name);\n return arguments.length === 1 ? op.value : this.update(op, value, options);\n },\n\n width(_) {\n return arguments.length ? this.signal('width', _) : this.signal('width');\n },\n\n height(_) {\n return arguments.length ? this.signal('height', _) : this.signal('height');\n },\n\n padding(_) {\n return arguments.length ? this.signal('padding', padding(_)) : padding(this.signal('padding'));\n },\n\n autosize(_) {\n return arguments.length ? this.signal('autosize', _) : this.signal('autosize');\n },\n\n background(_) {\n return arguments.length ? this.signal('background', _) : this.signal('background');\n },\n\n renderer(type) {\n if (!arguments.length) return this._renderType;\n if (!renderModule(type)) error('Unrecognized renderer type: ' + type);\n\n if (type !== this._renderType) {\n this._renderType = type;\n\n this._resetRenderer();\n }\n\n return this;\n },\n\n tooltip(handler) {\n if (!arguments.length) return this._tooltip;\n\n if (handler !== this._tooltip) {\n this._tooltip = handler;\n\n this._resetRenderer();\n }\n\n return this;\n },\n\n loader(loader) {\n if (!arguments.length) return this._loader;\n\n if (loader !== this._loader) {\n Dataflow.prototype.loader.call(this, loader);\n\n this._resetRenderer();\n }\n\n return this;\n },\n\n resize() {\n // set flag to perform autosize\n this._autosize = 1; // touch autosize signal to ensure top-level ViewLayout runs\n\n return this.touch(lookupSignal(this, 'autosize'));\n },\n\n _resetRenderer() {\n if (this._renderer) {\n this._renderer = null;\n this.initialize(this._el, this._elBind);\n }\n },\n\n // -- SIZING ----\n _resizeView: resizeView,\n\n // -- EVENT HANDLING ----\n addEventListener(type, handler, options) {\n let callback = handler;\n\n if (!(options && options.trap === false)) {\n // wrap callback in error handler\n callback = trap(this, handler);\n callback.raw = handler;\n }\n\n this._handler.on(type, callback);\n\n return this;\n },\n\n removeEventListener(type, handler) {\n var handlers = this._handler.handlers(type),\n i = handlers.length,\n h,\n t; // search registered handlers, remove if match found\n\n\n while (--i >= 0) {\n t = handlers[i].type;\n h = handlers[i].handler;\n\n if (type === t && (handler === h || handler === h.raw)) {\n this._handler.off(t, h);\n\n break;\n }\n }\n\n return this;\n },\n\n addResizeListener(handler) {\n const l = this._resizeListeners;\n\n if (l.indexOf(handler) < 0) {\n // add handler if it isn't already registered\n // note: error trapping handled elsewhere, so\n // no need to wrap handlers here\n l.push(handler);\n }\n\n return this;\n },\n\n removeResizeListener(handler) {\n var l = this._resizeListeners,\n i = l.indexOf(handler);\n\n if (i >= 0) {\n l.splice(i, 1);\n }\n\n return this;\n },\n\n addSignalListener(name, handler) {\n return addOperatorListener(this, name, lookupSignal(this, name), handler);\n },\n\n removeSignalListener(name, handler) {\n return removeOperatorListener(this, lookupSignal(this, name), handler);\n },\n\n addDataListener(name, handler) {\n return addOperatorListener(this, name, dataref(this, name).values, handler);\n },\n\n removeDataListener(name, handler) {\n return removeOperatorListener(this, dataref(this, name).values, handler);\n },\n\n globalCursor(_) {\n if (arguments.length) {\n if (this._globalCursor !== !!_) {\n const prev = setCursor(this, null); // clear previous cursor\n\n this._globalCursor = !!_;\n if (prev) setCursor(this, prev); // swap cursor\n }\n\n return this;\n } else {\n return this._globalCursor;\n }\n },\n\n preventDefault(_) {\n if (arguments.length) {\n this._preventDefault = _;\n return this;\n } else {\n return this._preventDefault;\n }\n },\n\n timer,\n events,\n finalize,\n hover,\n // -- DATA ----\n data,\n change,\n insert,\n remove,\n // -- SCALES --\n scale,\n // -- INITIALIZATION ----\n initialize,\n // -- HEADLESS RENDERING ----\n toImageURL: renderToImageURL,\n toCanvas: renderToCanvas,\n toSVG: renderToSVG,\n // -- SAVE / RESTORE STATE ----\n getState,\n setState\n});\n\nexport { View };\n","import {Timer, now} from \"./timer.js\";\n\nexport default function(callback, delay, time) {\n var t = new Timer, total = delay;\n if (delay == null) return t.restart(callback, delay, time), t;\n t._restart = t.restart;\n t.restart = function(callback, delay, time) {\n delay = +delay, time = time == null ? now() : +time;\n t._restart(function tick(elapsed) {\n elapsed += total;\n t._restart(tick, total += delay, time);\n callback(elapsed);\n }, delay, time);\n }\n t.restart(callback, delay, time);\n return t;\n}\n","const VIEW = 'view',\n LBRACK = '[',\n RBRACK = ']',\n LBRACE = '{',\n RBRACE = '}',\n COLON = ':',\n COMMA = ',',\n NAME = '@',\n GT = '>',\n ILLEGAL = /[[\\]{}]/,\n DEFAULT_MARKS = {\n '*': 1,\n arc: 1,\n area: 1,\n group: 1,\n image: 1,\n line: 1,\n path: 1,\n rect: 1,\n rule: 1,\n shape: 1,\n symbol: 1,\n text: 1,\n trail: 1\n};\nlet DEFAULT_SOURCE, MARKS;\n/**\n * Parse an event selector string.\n * Returns an array of event stream definitions.\n */\n\nfunction eventSelector (selector, source, marks) {\n DEFAULT_SOURCE = source || VIEW;\n MARKS = marks || DEFAULT_MARKS;\n return parseMerge(selector.trim()).map(parseSelector);\n}\n\nfunction isMarkType(type) {\n return MARKS[type];\n}\n\nfunction find(s, i, endChar, pushChar, popChar) {\n const n = s.length;\n let count = 0,\n c;\n\n for (; i < n; ++i) {\n c = s[i];\n if (!count && c === endChar) return i;else if (popChar && popChar.indexOf(c) >= 0) --count;else if (pushChar && pushChar.indexOf(c) >= 0) ++count;\n }\n\n return i;\n}\n\nfunction parseMerge(s) {\n const output = [],\n n = s.length;\n let start = 0,\n i = 0;\n\n while (i < n) {\n i = find(s, i, COMMA, LBRACK + LBRACE, RBRACK + RBRACE);\n output.push(s.substring(start, i).trim());\n start = ++i;\n }\n\n if (output.length === 0) {\n throw 'Empty event selector: ' + s;\n }\n\n return output;\n}\n\nfunction parseSelector(s) {\n return s[0] === '[' ? parseBetween(s) : parseStream(s);\n}\n\nfunction parseBetween(s) {\n const n = s.length;\n let i = 1,\n b;\n i = find(s, i, RBRACK, LBRACK, RBRACK);\n\n if (i === n) {\n throw 'Empty between selector: ' + s;\n }\n\n b = parseMerge(s.substring(1, i));\n\n if (b.length !== 2) {\n throw 'Between selector must have two elements: ' + s;\n }\n\n s = s.slice(i + 1).trim();\n\n if (s[0] !== GT) {\n throw 'Expected \\'>\\' after between selector: ' + s;\n }\n\n b = b.map(parseSelector);\n const stream = parseSelector(s.slice(1).trim());\n\n if (stream.between) {\n return {\n between: b,\n stream: stream\n };\n } else {\n stream.between = b;\n }\n\n return stream;\n}\n\nfunction parseStream(s) {\n const stream = {\n source: DEFAULT_SOURCE\n },\n source = [];\n let throttle = [0, 0],\n markname = 0,\n start = 0,\n n = s.length,\n i = 0,\n j,\n filter; // extract throttle from end\n\n if (s[n - 1] === RBRACE) {\n i = s.lastIndexOf(LBRACE);\n\n if (i >= 0) {\n try {\n throttle = parseThrottle(s.substring(i + 1, n - 1));\n } catch (e) {\n throw 'Invalid throttle specification: ' + s;\n }\n\n s = s.slice(0, i).trim();\n n = s.length;\n } else throw 'Unmatched right brace: ' + s;\n\n i = 0;\n }\n\n if (!n) throw s; // set name flag based on first char\n\n if (s[0] === NAME) markname = ++i; // extract first part of multi-part stream selector\n\n j = find(s, i, COLON);\n\n if (j < n) {\n source.push(s.substring(start, j).trim());\n start = i = ++j;\n } // extract remaining part of stream selector\n\n\n i = find(s, i, LBRACK);\n\n if (i === n) {\n source.push(s.substring(start, n).trim());\n } else {\n source.push(s.substring(start, i).trim());\n filter = [];\n start = ++i;\n if (start === n) throw 'Unmatched left bracket: ' + s;\n } // extract filters\n\n\n while (i < n) {\n i = find(s, i, RBRACK);\n if (i === n) throw 'Unmatched left bracket: ' + s;\n filter.push(s.substring(start, i).trim());\n if (i < n - 1 && s[++i] !== LBRACK) throw 'Expected left bracket: ' + s;\n start = ++i;\n } // marshall event stream specification\n\n\n if (!(n = source.length) || ILLEGAL.test(source[n - 1])) {\n throw 'Invalid event selector: ' + s;\n }\n\n if (n > 1) {\n stream.type = source[1];\n\n if (markname) {\n stream.markname = source[0].slice(1);\n } else if (isMarkType(source[0])) {\n stream.marktype = source[0];\n } else {\n stream.source = source[0];\n }\n } else {\n stream.type = source[0];\n }\n\n if (stream.type.slice(-1) === '!') {\n stream.consume = true;\n stream.type = stream.type.slice(0, -1);\n }\n\n if (filter != null) stream.filter = filter;\n if (throttle[0]) stream.throttle = throttle[0];\n if (throttle[1]) stream.debounce = throttle[1];\n return stream;\n}\n\nfunction parseThrottle(s) {\n const a = s.split(COMMA);\n if (!s.length || a.length > 2) throw s;\n return a.map(_ => {\n const x = +_;\n if (x !== x) throw s;\n return x;\n });\n}\n\nexport { eventSelector as parseSelector };\n","import { isObject, isArray, extend, hasOwnProperty, array, stringValue, peek, isString, error, splitAccessPath, mergeConfig } from 'vega-util';\nimport { parseExpression } from 'vega-functions';\nimport { parseSelector } from 'vega-event-selector';\nimport { isValidScaleType, isDiscrete, isQuantile, isDiscretizing, isContinuous } from 'vega-scale';\nimport { definition as definition$1 } from 'vega-dataflow';\n\nfunction parseAutosize (spec) {\n return isObject(spec) ? spec : {\n type: spec || 'pad'\n };\n}\n\nconst number = _ => +_ || 0;\n\nconst paddingObject = _ => ({\n top: _,\n bottom: _,\n left: _,\n right: _\n});\n\nfunction parsePadding (spec) {\n return !isObject(spec) ? paddingObject(number(spec)) : spec.signal ? spec : {\n top: number(spec.top),\n bottom: number(spec.bottom),\n left: number(spec.left),\n right: number(spec.right)\n };\n}\n\nconst encoder = _ => isObject(_) && !isArray(_) ? extend({}, _) : {\n value: _\n};\nfunction addEncode(object, name, value, set) {\n if (value != null) {\n const isEncoder = isObject(value) && !isArray(value) || isArray(value) && value.length && isObject(value[0]); // Always assign signal to update, even if the signal is from the enter block\n\n if (isEncoder) {\n object.update[name] = value;\n } else {\n object[set || 'enter'][name] = {\n value: value\n };\n }\n\n return 1;\n } else {\n return 0;\n }\n}\nfunction addEncoders(object, enter, update) {\n for (const name in enter) {\n addEncode(object, name, enter[name]);\n }\n\n for (const name in update) {\n addEncode(object, name, update[name], 'update');\n }\n}\nfunction extendEncode(encode, extra, skip) {\n for (const name in extra) {\n if (skip && hasOwnProperty(skip, name)) continue;\n encode[name] = extend(encode[name] || {}, extra[name]);\n }\n\n return encode;\n}\nfunction has(key, encode) {\n return encode && (encode.enter && encode.enter[key] || encode.update && encode.update[key]);\n}\n\nconst MarkRole = 'mark';\nconst FrameRole = 'frame';\nconst ScopeRole = 'scope';\nconst AxisRole = 'axis';\nconst AxisDomainRole = 'axis-domain';\nconst AxisGridRole = 'axis-grid';\nconst AxisLabelRole = 'axis-label';\nconst AxisTickRole = 'axis-tick';\nconst AxisTitleRole = 'axis-title';\nconst LegendRole = 'legend';\nconst LegendBandRole = 'legend-band';\nconst LegendEntryRole = 'legend-entry';\nconst LegendGradientRole = 'legend-gradient';\nconst LegendLabelRole = 'legend-label';\nconst LegendSymbolRole = 'legend-symbol';\nconst LegendTitleRole = 'legend-title';\nconst TitleRole = 'title';\nconst TitleTextRole = 'title-text';\nconst TitleSubtitleRole = 'title-subtitle';\n\nfunction applyDefaults (encode, type, role, style, config) {\n const defaults = {},\n enter = {};\n let update, key, skip, props; // if text mark, apply global lineBreak settings (#2370)\n\n key = 'lineBreak';\n\n if (type === 'text' && config[key] != null && !has(key, encode)) {\n applyDefault(defaults, key, config[key]);\n } // ignore legend and axis roles\n\n\n if (role == 'legend' || String(role).startsWith('axis')) {\n role = null;\n } // resolve mark config\n\n\n props = role === FrameRole ? config.group : role === MarkRole ? extend({}, config.mark, config[type]) : null;\n\n for (key in props) {\n // do not apply defaults if relevant fields are defined\n skip = has(key, encode) || (key === 'fill' || key === 'stroke') && (has('fill', encode) || has('stroke', encode));\n if (!skip) applyDefault(defaults, key, props[key]);\n } // resolve styles, apply with increasing precedence\n\n\n array(style).forEach(name => {\n const props = config.style && config.style[name];\n\n for (const key in props) {\n if (!has(key, encode)) {\n applyDefault(defaults, key, props[key]);\n }\n }\n });\n encode = extend({}, encode); // defensive copy\n\n for (key in defaults) {\n props = defaults[key];\n\n if (props.signal) {\n (update = update || {})[key] = props;\n } else {\n enter[key] = props;\n }\n }\n\n encode.enter = extend(enter, encode.enter);\n if (update) encode.update = extend(update, encode.update);\n return encode;\n}\n\nfunction applyDefault(defaults, key, value) {\n defaults[key] = value && value.signal ? {\n signal: value.signal\n } : {\n value: value\n };\n}\n\nconst scaleRef = scale => isString(scale) ? stringValue(scale) : scale.signal ? \"(\".concat(scale.signal, \")\") : field(scale);\n\nfunction entry$1(enc) {\n if (enc.gradient != null) {\n return gradient(enc);\n }\n\n let value = enc.signal ? \"(\".concat(enc.signal, \")\") : enc.color ? color(enc.color) : enc.field != null ? field(enc.field) : enc.value !== undefined ? stringValue(enc.value) : undefined;\n\n if (enc.scale != null) {\n value = scale(enc, value);\n }\n\n if (value === undefined) {\n value = null;\n }\n\n if (enc.exponent != null) {\n value = \"pow(\".concat(value, \",\").concat(property(enc.exponent), \")\");\n }\n\n if (enc.mult != null) {\n value += \"*\".concat(property(enc.mult));\n }\n\n if (enc.offset != null) {\n value += \"+\".concat(property(enc.offset));\n }\n\n if (enc.round) {\n value = \"round(\".concat(value, \")\");\n }\n\n return value;\n}\n\nconst _color = (type, x, y, z) => \"(\".concat(type, \"(\").concat([x, y, z].map(entry$1).join(','), \")+'')\");\n\nfunction color(enc) {\n return enc.c ? _color('hcl', enc.h, enc.c, enc.l) : enc.h || enc.s ? _color('hsl', enc.h, enc.s, enc.l) : enc.l || enc.a ? _color('lab', enc.l, enc.a, enc.b) : enc.r || enc.g || enc.b ? _color('rgb', enc.r, enc.g, enc.b) : null;\n}\n\nfunction gradient(enc) {\n // map undefined to null; expression lang does not allow undefined\n const args = [enc.start, enc.stop, enc.count].map(_ => _ == null ? null : stringValue(_)); // trim null inputs from the end\n\n while (args.length && peek(args) == null) args.pop();\n\n args.unshift(scaleRef(enc.gradient));\n return \"gradient(\".concat(args.join(','), \")\");\n}\n\nfunction property(property) {\n return isObject(property) ? '(' + entry$1(property) + ')' : property;\n}\n\nfunction field(ref) {\n return resolveField(isObject(ref) ? ref : {\n datum: ref\n });\n}\n\nfunction resolveField(ref) {\n let object, level, field;\n\n if (ref.signal) {\n object = 'datum';\n field = ref.signal;\n } else if (ref.group || ref.parent) {\n level = Math.max(1, ref.level || 1);\n object = 'item';\n\n while (level-- > 0) {\n object += '.mark.group';\n }\n\n if (ref.parent) {\n field = ref.parent;\n object += '.datum';\n } else {\n field = ref.group;\n }\n } else if (ref.datum) {\n object = 'datum';\n field = ref.datum;\n } else {\n error('Invalid field reference: ' + stringValue(ref));\n }\n\n if (!ref.signal) {\n field = isString(field) ? splitAccessPath(field).map(stringValue).join('][') : resolveField(field);\n }\n\n return object + '[' + field + ']';\n}\n\nfunction scale(enc, value) {\n const scale = scaleRef(enc.scale);\n\n if (enc.range != null) {\n // pull value from scale range\n value = \"lerp(_range(\".concat(scale, \"), \").concat(+enc.range, \")\");\n } else {\n // run value through scale and/or pull scale bandwidth\n if (value !== undefined) value = \"_scale(\".concat(scale, \", \").concat(value, \")\");\n\n if (enc.band) {\n value = (value ? value + '+' : '') + \"_bandwidth(\".concat(scale, \")\") + (+enc.band === 1 ? '' : '*' + property(enc.band));\n\n if (enc.extra) {\n // include logic to handle extraneous elements\n value = \"(datum.extra ? _scale(\".concat(scale, \", datum.extra.value) : \").concat(value, \")\");\n }\n }\n\n if (value == null) value = '0';\n }\n\n return value;\n}\n\nfunction rule (enc) {\n let code = '';\n enc.forEach(rule => {\n const value = entry$1(rule);\n code += rule.test ? \"(\".concat(rule.test, \")?\").concat(value, \":\") : value;\n }); // if no else clause, terminate with null (#1366)\n\n if (peek(code) === ':') {\n code += 'null';\n }\n\n return code;\n}\n\nfunction parseEncode (encode, type, role, style, scope, params) {\n const enc = {};\n params = params || {};\n params.encoders = {\n $encode: enc\n };\n encode = applyDefaults(encode, type, role, style, scope.config);\n\n for (const key in encode) {\n enc[key] = parseBlock(encode[key], type, params, scope);\n }\n\n return params;\n}\n\nfunction parseBlock(block, marktype, params, scope) {\n const channels = {},\n fields = {};\n\n for (const name in block) {\n if (block[name] != null) {\n // skip any null entries\n channels[name] = parse$1(expr(block[name]), scope, params, fields);\n }\n }\n\n return {\n $expr: {\n marktype,\n channels\n },\n $fields: Object.keys(fields),\n $output: Object.keys(block)\n };\n}\n\nfunction expr(enc) {\n return isArray(enc) ? rule(enc) : entry$1(enc);\n}\n\nfunction parse$1(code, scope, params, fields) {\n const expr = parseExpression(code, scope);\n expr.$fields.forEach(name => fields[name] = 1);\n extend(params, expr.$params);\n return expr.$expr;\n}\n\nconst OUTER = 'outer',\n OUTER_INVALID = ['value', 'update', 'init', 'react', 'bind'];\n\nfunction outerError(prefix, name) {\n error(prefix + ' for \"outer\" push: ' + stringValue(name));\n}\n\nfunction parseSignal (signal, scope) {\n const name = signal.name;\n\n if (signal.push === OUTER) {\n // signal must already be defined, raise error if not\n if (!scope.signals[name]) outerError('No prior signal definition', name); // signal push must not use properties reserved for standard definition\n\n OUTER_INVALID.forEach(prop => {\n if (signal[prop] !== undefined) outerError('Invalid property ', prop);\n });\n } else {\n // define a new signal in the current scope\n const op = scope.addSignal(name, signal.value);\n if (signal.react === false) op.react = false;\n if (signal.bind) scope.addBinding(name, signal.bind);\n }\n}\n\nfunction Entry(type, value, params, parent) {\n this.id = -1;\n this.type = type;\n this.value = value;\n this.params = params;\n if (parent) this.parent = parent;\n}\nfunction entry(type, value, params, parent) {\n return new Entry(type, value, params, parent);\n}\nfunction operator(value, params) {\n return entry('operator', value, params);\n} // -----\n\nfunction ref(op) {\n const ref = {\n $ref: op.id\n }; // if operator not yet registered, cache ref to resolve later\n\n if (op.id < 0) (op.refs = op.refs || []).push(ref);\n return ref;\n}\nfunction fieldRef$1(field, name) {\n return name ? {\n $field: field,\n $name: name\n } : {\n $field: field\n };\n}\nconst keyFieldRef = fieldRef$1('key');\nfunction compareRef(fields, orders) {\n return {\n $compare: fields,\n $order: orders\n };\n}\nfunction keyRef(fields, flat) {\n const ref = {\n $key: fields\n };\n if (flat) ref.$flat = true;\n return ref;\n} // -----\n\nconst Ascending = 'ascending';\nconst Descending = 'descending';\nfunction sortKey(sort) {\n return !isObject(sort) ? '' : (sort.order === Descending ? '-' : '+') + aggrField(sort.op, sort.field);\n}\nfunction aggrField(op, field) {\n return (op && op.signal ? '$' + op.signal : op || '') + (op && field ? '_' : '') + (field && field.signal ? '$' + field.signal : field || '');\n} // -----\n\nconst Scope$1 = 'scope';\nconst View = 'view';\nfunction isSignal(_) {\n return _ && _.signal;\n}\nfunction isExpr$1(_) {\n return _ && _.expr;\n}\nfunction hasSignal(_) {\n if (isSignal(_)) return true;\n if (isObject(_)) for (const key in _) {\n if (hasSignal(_[key])) return true;\n }\n return false;\n}\nfunction value(specValue, defaultValue) {\n return specValue != null ? specValue : defaultValue;\n}\nfunction deref(v) {\n return v && v.signal || v;\n}\n\nconst Timer = 'timer';\nfunction parseStream(stream, scope) {\n const method = stream.merge ? mergeStream : stream.stream ? nestedStream : stream.type ? eventStream : error('Invalid stream specification: ' + stringValue(stream));\n return method(stream, scope);\n}\n\nfunction eventSource(source) {\n return source === Scope$1 ? View : source || View;\n}\n\nfunction mergeStream(stream, scope) {\n const list = stream.merge.map(s => parseStream(s, scope)),\n entry = streamParameters({\n merge: list\n }, stream, scope);\n return scope.addStream(entry).id;\n}\n\nfunction nestedStream(stream, scope) {\n const id = parseStream(stream.stream, scope),\n entry = streamParameters({\n stream: id\n }, stream, scope);\n return scope.addStream(entry).id;\n}\n\nfunction eventStream(stream, scope) {\n let id;\n\n if (stream.type === Timer) {\n id = scope.event(Timer, stream.throttle);\n stream = {\n between: stream.between,\n filter: stream.filter\n };\n } else {\n id = scope.event(eventSource(stream.source), stream.type);\n }\n\n const entry = streamParameters({\n stream: id\n }, stream, scope);\n return Object.keys(entry).length === 1 ? id : scope.addStream(entry).id;\n}\n\nfunction streamParameters(entry, stream, scope) {\n let param = stream.between;\n\n if (param) {\n if (param.length !== 2) {\n error('Stream \"between\" parameter must have 2 entries: ' + stringValue(stream));\n }\n\n entry.between = [parseStream(param[0], scope), parseStream(param[1], scope)];\n }\n\n param = stream.filter ? [].concat(stream.filter) : [];\n\n if (stream.marktype || stream.markname || stream.markrole) {\n // add filter for mark type, name and/or role\n param.push(filterMark(stream.marktype, stream.markname, stream.markrole));\n }\n\n if (stream.source === Scope$1) {\n // add filter to limit events from sub-scope only\n param.push('inScope(event.item)');\n }\n\n if (param.length) {\n entry.filter = parseExpression('(' + param.join(')&&(') + ')', scope).$expr;\n }\n\n if ((param = stream.throttle) != null) {\n entry.throttle = +param;\n }\n\n if ((param = stream.debounce) != null) {\n entry.debounce = +param;\n }\n\n if (stream.consume) {\n entry.consume = true;\n }\n\n return entry;\n}\n\nfunction filterMark(type, name, role) {\n const item = 'event.item';\n return item + (type && type !== '*' ? '&&' + item + '.mark.marktype===\\'' + type + '\\'' : '') + (role ? '&&' + item + '.mark.role===\\'' + role + '\\'' : '') + (name ? '&&' + item + '.mark.name===\\'' + name + '\\'' : '');\n}\n\nconst OP_VALUE_EXPR = {\n code: '_.$value',\n ast: {\n type: 'Identifier',\n value: 'value'\n }\n};\nfunction parseUpdate (spec, scope, target) {\n const encode = spec.encode,\n entry = {\n target: target\n };\n let events = spec.events,\n update = spec.update,\n sources = [];\n\n if (!events) {\n error('Signal update missing events specification.');\n } // interpret as an event selector string\n\n\n if (isString(events)) {\n events = parseSelector(events, scope.isSubscope() ? Scope$1 : View);\n } // separate event streams from signal updates\n\n\n events = array(events).filter(s => s.signal || s.scale ? (sources.push(s), 0) : 1); // merge internal operator listeners\n\n if (sources.length > 1) {\n sources = [mergeSources(sources)];\n } // merge event streams, include as source\n\n\n if (events.length) {\n sources.push(events.length > 1 ? {\n merge: events\n } : events[0]);\n }\n\n if (encode != null) {\n if (update) error('Signal encode and update are mutually exclusive.');\n update = 'encode(item(),' + stringValue(encode) + ')';\n } // resolve update value\n\n\n entry.update = isString(update) ? parseExpression(update, scope) : update.expr != null ? parseExpression(update.expr, scope) : update.value != null ? update.value : update.signal != null ? {\n $expr: OP_VALUE_EXPR,\n $params: {\n $value: scope.signalRef(update.signal)\n }\n } : error('Invalid signal update specification.');\n\n if (spec.force) {\n entry.options = {\n force: true\n };\n }\n\n sources.forEach(source => scope.addUpdate(extend(streamSource(source, scope), entry)));\n}\n\nfunction streamSource(stream, scope) {\n return {\n source: stream.signal ? scope.signalRef(stream.signal) : stream.scale ? scope.scaleRef(stream.scale) : parseStream(stream, scope)\n };\n}\n\nfunction mergeSources(sources) {\n return {\n signal: '[' + sources.map(s => s.scale ? 'scale(\"' + s.scale + '\")' : s.signal) + ']'\n };\n}\n\nfunction parseSignalUpdates (signal, scope) {\n const op = scope.getSignal(signal.name);\n let expr = signal.update;\n\n if (signal.init) {\n if (expr) {\n error('Signals can not include both init and update expressions.');\n } else {\n expr = signal.init;\n op.initonly = true;\n }\n }\n\n if (expr) {\n expr = parseExpression(expr, scope);\n op.update = expr.$expr;\n op.params = expr.$params;\n }\n\n if (signal.on) {\n signal.on.forEach(_ => parseUpdate(_, scope, op.id));\n }\n}\n\nconst transform = name => (params, value, parent) => entry(name, value, params || undefined, parent);\n\nconst Aggregate = transform('aggregate');\nconst AxisTicks = transform('axisticks');\nconst Bound = transform('bound');\nconst Collect = transform('collect');\nconst Compare = transform('compare');\nconst DataJoin = transform('datajoin');\nconst Encode = transform('encode');\nconst Expression = transform('expression');\nconst Facet = transform('facet');\nconst Field = transform('field');\nconst Key = transform('key');\nconst LegendEntries = transform('legendentries');\nconst Load = transform('load');\nconst Mark = transform('mark');\nconst MultiExtent = transform('multiextent');\nconst MultiValues = transform('multivalues');\nconst Overlap = transform('overlap');\nconst Params = transform('params');\nconst PreFacet = transform('prefacet');\nconst Projection = transform('projection');\nconst Proxy = transform('proxy');\nconst Relay = transform('relay');\nconst Render = transform('render');\nconst Scale = transform('scale');\nconst Sieve = transform('sieve');\nconst SortItems = transform('sortitems');\nconst ViewLayout = transform('viewlayout');\nconst Values = transform('values');\n\nlet FIELD_REF_ID = 0;\nconst MULTIDOMAIN_SORT_OPS = {\n min: 'min',\n max: 'max',\n count: 'sum'\n};\nfunction initScale(spec, scope) {\n const type = spec.type || 'linear';\n\n if (!isValidScaleType(type)) {\n error('Unrecognized scale type: ' + stringValue(type));\n }\n\n scope.addScale(spec.name, {\n type,\n domain: undefined\n });\n}\nfunction parseScale(spec, scope) {\n const params = scope.getScale(spec.name).params;\n let key;\n params.domain = parseScaleDomain(spec.domain, spec, scope);\n\n if (spec.range != null) {\n params.range = parseScaleRange(spec, scope, params);\n }\n\n if (spec.interpolate != null) {\n parseScaleInterpolate(spec.interpolate, params);\n }\n\n if (spec.nice != null) {\n params.nice = parseScaleNice(spec.nice);\n }\n\n if (spec.bins != null) {\n params.bins = parseScaleBins(spec.bins, scope);\n }\n\n for (key in spec) {\n if (hasOwnProperty(params, key) || key === 'name') continue;\n params[key] = parseLiteral(spec[key], scope);\n }\n}\n\nfunction parseLiteral(v, scope) {\n return !isObject(v) ? v : v.signal ? scope.signalRef(v.signal) : error('Unsupported object: ' + stringValue(v));\n}\n\nfunction parseArray(v, scope) {\n return v.signal ? scope.signalRef(v.signal) : v.map(v => parseLiteral(v, scope));\n}\n\nfunction dataLookupError(name) {\n error('Can not find data set: ' + stringValue(name));\n} // -- SCALE DOMAIN ----\n\n\nfunction parseScaleDomain(domain, spec, scope) {\n if (!domain) {\n if (spec.domainMin != null || spec.domainMax != null) {\n error('No scale domain defined for domainMin/domainMax to override.');\n }\n\n return; // default domain\n }\n\n return domain.signal ? scope.signalRef(domain.signal) : (isArray(domain) ? explicitDomain : domain.fields ? multipleDomain : singularDomain)(domain, spec, scope);\n}\n\nfunction explicitDomain(domain, spec, scope) {\n return domain.map(v => parseLiteral(v, scope));\n}\n\nfunction singularDomain(domain, spec, scope) {\n const data = scope.getData(domain.data);\n if (!data) dataLookupError(domain.data);\n return isDiscrete(spec.type) ? data.valuesRef(scope, domain.field, parseSort(domain.sort, false)) : isQuantile(spec.type) ? data.domainRef(scope, domain.field) : data.extentRef(scope, domain.field);\n}\n\nfunction multipleDomain(domain, spec, scope) {\n const data = domain.data,\n fields = domain.fields.reduce((dom, d) => {\n d = isString(d) ? {\n data: data,\n field: d\n } : isArray(d) || d.signal ? fieldRef(d, scope) : d;\n dom.push(d);\n return dom;\n }, []);\n return (isDiscrete(spec.type) ? ordinalMultipleDomain : isQuantile(spec.type) ? quantileMultipleDomain : numericMultipleDomain)(domain, scope, fields);\n}\n\nfunction fieldRef(data, scope) {\n const name = '_:vega:_' + FIELD_REF_ID++,\n coll = Collect({});\n\n if (isArray(data)) {\n coll.value = {\n $ingest: data\n };\n } else if (data.signal) {\n const code = 'setdata(' + stringValue(name) + ',' + data.signal + ')';\n coll.params.input = scope.signalRef(code);\n }\n\n scope.addDataPipeline(name, [coll, Sieve({})]);\n return {\n data: name,\n field: 'data'\n };\n}\n\nfunction ordinalMultipleDomain(domain, scope, fields) {\n const sort = parseSort(domain.sort, true);\n let a, v; // get value counts for each domain field\n\n const counts = fields.map(f => {\n const data = scope.getData(f.data);\n if (!data) dataLookupError(f.data);\n return data.countsRef(scope, f.field, sort);\n }); // aggregate the results from each domain field\n\n const p = {\n groupby: keyFieldRef,\n pulse: counts\n };\n\n if (sort) {\n a = sort.op || 'count';\n v = sort.field ? aggrField(a, sort.field) : 'count';\n p.ops = [MULTIDOMAIN_SORT_OPS[a]];\n p.fields = [scope.fieldRef(v)];\n p.as = [v];\n }\n\n a = scope.add(Aggregate(p)); // collect aggregate output\n\n const c = scope.add(Collect({\n pulse: ref(a)\n })); // extract values for combined domain\n\n v = scope.add(Values({\n field: keyFieldRef,\n sort: scope.sortRef(sort),\n pulse: ref(c)\n }));\n return ref(v);\n}\n\nfunction parseSort(sort, multidomain) {\n if (sort) {\n if (!sort.field && !sort.op) {\n if (isObject(sort)) sort.field = 'key';else sort = {\n field: 'key'\n };\n } else if (!sort.field && sort.op !== 'count') {\n error('No field provided for sort aggregate op: ' + sort.op);\n } else if (multidomain && sort.field) {\n if (sort.op && !MULTIDOMAIN_SORT_OPS[sort.op]) {\n error('Multiple domain scales can not be sorted using ' + sort.op);\n }\n }\n }\n\n return sort;\n}\n\nfunction quantileMultipleDomain(domain, scope, fields) {\n // get value arrays for each domain field\n const values = fields.map(f => {\n const data = scope.getData(f.data);\n if (!data) dataLookupError(f.data);\n return data.domainRef(scope, f.field);\n }); // combine value arrays\n\n return ref(scope.add(MultiValues({\n values: values\n })));\n}\n\nfunction numericMultipleDomain(domain, scope, fields) {\n // get extents for each domain field\n const extents = fields.map(f => {\n const data = scope.getData(f.data);\n if (!data) dataLookupError(f.data);\n return data.extentRef(scope, f.field);\n }); // combine extents\n\n return ref(scope.add(MultiExtent({\n extents: extents\n })));\n} // -- SCALE BINS -----\n\n\nfunction parseScaleBins(v, scope) {\n return v.signal || isArray(v) ? parseArray(v, scope) : scope.objectProperty(v);\n} // -- SCALE NICE -----\n\n\nfunction parseScaleNice(nice) {\n return isObject(nice) ? {\n interval: parseLiteral(nice.interval),\n step: parseLiteral(nice.step)\n } : parseLiteral(nice);\n} // -- SCALE INTERPOLATION -----\n\n\nfunction parseScaleInterpolate(interpolate, params) {\n params.interpolate = parseLiteral(interpolate.type || interpolate);\n\n if (interpolate.gamma != null) {\n params.interpolateGamma = parseLiteral(interpolate.gamma);\n }\n} // -- SCALE RANGE -----\n\n\nfunction parseScaleRange(spec, scope, params) {\n const config = scope.config.range;\n let range = spec.range;\n\n if (range.signal) {\n return scope.signalRef(range.signal);\n } else if (isString(range)) {\n if (config && hasOwnProperty(config, range)) {\n spec = extend({}, spec, {\n range: config[range]\n });\n return parseScaleRange(spec, scope, params);\n } else if (range === 'width') {\n range = [0, {\n signal: 'width'\n }];\n } else if (range === 'height') {\n range = isDiscrete(spec.type) ? [0, {\n signal: 'height'\n }] : [{\n signal: 'height'\n }, 0];\n } else {\n error('Unrecognized scale range value: ' + stringValue(range));\n }\n } else if (range.scheme) {\n params.scheme = isArray(range.scheme) ? parseArray(range.scheme, scope) : parseLiteral(range.scheme, scope);\n if (range.extent) params.schemeExtent = parseArray(range.extent, scope);\n if (range.count) params.schemeCount = parseLiteral(range.count, scope);\n return;\n } else if (range.step) {\n params.rangeStep = parseLiteral(range.step, scope);\n return;\n } else if (isDiscrete(spec.type) && !isArray(range)) {\n return parseScaleDomain(range, spec, scope);\n } else if (!isArray(range)) {\n error('Unsupported range type: ' + stringValue(range));\n }\n\n return range.map(v => (isArray(v) ? parseArray : parseLiteral)(v, scope));\n}\n\nfunction parseProjection (proj, scope) {\n const config = scope.config.projection || {},\n params = {};\n\n for (const name in proj) {\n if (name === 'name') continue;\n params[name] = parseParameter$1(proj[name], name, scope);\n } // apply projection defaults from config\n\n\n for (const name in config) {\n if (params[name] == null) {\n params[name] = parseParameter$1(config[name], name, scope);\n }\n }\n\n scope.addProjection(proj.name, params);\n}\n\nfunction parseParameter$1(_, name, scope) {\n return isArray(_) ? _.map(_ => parseParameter$1(_, name, scope)) : !isObject(_) ? _ : _.signal ? scope.signalRef(_.signal) : name === 'fit' ? _ : error('Unsupported parameter object: ' + stringValue(_));\n}\n\nconst Top = 'top';\nconst Left = 'left';\nconst Right = 'right';\nconst Bottom = 'bottom';\nconst Center = 'center';\nconst Vertical = 'vertical';\nconst Start = 'start';\nconst Middle = 'middle';\nconst End = 'end';\nconst Index = 'index';\nconst Label = 'label';\nconst Offset = 'offset';\nconst Perc = 'perc';\nconst Perc2 = 'perc2';\nconst Value = 'value';\nconst GuideLabelStyle = 'guide-label';\nconst GuideTitleStyle = 'guide-title';\nconst GroupTitleStyle = 'group-title';\nconst GroupSubtitleStyle = 'group-subtitle';\nconst Symbols = 'symbol';\nconst Gradient = 'gradient';\nconst Discrete = 'discrete';\nconst Size = 'size';\nconst Shape = 'shape';\nconst Fill = 'fill';\nconst Stroke = 'stroke';\nconst StrokeWidth = 'strokeWidth';\nconst StrokeDash = 'strokeDash';\nconst Opacity = 'opacity'; // Encoding channels supported by legends\n// In priority order of 'canonical' scale\n\nconst LegendScales = [Size, Shape, Fill, Stroke, StrokeWidth, StrokeDash, Opacity];\nconst Skip = {\n name: 1,\n style: 1,\n interactive: 1\n};\nconst zero = {\n value: 0\n};\nconst one = {\n value: 1\n};\n\nconst GroupMark = 'group';\nconst RectMark = 'rect';\nconst RuleMark = 'rule';\nconst SymbolMark = 'symbol';\nconst TextMark = 'text';\n\nfunction guideGroup (mark) {\n mark.type = GroupMark;\n mark.interactive = mark.interactive || false;\n return mark;\n}\n\nfunction lookup(spec, config) {\n const _ = (name, dflt) => value(spec[name], value(config[name], dflt));\n\n _.isVertical = s => Vertical === value(spec.direction, config.direction || (s ? config.symbolDirection : config.gradientDirection));\n\n _.gradientLength = () => value(spec.gradientLength, config.gradientLength || config.gradientWidth);\n\n _.gradientThickness = () => value(spec.gradientThickness, config.gradientThickness || config.gradientHeight);\n\n _.entryColumns = () => value(spec.columns, value(config.columns, +_.isVertical(true)));\n\n return _;\n}\nfunction getEncoding(name, encode) {\n const v = encode && (encode.update && encode.update[name] || encode.enter && encode.enter[name]);\n return v && v.signal ? v : v ? v.value : null;\n}\nfunction getStyle(name, scope, style) {\n const s = scope.config.style[style];\n return s && s[name];\n}\nfunction anchorExpr(s, e, m) {\n return \"item.anchor === '\".concat(Start, \"' ? \").concat(s, \" : item.anchor === '\").concat(End, \"' ? \").concat(e, \" : \").concat(m);\n}\nconst alignExpr$1 = anchorExpr(stringValue(Left), stringValue(Right), stringValue(Center));\nfunction tickBand(_) {\n const v = _('tickBand');\n\n let offset = _('tickOffset'),\n band,\n extra;\n\n if (!v) {\n // if no tick band entry, fall back on other properties\n band = _('bandPosition');\n extra = _('tickExtra');\n } else if (v.signal) {\n // if signal, augment code to interpret values\n band = {\n signal: \"(\".concat(v.signal, \") === 'extent' ? 1 : 0.5\")\n };\n extra = {\n signal: \"(\".concat(v.signal, \") === 'extent'\")\n };\n\n if (!isObject(offset)) {\n offset = {\n signal: \"(\".concat(v.signal, \") === 'extent' ? 0 : \").concat(offset)\n };\n }\n } else if (v === 'extent') {\n // if constant, simply set values\n band = 1;\n extra = true;\n offset = 0;\n } else {\n band = 0.5;\n extra = false;\n }\n\n return {\n extra,\n band,\n offset\n };\n}\nfunction extendOffset(value, offset) {\n return !offset ? value : !value ? offset : !isObject(value) ? {\n value,\n offset\n } : Object.assign({}, value, {\n offset: extendOffset(value.offset, offset)\n });\n}\n\nfunction guideMark (mark, extras) {\n if (extras) {\n mark.name = extras.name;\n mark.style = extras.style || mark.style;\n mark.interactive = !!extras.interactive;\n mark.encode = extendEncode(mark.encode, extras, Skip);\n } else {\n mark.interactive = false;\n }\n\n return mark;\n}\n\nfunction legendGradient (spec, scale, config, userEncode) {\n const _ = lookup(spec, config),\n vertical = _.isVertical(),\n thickness = _.gradientThickness(),\n length = _.gradientLength();\n\n let enter, start, stop, width, height;\n\n if (vertical) {\n start = [0, 1];\n stop = [0, 0];\n width = thickness;\n height = length;\n } else {\n start = [0, 0];\n stop = [1, 0];\n width = length;\n height = thickness;\n }\n\n const encode = {\n enter: enter = {\n opacity: zero,\n x: zero,\n y: zero,\n width: encoder(width),\n height: encoder(height)\n },\n update: extend({}, enter, {\n opacity: one,\n fill: {\n gradient: scale,\n start: start,\n stop: stop\n }\n }),\n exit: {\n opacity: zero\n }\n };\n addEncoders(encode, {\n stroke: _('gradientStrokeColor'),\n strokeWidth: _('gradientStrokeWidth')\n }, {\n // update\n opacity: _('gradientOpacity')\n });\n return guideMark({\n type: RectMark,\n role: LegendGradientRole,\n encode\n }, userEncode);\n}\n\nfunction legendGradientDiscrete (spec, scale, config, userEncode, dataRef) {\n const _ = lookup(spec, config),\n vertical = _.isVertical(),\n thickness = _.gradientThickness(),\n length = _.gradientLength();\n\n let u,\n v,\n uu,\n vv,\n adjust = '';\n vertical ? (u = 'y', uu = 'y2', v = 'x', vv = 'width', adjust = '1-') : (u = 'x', uu = 'x2', v = 'y', vv = 'height');\n const enter = {\n opacity: zero,\n fill: {\n scale: scale,\n field: Value\n }\n };\n enter[u] = {\n signal: adjust + 'datum.' + Perc,\n mult: length\n };\n enter[v] = zero;\n enter[uu] = {\n signal: adjust + 'datum.' + Perc2,\n mult: length\n };\n enter[vv] = encoder(thickness);\n const encode = {\n enter: enter,\n update: extend({}, enter, {\n opacity: one\n }),\n exit: {\n opacity: zero\n }\n };\n addEncoders(encode, {\n stroke: _('gradientStrokeColor'),\n strokeWidth: _('gradientStrokeWidth')\n }, {\n // update\n opacity: _('gradientOpacity')\n });\n return guideMark({\n type: RectMark,\n role: LegendBandRole,\n key: Value,\n from: dataRef,\n encode\n }, userEncode);\n}\n\nconst alignExpr = \"datum.\".concat(Perc, \"<=0?\\\"\").concat(Left, \"\\\":datum.\").concat(Perc, \">=1?\\\"\").concat(Right, \"\\\":\\\"\").concat(Center, \"\\\"\"),\n baselineExpr = \"datum.\".concat(Perc, \"<=0?\\\"\").concat(Bottom, \"\\\":datum.\").concat(Perc, \">=1?\\\"\").concat(Top, \"\\\":\\\"\").concat(Middle, \"\\\"\");\nfunction legendGradientLabels (spec, config, userEncode, dataRef) {\n const _ = lookup(spec, config),\n vertical = _.isVertical(),\n thickness = encoder(_.gradientThickness()),\n length = _.gradientLength();\n\n let overlap = _('labelOverlap'),\n enter,\n update,\n u,\n v,\n adjust = '';\n\n const encode = {\n enter: enter = {\n opacity: zero\n },\n update: update = {\n opacity: one,\n text: {\n field: Label\n }\n },\n exit: {\n opacity: zero\n }\n };\n addEncoders(encode, {\n fill: _('labelColor'),\n fillOpacity: _('labelOpacity'),\n font: _('labelFont'),\n fontSize: _('labelFontSize'),\n fontStyle: _('labelFontStyle'),\n fontWeight: _('labelFontWeight'),\n limit: value(spec.labelLimit, config.gradientLabelLimit)\n });\n\n if (vertical) {\n enter.align = {\n value: 'left'\n };\n enter.baseline = update.baseline = {\n signal: baselineExpr\n };\n u = 'y';\n v = 'x';\n adjust = '1-';\n } else {\n enter.align = update.align = {\n signal: alignExpr\n };\n enter.baseline = {\n value: 'top'\n };\n u = 'x';\n v = 'y';\n }\n\n enter[u] = update[u] = {\n signal: adjust + 'datum.' + Perc,\n mult: length\n };\n enter[v] = update[v] = thickness;\n thickness.offset = value(spec.labelOffset, config.gradientLabelOffset) || 0;\n overlap = overlap ? {\n separation: _('labelSeparation'),\n method: overlap,\n order: 'datum.' + Index\n } : undefined; // type, role, style, key, dataRef, encode, extras\n\n return guideMark({\n type: TextMark,\n role: LegendLabelRole,\n style: GuideLabelStyle,\n key: Value,\n from: dataRef,\n encode,\n overlap\n }, userEncode);\n}\n\nfunction legendSymbolGroups (spec, config, userEncode, dataRef, columns) {\n const _ = lookup(spec, config),\n entries = userEncode.entries,\n interactive = !!(entries && entries.interactive),\n name = entries ? entries.name : undefined,\n height = _('clipHeight'),\n symbolOffset = _('symbolOffset'),\n valueRef = {\n data: 'value'\n },\n xSignal = \"(\".concat(columns, \") ? datum.\").concat(Offset, \" : datum.\").concat(Size),\n yEncode = height ? encoder(height) : {\n field: Size\n },\n index = \"datum.\".concat(Index),\n ncols = \"max(1, \".concat(columns, \")\");\n\n let encode, enter, update, nrows, sort;\n yEncode.mult = 0.5; // -- LEGEND SYMBOLS --\n\n encode = {\n enter: enter = {\n opacity: zero,\n x: {\n signal: xSignal,\n mult: 0.5,\n offset: symbolOffset\n },\n y: yEncode\n },\n update: update = {\n opacity: one,\n x: enter.x,\n y: enter.y\n },\n exit: {\n opacity: zero\n }\n };\n let baseFill = null,\n baseStroke = null;\n\n if (!spec.fill) {\n baseFill = config.symbolBaseFillColor;\n baseStroke = config.symbolBaseStrokeColor;\n }\n\n addEncoders(encode, {\n fill: _('symbolFillColor', baseFill),\n shape: _('symbolType'),\n size: _('symbolSize'),\n stroke: _('symbolStrokeColor', baseStroke),\n strokeDash: _('symbolDash'),\n strokeDashOffset: _('symbolDashOffset'),\n strokeWidth: _('symbolStrokeWidth')\n }, {\n // update\n opacity: _('symbolOpacity')\n });\n LegendScales.forEach(scale => {\n if (spec[scale]) {\n update[scale] = enter[scale] = {\n scale: spec[scale],\n field: Value\n };\n }\n });\n const symbols = guideMark({\n type: SymbolMark,\n role: LegendSymbolRole,\n key: Value,\n from: valueRef,\n clip: height ? true : undefined,\n encode\n }, userEncode.symbols); // -- LEGEND LABELS --\n\n const labelOffset = encoder(symbolOffset);\n labelOffset.offset = _('labelOffset');\n encode = {\n enter: enter = {\n opacity: zero,\n x: {\n signal: xSignal,\n offset: labelOffset\n },\n y: yEncode\n },\n update: update = {\n opacity: one,\n text: {\n field: Label\n },\n x: enter.x,\n y: enter.y\n },\n exit: {\n opacity: zero\n }\n };\n addEncoders(encode, {\n align: _('labelAlign'),\n baseline: _('labelBaseline'),\n fill: _('labelColor'),\n fillOpacity: _('labelOpacity'),\n font: _('labelFont'),\n fontSize: _('labelFontSize'),\n fontStyle: _('labelFontStyle'),\n fontWeight: _('labelFontWeight'),\n limit: _('labelLimit')\n });\n const labels = guideMark({\n type: TextMark,\n role: LegendLabelRole,\n style: GuideLabelStyle,\n key: Value,\n from: valueRef,\n encode\n }, userEncode.labels); // -- LEGEND ENTRY GROUPS --\n\n encode = {\n enter: {\n noBound: {\n value: !height\n },\n // ignore width/height in bounds calc\n width: zero,\n height: height ? encoder(height) : zero,\n opacity: zero\n },\n exit: {\n opacity: zero\n },\n update: update = {\n opacity: one,\n row: {\n signal: null\n },\n column: {\n signal: null\n }\n }\n }; // annotate and sort groups to ensure correct ordering\n\n if (_.isVertical(true)) {\n nrows = \"ceil(item.mark.items.length / \".concat(ncols, \")\");\n update.row.signal = \"\".concat(index, \"%\").concat(nrows);\n update.column.signal = \"floor(\".concat(index, \" / \").concat(nrows, \")\");\n sort = {\n field: ['row', index]\n };\n } else {\n update.row.signal = \"floor(\".concat(index, \" / \").concat(ncols, \")\");\n update.column.signal = \"\".concat(index, \" % \").concat(ncols);\n sort = {\n field: index\n };\n } // handle zero column case (implies infinite columns)\n\n\n update.column.signal = \"(\".concat(columns, \")?\").concat(update.column.signal, \":\").concat(index); // facet legend entries into sub-groups\n\n dataRef = {\n facet: {\n data: dataRef,\n name: 'value',\n groupby: Index\n }\n };\n return guideGroup({\n role: ScopeRole,\n from: dataRef,\n encode: extendEncode(encode, entries, Skip),\n marks: [symbols, labels],\n name,\n interactive,\n sort\n });\n}\nfunction legendSymbolLayout(spec, config) {\n const _ = lookup(spec, config); // layout parameters for legend entries\n\n\n return {\n align: _('gridAlign'),\n columns: _.entryColumns(),\n center: {\n row: true,\n column: false\n },\n padding: {\n row: _('rowPadding'),\n column: _('columnPadding')\n }\n };\n}\n\nconst isL = 'item.orient === \"left\"',\n isR = 'item.orient === \"right\"',\n isLR = \"(\".concat(isL, \" || \").concat(isR, \")\"),\n isVG = \"datum.vgrad && \".concat(isLR),\n baseline = anchorExpr('\"top\"', '\"bottom\"', '\"middle\"'),\n alignFlip = anchorExpr('\"right\"', '\"left\"', '\"center\"'),\n exprAlign = \"datum.vgrad && \".concat(isR, \" ? (\").concat(alignFlip, \") : (\").concat(isLR, \" && !(datum.vgrad && \").concat(isL, \")) ? \\\"left\\\" : \").concat(alignExpr$1),\n exprAnchor = \"item._anchor || (\".concat(isLR, \" ? \\\"middle\\\" : \\\"start\\\")\"),\n exprAngle = \"\".concat(isVG, \" ? (\").concat(isL, \" ? -90 : 90) : 0\"),\n exprBaseline = \"\".concat(isLR, \" ? (datum.vgrad ? (\").concat(isR, \" ? \\\"bottom\\\" : \\\"top\\\") : \").concat(baseline, \") : \\\"top\\\"\");\nfunction legendTitle (spec, config, userEncode, dataRef) {\n const _ = lookup(spec, config);\n\n const encode = {\n enter: {\n opacity: zero\n },\n update: {\n opacity: one,\n x: {\n field: {\n group: 'padding'\n }\n },\n y: {\n field: {\n group: 'padding'\n }\n }\n },\n exit: {\n opacity: zero\n }\n };\n addEncoders(encode, {\n orient: _('titleOrient'),\n _anchor: _('titleAnchor'),\n anchor: {\n signal: exprAnchor\n },\n angle: {\n signal: exprAngle\n },\n align: {\n signal: exprAlign\n },\n baseline: {\n signal: exprBaseline\n },\n text: spec.title,\n fill: _('titleColor'),\n fillOpacity: _('titleOpacity'),\n font: _('titleFont'),\n fontSize: _('titleFontSize'),\n fontStyle: _('titleFontStyle'),\n fontWeight: _('titleFontWeight'),\n limit: _('titleLimit'),\n lineHeight: _('titleLineHeight')\n }, {\n // require update\n align: _('titleAlign'),\n baseline: _('titleBaseline')\n });\n return guideMark({\n type: TextMark,\n role: LegendTitleRole,\n style: GuideTitleStyle,\n from: dataRef,\n encode\n }, userEncode);\n}\n\nfunction clip (clip, scope) {\n let expr;\n\n if (isObject(clip)) {\n if (clip.signal) {\n expr = clip.signal;\n } else if (clip.path) {\n expr = 'pathShape(' + param(clip.path) + ')';\n } else if (clip.sphere) {\n expr = 'geoShape(' + param(clip.sphere) + ', {type: \"Sphere\"})';\n }\n }\n\n return expr ? scope.signalRef(expr) : !!clip;\n}\n\nfunction param(value) {\n return isObject(value) && value.signal ? value.signal : stringValue(value);\n}\n\nfunction getRole (spec) {\n const role = spec.role || '';\n return !role.indexOf('axis') || !role.indexOf('legend') || !role.indexOf('title') ? role : spec.type === GroupMark ? ScopeRole : role || MarkRole;\n}\n\nfunction definition (spec) {\n return {\n marktype: spec.type,\n name: spec.name || undefined,\n role: spec.role || getRole(spec),\n zindex: +spec.zindex || undefined,\n aria: spec.aria,\n description: spec.description\n };\n}\n\nfunction interactive (spec, scope) {\n return spec && spec.signal ? scope.signalRef(spec.signal) : spec === false ? false : true;\n}\n\n/**\n * Parse a data transform specification.\n */\n\nfunction parseTransform (spec, scope) {\n const def = definition$1(spec.type);\n if (!def) error('Unrecognized transform type: ' + stringValue(spec.type));\n const t = entry(def.type.toLowerCase(), null, parseParameters(def, spec, scope));\n if (spec.signal) scope.addSignal(spec.signal, scope.proxy(t));\n t.metadata = def.metadata || {};\n return t;\n}\n/**\n * Parse all parameters of a data transform.\n */\n\nfunction parseParameters(def, spec, scope) {\n const params = {},\n n = def.params.length;\n\n for (let i = 0; i < n; ++i) {\n const pdef = def.params[i];\n params[pdef.name] = parseParameter(pdef, spec, scope);\n }\n\n return params;\n}\n/**\n * Parse a data transform parameter.\n */\n\n\nfunction parseParameter(def, spec, scope) {\n const type = def.type,\n value = spec[def.name];\n\n if (type === 'index') {\n return parseIndexParameter(def, spec, scope);\n } else if (value === undefined) {\n if (def.required) {\n error('Missing required ' + stringValue(spec.type) + ' parameter: ' + stringValue(def.name));\n }\n\n return;\n } else if (type === 'param') {\n return parseSubParameters(def, spec, scope);\n } else if (type === 'projection') {\n return scope.projectionRef(spec[def.name]);\n }\n\n return def.array && !isSignal(value) ? value.map(v => parameterValue(def, v, scope)) : parameterValue(def, value, scope);\n}\n/**\n * Parse a single parameter value.\n */\n\n\nfunction parameterValue(def, value, scope) {\n const type = def.type;\n\n if (isSignal(value)) {\n return isExpr(type) ? error('Expression references can not be signals.') : isField(type) ? scope.fieldRef(value) : isCompare(type) ? scope.compareRef(value) : scope.signalRef(value.signal);\n } else {\n const expr = def.expr || isField(type);\n return expr && outerExpr(value) ? scope.exprRef(value.expr, value.as) : expr && outerField(value) ? fieldRef$1(value.field, value.as) : isExpr(type) ? parseExpression(value, scope) : isData(type) ? ref(scope.getData(value).values) : isField(type) ? fieldRef$1(value) : isCompare(type) ? scope.compareRef(value) : value;\n }\n}\n/**\n * Parse parameter for accessing an index of another data set.\n */\n\n\nfunction parseIndexParameter(def, spec, scope) {\n if (!isString(spec.from)) {\n error('Lookup \"from\" parameter must be a string literal.');\n }\n\n return scope.getData(spec.from).lookupRef(scope, spec.key);\n}\n/**\n * Parse a parameter that contains one or more sub-parameter objects.\n */\n\n\nfunction parseSubParameters(def, spec, scope) {\n const value = spec[def.name];\n\n if (def.array) {\n if (!isArray(value)) {\n // signals not allowed!\n error('Expected an array of sub-parameters. Instead: ' + stringValue(value));\n }\n\n return value.map(v => parseSubParameter(def, v, scope));\n } else {\n return parseSubParameter(def, value, scope);\n }\n}\n/**\n * Parse a sub-parameter object.\n */\n\n\nfunction parseSubParameter(def, value, scope) {\n const n = def.params.length;\n let pdef; // loop over defs to find matching key\n\n for (let i = 0; i < n; ++i) {\n pdef = def.params[i];\n\n for (const k in pdef.key) {\n if (pdef.key[k] !== value[k]) {\n pdef = null;\n break;\n }\n }\n\n if (pdef) break;\n } // raise error if matching key not found\n\n\n if (!pdef) error('Unsupported parameter: ' + stringValue(value)); // parse params, create Params transform, return ref\n\n const params = extend(parseParameters(pdef, value, scope), pdef.key);\n return ref(scope.add(Params(params)));\n} // -- Utilities -----\n\n\nconst outerExpr = _ => _ && _.expr;\nconst outerField = _ => _ && _.field;\nconst isData = _ => _ === 'data';\nconst isExpr = _ => _ === 'expr';\nconst isField = _ => _ === 'field';\nconst isCompare = _ => _ === 'compare';\n\nfunction parseData$1 (from, group, scope) {\n let facet, key, op, dataRef, parent; // if no source data, generate singleton datum\n\n if (!from) {\n dataRef = ref(scope.add(Collect(null, [{}])));\n } // if faceted, process facet specification\n else if (facet = from.facet) {\n if (!group) error('Only group marks can be faceted.'); // use pre-faceted source data, if available\n\n if (facet.field != null) {\n dataRef = parent = getDataRef(facet, scope);\n } else {\n // generate facet aggregates if no direct data specification\n if (!from.data) {\n op = parseTransform(extend({\n type: 'aggregate',\n groupby: array(facet.groupby)\n }, facet.aggregate), scope);\n op.params.key = scope.keyRef(facet.groupby);\n op.params.pulse = getDataRef(facet, scope);\n dataRef = parent = ref(scope.add(op));\n } else {\n parent = ref(scope.getData(from.data).aggregate);\n }\n\n key = scope.keyRef(facet.groupby, true);\n }\n } // if not yet defined, get source data reference\n\n\n if (!dataRef) {\n dataRef = getDataRef(from, scope);\n }\n\n return {\n key: key,\n pulse: dataRef,\n parent: parent\n };\n}\nfunction getDataRef(from, scope) {\n return from.$ref ? from : from.data && from.data.$ref ? from.data : ref(scope.getData(from.data).output);\n}\n\nfunction DataScope(scope, input, output, values, aggr) {\n this.scope = scope; // parent scope object\n\n this.input = input; // first operator in pipeline (tuple input)\n\n this.output = output; // last operator in pipeline (tuple output)\n\n this.values = values; // operator for accessing tuples (but not tuple flow)\n // last aggregate in transform pipeline\n\n this.aggregate = aggr; // lookup table of field indices\n\n this.index = {};\n}\n\nDataScope.fromEntries = function (scope, entries) {\n const n = entries.length,\n values = entries[n - 1],\n output = entries[n - 2];\n let input = entries[0],\n aggr = null,\n i = 1;\n\n if (input && input.type === 'load') {\n input = entries[1];\n } // add operator entries to this scope, wire up pulse chain\n\n\n scope.add(entries[0]);\n\n for (; i < n; ++i) {\n entries[i].params.pulse = ref(entries[i - 1]);\n scope.add(entries[i]);\n if (entries[i].type === 'aggregate') aggr = entries[i];\n }\n\n return new DataScope(scope, input, output, values, aggr);\n};\n\nfunction fieldKey(field) {\n return isString(field) ? field : null;\n}\n\nfunction addSortField(scope, p, sort) {\n const as = aggrField(sort.op, sort.field);\n let s;\n\n if (p.ops) {\n for (let i = 0, n = p.as.length; i < n; ++i) {\n if (p.as[i] === as) return;\n }\n } else {\n p.ops = ['count'];\n p.fields = [null];\n p.as = ['count'];\n }\n\n if (sort.op) {\n p.ops.push((s = sort.op.signal) ? scope.signalRef(s) : sort.op);\n p.fields.push(scope.fieldRef(sort.field));\n p.as.push(as);\n }\n}\n\nfunction cache(scope, ds, name, optype, field, counts, index) {\n const cache = ds[name] || (ds[name] = {}),\n sort = sortKey(counts);\n let k = fieldKey(field),\n v,\n op;\n\n if (k != null) {\n scope = ds.scope;\n k = k + (sort ? '|' + sort : '');\n v = cache[k];\n }\n\n if (!v) {\n const params = counts ? {\n field: keyFieldRef,\n pulse: ds.countsRef(scope, field, counts)\n } : {\n field: scope.fieldRef(field),\n pulse: ref(ds.output)\n };\n if (sort) params.sort = scope.sortRef(counts);\n op = scope.add(entry(optype, undefined, params));\n if (index) ds.index[field] = op;\n v = ref(op);\n if (k != null) cache[k] = v;\n }\n\n return v;\n}\n\nDataScope.prototype = {\n countsRef(scope, field, sort) {\n const ds = this,\n cache = ds.counts || (ds.counts = {}),\n k = fieldKey(field);\n let v, a, p;\n\n if (k != null) {\n scope = ds.scope;\n v = cache[k];\n }\n\n if (!v) {\n p = {\n groupby: scope.fieldRef(field, 'key'),\n pulse: ref(ds.output)\n };\n if (sort && sort.field) addSortField(scope, p, sort);\n a = scope.add(Aggregate(p));\n v = scope.add(Collect({\n pulse: ref(a)\n }));\n v = {\n agg: a,\n ref: ref(v)\n };\n if (k != null) cache[k] = v;\n } else if (sort && sort.field) {\n addSortField(scope, v.agg.params, sort);\n }\n\n return v.ref;\n },\n\n tuplesRef() {\n return ref(this.values);\n },\n\n extentRef(scope, field) {\n return cache(scope, this, 'extent', 'extent', field, false);\n },\n\n domainRef(scope, field) {\n return cache(scope, this, 'domain', 'values', field, false);\n },\n\n valuesRef(scope, field, sort) {\n return cache(scope, this, 'vals', 'values', field, sort || true);\n },\n\n lookupRef(scope, field) {\n return cache(scope, this, 'lookup', 'tupleindex', field, false);\n },\n\n indataRef(scope, field) {\n return cache(scope, this, 'indata', 'tupleindex', field, true, true);\n }\n\n};\n\nfunction parseFacet (spec, scope, group) {\n const facet = spec.from.facet,\n name = facet.name,\n data = getDataRef(facet, scope);\n let op;\n\n if (!facet.name) {\n error('Facet must have a name: ' + stringValue(facet));\n }\n\n if (!facet.data) {\n error('Facet must reference a data set: ' + stringValue(facet));\n }\n\n if (facet.field) {\n op = scope.add(PreFacet({\n field: scope.fieldRef(facet.field),\n pulse: data\n }));\n } else if (facet.groupby) {\n op = scope.add(Facet({\n key: scope.keyRef(facet.groupby),\n group: ref(scope.proxy(group.parent)),\n pulse: data\n }));\n } else {\n error('Facet must specify groupby or field: ' + stringValue(facet));\n } // initialize facet subscope\n\n\n const subscope = scope.fork(),\n source = subscope.add(Collect()),\n values = subscope.add(Sieve({\n pulse: ref(source)\n }));\n subscope.addData(name, new DataScope(subscope, source, source, values));\n subscope.addSignal('parent', null); // parse faceted subflow\n\n op.params.subflow = {\n $subflow: subscope.parse(spec).toRuntime()\n };\n}\n\nfunction parseSubflow (spec, scope, input) {\n const op = scope.add(PreFacet({\n pulse: input.pulse\n })),\n subscope = scope.fork();\n subscope.add(Sieve());\n subscope.addSignal('parent', null); // parse group mark subflow\n\n op.params.subflow = {\n $subflow: subscope.parse(spec).toRuntime()\n };\n}\n\nfunction parseTrigger (spec, scope, name) {\n const remove = spec.remove,\n insert = spec.insert,\n toggle = spec.toggle,\n modify = spec.modify,\n values = spec.values,\n op = scope.add(operator());\n const update = 'if(' + spec.trigger + ',modify(\"' + name + '\",' + [insert, remove, toggle, modify, values].map(_ => _ == null ? 'null' : _).join(',') + '),0)';\n const expr = parseExpression(update, scope);\n op.update = expr.$expr;\n op.params = expr.$params;\n}\n\nfunction parseMark (spec, scope) {\n const role = getRole(spec),\n group = spec.type === GroupMark,\n facet = spec.from && spec.from.facet,\n overlap = spec.overlap;\n let layout = spec.layout || role === ScopeRole || role === FrameRole,\n ops,\n op,\n store,\n enc,\n name,\n layoutRef,\n boundRef;\n const nested = role === MarkRole || layout || facet; // resolve input data\n\n const input = parseData$1(spec.from, group, scope); // data join to map tuples to visual items\n\n op = scope.add(DataJoin({\n key: input.key || (spec.key ? fieldRef$1(spec.key) : undefined),\n pulse: input.pulse,\n clean: !group\n }));\n const joinRef = ref(op); // collect visual items\n\n op = store = scope.add(Collect({\n pulse: joinRef\n })); // connect visual items to scenegraph\n\n op = scope.add(Mark({\n markdef: definition(spec),\n interactive: interactive(spec.interactive, scope),\n clip: clip(spec.clip, scope),\n context: {\n $context: true\n },\n groups: scope.lookup(),\n parent: scope.signals.parent ? scope.signalRef('parent') : null,\n index: scope.markpath(),\n pulse: ref(op)\n }));\n const markRef = ref(op); // add visual encoders\n\n op = enc = scope.add(Encode(parseEncode(spec.encode, spec.type, role, spec.style, scope, {\n mod: false,\n pulse: markRef\n }))); // monitor parent marks to propagate changes\n\n op.params.parent = scope.encode(); // add post-encoding transforms, if defined\n\n if (spec.transform) {\n spec.transform.forEach(_ => {\n const tx = parseTransform(_, scope),\n md = tx.metadata;\n\n if (md.generates || md.changes) {\n error('Mark transforms should not generate new data.');\n }\n\n if (!md.nomod) enc.params.mod = true; // update encode mod handling\n\n tx.params.pulse = ref(op);\n scope.add(op = tx);\n });\n } // if item sort specified, perform post-encoding\n\n\n if (spec.sort) {\n op = scope.add(SortItems({\n sort: scope.compareRef(spec.sort),\n pulse: ref(op)\n }));\n }\n\n const encodeRef = ref(op); // add view layout operator if needed\n\n if (facet || layout) {\n layout = scope.add(ViewLayout({\n layout: scope.objectProperty(spec.layout),\n legends: scope.legends,\n mark: markRef,\n pulse: encodeRef\n }));\n layoutRef = ref(layout);\n } // compute bounding boxes\n\n\n const bound = scope.add(Bound({\n mark: markRef,\n pulse: layoutRef || encodeRef\n }));\n boundRef = ref(bound); // if group mark, recurse to parse nested content\n\n if (group) {\n // juggle layout & bounds to ensure they run *after* any faceting transforms\n if (nested) {\n ops = scope.operators;\n ops.pop();\n if (layout) ops.pop();\n }\n\n scope.pushState(encodeRef, layoutRef || boundRef, joinRef);\n facet ? parseFacet(spec, scope, input) // explicit facet\n : nested ? parseSubflow(spec, scope, input) // standard mark group\n : scope.parse(spec); // guide group, we can avoid nested scopes\n\n scope.popState();\n\n if (nested) {\n if (layout) ops.push(layout);\n ops.push(bound);\n }\n } // if requested, add overlap removal transform\n\n\n if (overlap) {\n boundRef = parseOverlap(overlap, boundRef, scope);\n } // render / sieve items\n\n\n const render = scope.add(Render({\n pulse: boundRef\n })),\n sieve = scope.add(Sieve({\n pulse: ref(render)\n }, undefined, scope.parent())); // if mark is named, make accessible as reactive geometry\n // add trigger updates if defined\n\n if (spec.name != null) {\n name = spec.name;\n scope.addData(name, new DataScope(scope, store, render, sieve));\n if (spec.on) spec.on.forEach(on => {\n if (on.insert || on.remove || on.toggle) {\n error('Marks only support modify triggers.');\n }\n\n parseTrigger(on, scope, name);\n });\n }\n}\n\nfunction parseOverlap(overlap, source, scope) {\n const method = overlap.method,\n bound = overlap.bound,\n sep = overlap.separation;\n const params = {\n separation: isSignal(sep) ? scope.signalRef(sep.signal) : sep,\n method: isSignal(method) ? scope.signalRef(method.signal) : method,\n pulse: source\n };\n\n if (overlap.order) {\n params.sort = scope.compareRef({\n field: overlap.order\n });\n }\n\n if (bound) {\n const tol = bound.tolerance;\n params.boundTolerance = isSignal(tol) ? scope.signalRef(tol.signal) : +tol;\n params.boundScale = scope.scaleRef(bound.scale);\n params.boundOrient = bound.orient;\n }\n\n return ref(scope.add(Overlap(params)));\n}\n\nfunction parseLegend (spec, scope) {\n const config = scope.config.legend,\n encode = spec.encode || {},\n _ = lookup(spec, config),\n legendEncode = encode.legend || {},\n name = legendEncode.name || undefined,\n interactive = legendEncode.interactive,\n style = legendEncode.style,\n scales = {};\n\n let scale = 0,\n entryLayout,\n params,\n children; // resolve scales and 'canonical' scale name\n\n LegendScales.forEach(s => spec[s] ? (scales[s] = spec[s], scale = scale || spec[s]) : 0);\n if (!scale) error('Missing valid scale for legend.'); // resolve legend type (symbol, gradient, or discrete gradient)\n\n const type = legendType(spec, scope.scaleType(scale)); // single-element data source for legend group\n\n const datum = {\n title: spec.title != null,\n scales: scales,\n type: type,\n vgrad: type !== 'symbol' && _.isVertical()\n };\n const dataRef = ref(scope.add(Collect(null, [datum]))); // encoding properties for legend entry sub-group\n\n const entryEncode = {\n enter: {\n x: {\n value: 0\n },\n y: {\n value: 0\n }\n }\n }; // data source for legend values\n\n const entryRef = ref(scope.add(LegendEntries(params = {\n type: type,\n scale: scope.scaleRef(scale),\n count: scope.objectProperty(_('tickCount')),\n limit: scope.property(_('symbolLimit')),\n values: scope.objectProperty(spec.values),\n minstep: scope.property(spec.tickMinStep),\n formatType: scope.property(spec.formatType),\n formatSpecifier: scope.property(spec.format)\n }))); // continuous gradient legend\n\n if (type === Gradient) {\n children = [legendGradient(spec, scale, config, encode.gradient), legendGradientLabels(spec, config, encode.labels, entryRef)]; // adjust default tick count based on the gradient length\n\n params.count = params.count || scope.signalRef(\"max(2,2*floor((\".concat(deref(_.gradientLength()), \")/100))\"));\n } // discrete gradient legend\n else if (type === Discrete) {\n children = [legendGradientDiscrete(spec, scale, config, encode.gradient, entryRef), legendGradientLabels(spec, config, encode.labels, entryRef)];\n } // symbol legend\n else {\n // determine legend symbol group layout\n entryLayout = legendSymbolLayout(spec, config);\n children = [legendSymbolGroups(spec, config, encode, entryRef, deref(entryLayout.columns))]; // pass symbol size information to legend entry generator\n\n params.size = sizeExpression(spec, scope, children[0].marks);\n } // generate legend marks\n\n\n children = [guideGroup({\n role: LegendEntryRole,\n from: dataRef,\n encode: entryEncode,\n marks: children,\n layout: entryLayout,\n interactive\n })]; // include legend title if defined\n\n if (datum.title) {\n children.push(legendTitle(spec, config, encode.title, dataRef));\n } // parse legend specification\n\n\n return parseMark(guideGroup({\n role: LegendRole,\n from: dataRef,\n encode: extendEncode(buildLegendEncode(_, spec, config), legendEncode, Skip),\n marks: children,\n aria: _('aria'),\n description: _('description'),\n zindex: _('zindex'),\n name,\n interactive,\n style\n }), scope);\n}\n\nfunction legendType(spec, scaleType) {\n let type = spec.type || Symbols;\n\n if (!spec.type && scaleCount(spec) === 1 && (spec.fill || spec.stroke)) {\n type = isContinuous(scaleType) ? Gradient : isDiscretizing(scaleType) ? Discrete : Symbols;\n }\n\n return type !== Gradient ? type : isDiscretizing(scaleType) ? Discrete : Gradient;\n}\n\nfunction scaleCount(spec) {\n return LegendScales.reduce((count, type) => count + (spec[type] ? 1 : 0), 0);\n}\n\nfunction buildLegendEncode(_, spec, config) {\n const encode = {\n enter: {},\n update: {}\n };\n addEncoders(encode, {\n orient: _('orient'),\n offset: _('offset'),\n padding: _('padding'),\n titlePadding: _('titlePadding'),\n cornerRadius: _('cornerRadius'),\n fill: _('fillColor'),\n stroke: _('strokeColor'),\n strokeWidth: config.strokeWidth,\n strokeDash: config.strokeDash,\n x: _('legendX'),\n y: _('legendY'),\n // accessibility support\n format: spec.format,\n formatType: spec.formatType\n });\n return encode;\n}\n\nfunction sizeExpression(spec, scope, marks) {\n const size = deref(getChannel('size', spec, marks)),\n strokeWidth = deref(getChannel('strokeWidth', spec, marks)),\n fontSize = deref(getFontSize(marks[1].encode, scope, GuideLabelStyle));\n return parseExpression(\"max(ceil(sqrt(\".concat(size, \")+\").concat(strokeWidth, \"),\").concat(fontSize, \")\"), scope);\n}\n\nfunction getChannel(name, spec, marks) {\n return spec[name] ? \"scale(\\\"\".concat(spec[name], \"\\\",datum)\") : getEncoding(name, marks[0].encode);\n}\n\nfunction getFontSize(encode, scope, style) {\n return getEncoding('fontSize', encode) || getStyle('fontSize', scope, style);\n}\n\nconst angleExpr = \"item.orient===\\\"\".concat(Left, \"\\\"?-90:item.orient===\\\"\").concat(Right, \"\\\"?90:0\");\nfunction parseTitle (spec, scope) {\n spec = isString(spec) ? {\n text: spec\n } : spec;\n\n const _ = lookup(spec, scope.config.title),\n encode = spec.encode || {},\n userEncode = encode.group || {},\n name = userEncode.name || undefined,\n interactive = userEncode.interactive,\n style = userEncode.style,\n children = []; // single-element data source for group title\n\n\n const datum = {},\n dataRef = ref(scope.add(Collect(null, [datum]))); // include title text\n\n children.push(buildTitle(spec, _, titleEncode(spec), dataRef)); // include subtitle text\n\n if (spec.subtitle) {\n children.push(buildSubTitle(spec, _, encode.subtitle, dataRef));\n } // parse title specification\n\n\n return parseMark(guideGroup({\n role: TitleRole,\n from: dataRef,\n encode: groupEncode(_, userEncode),\n marks: children,\n aria: _('aria'),\n description: _('description'),\n zindex: _('zindex'),\n name,\n interactive,\n style\n }), scope);\n} // provide backwards-compatibility for title custom encode;\n// the top-level encode block has been *deprecated*.\n\nfunction titleEncode(spec) {\n const encode = spec.encode;\n return encode && encode.title || extend({\n name: spec.name,\n interactive: spec.interactive,\n style: spec.style\n }, encode);\n}\n\nfunction groupEncode(_, userEncode) {\n const encode = {\n enter: {},\n update: {}\n };\n addEncoders(encode, {\n orient: _('orient'),\n anchor: _('anchor'),\n align: {\n signal: alignExpr$1\n },\n angle: {\n signal: angleExpr\n },\n limit: _('limit'),\n frame: _('frame'),\n offset: _('offset') || 0,\n padding: _('subtitlePadding')\n });\n return extendEncode(encode, userEncode, Skip);\n}\n\nfunction buildTitle(spec, _, userEncode, dataRef) {\n const zero = {\n value: 0\n },\n text = spec.text,\n encode = {\n enter: {\n opacity: zero\n },\n update: {\n opacity: {\n value: 1\n }\n },\n exit: {\n opacity: zero\n }\n };\n addEncoders(encode, {\n text: text,\n align: {\n signal: 'item.mark.group.align'\n },\n angle: {\n signal: 'item.mark.group.angle'\n },\n limit: {\n signal: 'item.mark.group.limit'\n },\n baseline: 'top',\n dx: _('dx'),\n dy: _('dy'),\n fill: _('color'),\n font: _('font'),\n fontSize: _('fontSize'),\n fontStyle: _('fontStyle'),\n fontWeight: _('fontWeight'),\n lineHeight: _('lineHeight')\n }, {\n // update\n align: _('align'),\n angle: _('angle'),\n baseline: _('baseline')\n });\n return guideMark({\n type: TextMark,\n role: TitleTextRole,\n style: GroupTitleStyle,\n from: dataRef,\n encode\n }, userEncode);\n}\n\nfunction buildSubTitle(spec, _, userEncode, dataRef) {\n const zero = {\n value: 0\n },\n text = spec.subtitle,\n encode = {\n enter: {\n opacity: zero\n },\n update: {\n opacity: {\n value: 1\n }\n },\n exit: {\n opacity: zero\n }\n };\n addEncoders(encode, {\n text: text,\n align: {\n signal: 'item.mark.group.align'\n },\n angle: {\n signal: 'item.mark.group.angle'\n },\n limit: {\n signal: 'item.mark.group.limit'\n },\n baseline: 'top',\n dx: _('dx'),\n dy: _('dy'),\n fill: _('subtitleColor'),\n font: _('subtitleFont'),\n fontSize: _('subtitleFontSize'),\n fontStyle: _('subtitleFontStyle'),\n fontWeight: _('subtitleFontWeight'),\n lineHeight: _('subtitleLineHeight')\n }, {\n // update\n align: _('align'),\n angle: _('angle'),\n baseline: _('baseline')\n });\n return guideMark({\n type: TextMark,\n role: TitleSubtitleRole,\n style: GroupSubtitleStyle,\n from: dataRef,\n encode\n }, userEncode);\n}\n\nfunction parseData(data, scope) {\n const transforms = [];\n\n if (data.transform) {\n data.transform.forEach(tx => {\n transforms.push(parseTransform(tx, scope));\n });\n }\n\n if (data.on) {\n data.on.forEach(on => {\n parseTrigger(on, scope, data.name);\n });\n }\n\n scope.addDataPipeline(data.name, analyze(data, scope, transforms));\n}\n/**\n * Analyze a data pipeline, add needed operators.\n */\n\nfunction analyze(data, scope, ops) {\n const output = [];\n let source = null,\n modify = false,\n generate = false,\n upstream,\n i,\n n,\n t,\n m;\n\n if (data.values) {\n // hard-wired input data set\n if (isSignal(data.values) || hasSignal(data.format)) {\n // if either values is signal or format has signal, use dynamic loader\n output.push(load(scope, data));\n output.push(source = collect());\n } else {\n // otherwise, ingest upon dataflow init\n output.push(source = collect({\n $ingest: data.values,\n $format: data.format\n }));\n }\n } else if (data.url) {\n // load data from external source\n if (hasSignal(data.url) || hasSignal(data.format)) {\n // if either url or format has signal, use dynamic loader\n output.push(load(scope, data));\n output.push(source = collect());\n } else {\n // otherwise, request load upon dataflow init\n output.push(source = collect({\n $request: data.url,\n $format: data.format\n }));\n }\n } else if (data.source) {\n // derives from one or more other data sets\n source = upstream = array(data.source).map(d => ref(scope.getData(d).output));\n output.push(null); // populate later\n } // scan data transforms, add collectors as needed\n\n\n for (i = 0, n = ops.length; i < n; ++i) {\n t = ops[i];\n m = t.metadata;\n\n if (!source && !m.source) {\n output.push(source = collect());\n }\n\n output.push(t);\n if (m.generates) generate = true;\n if (m.modifies && !generate) modify = true;\n if (m.source) source = t;else if (m.changes) source = null;\n }\n\n if (upstream) {\n n = upstream.length - 1;\n output[0] = Relay({\n derive: modify,\n pulse: n ? upstream : upstream[0]\n });\n\n if (modify || n) {\n // collect derived and multi-pulse tuples\n output.splice(1, 0, collect());\n }\n }\n\n if (!source) output.push(collect());\n output.push(Sieve({}));\n return output;\n}\n\nfunction collect(values) {\n const s = Collect({}, values);\n s.metadata = {\n source: true\n };\n return s;\n}\n\nfunction load(scope, data) {\n return Load({\n url: data.url ? scope.property(data.url) : undefined,\n async: data.async ? scope.property(data.async) : undefined,\n values: data.values ? scope.property(data.values) : undefined,\n format: scope.objectProperty(data.format)\n });\n}\n\nconst isX = orient => orient === Bottom || orient === Top; // get sign coefficient based on axis orient\n\n\nconst getSign = (orient, a, b) => isSignal(orient) ? ifLeftTopExpr(orient.signal, a, b) : orient === Left || orient === Top ? a : b; // condition on axis x-direction\n\nconst ifX = (orient, a, b) => isSignal(orient) ? ifXEnc(orient.signal, a, b) : isX(orient) ? a : b; // condition on axis y-direction\n\nconst ifY = (orient, a, b) => isSignal(orient) ? ifYEnc(orient.signal, a, b) : isX(orient) ? b : a;\nconst ifTop = (orient, a, b) => isSignal(orient) ? ifTopExpr(orient.signal, a, b) : orient === Top ? {\n value: a\n} : {\n value: b\n};\nconst ifRight = (orient, a, b) => isSignal(orient) ? ifRightExpr(orient.signal, a, b) : orient === Right ? {\n value: a\n} : {\n value: b\n};\n\nconst ifXEnc = ($orient, a, b) => ifEnc(\"\".concat($orient, \" === '\").concat(Top, \"' || \").concat($orient, \" === '\").concat(Bottom, \"'\"), a, b);\n\nconst ifYEnc = ($orient, a, b) => ifEnc(\"\".concat($orient, \" !== '\").concat(Top, \"' && \").concat($orient, \" !== '\").concat(Bottom, \"'\"), a, b);\n\nconst ifLeftTopExpr = ($orient, a, b) => ifExpr(\"\".concat($orient, \" === '\").concat(Left, \"' || \").concat($orient, \" === '\").concat(Top, \"'\"), a, b);\n\nconst ifTopExpr = ($orient, a, b) => ifExpr(\"\".concat($orient, \" === '\").concat(Top, \"'\"), a, b);\n\nconst ifRightExpr = ($orient, a, b) => ifExpr(\"\".concat($orient, \" === '\").concat(Right, \"'\"), a, b);\n\nconst ifEnc = (test, a, b) => {\n // ensure inputs are encoder objects (or null)\n a = a != null ? encoder(a) : a;\n b = b != null ? encoder(b) : b;\n\n if (isSimple(a) && isSimple(b)) {\n // if possible generate simple signal expression\n a = a ? a.signal || stringValue(a.value) : null;\n b = b ? b.signal || stringValue(b.value) : null;\n return {\n signal: \"\".concat(test, \" ? (\").concat(a, \") : (\").concat(b, \")\")\n };\n } else {\n // otherwise generate rule set\n return [extend({\n test\n }, a)].concat(b || []);\n }\n};\n\nconst isSimple = enc => enc == null || Object.keys(enc).length === 1;\n\nconst ifExpr = (test, a, b) => ({\n signal: \"\".concat(test, \" ? (\").concat(toExpr(a), \") : (\").concat(toExpr(b), \")\")\n});\n\nconst ifOrient = ($orient, t, b, l, r) => ({\n signal: (l != null ? \"\".concat($orient, \" === '\").concat(Left, \"' ? (\").concat(toExpr(l), \") : \") : '') + (b != null ? \"\".concat($orient, \" === '\").concat(Bottom, \"' ? (\").concat(toExpr(b), \") : \") : '') + (r != null ? \"\".concat($orient, \" === '\").concat(Right, \"' ? (\").concat(toExpr(r), \") : \") : '') + (t != null ? \"\".concat($orient, \" === '\").concat(Top, \"' ? (\").concat(toExpr(t), \") : \") : '') + '(null)'\n});\n\nconst toExpr = v => isSignal(v) ? v.signal : v == null ? null : stringValue(v);\n\nconst mult = (sign, value) => value === 0 ? 0 : isSignal(sign) ? {\n signal: \"(\".concat(sign.signal, \") * \").concat(value)\n} : {\n value: sign * value\n};\nconst patch = (value, base) => {\n const s = value.signal;\n return s && s.endsWith('(null)') ? {\n signal: s.slice(0, -6) + base.signal\n } : value;\n};\n\nfunction fallback(prop, config, axisConfig, style) {\n let styleProp;\n\n if (config && hasOwnProperty(config, prop)) {\n return config[prop];\n } else if (hasOwnProperty(axisConfig, prop)) {\n return axisConfig[prop];\n } else if (prop.startsWith('title')) {\n switch (prop) {\n case 'titleColor':\n styleProp = 'fill';\n break;\n\n case 'titleFont':\n case 'titleFontSize':\n case 'titleFontWeight':\n styleProp = prop[5].toLowerCase() + prop.slice(6);\n }\n\n return style[GuideTitleStyle][styleProp];\n } else if (prop.startsWith('label')) {\n switch (prop) {\n case 'labelColor':\n styleProp = 'fill';\n break;\n\n case 'labelFont':\n case 'labelFontSize':\n styleProp = prop[5].toLowerCase() + prop.slice(6);\n }\n\n return style[GuideLabelStyle][styleProp];\n }\n\n return null;\n}\n\nfunction keys(objects) {\n const map = {};\n\n for (const obj of objects) {\n if (!obj) continue;\n\n for (const key in obj) map[key] = 1;\n }\n\n return Object.keys(map);\n}\n\nfunction axisConfig (spec, scope) {\n var config = scope.config,\n style = config.style,\n axis = config.axis,\n band = scope.scaleType(spec.scale) === 'band' && config.axisBand,\n orient = spec.orient,\n xy,\n or,\n key;\n\n if (isSignal(orient)) {\n const xyKeys = keys([config.axisX, config.axisY]),\n orientKeys = keys([config.axisTop, config.axisBottom, config.axisLeft, config.axisRight]);\n xy = {};\n\n for (key of xyKeys) {\n xy[key] = ifX(orient, fallback(key, config.axisX, axis, style), fallback(key, config.axisY, axis, style));\n }\n\n or = {};\n\n for (key of orientKeys) {\n or[key] = ifOrient(orient.signal, fallback(key, config.axisTop, axis, style), fallback(key, config.axisBottom, axis, style), fallback(key, config.axisLeft, axis, style), fallback(key, config.axisRight, axis, style));\n }\n } else {\n xy = orient === Top || orient === Bottom ? config.axisX : config.axisY;\n or = config['axis' + orient[0].toUpperCase() + orient.slice(1)];\n }\n\n const result = xy || or || band ? extend({}, axis, xy, or, band) : axis;\n return result;\n}\n\nfunction axisDomain (spec, config, userEncode, dataRef) {\n const _ = lookup(spec, config),\n orient = spec.orient;\n\n let enter, update;\n const encode = {\n enter: enter = {\n opacity: zero\n },\n update: update = {\n opacity: one\n },\n exit: {\n opacity: zero\n }\n };\n addEncoders(encode, {\n stroke: _('domainColor'),\n strokeCap: _('domainCap'),\n strokeDash: _('domainDash'),\n strokeDashOffset: _('domainDashOffset'),\n strokeWidth: _('domainWidth'),\n strokeOpacity: _('domainOpacity')\n });\n const pos0 = position(spec, 0);\n const pos1 = position(spec, 1);\n enter.x = update.x = ifX(orient, pos0, zero);\n enter.x2 = update.x2 = ifX(orient, pos1);\n enter.y = update.y = ifY(orient, pos0, zero);\n enter.y2 = update.y2 = ifY(orient, pos1);\n return guideMark({\n type: RuleMark,\n role: AxisDomainRole,\n from: dataRef,\n encode\n }, userEncode);\n}\n\nfunction position(spec, pos) {\n return {\n scale: spec.scale,\n range: pos\n };\n}\n\nfunction axisGrid (spec, config, userEncode, dataRef, band) {\n const _ = lookup(spec, config),\n orient = spec.orient,\n vscale = spec.gridScale,\n sign = getSign(orient, 1, -1),\n offset = offsetValue(spec.offset, sign);\n\n let enter, exit, update;\n const encode = {\n enter: enter = {\n opacity: zero\n },\n update: update = {\n opacity: one\n },\n exit: exit = {\n opacity: zero\n }\n };\n addEncoders(encode, {\n stroke: _('gridColor'),\n strokeCap: _('gridCap'),\n strokeDash: _('gridDash'),\n strokeDashOffset: _('gridDashOffset'),\n strokeOpacity: _('gridOpacity'),\n strokeWidth: _('gridWidth')\n });\n const tickPos = {\n scale: spec.scale,\n field: Value,\n band: band.band,\n extra: band.extra,\n offset: band.offset,\n round: _('tickRound')\n };\n const sz = ifX(orient, {\n signal: 'height'\n }, {\n signal: 'width'\n });\n const gridStart = vscale ? {\n scale: vscale,\n range: 0,\n mult: sign,\n offset: offset\n } : {\n value: 0,\n offset: offset\n };\n const gridEnd = vscale ? {\n scale: vscale,\n range: 1,\n mult: sign,\n offset: offset\n } : extend(sz, {\n mult: sign,\n offset: offset\n });\n enter.x = update.x = ifX(orient, tickPos, gridStart);\n enter.y = update.y = ifY(orient, tickPos, gridStart);\n enter.x2 = update.x2 = ifY(orient, gridEnd);\n enter.y2 = update.y2 = ifX(orient, gridEnd);\n exit.x = ifX(orient, tickPos);\n exit.y = ifY(orient, tickPos);\n return guideMark({\n type: RuleMark,\n role: AxisGridRole,\n key: Value,\n from: dataRef,\n encode\n }, userEncode);\n}\n\nfunction offsetValue(offset, sign) {\n if (sign === 1) ; else if (!isObject(offset)) {\n offset = isSignal(sign) ? {\n signal: \"(\".concat(sign.signal, \") * (\").concat(offset || 0, \")\")\n } : sign * (offset || 0);\n } else {\n let entry = offset = extend({}, offset);\n\n while (entry.mult != null) {\n if (!isObject(entry.mult)) {\n entry.mult = isSignal(sign) // no offset if sign === 1\n ? {\n signal: \"(\".concat(entry.mult, \") * (\").concat(sign.signal, \")\")\n } : entry.mult * sign;\n return offset;\n } else {\n entry = entry.mult = extend({}, entry.mult);\n }\n }\n\n entry.mult = sign;\n }\n\n return offset;\n}\n\nfunction axisTicks (spec, config, userEncode, dataRef, size, band) {\n const _ = lookup(spec, config),\n orient = spec.orient,\n sign = getSign(orient, -1, 1);\n\n let enter, exit, update;\n const encode = {\n enter: enter = {\n opacity: zero\n },\n update: update = {\n opacity: one\n },\n exit: exit = {\n opacity: zero\n }\n };\n addEncoders(encode, {\n stroke: _('tickColor'),\n strokeCap: _('tickCap'),\n strokeDash: _('tickDash'),\n strokeDashOffset: _('tickDashOffset'),\n strokeOpacity: _('tickOpacity'),\n strokeWidth: _('tickWidth')\n });\n const tickSize = encoder(size);\n tickSize.mult = sign;\n const tickPos = {\n scale: spec.scale,\n field: Value,\n band: band.band,\n extra: band.extra,\n offset: band.offset,\n round: _('tickRound')\n };\n update.y = enter.y = ifX(orient, zero, tickPos);\n update.y2 = enter.y2 = ifX(orient, tickSize);\n exit.x = ifX(orient, tickPos);\n update.x = enter.x = ifY(orient, zero, tickPos);\n update.x2 = enter.x2 = ifY(orient, tickSize);\n exit.y = ifY(orient, tickPos);\n return guideMark({\n type: RuleMark,\n role: AxisTickRole,\n key: Value,\n from: dataRef,\n encode\n }, userEncode);\n}\n\nfunction flushExpr(scale, threshold, a, b, c) {\n return {\n signal: 'flush(range(\"' + scale + '\"), ' + 'scale(\"' + scale + '\", datum.value), ' + threshold + ',' + a + ',' + b + ',' + c + ')'\n };\n}\n\nfunction axisLabels (spec, config, userEncode, dataRef, size, band) {\n const _ = lookup(spec, config),\n orient = spec.orient,\n scale = spec.scale,\n sign = getSign(orient, -1, 1),\n flush = deref(_('labelFlush')),\n flushOffset = deref(_('labelFlushOffset')),\n labelAlign = _('labelAlign'),\n labelBaseline = _('labelBaseline');\n\n let flushOn = flush === 0 || !!flush,\n update;\n const tickSize = encoder(size);\n tickSize.mult = sign;\n tickSize.offset = encoder(_('labelPadding') || 0);\n tickSize.offset.mult = sign;\n const tickPos = {\n scale: scale,\n field: Value,\n band: 0.5,\n offset: extendOffset(band.offset, _('labelOffset'))\n };\n const align = ifX(orient, flushOn ? flushExpr(scale, flush, '\"left\"', '\"right\"', '\"center\"') : {\n value: 'center'\n }, ifRight(orient, 'left', 'right'));\n const baseline = ifX(orient, ifTop(orient, 'bottom', 'top'), flushOn ? flushExpr(scale, flush, '\"top\"', '\"bottom\"', '\"middle\"') : {\n value: 'middle'\n });\n const offsetExpr = flushExpr(scale, flush, \"-(\".concat(flushOffset, \")\"), flushOffset, 0);\n flushOn = flushOn && flushOffset;\n const enter = {\n opacity: zero,\n x: ifX(orient, tickPos, tickSize),\n y: ifY(orient, tickPos, tickSize)\n };\n const encode = {\n enter: enter,\n update: update = {\n opacity: one,\n text: {\n field: Label\n },\n x: enter.x,\n y: enter.y,\n align,\n baseline\n },\n exit: {\n opacity: zero,\n x: enter.x,\n y: enter.y\n }\n };\n addEncoders(encode, {\n dx: !labelAlign && flushOn ? ifX(orient, offsetExpr) : null,\n dy: !labelBaseline && flushOn ? ifY(orient, offsetExpr) : null\n });\n addEncoders(encode, {\n angle: _('labelAngle'),\n fill: _('labelColor'),\n fillOpacity: _('labelOpacity'),\n font: _('labelFont'),\n fontSize: _('labelFontSize'),\n fontWeight: _('labelFontWeight'),\n fontStyle: _('labelFontStyle'),\n limit: _('labelLimit'),\n lineHeight: _('labelLineHeight')\n }, {\n align: labelAlign,\n baseline: labelBaseline\n });\n\n const bound = _('labelBound');\n\n let overlap = _('labelOverlap'); // if overlap method or bound defined, request label overlap removal\n\n\n overlap = overlap || bound ? {\n separation: _('labelSeparation'),\n method: overlap,\n order: 'datum.index',\n bound: bound ? {\n scale,\n orient,\n tolerance: bound\n } : null\n } : undefined;\n\n if (update.align !== align) {\n update.align = patch(update.align, align);\n }\n\n if (update.baseline !== baseline) {\n update.baseline = patch(update.baseline, baseline);\n }\n\n return guideMark({\n type: TextMark,\n role: AxisLabelRole,\n style: GuideLabelStyle,\n key: Value,\n from: dataRef,\n encode,\n overlap\n }, userEncode);\n}\n\nfunction axisTitle (spec, config, userEncode, dataRef) {\n const _ = lookup(spec, config),\n orient = spec.orient,\n sign = getSign(orient, -1, 1);\n\n let enter, update;\n const encode = {\n enter: enter = {\n opacity: zero,\n anchor: encoder(_('titleAnchor', null)),\n align: {\n signal: alignExpr$1\n }\n },\n update: update = extend({}, enter, {\n opacity: one,\n text: encoder(spec.title)\n }),\n exit: {\n opacity: zero\n }\n };\n const titlePos = {\n signal: \"lerp(range(\\\"\".concat(spec.scale, \"\\\"), \").concat(anchorExpr(0, 1, 0.5), \")\")\n };\n update.x = ifX(orient, titlePos);\n update.y = ifY(orient, titlePos);\n enter.angle = ifX(orient, zero, mult(sign, 90));\n enter.baseline = ifX(orient, ifTop(orient, Bottom, Top), {\n value: Bottom\n });\n update.angle = enter.angle;\n update.baseline = enter.baseline;\n addEncoders(encode, {\n fill: _('titleColor'),\n fillOpacity: _('titleOpacity'),\n font: _('titleFont'),\n fontSize: _('titleFontSize'),\n fontStyle: _('titleFontStyle'),\n fontWeight: _('titleFontWeight'),\n limit: _('titleLimit'),\n lineHeight: _('titleLineHeight')\n }, {\n // require update\n align: _('titleAlign'),\n angle: _('titleAngle'),\n baseline: _('titleBaseline')\n });\n autoLayout(_, orient, encode, userEncode);\n encode.update.align = patch(encode.update.align, enter.align);\n encode.update.angle = patch(encode.update.angle, enter.angle);\n encode.update.baseline = patch(encode.update.baseline, enter.baseline);\n return guideMark({\n type: TextMark,\n role: AxisTitleRole,\n style: GuideTitleStyle,\n from: dataRef,\n encode\n }, userEncode);\n}\n\nfunction autoLayout(_, orient, encode, userEncode) {\n const auto = (value, dim) => value != null ? (encode.update[dim] = patch(encoder(value), encode.update[dim]), false) : !has(dim, userEncode) ? true : false;\n\n const autoY = auto(_('titleX'), 'x'),\n autoX = auto(_('titleY'), 'y');\n encode.enter.auto = autoX === autoY ? encoder(autoX) : ifX(orient, encoder(autoX), encoder(autoY));\n}\n\nfunction parseAxis (spec, scope) {\n const config = axisConfig(spec, scope),\n encode = spec.encode || {},\n axisEncode = encode.axis || {},\n name = axisEncode.name || undefined,\n interactive = axisEncode.interactive,\n style = axisEncode.style,\n _ = lookup(spec, config),\n band = tickBand(_); // single-element data source for axis group\n\n\n const datum = {\n scale: spec.scale,\n ticks: !!_('ticks'),\n labels: !!_('labels'),\n grid: !!_('grid'),\n domain: !!_('domain'),\n title: spec.title != null\n };\n const dataRef = ref(scope.add(Collect({}, [datum]))); // data source for axis ticks\n\n const ticksRef = ref(scope.add(AxisTicks({\n scale: scope.scaleRef(spec.scale),\n extra: scope.property(band.extra),\n count: scope.objectProperty(spec.tickCount),\n values: scope.objectProperty(spec.values),\n minstep: scope.property(spec.tickMinStep),\n formatType: scope.property(spec.formatType),\n formatSpecifier: scope.property(spec.format)\n }))); // generate axis marks\n\n const children = [];\n let size; // include axis gridlines if requested\n\n if (datum.grid) {\n children.push(axisGrid(spec, config, encode.grid, ticksRef, band));\n } // include axis ticks if requested\n\n\n if (datum.ticks) {\n size = _('tickSize');\n children.push(axisTicks(spec, config, encode.ticks, ticksRef, size, band));\n } // include axis labels if requested\n\n\n if (datum.labels) {\n size = datum.ticks ? size : 0;\n children.push(axisLabels(spec, config, encode.labels, ticksRef, size, band));\n } // include axis domain path if requested\n\n\n if (datum.domain) {\n children.push(axisDomain(spec, config, encode.domain, dataRef));\n } // include axis title if defined\n\n\n if (datum.title) {\n children.push(axisTitle(spec, config, encode.title, dataRef));\n } // parse axis specification\n\n\n return parseMark(guideGroup({\n role: AxisRole,\n from: dataRef,\n encode: extendEncode(buildAxisEncode(_, spec), axisEncode, Skip),\n marks: children,\n aria: _('aria'),\n description: _('description'),\n zindex: _('zindex'),\n name,\n interactive,\n style\n }), scope);\n}\n\nfunction buildAxisEncode(_, spec) {\n const encode = {\n enter: {},\n update: {}\n };\n addEncoders(encode, {\n orient: _('orient'),\n offset: _('offset') || 0,\n position: value(spec.position, 0),\n titlePadding: _('titlePadding'),\n minExtent: _('minExtent'),\n maxExtent: _('maxExtent'),\n range: {\n signal: \"abs(span(range(\\\"\".concat(spec.scale, \"\\\")))\")\n },\n translate: _('translate'),\n // accessibility support\n format: spec.format,\n formatType: spec.formatType\n });\n return encode;\n}\n\nfunction parseScope (spec, scope, preprocessed) {\n const signals = array(spec.signals),\n scales = array(spec.scales); // parse signal definitions, if not already preprocessed\n\n if (!preprocessed) signals.forEach(_ => parseSignal(_, scope)); // parse cartographic projection definitions\n\n array(spec.projections).forEach(_ => parseProjection(_, scope)); // initialize scale references\n\n scales.forEach(_ => initScale(_, scope)); // parse data sources\n\n array(spec.data).forEach(_ => parseData(_, scope)); // parse scale definitions\n\n scales.forEach(_ => parseScale(_, scope)); // parse signal updates\n\n (preprocessed || signals).forEach(_ => parseSignalUpdates(_, scope)); // parse axis definitions\n\n array(spec.axes).forEach(_ => parseAxis(_, scope)); // parse mark definitions\n\n array(spec.marks).forEach(_ => parseMark(_, scope)); // parse legend definitions\n\n array(spec.legends).forEach(_ => parseLegend(_, scope)); // parse title, if defined\n\n if (spec.title) parseTitle(spec.title, scope); // parse collected lambda (anonymous) expressions\n\n scope.parseLambdas();\n return scope;\n}\n\nconst rootEncode = spec => extendEncode({\n enter: {\n x: {\n value: 0\n },\n y: {\n value: 0\n }\n },\n update: {\n width: {\n signal: 'width'\n },\n height: {\n signal: 'height'\n }\n }\n}, spec);\n\nfunction parseView(spec, scope) {\n const config = scope.config; // add scenegraph root\n\n const root = ref(scope.root = scope.add(operator())); // parse top-level signal definitions\n\n const signals = collectSignals(spec, config);\n signals.forEach(_ => parseSignal(_, scope)); // assign description, event, legend, and locale configuration\n\n scope.description = spec.description || config.description;\n scope.eventConfig = config.events;\n scope.legends = scope.objectProperty(config.legend && config.legend.layout);\n scope.locale = config.locale; // store root group item\n\n const input = scope.add(Collect()); // encode root group item\n\n const encode = scope.add(Encode(parseEncode(rootEncode(spec.encode), GroupMark, FrameRole, spec.style, scope, {\n pulse: ref(input)\n }))); // perform view layout\n\n const parent = scope.add(ViewLayout({\n layout: scope.objectProperty(spec.layout),\n legends: scope.legends,\n autosize: scope.signalRef('autosize'),\n mark: root,\n pulse: ref(encode)\n }));\n scope.operators.pop(); // parse remainder of specification\n\n scope.pushState(ref(encode), ref(parent), null);\n parseScope(spec, scope, signals);\n scope.operators.push(parent); // bound / render / sieve root item\n\n let op = scope.add(Bound({\n mark: root,\n pulse: ref(parent)\n }));\n op = scope.add(Render({\n pulse: ref(op)\n }));\n op = scope.add(Sieve({\n pulse: ref(op)\n })); // track metadata for root item\n\n scope.addData('root', new DataScope(scope, input, input, op));\n return scope;\n}\n\nfunction signalObject(name, value) {\n return value && value.signal ? {\n name,\n update: value.signal\n } : {\n name,\n value\n };\n}\n/**\n * Collect top-level signals, merging values as needed. Signals\n * defined in the config signals arrays are added only if that\n * signal is not explicitly defined in the specification.\n * Built-in signals (autosize, background, padding, width, height)\n * receive special treatment. They are initialized using the\n * top-level spec property, or, if undefined in the spec, using\n * the corresponding top-level config property. If this property\n * is a signal reference object, the signal expression maps to the\n * signal 'update' property. If the spec's top-level signal array\n * contains an entry that matches a built-in signal, that entry\n * will be merged with the built-in specification, potentially\n * overwriting existing 'value' or 'update' properties.\n */\n\n\nfunction collectSignals(spec, config) {\n const _ = name => value(spec[name], config[name]),\n signals = [signalObject('background', _('background')), signalObject('autosize', parseAutosize(_('autosize'))), signalObject('padding', parsePadding(_('padding'))), signalObject('width', _('width') || 0), signalObject('height', _('height') || 0)],\n pre = signals.reduce((p, s) => (p[s.name] = s, p), {}),\n map = {}; // add spec signal array\n\n\n array(spec.signals).forEach(s => {\n if (hasOwnProperty(pre, s.name)) {\n // merge if built-in signal\n s = extend(pre[s.name], s);\n } else {\n // otherwise add to signal list\n signals.push(s);\n }\n\n map[s.name] = s;\n }); // add config signal array\n\n array(config.signals).forEach(s => {\n if (!hasOwnProperty(map, s.name) && !hasOwnProperty(pre, s.name)) {\n // add to signal list if not already defined\n signals.push(s);\n }\n });\n return signals;\n}\n\nfunction Scope(config, options) {\n this.config = config || {};\n this.options = options || {};\n this.bindings = [];\n this.field = {};\n this.signals = {};\n this.lambdas = {};\n this.scales = {};\n this.events = {};\n this.data = {};\n this.streams = [];\n this.updates = [];\n this.operators = [];\n this.eventConfig = null;\n this.locale = null;\n this._id = 0;\n this._subid = 0;\n this._nextsub = [0];\n this._parent = [];\n this._encode = [];\n this._lookup = [];\n this._markpath = [];\n}\n\nfunction Subscope(scope) {\n this.config = scope.config;\n this.options = scope.options;\n this.legends = scope.legends;\n this.field = Object.create(scope.field);\n this.signals = Object.create(scope.signals);\n this.lambdas = Object.create(scope.lambdas);\n this.scales = Object.create(scope.scales);\n this.events = Object.create(scope.events);\n this.data = Object.create(scope.data);\n this.streams = [];\n this.updates = [];\n this.operators = [];\n this._id = 0;\n this._subid = ++scope._nextsub[0];\n this._nextsub = scope._nextsub;\n this._parent = scope._parent.slice();\n this._encode = scope._encode.slice();\n this._lookup = scope._lookup.slice();\n this._markpath = scope._markpath;\n}\n\nScope.prototype = Subscope.prototype = {\n parse(spec) {\n return parseScope(spec, this);\n },\n\n fork() {\n return new Subscope(this);\n },\n\n isSubscope() {\n return this._subid > 0;\n },\n\n toRuntime() {\n this.finish();\n return {\n description: this.description,\n operators: this.operators,\n streams: this.streams,\n updates: this.updates,\n bindings: this.bindings,\n eventConfig: this.eventConfig,\n locale: this.locale\n };\n },\n\n id() {\n return (this._subid ? this._subid + ':' : 0) + this._id++;\n },\n\n add(op) {\n this.operators.push(op);\n op.id = this.id(); // if pre-registration references exist, resolve them now\n\n if (op.refs) {\n op.refs.forEach(ref => {\n ref.$ref = op.id;\n });\n op.refs = null;\n }\n\n return op;\n },\n\n proxy(op) {\n const vref = op instanceof Entry ? ref(op) : op;\n return this.add(Proxy({\n value: vref\n }));\n },\n\n addStream(stream) {\n this.streams.push(stream);\n stream.id = this.id();\n return stream;\n },\n\n addUpdate(update) {\n this.updates.push(update);\n return update;\n },\n\n // Apply metadata\n finish() {\n let name, ds; // annotate root\n\n if (this.root) this.root.root = true; // annotate signals\n\n for (name in this.signals) {\n this.signals[name].signal = name;\n } // annotate scales\n\n\n for (name in this.scales) {\n this.scales[name].scale = name;\n } // annotate data sets\n\n\n function annotate(op, name, type) {\n let data, list;\n\n if (op) {\n data = op.data || (op.data = {});\n list = data[name] || (data[name] = []);\n list.push(type);\n }\n }\n\n for (name in this.data) {\n ds = this.data[name];\n annotate(ds.input, name, 'input');\n annotate(ds.output, name, 'output');\n annotate(ds.values, name, 'values');\n\n for (const field in ds.index) {\n annotate(ds.index[field], name, 'index:' + field);\n }\n }\n\n return this;\n },\n\n // ----\n pushState(encode, parent, lookup) {\n this._encode.push(ref(this.add(Sieve({\n pulse: encode\n }))));\n\n this._parent.push(parent);\n\n this._lookup.push(lookup ? ref(this.proxy(lookup)) : null);\n\n this._markpath.push(-1);\n },\n\n popState() {\n this._encode.pop();\n\n this._parent.pop();\n\n this._lookup.pop();\n\n this._markpath.pop();\n },\n\n parent() {\n return peek(this._parent);\n },\n\n encode() {\n return peek(this._encode);\n },\n\n lookup() {\n return peek(this._lookup);\n },\n\n markpath() {\n const p = this._markpath;\n return ++p[p.length - 1];\n },\n\n // ----\n fieldRef(field, name) {\n if (isString(field)) return fieldRef$1(field, name);\n\n if (!field.signal) {\n error('Unsupported field reference: ' + stringValue(field));\n }\n\n const s = field.signal;\n let f = this.field[s];\n\n if (!f) {\n const params = {\n name: this.signalRef(s)\n };\n if (name) params.as = name;\n this.field[s] = f = ref(this.add(Field(params)));\n }\n\n return f;\n },\n\n compareRef(cmp) {\n let signal = false;\n\n const check = _ => isSignal(_) ? (signal = true, this.signalRef(_.signal)) : isExpr$1(_) ? (signal = true, this.exprRef(_.expr)) : _;\n\n const fields = array(cmp.field).map(check),\n orders = array(cmp.order).map(check);\n return signal ? ref(this.add(Compare({\n fields: fields,\n orders: orders\n }))) : compareRef(fields, orders);\n },\n\n keyRef(fields, flat) {\n let signal = false;\n\n const check = _ => isSignal(_) ? (signal = true, ref(sig[_.signal])) : _;\n\n const sig = this.signals;\n fields = array(fields).map(check);\n return signal ? ref(this.add(Key({\n fields: fields,\n flat: flat\n }))) : keyRef(fields, flat);\n },\n\n sortRef(sort) {\n if (!sort) return sort; // including id ensures stable sorting\n\n const a = aggrField(sort.op, sort.field),\n o = sort.order || Ascending;\n return o.signal ? ref(this.add(Compare({\n fields: a,\n orders: this.signalRef(o.signal)\n }))) : compareRef(a, o);\n },\n\n // ----\n event(source, type) {\n const key = source + ':' + type;\n\n if (!this.events[key]) {\n const id = this.id();\n this.streams.push({\n id: id,\n source: source,\n type: type\n });\n this.events[key] = id;\n }\n\n return this.events[key];\n },\n\n // ----\n hasOwnSignal(name) {\n return hasOwnProperty(this.signals, name);\n },\n\n addSignal(name, value) {\n if (this.hasOwnSignal(name)) {\n error('Duplicate signal name: ' + stringValue(name));\n }\n\n const op = value instanceof Entry ? value : this.add(operator(value));\n return this.signals[name] = op;\n },\n\n getSignal(name) {\n if (!this.signals[name]) {\n error('Unrecognized signal name: ' + stringValue(name));\n }\n\n return this.signals[name];\n },\n\n signalRef(s) {\n if (this.signals[s]) {\n return ref(this.signals[s]);\n } else if (!hasOwnProperty(this.lambdas, s)) {\n this.lambdas[s] = this.add(operator(null));\n }\n\n return ref(this.lambdas[s]);\n },\n\n parseLambdas() {\n const code = Object.keys(this.lambdas);\n\n for (let i = 0, n = code.length; i < n; ++i) {\n const s = code[i],\n e = parseExpression(s, this),\n op = this.lambdas[s];\n op.params = e.$params;\n op.update = e.$expr;\n }\n },\n\n property(spec) {\n return spec && spec.signal ? this.signalRef(spec.signal) : spec;\n },\n\n objectProperty(spec) {\n return !spec || !isObject(spec) ? spec : this.signalRef(spec.signal || propertyLambda(spec));\n },\n\n exprRef(code, name) {\n const params = {\n expr: parseExpression(code, this)\n };\n if (name) params.expr.$name = name;\n return ref(this.add(Expression(params)));\n },\n\n addBinding(name, bind) {\n if (!this.bindings) {\n error('Nested signals do not support binding: ' + stringValue(name));\n }\n\n this.bindings.push(extend({\n signal: name\n }, bind));\n },\n\n // ----\n addScaleProj(name, transform) {\n if (hasOwnProperty(this.scales, name)) {\n error('Duplicate scale or projection name: ' + stringValue(name));\n }\n\n this.scales[name] = this.add(transform);\n },\n\n addScale(name, params) {\n this.addScaleProj(name, Scale(params));\n },\n\n addProjection(name, params) {\n this.addScaleProj(name, Projection(params));\n },\n\n getScale(name) {\n if (!this.scales[name]) {\n error('Unrecognized scale name: ' + stringValue(name));\n }\n\n return this.scales[name];\n },\n\n scaleRef(name) {\n return ref(this.getScale(name));\n },\n\n scaleType(name) {\n return this.getScale(name).params.type;\n },\n\n projectionRef(name) {\n return this.scaleRef(name);\n },\n\n projectionType(name) {\n return this.scaleType(name);\n },\n\n // ----\n addData(name, dataScope) {\n if (hasOwnProperty(this.data, name)) {\n error('Duplicate data set name: ' + stringValue(name));\n }\n\n return this.data[name] = dataScope;\n },\n\n getData(name) {\n if (!this.data[name]) {\n error('Undefined data set name: ' + stringValue(name));\n }\n\n return this.data[name];\n },\n\n addDataPipeline(name, entries) {\n if (hasOwnProperty(this.data, name)) {\n error('Duplicate data set name: ' + stringValue(name));\n }\n\n return this.addData(name, DataScope.fromEntries(this, entries));\n }\n\n};\n\nfunction propertyLambda(spec) {\n return (isArray(spec) ? arrayLambda : objectLambda)(spec);\n}\n\nfunction arrayLambda(array) {\n const n = array.length;\n let code = '[';\n\n for (let i = 0; i < n; ++i) {\n const value = array[i];\n code += (i > 0 ? ',' : '') + (isObject(value) ? value.signal || propertyLambda(value) : stringValue(value));\n }\n\n return code + ']';\n}\n\nfunction objectLambda(obj) {\n let code = '{',\n i = 0,\n key,\n value;\n\n for (key in obj) {\n value = obj[key];\n code += (++i > 1 ? ',' : '') + stringValue(key) + ':' + (isObject(value) ? value.signal || propertyLambda(value) : stringValue(value));\n }\n\n return code + '}';\n}\n\n/**\n * Standard configuration defaults for Vega specification parsing.\n * Users can provide their own (sub-)set of these default values\n * by passing in a config object to the top-level parse method.\n */\nfunction defaults () {\n const defaultFont = 'sans-serif',\n defaultSymbolSize = 30,\n defaultStrokeWidth = 2,\n defaultColor = '#4c78a8',\n black = '#000',\n gray = '#888',\n lightGray = '#ddd';\n return {\n // default visualization description\n description: 'Vega visualization',\n // default padding around visualization\n padding: 0,\n // default for automatic sizing; options: 'none', 'pad', 'fit'\n // or provide an object (e.g., {'type': 'pad', 'resize': true})\n autosize: 'pad',\n // default view background color\n // covers the entire view component\n background: null,\n // default event handling configuration\n // preventDefault for view-sourced event types except 'wheel'\n events: {\n defaults: {\n allow: ['wheel']\n }\n },\n // defaults for top-level group marks\n // accepts mark properties (fill, stroke, etc)\n // covers the data rectangle within group width/height\n group: null,\n // defaults for basic mark types\n // each subset accepts mark properties (fill, stroke, etc)\n mark: null,\n arc: {\n fill: defaultColor\n },\n area: {\n fill: defaultColor\n },\n image: null,\n line: {\n stroke: defaultColor,\n strokeWidth: defaultStrokeWidth\n },\n path: {\n stroke: defaultColor\n },\n rect: {\n fill: defaultColor\n },\n rule: {\n stroke: black\n },\n shape: {\n stroke: defaultColor\n },\n symbol: {\n fill: defaultColor,\n size: 64\n },\n text: {\n fill: black,\n font: defaultFont,\n fontSize: 11\n },\n trail: {\n fill: defaultColor,\n size: defaultStrokeWidth\n },\n // style definitions\n style: {\n // axis & legend labels\n 'guide-label': {\n fill: black,\n font: defaultFont,\n fontSize: 10\n },\n // axis & legend titles\n 'guide-title': {\n fill: black,\n font: defaultFont,\n fontSize: 11,\n fontWeight: 'bold'\n },\n // headers, including chart title\n 'group-title': {\n fill: black,\n font: defaultFont,\n fontSize: 13,\n fontWeight: 'bold'\n },\n // chart subtitle\n 'group-subtitle': {\n fill: black,\n font: defaultFont,\n fontSize: 12\n },\n // defaults for styled point marks in Vega-Lite\n point: {\n size: defaultSymbolSize,\n strokeWidth: defaultStrokeWidth,\n shape: 'circle'\n },\n circle: {\n size: defaultSymbolSize,\n strokeWidth: defaultStrokeWidth\n },\n square: {\n size: defaultSymbolSize,\n strokeWidth: defaultStrokeWidth,\n shape: 'square'\n },\n // defaults for styled group marks in Vega-Lite\n cell: {\n fill: 'transparent',\n stroke: lightGray\n }\n },\n // defaults for title\n title: {\n orient: 'top',\n anchor: 'middle',\n offset: 4,\n subtitlePadding: 3\n },\n // defaults for axes\n axis: {\n minExtent: 0,\n maxExtent: 200,\n bandPosition: 0.5,\n domain: true,\n domainWidth: 1,\n domainColor: gray,\n grid: false,\n gridWidth: 1,\n gridColor: lightGray,\n labels: true,\n labelAngle: 0,\n labelLimit: 180,\n labelOffset: 0,\n labelPadding: 2,\n ticks: true,\n tickColor: gray,\n tickOffset: 0,\n tickRound: true,\n tickSize: 5,\n tickWidth: 1,\n titlePadding: 4\n },\n // correction for centering bias\n axisBand: {\n tickOffset: -0.5\n },\n // defaults for cartographic projection\n projection: {\n type: 'mercator'\n },\n // defaults for legends\n legend: {\n orient: 'right',\n padding: 0,\n gridAlign: 'each',\n columnPadding: 10,\n rowPadding: 2,\n symbolDirection: 'vertical',\n gradientDirection: 'vertical',\n gradientLength: 200,\n gradientThickness: 16,\n gradientStrokeColor: lightGray,\n gradientStrokeWidth: 0,\n gradientLabelOffset: 2,\n labelAlign: 'left',\n labelBaseline: 'middle',\n labelLimit: 160,\n labelOffset: 4,\n labelOverlap: true,\n symbolLimit: 30,\n symbolType: 'circle',\n symbolSize: 100,\n symbolOffset: 0,\n symbolStrokeWidth: 1.5,\n symbolBaseFillColor: 'transparent',\n symbolBaseStrokeColor: gray,\n titleLimit: 180,\n titleOrient: 'top',\n titlePadding: 5,\n layout: {\n offset: 18,\n direction: 'horizontal',\n left: {\n direction: 'vertical'\n },\n right: {\n direction: 'vertical'\n }\n }\n },\n // defaults for scale ranges\n range: {\n category: {\n scheme: 'tableau10'\n },\n ordinal: {\n scheme: 'blues'\n },\n heatmap: {\n scheme: 'yellowgreenblue'\n },\n ramp: {\n scheme: 'blues'\n },\n diverging: {\n scheme: 'blueorange',\n extent: [1, 0]\n },\n symbol: ['circle', 'square', 'triangle-up', 'cross', 'diamond', 'triangle-right', 'triangle-down', 'triangle-left']\n }\n };\n}\n\nfunction parse (spec, config, options) {\n if (!isObject(spec)) {\n error('Input Vega specification must be an object.');\n }\n\n config = mergeConfig(defaults(), config, spec.config);\n return parseView(spec, new Scope(config, options)).toRuntime();\n}\n\nexport { AxisDomainRole, AxisGridRole, AxisLabelRole, AxisRole, AxisTickRole, AxisTitleRole, DataScope, FrameRole, LegendEntryRole, LegendLabelRole, LegendRole, LegendSymbolRole, LegendTitleRole, MarkRole, Scope, ScopeRole, defaults as config, parse, parseSignal as signal, parseSignalUpdates as signalUpdates, parseStream as stream };\n","// -- Transforms -----\n\nimport {extend} from 'vega-util';\nimport {transforms} from 'vega-dataflow';\nimport * as tx from 'vega-transforms';\nimport * as vtx from 'vega-view-transforms';\nimport * as encode from 'vega-encode';\nimport * as geo from 'vega-geo';\nimport * as force from 'vega-force';\nimport * as tree from 'vega-hierarchy';\nimport * as label from 'vega-label';\nimport * as reg from 'vega-regression';\nimport * as voronoi from 'vega-voronoi';\nimport * as wordcloud from 'vega-wordcloud';\nimport * as xf from 'vega-crossfilter';\nextend(\n transforms,\n tx, vtx, encode, geo, force, label, tree, reg, voronoi, wordcloud, xf\n);\n\n\n// -- Exports -----\n\nexport {version} from './package.json';\n\nexport * from 'vega-statistics';\n\nexport * from 'vega-time';\n\nexport * from 'vega-util';\n\nexport * from 'vega-loader';\n\nexport * from 'vega-scenegraph';\n\nexport {\n Dataflow,\n EventStream,\n Parameters,\n Pulse,\n MultiPulse,\n Operator,\n Transform,\n changeset,\n ingest,\n isTuple,\n definition,\n transform,\n transforms,\n tupleid\n} from 'vega-dataflow';\n\nexport {\n scale,\n scheme,\n interpolate,\n interpolateColors,\n interpolateRange,\n quantizeInterpolator\n} from 'vega-scale';\n\nexport {\n projection\n} from 'vega-projection';\n\nexport {\n View\n} from 'vega-view';\n\nexport {\n numberFormatDefaultLocale as formatLocale,\n timeFormatDefaultLocale as timeFormatLocale,\n locale,\n defaultLocale,\n resetDefaultLocale\n} from 'vega-format';\n\nexport {\n expressionFunction\n} from 'vega-functions';\n\nexport {\n parse\n} from 'vega-parser';\n\nexport {\n context as runtimeContext\n} from 'vega-runtime';\n\nexport {\n codegenExpression,\n parseExpression\n} from 'vega-expression';\n\nexport {\n parseSelector\n} from 'vega-event-selector';\n"],"names":["accessor","fn","fields","name","fname","accessorName","accessorFields","getter","path","length","get1","getN","field","obj","len","i","error","message","Error","splitAccessPath","p","j","c","n","q","b","s","push","substring","opt","get","id","identity","_","zero","one","truthy","falsy","log$1","method","level","input","args","concat","slice","call","console","apply","logger","handler","arguments","undefined","this","warn","info","debug","isArray","Array","isObject","Object","isLegalKey","key","mergeConfig","_len","configs","_key","reduce","out","source","signals","mergeNamed","r","layout","writeConfig","output","value","recurse","k","o","a","map","add","forEach","peek","array","toNumber","exp","sign","x","Math","log","symlog","log1p","abs","symexp","expm1","pow","exponent","pan","domain","delta","lift","ground","d0","d1","dd","panLinear","panLog","panPow","panSymlog","constant","zoom","anchor","scale","da","zoomLinear","zoomLog","zoomPow","zoomSymlog","quarter","date","Date","getMonth","utcquarter","getUTCMonth","clampRange","range","min","max","span","lo","hi","isFunction","compare","orders","ord","fmap","gen","comparator","f","keys","ascending","u","v","compare1","compareN","order","debounce","delay","tid","e","clearTimeout","setTimeout","extend","extent","extentIndex","hop","prototype","hasOwnProperty","has","object","property","NULL","fastmap","test","has$1","size","empty","set","delete","clear","clean","next","flush","threshold","left","right","center","t","l","inherits","child","parent","members","proto","create","defineProperty","writable","enumerable","configurable","inrange","r0","r1","isBoolean","isDate","toString","isIterable","Symbol","iterator","isNumber","isRegExp","isString","flat","replace","lerp","frac","lruCache","maxsize","curr","prev","update","merge","array0","array1","n0","n1","i0","merged","constructor","i1","repeat","str","reps","pad","padchar","align","ceil","$","JSON","stringify","toBoolean","defaultParser","parse","toDate","parser","toSet","truncate","ellipsis","visitArray","filter","visitor","EOL","EOF","objectConverter","columns","Function","join","inferColumns","rows","columnSet","row","column","width","formatDate","hours","getUTCHours","minutes","getUTCMinutes","seconds","getUTCSeconds","milliseconds","getUTCMilliseconds","isNaN","year","formatYear","getUTCFullYear","getUTCDate","dsvFormat","delimiter","reFormat","RegExp","DELIMITER","charCodeAt","parseRows","text","N","I","eof","eol","token","preformatBody","formatValue","formatRow","convert","customConverter","format","formatBody","formatRows","identity$5","feature","topology","objects","type","features","geometries","bbox","properties","geometry","transformPoint","transform","x0","y0","kx","ky","dx","translate","dy","arcs","arc","points","pop","reverse","point","line","ring","polygon","coordinates","stitch","stitchedArcs","fragmentByStart","fragmentByEnd","fragments","emptyIndex","start","end","g","ends","p1","p0","dp","fg","unshift","gf","mesh","meshArcs","extractArcs","geom","geomsByArc","extract0","extract1","extract2","extract3","geoms","NaN","bisector","compare2","mid","d","numbers","number","values","valueof","_iterator","_step","index","_iterator2","_step2","_value","regeneratorRuntime","wrap","_context","_createForOfIteratorHelper","done","t0","finish","t1","stop","_marked","ascendingBisect","bisectRight","bisectLeft","bisect$1","deviation","count","mean","sum","err","variance","sqrt","Adder","_classCallCheck","_partials","Float64Array","_n","_createClass","y","InternMap","_Map","_inherits","_super","_createSuper","entries","_this","keyof","defineProperties","_assertThisInitialized","_intern","Map","_step$value","_slicedToArray","_get","_getPrototypeOf","intern_get","intern_set","intern_delete","_wrapNativeSuper","InternSet","_Set","_super2","_this2","Set","_typeof","valueOf","compareDefined","ascendingDefined","TypeError","e10","e5","e2","ticks","step","tickIncrement","isFinite","round","power","floor","LN10","tickStep","step0","step1","quickselect","m","z","sd","newLeft","newRight","swap","quantile","from","value0","subarray","quantileSorted","value1","median","flatten","arrays","delegateYield","formatDecimalParts","toExponential","indexOf","coefficient","prefixExponent","re","formatSpecifier","specifier","match","exec","FormatSpecifier","fill","symbol","comma","precision","trim","formatRounded","formatTypes","toFixed","toLocaleString","toPrecision","X","toUpperCase","identity$4","locale","formatPrefix","prefixes","formatLocale$1","grouping","thousands","group","Number","currencyPrefix","currency","currencySuffix","decimal","numerals","formatNumerals","String","percent","minus","nan","newFormat","prefix","toLowerCase","suffix","formatType","maybeSuffix","valuePrefix","valueSuffix","valueNegative","formatTrim","Infinity","padding","precisionFixed","precisionPrefix","precisionRound","definition","formatLocale","defaultLocale","newInterval","floori","offseti","interval","offset","previous","setTime","every","millisecond","utcMillisecond","durationSecond","durationMinute","durationHour","durationDay","durationWeek","durationMonth","durationYear","second","getMilliseconds","utcSecond","minute","getSeconds","getMinutes","timeMinute","hour","getHours","timeHour","day","setHours","setDate","getDate","getTimezoneOffset","timeDay","weekday","getDay","sunday","monday","weekday$1","thursday","month","setMonth","getFullYear","timeMonth","setFullYear","timeYear","utcMinute","setUTCSeconds","utcMinute$1","utcHour","setUTCMinutes","utcHour$1","utcDay","setUTCHours","setUTCDate","utcDay$1","utcWeekday","getUTCDay","utcSunday","utcMonday","utcThursday","utcMonth","setUTCMonth","utcMonth$1","utcYear","setUTCFullYear","utcYear$1","ticker","week","tickIntervals","tickInterval","target","_ref2","_tickIntervals","_ref","_ticker2","utcWeek","utcTicks","utcTickInterval","_ticker4","timeTicks","timeTickInterval","YEAR","QUARTER","MONTH","WEEK","DATE","DAY","DAYOFYEAR","HOURS","MINUTES","SECONDS","MILLISECONDS","TIME_UNITS","UNITS","timeUnits","units","unit","sort","defaultSpecifiers","_defineProperty","_defaultSpecifiers","timeUnitSpecifier","specifiers","fmt","localYear","dayofyear","localDayOfYear","localWeekNum","timeWeek","localFirst","localDate","H","M","S","L","utcdayofyear","utcDayOfYear","utcweek","utcWeekNum","UTC","utcFirst","utcDate","inv","newDate","phase","getUnit","firstDay","localGet","_localGet","localInv","_localInv","w","timeFloor","utcGet","_utcGet","utcInv","_utcInv","utcFloor","timeIntervals","_timeIntervals","timeSecond","timeMillisecond","utcIntervals","_utcIntervals","timeInterval","utcInterval","ival","timeOffset","utcOffset","sequence","timeSequence","utcSequence","Milli","Seconds","Minutes","Hours","Day","Month","Year","intervals","bin","ext","maxbins","locale_dateTime","dateTime","locale_date","locale_time","time","locale_periods","periods","locale_weekdays","days","locale_shortWeekdays","shortDays","locale_months","months","locale_shortMonths","shortMonths","periodRe","formatRe","periodLookup","formatLookup","weekdayRe","weekdayLookup","shortWeekdayRe","shortWeekdayLookup","monthRe","monthLookup","shortMonthRe","shortMonthLookup","formats","formatShortWeekday","A","formatWeekday","formatShortMonth","B","formatMonth","formatDayOfMonth","formatMicroseconds","formatYearISO","G","formatFullYearISO","formatHour24","formatHour12","formatDayOfYear","formatMilliseconds","formatMonthNumber","formatMinutes","formatPeriod","formatQuarter","Q","formatUnixTimestamp","formatUnixTimestampSeconds","formatSeconds","formatWeekdayNumberMonday","U","formatWeekNumberSunday","V","formatWeekNumberISO","formatWeekdayNumberSunday","W","formatWeekNumberMonday","Y","formatFullYear","Z","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","string","parseSpecifier","parseDayOfMonth","parseMicroseconds","parseYear","parseFullYear","parseHour24","parseDayOfYear","parseMilliseconds","parseMonthNumber","parseMinutes","parseQuarter","parseUnixTimestamp","parseUnixTimestampSeconds","parseSeconds","parseWeekdayNumberMonday","parseWeekNumberSunday","parseWeekNumberISO","parseWeekdayNumberSunday","parseWeekNumberMonday","parseZone","parseLiteralPercent","pads","charAt","newParse","timeMonday","utcFormat","utcParse","timeFormat","timeParse","defaultNumberLocale","defaultTimeLocale","numberRe","percentRe","requoteRe","requote","names","timeSunday","dISO","timeThursday","dow","UTCdISO","memoize","cache","spec","numberLocale","formatFloat","numberFormat","decimalChar","dec","idx","lastIndexOf","rightmostDigit","formatSpan","resetNumberFormatDefaultLocale","numberFormatLocale","numberFormatDefaultLocale","timeMultiFormat","timeLocale","resetTimeFormatDefaultLocale","timeFormatLocale","timeFormatLocale$1","timeFormatDefaultLocale","createLocale","numberSpec","timeSpec","protocol_re","allowed_re","whitespace_re","fileProtocol","load","uri","options","url","_context2","sanitize","sent","href","abrupt","localFile","file","http","_callee2","fileAccess","result","isFile","loadFile","base","isAllowed","hasProtocol","_context3","stringValue","baseURL","startsWith","endsWith","mode","defaultProtocol","rel","context","crossOrigin","_callee3","fileLoader","fs","filename","Promise","accept","reject","readFile","data","fileReject","_fileReject","_asyncToGenerator","mark","_callee4","_context4","httpLoader","fetch","_callee","response","ok","status","statusText","_x5","_x6","httpReject","_httpReject","_callee5","_context5","typeParsers","boolean","integer","unknown","typeTests","isInteger","typeList","inferType","inferTypes","types","delimitedFormat","delim","dsv","responseType","header","json","prop","Buffer","isBuffer","copy","parseJSON","filters","interior","exterior","topojson","csv","tsv","reader","read","schema","timeParser","utcParser","datum","parsers","parts","pattern","split","loader","loaderFactory","UniqueList","idFunc","list","ids","remove","splice","asyncCallback","df","callback","TUPLE_ID_KEY","TUPLE_ID","isTuple","tupleid","setid","ingest$1","derive","rederive","stableCompare","cmp","isChangeSet","changeset","rem","mod","remp","modp","reflow","insert","modify","tuple","encode","pulse","tuples","cur","modifies","CACHE","Parameters","force","modified","OP_ID","NO_PARAMS","Operator","init","params","react","stamp","rank","qrank","flags","_update","parameters","flag","bit","state","targets","_targets","skip","initonly","argval","_argval","argops","_argops","deps","op","marshall","item","detach","evaluate","StopPropagation","run","rv","STREAM_ID","EventStream","receive","_filter","_apply","stream","_preload","pending","res","_pending","loadPending","requests","request","consume","_consume","evt","val","trg","preventDefault","stopPropagation","throttle","pause","now","dataflow","between","active","SKIP","onStream","func","touch","onOperator","updater","connect","Pulse","materialize","visit","addFilter","MultiPulse","pulses","hash","changed","ADD","REM","MOD","changes","_evaluate","prerun","postrun","async","pr","_pulse","reentrant","_touched","_clock","_enqueue","_heap","_getPulse","then","_input","_postrun","priority","all","cb","runAsync","_runAsync","_this3","_running","ADD_REM","ADD_MOD","ALL","REFLOW","SOURCE","NO_SOURCE","NO_FIELDS","fork","clone","addAll","src","addF","remF","modF","srcF","cleans","runAfter","nomod","some","NO_OPT","Heap","nodes","siftdown","last","ridx","cidx","siftup","pidx","Dataflow","logLevel","_rank","_locale","_loader","logMethod","_log","Transform","cleanThreshold","shift","sources","targetRank","rerank","queue","ingest","preload","events","send","document","querySelectorAll","addEventListener","on","enqueue","singlePulse","transforms","Definition","quantiles","quartiles","estimateBandwidth","h","minstep","maxb","logb","div","divide","steps","eps","nice","bootstrapCI","samples","alpha","mu","random","dotbin","smooth","thresh","smoothing","exports","SQRT2PI","PI","SQRT2","nextSample","sampleNormal","stdev","rds","densityNormal","cumulativeNormal","cd","quantileNormal","erfinv","gaussian","sigma","dist","sample","pdf","cdf","icdf","kde","support","bandwidth","kernel","sampleLogNormal","densityLogNormal","cumulativeLogNormal","quantileLogNormal","lognormal","mixture","dists","weights","normalize","distributions","sampleUniform","densityUniform","cumulativeUniform","quantileUniform","uniform","ols","uX","uY","uXY","uX2","slope","xv","yv","_step3","ux","uy","_iterator3","visitPoints","_step4","_iterator4","rSquared","predict","SSE","SST","sse","sst","linear","XY","X2","coef","_points2","ly","xy","YL","XYL","X2Y","_ols2","c0","c1","YS","lx","quad","x2","_points4","X3","X4","X2X2","poly","_points6","lhs","rhs","matrix","gaussianElimination","uncenter","loess","_points8","bw","yhat","residuals","robustWeights","iter","edge","denom","xk","yk","tricube","xkw","_ols4","updateInterval","medianResidual","arg","cnt","MIN_RADIANS","sampleCurve","minSteps","maxSteps","minX","maxX","sx","sy","ymin","ymax","scaleY","pm","angleDelta","a0","atan2","a1","groupkey","measureName","as","noop","base_op","AggregateOps","cell","store","num","__count__","missing","valid","product","mean_d","average","req","dev","variancep","stdevp","stderr","distinct","ci0","ci1","q2","q1","q3","argmin","argmax","ValidAggregateOps","createMeasure","compareIndex","_ops","_this4","_out","compileMeasures","agg","ops","getreqs","resolve","ctr","TupleStore","reset","measure","prototype$1","Aggregate","_adds","_mods","_alen","_mlen","_drop","_cross","_dims","_dnames","_measures","_countOnly","_counts","_prev","_inputs","_outputs","_add","_rem","_ext","_q","quartile","ci","_ci","Aggregate$1","metadata","generates","null","default","_this5","aggr","drop","cross","dims","vals","collect","cells","generate","inputs","outputs","inputMap","inputVisit","groupby","dname","cellkey","mname","outname","newcell","newtuple","measures","celltuple","counts","adds","mods","Bin","SortedList","resort","Collect","Compare","update$5","CountPattern","Cross","required","band","bins","_bins","b0","b1","Collect$1","root","process","tokens","tcase","tokenize","case","_parameterCheck","_match","_stop","_finish","stopwords","_tuples","Distributions","randomKDE","randomMixture","normal","randomNormal","randomLogNormal","randomUniform","FUNCTION","def","Density","function","fieldNames","partition$1","groups","distribution","minsteps","maxsteps","DotBin","Output","Expression","update$4","expr","Extent","Subflow","Facet","_keys","Field","update$3","Filter","Flatten","Fold","Formula","Generate","autostep","detachSubflow","activate","flow","subflow","flows","sf","_group","detached","initTargets","act","_this6","rekey","k0","k1","isMod","revisit","maxlen","fnames","generator","Methods","Empty","Impute","JoinAggregate","KDE","Key","update$2","Load","Lookup","MultiExtent","update$1","extents","MultiValues","Params","Pivot","PreFacet","Project","Proxy","Quantile","gVals","kVal","impute","getValue","getField","fName","kName","gNames","keyvals","gKey","kMap","gMap","partition","_impute","cumulative","density","_this7","defaultValue","_transform","limit","pivotKeys","bind","aggregateParams","_this8","lut","project","dt","Quantile$1","Relay","Sample","Sequence","Sieve","TimeUnit","probs","cap","OUTPUT","TupleIndex","Values","utc","timezone","_floor","u0","u1","timeBin","tunits","WindowOps","row_number","dense_rank","drank","percent_rank","cume_dist","cume","ntile","lag","lead","first_value","last_value","nth_value","nth","prev_value","next_value","find","ValidWindowOps","WindowState","windows","countOnly","visitInputs","param","WindowOp","Window","processPartition","ignorePeers","frame","setWindow","adjustRange","bisect","wind","_this9","pi","tau","epsilon","tauEpsilon","Path","_x0","_y0","_x1","_y1","constant$3","moveTo","closePath","lineTo","quadraticCurveTo","x1","y1","bezierCurveTo","y2","arcTo","x21","y21","x01","y01","l01_2","x20","y20","l21_2","l20_2","l21","l01","tan","acos","t01","t21","ccw","cos","sin","cw","rect","halfPi","asin","arcInnerRadius","innerRadius","arcOuterRadius","outerRadius","arcStartAngle","startAngle","arcEndAngle","endAngle","arcPadAngle","padAngle","intersect","x3","y3","x10","y10","x32","y32","cornerTangents","rc","ox","oy","x11","y11","x00","y00","d2","D","cx0","cy0","cx1","cy1","dx0","dy0","dx1","dy1","cx","cy","array$4","Linear","curveLinear","line$2$1","defined","curve","buffer","defined0","lineStart","lineEnd","pointX","pointY","area$2$1","area","x0z","y0z","areaStart","areaEnd","arealine","lineX0","lineY0","lineY1","lineX1","Linear$1","_line","_point","circle$1","draw","noop$3","that","Basis","BasisClosed","BasisOpen","Bundle","beta","_basis","_beta","_x2","_x3","_x4","_y2","_y3","_y4","_x","_y","curveBundle","custom","bundle","_k","Cardinal","tension","curveCardinal","cardinal","CardinalClosed","_y5","curveCardinalClosed","CardinalOpen","curveCardinalOpen","_l01_a","_l01_2a","_l12_a","_l12_2a","_l23_a","_l23_2a","CatmullRom","_alpha","x23","y23","curveCatmullRom","catmullRom","CatmullRomClosed","curveCatmullRomClosed","CatmullRomOpen","curveCatmullRomOpen","LinearClosed","slope3","h0","h1","s0","s1","slope2","MonotoneX","MonotoneY","ReflectContext","Natural","controlPoints","Step","_t","domCanvas","createElement","getContext","height","_t0","px","py","domImage","Image","initRange","initInterpolator","interpolator","implicit","ordinal","define","factory","Color","darker","brighter","reI","reN","reP","reHex","reRgbInteger","reRgbPercent","reRgbaInteger","reRgbaPercent","reHslPercent","reHslaPercent","named","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen","color_formatHex","rgb","formatHex","color_formatRgb","formatRgb","color","parseInt","rgbn","Rgb","rgba","hsla","rgbConvert","opacity","rgb_formatHex","hex","rgb_formatRgb","Hsl","hslConvert","hsl","hsl2rgb","m1","m2","channels","assign","displayable","formatHsl","radians","degrees","Xn","Zn","t2","labConvert","Lab","Hcl","hcl2lab","rgb2lrgb","xyz2lab","lab","lab2xyz","lrgb2rgb","hclConvert","hcl","C","E","ED","EB","BC_DA","cubehelixConvert","Cubehelix","bl","cubehelix","basis","v0","v1","v2","v3","t3","basis$1","basisClosed","cosh","sinh","constant$2","hue","gamma","nogamma","exponential","rgbGamma","colorRgb","rgbSpline","spline","colors","rgbBasis","rgbBasisClosed","numberArray","isNumberArray","ArrayBuffer","isView","DataView","genericArray","nb","na","date$1","interpolateNumber","reA","reB","bi","am","bm","bs","lastIndex","interpolate$1","interpolateRound","svgNode","translateX","translateY","rotate","skewX","scaleX","decompose","atan","interpolateTransform","pxComma","pxParen","degParen","xa","ya","xb","yb","interpolateTransformCss","DOMMatrix","WebKitCSSMatrix","isIdentity","interpolateTransformSvg","createElementNS","setAttribute","baseVal","consolidate","zoomRho","rho","rho2","rho4","ux0","uy0","w0","ux1","uy1","w1","coshr0","tanh","duration","_1","_2","colorHsl","hsl$1","hslLong","colorHcl","hcl$1","hclLong","cubehelixGamma","colorCubehelix","cubehelix$1","cubehelixLong","piecewise","interpolate","colorLab","bimap","polymap","clamp","transformer","untransform","interpolateValue","rescale","clamper","invert","rangeRound","continuous","tickFormat","linearish","prestep","maxIter","transformLog","transformExp","transformLogn","transformExpn","pow10","reflect","loggish","logs","pows","log10","log2","logp","powp","transformSymlog","transformSymexp","symlogish","transformPow","transformSqrt","transformSquare","powish","calendar","formatMillisecond","formatSecond","formatMinute","formatHour","formatDay","formatWeek","k10","_ref4","sequential","sequentialPow","k21","r2","divergingPow","bandSpace","paddingInner","paddingOuter","space","Log","Pow","Sqrt","Symlog","Time","Sequential","Diverging","Quantize","Threshold","Ordinal","Point","Band","BinOrdinal","Continuous","Discrete","Discretizing","Interpolating","Temporal","scaleOrdinal","ordinalRange","range$1","invertRange","pointish","scales","invertExtent","invertRangeExtent","isValidScaleType","hasType","isContinuous","isDiscrete","isDiscretizing","isLogarithmic","isInterpolating","isQuantile","scale$4","sequentialLog","sequentialSymlog","diverging","divergingLog","divergingSymlog","thresholds","quantize","scaleBinOrdinal","tickFormat$1","scaleProps","interpolateRange","interpolateColors","$$1","quantizeInterpolator","scaleFraction","scale$1","interp","palette","scheme","schemes","category10","category20","category20b","category20c","tableau10","tableau20","accent","dark2","paired","pastel1","pastel2","set1","set2","set3","blues","greens","greys","oranges","purples","reds","blueGreen","bluePurple","greenBlue","orangeRed","purpleBlue","purpleBlueGreen","purpleRed","redPurple","yellowGreen","yellowOrangeBrown","yellowOrangeRed","blueOrange","brownBlueGreen","purpleGreen","purpleOrange","redBlue","redGrey","yellowGreenBlue","redYellowBlue","redYellowGreen","pinkYellowGreen","spectral","viridis","magma","inferno","plasma","cividis","rainbow","sinebow","turbo","browns","tealBlues","teals","warmGreys","goldGreen","goldOrange","goldRed","lightGreyRed","lightGreyTeal","lightMulti","lightOrange","lightTealBlue","darkBlue","darkGold","darkGreen","darkMulti","darkRed","SymbolLegend","defaultFormatter","descending","tickCount","minStep","validTicks","endpoints","tickValues","noSkip","varfmt","tickLog","symbols","_symbols","_formats","labelValues","binValues","thresholdValues","labelFormat","thresholdFormat","isDiscreteRange","formatRange","formatDiscrete","formatPoint","dflt","isTemporal","domainCaption","gradient_id","patternPrefix","isGradient","gradient","gradientRef","defs","Gradient","stops","lookup","monotone","horizontal","vertical","natural","curves","orientation","entry","paramCounts","commandPattern","numberPattern","spacePattern","flagPattern","commands","cmd","paramCount","segment","ws","parseParams","DegToRad","HalfPi","Tau","HalfSqrt3","segmentCache","bezierCache","bezier","th0","th1","rx","ry","sin_th","cos_th","a00","a01","a10","a11","cos_th0","sin_th0","cos_th1","sin_th1","th_half","sin_th_h2","temp","current","sX","sY","pathRender","tempX","tempY","tempControlX","tempControlY","controlX","controlY","anchorX","anchorY","beginPath","drawArc","coords","seg","large","sweep","rotateX","th","pl","sfactor_sq","sfactor","xc","yc","th_arc","segs","th2","th3","segments","bez","Tan30","builtins","circle","diamond","square","arrow","wedge","triangle","stroke","parsed","customSymbol","rectangleX","rectangleY","rectangleWidth","rectangleHeight","vg_rect","crTL","crTR","crBL","crBR","rectangle","tl","tr","br","path$3","cornerRadius","vg_trail","ready","w2","ud","trail","value$1","arcShape","padRadius","da0","da1","ap","rp","rc0","rc1","oc","ax","ay","bx","by","kc","lc","centroid","arc$2","areavShape","area$2","areahShape","lineShape","line$2","rectShape","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomRight","cornerRadiusBottomLeft","symbolShape","symbol$2","shape","trailShape","hasCornerRadius","clip_id","resetSVGClipId","clip$1","renderer","clip","_defs","clipping","Bounds","union","Item","bounds","GroupItem","items","ResourceLoader","customLoader","increment","decrement","boundStroke","miter","strokeOpacity","sw","strokeWidth","expand","strokeJoin","miterAdjustment","MAX_VALUE","equals","angle","rotatedPoints","encloses","alignsWith","intersects","contains","sanitizeURL","catch","loadImage","image$1","img","cors","onload","onerror","complete","poll","rot","ma","mb","mc","md","circleThreshold","addL","addX","addY","addp","addpL","boundContext","deg","context$1","px1","py1","px2","py2","quadExtrema","px3","py3","cubicExtrema","sa","ea","cubic","s2","canvas","intersectPath","brush","isPointInPath","intersectPoint","box","intersectRect","intersectRule","intersectBoxLine","blend","globalCompositeOperation","addStops","addColorStop","createRadialGradient","image","ictx","fillStyle","createLinearGradient","fillRect","createPattern","fillOpacity","globalAlpha","lw","strokeStyle","lineWidth","lineCap","strokeCap","lineJoin","miterLimit","strokeMiterLimit","setLineDash","strokeDash","lineDashOffset","strokeDashOffset","zindex","zorder","scene","zdirty","zitems","pickVisit","hit","drawAll","drawPath","drawOne","pick$1","gx","gy","pixelRatio","hitPath","filled","isPointInStroke","pickPath","translateItem","markItemPath","isect","tag","nested","attr","emit","rotateItem","bound","pick","markMultiItemPath","tip","orient","clipGroup","offset$1","strokeOffset","emitRectangle","off","rectanglePath","hitBackground","hitForeground","hitCorner","noBound","fore","strokeForeground","save","restore","dw","dh","ix","interactive","pickMark","marktype","content","background","foreground","xmlns","version","getImage","imageWidth","aspect","imageHeight","imageXOffset","imageYOffset","baseline","toDataURL","ar0","ar1","imageSmoothingEnabled","drawImage","xOffset","yOffset","path$1","pathCache","path$2","transformItem","draw$2","rule","widthCache","textMetrics","fontSize","measureWidth","estimateWidth","useCanvas","use","_estimateWidth","textValue","currentFontHeight","_measureWidth","font","currentFont","measureText","lineHeight","textLines","lineBreak","multiLineOffset","widthGetter","rtl","dir","fontFamily","quote","fontStyle","fontVariant","fontWeight","textAlign","tempBounds","anchorPoint","radius","theta","lh","fillText","strokeText","Marks","boundItem","DUMMY","boundMark","hasItems","sceneToJSON","indent","sceneFromJSON","initialize","Scenegraph","createMark","role","aria","description","domCreate","doc","ns","domFind","el","childNodes","tagName","domChild","ownerDocument","insertBefore","domClear","removeChild","cssClass","event","getBoundingClientRect","clientX","clientLeft","clientY","top","clientTop","Handler","customTooltip","_active","_handlers","_tooltip","defaultTooltip","element","Renderer","_el","_bgcolor","toJSON","markdef","origin","_obj","firstChild","_origin","_scene","_handlerIndex","handlers","eventName","handleHref","MouseEvent","dispatchEvent","handleTooltip","show","tooltip","mdef","resolveItem","getItemBoundingClientRect","bottom","scaleFactor","resize","bgcolor","_width","_height","_scale","dirty","render","_call","_render","renderAsync","_ready","_load","redraw","DragEnterEvent","DragLeaveEvent","DragOverEvent","MouseDownEvent","MouseMoveEvent","MouseOutEvent","MouseOverEvent","ClickEvent","MouseWheelEvent","TouchStartEvent","TouchMoveEvent","TouchEndEvent","TooltipShowEvent","TooltipHideEvent","HrefEvent","CanvasHandler","_down","_touch","_first","_events","eventListenerCheck","eventBundle","fire","move","moveEvent","overEvent","outEvent","pickEvent","exit","inactive","_canvas","DOMMouseScroll","mousemove","dragover","mouseout","dragleave","mousedown","click","touchstart","changedTouches","touchmove","touchend","vegaType","window","devicePixelRatio","CanvasRenderer","_options","_redraw","_dirty","_tempb","base$1","SVGHandler","_hrefHandler","listener","_tooltipHandler","externalContext","appendChild","inDOM","HTMLElement","parentNode","ratio","style","setTransform","ctx","db","vb","viewBounds","clipToBounds","clearRect","__data__","svg","_svg","removeEventListener","ARIA_HIDDEN","ARIA_LABEL","ARIA_ROLE","ARIA_ROLEDESCRIPTION","GRAPHICS_OBJECT","GRAPHICS_SYMBOL","roledesc","label","AriaIgnore","AriaGuides","axis","desc","caption","title","extractTitle","legend","props","channelCaption","titleCaption","AriaEncode","ariaRole","ariaRoleDescription","ariaItemAttributes","hide","ariaMarkAttributes","ariaGuide","ariaMark","innerText","markup","buf","outer","inner","stack","open","attrs","_i","_attrs","close","serializeXML","node","_serialize","hasAttributes","attributes","hasChildNodes","nodeType","nodeValue","stylesAttr","stylesCss","rootAttributes","svgns","SVGRenderer","_dirtyID","_root","dirtyParents","updateGradient","grad","pt","setAttributes","viewBox","preserveAspectRatio","fx","fy","fr","updateClipping","sibling","__values__","bg","cg","ownerSVGElement","previousSibling","siblingCheck","nextSibling","_clearDefs","setAttributeNS","RootIndex","setProperty","removeAttribute","_dirtyCheck","_dirtyAll","isDirty","isGroup","lastChild","extra","mark_extras","setStyle","ts","textContent","removeAttributeNS","removeProperty","loc","location","SVGStringRenderer","_text","class","attrList","_hrefs","prefixed","styleList","display","Canvas","None","RenderType","PNG","SVG","modules","renderModule","hits","intersectMark","intersectGroup","visitMark","intersectItem","marks","headless","clipBounds","boundClip","sceneEqual","pathEqual","ka","kb","objectEqual","Top","Left","Right","Bottom","Start","Middle","End","Group","AxisRole","TitleRole","FrameRole","ScopeRole","LegendRole","RowHeader","RowFooter","RowTitle","ColHeader","ColFooter","ColTitle","Padding","Fit","FitX","FitY","All","Each","Flush","Column","Row","Bound","rebound","view","markBounds","COUNTER_NAME","Identifier","Mark","Overlap","Identifier$1","counter","_signals","scenegraph","lookup$1","Init","methods","parity","greedy","sep","hasOverlap","hasBounds","Render","separation","boundScale","boundTolerance","tolerance","boundTest","boundOrient","isYAxis","axisLayout","indices","grid","labels","axisIndices","position","minExtent","maxExtent","titlePadding","dl","axisTitleLayout","auto","bboxFlush","bboxFull","offsetValue","gridLayout","nodirty","alignCol","alignRow","padCol","padRow","ncols","nrows","xExtent","xMax","yExtent","yMax","boxes","trellisLayout","views","_views$rowheaders","_views$rowfooters","_views$colheaders","_views$colfooters","_views$marks","rowheaders","rowfooters","colheaders","colfooters","rowtitle","coltitle","gridLayoutGroups","boundFlush","boundFull","headerBand","layoutHeaders","footerBand","titleAnchor","titleBand","layoutTitle","headers","isX","bf","stride","back","legendParams","config","legends","offsets","mult","legendLayout","widths","_bounds","ex","ey","tpad","tx","ty","legendTitleOffset","legendGroupLayout","legendBounds","lr","noBar","vgrad","ViewLayout","xBounds","yBounds","autosize","pos","subtitle","titleLayout","_autosize","viewWidth","viewHeight","_resizeView","viewSizeLayout","layoutGroup","shouldReflow","AxisTicks","DataJoin","defaultItemCreate","Encode","LegendEntries","newMap","fmod","encoders","reenter","enter","fraction","lskip","perc","adjust","labelFraction","perc2","sourceX","sourceY","targetX","targetY","LinkPath","Paths","rr","iy","sr","ta","sc","ss","tc","diagonalR","mr","Pie","includePad","Scale","domainCheck","adjustScheme","flip","SortItems","isContinuousColor","rawDomain","domainMid","scaleKey","rangeStep","configureRangeStep","scheme$1","schemeExtent","interpolateGamma","schemeCount","configureScheme","configureRange","domainRaw","configureBins","raw","includeZero","padDomain","domainMin","domainMax","domainImplicit","scaleImplicit","configureDomain","Zero","Center","Normalize","DefOutput","Stack","stackCenter","stackNormalize","stackZero","lastPos","lastNeg","epsilon2","quarterPi","hypot","streamGeometry","streamGeometryType","streamObjectType","Feature","FeatureCollection","Sphere","sphere","MultiPoint","LineString","streamLine","MultiLineString","Polygon","streamPolygon","MultiPolygon","GeometryCollection","closed","coordinate","polygonStart","polygonEnd","geoStream","lambda00","phi00","lambda0","cosPhi0","sinPhi0","phi0","lambda1","phi1","lambda2","deltaSum","ranges","areaRingSum","areaSum","areaStream","areaRingStart","areaRingEnd","areaRing","areaPointFirst","areaPoint","lambda","phi","dLambda","sdLambda","adLambda","cosPhi","sinPhi","spherical","cartesian","cartesianDot","cartesianCross","cartesianAddInPlace","cartesianScale","vector","cartesianNormalizeInPlace","W0","W1","X0","Y0","Z0","X1","Y1","Z1","Y2","Z2","z0","boundsStream","boundsPoint","boundsLineStart","boundsLineEnd","boundsRingPoint","boundsRingStart","boundsRingEnd","linePoint","inflection","phii","lambdai","antimeridian","rangeCompare","rangeContains","centroidStream","centroidPoint","centroidLineStart","centroidLineEnd","centroidRingStart","centroidRingEnd","centroidPointCartesian","centroidLinePointFirst","centroidLinePoint","centroidRingPointFirst","centroidRingPoint","cz","compose","rotationIdentity","rotateRadians","deltaLambda","deltaPhi","deltaGamma","rotationLambda","rotationPhiGamma","forwardRotationLambda","rotation","cosDeltaPhi","sinDeltaPhi","cosDeltaGamma","sinDeltaGamma","circleRadius","cosRadius","clipBuffer","lines","rejoin","pointEqual","Intersection","other","clipRejoin","compareIntersection","startInside","subject","link","isSubject","longitude","pointVisible","clipLine","sink","ringBuffer","ringSink","polygonStarted","pointRing","ringStart","ringEnd","winding","point0","sinPhi1","cosPhi1","point1","absDelta","intersection","phiArc","polygonContains","pointLine","ringSegments","validSegment","sign0","sign1","sinLambda0Lambda1","clipAntimeridianIntersect","to","direction","clipCircle","cr","smallRadius","notHemisphere","visible","two","n2","n2n2","n1n2","determinant","c2","n1xn2","uu","polar","code","v00","point2","sinRadius","circleStream","clipMax","clipMin","clipRectangle","corner","comparePoint","ca","activeStream","x__","y__","v__","x_","y_","v_","first","bufferStream","clipStream","polygonInside","cleanInside","graticuleX","graticuleY","pathArea","boundsStream$1","centroidPointFirstLine","centroidPointLine","centroidPointFirstRing","centroidPointRing","pathCentroid","PathContext","_radius","pointRadius","lengthRing","lengthSum","lengthStream","lengthPointFirst","lengthPoint","pathMeasure","PathString","_string","geoPath","projection","projectionStream","contextStream","pathBounds","TransformStream","fit","fitBounds","clipExtent","fitExtent","fitSize","fitWidth","fitHeight","_circle","cosMinDistance","resample","delta2","resampleLineTo","depth","phi2","dx2","dy2","dz","b00","c00","resampleStream","ringPoint","resampleNone","transformRadians","scaleTranslateRotate","scaleTranslate","cosAlpha","sinAlpha","ai","fi","projectionMutator","projectAt","projectResample","projectTransform","projectRotateTransform","cacheStream","preclip","clipAntimeridian","postclip","recenter","transformRotate","clipAngle","reflectX","reflectY","conicProjection","parallels","conicEqualAreaRaw","sy0","forward","cylindricalEqualAreaRaw","r0y","geoConicEqualArea","geoAlbers","conicEqualArea","azimuthalRaw","azimuthalInvert","cc","azimuthalEqualAreaRaw","cxcy","azimuthalEquidistantRaw","mercatorRaw","mercatorProjection","reclip","tany","conicConformalRaw","equirectangularRaw","conicEquidistantRaw","nx","A1","A2","A3","A4","equalEarthRaw","l2","l6","gnomonicRaw","naturalEarth1Raw","phi4","orthographicRaw","stereographicRaw","transverseMercatorRaw","sqrt2","mollweideBromleyTheta","cp","cpsinPhi","mollweideRaw","mollweideBromleyRaw","defaultPath","projectionProperties","proj","projections","getProjectionPath","albers","albersusa","lower48Point","alaskaPoint","hawaiiPoint","lower48","alaska","hawaii","pointStream","albersUsa","streams","azimuthalequalarea","azimuthalequidistant","conicconformal","conicequalarea","conicequidistant","equalEarth","equirectangular","gnomonic","mercator","mollweide","naturalEarth1","orthographic","stereographic","transversemercator","cases","contours","smoothLinear","tz","contour","polygons","holes","startIndex","endIndex","isorings","hole","xt","yt","_0","ringContains","xi","yi","pj","xj","yj","segmentContains","collinear","Isocontour","transformPolygon","transformRing","bandwidthNRD","density2D","weight","values0","Float32Array","values1","blurX","blurY","sz","cellSize","LN2","KDE2D","levels","paths","transformPaths","PARAMS","Contour","post","GeoJSON","GeoPath","GeoPoint","GeoShape","Graticule","DX","DY","graticule","outline","extentMajor","extentMinor","stepMajor","stepMinor","geoGraticule","Heatmap","dependency","$x","$y","$value","$max","Projection","_features","_points","lon","lat","geojson","initPath","shapeGenerator","shared","dep","opacity_","color_","can","getImageData","pix","putImageData","toCanvas","featurize","collectGeoJSON","tree","xm","ym","xp","yp","leaf","Quad","defaultX","defaultY","quadtree","Quadtree","leaf_copy","treeProto","constant$1","jiggle","vx","vy","nodeById","nodeId","cover","xz","yz","quads","retainer","removeAll","visitAfter","dispatch","Dispatch","parseTypenames","typenames","typename","T","taskHead","taskTail","timeout","clockLast","clockNow","clockSkew","clock","performance","setFrame","requestAnimationFrame","clearNow","Timer","_time","_next","timer","restart","wake","timerFlush","sleep","nap","poke","clearInterval","setInterval","initialAngle","forceSimulation","simulation","alphaMin","alphaDecay","alphaTarget","velocityDecay","forces","stepper","tick","iterations","initializeNodes","initializeForce","randomSource","closest","ForceMap","strength","collide","radii","ri","ri2","prepare","rj","_nodes","_random","nbody","strengths","distanceMin2","distanceMax2","theta2","accumulate","distanceMin","distanceMax","links","distances","bias","defaultStrength","distance","initializeStrength","initializeDistance","Forces","ForceParams","ForceConfig","ForceOutput","Force","setup","sim","getForce","numForces","setForceParam","change","iters","stopped","static","defaultSeparation","meanXReduce","maxYReduce","children","hierarchy","mapChildren","objectChildren","childs","Node","eachBefore","computeHeight","copyData","enclose","circles","shuffle","enclosesWeak","encloseBasis","extendBasis","enclosesWeakAll","enclosesNot","encloseBasis2","encloseBasis3","dr","encloseBasis1","r21","r3","a2","a3","b2","b3","c3","d3","ab","place","score","packEnclose","aa","sj","sk","pack","optional","constantZero","defaultRadius","radiusLeaf","packChildren","translateChild","roundNode","treemapDice","Node$1","eachAfter","each","ancestor","aNodes","ancestors","bNodes","leastCommonAncestor","descendants","leaves","node_iterator","preroot","ambiguous","imputed","defaultId","defaultParentId","parentId","stratify","nodeKey","currentId","currentParentId","nodeByKey","slash","P","parentof","nextLeft","nextRight","moveSubtree","wm","wp","nextAncestor","vim","TreeNode","treemapSlice","squarifyRatio","sumValue","minValue","maxValue","newRatio","minRatio","dice","treemapSquarify","squarify","treemapResquarify","resquarify","_squarify","Nest","treesource","nest","keyValue","valuesByKey","HierarchyLayout","setParams","setFields","Output$3","Pack","Output$2","Partition","Stratify","positionNode","parentKey","Layouts","tidy","nodeSize","treeRoot","firstWalk","secondWalk","sizeNode","siblings","executeShifts","midpoint","vip","vop","vom","sip","sop","som","apportion","cluster","previousNode","meanX","maxY","leafLeft","leafRight","Output$1","Tree","TreeLinks","Tiles","binary","sums","valueOffset","valueTarget","valueLeft","valueRight","slicedice","Treemap","tile","paddingStack","paddingTop","paddingRight","paddingBottom","paddingLeft","treemap","ALPHA_MASK","getBuffer","Uint32Array","_objectSpread","RIGHT0","SIZE","RIGHT1","scaler","bitmap","_set","mask","_clear","getRange","indexStart","indexEnd","setRange","clearRange","outOfBounds","Bitmap","textWidth","textHeight","collision","bm0","bm1","X_DIR","Y_DIR","Aligns","Baselines","boundary","isInside","anchorCode","TOP","MIDDLE","BOTTOM","placeAreaLabel","naive","bitmaps","avoidBaseMark","markIndex","areaWidth","maxAreaWidth","tryLabel","maxSize","_xMid","_yMid","swapTmp","labelPlaced","labelPlaced2","_result2","_result4","placeAreaLabelFloodFill","bm2","_stack$pop2","labelLayout","texts","avoidMarks","lineAnchor","positions","getOffsets","anchors","Int8Array","getAnchors","grouptype","isGroupArea","markBoundary","infPadding","isNaiveGroupArea","maxTextWidth","maxTextHeight","labelInside","baseMark","border","baseMarkContext","strokeContext","strokeAlpha","baseMarkAlpha","baseMarkBuffer","strokeBuffer","layer1","layer2","markBitmaps","baseBitmaps","_d$textWidth","sizeFactor","insideFactor","SQRT1_2","placeMarkLabel","Anchors","Label","Label$1","Loess","regressionLoess","regressionLinear","regressionLog","regressionExp","regressionPow","regressionQuad","regressionPoly","Regression","dof","degreesOfFreedom","model","dom","splitter","elen","flen","Qnew","hh","bvirt","enow","fnow","eindex","findex","hindex","vec","C1","C2","orient2d","detleft","detright","det","detsum","acxtail","acytail","bcxtail","bcytail","ahi","alo","bhi","blo","_j","u3","acx","bcx","acy","bcy","estimate","errbound","C1len","C2len","Dlen","orient2dadapt","EPSILON","EDGE_STACK","Delaunator","maxTriangles","_triangles","_halfedges","Int32Array","_hashSize","_hullPrev","_hullNext","_hullTri","_hullHash","_ids","_dists","hullPrev","hullNext","hullTri","hullHash","minY","i2","minDist","i0x","i0y","i1x","i1y","minRadius","circumradius","i2x","i2y","quicksort","hull","triangles","halfedges","cl","circumcenter","_cx","_cy","_hullStart","hullSize","_hashKey","trianglesLen","_addTriangle","_legalize","ar","al","inCircle","hbl","_link","getX","defaultGetX","getY","defaultGetY","bp","tempDist","arr","tmp","Voronoi","delaunay","xmin","xmax","_circumcenters","vectors","_init","_this$delaunay","circumcenters","_this$delaunay2","inedges","ti","tj","_renderSegment","_project","_clip","cellPolygons","cellPolygon","renderCell","_regioncode","_clipSegment","neighbors","cj","li","aj","lj","_this$delaunay3","e0","_cell","_clipInfinite","_clipFinite","e1","sx0","sx1","sy1","_S2","_S4","_edgecode","_edge","vx0","vy0","vxn","vyn","flatIterable","jitter","Delaunay","_delaunator","_hullIndex","hullIndex","dc","renderHull","trianglePolygons","trianglePolygon","renderTriangle","flatArray","defaultExtent","toPathString","voronoi","cloudRadians","ch","cloud","spiral","archimedeanSpiral","words","board","dxdy","startX","startY","maxDelta","cloudCollide","collideRects","sprite","msx","contextAndRatio","zeroArray","tags","xoff","yoff","hasText","cloudSprite","cloudBounds","functor","spirals","di","w32","maxh","wcr","wsr","hcr","hsr","pixels","seen","seenRow","archimedean","rectangular","Wordcloud","fontSizeRange","fsize","sizeScale","array8","Uint8Array","array16","Uint16Array","array32","Dimension","query","onAdd","added","dim","SortedIndex","oldv","oldi","addi","addv","permute","index0","index1","reindex","CrossFilter","lengthen","_index","Bitmaps","_indices","ResolveFilter","reinit","eval","remMap","modMap","bits","indexMap","incrementOne","incrementAll","old","lo1","hi1","lo0","hi0","ignore","pass","TokenName","lookahead","Literal","Property","ArrayExpression","BinaryExpression","CallExpression","ConditionalExpression","LogicalExpression","MemberExpression","ObjectExpression","UnaryExpression","ASTNode","elements","callee","consequent","alternate","argument","SyntaxIdentifier","MessageUnexpectedToken","MessageInvalidRegExp","MessageUnterminatedRegExp","MessageStrictOctalLiteral","ILLEGAL","DISABLED","RegexNonAsciiIdentifierStart","RegexNonAsciiIdentifierPart","assert","condition","isDecimalDigit","isHexDigit","isOctalDigit","isWhiteSpace","isLineTerminator","isIdentifierStart","fromCharCode","isIdentifierPart","keywords","if","in","do","var","for","new","try","let","else","void","with","enum","while","break","throw","const","yield","super","return","typeof","switch","export","import","public","finally","extends","package","private","continue","debugger","interface","protected","instanceof","implements","skipComment","scanHexEscape","throwError","scanUnicodeCodePointEscape","cu1","cu2","getEscapedIdentifier","substr","scanIdentifier","getIdentifier","scanPunctuator","code2","ch2","ch3","ch4","ch1","scanNumericLiteral","scanHexLiteral","scanOctalLiteral","octal","parseFloat","scanRegExp","body","classMarker","terminated","literal","scanRegExpBody","search","scanRegExpFlags","$0","$1","exception","testRegExp","regex","advance","scanStringLiteral","lex","finishBinaryExpression","operator","finishCallExpression","finishIdentifier","finishLiteral","finishMemberExpression","computed","member","finishProperty","kind","messageFormat","msg","whole","throwUnexpected","expect","matchKeyword","keyword","parseArrayInitialiser","parseConditionalExpression","finishArrayExpression","parseObjectPropertyKey","parseObjectProperty","parseObjectInitialiser","finishObjectExpression","legalKeywords","parsePrimaryExpression","parseExpression","parseGroupExpression","parseArguments","parseNonComputedMember","isIdentifierName","parseNonComputedProperty","parseComputedMember","parsePostfixExpression","parseLeftHandSideExpressionAllowCall","parseUnaryExpression","finishUnaryExpression","binaryPrecedence","prec","marker","markers","parseBinaryExpression","finishConditionalExpression","Constants","LOG2E","LOG10E","MIN_VALUE","Functions","codegen","cast","fncall","STRING","REGEXP","datetime","timezoneoffset","utcdate","utcday","utcyear","utcmonth","utchours","utcminutes","utcseconds","utcmilliseconds","upper","lower","regexp","allowed","forbidden","constants","functions","globalvar","fieldvar","outputGlobal","globals","memberDepth","ast","Generators","stripQuotes","Intersect","Union","SelectionId","$selectionId","UNIT_INDEX","testPoint","dval","others","_others","selectionVisitor","scope","indexName","IndexPrefix","dataName","getData","indataRef","tuplesRef","dateObj","setYear","dataVisitor","scaleVisitor","addScaleDependency","scaleName","scaleRef","getScale","internalScaleFunctions","fnctx","visitors","__bandwidth","_bandwidth","_range","ref","geoMethod","methodName","globalMethod","geoArea","geoBounds","deltaMax","geoCentroid","channel_luminance_value","channelValue","luminance","equal","equalArray","equalObject","removePredicate","accessors","seq","treeNodes","_window","_b","intersect$1","array$1","markname","functionContext","isDefined","isValid","indexof","_sequence","_len2","_key2","_array","lastindexof","_sequence2","_len3","_key3","repl","_sequence3","_len4","_key4","pluck","contrast","color1","color2","lum1","lum2","monthFormat","monthAbbrevFormat","dayFormat","dayAbbrevFormat","inScope","pinchDistance","touches","pinchAngle","screen","containerSize","container","clientWidth","clientHeight","windowSize","innerWidth","innerHeight","bandspace","setdata","pathShape","pathParse","retval","toggle","predicate","_trigger","lassoAppend","lasso","_toConsumableArray","lassoPath","intersectLasso","pixelLasso","bb","MAX_SAFE_INTEGER","MIN_SAFE_INTEGER","pointInPolygon","testx","testy","intersections","prevX","_polygon$j","prevY","_polygon$i","eventFunctions","thisPrefix","astVisitors","codegenParams","codeGenerator","codegenExpression","expressionFunction","signalName","getSignal","signalRef","$expr","$fields","$params","miss","unitIdx","isMulti","vl5","resUnit","resolved","multiRes","acc","And","Skip","Swap","canonicalType","expression","expressionCodegen","parameter","adjustSpatial","_compare","lt","gt","parseParameter","PARSERS","$ref","$key","$flat","parseParameters","parameterExpression","$field","$name","$encode","enc","encodeExpression","$output","$compare","$order","$tupleid","$subflow","subctx","operators","Context","Subcontext","ariaLabel","subcontext","_i2","_keys2","isCollect","$ingest","$format","$request","unresolved","signal","_loop","operatorExpression","eventExpression","handlerExpression","eventConfig","parseOperator","parseOperatorParameters","parseStream","updates","parseUpdate","isOperator","srcid","getState","dataset","setState","substate","Default","setCursor","cursor","globalCursor","dataref","_runtime","_viewWidth","_viewHeight","resizeRenderer","_renderer","_handler","_resizeListeners","eventExtend","vega","itemGroup","extension","VIEW","NO_TRAP","trap","trackEventListener","_eventListeners","permit","_eventConfig","itemFilter","markTarget","invoke","Event","BindClass","wrapper","NameClass","form","checkbox","select","radio","checked","option","valuesEqual","selected","selectedIndex","RadioClass","prepend","initializeRenderer","querySelector","paddingObject","renderHeadless","_renderHeadless","module","_scenegraph","toBlobURL","mime","blob","Blob","URL","createObjectURL","_renderToSVG","Width","Height","dataTest","signalTest","proxy","formatArray","formatTooltip","View","_elBind","_renderType","_globalCursor","_preventDefault","_timers","defaults","unpack","initializeEventConfig","runtime","_bind","bindings","_resize","resetSize","_resizeWidth","_resizeHeight","resizePadding","initializeResize","_background","user","hover","lookupSignal","findOperatorHandler","addOperatorListener","removeOperatorListener","_desc","_resetRenderer","rerun","addResizeListener","removeResizeListener","addSignalListener","removeSignalListener","addDataListener","removeDataListener","total","_restart","elapsed","timestamp","prevent","allow","finalize","timers","listeners","hoverSet","leaveSet","elBind","initializeAria","prevHandler","initializeHandler","binding","toImageURL","toSVG","DEFAULT_SOURCE","MARKS","LBRACK","RBRACK","DEFAULT_MARKS","eventSelector","selector","parseMerge","parseSelector","endChar","pushChar","popChar","parseBetween","parseThrottle","isMarkType","parseAutosize","parsePadding","encoder","addEncode","addEncoders","extendEncode","MarkRole","LegendLabelRole","TitleTextRole","TitleSubtitleRole","applyDefault","entry$1","_color","resolveField","parseEncode","applyDefaults","parseBlock","block","parse$1","OUTER_INVALID","outerError","parseSignal","addSignal","addBinding","Entry","refs","fieldRef$1","keyFieldRef","compareRef","aggrField","Scope$1","isSignal","hasSignal","specValue","deref","mergeStream","nestedStream","eventStream","streamParameters","addStream","eventSource","markrole","filterMark","OP_VALUE_EXPR","isSubscope","mergeSources","addUpdate","streamSource","FIELD_REF_ID","MULTIDOMAIN_SORT_OPS","parseScale","parseScaleDomain","parseScaleRange","parseLiteral","parseScaleInterpolate","parseScaleNice","parseArray","objectProperty","parseScaleBins","dataLookupError","explicitDomain","multipleDomain","singularDomain","valuesRef","parseSort","domainRef","extentRef","coll","addDataPipeline","fieldRef","ordinalMultipleDomain","quantileMultipleDomain","numericMultipleDomain","countsRef","sortRef","multidomain","parseParameter$1","Index","Perc","Value","GuideLabelStyle","GuideTitleStyle","GroupTitleStyle","GroupSubtitleStyle","Symbols","Size","LegendScales","GroupMark","RectMark","RuleMark","TextMark","guideGroup","isVertical","Vertical","symbolDirection","gradientDirection","gradientLength","gradientWidth","gradientThickness","gradientHeight","entryColumns","getEncoding","anchorExpr","alignExpr$1","extendOffset","guideMark","extras","legendGradient","userEncode","thickness","legendGradientDiscrete","dataRef","vv","alignExpr","baselineExpr","legendGradientLabels","overlap","labelLimit","gradientLabelLimit","labelOffset","gradientLabelOffset","legendSymbolGroups","symbolOffset","valueRef","xSignal","yEncode","baseFill","baseStroke","symbolBaseFillColor","symbolBaseStrokeColor","facet","isL","isR","isLR","isVG","alignFlip","exprAlign","exprAnchor","exprAngle","exprBaseline","getRole","parseTransform","definition$1","pdef","lookupRef","parseIndexParameter","parseSubParameter","parseSubParameters","projectionRef","parameterValue","isExpr","isField","isCompare","outerExpr","exprRef","outerField","isData","getDataRef","DataScope","aggregate","fieldKey","addSortField","ds","optype","sortKey","parseTrigger","trigger","parseMark","layoutRef","boundRef","keyRef","parseData$1","joinRef","$context","markpath","markRef","encodeRef","pushState","subscope","addData","toRuntime","parseFacet","parseSubflow","popState","tol","parseOverlap","sieve","parseLegend","entryLayout","legendEncode","scaleType","scaleCount","legendType","entryRef","tickMinStep","legendSymbolLayout","getChannel","getStyle","getFontSize","sizeExpression","_anchor","legendTitle","buildLegendEncode","fromEntries","angleExpr","parseTitle","buildTitle","titleEncode","buildSubTitle","groupEncode","parseData","upstream","analyze","getSign","ifLeftTopExpr","ifX","ifXEnc","ifY","ifYEnc","ifTop","ifTopExpr","$orient","ifEnc","ifExpr","ifRightExpr","isSimple","toExpr","ifOrient","patch","fallback","axisConfig","styleProp","axisGrid","vscale","gridScale","tickPos","gridStart","gridEnd","flushExpr","axisLabels","flushOffset","labelAlign","labelBaseline","flushOn","tickSize","ifRight","offsetExpr","axisTitle","titlePos","autoY","autoX","autoLayout","parseAxis","or","axisBand","xyKeys","axisX","axisY","orientKeys","axisTop","axisBottom","axisLeft","axisRight","axisEncode","tickBand","ticksRef","axisTicks","pos0","pos1","axisDomain","buildAxisEncode","parseScope","preprocessed","addProjection","parseProjection","addScale","initScale","parseSignalUpdates","axes","parseLambdas","parseView","signalObject","pre","collectSignals","rootEncode","Scope","lambdas","_id","_subid","_nextsub","_parent","_encode","_lookup","_markpath","Subscope","propertyLambda","arrayLambda","objectLambda","vref","annotate","check","isExpr$1","sig","hasOwnSignal","addScaleProj","projectionType","dataScope","extend$1","vtx","geo","reg","wordcloud","xf","defaultFont","defaultColor","lightGray","subtitlePadding","bandPosition","domainWidth","domainColor","gridWidth","gridColor","labelAngle","labelPadding","tickColor","tickOffset","tickRound","tickWidth","gridAlign","columnPadding","rowPadding","gradientStrokeColor","gradientStrokeWidth","labelOverlap","symbolLimit","symbolType","symbolSize","symbolStrokeWidth","titleLimit","titleOrient","category","heatmap","ramp","seed"],"mappings":"4OAAA,SAASA,EAAUC,EAAIC,EAAQC,GAG7B,OAFAF,EAAGC,OAASA,GAAU,GACtBD,EAAGG,MAAQD,EACJF,EAET,SAASI,EAAaJ,GACbA,OAAM,MAANA,EAAa,KAAOA,EAAGG,MAEhC,SAASE,EAAeL,GACfA,OAAM,MAANA,EAAa,KAAOA,EAAGC,OAGhC,SAASK,EAAQC,GACf,OAAuB,IAAhBA,EAAKC,OAAeC,EAAKF,EAAK,IAAMG,EAAKH,GAGlD,IAAME,EAAO,SAAAE,GAAS,OAAA,SAAUC,GACvBA,OAAAA,EAAID,KAGPD,EAAO,SAAAH,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