Skip to content

Instantly share code, notes, and snippets.

@timelyportfolio
Last active August 29, 2017 11:37
Show Gist options
  • Save timelyportfolio/a200e632235b02066f8f1a7c4c8dc37a to your computer and use it in GitHub Desktop.
Save timelyportfolio/a200e632235b02066f8f1a7c4c8dc37a to your computer and use it in GitHub Desktop.
vega 3.0 dataflow event stream outside of vega
license: mit
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<script src="https://unpkg.com/d3"></script>
<script src="https://unpkg.com/vega@3.0.2/build/vega-core.min.js"></script>
</head>
<body>
<div id = "vis"></div>
<pre id = "pre-hovered"></pre>
<script>
// spec from vega 3.0 examples
// https://github.com/uwdata/vega/blob/master/test/spec/bar-hover-label.vg.json
var spec = {
"width": 400,
"height": 200,
"padding": 5,
"signals": [
{
"name": "label",
"value": {"x": 0, "y": 0},
"on": [
{"events": "rect:mouseover", "update": "datum"},
{"events": "rect:mouseout", "update": "{x:0, y:0}"}
]
}
],
"data": [
{
"name": "table",
"values": [
{"x": 1, "y": 28}, {"x": 2, "y": 55},
{"x": 3, "y": 43}, {"x": 4, "y": 91},
{"x": 5, "y": 81}, {"x": 6, "y": 53},
{"x": 7, "y": 19}, {"x": 8, "y": 87},
{"x": 9, "y": 52}, {"x": 10, "y": 48},
{"x": 11, "y": 24}, {"x": 12, "y": 49},
{"x": 13, "y": 87}, {"x": 14, "y": 66},
{"x": 15, "y": 17}, {"x": 16, "y": 27},
{"x": 17, "y": 68}, {"x": 18, "y": 16},
{"x": 19, "y": 49}, {"x": 20, "y": 15}
]
}
],
"scales": [
{
"name": "xscale",
"type": "band",
"range": "width",
"domain": {"data": "table", "field": "x"}
},
{
"name": "yscale",
"type": "linear",
"range": "height",
"domain": {"data": "table", "field": "y"},
"nice": true
}
],
"axes": [
{"orient": "bottom", "scale": "xscale"},
{"orient": "left", "scale": "yscale"}
],
"marks": [
{
"type": "rect",
"from": {"data": "table"},
"encode": {
"enter": {
"x": {"scale": "xscale", "field": "x", "offset":1},
"width": {"scale": "xscale", "band": 1, "offset":-1},
"y": {"scale": "yscale", "field": "y"},
"y2": {"scale": "yscale", "value": 0}
},
"update": {
"fill": [
{"test": "datum === label", "value": "red"},
{"value": "steelblue"}
]
}
}
},
{
"type": "text",
"encode": {
"enter": {
"align": {"value": "center"},
"fill": {"value": "#333"}
},
"update": {
"x": {"scale": "xscale", "expr": "label.x", "band": 0.5},
"y": {"scale": "yscale", "expr": "label.y", "offset": -5},
"text": {"expr": "label.y"},
"fillOpacity": [
{"test": "!label._id", "value": 0},
{"value": 1}
]
}
}
}
]
};
var runtime = vega.parse(spec); // may throw an Error if parsing fails
var view = new vega.View(runtime)
.logLevel(vega.Warn) // set view logging level
.initialize(document.querySelector("#vis")) // set parent DOM element
.renderer("svg") // set render type (defaults to canvas)
.hover() // enable hover event processing
.run(); // update and render the view
// add a function to the dataflow to update pre with the hovered value
function hoverfollower(evt, val) {
d3.select("#pre-hovered").text(JSON.stringify(val));
};
// react to the label event stream
view.addSignalListener("label", hoverfollower);
</script>
</body>
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Vega 3.x Visualization Specification Language",
"defs": {
"axis": {
"type": "object",
"properties": {
"orient": {
"enum": [
"top",
"bottom",
"left",
"right"
]
},
"scale": {
"type": "string"
},
"title": {
"type": "string"
},
"zindex": {
"type": "number"
},
"interactive": {
"type": "boolean"
},
"domain": {
"type": "boolean"
},
"grid": {
"type": "boolean"
},
"tickSize": {
"type": "number"
},
"tickPadding": {
"type": "number"
},
"count": {
"oneOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
},
"format": {
"oneOf": [
{
"type": "string"
},
{
"$ref": "#/refs/signal"
}
]
},
"values": {
"oneOf": [
{
"type": "array"
},
{
"$ref": "#/refs/signal"
}
]
},
"offset": {
"oneOf": [
{
"type": "number"
},
{
"$ref": "#/refs/numberValue"
}
]
},
"position": {
"oneOf": [
{
"type": "number"
},
{
"$ref": "#/refs/numberValue"
}
]
},
"titlePadding": {
"oneOf": [
{
"type": "number"
},
{
"$ref": "#/refs/numberValue"
}
]
},
"minExtent": {
"oneOf": [
{
"type": "number"
},
{
"$ref": "#/refs/numberValue"
}
]
},
"maxExtent": {
"oneOf": [
{
"type": "number"
},
{
"$ref": "#/refs/numberValue"
}
]
},
"encode": {
"type": "object",
"properties": {
"ticks": {
"$ref": "#/defs/guideEncode"
},
"labels": {
"$ref": "#/defs/guideEncode"
},
"title": {
"$ref": "#/defs/guideEncode"
},
"grid": {
"$ref": "#/defs/guideEncode"
},
"axis": {
"$ref": "#/defs/guideEncode"
}
},
"additionalProperties": false
}
},
"additionalProperties": false,
"required": [
"orient",
"scale"
]
},
"background": {
"type": "string"
},
"data": {
"title": "Input data set definition",
"type": "object",
"allOf": [
{
"properties": {
"name": {
"type": "string"
},
"transform": {
"type": "array",
"items": {
"$ref": "#/defs/transform"
}
},
"on": {
"$ref": "#/defs/onTrigger"
},
"format": {
"type": "object",
"oneOf": [
{
"properties": {
"type": {
"enum": [
"json"
]
},
"parse": {
"oneOf": [
{
"enum": [
"auto"
]
},
{
"type": "object",
"additionalProperties": {
"enum": [
"number",
"boolean",
"date",
"string"
]
}
}
]
},
"property": {
"type": "string"
}
},
"additionalProperties": false
},
{
"properties": {
"type": {
"enum": [
"csv",
"tsv"
]
},
"parse": {
"oneOf": [
{
"enum": [
"auto"
]
},
{
"type": "object",
"additionalProperties": {
"enum": [
"number",
"boolean",
"date",
"string"
]
}
}
]
}
},
"additionalProperties": false
},
{
"properties": {
"type": {
"enum": [
"dsv"
]
},
"delimiter": {
"type": "string"
},
"parse": {
"oneOf": [
{
"enum": [
"auto"
]
},
{
"type": "object",
"additionalProperties": {
"enum": [
"number",
"boolean",
"date",
"string"
]
}
}
]
}
},
"additionalProperties": false
},
{
"oneOf": [
{
"properties": {
"type": {
"enum": [
"topojson"
]
},
"feature": {
"type": "string"
},
"property": {
"type": "string"
}
},
"additionalProperties": false
},
{
"properties": {
"type": {
"enum": [
"topojson"
]
},
"mesh": {
"type": "string"
},
"property": {
"type": "string"
}
},
"additionalProperties": false
}
]
}
]
}
},
"required": [
"name"
]
},
{
"anyOf": [
{
"required": [
"name"
]
},
{
"oneOf": [
{
"properties": {
"source": {
"type": "string"
}
},
"required": [
"source"
]
},
{
"properties": {
"values": {
"type": "array"
}
},
"required": [
"values"
]
},
{
"properties": {
"url": {
"type": "string"
}
},
"required": [
"url"
]
}
]
}
]
}
]
},
"rule": {
"type": "object",
"properties": {
"test": {
"type": "string"
}
}
},
"encodeEntry": {
"title": "Mark encode property set",
"type": "object",
"properties": {
"x": {
"$ref": "#/refs/numberValue"
},
"x2": {
"$ref": "#/refs/numberValue"
},
"xc": {
"$ref": "#/refs/numberValue"
},
"width": {
"$ref": "#/refs/numberValue"
},
"y": {
"$ref": "#/refs/numberValue"
},
"y2": {
"$ref": "#/refs/numberValue"
},
"yc": {
"$ref": "#/refs/numberValue"
},
"height": {
"$ref": "#/refs/numberValue"
},
"opacity": {
"$ref": "#/refs/numberValue"
},
"fill": {
"$ref": "#/refs/colorValue"
},
"fillOpacity": {
"$ref": "#/refs/numberValue"
},
"stroke": {
"$ref": "#/refs/colorValue"
},
"strokeWidth": {
"$ref": "#/refs/numberValue"
},
"strokeOpacity": {
"$ref": "#/refs/numberValue"
},
"strokeDash": {
"$ref": "#/refs/arrayValue"
},
"strokeDashOffset": {
"$ref": "#/refs/numberValue"
},
"cursor": {
"$ref": "#/refs/stringValue"
},
"clip": {
"$ref": "#/refs/booleanValue"
},
"size": {
"$ref": "#/refs/numberValue"
},
"shape": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/refs/stringValue"
}
]
},
"path": {
"$ref": "#/refs/stringValue"
},
"innerRadius": {
"$ref": "#/refs/numberValue"
},
"outerRadius": {
"$ref": "#/refs/numberValue"
},
"startAngle": {
"$ref": "#/refs/numberValue"
},
"endAngle": {
"$ref": "#/refs/numberValue"
},
"interpolate": {
"$ref": "#/refs/stringValue"
},
"tension": {
"$ref": "#/refs/numberValue"
},
"orient": {
"oneOf": [
{
"type": "array",
"items": {
"allOf": [
{
"$ref": "#/defs/rule"
},
{
"type": "object",
"allOf": [
{
"$ref": "#/refs/stringModifiers"
},
{
"anyOf": [
{
"oneOf": [
{
"$ref": "#/refs/signal",
"required": [
"signal"
]
},
{
"$ref": "#/refs/expr",
"required": [
"expr"
]
},
{
"properties": {
"value": {}
},
"required": [
"value"
]
},
{
"properties": {
"field": {
"$ref": "#/refs/field"
}
},
"required": [
"field"
]
},
{
"properties": {
"range": {
"type": [
"number",
"boolean"
]
}
},
"required": [
"range"
]
}
]
},
{
"required": [
"band"
]
},
{
"required": [
"offset"
]
}
]
}
]
}
]
}
},
{
"type": "object",
"allOf": [
{
"$ref": "#/refs/stringModifiers"
},
{
"anyOf": [
{
"oneOf": [
{
"$ref": "#/refs/signal",
"required": [
"signal"
]
},
{
"$ref": "#/refs/expr",
"required": [
"expr"
]
},
{
"properties": {
"value": {}
},
"required": [
"value"
]
},
{
"properties": {
"field": {
"$ref": "#/refs/field"
}
},
"required": [
"field"
]
},
{
"properties": {
"range": {
"type": [
"number",
"boolean"
]
}
},
"required": [
"range"
]
}
]
},
{
"required": [
"band"
]
},
{
"required": [
"offset"
]
}
]
}
]
}
]
},
"url": {
"$ref": "#/refs/stringValue"
},
"align": {
"oneOf": [
{
"type": "array",
"items": {
"allOf": [
{
"$ref": "#/defs/rule"
},
{
"type": "object",
"allOf": [
{
"$ref": "#/refs/stringModifiers"
},
{
"anyOf": [
{
"oneOf": [
{
"$ref": "#/refs/signal",
"required": [
"signal"
]
},
{
"$ref": "#/refs/expr",
"required": [
"expr"
]
},
{
"properties": {
"value": {}
},
"required": [
"value"
]
},
{
"properties": {
"field": {
"$ref": "#/refs/field"
}
},
"required": [
"field"
]
},
{
"properties": {
"range": {
"type": [
"number",
"boolean"
]
}
},
"required": [
"range"
]
}
]
},
{
"required": [
"band"
]
},
{
"required": [
"offset"
]
}
]
}
]
}
]
}
},
{
"type": "object",
"allOf": [
{
"$ref": "#/refs/stringModifiers"
},
{
"anyOf": [
{
"oneOf": [
{
"$ref": "#/refs/signal",
"required": [
"signal"
]
},
{
"$ref": "#/refs/expr",
"required": [
"expr"
]
},
{
"properties": {
"value": {}
},
"required": [
"value"
]
},
{
"properties": {
"field": {
"$ref": "#/refs/field"
}
},
"required": [
"field"
]
},
{
"properties": {
"range": {
"type": [
"number",
"boolean"
]
}
},
"required": [
"range"
]
}
]
},
{
"required": [
"band"
]
},
{
"required": [
"offset"
]
}
]
}
]
}
]
},
"baseline": {
"oneOf": [
{
"type": "array",
"items": {
"allOf": [
{
"$ref": "#/defs/rule"
},
{
"type": "object",
"allOf": [
{
"$ref": "#/refs/stringModifiers"
},
{
"anyOf": [
{
"oneOf": [
{
"$ref": "#/refs/signal",
"required": [
"signal"
]
},
{
"$ref": "#/refs/expr",
"required": [
"expr"
]
},
{
"properties": {
"value": {}
},
"required": [
"value"
]
},
{
"properties": {
"field": {
"$ref": "#/refs/field"
}
},
"required": [
"field"
]
},
{
"properties": {
"range": {
"type": [
"number",
"boolean"
]
}
},
"required": [
"range"
]
}
]
},
{
"required": [
"band"
]
},
{
"required": [
"offset"
]
}
]
}
]
}
]
}
},
{
"type": "object",
"allOf": [
{
"$ref": "#/refs/stringModifiers"
},
{
"anyOf": [
{
"oneOf": [
{
"$ref": "#/refs/signal",
"required": [
"signal"
]
},
{
"$ref": "#/refs/expr",
"required": [
"expr"
]
},
{
"properties": {
"value": {}
},
"required": [
"value"
]
},
{
"properties": {
"field": {
"$ref": "#/refs/field"
}
},
"required": [
"field"
]
},
{
"properties": {
"range": {
"type": [
"number",
"boolean"
]
}
},
"required": [
"range"
]
}
]
},
{
"required": [
"band"
]
},
{
"required": [
"offset"
]
}
]
}
]
}
]
},
"text": {
"$ref": "#/refs/stringValue"
},
"dx": {
"$ref": "#/refs/numberValue"
},
"dy": {
"$ref": "#/refs/numberValue"
},
"radius": {
"$ref": "#/refs/numberValue"
},
"theta": {
"$ref": "#/refs/numberValue"
},
"angle": {
"$ref": "#/refs/numberValue"
},
"font": {
"$ref": "#/refs/stringValue"
},
"fontSize": {
"$ref": "#/refs/numberValue"
},
"fontWeight": {
"$ref": "#/refs/stringValue"
},
"fontStyle": {
"$ref": "#/refs/stringValue"
}
},
"additionalProperties": true
},
"encode": {
"type": "object",
"patternProperties": {
"^.+$": {
"$ref": "#/defs/encodeEntry"
}
},
"additionalProperties": false
},
"guideEncode": {
"type": "object",
"properties": {
"interactive": {
"type": "boolean",
"default": false
}
},
"patternProperties": {
"^(?!interactive).+$": {
"$ref": "#/defs/encodeEntry"
}
},
"additionalProperties": false
},
"legend": {
"type": "object",
"properties": {
"size": {
"type": "string"
},
"shape": {
"type": "string"
},
"fill": {
"type": "string"
},
"stroke": {
"type": "string"
},
"opacity": {
"type": "string"
},
"type": {
"enum": [
"gradient",
"symbol"
],
"default": "symbol"
},
"orient": {
"enum": [
"left",
"right",
"top-left",
"top-right",
"bottom-left",
"bottom-right"
],
"default": "right"
},
"title": {
"type": "string"
},
"zindex": {
"type": "number"
},
"interactive": {
"type": "boolean"
},
"offset": {
"oneOf": [
{
"type": "number"
},
{
"$ref": "#/refs/numberValue"
}
]
},
"padding": {
"oneOf": [
{
"type": "number"
},
{
"$ref": "#/refs/numberValue"
}
]
},
"titlePadding": {
"oneOf": [
{
"type": "number"
},
{
"$ref": "#/refs/numberValue"
}
]
},
"entryPadding": {
"oneOf": [
{
"type": "number"
},
{
"$ref": "#/refs/numberValue"
}
]
},
"count": {
"oneOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
},
"format": {
"oneOf": [
{
"type": "string"
},
{
"$ref": "#/refs/signal"
}
]
},
"values": {
"oneOf": [
{
"type": "array"
},
{
"$ref": "#/refs/signal"
}
]
},
"encode": {
"type": "object",
"properties": {
"title": {
"$ref": "#/defs/guideEncode"
},
"labels": {
"$ref": "#/defs/guideEncode"
},
"legend": {
"$ref": "#/defs/guideEncode"
},
"symbols": {
"$ref": "#/defs/guideEncode"
},
"gradient": {
"$ref": "#/defs/guideEncode"
}
},
"additionalProperties": false
}
},
"additionalProperties": false,
"anyOf": [
{
"required": [
"size"
]
},
{
"required": [
"shape"
]
},
{
"required": [
"fill"
]
},
{
"required": [
"stroke"
]
},
{
"required": [
"opacity"
]
}
]
},
"mark": {
"type": "object",
"properties": {
"type": {
"$ref": "#/refs/marktype"
},
"name": {
"type": "string"
},
"key": {
"type": "string"
},
"interactive": {
"type": "boolean"
},
"encode": {
"$ref": "#/defs/encode"
},
"transform": {
"type": "array",
"items": {
"$ref": "#/defs/transformMark"
}
},
"on": {
"$ref": "#/defs/onMarkTrigger"
}
},
"required": [
"type"
]
},
"markGroup": {
"allOf": [
{
"properties": {
"type": {
"enum": [
"group"
]
}
},
"required": [
"type"
]
},
{
"$ref": "#/defs/mark"
},
{
"$ref": "#/defs/scope"
},
{
"type": "object",
"properties": {
"from": {
"oneOf": [
{
"$ref": "#/refs/from"
},
{
"$ref": "#/refs/facet"
}
]
}
}
}
]
},
"markVisual": {
"allOf": [
{
"not": {
"properties": {
"type": {
"enum": [
"group"
]
}
}
}
},
{
"$ref": "#/defs/mark"
},
{
"type": "object",
"properties": {
"from": {
"$ref": "#/refs/from"
}
}
}
]
},
"onEvents": {
"type": "array",
"items": {
"allOf": [
{
"type": "object",
"properties": {
"events": {
"oneOf": [
{
"$ref": "#/refs/selector"
},
{
"$ref": "#/refs/signal"
},
{
"$ref": "#/defs/stream"
},
{
"type": "array",
"items": {
"$ref": "#/defs/stream"
}
}
]
},
"force": {
"type": "boolean"
}
},
"required": [
"events"
]
},
{
"oneOf": [
{
"type": "object",
"properties": {
"encode": {
"type": "string"
}
},
"required": [
"encode"
]
},
{
"type": "object",
"properties": {
"update": {
"oneOf": [
{
"$ref": "#/refs/exprString"
},
{
"$ref": "#/refs/expr",
"additionalProperties": false
},
{
"$ref": "#/refs/signal"
},
{
"type": "object",
"properties": {
"value": {}
},
"required": [
"value"
]
}
]
}
},
"required": [
"update"
]
}
]
}
]
}
},
"onTrigger": {
"type": "array",
"items": {
"type": "object",
"properties": {
"trigger": {
"$ref": "#/refs/exprString"
},
"insert": {
"$ref": "#/refs/exprString"
},
"remove": {
"oneOf": [
{
"type": "boolean"
},
{
"$ref": "#/refs/exprString"
}
]
},
"modify": {
"$ref": "#/refs/exprString"
},
"values": {
"$ref": "#/refs/exprString"
}
},
"required": [
"trigger"
]
}
},
"onMarkTrigger": {
"type": "array",
"items": {
"type": "object",
"properties": {
"trigger": {
"$ref": "#/refs/exprString"
},
"modify": {
"$ref": "#/refs/exprString"
},
"values": {
"$ref": "#/refs/exprString"
}
},
"required": [
"trigger"
]
}
},
"padding": {
"oneOf": [
{
"type": "number"
},
{
"type": "object",
"properties": {
"top": {
"type": "number"
},
"bottom": {
"type": "number"
},
"left": {
"type": "number"
},
"right": {
"type": "number"
}
},
"additionalProperties": false
}
]
},
"scale": {
"title": "Scale mapping",
"type": "object",
"allOf": [
{
"properties": {
"name": {
"type": "string"
},
"type": {
"type": "string",
"default": "linear"
},
"domain": {
"oneOf": [
{
"type": "array",
"items": {
"oneOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"$ref": "#/refs/signal"
}
]
}
},
{
"$ref": "#/refs/scaleData"
},
{
"$ref": "#/refs/signal"
}
]
},
"domainMin": {
"oneOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
},
"domainMax": {
"oneOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
},
"reverse": {
"oneOf": [
{
"type": "boolean"
},
{
"$ref": "#/refs/signal"
}
]
},
"round": {
"oneOf": [
{
"type": "boolean"
},
{
"$ref": "#/refs/signal"
}
]
}
},
"required": [
"name"
]
},
{
"oneOf": [
{
"properties": {
"type": {
"enum": [
"ordinal"
]
},
"range": {
"oneOf": [
{
"enum": [
"width",
"height",
"shapes",
"category"
]
},
{
"type": "array",
"items": {
"oneOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
}
},
{
"$ref": "#/refs/signal"
},
{
"$ref": "#/refs/scaleData"
}
]
},
"scheme": {
"$ref": "#/refs/scaleScheme"
}
},
"required": [
"type"
]
},
{
"properties": {
"type": {
"enum": [
"band",
"point"
]
},
"range": {
"oneOf": [
{
"enum": [
"width",
"height",
"shapes",
"category"
]
},
{
"type": "array",
"items": {
"oneOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
}
},
{
"$ref": "#/refs/signal"
}
]
},
"padding": {
"oneOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
},
"paddingInner": {
"oneOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
},
"paddingOuter": {
"oneOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
},
"align": {
"oneOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
},
"bandSize": {
"oneOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
}
},
"required": [
"type"
]
},
{
"properties": {
"type": {
"enum": [
"sequential"
]
},
"scheme": {
"$ref": "#/refs/scaleScheme"
},
"clamp": {
"oneOf": [
{
"type": "boolean"
},
{
"$ref": "#/refs/signal"
}
]
}
},
"required": [
"type"
]
},
{
"properties": {
"type": {
"enum": [
"time",
"utc"
]
},
"range": {
"oneOf": [
{
"enum": [
"width",
"height",
"shapes",
"category"
]
},
{
"type": "array",
"items": {
"oneOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
}
},
{
"$ref": "#/refs/signal"
}
]
},
"clamp": {
"oneOf": [
{
"type": "boolean"
},
{
"$ref": "#/refs/signal"
}
]
},
"nice": {
"oneOf": [
{
"type": "boolean"
},
{
"enum": [
"second",
"minute",
"hour",
"day",
"week",
"month",
"year"
]
},
{
"$ref": "#/refs/signal"
}
]
}
},
"required": [
"type"
]
},
{
"properties": {
"type": {
"enum": [
"identity"
]
},
"nice": {
"oneOf": [
{
"type": "boolean"
},
{
"$ref": "#/refs/signal"
}
]
}
},
"required": [
"type"
]
},
{
"properties": {
"type": {
"enum": [
"quantile",
"quantize",
"threshold"
]
},
"range": {
"oneOf": [
{
"enum": [
"width",
"height",
"shapes",
"category"
]
},
{
"type": "array",
"items": {
"oneOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
}
},
{
"$ref": "#/refs/signal"
}
]
}
},
"required": [
"type"
]
},
{
"description": "Default numeric scale",
"not": {
"properties": {
"type": {
"enum": [
"ordinal",
"index",
"band",
"point",
"quantile",
"quantize",
"threshold",
"sequential",
"pow",
"time",
"utc",
"identity"
]
}
},
"required": [
"type"
]
},
"properties": {
"range": {
"oneOf": [
{
"enum": [
"width",
"height",
"shapes",
"category"
]
},
{
"type": "array",
"items": {
"oneOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
}
},
{
"$ref": "#/refs/signal"
}
]
},
"clamp": {
"oneOf": [
{
"type": "boolean"
},
{
"$ref": "#/refs/signal"
}
]
},
"nice": {
"oneOf": [
{
"type": "boolean"
},
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
},
"zero": {
"oneOf": [
{
"type": "boolean"
},
{
"$ref": "#/refs/signal"
}
]
}
}
},
{
"properties": {
"type": {
"enum": [
"pow"
]
},
"range": {
"oneOf": [
{
"enum": [
"width",
"height",
"shapes",
"category"
]
},
{
"type": "array",
"items": {
"oneOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
}
},
{
"$ref": "#/refs/signal"
}
]
},
"clamp": {
"oneOf": [
{
"type": "boolean"
},
{
"$ref": "#/refs/signal"
}
]
},
"exponent": {
"oneOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
},
"nice": {
"oneOf": [
{
"type": "boolean"
},
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
},
"zero": {
"oneOf": [
{
"type": "boolean"
},
{
"$ref": "#/refs/signal"
}
]
}
},
"required": [
"type"
]
},
{
"allOf": [
{
"properties": {
"type": {
"enum": [
"index"
]
},
"clamp": {
"oneOf": [
{
"type": "boolean"
},
{
"$ref": "#/refs/signal"
}
]
}
},
"required": [
"type",
"scheme"
]
},
{
"oneOf": [
{
"properties": {
"range": {
"oneOf": [
{
"enum": [
"width",
"height",
"shapes",
"category"
]
},
{
"type": "array",
"items": {
"oneOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
}
},
{
"$ref": "#/refs/signal"
}
]
}
},
"required": [
"range"
]
},
{
"properties": {
"scheme": {
"$ref": "#/refs/scaleScheme"
}
},
"required": [
"scheme"
]
}
]
}
]
}
]
}
]
},
"scope": {
"type": "object",
"properties": {
"encode": {
"$ref": "#/defs/encode"
},
"signals": {
"type": "array",
"items": {
"$ref": "#/defs/signal"
}
},
"data": {
"type": "array",
"items": {
"$ref": "#/defs/data"
}
},
"scales": {
"type": "array",
"items": {
"$ref": "#/defs/scale"
}
},
"axes": {
"type": "array",
"items": {
"$ref": "#/defs/axis"
}
},
"legends": {
"type": "array",
"items": {
"$ref": "#/defs/legend"
}
},
"marks": {
"type": "array",
"items": {
"oneOf": [
{
"$ref": "#/defs/markGroup"
},
{
"$ref": "#/defs/markVisual"
}
]
}
}
}
},
"signal": {
"type": "object",
"properties": {
"name": {
"type": "string",
"not": {
"enum": [
"parent"
]
}
},
"description": {
"type": "string"
},
"value": {},
"react": {
"type": "boolean",
"default": true
},
"update": {
"$ref": "#/defs/exprString"
},
"on": {
"$ref": "#/defs/onEvents"
},
"bind": {
"$ref": "#/defs/bind"
}
},
"additionalProperties": false,
"required": [
"name"
]
},
"spec": {
"title": "Vega visualization specification",
"type": "object",
"allOf": [
{
"$ref": "#/defs/scope"
},
{
"properties": {
"version": {
"type": "string"
},
"description": {
"type": "string"
},
"width": {
"type": "number"
},
"height": {
"type": "number"
},
"padding": {
"$ref": "#/defs/padding"
},
"autosize": {
"$ref": "#/defs/autosize"
},
"background": {
"$ref": "#/defs/background"
}
}
}
]
},
"streamParams": {
"properties": {
"between": {
"type": "array",
"minItems": 2,
"maxItems": 2,
"items": {
"$ref": "#/defs/stream"
}
},
"marktype": {
"type": "string"
},
"markname": {
"type": "string"
},
"filter": {
"oneOf": [
{
"$ref": "#/defs/exprString"
},
{
"type": "array",
"minItems": 1,
"items": {
"$ref": "#/defs/exprString"
}
}
]
},
"throttle": {
"type": "number"
},
"debounce": {
"type": "number"
},
"consume": {
"type": "boolean"
}
}
},
"streamEvents": {
"properties": {
"source": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"type"
]
},
"stream": {
"title": "Input event stream definition",
"type": "object",
"allOf": [
{
"$ref": "#/defs/streamParams"
},
{
"oneOf": [
{
"$ref": "#/defs/streamEvents"
},
{
"type": "object",
"properties": {
"stream": {
"$ref": "#/defs/stream"
}
},
"required": [
"stream"
]
},
{
"type": "object",
"properties": {
"merge": {
"type": "array",
"minItems": 1,
"items": {
"$ref": "#/defs/stream"
}
}
},
"required": [
"merge"
]
}
]
}
]
},
"transform": {
"oneOf": [
{
"$ref": "#/defs/aggregateTransform"
},
{
"$ref": "#/defs/binTransform"
},
{
"$ref": "#/defs/collectTransform"
},
{
"$ref": "#/defs/countpatternTransform"
},
{
"$ref": "#/defs/crossTransform"
},
{
"$ref": "#/defs/extentTransform"
},
{
"$ref": "#/defs/filterTransform"
},
{
"$ref": "#/defs/foldTransform"
},
{
"$ref": "#/defs/formulaTransform"
},
{
"$ref": "#/defs/imputeTransform"
},
{
"$ref": "#/defs/lookupTransform"
},
{
"$ref": "#/defs/rangeTransform"
},
{
"$ref": "#/defs/rankTransform"
},
{
"$ref": "#/defs/sampleTransform"
},
{
"$ref": "#/defs/geopathTransform"
},
{
"$ref": "#/defs/geopointTransform"
},
{
"$ref": "#/defs/geoshapeTransform"
},
{
"$ref": "#/defs/graticuleTransform"
},
{
"$ref": "#/defs/linkpathTransform"
},
{
"$ref": "#/defs/pieTransform"
},
{
"$ref": "#/defs/stackTransform"
},
{
"$ref": "#/defs/forceTransform"
},
{
"$ref": "#/defs/nestTransform"
},
{
"$ref": "#/defs/stratifyTransform"
},
{
"$ref": "#/defs/treelinksTransform"
},
{
"$ref": "#/defs/packTransform"
},
{
"$ref": "#/defs/partitionTransform"
},
{
"$ref": "#/defs/treeTransform"
},
{
"$ref": "#/defs/treemapTransform"
},
{
"$ref": "#/defs/voronoiTransform"
},
{
"$ref": "#/defs/wordcloudTransform"
},
{
"$ref": "#/defs/crossfilterTransform"
},
{
"$ref": "#/defs/resolvefilterTransform"
}
]
},
"transformMark": {
"oneOf": [
{
"$ref": "#/defs/binTransform"
},
{
"$ref": "#/defs/collectTransform"
},
{
"$ref": "#/defs/extentTransform"
},
{
"$ref": "#/defs/formulaTransform"
},
{
"$ref": "#/defs/lookupTransform"
},
{
"$ref": "#/defs/rankTransform"
},
{
"$ref": "#/defs/geopathTransform"
},
{
"$ref": "#/defs/geopointTransform"
},
{
"$ref": "#/defs/geoshapeTransform"
},
{
"$ref": "#/defs/linkpathTransform"
},
{
"$ref": "#/defs/pieTransform"
},
{
"$ref": "#/defs/stackTransform"
},
{
"$ref": "#/defs/forceTransform"
},
{
"$ref": "#/defs/nestTransform"
},
{
"$ref": "#/defs/stratifyTransform"
},
{
"$ref": "#/defs/packTransform"
},
{
"$ref": "#/defs/partitionTransform"
},
{
"$ref": "#/defs/treeTransform"
},
{
"$ref": "#/defs/treemapTransform"
},
{
"$ref": "#/defs/voronoiTransform"
},
{
"$ref": "#/defs/wordcloudTransform"
},
{
"$ref": "#/defs/crossfilterTransform"
},
{
"$ref": "#/defs/resolvefilterTransform"
}
]
},
"aggregateTransform": {
"type": "object",
"properties": {
"type": {
"enum": [
"aggregate"
]
},
"signal": {
"type": "string"
},
"groupby": {
"oneOf": [
{
"type": "array",
"items": {
"oneOf": [
{
"$ref": "#/refs/scaleField"
},
{
"$ref": "#/refs/paramField"
}
]
}
},
{
"$ref": "#/refs/signal"
}
]
},
"fields": {
"oneOf": [
{
"type": "array",
"items": {
"oneOf": [
{
"$ref": "#/refs/scaleField"
},
{
"$ref": "#/refs/paramField"
}
]
}
},
{
"$ref": "#/refs/signal"
}
]
},
"ops": {
"oneOf": [
{
"type": "array",
"items": {
"anyOf": [
{
"enum": [
"count",
"valid",
"missing",
"distinct",
"sum",
"mean",
"average",
"variance",
"variancep",
"stdev",
"stdevp",
"median",
"q1",
"q3",
"modeskew",
"min",
"max",
"argmin",
"argmax"
]
},
{
"$ref": "#/refs/signal"
}
]
}
},
{
"$ref": "#/refs/signal"
}
]
},
"as": {
"oneOf": [
{
"type": "array",
"items": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/refs/signal"
}
]
}
},
{
"$ref": "#/refs/signal"
}
]
},
"drop": {
"anyOf": [
{
"type": "boolean"
},
{
"$ref": "#/refs/signal"
}
],
"default": true
},
"key": {
"oneOf": [
{
"$ref": "#/refs/scaleField"
},
{
"$ref": "#/refs/paramField"
}
]
}
},
"additionalProperties": false,
"required": [
"type"
]
},
"binTransform": {
"type": "object",
"properties": {
"type": {
"enum": [
"bin"
]
},
"signal": {
"type": "string"
},
"field": {
"oneOf": [
{
"$ref": "#/refs/scaleField"
},
{
"$ref": "#/refs/paramField"
}
]
},
"maxbins": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
],
"default": 20
},
"base": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
],
"default": 10
},
"divide": {
"oneOf": [
{
"type": "array",
"items": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
}
},
{
"$ref": "#/refs/signal"
}
],
"default": [
5,
2
]
},
"extent": {
"oneOf": [
{
"type": "array",
"items": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
}
},
{
"$ref": "#/refs/signal"
}
],
"maxItems": 2,
"minItems": 2
},
"step": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
},
"steps": {
"oneOf": [
{
"type": "array",
"items": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
}
},
{
"$ref": "#/refs/signal"
}
]
},
"minstep": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
},
"nice": {
"anyOf": [
{
"type": "boolean"
},
{
"$ref": "#/refs/signal"
}
],
"default": true
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/refs/signal"
}
]
},
"as": {
"oneOf": [
{
"type": "array",
"items": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/refs/signal"
}
]
}
},
{
"$ref": "#/refs/signal"
}
],
"maxItems": 2,
"minItems": 2,
"default": [
"bin0",
"bin1"
]
}
},
"additionalProperties": false,
"required": [
"type",
"field",
"extent"
]
},
"collectTransform": {
"type": "object",
"properties": {
"type": {
"enum": [
"collect"
]
},
"signal": {
"type": "string"
},
"sort": {
"type": "object",
"properties": {
"oneOf": [
{
"field": {
"oneOf": [
{
"type": "string"
},
{
"$ref": "#/refs/signal"
}
]
},
"order": {
"$ref": "#/refs/sortOrder"
}
},
{
"field": {
"type": "array",
"items": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/refs/signal"
}
]
}
},
"order": {
"type": "array",
"items": {
"$ref": "#/refs/sortOrder"
}
}
}
]
}
}
},
"additionalProperties": false,
"required": [
"type"
]
},
"countpatternTransform": {
"type": "object",
"properties": {
"type": {
"enum": [
"countpattern"
]
},
"signal": {
"type": "string"
},
"field": {
"oneOf": [
{
"$ref": "#/refs/scaleField"
},
{
"$ref": "#/refs/paramField"
}
]
},
"case": {
"anyOf": [
{
"enum": [
"upper",
"lower",
"mixed"
]
},
{
"$ref": "#/refs/signal"
}
],
"default": "mixed"
},
"pattern": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/refs/signal"
}
],
"default": "[\\w\"]+"
},
"stopwords": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/refs/signal"
}
]
},
"as": {
"oneOf": [
{
"type": "array",
"items": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/refs/signal"
}
]
}
},
{
"$ref": "#/refs/signal"
}
],
"maxItems": 2,
"minItems": 2,
"default": [
"text",
"count"
]
}
},
"additionalProperties": false,
"required": [
"type",
"field"
]
},
"crossTransform": {
"type": "object",
"properties": {
"type": {
"enum": [
"cross"
]
},
"signal": {
"type": "string"
},
"filter": {
"$ref": "#/refs/exprString"
},
"as": {
"oneOf": [
{
"type": "array",
"items": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/refs/signal"
}
]
}
},
{
"$ref": "#/refs/signal"
}
],
"maxItems": 2,
"minItems": 2,
"default": [
"a",
"b"
]
}
},
"additionalProperties": false,
"required": [
"type"
]
},
"extentTransform": {
"type": "object",
"properties": {
"type": {
"enum": [
"extent"
]
},
"signal": {
"type": "string"
},
"field": {
"oneOf": [
{
"$ref": "#/refs/scaleField"
},
{
"$ref": "#/refs/paramField"
}
]
}
},
"additionalProperties": false,
"required": [
"type",
"field"
]
},
"filterTransform": {
"type": "object",
"properties": {
"type": {
"enum": [
"filter"
]
},
"signal": {
"type": "string"
},
"expr": {
"$ref": "#/refs/exprString"
}
},
"additionalProperties": false,
"required": [
"type",
"expr"
]
},
"foldTransform": {
"type": "object",
"properties": {
"type": {
"enum": [
"fold"
]
},
"signal": {
"type": "string"
},
"fields": {
"oneOf": [
{
"type": "array",
"items": {
"oneOf": [
{
"$ref": "#/refs/scaleField"
},
{
"$ref": "#/refs/paramField"
}
]
}
},
{
"$ref": "#/refs/signal"
}
]
},
"as": {
"oneOf": [
{
"type": "array",
"items": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/refs/signal"
}
]
}
},
{
"$ref": "#/refs/signal"
}
],
"maxItems": 2,
"minItems": 2,
"default": [
"key",
"value"
]
}
},
"additionalProperties": false,
"required": [
"type",
"fields"
]
},
"formulaTransform": {
"type": "object",
"properties": {
"type": {
"enum": [
"formula"
]
},
"signal": {
"type": "string"
},
"expr": {
"$ref": "#/refs/exprString"
},
"as": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/refs/signal"
}
]
}
},
"additionalProperties": false,
"required": [
"type",
"expr",
"as"
]
},
"imputeTransform": {
"type": "object",
"properties": {
"type": {
"enum": [
"impute"
]
},
"signal": {
"type": "string"
},
"field": {
"oneOf": [
{
"$ref": "#/refs/scaleField"
},
{
"$ref": "#/refs/paramField"
}
]
},
"groupby": {
"oneOf": [
{
"type": "array",
"items": {
"oneOf": [
{
"$ref": "#/refs/scaleField"
},
{
"$ref": "#/refs/paramField"
}
]
}
},
{
"$ref": "#/refs/signal"
}
]
},
"orderby": {
"oneOf": [
{
"type": "array",
"items": {
"oneOf": [
{
"$ref": "#/refs/scaleField"
},
{
"$ref": "#/refs/paramField"
}
]
}
},
{
"$ref": "#/refs/signal"
}
]
},
"method": {
"anyOf": [
{
"enum": [
"value",
"mean",
"median",
"max",
"min"
]
},
{
"$ref": "#/refs/signal"
}
],
"default": "value"
},
"value": {}
},
"additionalProperties": false,
"required": [
"type",
"field"
]
},
"lookupTransform": {
"type": "object",
"properties": {
"type": {
"enum": [
"lookup"
]
},
"signal": {
"type": "string"
},
"from": {
"type": "string"
},
"key": {
"oneOf": [
{
"$ref": "#/refs/scaleField"
},
{
"$ref": "#/refs/paramField"
}
]
},
"fields": {
"oneOf": [
{
"type": "array",
"items": {
"oneOf": [
{
"$ref": "#/refs/scaleField"
},
{
"$ref": "#/refs/paramField"
}
]
}
},
{
"$ref": "#/refs/signal"
}
]
},
"as": {
"oneOf": [
{
"type": "array",
"items": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/refs/signal"
}
]
}
},
{
"$ref": "#/refs/signal"
}
]
},
"default": {}
},
"additionalProperties": false,
"required": [
"type",
"from",
"key",
"fields",
"as"
]
},
"rangeTransform": {
"type": "object",
"properties": {
"type": {
"enum": [
"range"
]
},
"signal": {
"type": "string"
},
"start": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
},
"stop": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
},
"step": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
],
"default": 1
}
},
"additionalProperties": false,
"required": [
"type",
"start",
"stop"
]
},
"rankTransform": {
"type": "object",
"properties": {
"type": {
"enum": [
"rank"
]
},
"signal": {
"type": "string"
},
"field": {
"oneOf": [
{
"$ref": "#/refs/scaleField"
},
{
"$ref": "#/refs/paramField"
}
]
},
"normalize": {
"anyOf": [
{
"type": "boolean"
},
{
"$ref": "#/refs/signal"
}
]
},
"as": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/refs/signal"
}
],
"default": "rank"
}
},
"additionalProperties": false,
"required": [
"type"
]
},
"sampleTransform": {
"type": "object",
"properties": {
"type": {
"enum": [
"sample"
]
},
"signal": {
"type": "string"
},
"size": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
],
"default": 1000
}
},
"additionalProperties": false,
"required": [
"type"
]
},
"geopathTransform": {
"type": "object",
"properties": {
"type": {
"enum": [
"geopath"
]
},
"signal": {
"type": "string"
},
"projection": {
"type": "string"
},
"pointRadius": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
},
"field": {
"oneOf": [
{
"$ref": "#/refs/scaleField"
},
{
"$ref": "#/refs/paramField"
}
]
},
"as": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/refs/signal"
}
],
"default": "path"
}
},
"additionalProperties": false,
"required": [
"type",
"projection"
]
},
"geopointTransform": {
"type": "object",
"properties": {
"type": {
"enum": [
"geopoint"
]
},
"signal": {
"type": "string"
},
"projection": {
"type": "string"
},
"fields": {
"oneOf": [
{
"type": "array",
"items": {
"oneOf": [
{
"$ref": "#/refs/scaleField"
},
{
"$ref": "#/refs/paramField"
}
]
}
},
{
"$ref": "#/refs/signal"
}
],
"maxItems": 2,
"minItems": 2
},
"as": {
"oneOf": [
{
"type": "array",
"items": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/refs/signal"
}
]
}
},
{
"$ref": "#/refs/signal"
}
],
"maxItems": 2,
"minItems": 2,
"default": [
"x",
"y"
]
}
},
"additionalProperties": false,
"required": [
"type",
"projection",
"fields"
]
},
"geoshapeTransform": {
"type": "object",
"properties": {
"type": {
"enum": [
"geoshape"
]
},
"signal": {
"type": "string"
},
"projection": {
"type": "string"
},
"pointRadius": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
},
"field": {
"oneOf": [
{
"$ref": "#/refs/scaleField"
},
{
"$ref": "#/refs/paramField"
}
],
"default": "datum"
},
"as": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/refs/signal"
}
],
"default": "shape"
}
},
"additionalProperties": false,
"required": [
"type",
"projection"
]
},
"graticuleTransform": {
"type": "object",
"properties": {
"type": {
"enum": [
"graticule"
]
},
"signal": {
"type": "string"
},
"extent": {
"oneOf": [
{
"type": "array",
"items": {}
},
{
"$ref": "#/refs/signal"
}
],
"maxItems": 2,
"minItems": 2
},
"extentMajor": {
"oneOf": [
{
"type": "array",
"items": {}
},
{
"$ref": "#/refs/signal"
}
],
"maxItems": 2,
"minItems": 2
},
"extentMinor": {
"oneOf": [
{
"type": "array",
"items": {}
},
{
"$ref": "#/refs/signal"
}
],
"maxItems": 2,
"minItems": 2
},
"step": {
"oneOf": [
{
"type": "array",
"items": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
}
},
{
"$ref": "#/refs/signal"
}
],
"maxItems": 2,
"minItems": 2
},
"stepMajor": {
"oneOf": [
{
"type": "array",
"items": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
}
},
{
"$ref": "#/refs/signal"
}
],
"maxItems": 2,
"minItems": 2,
"default": [
90,
360
]
},
"stepMinor": {
"oneOf": [
{
"type": "array",
"items": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
}
},
{
"$ref": "#/refs/signal"
}
],
"maxItems": 2,
"minItems": 2,
"default": [
10,
10
]
},
"precision": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
],
"default": 2.5
}
},
"additionalProperties": false,
"required": [
"type"
]
},
"linkpathTransform": {
"type": "object",
"properties": {
"type": {
"enum": [
"linkpath"
]
},
"signal": {
"type": "string"
},
"sourceX": {
"oneOf": [
{
"$ref": "#/refs/scaleField"
},
{
"$ref": "#/refs/paramField"
}
],
"default": "source.x"
},
"sourceY": {
"oneOf": [
{
"$ref": "#/refs/scaleField"
},
{
"$ref": "#/refs/paramField"
}
],
"default": "source.y"
},
"targetX": {
"oneOf": [
{
"$ref": "#/refs/scaleField"
},
{
"$ref": "#/refs/paramField"
}
],
"default": "target.x"
},
"targetY": {
"oneOf": [
{
"$ref": "#/refs/scaleField"
},
{
"$ref": "#/refs/paramField"
}
],
"default": "target.y"
},
"orient": {
"anyOf": [
{
"enum": [
"horizontal",
"vertical",
"radial"
]
},
{
"$ref": "#/refs/signal"
}
],
"default": "vertical"
},
"shape": {
"anyOf": [
{
"enum": [
"line",
"curve",
"diagonal",
"orthogonal"
]
},
{
"$ref": "#/refs/signal"
}
],
"default": "line"
},
"as": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/refs/signal"
}
],
"default": "path"
}
},
"additionalProperties": false,
"required": [
"type"
]
},
"pieTransform": {
"type": "object",
"properties": {
"type": {
"enum": [
"pie"
]
},
"signal": {
"type": "string"
},
"field": {
"oneOf": [
{
"$ref": "#/refs/scaleField"
},
{
"$ref": "#/refs/paramField"
}
]
},
"startAngle": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
},
"endAngle": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
],
"default": 6.283185307179586
},
"sort": {
"anyOf": [
{
"type": "boolean"
},
{
"$ref": "#/refs/signal"
}
]
},
"as": {
"oneOf": [
{
"type": "array",
"items": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/refs/signal"
}
]
}
},
{
"$ref": "#/refs/signal"
}
],
"maxItems": 2,
"minItems": 2,
"default": [
"startAngle",
"endAngle"
]
}
},
"additionalProperties": false,
"required": [
"type"
]
},
"stackTransform": {
"type": "object",
"properties": {
"type": {
"enum": [
"stack"
]
},
"signal": {
"type": "string"
},
"field": {
"oneOf": [
{
"$ref": "#/refs/scaleField"
},
{
"$ref": "#/refs/paramField"
}
]
},
"groupby": {
"oneOf": [
{
"type": "array",
"items": {
"oneOf": [
{
"$ref": "#/refs/scaleField"
},
{
"$ref": "#/refs/paramField"
}
]
}
},
{
"$ref": "#/refs/signal"
}
]
},
"sort": {
"type": "object",
"properties": {
"oneOf": [
{
"field": {
"oneOf": [
{
"type": "string"
},
{
"$ref": "#/refs/signal"
}
]
},
"order": {
"$ref": "#/refs/sortOrder"
}
},
{
"field": {
"type": "array",
"items": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/refs/signal"
}
]
}
},
"order": {
"type": "array",
"items": {
"$ref": "#/refs/sortOrder"
}
}
}
]
}
},
"offset": {
"anyOf": [
{
"enum": [
"zero",
"center",
"normalize"
]
},
{
"$ref": "#/refs/signal"
}
],
"default": "zero"
},
"as": {
"oneOf": [
{
"type": "array",
"items": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/refs/signal"
}
]
}
},
{
"$ref": "#/refs/signal"
}
],
"maxItems": 2,
"minItems": 2,
"default": [
"y0",
"y1"
]
}
},
"additionalProperties": false,
"required": [
"type"
]
},
"forceTransform": {
"type": "object",
"properties": {
"type": {
"enum": [
"force"
]
},
"signal": {
"type": "string"
},
"static": {
"anyOf": [
{
"type": "boolean"
},
{
"$ref": "#/refs/signal"
}
]
},
"restart": {
"anyOf": [
{
"type": "boolean"
},
{
"$ref": "#/refs/signal"
}
]
},
"iterations": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
],
"default": 300
},
"alpha": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
],
"default": 1
},
"alphaMin": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
],
"default": 0.001
},
"alphaTarget": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
},
"drag": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
],
"default": 0.6
},
"forces": {
"type": "array",
"items": {
"oneOf": [
{
"type": "object",
"properties": {
"force": {
"enum": [
"center"
]
},
"x": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
},
"y": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
}
},
"additionalProperties": false,
"required": [
"force"
]
},
{
"type": "object",
"properties": {
"force": {
"enum": [
"collide"
]
},
"radius": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
},
{
"$ref": "#/refs/expr"
},
{
"$ref": "#/refs/paramField"
}
]
},
"strength": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
],
"default": 0.7
},
"iterations": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
],
"default": 1
}
},
"additionalProperties": false,
"required": [
"force"
]
},
{
"type": "object",
"properties": {
"force": {
"enum": [
"nbody"
]
},
"strength": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
],
"default": -30
},
"theta": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
],
"default": 0.9
},
"distanceMin": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
],
"default": 1
},
"distanceMax": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
}
},
"additionalProperties": false,
"required": [
"force"
]
},
{
"type": "object",
"properties": {
"force": {
"enum": [
"link"
]
},
"links": {
"type": "string"
},
"id": {
"oneOf": [
{
"$ref": "#/refs/scaleField"
},
{
"$ref": "#/refs/paramField"
}
]
},
"distance": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
},
{
"$ref": "#/refs/expr"
},
{
"$ref": "#/refs/paramField"
}
],
"default": 30
},
"strength": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
},
{
"$ref": "#/refs/expr"
},
{
"$ref": "#/refs/paramField"
}
]
},
"iterations": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
],
"default": 1
}
},
"additionalProperties": false,
"required": [
"force"
]
},
{
"type": "object",
"properties": {
"force": {
"enum": [
"x"
]
},
"strength": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
],
"default": 0.1
},
"x": {
"oneOf": [
{
"$ref": "#/refs/scaleField"
},
{
"$ref": "#/refs/paramField"
}
]
}
},
"additionalProperties": false,
"required": [
"force"
]
},
{
"type": "object",
"properties": {
"force": {
"enum": [
"y"
]
},
"strength": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
],
"default": 0.1
},
"y": {
"oneOf": [
{
"$ref": "#/refs/scaleField"
},
{
"$ref": "#/refs/paramField"
}
]
}
},
"additionalProperties": false,
"required": [
"force"
]
}
]
}
},
"as": {
"oneOf": [
{
"type": "array",
"items": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/refs/signal"
}
]
}
},
{
"$ref": "#/refs/signal"
}
],
"default": [
"x",
"y",
"vx",
"vy"
]
}
},
"additionalProperties": false,
"required": [
"type"
]
},
"nestTransform": {
"type": "object",
"properties": {
"type": {
"enum": [
"nest"
]
},
"signal": {
"type": "string"
},
"keys": {
"oneOf": [
{
"type": "array",
"items": {
"oneOf": [
{
"$ref": "#/refs/scaleField"
},
{
"$ref": "#/refs/paramField"
}
]
}
},
{
"$ref": "#/refs/signal"
}
]
}
},
"additionalProperties": false,
"required": [
"type"
]
},
"stratifyTransform": {
"type": "object",
"properties": {
"type": {
"enum": [
"stratify"
]
},
"signal": {
"type": "string"
},
"key": {
"oneOf": [
{
"$ref": "#/refs/scaleField"
},
{
"$ref": "#/refs/paramField"
}
]
},
"parentKey": {
"oneOf": [
{
"$ref": "#/refs/scaleField"
},
{
"$ref": "#/refs/paramField"
}
]
}
},
"additionalProperties": false,
"required": [
"type",
"key",
"parentKey"
]
},
"treelinksTransform": {
"type": "object",
"properties": {
"type": {
"enum": [
"treelinks"
]
},
"signal": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"type"
]
},
"packTransform": {
"type": "object",
"properties": {
"type": {
"enum": [
"pack"
]
},
"signal": {
"type": "string"
},
"field": {
"oneOf": [
{
"$ref": "#/refs/scaleField"
},
{
"$ref": "#/refs/paramField"
}
]
},
"sort": {
"type": "object",
"properties": {
"oneOf": [
{
"field": {
"oneOf": [
{
"type": "string"
},
{
"$ref": "#/refs/signal"
}
]
},
"order": {
"$ref": "#/refs/sortOrder"
}
},
{
"field": {
"type": "array",
"items": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/refs/signal"
}
]
}
},
"order": {
"type": "array",
"items": {
"$ref": "#/refs/sortOrder"
}
}
}
]
}
},
"padding": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
},
"radius": {
"oneOf": [
{
"$ref": "#/refs/scaleField"
},
{
"$ref": "#/refs/paramField"
}
]
},
"size": {
"oneOf": [
{
"type": "array",
"items": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
}
},
{
"$ref": "#/refs/signal"
}
],
"maxItems": 2,
"minItems": 2
},
"as": {
"oneOf": [
{
"type": "array",
"items": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/refs/signal"
}
]
}
},
{
"$ref": "#/refs/signal"
}
],
"maxItems": 3,
"minItems": 3,
"default": [
"x",
"y",
"r",
"depth",
"children"
]
}
},
"additionalProperties": false,
"required": [
"type"
]
},
"partitionTransform": {
"type": "object",
"properties": {
"type": {
"enum": [
"partition"
]
},
"signal": {
"type": "string"
},
"field": {
"oneOf": [
{
"$ref": "#/refs/scaleField"
},
{
"$ref": "#/refs/paramField"
}
]
},
"sort": {
"type": "object",
"properties": {
"oneOf": [
{
"field": {
"oneOf": [
{
"type": "string"
},
{
"$ref": "#/refs/signal"
}
]
},
"order": {
"$ref": "#/refs/sortOrder"
}
},
{
"field": {
"type": "array",
"items": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/refs/signal"
}
]
}
},
"order": {
"type": "array",
"items": {
"$ref": "#/refs/sortOrder"
}
}
}
]
}
},
"padding": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
},
"round": {
"anyOf": [
{
"type": "boolean"
},
{
"$ref": "#/refs/signal"
}
]
},
"size": {
"oneOf": [
{
"type": "array",
"items": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
}
},
{
"$ref": "#/refs/signal"
}
],
"maxItems": 2,
"minItems": 2
},
"as": {
"oneOf": [
{
"type": "array",
"items": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/refs/signal"
}
]
}
},
{
"$ref": "#/refs/signal"
}
],
"maxItems": 4,
"minItems": 4,
"default": [
"x0",
"y0",
"x1",
"y1",
"depth",
"children"
]
}
},
"additionalProperties": false,
"required": [
"type"
]
},
"treeTransform": {
"type": "object",
"properties": {
"type": {
"enum": [
"tree"
]
},
"signal": {
"type": "string"
},
"field": {
"oneOf": [
{
"$ref": "#/refs/scaleField"
},
{
"$ref": "#/refs/paramField"
}
]
},
"sort": {
"type": "object",
"properties": {
"oneOf": [
{
"field": {
"oneOf": [
{
"type": "string"
},
{
"$ref": "#/refs/signal"
}
]
},
"order": {
"$ref": "#/refs/sortOrder"
}
},
{
"field": {
"type": "array",
"items": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/refs/signal"
}
]
}
},
"order": {
"type": "array",
"items": {
"$ref": "#/refs/sortOrder"
}
}
}
]
}
},
"method": {
"anyOf": [
{
"enum": [
"tidy",
"cluster"
]
},
{
"$ref": "#/refs/signal"
}
],
"default": "tidy"
},
"size": {
"oneOf": [
{
"type": "array",
"items": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
}
},
{
"$ref": "#/refs/signal"
}
],
"maxItems": 2,
"minItems": 2
},
"nodeSize": {
"oneOf": [
{
"type": "array",
"items": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
}
},
{
"$ref": "#/refs/signal"
}
],
"maxItems": 2,
"minItems": 2
},
"as": {
"oneOf": [
{
"type": "array",
"items": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/refs/signal"
}
]
}
},
{
"$ref": "#/refs/signal"
}
],
"maxItems": 4,
"minItems": 4,
"default": [
"x",
"y",
"depth",
"children"
]
}
},
"additionalProperties": false,
"required": [
"type"
]
},
"treemapTransform": {
"type": "object",
"properties": {
"type": {
"enum": [
"treemap"
]
},
"signal": {
"type": "string"
},
"field": {
"oneOf": [
{
"$ref": "#/refs/scaleField"
},
{
"$ref": "#/refs/paramField"
}
]
},
"sort": {
"type": "object",
"properties": {
"oneOf": [
{
"field": {
"oneOf": [
{
"type": "string"
},
{
"$ref": "#/refs/signal"
}
]
},
"order": {
"$ref": "#/refs/sortOrder"
}
},
{
"field": {
"type": "array",
"items": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/refs/signal"
}
]
}
},
"order": {
"type": "array",
"items": {
"$ref": "#/refs/sortOrder"
}
}
}
]
}
},
"method": {
"anyOf": [
{
"enum": [
"squarify",
"resquarify",
"binary",
"dice",
"slice",
"slicedice"
]
},
{
"$ref": "#/refs/signal"
}
],
"default": "squarify"
},
"padding": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
},
"paddingInner": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
},
"paddingOuter": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
},
"paddingTop": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
},
"paddingRight": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
},
"paddingBottom": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
},
"paddingLeft": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
},
"ratio": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
],
"default": 1.618033988749895
},
"round": {
"anyOf": [
{
"type": "boolean"
},
{
"$ref": "#/refs/signal"
}
]
},
"size": {
"oneOf": [
{
"type": "array",
"items": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
}
},
{
"$ref": "#/refs/signal"
}
],
"maxItems": 2,
"minItems": 2
},
"as": {
"oneOf": [
{
"type": "array",
"items": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/refs/signal"
}
]
}
},
{
"$ref": "#/refs/signal"
}
],
"maxItems": 4,
"minItems": 4,
"default": [
"x0",
"y0",
"x1",
"y1",
"depth",
"children"
]
}
},
"additionalProperties": false,
"required": [
"type"
]
},
"voronoiTransform": {
"type": "object",
"properties": {
"type": {
"enum": [
"voronoi"
]
},
"signal": {
"type": "string"
},
"x": {
"oneOf": [
{
"$ref": "#/refs/scaleField"
},
{
"$ref": "#/refs/paramField"
}
]
},
"y": {
"oneOf": [
{
"$ref": "#/refs/scaleField"
},
{
"$ref": "#/refs/paramField"
}
]
},
"size": {
"oneOf": [
{
"type": "array",
"items": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
}
},
{
"$ref": "#/refs/signal"
}
],
"maxItems": 2,
"minItems": 2
},
"extent": {
"oneOf": [
{
"type": "array",
"items": {}
},
{
"$ref": "#/refs/signal"
}
],
"maxItems": 2,
"minItems": 2,
"default": [
[
-100000,
-100000
],
[
100000,
100000
]
]
},
"as": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/refs/signal"
}
],
"default": "path"
}
},
"additionalProperties": false,
"required": [
"type",
"x",
"y"
]
},
"wordcloudTransform": {
"type": "object",
"properties": {
"type": {
"enum": [
"wordcloud"
]
},
"signal": {
"type": "string"
},
"size": {
"oneOf": [
{
"type": "array",
"items": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
}
},
{
"$ref": "#/refs/signal"
}
],
"maxItems": 2,
"minItems": 2
},
"font": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/refs/signal"
},
{
"$ref": "#/refs/expr"
},
{
"$ref": "#/refs/paramField"
}
],
"default": "sans-serif"
},
"fontStyle": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/refs/signal"
},
{
"$ref": "#/refs/expr"
},
{
"$ref": "#/refs/paramField"
}
],
"default": "normal"
},
"fontWeight": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/refs/signal"
},
{
"$ref": "#/refs/expr"
},
{
"$ref": "#/refs/paramField"
}
],
"default": "normal"
},
"fontSize": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
},
{
"$ref": "#/refs/expr"
},
{
"$ref": "#/refs/paramField"
}
],
"default": 14
},
"fontSizeRange": {
"oneOf": [
{
"type": "array",
"items": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
}
},
{
"$ref": "#/refs/signal"
},
{
"type": "null"
}
],
"default": [
10,
50
]
},
"rotate": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
},
{
"$ref": "#/refs/expr"
},
{
"$ref": "#/refs/paramField"
}
]
},
"text": {
"oneOf": [
{
"$ref": "#/refs/scaleField"
},
{
"$ref": "#/refs/paramField"
}
]
},
"spiral": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/refs/signal"
}
]
},
"padding": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
},
{
"$ref": "#/refs/expr"
},
{
"$ref": "#/refs/paramField"
}
]
},
"as": {
"oneOf": [
{
"type": "array",
"items": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/refs/signal"
}
]
}
},
{
"$ref": "#/refs/signal"
}
],
"maxItems": 7,
"minItems": 7,
"default": [
"x",
"y",
"font",
"fontSize",
"fontStyle",
"fontWeight",
"angle"
]
}
},
"additionalProperties": false,
"required": [
"type"
]
},
"crossfilterTransform": {
"type": "object",
"properties": {
"type": {
"enum": [
"crossfilter"
]
},
"signal": {
"type": "string"
},
"fields": {
"oneOf": [
{
"type": "array",
"items": {
"oneOf": [
{
"$ref": "#/refs/scaleField"
},
{
"$ref": "#/refs/paramField"
}
]
}
},
{
"$ref": "#/refs/signal"
}
]
},
"query": {
"oneOf": [
{
"type": "array",
"items": {}
},
{
"$ref": "#/refs/signal"
}
]
}
},
"additionalProperties": false,
"required": [
"type",
"fields",
"query"
]
},
"resolvefilterTransform": {
"type": "object",
"properties": {
"type": {
"enum": [
"resolvefilter"
]
},
"signal": {
"type": "string"
},
"ignore": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/refs/signal"
}
]
},
"filter": {}
},
"additionalProperties": false,
"required": [
"type",
"ignore",
"filter"
]
}
},
"refs": {
"paramField": {
"type": "object",
"properties": {
"field": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"field"
]
},
"field": {
"title": "FieldRef",
"oneOf": [
{
"type": "string"
},
{
"oneOf": [
{
"$ref": "#/refs/signal"
},
{
"type": "object",
"properties": {
"datum": {
"$ref": "#/refs/field"
}
},
"required": [
"datum"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"group": {
"$ref": "#/refs/field"
},
"level": {
"type": "number"
}
},
"required": [
"group"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"parent": {
"$ref": "#/refs/field"
},
"level": {
"type": "number"
}
},
"required": [
"parent"
],
"additionalProperties": false
}
]
}
]
},
"scale": {
"title": "ScaleRef",
"$ref": "#/refs/field"
},
"stringModifiers": {
"properties": {
"scale": {
"$ref": "#/refs/scale"
}
}
},
"numberModifiers": {
"properties": {
"exponent": {
"oneOf": [
{
"type": "number"
},
{
"$ref": "#/refs/numberValue"
}
]
},
"mult": {
"oneOf": [
{
"type": "number"
},
{
"$ref": "#/refs/numberValue"
}
]
},
"offset": {
"oneOf": [
{
"type": "number"
},
{
"$ref": "#/refs/numberValue"
}
]
},
"round": {
"type": "boolean",
"default": false
},
"scale": {
"$ref": "#/refs/scale"
},
"band": {
"type": [
"number",
"boolean"
]
},
"extra": {
"type": "boolean"
}
}
},
"value": {
"oneOf": [
{
"type": "array",
"items": {
"allOf": [
{
"$ref": "#/defs/rule"
},
{
"type": "object",
"allOf": [
{
"$ref": "#/refs/stringModifiers"
},
{
"anyOf": [
{
"oneOf": [
{
"$ref": "#/refs/signal",
"required": [
"signal"
]
},
{
"$ref": "#/refs/expr",
"required": [
"expr"
]
},
{
"properties": {
"value": {}
},
"required": [
"value"
]
},
{
"properties": {
"field": {
"$ref": "#/refs/field"
}
},
"required": [
"field"
]
},
{
"properties": {
"range": {
"type": [
"number",
"boolean"
]
}
},
"required": [
"range"
]
}
]
},
{
"required": [
"band"
]
},
{
"required": [
"offset"
]
}
]
}
]
}
]
}
},
{
"type": "object",
"allOf": [
{
"$ref": "#/refs/stringModifiers"
},
{
"anyOf": [
{
"oneOf": [
{
"$ref": "#/refs/signal",
"required": [
"signal"
]
},
{
"$ref": "#/refs/expr",
"required": [
"expr"
]
},
{
"properties": {
"value": {}
},
"required": [
"value"
]
},
{
"properties": {
"field": {
"$ref": "#/refs/field"
}
},
"required": [
"field"
]
},
{
"properties": {
"range": {
"type": [
"number",
"boolean"
]
}
},
"required": [
"range"
]
}
]
},
{
"required": [
"band"
]
},
{
"required": [
"offset"
]
}
]
}
]
}
]
},
"numberValue": {
"oneOf": [
{
"type": "array",
"items": {
"allOf": [
{
"$ref": "#/defs/rule"
},
{
"type": "object",
"allOf": [
{
"$ref": "#/refs/numberModifiers"
},
{
"anyOf": [
{
"oneOf": [
{
"$ref": "#/refs/signal",
"required": [
"signal"
]
},
{
"$ref": "#/refs/expr",
"required": [
"expr"
]
},
{
"properties": {
"value": {}
},
"required": [
"value"
]
},
{
"properties": {
"field": {
"$ref": "#/refs/field"
}
},
"required": [
"field"
]
},
{
"properties": {
"range": {
"type": [
"number",
"boolean"
]
}
},
"required": [
"range"
]
}
]
},
{
"required": [
"band"
]
},
{
"required": [
"offset"
]
}
]
}
]
}
]
}
},
{
"type": "object",
"allOf": [
{
"$ref": "#/refs/numberModifiers"
},
{
"anyOf": [
{
"oneOf": [
{
"$ref": "#/refs/signal",
"required": [
"signal"
]
},
{
"$ref": "#/refs/expr",
"required": [
"expr"
]
},
{
"properties": {
"value": {}
},
"required": [
"value"
]
},
{
"properties": {
"field": {
"$ref": "#/refs/field"
}
},
"required": [
"field"
]
},
{
"properties": {
"range": {
"type": [
"number",
"boolean"
]
}
},
"required": [
"range"
]
}
]
},
{
"required": [
"band"
]
},
{
"required": [
"offset"
]
}
]
}
]
}
]
},
"stringValue": {
"oneOf": [
{
"type": "array",
"items": {
"allOf": [
{
"$ref": "#/defs/rule"
},
{
"type": "object",
"allOf": [
{
"$ref": "#/refs/stringModifiers"
},
{
"anyOf": [
{
"oneOf": [
{
"$ref": "#/refs/signal",
"required": [
"signal"
]
},
{
"$ref": "#/refs/expr",
"required": [
"expr"
]
},
{
"properties": {
"value": {}
},
"required": [
"value"
]
},
{
"properties": {
"field": {
"$ref": "#/refs/field"
}
},
"required": [
"field"
]
},
{
"properties": {
"range": {
"type": [
"number",
"boolean"
]
}
},
"required": [
"range"
]
}
]
},
{
"required": [
"band"
]
},
{
"required": [
"offset"
]
}
]
}
]
}
]
}
},
{
"type": "object",
"allOf": [
{
"$ref": "#/refs/stringModifiers"
},
{
"anyOf": [
{
"oneOf": [
{
"$ref": "#/refs/signal",
"required": [
"signal"
]
},
{
"$ref": "#/refs/expr",
"required": [
"expr"
]
},
{
"properties": {
"value": {}
},
"required": [
"value"
]
},
{
"properties": {
"field": {
"$ref": "#/refs/field"
}
},
"required": [
"field"
]
},
{
"properties": {
"range": {
"type": [
"number",
"boolean"
]
}
},
"required": [
"range"
]
}
]
},
{
"required": [
"band"
]
},
{
"required": [
"offset"
]
}
]
}
]
}
]
},
"booleanValue": {
"oneOf": [
{
"type": "array",
"items": {
"allOf": [
{
"$ref": "#/defs/rule"
},
{
"type": "object",
"allOf": [
{
"$ref": "#/refs/stringModifiers"
},
{
"anyOf": [
{
"oneOf": [
{
"$ref": "#/refs/signal",
"required": [
"signal"
]
},
{
"$ref": "#/refs/expr",
"required": [
"expr"
]
},
{
"properties": {
"value": {}
},
"required": [
"value"
]
},
{
"properties": {
"field": {
"$ref": "#/refs/field"
}
},
"required": [
"field"
]
},
{
"properties": {
"range": {
"type": [
"number",
"boolean"
]
}
},
"required": [
"range"
]
}
]
},
{
"required": [
"band"
]
},
{
"required": [
"offset"
]
}
]
}
]
}
]
}
},
{
"type": "object",
"allOf": [
{
"$ref": "#/refs/stringModifiers"
},
{
"anyOf": [
{
"oneOf": [
{
"$ref": "#/refs/signal",
"required": [
"signal"
]
},
{
"$ref": "#/refs/expr",
"required": [
"expr"
]
},
{
"properties": {
"value": {}
},
"required": [
"value"
]
},
{
"properties": {
"field": {
"$ref": "#/refs/field"
}
},
"required": [
"field"
]
},
{
"properties": {
"range": {
"type": [
"number",
"boolean"
]
}
},
"required": [
"range"
]
}
]
},
{
"required": [
"band"
]
},
{
"required": [
"offset"
]
}
]
}
]
}
]
},
"arrayValue": {
"oneOf": [
{
"type": "array",
"items": {
"allOf": [
{
"$ref": "#/defs/rule"
},
{
"type": "object",
"allOf": [
{
"$ref": "#/refs/stringModifiers"
},
{
"anyOf": [
{
"oneOf": [
{
"$ref": "#/refs/signal",
"required": [
"signal"
]
},
{
"$ref": "#/refs/expr",
"required": [
"expr"
]
},
{
"properties": {
"value": {}
},
"required": [
"value"
]
},
{
"properties": {
"field": {
"$ref": "#/refs/field"
}
},
"required": [
"field"
]
},
{
"properties": {
"range": {
"type": [
"number",
"boolean"
]
}
},
"required": [
"range"
]
}
]
},
{
"required": [
"band"
]
},
{
"required": [
"offset"
]
}
]
}
]
}
]
}
},
{
"type": "object",
"allOf": [
{
"$ref": "#/refs/stringModifiers"
},
{
"anyOf": [
{
"oneOf": [
{
"$ref": "#/refs/signal",
"required": [
"signal"
]
},
{
"$ref": "#/refs/expr",
"required": [
"expr"
]
},
{
"properties": {
"value": {}
},
"required": [
"value"
]
},
{
"properties": {
"field": {
"$ref": "#/refs/field"
}
},
"required": [
"field"
]
},
{
"properties": {
"range": {
"type": [
"number",
"boolean"
]
}
},
"required": [
"range"
]
}
]
},
{
"required": [
"band"
]
},
{
"required": [
"offset"
]
}
]
}
]
}
]
},
"colorRGB": {
"type": "object",
"properties": {
"r": {
"$ref": "#/refs/numberValue"
},
"g": {
"$ref": "#/refs/numberValue"
},
"b": {
"$ref": "#/refs/numberValue"
}
},
"required": [
"r",
"g",
"b"
]
},
"colorHSL": {
"type": "object",
"properties": {
"h": {
"$ref": "#/refs/numberValue"
},
"s": {
"$ref": "#/refs/numberValue"
},
"l": {
"$ref": "#/refs/numberValue"
}
},
"required": [
"h",
"s",
"l"
]
},
"colorLAB": {
"type": "object",
"properties": {
"l": {
"$ref": "#/refs/numberValue"
},
"a": {
"$ref": "#/refs/numberValue"
},
"b": {
"$ref": "#/refs/numberValue"
}
},
"required": [
"l",
"a",
"b"
]
},
"colorHCL": {
"type": "object",
"properties": {
"h": {
"$ref": "#/refs/numberValue"
},
"c": {
"$ref": "#/refs/numberValue"
},
"l": {
"$ref": "#/refs/numberValue"
}
},
"required": [
"h",
"c",
"l"
]
},
"colorValue": {
"title": "ColorRef",
"oneOf": [
{
"$ref": "#/refs/stringValue"
},
{
"type": "object",
"properties": {
"gradient": {
"$ref": "#/refs/scale"
}
},
"additionalProperties": false,
"required": [
"gradient"
]
},
{
"type": "object",
"properties": {
"color": {
"oneOf": [
{
"$ref": "#/refs/colorRGB"
},
{
"$ref": "#/refs/colorHSL"
},
{
"$ref": "#/refs/colorLAB"
},
{
"$ref": "#/refs/colorHCL"
}
]
}
},
"additionalProperties": "false",
"required": [
"color"
]
}
]
},
"expr": {
"title": "ExpressionRef",
"type": "object",
"properties": {
"expr": {
"type": "string"
}
},
"required": [
"expr"
]
},
"exprString": {
"title": "Expression String",
"type": "string"
},
"from": {
"type": "object",
"properties": {
"data": {
"type": "string"
}
},
"additionalProperties": false
},
"facet": {
"type": "object",
"properties": {
"data": {
"type": "string"
},
"facet": {
"oneOf": [
{
"type": "object",
"properties": {
"name": {
"type": "string"
},
"data": {
"type": "string"
},
"field": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"name",
"data",
"field"
]
},
{
"type": "object",
"properties": {
"name": {
"type": "string"
},
"data": {
"type": "string"
},
"groupby": {
"oneOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"aggregate": {
"type": "object",
"properties": {
"fields": {
"type": "array",
"items": {
"type": "string"
}
},
"ops": {
"type": "array",
"items": {
"type": "string"
}
},
"as": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
},
"additionalProperties": false,
"required": [
"name",
"data",
"groupby"
]
}
]
}
},
"additionalProperties": false,
"required": [
"facet"
]
},
"marktype": {
"title": "Mark Type definition",
"type": "string"
},
"sortOrder": {
"oneOf": [
{
"enum": [
"ascending",
"descending"
]
},
{
"$ref": "#/refs/signal",
"additionalProperties": false
}
]
},
"scaleField": {
"oneOf": [
{
"type": "string"
},
{
"$ref": "#/refs/signal",
"additionalProperties": false
},
{
"$ref": "#/refs/expr",
"additionalProperties": false
}
]
},
"scaleScheme": {
"oneOf": [
{
"type": "string"
},
{
"$ref": "#/refs/signal",
"additionalProperties": false
},
{
"$ref": "#/refs/expr",
"additionalProperties": false
}
]
},
"scaleData": {
"oneOf": [
{
"type": "object",
"properties": {
"data": {
"type": "string"
},
"field": {
"$ref": "#/refs/scaleField"
},
"sort": {
"oneOf": [
{
"type": "boolean"
},
{
"type": "object",
"properties": {
"field": {
"$ref": "#/refs/scaleField"
},
"op": {
"$ref": "#/refs/scaleField"
},
"order": {
"$ref": "#/refs/sortOrder"
}
},
"additionalProperties": false
}
]
}
},
"required": [
"data",
"field"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"data": {
"type": "string"
},
"fields": {
"type": "array",
"items": {
"oneOf": [
{
"type": "object",
"properties": {
"data": {
"type": "string"
},
"field": {
"$ref": "#/refs/scaleField"
}
},
"required": [
"data",
"field"
],
"additionalProperties": false
},
{
"$ref": "#/refs/scaleField"
}
]
},
"minItems": 1
},
"sort": {
"oneOf": [
{
"type": "boolean"
},
{
"type": "object",
"properties": {
"op": {
"enum": [
"count"
]
}
},
"additionalProperties": false
}
]
}
},
"required": [
"data",
"fields"
],
"additionalProperties": false
}
]
},
"selector": {
"title": "Event Selector String",
"type": "string"
},
"signal": {
"title": "SignalRef",
"type": "object",
"properties": {
"signal": {
"type": "string"
}
},
"required": [
"signal"
]
}
},
"$ref": "#/defs/spec"
}
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(t.vega=t.vega||{})}(this,function(t){"use strict";function n(t){var n,e,r,i,a,o,u,s,l=t.maxbins||20,f=t.base||10,c=Math.log(f),h=t.divide||[5,2],d=t.extent[0],p=t.extent[1],g=p-d;if(t.step)n=t.step;else if(t.steps){for(a=g/l,o=0,u=t.steps.length;u>o&&t.steps[o]<a;++o);n=t.steps[Math.max(0,o-1)]}else{for(e=Math.ceil(Math.log(l)/c),r=t.minstep||0,n=Math.max(r,Math.pow(f,Math.round(Math.log(g)/c)-e));Math.ceil(g/n)>l;)n*=f;for(o=0,u=h.length;u>o;++o)a=n/h[o],a>=r&&l>=g/a&&(n=a)}return a=Math.log(n),i=a>=0?0:~~(-a/c)+1,s=Math.pow(f,-i-1),(t.nice||void 0===t.nice)&&(d=Math.min(d,Math.floor(d/n+s)*n),p=Math.ceil(p/n)*n),{start:d,stop:p,step:n}}function e(t,n){var e,i=[],a=t.length,o=-1;if(null==n)for(;++o<a;)isNaN(e=r(t[o]))||i.push(e);else for(;++o<a;)isNaN(e=r(n(t[o],o,t)))||i.push(e);return i}function r(t){return null===t?NaN:+t}function i(t,n){return n>t?-1:t>n?1:t>=n?0:NaN}function a(t){return 1===t.length&&(t=o(t)),{left:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);i>r;){var a=r+i>>>1;t(n[a],e)<0?r=a+1:i=a}return r},right:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);i>r;){var a=r+i>>>1;t(n[a],e)>0?i=a:r=a+1}return r}}}function o(t){return function(n,e){return i(t(n),e)}}function u(t){return null===t?NaN:+t}function s(t,n,e){t=+t,n=+n,e=(i=arguments.length)<2?(n=t,t=0,1):3>i?1:+e;for(var r=-1,i=0|Math.max(0,Math.ceil((n-t)/e)),a=new Array(i);++r<i;)a[r]=t+r*e;return a}function l(t,n,e){var r=f(t,n,e);return s(Math.ceil(t/r)*r,Math.floor(n/r)*r+r/2,r)}function f(t,n,e){var r=Math.abs(n-t)/Math.max(0,e),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),a=r/i;return a>=gx?i*=10:a>=mx?i*=5:a>=vx&&(i*=2),t>n?-i:i}function c(t,n,e){if(null==e&&(e=u),r=t.length){if((n=+n)<=0||2>r)return+e(t[0],0,t);if(n>=1)return+e(t[r-1],r-1,t);var r,i=(r-1)*n,a=Math.floor(i),o=+e(t[a],a,t),s=+e(t[a+1],a+1,t);return o+(s-o)*(i-a)}}function h(t,n){var e,r,i=-1,a=t.length;if(null==n){for(;++i<a;)if(null!=(r=t[i])&&r>=r){e=r;break}for(;++i<a;)null!=(r=t[i])&&r>e&&(e=r)}else{for(;++i<a;)if(null!=(r=n(t[i],i,t))&&r>=r){e=r;break}for(;++i<a;)null!=(r=n(t[i],i,t))&&r>e&&(e=r)}return e}function d(t,n){var e,r=0,i=t.length,a=-1,o=i;if(null==n)for(;++a<i;)isNaN(e=u(t[a]))?--o:r+=e;else for(;++a<i;)isNaN(e=u(n(t[a],a,t)))?--o:r+=e;return o?r/o:void 0}function p(t,n){var e,r=[],a=t.length,o=-1;if(null==n)for(;++o<a;)isNaN(e=u(t[o]))||r.push(e);else for(;++o<a;)isNaN(e=u(n(t[o],o,t)))||r.push(e);return c(r.sort(i),.5)}function g(t){for(var n,e,r,i=t.length,a=-1,o=0;++a<i;)o+=t[a].length;for(e=new Array(o);--i>=0;)for(r=t[i],n=r.length;--n>=0;)e[--o]=r[n];return e}function m(t,n){var e,r,i=-1,a=t.length;if(null==n){for(;++i<a;)if(null!=(r=t[i])&&r>=r){e=r;break}for(;++i<a;)null!=(r=t[i])&&e>r&&(e=r)}else{for(;++i<a;)if(null!=(r=n(t[i],i,t))&&r>=r){e=r;break}for(;++i<a;)null!=(r=n(t[i],i,t))&&e>r&&(e=r)}return e}function v(t,n){for(var e=n.length,r=new Array(e);e--;)r[e]=t[n[e]];return r}function y(t,n){var e,r=0,i=t.length,a=-1;if(null==n)for(;++a<i;)(e=+t[a])&&(r+=e);else for(;++a<i;)(e=+n(t[a],a,t))&&(r+=e);return r}function _(t,n,r,a){var o,u,s,l,f=e(t,a),h=f.length,d=n;for(s=0,l=Array(d);d>s;++s){for(o=0,u=0;h>u;++u)o+=f[~~(Math.random()*h)];l[u]=o/h}return[c(l.sort(i),r/2),c(l,1-r/2)]}function x(t,n){var e=null==n?0:t,r=null==n?t:n,i=r-e,a={};return a.sample=function(){return e+Math.floor(i*Math.random())},a.pdf=function(t){return t===Math.floor(t)&&t>=e&&r>t?1/i:0},a.cdf=function(t){var n=Math.floor(t);return e>n?0:n>=r?1:(n-e+1)/i},a.icdf=function(t){return t>=0&&1>=t?e-1+Math.floor(t*i):NaN},a}function b(t,n){var e=t||0,r=n||1,i=NaN,a={};return a.sample=function(){var t,n,a=0,o=0;if(i===i)return a=i,i=NaN,a;do a=2*Math.random()-1,o=2*Math.random()-1,t=a*a+o*o;while(0===t||t>1);return n=Math.sqrt(-2*Math.log(t)/t),i=e+o*n*r,e+a*n*r},a.pdf=function(t){var n=Math.exp(Math.pow(t-e,2)/(-2*Math.pow(r,2)));return 1/(r*Math.sqrt(2*Math.PI))*n},a.cdf=function(t){var n,i=(t-e)/r,a=Math.abs(i);if(a>37)n=0;else{var o,u=Math.exp(-a*a/2);7.07106781186547>a?(o=.0352624965998911*a+.700383064443688,o=o*a+6.37396220353165,o=o*a+33.912866078383,o=o*a+112.079291497871,o=o*a+221.213596169931,o=o*a+220.206867912376,n=u*o,o=.0883883476483184*a+1.75566716318264,o=o*a+16.064177579207,o=o*a+86.7807322029461,o=o*a+296.564248779674,o=o*a+637.333633378831,o=o*a+793.826512519948,o=o*a+440.413735824752,n/=o):(o=a+.65,o=a+4/o,o=a+3/o,o=a+2/o,o=a+1/o,n=u/o/2.506628274631)}return i>0?1-n:n},a.icdf=function(t){if(0>=t||t>=1)return NaN;var n=2*t-1,i=8*(Math.PI-3)/(3*Math.PI*(4-Math.PI)),a=2/(Math.PI*i)+Math.log(1-Math.pow(n,2))/2,o=Math.log(1-n*n)/i,u=(n>0?1:-1)*Math.sqrt(Math.sqrt(a*a-o)-a);return e+r*Math.SQRT2*u},a}function w(t,n){var e=null==n?0:t,r=null==n?null==t?1:t:n,i=r-e,a={};return a.sample=function(){return e+i*Math.random()},a.pdf=function(t){return t>=e&&r>=t?1/i:0},a.cdf=function(t){return e>t?0:t>r?1:(t-e)/i},a.icdf=function(t){return t>=0&&1>=t?e+t*i:NaN},a}function M(t,n){var r=e(t,n);return[c(r.sort(i),.25),c(r,.5),c(r,.75)]}function k(t,n,e){return t.fields=n||[],t.fname=e,t}function E(t){return null==t?null:t.fname}function S(t){return null==t?null:t.fields}function C(t){return String(t).match(/\[(.*?)\]|[^.\[]+/g).map(A)}function A(t){return"["!==t[0]?t:"'"!==t[1]&&'"'!==t[1]?t.slice(1,-1):t.slice(2,-2).replace(/\\(["'])/g,"$1")}function T(t){return t===Object(t)}function N(t){return"string"==typeof t}function z(t){return yx(t)?"["+t.map(z)+"]":T(t)||N(t)?JSON.stringify(t).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):t}function D(t,n){var e=C(t).map(z),r=Function("_","return _["+e.join("][")+"];");return k(r,[t],n||t)}function O(t,n,e){var r=[n].concat([].slice.call(e));console[t].apply(console,r)}function R(t){var n=t||Sx;return{level:function(t){return arguments.length?(n=+t,this):n},warn:function(){return n>=Cx&&O("warn","WARN",arguments),this},info:function(){return n>=Ax&&O("log","INFO",arguments),this},debug:function(){return n>=Tx&&O("log","DEBUG",arguments),this}}}function P(t){return null!=t?yx(t)?t:[t]:[]}function q(t,n){if(null==t)return null;t=P(t);var e,r,i,a,o,u,s,l=t.map(function(t){return C(t).map(z).join("][")}),f=P(n),c=l.length-1,h="var u,v;return ";for(e=0;c>=e;++e)r=l[e],i="(u=a["+r+"])",a="(v=b["+r+"])",o="((v=v instanceof Date?+v:v),(u=u instanceof Date?+u:u))",u="descending"!==f[e]?(s=1,-1):(s=-1,1),h+="("+i+"<"+a+"||u==null)&&v!=null?"+u+":(u>v||v==null)&&u!=null?"+s+":"+o+"!==u&&v===v?"+u+":v!==v&&u===u?"+s+(c>e?":":":0");return k(Function("a","b",h+";"),t)}function L(t){return"function"==typeof t}function U(t){return L(t)?t:function(){return t}}function F(t){throw Error(t)}function j(t){for(var n,e,r=1,i=arguments.length;i>r;++r){n=arguments[r];for(e in n)t[e]=n[e]}return t}function I(t,n){var e,r,i,a,o,u=-1,s=t.length;if(null==n){for(;++u<s;)if(null!=(r=t[u])&&r>=r){e=i=r;break}for(a=o=u;++u<s;)null!=(r=t[u])&&(e>r&&(e=r,a=u),r>i&&(i=r,o=u))}else{for(;++u<s;)if(null!=(r=n(t[u],u,t))&&r>=r){e=i=r;break}for(a=o=u;++u<s;)null!=(r=n(t[u],u,t))&&(e>r&&(e=r,a=u),r>i&&(i=r,o=u))}return[a,o]}function $(t,n){var e=t.prototype=Object.create(n.prototype);return e.constructor=t,e}function W(t){return"number"==typeof t}function B(t){t=t?P(t):t;var n=t&&t.length?Function("_","return ''+"+t.map(function(t){return"_["+C(t).map(z).join("][")+"]"}).join("+'|'+")+";"):function(){return""};return k(n,t,"key")}function H(t,n,e,r){var i=n.length,a=e.length;if(!a)return n;if(!i)return e;for(var o=r||new n.constructor(i+a),u=0,s=0,l=0;i>u&&a>s;++l)o[l]=t(n[u],e[s])>0?e[s++]:n[u++];for(;i>u;++u,++l)o[l]=n[u];for(;a>s;++s,++l)o[l]=e[s];return o}function Y(t,n){for(var e="";--n>=0;)e+=t;return e}function X(t,n,e,r){var i=e||" ",a=n-t.length;return 0>=a?t:"left"===r?Y(i,a)+t:"center"===r?Y(i,~~(a/2))+t+Y(i,Math.ceil(a/2)):t+Y(i,a)}function G(t){return t[t.length-1]}function J(t){for(var n={},e=0,r=t.length;r>e;++e)n[t[e]]=1;return n}function V(t,n,e,r){var i=null!=r?r:"…",a=t.length,o=Math.max(0,n-i.length);return n>=a?t:"left"===e?i+t.slice(a-o):"center"===e?t.slice(0,Math.ceil(o/2))+i+t.slice(a-~~(o/2)):t.slice(0,o)+i}function Z(t,n,e){var r,i=0,a=t.length;if(n)for(;a>i;++i)(r=n(t[i]))&&e(r,i,t);else t.forEach(e)}function Q(){}function K(t,n){var e=new Q;if(t instanceof Q)t.each(function(t,n){e.set(n,t)});else if(Array.isArray(t)){var r,i=-1,a=t.length;if(null==n)for(;++i<a;)e.set(i,t[i]);else for(;++i<a;)e.set(n(r=t[i],i,t),r)}else if(t)for(var o in t)e.set(o,t[o]);return e}function tt(){function t(n,i,o,u){if(i>=a.length)return null!=r?r(n):null!=e?n.sort(e):n;for(var s,l,f,c=-1,h=n.length,d=a[i++],p=K(),g=o();++c<h;)(f=p.get(s=d(l=n[c])+""))?f.push(l):p.set(s,[l]);return p.each(function(n,e){u(g,e,t(n,i,o,u))}),g}function n(t,e){if(++e>a.length)return t;var i,u=o[e-1];return null!=r&&e>=a.length?i=t.entries():(i=[],t.each(function(t,r){i.push({key:r,values:n(t,e)})})),null!=u?i.sort(function(t,n){return u(t.key,n.key)}):i}var e,r,i,a=[],o=[];return i={object:function(n){return t(n,0,nt,et)},map:function(n){return t(n,0,rt,it)},entries:function(e){return n(t(e,0,rt,it),0)},key:function(t){return a.push(t),i},sortKeys:function(t){return o[a.length-1]=t,i},sortValues:function(t){return e=t,i},rollup:function(t){return r=t,i}}}function nt(){return{}}function et(t,n,e){t[n]=e}function rt(){return K()}function it(t,n,e){t.set(n,e)}function at(){for(var t,n=0,e=arguments.length,r={};e>n;++n){if(!(t=arguments[n]+"")||t in r)throw new Error("illegal type: "+t);r[t]=[]}return new ot(r)}function ot(t){this._=t}function ut(t,n){return t.trim().split(/^|\s+/).map(function(t){var e="",r=t.indexOf(".");if(r>=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}})}function st(t,n){for(var e,r=0,i=t.length;i>r;++r)if((e=t[r]).name===n)return e.value}function lt(t,n,e){for(var r=0,i=t.length;i>r;++r)if(t[r].name===n){t[r]=zx,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=e&&t.push({name:n,value:e}),t}function ft(t,n){function e(t){var n,e=l.status;if(!e&&ht(l)||e>=200&&300>e||304===e){if(a)try{n=a.call(r,l)}catch(i){return void u.call("error",r,i)}else n=l;u.call("load",r,n)}else u.call("error",r,t)}var r,i,a,o,u=at("beforesend","progress","load","error"),s=K(),l=new XMLHttpRequest,f=null,c=null,h=0;if("undefined"==typeof XDomainRequest||"withCredentials"in l||!/^(http(s)?:)?\/\//.test(t)||(l=new XDomainRequest),"onload"in l?l.onload=l.onerror=l.ontimeout=e:l.onreadystatechange=function(t){l.readyState>3&&e(t)},l.onprogress=function(t){u.call("progress",r,t)},r={header:function(t,n){return t=(t+"").toLowerCase(),arguments.length<2?s.get(t):(null==n?s.remove(t):s.set(t,n+""),r)},mimeType:function(t){return arguments.length?(i=null==t?null:t+"",r):i},responseType:function(t){return arguments.length?(o=t,r):o},timeout:function(t){return arguments.length?(h=+t,r):h},user:function(t){return arguments.length<1?f:(f=null==t?null:t+"",r)},password:function(t){return arguments.length<1?c:(c=null==t?null:t+"",r)},response:function(t){return a=t,r},get:function(t,n){return r.send("GET",t,n)},post:function(t,n){return r.send("POST",t,n)},send:function(n,e,a){return l.open(n,t,!0,f,c),null==i||s.has("accept")||s.set("accept",i+",*/*"),l.setRequestHeader&&s.each(function(t,n){l.setRequestHeader(n,t)}),null!=i&&l.overrideMimeType&&l.overrideMimeType(i),null!=o&&(l.responseType=o),h>0&&(l.timeout=h),null==a&&"function"==typeof e&&(a=e,e=null),null!=a&&1===a.length&&(a=ct(a)),null!=a&&r.on("error",a).on("load",function(t){a(null,t)}),u.call("beforesend",r,l),l.send(null==e?null:e),r},abort:function(){return l.abort(),r},on:function(){var t=u.on.apply(u,arguments);return t===u?r:t}},null!=n){if("function"!=typeof n)throw new Error("invalid callback: "+n);return r.get(n)}return r}function ct(t){return function(n,e){t(null==n?e:null)}}function ht(t){var n=t.responseType;return n&&"text"!==n?t.response:t.responseText}function dt(t){return new Function("d","return {"+t.map(function(t,n){return JSON.stringify(t)+": d["+n+"]"}).join(",")+"}")}function pt(t,n){var e=dt(t);return function(r,i){return n(e(r),i,t)}}function gt(t){var n=Object.create(null),e=[];return t.forEach(function(t){for(var r in t)r in n||e.push(n[r]=r)}),e}function mt(t){function n(t,n){var r,i,a=e(t,function(t,e){return r?r(t,e-1):(i=t,void(r=n?pt(t,n):dt(t)))});return a.columns=i,a}function e(t,n){function e(){if(f>=l)return o;if(i)return i=!1,a;var n,e=f;if(34===t.charCodeAt(e)){for(var r=e;r++<l;)if(34===t.charCodeAt(r)){if(34!==t.charCodeAt(r+1))break;++r}return f=r+2,n=t.charCodeAt(r+1),13===n?(i=!0,10===t.charCodeAt(r+2)&&++f):10===n&&(i=!0),t.slice(e+1,r).replace(/""/g,'"')}for(;l>f;){var u=1;if(n=t.charCodeAt(f++),10===n)i=!0;else if(13===n)i=!0,10===t.charCodeAt(f)&&(++f,++u);else if(n!==s)continue;return t.slice(e,f-u)}return t.slice(e)}for(var r,i,a={},o={},u=[],l=t.length,f=0,c=0;(r=e())!==o;){for(var h=[];r!==a&&r!==o;)h.push(r),r=e();n&&null==(h=n(h,c++))||u.push(h)}return u}function r(n,e){return null==e&&(e=gt(n)),[e.map(o).join(t)].concat(n.map(function(n){return e.map(function(t){return o(n[t])}).join(t)})).join("\n")}function i(t){return t.map(a).join("\n")}function a(n){return n.map(o).join(t)}function o(t){return null==t?"":u.test(t+="")?'"'+t.replace(/\"/g,'""')+'"':t}var u=new RegExp('["'+t+"\n]"),s=t.charCodeAt(0);return{parse:n,parseRows:e,format:r,formatRows:i}}function vt(t,n){return vt.loader(t,n||{})}function yt(t,n){var e=vt.sanitize(t,n);return e?Mt(e,Ox)?vt.file(e.slice(Ox.length)):vt.http(e,n):Promise.reject("Invalid URL: "+t)}function _t(t,n){var e,r,i,a;return null==t?null:((a=n.baseURL)&&!r&&(Mt(t,"/")||"/"===a[a.length-1]||(t="/"+t),t=a+t),e=Mt(t,Ox),r=Dx.test(t),(i=e||"file"===n.mode||"http"!==n.mode&&!r&&wt())?(e?"":Ox)+t:(Mt(t,"//")&&(t=(n.defaultProtocol||"http")+":"+t),t))}function xt(t,n){return new Promise(function(e,r){var i,a=ft(t);for(i in n.headers)a.header(i,n.headers[i]);Rx.forEach(function(t){n[t]&&a[t](n[t])}),a.on("error",function(n){r(n||"Error loading URL: "+t)}).on("load",function(t){var n=t&&t.responseText;t&&0!==t.status?e(n):r(n||"Error")}).get()})}function bt(t){return new Promise(function(n,e){var r=wt();r?r.readFile(t,function(t,r){t?e(t):n(r)}):e("No file system access for "+t)})}function wt(){return"function"==typeof require&&require("fs")}function Mt(t,n){return null==t?!1:0===t.lastIndexOf(n,0)}function kt(t,n){var e,r,i,a,o=qx.slice();for(r=0,i=t.length;i>r;++r){for(e=n?t[r][n]:t[r],a=0;a<o.length;++a)Nt(e)&&!o[a](e)&&(o.splice(a,1),--a);if(0===o.length)return"string"}return Lx[qx.indexOf(o[0])]}function Et(t,n){return n.reduce(function(n,e){return n[e]=kt(t,e),n},{})}function St(t){return null==t||""===t?null:+t}function Ct(t){return null==t||""===t?null:t&&"false"!==t?!!t:!1}function At(t,n){return null==t||""===t?null:n?n(t):Date.parse(t)}function Tt(t){return null==t||""===t?null:t+""}function Nt(t){return null!=t&&t===t}function zt(t){return"true"===t||"false"===t||t===!0||t===!1}function Dt(t){return!isNaN(Date.parse(t))}function Ot(t){return!(isNaN(+t)||t instanceof Date)}function Rt(t){return Ot(t)&&(t=+t)===~~t}function Pt(t){return function(n,e){var r={delimiter:t};return qt(n,e?j(e,r):r)}}function qt(t,n){return n.header&&(t=n.header.map(z).join(n.delimiter)+"\n"+t),mt(n.delimiter).parse(t)}function Lt(t){return"function"==typeof Buffer&&L(Buffer.isBuffer)?Buffer.isBuffer(t):!1}function Ut(t,n){return t=T(t)&&!Lt(t)?t:JSON.parse(t),n&&n.property?D(n.property)(t):t}function Ft(){}function jt(t){if(!t)return Ft;var n,e,r=t.scale[0],i=t.scale[1],a=t.translate[0],o=t.translate[1];return function(t,u){u||(n=e=0),t[0]=(n+=t[0])*r+a,t[1]=(e+=t[1])*i+o}}function It(t,n){for(var e,r=t.length,i=r-n;i<--r;)e=t[i],t[i++]=t[r],t[r]=e}function $t(t,n){return"GeometryCollection"===n.type?{type:"FeatureCollection",features:n.geometries.map(function(n){return Wt(t,n)})}:Wt(t,n)}function Wt(t,n){var e={type:"Feature",id:n.id,properties:n.properties||{},geometry:Bt(t,n)};return null==n.id&&delete e.id,e}function Bt(t,n){function e(t,n){n.length&&n.pop();for(var e,r=l[0>t?~t:t],i=0,a=r.length;a>i;++i)n.push(e=r[i].slice()),s(e,i);0>t&&It(n,a)}function r(t){return t=t.slice(),s(t,0),t}function i(t){for(var n=[],r=0,i=t.length;i>r;++r)e(t[r],n);return n.length<2&&n.push(n[0].slice()),n}function a(t){for(var n=i(t);n.length<4;)n.push(n[0].slice());return n}function o(t){return t.map(a)}function u(t){var n=t.type;return"GeometryCollection"===n?{type:n,geometries:t.geometries.map(u)}:n in f?{type:n,coordinates:f[n](t)}:null}var s=jt(t.transform),l=t.arcs,f={Point:function(t){return r(t.coordinates)},MultiPoint:function(t){return t.coordinates.map(r)},LineString:function(t){return i(t.arcs)},MultiLineString:function(t){return t.arcs.map(i)},Polygon:function(t){return o(t.arcs)},MultiPolygon:function(t){return t.arcs.map(o)}};return u(n)}function Ht(t,n){function e(n){var e,r=t.arcs[0>n?~n:n],i=r[0];return t.transform?(e=[0,0],r.forEach(function(t){e[0]+=t[0],e[1]+=t[1]})):e=r[r.length-1],0>n?[e,i]:[i,e]}function r(t,n){for(var e in t){var r=t[e];delete n[r.start],delete r.start,delete r.end,r.forEach(function(t){i[0>t?~t:t]=1}),u.push(r)}}var i={},a={},o={},u=[],s=-1;return n.forEach(function(e,r){var i,a=t.arcs[0>e?~e:e];a.length<3&&!a[1][0]&&!a[1][1]&&(i=n[++s],n[s]=e,n[r]=i)}),n.forEach(function(t){var n,r,i=e(t),u=i[0],s=i[1];if(n=o[u])if(delete o[n.end],n.push(t),n.end=s,r=a[s]){delete a[r.start];var l=r===n?n:n.concat(r);a[l.start=n.start]=o[l.end=r.end]=l}else a[n.start]=o[n.end]=n;else if(n=a[s])if(delete a[n.start],n.unshift(t),n.start=u,r=o[u]){delete o[r.end];var f=r===n?n:r.concat(n);a[f.start=r.start]=o[f.end=n.end]=f}else a[n.start]=o[n.end]=n;else n=[t],a[n.start=u]=o[n.end=s]=n}),r(o,a),r(a,o),n.forEach(function(t){i[0>t?~t:t]||u.push([t])}),u}function Yt(t){return Bt(t,Xt.apply(this,arguments))}function Xt(t,n,e){function r(t){var n=0>t?~t:t;(l[n]||(l[n]=[])).push({i:t,g:s})}function i(t){t.forEach(r)}function a(t){t.forEach(i)}function o(t){"GeometryCollection"===t.type?t.geometries.forEach(o):t.type in f&&(s=t,f[t.type](t.arcs))}var u=[];if(arguments.length>1){var s,l=[],f={LineString:i,MultiLineString:a,Polygon:a,MultiPolygon:function(t){t.forEach(a)}};o(n),l.forEach(arguments.length<3?function(t){u.push(t[0].i)}:function(t){e(t[0].g,t[t.length-1].g)&&u.push(t[0].i)})}else for(var c=0,h=t.arcs.length;h>c;++c)u.push(c);return{type:"MultiLineString",arcs:Ht(t,u)}}function Gt(t,n){var e,r;return t=Ut(t,n),n&&(r=n.feature)?(e=t.objects[r])?$t(t,e).features:F("Invalid TopoJSON object: "+r):n&&(r=n.mesh)?(e=t.objects[r])?[Yt(t,e)]:F("Invalid TopoJSON object: "+r):void F("Missing TopoJSON feature or mesh parameter.")}function Jt(t,n){return arguments.length>1?(Ux[t]=n,this):Ux.hasOwnProperty(t)?Ux[t]:null}function Vt(t,n,e,r){function i(n){return t(n=new Date(+n)),n}return i.floor=i,i.ceil=function(e){return t(e=new Date(e-1)),n(e,1),t(e),e},i.round=function(t){var n=i(t),e=i.ceil(t);return e-t>t-n?n:e},i.offset=function(t,e){return n(t=new Date(+t),null==e?1:Math.floor(e)),t},i.range=function(e,r,a){var o=[];if(e=i.ceil(e),a=null==a?1:Math.floor(a),!(r>e&&a>0))return o;do o.push(new Date(+e));while(n(e,a),t(e),r>e);return o},i.filter=function(e){return Vt(function(n){if(n>=n)for(;t(n),!e(n);)n.setTime(n-1)},function(t,r){if(t>=t)for(;--r>=0;)for(;n(t,1),!e(t););})},e&&(i.count=function(n,r){return Fx.setTime(+n),jx.setTime(+r),t(Fx),t(jx),Math.floor(e(Fx,jx))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?function(n){return r(n)%t===0}:function(n){return i.count(0,n)%t===0}):i:null}),i}function Zt(t){return Vt(function(n){n.setDate(n.getDate()-(n.getDay()+7-t)%7),n.setHours(0,0,0,0)},function(t,n){t.setDate(t.getDate()+7*n)},function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Wx)/Yx})}function Qt(t){return Vt(function(n){n.setUTCDate(n.getUTCDate()-(n.getUTCDay()+7-t)%7),n.setUTCHours(0,0,0,0)},function(t,n){t.setUTCDate(t.getUTCDate()+7*n)},function(t,n){return(n-t)/Yx})}function Kt(t){if(0<=t.y&&t.y<100){var n=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return n.setFullYear(t.y),n}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function tn(t){if(0<=t.y&&t.y<100){var n=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return n.setUTCFullYear(t.y),n}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function nn(t){return{y:t,m:0,d:1,H:0,M:0,S:0,L:0}}function en(t){function n(t,n){return function(e){var r,i,a,o=[],u=-1,s=0,l=t.length;for(e instanceof Date||(e=new Date(+e));++u<l;)37===t.charCodeAt(u)&&(o.push(t.slice(s,u)),null!=(i=db[r=t.charAt(++u)])?r=t.charAt(++u):i="e"===r?" ":"0",(a=n[r])&&(r=a(e,i)),o.push(r),s=u+1);return o.push(t.slice(s,u)),o.join("")}}function e(t,n){return function(e){var i=nn(1900),a=r(i,t,e+="",0);if(a!=e.length)return null;if("p"in i&&(i.H=i.H%12+12*i.p),"W"in i||"U"in i){"w"in i||(i.w="W"in i?1:0);var o="Z"in i?tn(nn(i.y)).getUTCDay():n(nn(i.y)).getDay();i.m=0,i.d="W"in i?(i.w+6)%7+7*i.W-(o+5)%7:i.w+7*i.U-(o+6)%7}return"Z"in i?(i.H+=i.Z/100|0,i.M+=i.Z%100,tn(i)):n(i)}}function r(t,n,e,r){for(var i,a,o=0,u=n.length,s=e.length;u>o;){if(r>=s)return-1;if(i=n.charCodeAt(o++),37===i){if(i=n.charAt(o++),a=$[i in db?n.charAt(o++):i],!a||(r=a(t,e,r))<0)return-1}else if(i!=e.charCodeAt(r++))return-1}return r}function i(t,n,e){var r=N.exec(n.slice(e));return r?(t.p=z[r[0].toLowerCase()],e+r[0].length):-1}function a(t,n,e){var r=R.exec(n.slice(e));return r?(t.w=P[r[0].toLowerCase()],e+r[0].length):-1}function o(t,n,e){var r=D.exec(n.slice(e));return r?(t.w=O[r[0].toLowerCase()],e+r[0].length):-1}function u(t,n,e){var r=U.exec(n.slice(e));return r?(t.m=F[r[0].toLowerCase()],e+r[0].length):-1}function s(t,n,e){var r=q.exec(n.slice(e));return r?(t.m=L[r[0].toLowerCase()],e+r[0].length):-1}function l(t,n,e){return r(t,w,n,e)}function f(t,n,e){return r(t,M,n,e)}function c(t,n,e){return r(t,k,n,e)}function h(t){return C[t.getDay()]}function d(t){return S[t.getDay()]}function p(t){return T[t.getMonth()]}function g(t){return A[t.getMonth()]}function m(t){return E[+(t.getHours()>=12)]}function v(t){return C[t.getUTCDay()]}function y(t){return S[t.getUTCDay()]}function _(t){return T[t.getUTCMonth()]}function x(t){return A[t.getUTCMonth()]}function b(t){return E[+(t.getUTCHours()>=12)]}var w=t.dateTime,M=t.date,k=t.time,E=t.periods,S=t.days,C=t.shortDays,A=t.months,T=t.shortMonths,N=on(E),z=un(E),D=on(S),O=un(S),R=on(C),P=un(C),q=on(A),L=un(A),U=on(T),F=un(T),j={a:h,A:d,b:p,B:g,c:null,d:wn,e:wn,H:Mn,I:kn,j:En,L:Sn,m:Cn,M:An,p:m,S:Tn,U:Nn,w:zn,W:Dn,x:null,X:null,y:On,Y:Rn,Z:Pn,"%":Vn},I={a:v,A:y,b:_,B:x,c:null,d:qn,e:qn,H:Ln,I:Un,j:Fn,L:jn,m:In,M:$n,p:b,S:Wn,U:Bn,w:Hn,W:Yn,x:null,X:null,y:Xn,Y:Gn,Z:Jn,"%":Vn},$={a:a,A:o,b:u,B:s,c:l,d:gn,e:gn,H:vn,I:vn,j:mn,L:xn,m:pn,M:yn,p:i,S:_n,U:ln,w:sn,W:fn,x:f,X:c,y:hn,Y:cn,Z:dn,"%":bn};return j.x=n(M,j),j.X=n(k,j),j.c=n(w,j),I.x=n(M,I),I.X=n(k,I),I.c=n(w,I),{format:function(t){var e=n(t+="",j);return e.toString=function(){return t},e},parse:function(t){var n=e(t+="",Kt);return n.toString=function(){return t},n},utcFormat:function(t){var e=n(t+="",I);return e.toString=function(){return t},e},utcParse:function(t){var n=e(t,tn);return n.toString=function(){return t},n}}}function rn(t,n,e){var r=0>t?"-":"",i=(r?-t:t)+"",a=i.length;return r+(e>a?new Array(e-a+1).join(n)+i:i)}function an(t){return t.replace(mb,"\\$&")}function on(t){return new RegExp("^(?:"+t.map(an).join("|")+")","i")}function un(t){for(var n={},e=-1,r=t.length;++e<r;)n[t[e].toLowerCase()]=e;return n}function sn(t,n,e){var r=pb.exec(n.slice(e,e+1));return r?(t.w=+r[0],e+r[0].length):-1}function ln(t,n,e){var r=pb.exec(n.slice(e));return r?(t.U=+r[0],e+r[0].length):-1}function fn(t,n,e){var r=pb.exec(n.slice(e));return r?(t.W=+r[0],e+r[0].length):-1}function cn(t,n,e){var r=pb.exec(n.slice(e,e+4));return r?(t.y=+r[0],e+r[0].length):-1}function hn(t,n,e){var r=pb.exec(n.slice(e,e+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),e+r[0].length):-1}function dn(t,n,e){var r=/^(Z)|([+-]\d\d)(?:\:?(\d\d))?/.exec(n.slice(e,e+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),e+r[0].length):-1}function pn(t,n,e){var r=pb.exec(n.slice(e,e+2));return r?(t.m=r[0]-1,e+r[0].length):-1}function gn(t,n,e){var r=pb.exec(n.slice(e,e+2));return r?(t.d=+r[0],e+r[0].length):-1}function mn(t,n,e){var r=pb.exec(n.slice(e,e+3));return r?(t.m=0,t.d=+r[0],e+r[0].length):-1}function vn(t,n,e){var r=pb.exec(n.slice(e,e+2));return r?(t.H=+r[0],e+r[0].length):-1}function yn(t,n,e){var r=pb.exec(n.slice(e,e+2));return r?(t.M=+r[0],e+r[0].length):-1}function _n(t,n,e){var r=pb.exec(n.slice(e,e+2));return r?(t.S=+r[0],e+r[0].length):-1}function xn(t,n,e){var r=pb.exec(n.slice(e,e+3));return r?(t.L=+r[0],e+r[0].length):-1}function bn(t,n,e){var r=gb.exec(n.slice(e,e+1));return r?e+r[0].length:-1}function wn(t,n){return rn(t.getDate(),n,2)}function Mn(t,n){return rn(t.getHours(),n,2)}function kn(t,n){return rn(t.getHours()%12||12,n,2)}function En(t,n){return rn(1+Vx.count(tb(t),t),n,3)}function Sn(t,n){return rn(t.getMilliseconds(),n,3)}function Cn(t,n){return rn(t.getMonth()+1,n,2)}function An(t,n){return rn(t.getMinutes(),n,2)}function Tn(t,n){return rn(t.getSeconds(),n,2)}function Nn(t,n){return rn(Zx.count(tb(t),t),n,2)}function zn(t){return t.getDay()}function Dn(t,n){return rn(Qx.count(tb(t),t),n,2)}function On(t,n){return rn(t.getFullYear()%100,n,2)}function Rn(t,n){return rn(t.getFullYear()%1e4,n,4)}function Pn(t){var n=t.getTimezoneOffset();return(n>0?"-":(n*=-1,"+"))+rn(n/60|0,"0",2)+rn(n%60,"0",2)}function qn(t,n){return rn(t.getUTCDate(),n,2)}function Ln(t,n){return rn(t.getUTCHours(),n,2)}function Un(t,n){return rn(t.getUTCHours()%12||12,n,2)}function Fn(t,n){return rn(1+rb.count(ub(t),t),n,3)}function jn(t,n){return rn(t.getUTCMilliseconds(),n,3)}function In(t,n){return rn(t.getUTCMonth()+1,n,2)}function $n(t,n){return rn(t.getUTCMinutes(),n,2)}function Wn(t,n){return rn(t.getUTCSeconds(),n,2)}function Bn(t,n){return rn(ib.count(ub(t),t),n,2)}function Hn(t){return t.getUTCDay()}function Yn(t,n){return rn(ab.count(ub(t),t),n,2)}function Xn(t,n){return rn(t.getUTCFullYear()%100,n,2)}function Gn(t,n){return rn(t.getUTCFullYear()%1e4,n,4)}function Jn(){return"+0000"}function Vn(){return"%"}function Zn(t){return sb=en(t),lb=sb.format,fb=sb.parse,cb=sb.utcFormat,hb=sb.utcParse,sb}function Qn(t){return t.toISOString()}function Kn(t){var n=new Date(t);return isNaN(n)?null:n}function te(t,n,e){n=n||{};var r=Jt(n.type||"json");return r||F("Unknown data format type: "+n.type),t=r(t,n),n.parse&&ne(t,n.parse,e),t.hasOwnProperty("columns")&&delete t.columns,t}function ne(t,n,e){e=e||fb;var r,i,a,o,u,s,l,f=t.columns||Object.keys(t[0]);for("auto"===n&&(n=Et(t,f)),f=Object.keys(n),r=f.map(function(t){var r,i,a=n[t];if(a&&0===a.indexOf("date:"))return r=a.split(/:(.+)?/,2),i=r[1],("'"===i[0]&&"'"===i[i.length-1]||'"'===i[0]&&'"'===i[i.length-1])&&(i=i.slice(1,-1)),e(i);if(!Px[a])throw Error("Illegal format pattern: "+t+":"+a);return Px[a]}),o=0,s=t.length,l=f.length;s>o;++o)for(i=t[o],u=0;l>u;++u)a=f[u],i[a]=r[u](i[a])}function ee(t){var n=t||bx,e=[],r={};return e.add=function(t){var i=n(t);return r[i]||(r[i]=1,e.push(t)),e},e.remove=function(t){var i,a=n(t);return r[a]&&(r[a]=0,(i=e.indexOf(t))>=0&&e.splice(i,1)),e},e}function re(t){return t._id}function ie(t,n){for(var e in t)"_id"!==e&&(n[e]=t[e]);return n}function ae(t){var n=t===Object(t)?t:{data:t};return n._id||(n._id=++yb),n}function oe(t){return ae(ie(t,{}))}function ue(t,n){return ie(t,n)}function se(t,n){return n._id=t._id,n}function le(t){return t&&t.constructor===fe}function fe(){var t=[],n=[],e=[],r=[],i=[];return{constructor:fe,insert:function(n){for(var e=P(n),r=0,i=e.length;i>r;++r)t.push(e[r]);return this},remove:function(t){for(var e=L(t)?r:n,i=P(t),a=0,o=i.length;o>a;++a)e.push(i[a]);return this},modify:function(t,n,r){var a={field:n,value:U(r)};return L(t)?(a.filter=t,i.push(a)):(a.tuple=t,e.push(a)),this},encode:function(t,n){return e.push({tuple:t,field:n}),this},pulse:function(a,o){function u(t,n,e){e?t[n]=e(t):a.encode=n,s[t._id]=t}var s,l,f,c,h,d,p;for(l=0,f=t.length;f>l;++l)a.add.push(ae(t[l]));for(s={},l=0,f=n.length;f>l;++l)d=n[l],s[d._id]=d;for(l=0,f=r.length;f>l;++l)h=r[l],o.forEach(function(t){h(t)&&(s[t._id]=t)});for(p in s)a.rem.push(s[p]);for(s={},l=0,f=e.length;f>l;++l)c=e[l],u(c.tuple,c.field,c.value),a.modifies(c.field);for(l=0,f=i.length;f>l;++l)c=i[l],h=c.filter,o.forEach(function(t){h(t)&&u(t,c.field,c.value)}),a.modifies(c.field);for(p in s)a.mod.push(s[p]);return a}}}function ce(){Object.defineProperty(this,_b,{writable:!0,value:{}})}function he(t,n){return(null!=n&&n>=0?n+":":"")+t}function de(t,n,e,r){this.id=++bb,this.value=t,this.stamp=-1,this.rank=-1,this.qrank=-1,this.flags=0,n&&(this._update=n),e&&this.parameters(e,r)}function pe(t){return function(n){var e=this.flags;return 0===arguments.length?!!(e&t):(this.flags=n?e|t:e&~t,this)}}function ge(t,n,e,r){var i=1,a=t instanceof de?t:t&&t.prototype instanceof de?new t:L(t)?new de(null,t):(i=0,new de(t,n));return this.rank(a),i&&(r=e,e=n),e&&this.connect(a,a.parameters(e,r)),this.touch(a),a}function me(t,n){var e,r,i=t.rank;for(e=0,r=n.length;r>e;++e)if(i<n[e].rank)return void this.rerank(t)}function ve(t,n,e){this.id=++Cb,this.value=null,e&&(this.receive=e),t&&(this._filter=t),n&&(this._apply=n)}function ye(t,n,e){return new ve(t,n,e)}function _e(t,n,e,r){var i,a=this,o=ye(e,r),u=function(t){t.dataflow=a,o.receive(t),a.run()};i="string"==typeof t&&"undefined"!=typeof document?document.querySelectorAll(t):P(t);for(var s=0,l=i.length;l>s;++s)i[s].addEventListener(n,u);return o}function xe(t,n,e,r,i){var a=t instanceof de?we:be;return a(this,t,n,e,r,i),this}function be(t,n,e,r,i,a){var o,u,s=j({},a,Tb);L(e)||(e=U(e)),void 0===r?o=function(n){t.touch(e(n))}:L(r)?(u=new de(null,r,i,!1),o=function(n){var r=e(n),i=(u.evaluate(n),u.value);le(i)?t.pulse(r,i,a):t.update(r,i,s)}):o=function(n){t.update(e(n),r,s)},n.apply(o)}function we(t,n,e,r,i,a){var o,u;void 0===r?u=e:(o=L(r)?r:U(r),r=e?function(t,n){return e.skip()?void 0:e.skip(!0).value=o(t,n)}:o,u=new de(null,r,i,!1),u.modified(a&&a.force),u.skip(!0),u.rank=0,e&&(u.value=e.value,u.targets().add(e))),n.targets().add(u)}function Me(t){t.rank=++this._rank}function ke(t){for(var n,e,r,i=[t];i.length;)if(this.rank(n=i.pop()),e=n._targets)for(r=e.length;--r>=0;)i.push(e[r])}function Ee(t,n,e){this.dataflow=t,this.stamp=null==n?-1:n,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=e||null}function Se(t,n){return t?function(e,r){return t(e,r)&&n(e,r)}:n}function Ce(t,n){var e={};return t.visit(n,function(t){e[t._id]=1}),function(t){return e[t._id]?null:t}}function Ae(t,n){var e=n||$b;return this._pulse?this._enqueue(t):this._touched.add(t),e.skip&&t.skip(!0),this}function Te(t,n,e){var r=e||$b;return(t.set(n)||r.force)&&this.touch(t,r),this}function Ne(t,n,e){var r=new Ee(this,this._clock+(this._pulse?0:1));return r.target=t,this._pulses[t.id]=n.pulse(r,t.value),this.touch(t,e||$b)}function ze(t,n,e){return this.pulse(t,this.changeset().insert(te(n,e)))}function De(t){return arguments.length?(this._loadopt=t,this):this._loadopt}function Oe(t){var n,e=new Promise(function(t){n=t});return e.requests=0,e.done=function(){0===--e.requests&&t.runAfter(function(){t._pending=null,t.run(),n(t)})},t._pending=e}function Re(t,n,e){var r=this,i=r._pending||Oe(r);i.requests+=1,vt(n,r.loadOptions()).then(function(n){r.ingest(t,n,e)},function(t){r.warn("Loading failed: "+n,t),i.done()}).then(i.done)["catch"](function(t){r.error(t)})}function Pe(t,n,e,r){var i,a,o,u,s,l=this,f=0;for(this.dataflow=t,this.stamp=n,this.fields=null,this.encode=r||null,this.pulses=e,o=0,u=e.length;u>o;++o)if(i=e[o],i.stamp===n){if(i.fields){a=l.fields||(l.fields={});for(s in i.fields)a[s]=1}i.changed(l.ADD)&&(f|=l.ADD),i.changed(l.REM)&&(f|=l.REM),i.changed(l.MOD)&&(f|=l.MOD)}this.changes=f}function qe(t){if(!this._touched.length)return 0;
if(this._pending)return this.info("Awaiting requests, delaying dataflow run."),0;var n,e,r,i=this,a=0,o=i.logLevel();i._pulse=new Ee(i,++i._clock,t),o>=Ax&&(r=Date.now(),i.debug("-- START PROPAGATION ("+i._clock+") -----")),i._touched.forEach(function(t){i._enqueue(t,!0)}),i._touched=ee(xx);try{for(;i._heap.size()>0;)n=i._heap.pop(),n.rank===n.qrank?(e=n.run(i._getPulse(n,t)),o>=Tx&&i.debug(n.id,e===Nb?"STOP":e,n),e!==Nb&&(i._pulse=e,n._targets&&n._targets.forEach(function(t){i._enqueue(t)})),++a):i._enqueue(n,!0)}catch(u){i.error(u)}if(i._pulses={},i._pulse=null,o>=Ax&&(r=Date.now()-r,i.info("> Pulse "+i._clock+": "+a+" operators; "+r+"ms")),i._postrun.length){var s=i._postrun;i._postrun=[],s.forEach(function(t){try{t(i)}catch(n){i.error(n)}})}return a}function Le(){return this._pending||Promise.resolve(this.run())}function Ue(t){if(this._pulse)this._postrun.push(t);else try{t(this)}catch(n){this.error(n)}}function Fe(t,n){var e=!this._pulses[t.id];e&&(this._pulses[t.id]=this._pulse),(e||n)&&(t.qrank=t.rank,this._heap.push(t))}function je(t,n){var e,r=t.source,i=this._clock;return r&&yx(r)?(e=r.map(function(t){return t.pulse}),new Pe(this,i,e,n)):(r=r&&r.pulse,e=this._pulses[t.id],r&&r!==Nb&&(r.stamp===i&&e.target!==t?e=r:e.source=r.source),e)}function Ie(t){this.cmp=t,this.nodes=[]}function $e(t,n,e,r){var i,a,o;for(i=t[e];e>n&&(o=e-1>>1,a=t[o],r(i,a)<0);)t[e]=a,e=o;return t[e]=i}function We(t,n,e){for(var r,i=n,a=t.length,o=t[n],u=2*n+1;a>u;)r=u+1,a>r&&e(t[u],t[r])>=0&&(u=r),t[n]=t[u],n=u,u=2*n+1;return t[n]=o,$e(t,i,n,e)}function Be(){this._log=R(),this._clock=0,this._rank=0,this._touched=ee(xx),this._pulses={},this._pulse=null,this._heap=new Ie(function(t,n){return t.qrank-n.qrank}),this._postrun=[]}function He(t){return function(){return this._log[t].apply(this,arguments)}}function Ye(t,n){de.call(this,t,null,n)}function Xe(t,n){var e=t.type;Ge(e,t),Je(e,n)}function Ge(t,n){return t=t&&t.toLowerCase(),arguments.length>1?(Gb[t]=n,this):Gb.hasOwnProperty(t)?Gb[t]:null}function Je(t,n){return arguments.length>1?(Xb[t]=n,this):Xb.hasOwnProperty(t)?Xb[t]:null}function Ve(t){this._key=t||"_id",this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null}function Ze(t,n){return Vb[t](n)}function Qe(t){return function(n){var e=j({init:"",add:"",rem:"",idx:0},t);return e.out=n||t.name,e}}function Ke(t,n){return t.idx-n.idx}function tr(t,n){function e(t,r){function i(n){t[n]||e(t,t[n]=Vb[n]())}return r.req&&r.req.forEach(i),n&&r.str&&r.str.forEach(i),t}var r,i=t.reduce(e,t.reduce(function(t,n){return t[n.name]=n,t},{})),a=[];for(r in i)a.push(i[r]);return a.sort(Ke)}function nr(t,n){var e=n||bx,r=tr(t,!0),i="this.cell = cell; this.tuple = t; this.valid = 0; this.missing = 0;",a="if(v==null){this.missing++; return;} if(v!==v) return; ++this.valid;",o="if(v==null){this.missing--; return;} if(v!==v) return; --this.valid;",u="var t = this.tuple; var cell = this.cell;";return r.forEach(function(t){t.idx<0?(i=t.init+i,a=t.add+a,o=t.rem+o):(i+=t.init,a+=t.add,o+=t.rem)}),t.slice().sort(Ke).forEach(function(t){u+="t['"+t.out+"']="+t.set+";"}),u+="return t;",i=Function("cell","t",i),i.prototype.add=Function("v","t",a),i.prototype.rem=Function("v","t",o),i.prototype.set=Function(u),i.prototype.get=e,i.fields=t.map(function(t){return t.out}),i}function er(t){Ye.call(this,null,t),this._adds=[],this._mods=[],this._alen=0,this._mlen=0,this._drop=!0,this._dims=[],this._dnames=[],this._measures=[],this._countOnly=!1,this._counts=null,this._prev=null,this._inputs=null,this._outputs=null}function rr(t,n,e){return e||t+(n?"_"+n:"")}function ir(t){var n,e=this._dims,r=e.length,i=String(e[0](t));for(n=1;r>n;++n)i+="|"+e[n](t);return i}function ar(t){Ye.call(this,null,t)}function or(t){Ye.call(this,[],t)}function ur(t){de.call(this,null,sr,t)}function sr(t){return this.value&&!t.modified()?this.value:q(t.fields,t.orders)}function lr(t){Ye.call(this,null,t)}function fr(t,n,e){switch(n){case"upper":t=t.toUpperCase();break;case"lower":t=t.toLowerCase()}return t.match(e)}function cr(t){Ye.call(this,null,t)}function hr(t,n,e,r){for(var i,a,o=[],u={},s=t.length,l=0;s>l;++l)for(u[n]=a=t[l],i=0;s>i;++i)u[e]=t[i],r(u)&&(o.push(ae(u)),u={},u[n]=a);return o}function dr(t){Ye.call(this,[+(1/0),-(1/0)],t)}function pr(t,n){de.call(this,t),this.parent=n}function gr(t){Ye.call(this,{},t),this._keys={},this._count=0;var n=this._targets=[];n.active=0,n.forEach=function(t){for(var e=0,r=n.active;r>e;++e)t(n[e],e,n)}}function mr(t){de.call(this,null,vr,t)}function vr(t){return this.value&&!t.modified()?this.value:yx(t.name)?P(t.name).map(function(t){return D(t)}):D(t.name,t.as)}function yr(t){Ye.call(this,{},t)}function _r(t){Ye.call(this,{},t)}function xr(t){return t.fields.join("|")}function br(t){Ye.call(this,null,t)}function wr(t){Ye.call(this,[],t)}function Mr(t){Ye.call(this,[],t)}function kr(t){var n,e=t.method||lw.value;return null!=lw[e]?e===lw.value?(n=void 0!==t.value?t.value:0,function(){return n}):lw[e]:void F("Unrecognized imputation method: "+e)}function Er(t){var n=t.field;return function(t){return t?n(t):NaN}}function Sr(t,n,e){var r,i,a,o,u,s,l,f,c,h=function(t){return t(c)},d=[],p=[],g={},m={};for(s=0,f=t.length;f>s;++s)c=t[s],i=(r=e.map(h))+"",l=g[i]||(g[i]=p.push(r)),o=(a=n?n.map(h):fw)+"",(u=m[o])||(u=m[o]=[],d.push(u),u.values=a),u[l-1]=c;return d.domain=p,d}function Cr(t){de.call(this,null,Ar,t)}function Ar(t){return this.value&&!t.modified()?this.value:B(t.fields)}function Tr(t){Ye.call(this,{},t)}function Nr(t,n){return t.hasOwnProperty(n)?t[n]:null}function zr(t){de.call(this,null,Dr,t)}function Dr(t){if(this.value&&!t.modified())return this.value;var n,e,r,i=+(1/0),a=-(1/0),o=t.extents;for(n=0,e=o.length;e>n;++n)r=o[n],r[0]<i&&(i=r[0]),r[1]>a&&(a=r[1]);return[i,a]}function Or(t){de.call(this,null,Rr,t)}function Rr(t){return this.value&&!t.modified()?this.value:t.values.reduce(function(t,n){return t.concat(n)},[])}function Pr(t){Ye.call(this,null,t)}function qr(t){gr.call(this,t)}function Lr(t){Ye.call(this,[],t)}function Ur(t){Ye.call(this,null,t)}function Fr(t){Ye.call(this,null,t)}function jr(t){Ye.call(this,[],t),this.count=0}function Ir(t){Ye.call(this,null,t),this.modified(!0)}function $r(t){Ye.call(this,{},t)}function Wr(t){Ye.call(this,null,t)}function Br(t){function n(n){var a=n+"",o=e.get(a);if(!o){if(i!==Uw)return i;e.set(a,o=r.push(n))}return t[(o-1)%t.length]}var e=K(),r=[],i=Uw;return t=null==t?[]:Lw.call(t),n.domain=function(t){if(!arguments.length)return r.slice();r=[],e=K();for(var i,a,o=-1,u=t.length;++o<u;)e.has(a=(i=t[o])+"")||e.set(a,r.push(i));return n},n.range=function(e){return arguments.length?(t=Lw.call(e),n):t.slice()},n.unknown=function(t){return arguments.length?(i=t,n):i},n.copy=function(){return Br().domain(r).range(t).unknown(i)},n}function Hr(t,n,e){t.prototype=n.prototype=e,e.constructor=t}function Yr(t,n){var e=Object.create(t.prototype);for(var r in n)e[r]=n[r];return e}function Xr(){}function Gr(t){var n;return t=(t+"").trim().toLowerCase(),(n=Iw.exec(t))?(n=parseInt(n[1],16),new Kr(n>>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1)):(n=$w.exec(t))?Jr(parseInt(n[1],16)):(n=Ww.exec(t))?new Kr(n[1],n[2],n[3],1):(n=Bw.exec(t))?new Kr(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=Hw.exec(t))?Vr(n[1],n[2],n[3],n[4]):(n=Yw.exec(t))?Vr(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=Xw.exec(t))?ti(n[1],n[2]/100,n[3]/100,1):(n=Gw.exec(t))?ti(n[1],n[2]/100,n[3]/100,n[4]):Jw.hasOwnProperty(t)?Jr(Jw[t]):"transparent"===t?new Kr(NaN,NaN,NaN,0):null}function Jr(t){return new Kr(t>>16&255,t>>8&255,255&t,1)}function Vr(t,n,e,r){return 0>=r&&(t=n=e=NaN),new Kr(t,n,e,r)}function Zr(t){return t instanceof Xr||(t=Gr(t)),t?(t=t.rgb(),new Kr(t.r,t.g,t.b,t.opacity)):new Kr}function Qr(t,n,e,r){return 1===arguments.length?Zr(t):new Kr(t,n,e,null==r?1:r)}function Kr(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function ti(t,n,e,r){return 0>=r?t=n=e=NaN:0>=e||e>=1?t=n=NaN:0>=n&&(t=NaN),new ri(t,n,e,r)}function ni(t){if(t instanceof ri)return new ri(t.h,t.s,t.l,t.opacity);if(t instanceof Xr||(t=Gr(t)),!t)return new ri;if(t instanceof ri)return t;t=t.rgb();var n=t.r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),a=Math.max(n,e,r),o=NaN,u=a-i,s=(a+i)/2;return u?(o=n===a?(e-r)/u+6*(r>e):e===a?(r-n)/u+2:(n-e)/u+4,u/=.5>s?a+i:2-a-i,o*=60):u=s>0&&1>s?0:o,new ri(o,u,s,t.opacity)}function ei(t,n,e,r){return 1===arguments.length?ni(t):new ri(t,n,e,null==r?1:r)}function ri(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function ii(t,n,e){return 255*(60>t?n+(e-n)*t/60:180>t?e:240>t?n+(e-n)*(240-t)/60:n)}function ai(t){if(t instanceof ui)return new ui(t.l,t.a,t.b,t.opacity);if(t instanceof pi){var n=t.h*Vw;return new ui(t.l,Math.cos(n)*t.c,Math.sin(n)*t.c,t.opacity)}t instanceof Kr||(t=Zr(t));var e=ci(t.r),r=ci(t.g),i=ci(t.b),a=si((.4124564*e+.3575761*r+.1804375*i)/Kw),o=si((.2126729*e+.7151522*r+.072175*i)/tM),u=si((.0193339*e+.119192*r+.9503041*i)/nM);return new ui(116*o-16,500*(a-o),200*(o-u),t.opacity)}function oi(t,n,e,r){return 1===arguments.length?ai(t):new ui(t,n,e,null==r?1:r)}function ui(t,n,e,r){this.l=+t,this.a=+n,this.b=+e,this.opacity=+r}function si(t){return t>aM?Math.pow(t,1/3):t/iM+eM}function li(t){return t>rM?t*t*t:iM*(t-eM)}function fi(t){return 255*(.0031308>=t?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function ci(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function hi(t){if(t instanceof pi)return new pi(t.h,t.c,t.l,t.opacity);t instanceof ui||(t=ai(t));var n=Math.atan2(t.b,t.a)*Zw;return new pi(0>n?n+360:n,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function di(t,n,e,r){return 1===arguments.length?hi(t):new pi(t,n,e,null==r?1:r)}function pi(t,n,e,r){this.h=+t,this.c=+n,this.l=+e,this.opacity=+r}function gi(t){if(t instanceof vi)return new vi(t.h,t.s,t.l,t.opacity);t instanceof Kr||(t=Zr(t));var n=t.r/255,e=t.g/255,r=t.b/255,i=(dM*r+cM*n-hM*e)/(dM+cM-hM),a=r-i,o=(fM*(e-i)-sM*a)/lM,u=Math.sqrt(o*o+a*a)/(fM*i*(1-i)),s=u?Math.atan2(o,a)*Zw-120:NaN;return new vi(0>s?s+360:s,u,i,t.opacity)}function mi(t,n,e,r){return 1===arguments.length?gi(t):new vi(t,n,e,null==r?1:r)}function vi(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function yi(t,n,e,r,i){var a=t*t,o=a*t;return((1-3*t+3*a-o)*n+(4-6*a+3*o)*e+(1+3*t+3*a-3*o)*r+o*i)/6}function _i(t){var n=t.length-1;return function(e){var r=0>=e?e=0:e>=1?(e=1,n-1):Math.floor(e*n),i=t[r],a=t[r+1],o=r>0?t[r-1]:2*i-a,u=n-1>r?t[r+2]:2*a-i;return yi((e-r/n)*n,o,i,a,u)}}function xi(t){return function(){return t}}function bi(t,n){return function(e){return t+e*n}}function wi(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}function Mi(t,n){var e=n-t;return e?bi(t,e>180||-180>e?e-360*Math.round(e/360):e):xi(isNaN(t)?n:t)}function ki(t){return 1===(t=+t)?Ei:function(n,e){return e-n?wi(n,e,t):xi(isNaN(n)?e:n)}}function Ei(t,n){var e=n-t;return e?bi(t,e):xi(isNaN(t)?n:t)}function Si(t){return function(n){var e,r,i=n.length,a=new Array(i),o=new Array(i),u=new Array(i);for(e=0;i>e;++e)r=Qr(n[e]),a[e]=r.r||0,o[e]=r.g||0,u[e]=r.b||0;return a=t(a),o=t(o),u=t(u),r.opacity=1,function(t){return r.r=a(t),r.g=o(t),r.b=u(t),r+""}}}function Ci(t,n){var e,r=n?n.length:0,i=t?Math.min(r,t.length):0,a=new Array(r),o=new Array(r);for(e=0;i>e;++e)a[e]=Ri(t[e],n[e]);for(;r>e;++e)o[e]=n[e];return function(t){for(e=0;i>e;++e)o[e]=a[e](t);return o}}function Ai(t,n){var e=new Date;return t=+t,n-=t,function(r){return e.setTime(t+n*r),e}}function Ti(t,n){return t=+t,n-=t,function(e){return t+n*e}}function Ni(t,n){var e,r={},i={};(null===t||"object"!=typeof t)&&(t={}),(null===n||"object"!=typeof n)&&(n={});for(e in n)e in t?r[e]=Ri(t[e],n[e]):i[e]=n[e];return function(t){for(e in r)i[e]=r[e](t);return i}}function zi(t){return function(){return t}}function Di(t){return function(n){return t(n)+""}}function Oi(t,n){var e,r,i,a=mM.lastIndex=vM.lastIndex=0,o=-1,u=[],s=[];for(t+="",n+="";(e=mM.exec(t))&&(r=vM.exec(n));)(i=r.index)>a&&(i=n.slice(a,i),u[o]?u[o]+=i:u[++o]=i),(e=e[0])===(r=r[0])?u[o]?u[o]+=r:u[++o]=r:(u[++o]=null,s.push({i:o,x:Ti(e,r)})),a=vM.lastIndex;return a<n.length&&(i=n.slice(a),u[o]?u[o]+=i:u[++o]=i),u.length<2?s[0]?Di(s[0].x):zi(n):(n=s.length,function(t){for(var e,r=0;n>r;++r)u[(e=s[r]).i]=e.x(t);return u.join("")})}function Ri(t,n){var e,r=typeof n;return null==n||"boolean"===r?xi(n):("number"===r?Ti:"string"===r?(e=Gr(n))?(n=e,pM):Oi:n instanceof Gr?pM:n instanceof Date?Ai:Array.isArray(n)?Ci:isNaN(n)?Ni:Ti)(t,n)}function Pi(t,n){return t=+t,n-=t,function(e){return Math.round(t+n*e)}}function qi(t){return function n(e){function r(n,r){var i=t((n=mi(n)).h,(r=mi(r)).h),a=Ei(n.s,r.s),o=Ei(n.l,r.l),u=Ei(n.opacity,r.opacity);return function(t){return n.h=i(t),n.s=a(t),n.l=o(Math.pow(t,e)),n.opacity=u(t),n+""}}return e=+e,r.gamma=n,r}(1)}function Li(t){return function(){return t}}function Ui(t){return+t}function Fi(t,n){return(n-=t=+t)?function(e){return(e-t)/n}:Li(n)}function ji(t){return function(n,e){var r=t(n=+n,e=+e);return function(t){return n>=t?0:t>=e?1:r(t)}}}function Ii(t){return function(n,e){var r=t(n=+n,e=+e);return function(t){return 0>=t?n:t>=1?e:r(t)}}}function $i(t,n,e,r){var i=t[0],a=t[1],o=n[0],u=n[1];return i>a?(i=e(a,i),o=r(u,o)):(i=e(i,a),o=r(o,u)),function(t){return o(i(t))}}function Wi(t,n,e,r){var i=Math.min(t.length,n.length)-1,a=new Array(i),o=new Array(i),u=-1;for(t[i]<t[0]&&(t=t.slice().reverse(),n=n.slice().reverse());++u<i;)a[u]=e(t[u],t[u+1]),o[u]=r(n[u],n[u+1]);return function(n){var e=dx(t,n,1,i)-1;return o[e](a[e](n))}}function Bi(t,n){return n.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp())}function Hi(t,n){function e(){return i=Math.min(u.length,s.length)>2?Wi:$i,a=o=null,r}function r(n){return(a||(a=i(u,s,f?ji(t):t,l)))(+n)}var i,a,o,u=xM,s=xM,l=Ri,f=!1;return r.invert=function(t){return(o||(o=i(s,u,Fi,f?Ii(n):n)))(+t)},r.domain=function(t){return arguments.length?(u=qw.call(t,Ui),e()):u.slice()},r.range=function(t){return arguments.length?(s=Lw.call(t),e()):s.slice()},r.rangeRound=function(t){return s=Lw.call(t),l=Pi,e()},r.clamp=function(t){return arguments.length?(f=!!t,e()):f},r.interpolate=function(t){return arguments.length?(l=t,e()):l},e()}function Yi(t,n){if((e=(t=n?t.toExponential(n-1):t.toExponential()).indexOf("e"))<0)return null;var e,r=t.slice(0,e);return[r.length>1?r[0]+r.slice(2):r,+t.slice(e+1)]}function Xi(t){return t=Yi(Math.abs(t)),t?t[1]:NaN}function Gi(t,n){return function(e,r){for(var i=e.length,a=[],o=0,u=t[0],s=0;i>0&&u>0&&(s+u+1>r&&(u=Math.max(1,r-s)),a.push(e.substring(i-=u,i+u)),!((s+=u+1)>r));)u=t[o=(o+1)%t.length];return a.reverse().join(n)}}function Ji(t,n){t=t.toPrecision(n);t:for(var e,r=t.length,i=1,a=-1;r>i;++i)switch(t[i]){case".":a=e=i;break;case"0":0===a&&(a=i),e=i;break;case"e":break t;default:a>0&&(a=0)}return a>0?t.slice(0,a)+t.slice(e+1):t}function Vi(t,n){var e=Yi(t,n);if(!e)return t+"";var r=e[0],i=e[1],a=i-(yM=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+Yi(t,Math.max(0,n+a-1))[0]}function Zi(t,n){var e=Yi(t,n);if(!e)return t+"";var r=e[0],i=e[1];return 0>i?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}function Qi(t){return new Ki(t)}function Ki(t){if(!(n=wM.exec(t)))throw new Error("invalid format: "+t);var n,e=n[1]||" ",r=n[2]||">",i=n[3]||"-",a=n[4]||"",o=!!n[5],u=n[6]&&+n[6],s=!!n[7],l=n[8]&&+n[8].slice(1),f=n[9]||"";"n"===f?(s=!0,f="g"):bM[f]||(f=""),(o||"0"===e&&"="===r)&&(o=!0,e="0",r="="),this.fill=e,this.align=r,this.sign=i,this.symbol=a,this.zero=o,this.width=u,this.comma=s,this.precision=l,this.type=f}function ta(t){return t}function na(t){function n(t){function n(t){var n,i,s,y=p,_=g;if("c"===d)_=m(t)+_,t="";else{t=+t;var x=(0>t||0>1/t)&&(t*=-1,!0);if(t=m(t,h),x)for(n=-1,i=t.length,x=!1;++n<i;)if(s=t.charCodeAt(n),s>48&&58>s||"x"===d&&s>96&&103>s||"X"===d&&s>64&&71>s){x=!0;break}if(y=(x?"("===u?u:"-":"-"===u||"("===u?"":u)+y,_=_+("s"===d?SM[8+yM/3]:"")+(x&&"("===u?")":""),v)for(n=-1,i=t.length;++n<i;)if(s=t.charCodeAt(n),48>s||s>57){_=(46===s?a+t.slice(n+1):t.slice(n))+_,t=t.slice(0,n);break}}c&&!l&&(t=r(t,1/0));var b=y.length+t.length+_.length,w=f>b?new Array(f-b+1).join(e):"";switch(c&&l&&(t=r(w+t,w.length?f-_.length:1/0),w=""),o){case"<":return y+t+_+w;case"=":return y+w+t+_;case"^":return w.slice(0,b=w.length>>1)+y+t+_+w.slice(b)}return w+y+t+_}t=Qi(t);var e=t.fill,o=t.align,u=t.sign,s=t.symbol,l=t.zero,f=t.width,c=t.comma,h=t.precision,d=t.type,p="$"===s?i[0]:"#"===s&&/[boxX]/.test(d)?"0"+d.toLowerCase():"",g="$"===s?i[1]:/[%p]/.test(d)?"%":"",m=bM[d],v=!d||/[defgprs%]/.test(d);return h=null==h?d?6:12:/[gprs]/.test(d)?Math.max(1,Math.min(21,h)):Math.max(0,Math.min(20,h)),n.toString=function(){return t+""},n}function e(t,e){var r=n((t=Qi(t),t.type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(Xi(e)/3))),a=Math.pow(10,-i),o=SM[8+i/3];return function(t){return r(a*t)+o}}var r=t.grouping&&t.thousands?Gi(t.grouping,t.thousands):ta,i=t.currency,a=t.decimal;return{format:n,formatPrefix:e}}function ea(t){return MM=na(t),kM=MM.format,EM=MM.formatPrefix,MM}function ra(t){return Math.max(0,-Xi(Math.abs(t)))}function ia(t,n){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Xi(n)/3)))-Xi(Math.abs(t)))}function aa(t,n){return t=Math.abs(t),n=Math.abs(n)-t,Math.max(0,Xi(n)-Xi(t))+1}function oa(t,n,e){var r,i=t[0],a=t[t.length-1],o=f(i,a,null==n?10:n);switch(e=Qi(null==e?",f":e),e.type){case"s":var u=Math.max(Math.abs(i),Math.abs(a));return null!=e.precision||isNaN(r=ia(o,u))||(e.precision=r),EM(e,u);case"":case"e":case"g":case"p":case"r":null!=e.precision||isNaN(r=aa(o,Math.max(Math.abs(i),Math.abs(a))))||(e.precision=r-("e"===e.type));break;case"f":case"%":null!=e.precision||isNaN(r=ra(o))||(e.precision=r-2*("%"===e.type))}return kM(e)}function ua(t){var n=t.domain;return t.ticks=function(t){var e=n();return l(e[0],e[e.length-1],null==t?10:t)},t.tickFormat=function(t,e){return oa(n(),t,e)},t.nice=function(e){var r=n(),i=r.length-1,a=null==e?10:e,o=r[0],u=r[i],s=f(o,u,a);return s&&(s=f(Math.floor(o/s)*s,Math.ceil(u/s)*s,a),r[0]=Math.floor(o/s)*s,r[i]=Math.ceil(u/s)*s,n(r)),t},t}function sa(){var t=Hi(Fi,Ti);return t.copy=function(){return Bi(t,sa())},ua(t)}function la(){function t(t){return+t}var n=[0,1];return t.invert=t,t.domain=t.range=function(e){return arguments.length?(n=qw.call(e,Ui),t):n.slice()},t.copy=function(){return la().domain(n)},ua(t)}function fa(t,n){t=t.slice();var e,r=0,i=t.length-1,a=t[r],o=t[i];return a>o&&(e=r,r=i,i=e,e=a,a=o,o=e),t[r]=n.floor(a),t[i]=n.ceil(o),t}function ca(t,n){return(n=Math.log(n/t))?function(e){return Math.log(e/t)/n}:Li(n)}function ha(t,n){return 0>t?function(e){return-Math.pow(-n,e)*Math.pow(-t,1-e)}:function(e){return Math.pow(n,e)*Math.pow(t,1-e)}}function da(t){return isFinite(t)?+("1e"+t):0>t?0:t}function pa(t){return 10===t?da:t===Math.E?Math.exp:function(n){return Math.pow(t,n)}}function ga(t){return t===Math.E?Math.log:10===t&&Math.log10||2===t&&Math.log2||(t=Math.log(t),function(n){return Math.log(n)/t})}function ma(t){return function(n){return-t(-n)}}function va(){function t(){return i=ga(r),a=pa(r),e()[0]<0&&(i=ma(i),a=ma(a)),n}var n=Hi(ca,ha).domain([1,10]),e=n.domain,r=10,i=ga(10),a=pa(10);return n.base=function(n){return arguments.length?(r=+n,t()):r},n.domain=function(n){return arguments.length?(e(n),t()):e()},n.ticks=function(t){var n,o=e(),u=o[0],s=o[o.length-1];(n=u>s)&&(d=u,u=s,s=d);var f,c,h,d=i(u),p=i(s),g=null==t?10:+t,m=[];if(!(r%1)&&g>p-d){if(d=Math.round(d)-1,p=Math.round(p)+1,u>0){for(;p>d;++d)for(c=1,f=a(d);r>c;++c)if(h=f*c,!(u>h)){if(h>s)break;m.push(h)}}else for(;p>d;++d)for(c=r-1,f=a(d);c>=1;--c)if(h=f*c,!(u>h)){if(h>s)break;m.push(h)}}else m=l(d,p,Math.min(p-d,g)).map(a);return n?m.reverse():m},n.tickFormat=function(t,e){if(null==e&&(e=10===r?".0e":","),"function"!=typeof e&&(e=kM(e)),t===1/0)return e;null==t&&(t=10);var o=Math.max(1,r*t/n.ticks().length);return function(t){var n=t/a(Math.round(i(t)));return r-.5>n*r&&(n*=r),o>=n?e(t):""}},n.nice=function(){return e(fa(e(),{floor:function(t){return a(Math.floor(i(t)))},ceil:function(t){return a(Math.ceil(i(t)))}}))},n.copy=function(){return Bi(n,va().base(r))},n}function ya(t,n){return 0>t?-Math.pow(-t,n):Math.pow(t,n)}function _a(){function t(t,n){return(n=ya(n,e)-(t=ya(t,e)))?function(r){return(ya(r,e)-t)/n}:Li(n)}function n(t,n){return n=ya(n,e)-(t=ya(t,e)),function(r){return ya(t+n*r,1/e)}}var e=1,r=Hi(t,n),i=r.domain;return r.exponent=function(t){return arguments.length?(e=+t,i(i())):e},r.copy=function(){return Bi(r,_a().exponent(e))},ua(r)}function xa(){return _a().exponent(.5)}function ba(){function t(){var t=0,i=Math.max(1,r.length);for(a=new Array(i-1);++t<i;)a[t-1]=c(e,t/i);return n}function n(t){return isNaN(t=+t)?void 0:r[dx(a,t)]}var e=[],r=[],a=[];return n.invertExtent=function(t){var n=r.indexOf(t);return 0>n?[NaN,NaN]:[n>0?a[n-1]:e[0],n<a.length?a[n]:e[e.length-1]]},n.domain=function(n){if(!arguments.length)return e.slice();e=[];for(var r,a=0,o=n.length;o>a;++a)r=n[a],null==r||isNaN(r=+r)||e.push(r);return e.sort(i),t()},n.range=function(n){return arguments.length?(r=Lw.call(n),t()):r.slice()},n.quantiles=function(){return a.slice()},n.copy=function(){return ba().domain(e).range(r)},n}function wa(){function t(t){return t>=t?o[dx(a,t,0,i)]:void 0}function n(){var n=-1;for(a=new Array(i);++n<i;)a[n]=((n+1)*r-(n-i)*e)/(i+1);return t}var e=0,r=1,i=1,a=[.5],o=[0,1];return t.domain=function(t){return arguments.length?(e=+t[0],r=+t[1],n()):[e,r]},t.range=function(t){return arguments.length?(i=(o=Lw.call(t)).length-1,n()):o.slice()},t.invertExtent=function(t){var n=o.indexOf(t);return 0>n?[NaN,NaN]:1>n?[e,a[0]]:n>=i?[a[i-1],r]:[a[n-1],a[n]]},t.copy=function(){return wa().domain([e,r]).range(o)},ua(t)}function Ma(){function t(t){return t>=t?e[dx(n,t,0,r)]:void 0}var n=[.5],e=[0,1],r=1;return t.domain=function(i){return arguments.length?(n=Lw.call(i),r=Math.min(n.length,e.length-1),t):n.slice()},t.range=function(i){return arguments.length?(e=Lw.call(i),r=Math.min(n.length,e.length-1),t):e.slice()},t.invertExtent=function(t){var r=e.indexOf(t);return[n[r-1],n[r]]},t.copy=function(){return Ma().domain(n).range(e)},t}function ka(t){return new Date(t)}function Ea(t){return t instanceof Date?+t:+new Date(+t)}function Sa(t,n,e,r,i,o,u,s,l){function c(a){return(u(a)<a?m:o(a)<a?v:i(a)<a?y:r(a)<a?_:n(a)<a?e(a)<a?x:b:t(a)<a?w:M)(a)}function h(n,e,r,i){if(null==n&&(n=10),"number"==typeof n){var o=Math.abs(r-e)/n,u=a(function(t){return t[2]}).right(k,o);u===k.length?(i=f(e/OM,r/OM,n),n=t):u?(u=k[o/k[u-1][2]<k[u][2]/o?u-1:u],i=u[1],n=u[0]):(i=f(e,r,n),n=s)}return null==i?n:n.every(i)}var d=Hi(Fi,Ti),p=d.invert,g=d.domain,m=l(".%L"),v=l(":%S"),y=l("%I:%M"),_=l("%I %p"),x=l("%a %d"),b=l("%b %d"),w=l("%B"),M=l("%Y"),k=[[u,1,CM],[u,5,5*CM],[u,15,15*CM],[u,30,30*CM],[o,1,AM],[o,5,5*AM],[o,15,15*AM],[o,30,30*AM],[i,1,TM],[i,3,3*TM],[i,6,6*TM],[i,12,12*TM],[r,1,NM],[r,2,2*NM],[e,1,zM],[n,1,DM],[n,3,3*DM],[t,1,OM]];return d.invert=function(t){return new Date(p(t))},d.domain=function(t){return arguments.length?g(qw.call(t,Ea)):g().map(ka)},d.ticks=function(t,n){var e,r=g(),i=r[0],a=r[r.length-1],o=i>a;return o&&(e=i,i=a,a=e),e=h(t,i,a,n),e=e?e.range(i,a+1):[],o?e.reverse():e},d.tickFormat=function(t,n){return null==n?c:l(n)},d.nice=function(t,n){var e=g();return(t=h(t,e[0],e[e.length-1],n))?g(fa(e,t)):d},d.copy=function(){return Bi(d,Sa(t,n,e,r,i,o,u,s,l))},d}function Ca(){return Sa(tb,Kx,Zx,Vx,Jx,Gx,Xx,Ix,lb).domain([new Date(2e3,0,1),new Date(2e3,0,2)])}function Aa(){return Sa(ub,ob,ib,rb,eb,nb,Xx,Ix,cb).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)])}function Ta(t){return t.match(/.{6}/g).map(function(t){return"#"+t})}function Na(t){(0>t||t>1)&&(t-=Math.floor(t));var n=Math.abs(t-.5);return IM.h=360*t-100,IM.s=1.5-1.5*n,IM.l=.8-.9*n,IM+""}function za(t){var n=t.length;return function(e){return t[Math.max(0,Math.min(n-1,Math.floor(e*n)))]}}function Da(t){function n(n){var a=(n-e)/(r-e);return t(i?Math.max(0,Math.min(1,a)):a)}var e=0,r=1,i=!1;return n.domain=function(t){return arguments.length?(e=+t[0],r=+t[1],n):[e,r]},n.clamp=function(t){return arguments.length?(i=!!t,n):i},n.interpolator=function(e){return arguments.length?(t=e,n):t},n.copy=function(){return Da(t).domain([e,r]).clamp(i)},ua(n)}function Oa(){function t(){var t=i().length,r=o[1]<o[0],h=o[r-0],d=o[1-r];n=(d-h)/Math.max(1,t-l+2*f),u&&(n=Math.floor(n)),h+=(d-h-n*(t-l))*c,e=n*(1-l),u&&(h=Math.round(h),e=Math.round(e));var p=s(t).map(function(t){return h+n*t});return a(r?p.reverse():p)}var n,e,r=Br().unknown(void 0),i=r.domain,a=r.range,o=[0,1],u=!1,l=0,f=0,c=.5;return delete r.unknown,r.domain=function(n){return arguments.length?(i(n),t()):i()},r.range=function(n){return arguments.length?(o=[+n[0],+n[1]],t()):o.slice()},r.rangeRound=function(n){return o=[+n[0],+n[1]],u=!0,t()},r.bandwidth=function(){return e},r.step=function(){return n},r.round=function(n){return arguments.length?(u=!!n,t()):u},r.padding=function(n){return arguments.length?(l=f=Math.max(0,Math.min(1,n)),t()):l},r.paddingInner=function(n){return arguments.length?(l=Math.max(0,Math.min(1,n)),t()):l},r.paddingOuter=function(n){return arguments.length?(f=Math.max(0,Math.min(1,n)),t()):f},r.align=function(n){return arguments.length?(c=Math.max(0,Math.min(1,n)),t()):c},r.invertRange=function(t){var n,r,u,s=+t[0],l=+t[1],f=o[1]<o[0],c=f?a().reverse():a(),h=c.length-1;return s>l&&(u=s,s=l,l=u),l<c[0]||s>o[1-f]?void 0:(n=Math.max(0,dx(c,s)-1),r=s===l?n:dx(c,l)-1,s-c[n]>e+1e-10&&++n,f&&(u=n,n=h-r,r=h-u),n>r?void 0:i().slice(n,r+1))},r.invert=function(t){var n=r.invertRange([t,t]);return n?n[0]:n},r.copy=function(){return Oa().domain(i()).range(o).round(u).paddingInner(l).paddingOuter(f).align(c)},t()}function Ra(t){var n=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return Ra(n())},t}function Pa(){return Ra(Oa().paddingInner(1))}function qa(t){function n(t){return i.hasOwnProperty(t)?a(i[t]):void 0}var e=[],r=0,i={},a=t?Da(t):sa();return n.domain=function(t){if(!arguments.length)return e.slice();e=t.slice(),r=e.length,i={};for(var o=0;r>o;)i[e[o]]=o++;return a.domain([0,r-1]),n},t||(n.invert=function(t){return e[a.invert(t)]},n.invertRange=function(t){var n,i=a.invert(t[0]),o=a.invert(t[1]);return i>o&&(n=i,i=o,o=n),n=e.slice(Math.max(0,Math.ceil(i)),Math.min(r,Math.floor(o)+1)),n.length?n:void 0}),(t?["interpolator"]:["interpolate","range","rangeRound"]).forEach(function(t){n[t]=function(){var e=a[t].apply(null,arguments);return arguments.length?n:e}}),n.copy=function(){return(t?qa(t).interpolator(a.interpolator()):qa().interpolate(a.interpolate()).range(a.range())).domain(e)},n}function La(t){return function(n){var e,r=n[0],i=n[1];return r>i&&(e=r,r=i,i=e),[t.invert(r),t.invert(i)]}}function Ua(t){return function(n){var e,r,i,a,o=t.range(),u=n[0],s=n[1],l=-1;for(u>s&&(r=u,u=s,s=r),i=0,a=o.length;a>i;++i)o[i]>=u&&o[i]<=s&&(0>l&&(l=i),e=i);return 0>l?void 0:(u=t.invertExtent(o[l]),s=t.invertExtent(o[e]),[void 0===u[0]?u[1]:u[0],void 0===s[1]?s[0]:s[1]])}}function Fa(t){return t.match(/.{6}/g).map(function(t){return"#"+t})}function ja(t){return gM(Fa(t))}function Ia(t){return function(n){return t(1-n)}}function $a(t,n){return arguments.length>1?(Ck[t]=n,this):Ck.hasOwnProperty(t)?Ck[t]:null}function Wa(t,n){return function(e,r){e&&((e=$a(e))||F("Unrecognized scale scheme: "+e),r&&(e=L(e)?Ia(e):e.slice().reverse()));var i=n(e);return i.type=t,i.invertRange||(i.invertRange=i.invert?La(i):i.invertExtent?Ua(i):void 0),i}}function Ba(t,n){return arguments.length>1?(Ak[t]=Wa(t,n),this):Ak.hasOwnProperty(t)?Ak[t]:null}function Ha(){return new Ya}function Ya(){this.reset()}function Xa(t,n,e){var r=t.s=n+e,i=r-n,a=r-i;t.t=n-a+(e-i)}function Ga(t){return t>1?0:-1>t?jk:Math.acos(t)}function Ja(t){return t>1?Ik:-1>t?-Ik:Math.asin(t)}function Va(){}function Za(t,n){t&&aE.hasOwnProperty(t.type)&&aE[t.type](t,n)}function Qa(t,n,e){var r,i=-1,a=t.length-e;for(n.lineStart();++i<a;)r=t[i],n.point(r[0],r[1],r[2]);n.lineEnd()}function Ka(t,n){var e=-1,r=t.length;for(n.polygonStart();++e<r;)Qa(t[e],n,1);n.polygonEnd()}function to(t,n){t&&iE.hasOwnProperty(t.type)?iE[t.type](t,n):Za(t,n)}function no(t){return[Gk(t[1],t[0]),Ja(t[2])]}function eo(t){var n=t[0],e=t[1],r=Jk(e);return[r*Jk(n),r*tE(n),tE(e)]}function ro(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function io(t,n){return[t[1]*n[2]-t[2]*n[1],t[2]*n[0]-t[0]*n[2],t[0]*n[1]-t[1]*n[0]]}function ao(t,n){t[0]+=n[0],t[1]+=n[1],t[2]+=n[2]}function oo(t,n){return[t[0]*n,t[1]*n,t[2]*n]}function uo(t){var n=eE(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=n,t[1]/=n,t[2]/=n}function so(t,n){qk.push(Lk=[Nk=t,Dk=t]),zk>n&&(zk=n),n>Ok&&(Ok=n)}function lo(t,n){return(n-=t)<0?n+360:n}function fo(t,n){function e(e,r){return e=t(e,r),n(e[0],e[1])}return t.invert&&n.invert&&(e.invert=function(e,r){return e=n.invert(e,r),e&&t.invert(e[0],e[1])}),e}function co(t,n){return[t>jk?t-Wk:-jk>t?t+Wk:t,n]}function ho(t,n,e){return(t%=Wk)?n||e?fo(go(t),mo(n,e)):go(t):n||e?mo(n,e):co}function po(t){return function(n,e){return n+=t,[n>jk?n-Wk:-jk>n?n+Wk:n,e]}}function go(t){var n=po(t);return n.invert=po(-t),n}function mo(t,n){function e(t,n){var e=Jk(n),u=Jk(t)*e,s=tE(t)*e,l=tE(n),f=l*r+u*i;return[Gk(s*a-f*o,u*r-l*i),Ja(f*a+s*o)]}var r=Jk(t),i=tE(t),a=Jk(n),o=tE(n);return e.invert=function(t,n){var e=Jk(n),u=Jk(t)*e,s=tE(t)*e,l=tE(n),f=l*a-s*o;return[Gk(s*a+l*o,u*r+f*i),Ja(f*r-u*i)]},e}function vo(t,n,e,r,i,a){if(e){var o=Jk(n),u=tE(n),s=r*e;null==i?(i=n+r*Wk,a=n-s/2):(i=yo(o,i),a=yo(o,a),(r>0?a>i:i>a)&&(i+=r*Wk));for(var l,f=i;r>0?f>a:a>f;f-=s)l=no([o,-u*Jk(f),-u*tE(f)]),t.point(l[0],l[1])}}function yo(t,n){n=eo(n),n[0]-=t,uo(n);var e=Ga(-n[1]);return((-n[2]<0?-e:e)+Wk-Fk)%Wk}function _o(){var t,n=[];return{point:function(n,e){t.push([n,e])},lineStart:function(){n.push(t=[])},lineEnd:Va,rejoin:function(){n.length>1&&n.push(n.pop().concat(n.shift()))},result:function(){var e=n;return n=[],t=null,e}}}function xo(t,n,e,r,i,a){var o,u=t[0],s=t[1],l=n[0],f=n[1],c=0,h=1,d=l-u,p=f-s;if(o=e-u,d||!(o>0)){if(o/=d,0>d){if(c>o)return;h>o&&(h=o)}else if(d>0){if(o>h)return;o>c&&(c=o)}if(o=i-u,d||!(0>o)){if(o/=d,0>d){if(o>h)return;o>c&&(c=o)}else if(d>0){if(c>o)return;h>o&&(h=o)}if(o=r-s,p||!(o>0)){if(o/=p,0>p){if(c>o)return;h>o&&(h=o)}else if(p>0){if(o>h)return;o>c&&(c=o)}if(o=a-s,p||!(0>o)){if(o/=p,0>p){if(o>h)return;o>c&&(c=o)}else if(p>0){if(c>o)return;h>o&&(h=o)}return c>0&&(t[0]=u+c*d,t[1]=s+c*p),1>h&&(n[0]=u+h*d,n[1]=s+h*p),!0}}}}}function bo(t,n){return Yk(t[0]-n[0])<Fk&&Yk(t[1]-n[1])<Fk}function wo(t,n,e,r){this.x=t,this.z=n,this.o=e,this.e=r,this.v=!1,this.n=this.p=null}function Mo(t,n,e,r,i){var a,o,u=[],s=[];if(t.forEach(function(t){if(!((n=t.length-1)<=0)){var n,e,r=t[0],o=t[n];if(bo(r,o)){for(i.lineStart(),a=0;n>a;++a)i.point((r=t[a])[0],r[1]);return void i.lineEnd()}u.push(e=new wo(r,t,null,!0)),s.push(e.o=new wo(r,null,e,!1)),u.push(e=new wo(o,t,null,!1)),s.push(e.o=new wo(o,null,e,!0))}}),u.length){for(s.sort(n),ko(u),ko(s),a=0,o=s.length;o>a;++a)s[a].e=e=!e;for(var l,f,c=u[0];;){for(var h=c,d=!0;h.v;)if((h=h.n)===c)return;l=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(d)for(a=0,o=l.length;o>a;++a)i.point((f=l[a])[0],f[1]);else r(h.x,h.n.x,1,i);h=h.n}else{if(d)for(l=h.p.z,a=l.length-1;a>=0;--a)i.point((f=l[a])[0],f[1]);else r(h.x,h.p.x,-1,i);h=h.p}h=h.o,l=h.z,d=!d}while(!h.v);i.lineEnd()}}}function ko(t){if(n=t.length){for(var n,e,r=0,i=t[0];++r<n;)i.n=e=t[r],e.p=i,i=e;i.n=e=t[0],e.p=i}}function Eo(t,n,e,r){function i(i,a){return i>=t&&e>=i&&a>=n&&r>=a}function a(i,a,u,l){var f=0,c=0;if(null==i||(f=o(i,u))!==(c=o(a,u))||s(i,a)<0^u>0){do l.point(0===f||3===f?t:e,f>1?r:n);while((f=(f+u+4)%4)!==c)}else l.point(a[0],a[1])}function o(r,i){return Yk(r[0]-t)<Fk?i>0?0:3:Yk(r[0]-e)<Fk?i>0?2:1:Yk(r[1]-n)<Fk?i>0?1:0:i>0?3:2}function u(t,n){return s(t.x,n.x)}function s(t,n){var e=o(t,1),r=o(n,1);return e!==r?e-r:0===e?n[1]-t[1]:1===e?t[0]-n[0]:2===e?t[1]-n[1]:n[0]-t[0];
}return function(o){function s(t,n){i(t,n)&&C.point(t,n)}function l(){for(var n=0,e=0,i=v.length;i>e;++e)for(var a,o,u=v[e],s=1,l=u.length,f=u[0],c=f[0],h=f[1];l>s;++s)a=c,o=h,f=u[s],c=f[0],h=f[1],r>=o?h>r&&(c-a)*(r-o)>(h-o)*(t-a)&&++n:r>=h&&(h-o)*(t-a)>(c-a)*(r-o)&&--n;return n}function f(){C=A,m=[],v=[],S=!0}function c(){var t=l(),n=S&&t,e=(m=g(m)).length;(n||e)&&(o.polygonStart(),n&&(o.lineStart(),a(null,null,1,o),o.lineEnd()),e&&Mo(m,u,t,a,o),o.polygonEnd()),C=o,m=v=y=null}function h(){T.point=p,v&&v.push(y=[]),E=!0,k=!1,w=M=NaN}function d(){m&&(p(_,x),b&&k&&A.rejoin(),m.push(A.result())),T.point=s,k&&C.lineEnd()}function p(a,o){var u=i(a,o);if(v&&y.push([a,o]),E)_=a,x=o,b=u,E=!1,u&&(C.lineStart(),C.point(a,o));else if(u&&k)C.point(a,o);else{var s=[w=Math.max(gE,Math.min(pE,w)),M=Math.max(gE,Math.min(pE,M))],l=[a=Math.max(gE,Math.min(pE,a)),o=Math.max(gE,Math.min(pE,o))];xo(s,l,t,n,e,r)?(k||(C.lineStart(),C.point(s[0],s[1])),C.point(l[0],l[1]),u||C.lineEnd(),S=!1):u&&(C.lineStart(),C.point(a,o),S=!1)}w=a,M=o,k=u}var m,v,y,_,x,b,w,M,k,E,S,C=o,A=_o(),T={point:s,lineStart:h,lineEnd:d,polygonStart:f,polygonEnd:c};return T}}function So(t,n,e){var r=s(t,n-Fk,e).concat(n);return function(t){return r.map(function(n){return[t,n]})}}function Co(t,n,e){var r=s(t,n-Fk,e).concat(n);return function(t){return r.map(function(n){return[n,t]})}}function Ao(){function t(){return{type:"MultiLineString",coordinates:n()}}function n(){return s(Vk(a/v)*v,i,v).map(d).concat(s(Vk(f/y)*y,l,y).map(p)).concat(s(Vk(r/g)*g,e,g).filter(function(t){return Yk(t%v)>Fk}).map(c)).concat(s(Vk(u/m)*m,o,m).filter(function(t){return Yk(t%y)>Fk}).map(h))}var e,r,i,a,o,u,l,f,c,h,d,p,g=10,m=g,v=90,y=360,_=2.5;return t.lines=function(){return n().map(function(t){return{type:"LineString",coordinates:t}})},t.outline=function(){return{type:"Polygon",coordinates:[d(a).concat(p(l).slice(1),d(i).reverse().slice(1),p(f).reverse().slice(1))]}},t.extent=function(n){return arguments.length?t.extentMajor(n).extentMinor(n):t.extentMinor()},t.extentMajor=function(n){return arguments.length?(a=+n[0][0],i=+n[1][0],f=+n[0][1],l=+n[1][1],a>i&&(n=a,a=i,i=n),f>l&&(n=f,f=l,l=n),t.precision(_)):[[a,f],[i,l]]},t.extentMinor=function(n){return arguments.length?(r=+n[0][0],e=+n[1][0],u=+n[0][1],o=+n[1][1],r>e&&(n=r,r=e,e=n),u>o&&(n=u,u=o,o=n),t.precision(_)):[[r,u],[e,o]]},t.step=function(n){return arguments.length?t.stepMajor(n).stepMinor(n):t.stepMinor()},t.stepMajor=function(n){return arguments.length?(v=+n[0],y=+n[1],t):[v,y]},t.stepMinor=function(n){return arguments.length?(g=+n[0],m=+n[1],t):[g,m]},t.precision=function(n){return arguments.length?(_=+n,c=So(u,o,90),h=Co(r,e,_),d=So(f,l,90),p=Co(a,i,_),t):_},t.extentMajor([[-180,-90+Fk],[180,90-Fk]]).extentMinor([[-180,-80-Fk],[180,80+Fk]])}function To(t){return t}function No(){yE.point=zo}function zo(t,n){yE.point=Do,oE=sE=t,uE=lE=n}function Do(t,n){vE.add(lE*t-sE*n),sE=t,lE=n}function Oo(){Do(oE,uE)}function Ro(t,n){_E>t&&(_E=t),t>bE&&(bE=t),xE>n&&(xE=n),n>wE&&(wE=n)}function Po(t,n){kE+=t,EE+=n,++SE}function qo(){OE.point=Lo}function Lo(t,n){OE.point=Uo,Po(hE=t,dE=n)}function Uo(t,n){var e=t-hE,r=n-dE,i=eE(e*e+r*r);CE+=i*(hE+t)/2,AE+=i*(dE+n)/2,TE+=i,Po(hE=t,dE=n)}function Fo(){OE.point=Po}function jo(){OE.point=$o}function Io(){Wo(fE,cE)}function $o(t,n){OE.point=Wo,Po(fE=hE=t,cE=dE=n)}function Wo(t,n){var e=t-hE,r=n-dE,i=eE(e*e+r*r);CE+=i*(hE+t)/2,AE+=i*(dE+n)/2,TE+=i,i=dE*t-hE*n,NE+=i*(hE+t),zE+=i*(dE+n),DE+=3*i,Po(hE=t,dE=n)}function Bo(t){this._context=t}function Ho(){this._string=[]}function Yo(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Xo(){function t(t){return t&&("function"==typeof a&&i.pointRadius(+a.apply(this,arguments)),to(t,e(i))),i.result()}var n,e,r,i,a=4.5;return t.area=function(t){return to(t,e(yE)),yE.result()},t.bounds=function(t){return to(t,e(ME)),ME.result()},t.centroid=function(t){return to(t,e(OE)),OE.result()},t.projection=function(r){return arguments.length?(e=null==(n=r)?To:r.stream,t):n},t.context=function(n){return arguments.length?(i=null==(r=n)?new Ho:new Bo(n),"function"!=typeof a&&i.pointRadius(a),t):r},t.pointRadius=function(n){return arguments.length?(a="function"==typeof n?n:(i.pointRadius(+n),+n),t):a},t.projection(null).context(null)}function Go(t,n){var e=n[0],r=n[1],i=[tE(e),-Jk(e),0],a=0,o=0;RE.reset();for(var u=0,s=t.length;s>u;++u)if(f=(l=t[u]).length)for(var l,f,c=l[f-1],h=c[0],d=c[1]/2+$k,p=tE(d),g=Jk(d),m=0;f>m;++m,h=y,p=x,g=b,c=v){var v=l[m],y=v[0],_=v[1]/2+$k,x=tE(_),b=Jk(_),w=y-h,M=w>=0?1:-1,k=M*w,E=k>jk,S=p*x;if(RE.add(Gk(S*M*tE(k),g*b+S*Jk(k))),a+=E?w+M*Wk:w,E^h>=e^y>=e){var C=io(eo(c),eo(v));uo(C);var A=io(i,C);uo(A);var T=(E^w>=0?-1:1)*Ja(A[2]);(r>T||r===T&&(C[0]||C[1]))&&(o+=E^w>=0?1:-1)}}return(-Fk>a||Fk>a&&-Fk>RE)^1&o}function Jo(t,n,e,r){return function(i,a){function o(n,e){var r=i(n,e);t(n=r[0],e=r[1])&&a.point(n,e)}function u(t,n){var e=i(t,n);v.point(e[0],e[1])}function s(){w.point=u,v.lineStart()}function l(){w.point=o,v.lineEnd()}function f(t,n){m.push([t,n]);var e=i(t,n);x.point(e[0],e[1])}function c(){x.lineStart(),m=[]}function h(){f(m[0][0],m[0][1]),x.lineEnd();var t,n,e,r,i=x.clean(),o=_.result(),u=o.length;if(m.pop(),d.push(m),m=null,u)if(1&i){if(e=o[0],(n=e.length-1)>0){for(b||(a.polygonStart(),b=!0),a.lineStart(),t=0;n>t;++t)a.point((r=e[t])[0],r[1]);a.lineEnd()}}else u>1&&2&i&&o.push(o.pop().concat(o.shift())),p.push(o.filter(Vo))}var d,p,m,v=n(a),y=i.invert(r[0],r[1]),_=_o(),x=n(_),b=!1,w={point:o,lineStart:s,lineEnd:l,polygonStart:function(){w.point=f,w.lineStart=c,w.lineEnd=h,p=[],d=[]},polygonEnd:function(){w.point=o,w.lineStart=s,w.lineEnd=l,p=g(p);var t=Go(d,y);p.length?(b||(a.polygonStart(),b=!0),Mo(p,Zo,t,e,a)):t&&(b||(a.polygonStart(),b=!0),a.lineStart(),e(null,null,1,a),a.lineEnd()),b&&(a.polygonEnd(),b=!1),p=d=null},sphere:function(){a.polygonStart(),a.lineStart(),e(null,null,1,a),a.lineEnd(),a.polygonEnd()}};return w}}function Vo(t){return t.length>1}function Zo(t,n){return((t=t.x)[0]<0?t[1]-Ik-Fk:Ik-t[1])-((n=n.x)[0]<0?n[1]-Ik-Fk:Ik-n[1])}function Qo(t){var n,e=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),n=1},point:function(a,o){var u=a>0?jk:-jk,s=Yk(a-e);Yk(s-jk)<Fk?(t.point(e,r=(r+o)/2>0?Ik:-Ik),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(u,r),t.point(a,r),n=0):i!==u&&s>=jk&&(Yk(e-i)<Fk&&(e-=i*Fk),Yk(a-u)<Fk&&(a-=u*Fk),r=Ko(e,r,a,o),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(u,r),n=0),t.point(e=a,r=o),i=u},lineEnd:function(){t.lineEnd(),e=r=NaN},clean:function(){return 2-n}}}function Ko(t,n,e,r){var i,a,o=tE(t-e);return Yk(o)>Fk?Xk((tE(n)*(a=Jk(r))*tE(e)-tE(r)*(i=Jk(n))*tE(t))/(i*a*o)):(n+r)/2}function tu(t,n,e,r){var i;if(null==t)i=e*Ik,r.point(-jk,i),r.point(0,i),r.point(jk,i),r.point(jk,0),r.point(jk,-i),r.point(0,-i),r.point(-jk,-i),r.point(-jk,0),r.point(-jk,i);else if(Yk(t[0]-n[0])>Fk){var a=t[0]<n[0]?jk:-jk;i=e*a/2,r.point(-a,i),r.point(0,i),r.point(a,i)}else r.point(n[0],n[1])}function nu(t,n){function e(e,r,i,a){vo(a,t,n,i,e,r)}function r(t,n){return Jk(t)*Jk(n)>u}function i(t){var n,e,i,u,f;return{lineStart:function(){u=i=!1,f=1},point:function(c,h){var d,p=[c,h],g=r(c,h),m=s?g?0:o(c,h):g?o(c+(0>c?jk:-jk),h):0;if(!n&&(u=i=g)&&t.lineStart(),g!==i&&(d=a(n,p),(bo(n,d)||bo(p,d))&&(p[0]+=Fk,p[1]+=Fk,g=r(p[0],p[1]))),g!==i)f=0,g?(t.lineStart(),d=a(p,n),t.point(d[0],d[1])):(d=a(n,p),t.point(d[0],d[1]),t.lineEnd()),n=d;else if(l&&n&&s^g){var v;m&e||!(v=a(p,n,!0))||(f=0,s?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1])))}!g||n&&bo(n,p)||t.point(p[0],p[1]),n=p,i=g,e=m},lineEnd:function(){i&&t.lineEnd(),n=null},clean:function(){return f|(u&&i)<<1}}}function a(t,n,e){var r=eo(t),i=eo(n),a=[1,0,0],o=io(r,i),s=ro(o,o),l=o[0],f=s-l*l;if(!f)return!e&&t;var c=u*s/f,h=-u*l/f,d=io(a,o),p=oo(a,c),g=oo(o,h);ao(p,g);var m=d,v=ro(p,m),y=ro(m,m),_=v*v-y*(ro(p,p)-1);if(!(0>_)){var x=eE(_),b=oo(m,(-v-x)/y);if(ao(b,p),b=no(b),!e)return b;var w,M=t[0],k=n[0],E=t[1],S=n[1];M>k&&(w=M,M=k,k=w);var C=k-M,A=Yk(C-jk)<Fk,T=A||Fk>C;if(!A&&E>S&&(w=E,E=S,S=w),T?A?E+S>0^b[1]<(Yk(b[0]-M)<Fk?E:S):E<=b[1]&&b[1]<=S:C>jk^(M<=b[0]&&b[0]<=k)){var N=oo(m,(-v+x)/y);return ao(N,p),[b,no(N)]}}}function o(n,e){var r=s?t:jk-t,i=0;return-r>n?i|=1:n>r&&(i|=2),-r>e?i|=4:e>r&&(i|=8),i}var u=Jk(t),s=u>0,l=Yk(u)>Fk;return Jo(r,i,e,s?[0,-t]:[-jk,t-jk])}function eu(t){function n(){}var e=n.prototype=Object.create(ru.prototype);for(var r in t)e[r]=t[r];return function(t){var e=new n;return e.stream=t,e}}function ru(){}function iu(t,n,e){var r=n[1][0]-n[0][0],i=n[1][1]-n[0][1],a=t.clipExtent&&t.clipExtent();t.scale(150).translate([0,0]),null!=a&&t.clipExtent(null),to(e,t.stream(ME));var o=ME.result(),u=Math.min(r/(o[1][0]-o[0][0]),i/(o[1][1]-o[0][1])),s=+n[0][0]+(r-u*(o[1][0]+o[0][0]))/2,l=+n[0][1]+(i-u*(o[1][1]+o[0][1]))/2;return null!=a&&t.clipExtent(a),t.scale(150*u).translate([s,l])}function au(t){return function(n,e){return iu(t,[[0,0],n],e)}}function ou(t){return function(n,e){return iu(t,n,e)}}function uu(t,n){return+n?lu(t,n):su(t)}function su(t){return eu({point:function(n,e){n=t(n,e),this.stream.point(n[0],n[1])}})}function lu(t,n){function e(r,i,a,o,u,s,l,f,c,h,d,p,g,m){var v=l-r,y=f-i,_=v*v+y*y;if(_>4*n&&g--){var x=o+h,b=u+d,w=s+p,M=eE(x*x+b*b+w*w),k=Ja(w/=M),E=Yk(Yk(w)-1)<Fk||Yk(a-c)<Fk?(a+c)/2:Gk(b,x),S=t(E,k),C=S[0],A=S[1],T=C-r,N=A-i,z=y*T-v*N;(z*z/_>n||Yk((v*T+y*N)/_-.5)>.3||LE>o*h+u*d+s*p)&&(e(r,i,a,o,u,s,C,A,E,x/=M,b/=M,w,g,m),m.point(C,A),e(C,A,E,x,b,w,l,f,c,h,d,p,g,m))}}return function(n){function r(e,r){e=t(e,r),n.point(e[0],e[1])}function i(){v=NaN,w.point=a,n.lineStart()}function a(r,i){var a=eo([r,i]),o=t(r,i);e(v,y,m,_,x,b,v=o[0],y=o[1],m=r,_=a[0],x=a[1],b=a[2],qE,n),n.point(v,y)}function o(){w.point=r,n.lineEnd()}function u(){i(),w.point=s,w.lineEnd=l}function s(t,n){a(f=t,n),c=v,h=y,d=_,p=x,g=b,w.point=a}function l(){e(v,y,m,_,x,b,c,h,f,d,p,g,qE,n),w.lineEnd=o,o()}var f,c,h,d,p,g,m,v,y,_,x,b,w={point:r,lineStart:i,lineEnd:o,polygonStart:function(){n.polygonStart(),w.lineStart=u},polygonEnd:function(){n.polygonEnd(),w.lineStart=i}};return w}}function fu(t){return cu(function(){return t})()}function cu(t){function n(t){return t=f(t[0]*Hk,t[1]*Hk),[t[0]*m+u,s-t[1]*m]}function e(t){return t=f.invert((t[0]-u)/m,(s-t[1])/m),t&&[t[0]*Bk,t[1]*Bk]}function r(t,n){return t=o(t,n),[t[0]*m+u,s-t[1]*m]}function i(){f=fo(l=ho(b,w,M),o);var t=o(_,x);return u=v-t[0]*m,s=y+t[1]*m,a()}function a(){return p=g=null,n}var o,u,s,l,f,c,h,d,p,g,m=150,v=480,y=250,_=0,x=0,b=0,w=0,M=0,k=null,E=PE,S=null,C=To,A=.5,T=uu(r,A);return n.stream=function(t){return p&&g===t?p:p=UE(E(l,T(C(g=t))))},n.clipAngle=function(t){return arguments.length?(E=+t?nu(k=t*Hk,6*Hk):(k=null,PE),a()):k*Bk},n.clipExtent=function(t){return arguments.length?(C=null==t?(S=c=h=d=null,To):Eo(S=+t[0][0],c=+t[0][1],h=+t[1][0],d=+t[1][1]),a()):null==S?null:[[S,c],[h,d]]},n.scale=function(t){return arguments.length?(m=+t,i()):m},n.translate=function(t){return arguments.length?(v=+t[0],y=+t[1],i()):[v,y]},n.center=function(t){return arguments.length?(_=t[0]%360*Hk,x=t[1]%360*Hk,i()):[_*Bk,x*Bk]},n.rotate=function(t){return arguments.length?(b=t[0]%360*Hk,w=t[1]%360*Hk,M=t.length>2?t[2]%360*Hk:0,i()):[b*Bk,w*Bk,M*Bk]},n.precision=function(t){return arguments.length?(T=uu(r,A=t*t),a()):eE(A)},n.fitExtent=ou(n),n.fitSize=au(n),function(){return o=t.apply(this,arguments),n.invert=o.invert&&e,i()}}function hu(t){var n=0,e=jk/3,r=cu(t),i=r(n,e);return i.parallels=function(t){return arguments.length?r(n=t[0]*Hk,e=t[1]*Hk):[n*Bk,e*Bk]},i}function du(t,n){function e(t,n){var e=eE(a-2*i*tE(n))/i;return[e*tE(t*=i),o-e*Jk(t)]}var r=tE(t),i=(r+tE(n))/2,a=1+r*(2*i-r),o=eE(a)/i;return e.invert=function(t,n){var e=o-n;return[Gk(t,e)/i,Ja((a-(t*t+e*e)*i*i)/(2*i))]},e}function pu(){return hu(du).scale(155.424).center([0,33.6442])}function gu(){return pu().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function mu(t){var n=t.length;return{point:function(e,r){for(var i=-1;++i<n;)t[i].point(e,r)},sphere:function(){for(var e=-1;++e<n;)t[e].sphere()},lineStart:function(){for(var e=-1;++e<n;)t[e].lineStart()},lineEnd:function(){for(var e=-1;++e<n;)t[e].lineEnd()},polygonStart:function(){for(var e=-1;++e<n;)t[e].polygonStart()},polygonEnd:function(){for(var e=-1;++e<n;)t[e].polygonEnd()}}}function vu(){function t(t){var n=t[0],e=t[1];return u=null,i.point(n,e),u||(a.point(n,e),u)||(o.point(n,e),u)}function n(){return e=r=null,t}var e,r,i,a,o,u,s=gu(),l=pu().rotate([154,0]).center([-2,58.5]).parallels([55,65]),f=pu().rotate([157,0]).center([-3,19.9]).parallels([8,18]),c={point:function(t,n){u=[t,n]}};return t.invert=function(t){var n=s.scale(),e=s.translate(),r=(t[0]-e[0])/n,i=(t[1]-e[1])/n;return(i>=.12&&.234>i&&r>=-.425&&-.214>r?l:i>=.166&&.234>i&&r>=-.214&&-.115>r?f:s).invert(t)},t.stream=function(t){return e&&r===t?e:e=mu([s.stream(r=t),l.stream(t),f.stream(t)])},t.precision=function(t){return arguments.length?(s.precision(t),l.precision(t),f.precision(t),n()):s.precision()},t.scale=function(n){return arguments.length?(s.scale(n),l.scale(.35*n),f.scale(n),t.translate(s.translate())):s.scale()},t.translate=function(t){if(!arguments.length)return s.translate();var e=s.scale(),r=+t[0],u=+t[1];return i=s.translate(t).clipExtent([[r-.455*e,u-.238*e],[r+.455*e,u+.238*e]]).stream(c),a=l.translate([r-.307*e,u+.201*e]).clipExtent([[r-.425*e+Fk,u+.12*e+Fk],[r-.214*e-Fk,u+.234*e-Fk]]).stream(c),o=f.translate([r-.205*e,u+.212*e]).clipExtent([[r-.214*e+Fk,u+.166*e+Fk],[r-.115*e-Fk,u+.234*e-Fk]]).stream(c),n()},t.fitExtent=ou(t),t.fitSize=au(t),t.scale(1070)}function yu(t){return function(n,e){var r=Jk(n),i=Jk(e),a=t(r*i);return[a*i*tE(n),a*tE(e)]}}function _u(t){return function(n,e){var r=eE(n*n+e*e),i=t(r),a=tE(i),o=Jk(i);return[Gk(n*a,r*o),Ja(r&&e*a/r)]}}function xu(){return fu(FE).scale(124.75).clipAngle(179.999)}function bu(){return fu(jE).scale(79.4188).clipAngle(179.999)}function wu(t,n){return[t,Qk(rE((Ik+n)/2))]}function Mu(){return ku(wu).scale(961/Wk)}function ku(t){var n,e=fu(t),r=e.scale,i=e.translate,a=e.clipExtent;return e.scale=function(t){return arguments.length?(r(t),n&&e.clipExtent(null),e):r()},e.translate=function(t){return arguments.length?(i(t),n&&e.clipExtent(null),e):i()},e.clipExtent=function(t){if(!arguments.length)return n?null:a();if(n=null==t){var o=jk*r(),u=i();t=[[u[0]-o,u[1]-o],[u[0]+o,u[1]+o]]}return a(t),e},e.clipExtent(null)}function Eu(t){return rE((Ik+t)/2)}function Su(t,n){function e(t,n){a>0?-Ik+Fk>n&&(n=-Ik+Fk):n>Ik-Fk&&(n=Ik-Fk);var e=a/Kk(Eu(n),i);return[e*tE(i*t),a-e*Jk(i*t)]}var r=Jk(t),i=t===n?tE(t):Qk(r/Jk(n))/Qk(Eu(n)/Eu(t)),a=r*Kk(Eu(t),i)/i;return i?(e.invert=function(t,n){var e=a-n,r=nE(i)*eE(t*t+e*e);return[Gk(t,e)/i,2*Xk(Kk(a/r,1/i))-Ik]},e):wu}function Cu(){return hu(Su).scale(109.5).parallels([30,30])}function Au(t,n){return[t,n]}function Tu(){return fu(Au).scale(152.63)}function Nu(t,n){function e(t,n){var e=a-n,r=i*t;return[e*tE(r),a-e*Jk(r)]}var r=Jk(t),i=t===n?tE(t):(r-Jk(n))/(n-t),a=r/i+t;return Yk(i)<Fk?Au:(e.invert=function(t,n){var e=a-n;return[Gk(t,e)/i,a-nE(i)*eE(t*t+e*e)]},e)}function zu(){return hu(Nu).scale(131.154).center([0,13.9389])}function Du(t,n){var e=Jk(n),r=Jk(t)*e;return[e*tE(t)/r,tE(n)/r]}function Ou(){return fu(Du).scale(144.049).clipAngle(60)}function Ru(t,n){return[Jk(n)*tE(t),tE(n)]}function Pu(){return fu(Ru).scale(249.5).clipAngle(90+Fk)}function qu(t,n){var e=Jk(n),r=1+Jk(t)*e;return[e*tE(t)/r,tE(n)/r]}function Lu(){return fu(qu).scale(250).clipAngle(142)}function Uu(t,n){return[Qk(rE((Ik+n)/2)),-t]}function Fu(){var t=ku(Uu),n=t.center,e=t.rotate;return t.center=function(t){return arguments.length?n([-t[1],t[0]]):(t=n(),[t[1],-t[0]])},t.rotate=function(t){return arguments.length?e([t[0],t[1],t.length>2?t[2]+90:90]):(t=e(),[t[0],t[1],t[2]-90])},e([0,0,90]).scale(159.155)}function ju(t){Ye.call(this,null,t)}function Iu(t){Ye.call(this,null,t)}function $u(t){Ye.call(this,null,t)}function Wu(t,n){var e=function(e){return t(n(e))};return e.context=function(n){return t.context(n),e},e}function Bu(t){Ye.call(this,[],t),this.generator=Ao()}function Hu(t,n){return function e(){var r=n();return r.type=t,r.copy=r.copy||function(){var t=e();return HE.forEach(function(n){r.hasOwnProperty(n)&&t[n](r[n]())}),t},r}}function Yu(t,n){return arguments.length>1?(YE[t]=Hu(t,n),this):YE.hasOwnProperty(t)?YE[t]:null}function Xu(t){Ye.call(this,null,t),this.modified(!0)}function Gu(t){var n=Yu((t||"mercator").toLowerCase());return n||F("Unrecognized projection type: "+t),n()}function Ju(t,n,e){L(t[n])&&t[n](e)}function Vu(t,n){return t.ticks?t.ticks(n):t.domain()}function Zu(t,n,e){var r=t.tickFormat?t.tickFormat(n,e):String;return"log"===t.type?Qu(r,Ku(e)):r}function Qu(t,n){return function(e){return t(e)?n(e):""}}function Ku(t){var n=Qi(t||",");if(null==n.precision){switch(n.precision=12,n.type){case"%":n.precision-=2;break;case"e":n.precision-=1}return ts(kM(n),kM(".1f")(1)[1])}return kM(n)}function ts(t,n){return function(e){var r,i,a=t(e),o=a.indexOf(n);if(0>o)return a;for(r=ns(a,o),i=r<a.length?a.slice(r):"";--r>o;)if("0"!==a[r]){++r;break}return a.slice(0,r)+i}}function ns(t,n){var e,r=t.lastIndexOf("e");if(r>0)return r;for(r=t.length;--r>n;)if(e=t.charCodeAt(r),e>=48&&57>=e)return r+1}function es(t){Ye.call(this,[],t)}function rs(t,n){return t.hasOwnProperty(n)?t[n]:null}function is(t){Ye.call(this,null,t)}function as(){return ae({})}function os(t){Ye.call(this,null,t)}function us(t){Ye.call(this,[],t)}function ss(t){return t.source.x}function ls(t){return t.source.y}function fs(t){return t.target.x}function cs(t){return t.target.y}function hs(t){Ye.call(this,{},t)}function ds(t,n,e,r){return"M"+t+","+n+"L"+e+","+r}function ps(t,n,e,r){return ds(n*Math.cos(t),n*Math.sin(t),r*Math.cos(e),r*Math.sin(e))}function gs(t,n,e,r){var i=e-t,a=r-n,o=.2*(i+a),u=.2*(a-i);return"M"+t+","+n+"C"+(t+o)+","+(n+u)+" "+(e+u)+","+(r-o)+" "+e+","+r}function ms(t,n,e,r){return gs(n*Math.cos(t),n*Math.sin(t),r*Math.cos(e),r*Math.sin(e))}function vs(t,n,e,r){return"M"+t+","+n+"V"+r+"H"+e}function ys(t,n,e,r){return"M"+t+","+n+"H"+e+"V"+r}function _s(t,n,e,r){var i=Math.cos(t),a=Math.sin(t),o=Math.cos(e),u=Math.sin(e),s=Math.abs(e-t)>Math.PI?t>=e:e>t;return"M"+n*i+","+n*a+"A"+n+","+n+" 0 0,"+(s?1:0)+" "+n*o+","+n*u+"L"+r*o+","+r*u}function xs(t,n,e,r){var i=(t+e)/2;return"M"+t+","+n+"C"+i+","+n+" "+i+","+r+" "+e+","+r}function bs(t,n,e,r){var i=(n+r)/2;return"M"+t+","+n+"C"+t+","+i+" "+e+","+i+" "+e+","+r}function ws(t,n,e,r){var i=Math.cos(t),a=Math.sin(t),o=Math.cos(e),u=Math.sin(e),s=(n+r)/2;return"M"+n*i+","+n*a+"C"+s*i+","+s*a+" "+s*o+","+s*u+" "+r*o+","+r*u}function Ms(t){Ye.call(this,null,t)}function ks(t){Ye.call(this,null,t),this.modified(!0)}function Es(t,n,e){var r=Ba((t||"linear").toLowerCase());return r(n&&n.toLowerCase(),e)}function Ss(t,n){var e,r=n.domain,i=n.zero||void 0===n.zero&&uS[t.type];return r?((i||null!=n.domainMin||null!=n.domainMax)&&(e=(r=r.slice()).length-1,i&&(r[0]>0&&(r[0]=0),r[e]<0&&(r[e]=0)),null!=n.domainMin&&(r[0]=n.domainMin),null!=n.domainMax&&(r[e]=n.domainMax)),t.domain(r),n.nice&&t.nice&&t.nice(n.nice!==!0&&+n.nice||null),r.length):0}function Cs(t,n,e){var r=t.type,i=n.range;null!=n.bandSize&&("band"!==r&&"point"!==r&&F("Only band and point scales support bandSize."),i=[0,n.bandSize*e]),i&&(n.reverse&&(i=i.slice().reverse()),t[n.round?"rangeRound":"range"](i))}function As(t){Ye.call(this,null,t)}function Ts(t,n,e,r){var i,a,o,u,s,l,f,c,h,d=[],p=function(t){return t(s)};if(null==n)d.push(t.slice());else for(i={},a=0,o=t.length;o>a;++a)s=t[a],l=n.map(p),f=i[l]||(d.push(i[l]=[]),i[l]),f.push(s);for(l=0,h=0,u=d.length;u>l;++l){for(f=d[l],a=0,c=0,o=f.length;o>a;++a)c+=r(f[a]);f.sum=c,c>h&&(h=c),e&&f.sort(e)}return d.max=h,d}function Ns(t,n){function e(){var e,i,a=r.length,o=0,u=0;for(e=0;a>e;++e)i=r[e],o+=i.x,u+=i.y;for(o=o/a-t,u=u/a-n,e=0;a>e;++e)i=r[e],i.x-=o,i.y-=u}var r;return null==t&&(t=0),null==n&&(n=0),e.initialize=function(t){r=t},e.x=function(n){return arguments.length?(t=+n,e):t},e.y=function(t){return arguments.length?(n=+t,e):n},e}function zs(t){return function(){return t}}function Ds(){return 1e-6*(Math.random()-.5)}function Os(t){var n=+this._x.call(null,t),e=+this._y.call(null,t);return Rs(this.cover(n,e),n,e,t)}function Rs(t,n,e,r){if(isNaN(n)||isNaN(e))return t;var i,a,o,u,s,l,f,c,h,d=t._root,p={data:r},g=t._x0,m=t._y0,v=t._x1,y=t._y1;if(!d)return t._root=p,t;for(;d.length;)if((l=n>=(a=(g+v)/2))?g=a:v=a,(f=e>=(o=(m+y)/2))?m=o:y=o,i=d,!(d=d[c=f<<1|l]))return i[c]=p,t;if(u=+t._x.call(null,d.data),s=+t._y.call(null,d.data),n===u&&e===s)return p.next=d,i?i[c]=p:t._root=p,t;do i=i?i[c]=new Array(4):t._root=new Array(4),(l=n>=(a=(g+v)/2))?g=a:v=a,(f=e>=(o=(m+y)/2))?m=o:y=o;while((c=f<<1|l)===(h=(s>=o)<<1|u>=a));return i[h]=d,i[c]=p,t}function Ps(t){var n,e,r,i,a=t.length,o=new Array(a),u=new Array(a),s=1/0,l=1/0,f=-(1/0),c=-(1/0);for(e=0;a>e;++e)isNaN(r=+this._x.call(null,n=t[e]))||isNaN(i=+this._y.call(null,n))||(o[e]=r,u[e]=i,s>r&&(s=r),r>f&&(f=r),l>i&&(l=i),i>c&&(c=i));for(s>f&&(s=this._x0,f=this._x1),l>c&&(l=this._y0,c=this._y1),this.cover(s,l).cover(f,c),e=0;a>e;++e)Rs(this,o[e],u[e],t[e]);return this}function qs(t,n){if(isNaN(t=+t)||isNaN(n=+n))return this;var e=this._x0,r=this._y0,i=this._x1,a=this._y1;if(isNaN(e))i=(e=Math.floor(t))+1,a=(r=Math.floor(n))+1;else{if(!(e>t||t>i||r>n||n>a))return this;var o,u,s=i-e,l=this._root;switch(u=((r+a)/2>n)<<1|(e+i)/2>t){case 0:do o=new Array(4),o[u]=l,l=o;while(s*=2,i=e+s,a=r+s,t>i||n>a);break;case 1:do o=new Array(4),o[u]=l,l=o;while(s*=2,e=i-s,a=r+s,e>t||n>a);break;case 2:do o=new Array(4),o[u]=l,l=o;while(s*=2,i=e+s,r=a-s,t>i||r>n);break;case 3:do o=new Array(4),o[u]=l,l=o;while(s*=2,e=i-s,r=a-s,e>t||r>n)}this._root&&this._root.length&&(this._root=l)}return this._x0=e,this._y0=r,this._x1=i,this._y1=a,this}function Ls(){var t=[];return this.visit(function(n){if(!n.length)do t.push(n.data);while(n=n.next)}),t}function Us(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function Fs(t,n,e,r,i){this.node=t,this.x0=n,this.y0=e,this.x1=r,this.y1=i}function js(t,n,e){var r,i,a,o,u,s,l,f=this._x0,c=this._y0,h=this._x1,d=this._y1,p=[],g=this._root;for(g&&p.push(new Fs(g,f,c,h,d)),null==e?e=1/0:(f=t-e,c=n-e,h=t+e,d=n+e,e*=e);s=p.pop();)if(!(!(g=s.node)||(i=s.x0)>h||(a=s.y0)>d||(o=s.x1)<f||(u=s.y1)<c))if(g.length){var m=(i+o)/2,v=(a+u)/2;p.push(new Fs(g[3],m,v,o,u),new Fs(g[2],i,v,m,u),new Fs(g[1],m,a,o,v),new Fs(g[0],i,a,m,v)),(l=(n>=v)<<1|t>=m)&&(s=p[p.length-1],p[p.length-1]=p[p.length-1-l],p[p.length-1-l]=s)}else{var y=t-+this._x.call(null,g.data),_=n-+this._y.call(null,g.data),x=y*y+_*_;if(e>x){var b=Math.sqrt(e=x);f=t-b,c=n-b,h=t+b,d=n+b,r=g.data}}return r}function Is(t){if(isNaN(a=+this._x.call(null,t))||isNaN(o=+this._y.call(null,t)))return this;var n,e,r,i,a,o,u,s,l,f,c,h,d=this._root,p=this._x0,g=this._y0,m=this._x1,v=this._y1;if(!d)return this;if(d.length)for(;;){if((l=a>=(u=(p+m)/2))?p=u:m=u,(f=o>=(s=(g+v)/2))?g=s:v=s,n=d,!(d=d[c=f<<1|l]))return this;if(!d.length)break;(n[c+1&3]||n[c+2&3]||n[c+3&3])&&(e=n,h=c)}for(;d.data!==t;)if(r=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,r?(i?r.next=i:delete r.next,this):n?(i?n[c]=i:delete n[c],(d=n[0]||n[1]||n[2]||n[3])&&d===(n[3]||n[2]||n[1]||n[0])&&!d.length&&(e?e[h]=d:this._root=d),this):(this._root=i,this)}function $s(t){for(var n=0,e=t.length;e>n;++n)this.remove(t[n]);return this}function Ws(){return this._root}function Bs(){var t=0;return this.visit(function(n){if(!n.length)do++t;while(n=n.next)}),t}function Hs(t){var n,e,r,i,a,o,u=[],s=this._root;for(s&&u.push(new Fs(s,this._x0,this._y0,this._x1,this._y1));n=u.pop();)if(!t(s=n.node,r=n.x0,i=n.y0,a=n.x1,o=n.y1)&&s.length){var l=(r+a)/2,f=(i+o)/2;(e=s[3])&&u.push(new Fs(e,l,f,a,o)),(e=s[2])&&u.push(new Fs(e,r,f,l,o)),(e=s[1])&&u.push(new Fs(e,l,i,a,f)),(e=s[0])&&u.push(new Fs(e,r,i,l,f))}return this}function Ys(t){var n,e=[],r=[];for(this._root&&e.push(new Fs(this._root,this._x0,this._y0,this._x1,this._y1));n=e.pop();){var i=n.node;if(i.length){var a,o=n.x0,u=n.y0,s=n.x1,l=n.y1,f=(o+s)/2,c=(u+l)/2;(a=i[0])&&e.push(new Fs(a,o,u,f,c)),(a=i[1])&&e.push(new Fs(a,f,u,s,c)),(a=i[2])&&e.push(new Fs(a,o,c,f,l)),(a=i[3])&&e.push(new Fs(a,f,c,s,l))}r.push(n)}for(;n=r.pop();)t(n.node,n.x0,n.y0,n.x1,n.y1);return this}function Xs(t){return t[0]}function Gs(t){return arguments.length?(this._x=t,this):this._x}function Js(t){return t[1]}function Vs(t){return arguments.length?(this._y=t,this):this._y}function Zs(t,n,e){var r=new Qs(null==n?Xs:n,null==e?Js:e,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function Qs(t,n,e,r,i,a){this._x=t,this._y=n,this._x0=e,this._y0=r,this._x1=i,this._y1=a,this._root=void 0}function Ks(t){for(var n={data:t.data},e=n;t=t.next;)e=e.next={data:t.data};return n}function tl(t){return t.x+t.vx}function nl(t){return t.y+t.vy}function el(t){function n(){function t(t,e,r,i,o){var u=t.data,d=t.r,p=c+d;{if(!u)return e>l+p||l-p>i||r>f+p||f-p>o;if(u.index>n){var g=l-u.x-u.vx,m=f-u.y-u.vy,v=g*g+m*m;p*p>v&&(0===g&&(g=Ds(),v+=g*g),0===m&&(m=Ds(),v+=m*m),v=(p-(v=Math.sqrt(v)))/v*a,s.vx+=(g*=v)*(p=(d*=d)/(h+d)),s.vy+=(m*=v)*p,u.vx-=g*(p=1-p),u.vy-=m*p)}}}for(var n,u,s,l,f,c,h,d=r.length,p=0;o>p;++p)for(u=Zs(r,tl,nl).visitAfter(e),n=0;d>n;++n)s=r[n],c=i[n],h=c*c,l=s.x+s.vx,f=s.y+s.vy,u.visit(t)}function e(t){if(t.data)return t.r=i[t.data.index];for(var n=t.r=0;4>n;++n)t[n]&&t[n].r>t.r&&(t.r=t[n].r)}var r,i,a=1,o=1;return"function"!=typeof t&&(t=zs(null==t?1:+t)),n.initialize=function(n){var e,a=(r=n).length;for(i=new Array(a),e=0;a>e;++e)i[e]=+t(r[e],e,r)},n.iterations=function(t){return arguments.length?(o=+t,n):o},n.strength=function(t){return arguments.length?(a=+t,n):a},n.radius=function(e){return arguments.length?(t="function"==typeof e?e:zs(+e),n):t},n}function rl(t,n){return n}function il(t){function n(t){return 1/Math.min(l[t.source.index],l[t.target.index])}function e(n){for(var e=0,r=t.length;p>e;++e)for(var i,a,s,l,c,h,d,g=0;r>g;++g)i=t[g],a=i.source,s=i.target,l=s.x+s.vx-a.x-a.vx||Ds(),c=s.y+s.vy-a.y-a.vy||Ds(),h=Math.sqrt(l*l+c*c),h=(h-u[g])/h*n*o[g],l*=h,c*=h,s.vx-=l*(d=f[g]),s.vy-=c*d,a.vx+=l*(d=1-d),a.vy+=c*d}function r(){if(s){var n,e,r=s.length,h=t.length,d=K(s,c);for(n=0,l=new Array(r);r>n;++n)l[n]=0;for(n=0;h>n;++n)e=t[n],e.index=n,"object"!=typeof e.source&&(e.source=d.get(e.source)),"object"!=typeof e.target&&(e.target=d.get(e.target)),++l[e.source.index],++l[e.target.index];for(n=0,f=new Array(h);h>n;++n)e=t[n],f[n]=l[e.source.index]/(l[e.source.index]+l[e.target.index]);o=new Array(h),i(),u=new Array(h),a()}}function i(){if(s)for(var n=0,e=t.length;e>n;++n)o[n]=+h(t[n],n,t)}function a(){if(s)for(var n=0,e=t.length;e>n;++n)u[n]=+d(t[n],n,t)}var o,u,s,l,f,c=rl,h=n,d=zs(30),p=1;return null==t&&(t=[]),e.initialize=function(t){s=t,r()},e.links=function(n){return arguments.length?(t=n,r(),e):t},e.id=function(t){return arguments.length?(c=t,e):c},e.iterations=function(t){return arguments.length?(p=+t,e):p},e.strength=function(t){return arguments.length?(h="function"==typeof t?t:zs(+t),i(),e):h},e.distance=function(t){return arguments.length?(d="function"==typeof t?t:zs(+t),a(),e):d},e}function al(){return MS||(SS(ol),MS=ES.now()+kS)}function ol(){MS=0}function ul(){this._call=this._time=this._next=null}function sl(t,n,e){var r=new ul;return r.restart(t,n,e),r}function ll(){al(),++yS;for(var t,n=mS;n;)(t=MS-n._time)>=0&&n._call.call(null,t),n=n._next;--yS}function fl(){MS=(wS=ES.now())+kS,yS=_S=0;try{ll()}finally{yS=0,hl(),MS=0}}function cl(){var t=ES.now(),n=t-wS;n>bS&&(kS-=n,wS=t)}function hl(){for(var t,n,e=mS,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:mS=n);vS=t,dl(r)}function dl(t){if(!yS){_S&&(_S=clearTimeout(_S));var n=t-MS;n>24?(1/0>t&&(_S=setTimeout(fl,n)),xS&&(xS=clearInterval(xS))):(xS||(xS=setInterval(cl,bS)),yS=1,SS(fl))}}function pl(t){return t.x}function gl(t){return t.y}function ml(t){function n(){e(),d.call("tick",a),u>o&&(h.stop(),d.call("end",a))}function e(){var n,e,r=t.length;for(o+=(l-o)*s,c.each(function(t){t(o)}),n=0;r>n;++n)e=t[n],null==e.fx?e.x+=e.vx*=f:(e.x=e.fx,e.vx=0),null==e.fy?e.y+=e.vy*=f:(e.y=e.fy,e.vy=0)}function r(){for(var n,e=0,r=t.length;r>e;++e){if(n=t[e],n.index=e,isNaN(n.x)||isNaN(n.y)){var i=CS*Math.sqrt(e),a=e*AS;n.x=i*Math.cos(a),n.y=i*Math.sin(a)}(isNaN(n.vx)||isNaN(n.vy))&&(n.vx=n.vy=0)}}function i(n){return n.initialize&&n.initialize(t),n}var a,o=1,u=.001,s=1-Math.pow(u,1/300),l=0,f=.6,c=K(),h=sl(n),d=at("tick","end");return null==t&&(t=[]),r(),a={tick:e,restart:function(){return h.restart(n),a},stop:function(){return h.stop(),a},nodes:function(n){return arguments.length?(t=n,r(),c.each(i),a):t},alpha:function(t){return arguments.length?(o=+t,a):o},alphaMin:function(t){return arguments.length?(u=+t,a):u},alphaDecay:function(t){return arguments.length?(s=+t,a):+s},alphaTarget:function(t){return arguments.length?(l=+t,a):l},velocityDecay:function(t){return arguments.length?(f=1-t,a):1-f},force:function(t,n){return arguments.length>1?(null==n?c.remove(t):c.set(t,i(n)),a):c.get(t)},find:function(n,e,r){var i,a,o,u,s,l=0,f=t.length;for(null==r?r=1/0:r*=r,l=0;f>l;++l)u=t[l],i=n-u.x,a=e-u.y,o=i*i+a*a,r>o&&(s=u,r=o);return s},on:function(t,n){return arguments.length>1?(d.on(t,n),a):d.on(t)}}}function vl(){function t(t){var n,u=i.length,s=Zs(i,pl,gl).visitAfter(e);for(o=t,n=0;u>n;++n)a=i[n],s.visit(r)}function n(){if(i){var t,n=i.length;for(u=new Array(n),t=0;n>t;++t)u[t]=+s(i[t],t,i)}}function e(t){var n,e,r,i,a,o=0;if(t.length){for(r=i=a=0;4>a;++a)(n=t[a])&&(e=n.value)&&(o+=e,r+=e*n.x,i+=e*n.y);t.x=r/o,t.y=i/o}else{n=t,n.x=n.data.x,n.y=n.data.y;do o+=u[n.data.index];while(n=n.next)}t.value=o}function r(t,n,e,r){if(!t.value)return!0;var i=t.x-a.x,s=t.y-a.y,h=r-n,d=i*i+s*s;if(d>h*h/c)return f>d&&(0===i&&(i=Ds(),d+=i*i),0===s&&(s=Ds(),d+=s*s),l>d&&(d=Math.sqrt(l*d)),a.vx+=i*t.value*o/d,a.vy+=s*t.value*o/d),!0;if(!(t.length||d>=f)){(t.data!==a||t.next)&&(0===i&&(i=Ds(),d+=i*i),0===s&&(s=Ds(),d+=s*s),l>d&&(d=Math.sqrt(l*d)));do t.data!==a&&(h=u[t.data.index]*o/d,a.vx+=i*h,a.vy+=s*h);while(t=t.next)}}var i,a,o,u,s=zs(-30),l=1,f=1/0,c=.81;return t.initialize=function(t){i=t,n()},t.strength=function(e){return arguments.length?(s="function"==typeof e?e:zs(+e),n(),t):s},t.distanceMin=function(n){return arguments.length?(l=n*n,t):Math.sqrt(l)},t.distanceMax=function(n){return arguments.length?(f=n*n,t):Math.sqrt(f)},t.theta=function(n){return arguments.length?(c=n*n,t):Math.sqrt(c)},t}function yl(t){function n(t){for(var n,e=0,o=r.length;o>e;++e)n=r[e],n.vx+=(a[e]-n.x)*i[e]*t}function e(){if(r){var n,e=r.length;for(i=new Array(e),a=new Array(e),n=0;e>n;++n)i[n]=isNaN(a[n]=+t(r[n],n,r))?0:+o(r[n],n,r)}}var r,i,a,o=zs(.1);return"function"!=typeof t&&(t=zs(null==t?0:+t)),n.initialize=function(t){r=t,e()},n.strength=function(t){return arguments.length?(o="function"==typeof t?t:zs(+t),e(),n):o},n.x=function(r){return arguments.length?(t="function"==typeof r?r:zs(+r),e(),n):t},n}function _l(t){function n(t){for(var n,e=0,o=r.length;o>e;++e)n=r[e],n.vy+=(a[e]-n.y)*i[e]*t}function e(){if(r){var n,e=r.length;for(i=new Array(e),a=new Array(e),n=0;e>n;++n)i[n]=isNaN(a[n]=+t(r[n],n,r))?0:+o(r[n],n,r)}}var r,i,a,o=zs(.1);return"function"!=typeof t&&(t=zs(null==t?0:+t)),n.initialize=function(t){r=t,e()},n.strength=function(t){return arguments.length?(o="function"==typeof t?t:zs(+t),e(),n):o},n.y=function(r){return arguments.length?(t="function"==typeof r?r:zs(+r),e(),n):t},n}function xl(t){Ye.call(this,null,t)}function bl(t,n){return function(){t.touch(n).run()}}function wl(t,n){var e=ml(t),r=!1,i=e.stop,a=e.restart;return e.stopped=function(){return r},e.restart=function(){return r=!1,a()},e.stop=function(){return r=!0,i()},Ml(e,n,!0).on("end",function(){r=!0})}function Ml(t,n,e){var r,i,a,o=P(n.forces);
for(r=0,i=zS.length;i>r;++r)a=zS[r],a!==NS&&n.modified(a)&&t[a](n[a]);for(r=0,i=o.length;i>r;++r)(e||n.modified(NS,r))&&t.force(NS+r,kl(o[r]));for(i=t.numForces||0;i>r;++r)t.force(NS+r,null);return t.numForces=o.length,t}function kl(t){var n,e;TS.hasOwnProperty(t.force)||F("Unrecognized force: "+t.force),n=TS[t.force]();for(e in t)L(n[e])&&n[e](t[e]);return n}function El(t,n){return t.parent===n.parent?1:2}function Sl(t){return t.reduce(Cl,0)/t.length}function Cl(t,n){return t+n.x}function Al(t){return 1+t.reduce(Tl,0)}function Tl(t,n){return Math.max(t,n.y)}function Nl(t){for(var n;n=t.children;)t=n[0];return t}function zl(t){for(var n;n=t.children;)t=n[n.length-1];return t}function Dl(){function t(t){var a,o=0;t.eachAfter(function(t){var e=t.children;e?(t.x=Sl(e),t.y=Al(e)):(t.x=a?o+=n(t,a):0,t.y=0,a=t)});var u=Nl(t),s=zl(t),l=u.x-n(u,s)/2,f=s.x+n(s,u)/2;return t.eachAfter(i?function(n){n.x=(n.x-t.x)*e,n.y=(t.y-n.y)*r}:function(n){n.x=(n.x-l)/(f-l)*e,n.y=(1-(t.y?n.y/t.y:1))*r})}var n=El,e=1,r=1,i=!1;return t.separation=function(e){return arguments.length?(n=e,t):n},t.size=function(n){return arguments.length?(i=!1,e=+n[0],r=+n[1],t):i?null:[e,r]},t.nodeSize=function(n){return arguments.length?(i=!0,e=+n[0],r=+n[1],t):i?[e,r]:null},t}function Ol(t){var n,e,r,i,a=this,o=[a];do for(n=o.reverse(),o=[];a=n.pop();)if(t(a),e=a.children)for(r=0,i=e.length;i>r;++r)o.push(e[r]);while(o.length);return this}function Rl(t){for(var n,e,r=this,i=[r];r=i.pop();)if(t(r),n=r.children)for(e=n.length-1;e>=0;--e)i.push(n[e]);return this}function Pl(t){for(var n,e,r,i=this,a=[i],o=[];i=a.pop();)if(o.push(i),n=i.children)for(e=0,r=n.length;r>e;++e)a.push(n[e]);for(;i=o.pop();)t(i);return this}function ql(t){return this.eachAfter(function(n){for(var e=+t(n.data)||0,r=n.children,i=r&&r.length;--i>=0;)e+=r[i].value;n.value=e})}function Ll(t){return this.eachBefore(function(n){n.children&&n.children.sort(t)})}function Ul(t){for(var n=this,e=Fl(n,t),r=[n];n!==e;)n=n.parent,r.push(n);for(var i=r.length;t!==e;)r.splice(i,0,t),t=t.parent;return r}function Fl(t,n){if(t===n)return t;var e=t.ancestors(),r=n.ancestors(),i=null;for(t=e.pop(),n=r.pop();t===n;)i=t,t=e.pop(),n=r.pop();return i}function jl(){for(var t=this,n=[t];t=t.parent;)n.push(t);return n}function Il(){var t=[];return this.each(function(n){t.push(n)}),t}function $l(){var t=[];return this.eachBefore(function(n){n.children||t.push(n)}),t}function Wl(){var t=this,n=[];return t.each(function(e){e!==t&&n.push({source:e.parent,target:e})}),n}function Bl(t,n){var e,r,i,a,o,u=new Jl(t),s=+t.value&&(u.value=t.value),l=[u];for(null==n&&(n=Yl);e=l.pop();)if(s&&(e.value=+e.data.value),(i=n(e.data))&&(o=i.length))for(e.children=new Array(o),a=o-1;a>=0;--a)l.push(r=e.children[a]=new Jl(i[a])),r.parent=e,r.depth=e.depth+1;return u.eachBefore(Gl)}function Hl(){return Bl(this).eachBefore(Xl)}function Yl(t){return t.children}function Xl(t){t.data=t.data.data}function Gl(t){var n=0;do t.height=n;while((t=t.parent)&&t.height<++n)}function Jl(t){this.data=t,this.depth=this.height=0,this.parent=null}function Vl(t){this._=t,this.next=null}function Zl(t){for(var n,e=(t=t.slice()).length,r=null,i=r;e;){var a=new Vl(t[e-1]);i=i?i.next=a:r=a,t[n]=t[--e]}return{head:r,tail:i}}function Ql(t){return tf(Zl(t),[])}function Kl(t,n){var e=n.x-t.x,r=n.y-t.y,i=t.r-n.r;return i*i+1e-6>e*e+r*r}function tf(t,n){var e,r,i,a=null,o=t.head;switch(n.length){case 1:e=nf(n[0]);break;case 2:e=ef(n[0],n[1]);break;case 3:e=rf(n[0],n[1],n[2])}for(;o;)i=o._,r=o.next,e&&Kl(e,i)?a=o:(a?(t.tail=a,a.next=null):t.head=t.tail=null,n.push(i),e=tf(t,n),n.pop(),t.head?(o.next=t.head,t.head=o):(o.next=null,t.head=t.tail=o),a=t.tail,a.next=r),o=r;return t.tail=a,e}function nf(t){return{x:t.x,y:t.y,r:t.r}}function ef(t,n){var e=t.x,r=t.y,i=t.r,a=n.x,o=n.y,u=n.r,s=a-e,l=o-r,f=u-i,c=Math.sqrt(s*s+l*l);return{x:(e+a+s/c*f)/2,y:(r+o+l/c*f)/2,r:(c+i+u)/2}}function rf(t,n,e){var r=t.x,i=t.y,a=t.r,o=n.x,u=n.y,s=n.r,l=e.x,f=e.y,c=e.r,h=2*(r-o),d=2*(i-u),p=2*(s-a),g=r*r+i*i-a*a-o*o-u*u+s*s,m=2*(r-l),v=2*(i-f),y=2*(c-a),_=r*r+i*i-a*a-l*l-f*f+c*c,x=m*d-h*v,b=(d*_-v*g)/x-r,w=(v*p-d*y)/x,M=(m*g-h*_)/x-i,k=(h*y-m*p)/x,E=w*w+k*k-1,S=2*(b*w+M*k+a),C=b*b+M*M-a*a,A=(-S-Math.sqrt(S*S-4*E*C))/(2*E);return{x:b+w*A+r,y:M+k*A+i,r:A}}function af(t,n,e){var r=t.x,i=t.y,a=n.r+e.r,o=t.r+e.r,u=n.x-r,s=n.y-i,l=u*u+s*s;if(l){var f=.5+((o*=o)-(a*=a))/(2*l),c=Math.sqrt(Math.max(0,2*a*(o+l)-(o-=l)*o-a*a))/(2*l);e.x=r+f*u+c*s,e.y=i+f*s-c*u}else e.x=r+o,e.y=i}function of(t,n){var e=n.x-t.x,r=n.y-t.y,i=t.r+n.r;return i*i>e*e+r*r}function uf(t,n,e){var r=t.x-n,i=t.y-e;return r*r+i*i}function sf(t){this._=t,this.next=null,this.previous=null}function lf(t){if(!(i=t.length))return 0;var n,e,r,i;if(n=t[0],n.x=0,n.y=0,!(i>1))return n.r;if(e=t[1],n.x=-e.r,e.x=n.r,e.y=0,!(i>2))return n.r+e.r;af(e,n,r=t[2]);var a,o,u,s,l,f,c,h=n.r*n.r,d=e.r*e.r,p=r.r*r.r,g=h+d+p,m=h*n.x+d*e.x+p*r.x,v=h*n.y+d*e.y+p*r.y;n=new sf(n),e=new sf(e),r=new sf(r),n.next=r.previous=e,e.next=n.previous=r,r.next=e.previous=n;t:for(u=3;i>u;++u){if(af(n._,e._,r=t[u]),r=new sf(r),(l=n.previous)===(s=e.next)){if(of(s._,r._)){n=e,e=s,--u;continue t}}else{f=s._.r,c=l._.r;do if(c>=f){if(of(s._,r._)){e=s,n.next=e,e.previous=n,--u;continue t}s=s.next,f+=s._.r}else{if(of(l._,r._)){n=l,n.next=e,e.previous=n,--u;continue t}l=l.previous,c+=l._.r}while(s!==l.next)}for(r.previous=n,r.next=e,n.next=e.previous=e=r,g+=p=r._.r*r._.r,m+=p*r._.x,v+=p*r._.y,h=uf(n._,a=m/g,o=v/g);(r=r.next)!==e;)(p=uf(r._,a,o))<h&&(n=r,h=p);e=n.next}for(n=[e._],r=e;(r=r.next)!==e;)n.push(r._);for(r=Ql(n),u=0;i>u;++u)n=t[u],n.x-=r.x,n.y-=r.y;return r.r}function ff(t){return null==t?null:cf(t)}function cf(t){if("function"!=typeof t)throw new Error;return t}function hf(){return 0}function df(t){return function(){return t}}function pf(t){return Math.sqrt(t.value)}function gf(){function t(t){return t.x=e/2,t.y=r/2,n?t.eachBefore(mf(n)).eachAfter(vf(i,.5)).eachBefore(yf(1)):t.eachBefore(mf(pf)).eachAfter(vf(hf,1)).eachAfter(vf(i,t.r/Math.min(e,r))).eachBefore(yf(Math.min(e,r)/(2*t.r))),t}var n=null,e=1,r=1,i=hf;return t.radius=function(e){return arguments.length?(n=ff(e),t):n},t.size=function(n){return arguments.length?(e=+n[0],r=+n[1],t):[e,r]},t.padding=function(n){return arguments.length?(i="function"==typeof n?n:df(+n),t):i},t}function mf(t){return function(n){n.children||(n.r=Math.max(0,+t(n)||0))}}function vf(t,n){return function(e){if(r=e.children){var r,i,a,o=r.length,u=t(e)*n||0;if(u)for(i=0;o>i;++i)r[i].r+=u;if(a=lf(r),u)for(i=0;o>i;++i)r[i].r-=u;e.r=a+u}}}function yf(t){return function(n){var e=n.parent;n.r*=t,e&&(n.x=e.x+t*n.x,n.y=e.y+t*n.y)}}function _f(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function xf(t,n,e,r,i){for(var a,o=t.children,u=-1,s=o.length,l=t.value&&(r-n)/t.value;++u<s;)a=o[u],a.y0=e,a.y1=i,a.x0=n,a.x1=n+=a.value*l}function bf(){function t(t){var o=t.height+1;return t.x0=t.y0=i,t.x1=e,t.y1=r/o,t.eachBefore(n(r,o)),a&&t.eachBefore(_f),t}function n(t,n){return function(e){e.children&&xf(e,e.x0,t*(e.depth+1)/n,e.x1,t*(e.depth+2)/n);var r=e.x0,a=e.y0,o=e.x1-i,u=e.y1-i;r>o&&(r=o=(r+o)/2),a>u&&(a=u=(a+u)/2),e.x0=r,e.y0=a,e.x1=o,e.y1=u}}var e=1,r=1,i=0,a=!1;return t.round=function(n){return arguments.length?(a=!!n,t):a},t.size=function(n){return arguments.length?(e=+n[0],r=+n[1],t):[e,r]},t.padding=function(n){return arguments.length?(i=+n,t):i},t}function wf(t){return t.id}function Mf(t){return t.parentId}function kf(){function t(t){var r,i,a,o,u,s,l,f=t.length,c=new Array(f),h={};for(i=0;f>i;++i)r=t[i],u=c[i]=new Jl(r),null!=(s=n(r,i,t))&&(s+="")&&(l=qS+(u.id=s),h[l]=l in h?US:u);for(i=0;f>i;++i)if(u=c[i],s=e(t[i],i,t),null!=s&&(s+="")){if(o=h[qS+s],!o)throw new Error("missing: "+s);if(o===US)throw new Error("ambiguous: "+s);o.children?o.children.push(u):o.children=[u],u.parent=o}else{if(a)throw new Error("multiple roots");a=u}if(!a)throw new Error("no root");if(a.parent=LS,a.eachBefore(function(t){t.depth=t.parent.depth+1,--f}).eachBefore(Gl),a.parent=null,f>0)throw new Error("cycle");return a}var n=wf,e=Mf;return t.id=function(e){return arguments.length?(n=cf(e),t):n},t.parentId=function(n){return arguments.length?(e=cf(n),t):e},t}function Ef(t,n){return t.parent===n.parent?1:2}function Sf(t){var n=t.children;return n?n[0]:t.t}function Cf(t){var n=t.children;return n?n[n.length-1]:t.t}function Af(t,n,e){var r=e/(n.i-t.i);n.c-=r,n.s+=e,t.c+=r,n.z+=e,n.m+=e}function Tf(t){for(var n,e=0,r=0,i=t.children,a=i.length;--a>=0;)n=i[a],n.z+=e,n.m+=e,e+=n.s+(r+=n.c)}function Nf(t,n,e){return t.a.parent===n.parent?t.a:e}function zf(t,n){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=n}function Df(t){for(var n,e,r,i,a,o=new zf(t,0),u=[o];n=u.pop();)if(r=n._.children)for(n.children=new Array(a=r.length),i=a-1;i>=0;--i)u.push(e=n.children[i]=new zf(r[i],i)),e.parent=n;return(o.parent=new zf(null,0)).children=[o],o}function Of(){function t(t){var r=Df(t);if(r.eachAfter(n),r.parent.m=-r.z,r.eachBefore(e),s)t.eachBefore(i);else{var l=t,f=t,c=t;t.eachBefore(function(t){t.x<l.x&&(l=t),t.x>f.x&&(f=t),t.depth>c.depth&&(c=t)});var h=l===f?1:a(l,f)/2,d=h-l.x,p=o/(f.x+h+d),g=u/(c.depth||1);t.eachBefore(function(t){t.x=(t.x+d)*p,t.y=t.depth*g})}return t}function n(t){var n=t.children,e=t.parent.children,i=t.i?e[t.i-1]:null;if(n){Tf(t);var o=(n[0].z+n[n.length-1].z)/2;i?(t.z=i.z+a(t._,i._),t.m=t.z-o):t.z=o}else i&&(t.z=i.z+a(t._,i._));t.parent.A=r(t,i,t.parent.A||e[0])}function e(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function r(t,n,e){if(n){for(var r,i=t,o=t,u=n,s=i.parent.children[0],l=i.m,f=o.m,c=u.m,h=s.m;u=Cf(u),i=Sf(i),u&&i;)s=Sf(s),o=Cf(o),o.a=t,r=u.z+c-i.z-l+a(u._,i._),r>0&&(Af(Nf(u,t,e),t,r),l+=r,f+=r),c+=u.m,l+=i.m,h+=s.m,f+=o.m;u&&!Cf(o)&&(o.t=u,o.m+=c-f),i&&!Sf(s)&&(s.t=i,s.m+=l-h,e=t)}return e}function i(t){t.x*=o,t.y=t.depth*u}var a=Ef,o=1,u=1,s=null;return t.separation=function(n){return arguments.length?(a=n,t):a},t.size=function(n){return arguments.length?(s=!1,o=+n[0],u=+n[1],t):s?null:[o,u]},t.nodeSize=function(n){return arguments.length?(s=!0,o=+n[0],u=+n[1],t):s?[o,u]:null},t}function Rf(t,n,e,r,i){for(var a,o=t.children,u=-1,s=o.length,l=t.value&&(i-e)/t.value;++u<s;)a=o[u],a.x0=n,a.x1=r,a.y0=e,a.y1=e+=a.value*l}function Pf(t,n,e,r,i,a){for(var o,u,s,l,f,c,h,d,p,g,m,v,y=[],_=n.children,x=0,b=_.length,w=n.value;b>x;){for(l=i-e,f=a-r,h=d=c=_[x].value,m=Math.max(f/l,l/f)/(w*t),v=c*c*m,g=Math.max(d/v,v/h),s=x+1;b>s;++s){if(c+=u=_[s].value,h>u&&(h=u),u>d&&(d=u),v=c*c*m,p=Math.max(d/v,v/h),p>g){c-=u;break}g=p}y.push(o={value:c,dice:f>l,children:_.slice(x,s)}),o.dice?xf(o,e,r,i,w?r+=f*c/w:a):Rf(o,e,r,w?e+=l*c/w:i,a),w-=c,x=s}return y}function qf(){function t(t){return t.x0=t.y0=0,t.x1=i,t.y1=a,t.eachBefore(n),o=[0],r&&t.eachBefore(_f),t}function n(t){var n=o[t.depth],r=t.x0+n,i=t.y0+n,a=t.x1-n,h=t.y1-n;r>a&&(r=a=(r+a)/2),i>h&&(i=h=(i+h)/2),t.x0=r,t.y0=i,t.x1=a,t.y1=h,t.children&&(n=o[t.depth+1]=u(t)/2,r+=c(t)-n,i+=s(t)-n,a-=l(t)-n,h-=f(t)-n,r>a&&(r=a=(r+a)/2),i>h&&(i=h=(i+h)/2),e(t,r,i,a,h))}var e=jS,r=!1,i=1,a=1,o=[0],u=hf,s=hf,l=hf,f=hf,c=hf;return t.round=function(n){return arguments.length?(r=!!n,t):r},t.size=function(n){return arguments.length?(i=+n[0],a=+n[1],t):[i,a]},t.tile=function(n){return arguments.length?(e=cf(n),t):e},t.padding=function(n){return arguments.length?t.paddingInner(n).paddingOuter(n):t.paddingInner()},t.paddingInner=function(n){return arguments.length?(u="function"==typeof n?n:df(+n),t):u},t.paddingOuter=function(n){return arguments.length?t.paddingTop(n).paddingRight(n).paddingBottom(n).paddingLeft(n):t.paddingTop()},t.paddingTop=function(n){return arguments.length?(s="function"==typeof n?n:df(+n),t):s},t.paddingRight=function(n){return arguments.length?(l="function"==typeof n?n:df(+n),t):l},t.paddingBottom=function(n){return arguments.length?(f="function"==typeof n?n:df(+n),t):f},t.paddingLeft=function(n){return arguments.length?(c="function"==typeof n?n:df(+n),t):c},t}function Lf(t,n,e,r,i){function a(t,n,e,r,i,o,u){if(t>=n-1){var l=s[t];return l.x0=r,l.y0=i,l.x1=o,l.y1=u,void 0}for(var c=f[t],h=e/2+c,d=t+1,p=n-1;p>d;){var g=d+p>>>1;f[g]<h?d=g+1:p=g}var m=f[d]-c,v=e-m;if(u-i>o-r){var y=(i*v+u*m)/e;a(t,d,m,r,i,o,y),a(d,n,v,r,y,o,u)}else{var _=(r*v+o*m)/e;a(t,d,m,r,i,_,u),a(d,n,v,_,i,o,u)}}var o,u,s=t.children,l=s.length,f=new Array(l+1);for(f[0]=u=o=0;l>o;++o)f[o+1]=u+=s[o].value;a(0,l,t.value,n,e,r,i)}function Uf(t,n,e,r,i){(1&t.depth?Rf:xf)(t,n,e,r,i)}function Ff(t){Ye.call(this,null,t)}function jf(t){return t.values}function If(t){Ye.call(this,null,t)}function $f(t){Ye.call(this,{},t)}function Wf(t){var n;return t.parent&&(n=t.parent.data)&&"_id"in n&&n}function Bf(t){var n=t||"tidy";return YS.hasOwnProperty(n)?YS[n]():void F("Unrecognized Tree layout method: "+n)}function Hf(){var t=qf();return t.ratio=function(n){var e=t.tile();e.ratio&&t.tile(e.ratio(n))},t.method=function(n){HS.hasOwnProperty(n)?t.tile(HS[n]):F("Unrecognized Treemap layout method: "+n)},t}function Yf(t){Ye.call(this,null,t)}function Xf(t,n,e){for(var r,i=0,a=n.length;a>i;++i)r=n[i],r in e&&t[r](e[r])}function Gf(t,n,e){for(var r=t.data,i=0,a=n.length-1;a>i;++i)r[e[i]]=t[n[i]];r[e[a]]=t.children?t.children.length:0}function Jf(t){Yf.call(this,t)}function Vf(t){Yf.call(this,t)}function Zf(t){Yf.call(this,t)}function Qf(t){Yf.call(this,t)}function Kf(t){return function(){return t}}function tc(t){return t[0]}function nc(t){return t[1]}function ec(){this._=null}function rc(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function ic(t,n){var e=n,r=n.R,i=e.U;i?i.L===e?i.L=r:i.R=r:t._=r,r.U=i,e.U=r,e.R=r.L,e.R&&(e.R.U=e),r.L=e}function ac(t,n){var e=n,r=n.L,i=e.U;i?i.L===e?i.L=r:i.R=r:t._=r,r.U=i,e.U=r,e.L=r.R,e.L&&(e.L.U=e),r.R=e}function oc(t){for(;t.L;)t=t.L;return t}function uc(t,n,e,r){var i=[null,null],a=aC.push(i)-1;return i.left=t,i.right=n,e&&lc(i,t,n,e),r&&lc(i,n,t,r),rC[t.index].halfedges.push(a),rC[n.index].halfedges.push(a),i}function sc(t,n,e){var r=[n,e];return r.left=t,r}function lc(t,n,e,r){t[0]||t[1]?t.left===e?t[1]=r:t[0]=r:(t[0]=r,t.left=n,t.right=e)}function fc(t,n,e,r,i){var a,o=t[0],u=t[1],s=o[0],l=o[1],f=u[0],c=u[1],h=0,d=1,p=f-s,g=c-l;if(a=n-s,p||!(a>0)){if(a/=p,0>p){if(h>a)return;d>a&&(d=a)}else if(p>0){if(a>d)return;a>h&&(h=a)}if(a=r-s,p||!(0>a)){if(a/=p,0>p){if(a>d)return;a>h&&(h=a)}else if(p>0){if(h>a)return;d>a&&(d=a)}if(a=e-l,g||!(a>0)){if(a/=g,0>g){if(h>a)return;d>a&&(d=a)}else if(g>0){if(a>d)return;a>h&&(h=a)}if(a=i-l,g||!(0>a)){if(a/=g,0>g){if(a>d)return;a>h&&(h=a)}else if(g>0){if(h>a)return;d>a&&(d=a)}return h>0||1>d?(h>0&&(t[0]=[s+h*p,l+h*g]),1>d&&(t[1]=[s+d*p,l+d*g]),!0):!0}}}}}function cc(t,n,e,r,i){var a=t[1];if(a)return!0;var o,u,s=t[0],l=t.left,f=t.right,c=l[0],h=l[1],d=f[0],p=f[1],g=(c+d)/2,m=(h+p)/2;if(p===h){if(n>g||g>=r)return;if(c>d){if(s){if(s[1]>=i)return}else s=[g,e];a=[g,i]}else{if(s){if(s[1]<e)return}else s=[g,i];a=[g,e]}}else if(o=(c-d)/(p-h),u=m-o*g,-1>o||o>1)if(c>d){if(s){if(s[1]>=i)return}else s=[(e-u)/o,e];a=[(i-u)/o,i]}else{if(s){if(s[1]<e)return}else s=[(i-u)/o,i];a=[(e-u)/o,e]}else if(p>h){if(s){if(s[0]>=r)return}else s=[n,o*n+u];a=[r,o*r+u]}else{if(s){if(s[0]<n)return}else s=[r,o*r+u];a=[n,o*n+u]}return t[0]=s,t[1]=a,!0}function hc(t,n,e,r){for(var i,a=aC.length;a--;)cc(i=aC[a],t,n,e,r)&&fc(i,t,n,e,r)&&(Math.abs(i[0][0]-i[1][0])>sC||Math.abs(i[0][1]-i[1][1])>sC)||delete aC[a]}function dc(t){return rC[t.index]={site:t,halfedges:[]}}function pc(t,n){var e=t.site,r=n.left,i=n.right;return e===i&&(i=r,r=e),i?Math.atan2(i[1]-r[1],i[0]-r[0]):(e===r?(r=n[1],i=n[0]):(r=n[0],i=n[1]),Math.atan2(r[0]-i[0],i[1]-r[1]))}function gc(t,n){return n[+(n.left!==t.site)]}function mc(t,n){return n[+(n.left===t.site)]}function vc(){for(var t,n,e,r,i=0,a=rC.length;a>i;++i)if((t=rC[i])&&(r=(n=t.halfedges).length)){var o=new Array(r),u=new Array(r);for(e=0;r>e;++e)o[e]=e,u[e]=pc(t,aC[n[e]]);for(o.sort(function(t,n){return u[n]-u[t]}),e=0;r>e;++e)u[e]=n[o[e]];for(e=0;r>e;++e)n[e]=u[e]}}function yc(t,n,e,r){var i,a,o,u,s,l,f,c,h,d,p,g,m=rC.length,v=!0;for(i=0;m>i;++i)if(a=rC[i]){for(o=a.site,s=a.halfedges,u=s.length;u--;)aC[s[u]]||s.splice(u,1);for(u=0,l=s.length;l>u;)d=mc(a,aC[s[u]]),p=d[0],g=d[1],f=gc(a,aC[s[++u%l]]),c=f[0],h=f[1],(Math.abs(p-c)>sC||Math.abs(g-h)>sC)&&(s.splice(u,0,aC.push(sc(o,d,Math.abs(p-t)<sC&&r-g>sC?[t,Math.abs(c-t)<sC?h:r]:Math.abs(g-r)<sC&&e-p>sC?[Math.abs(h-r)<sC?c:e,r]:Math.abs(p-e)<sC&&g-n>sC?[e,Math.abs(c-e)<sC?h:n]:Math.abs(g-n)<sC&&p-t>sC?[Math.abs(h-n)<sC?c:t,n]:null))-1),++l);l&&(v=!1)}if(v){var y,_,x,b=1/0;for(i=0,v=null;m>i;++i)(a=rC[i])&&(o=a.site,y=o[0]-t,_=o[1]-n,x=y*y+_*_,b>x&&(b=x,v=a));if(v){var w=[t,n],M=[t,r],k=[e,r],E=[e,n];v.halfedges.push(aC.push(sc(o=v.site,w,M))-1,aC.push(sc(o,M,k))-1,aC.push(sc(o,k,E))-1,aC.push(sc(o,E,w))-1)}}for(i=0;m>i;++i)(a=rC[i])&&(a.halfedges.length||delete rC[i])}function _c(){rc(this),this.x=this.y=this.arc=this.site=this.cy=null}function xc(t){var n=t.P,e=t.N;if(n&&e){var r=n.site,i=t.site,a=e.site;if(r!==a){var o=i[0],u=i[1],s=r[0]-o,l=r[1]-u,f=a[0]-o,c=a[1]-u,h=2*(s*c-l*f);if(!(h>=-lC)){var d=s*s+l*l,p=f*f+c*c,g=(c*d-l*p)/h,m=(s*p-f*d)/h,v=oC.pop()||new _c;v.arc=t,v.site=i,v.x=g+o,v.y=(v.cy=m+u)+Math.sqrt(g*g+m*m),t.circle=v;for(var y=null,_=iC._;_;)if(v.y<_.y||v.y===_.y&&v.x<=_.x){if(!_.L){y=_.P;break}_=_.L}else{if(!_.R){y=_;break}_=_.R}iC.insert(y,v),y||(nC=v)}}}}function bc(t){var n=t.circle;n&&(n.P||(nC=n.N),iC.remove(n),oC.push(n),rc(n),t.circle=null)}function wc(){rc(this),this.edge=this.site=this.circle=null}function Mc(t){var n=uC.pop()||new wc;return n.site=t,n}function kc(t){bc(t),eC.remove(t),uC.push(t),rc(t)}function Ec(t){var n=t.circle,e=n.x,r=n.cy,i=[e,r],a=t.P,o=t.N,u=[t];kc(t);for(var s=a;s.circle&&Math.abs(e-s.circle.x)<sC&&Math.abs(r-s.circle.cy)<sC;)a=s.P,u.unshift(s),kc(s),s=a;u.unshift(s),bc(s);for(var l=o;l.circle&&Math.abs(e-l.circle.x)<sC&&Math.abs(r-l.circle.cy)<sC;)o=l.N,u.push(l),kc(l),l=o;u.push(l),bc(l);var f,c=u.length;for(f=1;c>f;++f)l=u[f],s=u[f-1],lc(l.edge,s.site,l.site,i);s=u[0],l=u[c-1],l.edge=uc(s.site,l.site,null,i),xc(s),xc(l)}function Sc(t){for(var n,e,r,i,a=t[0],o=t[1],u=eC._;u;)if(r=Cc(u,o)-a,r>sC)u=u.L;else{if(i=a-Ac(u,o),!(i>sC)){r>-sC?(n=u.P,e=u):i>-sC?(n=u,e=u.N):n=e=u;break}if(!u.R){n=u;break}u=u.R}dc(t);var s=Mc(t);if(eC.insert(n,s),n||e){if(n===e)return bc(n),e=Mc(n.site),eC.insert(s,e),s.edge=e.edge=uc(n.site,s.site),xc(n),void xc(e);if(!e)return void(s.edge=uc(n.site,s.site));bc(n),bc(e);var l=n.site,f=l[0],c=l[1],h=t[0]-f,d=t[1]-c,p=e.site,g=p[0]-f,m=p[1]-c,v=2*(h*m-d*g),y=h*h+d*d,_=g*g+m*m,x=[(m*y-d*_)/v+f,(h*_-g*y)/v+c];lc(e.edge,l,p,x),s.edge=uc(l,t,null,x),e.edge=uc(t,p,null,x),xc(n),xc(e)}}function Cc(t,n){var e=t.site,r=e[0],i=e[1],a=i-n;if(!a)return r;var o=t.P;if(!o)return-(1/0);e=o.site;var u=e[0],s=e[1],l=s-n;if(!l)return u;var f=u-r,c=1/a-1/l,h=f/l;return c?(-h+Math.sqrt(h*h-2*c*(f*f/(-2*l)-s+l/2+i-a/2)))/c+r:(r+u)/2}function Ac(t,n){var e=t.N;if(e)return Cc(e,n);var r=t.site;return r[1]===n?r[0]:1/0}function Tc(t,n,e){return(t[0]-e[0])*(n[1]-t[1])-(t[0]-n[0])*(e[1]-t[1])}function Nc(t,n){return n[1]-t[1]||n[0]-t[0]}function zc(t,n){var e,r,i,a=t.sort(Nc).pop();for(aC=[],rC=new Array(t.length),eC=new ec,iC=new ec;;)if(i=nC,a&&(!i||a[1]<i.y||a[1]===i.y&&a[0]<i.x))(a[0]!==e||a[1]!==r)&&(Sc(a),e=a[0],r=a[1]),a=t.pop();else{if(!i)break;Ec(i.arc)}if(vc(),n){var o=+n[0][0],u=+n[0][1],s=+n[1][0],l=+n[1][1];hc(o,u,s,l),yc(o,u,s,l)}this.edges=aC,this.cells=rC,eC=iC=aC=rC=null}function Dc(){function t(t){return new zc(t.map(function(r,i){var a=[Math.round(n(r,i,t)/sC)*sC,Math.round(e(r,i,t)/sC)*sC];return a.index=i,a.data=r,a}),r)}var n=tc,e=nc,r=null;return t.polygons=function(n){return t(n).polygons()},t.links=function(n){return t(n).links()},t.triangles=function(n){return t(n).triangles()},t.x=function(e){return arguments.length?(n="function"==typeof e?e:Kf(+e),t):n},t.y=function(n){return arguments.length?(e="function"==typeof n?n:Kf(+n),t):e},t.extent=function(n){return arguments.length?(r=null==n?null:[[+n[0][0],+n[0][1]],[+n[1][0],+n[1][1]]],t):r&&[[r[0][0],r[0][1]],[r[1][0],r[1][1]]]},t.size=function(n){return arguments.length?(r=null==n?null:[[0,0],[+n[0],+n[1]]],t):r&&[r[1][0]-r[0][0],r[1][1]-r[0][1]]},t}function Oc(t){Ye.call(this,null,t)}function Rc(){function t(t){t.width=t.height=1;var n=Math.sqrt(t.getContext("2d").getImageData(0,0,1,1).data.length>>2);t.width=(pC<<5)/n,t.height=gC/n;var e=t.getContext("2d");return e.fillStyle=e.strokeStyle="red",e.textAlign="center",{context:e,ratio:n}}function n(t,n,e){for(var r,i,a,o=n.x,u=n.y,s=Math.sqrt(l[0]*l[0]+l[1]*l[1]),c=f(l),d=h()<.5?1:-1,p=-d;(r=c(p+=d))&&(i=~~r[0],a=~~r[1],!(Math.min(Math.abs(i),Math.abs(a))>=s));)if(n.x=o+i,n.y=u+a,!(n.x+n.x0<0||n.y+n.y0<0||n.x+n.x1>l[0]||n.y+n.y1>l[1])&&(!e||!qc(n,t,l[0]))&&(!e||Uc(n,e))){for(var g,m=n.sprite,v=n.width>>5,y=l[0]>>5,_=n.x-(v<<4),x=127&_,b=32-x,w=n.y1-n.y0,M=(n.y+n.y0)*y+(_>>5),k=0;w>k;k++){g=0;for(var E=0;v>=E;E++)t[M+E]|=g<<b|(v>E?(g=m[k*v+E])>>>x:0);M+=y}return n.sprite=null,!0}return!1}var e,r,i,a,o,u,s,l=[256,256],f=Fc,c=[],h=Math.random,d={},p=$c;return d.layout=function(){for(var f=t(p()),d=Ic((l[0]>>5)*l[1]),g=null,m=c.length,v=-1,y=[],_=c.map(function(t){return{text:e(t),font:r(t),style:a(t),weight:o(t),rotate:u(t),size:~~i(t),padding:s(t),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:t}}).sort(function(t,n){return n.size-t.size});++v<m;){var x=_[v];x.x=l[0]*(h()+.5)>>1,x.y=l[1]*(h()+.5)>>1,Pc(f,x,_,v),x.hasText&&n(d,x,g)&&(y.push(x),g?Lc(g,x):g=[{x:x.x+x.x0,y:x.y+x.y0},{x:x.x+x.x1,y:x.y+x.y1}],x.x-=l[0]>>1,x.y-=l[1]>>1)}return y},d.words=function(t){return arguments.length?(c=t,d):c},d.size=function(t){return arguments.length?(l=[+t[0],+t[1]],d):l},d.font=function(t){return arguments.length?(r=Wc(t),d):r},d.fontStyle=function(t){return arguments.length?(a=Wc(t),d):a},d.fontWeight=function(t){return arguments.length?(o=Wc(t),d):o},d.rotate=function(t){return arguments.length?(u=Wc(t),d):u},d.text=function(t){return arguments.length?(e=Wc(t),d):e},d.spiral=function(t){return arguments.length?(f=mC[t]||t,d):f},d.fontSize=function(t){return arguments.length?(i=Wc(t),d):i},d.padding=function(t){return arguments.length?(s=Wc(t),d):s},d.random=function(t){return arguments.length?(h=t,d):h},d}function Pc(t,n,e,r){if(!n.sprite){var i=t.context,a=t.ratio;i.clearRect(0,0,(pC<<5)/a,gC/a);var o,u,s,l,f,c=0,h=0,d=0,p=e.length;for(--r;++r<p;){if(n=e[r],i.save(),i.font=n.style+" "+n.weight+" "+~~((n.size+1)/a)+"px "+n.font,o=i.measureText(n.text+"m").width*a,s=n.size<<1,n.rotate){var g=Math.sin(n.rotate*dC),m=Math.cos(n.rotate*dC),v=o*m,y=o*g,_=s*m,x=s*g;o=Math.max(Math.abs(v+x),Math.abs(v-x))+31>>5<<5,s=~~Math.max(Math.abs(y+_),Math.abs(y-_))}else o=o+31>>5<<5;if(s>d&&(d=s),c+o>=pC<<5&&(c=0,h+=d,d=0),h+s>=gC)break;i.translate((c+(o>>1))/a,(h+(s>>1))/a),n.rotate&&i.rotate(n.rotate*dC),i.fillText(n.text,0,0),n.padding&&(i.lineWidth=2*n.padding,i.strokeText(n.text,0,0)),i.restore(),n.width=o,n.height=s,n.xoff=c,n.yoff=h,n.x1=o>>1,n.y1=s>>1,n.x0=-n.x1,n.y0=-n.y1,n.hasText=!0,c+=o}for(var b=i.getImageData(0,0,(pC<<5)/a,gC/a).data,w=[];--r>=0;)if(n=e[r],n.hasText){for(o=n.width,u=o>>5,s=n.y1-n.y0,l=0;s*u>l;l++)w[l]=0;if(c=n.xoff,null==c)return;h=n.yoff;var M=0,k=-1;for(f=0;s>f;f++){for(l=0;o>l;l++){var E=u*f+(l>>5),S=b[(h+f)*(pC<<5)+(c+l)<<2]?1<<31-l%32:0;w[E]|=S,M|=S}M?k=f:(n.y0++,s--,f--,h++)}n.y1=n.y0+k,n.sprite=w.slice(0,(n.y1-n.y0)*u)}}}function qc(t,n,e){e>>=5;for(var r,i=t.sprite,a=t.width>>5,o=t.x-(a<<4),u=127&o,s=32-u,l=t.y1-t.y0,f=(t.y+t.y0)*e+(o>>5),c=0;l>c;c++){r=0;for(var h=0;a>=h;h++)if((r<<s|(a>h?(r=i[c*a+h])>>>u:0))&n[f+h])return!0;f+=e}return!1}function Lc(t,n){var e=t[0],r=t[1];n.x+n.x0<e.x&&(e.x=n.x+n.x0),n.y+n.y0<e.y&&(e.y=n.y+n.y0),n.x+n.x1>r.x&&(r.x=n.x+n.x1),n.y+n.y1>r.y&&(r.y=n.y+n.y1)}function Uc(t,n){return t.x+t.x1>n[0].x&&t.x+t.x0<n[1].x&&t.y+t.y1>n[0].y&&t.y+t.y0<n[1].y}function Fc(t){var n=t[0]/t[1];return function(t){return[n*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function jc(t){var n=4,e=n*t[0]/t[1],r=0,i=0;return function(t){var a=0>t?-1:1;switch(Math.sqrt(1+4*a*t)-a&3){case 0:r+=e;break;case 1:i+=n;break;case 2:r-=e;break;default:i-=n}return[r,i]}}function Ic(t){for(var n=[],e=-1;++e<t;)n[e]=0;return n}function $c(){try{return"undefined"!=typeof document&&document.createElement?document.createElement("canvas"):new(require("canvas"))}catch(t){F("Canvas unavailable. Run in browser or install node-canvas.")}}function Wc(t){return"function"==typeof t?t:function(){return t}}function Bc(t){Ye.call(this,Rc(),t)}function Hc(t,n){var e=new Xb.Extent;return e.transform({field:t,modified:kx},n),e.value}function Yc(t){return new Uint8Array(t)}function Xc(t){return new Uint16Array(t)}function Gc(t){return new Uint32Array(t)}function Jc(){var t=8,n=[],e=Gc(0),r=Zc(0,t),i=Zc(0,t);return{data:function(){return n},seen:function(){return e=Vc(e,n.length)},add:function(t){for(var e,r=0,i=n.length,a=t.length;a>r;++r)e=t[r],e._index=i++,n.push(e)},remove:function(t,e){var a,o,u,s=n.length,l=Array(s-t),f=n;for(o=0;!e[o]&&s>o;++o)l[o]=n[o],f[o]=o;for(u=o;s>o;++o)a=n[o],e[o]?f[o]=-1:(f[o]=u,r[u]=r[o],i[u]=i[o],l[u]=a,a._index=u++),r[o]=0;return n=l,f},size:function(){return n.length},curr:function(){return r},prev:function(){return i},reset:function(t){i[t]=r[t]},all:function(){return 257>t?255:65537>t?65535:4294967295},set:function(t,n){r[t]|=n},clear:function(t,n){r[t]&=~n},resize:function(n,e){var a=r.length;(n>a||e>t)&&(t=Math.max(e,t),r=Zc(n,t,r),i=Zc(n,t))}}}function Vc(t,n,e){return t.length>=n?t:(e=e||new t.constructor(n),e.set(t),e)}function Zc(t,n,e){var r=(257>n?Yc:65537>n?Xc:Gc)(t);return e&&r.set(e),r}function Qc(t,n,e){var r=1<<n;return{one:r,zero:~r,range:e.slice(),bisect:t.bisect,index:t.index,size:t.size,onAdd:function(t,n){var e,i=this,a=i.bisect(i.range,t.value),o=t.index,u=a[0],s=a[1],l=o.length;for(e=0;u>e;++e)n[o[e]]|=r;for(e=s;l>e;++e)n[o[e]]|=r;return i}}}function Kc(){function t(t,n,e){if(!n.length)return[];var r,u,s,l=o,f=n.length,c=Array(f),h=Gc(f);for(s=0;f>s;++s)c[s]=t(n[s]),h[s]=s;if(c=th(c,h),l)r=a,u=i,a=Array(l+f),i=Gc(l+f),nh(e,r,u,l,c,h,f,a,i);else{if(e>0)for(s=0;f>s;++s)h[s]+=e;a=c,i=h}return o=l+f,{index:h,value:c}}function n(t,n){var e,r,u,s=o;for(r=0;!n[i[r]]&&s>r;++r);for(u=r;s>r;++r)n[e=i[r]]||(i[u]=e,a[u]=a[r],++u);o=s-t}function e(t){for(var n=0,e=o;e>n;++n)i[n]=t[i[n]]}function r(t,n){var e=n?n.length:(n=a,o);return[px(n,t[0],0,e),dx(n,t[1],0,e)]}var i=Gc(0),a=[],o=0;return{insert:t,remove:n,bisect:r,reindex:e,index:function(){return i},size:function(){return o}}}function th(t,n){return t.sort.call(n,function(n,e){var r=t[n],i=t[e];return i>r?-1:r>i?1:0}),v(t,n)}function nh(t,n,e,r,i,a,o,u,s){var l,f=0,c=0;for(l=0;r>f&&o>c;++l)n[f]<i[c]?(u[l]=n[f],s[l]=e[f++]):(u[l]=i[c],s[l]=a[c++]+t);for(;r>f;++f,++l)u[l]=n[f],s[l]=e[f];for(;o>c;++c,++l)u[l]=i[c],s[l]=a[c]+t}function eh(t){Ye.call(this,Jc(),t),this._indices=null,this._dims=null}function rh(t){Ye.call(this,null,t)}function ih(t){this.clear(),t&&this.union(t)}function ah(t,n){var e,r=[];return e={id:"gradient_"+EC++,x1:t?t[0]:0,y1:t?t[1]:0,x2:n?n[0]:1,y2:n?n[1]:0,stops:r,stop:function(t,n){return r.push({offset:t,color:n}),e}}}function oh(t){this.mark=t,this.bounds=this.bounds||new ih,this.bounds_prev=this.bounds_prev||new ih}function uh(t,n){var e=t.prototype=Object.create(n.prototype);return e.constructor=t,e}function sh(t){oh.call(this,t),this.items=this.items||[]}function lh(t,n){var e=null;return"undefined"!=typeof document&&document.createElement?(e=document.createElement("canvas"),e.width=t,e.height=n):SC&&(e=new SC(t,n)),e}function fh(t){this._pending=0,this._options=t||fh.Options}function ch(){this.root=dh({marktype:"group",name:"root",role:"frame"}),this.root.items=[new sh(this.root)]}function hh(t){throw Error(t)}function dh(t,n){return{bounds:new ih,bounds_prev:new ih,clip:!!t.clip,group:n,interactive:t.interactive===!1?!1:!0,items:[],marktype:t.marktype,name:t.name||void 0,role:t.role||void 0,zindex:t.zindex||0}}function ph(){this._active=null,this._handlers={}}function gh(t){this._el=null,this._bgcolor=null,this._loader=new fh(t)}function mh(){this._x0=this._y0=this._x1=this._y1=null,this._=[]}function vh(){return new mh}function yh(t){return function(){return t}}function _h(t){return t.innerRadius}function xh(t){return t.outerRadius}function bh(t){return t.startAngle}function wh(t){return t.endAngle}function Mh(t){return t&&t.padAngle}function kh(t){return t>=1?FC:-1>=t?-FC:Math.asin(t)}function Eh(t,n,e,r,i,a,o,u){var s=e-t,l=r-n,f=o-i,c=u-a,h=(f*(n-a)-c*(t-i))/(c*s-f*l);return[t+h*s,n+h*l]}function Sh(t,n,e,r,i,a,o){var u=t-e,s=n-r,l=(o?a:-a)/Math.sqrt(u*u+s*s),f=l*s,c=-l*u,h=t+f,d=n+c,p=e+f,g=r+c,m=(h+p)/2,v=(d+g)/2,y=p-h,_=g-d,x=y*y+_*_,b=i-a,w=h*g-p*d,M=(0>_?-1:1)*Math.sqrt(Math.max(0,b*b*x-w*w)),k=(w*_-y*M)/x,E=(-w*y-_*M)/x,S=(w*_+y*M)/x,C=(-w*y+_*M)/x,A=k-m,T=E-v,N=S-m,z=C-v;return A*A+T*T>N*N+z*z&&(k=S,E=C),{cx:k,cy:E,x01:-f,y01:-c,x11:k*(i/b-1),y11:E*(i/b-1)}}function Ch(){function t(){var t,l,f=+n.apply(this,arguments),c=+e.apply(this,arguments),h=a.apply(this,arguments)-FC,d=o.apply(this,arguments)-FC,p=Math.abs(d-h),g=d>h;if(s||(s=t=vh()),f>c&&(l=c,c=f,f=l),c>LC)if(p>jC-LC)s.moveTo(c*Math.cos(h),c*Math.sin(h)),s.arc(0,0,c,h,d,!g),f>LC&&(s.moveTo(f*Math.cos(d),f*Math.sin(d)),s.arc(0,0,f,d,h,g));else{var m,v,y=h,_=d,x=h,b=d,w=p,M=p,k=u.apply(this,arguments)/2,E=k>LC&&(i?+i.apply(this,arguments):Math.sqrt(f*f+c*c)),S=Math.min(Math.abs(c-f)/2,+r.apply(this,arguments)),C=S,A=S;if(E>LC){var T=kh(E/f*Math.sin(k)),N=kh(E/c*Math.sin(k));(w-=2*T)>LC?(T*=g?1:-1,x+=T,b-=T):(w=0,x=b=(h+d)/2),(M-=2*N)>LC?(N*=g?1:-1,y+=N,_-=N):(M=0,y=_=(h+d)/2)}var z=c*Math.cos(y),D=c*Math.sin(y),O=f*Math.cos(b),R=f*Math.sin(b);if(S>LC){var P=c*Math.cos(_),q=c*Math.sin(_),L=f*Math.cos(x),U=f*Math.sin(x);if(UC>p){var F=w>LC?Eh(z,D,L,U,P,q,O,R):[O,R],j=z-F[0],I=D-F[1],$=P-F[0],W=q-F[1],B=1/Math.sin(Math.acos((j*$+I*W)/(Math.sqrt(j*j+I*I)*Math.sqrt($*$+W*W)))/2),H=Math.sqrt(F[0]*F[0]+F[1]*F[1]);C=Math.min(S,(f-H)/(B-1)),A=Math.min(S,(c-H)/(B+1))}}M>LC?A>LC?(m=Sh(L,U,z,D,c,A,g),v=Sh(P,q,O,R,c,A,g),s.moveTo(m.cx+m.x01,m.cy+m.y01),S>A?s.arc(m.cx,m.cy,A,Math.atan2(m.y01,m.x01),Math.atan2(v.y01,v.x01),!g):(s.arc(m.cx,m.cy,A,Math.atan2(m.y01,m.x01),Math.atan2(m.y11,m.x11),!g),s.arc(0,0,c,Math.atan2(m.cy+m.y11,m.cx+m.x11),Math.atan2(v.cy+v.y11,v.cx+v.x11),!g),s.arc(v.cx,v.cy,A,Math.atan2(v.y11,v.x11),Math.atan2(v.y01,v.x01),!g))):(s.moveTo(z,D),s.arc(0,0,c,y,_,!g)):s.moveTo(z,D),f>LC&&w>LC?C>LC?(m=Sh(O,R,P,q,f,-C,g),v=Sh(z,D,L,U,f,-C,g),s.lineTo(m.cx+m.x01,m.cy+m.y01),S>C?s.arc(m.cx,m.cy,C,Math.atan2(m.y01,m.x01),Math.atan2(v.y01,v.x01),!g):(s.arc(m.cx,m.cy,C,Math.atan2(m.y01,m.x01),Math.atan2(m.y11,m.x11),!g),s.arc(0,0,f,Math.atan2(m.cy+m.y11,m.cx+m.x11),Math.atan2(v.cy+v.y11,v.cx+v.x11),g),s.arc(v.cx,v.cy,C,Math.atan2(v.y11,v.x11),Math.atan2(v.y01,v.x01),!g))):s.arc(0,0,f,b,x,g):s.lineTo(O,R)}else s.moveTo(0,0);return s.closePath(),t?(s=null,t+""||null):void 0}var n=_h,e=xh,r=yh(0),i=null,a=bh,o=wh,u=Mh,s=null;return t.centroid=function(){var t=(+n.apply(this,arguments)+ +e.apply(this,arguments))/2,r=(+a.apply(this,arguments)+ +o.apply(this,arguments))/2-UC/2;return[Math.cos(r)*t,Math.sin(r)*t]},t.innerRadius=function(e){return arguments.length?(n="function"==typeof e?e:yh(+e),t):n},t.outerRadius=function(n){return arguments.length?(e="function"==typeof n?n:yh(+n),t):e},t.cornerRadius=function(n){return arguments.length?(r="function"==typeof n?n:yh(+n),t):r},t.padRadius=function(n){return arguments.length?(i=null==n?null:"function"==typeof n?n:yh(+n),t):i},t.startAngle=function(n){return arguments.length?(a="function"==typeof n?n:yh(+n),t):a},t.endAngle=function(n){return arguments.length?(o="function"==typeof n?n:yh(+n),t):o},t.padAngle=function(n){return arguments.length?(u="function"==typeof n?n:yh(+n),t):u},t.context=function(n){return arguments.length?(s=null==n?null:n,t):s},t}function Ah(t){this._context=t}function Th(t){return new Ah(t);
}function Nh(t){return t[0]}function zh(t){return t[1]}function Dh(){function t(t){var u,s,l,f=t.length,c=!1;for(null==i&&(o=a(l=vh())),u=0;f>=u;++u)!(f>u&&r(s=t[u],u,t))===c&&((c=!c)?o.lineStart():o.lineEnd()),c&&o.point(+n(s,u,t),+e(s,u,t));return l?(o=null,l+""||null):void 0}var n=Nh,e=zh,r=yh(!0),i=null,a=Th,o=null;return t.x=function(e){return arguments.length?(n="function"==typeof e?e:yh(+e),t):n},t.y=function(n){return arguments.length?(e="function"==typeof n?n:yh(+n),t):e},t.defined=function(n){return arguments.length?(r="function"==typeof n?n:yh(!!n),t):r},t.curve=function(n){return arguments.length?(a=n,null!=i&&(o=a(i)),t):a},t.context=function(n){return arguments.length?(null==n?i=o=null:o=a(i=n),t):i},t}function Oh(){function t(t){var n,f,c,h,d,p=t.length,g=!1,m=new Array(p),v=new Array(p);for(null==u&&(l=s(d=vh())),n=0;p>=n;++n){if(!(p>n&&o(h=t[n],n,t))===g)if(g=!g)f=n,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),c=n-1;c>=f;--c)l.point(m[c],v[c]);l.lineEnd(),l.areaEnd()}g&&(m[n]=+e(h,n,t),v[n]=+i(h,n,t),l.point(r?+r(h,n,t):m[n],a?+a(h,n,t):v[n]))}return d?(l=null,d+""||null):void 0}function n(){return Dh().defined(o).curve(s).context(u)}var e=Nh,r=null,i=yh(0),a=zh,o=yh(!0),u=null,s=Th,l=null;return t.x=function(n){return arguments.length?(e="function"==typeof n?n:yh(+n),r=null,t):e},t.x0=function(n){return arguments.length?(e="function"==typeof n?n:yh(+n),t):e},t.x1=function(n){return arguments.length?(r=null==n?null:"function"==typeof n?n:yh(+n),t):r},t.y=function(n){return arguments.length?(i="function"==typeof n?n:yh(+n),a=null,t):i},t.y0=function(n){return arguments.length?(i="function"==typeof n?n:yh(+n),t):i},t.y1=function(n){return arguments.length?(a=null==n?null:"function"==typeof n?n:yh(+n),t):a},t.lineX0=t.lineY0=function(){return n().x(e).y(i)},t.lineY1=function(){return n().x(e).y(a)},t.lineX1=function(){return n().x(r).y(i)},t.defined=function(n){return arguments.length?(o="function"==typeof n?n:yh(!!n),t):o},t.curve=function(n){return arguments.length?(s=n,null!=u&&(l=s(u)),t):s},t.context=function(n){return arguments.length?(null==n?u=l=null:l=s(u=n),t):u},t}function Rh(){function t(){var t;return r||(r=t=vh()),n.apply(this,arguments).draw(r,+e.apply(this,arguments)),t?(r=null,t+""||null):void 0}var n=yh(IC),e=yh(64),r=null;return t.type=function(e){return arguments.length?(n="function"==typeof e?e:yh(e),t):n},t.size=function(n){return arguments.length?(e="function"==typeof n?n:yh(+n),t):e},t.context=function(n){return arguments.length?(r=null==n?null:n,t):r},t}function Ph(){}function qh(t,n,e){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+n)/6,(t._y0+4*t._y1+e)/6)}function Lh(t){this._context=t}function Uh(t){return new Lh(t)}function Fh(t,n){this._basis=new Lh(t),this._beta=n}function jh(t,n,e){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-n),t._y2+t._k*(t._y1-e),t._x2,t._y2)}function Ih(t,n){this._context=t,this._k=(1-n)/6}function $h(t,n){this._context=t,this._k=(1-n)/6}function Wh(t,n){this._context=t,this._k=(1-n)/6}function Bh(t,n,e){var r=t._x1,i=t._y1,a=t._x2,o=t._y2;if(t._l01_a>LC){var u=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,s=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*u-t._x0*t._l12_2a+t._x2*t._l01_2a)/s,i=(i*u-t._y0*t._l12_2a+t._y2*t._l01_2a)/s}if(t._l23_a>LC){var l=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,f=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*l+t._x1*t._l23_2a-n*t._l12_2a)/f,o=(o*l+t._y1*t._l23_2a-e*t._l12_2a)/f}t._context.bezierCurveTo(r,i,a,o,t._x2,t._y2)}function Hh(t,n){this._context=t,this._alpha=n}function Yh(t,n){this._context=t,this._alpha=n}function Xh(t,n){this._context=t,this._alpha=n}function Gh(t){return 0>t?-1:1}function Jh(t,n,e){var r=t._x1-t._x0,i=n-t._x1,a=(t._y1-t._y0)/(r||0>i&&-0),o=(e-t._y1)/(i||0>r&&-0),u=(a*i+o*r)/(r+i);return(Gh(a)+Gh(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(u))||0}function Vh(t,n){var e=t._x1-t._x0;return e?(3*(t._y1-t._y0)/e-n)/2:n}function Zh(t,n,e){var r=t._x0,i=t._y0,a=t._x1,o=t._y1,u=(a-r)/3;t._context.bezierCurveTo(r+u,i+u*n,a-u,o-u*e,a,o)}function Qh(t){this._context=t}function Kh(t){this._context=new td(t)}function td(t){this._context=t}function nd(t){return new Qh(t)}function ed(t){return new Kh(t)}function rd(t){this._context=t}function id(t){var n,e,r=t.length-1,i=new Array(r),a=new Array(r),o=new Array(r);for(i[0]=0,a[0]=2,o[0]=t[0]+2*t[1],n=1;r-1>n;++n)i[n]=1,a[n]=4,o[n]=4*t[n]+2*t[n+1];for(i[r-1]=2,a[r-1]=7,o[r-1]=8*t[r-1]+t[r],n=1;r>n;++n)e=i[n]/a[n-1],a[n]-=e,o[n]-=e*o[n-1];for(i[r-1]=o[r-1]/a[r-1],n=r-2;n>=0;--n)i[n]=(o[n]-i[n+1])/a[n];for(a[r-1]=(t[r]+i[r-1])/2,n=0;r-1>n;++n)a[n]=2*t[n+1]-i[n+1];return[i,a]}function ad(t){return new rd(t)}function od(t,n){this._context=t,this._t=n}function ud(t){return new od(t,.5)}function sd(t){return new od(t,0)}function ld(t){return new od(t,1)}function fd(t,n,e){var r=XC.hasOwnProperty(t)&&XC[t],i=null;return r&&(i=r.curve||r[n||"vertical"],r.tension&&null!=e&&(i=i[r.tension](e))),i}function cd(t){var n,e,r,i,a,o,u,s,l,f,c,h=[];for(n=t.slice().replace(JC[0],"###$1").split(JC[1]).slice(1),s=0,f=n.length;f>s;++s){for(e=n[s],r=e.slice(1).trim().replace(JC[2],"$1###$2").split(JC[3]),o=e.charAt(0),i=[o],l=0,c=r.length;c>l;++l)(a=+r[l])===a&&i.push(a);if(u=GC[o.toLowerCase()],i.length-1>u)for(l=1,c=i.length;c>l;l+=u)h.push([o].concat(i.slice(l,l+u)));else h.push(i)}return h}function hd(t,n,e,r,i,a,o,u,s){var l=QC.call(arguments);if(VC[l])return VC[l];var f=o*(Math.PI/180),c=Math.sin(f),h=Math.cos(f);e=Math.abs(e),r=Math.abs(r);var d=h*(u-t)*.5+c*(s-n)*.5,p=h*(s-n)*.5-c*(u-t)*.5,g=d*d/(e*e)+p*p/(r*r);g>1&&(g=Math.sqrt(g),e*=g,r*=g);var m=h/e,v=c/e,y=-c/r,_=h/r,x=m*u+v*s,b=y*u+_*s,w=m*t+v*n,M=y*t+_*n,k=(w-x)*(w-x)+(M-b)*(M-b),E=1/k-.25;0>E&&(E=0);var S=Math.sqrt(E);a==i&&(S=-S);var C=.5*(x+w)-S*(M-b),A=.5*(b+M)+S*(w-x),T=Math.atan2(b-A,x-C),N=Math.atan2(M-A,w-C),z=N-T;0>z&&1===a?z+=2*Math.PI:z>0&&0===a&&(z-=2*Math.PI);for(var D=Math.ceil(Math.abs(z/(.5*Math.PI+.001))),O=[],R=0;D>R;++R){var P=T+R*z/D,q=T+(R+1)*z/D;O[R]=[C,A,P,q,e,r,c,h]}return VC[l]=O}function dd(t){var n=QC.call(t);if(ZC[n])return ZC[n];var e=t[0],r=t[1],i=t[2],a=t[3],o=t[4],u=t[5],s=t[6],l=t[7],f=l*o,c=-s*u,h=s*o,d=l*u,p=Math.cos(i),g=Math.sin(i),m=Math.cos(a),v=Math.sin(a),y=.5*(a-i),_=Math.sin(.5*y),x=8/3*_*_/Math.sin(y),b=e+p-x*g,w=r+g+x*p,M=e+m,k=r+v,E=M+x*v,S=k-x*m;return ZC[n]=[f*b+c*w,h*b+d*w,f*E+c*S,h*E+d*S,f*M+c*k,h*M+d*k]}function pd(t,n){var e=KC[0]=t[0];if("a"===e||"A"===e)KC[1]=n*t[1],KC[2]=n*t[2],KC[6]=n*t[6],KC[7]=n*t[7];else for(var r=1,i=t.length;i>r;++r)KC[r]=n*t[r];return KC}function gd(t,n,e,r,i){var a,o,u,s,l,f=null,c=0,h=0,d=0,p=0;null==e&&(e=0),null==r&&(r=0),null==i&&(i=1),t.beginPath&&t.beginPath();for(var g=0,m=n.length;m>g;++g){switch(a=n[g],1!==i&&(a=pd(a,i)),a[0]){case"l":c+=a[1],h+=a[2],t.lineTo(c+e,h+r);break;case"L":c=a[1],h=a[2],t.lineTo(c+e,h+r);break;case"h":c+=a[1],t.lineTo(c+e,h+r);break;case"H":c=a[1],t.lineTo(c+e,h+r);break;case"v":h+=a[1],t.lineTo(c+e,h+r);break;case"V":h=a[1],t.lineTo(c+e,h+r);break;case"m":c+=a[1],h+=a[2],t.moveTo(c+e,h+r);break;case"M":c=a[1],h=a[2],t.moveTo(c+e,h+r);break;case"c":o=c+a[5],u=h+a[6],d=c+a[3],p=h+a[4],t.bezierCurveTo(c+a[1]+e,h+a[2]+r,d+e,p+r,o+e,u+r),c=o,h=u;break;case"C":c=a[5],h=a[6],d=a[3],p=a[4],t.bezierCurveTo(a[1]+e,a[2]+r,d+e,p+r,c+e,h+r);break;case"s":o=c+a[3],u=h+a[4],d=2*c-d,p=2*h-p,t.bezierCurveTo(d+e,p+r,c+a[1]+e,h+a[2]+r,o+e,u+r),d=c+a[1],p=h+a[2],c=o,h=u;break;case"S":o=a[3],u=a[4],d=2*c-d,p=2*h-p,t.bezierCurveTo(d+e,p+r,a[1]+e,a[2]+r,o+e,u+r),c=o,h=u,d=a[1],p=a[2];break;case"q":o=c+a[3],u=h+a[4],d=c+a[1],p=h+a[2],t.quadraticCurveTo(d+e,p+r,o+e,u+r),c=o,h=u;break;case"Q":o=a[3],u=a[4],t.quadraticCurveTo(a[1]+e,a[2]+r,o+e,u+r),c=o,h=u,d=a[1],p=a[2];break;case"t":o=c+a[1],u=h+a[2],null===f[0].match(/[QqTt]/)?(d=c,p=h):"t"===f[0]?(d=2*c-s,p=2*h-l):"q"===f[0]&&(d=2*c-d,p=2*h-p),s=d,l=p,t.quadraticCurveTo(d+e,p+r,o+e,u+r),c=o,h=u,d=c+a[1],p=h+a[2];break;case"T":o=a[1],u=a[2],d=2*c-d,p=2*h-p,t.quadraticCurveTo(d+e,p+r,o+e,u+r),c=o,h=u;break;case"a":md(t,c+e,h+r,[a[1],a[2],a[3],a[4],a[5],a[6]+c+e,a[7]+h+r]),c+=a[6],h+=a[7];break;case"A":md(t,c+e,h+r,[a[1],a[2],a[3],a[4],a[5],a[6]+e,a[7]+r]),c=a[6],h=a[7];break;case"z":case"Z":t.closePath()}f=a}}function md(t,n,e,r){for(var i=hd(r[5],r[6],r[0],r[1],r[3],r[4],r[2],n,e),a=0;a<i.length;++a){var o=dd(i[a]);t.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5])}}function vd(t){return eA.hasOwnProperty(t)?eA[t]:yd(t)}function yd(t){if(!rA.hasOwnProperty(t)){var n=cd(t);rA[t]={draw:function(t,e){gd(t,n,0,0,Math.sqrt(e))}}}return rA[t]}function _d(t){return t.x}function xd(t){return t.y}function bd(t){return t.width}function wd(t){return t.height}function Md(t){return function(){return t}}function kd(){function t(t,u,s){var l,f=null!=u?u:+n.call(this,t),c=null!=s?s:+e.call(this,t),h=+r.call(this,t),d=+i.call(this,t),p=+a.call(this,t);if(o||(o=l=vh()),0>=p)o.rect(f,c,h,d);else{var g=f+h,m=c+d;o.moveTo(f+p,c),o.lineTo(g-p,c),o.quadraticCurveTo(g,c,g,c+p),o.lineTo(g,m-p),o.quadraticCurveTo(g,m,g-p,m),o.lineTo(f+p,m),o.quadraticCurveTo(f,m,f,m-p),o.lineTo(f,c+p),o.quadraticCurveTo(f,c,f+p,c),o.closePath()}return l?(o=null,l+""||null):void 0}var n=_d,e=xd,r=bd,i=wd,a=Md(0),o=null;return t.x=function(e){return arguments.length?(n="function"==typeof e?e:Md(+e),t):n},t.y=function(n){return arguments.length?(e="function"==typeof n?n:Md(+n),t):e},t.width=function(n){return arguments.length?(r="function"==typeof n?n:Md(+n),t):r},t.height=function(n){return arguments.length?(i="function"==typeof n?n:Md(+n),t):i},t.cornerRadius=function(n){return arguments.length?(a="function"==typeof n?n:Md(+n),t):a},t.context=function(n){return arguments.length?(o=null==n?null:n,t):o},t}function Ed(){function t(t,n,e){var r=e/2;if(o){var i=s-n,a=t-u,c=Math.sqrt(i*i+a*a),h=(i/=c)*l,d=(a/=c)*l,p=Math.atan2(a,i);f.moveTo(u-h,s-d),f.lineTo(t-i*r,n-a*r),f.arc(t,n,r,p-iA,p),f.lineTo(u+h,s+d),f.arc(u,s,l,p,p+iA),f.closePath()}else o=1;u=t,s=n,l=r}function n(n){var u,s,l,c=n.length,h=!1;for(null==f&&(f=l=vh()),u=0;c>=u;++u)!(c>u&&a(s=n[u],u,n))===h&&(h=!h)&&(o=0),h&&t(+e(s,u,n),+r(s,u,n),+i(s,u,n));return l?(f=null,l+""||null):void 0}var e,r,i,a,o,u,s,l,f=null;return n.x=function(t){return arguments.length?(e=t,n):e},n.y=function(t){return arguments.length?(r=t,n):r},n.size=function(t){return arguments.length?(i=t,n):i},n.defined=function(t){return arguments.length?(a=t,n):a},n.context=function(t){return arguments.length?(f=null==t?null:t,n):f},n}function Sd(t){return t.x||0}function Cd(t){return t.y||0}function Ad(t){return t.width||0}function Td(t){return t.width||t.height||1}function Nd(t){return t.height||0}function zd(t){return(t.x||0)+(t.width||0)}function Dd(t){return(t.y||0)+(t.height||0)}function Od(t){return t.cornerRadius||0}function Rd(t){return t.padAngle||0}function Pd(t){return!(t.defined===!1)}function qd(t){return null==t.size?64:t.size}function Ld(t){return vd(t.shape||"circle")}function Ud(t,n){return aA.context(t)(n)}function Fd(t,n){var e=n[0],r=e.interpolate||"linear";return("trail"===r?lA:("horizontal"===e.orient?uA:oA).curve(fd(r,e.orient,e.tension))).context(t)(n)}function jd(t,n){return(n.mark.shape||n.shape).context(t)(n)}function Id(t,n){var e=n[0],r=e.interpolate||"linear";return sA.curve(fd(r,e.orient,e.tension)).context(t)(n)}function $d(t,n,e,r){return fA.context(t)(n,e,r)}function Wd(t,n){return cA.context(t)(n)}function Bd(t,n){return n.stroke&&0!==n.opacity&&0!==n.stokeOpacity&&t.expand(null!=n.strokeWidth?+n.strokeWidth:1),t}function Hd(t){return YC=t,Hd}function Yd(){}function Xd(t,n){YC.add(t,n)}function Gd(t,n,e){for(var r=e.width(),i=e.height(),a=e.x1+n.x1*r,o=e.y1+n.y1*i,u=e.x1+n.x2*r,s=e.y1+n.y2*i,l=n.stops,f=0,c=l.length,h=t.createLinearGradient(a,o,u,s);c>f;++f)h.addColorStop(l[f].offset,l[f].color);return h}function Jd(t,n,e){return e.id?Gd(t,e,n.bounds):e}function Vd(t,n,e){return e*=null==n.fillOpacity?1:n.fillOpacity,e>0?(t.globalAlpha=e,t.fillStyle=Jd(t,n,n.fill),!0):!1}function Zd(t,n,e){var r,i=null!=(i=n.strokeWidth)?i:1;return 0>=i?!1:(e*=null==n.strokeOpacity?1:n.strokeOpacity,e>0?(t.globalAlpha=e,t.strokeStyle=Jd(t,n,n.stroke),t.lineWidth=i,t.lineCap=null!=(r=n.strokeCap)?r:"butt",t.setLineDash&&(t.setLineDash(n.strokeDash||gA),t.lineDashOffset=n.strokeDashOffset||0),!0):!1)}function Qd(t,n){return t.zindex-n.zindex||t.index-n.index}function Kd(t){if(!t.zdirty)return t.zitems;var n,e,r,i=t.items,a=[];for(e=0,r=i.length;r>e;++e)n=i[e],n.index=e,n.zindex&&a.push(n);return t.zdirty=!1,t.zitems=a.sort(Qd)}function tp(t,n){var e,r,i=t.items;if(i&&i.length){var a=Kd(t);if(a&&a.length){for(e=0,r=i.length;r>e;++e)i[e].zindex||n(i[e]);i=a}for(e=0,r=i.length;r>e;++e)n(i[e])}}function np(t,n){var e,r,i=t.items;if(!i||!i.length)return null;var a=Kd(t);for(a&&a.length&&(i=a),r=i.length;--r>=0;)if(e=n(i[r]))return e;if(i===a)for(i=t.items,r=i.length;--r>=0;)if(!i[r].zindex&&(e=n(i[r])))return e;return null}function ep(t){return function(n,e,r){tp(e,function(e){(!r||r.intersects(e.bounds))&&ip(t,n,e,e)})}}function rp(t){return function(n,e,r){!e.items.length||r&&!r.intersects(e.bounds)||ip(t,n,e.items[0],e.items)}}function ip(t,n,e,r){var i=null==e.opacity?1:e.opacity;0!==i&&(t(n,r)||(e.fill&&Vd(n,e,i)&&n.fill(),e.stroke&&Zd(n,e,i)&&n.stroke()))}function ap(t){return t||(t=mA),function(n,e,r,i,a,o){return n.pixelRatio>1&&(r*=n.pixelRatio,i*=n.pixelRatio),np(e,function(e){var u=e.bounds;if((!u||u.contains(a,o))&&u)return t(n,e,r,i,a,o)?e:void 0})}}function op(t,n){return function(e,r,i,a){var o,u,s=Array.isArray(r)?r[0]:r,l=null==n?s.fill:n,f=s.stroke&&e.isPointInStroke;return f&&(o=s.strokeWidth,u=s.strokeCap,e.lineWidth=null!=o?o:1,e.lineCap=null!=u?u:"butt"),t(e,r)?!1:l&&e.isPointInPath(i,a)||f&&e.isPointInStroke(i,a)}}function up(t){return ap(op(t))}function sp(t,n){return"translate("+t+","+n+")"}function lp(t){return sp(t.x||0,t.y||0)}function fp(t,n){function e(t,e){t("transform",lp(e)),t("d",n(null,e))}function r(t,e){return n(Hd(t),e),Bd(t,e).translate(e.x||0,e.y||0)}function i(t,e){var r=e.x||0,i=e.y||0;t.translate(r,i),t.beginPath(),n(t,e),t.translate(-r,-i)}return{type:t,tag:"path",nested:!1,attr:e,bound:r,draw:ep(i),pick:up(i)}}function cp(t,n){function e(t,e){var r=e.mark.items;r.length&&t("d",n(null,r))}function r(t,e){var r=e.items;return 0===r.length?t:(n(Hd(t),r),Bd(t,r[0]))}function i(t,e){t.beginPath(),n(t,e)}function a(t,n,e,r,i,a){var u=n.items,s=n.bounds;return!u||!u.length||s&&!s.contains(i,a)?null:(t.pixelRatio>1&&(e*=t.pixelRatio,r*=t.pixelRatio),o(t,u,e,r)?u[0]:null)}var o=op(i);return{type:t,tag:"path",nested:!0,attr:e,bound:r,draw:rp(i),pick:a}}function hp(t,n,e){var r,i,a=null;t("transform",lp(n)),n.clip&&(r=e._defs,a=n.clip_id||(n.clip_id="clip"+r.clip_id++),i=r.clipping[a]||(r.clipping[a]={id:a}),i.width=n.width||0,i.height=n.height||0),t("clip-path",a?"url(#"+a+")":null)}function dp(t,n){var e=n.stroke?.5:0;t("class","background"),t("d",$d(null,n,e,e))}function pp(t,n){if(!n.clip&&n.items)for(var e=n.items,r=0,i=e.length;i>r;++r)t.union(e[r].bounds);return(n.clip||n.width||n.height)&&Bd(t.add(0,0).add(n.width||0,n.height||0),n),t.translate(n.x||0,n.y||0)}function gp(t,n,e){var r=this;tp(n,function(n){var i,a,o=n.x||0,u=n.y||0,s=n.width||0,l=n.height||0;t.save(),t.translate(o,u),(n.stroke||n.fill)&&(a=null==n.opacity?1:n.opacity,a>0&&(t.beginPath(),i=n.stroke?.5:0,$d(t,n,i,i),n.fill&&Vd(t,n,a)&&t.fill(),n.stroke&&Zd(t,n,a)&&t.stroke())),n.clip&&(t.beginPath(),t.rect(0,0,s,l),t.clip()),e&&e.translate(-o,-u),tp(n,function(n){r.draw(t,n,e)}),e&&e.translate(o,u),t.restore()})}function mp(t,n,e,r,i,a){if(n.bounds&&!n.bounds.contains(i,a)||!n.items)return null;var o=this;return np(n,function(u){var s,l,f,c;return c=u.bounds,!c||c.contains(i,a)?(l=u.x||0,f=u.y||0,t.save(),t.translate(l,f),l=i-l,f=a-f,s=np(u,function(t){return t.interactive!==!1||"group"===t.marktype?o.pick(t,e,r,l,f):null}),t.restore(),s?s:(s=n.interactive!==!1&&(u.fill||u.stroke)&&l>=0&&l<=u.width&&f>=0&&f<=u.height,s?u:null)):void 0})}function vp(t,n){var e=t.image;return e&&e.url===t.url||(e=t.image=n.loadImage(t.url),t.image.url=t.url),e}function yp(t,n){return"center"===t?n/2:"right"===t?n:0}function _p(t,n){return"middle"===t?n/2:"bottom"===t?n:0}function xp(t,n,e){var r=vp(n,e),i=n.x||0,a=n.y||0,o=n.width||r.width||0,u=n.height||r.height||0,s=e.imageURL(n.url);i-=yp(n.align,o),a-=_p(n.baseline,u),t("href",s,"http://www.w3.org/1999/xlink","xlink:href"),t("transform",sp(i,a)),t("width",o),t("height",u)}function bp(t,n){var e=n.image,r=n.x||0,i=n.y||0,a=n.width||e&&e.width||0,o=n.height||e&&e.height||0;return r-=yp(n.align,a),i-=_p(n.baseline,o),t.set(r,i,r+a,i+o)}function wp(t,n,e){var r=this;tp(n,function(n){if(!e||e.intersects(n.bounds)){var i,a=vp(n,r),o=n.x||0,u=n.y||0,s=n.width||a.width||0,l=n.height||a.height||0;o-=yp(n.align,s),u-=_p(n.baseline,l),a.loaded&&(t.globalAlpha=null!=(i=n.opacity)?i:1,t.drawImage(a,o,u,s,l))}})}function Mp(t,n){t("transform",lp(n)),t("d",n.path)}function kp(t,n){var e=n.path;if(null==e)return!0;var r=n.pathCache;r&&r.path===e||((n.pathCache=r=cd(e)).path=e),gd(t,r,n.x,n.y)}function Ep(t,n){return kp(Hd(t),n)?t.set(0,0,0,0):Bd(t,n)}function Sp(t,n){t("d",$d(null,n))}function Cp(t,n){var e,r;return Bd(t.set(e=n.x||0,r=n.y||0,e+n.width||0,r+n.height||0),n)}function Ap(t,n){t.beginPath(),$d(t,n)}function Tp(t,n){t("transform",lp(n)),t("x2",null!=n.x2?n.x2-(n.x||0):0),t("y2",null!=n.y2?n.y2-(n.y||0):0)}function Np(t,n){var e,r;return Bd(t.set(e=n.x||0,r=n.y||0,null!=n.x2?n.x2:e,null!=n.y2?n.y2:r),n)}function zp(t,n,e){var r,i,a,o;return n.stroke&&Zd(t,n,e)?(r=n.x||0,i=n.y||0,a=null!=n.x2?n.x2:r,o=null!=n.y2?n.y2:i,t.beginPath(),t.moveTo(r,i),t.lineTo(a,o),!0):!1}function Dp(t,n,e){tp(n,function(n){if(!e||e.intersects(n.bounds)){var r=null==n.opacity?1:n.opacity;r&&zp(t,n,r)&&t.stroke()}})}function Op(t,n,e,r){return t.isPointInStroke?zp(t,n,1)&&t.isPointInStroke(e,r):!1}function Rp(t){return~~(.8*Lp(t).length*qp(t))}function Pp(t){return pA.font=Up(t),pA.measureText(Lp(t.text)).width}function qp(t){return null!=t.fontSize?t.fontSize:11}function Lp(t){return null!=t?String(t):""}function Up(t,n){var e=t.font;return n&&e&&(e=String(e).replace(/\"/g,"'")),""+(t.fontStyle?t.fontStyle+" ":"")+(t.fontVariant?t.fontVariant+" ":"")+(t.fontWeight?t.fontWeight+" ":"")+qp(t)+"px "+(e||"sans-serif")}function Fp(t){var n=t.baseline,e=qp(t);return Math.round("top"===n?.93*e:"middle"===n?.3*e:"bottom"===n?-.21*e:0)}function jp(t,n){var e,r=n.dx||0,i=(n.dy||0)+Fp(n),a=n.x||0,o=n.y||0,u=n.angle||0,s=n.radius||0;s&&(e=(n.theta||0)-Math.PI/2,a+=s*Math.cos(e),o+=s*Math.sin(e)),t("text-anchor",AA[n.align]||"start"),u?(e=sp(a,o)+" rotate("+u+")",(r||i)&&(e+=" "+sp(r,i))):e=sp(a+r,o+i),t("transform",e)}function Ip(t,n,e){var r,i,a=qp(n),o=n.align,u=n.radius||0,s=n.x||0,l=n.y||0,f=n.dx||0,c=(n.dy||0)+Fp(n)-Math.round(.8*a);return u&&(i=(n.theta||0)-Math.PI/2,s+=u*Math.cos(i),l+=u*Math.sin(i)),r=CA(n),"center"===o?f-=r/2:"right"===o&&(f-=r),t.set(f+=s,c+=l,f+r,c+a),n.angle&&!e&&t.rotate(n.angle*Math.PI/180,s,l),t.expand(e?0:1)}function $p(t,n,e){tp(n,function(n){var r,i,a,o,u,s;(!e||e.intersects(n.bounds))&&(s=Lp(n.text))&&(r=null==n.opacity?1:n.opacity,0!==r&&(t.font=Up(n),t.textAlign=n.align||"left",i=n.x||0,a=n.y||0,(o=n.radius)&&(u=(n.theta||0)-Math.PI/2,i+=o*Math.cos(u),a+=o*Math.sin(u)),n.angle&&(t.save(),t.translate(i,a),t.rotate(n.angle*Math.PI/180),i=a=0),i+=n.dx||0,a+=(n.dy||0)+Fp(n),n.fill&&Vd(t,n,r)&&t.fillText(s,i,a),n.stroke&&Zd(t,n,r)&&t.strokeText(s,i,a),n.angle&&t.restore()))})}function Wp(t,n,e,r,i,a){if(n.fontSize<=0)return!1;if(!n.angle)return!0;var o=Ip(TA,n,!0),u=-n.angle*Math.PI/180,s=Math.cos(u),l=Math.sin(u),f=n.x,c=n.y,h=s*i-l*a+(f-f*s+c*l),d=l*i+s*a+(c-f*l-c*s);return o.contains(h,d)}function Bp(t,n){var e=n.getBoundingClientRect();return[t.clientX-e.left-(n.clientLeft||0),t.clientY-e.top-(n.clientTop||0)]}function Hp(t,n,e){return e?t.createElementNS(e,n):t.createElement(n)}function Yp(t,n){n=n.toLowerCase();for(var e=t.childNodes,r=0,i=e.length;i>r;++r)if(e[r].tagName.toLowerCase()===n)return e[r]}function Xp(t,n,e,r){var i,a=t.childNodes[n];return a&&a.tagName.toLowerCase()===e.toLowerCase()||(i=a||null,a=Hp(t.ownerDocument,e,r),t.insertBefore(a,i)),a}function Gp(t,n){for(var e=t.childNodes,r=e.length;r>n;)t.removeChild(e[--r]);return t}function Jp(t){return"mark-"+t.marktype+(t.name?" "+t.name:"")}function Vp(){ph.call(this),this._down=null,this._touch=null,this._first=!0}function Zp(t,n,e){return function(r){var i=this._active,a=this.pickEvent(r);a===i?this.fire(t,r):(i&&i.exit||this.fire(e,r),this._active=a,this.fire(n,r),this.fire(t,r))}}function Qp(t){return function(n){this.fire(t,n),this._active=null}}function Kp(t,n,e,r){var i="undefined"!=typeof HTMLElement&&t instanceof HTMLElement&&null!=t.parentNode,a=t.getContext("2d"),o=i?OA:1;return t.width=n*o,t.height=e*o,1!==o&&(t.style.width=n+"px",t.style.height=e+"px"),a.pixelRatio=o,a.setTransform(o,0,0,o,o*r[0],o*r[1]),t}function tg(t){gh.call(this,t),this._redraw=!1}function ng(t,n){var e,r,i,a,o,u=new ih;for(e=0,r=n.length;r>e;++e)i=n[e],a=i.mark,o=a.group,i=zA[a.marktype].nested?a:i,u.union(eg(i.bounds,o)),i.bounds_prev&&u.union(eg(i.bounds_prev,o));return u.round(),t.beginPath(),t.rect(u.x1,u.y1,u.width(),u.height()),t.clip(),u}function eg(t,n){if(null==n)return t;for(var e=qA.clear().union(t);null!=n;n=n.mark.group)e.translate(n.x||0,n.y||0);return e}function rg(){ph.call(this)}function ig(t,n,e){var r,i,a="<"+t;if(n)for(r in n)i=n[r],null!=i&&(a+=" "+r+'="'+i+'"');return e&&(a+=" "+e),a+">"}function ag(t){return"</"+t+">"}function og(t){gh.call(this,t),this._dirtyID=0,this._svg=null,this._root=null,this._defs=null}function ug(t,n,e){var r,i,a;for(t=Xp(t,e,"linearGradient",IA),t.setAttribute("id",n.id),t.setAttribute("x1",n.x1),t.setAttribute("x2",n.x2),t.setAttribute("y1",n.y1),t.setAttribute("y2",n.y2),r=0,i=n.stops.length;i>r;++r)a=Xp(t,r,"stop",IA),a.setAttribute("offset",n.stops[r].offset),a.setAttribute("stop-color",n.stops[r].color);Gp(t,r)}function sg(t,n,e){var r;t=Xp(t,e,"clipPath",IA),t.setAttribute("id",n.id),r=Xp(t,0,"rect",IA),r.setAttribute("x",0),r.setAttribute("y",0),r.setAttribute("width",n.width),r.setAttribute("height",n.height)}function lg(t,n){for(;t&&t.dirty!==n;t=t.mark.group){if(t.dirty=n,!t.mark||t.mark.dirty===n)return;t.mark.dirty=n}}function fg(t,n,e){var r=n.firstChild,i=0;tp(e,function(e){r=t.draw(n,e,r),++i}),Gp(n,1+i)}function cg(t,n,e,r){var i,a=t._svg;if(!a&&(i=n.ownerDocument,a=Hp(i,r,IA),t._svg=a,t.mark&&(a.__data__=t,a.__values__={fill:"default"},"g"===r))){var o=Hp(i,"path",IA);o.setAttribute("class","background"),a.appendChild(o),o.__data__=t}return(i||a.previousSibling!==e)&&n.insertBefore(a,e?e.nextSibling:n.firstChild),a}function hg(t,n,e){n!==HA[t]&&(null!=n?e?BA.setAttributeNS(e,t,n):BA.setAttribute(t,n):e?BA.removeAttributeNS(e,t):BA.removeAttribute(t),HA[t]=n)}function dg(){return"undefined"!=typeof window?window.location.href:""}function pg(t){gh.call(this,t),this._text={head:"",root:"",foot:"",defs:"",body:""},this._defs={clip_id:1,gradient:{},clipping:{}}}function gg(t,n,e,r){JA[r||t]=n}function mg(t,n,e,r){if(null==t)return"";var i,a,o,u,s,l="";for("bgrect"===e&&n.interactive===!1&&(l+="pointer-events: none;"),"text"===e&&(l+="font: "+Up(t)+";"),i=0,a=jA.length;a>i;++i)o=jA[i],u=FA[o],s=t[o],null==s?"fill"===u&&(l+=(l.length?" ":"")+"fill: none;"):(s.id&&(r.gradient[s.id]=s,s="url(#"+s.id+")"),l+=(l.length?" ":"")+u+": "+s+";");return l?'style="'+l+'"':null}function vg(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function yg(t,n,e,r){var i,a,o,u=ah(n,e),s=t.domain(),l=s[0],f=s[s.length-1];for("linear"!==t.type&&t.ticks&&(s=t.ticks(+r||15),l!==s[0]&&s.unshift(l),f!==s[s.length-1]&&s.push(f)),o=t.range?t.copy().domain([l,f]).range([0,1]):function(t){return(t-l)/(f-l)},i=0,a=s.length;a>i;++i)u.stop(o(s[i]),t(s[i]));return u}function _g(t){Ye.call(this,null,t)}function xg(t,n,e){return t.bounds_prev.clear().union(t.bounds),n(t.bounds.clear(),t,e)}function bg(t){Ye.call(this,null,t)}function wg(t){Ye.call(this,null,t)}function Mg(t){Ye.call(this,null,t)}function kg(t,n,e){var r,i,a,o,u,s=n.items,l=Math.max(0,n.width||0),f=Math.max(0,n.height||0),c=(new ih).set(0,0,l,f),h=c.clone(),d=h.clone(),p=[];for(o=0,u=s.length;u>o;++o)switch(r=s[o],r.role){case eT:d.union(Eg(r,l,f));break;case iT:p.push(r);break;case rT:case aT:c.union(r.bounds);default:h.union(r.bounds)}if(c.union(d),p.length)for(i={left:0,right:0,margin:e.legendMargin||8},d.union(h),o=0,u=p.length;u>o;++o)a=Sg(p[o],i,d,l,f),e.autosize===KA?c.add(a.x1,0).add(a.x2,0):c.union(a);Cg(t,n,h,c.union(h),e)}function Eg(t,n,e){var r,i=t.items[0],a=i.datum,o=a.orient,u=a.grid?1:0,s=u+1,l=s+(a.domain?2:1),f=i.range,c=i.offset,h=i.position,d=i.minExtent,p=i.maxExtent,g=a.title&&i.items[l].items[0],m=i.titlePadding,v=g?g.fontSize+m:0,y=i.bounds,_=0,x=0;switch(y.clear().union(i.items[u].bounds).union(i.items[s].bounds),o){case"top":_=h||0,x=-c,r=Math.max(d,Math.min(p,-y.y1)),g&&(g.auto?(g.y=-(m+r),r+=v):y.union(g.bounds)),y.add(0,-r).add(f,0);break;case"left":_=-c,x=h||0,r=Math.max(d,Math.min(p,-y.x1)),g&&(g.auto?(g.x=-(m+r),r+=v):y.union(g.bounds)),y.add(-r,0).add(0,f);break;case"right":_=n+c,x=h||0,r=Math.max(d,Math.min(p,y.x2)),g&&(g.auto?(g.x=m+r,r+=v):y.union(g.bounds)),y.add(0,0).add(r,f);break;case"bottom":_=h||0,x=e+c,r=Math.max(d,Math.min(p,y.y2)),g&&(g.auto?(g.y=m+r,r+=v):y.union(g.bounds)),y.add(0,0).add(f,r)}return i.x=_+.5,i.y=x+.5,Bd(y.translate(_,x),i),i.mark.bounds.clear().union(y),y}function Sg(t,n,e,r,i){var a,o,u=t.items[0],s=u.datum,l=s.orient,f=u.offset,c=u.bounds.clear(),h=0,d=n[l]||0;switch(u.items.forEach(function(t){c.union(t.bounds)}),a=Math.round(c.width())+2*u.padding-1,o=Math.round(c.height())+2*u.padding-1,l){case"left":h-=a+f-Math.floor(e.x1),n.left+=o+n.margin;break;case"right":h+=f+Math.ceil(e.x2),n.right+=o+n.margin;break;case"top-left":h+=f,d+=f;break;case"top-right":h+=r-a-f,d+=f;break;case"bottom-left":h+=f,d+=i-o-f;break;case"bottom-right":h+=r-a-f,d+=i-o-f}return u.x=h,u.y=d,u.width=a,u.height=o,Bd(c.set(h,d,h+a,d+o),u),u.mark.bounds.clear().union(c),c}function Cg(t,n,e,r,i){var a=i.autosize,o=t._width,u=t._height;if(!(t._autosize<1)&&a){var s=Math.max(0,n.width||0),l=Math.max(0,Math.ceil(-r.x1)),f=Math.max(0,Math.ceil(r.x2-s)),c=Math.max(0,n.height||0),h=Math.max(0,Math.ceil(-r.y1)),d=Math.max(0,Math.ceil(r.y2-c));a===nT?(o=s,u=c,l=0,h=0):a===KA?(s=Math.max(0,o-l-f),c=Math.max(0,u-h-d)):a===tT&&(o=s+l+f,u=c+h+d,n.width<0&&(s=e.width()),n.height<0&&(c=e.height())),t.autosize(o,u,s,c,[l,h])}}function Ag(t,n){return this._el?Tg(this,t||this._el,n):this.warn("Bind not supported for headless views."),this}function Tg(t,n,e){var r={elements:null,set:null,update:function(n){t.signal(e.signal,n).run()}};return N(n)&&(n=document.querySelector(n)),Ng(r,n,e,t.signal(e.signal)),t.on(t._signals[e.signal],null,function(){r.set(t.signal(e.signal))}),r}function Ng(t,n,e,r){var i=qg("div",{"class":uT});i.appendChild(qg("span",{"class":sT},e.name||e.signal)),n.appendChild(i);var a=zg;switch(e.type){case"checkbox":a=Dg;break;case"select":a=Og;break;case"radio":a=Rg;break;case"range":a=Pg}a(t,i,e,r)}function zg(t,n,e,r){var i=qg("input");for(var a in e)"signal"!==a&&"element"!==a&&i.setAttribute(a,e[a]);i.setAttribute("name",e.signal),i.setAttribute("value",r),n.appendChild(i),i.addEventListener("input",function(){t.update(i.value)}),t.elements=[i],t.set=function(t){i.value=t}}function Dg(t,n,e,r){var i={type:"checkbox",name:e.signal};r&&(i.checked=!0);var a=qg("input",i);n.appendChild(a),a.addEventListener("change",function(){t.update(a.checked)}),t.elements=[a],t.set=function(t){a.checked=!!t||null}}function Og(t,n,e,r){var i=qg("select",{name:e.signal});e.options.forEach(function(t){var n={value:t};t===r&&(n.selected=!0),i.appendChild(qg("option",n,t))}),n.appendChild(i),i.addEventListener("change",function(){t.update(e.options[i.selectedIndex])}),t.elements=[i],t.set=function(t){i.selectedIndex=e.options.indexOf(t)}}function Rg(t,n,e,r){var i=qg("span",{"class":lT});n.appendChild(i),t.elements=e.options.map(function(n){var a=fT+e.signal+"-"+n,o={id:a,type:"radio",name:e.signal,value:n};n===r&&(o.checked=!0);var u=qg("input",o);return u.addEventListener("change",function(){t.update(n)}),i.appendChild(u),i.appendChild(qg("label",{"for":a},n)),u}),t.set=function(n){for(var e=t.elements,r=0,i=e.length;i>r;++r)e[r].value===n&&(e[r].checked=!0)}}function Pg(t,n,e,r){r=void 0!==r?r:(+e.max+ +e.min)/2;var i=e.min||Math.min(0,+r)||0,a=e.max||Math.max(100,+r)||100,o=e.step||f(i,a,100),u=qg("input",{type:"range",value:r,name:e.signal,min:i,max:a,step:o}),s=qg("label",{},+r);n.appendChild(u),n.appendChild(s),u.addEventListener("input",function(){s.innerText=u.value,t.update(+u.value)}),t.elements=[u],t.set=function(t){u.value=t,s.innerText=t}}function qg(t,n,e){var r=document.createElement(t);for(var i in n)r.setAttribute(i,n[i]);return null!=e&&(r.innerText=e),r}function Lg(t){var n=t._signals.cursor;n||(t._signals.cursor=n=t.add({user:cT,item:null})),t.on(t.events("view","mousemove"),n,function(t,e){var r=n.value,i=r?N(r)?r:r.user:cT,a=e.item&&e.item.cursor||null;return r&&i===r.user&&a==r.item?r:{user:i,item:a}}),t.add(null,function(t){var n=t.cursor,e=this.value;return N(n)||(e=n.item,n=n.user),Ug(n&&n!==cT?n:e||n),e},{cursor:n})}function Ug(t){"undefined"!=typeof document&&document.body&&(document.body.style.cursor=t)}function Fg(t,n){var e=t._data;return e.hasOwnProperty(n)||t.error("Unrecognized data set: "+n),e[n]}function jg(t){return Fg(this,t).values.value}function Ig(t,n){return this.pulse(Fg(this,t).input,fe().insert(n))}function $g(t,n){return this.pulse(Fg(this,t).input,fe().remove(n))}function Wg(t){var n=t.padding();return Math.max(0,t._width+n.left+n.right)}function Bg(t){var n=t.padding();return Math.max(0,t._height+n.top+n.bottom)}function Hg(t){var n=t.padding(),e=t._origin;return[n.left+e[0],n.top+e[1]]}function Yg(t){var n=Hg(t);t._renderer.background(t._background),t._renderer.resize(Wg(t),Bg(t),n),t._handler.origin(n)}function Xg(t,n,e){var r,i,a,o=t._renderer.element();return o&&(a=Hg(t),i=n.changedTouches?n.changedTouches[0]:n,r=Bp(i,o),r[0]-=a[0],r[1]-=a[1]),n.vega=Gg(t,e,r),n.item=e,n}function Gg(t,n,e){function r(t){var e,r=a;if(t)for(e=n;e;e=e.mark.group)if(e.mark.name===t){r=e;break}return r&&r.mark&&r.mark.interactive?r:{}}function i(t){if(!t)return e;N(t)&&(t=r(t));for(var n=e.slice();t;)n[0]-=t.x||0,n[1]-=t.y||0,t=t.mark&&t.mark.group;return n}var a=n?"group"===n.mark.marktype?n:n.mark.group:null;return{view:U(t),item:U(n||{}),group:r,xy:i,x:function(t){return i(t)[0]},y:function(t){return i(t)[1]}}}function Jg(t,n,e){var r,i=this,a=new ve(e),o=function(t,n){a.receive(Xg(i,t,n)),i.run()};if("view"===t)return i._handler.on(n,o),a;"window"===t?"undefined"!=typeof window&&(r=[window]):"undefined"!=typeof document&&(r=document.querySelectorAll(t)),r||i.error("Can not resolve event source: "+t);for(var u=0,s=r.length;s>u;++u)r[u].addEventListener(n,o);return i._eventListeners.push({type:n,sources:r,handler:o}),a}function Vg(t){return t.item}function Zg(t){var n=t.item.mark.source;return n.source||n}function Qg(t){return function(n,e){return e.vega.view().changeset().encode(e.item,t)}}function Kg(t,n){return this.on(this.events("view","mouseover",Vg),Zg,Qg(t||"hover")),this.on(this.events("view","mouseout",Vg),Zg,Qg(n||"update")),this}function tm(){for(var t,n,e=this._eventListeners,r=e.length;--r>=0;)for(n=e[r],t=n.sources.length;--t>=0;)n.sources[t].removeEventListener(n.type,n.handler)}function nm(t,n,e,r){return n=n||new r(t.loadOptions()),n.initialize(e,Wg(t),Bg(t),Hg(t)).background(t._background)}function em(t,n,e,r){var i=(new r).scene(t.scenegraph().root).initialize(e,Hg(t),t);return n&&n.handlers().forEach(function(t){i.on(t.type,t.handler)}),i}function rm(t){var n=this,e=n._renderType,r=Vp,i=tg;
return e===pT&&(r=rg,i=t?og:pg),t?("string"==typeof t&&"undefined"!=typeof document&&(t=document.querySelector(t)),t.innerHTML="",n._el=t):n._el=null,n._renderer=e===gT?null:nm(n,n._renderer,t,i),n._handler=em(n,n._handler,t,r),t&&n._bind&&n._bind.forEach(function(e){n.bind(e.element||t,e)}),n}function im(t,n){return t.runAsync().then(function(){var e=n===pT?pg:tg;return nm(t,null,null,e).renderAsync(t._scenegraph.root)})}function am(t){return t===dT&&(t=hT),t!==pT&&t!==hT?Promise.reject("Unrecognized image type: "+t):im(this,t).then(function(n){return t===hT?n.canvas().toDataURL("image/png"):window.URL.createObjectURL(new Blob([n.svg()],{type:"image/svg+xml"}))})}function om(){return im(this,hT).then(function(t){return t.canvas()})}function um(){return im(this,pT).then(function(t){return t.svg()})}function sm(t){var n={};return function(e,r){var i=n[e]||(n[e]=t(e));return i(r)}}function lm(){return{format:sm(kM),timeFormat:sm(lb),utcFormat:sm(cb)}}function fm(t,n,e){";"!==n[n.length-1]&&(n="return("+n+");");var r=Function.apply(null,t.concat(n));return e&&e.functions?r.bind(e.functions):r}function cm(t,n){return fm(["_"],t,n)}function hm(t,n){return fm(["datum","_"],t,n)}function dm(t,n){return fm(["event"],t,n)}function pm(t,n){return fm(["_","event"],t,n)}function gm(t,n){return fm(["item","_"],t,n)}function mm(t,n,e){e=e||{};var r,i;for(r in t)i=t[r],i&&i.$expr&&i.$params&&mm(i.$params,n,e),e[r]=yx(i)?i.map(function(t){return vm(t,n)}):vm(i,n);return e}function vm(t,n){if(!t||!T(t))return t;for(var e,r=0,i=mT.length;i>r;++r)if(e=mT[r],t.hasOwnProperty(e.key))return e.parse(t,n);return t}function ym(t,n){return n.get(t.$ref)||F("Operator not defined: "+t.$ref)}function _m(t,n){var e="e:"+t.$expr;return n.fn[e]||(n.fn[e]=k(hm(t.$expr,n),t.$fields,t.$name))}function xm(t,n){var e="k:"+t.$key;return n.fn[e]||(n.fn[e]=B(t.$key))}function bm(t,n){var e="f:"+t.$field+"_"+t.$name;return n.fn[e]||(n.fn[e]=D(t.$field,t.$name))}function wm(t,n){var e="c:"+t.$compare+"_"+t.$order;return n.fn[e]||(n.fn[e]=q(t.$compare,t.$order))}function Mm(t,n){var e,r,i=t.$encode,a={};for(e in i)r=i[e],a[e]=k(gm(r.$expr,n),r.$fields),a[e].output=r.$output;return a}function km(t,n){var e=t.$subflow;return function(t,r,i,a){var o=Nm(e,n.fork(i)),u=o.get(e.operators[0].id),s=o.signals.parent;return s&&s.set(a),u.context=o,u}}function Em(t,n){return{marks:t.$itempath,items:n.itempath,context:n}}function Sm(t,n){"Operator"!==t.type&&t.type?n.transform(t,t.type):n.operator(t,t.update?cm(t.update,n):null)}function Cm(t,n){var e,r;t.params&&((e=n.get(t.id))||F("Invalid operator id: "+t.id),r=mm(t.params,n),n.dataflow.connect(e,e.parameters(r)))}function Am(t,n){var e,r=null!=t.filter?dm(t.filter):void 0,i=null!=t.stream?n.get(t.stream):void 0;t.source?i=n.events(t.source,t.type,r):t.merge&&(e=t.merge.map(n.get.bind(n)),i=e[0].merge.apply(e[0],e.slice(1))),t.between&&(e=t.between.map(n.get.bind(n)),i=i.between(e[0],e[1])),t.filter&&(i=i.filter(r)),null!=t.throttle&&(i=i.throttle(+t.throttle)),null!=t.debounce&&(i=i.debounce(+t.debounce)),null==i&&F("Invalid stream definition: "+JSON.stringify(t)),t.consume&&i.consume(!0),n.stream(t,i)}function Tm(t,n){var e=n.get(t.source),r=null,i=t.update,a=void 0;e||F("Source not defined: "+t.source),r=t.target&&t.target.$expr?dm(t.target.$expr):n.get(t.target),i&&i.$expr&&(i.$params&&(a=mm(i.$params,n)),i=pm(i.$expr,n)),n.update(t,e,r,i,a)}function Nm(t,n){var e=t.operators||[];return t.background&&(n.background=t.background),e.forEach(function(t){Sm(t,n)}),e.forEach(function(t){Cm(t,n)}),(t.streams||[]).forEach(function(t){Am(t,n)}),(t.updates||[]).forEach(function(t){Tm(t,n)}),n}function zm(t,n,e){return new Dm(t,n,e)}function Dm(t,n,e){this.dataflow=t,this.transforms=n,this.events=t.events.bind(t),this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},this.itempath=[],e&&(this.functions=e,this.functions.context=this)}function Om(t,n){this.dataflow=t.dataflow,this.transforms=t.transforms,this.functions=t.functions,this.events=t.events,this.signals=Object.create(t.signals),this.scales=Object.create(t.scales),this.nodes=Object.create(t.nodes),this.data=Object.create(t.data),this.fn=Object.create(t.fn),this.itempath=t.itempath.concat(n),t.functions&&(this.functions=Object.create(t.functions),this.functions.context=this)}function Rm(t,n){var e=N(t)?n.scales[t]:T(t)&&t.signal?n.signals[t.signal]:void 0;return e&&e.value}function Pm(){var t=lm();return t.pad=X,t.truncate=V,t.rgb=Qr,t.lab=oi,t.hcl=di,t.hsl=ei,t.gradient=yg,t.clampRange=function(t,n,e){var r,i=t[0],a=t[1];return i>a&&(r=a,a=i,i=r),r=a-i,[Math.min(Math.max(i,n),e-r),Math.min(Math.max(a,r),e)]},t.pinchDistance=function(){return"Math.sqrt(pow(event.touches[0].clientX - event.touches[1].clientX, 2) + pow(event.touches[0].clientY - event.touches[1].clientY, 2))"},t.pinchAngle=function(){return"Math.atan2(event.touches[1].clientY - event.touches[0].clientY,event.touches[1].clientX - event.touches[0].clientX)"},t.open=function(t,n){if("undefined"!=typeof window&&window&&window.open){var e=this.context.dataflow.loadOptions(),r=vt.sanitize(t,j({type:"open",name:n},e));r?window.open(r,n):F("Invalid URL: "+e.url)}else F("Open function can only be invoked in a browser.")},t.span=function(t){return t[t.length-1]-t[0]},t.range=function(t,n){var e=Rm(t,(n||this).context);return e&&e.range?e.range():[0,0]},t.bandwidth=function(t,n){var e=Rm(t,(n||this).context);return e&&e.bandwidth?e.bandwidth():0},t.scaleCopy=function(t,n){var e=Rm(t,(n||this).context);return e?e.copy():void 0},t.scale=function(t,n,e){var r=Rm(t,(e||this).context);return r?r(n):void 0},t.scaleInvert=function(t,n,e){var r=Rm(t,(e||this).context);return r?yx(n)?(r.invertRange||r.invert)(n):(r.invert||r.invertExtent)(n):void 0},t.indata=function(t,n,e){var r=this.context.data[t]["index:"+n],i=r?r.value[e]:void 0;return i?i.count:i},t.inrange=function(t,n){var e,r=n[0],i=n[n.length-1];return r>i&&(e=r,r=i,i=e),t>=r&&i>=t},t.encode=function(t,n,e){if(t){var r=this.context.dataflow,i=t.mark.source;r.pulse(i,r.changeset().encode(t,n))}return void 0!==e?e:t},t.modify=function(t,n,e,r,i,a){var o,u,s=this.context.dataflow,l=this.context.data[t],f=l.input,c=l.changes,h=s.stamp();if(!(f.value.length||n||r))return 0;if((!c||c.stamp<h)&&(l.changes=c=s.changeset(),c.stamp=h,s.runAfter(function(){s.pulse(f,c).run()})),e&&c.remove(e===!0?kx:e),n&&c.insert(n),r&&(o=function(t){for(u in r)if(t[u]!==r[u])return!1;return!0},f.value.filter(o).length?c.remove(o):c.insert(r)),i)for(u in a)c.modify(i,u,a[u]);return 1},t}function qm(t,n){return Nm(n,zm(t,Xb,Pm()))}function Lm(t,n){var e=t.add(null,function(e){t["_"+n]=e.size,t._autosize=t._resize=1},{size:t._signals[n]});return e.rank=0,e}function Um(t,n,e,r,i){this.runAfter(function(a){var o=0;a._autosize=0,a.width()!==e&&(o=1,a.width(e),a._resizeWidth.skip(!0)),a.height()!==r&&(o=1,a.height(r),a._resizeHeight.skip(!0)),a._width!==t&&(a._resize=1,a._width=t),a._height!==n&&(a._resize=1,a._height=n),(a._origin[0]!==i[0]||a._origin[1]!==i[1])&&(a._resize=1,a._origin=i),o&&a.run("enter")})}function Fm(t){var n,e;if(arguments.length){e={skip:!0};for(n in t)this.signal(n,t[n],e);return this.run()}t={};for(n in this._signals)t[n]=this.signal(n);return t}function jm(t,n){n=n||{},Be.call(this),this.loadOptions(n.loadOptions||{}),this.logLevel(n.logLevel||0),this._el=null,this._renderType=n.renderer||hT,this._scenegraph=new ch;var e=this._scenegraph.root;this._renderer=null,this._handler=(new Vp).scene(e),this._queue=null,this._eventListeners=[];var r=qm(this,t);this._signals=r.signals,this._scales=r.scales,this._data=r.data,this._bind=t.bindings,"undefined"!=typeof self&&(self.context=r),r.root&&r.root.set(e),e.source=this._data.root.input,this.pulse(this._data.root.input,this.changeset().insert(e.items)),this._background=r.background||null,this._width=this.width(),this._height=this.height(),this._origin=[0,0],this._resize=0,this._autosize=1,this._resizeWidth=Lm(this,"width"),this._resizeHeight=Lm(this,"height"),Lg(this)}function Im(t){return T(t)?t:W(t)?{top:t,bottom:t,left:t,right:t}:{top:0,left:0,bottom:0,right:0}}function $m(t,n){var e=n.addSignal(t.name,t.value);t.react===!1&&(e.react=!1),t.bind&&n.addBinding(t.name,t.bind)}function Wm(t){this.type=t}function Bm(t){switch(t.type){case"ArrayExpression":return t.elements;case"BinaryExpression":case"LogicalExpression":return[t.left,t.right];case"CallExpression":var n=t.arguments.slice();return n.unshift(t.callee),n;case"ConditionalExpression":return[t.test,t.consequent,t.alternate];case"MemberExpression":return[t.object,t.property];case"ObjectExpression":return t.properties;case"Property":return[t.key,t.value];case"UnaryExpression":return[t.argument];case"Identifier":case"Literal":case"RawCode":default:return[]}}function Hm(t,n){if(!t)throw new Error("ASSERT: "+n)}function Ym(t){return t>=48&&57>=t}function Xm(t){return"0123456789abcdefABCDEF".indexOf(t)>=0}function Gm(t){return"01234567".indexOf(t)>=0}function Jm(t){return 32===t||9===t||11===t||12===t||160===t||t>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(t)>=0}function Vm(t){return 10===t||13===t||8232===t||8233===t}function Zm(t){return 36===t||95===t||t>=65&&90>=t||t>=97&&122>=t||92===t||t>=128&&KT.test(String.fromCharCode(t))}function Qm(t){return 36===t||95===t||t>=65&&90>=t||t>=97&&122>=t||t>=48&&57>=t||92===t||t>=128&&tN.test(String.fromCharCode(t))}function Km(){for(var t;xT>_T&&(t=yT.charCodeAt(_T),Jm(t)||Vm(t));)++_T}function tv(t){var n,e,r,i=0;for(e="u"===t?4:2,n=0;e>n;++n)xT>_T&&Xm(yT[_T])?(r=yT[_T++],i=16*i+"0123456789abcdef".indexOf(r.toLowerCase())):Av({},IT,ZT);return String.fromCharCode(i)}function nv(){var t,n,e,r;for(t=yT[_T],n=0,"}"===t&&Av({},IT,ZT);xT>_T&&(t=yT[_T++],Xm(t));)n=16*n+"0123456789abcdef".indexOf(t.toLowerCase());return(n>1114111||"}"!==t)&&Av({},IT,ZT),65535>=n?String.fromCharCode(n):(e=(n-65536>>10)+55296,r=(n-65536&1023)+56320,String.fromCharCode(e,r))}function ev(){var t,n;for(t=yT.charCodeAt(_T++),n=String.fromCharCode(t),92===t&&(117!==yT.charCodeAt(_T)&&Av({},IT,ZT),++_T,t=tv("u"),t&&"\\"!==t&&Zm(t.charCodeAt(0))||Av({},IT,ZT),n=t);xT>_T&&(t=yT.charCodeAt(_T),Qm(t));)++_T,n+=String.fromCharCode(t),92===t&&(n=n.substr(0,n.length-1),117!==yT.charCodeAt(_T)&&Av({},IT,ZT),++_T,t=tv("u"),t&&"\\"!==t&&Qm(t.charCodeAt(0))||Av({},IT,ZT),n+=t);return n}function rv(){var t,n;for(t=_T++;xT>_T;){if(n=yT.charCodeAt(_T),92===n)return _T=t,ev();if(!Qm(n))break;++_T}return yT.slice(t,_T)}function iv(){var t,n,e;return t=_T,n=92===yT.charCodeAt(_T)?ev():rv(),e=1===n.length?kT:nN.hasOwnProperty(n)?ET:"null"===n?ST:"true"===n||"false"===n?wT:kT,{type:e,value:n,start:t,end:_T}}function av(){var t,n,e,r,i=_T,a=yT.charCodeAt(_T),o=yT[_T];switch(a){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++_T,{type:AT,value:String.fromCharCode(a),start:i,end:_T};default:if(t=yT.charCodeAt(_T+1),61===t)switch(a){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return _T+=2,{type:AT,value:String.fromCharCode(a)+String.fromCharCode(t),start:i,end:_T};case 33:case 61:return _T+=2,61===yT.charCodeAt(_T)&&++_T,{type:AT,value:yT.slice(i,_T),start:i,end:_T}}}return r=yT.substr(_T,4),">>>="===r?(_T+=4,{type:AT,value:r,start:i,end:_T}):(e=r.substr(0,3),">>>"===e||"<<="===e||">>="===e?(_T+=3,{type:AT,value:e,start:i,end:_T}):(n=e.substr(0,2),o===n[1]&&"+-<>&|".indexOf(o)>=0||"=>"===n?(_T+=2,{type:AT,value:n,start:i,end:_T}):"<>=!+-*%&|^/".indexOf(o)>=0?(++_T,{type:AT,value:o,start:i,end:_T}):void Av({},IT,ZT)))}function ov(t){for(var n="";xT>_T&&Xm(yT[_T]);)n+=yT[_T++];return 0===n.length&&Av({},IT,ZT),Zm(yT.charCodeAt(_T))&&Av({},IT,ZT),{type:CT,value:parseInt("0x"+n,16),start:t,end:_T}}function uv(t){for(var n="0"+yT[_T++];xT>_T&&Gm(yT[_T]);)n+=yT[_T++];return(Zm(yT.charCodeAt(_T))||Ym(yT.charCodeAt(_T)))&&Av({},IT,ZT),{type:CT,value:parseInt(n,8),octal:!0,start:t,end:_T}}function sv(){var t,n,e;if(e=yT[_T],Hm(Ym(e.charCodeAt(0))||"."===e,"Numeric literal must start with a decimal digit or a decimal point"),n=_T,t="","."!==e){if(t=yT[_T++],e=yT[_T],"0"===t){if("x"===e||"X"===e)return++_T,ov(n);if(Gm(e))return uv(n);e&&Ym(e.charCodeAt(0))&&Av({},IT,ZT)}for(;Ym(yT.charCodeAt(_T));)t+=yT[_T++];e=yT[_T]}if("."===e){for(t+=yT[_T++];Ym(yT.charCodeAt(_T));)t+=yT[_T++];e=yT[_T]}if("e"===e||"E"===e)if(t+=yT[_T++],e=yT[_T],("+"===e||"-"===e)&&(t+=yT[_T++]),Ym(yT.charCodeAt(_T)))for(;Ym(yT.charCodeAt(_T));)t+=yT[_T++];else Av({},IT,ZT);return Zm(yT.charCodeAt(_T))&&Av({},IT,ZT),{type:CT,value:parseFloat(t),start:n,end:_T}}function lv(){var t,n,e,r,i="",a=!1;for(t=yT[_T],Hm("'"===t||'"'===t,"String literal must starts with a quote"),n=_T,++_T;xT>_T;){if(e=yT[_T++],e===t){t="";break}if("\\"===e)if(e=yT[_T++],e&&Vm(e.charCodeAt(0)))"\r"===e&&"\n"===yT[_T]&&++_T;else switch(e){case"u":case"x":"{"===yT[_T]?(++_T,i+=nv()):i+=tv(e);break;case"n":i+="\n";break;case"r":i+="\r";break;case"t":i+=" ";break;case"b":i+="\b";break;case"f":i+="\f";break;case"v":i+="\x0B";break;default:Gm(e)?(r="01234567".indexOf(e),0!==r&&(a=!0),xT>_T&&Gm(yT[_T])&&(a=!0,r=8*r+"01234567".indexOf(yT[_T++]),"0123".indexOf(e)>=0&&xT>_T&&Gm(yT[_T])&&(r=8*r+"01234567".indexOf(yT[_T++]))),i+=String.fromCharCode(r)):i+=e}else{if(Vm(e.charCodeAt(0)))break;i+=e}}return""!==t&&Av({},IT,ZT),{type:TT,value:i,octal:a,start:n,end:_T}}function fv(t,n){var e=t;n.indexOf("u")>=0&&(e=e.replace(/\\u\{([0-9a-fA-F]+)\}/g,function(t,n){return parseInt(n,16)<=1114111?"x":void Av({},XT)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(e)}catch(r){Av({},XT)}try{return new RegExp(t,n)}catch(i){return null}}function cv(){var t,n,e,r,i;for(t=yT[_T],Hm("/"===t,"Regular expression literal must start with a slash"),n=yT[_T++],e=!1,r=!1;xT>_T;)if(t=yT[_T++],n+=t,"\\"===t)t=yT[_T++],Vm(t.charCodeAt(0))&&Av({},GT),n+=t;else if(Vm(t.charCodeAt(0)))Av({},GT);else if(e)"]"===t&&(e=!1);else{if("/"===t){r=!0;break}"["===t&&(e=!0)}return r||Av({},GT),i=n.substr(1,n.length-2),{value:i,literal:n}}function hv(){var t,n,e;for(n="",e="";xT>_T&&(t=yT[_T],Qm(t.charCodeAt(0)));)++_T,"\\"===t&&xT>_T?Av({},IT,ZT):(e+=t,n+=t);return e.search(/[^gimuy]/g)>=0&&Av({},XT,e),{value:e,literal:n}}function dv(){var t,n,e,r;return bT=null,Km(),t=_T,n=cv(),e=hv(),r=fv(n.value,e.value),{literal:n.literal+e.literal,value:r,regex:{pattern:n.value,flags:e.value},start:t,end:_T}}function pv(t){return t.type===kT||t.type===ET||t.type===wT||t.type===ST}function gv(){var t;return Km(),_T>=xT?{type:MT,start:_T,end:_T}:(t=yT.charCodeAt(_T),Zm(t)?iv():40===t||41===t||59===t?av():39===t||34===t?lv():46===t?Ym(yT.charCodeAt(_T+1))?sv():av():Ym(t)?sv():av())}function mv(){var t;return t=bT,_T=t.end,bT=gv(),_T=t.end,t}function vv(){var t;t=_T,bT=gv(),_T=t}function yv(t){var n=new Wm(NT);return n.elements=t,n}function _v(t,n,e){var r=new Wm("||"===t||"&&"===t?qT:zT);return r.operator=t,r.left=n,r.right=e,r}function xv(t,n){var e=new Wm(DT);return e.callee=t,e.arguments=n,e}function bv(t,n,e){var r=new Wm(OT);return r.test=t,r.consequent=n,r.alternate=e,r}function wv(t){var n=new Wm(RT);return n.name=t,n}function Mv(t){var n=new Wm(PT);return n.value=t.value,n.raw=yT.slice(t.start,t.end),t.regex&&("//"===n.raw&&(n.raw="/(?:)/"),n.regex=t.regex),n}function kv(t,n,e){var r=new Wm(LT);return r.computed="["===t,r.object=n,r.property=e,r.computed||(e.member=!0),r}function Ev(t){var n=new Wm(UT);return n.properties=t,n}function Sv(t,n,e){var r=new Wm(FT);return r.key=n,r.value=e,r.kind=t,r}function Cv(t,n){var e=new Wm(jT);return e.operator=t,e.argument=n,e.prefix=!0,e}function Av(t,n){var e,r=Array.prototype.slice.call(arguments,2),i=n.replace(/%(\d)/g,function(t,n){return Hm(n<r.length,"Message reference must be in range"),r[n]});throw e=new Error(i),e.index=_T,e.description=i,e}function Tv(t){t.type===MT&&Av(t,YT),t.type===CT&&Av(t,$T),t.type===TT&&Av(t,WT),t.type===kT&&Av(t,BT),t.type===ET&&Av(t,HT),Av(t,IT,t.value)}function Nv(t){var n=mv();(n.type!==AT||n.value!==t)&&Tv(n)}function zv(t){return bT.type===AT&&bT.value===t}function Dv(t){return bT.type===ET&&bT.value===t}function Ov(){var t=[];for(_T=bT.start,Nv("[");!zv("]");)zv(",")?(mv(),t.push(null)):(t.push(Gv()),zv("]")||Nv(","));return mv(),yv(t)}function Rv(){var t;return _T=bT.start,t=mv(),t.type===TT||t.type===CT?(t.octal&&Av(t,JT),Mv(t)):wv(t.value)}function Pv(){var t,n,e,r;return _T=bT.start,t=bT,t.type===kT?(e=Rv(),Nv(":"),r=Gv(),Sv("init",e,r)):t.type!==MT&&t.type!==AT?(n=Rv(),Nv(":"),r=Gv(),Sv("init",n,r)):void Tv(t)}function qv(){var t,n,e,r=[],i={},a=String;for(_T=bT.start,Nv("{");!zv("}");)t=Pv(),n=t.key.type===RT?t.key.name:a(t.key.value),e="$"+n,Object.prototype.hasOwnProperty.call(i,e)?Av({},VT):i[e]=!0,r.push(t),zv("}")||Nv(",");return Nv("}"),Ev(r)}function Lv(){var t;return Nv("("),t=Jv(),Nv(")"),t}function Uv(){var t,n,e;if(zv("("))return Lv();if(zv("["))return Ov();if(zv("{"))return qv();if(t=bT.type,_T=bT.start,t===kT||eN[bT.value])e=wv(mv().value);else if(t===TT||t===CT)bT.octal&&Av(bT,JT),e=Mv(mv());else{if(t===ET)throw new Error(QT);t===wT?(n=mv(),n.value="true"===n.value,e=Mv(n)):t===ST?(n=mv(),n.value=null,e=Mv(n)):zv("/")||zv("/=")?(e=Mv(dv()),vv()):Tv(mv())}return e}function Fv(){var t=[];if(Nv("("),!zv(")"))for(;xT>_T&&(t.push(Gv()),!zv(")"));)Nv(",");return Nv(")"),t}function jv(){var t;return _T=bT.start,t=mv(),pv(t)||Tv(t),wv(t.value)}function Iv(){return Nv("."),jv()}function $v(){var t;return Nv("["),t=Jv(),Nv("]"),t}function Wv(){var t,n,e;for(t=Uv();;)if(zv("."))e=Iv(),t=kv(".",t,e);else if(zv("("))n=Fv(),t=xv(t,n);else{if(!zv("["))break;e=$v(),t=kv("[",t,e)}return t}function Bv(){var t=Wv();if(bT.type===AT&&(zv("++")||zv("--")))throw new Error(QT);return t}function Hv(){var t,n;if(bT.type!==AT&&bT.type!==ET)n=Bv();else{if(zv("++")||zv("--"))throw new Error(QT);if(zv("+")||zv("-")||zv("~")||zv("!"))t=mv(),n=Hv(),n=Cv(t.value,n);else{if(Dv("delete")||Dv("void")||Dv("typeof"))throw new Error(QT);n=Bv()}}return n}function Yv(t){var n=0;if(t.type!==AT&&t.type!==ET)return 0;switch(t.value){case"||":n=1;break;case"&&":n=2;break;case"|":n=3;break;case"^":n=4;break;case"&":n=5;break;case"==":case"!=":case"===":case"!==":n=6;break;case"<":case">":case"<=":case">=":case"instanceof":case"in":n=7;break;case"<<":case">>":case">>>":n=8;break;case"+":case"-":n=9;break;case"*":case"/":case"%":n=11}return n}function Xv(){var t,n,e,r,i,a,o,u,s,l;if(t=bT,s=Hv(),r=bT,i=Yv(r),0===i)return s;for(r.prec=i,mv(),n=[t,bT],o=Hv(),a=[s,r,o];(i=Yv(bT))>0;){for(;a.length>2&&i<=a[a.length-2].prec;)o=a.pop(),u=a.pop().value,s=a.pop(),n.pop(),e=_v(u,s,o),a.push(e);r=mv(),r.prec=i,a.push(r),n.push(bT),e=Hv(),a.push(e)}for(l=a.length-1,e=a[l],n.pop();l>1;)n.pop(),e=_v(a[l-1].value,a[l-2],e),l-=2;return e}function Gv(){var t,n,e;return t=Xv(),zv("?")&&(mv(),n=Gv(),Nv(":"),e=Gv(),t=bv(t,n,e)),t}function Jv(){var t=Gv();if(zv(","))throw new Error(QT);return t}function Vv(t){yT=t,_T=0,xT=yT.length,bT=null,vv();var n=Jv();if(bT.type!==MT)throw new Error("Unexpect token after expression.");return n}function Zv(t){function n(n,e,r,i){var a=t(e[0]);return r&&(a=r+"("+a+")",0===r.lastIndexOf("new ",0)&&(a="("+a+")")),a+"."+n+(0>i?"":0===i?"()":"("+e.slice(1).map(t).join(",")+")")}function e(t,e,r){return function(i){return n(t,i,e,r)}}var r="new Date",i="String",a="RegExp";return{isNaN:"isNaN",isFinite:"isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(n){n.length<3&&F("Missing arguments to clamp function."),n.length>3&&F("Too many arguments to clamp function.");var e=n.map(t);return"Math.max("+e[1]+", Math.min("+e[2]+","+e[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:r,date:e("getDate",r,0),day:e("getDay",r,0),year:e("getFullYear",r,0),month:e("getMonth",r,0),hours:e("getHours",r,0),minutes:e("getMinutes",r,0),seconds:e("getSeconds",r,0),milliseconds:e("getMilliseconds",r,0),time:e("getTime",r,0),timezoneoffset:e("getTimezoneOffset",r,0),utcdate:e("getUTCDate",r,0),utcday:e("getUTCDay",r,0),utcyear:e("getUTCFullYear",r,0),utcmonth:e("getUTCMonth",r,0),utchours:e("getUTCHours",r,0),utcminutes:e("getUTCMinutes",r,0),utcseconds:e("getUTCSeconds",r,0),utcmilliseconds:e("getUTCMilliseconds",r,0),length:e("length",null,-1),indexof:e("indexOf",null),lastindexof:e("lastIndexOf",null),slice:e("slice",null),parseFloat:"parseFloat",parseInt:"parseInt",upper:e("toUpperCase",i,0),lower:e("toLowerCase",i,0),substring:e("substring",i),replace:e("replace",i),regexp:a,test:e("test",a),"if":function(n){n.length<3&&F("Missing arguments to if function."),n.length>3&&F("Too many arguments to if function.");var e=n.map(t);return e[0]+"?"+e[1]+":"+e[2]}}}function Qv(t){function n(t){if(N(t))return t;var n=g[t.type];return null==n&&F("Unsupported type: "+t.type),n(t)}function e(t){var e={code:n(t),globals:Object.keys(f),fields:Object.keys(c),data:Object.keys(h),defs:u};return f={},c={},h={},e}t=t||{};var r=t.whitelist?J(t.whitelist):{},i=t.blacklist?J(t.blacklist):{},a=t.constants||rN,o=(t.functions||Zv)(n),u=t.functionDefs?t.functionDefs(n):{},s=t.globalvar,l=t.fieldvar,f={},c={},h={},d=0,p=L(s)?s:function(t){return s+'["'+t+'"]'},g={Literal:function(t){return t.raw},Identifier:function(t){var n=t.name;return d>0?n:i.hasOwnProperty(n)?F("Illegal identifier: "+n):a.hasOwnProperty(n)?a[n]:r.hasOwnProperty(n)?n:(f[n]=1,p(n))},MemberExpression:function(t){var e=!t.computed,r=n(t.object);e&&(d+=1);var i=n(t.property);return r===l&&(c[i]=1),e&&(d-=1),r+(e?"."+i:"["+i+"]")},CallExpression:function(t){"Identifier"!==t.callee.type&&F("Illegal callee type: "+t.callee.type);var e=t.callee.name,r=t.arguments,i=o.hasOwnProperty(e)&&o[e];return i||F("Unrecognized function: "+e),L(i)?i(r,f,c,h):i+"("+r.map(n).join(",")+")"},ArrayExpression:function(t){return"["+t.elements.map(n).join(",")+"]"},BinaryExpression:function(t){return"("+n(t.left)+t.operator+n(t.right)+")"},UnaryExpression:function(t){return"("+t.operator+n(t.argument)+")"},ConditionalExpression:function(t){return"("+n(t.test)+"?"+n(t.consequent)+":"+n(t.alternate)+")"},LogicalExpression:function(t){return"("+n(t.left)+t.operator+n(t.right)+")"},ObjectExpression:function(t){return"{"+t.properties.map(n).join(",")+"}"},Property:function(t){d+=1;var e=n(t.key);return d-=1,e+":"+n(t.value)}};return e.functions=o,e.functionDefs=u,e.constants=a,e}function Kv(t){return"_["+z("$"+t)+"]"}function ty(t,n,e){var r=oN+t;e.hasOwnProperty(r)||(e[r]=n.signalRef(t))}function ny(t,n,e){var r=uN+t;if(!e.hasOwnProperty(r))try{e[r]=n.scaleRef(t)}catch(i){}}function ey(t,n,e,r){var i=sN+n;r.hasOwnProperty(i)||(r[i]=e.getData(t).indataRef(e,n))}function ry(t,n,e){var r,i,a={};try{r=Vv(t)}catch(o){F("Expression parse error: "+t)}return r.visit(function(t){if("CallExpression"===t.type){var e=t.callee.name,r=t.arguments;switch(e){case"bandwidth":case"copy":case"range":case"gradient":case"invert":case"scale":r[0].type===iN?ny(r[0].value,n,a):r[0].type===aN&&(e=r[0].name,r[0]=new Wm(iN),r[0].raw='{signal:"'+e+'"}');break;case"indata":r[0].type!==iN&&F("First argument to indata must be a string literal."),r[1].type!==iN&&F("Second argument to indata must be a string literal."),ey(r[0].value,r[1].value,n,a)}}}),i=cN(r),i.globals.forEach(function(t){ty(t,n,a)}),{$expr:e?e+"return("+i.code+");":i.code,$fields:i.fields,$params:a}}function iy(t){return vN.hasOwnProperty(t)}function ay(t){return uy(t.trim()).map(sy)}function oy(t,n,e,r,i){for(var a,o=0,u=t.length;u>n;++n){if(a=t[n],i&&i.indexOf(a)>=0&&--o,a===e&&!o)return n;r&&r.indexOf(a)>=0&&++o}return n}function uy(t){for(var n=[],e=0,r=t.length,i=0;r>i;)i=oy(t,i,MN,yN+xN,_N+bN),n.push(t.substring(e,i).trim()),e=++i;if(0===n.length)throw"Empty event selector: "+t;return n}function sy(t){return"["===t[0]?ly(t):fy(t)}function ly(t){var n,e,r=1,i=t.length,a=1;if(a=oy(t,a,_N,yN),a===i)throw"Empty between selector: "+t;if(n=uy(t.substring(r,a)),2!==n.length)throw"Between selector must have two elements: "+t;if(t=t.slice(a+1).trim(),t[0]!==kN)throw"Expected '>' after between selector: "+t;return n=n.map(sy),e=sy(t.slice(1).trim()),e.between?{between:n,stream:e}:(e.between=n,e)}function fy(t){var n,e,r={source:"view"},i=[],a=[0,0],o=0,u=0,s=t.length,l=0;if(t[s-1]===bN){if(l=t.lastIndexOf(xN),!(l>=0))throw"Unmatched right brace: "+t;try{a=cy(t.substring(l+1,s-1))}catch(f){throw"Invalid throttle specification: "+t}t=t.slice(0,l).trim(),s=t.length,l=0}if(!s)throw t;if("@"===t[0]&&(o=++l),n=oy(t,l,wN),s>n&&(i.push(t.substring(u,n).trim()),u=l=++n),l=oy(t,l,yN),l===s)i.push(t.substring(u,s).trim());else if(i.push(t.substring(u,l).trim()),e=[],u=++l,u===s)throw"Unmatched left bracket: "+t;for(;s>l;){if(l=oy(t,l,_N),l===s)throw"Unmatched left bracket: "+t;if(e.push(t.substring(u,l).trim()),s-1>l&&t[++l]!==yN)throw"Expected left bracket: "+t;u=++l}if(!(s=i.length)||EN.test(i[s-1]))throw"Invalid event selector: "+t;return s>1?(r.type=i[1],o?r.markname=i[0].slice(1):iy(i[0])?r.marktype=i[0]:r.source=i[0]):r.type=i[0],"!"===r.type.slice(-1)&&(r.consume=!0,r.type=r.type.slice(0,-1)),null!=e&&(r.filter=e),a[0]&&(r.throttle=a[0]),a[1]&&(r.debounce=a[1]),r}function cy(t){var n=t.split(MN);if(!t.length||n.length>2)throw t;return n.map(function(n){var e=+n;if(e!==e)throw t;return e})}function hy(t,n){return t.signal?n.getSignal(t.signal).id:dy(t,n)}function dy(t,n){var e=t.merge?py:t.stream?gy:t.type?my:F("Invalid stream specification: "+JSON.stringify(t));return e(t,n)}function py(t,n){var e=t.merge.map(function(t){return dy(t,n)}),r=vy({merge:e},t,n);return n.addStream(r).id}function gy(t,n){var e=dy(t.stream,n),r=vy({stream:e},t,n);return n.addStream(r).id}function my(t,n){var e=n.event(t.source||SN,t.type),r=vy({stream:e},t,n);return 1===Object.keys(r).length?e:n.addStream(r).id}function vy(t,n,e){var r,i;return(r=n.between)&&(2!==r.length&&F("Stream between parameter must have 2 entries."),t.between=[dy(r[0],e),dy(r[1],e)]),i=n.marktype||n.markname,(n.filter||i)&&(r=n.filter?P(n.filter):[],i&&r.push(yy(n.marktype,n.markname)),t.filter=ry("("+r.join(")&&(")+")").$expr),null!=(r=n.throttle)&&(t.throttle=+r),null!=(r=n.debounce)&&(t.debounce=+r),n.consume&&(t.consume=!0),t}function yy(t,n){var e="event.item";return e+(t&&"*"!==t?"&&"+e+".mark.marktype==='"+t+"'":"")+(n?"&&"+e+".mark.name==='"+n+"'":"")}function _y(t,n,e){var r,i=t.events,a=t.update,o=t.encode,u=[],s="";i||F("Signal update missing events specification."),N(i)&&(i=ay(i)),i=P(i).filter(function(t){return t.signal?(u.push(t),0):1}),i.length&&u.push(i.length>1?{merge:i}:i[0]),null!=o&&(a&&F("Signal encode and update are mutually exclusive."),a="encode(item(),"+z(o)+")"),s=N(a)?ry(a,n,CN):null!=a.expr?ry(a.expr,n,CN):null!=a.value?a.value:null!=a.signal?{$expr:"_.value",$params:{value:n.signalRef(a.signal)}}:F("Invalid signal update specification."),r={target:e,update:s},t.force&&(r.options={force:!0}),u.forEach(function(t){t={source:hy(t,n)},n.addUpdate(j(t,r))})}function xy(t,n){var e=n.getSignal(t.name);if(t.update){var r=ry(t.update,n);e.update=r.$expr,e.params=r.$params}t.on&&t.on.forEach(function(t){_y(t,n,e.id)})}function by(t,n){var e={};for(var r in t)"name"!==r&&(e[r]=wy(t[r],n));n.addProjection(t.name,e)}function wy(t,n){return yx(t)?t.map(function(t){return wy(t,n)}):T(t)?t.signal?n.signalRef(t.signal):F("Unsupported parameter object: "+JSON.stringify(t)):t}function My(t,n){var e="";return AN[n]?e:(t.x2&&(t.x?(e+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;",e+="o.width=o.x2-o.x;"):e+=t.width?"o.x=o.x2-o.width;":"o.x=o.x2;"),t.xc&&(e+=t.width?"o.x=o.xc-o.width/2;":"o.x=o.xc;"),t.y2&&(t.y?(e+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;",e+="o.height=o.y2-o.y;"):e+=t.height?"o.y=o.y2-o.height;":"o.y=o.y2;"),t.yc&&(e+=t.height?"o.y=o.yc-o.height/2;":"o.y=o.yc;"),e)}function ky(t,n,e,r){function i(t,i,a,o){var u=Ry(null,i,n,e,r),s=Ry(null,a,n,e,r),l=Ry(null,o,n,e,r);return"this."+t+"("+[u,s,l].join(",")+").toString()"}return t.c?i("hcl",t.h,t.c,t.l):t.h||t.s?i("hsl",t.h,t.s,t.l):t.l||t.a?i("lab",t.l,t.a,t.b):t.r||t.g||t.b?i("rgb",t.r,t.g,t.b):null}function Ey(t,n,e){var r=oN+t;return e.hasOwnProperty(r)||(e[r]=n.signalRef(t)),"_["+z(r)+"]"}function Sy(t,n,e,r){return Cy(T(t)?t:{datum:t},n,e,r)}function Cy(t,n,e,r){var i,a,o;if(t.signal)i="datum",o=Ey(t.signal,n,e);else if(t.group||t.parent){for(a=Math.max(1,t.level||1),i="item";a-- >0;)i+=".mark.group";t.parent?(o=t.parent,i+=".datum"):o=t.group}else t.datum?(i="datum",o=t.datum):F("Invalid field reference: "+JSON.stringify(t));return t.signal||(N(o)?(r[o]=1,o=C(o).map(z).join("][")):o=Cy(o,n,e,r)),i+"["+o+"]"}function Ay(t,n,e,r,i){var a,o,u,s=Ny(t.scale,e,r,i);return null!=t.range?(a=+t.range,o=s+".range()",n=0===a?o+"[0]":"($="+o+","+(1===a?"$[$.length-1]":"$[0]+"+a+"*($[$.length-1]-$[0])")+")"):(n=null!=n?s+"("+n+")":null,t.band&&(u=Ty(t.scale,e))&&(o=s+".bandwidth",a=+t.band,a=o+"()"+(1===a?"":"*"+a),0>u&&(a="("+o+"?"+a+":0)"),n=(n?n+"+":"")+a,t.extra&&(n="(datum.extra?"+s+"(datum.extra.value):"+n+")")),null==n&&(n="0")),n}function Ty(t,n){if(!N(t))return-1;var e=n.scaleType(t);return"band"===e||"point"===e?1:0}function Ny(t,n,e,r){var i;if(N(t))i=uN+t,e.hasOwnProperty(i)||(e[i]=n.scaleRef(t)),i=z(i);else{for(i in n.scales)e[uN+i]=n.scaleRef(i);i=z(uN)+"+"+Sy(t,n,e,r)}return"_["+i+"]"}function zy(t,n,e,r){return"this.gradient("+Ny(t.gradient,n,e,r)+","+z(t.start)+","+z(t.stop)+","+z(t.count)+")"}function Dy(t,n,e,r){return T(t)?"("+Ry(null,t,n,e,r)+")":t}function Oy(t,n,e,r){var i=ry(t,n);return i.$fields.forEach(function(t){r[t]=1}),j(e,i.$params),i.$expr}function Ry(t,n,e,r,i){if(null!=n.gradient)return zy(n,e,r,i);var a=null!=n.color?ky(n.color,e,r,i):null!=n.field?Sy(n.field,e,r,i):null!=n.signal?Ey(n.signal,e,r):null!=n.expr?Oy(n.expr,e,r,i):null!=n.value?z(n.value):null;return null!=n.scale&&(a=Ay(n,a,e,r,i)),null!=n.exponent&&(a="Math.pow("+a+","+Dy(n.exponent,e,r,i)+")"),null!=n.mult&&(a+="*"+Dy(n.mult,e,r,i)),null!=n.offset&&(a+="+"+Dy(n.offset,e,r,i)),n.round&&(a="Math.round("+a+")"),a}function Py(t,n,e){return t+"["+z(n)+"]="+e+";"}function qy(t,n,e,r,i){var a="";return n.forEach(function(n){var o=Ry(t,n,e,r,i);a+=n.test?Oy(n.test,e,r,i)+"?"+o+":":o}),Py("o",t,a)}function Ly(t,n,e,r){var i,a,o,u={},s="var o=item,datum=o.datum,$;";for(i in t)a=t[i],yx(a)?s+=qy(i,a,r,e,u):(o=Ry(i,a,r,e,u),s+=Py("o",i,o));return s+=My(t,n),s+="return 1;",{$expr:s,$fields:Object.keys(u),$output:Object.keys(t)}}function Uy(t){return T(t)?t:{value:t}}function Fy(t,n){for(var e in n)"interactive"!==e&&(t[e]=j(t[e]||{},n[e]));return t}function jy(t,n,e,r,i){var a,o;i=i||{},i.encoders={$encode:a={}},t=Iy(t,n,e,r.config);for(o in t)a[o]=Ly(t[o],n,i,r);return i}function Iy(t,n,e,r){var i,a,o;if(r=r&&(e===NN?r.group:e===TN?r.mark&&r.mark[n]:null)){i={};for(a in r)o=$y(a,t)||("fill"===a||"stroke"===a)&&($y("fill",t)||$y("stroke",t)),o||(i[a]={value:r[a]});t=j({},t),t.enter=j(i,t.enter)}return t}function $y(t,n){return n.enter&&n.enter[t]||n.update&&n.update[t]}function Wy(t,n,e,r,i,a){return{type:t,role:n,key:e,from:r,interactive:!(!a||!a.interactive),encode:Fy(i,a)}}function By(t,n,e){var r={value:0},i={};return i.enter={opacity:r,x:r,y:r,width:{value:n.gradientWidth},height:{value:n.gradientHeight},stroke:{value:n.gradientStrokeColor},strokeWidth:{value:n.gradientStrokeWidth}},i.exit={opacity:r},i.update={x:r,y:r,width:{value:n.gradientWidth},height:{value:n.gradientHeight},fill:{gradient:t},opacity:{value:1}},Wy(dN,jN,void 0,void 0,i,e)}function Hy(t,n,e,r){var i,a,o={value:0},u={};return u.enter=i={opacity:o,text:{field:JN},fill:{value:n.labelColor},font:{value:n.labelFont},fontSize:{value:n.labelFontSize},baseline:{value:n.gradientLabelBaseline}},u.exit={opacity:o},u.update=a={opacity:{value:1}},i.x=a.x={field:VN,mult:n.gradientWidth},i.y=a.y={value:n.gradientHeight,
offset:n.gradientLabelOffset},i.align=a.align={expr:tz},Wy(mN,IN,JN,r,u,e)}function Yy(t,n,e,r){var i,a,o={value:0},u={};return u.enter=i={opacity:o,fill:{value:n.labelColor},text:{field:JN},font:{value:n.labelFont},fontSize:{value:n.labelFontSize},align:{value:n.labelAlign},baseline:{value:n.labelBaseline}},u.exit={opacity:o},u.update=a={opacity:{value:1}},i.x=a.x={field:ZN,offset:n.labelOffset},i.y=a.y={field:ZN,mult:.5,offset:{field:QN,offset:{field:{group:"entryPadding"},mult:{field:GN}}}},Wy(mN,IN,JN,r,u,e)}function Xy(t,n,e,r){var i,a,o={value:0},u={};return u.enter=i={opacity:o,shape:{value:n.symbolType},size:{value:n.symbolSize},strokeWidth:{value:n.symbolStrokeWidth}},t.fill||(i.stroke={value:n.symbolColor}),u.exit={opacity:o},u.update=a={opacity:{value:1}},i.x=a.x={field:ZN,mult:.5},i.y=a.y={field:ZN,mult:.5,offset:{field:QN,offset:{field:{group:"entryPadding"},mult:{field:GN}}}},["shape","size","fill","stroke","opacity"].forEach(function(n){t[n]&&(a[n]=i[n]={scale:t[n],field:KN})}),Wy(gN,$N,JN,r,u,e)}function Gy(t,n,e,r){var i={value:0},a={};return a.enter={x:{field:{group:"padding"}},y:{field:{group:"padding"}},opacity:i,fill:{value:n.titleColor},font:{value:n.titleFont},fontSize:{value:n.titleFontSize},fontWeight:{value:n.titleFontWeight},align:{value:n.titleAlign},baseline:{value:n.titleBaseline}},a.exit={opacity:i},a.update={opacity:{value:1},text:{field:"title"}},Wy(mN,WN,null,r,a,e)}function Jy(t,n,e,r,i){return{type:hN,role:t,from:n,interactive:e,encode:r,marks:i}}function Vy(t){return t.role||(t.type===hN&&(t.legends||t.axes)?zN:TN)}function Zy(t){return{clip:t.clip||!1,interactive:t.interactive===!1?!1:!0,marktype:t.type,name:t.name||void 0,role:Vy(t),zindex:+t.zindex||void 0}}function Qy(t){return t}function Ky(t,n,e,r){this.id=-1,this.type=t,this.value=n,this.params=e,r&&(this.parent=r)}function t_(t,n,e,r){return new Ky(t,n,e,r)}function n_(t,n){return t_("Operator",t,n)}function e_(t){return{$ref:t.id}}function r_(t,n){return n?{$field:t,$name:n}:{$field:t}}function i_(t,n){return{$compare:t,$order:n}}function a_(t){return{$key:t}}function o_(t){return T(t)?(t.order===rz?"-":"+")+u_(t.op,t.field):""}function u_(t,n){return(t&&t.signal?"$"+t.signal:t||"")+(t&&n?"_":"")+(n&&n.signal?"$"+n.signal:n||"")}function s_(t){return t&&t.signal}function l_(t){return function(n,e,r){return t_(t,e,n||void 0,r)}}function f_(t,n){var e=Ge(t.type);e||F("Unrecognized transform type: "+t.type);var r=t_(e.type,null,c_(e,t,n));return t.signal&&n.addSignal(t.signal,r),r.metadata=e.metadata||{},r}function c_(t,n,e){var r,i,a,o={};for(i=0,a=t.params.length;a>i;++i)r=t.params[i],o[r.name]=h_(r,n,e);return o}function h_(t,n,e){var r,i=t.type;return"index"===i?p_(t,n,e):"param"===i?g_(t,n,e):"projection"===i?e.projectionRef(n[t.name]):(r=n[t.name],void 0===r?void(t.required&&F("Missing required parameter: "+t.name)):t.array&&!s_(r)?r.map(function(n){return d_(t,n,e)}):d_(t,r,e))}function d_(t,n,e){var r=t.type;if(s_(n))return x_(r)?F("Expression references can not be signals."):b_(r)?e.fieldRef(n):w_(r)?e.compareRef(n):e.signalRef(n.signal);var i=t.expr||b_(r);return i&&v_(n)?ry(n.expr,e):i&&y_(n)?r_(n.field):x_(r)?ry(n,e):__(r)?e_(e.getData(n).values):b_(r)?r_(n):w_(r)?i_(P(n.field),P(n.order)):n}function p_(t,n,e){return N(n.from)||F('Lookup "from" parameter must be a string literal.'),e.getData(n.from).lookupRef(e,n.key)}function g_(t,n,e){var r=n[t.name];return t.array?(yx(r)||F("Expected an array of sub-parameters. Instead: "+r),r.map(function(n){return m_(t,n,e)})):m_(t,r,e)}function m_(t,n,e){var r,i,a,o,u;for(o=0,u=t.params.length;u>o;++o){i=t.params[o];for(a in i.key)if(i.key[a]!==n[a]){i=null;break}if(i)break}return i||F("Unsupported parameter: "+JSON.stringify(n)),r=j(c_(i,n,e),i.key),e_(e.add(yz(r)))}function v_(t){return t&&t.expr}function y_(t){return t&&t.field}function __(t){return"data"===t}function x_(t){return"expr"===t}function b_(t){return"field"===t}function w_(t){return"compare"===t}function M_(t,n,e){var r,i,a,o;return t?(r=t.facet)&&(n||F("Only group marks can be faceted."),null!=r.field?o=e_(e.getData(r.data).output):(i=e.keyRef(r.groupby),t.data||(a=f_(j({type:"aggregate",groupby:P(r.groupby)},r.aggregate)),a.params.key=i,a.params.pulse=e_(e.getData(r.data).output),o=e_(e.add(a))))):o=e_(e.add(uz(null,[{}]))),o||(o=t.$ref?t:e_(t.mark?e.getData(Qy(t.mark)).output:e.getData(t.data).output)),{key:i,pulse:o}}function k_(t,n,e,r){this.scope=t,this.input=n,this.output=e,this.values=r,this.index={}}function E_(t){return N(t)?t:null}function S_(t,n,e){var r,i=u_(e.op,e.field);if(n.ops){for(var a=0,o=n.as.length;o>a;++a)if(n.as[a]===i)return}else n.ops=["count"],n.fields=[null],n.as=["count"];e.op&&(n.ops.push((r=e.op.signal)?t.signalRef(r):e.op),n.fields.push(t.fieldRef(e.field)),n.as.push(i))}function C_(t,n,e,r,i,a,o){var u,s,l=n[e]||(n[e]={}),f=o_(a),c=E_(i);if(null!=c&&(t=n.scope,c+=f?"|"+f:"",u=l[c]),!u){var h=a?{field:nz,pulse:n.countsRef(t,i,a)}:{field:t.fieldRef(i),pulse:e_(n.output)};f&&(h.sort=t.sortRef(a)),s=t.add(t_(r,void 0,h)),o&&(n.index[i]=s),u=e_(s),null!=c&&(l[c]=u)}return u}function A_(t,n,e){var r,i,a,o=t.from.facet,u=o.name,s=e_(n.getData(o.data).output);o.name||F("Facet must have a name: "+JSON.stringify(o)),o.data||F("Facet must reference a data set: "+JSON.stringify(o)),o.field?a=n.add(_z({field:n.fieldRef(o.field),pulse:s})):o.groupby?a=n.add(cz({key:n.keyRef(o.groupby),group:e.pulse,pulse:s})):F("Facet must specify groupby or field: "+JSON.stringify(o)),r=n.fork(),i=r.add(uz()),r.addData(u,new k_(r,i,i)),r.addSignal("parent",null),a.params.subflow={$subflow:ax(t,r).toRuntime()}}function T_(t,n,e){var r=n.add(_z({pulse:e.pulse})),i=n.fork();i.add(kz()),i.addSignal("parent",null),r.params.subflow={$subflow:ax(t,i).toRuntime()}}function N_(t,n,e){var r,i,a=t.remove,o=t.insert,u=t.toggle,s=t.modify,l=t.values,f=n.add(n_());r="if("+t.trigger+',modify("'+e+'",'+[o,a,u,s,l].map(function(t){return null==t?"null":t}).join(",")+"),0)",i=ry(r,n),f.update=i.$expr,f.params=i.$params}function z_(t,n){var e,r,i,a,o,u,s,l,f,c,h=Vy(t),d=t.type===hN,p=t.from&&t.from.facet,g=h===zN||h===NN;r=M_(t.from,d,n),e=n.add(lz(r)),e=i=n.add(uz({pulse:e_(e)})),e=n.add(gz({markdef:Zy(t),scenepath:{$itempath:n.markpath()},pulse:e_(e)})),l=e_(e),e=n.add(fz(jy(t.encode,t.type,h,n,{pulse:l}))),t.transform&&t.transform.forEach(function(t){var r=f_(t,n);(r.metadata.generates||r.metadata.changes)&&F("Mark transforms should not generate new data."),r.params.pulse=e_(e),n.add(e=r)}),e.params.parent=n.encode(),f=e_(e),(p||g)&&(e=n.add(Ez({legendMargin:n.config.legendMargin,mark:l,pulse:f})),n.operators.pop(),n.pushState(f,e_(e)),p?A_(t,n,r):T_(t,n,r),n.popState(),n.operators.push(e)),a=n.add(oz({mark:l,pulse:e_(e)})),c=e_(a),!d||p||g||(n.pushState(f,c),h===TN?T_(t,n,r):ax(t,n),n.popState()),o=n.add(wz({pulse:c})),u=n.add(kz({pulse:c},void 0,n.parent())),null!=t.name&&(s=Qy(t.name),n.addData(s,new k_(n,i,o,u)),t.on&&t.on.forEach(function(t){(t.insert||t.remove||t.toggle)&&F("Marks only support modify triggers."),N_(t,n,s)}))}function D_(t,n){var e,r,i,a,o,u,s,l,f=t.type||"symbol",c=n.config.legend,h=t.encode||{},d=!!t.interactive,p=t.size||t.shape||t.fill||t.stroke||t.opacity;return p||F("Missing valid scale for legend."),e={orient:O_(t.orient,c.orient),title:t.title},r=e_(n.add(uz(null,[e]))),u=Fy({update:{offset:Uy(O_(t.offset,c.offset)),padding:Uy(O_(t.padding,c.padding)),titlePadding:Uy(O_(t.titlePadding,c.titlePadding))}},h.legend),s={update:{x:{field:{group:"padding"}},y:{field:{group:"padding"}},entryPadding:Uy(O_(t.entryPadding,c.entryPadding))}},"gradient"===f?(i=e_(n.add(pz({type:"gradient",scale:n.scaleRef(p),count:n.property(t.count),values:n.property(t.values),formatSpecifier:n.property(t.format)}))),l=[By(p,c,h.gradient),Hy(t,c,h.labels,i)]):(i=e_(n.add(pz({size:R_(t,c,h.labels),scale:n.scaleRef(p),count:n.property(t.count),values:n.property(t.values),formatSpecifier:n.property(t.formatSpecifier)}))),l=[Xy(t,c,h.symbols,i),Yy(t,c,h.labels,i)]),l=[Jy(FN,r,d,s,l)],e.title&&(o=Gy(t,c,h.title,r),s.update.y.offset={field:{group:"titlePadding"},offset:o.encode.update.fontSize||o.encode.enter.fontSize},l.push(o)),a=Jy(UN,r,d,u,l),t.zindex&&(a.zindex=t.zindex),z_(a,n)}function O_(t,n){return null!=t?t:n}function R_(t,n,e){var r,i=+n.symbolSize;return r=e&&e.update&&e.update.fontSize,r||(r=e&&e.enter&&e.enter.fontSize),r&&(r=r.value),r||(r=+n.labelFontSize),t.size?{$expr:"Math.max(ceil(sqrt(_.scale(datum))),"+r+")"}:Math.max(Math.ceil(Math.sqrt(i)),r)}function P_(t){return Nz.hasOwnProperty(t)}function q_(t){return"quantile"===t}function L_(t,n){var e,r,i=t.type||"linear";Tz.hasOwnProperty(i)||F("Unrecognized scale type: "+i),e={type:i,domain:F_(t.domain,t,n)},null!=t.range&&(null!=t.bandSize&&F("Scale range and bandSize are mutually exclusive."),e.range=X_(t,n));for(r in t)e[r]||"name"===r||(e[r]=U_(t[r],n));n.addScale(t.name,e)}function U_(t,n){return T(t)?t.signal?n.signalRef(t.signal):F("Unsupported object: "+t):t}function F_(t,n,e){return t?t.signal?e.signalRef(t.signal):(yx(t)?j_:t.fields?$_:I_)(t,n,e):void 0}function j_(t,n,e){return t.map(function(t){return U_(t,e)})}function I_(t,n,e){var r=e.getData(t.data);return r||F("Can not find data set: "+t.data),P_(n.type)?r.valuesRef(e,t.field,B_(t.sort,!1)):q_(n.type)?r.domainRef(e,t.field):r.extentRef(e,t.field)}function $_(t,n,e){var r=t.data,i=t.fields.reduce(function(t,n){return t.push(N(n)?{data:r,field:n}:n),t},[]);return(P_(n.type)?W_:q_(n.type)?H_:Y_)(t,e,i)}function W_(t,n,e){var r,i,a,o;return r=e.map(function(t){var e=n.getData(t.data);return e||F("Can not find data set: "+t.data),e.countsRef(n,t.field)}),i=n.add(iz({groupby:nz,ops:["sum"],fields:[n.fieldRef("count")],as:["count"],pulse:r})),a=n.add(uz({pulse:e_(i)})),o=n.add(Sz({field:nz,sort:n.sortRef(B_(t.sort,!0)),pulse:e_(a)})),e_(o)}function B_(t,n){return t&&(t.field||t.op?t.field||"count"===t.op?n&&t.field?F("Multiple domain scales can not sort by field."):n&&t.op&&"count"!==t.op&&F("Multiple domain scales support op count only."):F("No field provided for sort aggregate op: "+t.op):T(t)?t.field="key":t={field:"key"}),t}function H_(t,n,e){var r=e.map(function(t){var e=n.getData(t.data);return e||F("Can not find data set: "+t.data),e.domainRef(n,t.field)});return e_(n.add(vz({values:r})))}function Y_(t,n,e){var r=e.map(function(t){var e=n.getData(t.data);return e||F("Can not find data set: "+t.data),e.extentRef(n,t.field)});return e_(n.add(mz({extents:r})))}function X_(t,n){var e=t.range,r=n.config.range;if(e.signal)return n.signalRef(e.signal);if(N(e))r&&r.hasOwnProperty(e)?e=r[e]:"width"===e?e=[0,{signal:"width"}]:"height"===e?e=P_(t.type)?[0,{signal:"height"}]:[{signal:"height"},0]:F("Unrecognized scale range value: "+e);else{if(P_(t.type)&&!yx(e))return F_(e,t,n);yx(e)||F("Unsupported range type: "+e)}return e.map(function(t){return U_(t,n)})}function G_(t,n){var e=[];t.transform&&t.transform.forEach(function(t){e.push(f_(t,n))}),t.on&&t.on.forEach(function(e){N_(e,n,t.name)}),n.addDataPipeline(t.name,J_(t,n,e))}function J_(t,n,e){var r,i,a,o,u,s=[],l=null,f=!1,c=!1;for(t.values?s.push(l=V_({$ingest:t.values,$format:t.format})):t.url?s.push(l=V_({$request:t.url,$format:t.format})):t.source&&(r=n.getData(t.source),l=r.output,s.push(null)),i=0,a=e.length;a>i;++i)o=e[i],u=o.metadata,l||u.source||s.push(l=V_()),s.push(o),u.generates&&(c=!0),u.modifies&&!c&&(f=!0),u.source?l=o:u.changes&&(l=null);return r&&(s[0]=bz({derive:f,pulse:e_(r.output)}),f&&s.splice(1,0,V_())),l||s.push(V_()),s.push(kz({})),s}function V_(t){var n=uz({},t);return n.metadata={source:!0},n}function Z_(t,n){var e=n.config,r=t.orient,i=r===BN||r===XN?e.axisX:e.axisY,a=e["axis"+r[0].toUpperCase()+r.slice(1)],o="band"===n.scaleType(t.scale)&&e.axisBand;return i||a||o?j({},e.axis,i,a,o):e.axis}function Q_(t,n,e,r){var i,a,o=t.orient,u={value:0},s={};return s.enter=i={opacity:u,stroke:{value:n.tickColor},strokeWidth:{value:n.tickWidth}},s.exit={opacity:u},s.update=a={opacity:{value:1}},o===BN||o===XN?(i.y=u,a.x=i.x=K_(t,0),a.x2=i.x2=K_(t,1)):(i.x=u,a.y=i.y=K_(t,0),a.y2=i.y2=K_(t,1)),Wy(pN,ON,null,r,s,e)}function K_(t,n){return{scale:t.scale,range:n}}function tx(t,n,e,r){var i,a,o,u,s=t.orient,l=s===HN||s===BN?1:-1,f=l*t.offset||0,c={value:0},h={};return h.enter=i={opacity:c,stroke:{value:n.gridColor},strokeWidth:{value:n.gridWidth},strokeDash:{value:n.gridDash}},h.exit=a={opacity:c},h.update=o={opacity:{value:n.gridOpacity}},u={scale:t.scale,field:KN,band:n.bandPosition,round:n.tickRound,extra:n.tickExtra},s===BN||s===XN?(i.y={value:f},o.y2=i.y2={signal:"height",mult:l,offset:f},o.x=i.x=a.x=u):(i.x={value:f},o.x2=i.x2={signal:"width",mult:l,offset:f},o.y=i.y=a.y=u),Wy(pN,RN,KN,r,h,e)}function nx(t,n,e,r){var i,a,o,u,s,l=t.orient,f=l===HN||l===BN?-1:1,c=null!=t.tickSize?t.tickSize:n.tickSize,h={value:0},d={};return d.enter=i={opacity:h,stroke:{value:n.tickColor},strokeWidth:{value:n.tickWidth}},d.exit=a={opacity:h},d.update=o={opacity:{value:1}},u=Uy(c),u.mult=f,s={scale:t.scale,field:KN,band:n.bandPosition,round:n.tickRound,extra:n.tickExtra},l===BN||l===XN?(o.y=i.y=h,o.y2=i.y2=u,o.x=i.x=a.x=s):(o.x=i.x=h,o.x2=i.x2=u,o.y=i.y=a.y=s),Wy(pN,qN,JN,r,d,e)}function ex(t,n,e,r){var i,a,o,u,s,l=t.orient,f=l===HN||l===BN?-1:1,c=null!=t.tickSize?t.tickSize:n.tickSize,h=null!=t.tickPadding?t.tickPadding:n.tickPadding,d={value:0},p={};return p.enter=i={opacity:d,fill:{value:n.tickLabelColor},font:{value:n.tickLabelFont},fontSize:{value:n.tickLabelFontSize},text:{field:JN}},p.exit=a={opacity:d},p.update=o={opacity:{value:1}},u=Uy(c),u.mult=f,u.offset=Uy(h),u.offset.mult=f,s={scale:t.scale,field:KN,band:.5},l===BN||l===XN?(o.y=i.y=u,o.x=i.x=a.x=s,o.align={value:"center"},o.baseline={value:l===BN?"bottom":"top"}):(o.x=i.x=u,o.y=i.y=a.y=s,o.align={value:l===YN?"left":"right"},o.baseline={value:"middle"}),Wy(mN,PN,JN,r,p,e)}function rx(t,n,e,r){var i,a,o=t.orient,u=o===HN||o===BN?-1:1,s=o===BN||o===XN,l={};return l.enter={opacity:{value:0},fill:{value:n.titleColor},font:{value:n.titleFont},fontSize:{value:n.titleFontSize},fontWeight:{value:n.titleFontWeight},align:{value:n.titleAlign}},l.exit={opacity:{value:0}},l.update=i={opacity:{value:1},text:{field:"title"}},a={scale:t.scale,range:.5},s?(i.x=a,i.angle={value:0},i.baseline={value:o===BN?"bottom":"top"}):(i.y=a,i.angle={value:90*u},i.baseline={value:"bottom"}),null!=n.titleAngle&&(i.angle={value:n.titleAngle}),null!=n.titleBaseline&&(i.baseline={value:n.titleBaseline}),null!=n.titleX?i.x={value:n.titleX}:s&&!$y(e,"x")&&(l.enter.auto={value:!0}),null!=n.titleY?i.y={value:n.titleY}:s||$y(e,"y")||(l.enter.auto={value:!0}),Wy(mN,LN,null,r,l,e)}function ix(t,n){var e,r,i,a,o,u,s=Z_(t,n),l=t.encode||{},f=!!t.interactive;return e={orient:t.orient,domain:null!=t.domain?!!t.domain:s.domainDefault,grid:null!=t.grid?!!t.grid:s.gridDefault,title:t.title},r=e_(n.add(uz({},[e]))),o=Fy({update:{range:{expr:'abs(span(range("'+t.scale+'")))'},offset:Uy(t.offset||0),position:Uy(t.position||0),titlePadding:Uy(t.titlePadding||s.titlePadding),minExtent:Uy(t.minExtent||s.minExtent),maxExtent:Uy(t.maxExtent||s.maxExtent)}},l.axis),i=e_(n.add(az({scale:n.scaleRef(t.scale),extra:s.tickExtra,count:n.property(t.count),values:n.property(t.values),formatSpecifier:n.property(t.format)}))),u=[nx(t,s,l.ticks,i),ex(t,s,l.labels,i)],e.grid&&u.unshift(tx(t,s,l.grid,i)),e.domain&&u.push(Q_(t,s,l.domain,r)),e.title&&u.push(rx(t,s,l.title,r)),a=Jy(DN,r,f,o,u),t.zindex&&(a.zindex=t.zindex),z_(a,n)}function ax(t,n,e){var r=P(t.signals);return e||r.forEach(function(t){$m(t,n)}),P(t.projections).forEach(function(t){by(t,n)}),P(t.data).forEach(function(t){G_(t,n)}),P(t.scales).forEach(function(t){L_(t,n)}),r.forEach(function(t){xy(t,n)}),P(t.axes).forEach(function(t){ix(t,n)}),P(t.marks).forEach(function(t){z_(t,n)}),P(t.legends).forEach(function(t){D_(t,n)}),n}function ox(t,n){var e,r,i,a,o;return n.background=t.background||n.config.background,o=e_(n.root=n.add(n_())),n.addSignal("width",t.width||-1),n.addSignal("height",t.height||-1),n.addSignal("padding",Im(t.padding)),P(t.signals).forEach(function(t){zz[t.name]||$m(t,n)}),r=n.add(uz()),i=Fy({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},t.encode),i=n.add(fz(jy(i,hN,NN,n,{pulse:e_(r)}))),a=n.add(Ez({legendMargin:n.config.legendMargin,autosize:t.autosize||n.config.autosize,mark:o,pulse:e_(i)})),n.pushState(e_(i),e_(a)),ax(t,n,!0),e=n.add(oz({mark:o,pulse:e_(a)})),e=n.add(wz({pulse:e_(e)})),e=n.add(kz({pulse:e_(e)})),n.addData("root",new k_(n,r,r,e)),n}function ux(t){this.config=t,this.bindings=[],this.field={},this.signals={},this.scales={},this.events={},this.data={},this.streams=[],this.updates=[],this.operators=[],this.background=null,this._id=0,this._subid=0,this._nextsub=[0],this._parent=[],this._encode=[],this._markpath=[]}function sx(t){this.config=t.config,this.field=Object.create(t.field),this.signals=Object.create(t.signals),this.scales=Object.create(t.scales),this.events=Object.create(t.events),this.data=Object.create(t.data),this.streams=[],this.updates=[],this.operators=[],this._id=0,this._subid=++t._nextsub[0],this._nextsub=t._nextsub,this._parent=t._parent.slice(),this._encode=t._encode.slice(),this._markpath=t._markpath}function lx(t){var n,e=fx();for(n in t)e[n]=T(e[n])?j(e[n],t[n]):e[n]=t[n];return e}function fx(){return{autosize:"pad",background:null,group:null,mark:{arc:{fill:"steelblue"},area:{fill:"steelblue"},image:null,line:{stroke:"steelblue"},path:{stroke:"steelblue"},rect:{fill:"steelblue"},rule:{stroke:"#000"},shape:{stroke:"steelblue"},symbol:{fill:"steelblue",size:64},text:{fill:"#000",font:"sans-serif",fontSize:11}},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domainDefault:!0,domainWidth:1,domainColor:"#000",gridDefault:!1,gridWidth:1,gridColor:"#ddd",gridDash:[],gridOpacity:1,tickPadding:2,tickRound:!0,tickSize:5,tickWidth:1,tickColor:"#000",tickLabelColor:"#000",tickLabelFont:"sans-serif",tickLabelFontSize:10,titleAlign:"center",titlePadding:2,titleColor:"#000",titleFont:"sans-serif",titleFontSize:11,titleFontWeight:"bold"},legend:{orient:"right",offset:18,padding:0,margin:8,entryPadding:5,titlePadding:5,gradientWidth:100,gradientHeight:20,gradientStrokeColor:"#ddd",gradientStrokeWidth:0,gradientLabelBaseline:"top",gradientLabelOffset:2,labelColor:"#000",labelFontSize:10,labelFont:"sans-serif",labelAlign:"left",labelBaseline:"middle",labelOffset:8,symbolType:"circle",symbolSize:100,symbolColor:"#888",symbolStrokeWidth:1.5,titleColor:"#000",titleFont:"sans-serif",titleFontSize:11,titleFontWeight:"bold",titleAlign:"left",titleBaseline:"top"},range:{category:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],symbol:["circle","cross","diamond","square","triangle-up","triangle-down","triangle-right","triangle-left"]}}}function cx(t,n){return ox(t,new ux(lx(n||t.config))).toRuntime()}var hx=a(i),dx=hx.right,px=hx.left,gx=Math.sqrt(50),mx=Math.sqrt(10),vx=Math.sqrt(2),yx=Array.isArray,_x=[],xx=D("id"),bx=k(function(t){return t},_x,"identity"),wx=k(function(){return 0},_x,"zero"),Mx=k(function(){return 1},_x,"one"),kx=k(function(){return!0},_x,"true"),Ex=k(function(){return!1},_x,"false"),Sx=0,Cx=1,Ax=2,Tx=3,Nx="$";Q.prototype=K.prototype={constructor:Q,has:function(t){return Nx+t in this},get:function(t){return this[Nx+t]},set:function(t,n){return this[Nx+t]=n,this},remove:function(t){var n=Nx+t;return n in this&&delete this[n]},clear:function(){for(var t in this)t[0]===Nx&&delete this[t]},keys:function(){var t=[];for(var n in this)n[0]===Nx&&t.push(n.slice(1));return t},values:function(){var t=[];for(var n in this)n[0]===Nx&&t.push(this[n]);return t},entries:function(){var t=[];for(var n in this)n[0]===Nx&&t.push({key:n.slice(1),value:this[n]});return t},size:function(){var t=0;for(var n in this)n[0]===Nx&&++t;return t},empty:function(){for(var t in this)if(t[0]===Nx)return!1;return!0},each:function(t){for(var n in this)n[0]===Nx&&t(this[n],n.slice(1),this)}};var zx=(K.prototype,{value:function(){}});ot.prototype=at.prototype={constructor:ot,on:function(t,n){var e,r=this._,i=ut(t+"",r),a=-1,o=i.length;{if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++a<o;)if(e=(t=i[a]).type)r[e]=lt(r[e],t.name,n);else if(null==n)for(e in r)r[e]=lt(r[e],t.name,null);return this}for(;++a<o;)if((e=(t=i[a]).type)&&(e=st(r[e],t.name)))return e}},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new ot(t)},call:function(t,n){if((e=arguments.length-2)>0)for(var e,r,i=new Array(e),a=0;e>a;++a)i[a]=arguments[a+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(r=this._[t],a=0,e=r.length;e>a;++a)r[a].value.apply(n,i)},apply:function(t,n,e){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,a=r.length;a>i;++i)r[i].value.apply(n,e)}};mt(","),mt(" ");vt.loader=yt,vt.sanitize=_t,vt.http=xt,vt.file=bt;var Dx=/^([A-Za-z]+:)?\/\//,Ox="file://",Rx=["mimeType","responseType","user","password"],Px={"boolean":Ct,integer:St,number:St,date:At,string:Tt},qx=[zt,Rt,Ot,Dt],Lx=["boolean","integer","number","date"],Ux={dsv:qt,csv:Pt(","),tsv:Pt(" "),json:Ut,topojson:Gt},Fx=new Date,jx=new Date,Ix=Vt(function(){},function(t,n){t.setTime(+t+n)},function(t,n){return n-t});Ix.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?Vt(function(n){n.setTime(Math.floor(n/t)*t)},function(n,e){n.setTime(+n+e*t)},function(n,e){return(e-n)/t}):Ix:null};var $x=1e3,Wx=6e4,Bx=36e5,Hx=864e5,Yx=6048e5,Xx=Vt(function(t){t.setTime(Math.floor(t/$x)*$x)},function(t,n){t.setTime(+t+n*$x)},function(t,n){return(n-t)/$x},function(t){return t.getUTCSeconds()}),Gx=Vt(function(t){t.setTime(Math.floor(t/Wx)*Wx)},function(t,n){t.setTime(+t+n*Wx)},function(t,n){return(n-t)/Wx},function(t){return t.getMinutes()}),Jx=Vt(function(t){var n=t.getTimezoneOffset()*Wx%Bx;0>n&&(n+=Bx),t.setTime(Math.floor((+t-n)/Bx)*Bx+n)},function(t,n){t.setTime(+t+n*Bx)},function(t,n){return(n-t)/Bx},function(t){return t.getHours()}),Vx=Vt(function(t){t.setHours(0,0,0,0)},function(t,n){t.setDate(t.getDate()+n)},function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Wx)/Hx},function(t){return t.getDate()-1}),Zx=Zt(0),Qx=Zt(1),Kx=Vt(function(t){t.setDate(1),t.setHours(0,0,0,0)},function(t,n){t.setMonth(t.getMonth()+n)},function(t,n){return n.getMonth()-t.getMonth()+12*(n.getFullYear()-t.getFullYear())},function(t){return t.getMonth()}),tb=Vt(function(t){t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,n){t.setFullYear(t.getFullYear()+n)},function(t,n){return n.getFullYear()-t.getFullYear()},function(t){return t.getFullYear()});tb.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Vt(function(n){n.setFullYear(Math.floor(n.getFullYear()/t)*t),n.setMonth(0,1),n.setHours(0,0,0,0)},function(n,e){n.setFullYear(n.getFullYear()+e*t)}):null};var nb=Vt(function(t){t.setUTCSeconds(0,0)},function(t,n){t.setTime(+t+n*Wx)},function(t,n){return(n-t)/Wx},function(t){return t.getUTCMinutes()}),eb=Vt(function(t){t.setUTCMinutes(0,0,0)},function(t,n){t.setTime(+t+n*Bx)},function(t,n){return(n-t)/Bx},function(t){return t.getUTCHours()}),rb=Vt(function(t){t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCDate(t.getUTCDate()+n)},function(t,n){return(n-t)/Hx},function(t){return t.getUTCDate()-1}),ib=Qt(0),ab=Qt(1),ob=Vt(function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCMonth(t.getUTCMonth()+n)},function(t,n){return n.getUTCMonth()-t.getUTCMonth()+12*(n.getUTCFullYear()-t.getUTCFullYear())},function(t){return t.getUTCMonth()}),ub=Vt(function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n)},function(t,n){return n.getUTCFullYear()-t.getUTCFullYear()},function(t){return t.getUTCFullYear()});ub.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Vt(function(n){n.setUTCFullYear(Math.floor(n.getUTCFullYear()/t)*t),n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)},function(n,e){n.setUTCFullYear(n.getUTCFullYear()+e*t)}):null};var sb,lb,fb,cb,hb,db={"-":"",_:" ",0:"0"},pb=/^\s*\d+/,gb=/^%/,mb=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;Zn({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var vb="%Y-%m-%dT%H:%M:%S.%LZ",yb=(Date.prototype.toISOString?Qn:cb(vb),+new Date("2000-01-01T00:00:00.000Z")?Kn:hb(vb),1),_b="_:mod:_",xb=ce.prototype;xb.set=function(t,n,e,r){var i=this,a=i[t],o=i[_b];return null!=n&&n>=0?(a[n]!==e||r)&&(a[n]=e,o[he(t,n)]=1,o[t]=1):(a!==e||r)&&(i[t]=e,o[t]=1,yx(e)&&e.forEach(function(n,e){o[he(t,e)]=1})),i},xb.modified=function(t,n){var e,r=this[_b];if(!arguments.length){for(e in r)if(r[e])return!0;return!1}if(yx(t)){for(e=0;e<t.length;++e)if(r[t[e]])return!0;return!1}return!!r[he(t,n)]},xb.clear=function(){return this[_b]={},this};var bb=0,wb="pulse",Mb=new ce,kb=1,Eb=2,Sb=de.prototype;Sb.targets=function(){return this._targets||(this._targets=ee(xx))},Sb.set=function(t){return this.value!==t?(this.value=t,1):0},Sb.skip=pe(kb),Sb.modified=pe(Eb),Sb.parameters=function(t,n){function e(t,e,r){r instanceof de?(r!==u&&(n&&r.targets().add(u),f.push(r)),l.push({op:r,name:t,index:e})):s.set(t,e,r)}n=n!==!1;var r,i,a,o,u=this,s=u._argval=u._argval||new ce,l=u._argops=u._argops||[],f=[];for(r in t)if(i=t[r],r===wb)P(i).forEach(function(t){t instanceof de?t!==u&&(t.targets().add(u),f.push(t)):F("Pulse parameters must be operator instances.")}),u.source=i;else if(yx(i))for(s.set(r,-1,Array(a=i.length)),o=0;a>o;++o)e(r,o,i[o]);else e(r,-1,i);return this.marshall().clear(),f},Sb.marshall=function(t){var n,e,r,i,a,o=this._argval||Mb,u=this._argops;if(u&&(r=u.length))for(e=0;r>e;++e)n=u[e],i=n.op,a=i.modified()&&i.stamp===t,o.set(n.name,n.index,i.value,a);return o},Sb.evaluate=function(t){if(this._update){var n=this.marshall(t.stamp),e=this._update(n,t);if(n.clear(),e!==this.value)this.value=e;else if(!this.modified())return t.StopPropagation}},Sb.run=function(t){if(t.stamp<=this.stamp)return t.StopPropagation;var n=this.skip()?(this.skip(!1),0):this.evaluate(t);return this.stamp=t.stamp,this.pulse=n||t};var Cb=0,Ab=ve.prototype;Ab._filter=kx,Ab._apply=bx,Ab.targets=function(){return this._targets||(this._targets=ee(xx))},Ab.consume=function(t){return arguments.length?(this._consume=!!t,this):!!this._consume},Ab.receive=function(t){if(this._filter(t)){for(var n=this.value=this._apply(t),e=this._targets,r=e?e.length:0,i=0;r>i;++i)e[i].receive(n);this._consume&&(t.preventDefault(),t.stopPropagation())}},Ab.filter=function(t){var n=ye(t);return this.targets().add(n),n},Ab.apply=function(t){var n=ye(null,t);return this.targets().add(n),n},Ab.merge=function(){var t=ye();this.targets().add(t);for(var n=0,e=arguments.length;e>n;++n)arguments[n].targets().add(t);return t},Ab.throttle=function(t){var n=-1;return this.filter(function(){var e=Date.now();return e-n>t?(n=e,1):0})},Ab.debounce=function(t){function n(){var t=r.dataflow;e.receive(r),r=null,i=null,t&&t.run&&t.run()}var e=ye(),r=null,i=null;return this.targets().add(ye(null,null,function(e){r=e,i&&clearTimeout(i),i=setTimeout(n,t)})),e},Ab.between=function(t,n){var e=!1;return t.targets().add(ye(null,null,function(){e=!0})),n.targets().add(ye(null,null,function(){e=!1})),this.filter(function(){return e})};var Tb={skip:!0},Nb={},zb=1,Db=2,Ob=4,Rb=zb|Db,Pb=zb|Ob,qb=zb|Db|Ob,Lb=8,Ub=16,Fb=32,jb=64,Ib=Ee.prototype;Ib.StopPropagation=Nb,Ib.ADD=zb,Ib.REM=Db,Ib.MOD=Ob,Ib.ADD_REM=Rb,Ib.ADD_MOD=Pb,Ib.ALL=qb,Ib.REFLOW=Lb,Ib.SOURCE=Ub,Ib.NO_SOURCE=Fb,Ib.NO_FIELDS=jb,Ib.fork=function(t){return new Ee(this.dataflow).init(this,t)},Ib.addAll=function(){var t=this;return this.source&&this.source.length!==this.add.length?(t=new Ee(this.dataflow).init(this),t.add=t.source,t):t},Ib.init=function(t,n){var e=this;return e.stamp=t.stamp,e.encode=t.encode,!t.fields||n&jb||(e.fields=t.fields),e.add=n&zb?(e.addF=t.addF,t.add):(e.addF=null,[]),e.rem=n&Db?(e.remF=t.remF,t.rem):(e.remF=null,[]),e.mod=n&Ob?(e.modF=t.modF,t.mod):(e.modF=null,[]),e.source=n&Fb?(e.srcF=null,null):(e.srcF=t.srcF,t.source),e},Ib.runAfter=function(t){this.dataflow.runAfter(t)},Ib.changed=function(t){var n=t||qb;return n&zb&&this.add.length||n&Db&&this.rem.length||n&Ob&&this.mod.length},Ib.reflow=function(){var t=this.add.length,n=this.source&&this.source.length;return n&&n!==t&&(this.mod=this.source,t&&this.filter(Ob,Ce(this,zb))),this},Ib.modifies=function(t){var n=P(t),e=this.fields||(this.fields={});return n.forEach(function(t){e[t]=!0}),this},Ib.modified=function(t){var n=this.fields;return this.mod.length&&n?arguments.length?yx(t)?t.some(function(t){return n[t]}):n[t]:!!n:!1},Ib.filter=function(t,n){var e=this;return t&zb&&(e.addF=Se(e.addF,n)),t&Db&&(e.remF=Se(e.remF,n)),t&Ob&&(e.modF=Se(e.modF,n)),t&Ub&&(e.srcF=Se(e.srcF,n)),e},Ib.materialize=function(t){t=t||qb;var n=this;return t&zb&&n.addF&&(n.add=n.add.filter(n.addF),n.addF=null),t&Db&&n.remF&&(n.rem=n.rem.filter(n.remF),n.remF=null),t&Ob&&n.modF&&(n.mod=n.mod.filter(n.modF),n.modF=null),t&Ub&&n.srcF&&(n.source=n.source.filter(n.srcF),n.srcF=null),n},Ib.visit=function(t,n){var e,r,i=n;return t&Ub?(Z(this.source,this.srcF,i),this):(t&zb&&Z(this.add,this.addF,i),t&Db&&Z(this.rem,this.remF,i),t&Ob&&Z(this.mod,this.modF,i),t&Lb&&(e=this.source)&&(r=this.add.length+this.mod.length,r===e||(r?Z(e,Ce(this,Pb),i):Z(e,this.srcF,i))),this)};var $b={skip:!1,force:!1},Wb=$(Pe,Ee);Wb.fork=function(){return arguments.length&&arguments[0]&Ee.prototype.ALL&&F("MultiPulse fork does not support tuple change sets."),new Ee(this.dataflow).init(this,0)},Wb.changed=function(t){return this.changes&t},Wb.modified=function(t){var n=this,e=n.fields;return e&&n.changes&n.MOD?yx(t)?t.some(function(t){return e[t]}):e[t]:0},Wb.filter=function(){F("MultiPulse does not support filtering.")},Wb.materialize=function(){F("MultiPulse does not support materialization.")},Wb.visit=function(t,n){var e,r,i=this.pulses;for(e=0,r=i.length;r>e;++e)i[e].stamp===this.stamp&&i[e].visit(t,n);return this};var Bb=Ie.prototype;Bb.size=function(){return this.nodes.length},Bb.clear=function(){return this.nodes=[],this},Bb.peek=function(){return this.nodes[0]},Bb.push=function(t){var n=this.nodes;return n.push(t),$e(n,0,n.length-1,this.cmp)},Bb.pop=function(){var t,n=this.nodes,e=n.pop();return n.length?(t=n[0],n[0]=e,We(n,0,this.cmp)):t=e,t},Bb.replace=function(t){var n=this.nodes,e=n[0];return n[0]=t,We(n,0,this.cmp),e},Bb.pushpop=function(t){var n=this.nodes,e=n[0];return n.length&&this.cmp(e,t)<0&&(n[0]=t,t=e,We(n,0,this.cmp)),t};var Hb=Be.prototype;Hb.stamp=function(){return this._clock},Hb.add=ge,Hb.connect=me,Hb.rank=Me,Hb.rerank=ke,Hb.pulse=Ne,Hb.touch=Ae,Hb.update=Te,Hb.changeset=fe,Hb.ingest=ze,Hb.request=Re,Hb.loadOptions=De,Hb.events=_e,Hb.on=xe,Hb.run=qe,Hb.runAsync=Le,Hb.runAfter=Ue,Hb._enqueue=Fe,Hb._getPulse=je,Hb.warn=He("warn"),Hb.info=He("info"),Hb.debug=He("debug"),Hb.logLevel=He("level"),Hb.error=function(t){throw t};var Yb=$(Ye,de);Yb.evaluate=function(t){var n=this.marshall(t.stamp),e=this.transform(n,t);return n.clear(),e},Yb.transform=function(){};var Xb={},Gb={},Jb=Ve.prototype;Jb.add=function(t){this._add.push(t)},Jb.rem=function(t){this._rem.push(t)},Jb.values=function(){if(this._get=null,0===this._rem.length)return this._add;var t,n,e,r=this._add,i=this._rem,a=this._key,o=r.length,u=i.length,s=Array(o-u),l={};for(t=0;u>t;++t)l[i[t][a]]=1;for(t=0,n=0;o>t;++t)l[(e=r[t])[a]]?l[e[a]]=0:s[n++]=e;return this._rem=[],this._add=s},Jb.extent=function(t){if(this._get!==t||!this._ext){var n=this.values(),e=I(n,t);this._ext=[n[e[0]],n[e[1]]],this._get=t}return this._ext},Jb.argmin=function(t){return this.extent(t)[0]||{}},Jb.argmax=function(t){
return this.extent(t)[1]||{}},Jb.min=function(t){var n=this.extent(t)[0];return null!=n?t(n):+(1/0)},Jb.max=function(t){var n=this.extent(t)[1];return null!=n?t(n):-(1/0)},Jb.quartile=function(t){return this._get===t&&this._q||(this._q=M(this.values(),t),this._get=t),this._q},Jb.q1=function(t){return this.quartile(t)[0]},Jb.q2=function(t){return this.quartile(t)[1]},Jb.q3=function(t){return this.quartile(t)[2]},Jb.ci=function(t){return this._get===t&&this._ci||(this._ci=_(this.values(),1e3,.05,t),this._get=t),this._ci},Jb.ci0=function(t){return this.ci(t)[0]},Jb.ci1=function(t){return this.ci(t)[1]};var Vb={values:Qe({name:"values",init:"cell.store = true;",set:"cell.data.values()",idx:-1}),count:Qe({name:"count",set:"cell.num"}),missing:Qe({name:"missing",set:"this.missing"}),valid:Qe({name:"valid",set:"this.valid"}),distinct:Qe({name:"distinct",init:"this.dmap = {}; this.distinct = 0;",add:"this.dmap[v] = 1 + (this.dmap[v] || (++this.distinct, 0));",rem:"if (!(--this.dmap[v])) --this.distinct;",set:"this.distinct"}),sum:Qe({name:"sum",init:"this.sum = 0;",add:"this.sum += v;",rem:"this.sum -= v;",set:"this.sum"}),mean:Qe({name:"mean",init:"this.mean = 0;",add:"var d = v - this.mean; this.mean += d / this.valid;",rem:"var d = v - this.mean; this.mean -= this.valid ? d / this.valid : this.mean;",set:"this.mean"}),average:Qe({name:"average",set:"this.mean",req:["mean"],idx:1}),variance:Qe({name:"variance",init:"this.dev = 0;",add:"this.dev += d * (v - this.mean);",rem:"this.dev -= d * (v - this.mean);",set:"this.valid > 1 ? this.dev / (this.valid-1) : 0",req:["mean"],idx:1}),variancep:Qe({name:"variancep",set:"this.valid > 1 ? this.dev / this.valid : 0",req:["variance"],idx:2}),stdev:Qe({name:"stdev",set:"this.valid > 1 ? Math.sqrt(this.dev / (this.valid-1)) : 0",req:["variance"],idx:2}),stdevp:Qe({name:"stdevp",set:"this.valid > 1 ? Math.sqrt(this.dev / this.valid) : 0",req:["variance"],idx:2}),stderr:Qe({name:"stderr",set:"this.valid > 1 ? Math.sqrt(this.dev / (this.valid * (this.valid-1))) : 0",req:["variance"],idx:2}),ci0:Qe({name:"ci0",set:"cell.data.ci0(this.get)",req:["values"],idx:3}),ci1:Qe({name:"ci1",set:"cell.data.ci1(this.get)",req:["values"],idx:3}),median:Qe({name:"median",set:"cell.data.q2(this.get)",req:["values"],idx:3}),q1:Qe({name:"q1",set:"cell.data.q1(this.get)",req:["values"],idx:3}),q3:Qe({name:"q3",set:"cell.data.q3(this.get)",req:["values"],idx:3}),argmin:Qe({name:"argmin",add:"if (v < this.min) this.argmin = t;",rem:"if (v <= this.min) this.argmin = null;",set:"this.argmin || cell.data.argmin(this.get)",req:["min"],str:["values"],idx:3}),argmax:Qe({name:"argmax",add:"if (v > this.max) this.argmax = t;",rem:"if (v >= this.max) this.argmax = null;",set:"this.argmax || cell.data.argmax(this.get)",req:["max"],str:["values"],idx:3}),min:Qe({name:"min",init:"this.min = null;",add:"if (v < this.min || this.min === null) this.min = v;",rem:"if (v <= this.min) this.min = NaN;",set:"this.min = (isNaN(this.min) ? cell.data.min(this.get) : this.min)",str:["values"],idx:4}),max:Qe({name:"max",init:"this.max = null;",add:"if (v > this.max || this.max === null) this.max = v;",rem:"if (v >= this.max) this.max = NaN;",set:"this.max = (isNaN(this.max) ? cell.data.max(this.get) : this.max)",str:["values"],idx:4})},Zb=$(er,Ye);Zb.transform=function(t,n){var e,r=this,i=n.fork(n.NO_SOURCE|n.NO_FIELDS);return this.stamp=i.stamp,this.value&&((e=t.modified())||n.modified(this._inputs))?(this._prev=this.value,this.value=e?this.init(t):{},n.visit(n.SOURCE,function(t){r.add(t)})):(this.value=this.value||this.init(t),n.visit(n.REM,function(t){r.rem(t)}),n.visit(n.ADD,function(t){r.add(t)})),i.modifies(this._outputs),r._drop=t.drop!==!1,r.changes(i)},Zb.init=function(t){function n(t){for(var n,r=t.fields,a=0,o=r.length;o>a;++a)i[n=r[a]]||(i[n]=1,e.push(n))}var e=this._inputs=[],r=this._outputs=[],i={};this._dims=P(t.groupby),this._dnames=this._dims.map(function(t){var e=E(t);return n(t),r.push(e),e}),this.cellkey=t.key?t.key:0===this._dims.length?function(){return""}:1===this._dims.length?this._dims[0]:ir,this._countOnly=!0,this._counts=[],this._measures=[];var a,o,u,s,l,f,c=t.fields||[null],h=t.ops||["count"],d=t.as||[],p=c.length,g={};for(p!==h.length&&F("Unmatched number of fields and aggregate ops."),f=0;p>f;++f)a=c[f],o=h[f],null==a&&"count"!==o&&F("Null aggregate field specified."),s=E(a),l=rr(o,s,d[f]),r.push(l),"count"!==o?(u=g[s],u||(n(a),u=g[s]=[],u.field=a,this._measures.push(u)),"count"!==o&&(this._countOnly=!1),u.push(Ze(o,l))):this._counts.push(l);return this._measures=this._measures.map(function(t){return nr(t,t.field)}),{}},Zb.cellkey=ir,Zb.cell=function(t,n){var e=this.value[t];return e?0===e.num&&this._drop&&e.stamp<this.stamp?(e.stamp=this.stamp,this._adds[this._alen++]=e):e.stamp<this.stamp&&(e.stamp=this.stamp,this._mods[this._mlen++]=e):(e=this.value[t]=this.newcell(t,n),this._adds[this._alen++]=e),e},Zb.newcell=function(t,n){var e={key:t,num:0,agg:null,tuple:this.newtuple(n,this._prev&&this._prev[t]),stamp:this.stamp,store:!1};if(!this._countOnly){var r,i=this._measures,a=i.length;for(e.agg=Array(a),r=0;a>r;++r)e.agg[r]=new i[r](e,e.tuple)}return e.store&&(e.data=new Ve),e},Zb.newtuple=function(t,n){var e,r,i=this._dnames,a=this._dims,o={};for(e=0,r=a.length;r>e;++e)o[i[e]]=a[e](t);return n?se(n.tuple,o):ae(o)},Zb.add=function(t){var n,e,r,i=this.cellkey(t),a=this.cell(i,t);if(a.num+=1,!this._countOnly)for(a.store&&a.data.add(t),n=a.agg,e=0,r=n.length;r>e;++e)n[e].add(n[e].get(t),t)},Zb.rem=function(t){var n,e,r,i=this.cellkey(t),a=this.cell(i,t);if(a.num-=1,!this._countOnly)for(a.store&&a.data.rem(t),n=a.agg,e=0,r=n.length;r>e;++e)n[e].rem(n[e].get(t),t)},Zb.celltuple=function(t){var n,e,r,i=t.tuple,a=this._counts;for(t.store&&t.data.values(),e=0,r=a.length;r>e;++e)i[a[e]]=t.num;if(!this._countOnly)for(n=t.agg,e=0,r=n.length;r>e;++e)n[e].set();return i},Zb.changes=function(t){var n,e,r,i,a=this._adds,o=this._mods,u=this._prev,s=this._drop,l=t.add,f=t.rem,c=t.mod;if(u)for(e in u)f.push(u[e].tuple);for(r=0,i=this._alen;i>r;++r)l.push(this.celltuple(a[r])),a[r]=null;for(r=0,i=this._mlen;i>r;++r)n=o[r],(0===n.num&&s?f:c).push(this.celltuple(n)),o[r]=null;return this._alen=this._mlen=0,this._prev=null,t};var Qb=$(ar,Ye);Qb.transform=function(t,n){var e=this._bins(t),r=e.step,i=t.as||["bin0","bin1"],a=i[0],o=i[1],u=t.modified()?(n.reflow(),n.SOURCE):n.modified(S(t.field))?n.ADD_MOD:n.ADD;return n.visit(u,function(t){t[o]=(t[a]=e(t))+r}),n.modifies(i)},Qb._bins=function(t){if(this.value&&!t.modified())return this.value;var e=t.field,r=n(t),i=r.start,a=r.step,o=function(t){var n=e(t);return null==n?null:i+a*Math.floor((+n-i)/a)};return o.step=a,this.value=k(o,S(e),t.name||"bin_"+E(e))};var Kb=$(or,Ye);Kb.transform=function(t,n){var e,r=n.fork(n.ALL),i=n.changed(n.ADD),a=n.changed(),o=t.sort,u=this.value,s=function(t){u.push(t)},l=0;return r.rem.length&&(e={},r.visit(r.REM,function(t){e[t._id]=1,++l}),u=u.filter(function(t){return!e[t._id]})),o?((t.modified("sort")||n.modified(o.fields))&&(u.sort(o),a=!0),i&&(u=H(o,u,r.add.sort(o)))):i&&r.visit(r.ADD,s),this.modified(a),this.value=r.source=u,r},$(ur,de);var tw=$(lr,Ye);tw.transform=function(t,n){function e(n){return function(e){for(var r,i=fr(u(e),t["case"],a)||[],s=0,l=i.length;l>s;++s)o.test(r=i[s])||n(r)}}var r=this._parameterCheck(t,n),i=this._counts,a=this._match,o=this._stop,u=t.field,s=t.as||["text","count"],l=e(function(t){i[t]=1+(i[t]||0)}),f=e(function(t){i[t]-=1});return r?n.visit(n.SOURCE,l):(n.visit(n.ADD,l),n.visit(n.REM,f)),this._finish(n,s)},tw._parameterCheck=function(t,n){var e=!1;return(t.modified("stopwords")||!this._stop)&&(this._stop=new RegExp("^"+(t.stopwords||"")+"$","i"),e=!0),(t.modified("pattern")||!this._match)&&(this._match=new RegExp(t.pattern||"[\\w']+","g"),e=!0),(t.modified("field")||n.modified(t.field.fields))&&(e=!0),e&&(this._counts={}),e},tw._finish=function(t,n){var e,r,i,a=this._counts,o=this._tuples||(this._tuples={}),u=n[0],s=n[1],l=t.fork();for(e in a)r=o[e],i=a[e]||0,!r&&i?(o[e]=r=ae({}),r[u]=e,r[s]=i,l.add.push(r)):0===i?(r&&l.rem.push(r),a[e]=null,o[e]=null):r[s]!==i&&(r[s]=i,l.mod.push(r));return l.modifies(n)};var nw=$(cr,Ye);nw.transform=function(t,n){var e=n.fork(n.NO_SOURCE),r=this.value,i=t.as||["a","b"],a=i[0],o=i[1],u=!r||n.changed(n.ADD_REM)||t.modified("as")||t.modified("filter");return u?(r&&(e.rem=r),e.add=this.value=hr(n.source,a,o,t.filter||kx)):e.mod=r,e.source=this.value,e.modifies(i)};var ew=$(dr,Ye);ew.transform=function(t,n){var e,r=this.value,i=t.field,a=r[0],o=r[1],u=n.ADD;e=n.changed()||n.modified(i.fields)||t.modified("field"),e&&(u=n.SOURCE,a=+(1/0),o=-(1/0)),n.visit(u,function(t){var n=i(t);a>n&&(a=n),n>o&&(o=n)}),this.value=[a,o]};var rw=$(pr,de);rw.connect=function(t){return this.targets().add(t),t.source=this},rw.add=function(t){this.value.add.push(t)},rw.rem=function(t){this.value.rem.push(t)},rw.mod=function(t){this.value.mod.push(t)},rw.init=function(t){this.value.init(t)},rw.evaluate=function(){return this.value};var iw=$(gr,Ye);iw.activate=function(t){this._targets[this._targets.active++]=t},iw.subflow=function(t,n,e,r){var i,a,o=this.value,u=o.hasOwnProperty(t)&&o[t];return u?u.value.stamp<e.stamp&&(u.init(e),this.activate(u)):(a=r||(a=this._group[t])&&a.tuple,i=e.dataflow,u=i.add(new pr(e.fork(),this)).connect(n(i,t,this._count++,a)),o[t]=u,this.activate(u)),u},iw.transform=function(t,n){function e(t){return r.subflow(t,a,n)}var r=this,i=t.key,a=t.subflow,o=this._keys,u=t.modified("key");return this._group=t.group||{},this._targets.active=0,n.visit(n.ADD,function(t){e(o[t._id]=i(t)).add(t)}),n.visit(n.REM,function(t){var n=o[t._id];o[t._id]=null,e(n).rem(t)}),u||n.modified(i.fields)?n.visit(n.MOD,function(t){var n=o[t._id],r=i(t);n===r?e(r).mod(t):(o[t._id]=r,e(n).rem(t),e(r).add(t))}):n.changed(n.MOD)&&n.visit(n.MOD,function(t){e(o[t._id]).mod(t)}),u&&n.visit(n.REFLOW,function(t){var n=o[t._id],r=i(t);n!==r&&(o[t._id]=r,e(n).rem(t),e(r).add(t))}),n},$(mr,de);var aw=$(yr,Ye);aw.transform=function(t,n){function e(n){var e=r(n,t),a=i[n._id];e&&a?(i[n._id]=0,o.push(n)):e||a?l&&e&&!a&&s.push(n):(i[n._id]=1,u.push(n))}var r=t.expr,i=this.value,a=n.fork(),o=a.add,u=a.rem,s=a.mod,l=!0;return n.visit(n.REM,function(t){i[t._id]?i[t._id]=0:u.push(t)}),n.visit(n.ADD,function(n){r(n,t)?o.push(n):i[n._id]=1}),n.visit(n.MOD,e),t.modified()&&(l=!1,n.visit(n.REFLOW,e)),a};var ow=$(_r,Ye);ow.transform=function(t,n){function e(t){for(var n,e=a[t._id]=Array(h),r=0;h>r;++r)n=e[r]=oe(t),n[l]=c[r],n[f]=u[r](t),p.add.push(n)}function r(t){for(var n,e=a[t._id],r=0;h>r;++r)m&1<<r&&(n=ue(t,e[r],d),n[l]=c[r],n[f]=u[r](t),p.mod.push(n))}var i,a=this.value,o=t.modified("fields"),u=t.fields,s=t.as||["key","value"],l=s[0],f=s[1],c=u.map(xr),h=u.length,d=n.stamp,p=n.fork(),g=0,m=0;if(o){for(i in a)p.rem.push.apply(p.rem,a[i]);a=this.value={},n.visit(n.SOURCE,e)}else{for(n.visit(n.ADD,e);h>g;++g)n.modified(u[g].fields)&&(m|=1<<g);m&&n.visit(n.MOD,r),n.visit(n.REM,function(t){p.rem.push.apply(p.rem,a[t._id]),a[t._id]=null})}return p.modifies(s)};var uw=$(br,Ye);uw.transform=function(t,n){function e(n){n[a]=i(n,t)}var r,i=t.expr,a=t.as;return t.modified()?n.materialize().reflow().visit(n.SOURCE,e):(r=n.modified(i.fields),n.visit(r?n.ADD_MOD:n.ADD,e)),n.modifies(a)};var sw=$(wr,Ye);sw.transform=function(t,n){var e,r,i,a=this.value,o=n.fork(n.ALL),u=t.size-a.length,s=t.generator;if(u>0){for(e=[];--u>=0;)e.push(i=ae(s(t))),a.push(i);o.add=o.add.length?o.materialize(o.ADD).add.concat(e):e}else r=a.slice(0,-u),o.rem=o.rem.length?o.materialize(o.REM).rem.concat(r):r,a=a.slice(-u);return o.source=this.value=a,o};var lw={value:"value",median:p,mean:d,min:m,max:h},fw=[],cw=$(Mr,Ye);cw.transform=function(t,n){var e,r,i,a,o,u,s,l,f,c,h=n.fork(n.ALL),d=kr(t),p=Er(t),g=E(t.field),m=t.groupby.map(E),v=t.orderby.map(E),y=Sr(n.source,t.groupby,t.orderby),_=[],x=this.value,b=y.domain.length;for(o=0,l=y.length;l>o;++o)for(e=y[o],i=e.values,r=NaN,s=0;b>s;++s)if(null==e[s]){for(a=y.domain[s],c={_impute:!0},u=0,f=i.length;f>u;++u)c[m[u]]=i[u];for(u=0,f=a.length;f>u;++u)c[v[u]]=a[u];c[g]=isNaN(r)?r=d(e,p):r,_.push(ae(c))}return _.length&&(h.add=h.materialize(h.ADD).add.concat(_)),x.length&&(h.rem=h.materialize(h.REM).rem.concat(x)),this.value=_,h},$(Cr,de);var hw=$(Tr,Ye);hw.transform=function(t,n){var e,r,i,a,o=n,u=t.as,s=t.fields,l=t.index,f=null==t["default"]?null:t["default"],c=t.modified(),h=n.ADD;return 1===s.length?(r=s[0],i=u[0],e=function(t){var n=Nr(l,r(t));t[i]=null==n?f:n}):e=function(t){for(var n,e=0,r=s.length;r>e;++e)n=Nr(l,s[e](t)),t[u[e]]=null==n?f:n},c?(h=n.SOURCE,o=n.fork(n.ALL).reflow()):(a=s.some(function(t){return n.modified(t.fields)}),h|=a?n.MOD:0),n.visit(h,e),o.modifies(u)},$(zr,de),$(Or,de),$(Pr,Ye),Pr.prototype.transform=function(t,n){return this.modified(t.modified()),this.value=t,n.fork()};var dw=$(qr,gr);dw.transform=function(t,n){var e=this,r=t.subflow,i=t.field;return(t.modified("field")||i&&n.modified(i.fields))&&F("PreFacet does not support field modification."),this._targets.active=0,n.visit(n.ADD,function(t){var a=e.subflow(t._id,r,n,t);i?i(t).forEach(function(t){a.add(ae(t))}):a.add(t)}),n.visit(n.REM,function(t){var a=e.subflow(t._id,r,n,t);i?i(t).forEach(function(t){a.rem(t)}):a.rem(t)}),n};var pw=$(Lr,Ye);pw.transform=function(t,n){if(t.modified()){var e=n.materialize().fork(n.MOD);return e.rem=n.rem.concat(this.value),e.source=this.value=s(t.start,t.stop,t.step).map(ae),e.add=n.add.concat(this.value),e}};var gw=$(Ur,Ye);gw.transform=function(t,n){n.source||F("Rank transform requires an upstream data source.");var e,r=t.normalize,i=t.field,a=t.as||"rank",o={},u=-1;return i?(n.visit(n.SOURCE,function(t){var n=i(t);null==o[n]&&(o[n]=++u)}),n.visit(n.SOURCE,r&&--u?function(t){t[a]=o[i(t)]/u}:function(t){t[a]=o[i(t)]})):(u+=n.source.length,e=-1,n.visit(n.SOURCE,r&&u?function(t){t[a]=++e/u}:function(t){t[a]=++e})),n.reflow().modifies(a)};var mw=$(Fr,Ye);mw.transform=function(t,n){var e,r=this.value||(e=n=n.addAll(),this.value={});return t.derive&&(e=n.fork(),n.visit(n.ADD,function(t){var n=oe(t);r[t._id]=n,e.add.push(n)}),n.visit(n.MOD,function(t){e.mod.push(ue(t,r[t._id]))}),n.visit(n.REM,function(t){e.rem.push(r[t._id]),r[t._id]=null})),e};var vw=$(jr,Ye);vw.transform=function(t,n){function e(t){var n,e;o.length<a?o.push(t):(e=~~(u*Math.random()),e<o.length&&e>=s&&(n=o[e],l[n._id]&&r.rem.push(n),o[e]=t)),++u}var r=n.fork(),i=t.modified("size"),a=t.size,o=this.value,u=this.count,s=0,l=o.reduce(function(t,n){return t[n._id]=1,t},{});if(n.rem.length&&(n.visit(n.REM,function(t){l[t._id]&&(l[t._id]=-1,r.rem.push(t)),--u}),o=o.filter(function(t){return-1!==l[t._id]})),(n.rem.length||i)&&o.length<a&&n.source&&(s=u=o.length,n.visit(n.SOURCE,function(t){l[t._id]||e(t)}),s=-1),i&&o.length>a){for(var f=0,c=o.length-a;c>f;++f)l[o[f]._id]=-1,r.rem.push(o[f]);o=o.slice(c)}return n.mod.length&&n.visit(n.MOD,function(t){l[t._id]&&r.mod.push(t)}),n.add.length&&n.visit(n.ADD,e),(n.add.length||0>s)&&(r.add=o.filter(function(t){return!l[t._id]})),this.count=u,this.value=r.source=o,r};var yw=$(Ir,Ye);yw.transform=function(t,n){return this.value=n.source,n.changed()?n.fork(n.NO_SOURCE|n.NO_FIELDS):n.StopPropagation};var _w=$($r,Ye);_w.transform=function(t,n){function e(t){i[r(t)]=t}var r=t.field,i=this.value,a=!0;return t.modified("field")||n.modified(r.fields)?(this.value=i={},n.visit(n.SOURCE,e)):n.changed()?(n.visit(n.REM,function(t){i[r(t)]=void 0}),n.visit(n.ADD,e)):a=!1,this.modified(a),n.fork()};var xw=$(Wr,Ye);xw.transform=function(t,n){var e=!this.value||t.modified("field")||t.modified("sort")||n.changed()||t.sort&&n.modified(t.sort.fields);e&&(this.value=(t.sort?n.source.slice().sort(t.sort):n.source).map(t.field))};var bw={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"fields",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:["count","valid","missing","distinct","sum","mean","average","variance","variancep","stdev","stdevp","median","q1","q3","modeskew","min","max","argmin","argmax"]},{name:"as",type:"string",array:!0},{name:"drop",type:"boolean","default":!0},{name:"key",type:"field"}]},ww={type:"Bin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"maxbins",type:"number","default":20},{name:"base",type:"number","default":10},{name:"divide",type:"number",array:!0,"default":[5,2]},{name:"extent",type:"number",array:!0,length:2,required:!0},{name:"step",type:"number"},{name:"steps",type:"number",array:!0},{name:"minstep",type:"number","default":0},{name:"nice",type:"boolean","default":!0},{name:"name",type:"string"},{name:"as",type:"string",array:!0,length:2,"default":["bin0","bin1"]}]},Mw={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]},kw={type:"CountPattern",metadata:{generates:!0,changes:!0},params:[{name:"field",type:"field",required:!0},{name:"case",type:"enum",values:["upper","lower","mixed"],"default":"mixed"},{name:"pattern",type:"string","default":'[\\w"]+'},{name:"stopwords",type:"string","default":""},{name:"as",type:"string",array:!0,length:2,"default":["text","count"]}]},Ew={type:"Cross",metadata:{source:!0,generates:!0,changes:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,"default":["a","b"]}]},Sw={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]},Cw={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]},Aw={type:"Fold",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0,length:2,"default":["key","value"]}]},Tw={type:"Formula",metadata:{modifies:!0},params:[{name:"expr",type:"expr",required:!0},{name:"as",type:"string",required:!0}]},Nw={type:"Impute",metadata:{changes:!0},params:[{name:"field",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"orderby",type:"field",array:!0},{name:"method",type:"enum","default":"value",values:["value","mean","median","max","min"]},{name:"value","default":0}]},zw={type:"Lookup",metadata:{modifies:!0},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:!0},{name:"key",type:"field",required:!0}]},{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0,required:!0},{name:"default","default":null}]},Dw={type:"Range",metadata:{generates:!0,source:!0},params:[{name:"start",type:"number",required:!0},{name:"stop",type:"number",required:!0},{name:"step",type:"number","default":1}],output:["value"]},Ow={type:"Rank",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"normalize",type:"boolean","default":!1},{name:"as",type:"string","default":"rank"}]},Rw={type:"Sample",metadata:{source:!0,changes:!0},params:[{name:"size",type:"number","default":1e3}]};Xe(bw,er),Xe(ww,ar),Xe(Mw,or),Xe(kw,lr),Xe(Ew,cr),Xe(Sw,dr),Xe(Cw,yr),Xe(Aw,_r),Xe(Tw,br),Xe(Nw,Mr),Xe(zw,Tr),Xe(Dw,Lr),Xe(Ow,Ur),Xe(Rw,jr),Je("Compare",ur),Je("Facet",gr),Je("Field",mr),Je("Generate",wr),Je("Key",Cr),Je("MultiExtent",zr),Je("MultiValues",Or),Je("Params",Pr),Je("PreFacet",qr),Je("Relay",Fr),Je("Sieve",Ir),Je("Subflow",pr),Je("TupleIndex",$r),Je("Values",Wr);var Pw=Array.prototype,qw=Pw.map,Lw=Pw.slice,Uw={name:"implicit"},Fw=.7,jw=1/Fw,Iw=/^#([0-9a-f]{3})$/,$w=/^#([0-9a-f]{6})$/,Ww=/^rgb\(\s*([-+]?\d+)\s*,\s*([-+]?\d+)\s*,\s*([-+]?\d+)\s*\)$/,Bw=/^rgb\(\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*\)$/,Hw=/^rgba\(\s*([-+]?\d+)\s*,\s*([-+]?\d+)\s*,\s*([-+]?\d+)\s*,\s*([-+]?\d+(?:\.\d+)?)\s*\)$/,Yw=/^rgba\(\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)\s*\)$/,Xw=/^hsl\(\s*([-+]?\d+(?:\.\d+)?)\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*\)$/,Gw=/^hsla\(\s*([-+]?\d+(?:\.\d+)?)\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)\s*\)$/,Jw={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Hr(Xr,Gr,{displayable:function(){return this.rgb().displayable()},toString:function(){return this.rgb()+""}}),Hr(Kr,Qr,Yr(Xr,{brighter:function(t){return t=null==t?jw:Math.pow(jw,t),new Kr(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?Fw:Math.pow(Fw,t),new Kr(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},toString:function(){var t=this.opacity;return t=isNaN(t)?1:Math.max(0,Math.min(1,t)),(1===t?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}})),Hr(ri,ei,Yr(Xr,{brighter:function(t){return t=null==t?jw:Math.pow(jw,t),new ri(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?Fw:Math.pow(Fw,t),new ri(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(.5>e?e:1-e)*n,i=2*e-r;return new Kr(ii(t>=240?t-240:t+120,i,r),ii(t,i,r),ii(120>t?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var Vw=Math.PI/180,Zw=180/Math.PI,Qw=18,Kw=.95047,tM=1,nM=1.08883,eM=4/29,rM=6/29,iM=3*rM*rM,aM=rM*rM*rM;Hr(ui,oi,Yr(Xr,{brighter:function(t){return new ui(this.l+Qw*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new ui(this.l-Qw*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,n=isNaN(this.a)?t:t+this.a/500,e=isNaN(this.b)?t:t-this.b/200;return t=tM*li(t),n=Kw*li(n),e=nM*li(e),new Kr(fi(3.2404542*n-1.5371385*t-.4985314*e),fi(-.969266*n+1.8760108*t+.041556*e),fi(.0556434*n-.2040259*t+1.0572252*e),this.opacity)}})),Hr(pi,di,Yr(Xr,{brighter:function(t){return new pi(this.h,this.c,this.l+Qw*(null==t?1:t),this.opacity)},darker:function(t){return new pi(this.h,this.c,this.l-Qw*(null==t?1:t),this.opacity)},rgb:function(){return ai(this).rgb()}}));var oM=-.14861,uM=1.78277,sM=-.29227,lM=-.90649,fM=1.97294,cM=fM*lM,hM=fM*uM,dM=uM*sM-lM*oM;Hr(vi,mi,Yr(Xr,{brighter:function(t){return t=null==t?jw:Math.pow(jw,t),new vi(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?Fw:Math.pow(Fw,t),new vi(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*Vw,n=+this.l,e=isNaN(this.s)?0:this.s*n*(1-n),r=Math.cos(t),i=Math.sin(t);return new Kr(255*(n+e*(oM*r+uM*i)),255*(n+e*(sM*r+lM*i)),255*(n+e*(fM*r)),this.opacity)}}));var pM=function Oz(t){function n(t,n){var r=e((t=Qr(t)).r,(n=Qr(n)).r),i=e(t.g,n.g),a=e(t.b,n.b),o=e(t.opacity,n.opacity);return function(n){return t.r=r(n),t.g=i(n),t.b=a(n),t.opacity=o(n),t+""}}var e=ki(t);return n.gamma=Oz,n}(1),gM=Si(_i),mM=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,vM=new RegExp(mM.source,"g");qi(Mi);var yM,_M=qi(Ei),xM=[0,1],bM={"":Ji,"%":function(t,n){return(100*t).toFixed(n)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,n){return t.toExponential(n)},f:function(t,n){return t.toFixed(n)},g:function(t,n){return t.toPrecision(n)},o:function(t){return Math.round(t).toString(8)},p:function(t,n){return Zi(100*t,n)},r:Zi,s:Vi,X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}},wM=/^(?:(.)?([<>=^]))?([+\-\( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?([a-z%])?$/i;Ki.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+this.type};var MM,kM,EM,SM=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];ea({decimal:".",thousands:",",grouping:[3],currency:["$",""]});var CM=1e3,AM=60*CM,TM=60*AM,NM=24*TM,zM=7*NM,DM=30*NM,OM=365*NM,RM=Ta("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),PM=Ta("393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6"),qM=Ta("3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9"),LM=Ta("1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5"),UM=_M(mi(300,.5,0),mi(-240,.5,1)),FM=_M(mi(-100,.75,.35),mi(80,1.5,.8)),jM=_M(mi(260,.75,.35),mi(80,1.5,.8)),IM=mi(),$M=za(Ta("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),WM=za(Ta("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),BM=za(Ta("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),HM=za(Ta("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),YM=Fa("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),XM=Fa("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),GM=Fa("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),JM=Fa("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),VM=Fa("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),ZM=Fa("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),QM=Fa("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),KM=Fa("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),tk=ja("5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30"),nk=ja("40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b"),ek=ja("8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419"),rk=ja("7f3b08b35806e08214fdb863fee0b6f7f7f7d8daebb2abd28073ac5427882d004b"),ik=ja("67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061"),ak=ja("67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a"),ok=ja("a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695"),uk=ja("a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837"),sk=ja("9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2"),lk=ja("f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b"),fk=ja("f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b"),ck=ja("f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081"),hk=ja("fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000"),dk=ja("fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636"),pk=ja("fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858"),gk=ja("f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f"),mk=ja("fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a"),vk=ja("ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58"),yk=ja("ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529"),_k=ja("ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506"),xk=ja("ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026"),bk=ja("f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b"),wk=ja("f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b"),Mk=ja("fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000"),kk=ja("fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d"),Ek=ja("fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d"),Sk=ja("fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704"),Ck={
category10:RM,category20:LM,category20b:PM,category20c:qM,accent:YM,dark2:XM,paired:GM,pastel1:JM,pastel2:VM,set1:ZM,set2:QM,set3:KM,cubehelix:UM,rainbow:Na,warm:FM,cool:jM,viridis:$M,magma:WM,inferno:BM,plasma:HM,brbg:tk,prgn:nk,piyg:ek,puor:rk,rdbu:ik,rdgy:ak,rdylbu:ok,rdylgn:uk,spectral:sk,brownbluegreen:tk,purplegreen:nk,pinkyellowgreen:ek,purpleorange:rk,redblue:ik,redgrey:ak,redyellowblue:ok,redyellowgreen:uk,bugn:lk,bupu:fk,gnbu:ck,orrd:hk,pubugn:dk,pubu:pk,purd:gk,rdpu:mk,ylgnbu:vk,ylgn:yk,ylorbr:_k,ylorrd:xk,bluegreen:lk,bluepurple:fk,greenblue:ck,orangered:hk,purplebluegreen:dk,purpleblue:pk,purplered:gk,redpurple:mk,yellowgreenblue:vk,yellowgreen:yk,yelloworangebrown:_k,yelloworangered:xk,blues:bk,greens:wk,greys:Mk,purples:kk,reds:Ek,oranges:Sk},Ak={identity:la,linear:sa,log:va,ordinal:Br,pow:_a,sqrt:xa,quantile:ba,quantize:wa,threshold:Ma,time:Ca,utc:Aa,sequential:Da,band:Oa,point:Pa,index:qa};for(var Tk in Ak)Ba(Tk,Ak[Tk]);Ya.prototype={constructor:Ya,reset:function(){this.s=this.t=0},add:function(t){Xa(Uk,t,this.t),Xa(this,Uk.s,this.s),this.s?this.t+=Uk.t:this.s=Uk.t},valueOf:function(){return this.s}};var Nk,zk,Dk,Ok,Rk,Pk,qk,Lk,Uk=new Ya,Fk=1e-6,jk=Math.PI,Ik=jk/2,$k=jk/4,Wk=2*jk,Bk=180/jk,Hk=jk/180,Yk=Math.abs,Xk=Math.atan,Gk=Math.atan2,Jk=Math.cos,Vk=Math.ceil,Zk=Math.exp,Qk=Math.log,Kk=Math.pow,tE=Math.sin,nE=Math.sign||function(t){return t>0?1:0>t?-1:0},eE=Math.sqrt,rE=Math.tan,iE={Feature:function(t,n){Za(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++r<i;)Za(e[r].geometry,n)}},aE={Sphere:function(t,n){n.sphere()},Point:function(t,n){t=t.coordinates,n.point(t[0],t[1],t[2])},MultiPoint:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;++r<i;)t=e[r],n.point(t[0],t[1],t[2])},LineString:function(t,n){Qa(t.coordinates,n,0)},MultiLineString:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;++r<i;)Qa(e[r],n,0)},Polygon:function(t,n){Ka(t.coordinates,n)},MultiPolygon:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;++r<i;)Ka(e[r],n)},GeometryCollection:function(t,n){for(var e=t.geometries,r=-1,i=e.length;++r<i;)Za(e[r],n)}};Ha(),Ha(),Ha();co.invert=co;var oE,uE,sE,lE,fE,cE,hE,dE,pE=1e9,gE=-pE,mE=(Ha(),Ha()),vE=Ha(),yE={point:Va,lineStart:Va,lineEnd:Va,polygonStart:function(){yE.lineStart=No,yE.lineEnd=Oo},polygonEnd:function(){yE.lineStart=yE.lineEnd=yE.point=Va,mE.add(Yk(vE)),vE.reset()},result:function(){var t=mE/2;return mE.reset(),t}},_E=1/0,xE=_E,bE=-_E,wE=bE,ME={point:Ro,lineStart:Va,lineEnd:Va,polygonStart:Va,polygonEnd:Va,result:function(){var t=[[_E,xE],[bE,wE]];return bE=wE=-(xE=_E=1/0),t}},kE=0,EE=0,SE=0,CE=0,AE=0,TE=0,NE=0,zE=0,DE=0,OE={point:Po,lineStart:qo,lineEnd:Fo,polygonStart:function(){OE.lineStart=jo,OE.lineEnd=Io},polygonEnd:function(){OE.point=Po,OE.lineStart=qo,OE.lineEnd=Fo},result:function(){var t=DE?[NE/DE,zE/DE]:TE?[CE/TE,AE/TE]:SE?[kE/SE,EE/SE]:[NaN,NaN];return kE=EE=SE=CE=AE=TE=NE=zE=DE=0,t}};Bo.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,n){switch(this._point){case 0:this._context.moveTo(t,n),this._point=1;break;case 1:this._context.lineTo(t,n);break;default:this._context.moveTo(t+this._radius,n),this._context.arc(t,n,this._radius,0,Wk)}},result:Va},Ho.prototype={_circle:Yo(4.5),pointRadius:function(t){return this._circle=Yo(t),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,n){switch(this._point){case 0:this._string.push("M",t,",",n),this._point=1;break;case 1:this._string.push("L",t,",",n);break;default:this._string.push("M",t,",",n,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}}};var RE=Ha(),PE=Jo(function(){return!0},Qo,tu,[-jk,-Ik]);ru.prototype={point:function(t,n){this.stream.point(t,n)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var qE=16,LE=Jk(30*Hk),UE=eu({point:function(t,n){this.stream.point(t*Hk,n*Hk)}}),FE=yu(function(t){return eE(2/(1+t))});FE.invert=_u(function(t){return 2*Ja(t/2)});var jE=yu(function(t){return(t=Ga(t))&&t/tE(t)});jE.invert=_u(function(t){return t}),wu.invert=function(t,n){return[t,2*Xk(Zk(n))-Ik]},Au.invert=Au,Du.invert=_u(Xk),Ru.invert=_u(Ja),qu.invert=_u(function(t){return 2*Xk(t)}),Uu.invert=function(t,n){return[-n,2*Xk(Zk(t))-Ik]};var IE=$(ju,Ye);IE.transform=function(t,n){function e(t){t[u]=a(o(t))}var r,i=n.fork(n.ALL),a=this.value,o=t.field||bx,u=t.as||"path";return!a||t.modified()?(this.value=a=Xo().pointRadius(t.pointRadius).projection(t.projection),i.materialize().reflow().visit(i.SOURCE,e)):(r=o===bx||n.modified(o.fields),i.visit(r?i.ADD_MOD:i.ADD,e)),i.modifies(u)};var $E=$(Iu,Ye);$E.transform=function(t,n){function e(t){var n=i([a(t),o(t)]);n?(t[s]=n[0],t[l]=n[1]):(t[s]=void 0,t[l]=void 0)}var r,i=t.projection,a=t.fields[0],o=t.fields[1],u=t.as||["x","y"],s=u[0],l=u[1];return t.modified()?n.materialize().reflow().visit(n.SOURCE,e):(r=n.modified(a.fields)||n.modified(o.fields),n.visit(r?n.ADD_MOD:n.ADD,e)),n.modifies(u)};var WE=$($u,Ye);WE.transform=function(t,n){var e=n.fork(n.ALL),r=this.value,i=t.field||D("datum"),a=t.as||"shape",o=e.ADD_MOD;return(!r||t.modified())&&(this.value=r=Wu(Xo().pointRadius(t.pointRadius).projection(t.projection),i),e.materialize().reflow(),o=e.SOURCE),e.visit(o,function(t){t[a]=r}),e.modifies(a)};var BE=$(Bu,Ye);BE.transform=function(t,n){var e,r=n.fork(),i=this.value,a=this.generator;if(!i.length||t.modified())for(var o in t)L(a[o])&&a[o](t[o]);return e=a(),i.length?(e._id=i[0]._id,r.mod.push(e)):r.add.push(ae(e)),i[0]=e,r.source=i,r};var HE=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"],YE={albers:gu,albersusa:vu,azimuthalequalarea:xu,azimuthalequidistant:bu,conicconformal:Cu,conicequalarea:pu,conicequidistant:zu,equirectangular:Tu,gnomonic:Ou,mercator:Mu,orthographic:Pu,stereographic:Lu,transversemercator:Fu};for(var XE in YE)Yu(XE,YE[XE]);var GE=$(Xu,Ye);GE.transform=function(t){var n=this.value;!n||t.modified("type")?(this.value=n=Gu(t.type),HE.forEach(function(e){null!=t[e]&&Ju(n,e,t[e])})):HE.forEach(function(e){t.modified(e)&&Ju(n,e,t[e])})};var JE={type:"GeoPath",metadata:{modifies:!0},params:[{name:"projection",type:"projection",required:!0},{name:"pointRadius",type:"number"},{name:"field",type:"field"},{name:"as",type:"string","default":"path"}]},VE={type:"GeoPoint",metadata:{modifies:!0},params:[{name:"projection",type:"projection",required:!0},{name:"fields",type:"field",array:!0,required:!0,length:2},{name:"as",type:"string",array:!0,length:2,"default":["x","y"]}]},ZE={type:"GeoShape",metadata:{modifies:!0},params:[{name:"projection",type:"projection",required:!0},{name:"pointRadius",type:"number"},{name:"field",type:"field","default":"datum"},{name:"as",type:"string","default":"shape"}]},QE={type:"Graticule",metadata:{source:!0,generates:!0,changes:!0},params:[{name:"extent",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMajor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMinor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"step",type:"number",array:!0,length:2},{name:"stepMajor",type:"number",array:!0,length:2,"default":[90,360]},{name:"stepMinor",type:"number",array:!0,length:2,"default":[10,10]},{name:"precision",type:"number","default":2.5}]};Xe(JE,ju),Xe(VE,Iu),Xe(ZE,$u),Xe(QE,Bu),Je("Projection",Xu);var KE=$(es,Ye);KE.transform=function(t,n){if(null!=this.value&&!t.modified())return n.StopPropagation;var e=n.fork(),r=this.value,i=t.scale,a=null==t.count?10:t.count,o=t.format||Zu(i,a,t.formatSpecifier),u=t.values||Vu(i,a);return r&&(e.rem=r),r=u.map(function(t){return ae({value:t,label:o(t)})}),t.extra&&r.push(ae({extra:{value:r[0].value},label:""})),e.source=e.add=this.value=r,e};var tS=$(is,Ye);tS.transform=function(t,n){var e=n.fork(n.NO_SOURCE|n.NO_FIELDS),r=t.item||as,i=t.key||re,a=this.value||(n=n.addAll(),this.value={});return(t.modified("key")||n.modified(i))&&F("DataJoin does not support modified key function or fields."),n.visit(n.ADD,function(t){var n=i(t),o=rs(a,n);o?(o.exit?e.add:e.mod).push(o):(a[n]=o=r(t),e.add.push(o)),o.datum=t,o.exit=!1}),n.visit(n.MOD,function(t){var n=i(t),r=rs(a,n);r&&e.mod.push(r)}),n.visit(n.REM,function(t){var n=i(t),r=rs(a,n);t===r.datum&&(e.rem.push(r),r.exit=!0)}),e};var nS=$(os,Ye);nS.transform=function(t,n){var e=n.fork(n.ADD_REM),r=n.encode,i="enter"===r,a=t.encoders.update||Ex,o=t.encoders.enter||Ex,u=t.encoders.exit||Ex,s=(r&&!i?t.encoders[r]:a)||Ex;if(n.changed(n.ADD)&&(n.visit(n.ADD,function(n){o(n,t),a(n,t),s!==Ex&&s!==a&&s(n,t)}),e.modifies(o.output),e.modifies(a.output),s!==Ex&&s!==a&&e.modifies(s.output)),n.changed(n.REM)&&u!==Ex&&(n.visit(n.REM,function(n){u(n,t)}),e.modifies(u.output)),i||s!==Ex){var l=n.MOD|(t.modified()?n.REFLOW:0);i?(n.visit(l,function(n){var r=o(n,t);(s(n,t)||r)&&e.mod.push(n)}),e.mod.length&&e.modifies(o.output)):n.visit(l,function(n){s(n,t)&&e.mod.push(n)}),e.mod.length&&e.modifies(s.output)}return e};var eS=$(us,Ye);eS.transform=function(t,n){if(null!=this.value&&!t.modified())return n.StopPropagation;var e=n.fork(),r=0,i=this.value,a="gradient"===t.type,o=t.scale,u=null==t.count?5:t.count,s=t.format||Zu(o,u,t.formatSpecifier),l=t.values||(a?o.domain():Vu(o,u));if(i&&(e.rem=i),a)var f=t.values?o.domain():l,c=f[0],h=f[f.length-1],d=o.range?o.copy().domain([c,h]).range([0,1]):function(t){return(t-c)/(h-c)};else{var p=t.size;L(p)||(p=U(p||8))}return i=l.map(function(t,n){var e=ae({index:n,label:s(t),value:t});return a?e.perc=d(t):(e.size=p(t),e.total=Math.round(r),r+=e.size),e}),e.source=e.add=this.value=i,e};var rS={line:ds,"line-radial":ps,curve:gs,"curve-radial":ms,"orthogonal-horizontal":vs,"orthogonal-vertical":ys,"orthogonal-radial":_s,"diagonal-horizontal":xs,"diagonal-vertical":bs,"diagonal-radial":ws},iS=$(hs,Ye);iS.transform=function(t,n){var e=t.sourceX||ss,r=t.sourceY||ls,i=t.targetX||fs,a=t.targetY||cs,o=t.as||"path",u=t.orient||"vertical",s=t.shape||"line",l=rs(rS,s+"-"+u)||rs(rS,s);return l||F("LinkPath unsupported type: "+t.shape+"-"+t.orient),n.reflow().visit(n.SOURCE,function(t){t[o]=l(e(t),r(t),i(t),a(t))}),n.modifies(o)};var aS=$(Ms,Ye);aS.transform=function(t,n){var e,r,i,a=t.as||["startAngle","endAngle"],o=a[0],u=a[1],l=t.field||Mx,f=t.startAngle||0,c=null!=t.endAngle?t.endAngle:2*Math.PI,h=n.source,d=h.map(l),p=d.length,g=f,m=(c-f)/y(d),v=s(p);for(t.sort&&v.sort(function(t,n){return d[t]-d[n]}),e=0;p>e;++e)i=d[v[e]],r=h[v[e]],r[o]=g,r[u]=g+=i*m;return this.value=d,n.reflow().modifies(a)};var oS={set:1,modified:1,clear:1,type:1,scheme:1,domain:1,domainMin:1,domainMax:1,nice:1,zero:1,range:1,round:1,bandSize:1,reverse:1},uS=J(["linear","pow","sqrt"]),sS=$(ks,Ye);sS.transform=function(t,n){var e,r=this.value,i=!r||t.modified("type")||t.modified("scheme")||t.scheme&&t.modified("reverse");i&&(this.value=r=Es(t.type,t.scheme,t.reverse));for(e in t)oS[e]||(L(r[e])?r[e](t[e]):n.dataflow.warn("Unsupported scale property: "+e));return Cs(r,t,Ss(r,t)),n.fork(n.NO_SOURCE|n.NO_FIELDS)};var lS="center",fS="normalize",cS=$(As,Ye);cS.transform=function(t,n){var e,r,i,a,o,u,s,l,f,c,h,d,p,g=t.as||["y0","y1"],m=g[0],v=g[1],y=t.field,_=t.offset;for(e=Ts(n.source,t.groupby,t.sort,y),i=0,o=e.length,s=e.max;o>i;++i)for(r=e[i],l=_===lS?(s-r.sum)/2:0,f=_===fS?1/r.sum:1,d=l,p=0,a=0,u=r.length;u>a;++a)c=r[a],h=d,p+=y(c),d=f*p+l,c[m]=h,c[v]=d;return n.reflow().modifies(g)};var hS={type:"LinkPath",metadata:{modifies:!0},params:[{name:"sourceX",type:"field","default":"source.x"},{name:"sourceY",type:"field","default":"source.y"},{name:"targetX",type:"field","default":"target.x"},{name:"targetY",type:"field","default":"target.y"},{name:"orient",type:"enum","default":"vertical",values:["horizontal","vertical","radial"]},{name:"shape",type:"enum","default":"line",values:["line","curve","diagonal","orthogonal"]},{name:"as",type:"string","default":"path"}]},dS={type:"Pie",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"startAngle",type:"number","default":0},{name:"endAngle",type:"number","default":6.283185307179586},{name:"sort",type:"boolean","default":!1},{name:"as",type:"string",array:!0,length:2,"default":["startAngle","endAngle"]}]},pS={type:"Stack",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"groupby",type:"field",array:!0},{name:"sort",type:"compare"},{name:"offset",type:"enum","default":"zero",values:["zero","center","normalize"]},{name:"as",type:"string",array:!0,length:2,"default":["y0","y1"]}]};Xe(hS,hs),Xe(dS,Ms),Xe(pS,As),Je("AxisTicks",es),Je("DataJoin",is),Je("Encode",os),Je("LegendEntries",us),Je("Scale",ks);var gS=Zs.prototype=Qs.prototype;gS.copy=function(){var t,n,e=new Qs(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return e;if(!r.length)return e._root=Ks(r),e;for(t=[{source:r,target:e._root=new Array(4)}];r=t.pop();)for(var i=0;4>i;++i)(n=r.source[i])&&(n.length?t.push({source:n,target:r.target[i]=new Array(4)}):r.target[i]=Ks(n));return e},gS.add=Os,gS.addAll=Ps,gS.cover=qs,gS.data=Ls,gS.extent=Us,gS.find=js,gS.remove=Is,gS.removeAll=$s,gS.root=Ws,gS.size=Bs,gS.visit=Hs,gS.visitAfter=Ys,gS.x=Gs,gS.y=Vs;var mS,vS,yS=0,_S=0,xS=0,bS=1e3,wS=0,MS=0,kS=0,ES="object"==typeof performance&&performance.now?performance:Date,SS="function"==typeof requestAnimationFrame?requestAnimationFrame:function(t){setTimeout(t,17)};ul.prototype=sl.prototype={constructor:ul,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?al():+e)+(null==n?0:+n),this._next||vS===this||(vS?vS._next=this:mS=this,vS=this),this._call=t,this._time=e,dl()},stop:function(){this._call&&(this._call=null,this._time=1/0,dl())}};var CS=10,AS=Math.PI*(3-Math.sqrt(5)),TS={center:Ns,collide:el,nbody:vl,link:il,x:yl,y:_l},NS="forces",zS=["alpha","alphaMin","alphaTarget","velocityDecay","drag","forces"],DS=["static","iterations"],OS=["x","y","vx","vy"],RS=$(xl,Ye);RS.transform=function(t,n){var e=this.value,r=n.changed(n.ADD_REM),i=t.modified(zS),a=t.iterations||300;if(e?(r&&(n.modifies("index"),e.nodes(n.source)),i&&Ml(e,t)):(this.value=e=wl(n.source,t),e.on("tick",bl(n.dataflow,this)),t["static"]||(r=!0,e.tick()),n.modifies("index")),i||r||t.modified(DS)||n.changed()&&t.restart)if(e.alpha(Math.max(e.alpha(),t.alpha||1)).alphaDecay(1-Math.pow(e.alphaMin(),1/a)),t["static"])for(e.stop();--a>=0;)e.tick();else if(e.stopped()&&e.restart(),!r)return n.StopPropagation;return this.finish(n)},RS.finish=function(t){for(var n,e=t.dataflow,r=this._argops,i=0,a=r.length;a>i;++i)if(n=r[i],n.name===NS&&"link"===n.op._argval.force)for(var o,u=n.op._argops,s=0,l=u.length;l>s;++s)if("links"===u[s].name&&(o=u[s].op.source)){e.touch(o);break}return t.reflow().modifies(OS)};var PS={type:"Force",metadata:{modifies:!0},params:[{name:"static",type:"boolean","default":!1},{name:"restart",type:"boolean","default":!1},{name:"iterations",type:"number","default":300},{name:"alpha",type:"number","default":1},{name:"alphaMin",type:"number","default":.001},{name:"alphaTarget",type:"number","default":0},{name:"drag",type:"number","default":.6},{name:"forces",type:"param",array:!0,params:[{key:{force:"center"},params:[{name:"x",type:"number","default":0},{name:"y",type:"number","default":0}]},{key:{force:"collide"},params:[{name:"radius",type:"number",expr:!0},{name:"strength",type:"number","default":.7},{name:"iterations",type:"number","default":1}]},{key:{force:"nbody"},params:[{name:"strength",type:"number","default":-30},{name:"theta",type:"number","default":.9},{name:"distanceMin",type:"number","default":1},{name:"distanceMax",type:"number"}]},{key:{force:"link"},params:[{name:"links",type:"data"},{name:"id",type:"field"},{name:"distance",type:"number","default":30,expr:!0},{name:"strength",type:"number",expr:!0},{name:"iterations",type:"number","default":1}]},{key:{force:"x"},params:[{name:"strength",type:"number","default":.1},{name:"x",type:"field"}]},{key:{force:"y"},params:[{name:"strength",type:"number","default":.1},{name:"y",type:"field"}]}]},{name:"as",type:"string",array:!0,modify:!1,"default":["x","y","vx","vy"]}]};Xe(PS,xl),Jl.prototype=Bl.prototype={constructor:Jl,each:Ol,eachAfter:Pl,eachBefore:Rl,sum:ql,sort:Ll,path:Ul,ancestors:jl,descendants:Il,leaves:$l,links:Wl,copy:Hl};var qS="$",LS={depth:-1},US={};zf.prototype=Object.create(Jl.prototype);var FS=(1+Math.sqrt(5))/2,jS=function Rz(t){function n(n,e,r,i,a){Pf(t,n,e,r,i,a)}return n.ratio=function(t){return Rz((t=+t)>1?t:1)},n}(FS),IS=function Pz(t){function n(n,e,r,i,a){if((o=n._squarify)&&o.ratio===t)for(var o,u,s,l,f,c=-1,h=o.length,d=n.value;++c<h;){for(u=o[c],s=u.children,l=u.value=0,f=s.length;f>l;++l)u.value+=s[l].value;u.dice?xf(u,e,r,i,r+=(a-r)*u.value/d):Rf(u,e,r,e+=(i-e)*u.value/d,a),d-=u.value}else n._squarify=o=Pf(t,n,e,r,i,a),o.ratio=t}return n.ratio=function(t){return Pz((t=+t)>1?t:1)},n}(FS),$S=$(Ff,Ye);$S.transform=function(t,n){if(n.source||F("Nest transform requires an upstream data source."),!this.value||t.modified()||n.changed()){var e=P(t.keys).reduce(function(t,n){return t.key(n),t},tt()).entries(n.source),r=Bl({values:e},jf),i=r.lookup={};r.each(function(t){"_id"in t.data&&(i[t.data._id]=t)}),this.value=r}n.source.root=this.value};var WS=$(If,Ye);WS.transform=function(t,n){n.source||F("Stratify transform requires an upstream data source.");var e=!this.value||t.modified()||n.changed(n.ADD_REM)||n.modified(t.key.fields)||n.modified(t.parentKey.fields);if(e){var r=kf().id(t.key).parentId(t.parentKey)(n.source),i=r.lookup={};r.each(function(t){i[t.data._id]=t}),this.value=r}n.source.root=this.value};var BS=$($f,Ye);BS.transform=function(t,n){function e(t){var n=a[t];n&&(o[t]=1,u.mod.push(n))}n.source&&n.source.root||F("TreeLinks transform requires a backing tree data source.");var r=n.source.root,i=r.lookup,a=this.value,o={},u=n.fork();return n.visit(n.REM,function(t){var n=a[t._id];n&&(delete a[t._id],u.rem.push(n))}),n.visit(n.ADD,function(t){var n,e=t._id;(n=Wf(i[e]))&&(u.add.push(a[e]=ae({source:n,target:t})),o[e]=1)}),n.visit(n.MOD,function(t){var n=t._id,r=i[n],a=r.children;if(e(n),a)for(var u=0,s=a.length;s>u;++u)o[n=a[u].data._id]||e(n)}),u};var HS={binary:Lf,dice:xf,slice:Rf,slicedice:Uf,squarify:jS,resquarify:IS},YS={tidy:Of,cluster:Dl},XS=$(Yf,Ye);XS.transform=function(t,n){n.source&&n.source.root||F(this.constructor.name+" transform requires a backing tree data source.");var e=this.layout(t.method),r=this.fields,i=n.source.root,a=t.as||r;t.field&&i.sum(t.field),t.sort&&i.sort(t.sort),Xf(e,this.params,t);try{this.value=e(i)}catch(o){F(o)}return i.each(function(t){Gf(t,r,a)}),n.reflow().modifies(a).modifies("leaf")},$(Jf,Yf),Jf.prototype.layout=Bf,Jf.prototype.params=["size","nodeSize","separation"],Jf.prototype.fields=["x","y","depth","children"],$(Vf,Yf),Vf.prototype.layout=Hf,Vf.prototype.params=["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],Vf.prototype.fields=["x0","y0","x1","y1","depth","children"],$(Zf,Yf),Zf.prototype.layout=bf,Zf.prototype.params=["size","round","padding"],Zf.prototype.fields=Vf.prototype.fields,$(Qf,Yf),Qf.prototype.layout=gf,Qf.prototype.params=["size","padding"],Qf.prototype.fields=["x","y","r","depth","children"];var GS={type:"Nest",metadata:{treesource:!0},params:[{name:"keys",type:"field",array:!0}]},JS={type:"Stratify",metadata:{treesource:!0},params:[{name:"key",type:"field",required:!0},{name:"parentKey",type:"field",required:!0}]},VS={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]},ZS={type:"Pack",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number","default":0},{name:"radius",type:"field","default":null},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:3,"default":["x","y","r","depth","children"]}]},QS={type:"Partition",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number","default":0},{name:"round",type:"boolean","default":!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:4,"default":["x0","y0","x1","y1","depth","children"]}]},KS={type:"Tree",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum","default":"tidy",values:["tidy","cluster"]},{name:"size",type:"number",array:!0,length:2},{name:"nodeSize",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:4,"default":["x","y","depth","children"]}]},tC={type:"Treemap",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum","default":"squarify",values:["squarify","resquarify","binary","dice","slice","slicedice"]},{name:"padding",type:"number","default":0},{name:"paddingInner",type:"number","default":0},{name:"paddingOuter",type:"number","default":0},{name:"paddingTop",type:"number","default":0},{name:"paddingRight",type:"number","default":0},{name:"paddingBottom",type:"number","default":0},{name:"paddingLeft",type:"number","default":0},{name:"ratio",type:"number","default":1.618033988749895},{name:"round",type:"boolean","default":!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:4,"default":["x0","y0","x1","y1","depth","children"]}]};Xe(GS,Ff),Xe(JS,If),Xe(VS,$f),Xe(ZS,Qf),Xe(QS,Zf),Xe(KS,Jf),Xe(tC,Vf),ec.prototype={constructor:ec,insert:function(t,n){var e,r,i;if(t){if(n.P=t,n.N=t.N,t.N&&(t.N.P=n),t.N=n,t.R){for(t=t.R;t.L;)t=t.L;t.L=n}else t.R=n;e=t}else this._?(t=oc(this._),n.P=null,n.N=t,t.P=t.L=n,e=t):(n.P=n.N=null,this._=n,e=null);for(n.L=n.R=null,n.U=e,n.C=!0,t=n;e&&e.C;)r=e.U,e===r.L?(i=r.R,i&&i.C?(e.C=i.C=!1,r.C=!0,t=r):(t===e.R&&(ic(this,e),t=e,e=t.U),e.C=!1,r.C=!0,ac(this,r))):(i=r.L,i&&i.C?(e.C=i.C=!1,r.C=!0,t=r):(t===e.L&&(ac(this,e),t=e,e=t.U),e.C=!1,r.C=!0,ic(this,r))),e=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var n,e,r,i=t.U,a=t.L,o=t.R;if(e=a?o?oc(o):a:o,i?i.L===t?i.L=e:i.R=e:this._=e,a&&o?(r=e.C,e.C=t.C,e.L=a,a.U=e,e!==o?(i=e.U,e.U=t.U,t=e.R,i.L=t,e.R=o,o.U=e):(e.U=i,i=e,t=e.R)):(r=t.C,t=e),t&&(t.U=i),!r){if(t&&t.C)return void(t.C=!1);do{if(t===this._)break;if(t===i.L){if(n=i.R,n.C&&(n.C=!1,i.C=!0,ic(this,i),n=i.R),n.L&&n.L.C||n.R&&n.R.C){n.R&&n.R.C||(n.L.C=!1,n.C=!0,ac(this,n),n=i.R),n.C=i.C,i.C=n.R.C=!1,ic(this,i),t=this._;break}}else if(n=i.L,n.C&&(n.C=!1,i.C=!0,ac(this,i),n=i.L),n.L&&n.L.C||n.R&&n.R.C){n.L&&n.L.C||(n.R.C=!1,n.C=!0,ic(this,n),n=i.L),n.C=i.C,i.C=n.L.C=!1,ac(this,i),t=this._;break}n.C=!0,t=i,i=i.U}while(!t.C);t&&(t.C=!1)}}};var nC,eC,rC,iC,aC,oC=[],uC=[],sC=1e-6,lC=1e-12;zc.prototype={constructor:zc,polygons:function(){var t=this.edges;return this.cells.map(function(n){var e=n.halfedges.map(function(e){return gc(n,t[e])});return e.data=n.site.data,e})},triangles:function(){var t=[],n=this.edges;return this.cells.forEach(function(e,r){for(var i,a=e.site,o=e.halfedges,u=-1,s=o.length,l=n[o[s-1]],f=l.left===a?l.right:l.left;++u<s;)i=f,l=n[o[u]],f=l.left===a?l.right:l.left,r<i.index&&r<f.index&&Tc(a,i,f)<0&&t.push([a.data,i.data,f.data])}),t},links:function(){return this.edges.filter(function(t){return t.right}).map(function(t){return{source:t.left.data,target:t.right.data}})}};var fC=$(Oc,Ye),cC=[[-1e5,-1e5],[1e5,1e5]];fC.transform=function(t,n){var e,r,i,a,o=t.as||"path",u=n.source;for(e=Dc().x(t.x).y(t.y),t.size?e.size(t.size):e.extent(t.extent||cC),this.value=e=e(u),r=e.polygons(),i=0,a=u.length;a>i;++i)u[i][o]=r[i]?"M"+r[i].join("L")+"Z":null;return n.reflow().modifies(o)};var hC={type:"Voronoi",metadata:{modifies:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"size",type:"number",array:!0,length:2},{name:"extent",type:"array",array:!0,length:2,"default":[[-1e5,-1e5],[1e5,1e5]],content:{type:"number",array:!0,length:2}},{name:"as",type:"string","default":"path"}]};Xe(hC,Oc);var dC=Math.PI/180,pC=64,gC=2048,mC={archimedean:Fc,rectangular:jc},vC=["x","y","font","fontSize","fontStyle","fontWeight","angle"],yC=$(Bc,Ye);yC.transform=function(t,n){var e=t.modified()||n.changed(n.ADD_REM)||L(t.text)&&n.modified(t.text.fields)||L(t.font)&&n.modified(t.font.fields)||L(t.rotate)&&n.modified(t.rotate.fields)||L(t.fontSize)&&n.modified(t.fontSize.fields)||L(t.fontStyle)&&n.modified(t.fontStyle.fields)||L(t.fontWeight)&&n.modified(t.fontWeight.fields);if(e){var r,i,a,o,u=this.value,s=t.as||vC,l=t.fontSize||14;L(l)?r=t.fontSizeRange:l=U(l),r&&(i=l,a=Ba("sqrt")().domain(Hc(i,n)).range(r),l=function(t){return a(i(t))});var f=n.materialize(n.SOURCE).source;f.forEach(function(t){t[s[0]]=NaN,t[s[1]]=NaN,t[s[3]]=0}),o=u.words(f).text(t.text).size(t.size||[500,500]).padding(t.padding||1).spiral(t.spiral||"archimedean").rotate(t.rotate||0).font(t.font||"sans-serif").fontStyle(t.fontStyle||"normal").fontWeight(t.fontWeight||"normal").fontSize(l).layout();for(var c,h,d=u.size(),p=d[0]>>1,g=d[1]>>1,m=0,v=o.length;v>m;++m)c=o[m],h=c.datum,h[s[0]]=c.x+p,h[s[1]]=c.y+g,h[s[2]]=c.font,h[s[3]]=c.size,h[s[4]]=c.style,h[s[5]]=c.weight,h[s[6]]=c.rotate;return n.reflow().modifies(s)}};var _C={type:"Wordcloud",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2},{name:"font",type:"string",expr:!0,"default":"sans-serif"},{name:"fontStyle",type:"string",expr:!0,"default":"normal"},{name:"fontWeight",type:"string",expr:!0,"default":"normal"},{name:"fontSize",type:"number",expr:!0,"default":14},{name:"fontSizeRange",type:"number",array:!0,"null":!0,"default":[10,50]},{name:"rotate",type:"number",expr:!0,"default":0},{name:"text",type:"field"},{name:"spiral",type:"string",values:["archimedean","rectangular"]},{name:"padding",type:"number",expr:!0},{name:"as",type:"string",array:!0,length:7,"default":["x","y","font","fontSize","fontStyle","fontWeight","angle"]}]};Xe(_C,Bc);var xC=$(eh,Ye);xC.transform=function(t,n){if(this._dims){var e=t.modified("fields")||t.fields.some(function(t){return n.modified(t.fields)});return e?this.reinit(t,n):this.eval(t,n)}return this.init(t,n)},xC.init=function(t,n){for(var e,r,i=t.fields,a=t.query,o=this._indices={},u=this._dims=[],s=a.length,l=0;s>l;++l)e=i[l].fname,r=o[e]||(o[e]=Kc()),u.push(Qc(r,l,a[l]));return this.eval(t,n)},xC.reinit=function(t,n){var e,r,i,a,o,u,s,l,f,c=n.materialize().fork(),h=t.fields,d=t.query,p=this._indices,g=this._dims,m=this.value,v=m.curr(),y=m.prev(),_=m.all(),x=c.rem=c.add,b=c.mod,w=d.length,M={};if(y.set(v),n.rem.length&&(o=this.remove(t,n,c)),n.add.length&&m.add(n.add),n.mod.length)for(u={},a=n.mod,s=0,l=a.length;l>s;++s)u[a[s]._index]=1;for(s=0;w>s;++s)f=h[s],(!g[s]||t.modified("fields",s)||n.modified(f.fields))&&(i=f.fname,(e=M[i])||(p[i]=r=Kc(),M[i]=e=r.insert(f,n.source,0)),g[s]=Qc(r,s,d[s]).onAdd(e,v));for(s=0,l=m.data().length;l>s;++s)o[s]||(y[s]!==v[s]?x.push(s):u[s]&&v[s]!==_&&b.push(s));return m.mask=(1<<w)-1,c},xC.eval=function(t,n){var e=n.materialize().fork(),r=this._dims.length,i=0;return n.rem.length&&(this.remove(t,n,e),i|=(1<<r)-1),t.modified("query")&&!t.modified("fields")&&(i|=this.update(t,n,e)),n.add.length&&(this.insert(t,n,e),i|=(1<<r)-1),n.mod.length&&(this.modify(n,e),i|=(1<<r)-1),this.value.mask=i,e},xC.insert=function(t,n,e){var r,i,a,o=n.add,u=this.value,s=this._dims,l=this._indices,f=t.fields,c={},h=e.add,d=u.size(),p=d+o.length,g=s.length;u.resize(p,g),u.add(o);var m=u.curr(),v=u.prev(),y=u.all();for(r=0;g>r;++r)i=f[r].fname,a=c[i]||(c[i]=l[i].insert(f[r],o,d)),s[r].onAdd(a,m);for(;p>d;++d)v[d]=y,m[d]!==y&&h.push(d)},xC.modify=function(t,n){var e,r,i,a=n.mod,o=this.value,u=o.curr(),s=o.all(),l=t.mod;for(e=0,r=l.length;r>e;++e)i=l[e]._index,u[i]!==s&&a.push(i)},xC.remove=function(t,n,e){var r,i,a,o,u=this._indices,s=this.value,l=s.curr(),f=s.prev(),c=s.all(),h={},d=e.rem,p=n.rem;for(r=0,i=p.length;i>r;++r)a=p[r]._index,h[a]=1,f[a]=o=l[a],l[a]=c,o!==c&&d.push(a);for(a in u)u[a].remove(i,h);return this.reindex(n,i,h),h},xC.reindex=function(t,n,e){var r=this._indices,i=this.value;t.runAfter(function(){var t=i.remove(n,e);for(var a in r)r[a].reindex(t)})},xC.update=function(t,n,e){var r,i,a=this._dims,o=t.query,u=n.stamp,s=a.length,l=0;for(e.filters=0,i=0;s>i;++i)t.modified("query",i)&&(r=i,++l);if(1===l)l=a[r].one,this.incrementOne(a[r],o[r],e.add,e.rem);else for(i=0,l=0;s>i;++i)t.modified("query",i)&&(l|=a[i].one,this.incrementAll(a[i],o[i],u,e.add),e.rem=e.add);return l},xC.incrementAll=function(t,n,e,r){var i,a,o,u=this.value,s=u.seen(),l=u.curr(),f=u.prev(),c=t.index(),h=t.bisect(t.range),d=t.bisect(n),p=d[0],g=d[1],m=h[0],v=h[1],y=t.one;if(m>p)for(i=p,a=Math.min(m,g);a>i;++i)o=c[i],s[o]!==e&&(f[o]=l[o],s[o]=e,r.push(o)),l[o]^=y;else if(p>m)for(i=m,a=Math.min(p,v);a>i;++i)o=c[i],s[o]!==e&&(f[o]=l[o],s[o]=e,r.push(o)),l[o]^=y;if(g>v)for(i=Math.max(p,v),a=g;a>i;++i)o=c[i],s[o]!==e&&(f[o]=l[o],s[o]=e,r.push(o)),l[o]^=y;else if(v>g)for(i=Math.max(m,g),a=v;a>i;++i)o=c[i],s[o]!==e&&(f[o]=l[o],s[o]=e,r.push(o)),l[o]^=y;t.range=n.slice()},xC.incrementOne=function(t,n,e,r){var i,a,o,u=this.value,s=u.curr(),l=t.index(),f=t.bisect(t.range),c=t.bisect(n),h=c[0],d=c[1],p=f[0],g=f[1],m=t.one;if(p>h)for(i=h,a=Math.min(p,d);a>i;++i)o=l[i],s[o]^=m,e.push(o);else if(h>p)for(i=p,a=Math.min(h,g);a>i;++i)o=l[i],s[o]^=m,r.push(o);if(d>g)for(i=Math.max(h,g),a=d;a>i;++i)o=l[i],s[o]^=m,e.push(o);else if(g>d)for(i=Math.max(p,d),a=g;a>i;++i)o=l[i],s[o]^=m,r.push(o);t.range=n.slice()};var bC={type:"CrossFilter",metadata:{},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"query",type:"array",array:!0,required:!0,content:{type:"number",array:!0,length:2}}]},wC=$(rh,Ye);wC.transform=function(t,n){var e=~(t.ignore||0),r=t.filter,i=r.mask;if(0===(i&e))return n.StopPropagation;var a=n.fork(n.ALL),o=r.data(),u=r.curr(),s=r.prev(),l=function(t){return u[t]&e?null:o[t]};return a.filter(a.MOD,l),i&i-1?(a.filter(a.ADD,function(t){var n=u[t]&e,r=!n&&n^s[t]&e;return r?o[t]:null}),a.filter(a.REM,function(t){var n=u[t]&e,r=n&&!(n^(n^s[t]&e));return r?o[t]:null})):(a.filter(a.ADD,l),a.filter(a.REM,function(t){return(u[t]&e)===i?o[t]:null})),a.filter(a.SOURCE,function(t){return l(t._index)})};var MC={type:"ResolveFilter",metadata:{},params:[{name:"ignore",type:"number",required:!0,description:"A bit mask indicating which filters to ignore."},{name:"filter",type:"object",required:!0,description:"Per-tuple filter bitmaps from a CrossFilter transform."}]};Xe(bC,eh),Xe(MC,rh);var kC=ih.prototype;kC.clone=function(){return new ih(this)},kC.clear=function(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},kC.set=function(t,n,e,r){return t>e?(this.x2=t,this.x1=e):(this.x1=t,this.x2=e),n>r?(this.y2=n,this.y1=r):(this.y1=n,this.y2=r),this},kC.add=function(t,n){return t<this.x1&&(this.x1=t),n<this.y1&&(this.y1=n),t>this.x2&&(this.x2=t),n>this.y2&&(this.y2=n),this},kC.expand=function(t){return this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t,this},kC.round=function(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},kC.translate=function(t,n){return this.x1+=t,this.x2+=t,this.y1+=n,this.y2+=n,this},kC.rotate=function(t,n,e){var r=Math.cos(t),i=Math.sin(t),a=n-n*r+e*i,o=e-n*i-e*r,u=this.x1,s=this.x2,l=this.y1,f=this.y2;
return this.clear().add(r*u-i*l+a,i*u+r*l+o).add(r*u-i*f+a,i*u+r*f+o).add(r*s-i*l+a,i*s+r*l+o).add(r*s-i*f+a,i*s+r*f+o)},kC.union=function(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this},kC.encloses=function(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2},kC.alignsWith=function(t){return t&&(this.x1==t.x1||this.x2==t.x2||this.y1==t.y1||this.y2==t.y2)},kC.intersects=function(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)},kC.contains=function(t,n){return!(t<this.x1||t>this.x2||n<this.y1||n>this.y2)},kC.width=function(){return this.x2-this.x1},kC.height=function(){return this.y2-this.y1};var EC=0;uh(sh,oh);var SC;try{SC=require("canvas")}catch(CC){SC=null}var AC="undefined"!=typeof Image?Image:SC&&SC.Image||null;fh.Options={};var TC=fh.prototype;TC.pending=function(){return this._pending},TC.imageURL=function(t){return vt.sanitize(t,this._options)},TC.loadImage=function(t){var n=this.imageURL(t);if(!n||!AC)return{loaded:!1,width:0,height:0};var e=this,r=new AC;return e._pending+=1,r.onload=function(){e._pending-=1,r.loaded=!0},r.onerror=function(){e._pending-=1,r.loaded=!1},r.src=n,r},TC.ready=function(){var t=this;return new Promise(function(n){function e(r){t._pending?setTimeout(function(){e(!0)},10):n(r)}e(!1)})};var NC=ch.prototype;NC.mark=function(t,n){var e,r,i,a,o=t.marks,u=t.items,s=this.root.items[0];try{for(i=0,a=o.length;a>i&&(e=s.items[o[i]],e);++i)r=u[i]||0,s=e.items[r]||e.items[e.items.length-1];if(!e)return e=dh(n,s),s.items[o[i]]=e,e.zindex&&(e.group.zdirty=!0),e;throw a}catch(l){hh("Invalid scenegraph path: "+JSON.stringify(t))}};var zC=ph.prototype;zC.initialize=function(t,n,e){return this._el=t,this._obj=e||null,this.origin(n)},zC.element=function(){return this._el},zC.origin=function(t){return this._origin=t||[0,0],this},zC.scene=function(t){return arguments.length?(this._scene=t,this):this._scene},zC.on=function(){},zC.off=function(){},zC.handlers=function(){var t,n=this._handlers,e=[];for(t in n)e.push.apply(e,n[t]);return e},zC.eventName=function(t){var n=t.indexOf(".");return 0>n?t:t.slice(0,n)};var DC=gh.prototype;DC.initialize=function(t,n,e,r){return this._el=t,this.resize(n,e,r)},DC.element=function(){return this._el},DC.scene=function(){return this._el&&this._el.firstChild},DC.background=function(t){return 0===arguments.length?this._bgcolor:(this._bgcolor=t,this)},DC.resize=function(t,n,e){return this._width=t,this._height=n,this._origin=e||[0,0],this},DC.render=function(t,n){var e=this;return e._call=function(){e._render(t,n)},e._call(),e._call=null,e},DC._render=function(){},DC.renderAsync=function(t,n){var e=this.render(t,n);return this._ready?this._ready.then(function(){return e}):Promise.resolve(e)},DC.imageURL=function(t){return this._loader.imageURL(t)},DC.loadImage=function(t){var n=this,e=n._loader.loadImage(t);if(!n._ready){var r=n._call;n._ready=n._loader.ready().then(function(t){t&&r(),n._ready=null})}return e};var OC=Math.PI,RC=2*OC,PC=1e-6,qC=RC-PC;mh.prototype=vh.prototype={constructor:mh,moveTo:function(t,n){this._.push("M",this._x0=this._x1=+t,",",this._y0=this._y1=+n)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._.push("Z"))},lineTo:function(t,n){this._.push("L",this._x1=+t,",",this._y1=+n)},quadraticCurveTo:function(t,n,e,r){this._.push("Q",+t,",",+n,",",this._x1=+e,",",this._y1=+r)},bezierCurveTo:function(t,n,e,r,i,a){this._.push("C",+t,",",+n,",",+e,",",+r,",",this._x1=+i,",",this._y1=+a)},arcTo:function(t,n,e,r,i){t=+t,n=+n,e=+e,r=+r,i=+i;var a=this._x1,o=this._y1,u=e-t,s=r-n,l=a-t,f=o-n,c=l*l+f*f;if(0>i)throw new Error("negative radius: "+i);if(null===this._x1)this._.push("M",this._x1=t,",",this._y1=n);else if(c>PC)if(Math.abs(f*u-s*l)>PC&&i){var h=e-a,d=r-o,p=u*u+s*s,g=h*h+d*d,m=Math.sqrt(p),v=Math.sqrt(c),y=i*Math.tan((OC-Math.acos((p+c-g)/(2*m*v)))/2),_=y/v,x=y/m;Math.abs(_-1)>PC&&this._.push("L",t+_*l,",",n+_*f),this._.push("A",i,",",i,",0,0,",+(f*h>l*d),",",this._x1=t+x*u,",",this._y1=n+x*s)}else this._.push("L",this._x1=t,",",this._y1=n);else;},arc:function(t,n,e,r,i,a){t=+t,n=+n,e=+e;var o=e*Math.cos(r),u=e*Math.sin(r),s=t+o,l=n+u,f=1^a,c=a?r-i:i-r;if(0>e)throw new Error("negative radius: "+e);null===this._x1?this._.push("M",s,",",l):(Math.abs(this._x1-s)>PC||Math.abs(this._y1-l)>PC)&&this._.push("L",s,",",l),e&&(c>qC?this._.push("A",e,",",e,",0,1,",f,",",t-o,",",n-u,"A",e,",",e,",0,1,",f,",",this._x1=s,",",this._y1=l):(0>c&&(c=c%RC+RC),this._.push("A",e,",",e,",0,",+(c>=OC),",",f,",",this._x1=t+e*Math.cos(i),",",this._y1=n+e*Math.sin(i))))},rect:function(t,n,e,r){this._.push("M",this._x0=this._x1=+t,",",this._y0=this._y1=+n,"h",+e,"v",+r,"h",-e,"Z")},toString:function(){return this._.join("")}};var LC=1e-12,UC=Math.PI,FC=UC/2,jC=2*UC;Ah.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:this._context.lineTo(t,n)}}};var IC={draw:function(t,n){var e=Math.sqrt(n/UC);t.moveTo(e,0),t.arc(0,0,e,0,jC)}},$C=Math.sin(UC/10)/Math.sin(7*UC/10);Math.sin(jC/10)*$C,-Math.cos(jC/10)*$C;Lh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:qh(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:qh(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}},Fh.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,n=this._y,e=t.length-1;if(e>0)for(var r,i=t[0],a=n[0],o=t[e]-i,u=n[e]-a,s=-1;++s<=e;)r=s/e,this._basis.point(this._beta*t[s]+(1-this._beta)*(i+r*o),this._beta*n[s]+(1-this._beta)*(a+r*u));this._x=this._y=null,this._basis.lineEnd()},point:function(t,n){this._x.push(+t),this._y.push(+n)}};var WC=function qz(t){function n(n){return 1===t?new Lh(n):new Fh(n,t)}return n.beta=function(t){return qz(+t)},n}(.85);Ih.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:jh(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2,this._x1=t,this._y1=n;break;case 2:this._point=3;default:jh(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var BC=function Lz(t){function n(n){return new Ih(n,t)}return n.tension=function(t){return Lz(+t)},n}(0);$h.prototype={areaStart:Ph,areaEnd:Ph,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:jh(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}},function Uz(t){function n(n){return new $h(n,t)}return n.tension=function(t){return Uz(+t)},n}(0),Wh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:jh(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}},function Fz(t){function n(n){return new Wh(n,t)}return n.tension=function(t){return Fz(+t)},n}(0),Hh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3;default:Bh(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var HC=function jz(t){function n(n){return t?new Hh(n,t):new Ih(n,0)}return n.alpha=function(t){return jz(+t)},n}(.5);Yh.prototype={areaStart:Ph,areaEnd:Ph,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:Bh(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}},function Iz(t){function n(n){return t?new Yh(n,t):new $h(n,0)}return n.alpha=function(t){return Iz(+t)},n}(.5),Xh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Bh(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}},function $z(t){function n(n){return t?new Xh(n,t):new Wh(n,0)}return n.alpha=function(t){return $z(+t)},n}(.5),Qh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Zh(this,this._t0,Vh(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){var e=NaN;if(t=+t,n=+n,t!==this._x1||n!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3,Zh(this,Vh(this,e=Jh(this,t,n)),e);break;default:Zh(this,this._t0,e=Jh(this,t,n))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n,this._t0=e}}},(Kh.prototype=Object.create(Qh.prototype)).point=function(t,n){Qh.prototype.point.call(this,n,t)},td.prototype={moveTo:function(t,n){this._context.moveTo(n,t)},closePath:function(){this._context.closePath()},lineTo:function(t,n){this._context.lineTo(n,t)},bezierCurveTo:function(t,n,e,r,i,a){this._context.bezierCurveTo(n,t,r,e,a,i)}},rd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,n=this._y,e=t.length;if(e)if(this._line?this._context.lineTo(t[0],n[0]):this._context.moveTo(t[0],n[0]),2===e)this._context.lineTo(t[1],n[1]);else for(var r=id(t),i=id(n),a=0,o=1;e>o;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],t[o],n[o]);(this._line||0!==this._line&&1===e)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,n){this._x.push(+t),this._y.push(+n)}},od.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,n),this._context.lineTo(t,n);else{var e=this._x*(1-this._t)+t*this._t;this._context.lineTo(e,this._y),this._context.lineTo(e,n)}}this._x=t,this._y=n}};var YC,XC={basis:{curve:Uh},bundle:{curve:WC,tension:"beta",value:.85},cardinal:{curve:BC,tension:"tension",value:0},catmullRom:{curve:HC,tension:"alpha",value:.5},linear:{curve:Th},monotone:{horizontal:ed,vertical:nd},natural:{curve:ad},step:{curve:ud},stepAfter:{curve:ld},stepBefore:{curve:sd}},GC={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},JC=[/([MLHVCSQTAZmlhvcsqtaz])/g,/###/,/(\d)([-+])/g,/\s|,|###/],VC={},ZC={},QC=[].join,KC=["l",0,0,0,0,0,0,0],tA=2*Math.PI,nA=Math.sqrt(3)/2,eA={circle:{draw:function(t,n){var e=Math.sqrt(n)/2;t.moveTo(e,0),t.arc(0,0,e,0,tA)}},cross:{draw:function(t,n){var e=Math.sqrt(n)/2,r=e/2.5;t.moveTo(-e,-r),t.lineTo(-e,r),t.lineTo(-r,r),t.lineTo(-r,e),t.lineTo(r,e),t.lineTo(r,r),t.lineTo(e,r),t.lineTo(e,-r),t.lineTo(r,-r),t.lineTo(r,-e),t.lineTo(-r,-e),t.lineTo(-r,-r),t.closePath()}},diamond:{draw:function(t,n){var e=Math.sqrt(n)/2;t.moveTo(-e,0),t.lineTo(0,-e),t.lineTo(e,0),t.lineTo(0,e),t.closePath()}},square:{draw:function(t,n){var e=Math.sqrt(n),r=-e/2;t.rect(r,r,e,e)}},"triangle-up":{draw:function(t,n){var e=Math.sqrt(n)/2,r=nA*e;t.moveTo(0,-r),t.lineTo(-e,r),t.lineTo(e,r),t.closePath()}},"triangle-down":{draw:function(t,n){var e=Math.sqrt(n)/2,r=nA*e;t.moveTo(0,r),t.lineTo(-e,-r),t.lineTo(e,-r),t.closePath()}},"triangle-right":{draw:function(t,n){var e=Math.sqrt(n)/2,r=nA*e;t.moveTo(r,0),t.lineTo(-r,-e),t.lineTo(-r,e),t.closePath()}},"triangle-left":{draw:function(t,n){var e=Math.sqrt(n)/2,r=nA*e;t.moveTo(-r,0),t.lineTo(r,-e),t.lineTo(r,e),t.closePath()}}},rA={},iA=Math.PI,aA=Ch().cornerRadius(Od).padAngle(Rd),oA=Oh().x(Sd).y1(Cd).y0(Dd).defined(Pd),uA=Oh().y(Cd).x1(Sd).x0(zd).defined(Pd),sA=Dh().x(Sd).y(Cd).defined(Pd),lA=Ed().x(Sd).y(Cd).defined(Pd).size(Td),fA=kd().x(Sd).y(Cd).width(Ad).height(Nd).cornerRadius(Od),cA=Rh().type(Ld).size(qd),hA=2*Math.PI,dA=Math.PI/2;Hd.beginPath=Yd,Hd.closePath=Yd,Hd.moveTo=Xd,Hd.lineTo=Xd,Hd.rect=function(t,n,e,r){Xd(t,n),Xd(t+e,n+r)},Hd.quadraticCurveTo=function(t,n,e,r){Xd(t,n),Xd(e,r)},Hd.bezierCurveTo=function(t,n,e,r,i,a){Xd(t,n),Xd(e,r),Xd(i,a)},Hd.arc=function(t,n,e,r,i,a){function o(t){l=e*Math.cos(t),f=e*Math.sin(t),c>l&&(c=l),l>h&&(h=l),d>f&&(d=f),f>p&&(p=f)}if(e===hA)return Xd(t-e,n-e),void Xd(t+e,n+e);var u,s,l,f,c=1/0,h=-(1/0),d=1/0,p=-(1/0);if(o(r),o(i),a)for(u=i-i%dA,s=0;4>s&&u>r;++s,u-=dA)o(u);else for(u=r-r%dA,s=0;4>s&&i>u;++s,u+=dA)o(u);Xd(t+c,n+d),Xd(t+h,n+p)};var pA,gA=[],mA=function(){return!0},vA=fp("arc",Ud),yA=cp("area",Fd),_A={type:"group",tag:"g",nested:!1,attr:hp,bound:pp,draw:gp,pick:mp,background:dp},xA={type:"image",tag:"image",nested:!1,attr:xp,bound:bp,draw:wp,pick:ap()},bA=cp("line",Id),wA={type:"path",tag:"path",nested:!1,attr:Mp,bound:Ep,draw:ep(kp),pick:up(kp)},MA={type:"rect",tag:"path",nested:!1,attr:Sp,bound:Cp,draw:ep(Ap),pick:up(Ap)},kA={type:"rule",tag:"line",nested:!1,attr:Tp,bound:Np,draw:Dp,pick:ap(Op)},EA=fp("shape",jd),SA=fp("symbol",Wd),CA=(pA=lh(1,1))?(pA=pA.getContext("2d"),Pp):Rp,AA={left:"start",center:"middle",right:"end"},TA=new ih,NA={type:"text",tag:"text",nested:!1,attr:jp,bound:Ip,draw:$p,pick:ap(Wp)},zA={arc:vA,area:yA,group:_A,image:xA,line:bA,path:wA,rect:MA,rule:kA,shape:EA,symbol:SA,text:NA},DA=uh(Vp,ph);DA.initialize=function(t,n,e){var r=this._canvas=t&&Yp(t,"canvas");if(r){var i=this;this.events.forEach(function(t){r.addEventListener(t,function(n){DA[t]?DA[t].call(i,n):i.fire(t,n)})})}return ph.prototype.initialize.call(this,t,n,e)},DA.canvas=function(){return this._canvas},DA.context=function(){return this._canvas.getContext("2d")},DA.events=["keydown","keypress","keyup","dragenter","dragleave","dragover","mousedown","mouseup","mousemove","mouseout","mouseover","click","dblclick","wheel","mousewheel","touchstart","touchmove","touchend"],DA.DOMMouseScroll=function(t){this.fire("mousewheel",t)},DA.mousemove=Zp("mousemove","mouseover","mouseout"),DA.dragover=Zp("dragover","dragenter","dragleave"),DA.mouseout=Qp("mouseout"),DA.dragleave=Qp("dragleave"),DA.mousedown=function(t){this._down=this._active,this.fire("mousedown",t)},DA.click=function(t){this._down===this._active&&(this.fire("click",t),this._down=null)},DA.touchstart=function(t){this._touch=this.pickEvent(t.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire("touchstart",t,!0)},DA.touchmove=function(t){this.fire("touchmove",t,!0)},DA.touchend=function(t){this.fire("touchend",t,!0),this._touch=null},DA.fire=function(t,n,e){var r,i,a=e?this._touch:this._active,o=this._handlers[t];if(o)for(n.vegaType=t,r=0,i=o.length;i>r;++r)o[r].handler.call(this._obj,n,a)},DA.on=function(t,n){var e=this.eventName(t),r=this._handlers;return(r[e]||(r[e]=[])).push({type:t,handler:n}),this},DA.off=function(t,n){var e,r=this.eventName(t),i=this._handlers[r];if(i){for(e=i.length;--e>=0;)i[e].type===t&&(n&&i[e].handler!==n||i.splice(e,1));return this}},DA.pickEvent=function(t){var n=Bp(t,this._canvas),e=this._origin;return this.pick(this._scene,n[0],n[1],n[0]-e[0],n[1]-e[1])},DA.pick=function(t,n,e,r,i){var a=this.context(),o=zA[t.marktype];return o.pick.call(this,a,t,n,e,r,i)};var OA="undefined"!=typeof window?window.devicePixelRatio||1:1,RA=uh(tg,gh),PA=gh.prototype,qA=new ih;RA.initialize=function(t,n,e,r){return this._canvas=lh(1,1),t&&(Gp(t,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),PA.initialize.call(this,t,n,e,r)},RA.resize=function(t,n,e){return PA.resize.call(this,t,n,e),Kp(this._canvas,this._width,this._height,this._origin),this._redraw=!0,this},RA.canvas=function(){return this._canvas},RA.context=function(){return this._canvas?this._canvas.getContext("2d"):null},RA._render=function(t,n){var e,r=this.context(),i=this._origin,a=this._width,o=this._height;return r.save(),e=!n||this._redraw?(this._redraw=!1,null):ng(r,n),this.clear(-i[0],-i[1],a,o),this.draw(r,t,e),r.restore(),this},RA.draw=function(t,n,e){var r=zA[n.marktype];r.draw.call(this,t,n,e)},RA.clear=function(t,n,e,r){var i=this.context();i.clearRect(t,n,e,r),null!=this._bgcolor&&(i.fillStyle=this._bgcolor,i.fillRect(t,n,e,r))};var LA=uh(rg,ph);LA.initialize=function(t,n,e){return this._svg=t&&Yp(t,"svg"),ph.prototype.initialize.call(this,t,n,e)},LA.svg=function(){return this._svg},LA.listener=function(t){var n=this;return function(e){var r=e.target,i=r.__data__;e.vegaType=e.type,i=Array.isArray(i)?i[0]:i,t.call(n._obj,e,i)}},LA.on=function(t,n){var e=this.eventName(t),r=this._handlers,i={type:t,handler:n,listener:this.listener(n)};return(r[e]||(r[e]=[])).push(i),this._svg&&this._svg.addEventListener(e,i.listener),this},LA.off=function(t,n){var e,r=this.eventName(t),i=this._svg,a=this._handlers[r];if(a){for(e=a.length;--e>=0;)(a[e].type===t&&!n||a[e].handler===n)&&(this._svg&&i.removeEventListener(r,a[e].listener),a.splice(e,1));return this}};var UA={version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},FA={fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeWidth:"stroke-width",strokeOpacity:"stroke-opacity",strokeCap:"stroke-linecap",strokeDash:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",opacity:"opacity"},jA=Object.keys(FA),IA=UA.xmlns,$A=uh(og,gh),WA=gh.prototype;$A.initialize=function(t,n,e,r){return t&&(this._svg=Xp(t,0,"svg",IA),this._svg.setAttribute("class","marks"),Gp(t,1),this._root=Xp(this._svg,0,"g",IA),Gp(this._svg,1)),this._defs={clip_id:1,gradient:{},clipping:{}},this.background(this._bgcolor),WA.initialize.call(this,t,n,e,r)},$A.background=function(t){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",t),WA.background.apply(this,arguments)},$A.resize=function(t,n,e){return WA.resize.call(this,t,n,e),this._svg&&(this._svg.setAttribute("width",this._width),this._svg.setAttribute("height",this._height),this._root.setAttribute("transform","translate("+this._origin+")")),this},$A.svg=function(){if(!this._svg)return null;var t={"class":"marks",width:this._width,height:this._height};for(var n in UA)t[n]=UA[n];return ig("svg",t)+this._svg.innerHTML+ag("svg")},$A._render=function(t,n){return this._dirtyCheck(n)&&(this._dirtyAll&&this._resetDefs(),this.draw(this._root,t),Gp(this._root,1)),this.updateDefs(),this},$A.updateDefs=function(){var t,n=this._svg,e=this._defs,r=e.el,i=0;for(t in e.gradient)r||(e.el=r=Xp(n,0,"defs",IA)),ug(r,e.gradient[t],i++);for(t in e.clipping)r||(e.el=r=Xp(n,0,"defs",IA)),sg(r,e.clipping[t],i++);r&&(0===i?(n.removeChild(r),e.el=null):Gp(r,i))},$A._resetDefs=function(){var t=this._defs;t.clip_id=1,t.gradient={},t.clipping={}},$A.isDirty=function(t){return this._dirtyAll||!t._svg||t.dirty===this._dirtyID},$A._dirtyCheck=function(t){if(this._dirtyAll=!0,!t)return!0;var n,e,r,i,a,o,u,s=++this._dirtyID;for(a=0,o=t.length;o>a;++a)n=t[a],e=n.mark,e.marktype!==r&&(r=e.marktype,i=zA[r]),e.zdirty&&e.dirty!==s&&(this._dirtyAll=!1,e.dirty=s,lg(e.group,s)),n.exit?(i.nested&&e.items.length?(u=e.items[0],u._svg&&this._update(i,u._svg,u)):n._svg&&n._svg.remove(),n._svg=null):(n=i.nested?e.items[0]:n,n._update!==s&&(n._svg&&n._svg.ownerSVGElement?this._update(i,n._svg,n):(this._dirtyAll=!1,lg(n,s)),n._update=s));return!this._dirtyAll},$A.draw=function(t,n,e){function r(t){var n=a.isDirty(t),e=cg(t,i,l,o.tag);n&&(a._update(o,e,t),s&&fg(a,e,t)),l=e,++f}if(!this.isDirty(n))return n._svg;var i,a=this,o=zA[n.marktype],u=n.interactive===!1?"none":null,s="g"===o.tag,l=null,f=0;return i=cg(n,t,e,"g"),i.setAttribute("class",Jp(n)),!s&&u&&i.style.setProperty("pointer-events",u),o.nested?n.items.length&&r(n.items[0]):tp(n,r),Gp(i,f),i};var BA=null,HA=null,YA={group:function(t,n,e){BA=n.childNodes[0],HA=n.__values__,t.background(hg,e,this);var r=e.mark.interactive===!1?"none":null;r!==HA.events&&(BA.style.setProperty("pointer-events",r),HA.events=r)},text:function(t,n,e){var r=Lp(e.text);r!==HA.text&&(n.textContent=r,HA.text=r),r=Up(e),r!==HA.font&&(n.style.setProperty("font",r),HA.font=r)}};$A._update=function(t,n,e){BA=n,HA=n.__values__,t.attr(hg,e,this);var r=YA[t.type];r&&r(t,n,e),this.style(BA,e)},$A.style=function(t,n){if(null!=n){var e,r,i,a,o;for(e=0,r=jA.length;r>e;++e)i=jA[e],o=n[i],o!==HA[i]&&(a=FA[i],null==o?"fill"===a?t.style.setProperty(a,"none"):t.style.removeProperty(a):(o.id&&(this._defs.gradient[o.id]=o,o="url("+dg()+"#"+o.id+")"),t.style.setProperty(a,o+"")),HA[i]=o)}};var XA=uh(pg,gh),GA=gh.prototype;XA.resize=function(t,n,e){GA.resize.call(this,t,n,e);var r=this._origin,i=this._text,a={"class":"marks",width:this._width,height:this._height};for(var o in UA)a[o]=UA[o];return i.head=ig("svg",a),i.root=ig("g",{transform:"translate("+r+")"}),i.foot=ag("g")+ag("svg"),this},XA.svg=function(){var t=this._text;return t.head+t.defs+t.root+t.body+t.foot},XA._render=function(t){return this._text.body=this.mark(t),this._text.defs=this.buildDefs(),this},XA.reset=function(){return this._defs.clip_id=0,this},XA.buildDefs=function(){var t,n,e,r,i=this._defs,a="";for(n in i.gradient){for(e=i.gradient[n],r=e.stops,a+=ig("linearGradient",{id:n,x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2}),t=0;t<r.length;++t)a+=ig("stop",{offset:r[t].offset,"stop-color":r[t].color})+ag("stop");a+=ag("linearGradient")}for(n in i.clipping)e=i.clipping[n],a+=ig("clipPath",{id:n}),a+=ig("rect",{x:0,y:0,width:e.width,height:e.height})+ag("rect"),a+=ag("clipPath");return a.length>0?ig("defs")+a+ag("defs"):""};var JA;XA.attributes=function(t,n){return JA={},t(gg,n,this),JA},XA.mark=function(t){function n(n){e="g"!==a?mg(n,t,a,o):null,u+=ig(a,r.attributes(i.attr,n),e),"text"===a?u+=vg(Lp(n.text)):"g"===a&&(u+=ig("path",r.attributes(i.background,n),mg(n,t,"bgrect",o))+ag("path"),u+=r.markGroup(n)),u+=ag(a)}var e,r=this,i=zA[t.marktype],a=i.tag,o=this._defs,u="";return"g"!==a&&t.interactive===!1&&(e='style="pointer-events: none;"'),u+=ig("g",{"class":Jp(t)},e),i.nested?t.items&&t.items.length&&n(t.items[0]):tp(t,n),u+ag("g")},XA.markGroup=function(t){var n=this,e="";return tp(t,function(t){e+=n.mark(t)}),e};var VA=$(_g,Ye);VA.transform=function(t,n){var e,r=t.mark,i=zA[r.marktype],a=i.bound,o=r.bounds;return r.bounds_prev.clear().union(o),i.nested?xg(r,a):t.modified()?(o.clear(),r.items.forEach(function(t){o.union(xg(t,a))})):(e=n.changed(n.REM),n.visit(n.ADD,function(t){o.union(xg(t,a))}),n.visit(n.MOD,function(t){e=e||o.alignsWith(t.bounds),o.union(xg(t,a))}),e&&(o.clear(),r.items.forEach(function(t){o.union(t.bounds)}))),n.modifies("bounds")};var ZA=$(bg,Ye);ZA.transform=function(t,n){var e=this.value;e||(e=n.dataflow.scenegraph().mark(t.scenepath,t.markdef),e.source=this,this.value=e,e.group.context=t.scenepath.context);var r="group"===e.marktype?sh:oh;return n.visit(n.ADD,function(t){r.call(t,e)}),e.items=n.source,n};var QA=$(wg,Ye);QA.transform=function(t,n){var e=n.dataflow;if(n.changed(n.REM)&&e.enqueue(n.materialize(n.REM).rem),n.changed(n.ADD)&&e.enqueue(n.materialize(n.ADD).add),n.changed(n.MOD)&&e.enqueue(n.materialize(n.MOD).mod),n.fields&&n.fields.zindex){var r=n.source&&n.source[0];r&&(r.mark.zdirty=!0)}};var KA="fit",tT="pad",nT="none",eT="axis",rT="frame",iT="legend",aT="scope",oT=$(Mg,Ye);oT.transform=function(t,n){var e=n.dataflow;return t.mark.items.forEach(function(n){kg(e,n,t)}),n};var uT="vega-bind",sT="vega-bind-name",lT="vega-bind-radio",fT="vega-option-",cT="default",hT="canvas",dT="png",pT="svg",gT="none",mT=[{key:"$ref",parse:ym},{key:"$key",parse:xm},{key:"$expr",parse:_m},{key:"$field",parse:bm},{key:"$encode",parse:Mm},{key:"$compare",parse:wm},{key:"$subflow",parse:km},{key:"$itempath",parse:Em}];Dm.prototype=Om.prototype={fork:function(t){return new Om(this,t)},get:function(t){return this.nodes[t]},set:function(t,n){return this.nodes[t]=n},add:function(t,n){var e,r=this,i=r.dataflow;if(r.set(t.id,n),"Collect"===t.type&&(e=t.value)&&(e.$ingest?i.ingest(n,e.$ingest,e.$format):e.$request?i.request(n,e.$request,e.$format):i.pulse(n,i.changeset().insert(e))),t.root&&(r.root=n),t.parent){var a=r.get(t.parent.$ref);i.connect(a,[n]),n.targets().add(a)}if(t.signal&&(r.signals[t.signal]=n),t.scale&&(r.scales[t.scale]=n),t.data)for(var o in t.data)e=r.data[o]||(r.data[o]={}),t.data[o].forEach(function(t){e[t]=n})},operator:function(t,n,e){this.add(t,this.dataflow.add(t.value,n,e,t.react))},transform:function(t,n,e){this.add(t,this.dataflow.add(this.transforms[n],e))},stream:function(t,n){this.set(t.id,n)},update:function(t,n,e,r,i){this.dataflow.on(n,e,r,i,t.options)}};var vT=$(jm,Be);vT.run=function(t){Be.prototype.run.call(this,t);var n=this._queue;return(this._resize||!n||n.length)&&(this.render(n),this._queue=[]),this},vT.render=function(t){return this._renderer&&(this._resize&&(this._resize=0,Yg(this)),this._renderer.render(this._scenegraph.root,t)),this},vT.enqueue=function(t){this._queue&&t&&t.length&&(this._queue=this._queue.concat(t))},vT.signal=function(t,n,e){var r=this._signals[t];return 1===arguments.length?r?r.value:void 0:this.update(r,n,e)},vT.scenegraph=function(){return this._scenegraph},vT.background=function(t){return arguments.length?(this._background=t,this._resize=1,this):this._background},vT.width=function(t){return arguments.length?this.signal("width",t):this.signal("width")},vT.height=function(t){return arguments.length?this.signal("height",t):this.signal("height")},vT.padding=function(t){return arguments.length?this.signal("padding",t):this.signal("padding")},vT.renderer=function(t){return arguments.length?(t!==pT&&t!==gT&&(t=hT),t!==this._renderType&&(this._renderType=t,this._renderer&&(this._renderer=this._queue=null,this.initialize(this._el))),this):this._renderType},vT.autosize=Um,vT.data=jg,vT.insert=Ig,vT.remove=$g,vT.initialize=rm,vT.toImageURL=am,vT.toCanvas=om,vT.toSVG=um,vT.events=Jg,vT.finalize=tm,vT.hover=Kg,vT.bind=Ag,vT.state=Fm,Je("Bound",_g),Je("Mark",bg),Je("Render",wg),Je("ViewLayout",Mg),Wm.prototype.visit=function(t){var n,e,r,i=this;if(t(i))return 1;for(n=Bm(i),e=0,r=n.length;r>e;++e)if(n[e].visit(t))return 1};var yT,_T,xT,bT,wT=1,MT=2,kT=3,ET=4,ST=5,CT=6,AT=7,TT=8,NT="ArrayExpression",zT="BinaryExpression",DT="CallExpression",OT="ConditionalExpression",RT="Identifier",PT="Literal",qT="LogicalExpression",LT="MemberExpression",UT="ObjectExpression",FT="Property",jT="UnaryExpression",IT="Unexpected token %0",$T="Unexpected number",WT="Unexpected string",BT="Unexpected identifier",HT="Unexpected reserved word",YT="Unexpected end of input",XT="Invalid regular expression",GT="Invalid regular expression: missing /",JT="Octal literals are not allowed in strict mode.",VT="Duplicate data property in object literal not allowed in strict mode",ZT="ILLEGAL",QT="Disabled.",KT=new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠ-ࢲऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞭꞰꞱꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭟꭤꭥꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),tN=new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԯԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠ-ࢲࣤ-ॣ०-९ॱ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఀ-ఃఅ-ఌఎ-ఐఒ-నప-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಁ-ಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲഁ-ഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟ෦-෯ෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤞᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧ᪰-᪽ᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶ᳸᳹ᴀ-᷵᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‌‍‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚝꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞭꞰꞱꟷ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꧠ-ꧾꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭟꭤꭥꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︭︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),nN={
"if":1,"in":1,"do":1,"var":1,"for":1,"new":1,"try":1,let:1,"this":1,"else":1,"case":1,"void":1,"with":1,"enum":1,"while":1,"break":1,"catch":1,"throw":1,"const":1,"yield":1,"class":1,"super":1,"return":1,"typeof":1,"delete":1,"switch":1,"export":1,"import":1,"public":1,"static":1,"default":1,"finally":1,"extends":1,"package":1,"private":1,"function":1,"continue":1,"debugger":1,"interface":1,"protected":1,"instanceof":1,"implements":1},eN={"if":1,"this":1},rN={NaN:"NaN",E:"Math.E",LN2:"Math.LN2",LN10:"Math.LN10",LOG2E:"Math.LOG2E",LOG10E:"Math.LOG10E",PI:"Math.PI",SQRT1_2:"Math.SQRT1_2",SQRT2:"Math.SQRT2"},iN="Literal",aN="Identifier",oN="$",uN="%",sN="@",lN="event.vega.",fN=function(t){var n=Zv(t);return n.view=lN+"view",n.item=lN+"item",n.group=lN+"group",n.xy=lN+"xy",n.x=lN+"x",n.y=lN+"y",n.encode="this.encode",n.modify="this.modify",n.format="this.format",n.timeFormat="this.timeFormat",n.utcFormat="this.utcFormat",n.pad="this.pad",n.truncate="this.truncate",n.rgb="this.rgb",n.lab="this.lab",n.hcl="this.hcl",n.hsl="this.hsl",n.gradient="this.gradient",n.copy="this.scaleCopy",n.bandwidth="this.bandwidth",n.indata="this.indata",n.inrange="this.inrange",n.invert="this.scaleInvert",n.range="this.range",n.scale="this.scale",n.span="this.span",n.clampRange="this.clampRange",n.pinchDistance="this.pinchDistance",n.pinchAngle="this.pinchAngle",n.open="this.open",n.screen=function(){return"window.screen"},n.windowsize=function(){return"[window.innerWidth, window.innerHeight]"},n},cN=Qv({blacklist:["_"],whitelist:["datum","event"],fieldvar:"datum",globalvar:Kv,functions:fN,constants:rN}),hN="group",dN="rect",pN="rule",gN="symbol",mN="text",vN=J(["*","arc","area","group","image","line","path","rect","rule","shape","symbol","text"]),yN="[",_N="]",xN="{",bN="}",wN=":",MN=",",kN=">",EN=/[\[\]\{\}]/,SN="view",CN="var datum=event.item&&event.item.datum;",AN=J(["rule"]),TN="mark",NN="frame",zN="scope",DN="axis",ON="axis-domain",RN="axis-grid",PN="axis-label",qN="axis-tick",LN="axis-title",UN="legend",FN="legend-entry",jN="legend-gradient",IN="legend-label",$N="legend-symbol",WN="legend-title",BN="top",HN="left",YN="right",XN="bottom",GN="index",JN="label",VN="perc",ZN="size",QN="total",KN="value",tz="datum."+VN+'<=0?"left":datum.'+VN+'>=1?"right":"center"',nz=r_("key"),ez="ascending",rz="descending",iz=l_("Aggregate"),az=l_("AxisTicks"),oz=l_("Bound"),uz=l_("Collect"),sz=l_("Compare"),lz=l_("DataJoin"),fz=l_("Encode"),cz=l_("Facet"),hz=l_("Field"),dz=l_("Key"),pz=l_("LegendEntries"),gz=l_("Mark"),mz=l_("MultiExtent"),vz=l_("MultiValues"),yz=l_("Params"),_z=l_("PreFacet"),xz=l_("Projection"),bz=l_("Relay"),wz=l_("Render"),Mz=l_("Scale"),kz=l_("Sieve"),Ez=l_("ViewLayout"),Sz=l_("Values");k_.fromEntries=function(t,n){var e=n.length,r=1,i=n[0],a=n[e-1],o=n[e-2];for(t.add(n[0]);e>r;++r)n[r].params.pulse=e_(n[r-1]),t.add(n[r]);return new k_(t,i,o,a)};var Cz=k_.prototype;Cz.countsRef=function(t,n,e){var r,i,a,o=this,u=o.counts||(o.counts={}),s=E_(n);return null!=s&&(t=o.scope,r=u[s]),r?e&&e.field&&S_(t,r.agg.params,e):(a={groupby:t.fieldRef(n,"key"),pulse:e_(o.output)},e&&e.field&&S_(t,a,e),i=t.add(iz(a)),r=t.add(uz({pulse:e_(i)})),r={agg:i,ref:e_(r)},null!=s&&(u[s]=r)),r.ref},Cz.extentRef=function(t,n){return C_(t,this,"extent","Extent",n,!1)},Cz.domainRef=function(t,n){return C_(t,this,"domain","Values",n,!1)},Cz.valuesRef=function(t,n,e){return C_(t,this,"vals","Values",n,e||!0)},Cz.lookupRef=function(t,n){return C_(t,this,"lookup","TupleIndex",n,!1)},Cz.indataRef=function(t,n){return C_(t,this,"indata","TupleIndex",n,!0,!0)};var Az=["identity","ordinal","band","point","index","linear","pow","sqrt","log","sequential","time","utc","quantize","quantile","threshold"],Tz=J(Az),Nz=J(Az.slice(1,5)),zz=J(["width","height","padding"]),Dz=ux.prototype=sx.prototype;Dz.fork=function(){return new sx(this)},Dz.toRuntime=function(){return this.finish(),{background:this.background,operators:this.operators,streams:this.streams,updates:this.updates,bindings:this.bindings}},Dz.id=function(){return(this._subid?this._subid+":":0)+this._id++},Dz.add=function(t){return this.operators.push(t),t.id=this.id(),t},Dz.addStream=function(t){return this.streams.push(t),t.id=this.id(),t},Dz.addUpdate=function(t){return this.updates.push(t),t},Dz.finish=function(){function t(t,n,e){var r,i;t&&(r=t.data||(t.data={}),i=r[n]||(r[n]=[]),i.push(e))}var n,e;this.root&&(this.root.root=!0);for(n in this.signals)this.signals[n].signal=n;for(n in this.scales)this.scales[n].scale=n;for(n in this.data){e=this.data[n],t(e.input,n,"input"),t(e.output,n,"output"),t(e.values,n,"values");for(var r in e.index)t(e.index[r],n,"index:"+r)}return this},Dz.pushState=function(t,n){this._encode.push(e_(this.add(kz({pulse:t})))),this._parent.push(n),this._markpath.push(-1)},Dz.popState=function(){this._parent.pop(),this._encode.pop(),this._markpath.pop()},Dz.parent=function(){return G(this._parent)},Dz.encode=function(){return G(this._encode)},Dz.markpath=function(){var t=this._markpath;return++t[t.length-1],t.slice()},Dz.fieldRef=function(t,n){if(N(t))return r_(t,n);t.signal||t.expr||F("Unsupported field reference: "+JSON.stringify(t));var e,r,i,a,o=this.field[t.signal||t.expr];return o||(t.expr?(i=ry(r=t.expr,this),a=this.add(n_(null,i.$params)),a.update=i.$expr,e={name:e_(a)}):e={name:e_(this.signals[r=t.signal])},n&&(e.as=n),this.field[r]=o=e_(this.add(hz(e)))),o},Dz.compareRef=function(t){function n(t){return s_(t)?(r=!0,e_(e[t.signal])):t}var e=this.signals,r=!1,i=P(t.field).map(n),a=P(t.order).map(n);return r?e_(this.add(sz({fields:i,orders:a}))):i_(i,a)},Dz.keyRef=function(t){function n(t){return s_(t)?(r=!0,e_(e[t.signal])):t}var e=this.signals,r=!1;return t=P(t).map(n),r?e_(this.add(dz({fields:t}))):a_(t)},Dz.sortRef=function(t){if(!t)return t;var n=[u_(t.op,t.field),"_id"],e=t.order||ez;return e.signal?e_(this.add(sz({fields:n,orders:[e=this.signalRef(e.signal),e]}))):i_(n,[e,e])},Dz.event=function(t,n){var e=t+":"+n;if(!this.events[e]){var r=this.id();this.streams.push({id:r,source:t,type:n}),this.events[e]=r}return this.events[e]},Dz.addSignal=function(t,n){this.signals.hasOwnProperty(t)&&F("Duplicate signal name: "+t);var e=n instanceof Ky?n:this.add(n_(n));return this.signals[t]=e},Dz.getSignal=function(t){return this.signals[t]||F("Unrecognized signal name: "+t),this.signals[t]},Dz.signalRef=function(t){return e_(this.getSignal(t))},Dz.property=function(t){return t&&t.signal?this.signalRef(t.signal):t},Dz.addBinding=function(t,n){this.bindings||F("Nested signals do not support binding."),this.bindings.push(j({signal:t},n))},Dz.addScaleProj=function(t,n){this.scales.hasOwnProperty(t)&&F("Duplicate scale or projection name: "+t),this.scales[t]=this.add(n)},Dz.addScale=function(t,n){this.addScaleProj(t,Mz(n))},Dz.addProjection=function(t,n){this.addScaleProj(t,xz(n))},Dz.getScale=function(t){return this.scales[t]||F("Unrecognized scale name: "+t),this.scales[t]},Dz.projectionRef=Dz.scaleRef=function(t){return e_(this.getScale(t))},Dz.projectionType=Dz.scaleType=function(t){return this.getScale(t).params.type},Dz.addData=function(t,n){this.data.hasOwnProperty(t)&&F("Duplicate data set name: "+t),this.data[t]=n},Dz.getData=function(t){return this.data[t]||F("Undefined data set name: "+t),this.data[t]},Dz.addDataPipeline=function(t,n){this.data.hasOwnProperty(t)&&F("Duplicate data set name: "+t),this.addData(t,k_.fromEntries(this,n))},t.load=vt,t.Dataflow=Be,t.EventStream=ve,t.Parameters=ce,t.Pulse=Ee,t.MultiPulse=Pe,t.Operator=de,t.Transform=Ye,t.changeset=fe,t.ingest=ae,t.register=Xe,t.definition=Ge,t.definitions=Gb,t.transform=Je,t.transforms=Xb,t.tupleid=re,t.scale=Ba,t.scheme=$a,t.projection=Yu,t.View=jm,t.parse=cx,t.runtime=Nm,t.runtimeContext=zm,t.bin=n,t.bootstrapCI=_,t.randomInteger=x,t.randomNormal=b,t.randomUniform=w,t.quartiles=M,t.accessor=k,t.accessorName=E,t.accessorFields=S,t.id=xx,t.identity=bx,t.zero=wx,t.one=Mx,t.truthy=kx,t.falsy=Ex,t.logger=R,t.None=Sx,t.Warn=Cx,t.Info=Ax,t.Debug=Tx,t.array=P,t.compare=q,t.constant=U,t.error=F,t.extend=j,t.extentIndex=I,t.field=D,t.inherits=$,t.isArray=yx,t.isFunction=L,t.isNumber=W,t.isObject=T,t.isString=N,t.key=B,t.merge=H,t.pad=X,t.peek=G,t.repeat=Y,t.splitAccessPath=C,t.stringValue=z,t.toSet=J,t.truncate=V,t.visitArray=Z,Object.defineProperty(t,"__esModule",{value:!0})});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment