Created
September 12, 2017 22:53
-
-
Save biovisualize/c927fc7d84e6413c09aefeac04ee52a2 to your computer and use it in GitHub Desktop.
MapD3 early example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<link rel="stylesheet" href="mapd3.min.css"> | |
</head><body> | |
<div class="chart1"></div> | |
<div class="chart2"></div> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.5.0/d3.min.js"></script> | |
<script src="mapd3.min.js"></script> | |
<script> | |
const dataManager = mapd3.dataManager() | |
const data = dataManager.generateTestDataset() | |
const observer = mapd3.observer(dataManager) | |
const colors = mapd3.colors.mapdColors | |
const chartNode1 = document.querySelector(".chart1") | |
const chart1 = mapd3.line(chartNode1) | |
.setConfig({ | |
width: 800, | |
height: 400, | |
margin: { | |
top: 8, | |
right: 32, | |
bottom: 32, | |
left: 32 | |
}, | |
grid: "horizontal", | |
xAxisFormat: "%x", | |
yAxisFormat: ".1f", | |
yTicks: 5, | |
colorSchema: colors | |
}) | |
.setData(data) | |
mapd3.tooltip(chart1) | |
const chart2 = mapd3.line(".chart2") | |
.setConfig({ | |
width: 800, | |
height: 100, | |
margin: { | |
top: 8, | |
right: 32, | |
bottom: 32, | |
left: 32 | |
}, | |
grid: "horizontal", | |
xAxisFormat: "%x", | |
yAxisFormat: ".1f", | |
yTicks: 3, | |
colorSchema: colors | |
}) | |
.setData(data) | |
mapd3.brush(chart2) | |
.on("brushMove", (e) => { | |
observer.pub("brushChange", e) | |
}) | |
observer.sub("dataFilter", (_data) => { | |
chart1.setData(_data) | |
}) | |
</script> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@font-face{font-family:Karla,sans-serif;src:url(https://fonts.googleapis.com/css?family=Karla) format("opentype");font-weight:300}.mapd3{font-family:Karla,sans-serif;-webkit-font-smoothing:antialiased}.horizontal-grid-line,.vertical-grid-line{fill:none;shape-rendering:crispEdges;stroke:#eff2f5;stroke-width:1;stroke-dasharray:4,4}.extended-x-line,.extended-y-line{fill:none;shape-rendering:crispEdges;stroke:#d2d6df;stroke-width:1}.tick line{fill:none;stroke:#adb0b6;stroke-width:1;shape-rendering:crispEdges}.tick text{font-size:1rem;fill:#666a73;padding:12px}.x-axis-label,.y-axis-label{font-size:1rem;fill:#adb0b6}.vertical-marker-container .vertical-marker{stroke:#d2d6df;stroke-width:1;fill:none}.vertical-marker-container .data-point-highlighter{fill:#fff;stroke-width:2}.tooltip-background{fill:rgba(255,255,255,.97);stroke:#d2d6df;stroke-width:1;border-radius:2px}.tooltip-divider,.tooltip-text-container{fill:#fff;fill-opacity:.8;stroke:#eee;stroke-width:1;pointer-events:none}.mapd3-legend .legend-entry.is-faded .legend-circle,.mapd3-legend .legend-entry.is-faded .legend-entry-name,.mapd3-legend .legend-entry.is-faded .legend-entry-value{opacity:.97;transition:opacity .2s ease-out;-moz-transition:opacity .2s ease-out;-webkit-transition:opacity .2s ease-out}.mapd3-legend .legend-entry.is-faded .legend-circle,.mapd3-legend .legend-entry.is-faded .legend-entry-name,.mapd3-legend .legend-entry.is-faded .legend-entry-value{opacity:.2}.line-chart .topic .line{fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}.line-chart .x.axis path,.line-chart .y.axis path{display:none}.line-chart .month-axis path{display:none}.line-chart .masking-rectangle{fill:#fff}.line-chart .x.axis text,.line-chart .y.axis text{font-size:.8em}.line-chart .line-chart .y.axis path,.line-chart .x.axis path{display:block;stroke:#adb0b6}.line-chart .series .line{stroke-width:1.5px}.line-chart .horizontal-grid-line,.line-chart .vertical-grid-line{stroke-dasharray:none}.line-chart .line{fill:none}.line-chart .series .group-2{stroke-dasharray:5;stroke-width:1px}.brush-chart .brush-area{fill:#eff2f5}.brush-chart rect.brush-rect.selection{fill-opacity:.08;fill:url(#brush-area-gradient);stroke-linejoin:round}.brush-chart rect.brush-rect.handle{fill:#00d8d2;width:.2rem}.brush-chart .axis path{display:none}.brush-group .selection{fill:#22a7f0}.brush-group .handle{fill:#eee} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!function(n,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.mapd3=e():n.mapd3=e()}(this,function(){return function(n){function e(a){if(t[a])return t[a].exports;var r=t[a]={exports:{},id:a,loaded:!1};return n[a].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var t={};return e.m=n,e.c=t,e.p="",e(0)}([function(module,exports,__webpack_require__){eval('"use strict";\n\nObject.defineProperty(exports, "__esModule", {\n value: true\n});\nexports.colors = exports.brush = exports.observer = exports.dataManager = exports.tooltip = exports.line = undefined;\n\nvar _line = __webpack_require__(1);\n\nvar _line2 = _interopRequireDefault(_line);\n\nvar _tooltip = __webpack_require__(23);\n\nvar _tooltip2 = _interopRequireDefault(_tooltip);\n\nvar _dataManager = __webpack_require__(24);\n\nvar _dataManager2 = _interopRequireDefault(_dataManager);\n\nvar _observer = __webpack_require__(26);\n\nvar _observer2 = _interopRequireDefault(_observer);\n\nvar _brush = __webpack_require__(27);\n\nvar _brush2 = _interopRequireDefault(_brush);\n\nvar _colors = __webpack_require__(17);\n\nvar _colors2 = _interopRequireDefault(_colors);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.line = _line2.default;\nexports.tooltip = _tooltip2.default;\nexports.dataManager = _dataManager2.default;\nexports.observer = _observer2.default;\nexports.brush = _brush2.default;\nexports.colors = _colors2.default;\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/bundle.js\n// module id = 0\n// module chunks = 0\n//# sourceURL=webpack:///./src/bundle.js?')},function(module,exports,__webpack_require__){eval('var __WEBPACK_AMD_DEFINE_RESULT__;"use strict";\n\n!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require) {\n "use strict";\n\n var d3Array = __webpack_require__(2);\n var d3Axis = __webpack_require__(3);\n var d3Collection = __webpack_require__(4);\n var d3Dispatch = __webpack_require__(5);\n var d3Ease = __webpack_require__(6);\n var d3Scale = __webpack_require__(7);\n var d3Shape = __webpack_require__(13);\n var d3Selection = __webpack_require__(15);\n var d3TimeFormat = __webpack_require__(12);\n var d3Format = __webpack_require__(10);\n\n var _require = __webpack_require__(16),\n exportChart = _require.exportChart;\n\n var colorHelper = __webpack_require__(17);\n\n var _require2 = __webpack_require__(18),\n keys = _require2.keys;\n\n var _require3 = __webpack_require__(22),\n cloneData = _require3.cloneData;\n\n /**\n * @typedef D3Selection\n * @type {Array[]}\n * @property {Number} length Size of the selection\n * @property {DOMElement} parentNode Parent of the selection\n */\n\n /**\n * @typedef lineChartDataByTopic\n * @type {Object}\n * @property {String} topicName Topic name (required)\n * @property {Number} topic Topic identifier (required)\n * @property {Object[]} dates All date entries with values for that topic (required)\n *\n * @example\n * {\n * topicName: "San Francisco",\n * topic: 123,\n * dates: [\n * {\n * date: "2017-01-16T16:00:00-08:00",\n * value: 1\n * },\n * {\n * date: "2017-01-16T17:00:00-08:00",\n * value: 2\n * }\n * ]\n * }\n */\n\n /**\n * @typedef LineChartData\n * @type {Object[]}\n * @property {lineChartDataByTopic[]} dataBySeries Data values to chart (required)\n *\n * @example\n * {\n * dataBySeries: [\n * {\n * topicName: "San Francisco",\n * topic: 123,\n * dates: [\n * {\n * date: "2017-01-16T16:00:00-08:00",\n * value: 1\n * },\n * {\n * date: "2017-01-16T17:00:00-08:00",\n * value: 2\n * }\n * ]\n * },\n * {\n * topicName: "Other",\n * topic: 345,\n * dates: [\n * {...},\n * {...}\n * ]\n * }\n * ]\n * }\n */\n\n /**\n * Line Chart reusable API module that allows us\n * rendering a multi line and configurable chart.\n *\n * @module Line\n * @tutorial line\n * @requires d3-array, d3-axis, d3-brush, d3-ease, d3-format, d3-scale, d3-shape, d3-selection, d3-time, d3-time-format\n *\n * @example\n * let lineChart = line()\n *\n * lineChart\n * .aspectRatio(0.5)\n * .width(500)\n *\n * d3Selection.select(".css-selector")\n * .datum(dataset)\n * .call(lineChart)\n *\n */\n\n\n return function mapdLine(_container) {\n\n var config = {\n margin: {\n top: 48,\n right: 32,\n bottom: 48,\n left: 32\n },\n width: 800,\n height: 500,\n tooltipThreshold: 480,\n xAxisPadding: {\n top: 0,\n left: 0,\n bottom: 0,\n right: 0\n },\n tickPadding: 5,\n colorSchema: colorHelper.colorSchemas.mapdColors,\n dotRadius: 4,\n xAxisFormat: "%c",\n xTicks: null,\n tickSizes: 8,\n\n isAnimated: false,\n ease: d3Ease.easeQuadInOut,\n animationDuration: 1500,\n\n yTicks: 5,\n yTicks2: 5,\n yAxisFormat: ".2s",\n yAxisFormat2: ".2s"\n };\n\n var cache = {\n container: _container,\n svg: null,\n maskingRectangle: null,\n verticalGridLines: null,\n horizontalGridLines: null,\n grid: null,\n verticalMarkerContainer: null,\n verticalMarkerLine: null,\n\n dataBySeries: null,\n dataByDate: null,\n chartWidth: null, chartHeight: null,\n xScale: null, yScale: null, yScale2: null, colorScale: null,\n seriesColorScale: null,\n xAxis: null, yAxis: null, yAxis2: null,\n groupKeys: []\n\n // accessors\n };var getDate = function getDate(d) {\n return d[keys.DATE_KEY];\n };\n var getValue = function getValue(d) {\n return d[keys.VALUE_KEY];\n };\n var getSeries = function getSeries(d) {\n return d[keys.ID_KEY];\n };\n var getLineColor = function getLineColor(d) {\n return cache.colorScale(d[keys.ID_KEY]);\n };\n\n // events\n var dispatcher = d3Dispatch.dispatch("mouseOver", "mouseOut", "mouseMove");\n\n /**\n * This function creates the graph using the selection and data provided\n *\n * @param {D3Selection} _selection A d3 selection that represents\n * the container(s) where the chart(s) will be rendered\n * @param {LineChartData} _data The data to attach and generate the chart\n */\n function init() {\n buildSVG(_container);\n\n return this;\n }\n init();\n\n /**\n * Builds the SVG element that will contain the chart\n *\n * @param {HTMLElement} container DOM element that will work as the container of the graph\n * @private\n */\n function buildSVG() {\n var w = config.width || this.clientWidth;\n var h = config.height || this.clientHeight;\n cache.chartWidth = w - config.margin.left - config.margin.right;\n cache.chartHeight = h - config.margin.top - config.margin.bottom;\n\n if (!cache.svg) {\n cache.svg = d3Selection.select(cache.container).append("svg").classed("mapd3 line-chart", true);\n\n var container = cache.svg.append("g").classed("container-group", true);\n\n container.append("g").classed("grid-lines-group", true);\n container.append("g").classed("x-axis-group", true).append("g").classed("axis x", true);\n container.append("g").classed("y-axis-group axis y", true);\n container.append("g").classed("y-axis-group2 axis y", true);\n container.append("g").classed("chart-group", true);\n\n var metadataGroup = container.append("g").classed("metadata-group", true);\n metadataGroup.append("g").attr("class", "hover-marker vertical-marker-container");\n\n cache.maskingRectangle = cache.svg.append("rect").attr("class", "masking-rectangle");\n }\n\n cache.svg.attr("width", config.width).attr("height", config.height).select(".container-group").attr("transform", "translate(" + config.margin.left + "," + config.margin.top + ")");\n }\n\n function setData(_data) {\n var cleanedData = cleanData(_data);\n cache.dataBySeries = cleanedData.dataBySeries;\n cache.dataByDate = cleanedData.dataByDate;\n\n buildSVG(_container);\n buildScales();\n buildAxis();\n drawAxis();\n drawLines();\n\n if (shouldShowTooltip()) {\n drawVerticalMarker();\n addMouseEvents();\n }\n\n triggerIntroAnimation();\n\n return this;\n }\n\n /**\n * Adds events to the container group if the environment is not mobile\n * Adding: mouseover, mouseout and mousemove\n */\n function addMouseEvents() {\n cache.svg.on("mouseover", function mouseover(d) {\n handleMouseOver(this, d);\n }).on("mouseout", function mouseout(d) {\n handleMouseOut(this, d);\n }).on("mousemove", function mousemove(d) {\n handleMouseMove(this, d);\n });\n }\n\n /**\n * Creates the d3 x and y axis, setting orientations\n * @private\n */\n function buildAxis() {\n // let dataTimeSpan = cache.yScale.domain()[1] - cache.yScale.domain()[0]\n var tick = config.xTicks;\n var format = d3TimeFormat.timeFormat(config.xAxisFormat);\n\n cache.xAxis = d3Axis.axisBottom(cache.xScale).ticks(tick).tickSize(config.tickSizes, 0).tickPadding(config.tickPadding).tickFormat(format);\n\n cache.yAxis = d3Axis.axisLeft(cache.yScale).ticks(config.yTicks).tickSize([config.tickSizes]).tickPadding(config.tickPadding).tickFormat(d3Format.format(config.yAxisFormat));\n\n cache.yAxis2 = d3Axis.axisRight(cache.yScale2).ticks(config.yTicks).tickSize([config.tickSizes]).tickPadding(config.tickPadding).tickFormat(d3Format.format(config.yAxisFormat));\n\n drawGridLines(tick, config.yTicks);\n }\n\n /**\n * Creates the x and y scales of the graph\n * @private\n */\n function buildScales() {\n // split groups between axes\n var groups = {};\n cache.dataBySeries.forEach(function (d) {\n var key = d[keys.GROUP_KEY];\n if (!groups[key]) {\n groups[key] = {\n allValues: [],\n allDates: []\n };\n cache.groupKeys.push(key);\n }\n groups[key].allValues = groups[key].allValues.concat(d[keys.VALUES_KEY].map(function (dB) {\n return dB[keys.VALUE_KEY];\n }));\n groups[key].allDates = groups[key].allDates.concat(d[keys.VALUES_KEY].map(function (dB) {\n return dB[keys.DATE_KEY];\n }));\n });\n\n var groupAxis1 = groups[cache.groupKeys[0]];\n var groupAxis2 = groups[cache.groupKeys[1]];\n\n var datesExtent = d3Array.extent(groupAxis1.allDates);\n var valuesExtent = d3Array.extent(groupAxis1.allValues);\n // const yScaleBottomValue = Math.abs(minY) < 0 ? Math.abs(minY) : 0\n var yScaleBottomValue = valuesExtent[0];\n\n var valuesExtent2 = d3Array.extent(groupAxis2.allValues);\n var yScaleBottomValue2 = valuesExtent2[0];\n\n cache.xScale = d3Scale.scaleTime().domain(datesExtent).rangeRound([0, cache.chartWidth]);\n\n cache.yScale = d3Scale.scaleLinear().domain([yScaleBottomValue, Math.abs(valuesExtent[1])]).rangeRound([cache.chartHeight, 0]).nice();\n\n cache.yScale2 = cache.yScale.copy().domain([yScaleBottomValue2, Math.abs(valuesExtent2[1])]);\n\n cache.colorScale = d3Scale.scaleOrdinal().range(config.colorSchema).domain(cache.dataBySeries.map(getSeries));\n\n var range = cache.colorScale.range();\n\n cache.seriesColorScale = cache.colorScale.domain().reduce(function (memo, item, i) {\n memo[item] = range[i];\n return memo;\n }, {});\n }\n\n /**\n * Parses dates and values into JS Date objects and numbers\n * @param {obj} dataBySeries Raw data grouped by topic\n * @return {obj} Parsed data with dataBySeries and dataByDate\n */\n function cleanData(_data) {\n var dataBySeries = cloneData(_data[keys.SERIES_KEY]);\n var flatData = [];\n\n // Normalize dataBySeries\n dataBySeries.forEach(function (kv) {\n kv[keys.VALUES_KEY].forEach(function (d) {\n d[keys.DATE_KEY] = new Date(d[keys.DATE_KEY]);\n d[keys.VALUE_KEY] = Number(d[keys.VALUE_KEY]);\n });\n });\n\n dataBySeries.forEach(function (serie) {\n serie[keys.VALUES_KEY].forEach(function (date) {\n flatData.push({\n label: serie[keys.LABEL_KEY],\n group: serie[keys.GROUP_KEY],\n id: serie[keys.ID_KEY],\n date: date[keys.DATE_KEY],\n value: date[keys.VALUE_KEY]\n });\n });\n });\n\n // Nest data by date and format\n var dataByDate = d3Collection.nest().key(getDate).entries(flatData).map(function (d) {\n return {\n date: new Date(d.key),\n series: d[keys.VALUES_KEY]\n };\n });\n\n return { dataBySeries: dataBySeries, dataByDate: dataByDate };\n }\n\n /**\n * Removes all the datapoints highlighter circles added to the marker container\n * @return void\n */\n function cleanDataPointHighlights() {\n cache.verticalMarkerContainer.selectAll(".circle-container").remove();\n }\n\n /**\n * Draws the x and y axis on the svg object within their\n * respective groups\n * @private\n */\n function drawAxis() {\n cache.svg.select(".x-axis-group .axis.x").attr("transform", "translate(0, " + cache.chartHeight + ")").call(cache.xAxis);\n\n cache.svg.select(".y-axis-group.axis.y").attr("transform", "translate(" + -config.xAxisPadding.left + ", 0)").transition().ease(config.ease).call(cache.yAxis);\n\n cache.svg.select(".y-axis-group2.axis.y").attr("transform", "translate(" + (cache.chartWidth - config.xAxisPadding.right) + ", 0)").transition().ease(config.ease).call(cache.yAxis2);\n }\n\n /**\n * Draws the line elements within the chart group\n * @private\n */\n function drawLines() {\n var seriesLine = d3Shape.line().x(function (d) {\n return cache.xScale(d[keys.DATE_KEY]);\n }).y(function (d) {\n return cache.yScale(d[keys.VALUE_KEY]);\n });\n\n var seriesLine2 = d3Shape.line().x(function (d) {\n return cache.xScale(d[keys.DATE_KEY]);\n }).y(function (d) {\n return cache.yScale2(d[keys.VALUE_KEY]);\n }).curve(d3.curveCatmullRom);\n\n var lines = cache.svg.select(".chart-group").selectAll(".line").data(cache.dataBySeries);\n\n lines.enter().append("g").attr("class", "series").append("path").merge(lines).attr("class", function (d, i) {\n return ["line", "group-" + d[keys.GROUP_KEY], "series-" + i].join(" ");\n }).attr("d", function (d) {\n if (d[keys.GROUP_KEY] === cache.groupKeys[0]) {\n return seriesLine(d[keys.VALUES_KEY]);\n } else {\n return seriesLine2(d[keys.VALUES_KEY]);\n }\n }).style("stroke", getLineColor);\n\n lines.exit().remove();\n }\n\n /**\n * Draws grid lines on the background of the chart\n * @return void\n */\n function drawGridLines(_xTicks, _yTicks) {\n if (config.grid === "horizontal" || config.grid === "full") {\n cache.horizontalGridLines = cache.svg.select(".grid-lines-group").selectAll("line.horizontal-grid-line").data(cache.yScale.ticks(_yTicks));\n\n cache.horizontalGridLines.enter().append("line").attr("class", "horizontal-grid-line").merge(cache.horizontalGridLines).transition().attr("x1", -config.xAxisPadding.left).attr("x2", cache.chartWidth).attr("y1", cache.yScale).attr("y2", cache.yScale);\n\n cache.horizontalGridLines.exit().remove();\n }\n\n if (config.grid === "vertical" || config.grid === "full") {\n cache.verticalGridLines = cache.svg.select(".grid-lines-group").selectAll("line.vertical-grid-line").data(cache.xScale.ticks(_xTicks));\n\n cache.verticalGridLines.enter().append("line").attr("class", "vertical-grid-line").merge(cache.verticalGridLines).transition().attr("y1", 0).attr("y2", cache.chartHeight).attr("x1", cache.xScale).attr("x2", cache.xScale);\n }\n }\n\n function triggerIntroAnimation() {\n if (config.isAnimated) {\n cache.maskingRectangle = cache.svg.select(".masking-rectangle").attr("width", cache.chartWidth - 2).attr("height", cache.chartHeight).attr("x", config.margin.left + 1).attr("y", config.margin.top);\n\n cache.maskingRectangle.transition().duration(config.animationDuration).ease(config.ease).attr("width", 0).attr("x", config.width - config.margin.right).on("end", function () {\n return cache.maskingRectangle.remove();\n });\n }\n }\n\n /**\n * Creates the vertical marker\n * @return void\n */\n function drawVerticalMarker() {\n cache.verticalMarkerContainer = cache.svg.select(".metadata-group .vertical-marker-container").attr("transform", "translate(9999, 0)");\n\n cache.verticalMarkerLine = cache.verticalMarkerContainer.selectAll("path").data([{\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0\n }]);\n\n cache.verticalMarkerLine.enter().append("line").classed("vertical-marker", true).merge(cache.verticalMarkerLine).attr("x1", 0).attr("y1", cache.chartHeight).attr("x2", 0).attr("y2", 0);\n\n cache.verticalMarkerLine.exit().remove();\n }\n\n /**\n * Finds out which datapoint is closer to the given x position\n * @param {Number} x0 Date value for data point\n * @param {Object} d0 Previous datapoint\n * @param {Object} d1 Next datapoint\n * @return {Object} d0 or d1, the datapoint with closest date to x0\n */\n function findOutNearestDate(_x0, _d0, _d1) {\n return new Date(_x0).getTime() - new Date(_d0[keys.DATE_KEY]).getTime() > new Date(_d1[keys.DATE_KEY]).getTime() - new Date(_x0).getTime() ? _d0 : _d1;\n }\n\n /**\n * Extract X position on the graph from a given mouse event\n * @param {Object} event D3 mouse event\n * @return {Number} Position on the x axis of the mouse\n */\n function getMouseXPosition(_event) {\n return d3Selection.mouse(_event)[0];\n }\n\n /**\n * Finds out the data entry that is closer to the given position on pixels\n * @param {Number} mouseX X position of the mouse\n * @return {Object} Data entry that is closer to that x axis position\n */\n function getNearestDataPoint(_mouseX) {\n var dateFromInvertedX = cache.xScale.invert(_mouseX);\n var bisectDate = d3Array.bisector(getDate).left;\n var dataEntryIndex = bisectDate(cache.dataByDate, dateFromInvertedX, 1);\n var dataEntryForXPosition = cache.dataByDate[dataEntryIndex];\n var previousDataEntryForXPosition = cache.dataByDate[dataEntryIndex - 1];\n var nearestDataPoint = null;\n\n if (previousDataEntryForXPosition && dataEntryForXPosition) {\n nearestDataPoint = findOutNearestDate(dateFromInvertedX, dataEntryForXPosition, previousDataEntryForXPosition);\n } else {\n nearestDataPoint = dataEntryForXPosition;\n }\n\n return nearestDataPoint;\n }\n\n /**\n * MouseMove handler, calculates the nearest dataPoint to the cursor\n * and updates metadata related to it\n * @private\n */\n function handleMouseMove(_e) {\n var xPositionOffset = -config.margin.left; // Arbitrary number, will love to know how to assess it\n var dataPoint = getNearestDataPoint(getMouseXPosition(_e) + xPositionOffset);\n\n if (dataPoint) {\n var dataPointXPosition = cache.xScale(new Date(dataPoint.date));\n moveVerticalMarker(dataPointXPosition);\n highlightDataPoints(dataPoint);\n dispatcher.call("mouseMove", _e, dataPoint, cache.seriesColorScale, dataPointXPosition);\n }\n }\n\n /**\n * MouseOut handler and removes active class on verticalMarkerLine\n * It also resets the container of the vertical marker\n * @private\n */\n function handleMouseOut(_e, _d) {\n cache.verticalMarkerLine.classed("bc-is-active", false);\n cache.verticalMarkerContainer.attr("transform", "translate(9999, 0)");\n\n dispatcher.call("mouseOut", _e, _d, d3Selection.mouse(_e));\n }\n\n /**\n * Mouseover handler and adds active class to verticalMarkerLine\n * @private\n */\n function handleMouseOver(_e, _d) {\n cache.verticalMarkerLine.classed("bc-is-active", true);\n\n dispatcher.call("mouseOver", _e, _d, d3Selection.mouse(_e));\n }\n\n /**\n * Creates coloured circles marking where the exact data y value is for a given data point\n * @param {Object} dataPoint Data point to extract info from\n * @private\n */\n function highlightDataPoints(_dataPoint) {\n cleanDataPointHighlights();\n\n // sorting the topics based on the order of the colors,\n // so that the order always stays constant\n // TO DO: make it immutable\n _dataPoint[keys.SERIES_KEY] = _dataPoint[keys.SERIES_KEY].filter(function (t) {\n return Boolean(t);\n }).sort(function (a, b) {\n return cache.seriesColorScale[a.name] < cache.seriesColorScale[b.name];\n });\n\n _dataPoint[keys.SERIES_KEY].forEach(function (_ref, index) {\n var id = _ref.id;\n\n var marker = cache.verticalMarkerContainer.append("g").classed("circle-container", true);\n\n marker.append("circle").classed("data-point-highlighter", true).attr("cx", config.dotRadius / 2).attr("cy", 0).attr("r", config.dotRadius).style("stroke", cache.seriesColorScale[id]);\n\n marker.attr("transform", function () {\n var datum = _dataPoint[keys.SERIES_KEY][index];\n var scale = datum.group === cache.groupKeys[0] ? cache.yScale(datum[keys.VALUE_KEY]) : cache.yScale2(datum[keys.VALUE_KEY]);\n return "translate( " + -config.dotRadius / 2 + ", " + scale + " )";\n });\n });\n }\n\n /**\n * Helper method to update the x position of the vertical marker\n * @param {Object} dataPoint Data entry to extract info\n * @return void\n */\n function moveVerticalMarker(_verticalMarkerXPosition) {\n cache.verticalMarkerContainer.attr("transform", "translate(" + _verticalMarkerXPosition + ",0)");\n }\n\n /**\n * Determines if we should add the tooltip related logic depending on the\n * size of the chart and the tooltipThreshold variable value\n * @return {Boolean} Should we build the tooltip?\n */\n function shouldShowTooltip() {\n return config.width > config.tooltipThreshold;\n }\n\n /**\n * Chart exported to png and a download action is fired\n * @public\n */\n function save(_filename, _title) {\n exportChart.call(this, cache.svg, _filename, _title);\n }\n\n /**\n * Exposes an "on" method that acts as a bridge with the event dispatcher\n * We are going to expose this events:\n * customMouseHover, mouseMove and mouseOut\n *\n * @return {module} Bar Chart\n * @public\n */\n function on() {\n return dispatcher.on.apply(dispatcher, arguments);\n }\n\n function setConfig(_config) {\n config = Object.assign({}, config, _config);\n return this;\n }\n\n function getConfig() {\n return config;\n }\n\n function getCache() {\n return cache;\n }\n\n return {\n init: init,\n setConfig: setConfig,\n setData: setData,\n getCache: getCache,\n getConfig: getConfig,\n on: on,\n save: save\n };\n };\n}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/charts/line.js\n// module id = 1\n// module chunks = 0\n//# sourceURL=webpack:///./src/charts/line.js?')},function(module,exports,__webpack_require__){eval("// https://d3js.org/d3-array/ Version 1.2.0. Copyright 2017 Mike Bostock.\n(function (global, factory) {\n\t true ? factory(exports) :\n\ttypeof define === 'function' && define.amd ? define(['exports'], factory) :\n\t(factory((global.d3 = global.d3 || {})));\n}(this, (function (exports) { 'use strict';\n\nvar ascending = function(a, b) {\n return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n};\n\nvar bisector = function(compare) {\n if (compare.length === 1) compare = ascendingComparator(compare);\n return {\n left: function(a, x, lo, hi) {\n if (lo == null) lo = 0;\n if (hi == null) hi = a.length;\n while (lo < hi) {\n var mid = lo + hi >>> 1;\n if (compare(a[mid], x) < 0) lo = mid + 1;\n else hi = mid;\n }\n return lo;\n },\n right: function(a, x, lo, hi) {\n if (lo == null) lo = 0;\n if (hi == null) hi = a.length;\n while (lo < hi) {\n var mid = lo + hi >>> 1;\n if (compare(a[mid], x) > 0) hi = mid;\n else lo = mid + 1;\n }\n return lo;\n }\n };\n};\n\nfunction ascendingComparator(f) {\n return function(d, x) {\n return ascending(f(d), x);\n };\n}\n\nvar ascendingBisect = bisector(ascending);\nvar bisectRight = ascendingBisect.right;\nvar bisectLeft = ascendingBisect.left;\n\nvar pairs = function(array, f) {\n if (f == null) f = pair;\n var i = 0, n = array.length - 1, p = array[0], pairs = new Array(n < 0 ? 0 : n);\n while (i < n) pairs[i] = f(p, p = array[++i]);\n return pairs;\n};\n\nfunction pair(a, b) {\n return [a, b];\n}\n\nvar cross = function(values0, values1, reduce) {\n var n0 = values0.length,\n n1 = values1.length,\n values = new Array(n0 * n1),\n i0,\n i1,\n i,\n value0;\n\n if (reduce == null) reduce = pair;\n\n for (i0 = i = 0; i0 < n0; ++i0) {\n for (value0 = values0[i0], i1 = 0; i1 < n1; ++i1, ++i) {\n values[i] = reduce(value0, values1[i1]);\n }\n }\n\n return values;\n};\n\nvar descending = function(a, b) {\n return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;\n};\n\nvar number = function(x) {\n return x === null ? NaN : +x;\n};\n\nvar variance = function(values, valueof) {\n var n = values.length,\n m = 0,\n i = -1,\n mean = 0,\n value,\n delta,\n sum = 0;\n\n if (valueof == null) {\n while (++i < n) {\n if (!isNaN(value = number(values[i]))) {\n delta = value - mean;\n mean += delta / ++m;\n sum += delta * (value - mean);\n }\n }\n }\n\n else {\n while (++i < n) {\n if (!isNaN(value = number(valueof(values[i], i, values)))) {\n delta = value - mean;\n mean += delta / ++m;\n sum += delta * (value - mean);\n }\n }\n }\n\n if (m > 1) return sum / (m - 1);\n};\n\nvar deviation = function(array, f) {\n var v = variance(array, f);\n return v ? Math.sqrt(v) : v;\n};\n\nvar extent = function(values, valueof) {\n var n = values.length,\n i = -1,\n value,\n min,\n max;\n\n if (valueof == null) {\n while (++i < n) { // Find the first comparable value.\n if ((value = values[i]) != null && value >= value) {\n min = max = value;\n while (++i < n) { // Compare the remaining values.\n if ((value = values[i]) != null) {\n if (min > value) min = value;\n if (max < value) max = value;\n }\n }\n }\n }\n }\n\n else {\n while (++i < n) { // Find the first comparable value.\n if ((value = valueof(values[i], i, values)) != null && value >= value) {\n min = max = value;\n while (++i < n) { // Compare the remaining values.\n if ((value = valueof(values[i], i, values)) != null) {\n if (min > value) min = value;\n if (max < value) max = value;\n }\n }\n }\n }\n }\n\n return [min, max];\n};\n\nvar array = Array.prototype;\n\nvar slice = array.slice;\nvar map = array.map;\n\nvar constant = function(x) {\n return function() {\n return x;\n };\n};\n\nvar identity = function(x) {\n return x;\n};\n\nvar range = function(start, stop, step) {\n start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step;\n\n var i = -1,\n n = Math.max(0, Math.ceil((stop - start) / step)) | 0,\n range = new Array(n);\n\n while (++i < n) {\n range[i] = start + i * step;\n }\n\n return range;\n};\n\nvar e10 = Math.sqrt(50);\nvar e5 = Math.sqrt(10);\nvar e2 = Math.sqrt(2);\n\nvar ticks = function(start, stop, count) {\n var reverse = stop < start,\n i = -1,\n n,\n ticks,\n step;\n\n if (reverse) n = start, start = stop, stop = n;\n\n if ((step = tickIncrement(start, stop, count)) === 0 || !isFinite(step)) return [];\n\n if (step > 0) {\n start = Math.ceil(start / step);\n stop = Math.floor(stop / step);\n ticks = new Array(n = Math.ceil(stop - start + 1));\n while (++i < n) ticks[i] = (start + i) * step;\n } else {\n start = Math.floor(start * step);\n stop = Math.ceil(stop * step);\n ticks = new Array(n = Math.ceil(start - stop + 1));\n while (++i < n) ticks[i] = (start - i) / step;\n }\n\n if (reverse) ticks.reverse();\n\n return ticks;\n};\n\nfunction tickIncrement(start, stop, count) {\n var step = (stop - start) / Math.max(0, count),\n power = Math.floor(Math.log(step) / Math.LN10),\n error = step / Math.pow(10, power);\n return power >= 0\n ? (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1) * Math.pow(10, power)\n : -Math.pow(10, -power) / (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1);\n}\n\nfunction tickStep(start, stop, count) {\n var step0 = Math.abs(stop - start) / Math.max(0, count),\n step1 = Math.pow(10, Math.floor(Math.log(step0) / Math.LN10)),\n error = step0 / step1;\n if (error >= e10) step1 *= 10;\n else if (error >= e5) step1 *= 5;\n else if (error >= e2) step1 *= 2;\n return stop < start ? -step1 : step1;\n}\n\nvar sturges = function(values) {\n return Math.ceil(Math.log(values.length) / Math.LN2) + 1;\n};\n\nvar histogram = function() {\n var value = identity,\n domain = extent,\n threshold = sturges;\n\n function histogram(data) {\n var i,\n n = data.length,\n x,\n values = new Array(n);\n\n for (i = 0; i < n; ++i) {\n values[i] = value(data[i], i, data);\n }\n\n var xz = domain(values),\n x0 = xz[0],\n x1 = xz[1],\n tz = threshold(values, x0, x1);\n\n // Convert number of thresholds into uniform thresholds.\n if (!Array.isArray(tz)) {\n tz = tickStep(x0, x1, tz);\n tz = range(Math.ceil(x0 / tz) * tz, Math.floor(x1 / tz) * tz, tz); // exclusive\n }\n\n // Remove any thresholds outside the domain.\n var m = tz.length;\n while (tz[0] <= x0) tz.shift(), --m;\n while (tz[m - 1] > x1) tz.pop(), --m;\n\n var bins = new Array(m + 1),\n bin;\n\n // Initialize bins.\n for (i = 0; i <= m; ++i) {\n bin = bins[i] = [];\n bin.x0 = i > 0 ? tz[i - 1] : x0;\n bin.x1 = i < m ? tz[i] : x1;\n }\n\n // Assign data to bins by value, ignoring any outside the domain.\n for (i = 0; i < n; ++i) {\n x = values[i];\n if (x0 <= x && x <= x1) {\n bins[bisectRight(tz, x, 0, m)].push(data[i]);\n }\n }\n\n return bins;\n }\n\n histogram.value = function(_) {\n return arguments.length ? (value = typeof _ === \"function\" ? _ : constant(_), histogram) : value;\n };\n\n histogram.domain = function(_) {\n return arguments.length ? (domain = typeof _ === \"function\" ? _ : constant([_[0], _[1]]), histogram) : domain;\n };\n\n histogram.thresholds = function(_) {\n return arguments.length ? (threshold = typeof _ === \"function\" ? _ : Array.isArray(_) ? constant(slice.call(_)) : constant(_), histogram) : threshold;\n };\n\n return histogram;\n};\n\nvar quantile = function(values, p, valueof) {\n if (valueof == null) valueof = number;\n if (!(n = values.length)) return;\n if ((p = +p) <= 0 || n < 2) return +valueof(values[0], 0, values);\n if (p >= 1) return +valueof(values[n - 1], n - 1, values);\n var n,\n i = (n - 1) * p,\n i0 = Math.floor(i),\n value0 = +valueof(values[i0], i0, values),\n value1 = +valueof(values[i0 + 1], i0 + 1, values);\n return value0 + (value1 - value0) * (i - i0);\n};\n\nvar freedmanDiaconis = function(values, min, max) {\n values = map.call(values, number).sort(ascending);\n return Math.ceil((max - min) / (2 * (quantile(values, 0.75) - quantile(values, 0.25)) * Math.pow(values.length, -1 / 3)));\n};\n\nvar scott = function(values, min, max) {\n return Math.ceil((max - min) / (3.5 * deviation(values) * Math.pow(values.length, -1 / 3)));\n};\n\nvar max = function(values, valueof) {\n var n = values.length,\n i = -1,\n value,\n max;\n\n if (valueof == null) {\n while (++i < n) { // Find the first comparable value.\n if ((value = values[i]) != null && value >= value) {\n max = value;\n while (++i < n) { // Compare the remaining values.\n if ((value = values[i]) != null && value > max) {\n max = value;\n }\n }\n }\n }\n }\n\n else {\n while (++i < n) { // Find the first comparable value.\n if ((value = valueof(values[i], i, values)) != null && value >= value) {\n max = value;\n while (++i < n) { // Compare the remaining values.\n if ((value = valueof(values[i], i, values)) != null && value > max) {\n max = value;\n }\n }\n }\n }\n }\n\n return max;\n};\n\nvar mean = function(values, valueof) {\n var n = values.length,\n m = n,\n i = -1,\n value,\n sum = 0;\n\n if (valueof == null) {\n while (++i < n) {\n if (!isNaN(value = number(values[i]))) sum += value;\n else --m;\n }\n }\n\n else {\n while (++i < n) {\n if (!isNaN(value = number(valueof(values[i], i, values)))) sum += value;\n else --m;\n }\n }\n\n if (m) return sum / m;\n};\n\nvar median = function(values, valueof) {\n var n = values.length,\n i = -1,\n value,\n numbers = [];\n\n if (valueof == null) {\n while (++i < n) {\n if (!isNaN(value = number(values[i]))) {\n numbers.push(value);\n }\n }\n }\n\n else {\n while (++i < n) {\n if (!isNaN(value = number(valueof(values[i], i, values)))) {\n numbers.push(value);\n }\n }\n }\n\n return quantile(numbers.sort(ascending), 0.5);\n};\n\nvar merge = function(arrays) {\n var n = arrays.length,\n m,\n i = -1,\n j = 0,\n merged,\n array;\n\n while (++i < n) j += arrays[i].length;\n merged = new Array(j);\n\n while (--n >= 0) {\n array = arrays[n];\n m = array.length;\n while (--m >= 0) {\n merged[--j] = array[m];\n }\n }\n\n return merged;\n};\n\nvar min = function(values, valueof) {\n var n = values.length,\n i = -1,\n value,\n min;\n\n if (valueof == null) {\n while (++i < n) { // Find the first comparable value.\n if ((value = values[i]) != null && value >= value) {\n min = value;\n while (++i < n) { // Compare the remaining values.\n if ((value = values[i]) != null && min > value) {\n min = value;\n }\n }\n }\n }\n }\n\n else {\n while (++i < n) { // Find the first comparable value.\n if ((value = valueof(values[i], i, values)) != null && value >= value) {\n min = value;\n while (++i < n) { // Compare the remaining values.\n if ((value = valueof(values[i], i, values)) != null && min > value) {\n min = value;\n }\n }\n }\n }\n }\n\n return min;\n};\n\nvar permute = function(array, indexes) {\n var i = indexes.length, permutes = new Array(i);\n while (i--) permutes[i] = array[indexes[i]];\n return permutes;\n};\n\nvar scan = function(values, compare) {\n if (!(n = values.length)) return;\n var n,\n i = 0,\n j = 0,\n xi,\n xj = values[j];\n\n if (compare == null) compare = ascending;\n\n while (++i < n) {\n if (compare(xi = values[i], xj) < 0 || compare(xj, xj) !== 0) {\n xj = xi, j = i;\n }\n }\n\n if (compare(xj, xj) === 0) return j;\n};\n\nvar shuffle = function(array, i0, i1) {\n var m = (i1 == null ? array.length : i1) - (i0 = i0 == null ? 0 : +i0),\n t,\n i;\n\n while (m) {\n i = Math.random() * m-- | 0;\n t = array[m + i0];\n array[m + i0] = array[i + i0];\n array[i + i0] = t;\n }\n\n return array;\n};\n\nvar sum = function(values, valueof) {\n var n = values.length,\n i = -1,\n value,\n sum = 0;\n\n if (valueof == null) {\n while (++i < n) {\n if (value = +values[i]) sum += value; // Note: zero and null are equivalent.\n }\n }\n\n else {\n while (++i < n) {\n if (value = +valueof(values[i], i, values)) sum += value;\n }\n }\n\n return sum;\n};\n\nvar transpose = function(matrix) {\n if (!(n = matrix.length)) return [];\n for (var i = -1, m = min(matrix, length), transpose = new Array(m); ++i < m;) {\n for (var j = -1, n, row = transpose[i] = new Array(n); ++j < n;) {\n row[j] = matrix[j][i];\n }\n }\n return transpose;\n};\n\nfunction length(d) {\n return d.length;\n}\n\nvar zip = function() {\n return transpose(arguments);\n};\n\nexports.bisect = bisectRight;\nexports.bisectRight = bisectRight;\nexports.bisectLeft = bisectLeft;\nexports.ascending = ascending;\nexports.bisector = bisector;\nexports.cross = cross;\nexports.descending = descending;\nexports.deviation = deviation;\nexports.extent = extent;\nexports.histogram = histogram;\nexports.thresholdFreedmanDiaconis = freedmanDiaconis;\nexports.thresholdScott = scott;\nexports.thresholdSturges = sturges;\nexports.max = max;\nexports.mean = mean;\nexports.median = median;\nexports.merge = merge;\nexports.min = min;\nexports.pairs = pairs;\nexports.permute = permute;\nexports.quantile = quantile;\nexports.range = range;\nexports.scan = scan;\nexports.shuffle = shuffle;\nexports.sum = sum;\nexports.ticks = ticks;\nexports.tickIncrement = tickIncrement;\nexports.tickStep = tickStep;\nexports.transpose = transpose;\nexports.variance = variance;\nexports.zip = zip;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n})));\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/d3-array/build/d3-array.js\n// module id = 2\n// module chunks = 0\n//# sourceURL=webpack:///./~/d3-array/build/d3-array.js?"); | |
},function(module,exports,__webpack_require__){eval('// https://d3js.org/d3-axis/ Version 1.0.8. Copyright 2017 Mike Bostock.\n(function (global, factory) {\n\t true ? factory(exports) :\n\ttypeof define === \'function\' && define.amd ? define([\'exports\'], factory) :\n\t(factory((global.d3 = global.d3 || {})));\n}(this, (function (exports) { \'use strict\';\n\nvar slice = Array.prototype.slice;\n\nvar identity = function(x) {\n return x;\n};\n\nvar top = 1;\nvar right = 2;\nvar bottom = 3;\nvar left = 4;\nvar epsilon = 1e-6;\n\nfunction translateX(x) {\n return "translate(" + (x + 0.5) + ",0)";\n}\n\nfunction translateY(y) {\n return "translate(0," + (y + 0.5) + ")";\n}\n\nfunction number(scale) {\n return function(d) {\n return +scale(d);\n };\n}\n\nfunction center(scale) {\n var offset = Math.max(0, scale.bandwidth() - 1) / 2; // Adjust for 0.5px offset.\n if (scale.round()) offset = Math.round(offset);\n return function(d) {\n return +scale(d) + offset;\n };\n}\n\nfunction entering() {\n return !this.__axis;\n}\n\nfunction axis(orient, scale) {\n var tickArguments = [],\n tickValues = null,\n tickFormat = null,\n tickSizeInner = 6,\n tickSizeOuter = 6,\n tickPadding = 3,\n k = orient === top || orient === left ? -1 : 1,\n x = orient === left || orient === right ? "x" : "y",\n transform = orient === top || orient === bottom ? translateX : translateY;\n\n function axis(context) {\n var values = tickValues == null ? (scale.ticks ? scale.ticks.apply(scale, tickArguments) : scale.domain()) : tickValues,\n format = tickFormat == null ? (scale.tickFormat ? scale.tickFormat.apply(scale, tickArguments) : identity) : tickFormat,\n spacing = Math.max(tickSizeInner, 0) + tickPadding,\n range = scale.range(),\n range0 = +range[0] + 0.5,\n range1 = +range[range.length - 1] + 0.5,\n position = (scale.bandwidth ? center : number)(scale.copy()),\n selection = context.selection ? context.selection() : context,\n path = selection.selectAll(".domain").data([null]),\n tick = selection.selectAll(".tick").data(values, scale).order(),\n tickExit = tick.exit(),\n tickEnter = tick.enter().append("g").attr("class", "tick"),\n line = tick.select("line"),\n text = tick.select("text");\n\n path = path.merge(path.enter().insert("path", ".tick")\n .attr("class", "domain")\n .attr("stroke", "#000"));\n\n tick = tick.merge(tickEnter);\n\n line = line.merge(tickEnter.append("line")\n .attr("stroke", "#000")\n .attr(x + "2", k * tickSizeInner));\n\n text = text.merge(tickEnter.append("text")\n .attr("fill", "#000")\n .attr(x, k * spacing)\n .attr("dy", orient === top ? "0em" : orient === bottom ? "0.71em" : "0.32em"));\n\n if (context !== selection) {\n path = path.transition(context);\n tick = tick.transition(context);\n line = line.transition(context);\n text = text.transition(context);\n\n tickExit = tickExit.transition(context)\n .attr("opacity", epsilon)\n .attr("transform", function(d) { return isFinite(d = position(d)) ? transform(d) : this.getAttribute("transform"); });\n\n tickEnter\n .attr("opacity", epsilon)\n .attr("transform", function(d) { var p = this.parentNode.__axis; return transform(p && isFinite(p = p(d)) ? p : position(d)); });\n }\n\n tickExit.remove();\n\n path\n .attr("d", orient === left || orient == right\n ? "M" + k * tickSizeOuter + "," + range0 + "H0.5V" + range1 + "H" + k * tickSizeOuter\n : "M" + range0 + "," + k * tickSizeOuter + "V0.5H" + range1 + "V" + k * tickSizeOuter);\n\n tick\n .attr("opacity", 1)\n .attr("transform", function(d) { return transform(position(d)); });\n\n line\n .attr(x + "2", k * tickSizeInner);\n\n text\n .attr(x, k * spacing)\n .text(format);\n\n selection.filter(entering)\n .attr("fill", "none")\n .attr("font-size", 10)\n .attr("font-family", "sans-serif")\n .attr("text-anchor", orient === right ? "start" : orient === left ? "end" : "middle");\n\n selection\n .each(function() { this.__axis = position; });\n }\n\n axis.scale = function(_) {\n return arguments.length ? (scale = _, axis) : scale;\n };\n\n axis.ticks = function() {\n return tickArguments = slice.call(arguments), axis;\n };\n\n axis.tickArguments = function(_) {\n return arguments.length ? (tickArguments = _ == null ? [] : slice.call(_), axis) : tickArguments.slice();\n };\n\n axis.tickValues = function(_) {\n return arguments.length ? (tickValues = _ == null ? null : slice.call(_), axis) : tickValues && tickValues.slice();\n };\n\n axis.tickFormat = function(_) {\n return arguments.length ? (tickFormat = _, axis) : tickFormat;\n };\n\n axis.tickSize = function(_) {\n return arguments.length ? (tickSizeInner = tickSizeOuter = +_, axis) : tickSizeInner;\n };\n\n axis.tickSizeInner = function(_) {\n return arguments.length ? (tickSizeInner = +_, axis) : tickSizeInner;\n };\n\n axis.tickSizeOuter = function(_) {\n return arguments.length ? (tickSizeOuter = +_, axis) : tickSizeOuter;\n };\n\n axis.tickPadding = function(_) {\n return arguments.length ? (tickPadding = +_, axis) : tickPadding;\n };\n\n return axis;\n}\n\nfunction axisTop(scale) {\n return axis(top, scale);\n}\n\nfunction axisRight(scale) {\n return axis(right, scale);\n}\n\nfunction axisBottom(scale) {\n return axis(bottom, scale);\n}\n\nfunction axisLeft(scale) {\n return axis(left, scale);\n}\n\nexports.axisTop = axisTop;\nexports.axisRight = axisRight;\nexports.axisBottom = axisBottom;\nexports.axisLeft = axisLeft;\n\nObject.defineProperty(exports, \'__esModule\', { value: true });\n\n})));\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/d3-axis/build/d3-axis.js\n// module id = 3\n// module chunks = 0\n//# sourceURL=webpack:///./~/d3-axis/build/d3-axis.js?')},function(module,exports,__webpack_require__){eval("// https://d3js.org/d3-collection/ Version 1.0.4. Copyright 2017 Mike Bostock.\n(function (global, factory) {\n\t true ? factory(exports) :\n\ttypeof define === 'function' && define.amd ? define(['exports'], factory) :\n\t(factory((global.d3 = global.d3 || {})));\n}(this, (function (exports) { 'use strict';\n\nvar prefix = \"$\";\n\nfunction Map() {}\n\nMap.prototype = map.prototype = {\n constructor: Map,\n has: function(key) {\n return (prefix + key) in this;\n },\n get: function(key) {\n return this[prefix + key];\n },\n set: function(key, value) {\n this[prefix + key] = value;\n return this;\n },\n remove: function(key) {\n var property = prefix + key;\n return property in this && delete this[property];\n },\n clear: function() {\n for (var property in this) if (property[0] === prefix) delete this[property];\n },\n keys: function() {\n var keys = [];\n for (var property in this) if (property[0] === prefix) keys.push(property.slice(1));\n return keys;\n },\n values: function() {\n var values = [];\n for (var property in this) if (property[0] === prefix) values.push(this[property]);\n return values;\n },\n entries: function() {\n var entries = [];\n for (var property in this) if (property[0] === prefix) entries.push({key: property.slice(1), value: this[property]});\n return entries;\n },\n size: function() {\n var size = 0;\n for (var property in this) if (property[0] === prefix) ++size;\n return size;\n },\n empty: function() {\n for (var property in this) if (property[0] === prefix) return false;\n return true;\n },\n each: function(f) {\n for (var property in this) if (property[0] === prefix) f(this[property], property.slice(1), this);\n }\n};\n\nfunction map(object, f) {\n var map = new Map;\n\n // Copy constructor.\n if (object instanceof Map) object.each(function(value, key) { map.set(key, value); });\n\n // Index array by numeric index or specified key function.\n else if (Array.isArray(object)) {\n var i = -1,\n n = object.length,\n o;\n\n if (f == null) while (++i < n) map.set(i, object[i]);\n else while (++i < n) map.set(f(o = object[i], i, object), o);\n }\n\n // Convert object to map.\n else if (object) for (var key in object) map.set(key, object[key]);\n\n return map;\n}\n\nvar nest = function() {\n var keys = [],\n sortKeys = [],\n sortValues,\n rollup,\n nest;\n\n function apply(array, depth, createResult, setResult) {\n if (depth >= keys.length) {\n if (sortValues != null) array.sort(sortValues);\n return rollup != null ? rollup(array) : array;\n }\n\n var i = -1,\n n = array.length,\n key = keys[depth++],\n keyValue,\n value,\n valuesByKey = map(),\n values,\n result = createResult();\n\n while (++i < n) {\n if (values = valuesByKey.get(keyValue = key(value = array[i]) + \"\")) {\n values.push(value);\n } else {\n valuesByKey.set(keyValue, [value]);\n }\n }\n\n valuesByKey.each(function(values, key) {\n setResult(result, key, apply(values, depth, createResult, setResult));\n });\n\n return result;\n }\n\n function entries(map$$1, depth) {\n if (++depth > keys.length) return map$$1;\n var array, sortKey = sortKeys[depth - 1];\n if (rollup != null && depth >= keys.length) array = map$$1.entries();\n else array = [], map$$1.each(function(v, k) { array.push({key: k, values: entries(v, depth)}); });\n return sortKey != null ? array.sort(function(a, b) { return sortKey(a.key, b.key); }) : array;\n }\n\n return nest = {\n object: function(array) { return apply(array, 0, createObject, setObject); },\n map: function(array) { return apply(array, 0, createMap, setMap); },\n entries: function(array) { return entries(apply(array, 0, createMap, setMap), 0); },\n key: function(d) { keys.push(d); return nest; },\n sortKeys: function(order) { sortKeys[keys.length - 1] = order; return nest; },\n sortValues: function(order) { sortValues = order; return nest; },\n rollup: function(f) { rollup = f; return nest; }\n };\n};\n\nfunction createObject() {\n return {};\n}\n\nfunction setObject(object, key, value) {\n object[key] = value;\n}\n\nfunction createMap() {\n return map();\n}\n\nfunction setMap(map$$1, key, value) {\n map$$1.set(key, value);\n}\n\nfunction Set() {}\n\nvar proto = map.prototype;\n\nSet.prototype = set.prototype = {\n constructor: Set,\n has: proto.has,\n add: function(value) {\n value += \"\";\n this[prefix + value] = value;\n return this;\n },\n remove: proto.remove,\n clear: proto.clear,\n values: proto.keys,\n size: proto.size,\n empty: proto.empty,\n each: proto.each\n};\n\nfunction set(object, f) {\n var set = new Set;\n\n // Copy constructor.\n if (object instanceof Set) object.each(function(value) { set.add(value); });\n\n // Otherwise, assume it’s an array.\n else if (object) {\n var i = -1, n = object.length;\n if (f == null) while (++i < n) set.add(object[i]);\n else while (++i < n) set.add(f(object[i], i, object));\n }\n\n return set;\n}\n\nvar keys = function(map) {\n var keys = [];\n for (var key in map) keys.push(key);\n return keys;\n};\n\nvar values = function(map) {\n var values = [];\n for (var key in map) values.push(map[key]);\n return values;\n};\n\nvar entries = function(map) {\n var entries = [];\n for (var key in map) entries.push({key: key, value: map[key]});\n return entries;\n};\n\nexports.nest = nest;\nexports.set = set;\nexports.map = map;\nexports.keys = keys;\nexports.values = values;\nexports.entries = entries;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n})));\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/d3-collection/build/d3-collection.js\n// module id = 4\n// module chunks = 0\n//# sourceURL=webpack:///./~/d3-collection/build/d3-collection.js?")},function(module,exports,__webpack_require__){eval('// https://d3js.org/d3-dispatch/ Version 1.0.3. Copyright 2017 Mike Bostock.\n(function (global, factory) {\n\t true ? factory(exports) :\n\ttypeof define === \'function\' && define.amd ? define([\'exports\'], factory) :\n\t(factory((global.d3 = global.d3 || {})));\n}(this, (function (exports) { \'use strict\';\n\nvar noop = {value: function() {}};\n\nfunction dispatch() {\n for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) {\n if (!(t = arguments[i] + "") || (t in _)) throw new Error("illegal type: " + t);\n _[t] = [];\n }\n return new Dispatch(_);\n}\n\nfunction Dispatch(_) {\n this._ = _;\n}\n\nfunction parseTypenames(typenames, types) {\n return typenames.trim().split(/^|\\s+/).map(function(t) {\n var name = "", i = t.indexOf(".");\n if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);\n if (t && !types.hasOwnProperty(t)) throw new Error("unknown type: " + t);\n return {type: t, name: name};\n });\n}\n\nDispatch.prototype = dispatch.prototype = {\n constructor: Dispatch,\n on: function(typename, callback) {\n var _ = this._,\n T = parseTypenames(typename + "", _),\n t,\n i = -1,\n n = T.length;\n\n // If no callback was specified, return the callback of the given type and name.\n if (arguments.length < 2) {\n while (++i < n) if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name))) return t;\n return;\n }\n\n // If a type was specified, set the callback for the given type and name.\n // Otherwise, if a null callback was specified, remove callbacks of the given name.\n if (callback != null && typeof callback !== "function") throw new Error("invalid callback: " + callback);\n while (++i < n) {\n if (t = (typename = T[i]).type) _[t] = set(_[t], typename.name, callback);\n else if (callback == null) for (t in _) _[t] = set(_[t], typename.name, null);\n }\n\n return this;\n },\n copy: function() {\n var copy = {}, _ = this._;\n for (var t in _) copy[t] = _[t].slice();\n return new Dispatch(copy);\n },\n call: function(type, that) {\n if ((n = arguments.length - 2) > 0) for (var args = new Array(n), i = 0, n, t; i < n; ++i) args[i] = arguments[i + 2];\n if (!this._.hasOwnProperty(type)) throw new Error("unknown type: " + type);\n for (t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n },\n apply: function(type, that, args) {\n if (!this._.hasOwnProperty(type)) throw new Error("unknown type: " + type);\n for (var t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n }\n};\n\nfunction get(type, name) {\n for (var i = 0, n = type.length, c; i < n; ++i) {\n if ((c = type[i]).name === name) {\n return c.value;\n }\n }\n}\n\nfunction set(type, name, callback) {\n for (var i = 0, n = type.length; i < n; ++i) {\n if (type[i].name === name) {\n type[i] = noop, type = type.slice(0, i).concat(type.slice(i + 1));\n break;\n }\n }\n if (callback != null) type.push({name: name, value: callback});\n return type;\n}\n\nexports.dispatch = dispatch;\n\nObject.defineProperty(exports, \'__esModule\', { value: true });\n\n})));\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/d3-dispatch/build/d3-dispatch.js\n// module id = 5\n// module chunks = 0\n//# sourceURL=webpack:///./~/d3-dispatch/build/d3-dispatch.js?')},function(module,exports,__webpack_require__){eval("// https://d3js.org/d3-ease/ Version 1.0.3. Copyright 2017 Mike Bostock.\n(function (global, factory) {\n\t true ? factory(exports) :\n\ttypeof define === 'function' && define.amd ? define(['exports'], factory) :\n\t(factory((global.d3 = global.d3 || {})));\n}(this, (function (exports) { 'use strict';\n\nfunction linear(t) {\n return +t;\n}\n\nfunction quadIn(t) {\n return t * t;\n}\n\nfunction quadOut(t) {\n return t * (2 - t);\n}\n\nfunction quadInOut(t) {\n return ((t *= 2) <= 1 ? t * t : --t * (2 - t) + 1) / 2;\n}\n\nfunction cubicIn(t) {\n return t * t * t;\n}\n\nfunction cubicOut(t) {\n return --t * t * t + 1;\n}\n\nfunction cubicInOut(t) {\n return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;\n}\n\nvar exponent = 3;\n\nvar polyIn = (function custom(e) {\n e = +e;\n\n function polyIn(t) {\n return Math.pow(t, e);\n }\n\n polyIn.exponent = custom;\n\n return polyIn;\n})(exponent);\n\nvar polyOut = (function custom(e) {\n e = +e;\n\n function polyOut(t) {\n return 1 - Math.pow(1 - t, e);\n }\n\n polyOut.exponent = custom;\n\n return polyOut;\n})(exponent);\n\nvar polyInOut = (function custom(e) {\n e = +e;\n\n function polyInOut(t) {\n return ((t *= 2) <= 1 ? Math.pow(t, e) : 2 - Math.pow(2 - t, e)) / 2;\n }\n\n polyInOut.exponent = custom;\n\n return polyInOut;\n})(exponent);\n\nvar pi = Math.PI;\nvar halfPi = pi / 2;\n\nfunction sinIn(t) {\n return 1 - Math.cos(t * halfPi);\n}\n\nfunction sinOut(t) {\n return Math.sin(t * halfPi);\n}\n\nfunction sinInOut(t) {\n return (1 - Math.cos(pi * t)) / 2;\n}\n\nfunction expIn(t) {\n return Math.pow(2, 10 * t - 10);\n}\n\nfunction expOut(t) {\n return 1 - Math.pow(2, -10 * t);\n}\n\nfunction expInOut(t) {\n return ((t *= 2) <= 1 ? Math.pow(2, 10 * t - 10) : 2 - Math.pow(2, 10 - 10 * t)) / 2;\n}\n\nfunction circleIn(t) {\n return 1 - Math.sqrt(1 - t * t);\n}\n\nfunction circleOut(t) {\n return Math.sqrt(1 - --t * t);\n}\n\nfunction circleInOut(t) {\n return ((t *= 2) <= 1 ? 1 - Math.sqrt(1 - t * t) : Math.sqrt(1 - (t -= 2) * t) + 1) / 2;\n}\n\nvar b1 = 4 / 11;\nvar b2 = 6 / 11;\nvar b3 = 8 / 11;\nvar b4 = 3 / 4;\nvar b5 = 9 / 11;\nvar b6 = 10 / 11;\nvar b7 = 15 / 16;\nvar b8 = 21 / 22;\nvar b9 = 63 / 64;\nvar b0 = 1 / b1 / b1;\n\nfunction bounceIn(t) {\n return 1 - bounceOut(1 - t);\n}\n\nfunction bounceOut(t) {\n return (t = +t) < b1 ? b0 * t * t : t < b3 ? b0 * (t -= b2) * t + b4 : t < b6 ? b0 * (t -= b5) * t + b7 : b0 * (t -= b8) * t + b9;\n}\n\nfunction bounceInOut(t) {\n return ((t *= 2) <= 1 ? 1 - bounceOut(1 - t) : bounceOut(t - 1) + 1) / 2;\n}\n\nvar overshoot = 1.70158;\n\nvar backIn = (function custom(s) {\n s = +s;\n\n function backIn(t) {\n return t * t * ((s + 1) * t - s);\n }\n\n backIn.overshoot = custom;\n\n return backIn;\n})(overshoot);\n\nvar backOut = (function custom(s) {\n s = +s;\n\n function backOut(t) {\n return --t * t * ((s + 1) * t + s) + 1;\n }\n\n backOut.overshoot = custom;\n\n return backOut;\n})(overshoot);\n\nvar backInOut = (function custom(s) {\n s = +s;\n\n function backInOut(t) {\n return ((t *= 2) < 1 ? t * t * ((s + 1) * t - s) : (t -= 2) * t * ((s + 1) * t + s) + 2) / 2;\n }\n\n backInOut.overshoot = custom;\n\n return backInOut;\n})(overshoot);\n\nvar tau = 2 * Math.PI;\nvar amplitude = 1;\nvar period = 0.3;\n\nvar elasticIn = (function custom(a, p) {\n var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau);\n\n function elasticIn(t) {\n return a * Math.pow(2, 10 * --t) * Math.sin((s - t) / p);\n }\n\n elasticIn.amplitude = function(a) { return custom(a, p * tau); };\n elasticIn.period = function(p) { return custom(a, p); };\n\n return elasticIn;\n})(amplitude, period);\n\nvar elasticOut = (function custom(a, p) {\n var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau);\n\n function elasticOut(t) {\n return 1 - a * Math.pow(2, -10 * (t = +t)) * Math.sin((t + s) / p);\n }\n\n elasticOut.amplitude = function(a) { return custom(a, p * tau); };\n elasticOut.period = function(p) { return custom(a, p); };\n\n return elasticOut;\n})(amplitude, period);\n\nvar elasticInOut = (function custom(a, p) {\n var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau);\n\n function elasticInOut(t) {\n return ((t = t * 2 - 1) < 0\n ? a * Math.pow(2, 10 * t) * Math.sin((s - t) / p)\n : 2 - a * Math.pow(2, -10 * t) * Math.sin((s + t) / p)) / 2;\n }\n\n elasticInOut.amplitude = function(a) { return custom(a, p * tau); };\n elasticInOut.period = function(p) { return custom(a, p); };\n\n return elasticInOut;\n})(amplitude, period);\n\nexports.easeLinear = linear;\nexports.easeQuad = quadInOut;\nexports.easeQuadIn = quadIn;\nexports.easeQuadOut = quadOut;\nexports.easeQuadInOut = quadInOut;\nexports.easeCubic = cubicInOut;\nexports.easeCubicIn = cubicIn;\nexports.easeCubicOut = cubicOut;\nexports.easeCubicInOut = cubicInOut;\nexports.easePoly = polyInOut;\nexports.easePolyIn = polyIn;\nexports.easePolyOut = polyOut;\nexports.easePolyInOut = polyInOut;\nexports.easeSin = sinInOut;\nexports.easeSinIn = sinIn;\nexports.easeSinOut = sinOut;\nexports.easeSinInOut = sinInOut;\nexports.easeExp = expInOut;\nexports.easeExpIn = expIn;\nexports.easeExpOut = expOut;\nexports.easeExpInOut = expInOut;\nexports.easeCircle = circleInOut;\nexports.easeCircleIn = circleIn;\nexports.easeCircleOut = circleOut;\nexports.easeCircleInOut = circleInOut;\nexports.easeBounce = bounceOut;\nexports.easeBounceIn = bounceIn;\nexports.easeBounceOut = bounceOut;\nexports.easeBounceInOut = bounceInOut;\nexports.easeBack = backInOut;\nexports.easeBackIn = backIn;\nexports.easeBackOut = backOut;\nexports.easeBackInOut = backInOut;\nexports.easeElastic = elasticOut;\nexports.easeElasticIn = elasticIn;\nexports.easeElasticOut = elasticOut;\nexports.easeElasticInOut = elasticInOut;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n})));\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/d3-ease/build/d3-ease.js\n// module id = 6\n// module chunks = 0\n//# sourceURL=webpack:///./~/d3-ease/build/d3-ease.js?")},function(module,exports,__webpack_require__){eval('// https://d3js.org/d3-scale/ Version 1.0.6. Copyright 2017 Mike Bostock.\n(function (global, factory) {\n\t true ? factory(exports, __webpack_require__(2), __webpack_require__(4), __webpack_require__(8), __webpack_require__(10), __webpack_require__(11), __webpack_require__(12), __webpack_require__(9)) :\n\ttypeof define === \'function\' && define.amd ? define([\'exports\', \'d3-array\', \'d3-collection\', \'d3-interpolate\', \'d3-format\', \'d3-time\', \'d3-time-format\', \'d3-color\'], factory) :\n\t(factory((global.d3 = global.d3 || {}),global.d3,global.d3,global.d3,global.d3,global.d3,global.d3,global.d3));\n}(this, (function (exports,d3Array,d3Collection,d3Interpolate,d3Format,d3Time,d3TimeFormat,d3Color) { \'use strict\';\n\nvar array = Array.prototype;\n\nvar map$1 = array.map;\nvar slice = array.slice;\n\nvar implicit = {name: "implicit"};\n\nfunction ordinal(range$$1) {\n var index = d3Collection.map(),\n domain = [],\n unknown = implicit;\n\n range$$1 = range$$1 == null ? [] : slice.call(range$$1);\n\n function scale(d) {\n var key = d + "", i = index.get(key);\n if (!i) {\n if (unknown !== implicit) return unknown;\n index.set(key, i = domain.push(d));\n }\n return range$$1[(i - 1) % range$$1.length];\n }\n\n scale.domain = function(_) {\n if (!arguments.length) return domain.slice();\n domain = [], index = d3Collection.map();\n var i = -1, n = _.length, d, key;\n while (++i < n) if (!index.has(key = (d = _[i]) + "")) index.set(key, domain.push(d));\n return scale;\n };\n\n scale.range = function(_) {\n return arguments.length ? (range$$1 = slice.call(_), scale) : range$$1.slice();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return ordinal()\n .domain(domain)\n .range(range$$1)\n .unknown(unknown);\n };\n\n return scale;\n}\n\nfunction band() {\n var scale = ordinal().unknown(undefined),\n domain = scale.domain,\n ordinalRange = scale.range,\n range$$1 = [0, 1],\n step,\n bandwidth,\n round = false,\n paddingInner = 0,\n paddingOuter = 0,\n align = 0.5;\n\n delete scale.unknown;\n\n function rescale() {\n var n = domain().length,\n reverse = range$$1[1] < range$$1[0],\n start = range$$1[reverse - 0],\n stop = range$$1[1 - reverse];\n step = (stop - start) / Math.max(1, n - paddingInner + paddingOuter * 2);\n if (round) step = Math.floor(step);\n start += (stop - start - step * (n - paddingInner)) * align;\n bandwidth = step * (1 - paddingInner);\n if (round) start = Math.round(start), bandwidth = Math.round(bandwidth);\n var values = d3Array.range(n).map(function(i) { return start + step * i; });\n return ordinalRange(reverse ? values.reverse() : values);\n }\n\n scale.domain = function(_) {\n return arguments.length ? (domain(_), rescale()) : domain();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range$$1 = [+_[0], +_[1]], rescale()) : range$$1.slice();\n };\n\n scale.rangeRound = function(_) {\n return range$$1 = [+_[0], +_[1]], round = true, rescale();\n };\n\n scale.bandwidth = function() {\n return bandwidth;\n };\n\n scale.step = function() {\n return step;\n };\n\n scale.round = function(_) {\n return arguments.length ? (round = !!_, rescale()) : round;\n };\n\n scale.padding = function(_) {\n return arguments.length ? (paddingInner = paddingOuter = Math.max(0, Math.min(1, _)), rescale()) : paddingInner;\n };\n\n scale.paddingInner = function(_) {\n return arguments.length ? (paddingInner = Math.max(0, Math.min(1, _)), rescale()) : paddingInner;\n };\n\n scale.paddingOuter = function(_) {\n return arguments.length ? (paddingOuter = Math.max(0, Math.min(1, _)), rescale()) : paddingOuter;\n };\n\n scale.align = function(_) {\n return arguments.length ? (align = Math.max(0, Math.min(1, _)), rescale()) : align;\n };\n\n scale.copy = function() {\n return band()\n .domain(domain())\n .range(range$$1)\n .round(round)\n .paddingInner(paddingInner)\n .paddingOuter(paddingOuter)\n .align(align);\n };\n\n return rescale();\n}\n\nfunction pointish(scale) {\n var copy = scale.copy;\n\n scale.padding = scale.paddingOuter;\n delete scale.paddingInner;\n delete scale.paddingOuter;\n\n scale.copy = function() {\n return pointish(copy());\n };\n\n return scale;\n}\n\nfunction point() {\n return pointish(band().paddingInner(1));\n}\n\nvar constant = function(x) {\n return function() {\n return x;\n };\n};\n\nvar number = function(x) {\n return +x;\n};\n\nvar unit = [0, 1];\n\nfunction deinterpolateLinear(a, b) {\n return (b -= (a = +a))\n ? function(x) { return (x - a) / b; }\n : constant(b);\n}\n\nfunction deinterpolateClamp(deinterpolate) {\n return function(a, b) {\n var d = deinterpolate(a = +a, b = +b);\n return function(x) { return x <= a ? 0 : x >= b ? 1 : d(x); };\n };\n}\n\nfunction reinterpolateClamp(reinterpolate) {\n return function(a, b) {\n var r = reinterpolate(a = +a, b = +b);\n return function(t) { return t <= 0 ? a : t >= 1 ? b : r(t); };\n };\n}\n\nfunction bimap(domain, range$$1, deinterpolate, reinterpolate) {\n var d0 = domain[0], d1 = domain[1], r0 = range$$1[0], r1 = range$$1[1];\n if (d1 < d0) d0 = deinterpolate(d1, d0), r0 = reinterpolate(r1, r0);\n else d0 = deinterpolate(d0, d1), r0 = reinterpolate(r0, r1);\n return function(x) { return r0(d0(x)); };\n}\n\nfunction polymap(domain, range$$1, deinterpolate, reinterpolate) {\n var j = Math.min(domain.length, range$$1.length) - 1,\n d = new Array(j),\n r = new Array(j),\n i = -1;\n\n // Reverse descending domains.\n if (domain[j] < domain[0]) {\n domain = domain.slice().reverse();\n range$$1 = range$$1.slice().reverse();\n }\n\n while (++i < j) {\n d[i] = deinterpolate(domain[i], domain[i + 1]);\n r[i] = reinterpolate(range$$1[i], range$$1[i + 1]);\n }\n\n return function(x) {\n var i = d3Array.bisect(domain, x, 1, j) - 1;\n return r[i](d[i](x));\n };\n}\n\nfunction copy(source, target) {\n return target\n .domain(source.domain())\n .range(source.range())\n .interpolate(source.interpolate())\n .clamp(source.clamp());\n}\n\n// deinterpolate(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1].\n// reinterpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding domain value x in [a,b].\nfunction continuous(deinterpolate, reinterpolate) {\n var domain = unit,\n range$$1 = unit,\n interpolate$$1 = d3Interpolate.interpolate,\n clamp = false,\n piecewise,\n output,\n input;\n\n function rescale() {\n piecewise = Math.min(domain.length, range$$1.length) > 2 ? polymap : bimap;\n output = input = null;\n return scale;\n }\n\n function scale(x) {\n return (output || (output = piecewise(domain, range$$1, clamp ? deinterpolateClamp(deinterpolate) : deinterpolate, interpolate$$1)))(+x);\n }\n\n scale.invert = function(y) {\n return (input || (input = piecewise(range$$1, domain, deinterpolateLinear, clamp ? reinterpolateClamp(reinterpolate) : reinterpolate)))(+y);\n };\n\n scale.domain = function(_) {\n return arguments.length ? (domain = map$1.call(_, number), rescale()) : domain.slice();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range$$1 = slice.call(_), rescale()) : range$$1.slice();\n };\n\n scale.rangeRound = function(_) {\n return range$$1 = slice.call(_), interpolate$$1 = d3Interpolate.interpolateRound, rescale();\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = !!_, rescale()) : clamp;\n };\n\n scale.interpolate = function(_) {\n return arguments.length ? (interpolate$$1 = _, rescale()) : interpolate$$1;\n };\n\n return rescale();\n}\n\nvar tickFormat = function(domain, count, specifier) {\n var start = domain[0],\n stop = domain[domain.length - 1],\n step = d3Array.tickStep(start, stop, count == null ? 10 : count),\n precision;\n specifier = d3Format.formatSpecifier(specifier == null ? ",f" : specifier);\n switch (specifier.type) {\n case "s": {\n var value = Math.max(Math.abs(start), Math.abs(stop));\n if (specifier.precision == null && !isNaN(precision = d3Format.precisionPrefix(step, value))) specifier.precision = precision;\n return d3Format.formatPrefix(specifier, value);\n }\n case "":\n case "e":\n case "g":\n case "p":\n case "r": {\n if (specifier.precision == null && !isNaN(precision = d3Format.precisionRound(step, Math.max(Math.abs(start), Math.abs(stop))))) specifier.precision = precision - (specifier.type === "e");\n break;\n }\n case "f":\n case "%": {\n if (specifier.precision == null && !isNaN(precision = d3Format.precisionFixed(step))) specifier.precision = precision - (specifier.type === "%") * 2;\n break;\n }\n }\n return d3Format.format(specifier);\n};\n\nfunction linearish(scale) {\n var domain = scale.domain;\n\n scale.ticks = function(count) {\n var d = domain();\n return d3Array.ticks(d[0], d[d.length - 1], count == null ? 10 : count);\n };\n\n scale.tickFormat = function(count, specifier) {\n return tickFormat(domain(), count, specifier);\n };\n\n scale.nice = function(count) {\n if (count == null) count = 10;\n\n var d = domain(),\n i0 = 0,\n i1 = d.length - 1,\n start = d[i0],\n stop = d[i1],\n step;\n\n if (stop < start) {\n step = start, start = stop, stop = step;\n step = i0, i0 = i1, i1 = step;\n }\n\n step = d3Array.tickIncrement(start, stop, count);\n\n if (step > 0) {\n start = Math.floor(start / step) * step;\n stop = Math.ceil(stop / step) * step;\n step = d3Array.tickIncrement(start, stop, count);\n } else if (step < 0) {\n start = Math.ceil(start * step) / step;\n stop = Math.floor(stop * step) / step;\n step = d3Array.tickIncrement(start, stop, count);\n }\n\n if (step > 0) {\n d[i0] = Math.floor(start / step) * step;\n d[i1] = Math.ceil(stop / step) * step;\n domain(d);\n } else if (step < 0) {\n d[i0] = Math.ceil(start * step) / step;\n d[i1] = Math.floor(stop * step) / step;\n domain(d);\n }\n\n return scale;\n };\n\n return scale;\n}\n\nfunction linear() {\n var scale = continuous(deinterpolateLinear, d3Interpolate.interpolateNumber);\n\n scale.copy = function() {\n return copy(scale, linear());\n };\n\n return linearish(scale);\n}\n\nfunction identity() {\n var domain = [0, 1];\n\n function scale(x) {\n return +x;\n }\n\n scale.invert = scale;\n\n scale.domain = scale.range = function(_) {\n return arguments.length ? (domain = map$1.call(_, number), scale) : domain.slice();\n };\n\n scale.copy = function() {\n return identity().domain(domain);\n };\n\n return linearish(scale);\n}\n\nvar nice = function(domain, interval) {\n domain = domain.slice();\n\n var i0 = 0,\n i1 = domain.length - 1,\n x0 = domain[i0],\n x1 = domain[i1],\n t;\n\n if (x1 < x0) {\n t = i0, i0 = i1, i1 = t;\n t = x0, x0 = x1, x1 = t;\n }\n\n domain[i0] = interval.floor(x0);\n domain[i1] = interval.ceil(x1);\n return domain;\n};\n\nfunction deinterpolate(a, b) {\n return (b = Math.log(b / a))\n ? function(x) { return Math.log(x / a) / b; }\n : constant(b);\n}\n\nfunction reinterpolate(a, b) {\n return a < 0\n ? function(t) { return -Math.pow(-b, t) * Math.pow(-a, 1 - t); }\n : function(t) { return Math.pow(b, t) * Math.pow(a, 1 - t); };\n}\n\nfunction pow10(x) {\n return isFinite(x) ? +("1e" + x) : x < 0 ? 0 : x;\n}\n\nfunction powp(base) {\n return base === 10 ? pow10\n : base === Math.E ? Math.exp\n : function(x) { return Math.pow(base, x); };\n}\n\nfunction logp(base) {\n return base === Math.E ? Math.log\n : base === 10 && Math.log10\n || base === 2 && Math.log2\n || (base = Math.log(base), function(x) { return Math.log(x) / base; });\n}\n\nfunction reflect(f) {\n return function(x) {\n return -f(-x);\n };\n}\n\nfunction log() {\n var scale = continuous(deinterpolate, reinterpolate).domain([1, 10]),\n domain = scale.domain,\n base = 10,\n logs = logp(10),\n pows = powp(10);\n\n function rescale() {\n logs = logp(base), pows = powp(base);\n if (domain()[0] < 0) logs = reflect(logs), pows = reflect(pows);\n return scale;\n }\n\n scale.base = function(_) {\n return arguments.length ? (base = +_, rescale()) : base;\n };\n\n scale.domain = function(_) {\n return arguments.length ? (domain(_), rescale()) : domain();\n };\n\n scale.ticks = function(count) {\n var d = domain(),\n u = d[0],\n v = d[d.length - 1],\n r;\n\n if (r = v < u) i = u, u = v, v = i;\n\n var i = logs(u),\n j = logs(v),\n p,\n k,\n t,\n n = count == null ? 10 : +count,\n z = [];\n\n if (!(base % 1) && j - i < n) {\n i = Math.round(i) - 1, j = Math.round(j) + 1;\n if (u > 0) for (; i < j; ++i) {\n for (k = 1, p = pows(i); k < base; ++k) {\n t = p * k;\n if (t < u) continue;\n if (t > v) break;\n z.push(t);\n }\n } else for (; i < j; ++i) {\n for (k = base - 1, p = pows(i); k >= 1; --k) {\n t = p * k;\n if (t < u) continue;\n if (t > v) break;\n z.push(t);\n }\n }\n } else {\n z = d3Array.ticks(i, j, Math.min(j - i, n)).map(pows);\n }\n\n return r ? z.reverse() : z;\n };\n\n scale.tickFormat = function(count, specifier) {\n if (specifier == null) specifier = base === 10 ? ".0e" : ",";\n if (typeof specifier !== "function") specifier = d3Format.format(specifier);\n if (count === Infinity) return specifier;\n if (count == null) count = 10;\n var k = Math.max(1, base * count / scale.ticks().length); // TODO fast estimate?\n return function(d) {\n var i = d / pows(Math.round(logs(d)));\n if (i * base < base - 0.5) i *= base;\n return i <= k ? specifier(d) : "";\n };\n };\n\n scale.nice = function() {\n return domain(nice(domain(), {\n floor: function(x) { return pows(Math.floor(logs(x))); },\n ceil: function(x) { return pows(Math.ceil(logs(x))); }\n }));\n };\n\n scale.copy = function() {\n return copy(scale, log().base(base));\n };\n\n return scale;\n}\n\nfunction raise(x, exponent) {\n return x < 0 ? -Math.pow(-x, exponent) : Math.pow(x, exponent);\n}\n\nfunction pow() {\n var exponent = 1,\n scale = continuous(deinterpolate, reinterpolate),\n domain = scale.domain;\n\n function deinterpolate(a, b) {\n return (b = raise(b, exponent) - (a = raise(a, exponent)))\n ? function(x) { return (raise(x, exponent) - a) / b; }\n : constant(b);\n }\n\n function reinterpolate(a, b) {\n b = raise(b, exponent) - (a = raise(a, exponent));\n return function(t) { return raise(a + b * t, 1 / exponent); };\n }\n\n scale.exponent = function(_) {\n return arguments.length ? (exponent = +_, domain(domain())) : exponent;\n };\n\n scale.copy = function() {\n return copy(scale, pow().exponent(exponent));\n };\n\n return linearish(scale);\n}\n\nfunction sqrt() {\n return pow().exponent(0.5);\n}\n\nfunction quantile$1() {\n var domain = [],\n range$$1 = [],\n thresholds = [];\n\n function rescale() {\n var i = 0, n = Math.max(1, range$$1.length);\n thresholds = new Array(n - 1);\n while (++i < n) thresholds[i - 1] = d3Array.quantile(domain, i / n);\n return scale;\n }\n\n function scale(x) {\n if (!isNaN(x = +x)) return range$$1[d3Array.bisect(thresholds, x)];\n }\n\n scale.invertExtent = function(y) {\n var i = range$$1.indexOf(y);\n return i < 0 ? [NaN, NaN] : [\n i > 0 ? thresholds[i - 1] : domain[0],\n i < thresholds.length ? thresholds[i] : domain[domain.length - 1]\n ];\n };\n\n scale.domain = function(_) {\n if (!arguments.length) return domain.slice();\n domain = [];\n for (var i = 0, n = _.length, d; i < n; ++i) if (d = _[i], d != null && !isNaN(d = +d)) domain.push(d);\n domain.sort(d3Array.ascending);\n return rescale();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range$$1 = slice.call(_), rescale()) : range$$1.slice();\n };\n\n scale.quantiles = function() {\n return thresholds.slice();\n };\n\n scale.copy = function() {\n return quantile$1()\n .domain(domain)\n .range(range$$1);\n };\n\n return scale;\n}\n\nfunction quantize() {\n var x0 = 0,\n x1 = 1,\n n = 1,\n domain = [0.5],\n range$$1 = [0, 1];\n\n function scale(x) {\n if (x <= x) return range$$1[d3Array.bisect(domain, x, 0, n)];\n }\n\n function rescale() {\n var i = -1;\n domain = new Array(n);\n while (++i < n) domain[i] = ((i + 1) * x1 - (i - n) * x0) / (n + 1);\n return scale;\n }\n\n scale.domain = function(_) {\n return arguments.length ? (x0 = +_[0], x1 = +_[1], rescale()) : [x0, x1];\n };\n\n scale.range = function(_) {\n return arguments.length ? (n = (range$$1 = slice.call(_)).length - 1, rescale()) : range$$1.slice();\n };\n\n scale.invertExtent = function(y) {\n var i = range$$1.indexOf(y);\n return i < 0 ? [NaN, NaN]\n : i < 1 ? [x0, domain[0]]\n : i >= n ? [domain[n - 1], x1]\n : [domain[i - 1], domain[i]];\n };\n\n scale.copy = function() {\n return quantize()\n .domain([x0, x1])\n .range(range$$1);\n };\n\n return linearish(scale);\n}\n\nfunction threshold() {\n var domain = [0.5],\n range$$1 = [0, 1],\n n = 1;\n\n function scale(x) {\n if (x <= x) return range$$1[d3Array.bisect(domain, x, 0, n)];\n }\n\n scale.domain = function(_) {\n return arguments.length ? (domain = slice.call(_), n = Math.min(domain.length, range$$1.length - 1), scale) : domain.slice();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range$$1 = slice.call(_), n = Math.min(domain.length, range$$1.length - 1), scale) : range$$1.slice();\n };\n\n scale.invertExtent = function(y) {\n var i = range$$1.indexOf(y);\n return [domain[i - 1], domain[i]];\n };\n\n scale.copy = function() {\n return threshold()\n .domain(domain)\n .range(range$$1);\n };\n\n return scale;\n}\n\nvar durationSecond = 1000;\nvar durationMinute = durationSecond * 60;\nvar durationHour = durationMinute * 60;\nvar durationDay = durationHour * 24;\nvar durationWeek = durationDay * 7;\nvar durationMonth = durationDay * 30;\nvar durationYear = durationDay * 365;\n\nfunction date(t) {\n return new Date(t);\n}\n\nfunction number$1(t) {\n return t instanceof Date ? +t : +new Date(+t);\n}\n\nfunction calendar(year, month, week, day, hour, minute, second, millisecond, format$$1) {\n var scale = continuous(deinterpolateLinear, d3Interpolate.interpolateNumber),\n invert = scale.invert,\n domain = scale.domain;\n\n var formatMillisecond = format$$1(".%L"),\n formatSecond = format$$1(":%S"),\n formatMinute = format$$1("%I:%M"),\n formatHour = format$$1("%I %p"),\n formatDay = format$$1("%a %d"),\n formatWeek = format$$1("%b %d"),\n formatMonth = format$$1("%B"),\n formatYear = format$$1("%Y");\n\n var tickIntervals = [\n [second, 1, durationSecond],\n [second, 5, 5 * durationSecond],\n [second, 15, 15 * durationSecond],\n [second, 30, 30 * durationSecond],\n [minute, 1, durationMinute],\n [minute, 5, 5 * durationMinute],\n [minute, 15, 15 * durationMinute],\n [minute, 30, 30 * durationMinute],\n [ hour, 1, durationHour ],\n [ hour, 3, 3 * durationHour ],\n [ hour, 6, 6 * durationHour ],\n [ hour, 12, 12 * durationHour ],\n [ day, 1, durationDay ],\n [ day, 2, 2 * durationDay ],\n [ week, 1, durationWeek ],\n [ month, 1, durationMonth ],\n [ month, 3, 3 * durationMonth ],\n [ year, 1, durationYear ]\n ];\n\n function tickFormat(date) {\n return (second(date) < date ? formatMillisecond\n : minute(date) < date ? formatSecond\n : hour(date) < date ? formatMinute\n : day(date) < date ? formatHour\n : month(date) < date ? (week(date) < date ? formatDay : formatWeek)\n : year(date) < date ? formatMonth\n : formatYear)(date);\n }\n\n function tickInterval(interval, start, stop, step) {\n if (interval == null) interval = 10;\n\n // If a desired tick count is specified, pick a reasonable tick interval\n // based on the extent of the domain and a rough estimate of tick size.\n // Otherwise, assume interval is already a time interval and use it.\n if (typeof interval === "number") {\n var target = Math.abs(stop - start) / interval,\n i = d3Array.bisector(function(i) { return i[2]; }).right(tickIntervals, target);\n if (i === tickIntervals.length) {\n step = d3Array.tickStep(start / durationYear, stop / durationYear, interval);\n interval = year;\n } else if (i) {\n i = tickIntervals[target / tickIntervals[i - 1][2] < tickIntervals[i][2] / target ? i - 1 : i];\n step = i[1];\n interval = i[0];\n } else {\n step = d3Array.tickStep(start, stop, interval);\n interval = millisecond;\n }\n }\n\n return step == null ? interval : interval.every(step);\n }\n\n scale.invert = function(y) {\n return new Date(invert(y));\n };\n\n scale.domain = function(_) {\n return arguments.length ? domain(map$1.call(_, number$1)) : domain().map(date);\n };\n\n scale.ticks = function(interval, step) {\n var d = domain(),\n t0 = d[0],\n t1 = d[d.length - 1],\n r = t1 < t0,\n t;\n if (r) t = t0, t0 = t1, t1 = t;\n t = tickInterval(interval, t0, t1, step);\n t = t ? t.range(t0, t1 + 1) : []; // inclusive stop\n return r ? t.reverse() : t;\n };\n\n scale.tickFormat = function(count, specifier) {\n return specifier == null ? tickFormat : format$$1(specifier);\n };\n\n scale.nice = function(interval, step) {\n var d = domain();\n return (interval = tickInterval(interval, d[0], d[d.length - 1], step))\n ? domain(nice(d, interval))\n : scale;\n };\n\n scale.copy = function() {\n return copy(scale, calendar(year, month, week, day, hour, minute, second, millisecond, format$$1));\n };\n\n return scale;\n}\n\nvar time = function() {\n return calendar(d3Time.timeYear, d3Time.timeMonth, d3Time.timeWeek, d3Time.timeDay, d3Time.timeHour, d3Time.timeMinute, d3Time.timeSecond, d3Time.timeMillisecond, d3TimeFormat.timeFormat).domain([new Date(2000, 0, 1), new Date(2000, 0, 2)]);\n};\n\nvar utcTime = function() {\n return calendar(d3Time.utcYear, d3Time.utcMonth, d3Time.utcWeek, d3Time.utcDay, d3Time.utcHour, d3Time.utcMinute, d3Time.utcSecond, d3Time.utcMillisecond, d3TimeFormat.utcFormat).domain([Date.UTC(2000, 0, 1), Date.UTC(2000, 0, 2)]);\n};\n\nvar colors = function(s) {\n return s.match(/.{6}/g).map(function(x) {\n return "#" + x;\n });\n};\n\nvar category10 = colors("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf");\n\nvar category20b = colors("393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6");\n\nvar category20c = colors("3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9");\n\nvar category20 = colors("1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5");\n\nvar cubehelix$1 = d3Interpolate.interpolateCubehelixLong(d3Color.cubehelix(300, 0.5, 0.0), d3Color.cubehelix(-240, 0.5, 1.0));\n\nvar warm = d3Interpolate.interpolateCubehelixLong(d3Color.cubehelix(-100, 0.75, 0.35), d3Color.cubehelix(80, 1.50, 0.8));\n\nvar cool = d3Interpolate.interpolateCubehelixLong(d3Color.cubehelix(260, 0.75, 0.35), d3Color.cubehelix(80, 1.50, 0.8));\n\nvar rainbow = d3Color.cubehelix();\n\nvar rainbow$1 = function(t) {\n if (t < 0 || t > 1) t -= Math.floor(t);\n var ts = Math.abs(t - 0.5);\n rainbow.h = 360 * t - 100;\n rainbow.s = 1.5 - 1.5 * ts;\n rainbow.l = 0.8 - 0.9 * ts;\n return rainbow + "";\n};\n\nfunction ramp(range$$1) {\n var n = range$$1.length;\n return function(t) {\n return range$$1[Math.max(0, Math.min(n - 1, Math.floor(t * n)))];\n };\n}\n\nvar viridis = ramp(colors("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));\n\nvar magma = ramp(colors("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf"));\n\nvar inferno = ramp(colors("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4"));\n\nvar plasma = ramp(colors("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));\n\nfunction sequential(interpolator) {\n var x0 = 0,\n x1 = 1,\n clamp = false;\n\n function scale(x) {\n var t = (x - x0) / (x1 - x0);\n return interpolator(clamp ? Math.max(0, Math.min(1, t)) : t);\n }\n\n scale.domain = function(_) {\n return arguments.length ? (x0 = +_[0], x1 = +_[1], scale) : [x0, x1];\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = !!_, scale) : clamp;\n };\n\n scale.interpolator = function(_) {\n return arguments.length ? (interpolator = _, scale) : interpolator;\n };\n\n scale.copy = function() {\n return sequential(interpolator).domain([x0, x1]).clamp(clamp);\n };\n\n return linearish(scale);\n}\n\nexports.scaleBand = band;\nexports.scalePoint = point;\nexports.scaleIdentity = identity;\nexports.scaleLinear = linear;\nexports.scaleLog = log;\nexports.scaleOrdinal = ordinal;\nexports.scaleImplicit = implicit;\nexports.scalePow = pow;\nexports.scaleSqrt = sqrt;\nexports.scaleQuantile = quantile$1;\nexports.scaleQuantize = quantize;\nexports.scaleThreshold = threshold;\nexports.scaleTime = time;\nexports.scaleUtc = utcTime;\nexports.schemeCategory10 = category10;\nexports.schemeCategory20b = category20b;\nexports.schemeCategory20c = category20c;\nexports.schemeCategory20 = category20;\nexports.interpolateCubehelixDefault = cubehelix$1;\nexports.interpolateRainbow = rainbow$1;\nexports.interpolateWarm = warm;\nexports.interpolateCool = cool;\nexports.interpolateViridis = viridis;\nexports.interpolateMagma = magma;\nexports.interpolateInferno = inferno;\nexports.interpolatePlasma = plasma;\nexports.scaleSequential = sequential;\n\nObject.defineProperty(exports, \'__esModule\', { value: true });\n\n})));\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/d3-scale/build/d3-scale.js\n// module id = 7\n// module chunks = 0\n//# sourceURL=webpack:///./~/d3-scale/build/d3-scale.js?'); | |
},function(module,exports,__webpack_require__){eval('// https://d3js.org/d3-interpolate/ Version 1.1.5. Copyright 2017 Mike Bostock.\n(function (global, factory) {\n\t true ? factory(exports, __webpack_require__(9)) :\n\ttypeof define === \'function\' && define.amd ? define([\'exports\', \'d3-color\'], factory) :\n\t(factory((global.d3 = global.d3 || {}),global.d3));\n}(this, (function (exports,d3Color) { \'use strict\';\n\nfunction basis(t1, v0, v1, v2, v3) {\n var t2 = t1 * t1, t3 = t2 * t1;\n return ((1 - 3 * t1 + 3 * t2 - t3) * v0\n + (4 - 6 * t2 + 3 * t3) * v1\n + (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2\n + t3 * v3) / 6;\n}\n\nvar basis$1 = function(values) {\n var n = values.length - 1;\n return function(t) {\n var i = t <= 0 ? (t = 0) : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n),\n v1 = values[i],\n v2 = values[i + 1],\n v0 = i > 0 ? values[i - 1] : 2 * v1 - v2,\n v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1;\n return basis((t - i / n) * n, v0, v1, v2, v3);\n };\n};\n\nvar basisClosed = function(values) {\n var n = values.length;\n return function(t) {\n var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n),\n v0 = values[(i + n - 1) % n],\n v1 = values[i % n],\n v2 = values[(i + 1) % n],\n v3 = values[(i + 2) % n];\n return basis((t - i / n) * n, v0, v1, v2, v3);\n };\n};\n\nvar constant = function(x) {\n return function() {\n return x;\n };\n};\n\nfunction linear(a, d) {\n return function(t) {\n return a + t * d;\n };\n}\n\nfunction exponential(a, b, y) {\n return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) {\n return Math.pow(a + t * b, y);\n };\n}\n\nfunction hue(a, b) {\n var d = b - a;\n return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant(isNaN(a) ? b : a);\n}\n\nfunction gamma(y) {\n return (y = +y) === 1 ? nogamma : function(a, b) {\n return b - a ? exponential(a, b, y) : constant(isNaN(a) ? b : a);\n };\n}\n\nfunction nogamma(a, b) {\n var d = b - a;\n return d ? linear(a, d) : constant(isNaN(a) ? b : a);\n}\n\nvar rgb$1 = ((function rgbGamma(y) {\n var color$$1 = gamma(y);\n\n function rgb$$1(start, end) {\n var r = color$$1((start = d3Color.rgb(start)).r, (end = d3Color.rgb(end)).r),\n g = color$$1(start.g, end.g),\n b = color$$1(start.b, end.b),\n opacity = nogamma(start.opacity, end.opacity);\n return function(t) {\n start.r = r(t);\n start.g = g(t);\n start.b = b(t);\n start.opacity = opacity(t);\n return start + "";\n };\n }\n\n rgb$$1.gamma = rgbGamma;\n\n return rgb$$1;\n}))(1);\n\nfunction rgbSpline(spline) {\n return function(colors) {\n var n = colors.length,\n r = new Array(n),\n g = new Array(n),\n b = new Array(n),\n i, color$$1;\n for (i = 0; i < n; ++i) {\n color$$1 = d3Color.rgb(colors[i]);\n r[i] = color$$1.r || 0;\n g[i] = color$$1.g || 0;\n b[i] = color$$1.b || 0;\n }\n r = spline(r);\n g = spline(g);\n b = spline(b);\n color$$1.opacity = 1;\n return function(t) {\n color$$1.r = r(t);\n color$$1.g = g(t);\n color$$1.b = b(t);\n return color$$1 + "";\n };\n };\n}\n\nvar rgbBasis = rgbSpline(basis$1);\nvar rgbBasisClosed = rgbSpline(basisClosed);\n\nvar array = function(a, b) {\n var nb = b ? b.length : 0,\n na = a ? Math.min(nb, a.length) : 0,\n x = new Array(nb),\n c = new Array(nb),\n i;\n\n for (i = 0; i < na; ++i) x[i] = value(a[i], b[i]);\n for (; i < nb; ++i) c[i] = b[i];\n\n return function(t) {\n for (i = 0; i < na; ++i) c[i] = x[i](t);\n return c;\n };\n};\n\nvar date = function(a, b) {\n var d = new Date;\n return a = +a, b -= a, function(t) {\n return d.setTime(a + b * t), d;\n };\n};\n\nvar number = function(a, b) {\n return a = +a, b -= a, function(t) {\n return a + b * t;\n };\n};\n\nvar object = function(a, b) {\n var i = {},\n c = {},\n k;\n\n if (a === null || typeof a !== "object") a = {};\n if (b === null || typeof b !== "object") b = {};\n\n for (k in b) {\n if (k in a) {\n i[k] = value(a[k], b[k]);\n } else {\n c[k] = b[k];\n }\n }\n\n return function(t) {\n for (k in i) c[k] = i[k](t);\n return c;\n };\n};\n\nvar reA = /[-+]?(?:\\d+\\.?\\d*|\\.?\\d+)(?:[eE][-+]?\\d+)?/g;\nvar reB = new RegExp(reA.source, "g");\n\nfunction zero(b) {\n return function() {\n return b;\n };\n}\n\nfunction one(b) {\n return function(t) {\n return b(t) + "";\n };\n}\n\nvar string = function(a, b) {\n var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b\n am, // current match in a\n bm, // current match in b\n bs, // string preceding current number in b, if any\n i = -1, // index in s\n s = [], // string constants and placeholders\n q = []; // number interpolators\n\n // Coerce inputs to strings.\n a = a + "", b = b + "";\n\n // Interpolate pairs of numbers in a & b.\n while ((am = reA.exec(a))\n && (bm = reB.exec(b))) {\n if ((bs = bm.index) > bi) { // a string precedes the next number in b\n bs = b.slice(bi, bs);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match\n if (s[i]) s[i] += bm; // coalesce with previous string\n else s[++i] = bm;\n } else { // interpolate non-matching numbers\n s[++i] = null;\n q.push({i: i, x: number(am, bm)});\n }\n bi = reB.lastIndex;\n }\n\n // Add remains of b.\n if (bi < b.length) {\n bs = b.slice(bi);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n\n // Special optimization for only a single match.\n // Otherwise, interpolate each of the numbers and rejoin the string.\n return s.length < 2 ? (q[0]\n ? one(q[0].x)\n : zero(b))\n : (b = q.length, function(t) {\n for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);\n return s.join("");\n });\n};\n\nvar value = function(a, b) {\n var t = typeof b, c;\n return b == null || t === "boolean" ? constant(b)\n : (t === "number" ? number\n : t === "string" ? ((c = d3Color.color(b)) ? (b = c, rgb$1) : string)\n : b instanceof d3Color.color ? rgb$1\n : b instanceof Date ? date\n : Array.isArray(b) ? array\n : typeof b.valueOf !== "function" && typeof b.toString !== "function" || isNaN(b) ? object\n : number)(a, b);\n};\n\nvar round = function(a, b) {\n return a = +a, b -= a, function(t) {\n return Math.round(a + b * t);\n };\n};\n\nvar degrees = 180 / Math.PI;\n\nvar identity = {\n translateX: 0,\n translateY: 0,\n rotate: 0,\n skewX: 0,\n scaleX: 1,\n scaleY: 1\n};\n\nvar decompose = function(a, b, c, d, e, f) {\n var scaleX, scaleY, skewX;\n if (scaleX = Math.sqrt(a * a + b * b)) a /= scaleX, b /= scaleX;\n if (skewX = a * c + b * d) c -= a * skewX, d -= b * skewX;\n if (scaleY = Math.sqrt(c * c + d * d)) c /= scaleY, d /= scaleY, skewX /= scaleY;\n if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX;\n return {\n translateX: e,\n translateY: f,\n rotate: Math.atan2(b, a) * degrees,\n skewX: Math.atan(skewX) * degrees,\n scaleX: scaleX,\n scaleY: scaleY\n };\n};\n\nvar cssNode;\nvar cssRoot;\nvar cssView;\nvar svgNode;\n\nfunction parseCss(value) {\n if (value === "none") return identity;\n if (!cssNode) cssNode = document.createElement("DIV"), cssRoot = document.documentElement, cssView = document.defaultView;\n cssNode.style.transform = value;\n value = cssView.getComputedStyle(cssRoot.appendChild(cssNode), null).getPropertyValue("transform");\n cssRoot.removeChild(cssNode);\n value = value.slice(7, -1).split(",");\n return decompose(+value[0], +value[1], +value[2], +value[3], +value[4], +value[5]);\n}\n\nfunction parseSvg(value) {\n if (value == null) return identity;\n if (!svgNode) svgNode = document.createElementNS("http://www.w3.org/2000/svg", "g");\n svgNode.setAttribute("transform", value);\n if (!(value = svgNode.transform.baseVal.consolidate())) return identity;\n value = value.matrix;\n return decompose(value.a, value.b, value.c, value.d, value.e, value.f);\n}\n\nfunction interpolateTransform(parse, pxComma, pxParen, degParen) {\n\n function pop(s) {\n return s.length ? s.pop() + " " : "";\n }\n\n function translate(xa, ya, xb, yb, s, q) {\n if (xa !== xb || ya !== yb) {\n var i = s.push("translate(", null, pxComma, null, pxParen);\n q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});\n } else if (xb || yb) {\n s.push("translate(" + xb + pxComma + yb + pxParen);\n }\n }\n\n function rotate(a, b, s, q) {\n if (a !== b) {\n if (a - b > 180) b += 360; else if (b - a > 180) a += 360; // shortest path\n q.push({i: s.push(pop(s) + "rotate(", null, degParen) - 2, x: number(a, b)});\n } else if (b) {\n s.push(pop(s) + "rotate(" + b + degParen);\n }\n }\n\n function skewX(a, b, s, q) {\n if (a !== b) {\n q.push({i: s.push(pop(s) + "skewX(", null, degParen) - 2, x: number(a, b)});\n } else if (b) {\n s.push(pop(s) + "skewX(" + b + degParen);\n }\n }\n\n function scale(xa, ya, xb, yb, s, q) {\n if (xa !== xb || ya !== yb) {\n var i = s.push(pop(s) + "scale(", null, ",", null, ")");\n q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});\n } else if (xb !== 1 || yb !== 1) {\n s.push(pop(s) + "scale(" + xb + "," + yb + ")");\n }\n }\n\n return function(a, b) {\n var s = [], // string constants and placeholders\n q = []; // number interpolators\n a = parse(a), b = parse(b);\n translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q);\n rotate(a.rotate, b.rotate, s, q);\n skewX(a.skewX, b.skewX, s, q);\n scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q);\n a = b = null; // gc\n return function(t) {\n var i = -1, n = q.length, o;\n while (++i < n) s[(o = q[i]).i] = o.x(t);\n return s.join("");\n };\n };\n}\n\nvar interpolateTransformCss = interpolateTransform(parseCss, "px, ", "px)", "deg)");\nvar interpolateTransformSvg = interpolateTransform(parseSvg, ", ", ")", ")");\n\nvar rho = Math.SQRT2;\nvar rho2 = 2;\nvar rho4 = 4;\nvar epsilon2 = 1e-12;\n\nfunction cosh(x) {\n return ((x = Math.exp(x)) + 1 / x) / 2;\n}\n\nfunction sinh(x) {\n return ((x = Math.exp(x)) - 1 / x) / 2;\n}\n\nfunction tanh(x) {\n return ((x = Math.exp(2 * x)) - 1) / (x + 1);\n}\n\n// p0 = [ux0, uy0, w0]\n// p1 = [ux1, uy1, w1]\nvar zoom = function(p0, p1) {\n var ux0 = p0[0], uy0 = p0[1], w0 = p0[2],\n ux1 = p1[0], uy1 = p1[1], w1 = p1[2],\n dx = ux1 - ux0,\n dy = uy1 - uy0,\n d2 = dx * dx + dy * dy,\n i,\n S;\n\n // Special case for u0 ≅ u1.\n if (d2 < epsilon2) {\n S = Math.log(w1 / w0) / rho;\n i = function(t) {\n return [\n ux0 + t * dx,\n uy0 + t * dy,\n w0 * Math.exp(rho * t * S)\n ];\n };\n }\n\n // General case.\n else {\n var d1 = Math.sqrt(d2),\n b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1),\n b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1),\n r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0),\n r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);\n S = (r1 - r0) / rho;\n i = function(t) {\n var s = t * S,\n coshr0 = cosh(r0),\n u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0));\n return [\n ux0 + u * dx,\n uy0 + u * dy,\n w0 * coshr0 / cosh(rho * s + r0)\n ];\n };\n }\n\n i.duration = S * 1000;\n\n return i;\n};\n\nfunction hsl$1(hue$$1) {\n return function(start, end) {\n var h = hue$$1((start = d3Color.hsl(start)).h, (end = d3Color.hsl(end)).h),\n s = nogamma(start.s, end.s),\n l = nogamma(start.l, end.l),\n opacity = nogamma(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.s = s(t);\n start.l = l(t);\n start.opacity = opacity(t);\n return start + "";\n };\n }\n}\n\nvar hsl$2 = hsl$1(hue);\nvar hslLong = hsl$1(nogamma);\n\nfunction lab$1(start, end) {\n var l = nogamma((start = d3Color.lab(start)).l, (end = d3Color.lab(end)).l),\n a = nogamma(start.a, end.a),\n b = nogamma(start.b, end.b),\n opacity = nogamma(start.opacity, end.opacity);\n return function(t) {\n start.l = l(t);\n start.a = a(t);\n start.b = b(t);\n start.opacity = opacity(t);\n return start + "";\n };\n}\n\nfunction hcl$1(hue$$1) {\n return function(start, end) {\n var h = hue$$1((start = d3Color.hcl(start)).h, (end = d3Color.hcl(end)).h),\n c = nogamma(start.c, end.c),\n l = nogamma(start.l, end.l),\n opacity = nogamma(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.c = c(t);\n start.l = l(t);\n start.opacity = opacity(t);\n return start + "";\n };\n }\n}\n\nvar hcl$2 = hcl$1(hue);\nvar hclLong = hcl$1(nogamma);\n\nfunction cubehelix$1(hue$$1) {\n return (function cubehelixGamma(y) {\n y = +y;\n\n function cubehelix$$1(start, end) {\n var h = hue$$1((start = d3Color.cubehelix(start)).h, (end = d3Color.cubehelix(end)).h),\n s = nogamma(start.s, end.s),\n l = nogamma(start.l, end.l),\n opacity = nogamma(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.s = s(t);\n start.l = l(Math.pow(t, y));\n start.opacity = opacity(t);\n return start + "";\n };\n }\n\n cubehelix$$1.gamma = cubehelixGamma;\n\n return cubehelix$$1;\n })(1);\n}\n\nvar cubehelix$2 = cubehelix$1(hue);\nvar cubehelixLong = cubehelix$1(nogamma);\n\nvar quantize = function(interpolator, n) {\n var samples = new Array(n);\n for (var i = 0; i < n; ++i) samples[i] = interpolator(i / (n - 1));\n return samples;\n};\n\nexports.interpolate = value;\nexports.interpolateArray = array;\nexports.interpolateBasis = basis$1;\nexports.interpolateBasisClosed = basisClosed;\nexports.interpolateDate = date;\nexports.interpolateNumber = number;\nexports.interpolateObject = object;\nexports.interpolateRound = round;\nexports.interpolateString = string;\nexports.interpolateTransformCss = interpolateTransformCss;\nexports.interpolateTransformSvg = interpolateTransformSvg;\nexports.interpolateZoom = zoom;\nexports.interpolateRgb = rgb$1;\nexports.interpolateRgbBasis = rgbBasis;\nexports.interpolateRgbBasisClosed = rgbBasisClosed;\nexports.interpolateHsl = hsl$2;\nexports.interpolateHslLong = hslLong;\nexports.interpolateLab = lab$1;\nexports.interpolateHcl = hcl$2;\nexports.interpolateHclLong = hclLong;\nexports.interpolateCubehelix = cubehelix$2;\nexports.interpolateCubehelixLong = cubehelixLong;\nexports.quantize = quantize;\n\nObject.defineProperty(exports, \'__esModule\', { value: true });\n\n})));\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/d3-interpolate/build/d3-interpolate.js\n// module id = 8\n// module chunks = 0\n//# sourceURL=webpack:///./~/d3-interpolate/build/d3-interpolate.js?')},function(module,exports,__webpack_require__){eval('// https://d3js.org/d3-color/ Version 1.0.3. Copyright 2017 Mike Bostock.\n(function (global, factory) {\n\t true ? factory(exports) :\n\ttypeof define === \'function\' && define.amd ? define([\'exports\'], factory) :\n\t(factory((global.d3 = global.d3 || {})));\n}(this, (function (exports) { \'use strict\';\n\nvar define = function(constructor, factory, prototype) {\n constructor.prototype = factory.prototype = prototype;\n prototype.constructor = constructor;\n};\n\nfunction extend(parent, definition) {\n var prototype = Object.create(parent.prototype);\n for (var key in definition) prototype[key] = definition[key];\n return prototype;\n}\n\nfunction Color() {}\n\nvar darker = 0.7;\nvar brighter = 1 / darker;\n\nvar reI = "\\\\s*([+-]?\\\\d+)\\\\s*";\nvar reN = "\\\\s*([+-]?\\\\d*\\\\.?\\\\d+(?:[eE][+-]?\\\\d+)?)\\\\s*";\nvar reP = "\\\\s*([+-]?\\\\d*\\\\.?\\\\d+(?:[eE][+-]?\\\\d+)?)%\\\\s*";\nvar reHex3 = /^#([0-9a-f]{3})$/;\nvar reHex6 = /^#([0-9a-f]{6})$/;\nvar reRgbInteger = new RegExp("^rgb\\\\(" + [reI, reI, reI] + "\\\\)$");\nvar reRgbPercent = new RegExp("^rgb\\\\(" + [reP, reP, reP] + "\\\\)$");\nvar reRgbaInteger = new RegExp("^rgba\\\\(" + [reI, reI, reI, reN] + "\\\\)$");\nvar reRgbaPercent = new RegExp("^rgba\\\\(" + [reP, reP, reP, reN] + "\\\\)$");\nvar reHslPercent = new RegExp("^hsl\\\\(" + [reN, reP, reP] + "\\\\)$");\nvar reHslaPercent = new RegExp("^hsla\\\\(" + [reN, reP, reP, reN] + "\\\\)$");\n\nvar named = {\n aliceblue: 0xf0f8ff,\n antiquewhite: 0xfaebd7,\n aqua: 0x00ffff,\n aquamarine: 0x7fffd4,\n azure: 0xf0ffff,\n beige: 0xf5f5dc,\n bisque: 0xffe4c4,\n black: 0x000000,\n blanchedalmond: 0xffebcd,\n blue: 0x0000ff,\n blueviolet: 0x8a2be2,\n brown: 0xa52a2a,\n burlywood: 0xdeb887,\n cadetblue: 0x5f9ea0,\n chartreuse: 0x7fff00,\n chocolate: 0xd2691e,\n coral: 0xff7f50,\n cornflowerblue: 0x6495ed,\n cornsilk: 0xfff8dc,\n crimson: 0xdc143c,\n cyan: 0x00ffff,\n darkblue: 0x00008b,\n darkcyan: 0x008b8b,\n darkgoldenrod: 0xb8860b,\n darkgray: 0xa9a9a9,\n darkgreen: 0x006400,\n darkgrey: 0xa9a9a9,\n darkkhaki: 0xbdb76b,\n darkmagenta: 0x8b008b,\n darkolivegreen: 0x556b2f,\n darkorange: 0xff8c00,\n darkorchid: 0x9932cc,\n darkred: 0x8b0000,\n darksalmon: 0xe9967a,\n darkseagreen: 0x8fbc8f,\n darkslateblue: 0x483d8b,\n darkslategray: 0x2f4f4f,\n darkslategrey: 0x2f4f4f,\n darkturquoise: 0x00ced1,\n darkviolet: 0x9400d3,\n deeppink: 0xff1493,\n deepskyblue: 0x00bfff,\n dimgray: 0x696969,\n dimgrey: 0x696969,\n dodgerblue: 0x1e90ff,\n firebrick: 0xb22222,\n floralwhite: 0xfffaf0,\n forestgreen: 0x228b22,\n fuchsia: 0xff00ff,\n gainsboro: 0xdcdcdc,\n ghostwhite: 0xf8f8ff,\n gold: 0xffd700,\n goldenrod: 0xdaa520,\n gray: 0x808080,\n green: 0x008000,\n greenyellow: 0xadff2f,\n grey: 0x808080,\n honeydew: 0xf0fff0,\n hotpink: 0xff69b4,\n indianred: 0xcd5c5c,\n indigo: 0x4b0082,\n ivory: 0xfffff0,\n khaki: 0xf0e68c,\n lavender: 0xe6e6fa,\n lavenderblush: 0xfff0f5,\n lawngreen: 0x7cfc00,\n lemonchiffon: 0xfffacd,\n lightblue: 0xadd8e6,\n lightcoral: 0xf08080,\n lightcyan: 0xe0ffff,\n lightgoldenrodyellow: 0xfafad2,\n lightgray: 0xd3d3d3,\n lightgreen: 0x90ee90,\n lightgrey: 0xd3d3d3,\n lightpink: 0xffb6c1,\n lightsalmon: 0xffa07a,\n lightseagreen: 0x20b2aa,\n lightskyblue: 0x87cefa,\n lightslategray: 0x778899,\n lightslategrey: 0x778899,\n lightsteelblue: 0xb0c4de,\n lightyellow: 0xffffe0,\n lime: 0x00ff00,\n limegreen: 0x32cd32,\n linen: 0xfaf0e6,\n magenta: 0xff00ff,\n maroon: 0x800000,\n mediumaquamarine: 0x66cdaa,\n mediumblue: 0x0000cd,\n mediumorchid: 0xba55d3,\n mediumpurple: 0x9370db,\n mediumseagreen: 0x3cb371,\n mediumslateblue: 0x7b68ee,\n mediumspringgreen: 0x00fa9a,\n mediumturquoise: 0x48d1cc,\n mediumvioletred: 0xc71585,\n midnightblue: 0x191970,\n mintcream: 0xf5fffa,\n mistyrose: 0xffe4e1,\n moccasin: 0xffe4b5,\n navajowhite: 0xffdead,\n navy: 0x000080,\n oldlace: 0xfdf5e6,\n olive: 0x808000,\n olivedrab: 0x6b8e23,\n orange: 0xffa500,\n orangered: 0xff4500,\n orchid: 0xda70d6,\n palegoldenrod: 0xeee8aa,\n palegreen: 0x98fb98,\n paleturquoise: 0xafeeee,\n palevioletred: 0xdb7093,\n papayawhip: 0xffefd5,\n peachpuff: 0xffdab9,\n peru: 0xcd853f,\n pink: 0xffc0cb,\n plum: 0xdda0dd,\n powderblue: 0xb0e0e6,\n purple: 0x800080,\n rebeccapurple: 0x663399,\n red: 0xff0000,\n rosybrown: 0xbc8f8f,\n royalblue: 0x4169e1,\n saddlebrown: 0x8b4513,\n salmon: 0xfa8072,\n sandybrown: 0xf4a460,\n seagreen: 0x2e8b57,\n seashell: 0xfff5ee,\n sienna: 0xa0522d,\n silver: 0xc0c0c0,\n skyblue: 0x87ceeb,\n slateblue: 0x6a5acd,\n slategray: 0x708090,\n slategrey: 0x708090,\n snow: 0xfffafa,\n springgreen: 0x00ff7f,\n steelblue: 0x4682b4,\n tan: 0xd2b48c,\n teal: 0x008080,\n thistle: 0xd8bfd8,\n tomato: 0xff6347,\n turquoise: 0x40e0d0,\n violet: 0xee82ee,\n wheat: 0xf5deb3,\n white: 0xffffff,\n whitesmoke: 0xf5f5f5,\n yellow: 0xffff00,\n yellowgreen: 0x9acd32\n};\n\ndefine(Color, color, {\n displayable: function() {\n return this.rgb().displayable();\n },\n toString: function() {\n return this.rgb() + "";\n }\n});\n\nfunction color(format) {\n var m;\n format = (format + "").trim().toLowerCase();\n return (m = reHex3.exec(format)) ? (m = parseInt(m[1], 16), new Rgb((m >> 8 & 0xf) | (m >> 4 & 0x0f0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1)) // #f00\n : (m = reHex6.exec(format)) ? rgbn(parseInt(m[1], 16)) // #ff0000\n : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0)\n : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)\n : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)\n : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)\n : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)\n : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)\n : named.hasOwnProperty(format) ? rgbn(named[format])\n : format === "transparent" ? new Rgb(NaN, NaN, NaN, 0)\n : null;\n}\n\nfunction rgbn(n) {\n return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);\n}\n\nfunction rgba(r, g, b, a) {\n if (a <= 0) r = g = b = NaN;\n return new Rgb(r, g, b, a);\n}\n\nfunction rgbConvert(o) {\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Rgb;\n o = o.rgb();\n return new Rgb(o.r, o.g, o.b, o.opacity);\n}\n\nfunction rgb(r, g, b, opacity) {\n return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);\n}\n\nfunction Rgb(r, g, b, opacity) {\n this.r = +r;\n this.g = +g;\n this.b = +b;\n this.opacity = +opacity;\n}\n\ndefine(Rgb, rgb, extend(Color, {\n brighter: function(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n darker: function(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n rgb: function() {\n return this;\n },\n displayable: function() {\n return (0 <= this.r && this.r <= 255)\n && (0 <= this.g && this.g <= 255)\n && (0 <= this.b && this.b <= 255)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n toString: function() {\n var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a));\n return (a === 1 ? "rgb(" : "rgba(")\n + Math.max(0, Math.min(255, Math.round(this.r) || 0)) + ", "\n + Math.max(0, Math.min(255, Math.round(this.g) || 0)) + ", "\n + Math.max(0, Math.min(255, Math.round(this.b) || 0))\n + (a === 1 ? ")" : ", " + a + ")");\n }\n}));\n\nfunction hsla(h, s, l, a) {\n if (a <= 0) h = s = l = NaN;\n else if (l <= 0 || l >= 1) h = s = NaN;\n else if (s <= 0) h = NaN;\n return new Hsl(h, s, l, a);\n}\n\nfunction hslConvert(o) {\n if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Hsl;\n if (o instanceof Hsl) return o;\n o = o.rgb();\n var r = o.r / 255,\n g = o.g / 255,\n b = o.b / 255,\n min = Math.min(r, g, b),\n max = Math.max(r, g, b),\n h = NaN,\n s = max - min,\n l = (max + min) / 2;\n if (s) {\n if (r === max) h = (g - b) / s + (g < b) * 6;\n else if (g === max) h = (b - r) / s + 2;\n else h = (r - g) / s + 4;\n s /= l < 0.5 ? max + min : 2 - max - min;\n h *= 60;\n } else {\n s = l > 0 && l < 1 ? 0 : h;\n }\n return new Hsl(h, s, l, o.opacity);\n}\n\nfunction hsl(h, s, l, opacity) {\n return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);\n}\n\nfunction Hsl(h, s, l, opacity) {\n this.h = +h;\n this.s = +s;\n this.l = +l;\n this.opacity = +opacity;\n}\n\ndefine(Hsl, hsl, extend(Color, {\n brighter: function(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n darker: function(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n rgb: function() {\n var h = this.h % 360 + (this.h < 0) * 360,\n s = isNaN(h) || isNaN(this.s) ? 0 : this.s,\n l = this.l,\n m2 = l + (l < 0.5 ? l : 1 - l) * s,\n m1 = 2 * l - m2;\n return new Rgb(\n hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),\n hsl2rgb(h, m1, m2),\n hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),\n this.opacity\n );\n },\n displayable: function() {\n return (0 <= this.s && this.s <= 1 || isNaN(this.s))\n && (0 <= this.l && this.l <= 1)\n && (0 <= this.opacity && this.opacity <= 1);\n }\n}));\n\n/* From FvD 13.37, CSS Color Module Level 3 */\nfunction hsl2rgb(h, m1, m2) {\n return (h < 60 ? m1 + (m2 - m1) * h / 60\n : h < 180 ? m2\n : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60\n : m1) * 255;\n}\n\nvar deg2rad = Math.PI / 180;\nvar rad2deg = 180 / Math.PI;\n\nvar Kn = 18;\nvar Xn = 0.950470;\nvar Yn = 1;\nvar Zn = 1.088830;\nvar t0 = 4 / 29;\nvar t1 = 6 / 29;\nvar t2 = 3 * t1 * t1;\nvar t3 = t1 * t1 * t1;\n\nfunction labConvert(o) {\n if (o instanceof Lab) return new Lab(o.l, o.a, o.b, o.opacity);\n if (o instanceof Hcl) {\n var h = o.h * deg2rad;\n return new Lab(o.l, Math.cos(h) * o.c, Math.sin(h) * o.c, o.opacity);\n }\n if (!(o instanceof Rgb)) o = rgbConvert(o);\n var b = rgb2xyz(o.r),\n a = rgb2xyz(o.g),\n l = rgb2xyz(o.b),\n x = xyz2lab((0.4124564 * b + 0.3575761 * a + 0.1804375 * l) / Xn),\n y = xyz2lab((0.2126729 * b + 0.7151522 * a + 0.0721750 * l) / Yn),\n z = xyz2lab((0.0193339 * b + 0.1191920 * a + 0.9503041 * l) / Zn);\n return new Lab(116 * y - 16, 500 * (x - y), 200 * (y - z), o.opacity);\n}\n\nfunction lab(l, a, b, opacity) {\n return arguments.length === 1 ? labConvert(l) : new Lab(l, a, b, opacity == null ? 1 : opacity);\n}\n\nfunction Lab(l, a, b, opacity) {\n this.l = +l;\n this.a = +a;\n this.b = +b;\n this.opacity = +opacity;\n}\n\ndefine(Lab, lab, extend(Color, {\n brighter: function(k) {\n return new Lab(this.l + Kn * (k == null ? 1 : k), this.a, this.b, this.opacity);\n },\n darker: function(k) {\n return new Lab(this.l - Kn * (k == null ? 1 : k), this.a, this.b, this.opacity);\n },\n rgb: function() {\n var y = (this.l + 16) / 116,\n x = isNaN(this.a) ? y : y + this.a / 500,\n z = isNaN(this.b) ? y : y - this.b / 200;\n y = Yn * lab2xyz(y);\n x = Xn * lab2xyz(x);\n z = Zn * lab2xyz(z);\n return new Rgb(\n xyz2rgb( 3.2404542 * x - 1.5371385 * y - 0.4985314 * z), // D65 -> sRGB\n xyz2rgb(-0.9692660 * x + 1.8760108 * y + 0.0415560 * z),\n xyz2rgb( 0.0556434 * x - 0.2040259 * y + 1.0572252 * z),\n this.opacity\n );\n }\n}));\n\nfunction xyz2lab(t) {\n return t > t3 ? Math.pow(t, 1 / 3) : t / t2 + t0;\n}\n\nfunction lab2xyz(t) {\n return t > t1 ? t * t * t : t2 * (t - t0);\n}\n\nfunction xyz2rgb(x) {\n return 255 * (x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055);\n}\n\nfunction rgb2xyz(x) {\n return (x /= 255) <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4);\n}\n\nfunction hclConvert(o) {\n if (o instanceof Hcl) return new Hcl(o.h, o.c, o.l, o.opacity);\n if (!(o instanceof Lab)) o = labConvert(o);\n var h = Math.atan2(o.b, o.a) * rad2deg;\n return new Hcl(h < 0 ? h + 360 : h, Math.sqrt(o.a * o.a + o.b * o.b), o.l, o.opacity);\n}\n\nfunction hcl(h, c, l, opacity) {\n return arguments.length === 1 ? hclConvert(h) : new Hcl(h, c, l, opacity == null ? 1 : opacity);\n}\n\nfunction Hcl(h, c, l, opacity) {\n this.h = +h;\n this.c = +c;\n this.l = +l;\n this.opacity = +opacity;\n}\n\ndefine(Hcl, hcl, extend(Color, {\n brighter: function(k) {\n return new Hcl(this.h, this.c, this.l + Kn * (k == null ? 1 : k), this.opacity);\n },\n darker: function(k) {\n return new Hcl(this.h, this.c, this.l - Kn * (k == null ? 1 : k), this.opacity);\n },\n rgb: function() {\n return labConvert(this).rgb();\n }\n}));\n\nvar A = -0.14861;\nvar B = +1.78277;\nvar C = -0.29227;\nvar D = -0.90649;\nvar E = +1.97294;\nvar ED = E * D;\nvar EB = E * B;\nvar BC_DA = B * C - D * A;\n\nfunction cubehelixConvert(o) {\n if (o instanceof Cubehelix) return new Cubehelix(o.h, o.s, o.l, o.opacity);\n if (!(o instanceof Rgb)) o = rgbConvert(o);\n var r = o.r / 255,\n g = o.g / 255,\n b = o.b / 255,\n l = (BC_DA * b + ED * r - EB * g) / (BC_DA + ED - EB),\n bl = b - l,\n k = (E * (g - l) - C * bl) / D,\n s = Math.sqrt(k * k + bl * bl) / (E * l * (1 - l)), // NaN if l=0 or l=1\n h = s ? Math.atan2(k, bl) * rad2deg - 120 : NaN;\n return new Cubehelix(h < 0 ? h + 360 : h, s, l, o.opacity);\n}\n\nfunction cubehelix(h, s, l, opacity) {\n return arguments.length === 1 ? cubehelixConvert(h) : new Cubehelix(h, s, l, opacity == null ? 1 : opacity);\n}\n\nfunction Cubehelix(h, s, l, opacity) {\n this.h = +h;\n this.s = +s;\n this.l = +l;\n this.opacity = +opacity;\n}\n\ndefine(Cubehelix, cubehelix, extend(Color, {\n brighter: function(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Cubehelix(this.h, this.s, this.l * k, this.opacity);\n },\n darker: function(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Cubehelix(this.h, this.s, this.l * k, this.opacity);\n },\n rgb: function() {\n var h = isNaN(this.h) ? 0 : (this.h + 120) * deg2rad,\n l = +this.l,\n a = isNaN(this.s) ? 0 : this.s * l * (1 - l),\n cosh = Math.cos(h),\n sinh = Math.sin(h);\n return new Rgb(\n 255 * (l + a * (A * cosh + B * sinh)),\n 255 * (l + a * (C * cosh + D * sinh)),\n 255 * (l + a * (E * cosh)),\n this.opacity\n );\n }\n}));\n\nexports.color = color;\nexports.rgb = rgb;\nexports.hsl = hsl;\nexports.lab = lab;\nexports.hcl = hcl;\nexports.cubehelix = cubehelix;\n\nObject.defineProperty(exports, \'__esModule\', { value: true });\n\n})));\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/d3-color/build/d3-color.js\n// module id = 9\n// module chunks = 0\n//# sourceURL=webpack:///./~/d3-color/build/d3-color.js?')},function(module,exports,__webpack_require__){eval('// https://d3js.org/d3-format/ Version 1.2.0. Copyright 2017 Mike Bostock.\n(function (global, factory) {\n\t true ? factory(exports) :\n\ttypeof define === \'function\' && define.amd ? define([\'exports\'], factory) :\n\t(factory((global.d3 = global.d3 || {})));\n}(this, (function (exports) { \'use strict\';\n\n// Computes the decimal coefficient and exponent of the specified number x with\n// significant digits p, where x is positive and p is in [1, 21] or undefined.\n// For example, formatDecimal(1.23) returns ["123", 0].\nvar formatDecimal = function(x, p) {\n if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf("e")) < 0) return null; // NaN, ±Infinity\n var i, coefficient = x.slice(0, i);\n\n // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n // (e.g., 1.2e+3) or the form \\de[-+]\\d+ (e.g., 1e+3).\n return [\n coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,\n +x.slice(i + 1)\n ];\n};\n\nvar exponent = function(x) {\n return x = formatDecimal(Math.abs(x)), x ? x[1] : NaN;\n};\n\nvar formatGroup = function(grouping, thousands) {\n return function(value, width) {\n var i = value.length,\n t = [],\n j = 0,\n g = grouping[0],\n length = 0;\n\n while (i > 0 && g > 0) {\n if (length + g + 1 > width) g = Math.max(1, width - length);\n t.push(value.substring(i -= g, i + g));\n if ((length += g + 1) > width) break;\n g = grouping[j = (j + 1) % grouping.length];\n }\n\n return t.reverse().join(thousands);\n };\n};\n\nvar formatNumerals = function(numerals) {\n return function(value) {\n return value.replace(/[0-9]/g, function(i) {\n return numerals[+i];\n });\n };\n};\n\nvar formatDefault = function(x, p) {\n x = x.toPrecision(p);\n\n out: for (var n = x.length, i = 1, i0 = -1, i1; i < n; ++i) {\n switch (x[i]) {\n case ".": i0 = i1 = i; break;\n case "0": if (i0 === 0) i0 = i; i1 = i; break;\n case "e": break out;\n default: if (i0 > 0) i0 = 0; break;\n }\n }\n\n return i0 > 0 ? x.slice(0, i0) + x.slice(i1 + 1) : x;\n};\n\nvar prefixExponent;\n\nvar formatPrefixAuto = function(x, p) {\n var d = formatDecimal(x, p);\n if (!d) return x + "";\n var coefficient = d[0],\n exponent = d[1],\n i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1,\n n = coefficient.length;\n return i === n ? coefficient\n : i > n ? coefficient + new Array(i - n + 1).join("0")\n : i > 0 ? coefficient.slice(0, i) + "." + coefficient.slice(i)\n : "0." + new Array(1 - i).join("0") + formatDecimal(x, Math.max(0, p + i - 1))[0]; // less than 1y!\n};\n\nvar formatRounded = function(x, p) {\n var d = formatDecimal(x, p);\n if (!d) return x + "";\n var coefficient = d[0],\n exponent = d[1];\n return exponent < 0 ? "0." + new Array(-exponent).join("0") + coefficient\n : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + "." + coefficient.slice(exponent + 1)\n : coefficient + new Array(exponent - coefficient.length + 2).join("0");\n};\n\nvar formatTypes = {\n "": formatDefault,\n "%": function(x, p) { return (x * 100).toFixed(p); },\n "b": function(x) { return Math.round(x).toString(2); },\n "c": function(x) { return x + ""; },\n "d": function(x) { return Math.round(x).toString(10); },\n "e": function(x, p) { return x.toExponential(p); },\n "f": function(x, p) { return x.toFixed(p); },\n "g": function(x, p) { return x.toPrecision(p); },\n "o": function(x) { return Math.round(x).toString(8); },\n "p": function(x, p) { return formatRounded(x * 100, p); },\n "r": formatRounded,\n "s": formatPrefixAuto,\n "X": function(x) { return Math.round(x).toString(16).toUpperCase(); },\n "x": function(x) { return Math.round(x).toString(16); }\n};\n\n// [[fill]align][sign][symbol][0][width][,][.precision][type]\nvar re = /^(?:(.)?([<>=^]))?([+\\-\\( ])?([$#])?(0)?(\\d+)?(,)?(\\.\\d+)?([a-z%])?$/i;\n\nfunction formatSpecifier(specifier) {\n return new FormatSpecifier(specifier);\n}\n\nformatSpecifier.prototype = FormatSpecifier.prototype; // instanceof\n\nfunction FormatSpecifier(specifier) {\n if (!(match = re.exec(specifier))) throw new Error("invalid format: " + specifier);\n\n var match,\n fill = match[1] || " ",\n align = match[2] || ">",\n sign = match[3] || "-",\n symbol = match[4] || "",\n zero = !!match[5],\n width = match[6] && +match[6],\n comma = !!match[7],\n precision = match[8] && +match[8].slice(1),\n type = match[9] || "";\n\n // The "n" type is an alias for ",g".\n if (type === "n") comma = true, type = "g";\n\n // Map invalid types to the default format.\n else if (!formatTypes[type]) type = "";\n\n // If zero fill is specified, padding goes after sign and before digits.\n if (zero || (fill === "0" && align === "=")) zero = true, fill = "0", align = "=";\n\n this.fill = fill;\n this.align = align;\n this.sign = sign;\n this.symbol = symbol;\n this.zero = zero;\n this.width = width;\n this.comma = comma;\n this.precision = precision;\n this.type = type;\n}\n\nFormatSpecifier.prototype.toString = function() {\n return this.fill\n + this.align\n + this.sign\n + this.symbol\n + (this.zero ? "0" : "")\n + (this.width == null ? "" : Math.max(1, this.width | 0))\n + (this.comma ? "," : "")\n + (this.precision == null ? "" : "." + Math.max(0, this.precision | 0))\n + this.type;\n};\n\nvar identity = function(x) {\n return x;\n};\n\nvar prefixes = ["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];\n\nvar formatLocale = function(locale) {\n var group = locale.grouping && locale.thousands ? formatGroup(locale.grouping, locale.thousands) : identity,\n currency = locale.currency,\n decimal = locale.decimal,\n numerals = locale.numerals ? formatNumerals(locale.numerals) : identity,\n percent = locale.percent || "%";\n\n function newFormat(specifier) {\n specifier = formatSpecifier(specifier);\n\n var fill = specifier.fill,\n align = specifier.align,\n sign = specifier.sign,\n symbol = specifier.symbol,\n zero = specifier.zero,\n width = specifier.width,\n comma = specifier.comma,\n precision = specifier.precision,\n type = specifier.type;\n\n // Compute the prefix and suffix.\n // For SI-prefix, the suffix is lazily computed.\n var prefix = symbol === "$" ? currency[0] : symbol === "#" && /[boxX]/.test(type) ? "0" + type.toLowerCase() : "",\n suffix = symbol === "$" ? currency[1] : /[%p]/.test(type) ? percent : "";\n\n // What format function should we use?\n // Is this an integer type?\n // Can this type generate exponential notation?\n var formatType = formatTypes[type],\n maybeSuffix = !type || /[defgprs%]/.test(type);\n\n // Set the default precision if not specified,\n // or clamp the specified precision to the supported range.\n // For significant precision, it must be in [1, 21].\n // For fixed precision, it must be in [0, 20].\n precision = precision == null ? (type ? 6 : 12)\n : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision))\n : Math.max(0, Math.min(20, precision));\n\n function format(value) {\n var valuePrefix = prefix,\n valueSuffix = suffix,\n i, n, c;\n\n if (type === "c") {\n valueSuffix = formatType(value) + valueSuffix;\n value = "";\n } else {\n value = +value;\n\n // Perform the initial formatting.\n var valueNegative = value < 0;\n value = formatType(Math.abs(value), precision);\n\n // If a negative value rounds to zero during formatting, treat as positive.\n if (valueNegative && +value === 0) valueNegative = false;\n\n // Compute the prefix and suffix.\n valuePrefix = (valueNegative ? (sign === "(" ? sign : "-") : sign === "-" || sign === "(" ? "" : sign) + valuePrefix;\n valueSuffix = valueSuffix + (type === "s" ? prefixes[8 + prefixExponent / 3] : "") + (valueNegative && sign === "(" ? ")" : "");\n\n // Break the formatted value into the integer “value” part that can be\n // grouped, and fractional or exponential “suffix” part that is not.\n if (maybeSuffix) {\n i = -1, n = value.length;\n while (++i < n) {\n if (c = value.charCodeAt(i), 48 > c || c > 57) {\n valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix;\n value = value.slice(0, i);\n break;\n }\n }\n }\n }\n\n // If the fill character is not "0", grouping is applied before padding.\n if (comma && !zero) value = group(value, Infinity);\n\n // Compute the padding.\n var length = valuePrefix.length + value.length + valueSuffix.length,\n padding = length < width ? new Array(width - length + 1).join(fill) : "";\n\n // If the fill character is "0", grouping is applied after padding.\n if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = "";\n\n // Reconstruct the final output based on the desired alignment.\n switch (align) {\n case "<": value = valuePrefix + value + valueSuffix + padding; break;\n case "=": value = valuePrefix + padding + value + valueSuffix; break;\n case "^": value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length); break;\n default: value = padding + valuePrefix + value + valueSuffix; break;\n }\n\n return numerals(value);\n }\n\n format.toString = function() {\n return specifier + "";\n };\n\n return format;\n }\n\n function formatPrefix(specifier, value) {\n var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = "f", specifier)),\n e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3,\n k = Math.pow(10, -e),\n prefix = prefixes[8 + e / 3];\n return function(value) {\n return f(k * value) + prefix;\n };\n }\n\n return {\n format: newFormat,\n formatPrefix: formatPrefix\n };\n};\n\nvar locale;\n\n\n\ndefaultLocale({\n decimal: ".",\n thousands: ",",\n grouping: [3],\n currency: ["$", ""]\n});\n\nfunction defaultLocale(definition) {\n locale = formatLocale(definition);\n exports.format = locale.format;\n exports.formatPrefix = locale.formatPrefix;\n return locale;\n}\n\nvar precisionFixed = function(step) {\n return Math.max(0, -exponent(Math.abs(step)));\n};\n\nvar precisionPrefix = function(step, value) {\n return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step)));\n};\n\nvar precisionRound = function(step, max) {\n step = Math.abs(step), max = Math.abs(max) - step;\n return Math.max(0, exponent(max) - exponent(step)) + 1;\n};\n\nexports.formatDefaultLocale = defaultLocale;\nexports.formatLocale = formatLocale;\nexports.formatSpecifier = formatSpecifier;\nexports.precisionFixed = precisionFixed;\nexports.precisionPrefix = precisionPrefix;\nexports.precisionRound = precisionRound;\n\nObject.defineProperty(exports, \'__esModule\', { value: true });\n\n})));\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/d3-format/build/d3-format.js\n// module id = 10\n// module chunks = 0\n//# sourceURL=webpack:///./~/d3-format/build/d3-format.js?'); | |
},function(module,exports,__webpack_require__){eval("// https://d3js.org/d3-time/ Version 1.0.7. Copyright 2017 Mike Bostock.\n(function (global, factory) {\n\t true ? factory(exports) :\n\ttypeof define === 'function' && define.amd ? define(['exports'], factory) :\n\t(factory((global.d3 = global.d3 || {})));\n}(this, (function (exports) { 'use strict';\n\nvar t0 = new Date;\nvar t1 = new Date;\n\nfunction newInterval(floori, offseti, count, field) {\n\n function interval(date) {\n return floori(date = new Date(+date)), date;\n }\n\n interval.floor = interval;\n\n interval.ceil = function(date) {\n return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date;\n };\n\n interval.round = function(date) {\n var d0 = interval(date),\n d1 = interval.ceil(date);\n return date - d0 < d1 - date ? d0 : d1;\n };\n\n interval.offset = function(date, step) {\n return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;\n };\n\n interval.range = function(start, stop, step) {\n var range = [];\n start = interval.ceil(start);\n step = step == null ? 1 : Math.floor(step);\n if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date\n do range.push(new Date(+start)); while (offseti(start, step), floori(start), start < stop)\n return range;\n };\n\n interval.filter = function(test) {\n return newInterval(function(date) {\n if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1);\n }, function(date, step) {\n if (date >= date) {\n if (step < 0) while (++step <= 0) {\n while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty\n } else while (--step >= 0) {\n while (offseti(date, +1), !test(date)) {} // eslint-disable-line no-empty\n }\n }\n });\n };\n\n if (count) {\n interval.count = function(start, end) {\n t0.setTime(+start), t1.setTime(+end);\n floori(t0), floori(t1);\n return Math.floor(count(t0, t1));\n };\n\n interval.every = function(step) {\n step = Math.floor(step);\n return !isFinite(step) || !(step > 0) ? null\n : !(step > 1) ? interval\n : interval.filter(field\n ? function(d) { return field(d) % step === 0; }\n : function(d) { return interval.count(0, d) % step === 0; });\n };\n }\n\n return interval;\n}\n\nvar millisecond = newInterval(function() {\n // noop\n}, function(date, step) {\n date.setTime(+date + step);\n}, function(start, end) {\n return end - start;\n});\n\n// An optimized implementation for this simple case.\nmillisecond.every = function(k) {\n k = Math.floor(k);\n if (!isFinite(k) || !(k > 0)) return null;\n if (!(k > 1)) return millisecond;\n return newInterval(function(date) {\n date.setTime(Math.floor(date / k) * k);\n }, function(date, step) {\n date.setTime(+date + step * k);\n }, function(start, end) {\n return (end - start) / k;\n });\n};\n\nvar milliseconds = millisecond.range;\n\nvar durationSecond = 1e3;\nvar durationMinute = 6e4;\nvar durationHour = 36e5;\nvar durationDay = 864e5;\nvar durationWeek = 6048e5;\n\nvar second = newInterval(function(date) {\n date.setTime(Math.floor(date / durationSecond) * durationSecond);\n}, function(date, step) {\n date.setTime(+date + step * durationSecond);\n}, function(start, end) {\n return (end - start) / durationSecond;\n}, function(date) {\n return date.getUTCSeconds();\n});\n\nvar seconds = second.range;\n\nvar minute = newInterval(function(date) {\n date.setTime(Math.floor(date / durationMinute) * durationMinute);\n}, function(date, step) {\n date.setTime(+date + step * durationMinute);\n}, function(start, end) {\n return (end - start) / durationMinute;\n}, function(date) {\n return date.getMinutes();\n});\n\nvar minutes = minute.range;\n\nvar hour = newInterval(function(date) {\n var offset = date.getTimezoneOffset() * durationMinute % durationHour;\n if (offset < 0) offset += durationHour;\n date.setTime(Math.floor((+date - offset) / durationHour) * durationHour + offset);\n}, function(date, step) {\n date.setTime(+date + step * durationHour);\n}, function(start, end) {\n return (end - start) / durationHour;\n}, function(date) {\n return date.getHours();\n});\n\nvar hours = hour.range;\n\nvar day = newInterval(function(date) {\n date.setHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setDate(date.getDate() + step);\n}, function(start, end) {\n return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay;\n}, function(date) {\n return date.getDate() - 1;\n});\n\nvar days = day.range;\n\nfunction weekday(i) {\n return newInterval(function(date) {\n date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);\n date.setHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setDate(date.getDate() + step * 7);\n }, function(start, end) {\n return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;\n });\n}\n\nvar sunday = weekday(0);\nvar monday = weekday(1);\nvar tuesday = weekday(2);\nvar wednesday = weekday(3);\nvar thursday = weekday(4);\nvar friday = weekday(5);\nvar saturday = weekday(6);\n\nvar sundays = sunday.range;\nvar mondays = monday.range;\nvar tuesdays = tuesday.range;\nvar wednesdays = wednesday.range;\nvar thursdays = thursday.range;\nvar fridays = friday.range;\nvar saturdays = saturday.range;\n\nvar month = newInterval(function(date) {\n date.setDate(1);\n date.setHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setMonth(date.getMonth() + step);\n}, function(start, end) {\n return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;\n}, function(date) {\n return date.getMonth();\n});\n\nvar months = month.range;\n\nvar year = newInterval(function(date) {\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setFullYear(date.getFullYear() + step);\n}, function(start, end) {\n return end.getFullYear() - start.getFullYear();\n}, function(date) {\n return date.getFullYear();\n});\n\n// An optimized implementation for this simple case.\nyear.every = function(k) {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : newInterval(function(date) {\n date.setFullYear(Math.floor(date.getFullYear() / k) * k);\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setFullYear(date.getFullYear() + step * k);\n });\n};\n\nvar years = year.range;\n\nvar utcMinute = newInterval(function(date) {\n date.setUTCSeconds(0, 0);\n}, function(date, step) {\n date.setTime(+date + step * durationMinute);\n}, function(start, end) {\n return (end - start) / durationMinute;\n}, function(date) {\n return date.getUTCMinutes();\n});\n\nvar utcMinutes = utcMinute.range;\n\nvar utcHour = newInterval(function(date) {\n date.setUTCMinutes(0, 0, 0);\n}, function(date, step) {\n date.setTime(+date + step * durationHour);\n}, function(start, end) {\n return (end - start) / durationHour;\n}, function(date) {\n return date.getUTCHours();\n});\n\nvar utcHours = utcHour.range;\n\nvar utcDay = newInterval(function(date) {\n date.setUTCHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setUTCDate(date.getUTCDate() + step);\n}, function(start, end) {\n return (end - start) / durationDay;\n}, function(date) {\n return date.getUTCDate() - 1;\n});\n\nvar utcDays = utcDay.range;\n\nfunction utcWeekday(i) {\n return newInterval(function(date) {\n date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);\n date.setUTCHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setUTCDate(date.getUTCDate() + step * 7);\n }, function(start, end) {\n return (end - start) / durationWeek;\n });\n}\n\nvar utcSunday = utcWeekday(0);\nvar utcMonday = utcWeekday(1);\nvar utcTuesday = utcWeekday(2);\nvar utcWednesday = utcWeekday(3);\nvar utcThursday = utcWeekday(4);\nvar utcFriday = utcWeekday(5);\nvar utcSaturday = utcWeekday(6);\n\nvar utcSundays = utcSunday.range;\nvar utcMondays = utcMonday.range;\nvar utcTuesdays = utcTuesday.range;\nvar utcWednesdays = utcWednesday.range;\nvar utcThursdays = utcThursday.range;\nvar utcFridays = utcFriday.range;\nvar utcSaturdays = utcSaturday.range;\n\nvar utcMonth = newInterval(function(date) {\n date.setUTCDate(1);\n date.setUTCHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setUTCMonth(date.getUTCMonth() + step);\n}, function(start, end) {\n return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;\n}, function(date) {\n return date.getUTCMonth();\n});\n\nvar utcMonths = utcMonth.range;\n\nvar utcYear = newInterval(function(date) {\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setUTCFullYear(date.getUTCFullYear() + step);\n}, function(start, end) {\n return end.getUTCFullYear() - start.getUTCFullYear();\n}, function(date) {\n return date.getUTCFullYear();\n});\n\n// An optimized implementation for this simple case.\nutcYear.every = function(k) {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : newInterval(function(date) {\n date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k);\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setUTCFullYear(date.getUTCFullYear() + step * k);\n });\n};\n\nvar utcYears = utcYear.range;\n\nexports.timeInterval = newInterval;\nexports.timeMillisecond = millisecond;\nexports.timeMilliseconds = milliseconds;\nexports.utcMillisecond = millisecond;\nexports.utcMilliseconds = milliseconds;\nexports.timeSecond = second;\nexports.timeSeconds = seconds;\nexports.utcSecond = second;\nexports.utcSeconds = seconds;\nexports.timeMinute = minute;\nexports.timeMinutes = minutes;\nexports.timeHour = hour;\nexports.timeHours = hours;\nexports.timeDay = day;\nexports.timeDays = days;\nexports.timeWeek = sunday;\nexports.timeWeeks = sundays;\nexports.timeSunday = sunday;\nexports.timeSundays = sundays;\nexports.timeMonday = monday;\nexports.timeMondays = mondays;\nexports.timeTuesday = tuesday;\nexports.timeTuesdays = tuesdays;\nexports.timeWednesday = wednesday;\nexports.timeWednesdays = wednesdays;\nexports.timeThursday = thursday;\nexports.timeThursdays = thursdays;\nexports.timeFriday = friday;\nexports.timeFridays = fridays;\nexports.timeSaturday = saturday;\nexports.timeSaturdays = saturdays;\nexports.timeMonth = month;\nexports.timeMonths = months;\nexports.timeYear = year;\nexports.timeYears = years;\nexports.utcMinute = utcMinute;\nexports.utcMinutes = utcMinutes;\nexports.utcHour = utcHour;\nexports.utcHours = utcHours;\nexports.utcDay = utcDay;\nexports.utcDays = utcDays;\nexports.utcWeek = utcSunday;\nexports.utcWeeks = utcSundays;\nexports.utcSunday = utcSunday;\nexports.utcSundays = utcSundays;\nexports.utcMonday = utcMonday;\nexports.utcMondays = utcMondays;\nexports.utcTuesday = utcTuesday;\nexports.utcTuesdays = utcTuesdays;\nexports.utcWednesday = utcWednesday;\nexports.utcWednesdays = utcWednesdays;\nexports.utcThursday = utcThursday;\nexports.utcThursdays = utcThursdays;\nexports.utcFriday = utcFriday;\nexports.utcFridays = utcFridays;\nexports.utcSaturday = utcSaturday;\nexports.utcSaturdays = utcSaturdays;\nexports.utcMonth = utcMonth;\nexports.utcMonths = utcMonths;\nexports.utcYear = utcYear;\nexports.utcYears = utcYears;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n})));\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/d3-time/build/d3-time.js\n// module id = 11\n// module chunks = 0\n//# sourceURL=webpack:///./~/d3-time/build/d3-time.js?")},function(module,exports,__webpack_require__){eval('// https://d3js.org/d3-time-format/ Version 2.0.5. Copyright 2017 Mike Bostock.\n(function (global, factory) {\n\t true ? factory(exports, __webpack_require__(11)) :\n\ttypeof define === \'function\' && define.amd ? define([\'exports\', \'d3-time\'], factory) :\n\t(factory((global.d3 = global.d3 || {}),global.d3));\n}(this, (function (exports,d3Time) { \'use strict\';\n\nfunction localDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L);\n date.setFullYear(d.y);\n return date;\n }\n return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L);\n}\n\nfunction utcDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L));\n date.setUTCFullYear(d.y);\n return date;\n }\n return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L));\n}\n\nfunction newYear(y) {\n return {y: y, m: 0, d: 1, H: 0, M: 0, S: 0, L: 0};\n}\n\nfunction formatLocale(locale) {\n var locale_dateTime = locale.dateTime,\n locale_date = locale.date,\n locale_time = locale.time,\n locale_periods = locale.periods,\n locale_weekdays = locale.days,\n locale_shortWeekdays = locale.shortDays,\n locale_months = locale.months,\n locale_shortMonths = locale.shortMonths;\n\n var periodRe = formatRe(locale_periods),\n periodLookup = formatLookup(locale_periods),\n weekdayRe = formatRe(locale_weekdays),\n weekdayLookup = formatLookup(locale_weekdays),\n shortWeekdayRe = formatRe(locale_shortWeekdays),\n shortWeekdayLookup = formatLookup(locale_shortWeekdays),\n monthRe = formatRe(locale_months),\n monthLookup = formatLookup(locale_months),\n shortMonthRe = formatRe(locale_shortMonths),\n shortMonthLookup = formatLookup(locale_shortMonths);\n\n var formats = {\n "a": formatShortWeekday,\n "A": formatWeekday,\n "b": formatShortMonth,\n "B": formatMonth,\n "c": null,\n "d": formatDayOfMonth,\n "e": formatDayOfMonth,\n "H": formatHour24,\n "I": formatHour12,\n "j": formatDayOfYear,\n "L": formatMilliseconds,\n "m": formatMonthNumber,\n "M": formatMinutes,\n "p": formatPeriod,\n "S": formatSeconds,\n "U": formatWeekNumberSunday,\n "w": formatWeekdayNumber,\n "W": formatWeekNumberMonday,\n "x": null,\n "X": null,\n "y": formatYear,\n "Y": formatFullYear,\n "Z": formatZone,\n "%": formatLiteralPercent\n };\n\n var utcFormats = {\n "a": formatUTCShortWeekday,\n "A": formatUTCWeekday,\n "b": formatUTCShortMonth,\n "B": formatUTCMonth,\n "c": null,\n "d": formatUTCDayOfMonth,\n "e": formatUTCDayOfMonth,\n "H": formatUTCHour24,\n "I": formatUTCHour12,\n "j": formatUTCDayOfYear,\n "L": formatUTCMilliseconds,\n "m": formatUTCMonthNumber,\n "M": formatUTCMinutes,\n "p": formatUTCPeriod,\n "S": formatUTCSeconds,\n "U": formatUTCWeekNumberSunday,\n "w": formatUTCWeekdayNumber,\n "W": formatUTCWeekNumberMonday,\n "x": null,\n "X": null,\n "y": formatUTCYear,\n "Y": formatUTCFullYear,\n "Z": formatUTCZone,\n "%": formatLiteralPercent\n };\n\n var parses = {\n "a": parseShortWeekday,\n "A": parseWeekday,\n "b": parseShortMonth,\n "B": parseMonth,\n "c": parseLocaleDateTime,\n "d": parseDayOfMonth,\n "e": parseDayOfMonth,\n "H": parseHour24,\n "I": parseHour24,\n "j": parseDayOfYear,\n "L": parseMilliseconds,\n "m": parseMonthNumber,\n "M": parseMinutes,\n "p": parsePeriod,\n "S": parseSeconds,\n "U": parseWeekNumberSunday,\n "w": parseWeekdayNumber,\n "W": parseWeekNumberMonday,\n "x": parseLocaleDate,\n "X": parseLocaleTime,\n "y": parseYear,\n "Y": parseFullYear,\n "Z": parseZone,\n "%": parseLiteralPercent\n };\n\n // These recursive directive definitions must be deferred.\n formats.x = newFormat(locale_date, formats);\n formats.X = newFormat(locale_time, formats);\n formats.c = newFormat(locale_dateTime, formats);\n utcFormats.x = newFormat(locale_date, utcFormats);\n utcFormats.X = newFormat(locale_time, utcFormats);\n utcFormats.c = newFormat(locale_dateTime, utcFormats);\n\n function newFormat(specifier, formats) {\n return function(date) {\n var string = [],\n i = -1,\n j = 0,\n n = specifier.length,\n c,\n pad,\n format;\n\n if (!(date instanceof Date)) date = new Date(+date);\n\n while (++i < n) {\n if (specifier.charCodeAt(i) === 37) {\n string.push(specifier.slice(j, i));\n if ((pad = pads[c = specifier.charAt(++i)]) != null) c = specifier.charAt(++i);\n else pad = c === "e" ? " " : "0";\n if (format = formats[c]) c = format(date, pad);\n string.push(c);\n j = i + 1;\n }\n }\n\n string.push(specifier.slice(j, i));\n return string.join("");\n };\n }\n\n function newParse(specifier, newDate) {\n return function(string) {\n var d = newYear(1900),\n i = parseSpecifier(d, specifier, string += "", 0);\n if (i != string.length) return null;\n\n // The am-pm flag is 0 for AM, and 1 for PM.\n if ("p" in d) d.H = d.H % 12 + d.p * 12;\n\n // Convert day-of-week and week-of-year to day-of-year.\n if ("W" in d || "U" in d) {\n if (!("w" in d)) d.w = "W" in d ? 1 : 0;\n var day = "Z" in d ? utcDate(newYear(d.y)).getUTCDay() : newDate(newYear(d.y)).getDay();\n d.m = 0;\n d.d = "W" in d ? (d.w + 6) % 7 + d.W * 7 - (day + 5) % 7 : d.w + d.U * 7 - (day + 6) % 7;\n }\n\n // If a time zone is specified, all fields are interpreted as UTC and then\n // offset according to the specified time zone.\n if ("Z" in d) {\n d.H += d.Z / 100 | 0;\n d.M += d.Z % 100;\n return utcDate(d);\n }\n\n // Otherwise, all fields are in local time.\n return newDate(d);\n };\n }\n\n function parseSpecifier(d, specifier, string, j) {\n var i = 0,\n n = specifier.length,\n m = string.length,\n c,\n parse;\n\n while (i < n) {\n if (j >= m) return -1;\n c = specifier.charCodeAt(i++);\n if (c === 37) {\n c = specifier.charAt(i++);\n parse = parses[c in pads ? specifier.charAt(i++) : c];\n if (!parse || ((j = parse(d, string, j)) < 0)) return -1;\n } else if (c != string.charCodeAt(j++)) {\n return -1;\n }\n }\n\n return j;\n }\n\n function parsePeriod(d, string, i) {\n var n = periodRe.exec(string.slice(i));\n return n ? (d.p = periodLookup[n[0].toLowerCase()], i + n[0].length) : -1;\n }\n\n function parseShortWeekday(d, string, i) {\n var n = shortWeekdayRe.exec(string.slice(i));\n return n ? (d.w = shortWeekdayLookup[n[0].toLowerCase()], i + n[0].length) : -1;\n }\n\n function parseWeekday(d, string, i) {\n var n = weekdayRe.exec(string.slice(i));\n return n ? (d.w = weekdayLookup[n[0].toLowerCase()], i + n[0].length) : -1;\n }\n\n function parseShortMonth(d, string, i) {\n var n = shortMonthRe.exec(string.slice(i));\n return n ? (d.m = shortMonthLookup[n[0].toLowerCase()], i + n[0].length) : -1;\n }\n\n function parseMonth(d, string, i) {\n var n = monthRe.exec(string.slice(i));\n return n ? (d.m = monthLookup[n[0].toLowerCase()], i + n[0].length) : -1;\n }\n\n function parseLocaleDateTime(d, string, i) {\n return parseSpecifier(d, locale_dateTime, string, i);\n }\n\n function parseLocaleDate(d, string, i) {\n return parseSpecifier(d, locale_date, string, i);\n }\n\n function parseLocaleTime(d, string, i) {\n return parseSpecifier(d, locale_time, string, i);\n }\n\n function formatShortWeekday(d) {\n return locale_shortWeekdays[d.getDay()];\n }\n\n function formatWeekday(d) {\n return locale_weekdays[d.getDay()];\n }\n\n function formatShortMonth(d) {\n return locale_shortMonths[d.getMonth()];\n }\n\n function formatMonth(d) {\n return locale_months[d.getMonth()];\n }\n\n function formatPeriod(d) {\n return locale_periods[+(d.getHours() >= 12)];\n }\n\n function formatUTCShortWeekday(d) {\n return locale_shortWeekdays[d.getUTCDay()];\n }\n\n function formatUTCWeekday(d) {\n return locale_weekdays[d.getUTCDay()];\n }\n\n function formatUTCShortMonth(d) {\n return locale_shortMonths[d.getUTCMonth()];\n }\n\n function formatUTCMonth(d) {\n return locale_months[d.getUTCMonth()];\n }\n\n function formatUTCPeriod(d) {\n return locale_periods[+(d.getUTCHours() >= 12)];\n }\n\n return {\n format: function(specifier) {\n var f = newFormat(specifier += "", formats);\n f.toString = function() { return specifier; };\n return f;\n },\n parse: function(specifier) {\n var p = newParse(specifier += "", localDate);\n p.toString = function() { return specifier; };\n return p;\n },\n utcFormat: function(specifier) {\n var f = newFormat(specifier += "", utcFormats);\n f.toString = function() { return specifier; };\n return f;\n },\n utcParse: function(specifier) {\n var p = newParse(specifier, utcDate);\n p.toString = function() { return specifier; };\n return p;\n }\n };\n}\n\nvar pads = {"-": "", "_": " ", "0": "0"};\nvar numberRe = /^\\s*\\d+/;\nvar percentRe = /^%/;\nvar requoteRe = /[\\\\\\^\\$\\*\\+\\?\\|\\[\\]\\(\\)\\.\\{\\}]/g;\n\nfunction pad(value, fill, width) {\n var sign = value < 0 ? "-" : "",\n string = (sign ? -value : value) + "",\n length = string.length;\n return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string);\n}\n\nfunction requote(s) {\n return s.replace(requoteRe, "\\\\$&");\n}\n\nfunction formatRe(names) {\n return new RegExp("^(?:" + names.map(requote).join("|") + ")", "i");\n}\n\nfunction formatLookup(names) {\n var map = {}, i = -1, n = names.length;\n while (++i < n) map[names[i].toLowerCase()] = i;\n return map;\n}\n\nfunction parseWeekdayNumber(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.w = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberSunday(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.U = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberMonday(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.W = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseFullYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 4));\n return n ? (d.y = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2000), i + n[0].length) : -1;\n}\n\nfunction parseZone(d, string, i) {\n var n = /^(Z)|([+-]\\d\\d)(?:\\:?(\\d\\d))?/.exec(string.slice(i, i + 6));\n return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || "00")), i + n[0].length) : -1;\n}\n\nfunction parseMonthNumber(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.m = n[0] - 1, i + n[0].length) : -1;\n}\n\nfunction parseDayOfMonth(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.d = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseDayOfYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.m = 0, d.d = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseHour24(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.H = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMinutes(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.M = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseSeconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.S = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMilliseconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.L = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseLiteralPercent(d, string, i) {\n var n = percentRe.exec(string.slice(i, i + 1));\n return n ? i + n[0].length : -1;\n}\n\nfunction formatDayOfMonth(d, p) {\n return pad(d.getDate(), p, 2);\n}\n\nfunction formatHour24(d, p) {\n return pad(d.getHours(), p, 2);\n}\n\nfunction formatHour12(d, p) {\n return pad(d.getHours() % 12 || 12, p, 2);\n}\n\nfunction formatDayOfYear(d, p) {\n return pad(1 + d3Time.timeDay.count(d3Time.timeYear(d), d), p, 3);\n}\n\nfunction formatMilliseconds(d, p) {\n return pad(d.getMilliseconds(), p, 3);\n}\n\nfunction formatMonthNumber(d, p) {\n return pad(d.getMonth() + 1, p, 2);\n}\n\nfunction formatMinutes(d, p) {\n return pad(d.getMinutes(), p, 2);\n}\n\nfunction formatSeconds(d, p) {\n return pad(d.getSeconds(), p, 2);\n}\n\nfunction formatWeekNumberSunday(d, p) {\n return pad(d3Time.timeSunday.count(d3Time.timeYear(d), d), p, 2);\n}\n\nfunction formatWeekdayNumber(d) {\n return d.getDay();\n}\n\nfunction formatWeekNumberMonday(d, p) {\n return pad(d3Time.timeMonday.count(d3Time.timeYear(d), d), p, 2);\n}\n\nfunction formatYear(d, p) {\n return pad(d.getFullYear() % 100, p, 2);\n}\n\nfunction formatFullYear(d, p) {\n return pad(d.getFullYear() % 10000, p, 4);\n}\n\nfunction formatZone(d) {\n var z = d.getTimezoneOffset();\n return (z > 0 ? "-" : (z *= -1, "+"))\n + pad(z / 60 | 0, "0", 2)\n + pad(z % 60, "0", 2);\n}\n\nfunction formatUTCDayOfMonth(d, p) {\n return pad(d.getUTCDate(), p, 2);\n}\n\nfunction formatUTCHour24(d, p) {\n return pad(d.getUTCHours(), p, 2);\n}\n\nfunction formatUTCHour12(d, p) {\n return pad(d.getUTCHours() % 12 || 12, p, 2);\n}\n\nfunction formatUTCDayOfYear(d, p) {\n return pad(1 + d3Time.utcDay.count(d3Time.utcYear(d), d), p, 3);\n}\n\nfunction formatUTCMilliseconds(d, p) {\n return pad(d.getUTCMilliseconds(), p, 3);\n}\n\nfunction formatUTCMonthNumber(d, p) {\n return pad(d.getUTCMonth() + 1, p, 2);\n}\n\nfunction formatUTCMinutes(d, p) {\n return pad(d.getUTCMinutes(), p, 2);\n}\n\nfunction formatUTCSeconds(d, p) {\n return pad(d.getUTCSeconds(), p, 2);\n}\n\nfunction formatUTCWeekNumberSunday(d, p) {\n return pad(d3Time.utcSunday.count(d3Time.utcYear(d), d), p, 2);\n}\n\nfunction formatUTCWeekdayNumber(d) {\n return d.getUTCDay();\n}\n\nfunction formatUTCWeekNumberMonday(d, p) {\n return pad(d3Time.utcMonday.count(d3Time.utcYear(d), d), p, 2);\n}\n\nfunction formatUTCYear(d, p) {\n return pad(d.getUTCFullYear() % 100, p, 2);\n}\n\nfunction formatUTCFullYear(d, p) {\n return pad(d.getUTCFullYear() % 10000, p, 4);\n}\n\nfunction formatUTCZone() {\n return "+0000";\n}\n\nfunction formatLiteralPercent() {\n return "%";\n}\n\nvar locale$1;\n\n\n\n\n\ndefaultLocale({\n dateTime: "%x, %X",\n date: "%-m/%-d/%Y",\n time: "%-I:%M:%S %p",\n periods: ["AM", "PM"],\n days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],\n shortDays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],\n months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],\n shortMonths: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]\n});\n\nfunction defaultLocale(definition) {\n locale$1 = formatLocale(definition);\n exports.timeFormat = locale$1.format;\n exports.timeParse = locale$1.parse;\n exports.utcFormat = locale$1.utcFormat;\n exports.utcParse = locale$1.utcParse;\n return locale$1;\n}\n\nvar isoSpecifier = "%Y-%m-%dT%H:%M:%S.%LZ";\n\nfunction formatIsoNative(date) {\n return date.toISOString();\n}\n\nvar formatIso = Date.prototype.toISOString\n ? formatIsoNative\n : exports.utcFormat(isoSpecifier);\n\nfunction parseIsoNative(string) {\n var date = new Date(string);\n return isNaN(date) ? null : date;\n}\n\nvar parseIso = +new Date("2000-01-01T00:00:00.000Z")\n ? parseIsoNative\n : exports.utcParse(isoSpecifier);\n\nexports.timeFormatDefaultLocale = defaultLocale;\nexports.timeFormatLocale = formatLocale;\nexports.isoFormat = formatIso;\nexports.isoParse = parseIso;\n\nObject.defineProperty(exports, \'__esModule\', { value: true });\n\n})));\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/d3-time-format/build/d3-time-format.js\n// module id = 12\n// module chunks = 0\n//# sourceURL=webpack:///./~/d3-time-format/build/d3-time-format.js?')},function(module,exports,__webpack_require__){eval('// https://d3js.org/d3-shape/ Version 1.2.0. Copyright 2017 Mike Bostock.\n(function (global, factory) {\n\t true ? factory(exports, __webpack_require__(14)) :\n\ttypeof define === \'function\' && define.amd ? define([\'exports\', \'d3-path\'], factory) :\n\t(factory((global.d3 = global.d3 || {}),global.d3));\n}(this, (function (exports,d3Path) { \'use strict\';\n\nvar constant = function(x) {\n return function constant() {\n return x;\n };\n};\n\nvar abs = Math.abs;\nvar atan2 = Math.atan2;\nvar cos = Math.cos;\nvar max = Math.max;\nvar min = Math.min;\nvar sin = Math.sin;\nvar sqrt = Math.sqrt;\n\nvar epsilon = 1e-12;\nvar pi = Math.PI;\nvar halfPi = pi / 2;\nvar tau = 2 * pi;\n\nfunction acos(x) {\n return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);\n}\n\nfunction asin(x) {\n return x >= 1 ? halfPi : x <= -1 ? -halfPi : Math.asin(x);\n}\n\nfunction arcInnerRadius(d) {\n return d.innerRadius;\n}\n\nfunction arcOuterRadius(d) {\n return d.outerRadius;\n}\n\nfunction arcStartAngle(d) {\n return d.startAngle;\n}\n\nfunction arcEndAngle(d) {\n return d.endAngle;\n}\n\nfunction arcPadAngle(d) {\n return d && d.padAngle; // Note: optional!\n}\n\nfunction intersect(x0, y0, x1, y1, x2, y2, x3, y3) {\n var x10 = x1 - x0, y10 = y1 - y0,\n x32 = x3 - x2, y32 = y3 - y2,\n t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / (y32 * x10 - x32 * y10);\n return [x0 + t * x10, y0 + t * y10];\n}\n\n// Compute perpendicular offset line of length rc.\n// http://mathworld.wolfram.com/Circle-LineIntersection.html\nfunction cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * sqrt(max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}\n\nvar arc = function() {\n var innerRadius = arcInnerRadius,\n outerRadius = arcOuterRadius,\n cornerRadius = constant(0),\n padRadius = null,\n startAngle = arcStartAngle,\n endAngle = arcEndAngle,\n padAngle = arcPadAngle,\n context = null;\n\n function arc() {\n var buffer,\n r,\n r0 = +innerRadius.apply(this, arguments),\n r1 = +outerRadius.apply(this, arguments),\n a0 = startAngle.apply(this, arguments) - halfPi,\n a1 = endAngle.apply(this, arguments) - halfPi,\n da = abs(a1 - a0),\n cw = a1 > a0;\n\n if (!context) context = buffer = d3Path.path();\n\n // Ensure that the outer radius is always larger than the inner radius.\n if (r1 < r0) r = r1, r1 = r0, r0 = r;\n\n // Is it a point?\n if (!(r1 > epsilon)) context.moveTo(0, 0);\n\n // Or is it a circle or annulus?\n else if (da > tau - epsilon) {\n context.moveTo(r1 * cos(a0), r1 * sin(a0));\n context.arc(0, 0, r1, a0, a1, !cw);\n if (r0 > epsilon) {\n context.moveTo(r0 * cos(a1), r0 * sin(a1));\n context.arc(0, 0, r0, a1, a0, cw);\n }\n }\n\n // Or is it a circular or annular sector?\n else {\n var a01 = a0,\n a11 = a1,\n a00 = a0,\n a10 = a1,\n da0 = da,\n da1 = da,\n ap = padAngle.apply(this, arguments) / 2,\n rp = (ap > epsilon) && (padRadius ? +padRadius.apply(this, arguments) : sqrt(r0 * r0 + r1 * r1)),\n rc = min(abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments)),\n rc0 = rc,\n rc1 = rc,\n t0,\n t1;\n\n // Apply padding? Note that since r1 ≥ r0, da1 ≥ da0.\n if (rp > epsilon) {\n var p0 = asin(rp / r0 * sin(ap)),\n p1 = asin(rp / r1 * sin(ap));\n if ((da0 -= p0 * 2) > epsilon) p0 *= (cw ? 1 : -1), a00 += p0, a10 -= p0;\n else da0 = 0, a00 = a10 = (a0 + a1) / 2;\n if ((da1 -= p1 * 2) > epsilon) p1 *= (cw ? 1 : -1), a01 += p1, a11 -= p1;\n else da1 = 0, a01 = a11 = (a0 + a1) / 2;\n }\n\n var x01 = r1 * cos(a01),\n y01 = r1 * sin(a01),\n x10 = r0 * cos(a10),\n y10 = r0 * sin(a10);\n\n // Apply rounded corners?\n if (rc > epsilon) {\n var x11 = r1 * cos(a11),\n y11 = r1 * sin(a11),\n x00 = r0 * cos(a00),\n y00 = r0 * sin(a00);\n\n // Restrict the corner radius according to the sector angle.\n if (da < pi) {\n var oc = da0 > epsilon ? intersect(x01, y01, x00, y00, x11, y11, x10, y10) : [x10, y10],\n ax = x01 - oc[0],\n ay = y01 - oc[1],\n bx = x11 - oc[0],\n by = y11 - oc[1],\n kc = 1 / sin(acos((ax * bx + ay * by) / (sqrt(ax * ax + ay * ay) * sqrt(bx * bx + by * by))) / 2),\n lc = sqrt(oc[0] * oc[0] + oc[1] * oc[1]);\n rc0 = min(rc, (r0 - lc) / (kc - 1));\n rc1 = min(rc, (r1 - lc) / (kc + 1));\n }\n }\n\n // Is the sector collapsed to a line?\n if (!(da1 > epsilon)) context.moveTo(x01, y01);\n\n // Does the sector’s outer ring have rounded corners?\n else if (rc1 > epsilon) {\n t0 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw);\n t1 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw);\n\n context.moveTo(t0.cx + t0.x01, t0.cy + t0.y01);\n\n // Have the corners merged?\n if (rc1 < rc) context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);\n\n // Otherwise, draw the two corners and the ring.\n else {\n context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r1, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), !cw);\n context.arc(t1.cx, t1.cy, rc1, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);\n }\n }\n\n // Or is the outer ring just a circular arc?\n else context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw);\n\n // Is there no inner ring, and it’s a circular sector?\n // Or perhaps it’s an annular sector collapsed due to padding?\n if (!(r0 > epsilon) || !(da0 > epsilon)) context.lineTo(x10, y10);\n\n // Does the sector’s inner ring (or point) have rounded corners?\n else if (rc0 > epsilon) {\n t0 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw);\n t1 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw);\n\n context.lineTo(t0.cx + t0.x01, t0.cy + t0.y01);\n\n // Have the corners merged?\n if (rc0 < rc) context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);\n\n // Otherwise, draw the two corners and the ring.\n else {\n context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r0, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), cw);\n context.arc(t1.cx, t1.cy, rc0, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);\n }\n }\n\n // Or is the inner ring just a circular arc?\n else context.arc(0, 0, r0, a10, a00, cw);\n }\n\n context.closePath();\n\n if (buffer) return context = null, buffer + "" || null;\n }\n\n arc.centroid = function() {\n var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2,\n a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - pi / 2;\n return [cos(a) * r, sin(a) * r];\n };\n\n arc.innerRadius = function(_) {\n return arguments.length ? (innerRadius = typeof _ === "function" ? _ : constant(+_), arc) : innerRadius;\n };\n\n arc.outerRadius = function(_) {\n return arguments.length ? (outerRadius = typeof _ === "function" ? _ : constant(+_), arc) : outerRadius;\n };\n\n arc.cornerRadius = function(_) {\n return arguments.length ? (cornerRadius = typeof _ === "function" ? _ : constant(+_), arc) : cornerRadius;\n };\n\n arc.padRadius = function(_) {\n return arguments.length ? (padRadius = _ == null ? null : typeof _ === "function" ? _ : constant(+_), arc) : padRadius;\n };\n\n arc.startAngle = function(_) {\n return arguments.length ? (startAngle = typeof _ === "function" ? _ : constant(+_), arc) : startAngle;\n };\n\n arc.endAngle = function(_) {\n return arguments.length ? (endAngle = typeof _ === "function" ? _ : constant(+_), arc) : endAngle;\n };\n\n arc.padAngle = function(_) {\n return arguments.length ? (padAngle = typeof _ === "function" ? _ : constant(+_), arc) : padAngle;\n };\n\n arc.context = function(_) {\n return arguments.length ? ((context = _ == null ? null : _), arc) : context;\n };\n\n return arc;\n};\n\nfunction Linear(context) {\n this._context = context;\n}\n\nLinear.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // proceed\n default: this._context.lineTo(x, y); break;\n }\n }\n};\n\nvar curveLinear = function(context) {\n return new Linear(context);\n};\n\nfunction x(p) {\n return p[0];\n}\n\nfunction y(p) {\n return p[1];\n}\n\nvar line = function() {\n var x$$1 = x,\n y$$1 = y,\n defined = constant(true),\n context = null,\n curve = curveLinear,\n output = null;\n\n function line(data) {\n var i,\n n = data.length,\n d,\n defined0 = false,\n buffer;\n\n if (context == null) output = curve(buffer = d3Path.path());\n\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) output.lineStart();\n else output.lineEnd();\n }\n if (defined0) output.point(+x$$1(d, i, data), +y$$1(d, i, data));\n }\n\n if (buffer) return output = null, buffer + "" || null;\n }\n\n line.x = function(_) {\n return arguments.length ? (x$$1 = typeof _ === "function" ? _ : constant(+_), line) : x$$1;\n };\n\n line.y = function(_) {\n return arguments.length ? (y$$1 = typeof _ === "function" ? _ : constant(+_), line) : y$$1;\n };\n\n line.defined = function(_) {\n return arguments.length ? (defined = typeof _ === "function" ? _ : constant(!!_), line) : defined;\n };\n\n line.curve = function(_) {\n return arguments.length ? (curve = _, context != null && (output = curve(context)), line) : curve;\n };\n\n line.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), line) : context;\n };\n\n return line;\n};\n\nvar area = function() {\n var x0 = x,\n x1 = null,\n y0 = constant(0),\n y1 = y,\n defined = constant(true),\n context = null,\n curve = curveLinear,\n output = null;\n\n function area(data) {\n var i,\n j,\n k,\n n = data.length,\n d,\n defined0 = false,\n buffer,\n x0z = new Array(n),\n y0z = new Array(n);\n\n if (context == null) output = curve(buffer = d3Path.path());\n\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) {\n j = i;\n output.areaStart();\n output.lineStart();\n } else {\n output.lineEnd();\n output.lineStart();\n for (k = i - 1; k >= j; --k) {\n output.point(x0z[k], y0z[k]);\n }\n output.lineEnd();\n output.areaEnd();\n }\n }\n if (defined0) {\n x0z[i] = +x0(d, i, data), y0z[i] = +y0(d, i, data);\n output.point(x1 ? +x1(d, i, data) : x0z[i], y1 ? +y1(d, i, data) : y0z[i]);\n }\n }\n\n if (buffer) return output = null, buffer + "" || null;\n }\n\n function arealine() {\n return line().defined(defined).curve(curve).context(context);\n }\n\n area.x = function(_) {\n return arguments.length ? (x0 = typeof _ === "function" ? _ : constant(+_), x1 = null, area) : x0;\n };\n\n area.x0 = function(_) {\n return arguments.length ? (x0 = typeof _ === "function" ? _ : constant(+_), area) : x0;\n };\n\n area.x1 = function(_) {\n return arguments.length ? (x1 = _ == null ? null : typeof _ === "function" ? _ : constant(+_), area) : x1;\n };\n\n area.y = function(_) {\n return arguments.length ? (y0 = typeof _ === "function" ? _ : constant(+_), y1 = null, area) : y0;\n };\n\n area.y0 = function(_) {\n return arguments.length ? (y0 = typeof _ === "function" ? _ : constant(+_), area) : y0;\n };\n\n area.y1 = function(_) {\n return arguments.length ? (y1 = _ == null ? null : typeof _ === "function" ? _ : constant(+_), area) : y1;\n };\n\n area.lineX0 =\n area.lineY0 = function() {\n return arealine().x(x0).y(y0);\n };\n\n area.lineY1 = function() {\n return arealine().x(x0).y(y1);\n };\n\n area.lineX1 = function() {\n return arealine().x(x1).y(y0);\n };\n\n area.defined = function(_) {\n return arguments.length ? (defined = typeof _ === "function" ? _ : constant(!!_), area) : defined;\n };\n\n area.curve = function(_) {\n return arguments.length ? (curve = _, context != null && (output = curve(context)), area) : curve;\n };\n\n area.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), area) : context;\n };\n\n return area;\n};\n\nvar descending = function(a, b) {\n return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;\n};\n\nvar identity = function(d) {\n return d;\n};\n\nvar pie = function() {\n var value = identity,\n sortValues = descending,\n sort = null,\n startAngle = constant(0),\n endAngle = constant(tau),\n padAngle = constant(0);\n\n function pie(data) {\n var i,\n n = data.length,\n j,\n k,\n sum = 0,\n index = new Array(n),\n arcs = new Array(n),\n a0 = +startAngle.apply(this, arguments),\n da = Math.min(tau, Math.max(-tau, endAngle.apply(this, arguments) - a0)),\n a1,\n p = Math.min(Math.abs(da) / n, padAngle.apply(this, arguments)),\n pa = p * (da < 0 ? -1 : 1),\n v;\n\n for (i = 0; i < n; ++i) {\n if ((v = arcs[index[i] = i] = +value(data[i], i, data)) > 0) {\n sum += v;\n }\n }\n\n // Optionally sort the arcs by previously-computed values or by data.\n if (sortValues != null) index.sort(function(i, j) { return sortValues(arcs[i], arcs[j]); });\n else if (sort != null) index.sort(function(i, j) { return sort(data[i], data[j]); });\n\n // Compute the arcs! They are stored in the original data\'s order.\n for (i = 0, k = sum ? (da - n * pa) / sum : 0; i < n; ++i, a0 = a1) {\n j = index[i], v = arcs[j], a1 = a0 + (v > 0 ? v * k : 0) + pa, arcs[j] = {\n data: data[j],\n index: i,\n value: v,\n startAngle: a0,\n endAngle: a1,\n padAngle: p\n };\n }\n\n return arcs;\n }\n\n pie.value = function(_) {\n return arguments.length ? (value = typeof _ === "function" ? _ : constant(+_), pie) : value;\n };\n\n pie.sortValues = function(_) {\n return arguments.length ? (sortValues = _, sort = null, pie) : sortValues;\n };\n\n pie.sort = function(_) {\n return arguments.length ? (sort = _, sortValues = null, pie) : sort;\n };\n\n pie.startAngle = function(_) {\n return arguments.length ? (startAngle = typeof _ === "function" ? _ : constant(+_), pie) : startAngle;\n };\n\n pie.endAngle = function(_) {\n return arguments.length ? (endAngle = typeof _ === "function" ? _ : constant(+_), pie) : endAngle;\n };\n\n pie.padAngle = function(_) {\n return arguments.length ? (padAngle = typeof _ === "function" ? _ : constant(+_), pie) : padAngle;\n };\n\n return pie;\n};\n\nvar curveRadialLinear = curveRadial(curveLinear);\n\nfunction Radial(curve) {\n this._curve = curve;\n}\n\nRadial.prototype = {\n areaStart: function() {\n this._curve.areaStart();\n },\n areaEnd: function() {\n this._curve.areaEnd();\n },\n lineStart: function() {\n this._curve.lineStart();\n },\n lineEnd: function() {\n this._curve.lineEnd();\n },\n point: function(a, r) {\n this._curve.point(r * Math.sin(a), r * -Math.cos(a));\n }\n};\n\nfunction curveRadial(curve) {\n\n function radial(context) {\n return new Radial(curve(context));\n }\n\n radial._curve = curve;\n\n return radial;\n}\n\nfunction lineRadial(l) {\n var c = l.curve;\n\n l.angle = l.x, delete l.x;\n l.radius = l.y, delete l.y;\n\n l.curve = function(_) {\n return arguments.length ? c(curveRadial(_)) : c()._curve;\n };\n\n return l;\n}\n\nvar lineRadial$1 = function() {\n return lineRadial(line().curve(curveRadialLinear));\n};\n\nvar areaRadial = function() {\n var a = area().curve(curveRadialLinear),\n c = a.curve,\n x0 = a.lineX0,\n x1 = a.lineX1,\n y0 = a.lineY0,\n y1 = a.lineY1;\n\n a.angle = a.x, delete a.x;\n a.startAngle = a.x0, delete a.x0;\n a.endAngle = a.x1, delete a.x1;\n a.radius = a.y, delete a.y;\n a.innerRadius = a.y0, delete a.y0;\n a.outerRadius = a.y1, delete a.y1;\n a.lineStartAngle = function() { return lineRadial(x0()); }, delete a.lineX0;\n a.lineEndAngle = function() { return lineRadial(x1()); }, delete a.lineX1;\n a.lineInnerRadius = function() { return lineRadial(y0()); }, delete a.lineY0;\n a.lineOuterRadius = function() { return lineRadial(y1()); }, delete a.lineY1;\n\n a.curve = function(_) {\n return arguments.length ? c(curveRadial(_)) : c()._curve;\n };\n\n return a;\n};\n\nvar pointRadial = function(x, y) {\n return [(y = +y) * Math.cos(x -= Math.PI / 2), y * Math.sin(x)];\n};\n\nvar slice = Array.prototype.slice;\n\nfunction linkSource(d) {\n return d.source;\n}\n\nfunction linkTarget(d) {\n return d.target;\n}\n\nfunction link(curve) {\n var source = linkSource,\n target = linkTarget,\n x$$1 = x,\n y$$1 = y,\n context = null;\n\n function link() {\n var buffer, argv = slice.call(arguments), s = source.apply(this, argv), t = target.apply(this, argv);\n if (!context) context = buffer = d3Path.path();\n curve(context, +x$$1.apply(this, (argv[0] = s, argv)), +y$$1.apply(this, argv), +x$$1.apply(this, (argv[0] = t, argv)), +y$$1.apply(this, argv));\n if (buffer) return context = null, buffer + "" || null;\n }\n\n link.source = function(_) {\n return arguments.length ? (source = _, link) : source;\n };\n\n link.target = function(_) {\n return arguments.length ? (target = _, link) : target;\n };\n\n link.x = function(_) {\n return arguments.length ? (x$$1 = typeof _ === "function" ? _ : constant(+_), link) : x$$1;\n };\n\n link.y = function(_) {\n return arguments.length ? (y$$1 = typeof _ === "function" ? _ : constant(+_), link) : y$$1;\n };\n\n link.context = function(_) {\n return arguments.length ? ((context = _ == null ? null : _), link) : context;\n };\n\n return link;\n}\n\nfunction curveHorizontal(context, x0, y0, x1, y1) {\n context.moveTo(x0, y0);\n context.bezierCurveTo(x0 = (x0 + x1) / 2, y0, x0, y1, x1, y1);\n}\n\nfunction curveVertical(context, x0, y0, x1, y1) {\n context.moveTo(x0, y0);\n context.bezierCurveTo(x0, y0 = (y0 + y1) / 2, x1, y0, x1, y1);\n}\n\nfunction curveRadial$1(context, x0, y0, x1, y1) {\n var p0 = pointRadial(x0, y0),\n p1 = pointRadial(x0, y0 = (y0 + y1) / 2),\n p2 = pointRadial(x1, y0),\n p3 = pointRadial(x1, y1);\n context.moveTo(p0[0], p0[1]);\n context.bezierCurveTo(p1[0], p1[1], p2[0], p2[1], p3[0], p3[1]);\n}\n\nfunction linkHorizontal() {\n return link(curveHorizontal);\n}\n\nfunction linkVertical() {\n return link(curveVertical);\n}\n\nfunction linkRadial() {\n var l = link(curveRadial$1);\n l.angle = l.x, delete l.x;\n l.radius = l.y, delete l.y;\n return l;\n}\n\nvar circle = {\n draw: function(context, size) {\n var r = Math.sqrt(size / pi);\n context.moveTo(r, 0);\n context.arc(0, 0, r, 0, tau);\n }\n};\n\nvar cross = {\n draw: function(context, size) {\n var r = Math.sqrt(size / 5) / 2;\n context.moveTo(-3 * r, -r);\n context.lineTo(-r, -r);\n context.lineTo(-r, -3 * r);\n context.lineTo(r, -3 * r);\n context.lineTo(r, -r);\n context.lineTo(3 * r, -r);\n context.lineTo(3 * r, r);\n context.lineTo(r, r);\n context.lineTo(r, 3 * r);\n context.lineTo(-r, 3 * r);\n context.lineTo(-r, r);\n context.lineTo(-3 * r, r);\n context.closePath();\n }\n};\n\nvar tan30 = Math.sqrt(1 / 3);\nvar tan30_2 = tan30 * 2;\n\nvar diamond = {\n draw: function(context, size) {\n var y = Math.sqrt(size / tan30_2),\n x = y * tan30;\n context.moveTo(0, -y);\n context.lineTo(x, 0);\n context.lineTo(0, y);\n context.lineTo(-x, 0);\n context.closePath();\n }\n};\n\nvar ka = 0.89081309152928522810;\nvar kr = Math.sin(pi / 10) / Math.sin(7 * pi / 10);\nvar kx = Math.sin(tau / 10) * kr;\nvar ky = -Math.cos(tau / 10) * kr;\n\nvar star = {\n draw: function(context, size) {\n var r = Math.sqrt(size * ka),\n x = kx * r,\n y = ky * r;\n context.moveTo(0, -r);\n context.lineTo(x, y);\n for (var i = 1; i < 5; ++i) {\n var a = tau * i / 5,\n c = Math.cos(a),\n s = Math.sin(a);\n context.lineTo(s * r, -c * r);\n context.lineTo(c * x - s * y, s * x + c * y);\n }\n context.closePath();\n }\n};\n\nvar square = {\n draw: function(context, size) {\n var w = Math.sqrt(size),\n x = -w / 2;\n context.rect(x, x, w, w);\n }\n};\n\nvar sqrt3 = Math.sqrt(3);\n\nvar triangle = {\n draw: function(context, size) {\n var y = -Math.sqrt(size / (sqrt3 * 3));\n context.moveTo(0, y * 2);\n context.lineTo(-sqrt3 * y, -y);\n context.lineTo(sqrt3 * y, -y);\n context.closePath();\n }\n};\n\nvar c = -0.5;\nvar s = Math.sqrt(3) / 2;\nvar k = 1 / Math.sqrt(12);\nvar a = (k / 2 + 1) * 3;\n\nvar wye = {\n draw: function(context, size) {\n var r = Math.sqrt(size / a),\n x0 = r / 2,\n y0 = r * k,\n x1 = x0,\n y1 = r * k + r,\n x2 = -x1,\n y2 = y1;\n context.moveTo(x0, y0);\n context.lineTo(x1, y1);\n context.lineTo(x2, y2);\n context.lineTo(c * x0 - s * y0, s * x0 + c * y0);\n context.lineTo(c * x1 - s * y1, s * x1 + c * y1);\n context.lineTo(c * x2 - s * y2, s * x2 + c * y2);\n context.lineTo(c * x0 + s * y0, c * y0 - s * x0);\n context.lineTo(c * x1 + s * y1, c * y1 - s * x1);\n context.lineTo(c * x2 + s * y2, c * y2 - s * x2);\n context.closePath();\n }\n};\n\nvar symbols = [\n circle,\n cross,\n diamond,\n square,\n star,\n triangle,\n wye\n];\n\nvar symbol = function() {\n var type = constant(circle),\n size = constant(64),\n context = null;\n\n function symbol() {\n var buffer;\n if (!context) context = buffer = d3Path.path();\n type.apply(this, arguments).draw(context, +size.apply(this, arguments));\n if (buffer) return context = null, buffer + "" || null;\n }\n\n symbol.type = function(_) {\n return arguments.length ? (type = typeof _ === "function" ? _ : constant(_), symbol) : type;\n };\n\n symbol.size = function(_) {\n return arguments.length ? (size = typeof _ === "function" ? _ : constant(+_), symbol) : size;\n };\n\n symbol.context = function(_) {\n return arguments.length ? (context = _ == null ? null : _, symbol) : context;\n };\n\n return symbol;\n};\n\nvar noop = function() {};\n\nfunction point(that, x, y) {\n that._context.bezierCurveTo(\n (2 * that._x0 + that._x1) / 3,\n (2 * that._y0 + that._y1) / 3,\n (that._x0 + 2 * that._x1) / 3,\n (that._y0 + 2 * that._y1) / 3,\n (that._x0 + 4 * that._x1 + x) / 6,\n (that._y0 + 4 * that._y1 + y) / 6\n );\n}\n\nfunction Basis(context) {\n this._context = context;\n}\n\nBasis.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 3: point(this, this._x1, this._y1); // proceed\n case 2: this._context.lineTo(this._x1, this._y1); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6); // proceed\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nvar basis = function(context) {\n return new Basis(context);\n};\n\nfunction BasisClosed(context) {\n this._context = context;\n}\n\nBasisClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x2, this._y2);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3);\n this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x2, this._y2);\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._x2 = x, this._y2 = y; break;\n case 1: this._point = 2; this._x3 = x, this._y3 = y; break;\n case 2: this._point = 3; this._x4 = x, this._y4 = y; this._context.moveTo((this._x0 + 4 * this._x1 + x) / 6, (this._y0 + 4 * this._y1 + y) / 6); break;\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nvar basisClosed = function(context) {\n return new BasisClosed(context);\n};\n\nfunction BasisOpen(context) {\n this._context = context;\n}\n\nBasisOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; var x0 = (this._x0 + 4 * this._x1 + x) / 6, y0 = (this._y0 + 4 * this._y1 + y) / 6; this._line ? this._context.lineTo(x0, y0) : this._context.moveTo(x0, y0); break;\n case 3: this._point = 4; // proceed\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nvar basisOpen = function(context) {\n return new BasisOpen(context);\n};\n\nfunction Bundle(context, beta) {\n this._basis = new Basis(context);\n this._beta = beta;\n}\n\nBundle.prototype = {\n lineStart: function() {\n this._x = [];\n this._y = [];\n this._basis.lineStart();\n },\n lineEnd: function() {\n var x = this._x,\n y = this._y,\n j = x.length - 1;\n\n if (j > 0) {\n var x0 = x[0],\n y0 = y[0],\n dx = x[j] - x0,\n dy = y[j] - y0,\n i = -1,\n t;\n\n while (++i <= j) {\n t = i / j;\n this._basis.point(\n this._beta * x[i] + (1 - this._beta) * (x0 + t * dx),\n this._beta * y[i] + (1 - this._beta) * (y0 + t * dy)\n );\n }\n }\n\n this._x = this._y = null;\n this._basis.lineEnd();\n },\n point: function(x, y) {\n this._x.push(+x);\n this._y.push(+y);\n }\n};\n\nvar bundle = ((function custom(beta) {\n\n function bundle(context) {\n return beta === 1 ? new Basis(context) : new Bundle(context, beta);\n }\n\n bundle.beta = function(beta) {\n return custom(+beta);\n };\n\n return bundle;\n}))(0.85);\n\nfunction point$1(that, x, y) {\n that._context.bezierCurveTo(\n that._x1 + that._k * (that._x2 - that._x0),\n that._y1 + that._k * (that._y2 - that._y0),\n that._x2 + that._k * (that._x1 - x),\n that._y2 + that._k * (that._y1 - y),\n that._x2,\n that._y2\n );\n}\n\nfunction Cardinal(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinal.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x2, this._y2); break;\n case 3: point$1(this, this._x1, this._y1); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; this._x1 = x, this._y1 = y; break;\n case 2: this._point = 3; // proceed\n default: point$1(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nvar cardinal = ((function custom(tension) {\n\n function cardinal(context) {\n return new Cardinal(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n}))(0);\n\nfunction CardinalClosed(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinalClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.lineTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n this.point(this._x5, this._y5);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._x3 = x, this._y3 = y; break;\n case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break;\n case 2: this._point = 3; this._x5 = x, this._y5 = y; break;\n default: point$1(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nvar cardinalClosed = ((function custom(tension) {\n\n function cardinal(context) {\n return new CardinalClosed(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n}))(0);\n\nfunction CardinalOpen(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinalOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break;\n case 3: this._point = 4; // proceed\n default: point$1(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nvar cardinalOpen = ((function custom(tension) {\n\n function cardinal(context) {\n return new CardinalOpen(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n}))(0);\n\nfunction point$2(that, x, y) {\n var x1 = that._x1,\n y1 = that._y1,\n x2 = that._x2,\n y2 = that._y2;\n\n if (that._l01_a > epsilon) {\n var a = 2 * that._l01_2a + 3 * that._l01_a * that._l12_a + that._l12_2a,\n n = 3 * that._l01_a * (that._l01_a + that._l12_a);\n x1 = (x1 * a - that._x0 * that._l12_2a + that._x2 * that._l01_2a) / n;\n y1 = (y1 * a - that._y0 * that._l12_2a + that._y2 * that._l01_2a) / n;\n }\n\n if (that._l23_a > epsilon) {\n var b = 2 * that._l23_2a + 3 * that._l23_a * that._l12_a + that._l12_2a,\n m = 3 * that._l23_a * (that._l23_a + that._l12_a);\n x2 = (x2 * b + that._x1 * that._l23_2a - x * that._l12_2a) / m;\n y2 = (y2 * b + that._y1 * that._l23_2a - y * that._l12_2a) / m;\n }\n\n that._context.bezierCurveTo(x1, y1, x2, y2, that._x2, that._y2);\n}\n\nfunction CatmullRom(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRom.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x2, this._y2); break;\n case 3: this.point(this._x2, this._y2); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; // proceed\n default: point$2(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nvar catmullRom = ((function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRom(context, alpha) : new Cardinal(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n}))(0.5);\n\nfunction CatmullRomClosed(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRomClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.lineTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n this.point(this._x5, this._y5);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; this._x3 = x, this._y3 = y; break;\n case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break;\n case 2: this._point = 3; this._x5 = x, this._y5 = y; break;\n default: point$2(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nvar catmullRomClosed = ((function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRomClosed(context, alpha) : new CardinalClosed(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n}))(0.5);\n\nfunction CatmullRomOpen(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRomOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break;\n case 3: this._point = 4; // proceed\n default: point$2(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nvar catmullRomOpen = ((function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRomOpen(context, alpha) : new CardinalOpen(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n}))(0.5);\n\nfunction LinearClosed(context) {\n this._context = context;\n}\n\nLinearClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._point) this._context.closePath();\n },\n point: function(x, y) {\n x = +x, y = +y;\n if (this._point) this._context.lineTo(x, y);\n else this._point = 1, this._context.moveTo(x, y);\n }\n};\n\nvar linearClosed = function(context) {\n return new LinearClosed(context);\n};\n\nfunction sign(x) {\n return x < 0 ? -1 : 1;\n}\n\n// Calculate the slopes of the tangents (Hermite-type interpolation) based on\n// the following paper: Steffen, M. 1990. A Simple Method for Monotonic\n// Interpolation in One Dimension. Astronomy and Astrophysics, Vol. 239, NO.\n// NOV(II), P. 443, 1990.\nfunction slope3(that, x2, y2) {\n var h0 = that._x1 - that._x0,\n h1 = x2 - that._x1,\n s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0),\n s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0),\n p = (s0 * h1 + s1 * h0) / (h0 + h1);\n return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;\n}\n\n// Calculate a one-sided slope.\nfunction slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}\n\n// According to https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Representations\n// "you can express cubic Hermite interpolation in terms of cubic Bézier curves\n// with respect to the four values p0, p0 + m0 / 3, p1 - m1 / 3, p1".\nfunction point$3(that, t0, t1) {\n var x0 = that._x0,\n y0 = that._y0,\n x1 = that._x1,\n y1 = that._y1,\n dx = (x1 - x0) / 3;\n that._context.bezierCurveTo(x0 + dx, y0 + dx * t0, x1 - dx, y1 - dx * t1, x1, y1);\n}\n\nfunction MonotoneX(context) {\n this._context = context;\n}\n\nMonotoneX.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 =\n this._t0 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x1, this._y1); break;\n case 3: point$3(this, this._t0, slope2(this, this._t0)); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n var t1 = NaN;\n\n x = +x, y = +y;\n if (x === this._x1 && y === this._y1) return; // Ignore coincident points.\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; point$3(this, slope2(this, t1 = slope3(this, x, y)), t1); break;\n default: point$3(this, this._t0, t1 = slope3(this, x, y)); break;\n }\n\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n this._t0 = t1;\n }\n};\n\nfunction MonotoneY(context) {\n this._context = new ReflectContext(context);\n}\n\n(MonotoneY.prototype = Object.create(MonotoneX.prototype)).point = function(x, y) {\n MonotoneX.prototype.point.call(this, y, x);\n};\n\nfunction ReflectContext(context) {\n this._context = context;\n}\n\nReflectContext.prototype = {\n moveTo: function(x, y) { this._context.moveTo(y, x); },\n closePath: function() { this._context.closePath(); },\n lineTo: function(x, y) { this._context.lineTo(y, x); },\n bezierCurveTo: function(x1, y1, x2, y2, x, y) { this._context.bezierCurveTo(y1, x1, y2, x2, y, x); }\n};\n\nfunction monotoneX(context) {\n return new MonotoneX(context);\n}\n\nfunction monotoneY(context) {\n return new MonotoneY(context);\n}\n\nfunction Natural(context) {\n this._context = context;\n}\n\nNatural.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x = [];\n this._y = [];\n },\n lineEnd: function() {\n var x = this._x,\n y = this._y,\n n = x.length;\n\n if (n) {\n this._line ? this._context.lineTo(x[0], y[0]) : this._context.moveTo(x[0], y[0]);\n if (n === 2) {\n this._context.lineTo(x[1], y[1]);\n } else {\n var px = controlPoints(x),\n py = controlPoints(y);\n for (var i0 = 0, i1 = 1; i1 < n; ++i0, ++i1) {\n this._context.bezierCurveTo(px[0][i0], py[0][i0], px[1][i0], py[1][i0], x[i1], y[i1]);\n }\n }\n }\n\n if (this._line || (this._line !== 0 && n === 1)) this._context.closePath();\n this._line = 1 - this._line;\n this._x = this._y = null;\n },\n point: function(x, y) {\n this._x.push(+x);\n this._y.push(+y);\n }\n};\n\n// See https://www.particleincell.com/2012/bezier-splines/ for derivation.\nfunction controlPoints(x) {\n var i,\n n = x.length - 1,\n m,\n a = new Array(n),\n b = new Array(n),\n r = new Array(n);\n a[0] = 0, b[0] = 2, r[0] = x[0] + 2 * x[1];\n for (i = 1; i < n - 1; ++i) a[i] = 1, b[i] = 4, r[i] = 4 * x[i] + 2 * x[i + 1];\n a[n - 1] = 2, b[n - 1] = 7, r[n - 1] = 8 * x[n - 1] + x[n];\n for (i = 1; i < n; ++i) m = a[i] / b[i - 1], b[i] -= m, r[i] -= m * r[i - 1];\n a[n - 1] = r[n - 1] / b[n - 1];\n for (i = n - 2; i >= 0; --i) a[i] = (r[i] - a[i + 1]) / b[i];\n b[n - 1] = (x[n] + a[n - 1]) / 2;\n for (i = 0; i < n - 1; ++i) b[i] = 2 * x[i + 1] - a[i + 1];\n return [a, b];\n}\n\nvar natural = function(context) {\n return new Natural(context);\n};\n\nfunction Step(context, t) {\n this._context = context;\n this._t = t;\n}\n\nStep.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x = this._y = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (0 < this._t && this._t < 1 && this._point === 2) this._context.lineTo(this._x, this._y);\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n if (this._line >= 0) this._t = 1 - this._t, this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // proceed\n default: {\n if (this._t <= 0) {\n this._context.lineTo(this._x, y);\n this._context.lineTo(x, y);\n } else {\n var x1 = this._x * (1 - this._t) + x * this._t;\n this._context.lineTo(x1, this._y);\n this._context.lineTo(x1, y);\n }\n break;\n }\n }\n this._x = x, this._y = y;\n }\n};\n\nvar step = function(context) {\n return new Step(context, 0.5);\n};\n\nfunction stepBefore(context) {\n return new Step(context, 0);\n}\n\nfunction stepAfter(context) {\n return new Step(context, 1);\n}\n\nvar none = function(series, order) {\n if (!((n = series.length) > 1)) return;\n for (var i = 1, j, s0, s1 = series[order[0]], n, m = s1.length; i < n; ++i) {\n s0 = s1, s1 = series[order[i]];\n for (j = 0; j < m; ++j) {\n s1[j][1] += s1[j][0] = isNaN(s0[j][1]) ? s0[j][0] : s0[j][1];\n }\n }\n};\n\nvar none$1 = function(series) {\n var n = series.length, o = new Array(n);\n while (--n >= 0) o[n] = n;\n return o;\n};\n\nfunction stackValue(d, key) {\n return d[key];\n}\n\nvar stack = function() {\n var keys = constant([]),\n order = none$1,\n offset = none,\n value = stackValue;\n\n function stack(data) {\n var kz = keys.apply(this, arguments),\n i,\n m = data.length,\n n = kz.length,\n sz = new Array(n),\n oz;\n\n for (i = 0; i < n; ++i) {\n for (var ki = kz[i], si = sz[i] = new Array(m), j = 0, sij; j < m; ++j) {\n si[j] = sij = [0, +value(data[j], ki, j, data)];\n sij.data = data[j];\n }\n si.key = ki;\n }\n\n for (i = 0, oz = order(sz); i < n; ++i) {\n sz[oz[i]].index = i;\n }\n\n offset(sz, oz);\n return sz;\n }\n\n stack.keys = function(_) {\n return arguments.length ? (keys = typeof _ === "function" ? _ : constant(slice.call(_)), stack) : keys;\n };\n\n stack.value = function(_) {\n return arguments.length ? (value = typeof _ === "function" ? _ : constant(+_), stack) : value;\n };\n\n stack.order = function(_) {\n return arguments.length ? (order = _ == null ? none$1 : typeof _ === "function" ? _ : constant(slice.call(_)), stack) : order;\n };\n\n stack.offset = function(_) {\n return arguments.length ? (offset = _ == null ? none : _, stack) : offset;\n };\n\n return stack;\n};\n\nvar expand = function(series, order) {\n if (!((n = series.length) > 0)) return;\n for (var i, n, j = 0, m = series[0].length, y; j < m; ++j) {\n for (y = i = 0; i < n; ++i) y += series[i][j][1] || 0;\n if (y) for (i = 0; i < n; ++i) series[i][j][1] /= y;\n }\n none(series, order);\n};\n\nvar diverging = function(series, order) {\n if (!((n = series.length) > 1)) return;\n for (var i, j = 0, d, dy, yp, yn, n, m = series[order[0]].length; j < m; ++j) {\n for (yp = yn = 0, i = 0; i < n; ++i) {\n if ((dy = (d = series[order[i]][j])[1] - d[0]) >= 0) {\n d[0] = yp, d[1] = yp += dy;\n } else if (dy < 0) {\n d[1] = yn, d[0] = yn += dy;\n } else {\n d[0] = yp;\n }\n }\n }\n};\n\nvar silhouette = function(series, order) {\n if (!((n = series.length) > 0)) return;\n for (var j = 0, s0 = series[order[0]], n, m = s0.length; j < m; ++j) {\n for (var i = 0, y = 0; i < n; ++i) y += series[i][j][1] || 0;\n s0[j][1] += s0[j][0] = -y / 2;\n }\n none(series, order);\n};\n\nvar wiggle = function(series, order) {\n if (!((n = series.length) > 0) || !((m = (s0 = series[order[0]]).length) > 0)) return;\n for (var y = 0, j = 1, s0, m, n; j < m; ++j) {\n for (var i = 0, s1 = 0, s2 = 0; i < n; ++i) {\n var si = series[order[i]],\n sij0 = si[j][1] || 0,\n sij1 = si[j - 1][1] || 0,\n s3 = (sij0 - sij1) / 2;\n for (var k = 0; k < i; ++k) {\n var sk = series[order[k]],\n skj0 = sk[j][1] || 0,\n skj1 = sk[j - 1][1] || 0;\n s3 += skj0 - skj1;\n }\n s1 += sij0, s2 += s3 * sij0;\n }\n s0[j - 1][1] += s0[j - 1][0] = y;\n if (s1) y -= s2 / s1;\n }\n s0[j - 1][1] += s0[j - 1][0] = y;\n none(series, order);\n};\n\nvar ascending = function(series) {\n var sums = series.map(sum);\n return none$1(series).sort(function(a, b) { return sums[a] - sums[b]; });\n};\n\nfunction sum(series) {\n var s = 0, i = -1, n = series.length, v;\n while (++i < n) if (v = +series[i][1]) s += v;\n return s;\n}\n\nvar descending$1 = function(series) {\n return ascending(series).reverse();\n};\n\nvar insideOut = function(series) {\n var n = series.length,\n i,\n j,\n sums = series.map(sum),\n order = none$1(series).sort(function(a, b) { return sums[b] - sums[a]; }),\n top = 0,\n bottom = 0,\n tops = [],\n bottoms = [];\n\n for (i = 0; i < n; ++i) {\n j = order[i];\n if (top < bottom) {\n top += sums[j];\n tops.push(j);\n } else {\n bottom += sums[j];\n bottoms.push(j);\n }\n }\n\n return bottoms.reverse().concat(tops);\n};\n\nvar reverse = function(series) {\n return none$1(series).reverse();\n};\n\nexports.arc = arc;\nexports.area = area;\nexports.line = line;\nexports.pie = pie;\nexports.areaRadial = areaRadial;\nexports.radialArea = areaRadial;\nexports.lineRadial = lineRadial$1;\nexports.radialLine = lineRadial$1;\nexports.pointRadial = pointRadial;\nexports.linkHorizontal = linkHorizontal;\nexports.linkVertical = linkVertical;\nexports.linkRadial = linkRadial;\nexports.symbol = symbol;\nexports.symbols = symbols;\nexports.symbolCircle = circle;\nexports.symbolCross = cross;\nexports.symbolDiamond = diamond;\nexports.symbolSquare = square;\nexports.symbolStar = star;\nexports.symbolTriangle = triangle;\nexports.symbolWye = wye;\nexports.curveBasisClosed = basisClosed;\nexports.curveBasisOpen = basisOpen;\nexports.curveBasis = basis;\nexports.curveBundle = bundle;\nexports.curveCardinalClosed = cardinalClosed;\nexports.curveCardinalOpen = cardinalOpen;\nexports.curveCardinal = cardinal;\nexports.curveCatmullRomClosed = catmullRomClosed;\nexports.curveCatmullRomOpen = catmullRomOpen;\nexports.curveCatmullRom = catmullRom;\nexports.curveLinearClosed = linearClosed;\nexports.curveLinear = curveLinear;\nexports.curveMonotoneX = monotoneX;\nexports.curveMonotoneY = monotoneY;\nexports.curveNatural = natural;\nexports.curveStep = step;\nexports.curveStepAfter = stepAfter;\nexports.curveStepBefore = stepBefore;\nexports.stack = stack;\nexports.stackOffsetExpand = expand;\nexports.stackOffsetDiverging = diverging;\nexports.stackOffsetNone = none;\nexports.stackOffsetSilhouette = silhouette;\nexports.stackOffsetWiggle = wiggle;\nexports.stackOrderAscending = ascending;\nexports.stackOrderDescending = descending$1;\nexports.stackOrderInsideOut = insideOut;\nexports.stackOrderNone = none$1;\nexports.stackOrderReverse = reverse;\n\nObject.defineProperty(exports, \'__esModule\', { value: true });\n\n})));\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/d3-shape/build/d3-shape.js\n// module id = 13\n// module chunks = 0\n//# sourceURL=webpack:///./~/d3-shape/build/d3-shape.js?'); | |
},function(module,exports,__webpack_require__){eval('// https://d3js.org/d3-path/ Version 1.0.5. Copyright 2017 Mike Bostock.\n(function (global, factory) {\n\t true ? factory(exports) :\n\ttypeof define === \'function\' && define.amd ? define([\'exports\'], factory) :\n\t(factory((global.d3 = global.d3 || {})));\n}(this, (function (exports) { \'use strict\';\n\nvar pi = Math.PI;\nvar tau = 2 * pi;\nvar epsilon = 1e-6;\nvar tauEpsilon = tau - epsilon;\n\nfunction Path() {\n this._x0 = this._y0 = // start of current subpath\n this._x1 = this._y1 = null; // end of current subpath\n this._ = "";\n}\n\nfunction path() {\n return new Path;\n}\n\nPath.prototype = path.prototype = {\n constructor: Path,\n moveTo: function(x, y) {\n this._ += "M" + (this._x0 = this._x1 = +x) + "," + (this._y0 = this._y1 = +y);\n },\n closePath: function() {\n if (this._x1 !== null) {\n this._x1 = this._x0, this._y1 = this._y0;\n this._ += "Z";\n }\n },\n lineTo: function(x, y) {\n this._ += "L" + (this._x1 = +x) + "," + (this._y1 = +y);\n },\n quadraticCurveTo: function(x1, y1, x, y) {\n this._ += "Q" + (+x1) + "," + (+y1) + "," + (this._x1 = +x) + "," + (this._y1 = +y);\n },\n bezierCurveTo: function(x1, y1, x2, y2, x, y) {\n this._ += "C" + (+x1) + "," + (+y1) + "," + (+x2) + "," + (+y2) + "," + (this._x1 = +x) + "," + (this._y1 = +y);\n },\n arcTo: function(x1, y1, x2, y2, r) {\n x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;\n var x0 = this._x1,\n y0 = this._y1,\n x21 = x2 - x1,\n y21 = y2 - y1,\n x01 = x0 - x1,\n y01 = y0 - y1,\n l01_2 = x01 * x01 + y01 * y01;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error("negative radius: " + r);\n\n // Is this path empty? Move to (x1,y1).\n if (this._x1 === null) {\n this._ += "M" + (this._x1 = x1) + "," + (this._y1 = y1);\n }\n\n // Or, is (x1,y1) coincident with (x0,y0)? Do nothing.\n else if (!(l01_2 > epsilon)) {}\n\n // Or, are (x0,y0), (x1,y1) and (x2,y2) collinear?\n // Equivalently, is (x1,y1) coincident with (x2,y2)?\n // Or, is the radius zero? Line to (x1,y1).\n else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) {\n this._ += "L" + (this._x1 = x1) + "," + (this._y1 = y1);\n }\n\n // Otherwise, draw an arc!\n else {\n var x20 = x2 - x0,\n y20 = y2 - y0,\n l21_2 = x21 * x21 + y21 * y21,\n l20_2 = x20 * x20 + y20 * y20,\n l21 = Math.sqrt(l21_2),\n l01 = Math.sqrt(l01_2),\n l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2),\n t01 = l / l01,\n t21 = l / l21;\n\n // If the start tangent is not coincident with (x0,y0), line to.\n if (Math.abs(t01 - 1) > epsilon) {\n this._ += "L" + (x1 + t01 * x01) + "," + (y1 + t01 * y01);\n }\n\n this._ += "A" + r + "," + r + ",0,0," + (+(y01 * x20 > x01 * y20)) + "," + (this._x1 = x1 + t21 * x21) + "," + (this._y1 = y1 + t21 * y21);\n }\n },\n arc: function(x, y, r, a0, a1, ccw) {\n x = +x, y = +y, r = +r;\n var dx = r * Math.cos(a0),\n dy = r * Math.sin(a0),\n x0 = x + dx,\n y0 = y + dy,\n cw = 1 ^ ccw,\n da = ccw ? a0 - a1 : a1 - a0;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error("negative radius: " + r);\n\n // Is this path empty? Move to (x0,y0).\n if (this._x1 === null) {\n this._ += "M" + x0 + "," + y0;\n }\n\n // Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0).\n else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) {\n this._ += "L" + x0 + "," + y0;\n }\n\n // Is this arc empty? We’re done.\n if (!r) return;\n\n // Does the angle go the wrong way? Flip the direction.\n if (da < 0) da = da % tau + tau;\n\n // Is this a complete circle? Draw two arcs to complete the circle.\n if (da > tauEpsilon) {\n this._ += "A" + r + "," + r + ",0,1," + cw + "," + (x - dx) + "," + (y - dy) + "A" + r + "," + r + ",0,1," + cw + "," + (this._x1 = x0) + "," + (this._y1 = y0);\n }\n\n // Is this arc non-empty? Draw an arc!\n else if (da > epsilon) {\n this._ += "A" + r + "," + r + ",0," + (+(da >= pi)) + "," + cw + "," + (this._x1 = x + r * Math.cos(a1)) + "," + (this._y1 = y + r * Math.sin(a1));\n }\n },\n rect: function(x, y, w, h) {\n this._ += "M" + (this._x0 = this._x1 = +x) + "," + (this._y0 = this._y1 = +y) + "h" + (+w) + "v" + (+h) + "h" + (-w) + "Z";\n },\n toString: function() {\n return this._;\n }\n};\n\nexports.path = path;\n\nObject.defineProperty(exports, \'__esModule\', { value: true });\n\n})));\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/d3-path/build/d3-path.js\n// module id = 14\n// module chunks = 0\n//# sourceURL=webpack:///./~/d3-path/build/d3-path.js?')},function(module,exports,__webpack_require__){eval('// https://d3js.org/d3-selection/ Version 1.1.0. Copyright 2017 Mike Bostock.\n(function (global, factory) {\n\t true ? factory(exports) :\n\ttypeof define === \'function\' && define.amd ? define([\'exports\'], factory) :\n\t(factory((global.d3 = global.d3 || {})));\n}(this, (function (exports) { \'use strict\';\n\nvar xhtml = "http://www.w3.org/1999/xhtml";\n\nvar namespaces = {\n svg: "http://www.w3.org/2000/svg",\n xhtml: xhtml,\n xlink: "http://www.w3.org/1999/xlink",\n xml: "http://www.w3.org/XML/1998/namespace",\n xmlns: "http://www.w3.org/2000/xmlns/"\n};\n\nvar namespace = function(name) {\n var prefix = name += "", i = prefix.indexOf(":");\n if (i >= 0 && (prefix = name.slice(0, i)) !== "xmlns") name = name.slice(i + 1);\n return namespaces.hasOwnProperty(prefix) ? {space: namespaces[prefix], local: name} : name;\n};\n\nfunction creatorInherit(name) {\n return function() {\n var document = this.ownerDocument,\n uri = this.namespaceURI;\n return uri === xhtml && document.documentElement.namespaceURI === xhtml\n ? document.createElement(name)\n : document.createElementNS(uri, name);\n };\n}\n\nfunction creatorFixed(fullname) {\n return function() {\n return this.ownerDocument.createElementNS(fullname.space, fullname.local);\n };\n}\n\nvar creator = function(name) {\n var fullname = namespace(name);\n return (fullname.local\n ? creatorFixed\n : creatorInherit)(fullname);\n};\n\nvar nextId = 0;\n\nfunction local() {\n return new Local;\n}\n\nfunction Local() {\n this._ = "@" + (++nextId).toString(36);\n}\n\nLocal.prototype = local.prototype = {\n constructor: Local,\n get: function(node) {\n var id = this._;\n while (!(id in node)) if (!(node = node.parentNode)) return;\n return node[id];\n },\n set: function(node, value) {\n return node[this._] = value;\n },\n remove: function(node) {\n return this._ in node && delete node[this._];\n },\n toString: function() {\n return this._;\n }\n};\n\nvar matcher = function(selector) {\n return function() {\n return this.matches(selector);\n };\n};\n\nif (typeof document !== "undefined") {\n var element = document.documentElement;\n if (!element.matches) {\n var vendorMatches = element.webkitMatchesSelector\n || element.msMatchesSelector\n || element.mozMatchesSelector\n || element.oMatchesSelector;\n matcher = function(selector) {\n return function() {\n return vendorMatches.call(this, selector);\n };\n };\n }\n}\n\nvar matcher$1 = matcher;\n\nvar filterEvents = {};\n\nexports.event = null;\n\nif (typeof document !== "undefined") {\n var element$1 = document.documentElement;\n if (!("onmouseenter" in element$1)) {\n filterEvents = {mouseenter: "mouseover", mouseleave: "mouseout"};\n }\n}\n\nfunction filterContextListener(listener, index, group) {\n listener = contextListener(listener, index, group);\n return function(event) {\n var related = event.relatedTarget;\n if (!related || (related !== this && !(related.compareDocumentPosition(this) & 8))) {\n listener.call(this, event);\n }\n };\n}\n\nfunction contextListener(listener, index, group) {\n return function(event1) {\n var event0 = exports.event; // Events can be reentrant (e.g., focus).\n exports.event = event1;\n try {\n listener.call(this, this.__data__, index, group);\n } finally {\n exports.event = event0;\n }\n };\n}\n\nfunction parseTypenames(typenames) {\n return typenames.trim().split(/^|\\s+/).map(function(t) {\n var name = "", i = t.indexOf(".");\n if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);\n return {type: t, name: name};\n });\n}\n\nfunction onRemove(typename) {\n return function() {\n var on = this.__on;\n if (!on) return;\n for (var j = 0, i = -1, m = on.length, o; j < m; ++j) {\n if (o = on[j], (!typename.type || o.type === typename.type) && o.name === typename.name) {\n this.removeEventListener(o.type, o.listener, o.capture);\n } else {\n on[++i] = o;\n }\n }\n if (++i) on.length = i;\n else delete this.__on;\n };\n}\n\nfunction onAdd(typename, value, capture) {\n var wrap = filterEvents.hasOwnProperty(typename.type) ? filterContextListener : contextListener;\n return function(d, i, group) {\n var on = this.__on, o, listener = wrap(value, i, group);\n if (on) for (var j = 0, m = on.length; j < m; ++j) {\n if ((o = on[j]).type === typename.type && o.name === typename.name) {\n this.removeEventListener(o.type, o.listener, o.capture);\n this.addEventListener(o.type, o.listener = listener, o.capture = capture);\n o.value = value;\n return;\n }\n }\n this.addEventListener(typename.type, listener, capture);\n o = {type: typename.type, name: typename.name, value: value, listener: listener, capture: capture};\n if (!on) this.__on = [o];\n else on.push(o);\n };\n}\n\nvar selection_on = function(typename, value, capture) {\n var typenames = parseTypenames(typename + ""), i, n = typenames.length, t;\n\n if (arguments.length < 2) {\n var on = this.node().__on;\n if (on) for (var j = 0, m = on.length, o; j < m; ++j) {\n for (i = 0, o = on[j]; i < n; ++i) {\n if ((t = typenames[i]).type === o.type && t.name === o.name) {\n return o.value;\n }\n }\n }\n return;\n }\n\n on = value ? onAdd : onRemove;\n if (capture == null) capture = false;\n for (i = 0; i < n; ++i) this.each(on(typenames[i], value, capture));\n return this;\n};\n\nfunction customEvent(event1, listener, that, args) {\n var event0 = exports.event;\n event1.sourceEvent = exports.event;\n exports.event = event1;\n try {\n return listener.apply(that, args);\n } finally {\n exports.event = event0;\n }\n}\n\nvar sourceEvent = function() {\n var current = exports.event, source;\n while (source = current.sourceEvent) current = source;\n return current;\n};\n\nvar point = function(node, event) {\n var svg = node.ownerSVGElement || node;\n\n if (svg.createSVGPoint) {\n var point = svg.createSVGPoint();\n point.x = event.clientX, point.y = event.clientY;\n point = point.matrixTransform(node.getScreenCTM().inverse());\n return [point.x, point.y];\n }\n\n var rect = node.getBoundingClientRect();\n return [event.clientX - rect.left - node.clientLeft, event.clientY - rect.top - node.clientTop];\n};\n\nvar mouse = function(node) {\n var event = sourceEvent();\n if (event.changedTouches) event = event.changedTouches[0];\n return point(node, event);\n};\n\nfunction none() {}\n\nvar selector = function(selector) {\n return selector == null ? none : function() {\n return this.querySelector(selector);\n };\n};\n\nvar selection_select = function(select) {\n if (typeof select !== "function") select = selector(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {\n if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {\n if ("__data__" in node) subnode.__data__ = node.__data__;\n subgroup[i] = subnode;\n }\n }\n }\n\n return new Selection(subgroups, this._parents);\n};\n\nfunction empty() {\n return [];\n}\n\nvar selectorAll = function(selector) {\n return selector == null ? empty : function() {\n return this.querySelectorAll(selector);\n };\n};\n\nvar selection_selectAll = function(select) {\n if (typeof select !== "function") select = selectorAll(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n subgroups.push(select.call(node, node.__data__, i, group));\n parents.push(node);\n }\n }\n }\n\n return new Selection(subgroups, parents);\n};\n\nvar selection_filter = function(match) {\n if (typeof match !== "function") match = matcher$1(match);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {\n if ((node = group[i]) && match.call(node, node.__data__, i, group)) {\n subgroup.push(node);\n }\n }\n }\n\n return new Selection(subgroups, this._parents);\n};\n\nvar sparse = function(update) {\n return new Array(update.length);\n};\n\nvar selection_enter = function() {\n return new Selection(this._enter || this._groups.map(sparse), this._parents);\n};\n\nfunction EnterNode(parent, datum) {\n this.ownerDocument = parent.ownerDocument;\n this.namespaceURI = parent.namespaceURI;\n this._next = null;\n this._parent = parent;\n this.__data__ = datum;\n}\n\nEnterNode.prototype = {\n constructor: EnterNode,\n appendChild: function(child) { return this._parent.insertBefore(child, this._next); },\n insertBefore: function(child, next) { return this._parent.insertBefore(child, next); },\n querySelector: function(selector) { return this._parent.querySelector(selector); },\n querySelectorAll: function(selector) { return this._parent.querySelectorAll(selector); }\n};\n\nvar constant = function(x) {\n return function() {\n return x;\n };\n};\n\nvar keyPrefix = "$"; // Protect against keys like “__proto__”.\n\nfunction bindIndex(parent, group, enter, update, exit, data) {\n var i = 0,\n node,\n groupLength = group.length,\n dataLength = data.length;\n\n // Put any non-null nodes that fit into update.\n // Put any null nodes into enter.\n // Put any remaining data into enter.\n for (; i < dataLength; ++i) {\n if (node = group[i]) {\n node.__data__ = data[i];\n update[i] = node;\n } else {\n enter[i] = new EnterNode(parent, data[i]);\n }\n }\n\n // Put any non-null nodes that don’t fit into exit.\n for (; i < groupLength; ++i) {\n if (node = group[i]) {\n exit[i] = node;\n }\n }\n}\n\nfunction bindKey(parent, group, enter, update, exit, data, key) {\n var i,\n node,\n nodeByKeyValue = {},\n groupLength = group.length,\n dataLength = data.length,\n keyValues = new Array(groupLength),\n keyValue;\n\n // Compute the key for each node.\n // If multiple nodes have the same key, the duplicates are added to exit.\n for (i = 0; i < groupLength; ++i) {\n if (node = group[i]) {\n keyValues[i] = keyValue = keyPrefix + key.call(node, node.__data__, i, group);\n if (keyValue in nodeByKeyValue) {\n exit[i] = node;\n } else {\n nodeByKeyValue[keyValue] = node;\n }\n }\n }\n\n // Compute the key for each datum.\n // If there a node associated with this key, join and add it to update.\n // If there is not (or the key is a duplicate), add it to enter.\n for (i = 0; i < dataLength; ++i) {\n keyValue = keyPrefix + key.call(parent, data[i], i, data);\n if (node = nodeByKeyValue[keyValue]) {\n update[i] = node;\n node.__data__ = data[i];\n nodeByKeyValue[keyValue] = null;\n } else {\n enter[i] = new EnterNode(parent, data[i]);\n }\n }\n\n // Add any remaining nodes that were not bound to data to exit.\n for (i = 0; i < groupLength; ++i) {\n if ((node = group[i]) && (nodeByKeyValue[keyValues[i]] === node)) {\n exit[i] = node;\n }\n }\n}\n\nvar selection_data = function(value, key) {\n if (!value) {\n data = new Array(this.size()), j = -1;\n this.each(function(d) { data[++j] = d; });\n return data;\n }\n\n var bind = key ? bindKey : bindIndex,\n parents = this._parents,\n groups = this._groups;\n\n if (typeof value !== "function") value = constant(value);\n\n for (var m = groups.length, update = new Array(m), enter = new Array(m), exit = new Array(m), j = 0; j < m; ++j) {\n var parent = parents[j],\n group = groups[j],\n groupLength = group.length,\n data = value.call(parent, parent && parent.__data__, j, parents),\n dataLength = data.length,\n enterGroup = enter[j] = new Array(dataLength),\n updateGroup = update[j] = new Array(dataLength),\n exitGroup = exit[j] = new Array(groupLength);\n\n bind(parent, group, enterGroup, updateGroup, exitGroup, data, key);\n\n // Now connect the enter nodes to their following update node, such that\n // appendChild can insert the materialized enter node before this node,\n // rather than at the end of the parent node.\n for (var i0 = 0, i1 = 0, previous, next; i0 < dataLength; ++i0) {\n if (previous = enterGroup[i0]) {\n if (i0 >= i1) i1 = i0 + 1;\n while (!(next = updateGroup[i1]) && ++i1 < dataLength);\n previous._next = next || null;\n }\n }\n }\n\n update = new Selection(update, parents);\n update._enter = enter;\n update._exit = exit;\n return update;\n};\n\nvar selection_exit = function() {\n return new Selection(this._exit || this._groups.map(sparse), this._parents);\n};\n\nvar selection_merge = function(selection) {\n\n for (var groups0 = this._groups, groups1 = selection._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {\n for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {\n if (node = group0[i] || group1[i]) {\n merge[i] = node;\n }\n }\n }\n\n for (; j < m0; ++j) {\n merges[j] = groups0[j];\n }\n\n return new Selection(merges, this._parents);\n};\n\nvar selection_order = function() {\n\n for (var groups = this._groups, j = -1, m = groups.length; ++j < m;) {\n for (var group = groups[j], i = group.length - 1, next = group[i], node; --i >= 0;) {\n if (node = group[i]) {\n if (next && next !== node.nextSibling) next.parentNode.insertBefore(node, next);\n next = node;\n }\n }\n }\n\n return this;\n};\n\nvar selection_sort = function(compare) {\n if (!compare) compare = ascending;\n\n function compareNode(a, b) {\n return a && b ? compare(a.__data__, b.__data__) : !a - !b;\n }\n\n for (var groups = this._groups, m = groups.length, sortgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, sortgroup = sortgroups[j] = new Array(n), node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n sortgroup[i] = node;\n }\n }\n sortgroup.sort(compareNode);\n }\n\n return new Selection(sortgroups, this._parents).order();\n};\n\nfunction ascending(a, b) {\n return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n\nvar selection_call = function() {\n var callback = arguments[0];\n arguments[0] = this;\n callback.apply(null, arguments);\n return this;\n};\n\nvar selection_nodes = function() {\n var nodes = new Array(this.size()), i = -1;\n this.each(function() { nodes[++i] = this; });\n return nodes;\n};\n\nvar selection_node = function() {\n\n for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {\n for (var group = groups[j], i = 0, n = group.length; i < n; ++i) {\n var node = group[i];\n if (node) return node;\n }\n }\n\n return null;\n};\n\nvar selection_size = function() {\n var size = 0;\n this.each(function() { ++size; });\n return size;\n};\n\nvar selection_empty = function() {\n return !this.node();\n};\n\nvar selection_each = function(callback) {\n\n for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {\n for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) {\n if (node = group[i]) callback.call(node, node.__data__, i, group);\n }\n }\n\n return this;\n};\n\nfunction attrRemove(name) {\n return function() {\n this.removeAttribute(name);\n };\n}\n\nfunction attrRemoveNS(fullname) {\n return function() {\n this.removeAttributeNS(fullname.space, fullname.local);\n };\n}\n\nfunction attrConstant(name, value) {\n return function() {\n this.setAttribute(name, value);\n };\n}\n\nfunction attrConstantNS(fullname, value) {\n return function() {\n this.setAttributeNS(fullname.space, fullname.local, value);\n };\n}\n\nfunction attrFunction(name, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) this.removeAttribute(name);\n else this.setAttribute(name, v);\n };\n}\n\nfunction attrFunctionNS(fullname, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) this.removeAttributeNS(fullname.space, fullname.local);\n else this.setAttributeNS(fullname.space, fullname.local, v);\n };\n}\n\nvar selection_attr = function(name, value) {\n var fullname = namespace(name);\n\n if (arguments.length < 2) {\n var node = this.node();\n return fullname.local\n ? node.getAttributeNS(fullname.space, fullname.local)\n : node.getAttribute(fullname);\n }\n\n return this.each((value == null\n ? (fullname.local ? attrRemoveNS : attrRemove) : (typeof value === "function"\n ? (fullname.local ? attrFunctionNS : attrFunction)\n : (fullname.local ? attrConstantNS : attrConstant)))(fullname, value));\n};\n\nvar defaultView = function(node) {\n return (node.ownerDocument && node.ownerDocument.defaultView) // node is a Node\n || (node.document && node) // node is a Window\n || node.defaultView; // node is a Document\n};\n\nfunction styleRemove(name) {\n return function() {\n this.style.removeProperty(name);\n };\n}\n\nfunction styleConstant(name, value, priority) {\n return function() {\n this.style.setProperty(name, value, priority);\n };\n}\n\nfunction styleFunction(name, value, priority) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) this.style.removeProperty(name);\n else this.style.setProperty(name, v, priority);\n };\n}\n\nvar selection_style = function(name, value, priority) {\n return arguments.length > 1\n ? this.each((value == null\n ? styleRemove : typeof value === "function"\n ? styleFunction\n : styleConstant)(name, value, priority == null ? "" : priority))\n : styleValue(this.node(), name);\n};\n\nfunction styleValue(node, name) {\n return node.style.getPropertyValue(name)\n || defaultView(node).getComputedStyle(node, null).getPropertyValue(name);\n}\n\nfunction propertyRemove(name) {\n return function() {\n delete this[name];\n };\n}\n\nfunction propertyConstant(name, value) {\n return function() {\n this[name] = value;\n };\n}\n\nfunction propertyFunction(name, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) delete this[name];\n else this[name] = v;\n };\n}\n\nvar selection_property = function(name, value) {\n return arguments.length > 1\n ? this.each((value == null\n ? propertyRemove : typeof value === "function"\n ? propertyFunction\n : propertyConstant)(name, value))\n : this.node()[name];\n};\n\nfunction classArray(string) {\n return string.trim().split(/^|\\s+/);\n}\n\nfunction classList(node) {\n return node.classList || new ClassList(node);\n}\n\nfunction ClassList(node) {\n this._node = node;\n this._names = classArray(node.getAttribute("class") || "");\n}\n\nClassList.prototype = {\n add: function(name) {\n var i = this._names.indexOf(name);\n if (i < 0) {\n this._names.push(name);\n this._node.setAttribute("class", this._names.join(" "));\n }\n },\n remove: function(name) {\n var i = this._names.indexOf(name);\n if (i >= 0) {\n this._names.splice(i, 1);\n this._node.setAttribute("class", this._names.join(" "));\n }\n },\n contains: function(name) {\n return this._names.indexOf(name) >= 0;\n }\n};\n\nfunction classedAdd(node, names) {\n var list = classList(node), i = -1, n = names.length;\n while (++i < n) list.add(names[i]);\n}\n\nfunction classedRemove(node, names) {\n var list = classList(node), i = -1, n = names.length;\n while (++i < n) list.remove(names[i]);\n}\n\nfunction classedTrue(names) {\n return function() {\n classedAdd(this, names);\n };\n}\n\nfunction classedFalse(names) {\n return function() {\n classedRemove(this, names);\n };\n}\n\nfunction classedFunction(names, value) {\n return function() {\n (value.apply(this, arguments) ? classedAdd : classedRemove)(this, names);\n };\n}\n\nvar selection_classed = function(name, value) {\n var names = classArray(name + "");\n\n if (arguments.length < 2) {\n var list = classList(this.node()), i = -1, n = names.length;\n while (++i < n) if (!list.contains(names[i])) return false;\n return true;\n }\n\n return this.each((typeof value === "function"\n ? classedFunction : value\n ? classedTrue\n : classedFalse)(names, value));\n};\n\nfunction textRemove() {\n this.textContent = "";\n}\n\nfunction textConstant(value) {\n return function() {\n this.textContent = value;\n };\n}\n\nfunction textFunction(value) {\n return function() {\n var v = value.apply(this, arguments);\n this.textContent = v == null ? "" : v;\n };\n}\n\nvar selection_text = function(value) {\n return arguments.length\n ? this.each(value == null\n ? textRemove : (typeof value === "function"\n ? textFunction\n : textConstant)(value))\n : this.node().textContent;\n};\n\nfunction htmlRemove() {\n this.innerHTML = "";\n}\n\nfunction htmlConstant(value) {\n return function() {\n this.innerHTML = value;\n };\n}\n\nfunction htmlFunction(value) {\n return function() {\n var v = value.apply(this, arguments);\n this.innerHTML = v == null ? "" : v;\n };\n}\n\nvar selection_html = function(value) {\n return arguments.length\n ? this.each(value == null\n ? htmlRemove : (typeof value === "function"\n ? htmlFunction\n : htmlConstant)(value))\n : this.node().innerHTML;\n};\n\nfunction raise() {\n if (this.nextSibling) this.parentNode.appendChild(this);\n}\n\nvar selection_raise = function() {\n return this.each(raise);\n};\n\nfunction lower() {\n if (this.previousSibling) this.parentNode.insertBefore(this, this.parentNode.firstChild);\n}\n\nvar selection_lower = function() {\n return this.each(lower);\n};\n\nvar selection_append = function(name) {\n var create = typeof name === "function" ? name : creator(name);\n return this.select(function() {\n return this.appendChild(create.apply(this, arguments));\n });\n};\n\nfunction constantNull() {\n return null;\n}\n\nvar selection_insert = function(name, before) {\n var create = typeof name === "function" ? name : creator(name),\n select = before == null ? constantNull : typeof before === "function" ? before : selector(before);\n return this.select(function() {\n return this.insertBefore(create.apply(this, arguments), select.apply(this, arguments) || null);\n });\n};\n\nfunction remove() {\n var parent = this.parentNode;\n if (parent) parent.removeChild(this);\n}\n\nvar selection_remove = function() {\n return this.each(remove);\n};\n\nvar selection_datum = function(value) {\n return arguments.length\n ? this.property("__data__", value)\n : this.node().__data__;\n};\n\nfunction dispatchEvent(node, type, params) {\n var window = defaultView(node),\n event = window.CustomEvent;\n\n if (typeof event === "function") {\n event = new event(type, params);\n } else {\n event = window.document.createEvent("Event");\n if (params) event.initEvent(type, params.bubbles, params.cancelable), event.detail = params.detail;\n else event.initEvent(type, false, false);\n }\n\n node.dispatchEvent(event);\n}\n\nfunction dispatchConstant(type, params) {\n return function() {\n return dispatchEvent(this, type, params);\n };\n}\n\nfunction dispatchFunction(type, params) {\n return function() {\n return dispatchEvent(this, type, params.apply(this, arguments));\n };\n}\n\nvar selection_dispatch = function(type, params) {\n return this.each((typeof params === "function"\n ? dispatchFunction\n : dispatchConstant)(type, params));\n};\n\nvar root = [null];\n\nfunction Selection(groups, parents) {\n this._groups = groups;\n this._parents = parents;\n}\n\nfunction selection() {\n return new Selection([[document.documentElement]], root);\n}\n\nSelection.prototype = selection.prototype = {\n constructor: Selection,\n select: selection_select,\n selectAll: selection_selectAll,\n filter: selection_filter,\n data: selection_data,\n enter: selection_enter,\n exit: selection_exit,\n merge: selection_merge,\n order: selection_order,\n sort: selection_sort,\n call: selection_call,\n nodes: selection_nodes,\n node: selection_node,\n size: selection_size,\n empty: selection_empty,\n each: selection_each,\n attr: selection_attr,\n style: selection_style,\n property: selection_property,\n classed: selection_classed,\n text: selection_text,\n html: selection_html,\n raise: selection_raise,\n lower: selection_lower,\n append: selection_append,\n insert: selection_insert,\n remove: selection_remove,\n datum: selection_datum,\n on: selection_on,\n dispatch: selection_dispatch\n};\n\nvar select = function(selector) {\n return typeof selector === "string"\n ? new Selection([[document.querySelector(selector)]], [document.documentElement])\n : new Selection([[selector]], root);\n};\n\nvar selectAll = function(selector) {\n return typeof selector === "string"\n ? new Selection([document.querySelectorAll(selector)], [document.documentElement])\n : new Selection([selector == null ? [] : selector], root);\n};\n\nvar touch = function(node, touches, identifier) {\n if (arguments.length < 3) identifier = touches, touches = sourceEvent().changedTouches;\n\n for (var i = 0, n = touches ? touches.length : 0, touch; i < n; ++i) {\n if ((touch = touches[i]).identifier === identifier) {\n return point(node, touch);\n }\n }\n\n return null;\n};\n\nvar touches = function(node, touches) {\n if (touches == null) touches = sourceEvent().touches;\n\n for (var i = 0, n = touches ? touches.length : 0, points = new Array(n); i < n; ++i) {\n points[i] = point(node, touches[i]);\n }\n\n return points;\n};\n\nexports.creator = creator;\nexports.local = local;\nexports.matcher = matcher$1;\nexports.mouse = mouse;\nexports.namespace = namespace;\nexports.namespaces = namespaces;\nexports.select = select;\nexports.selectAll = selectAll;\nexports.selection = selection;\nexports.selector = selector;\nexports.selectorAll = selectorAll;\nexports.style = styleValue;\nexports.touch = touch;\nexports.touches = touches;\nexports.window = defaultView;\nexports.customEvent = customEvent;\n\nObject.defineProperty(exports, \'__esModule\', { value: true });\n\n})));\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/d3-selection/build/d3-selection.js\n// module id = 15\n// module chunks = 0\n//# sourceURL=webpack:///./~/d3-selection/build/d3-selection.js?'); | |
},function(module,exports,__webpack_require__){eval("var __WEBPACK_AMD_DEFINE_RESULT__;'use strict';\n\n!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require) {\n 'use strict';\n\n var _require = __webpack_require__(17),\n colorSchemas = _require.colorSchemas;\n\n var constants = __webpack_require__(18);\n var serializeWithStyles = __webpack_require__(19);\n\n var encoder = window.btoa;\n\n if (!encoder) {\n encoder = __webpack_require__(20).encode;\n }\n\n // Base64 doesn't work really well with Unicode strings, so we need to use this function\n // Ref: https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding\n var b64EncodeUnicode = function b64EncodeUnicode(str) {\n return encoder(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function (match, p1) {\n return String.fromCharCode('0x' + p1);\n }));\n };\n\n var config = {\n defaultFilename: 'mapd3.png',\n chartBackground: 'white',\n imageSourceBase: 'data:image/svg+xml;base64,',\n titleFontSize: '15px',\n titleFontFamily: '\\'Benton Sans\\', sans-serif',\n titleTopOffset: 30,\n get styleBackgroundString() {\n return '<style>svg{background:' + this.chartBackground + ';}</style>';\n }\n };\n\n /**\n * Main function to be used as a method by chart instances to export charts to png\n * @param {array} svgs (or an svg element) pass in both chart & legend as array or just chart as svg or in array\n * @param {string} filename [download to be called <filename>.png]\n * @param {string} title Title for the image\n */\n function exportChart(d3svg, filename, title) {\n var img = createImage(convertSvgToHtml.call(this, d3svg, title));\n\n img.onload = handleImageLoad.bind(img, createCanvas(this.width(), this.height()), filename);\n }\n\n /**\n * adds background styles to raw html\n * @param {string} html raw html\n */\n function addBackground(html) {\n return html.replace('>', '>' + config.styleBackgroundString);\n }\n\n /**\n * takes d3 svg el, adds proper svg tags, adds inline styles\n * from stylesheets, adds white background and returns string\n * @param {object} d3svg TYPE d3 svg element\n * @return {string} string of passed d3\n */\n function convertSvgToHtml(d3svg, title) {\n if (!d3svg) {\n return;\n }\n\n d3svg.attr('version', 1.1).attr('xmlns', 'http://www.w3.org/2000/svg');\n var serializer = serializeWithStyles.initializeSerializer();\n var html = serializer(d3svg.node());\n\n html = formatHtmlByBrowser(html);\n html = prependTitle.call(this, html, title, parseInt(d3svg.attr('width'), 10));\n html = addBackground(html);\n\n return html;\n }\n\n /**\n * Create Canvas\n * @param {number} width\n * @param {number} height\n * @return {object} TYPE canvas element\n */\n function createCanvas(width, height) {\n var canvas = document.createElement('canvas');\n\n canvas.height = height;\n canvas.width = width;\n\n return canvas;\n }\n\n /**\n * Create Image\n * @param {string} svgHtml string representation of svg el\n * @return {object} TYPE element <img>, src points at svg\n */\n function createImage(svgHtml) {\n var img = new Image();\n\n img.src = '' + config.imageSourceBase + b64EncodeUnicode(svgHtml);\n\n return img;\n };\n\n /**\n * Draws image on canvas\n * @param {object} image TYPE:el <img>, to be drawn\n * @param {object} canvas TYPE: el <canvas>, to draw on\n */\n function drawImageOnCanvas(image, canvas) {\n canvas.getContext('2d').drawImage(image, 0, 0);\n\n return canvas;\n }\n\n /**\n * Triggers browser to download image, convert canvas to url,\n * we need to append the link el to the dom before clicking it for Firefox to register\n * point <a> at it and trigger click\n * @param {object} canvas TYPE: el <canvas>\n * @param {string} filename\n * @param {string} extensionType\n */\n function downloadCanvas(canvas) {\n var filename = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : config.defaultFilename;\n var extensionType = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'image/png';\n\n var url = canvas.toDataURL(extensionType);\n var link = document.createElement('a');\n\n link.href = url;\n link.download = filename;\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n }\n\n /**\n * Some browsers need special formatting, we handle that here\n * @param {string} html string of svg html\n * @return {string} string of svg html\n */\n function formatHtmlByBrowser(html) {\n if (navigator.userAgent.search('FireFox') > -1) {\n return html.replace(/url.*"\\)/, 'url("#' + constants.lineGradientId + '");');\n }\n\n return html;\n }\n\n /**\n * Handles on load event fired by img.onload, this=img\n * @param {object} canvas TYPE: el <canvas>\n * @param {string} filename\n * @param {object} e\n */\n function handleImageLoad(canvas, filename, e) {\n e.preventDefault();\n\n downloadCanvas(drawImageOnCanvas(this, canvas), filename);\n }\n\n /**\n * if passed, append title to the raw html to appear on graph\n * @param {string} html raw html string\n * @param {string} title title of the graph\n * @param {number} svgWidth width of graph container\n * @return {string} raw html with title prepended\n */\n function prependTitle(html, title, svgWidth) {\n if (!title || !svgWidth) {\n return html;\n }\n var grey = colorSchemas.grey;\n\n\n html = html.replace(/<g/, '<text x=\"' + this.margin().left + '\" y=\"' + config.titleTopOffset + '\" font-family=\"' + config.titleFontFamily + '\" font-size=\"' + config.titleFontSize + '\" fill=\"' + grey[6] + '\"> ' + title + ' </text><g ');\n\n return html;\n }\n\n return {\n exportChart: exportChart,\n convertSvgToHtml: convertSvgToHtml,\n createImage: createImage,\n drawImageOnCanvas: drawImageOnCanvas\n };\n}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/charts/helpers/exportChart.js\n// module id = 16\n// module chunks = 0\n//# sourceURL=webpack:///./src/charts/helpers/exportChart.js?")},function(module,exports,__webpack_require__){eval('var __WEBPACK_AMD_DEFINE_RESULT__;"use strict";\n\n!(__WEBPACK_AMD_DEFINE_RESULT__ = function () {\n\n var mapdUI = {\n skyBlue: "#22A7F0"\n };\n\n var mapdColors = ["#ea5545", "#bdcf32", "#b33dc6", "#ef9b20", "#87bc45", "#f46a9b", "#ace5c7", "#ede15b", "#836dc5", "#86d87f", "#27aeef"];\n\n var grey = ["#F8F8FA", "#EFF2F5", "#D2D6DF", "#C3C6CF", "#ADB0B6", "#666A73", "#45494E", "#363A43", "#282C35"];\n\n var orange = ["#fcc870", "#ffa71a", "#fb8825", "#f6682f", "#db5a2c", "#bf4c28", "#a43b1c", "#892a10", "#f9e9c5"];\n\n var blueGreen = ["#ccf7f6", "#70e4e0", "#00d8d2", "#00acaf", "#007f8c", "#005e66", "#003c3f", "#002d2f", "#0d2223"];\n\n var teal = ["#ccfffe", "#94f7f4", "#00fff8", "#1de1e1", "#39c2c9", "#2e9a9d", "#227270", "#1a5957", "#133f3e"];\n\n var green = ["#edfff7", "#d7ffef", "#c0ffe7", "#95f5d7", "#6aedc7", "#59c3a3", "#479980", "#34816a", "#206953"];\n\n var yellow = ["#f9f2b3", "#fbe986", "#fce05a", "#fed72d", "#ffce00", "#fcc11c", "#f9b438", "#eda629", "#e09819"];\n // Pink Palette\n var pink = ["#fdd1ea", "#fb9cd2", "#f866b9", "#fc40b6", "#ff1ab3", "#e3239d", "#c62c86", "#a62073", "#85135f"];\n // Purple Palette\n var purple = ["#ddd6fc", "#bbb1f0", "#998ce3", "#8e6bc1", "#824a9e", "#77337f", "#6b1c60", "#591650", "#470f3f"];\n // Red Palette\n var red = ["#ffd8d4", "#ffb5b0", "#ff938c", "#ff766c", "#ff584c", "#f04b42", "#e03d38", "#be2e29", "#9c1e19"];\n\n return {\n mapdUI: mapdUI,\n mapdColors: mapdColors,\n colorSchemas: {\n grey: grey,\n orange: orange,\n blueGreen: blueGreen,\n teal: teal,\n green: green,\n yellow: yellow,\n pink: pink,\n purple: purple,\n red: red\n }\n };\n}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/charts/helpers/colors.js\n// module id = 17\n// module chunks = 0\n//# sourceURL=webpack:///./src/charts/helpers/colors.js?')},function(module,exports,__webpack_require__){eval('var __WEBPACK_AMD_DEFINE_RESULT__;"use strict";\n\n!(__WEBPACK_AMD_DEFINE_RESULT__ = function () {\n\n var axisTimeCombinations = {\n MINUTE_HOUR: "minute-hour",\n HOUR_DAY: "hour-daymonth",\n DAY_MONTH: "day-month",\n MONTH_YEAR: "month-year"\n };\n\n var timeBenchmarks = {\n ONE_AND_A_HALF_YEARS: 47304000000,\n ONE_YEAR: 31536000365,\n ONE_DAY: 86400001\n };\n\n var keys = {\n DATE_KEY: "date",\n VALUE_KEY: "value",\n ID_KEY: "id",\n LABEL_KEY: "label",\n GROUP_KEY: "group",\n VALUES_KEY: "values",\n SERIES_KEY: "series"\n };\n\n return {\n keys: keys,\n axisTimeCombinations: axisTimeCombinations,\n timeBenchmarks: timeBenchmarks,\n lineGradientId: "lineGradientId"\n };\n}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/charts/helpers/constants.js\n// module id = 18\n// module chunks = 0\n//# sourceURL=webpack:///./src/charts/helpers/constants.js?')},function(module,exports){eval("'use strict';\n\nmodule.exports = function () {\n\n 'use strict';\n\n return {\n\n /**\n * returns serializer function, only run it when you know you want to serialize your chart\n * @return {func} serializer to add styles in line to dom string\n */\n initializeSerializer: function initializeSerializer() {\n\n // Mapping between tag names and css default values lookup tables. This allows to exclude default values in the result.\n var defaultStylesByTagName = {};\n\n // Styles inherited from style sheets will not be rendered for elements with these tag names\n var noStyleTags = { 'BASE': true, 'HEAD': true, 'HTML': true, 'META': true, 'NOFRAME': true, 'NOSCRIPT': true, 'PARAM': true, 'SCRIPT': true, 'STYLE': true, 'TITLE': true };\n\n // This list determines which css default values lookup tables are precomputed at load time\n // Lookup tables for other tag names will be automatically built at runtime if needed\n var tagNames = ['A', 'ABBR', 'ADDRESS', 'AREA', 'ARTICLE', 'ASIDE', 'AUDIO', 'B', 'BASE', 'BDI', 'BDO', 'BLOCKQUOTE', 'BODY', 'BR', 'BUTTON', 'CANVAS', 'CAPTION', 'CENTER', 'CITE', 'CODE', 'COL', 'COLGROUP', 'COMMAND', 'DATALIST', 'DD', 'DEL', 'DETAILS', 'DFN', 'DIV', 'DL', 'DT', 'EM', 'EMBED', 'FIELDSET', 'FIGCAPTION', 'FIGURE', 'FONT', 'FOOTER', 'FORM', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'HEAD', 'HEADER', 'HGROUP', 'HR', 'HTML', 'I', 'IFRAME', 'IMG', 'INPUT', 'INS', 'KBD', 'LABEL', 'LEGEND', 'LI', 'LINK', 'MAP', 'MARK', 'MATH', 'MENU', 'META', 'METER', 'NAV', 'NOBR', 'NOSCRIPT', 'OBJECT', 'OL', 'OPTION', 'OPTGROUP', 'OUTPUT', 'P', 'PARAM', 'PRE', 'PROGRESS', 'Q', 'RP', 'RT', 'RUBY', 'S', 'SAMP', 'SCRIPT', 'SECTION', 'SELECT', 'SMALL', 'SOURCE', 'SPAN', 'STRONG', 'STYLE', 'SUB', 'SUMMARY', 'SUP', 'SVG', 'TABLE', 'TBODY', 'TD', 'TEXTAREA', 'TFOOT', 'TH', 'THEAD', 'TIME', 'TITLE', 'TR', 'TRACK', 'U', 'UL', 'VAR', 'VIDEO', 'WBR'];\n\n // Precompute the lookup tables.\n [].forEach.call(tagNames, function (name) {\n if (!noStyleTags[name]) {\n defaultStylesByTagName[name] = computeDefaultStyleByTagName(name);\n }\n });\n\n function computeDefaultStyleByTagName(tagName) {\n var defaultStyle = {},\n element = document.body.appendChild(document.createElement(tagName)),\n computedStyle = window.getComputedStyle(element);\n\n [].forEach.call(computedStyle, function (style) {\n defaultStyle[style] = computedStyle[style];\n });\n document.body.removeChild(element);\n return defaultStyle;\n }\n\n function getDefaultStyleByTagName(tagName) {\n tagName = tagName.toUpperCase();\n if (!defaultStylesByTagName[tagName]) {\n defaultStylesByTagName[tagName] = computeDefaultStyleByTagName(tagName);\n }\n return defaultStylesByTagName[tagName];\n };\n\n function serializeWithStyles(elem) {\n\n var cssTexts = [],\n elements = void 0,\n computedStyle = void 0,\n defaultStyle = void 0,\n result = void 0;\n\n if (!elem || elem.nodeType !== Node.ELEMENT_NODE) {\n // 'Error: Object passed in to serializeWithSyles not of nodeType Node.ELEMENT_NODE'\n\n return;\n }\n\n cssTexts = [];\n elements = elem.querySelectorAll('*');\n\n [].forEach.call(elements, function (el, i) {\n if (!noStyleTags[el.tagName]) {\n computedStyle = window.getComputedStyle(el);\n defaultStyle = getDefaultStyleByTagName(el.tagName);\n cssTexts[i] = el.style.cssText;\n [].forEach.call(computedStyle, function (cssPropName) {\n if (computedStyle[cssPropName] !== defaultStyle[cssPropName]) {\n el.style[cssPropName] = computedStyle[cssPropName];\n }\n });\n }\n });\n\n result = elem.outerHTML;\n elements = [].map.call(elements, function (el, i) {\n el.style.cssText = cssTexts[i];\n return el;\n });\n\n return result;\n };\n\n return serializeWithStyles;\n }\n };\n}();\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/charts/helpers/serializeWithStyles.js\n// module id = 19\n// module chunks = 0\n//# sourceURL=webpack:///./src/charts/helpers/serializeWithStyles.js?")},function(module,exports,__webpack_require__){eval("var __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module, global) {/*! http://mths.be/base64 v0.1.0 by @mathias | MIT license */\n;(function(root) {\n\n\t// Detect free variables `exports`.\n\tvar freeExports = typeof exports == 'object' && exports;\n\n\t// Detect free variable `module`.\n\tvar freeModule = typeof module == 'object' && module &&\n\t\tmodule.exports == freeExports && module;\n\n\t// Detect free variable `global`, from Node.js or Browserified code, and use\n\t// it as `root`.\n\tvar freeGlobal = typeof global == 'object' && global;\n\tif (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {\n\t\troot = freeGlobal;\n\t}\n\n\t/*--------------------------------------------------------------------------*/\n\n\tvar InvalidCharacterError = function(message) {\n\t\tthis.message = message;\n\t};\n\tInvalidCharacterError.prototype = new Error;\n\tInvalidCharacterError.prototype.name = 'InvalidCharacterError';\n\n\tvar error = function(message) {\n\t\t// Note: the error messages used throughout this file match those used by\n\t\t// the native `atob`/`btoa` implementation in Chromium.\n\t\tthrow new InvalidCharacterError(message);\n\t};\n\n\tvar TABLE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n\t// http://whatwg.org/html/common-microsyntaxes.html#space-character\n\tvar REGEX_SPACE_CHARACTERS = /[\\t\\n\\f\\r ]/g;\n\n\t// `decode` is designed to be fully compatible with `atob` as described in the\n\t// HTML Standard. http://whatwg.org/html/webappapis.html#dom-windowbase64-atob\n\t// The optimized base64-decoding algorithm used is based on @atk’s excellent\n\t// implementation. https://gist.github.com/atk/1020396\n\tvar decode = function(input) {\n\t\tinput = String(input)\n\t\t\t.replace(REGEX_SPACE_CHARACTERS, '');\n\t\tvar length = input.length;\n\t\tif (length % 4 == 0) {\n\t\t\tinput = input.replace(/==?$/, '');\n\t\t\tlength = input.length;\n\t\t}\n\t\tif (\n\t\t\tlength % 4 == 1 ||\n\t\t\t// http://whatwg.org/C#alphanumeric-ascii-characters\n\t\t\t/[^+a-zA-Z0-9/]/.test(input)\n\t\t) {\n\t\t\terror(\n\t\t\t\t'Invalid character: the string to be decoded is not correctly encoded.'\n\t\t\t);\n\t\t}\n\t\tvar bitCounter = 0;\n\t\tvar bitStorage;\n\t\tvar buffer;\n\t\tvar output = '';\n\t\tvar position = -1;\n\t\twhile (++position < length) {\n\t\t\tbuffer = TABLE.indexOf(input.charAt(position));\n\t\t\tbitStorage = bitCounter % 4 ? bitStorage * 64 + buffer : buffer;\n\t\t\t// Unless this is the first of a group of 4 characters…\n\t\t\tif (bitCounter++ % 4) {\n\t\t\t\t// …convert the first 8 bits to a single ASCII character.\n\t\t\t\toutput += String.fromCharCode(\n\t\t\t\t\t0xFF & bitStorage >> (-2 * bitCounter & 6)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn output;\n\t};\n\n\t// `encode` is designed to be fully compatible with `btoa` as described in the\n\t// HTML Standard: http://whatwg.org/html/webappapis.html#dom-windowbase64-btoa\n\tvar encode = function(input) {\n\t\tinput = String(input);\n\t\tif (/[^\\0-\\xFF]/.test(input)) {\n\t\t\t// Note: no need to special-case astral symbols here, as surrogates are\n\t\t\t// matched, and the input is supposed to only contain ASCII anyway.\n\t\t\terror(\n\t\t\t\t'The string to be encoded contains characters outside of the ' +\n\t\t\t\t'Latin1 range.'\n\t\t\t);\n\t\t}\n\t\tvar padding = input.length % 3;\n\t\tvar output = '';\n\t\tvar position = -1;\n\t\tvar a;\n\t\tvar b;\n\t\tvar c;\n\t\tvar d;\n\t\tvar buffer;\n\t\t// Make sure any padding is handled outside of the loop.\n\t\tvar length = input.length - padding;\n\n\t\twhile (++position < length) {\n\t\t\t// Read three bytes, i.e. 24 bits.\n\t\t\ta = input.charCodeAt(position) << 16;\n\t\t\tb = input.charCodeAt(++position) << 8;\n\t\t\tc = input.charCodeAt(++position);\n\t\t\tbuffer = a + b + c;\n\t\t\t// Turn the 24 bits into four chunks of 6 bits each, and append the\n\t\t\t// matching character for each of them to the output.\n\t\t\toutput += (\n\t\t\t\tTABLE.charAt(buffer >> 18 & 0x3F) +\n\t\t\t\tTABLE.charAt(buffer >> 12 & 0x3F) +\n\t\t\t\tTABLE.charAt(buffer >> 6 & 0x3F) +\n\t\t\t\tTABLE.charAt(buffer & 0x3F)\n\t\t\t);\n\t\t}\n\n\t\tif (padding == 2) {\n\t\t\ta = input.charCodeAt(position) << 8;\n\t\t\tb = input.charCodeAt(++position);\n\t\t\tbuffer = a + b;\n\t\t\toutput += (\n\t\t\t\tTABLE.charAt(buffer >> 10) +\n\t\t\t\tTABLE.charAt((buffer >> 4) & 0x3F) +\n\t\t\t\tTABLE.charAt((buffer << 2) & 0x3F) +\n\t\t\t\t'='\n\t\t\t);\n\t\t} else if (padding == 1) {\n\t\t\tbuffer = input.charCodeAt(position);\n\t\t\toutput += (\n\t\t\t\tTABLE.charAt(buffer >> 2) +\n\t\t\t\tTABLE.charAt((buffer << 4) & 0x3F) +\n\t\t\t\t'=='\n\t\t\t);\n\t\t}\n\n\t\treturn output;\n\t};\n\n\tvar base64 = {\n\t\t'encode': encode,\n\t\t'decode': decode,\n\t\t'version': '0.1.0'\n\t};\n\n\t// Some AMD build optimizers, like r.js, check for specific condition patterns\n\t// like the following:\n\tif (\n\t\ttrue\n\t) {\n\t\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function() {\n\t\t\treturn base64;\n\t\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t}\telse if (freeExports && !freeExports.nodeType) {\n\t\tif (freeModule) { // in Node.js or RingoJS v0.8.0+\n\t\t\tfreeModule.exports = base64;\n\t\t} else { // in Narwhal or RingoJS v0.7.0-\n\t\t\tfor (var key in base64) {\n\t\t\t\tbase64.hasOwnProperty(key) && (freeExports[key] = base64[key]);\n\t\t\t}\n\t\t}\n\t} else { // in Rhino or a web browser\n\t\troot.base64 = base64;\n\t}\n\n}(this));\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(21)(module), (function() { return this; }())))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/base-64/base64.js\n// module id = 20\n// module chunks = 0\n//# sourceURL=webpack:///./~/base-64/base64.js?")},function(module,exports){eval("module.exports = function(module) {\r\n\tif(!module.webpackPolyfill) {\r\n\t\tmodule.deprecate = function() {};\r\n\t\tmodule.paths = [];\r\n\t\t// module.parent = undefined by default\r\n\t\tmodule.children = [];\r\n\t\tmodule.webpackPolyfill = 1;\r\n\t}\r\n\treturn module;\r\n}\r\n\n\n//////////////////\n// WEBPACK FOOTER\n// (webpack)/buildin/module.js\n// module id = 21\n// module chunks = 0\n//# sourceURL=webpack:///(webpack)/buildin/module.js?")},function(module,exports,__webpack_require__){eval("var __WEBPACK_AMD_DEFINE_RESULT__;'use strict';\n\n!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require) {\n 'use strict';\n\n var d3Format = __webpack_require__(10);\n\n /**\n * Calculates percentage of value from total\n * @param {Number} value Value to check\n * @param {Number} total Sum of values\n * @param {String} decimals Specifies number of decimals https://github.com/d3/d3-format\n * @return {String} Percentage\n */\n function calculatePercent(value, total, decimals) {\n return d3Format.format(decimals)(value / total * 100);\n }\n\n /**\n * Checks if a number is an integer of has decimal values\n * @param {Number} value Value to check\n * @return {Boolean} If it is an iteger\n */\n function isInteger(value) {\n return value % 1 === 0;\n }\n\n /**\n * Clones the passed array of data\n * @param {Object[]} dataToClone Data to clone\n * @return {Object[]} Cloned data\n */\n function cloneData(dataToClone) {\n return JSON.parse(JSON.stringify(dataToClone));\n }\n\n return {\n calculatePercent: calculatePercent,\n isInteger: isInteger,\n cloneData: cloneData\n };\n}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/charts/helpers/common.js\n// module id = 22\n// module chunks = 0\n//# sourceURL=webpack:///./src/charts/helpers/common.js?")},function(module,exports,__webpack_require__){eval('var __WEBPACK_AMD_DEFINE_RESULT__;"use strict";\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();\n\n!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require) {\n "use strict";\n\n var d3Ease = __webpack_require__(6);\n var d3Format = __webpack_require__(10);\n var d3TimeFormat = __webpack_require__(12);\n\n var _require = __webpack_require__(18),\n keys = _require.keys;\n\n /**\n * Tooltip Component reusable API class that renders a\n * simple and configurable tooltip element for MapD3\'s\n * line chart or stacked area chart.\n *\n * @module Tooltip\n * @tutorial tooltip\n * @requires d3-array, d3-axis, d3-dispatch, d3-format, d3-scale, d3-selection, d3-transition\n *\n * @example\n * var lineChart = line(),\n * tooltip = tooltip();\n *\n * tooltip\n * .title(\'Tooltip title\');\n *\n * lineChart\n * .width(500)\n * .on(\'customMouseOver\', function() {\n * tooltip.show();\n * })\n * .on(\'customMouseMove\', function(dataPoint, topicColorMap, dataPointXPosition) {\n * tooltip.update(dataPoint, topicColorMap, dataPointXPosition);\n * })\n * .on(\'customMouseOut\', function() {\n * tooltip.hide();\n * });\n *\n * d3Selection.select(\'.css-selector\')\n * .datum(dataset)\n * .call(lineChart);\n *\n * d3Selection.select(\'.metadata-group .hover-marker\')\n * .datum([])\n * .call(tooltip);\n *\n */\n\n\n return function module(_chart) {\n\n var config = {\n margin: {\n top: 2,\n right: 2,\n bottom: 2,\n left: 2\n },\n width: 250,\n height: 45,\n\n title: "",\n valueFormat: ".2s",\n\n tooltipOffset: {\n y: -55,\n x: 0\n },\n tooltipMaxTopicLength: 170,\n tooltipBorderRadius: 3,\n entryLineLimit: 3,\n\n // Animations\n mouseChaseDuration: 30,\n ease: d3Ease.easeQuadInOut,\n\n titleHeight: 32,\n elementHeight: 24,\n padding: 8,\n dotRadius: 4,\n\n dateFormat: "%x",\n seriesOrder: []\n };\n\n var cache = {\n chart: _chart,\n svg: null,\n colorMap: null,\n chartWidth: null,\n chartHeight: null,\n tooltipDivider: null,\n tooltipBody: null,\n tooltipTitle: null,\n tooltipHeight: 48,\n tooltipWidth: 150,\n tooltipBackground: null\n };\n\n var chartCache = null;\n\n /**\n * This function creates the graph using the selection as container\n * @param {D3Selection} _selection A d3 selection that represents\n * the container(s) where the chart(s) will be rendered\n * @param {Object} _data The data to attach and generate the chart\n */\n function init() {\n cache.chart.on("mouseOver.tooltip", show).on("mouseMove.tooltip", update).on("mouseOut.tooltip", hide);\n\n buildSVG();\n }\n init();\n\n /**\n * Builds the SVG element that will contain the chart\n * @param {HTMLElement} container DOM element that will work as the container of the graph\n * @private\n */\n function buildSVG() {\n chartCache = cache.chart.getCache();\n setConfig(cache.chart.getConfig());\n\n if (!cache.svg) {\n cache.svg = chartCache.svg.append("g").classed("mapd3 mapd3-tooltip", true);\n\n cache.tooltipBackground = cache.svg.append("rect").classed("tooltip-text-container", true);\n\n cache.tooltipTitle = cache.svg.append("text").classed("tooltip-title", true).attr("dominant-baseline", "hanging");\n\n cache.tooltipDivider = cache.svg.append("line").classed("tooltip-divider", true);\n\n cache.tooltipBody = cache.svg.append("g").classed("tooltip-body", true);\n }\n\n cache.chartWidth = config.width - config.margin.left - config.margin.right;\n cache.chartHeight = config.height - config.margin.top - config.margin.bottom;\n\n cache.svg.attr("width", config.width).attr("height", config.height);\n\n cache.tooltipBackground.attr("width", cache.tooltipWidth).attr("height", cache.tooltipHeight).attr("rx", config.tooltipBorderRadius).attr("ry", config.tooltipBorderRadius);\n\n cache.tooltipTitle.attr("dy", config.padding).attr("dx", config.padding);\n\n cache.tooltipDivider.attr("x2", cache.tooltipWidth).attr("y1", config.titleHeight).attr("y2", config.titleHeight);\n\n cache.tooltipBody = cache.svg.append("g").classed("tooltip-body", true);\n\n hide();\n }\n\n /**\n * Draws the data entries inside the tooltip for a given series\n * @param {Object} series series to extract data from\n * @return void\n */\n function updateSeriesContent(_series) {\n var tooltipLeft = cache.tooltipBody.selectAll(".tooltip-left-text").data(_series);\n tooltipLeft.enter().append("text").classed("tooltip-left-text", true).attr("dominant-baseline", "hanging").attr("dy", config.padding).attr("dx", config.padding * 2 + config.dotRadius).merge(tooltipLeft).attr("y", function (d, i) {\n return i * config.elementHeight + config.titleHeight;\n }).text(function (d) {\n return d[keys.LABEL_KEY];\n });\n tooltipLeft.exit().remove();\n\n var tooltipRight = cache.tooltipBody.selectAll(".tooltip-right-text").data(_series);\n tooltipRight.enter().append("text").classed("tooltip-right-text", true).attr("text-anchor", "end").attr("dominant-baseline", "hanging").attr("dy", config.padding).attr("dx", -config.padding).merge(tooltipRight).attr("x", cache.tooltipWidth).attr("y", function (d, i) {\n return i * config.elementHeight + config.titleHeight;\n }).text(getValueText);\n tooltipRight.exit().remove();\n\n var tooltipCircles = cache.tooltipBody.selectAll(".tooltip-circle").data(_series);\n tooltipCircles.enter().append("circle").classed("tooltip-circle", true).merge(tooltipCircles).attr("cx", config.padding + config.dotRadius).attr("cy", function (d, i) {\n return i * config.elementHeight + config.titleHeight + config.elementHeight / 2;\n }).attr("r", config.dotRadius).style("fill", function (d) {\n return chartCache.seriesColorScale[d[keys.ID_KEY]];\n });\n tooltipCircles.exit().remove();\n\n cache.tooltipHeight = cache.tooltipBody.node().getBBox().height;\n cache.tooltipBackground.attr("width", cache.tooltipWidth).attr("height", cache.tooltipHeight + config.titleHeight + config.padding);\n }\n\n /**\n * Calculates the desired position for the tooltip\n * @param {Number} mouseX Current horizontal mouse position\n * @param {Number} mouseY Current vertical mouse position\n * @return {Number[]} X and Y position\n */\n function getTooltipPosition(_mouseX) {\n var tooltipX = _mouseX + config.margin.left;\n var offset = 0;\n var tooltipY = config.margin.top;\n\n if (_mouseX > cache.chartWidth / 2) {\n offset = -cache.tooltipWidth;\n }\n\n return [tooltipX + offset, tooltipY];\n }\n\n /**\n * Extracts the value from the data object\n * @param {Object} data Data value containing the info\n * @return {String} Value to show\n */\n function getValueText(_data) {\n var value = _data[keys.VALUE_KEY];\n var valueText = null;\n var format = d3Format.format(config.valueFormat);\n\n if (data.missingValue) {\n valueText = "-";\n } else {\n valueText = format(value);\n }\n\n return valueText;\n }\n\n /**\n * Updates size and position of tooltip depending on the side of the chart we are in\n *\n * @param {Object} dataPoint DataPoint of the tooltip\n * @param {Number} xPosition DataPoint\'s x position in the chart\n * @param {Number} xPosition DataPoint\'s y position in the chart\n * @return void\n */\n function updatePositionAndSize(_xPosition) {\n var _getTooltipPosition = getTooltipPosition(_xPosition),\n _getTooltipPosition2 = _slicedToArray(_getTooltipPosition, 2),\n tooltipX = _getTooltipPosition2[0],\n tooltipY = _getTooltipPosition2[1];\n\n cache.svg.attr("width", cache.tooltipWidth).attr("height", cache.tooltipHeight).transition().duration(config.mouseChaseDuration).ease(config.ease).attr("transform", "translate(" + tooltipX + ", " + tooltipY + ")");\n }\n\n /**\n * Updates value of tooltipTitle with the data meaning and the date\n * @param {Object} dataPoint Point of data to use as source\n * @return void\n */\n function updateTitle(_dataPoint) {\n var date = new Date(_dataPoint[keys.DATE_KEY]);\n var format = d3TimeFormat.timeFormat(config.dateFormat);\n var tooltipTitleText = [config.title, format(date)].join("");\n\n cache.tooltipTitle.text(tooltipTitleText);\n }\n\n /**\n * Helper method to sort the passed topics array by the names passed int he order arary\n * @param {Object[]} topics Topics data, retrieved from datapoint passed by line chart\n * @param {Object[]} order Array of names in the order to sort topics by\n * @return {Object[]} sorted topics object\n */\n function sortByTopicsOrder(_series) {\n var _order = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : seriesOrder;\n\n return _order.map(function (orderName) {\n return _series.filter(function (_ref) {\n var name = _ref.name;\n return name === orderName;\n })[0];\n });\n }\n\n /**\n * Sorts series by alphabetical order for arrays of objects with a name proeprty\n * @param {Array} topics List of series objects\n * @return {Array} List of series name strings\n */\n function sortByAlpha(_series) {\n // TO DO: make this immutable\n return _series.sort();\n }\n\n /**\n * Draws the data entries inside the tooltip\n * @param {Object} dataPoint Data entry from to take the info\n * @return void\n */\n function updateContent(dataPoint) {\n var series = dataPoint[keys.SERIES_KEY];\n\n if (config.seriesOrder.length) {\n series = sortByTopicsOrder(series);\n } else if (series.length && series[0].name) {\n series = sortByAlpha(series);\n }\n\n updateTitle(dataPoint);\n updateSeriesContent(series);\n }\n\n /**\n * Updates tooltip title, content, size and position\n * sorts by alphatical name order if not forced order given\n *\n * @param {lineChartPointByDate} dataPoint Current datapoint to show info about\n * @param {Number} xPosition Position of the mouse on the X axis\n * @return void\n */\n function updateTooltip(dataPoint, xPosition) {\n updateContent(dataPoint);\n updatePositionAndSize(xPosition);\n }\n\n // API\n\n /**\n * Hides the tooltip\n * @return {Module} Tooltip module to chain calls\n * @public\n */\n function hide() {\n cache.svg.style("display", "none");\n\n return this;\n }\n\n /**\n * Shows the tooltip\n * @return {Module} Tooltip module to chain calls\n * @public\n */\n function show() {\n cache.svg.style("display", "block");\n\n return this;\n }\n\n /**\n * Updates the position and content of the tooltip\n * @param {Object} dataPoint Datapoint to represent\n * @param {Object} colorMapping Color scheme of the topics\n * @param {Number} position X-scale position in pixels\n * @return {Module} Tooltip module to chain calls\n * @public\n */\n function update(_dataPoint, _colorMapping, _xPosition) {\n var _yPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;\n\n updateTooltip(_dataPoint, _xPosition, _yPosition);\n\n return this;\n }\n\n function setConfig(_config) {\n config = Object.assign({}, config, _config);\n return this;\n }\n\n function getCache() {\n return cache;\n }\n\n return {\n hide: hide,\n show: show,\n update: update,\n setConfig: setConfig,\n getCache: getCache\n };\n };\n}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/charts/tooltip.js\n// module id = 23\n// module chunks = 0\n//# sourceURL=webpack:///./src/charts/tooltip.js?'); | |
},function(module,exports,__webpack_require__){eval('var __WEBPACK_AMD_DEFINE_RESULT__;"use strict";\n\n!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require) {\n "use strict";\n\n var d3Random = __webpack_require__(25);\n\n var _require = __webpack_require__(11),\n timeDay = _require.timeDay,\n timeMonth = _require.timeMonth;\n\n return function dataManager() {\n\n var VALUE_RANGE = 100;\n var cache = {\n data: null,\n baseDate: null\n };\n\n function generateSeries(_range) {\n cache.baseDate = new Date();\n var dateRange = timeDay.range(timeMonth.floor(cache.baseDate), timeMonth.ceil(cache.baseDate));\n var value = 0;\n var rnd = d3Random.randomNormal(0, 1);\n var STEP_RATIO = 100;\n var STEP = _range / STEP_RATIO;\n return dateRange.map(function (d) {\n value = value + rnd() * STEP;\n return {\n value: value,\n date: d.toISOString()\n };\n });\n }\n\n function generateTestDataset() {\n cache.data = {\n series: [{\n label: "line A",\n id: 1,\n group: 1,\n values: generateSeries(VALUE_RANGE)\n }, {\n label: "line B",\n id: 2,\n group: 1,\n values: generateSeries(VALUE_RANGE)\n }, {\n label: "line C",\n id: 3,\n group: 2,\n values: generateSeries(VALUE_RANGE * 2)\n }]\n };\n\n return cache.data;\n }\n\n function filterByDate(_dateExtent) {\n var data = JSON.parse(JSON.stringify(cache.data));\n data.series.forEach(function (series) {\n series.values = series.values.filter(function (d) {\n var epoch = new Date(d.date).getTime();\n return epoch >= _dateExtent[0].getTime() && epoch <= _dateExtent[1].getTime();\n });\n });\n\n return data;\n }\n\n return {\n generateTestDataset: generateTestDataset,\n generateSeries: generateSeries,\n filterByDate: filterByDate\n };\n };\n}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/charts/data-manager.js\n// module id = 24\n// module chunks = 0\n//# sourceURL=webpack:///./src/charts/data-manager.js?')},function(module,exports,__webpack_require__){eval("// https://d3js.org/d3-random/ Version 1.1.0. Copyright 2017 Mike Bostock.\n(function (global, factory) {\n\t true ? factory(exports) :\n\ttypeof define === 'function' && define.amd ? define(['exports'], factory) :\n\t(factory((global.d3 = global.d3 || {})));\n}(this, (function (exports) { 'use strict';\n\nvar defaultSource = function() {\n return Math.random();\n};\n\nvar uniform = ((function sourceRandomUniform(source) {\n function randomUniform(min, max) {\n min = min == null ? 0 : +min;\n max = max == null ? 1 : +max;\n if (arguments.length === 1) max = min, min = 0;\n else max -= min;\n return function() {\n return source() * max + min;\n };\n }\n\n randomUniform.source = sourceRandomUniform;\n\n return randomUniform;\n}))(defaultSource);\n\nvar normal = ((function sourceRandomNormal(source) {\n function randomNormal(mu, sigma) {\n var x, r;\n mu = mu == null ? 0 : +mu;\n sigma = sigma == null ? 1 : +sigma;\n return function() {\n var y;\n\n // If available, use the second previously-generated uniform random.\n if (x != null) y = x, x = null;\n\n // Otherwise, generate a new x and y.\n else do {\n x = source() * 2 - 1;\n y = source() * 2 - 1;\n r = x * x + y * y;\n } while (!r || r > 1);\n\n return mu + sigma * y * Math.sqrt(-2 * Math.log(r) / r);\n };\n }\n\n randomNormal.source = sourceRandomNormal;\n\n return randomNormal;\n}))(defaultSource);\n\nvar logNormal = ((function sourceRandomLogNormal(source) {\n function randomLogNormal() {\n var randomNormal = normal.source(source).apply(this, arguments);\n return function() {\n return Math.exp(randomNormal());\n };\n }\n\n randomLogNormal.source = sourceRandomLogNormal;\n\n return randomLogNormal;\n}))(defaultSource);\n\nvar irwinHall = ((function sourceRandomIrwinHall(source) {\n function randomIrwinHall(n) {\n return function() {\n for (var sum = 0, i = 0; i < n; ++i) sum += source();\n return sum;\n };\n }\n\n randomIrwinHall.source = sourceRandomIrwinHall;\n\n return randomIrwinHall;\n}))(defaultSource);\n\nvar bates = ((function sourceRandomBates(source) {\n function randomBates(n) {\n var randomIrwinHall = irwinHall.source(source)(n);\n return function() {\n return randomIrwinHall() / n;\n };\n }\n\n randomBates.source = sourceRandomBates;\n\n return randomBates;\n}))(defaultSource);\n\nvar exponential = ((function sourceRandomExponential(source) {\n function randomExponential(lambda) {\n return function() {\n return -Math.log(1 - source()) / lambda;\n };\n }\n\n randomExponential.source = sourceRandomExponential;\n\n return randomExponential;\n}))(defaultSource);\n\nexports.randomUniform = uniform;\nexports.randomNormal = normal;\nexports.randomLogNormal = logNormal;\nexports.randomBates = bates;\nexports.randomIrwinHall = irwinHall;\nexports.randomExponential = exponential;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n})));\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/d3-random/build/d3-random.js\n// module id = 25\n// module chunks = 0\n//# sourceURL=webpack:///./~/d3-random/build/d3-random.js?")},function(module,exports,__webpack_require__){eval('var __WEBPACK_AMD_DEFINE_RESULT__;"use strict";\n\n!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require) {\n "use strict";\n\n var _require = __webpack_require__(5),\n dispatch = _require.dispatch;\n\n return function observer(_dataManager) {\n var dispatcher = dispatch("brushChange", "dataFilter");\n var dataManager = _dataManager;\n\n dispatcher.on("brushChange.observer", function (e) {\n var filtered = dataManager.filterByDate(e);\n pub("dataFilter", filtered);\n });\n\n function sub() {\n dispatcher.on.apply(dispatcher, arguments);\n return this;\n }\n\n function pub(_channelName) {\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n dispatcher.call.apply(dispatcher, [_channelName, this].concat(args));\n return this;\n }\n\n return {\n sub: sub,\n pub: pub\n };\n };\n}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/charts/observer.js\n// module id = 26\n// module chunks = 0\n//# sourceURL=webpack:///./src/charts/observer.js?')},function(module,exports,__webpack_require__){eval('var __WEBPACK_AMD_DEFINE_RESULT__;"use strict";\n\n!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require) {\n "use strict";\n\n var d3Array = __webpack_require__(2);\n var d3Brush = __webpack_require__(28);\n // const d3Ease = require("d3-ease")\n var d3Scale = __webpack_require__(7);\n var d3Dispatch = __webpack_require__(5);\n var d3Selection = __webpack_require__(15);\n var d3Time = __webpack_require__(11);\n\n var _require = __webpack_require__(18),\n keys = _require.keys;\n\n var _require2 = __webpack_require__(22),\n cloneData = _require2.cloneData;\n\n /**\n * @typedef BrushChartData\n * @type {Object[]}\n * @property {Number} value Value to chart (required)\n * @property {Date} date Date of the value (required)\n *\n * @example\n * [\n * {\n * value: 1,\n * date: \'2011-01-06T00:00:00Z\'\n * },\n * {\n * value: 2,\n * date: \'2011-01-07T00:00:00Z\'\n * }\n * ]\n */\n\n /**\n * Brush Chart reusable API class that renders a\n * simple and configurable brush chart.\n *\n * @module Brush\n * @tutorial brush\n * @requires d3-array, d3-axis, d3-brush, d3-ease, d3-scale, d3-shape, d3-selection, d3-time, d3-time-format\n *\n * @example\n * let brushChart = brush();\n *\n * brushChart\n * .height(500)\n * .width(800);\n *\n * d3Selection.select(\'.css-selector\')\n * .datum(dataset)\n * .call(brushChart);\n *\n */\n\n return function module(_chart) {\n\n var config = {\n margin: {\n top: 60,\n right: 30,\n bottom: 40,\n left: 70\n },\n width: 800,\n height: 500\n };\n\n var cache = {\n chart: _chart,\n svg: null,\n chartWidth: null,\n chartHeight: null,\n dateRange: [null, null],\n brush: null,\n chartBrush: null,\n handle: null,\n data: null,\n xScale: null\n };\n\n var chartCache = null;\n\n // accessors\n // const getValue = ({value}) => value\n // const getDate = ({date}) => date\n\n // events\n var dispatcher = d3Dispatch.dispatch("brushStart", "brushMove", "brushEnd");\n\n /**\n * This function creates the graph using the selection as container\n * @param {D3Selection} _selection A d3 selection that represents\n * the container(s) where the chart(s) will be rendered\n * @param {BrushChartData} _data The data to attach and generate the chart\n */\n function init() {\n buildSVG();\n\n cache.data = extractBrushDimension(cloneData(chartCache.dataBySeries));\n buildScales();\n buildBrush();\n drawBrush();\n }\n init();\n\n /**\n * Builds the SVG element that will contain the chart\n * @param {HTMLElement} container DOM element that will work as the container of the graph\n * @private\n */\n function buildSVG() {\n chartCache = cache.chart.getCache();\n setConfig(cache.chart.getConfig());\n\n cache.chartWidth = config.width - config.margin.left - config.margin.right;\n cache.chartHeight = config.height - config.margin.top - config.margin.bottom;\n\n if (!cache.svg) {\n cache.svg = chartCache.svg.append("g").classed("brush-group", true);\n }\n\n cache.svg.attr("transform", "translate(" + config.margin.left + ", " + config.margin.top + ")");\n }\n\n /**\n * Creates the brush element and attaches a listener\n * @return {void}\n */\n function buildBrush() {\n cache.brush = d3Brush.brushX().extent([[0, 0], [cache.chartWidth, cache.chartHeight]]).on("start", handleBrushStart).on("brush", handleBrushMove).on("end", handleBrushEnd);\n }\n\n /**\n * Builds containers for the chart, the axis and a wrapper for all of them\n * Also applies the Margin convention\n * @private\n */\n function buildContainerGroups() {\n var container = cache.svg.append("g").classed("container-group", true).attr("transform", "translate(" + config.margin.left + ", " + config.margin.top + ")");\n\n container.append("g").classed("brush-group", true);\n }\n\n /**\n * Creates the x and y scales of the graph\n * @private\n */\n function buildScales() {\n cache.xScale = d3Scale.scaleTime().domain(d3Array.extent(cache.data)).range([0, cache.chartWidth]);\n }\n\n /**\n * Cleaning data adding the proper format\n *\n * @param {BrushChartData} data Data\n */\n function extractBrushDimension(_data) {\n var merged = d3Array.merge(_data.map(function (d) {\n return d[keys.VALUES_KEY];\n }));\n return merged.map(function (d) {\n return new Date(d[keys.DATE_KEY]);\n }).sort(function (a, b) {\n return a.getTime() - b.getTime();\n });\n }\n\n /**\n * Draws the Brush components on its group\n * @return {void}\n */\n function drawBrush() {\n cache.chartBrush = cache.svg.call(cache.brush);\n\n cache.chartBrush.selectAll(".brush-rect").attr("height", cache.chartHeight);\n }\n\n /**\n * When a brush event starts, we can extract info from the extension\n * of the brush.\n *\n * @return {void}\n */\n function handleBrushStart() {\n var s = d3Selection.event.selection;\n var dateExtent = s.map(cache.xScale.invert);\n\n dispatcher.call("brushStart", this, dateExtent);\n }\n\n /**\n * When a brush event moves, we can extract info from the extension\n * of the brush.\n *\n * @return {void}\n */\n function handleBrushMove() {\n var s = d3Selection.event.selection;\n var dateExtent = s.map(cache.xScale.invert);\n\n dispatcher.call("brushMove", this, dateExtent);\n }\n\n /**\n * Processes the end brush event, snapping the boundaries to days\n * as showed on the example on https://bl.ocks.org/mbostock/6232537\n * @return {void}\n * @private\n */\n function handleBrushEnd() {\n // Only transition after input, ignore empty selections.\n if (!d3Selection.event.sourceEvent || !d3Selection.event.selection) {\n return;\n }\n\n var s = d3Selection.event.selection;\n var dateExtent = s.map(cache.xScale.invert);\n var dateExtentRounded = dateExtent.map(d3Time.timeDay.round);\n\n // If empty when rounded, use floor & ceil instead.\n if (dateExtentRounded[0] >= dateExtentRounded[1]) {\n dateExtentRounded[0] = d3Time.timeDay.floor(dateExtent[0]);\n dateExtentRounded[1] = d3Time.timeDay.offset(dateExtentRounded[0]);\n }\n\n d3Selection.select(this).transition().call(d3Selection.event.target.move, dateExtentRounded.map(cache.xScale));\n\n dispatcher.call("brushEnd", this, dateExtentRounded);\n }\n\n /**\n * Sets a new brush extent within the passed percentage positions\n * @param {Number} a Percentage of data that the brush start with\n * @param {Number} b Percentage of data that the brush ends with\n * @example\n * setBrushByPercentages(0.25, 0.5)\n */\n function setBrushByPercentages(_a, _b) {\n var x0 = _a * cache.chartWidth;\n var x1 = _b * cache.chartWidth;\n\n brush.move(chartBrush, [x0, x1]);\n }\n\n /**\n * Sets a new brush extent within the passed dates\n * @param {String | Date} dateA Initial Date\n * @param {String | Date} dateB End Date\n */\n function setBrushByDates(_dateA, _dateB) {\n var x0 = cache.xScale(new Date(_dateA));\n var x1 = cache.xScale(new Date(_dateB));\n\n cache.brush.move(cache.chartBrush, [x0, x1]);\n }\n\n /**\n * Updates visibility and position of the brush handlers\n * @param {Number[]} dateExtent Date range\n * @return {void}\n */\n function updateHandlers(_dateExtent) {\n if (_dateExtent === null) {\n cache.handle.attr("display", "none");\n } else {\n cache.handle.attr("display", null).attr("transform", function (d, i) {\n return "translate(" + _dateExtent[i] + "," + cache.chartHeight / 2 + ")";\n });\n }\n }\n\n // API\n\n /**\n * Gets or Sets the dateRange for the selected part of the brush\n * @param {String[]} _x Desired dateRange for the graph\n * @return { dateRange | module} Current dateRange or Chart module to chain calls\n * @public\n */\n // function dateRange (_x) {\n // if (!arguments.length) {\n // return dateRange\n // }\n // dateRange = _x\n\n // if (Array.isArray(dateRange)) {\n // setBrushByDates(...dateRange)\n // }\n\n // return this\n // }\n\n /**\n * Exposes an \'on\' method that acts as a bridge with the event dispatcher\n * We are going to expose this events:\n * brushStart, brushMove, brushEnd\n *\n * @return {module} Chart\n * @public\n */\n function on() {\n return dispatcher.on.apply(dispatcher, arguments);\n }\n\n function setConfig(_config) {\n config = Object.assign({}, config, _config);\n return this;\n }\n\n function getCache() {\n return cache;\n }\n\n return {\n getCache: getCache,\n on: on,\n setConfig: setConfig\n };\n };\n}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/charts/brush.js\n// module id = 27\n// module chunks = 0\n//# sourceURL=webpack:///./src/charts/brush.js?')},function(module,exports,__webpack_require__){eval('// https://d3js.org/d3-brush/ Version 1.0.4. Copyright 2017 Mike Bostock.\n(function (global, factory) {\n\t true ? factory(exports, __webpack_require__(5), __webpack_require__(29), __webpack_require__(8), __webpack_require__(15), __webpack_require__(30)) :\n\ttypeof define === \'function\' && define.amd ? define([\'exports\', \'d3-dispatch\', \'d3-drag\', \'d3-interpolate\', \'d3-selection\', \'d3-transition\'], factory) :\n\t(factory((global.d3 = global.d3 || {}),global.d3,global.d3,global.d3,global.d3,global.d3));\n}(this, (function (exports,d3Dispatch,d3Drag,d3Interpolate,d3Selection,d3Transition) { \'use strict\';\n\nvar constant = function(x) {\n return function() {\n return x;\n };\n};\n\nvar BrushEvent = function(target, type, selection) {\n this.target = target;\n this.type = type;\n this.selection = selection;\n};\n\nfunction nopropagation() {\n d3Selection.event.stopImmediatePropagation();\n}\n\nvar noevent = function() {\n d3Selection.event.preventDefault();\n d3Selection.event.stopImmediatePropagation();\n};\n\nvar MODE_DRAG = {name: "drag"};\nvar MODE_SPACE = {name: "space"};\nvar MODE_HANDLE = {name: "handle"};\nvar MODE_CENTER = {name: "center"};\n\nvar X = {\n name: "x",\n handles: ["e", "w"].map(type),\n input: function(x, e) { return x && [[x[0], e[0][1]], [x[1], e[1][1]]]; },\n output: function(xy) { return xy && [xy[0][0], xy[1][0]]; }\n};\n\nvar Y = {\n name: "y",\n handles: ["n", "s"].map(type),\n input: function(y, e) { return y && [[e[0][0], y[0]], [e[1][0], y[1]]]; },\n output: function(xy) { return xy && [xy[0][1], xy[1][1]]; }\n};\n\nvar XY = {\n name: "xy",\n handles: ["n", "e", "s", "w", "nw", "ne", "se", "sw"].map(type),\n input: function(xy) { return xy; },\n output: function(xy) { return xy; }\n};\n\nvar cursors = {\n overlay: "crosshair",\n selection: "move",\n n: "ns-resize",\n e: "ew-resize",\n s: "ns-resize",\n w: "ew-resize",\n nw: "nwse-resize",\n ne: "nesw-resize",\n se: "nwse-resize",\n sw: "nesw-resize"\n};\n\nvar flipX = {\n e: "w",\n w: "e",\n nw: "ne",\n ne: "nw",\n se: "sw",\n sw: "se"\n};\n\nvar flipY = {\n n: "s",\n s: "n",\n nw: "sw",\n ne: "se",\n se: "ne",\n sw: "nw"\n};\n\nvar signsX = {\n overlay: +1,\n selection: +1,\n n: null,\n e: +1,\n s: null,\n w: -1,\n nw: -1,\n ne: +1,\n se: +1,\n sw: -1\n};\n\nvar signsY = {\n overlay: +1,\n selection: +1,\n n: -1,\n e: null,\n s: +1,\n w: null,\n nw: -1,\n ne: -1,\n se: +1,\n sw: +1\n};\n\nfunction type(t) {\n return {type: t};\n}\n\n// Ignore right-click, since that should open the context menu.\nfunction defaultFilter() {\n return !d3Selection.event.button;\n}\n\nfunction defaultExtent() {\n var svg = this.ownerSVGElement || this;\n return [[0, 0], [svg.width.baseVal.value, svg.height.baseVal.value]];\n}\n\n// Like d3.local, but with the name “__brush” rather than auto-generated.\nfunction local(node) {\n while (!node.__brush) if (!(node = node.parentNode)) return;\n return node.__brush;\n}\n\nfunction empty(extent) {\n return extent[0][0] === extent[1][0]\n || extent[0][1] === extent[1][1];\n}\n\nfunction brushSelection(node) {\n var state = node.__brush;\n return state ? state.dim.output(state.selection) : null;\n}\n\nfunction brushX() {\n return brush$1(X);\n}\n\nfunction brushY() {\n return brush$1(Y);\n}\n\nvar brush = function() {\n return brush$1(XY);\n};\n\nfunction brush$1(dim) {\n var extent = defaultExtent,\n filter = defaultFilter,\n listeners = d3Dispatch.dispatch(brush, "start", "brush", "end"),\n handleSize = 6,\n touchending;\n\n function brush(group) {\n var overlay = group\n .property("__brush", initialize)\n .selectAll(".overlay")\n .data([type("overlay")]);\n\n overlay.enter().append("rect")\n .attr("class", "overlay")\n .attr("pointer-events", "all")\n .attr("cursor", cursors.overlay)\n .merge(overlay)\n .each(function() {\n var extent = local(this).extent;\n d3Selection.select(this)\n .attr("x", extent[0][0])\n .attr("y", extent[0][1])\n .attr("width", extent[1][0] - extent[0][0])\n .attr("height", extent[1][1] - extent[0][1]);\n });\n\n group.selectAll(".selection")\n .data([type("selection")])\n .enter().append("rect")\n .attr("class", "selection")\n .attr("cursor", cursors.selection)\n .attr("fill", "#777")\n .attr("fill-opacity", 0.3)\n .attr("stroke", "#fff")\n .attr("shape-rendering", "crispEdges");\n\n var handle = group.selectAll(".handle")\n .data(dim.handles, function(d) { return d.type; });\n\n handle.exit().remove();\n\n handle.enter().append("rect")\n .attr("class", function(d) { return "handle handle--" + d.type; })\n .attr("cursor", function(d) { return cursors[d.type]; });\n\n group\n .each(redraw)\n .attr("fill", "none")\n .attr("pointer-events", "all")\n .style("-webkit-tap-highlight-color", "rgba(0,0,0,0)")\n .on("mousedown.brush touchstart.brush", started);\n }\n\n brush.move = function(group, selection) {\n if (group.selection) {\n group\n .on("start.brush", function() { emitter(this, arguments).beforestart().start(); })\n .on("interrupt.brush end.brush", function() { emitter(this, arguments).end(); })\n .tween("brush", function() {\n var that = this,\n state = that.__brush,\n emit = emitter(that, arguments),\n selection0 = state.selection,\n selection1 = dim.input(typeof selection === "function" ? selection.apply(this, arguments) : selection, state.extent),\n i = d3Interpolate.interpolate(selection0, selection1);\n\n function tween(t) {\n state.selection = t === 1 && empty(selection1) ? null : i(t);\n redraw.call(that);\n emit.brush();\n }\n\n return selection0 && selection1 ? tween : tween(1);\n });\n } else {\n group\n .each(function() {\n var that = this,\n args = arguments,\n state = that.__brush,\n selection1 = dim.input(typeof selection === "function" ? selection.apply(that, args) : selection, state.extent),\n emit = emitter(that, args).beforestart();\n\n d3Transition.interrupt(that);\n state.selection = selection1 == null || empty(selection1) ? null : selection1;\n redraw.call(that);\n emit.start().brush().end();\n });\n }\n };\n\n function redraw() {\n var group = d3Selection.select(this),\n selection = local(this).selection;\n\n if (selection) {\n group.selectAll(".selection")\n .style("display", null)\n .attr("x", selection[0][0])\n .attr("y", selection[0][1])\n .attr("width", selection[1][0] - selection[0][0])\n .attr("height", selection[1][1] - selection[0][1]);\n\n group.selectAll(".handle")\n .style("display", null)\n .attr("x", function(d) { return d.type[d.type.length - 1] === "e" ? selection[1][0] - handleSize / 2 : selection[0][0] - handleSize / 2; })\n .attr("y", function(d) { return d.type[0] === "s" ? selection[1][1] - handleSize / 2 : selection[0][1] - handleSize / 2; })\n .attr("width", function(d) { return d.type === "n" || d.type === "s" ? selection[1][0] - selection[0][0] + handleSize : handleSize; })\n .attr("height", function(d) { return d.type === "e" || d.type === "w" ? selection[1][1] - selection[0][1] + handleSize : handleSize; });\n }\n\n else {\n group.selectAll(".selection,.handle")\n .style("display", "none")\n .attr("x", null)\n .attr("y", null)\n .attr("width", null)\n .attr("height", null);\n }\n }\n\n function emitter(that, args) {\n return that.__brush.emitter || new Emitter(that, args);\n }\n\n function Emitter(that, args) {\n this.that = that;\n this.args = args;\n this.state = that.__brush;\n this.active = 0;\n }\n\n Emitter.prototype = {\n beforestart: function() {\n if (++this.active === 1) this.state.emitter = this, this.starting = true;\n return this;\n },\n start: function() {\n if (this.starting) this.starting = false, this.emit("start");\n return this;\n },\n brush: function() {\n this.emit("brush");\n return this;\n },\n end: function() {\n if (--this.active === 0) delete this.state.emitter, this.emit("end");\n return this;\n },\n emit: function(type) {\n d3Selection.customEvent(new BrushEvent(brush, type, dim.output(this.state.selection)), listeners.apply, listeners, [type, this.that, this.args]);\n }\n };\n\n function started() {\n if (d3Selection.event.touches) { if (d3Selection.event.changedTouches.length < d3Selection.event.touches.length) return noevent(); }\n else if (touchending) return;\n if (!filter.apply(this, arguments)) return;\n\n var that = this,\n type = d3Selection.event.target.__data__.type,\n mode = (d3Selection.event.metaKey ? type = "overlay" : type) === "selection" ? MODE_DRAG : (d3Selection.event.altKey ? MODE_CENTER : MODE_HANDLE),\n signX = dim === Y ? null : signsX[type],\n signY = dim === X ? null : signsY[type],\n state = local(that),\n extent = state.extent,\n selection = state.selection,\n W = extent[0][0], w0, w1,\n N = extent[0][1], n0, n1,\n E = extent[1][0], e0, e1,\n S = extent[1][1], s0, s1,\n dx,\n dy,\n moving,\n shifting = signX && signY && d3Selection.event.shiftKey,\n lockX,\n lockY,\n point0 = d3Selection.mouse(that),\n point = point0,\n emit = emitter(that, arguments).beforestart();\n\n if (type === "overlay") {\n state.selection = selection = [\n [w0 = dim === Y ? W : point0[0], n0 = dim === X ? N : point0[1]],\n [e0 = dim === Y ? E : w0, s0 = dim === X ? S : n0]\n ];\n } else {\n w0 = selection[0][0];\n n0 = selection[0][1];\n e0 = selection[1][0];\n s0 = selection[1][1];\n }\n\n w1 = w0;\n n1 = n0;\n e1 = e0;\n s1 = s0;\n\n var group = d3Selection.select(that)\n .attr("pointer-events", "none");\n\n var overlay = group.selectAll(".overlay")\n .attr("cursor", cursors[type]);\n\n if (d3Selection.event.touches) {\n group\n .on("touchmove.brush", moved, true)\n .on("touchend.brush touchcancel.brush", ended, true);\n } else {\n var view = d3Selection.select(d3Selection.event.view)\n .on("keydown.brush", keydowned, true)\n .on("keyup.brush", keyupped, true)\n .on("mousemove.brush", moved, true)\n .on("mouseup.brush", ended, true);\n\n d3Drag.dragDisable(d3Selection.event.view);\n }\n\n nopropagation();\n d3Transition.interrupt(that);\n redraw.call(that);\n emit.start();\n\n function moved() {\n var point1 = d3Selection.mouse(that);\n if (shifting && !lockX && !lockY) {\n if (Math.abs(point1[0] - point[0]) > Math.abs(point1[1] - point[1])) lockY = true;\n else lockX = true;\n }\n point = point1;\n moving = true;\n noevent();\n move();\n }\n\n function move() {\n var t;\n\n dx = point[0] - point0[0];\n dy = point[1] - point0[1];\n\n switch (mode) {\n case MODE_SPACE:\n case MODE_DRAG: {\n if (signX) dx = Math.max(W - w0, Math.min(E - e0, dx)), w1 = w0 + dx, e1 = e0 + dx;\n if (signY) dy = Math.max(N - n0, Math.min(S - s0, dy)), n1 = n0 + dy, s1 = s0 + dy;\n break;\n }\n case MODE_HANDLE: {\n if (signX < 0) dx = Math.max(W - w0, Math.min(E - w0, dx)), w1 = w0 + dx, e1 = e0;\n else if (signX > 0) dx = Math.max(W - e0, Math.min(E - e0, dx)), w1 = w0, e1 = e0 + dx;\n if (signY < 0) dy = Math.max(N - n0, Math.min(S - n0, dy)), n1 = n0 + dy, s1 = s0;\n else if (signY > 0) dy = Math.max(N - s0, Math.min(S - s0, dy)), n1 = n0, s1 = s0 + dy;\n break;\n }\n case MODE_CENTER: {\n if (signX) w1 = Math.max(W, Math.min(E, w0 - dx * signX)), e1 = Math.max(W, Math.min(E, e0 + dx * signX));\n if (signY) n1 = Math.max(N, Math.min(S, n0 - dy * signY)), s1 = Math.max(N, Math.min(S, s0 + dy * signY));\n break;\n }\n }\n\n if (e1 < w1) {\n signX *= -1;\n t = w0, w0 = e0, e0 = t;\n t = w1, w1 = e1, e1 = t;\n if (type in flipX) overlay.attr("cursor", cursors[type = flipX[type]]);\n }\n\n if (s1 < n1) {\n signY *= -1;\n t = n0, n0 = s0, s0 = t;\n t = n1, n1 = s1, s1 = t;\n if (type in flipY) overlay.attr("cursor", cursors[type = flipY[type]]);\n }\n\n if (state.selection) selection = state.selection; // May be set by brush.move!\n if (lockX) w1 = selection[0][0], e1 = selection[1][0];\n if (lockY) n1 = selection[0][1], s1 = selection[1][1];\n\n if (selection[0][0] !== w1\n || selection[0][1] !== n1\n || selection[1][0] !== e1\n || selection[1][1] !== s1) {\n state.selection = [[w1, n1], [e1, s1]];\n redraw.call(that);\n emit.brush();\n }\n }\n\n function ended() {\n nopropagation();\n if (d3Selection.event.touches) {\n if (d3Selection.event.touches.length) return;\n if (touchending) clearTimeout(touchending);\n touchending = setTimeout(function() { touchending = null; }, 500); // Ghost clicks are delayed!\n group.on("touchmove.brush touchend.brush touchcancel.brush", null);\n } else {\n d3Drag.dragEnable(d3Selection.event.view, moving);\n view.on("keydown.brush keyup.brush mousemove.brush mouseup.brush", null);\n }\n group.attr("pointer-events", "all");\n overlay.attr("cursor", cursors.overlay);\n if (state.selection) selection = state.selection; // May be set by brush.move (on start)!\n if (empty(selection)) state.selection = null, redraw.call(that);\n emit.end();\n }\n\n function keydowned() {\n switch (d3Selection.event.keyCode) {\n case 16: { // SHIFT\n shifting = signX && signY;\n break;\n }\n case 18: { // ALT\n if (mode === MODE_HANDLE) {\n if (signX) e0 = e1 - dx * signX, w0 = w1 + dx * signX;\n if (signY) s0 = s1 - dy * signY, n0 = n1 + dy * signY;\n mode = MODE_CENTER;\n move();\n }\n break;\n }\n case 32: { // SPACE; takes priority over ALT\n if (mode === MODE_HANDLE || mode === MODE_CENTER) {\n if (signX < 0) e0 = e1 - dx; else if (signX > 0) w0 = w1 - dx;\n if (signY < 0) s0 = s1 - dy; else if (signY > 0) n0 = n1 - dy;\n mode = MODE_SPACE;\n overlay.attr("cursor", cursors.selection);\n move();\n }\n break;\n }\n default: return;\n }\n noevent();\n }\n\n function keyupped() {\n switch (d3Selection.event.keyCode) {\n case 16: { // SHIFT\n if (shifting) {\n lockX = lockY = shifting = false;\n move();\n }\n break;\n }\n case 18: { // ALT\n if (mode === MODE_CENTER) {\n if (signX < 0) e0 = e1; else if (signX > 0) w0 = w1;\n if (signY < 0) s0 = s1; else if (signY > 0) n0 = n1;\n mode = MODE_HANDLE;\n move();\n }\n break;\n }\n case 32: { // SPACE\n if (mode === MODE_SPACE) {\n if (d3Selection.event.altKey) {\n if (signX) e0 = e1 - dx * signX, w0 = w1 + dx * signX;\n if (signY) s0 = s1 - dy * signY, n0 = n1 + dy * signY;\n mode = MODE_CENTER;\n } else {\n if (signX < 0) e0 = e1; else if (signX > 0) w0 = w1;\n if (signY < 0) s0 = s1; else if (signY > 0) n0 = n1;\n mode = MODE_HANDLE;\n }\n overlay.attr("cursor", cursors[type]);\n move();\n }\n break;\n }\n default: return;\n }\n noevent();\n }\n }\n\n function initialize() {\n var state = this.__brush || {selection: null};\n state.extent = extent.apply(this, arguments);\n state.dim = dim;\n return state;\n }\n\n brush.extent = function(_) {\n return arguments.length ? (extent = typeof _ === "function" ? _ : constant([[+_[0][0], +_[0][1]], [+_[1][0], +_[1][1]]]), brush) : extent;\n };\n\n brush.filter = function(_) {\n return arguments.length ? (filter = typeof _ === "function" ? _ : constant(!!_), brush) : filter;\n };\n\n brush.handleSize = function(_) {\n return arguments.length ? (handleSize = +_, brush) : handleSize;\n };\n\n brush.on = function() {\n var value = listeners.on.apply(listeners, arguments);\n return value === listeners ? brush : value;\n };\n\n return brush;\n}\n\nexports.brush = brush;\nexports.brushX = brushX;\nexports.brushY = brushY;\nexports.brushSelection = brushSelection;\n\nObject.defineProperty(exports, \'__esModule\', { value: true });\n\n})));\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/d3-brush/build/d3-brush.js\n// module id = 28\n// module chunks = 0\n//# sourceURL=webpack:///./~/d3-brush/build/d3-brush.js?'); | |
},function(module,exports,__webpack_require__){eval('// https://d3js.org/d3-drag/ Version 1.1.1. Copyright 2017 Mike Bostock.\n(function (global, factory) {\n\t true ? factory(exports, __webpack_require__(5), __webpack_require__(15)) :\n\ttypeof define === \'function\' && define.amd ? define([\'exports\', \'d3-dispatch\', \'d3-selection\'], factory) :\n\t(factory((global.d3 = global.d3 || {}),global.d3,global.d3));\n}(this, (function (exports,d3Dispatch,d3Selection) { \'use strict\';\n\nfunction nopropagation() {\n d3Selection.event.stopImmediatePropagation();\n}\n\nvar noevent = function() {\n d3Selection.event.preventDefault();\n d3Selection.event.stopImmediatePropagation();\n};\n\nvar nodrag = function(view) {\n var root = view.document.documentElement,\n selection = d3Selection.select(view).on("dragstart.drag", noevent, true);\n if ("onselectstart" in root) {\n selection.on("selectstart.drag", noevent, true);\n } else {\n root.__noselect = root.style.MozUserSelect;\n root.style.MozUserSelect = "none";\n }\n};\n\nfunction yesdrag(view, noclick) {\n var root = view.document.documentElement,\n selection = d3Selection.select(view).on("dragstart.drag", null);\n if (noclick) {\n selection.on("click.drag", noevent, true);\n setTimeout(function() { selection.on("click.drag", null); }, 0);\n }\n if ("onselectstart" in root) {\n selection.on("selectstart.drag", null);\n } else {\n root.style.MozUserSelect = root.__noselect;\n delete root.__noselect;\n }\n}\n\nvar constant = function(x) {\n return function() {\n return x;\n };\n};\n\nfunction DragEvent(target, type, subject, id, active, x, y, dx, dy, dispatch$$1) {\n this.target = target;\n this.type = type;\n this.subject = subject;\n this.identifier = id;\n this.active = active;\n this.x = x;\n this.y = y;\n this.dx = dx;\n this.dy = dy;\n this._ = dispatch$$1;\n}\n\nDragEvent.prototype.on = function() {\n var value = this._.on.apply(this._, arguments);\n return value === this._ ? this : value;\n};\n\n// Ignore right-click, since that should open the context menu.\nfunction defaultFilter() {\n return !d3Selection.event.button;\n}\n\nfunction defaultContainer() {\n return this.parentNode;\n}\n\nfunction defaultSubject(d) {\n return d == null ? {x: d3Selection.event.x, y: d3Selection.event.y} : d;\n}\n\nfunction touchable() {\n return "ontouchstart" in this;\n}\n\nvar drag = function() {\n var filter = defaultFilter,\n container = defaultContainer,\n subject = defaultSubject,\n gestures = {},\n listeners = d3Dispatch.dispatch("start", "drag", "end"),\n active = 0,\n mousedownx,\n mousedowny,\n mousemoving,\n touchending,\n clickDistance2 = 0;\n\n function drag(selection) {\n selection\n .on("mousedown.drag", mousedowned)\n .filter(touchable)\n .on("touchstart.drag", touchstarted)\n .on("touchmove.drag", touchmoved)\n .on("touchend.drag touchcancel.drag", touchended)\n .style("touch-action", "none")\n .style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");\n }\n\n function mousedowned() {\n if (touchending || !filter.apply(this, arguments)) return;\n var gesture = beforestart("mouse", container.apply(this, arguments), d3Selection.mouse, this, arguments);\n if (!gesture) return;\n d3Selection.select(d3Selection.event.view).on("mousemove.drag", mousemoved, true).on("mouseup.drag", mouseupped, true);\n nodrag(d3Selection.event.view);\n nopropagation();\n mousemoving = false;\n mousedownx = d3Selection.event.clientX;\n mousedowny = d3Selection.event.clientY;\n gesture("start");\n }\n\n function mousemoved() {\n noevent();\n if (!mousemoving) {\n var dx = d3Selection.event.clientX - mousedownx, dy = d3Selection.event.clientY - mousedowny;\n mousemoving = dx * dx + dy * dy > clickDistance2;\n }\n gestures.mouse("drag");\n }\n\n function mouseupped() {\n d3Selection.select(d3Selection.event.view).on("mousemove.drag mouseup.drag", null);\n yesdrag(d3Selection.event.view, mousemoving);\n noevent();\n gestures.mouse("end");\n }\n\n function touchstarted() {\n if (!filter.apply(this, arguments)) return;\n var touches = d3Selection.event.changedTouches,\n c = container.apply(this, arguments),\n n = touches.length, i, gesture;\n\n for (i = 0; i < n; ++i) {\n if (gesture = beforestart(touches[i].identifier, c, d3Selection.touch, this, arguments)) {\n nopropagation();\n gesture("start");\n }\n }\n }\n\n function touchmoved() {\n var touches = d3Selection.event.changedTouches,\n n = touches.length, i, gesture;\n\n for (i = 0; i < n; ++i) {\n if (gesture = gestures[touches[i].identifier]) {\n noevent();\n gesture("drag");\n }\n }\n }\n\n function touchended() {\n var touches = d3Selection.event.changedTouches,\n n = touches.length, i, gesture;\n\n if (touchending) clearTimeout(touchending);\n touchending = setTimeout(function() { touchending = null; }, 500); // Ghost clicks are delayed!\n for (i = 0; i < n; ++i) {\n if (gesture = gestures[touches[i].identifier]) {\n nopropagation();\n gesture("end");\n }\n }\n }\n\n function beforestart(id, container, point, that, args) {\n var p = point(container, id), s, dx, dy,\n sublisteners = listeners.copy();\n\n if (!d3Selection.customEvent(new DragEvent(drag, "beforestart", s, id, active, p[0], p[1], 0, 0, sublisteners), function() {\n if ((d3Selection.event.subject = s = subject.apply(that, args)) == null) return false;\n dx = s.x - p[0] || 0;\n dy = s.y - p[1] || 0;\n return true;\n })) return;\n\n return function gesture(type) {\n var p0 = p, n;\n switch (type) {\n case "start": gestures[id] = gesture, n = active++; break;\n case "end": delete gestures[id], --active; // nobreak\n case "drag": p = point(container, id), n = active; break;\n }\n d3Selection.customEvent(new DragEvent(drag, type, s, id, n, p[0] + dx, p[1] + dy, p[0] - p0[0], p[1] - p0[1], sublisteners), sublisteners.apply, sublisteners, [type, that, args]);\n };\n }\n\n drag.filter = function(_) {\n return arguments.length ? (filter = typeof _ === "function" ? _ : constant(!!_), drag) : filter;\n };\n\n drag.container = function(_) {\n return arguments.length ? (container = typeof _ === "function" ? _ : constant(_), drag) : container;\n };\n\n drag.subject = function(_) {\n return arguments.length ? (subject = typeof _ === "function" ? _ : constant(_), drag) : subject;\n };\n\n drag.on = function() {\n var value = listeners.on.apply(listeners, arguments);\n return value === listeners ? drag : value;\n };\n\n drag.clickDistance = function(_) {\n return arguments.length ? (clickDistance2 = (_ = +_) * _, drag) : Math.sqrt(clickDistance2);\n };\n\n return drag;\n};\n\nexports.drag = drag;\nexports.dragDisable = nodrag;\nexports.dragEnable = yesdrag;\n\nObject.defineProperty(exports, \'__esModule\', { value: true });\n\n})));\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/d3-drag/build/d3-drag.js\n// module id = 29\n// module chunks = 0\n//# sourceURL=webpack:///./~/d3-drag/build/d3-drag.js?')},function(module,exports,__webpack_require__){eval('// https://d3js.org/d3-transition/ Version 1.1.0. Copyright 2017 Mike Bostock.\n(function (global, factory) {\n\t true ? factory(exports, __webpack_require__(15), __webpack_require__(5), __webpack_require__(31), __webpack_require__(8), __webpack_require__(9), __webpack_require__(6)) :\n\ttypeof define === \'function\' && define.amd ? define([\'exports\', \'d3-selection\', \'d3-dispatch\', \'d3-timer\', \'d3-interpolate\', \'d3-color\', \'d3-ease\'], factory) :\n\t(factory((global.d3 = global.d3 || {}),global.d3,global.d3,global.d3,global.d3,global.d3,global.d3));\n}(this, (function (exports,d3Selection,d3Dispatch,d3Timer,d3Interpolate,d3Color,d3Ease) { \'use strict\';\n\nvar emptyOn = d3Dispatch.dispatch("start", "end", "interrupt");\nvar emptyTween = [];\n\nvar CREATED = 0;\nvar SCHEDULED = 1;\nvar STARTING = 2;\nvar STARTED = 3;\nvar RUNNING = 4;\nvar ENDING = 5;\nvar ENDED = 6;\n\nvar schedule = function(node, name, id, index, group, timing) {\n var schedules = node.__transition;\n if (!schedules) node.__transition = {};\n else if (id in schedules) return;\n create(node, id, {\n name: name,\n index: index, // For context during callback.\n group: group, // For context during callback.\n on: emptyOn,\n tween: emptyTween,\n time: timing.time,\n delay: timing.delay,\n duration: timing.duration,\n ease: timing.ease,\n timer: null,\n state: CREATED\n });\n};\n\nfunction init(node, id) {\n var schedule = node.__transition;\n if (!schedule || !(schedule = schedule[id]) || schedule.state > CREATED) throw new Error("too late");\n return schedule;\n}\n\nfunction set(node, id) {\n var schedule = node.__transition;\n if (!schedule || !(schedule = schedule[id]) || schedule.state > STARTING) throw new Error("too late");\n return schedule;\n}\n\nfunction get(node, id) {\n var schedule = node.__transition;\n if (!schedule || !(schedule = schedule[id])) throw new Error("too late");\n return schedule;\n}\n\nfunction create(node, id, self) {\n var schedules = node.__transition,\n tween;\n\n // Initialize the self timer when the transition is created.\n // Note the actual delay is not known until the first callback!\n schedules[id] = self;\n self.timer = d3Timer.timer(schedule, 0, self.time);\n\n function schedule(elapsed) {\n self.state = SCHEDULED;\n self.timer.restart(start, self.delay, self.time);\n\n // If the elapsed delay is less than our first sleep, start immediately.\n if (self.delay <= elapsed) start(elapsed - self.delay);\n }\n\n function start(elapsed) {\n var i, j, n, o;\n\n // If the state is not SCHEDULED, then we previously errored on start.\n if (self.state !== SCHEDULED) return stop();\n\n for (i in schedules) {\n o = schedules[i];\n if (o.name !== self.name) continue;\n\n // While this element already has a starting transition during this frame,\n // defer starting an interrupting transition until that transition has a\n // chance to tick (and possibly end); see d3/d3-transition#54!\n if (o.state === STARTED) return d3Timer.timeout(start);\n\n // Interrupt the active transition, if any.\n // Dispatch the interrupt event.\n if (o.state === RUNNING) {\n o.state = ENDED;\n o.timer.stop();\n o.on.call("interrupt", node, node.__data__, o.index, o.group);\n delete schedules[i];\n }\n\n // Cancel any pre-empted transitions. No interrupt event is dispatched\n // because the cancelled transitions never started. Note that this also\n // removes this transition from the pending list!\n else if (+i < id) {\n o.state = ENDED;\n o.timer.stop();\n delete schedules[i];\n }\n }\n\n // Defer the first tick to end of the current frame; see d3/d3#1576.\n // Note the transition may be canceled after start and before the first tick!\n // Note this must be scheduled before the start event; see d3/d3-transition#16!\n // Assuming this is successful, subsequent callbacks go straight to tick.\n d3Timer.timeout(function() {\n if (self.state === STARTED) {\n self.state = RUNNING;\n self.timer.restart(tick, self.delay, self.time);\n tick(elapsed);\n }\n });\n\n // Dispatch the start event.\n // Note this must be done before the tween are initialized.\n self.state = STARTING;\n self.on.call("start", node, node.__data__, self.index, self.group);\n if (self.state !== STARTING) return; // interrupted\n self.state = STARTED;\n\n // Initialize the tween, deleting null tween.\n tween = new Array(n = self.tween.length);\n for (i = 0, j = -1; i < n; ++i) {\n if (o = self.tween[i].value.call(node, node.__data__, self.index, self.group)) {\n tween[++j] = o;\n }\n }\n tween.length = j + 1;\n }\n\n function tick(elapsed) {\n var t = elapsed < self.duration ? self.ease.call(null, elapsed / self.duration) : (self.timer.restart(stop), self.state = ENDING, 1),\n i = -1,\n n = tween.length;\n\n while (++i < n) {\n tween[i].call(null, t);\n }\n\n // Dispatch the end event.\n if (self.state === ENDING) {\n self.on.call("end", node, node.__data__, self.index, self.group);\n stop();\n }\n }\n\n function stop() {\n self.state = ENDED;\n self.timer.stop();\n delete schedules[id];\n for (var i in schedules) return; // eslint-disable-line no-unused-vars\n delete node.__transition;\n }\n}\n\nvar interrupt = function(node, name) {\n var schedules = node.__transition,\n schedule,\n active,\n empty = true,\n i;\n\n if (!schedules) return;\n\n name = name == null ? null : name + "";\n\n for (i in schedules) {\n if ((schedule = schedules[i]).name !== name) { empty = false; continue; }\n active = schedule.state > STARTING && schedule.state < ENDING;\n schedule.state = ENDED;\n schedule.timer.stop();\n if (active) schedule.on.call("interrupt", node, node.__data__, schedule.index, schedule.group);\n delete schedules[i];\n }\n\n if (empty) delete node.__transition;\n};\n\nvar selection_interrupt = function(name) {\n return this.each(function() {\n interrupt(this, name);\n });\n};\n\nfunction tweenRemove(id, name) {\n var tween0, tween1;\n return function() {\n var schedule = set(this, id),\n tween = schedule.tween;\n\n // If this node shared tween with the previous node,\n // just assign the updated shared tween and we’re done!\n // Otherwise, copy-on-write.\n if (tween !== tween0) {\n tween1 = tween0 = tween;\n for (var i = 0, n = tween1.length; i < n; ++i) {\n if (tween1[i].name === name) {\n tween1 = tween1.slice();\n tween1.splice(i, 1);\n break;\n }\n }\n }\n\n schedule.tween = tween1;\n };\n}\n\nfunction tweenFunction(id, name, value) {\n var tween0, tween1;\n if (typeof value !== "function") throw new Error;\n return function() {\n var schedule = set(this, id),\n tween = schedule.tween;\n\n // If this node shared tween with the previous node,\n // just assign the updated shared tween and we’re done!\n // Otherwise, copy-on-write.\n if (tween !== tween0) {\n tween1 = (tween0 = tween).slice();\n for (var t = {name: name, value: value}, i = 0, n = tween1.length; i < n; ++i) {\n if (tween1[i].name === name) {\n tween1[i] = t;\n break;\n }\n }\n if (i === n) tween1.push(t);\n }\n\n schedule.tween = tween1;\n };\n}\n\nvar transition_tween = function(name, value) {\n var id = this._id;\n\n name += "";\n\n if (arguments.length < 2) {\n var tween = get(this.node(), id).tween;\n for (var i = 0, n = tween.length, t; i < n; ++i) {\n if ((t = tween[i]).name === name) {\n return t.value;\n }\n }\n return null;\n }\n\n return this.each((value == null ? tweenRemove : tweenFunction)(id, name, value));\n};\n\nfunction tweenValue(transition, name, value) {\n var id = transition._id;\n\n transition.each(function() {\n var schedule = set(this, id);\n (schedule.value || (schedule.value = {}))[name] = value.apply(this, arguments);\n });\n\n return function(node) {\n return get(node, id).value[name];\n };\n}\n\nvar interpolate = function(a, b) {\n var c;\n return (typeof b === "number" ? d3Interpolate.interpolateNumber\n : b instanceof d3Color.color ? d3Interpolate.interpolateRgb\n : (c = d3Color.color(b)) ? (b = c, d3Interpolate.interpolateRgb)\n : d3Interpolate.interpolateString)(a, b);\n};\n\nfunction attrRemove(name) {\n return function() {\n this.removeAttribute(name);\n };\n}\n\nfunction attrRemoveNS(fullname) {\n return function() {\n this.removeAttributeNS(fullname.space, fullname.local);\n };\n}\n\nfunction attrConstant(name, interpolate$$1, value1) {\n var value00,\n interpolate0;\n return function() {\n var value0 = this.getAttribute(name);\n return value0 === value1 ? null\n : value0 === value00 ? interpolate0\n : interpolate0 = interpolate$$1(value00 = value0, value1);\n };\n}\n\nfunction attrConstantNS(fullname, interpolate$$1, value1) {\n var value00,\n interpolate0;\n return function() {\n var value0 = this.getAttributeNS(fullname.space, fullname.local);\n return value0 === value1 ? null\n : value0 === value00 ? interpolate0\n : interpolate0 = interpolate$$1(value00 = value0, value1);\n };\n}\n\nfunction attrFunction(name, interpolate$$1, value) {\n var value00,\n value10,\n interpolate0;\n return function() {\n var value0, value1 = value(this);\n if (value1 == null) return void this.removeAttribute(name);\n value0 = this.getAttribute(name);\n return value0 === value1 ? null\n : value0 === value00 && value1 === value10 ? interpolate0\n : interpolate0 = interpolate$$1(value00 = value0, value10 = value1);\n };\n}\n\nfunction attrFunctionNS(fullname, interpolate$$1, value) {\n var value00,\n value10,\n interpolate0;\n return function() {\n var value0, value1 = value(this);\n if (value1 == null) return void this.removeAttributeNS(fullname.space, fullname.local);\n value0 = this.getAttributeNS(fullname.space, fullname.local);\n return value0 === value1 ? null\n : value0 === value00 && value1 === value10 ? interpolate0\n : interpolate0 = interpolate$$1(value00 = value0, value10 = value1);\n };\n}\n\nvar transition_attr = function(name, value) {\n var fullname = d3Selection.namespace(name), i = fullname === "transform" ? d3Interpolate.interpolateTransformSvg : interpolate;\n return this.attrTween(name, typeof value === "function"\n ? (fullname.local ? attrFunctionNS : attrFunction)(fullname, i, tweenValue(this, "attr." + name, value))\n : value == null ? (fullname.local ? attrRemoveNS : attrRemove)(fullname)\n : (fullname.local ? attrConstantNS : attrConstant)(fullname, i, value + ""));\n};\n\nfunction attrTweenNS(fullname, value) {\n function tween() {\n var node = this, i = value.apply(node, arguments);\n return i && function(t) {\n node.setAttributeNS(fullname.space, fullname.local, i(t));\n };\n }\n tween._value = value;\n return tween;\n}\n\nfunction attrTween(name, value) {\n function tween() {\n var node = this, i = value.apply(node, arguments);\n return i && function(t) {\n node.setAttribute(name, i(t));\n };\n }\n tween._value = value;\n return tween;\n}\n\nvar transition_attrTween = function(name, value) {\n var key = "attr." + name;\n if (arguments.length < 2) return (key = this.tween(key)) && key._value;\n if (value == null) return this.tween(key, null);\n if (typeof value !== "function") throw new Error;\n var fullname = d3Selection.namespace(name);\n return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value));\n};\n\nfunction delayFunction(id, value) {\n return function() {\n init(this, id).delay = +value.apply(this, arguments);\n };\n}\n\nfunction delayConstant(id, value) {\n return value = +value, function() {\n init(this, id).delay = value;\n };\n}\n\nvar transition_delay = function(value) {\n var id = this._id;\n\n return arguments.length\n ? this.each((typeof value === "function"\n ? delayFunction\n : delayConstant)(id, value))\n : get(this.node(), id).delay;\n};\n\nfunction durationFunction(id, value) {\n return function() {\n set(this, id).duration = +value.apply(this, arguments);\n };\n}\n\nfunction durationConstant(id, value) {\n return value = +value, function() {\n set(this, id).duration = value;\n };\n}\n\nvar transition_duration = function(value) {\n var id = this._id;\n\n return arguments.length\n ? this.each((typeof value === "function"\n ? durationFunction\n : durationConstant)(id, value))\n : get(this.node(), id).duration;\n};\n\nfunction easeConstant(id, value) {\n if (typeof value !== "function") throw new Error;\n return function() {\n set(this, id).ease = value;\n };\n}\n\nvar transition_ease = function(value) {\n var id = this._id;\n\n return arguments.length\n ? this.each(easeConstant(id, value))\n : get(this.node(), id).ease;\n};\n\nvar transition_filter = function(match) {\n if (typeof match !== "function") match = d3Selection.matcher(match);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {\n if ((node = group[i]) && match.call(node, node.__data__, i, group)) {\n subgroup.push(node);\n }\n }\n }\n\n return new Transition(subgroups, this._parents, this._name, this._id);\n};\n\nvar transition_merge = function(transition) {\n if (transition._id !== this._id) throw new Error;\n\n for (var groups0 = this._groups, groups1 = transition._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {\n for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {\n if (node = group0[i] || group1[i]) {\n merge[i] = node;\n }\n }\n }\n\n for (; j < m0; ++j) {\n merges[j] = groups0[j];\n }\n\n return new Transition(merges, this._parents, this._name, this._id);\n};\n\nfunction start(name) {\n return (name + "").trim().split(/^|\\s+/).every(function(t) {\n var i = t.indexOf(".");\n if (i >= 0) t = t.slice(0, i);\n return !t || t === "start";\n });\n}\n\nfunction onFunction(id, name, listener) {\n var on0, on1, sit = start(name) ? init : set;\n return function() {\n var schedule = sit(this, id),\n on = schedule.on;\n\n // If this node shared a dispatch with the previous node,\n // just assign the updated shared dispatch and we’re done!\n // Otherwise, copy-on-write.\n if (on !== on0) (on1 = (on0 = on).copy()).on(name, listener);\n\n schedule.on = on1;\n };\n}\n\nvar transition_on = function(name, listener) {\n var id = this._id;\n\n return arguments.length < 2\n ? get(this.node(), id).on.on(name)\n : this.each(onFunction(id, name, listener));\n};\n\nfunction removeFunction(id) {\n return function() {\n var parent = this.parentNode;\n for (var i in this.__transition) if (+i !== id) return;\n if (parent) parent.removeChild(this);\n };\n}\n\nvar transition_remove = function() {\n return this.on("end.remove", removeFunction(this._id));\n};\n\nvar transition_select = function(select) {\n var name = this._name,\n id = this._id;\n\n if (typeof select !== "function") select = d3Selection.selector(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {\n if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {\n if ("__data__" in node) subnode.__data__ = node.__data__;\n subgroup[i] = subnode;\n schedule(subgroup[i], name, id, i, subgroup, get(node, id));\n }\n }\n }\n\n return new Transition(subgroups, this._parents, name, id);\n};\n\nvar transition_selectAll = function(select) {\n var name = this._name,\n id = this._id;\n\n if (typeof select !== "function") select = d3Selection.selectorAll(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n for (var children = select.call(node, node.__data__, i, group), child, inherit = get(node, id), k = 0, l = children.length; k < l; ++k) {\n if (child = children[k]) {\n schedule(child, name, id, k, children, inherit);\n }\n }\n subgroups.push(children);\n parents.push(node);\n }\n }\n }\n\n return new Transition(subgroups, parents, name, id);\n};\n\nvar Selection = d3Selection.selection.prototype.constructor;\n\nvar transition_selection = function() {\n return new Selection(this._groups, this._parents);\n};\n\nfunction styleRemove(name, interpolate$$1) {\n var value00,\n value10,\n interpolate0;\n return function() {\n var value0 = d3Selection.style(this, name),\n value1 = (this.style.removeProperty(name), d3Selection.style(this, name));\n return value0 === value1 ? null\n : value0 === value00 && value1 === value10 ? interpolate0\n : interpolate0 = interpolate$$1(value00 = value0, value10 = value1);\n };\n}\n\nfunction styleRemoveEnd(name) {\n return function() {\n this.style.removeProperty(name);\n };\n}\n\nfunction styleConstant(name, interpolate$$1, value1) {\n var value00,\n interpolate0;\n return function() {\n var value0 = d3Selection.style(this, name);\n return value0 === value1 ? null\n : value0 === value00 ? interpolate0\n : interpolate0 = interpolate$$1(value00 = value0, value1);\n };\n}\n\nfunction styleFunction(name, interpolate$$1, value) {\n var value00,\n value10,\n interpolate0;\n return function() {\n var value0 = d3Selection.style(this, name),\n value1 = value(this);\n if (value1 == null) value1 = (this.style.removeProperty(name), d3Selection.style(this, name));\n return value0 === value1 ? null\n : value0 === value00 && value1 === value10 ? interpolate0\n : interpolate0 = interpolate$$1(value00 = value0, value10 = value1);\n };\n}\n\nvar transition_style = function(name, value, priority) {\n var i = (name += "") === "transform" ? d3Interpolate.interpolateTransformCss : interpolate;\n return value == null ? this\n .styleTween(name, styleRemove(name, i))\n .on("end.style." + name, styleRemoveEnd(name))\n : this.styleTween(name, typeof value === "function"\n ? styleFunction(name, i, tweenValue(this, "style." + name, value))\n : styleConstant(name, i, value + ""), priority);\n};\n\nfunction styleTween(name, value, priority) {\n function tween() {\n var node = this, i = value.apply(node, arguments);\n return i && function(t) {\n node.style.setProperty(name, i(t), priority);\n };\n }\n tween._value = value;\n return tween;\n}\n\nvar transition_styleTween = function(name, value, priority) {\n var key = "style." + (name += "");\n if (arguments.length < 2) return (key = this.tween(key)) && key._value;\n if (value == null) return this.tween(key, null);\n if (typeof value !== "function") throw new Error;\n return this.tween(key, styleTween(name, value, priority == null ? "" : priority));\n};\n\nfunction textConstant(value) {\n return function() {\n this.textContent = value;\n };\n}\n\nfunction textFunction(value) {\n return function() {\n var value1 = value(this);\n this.textContent = value1 == null ? "" : value1;\n };\n}\n\nvar transition_text = function(value) {\n return this.tween("text", typeof value === "function"\n ? textFunction(tweenValue(this, "text", value))\n : textConstant(value == null ? "" : value + ""));\n};\n\nvar transition_transition = function() {\n var name = this._name,\n id0 = this._id,\n id1 = newId();\n\n for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n var inherit = get(node, id0);\n schedule(node, name, id1, i, group, {\n time: inherit.time + inherit.delay + inherit.duration,\n delay: 0,\n duration: inherit.duration,\n ease: inherit.ease\n });\n }\n }\n }\n\n return new Transition(groups, this._parents, name, id1);\n};\n\nvar id = 0;\n\nfunction Transition(groups, parents, name, id) {\n this._groups = groups;\n this._parents = parents;\n this._name = name;\n this._id = id;\n}\n\nfunction transition(name) {\n return d3Selection.selection().transition(name);\n}\n\nfunction newId() {\n return ++id;\n}\n\nvar selection_prototype = d3Selection.selection.prototype;\n\nTransition.prototype = transition.prototype = {\n constructor: Transition,\n select: transition_select,\n selectAll: transition_selectAll,\n filter: transition_filter,\n merge: transition_merge,\n selection: transition_selection,\n transition: transition_transition,\n call: selection_prototype.call,\n nodes: selection_prototype.nodes,\n node: selection_prototype.node,\n size: selection_prototype.size,\n empty: selection_prototype.empty,\n each: selection_prototype.each,\n on: transition_on,\n attr: transition_attr,\n attrTween: transition_attrTween,\n style: transition_style,\n styleTween: transition_styleTween,\n text: transition_text,\n remove: transition_remove,\n tween: transition_tween,\n delay: transition_delay,\n duration: transition_duration,\n ease: transition_ease\n};\n\nvar defaultTiming = {\n time: null, // Set on use.\n delay: 0,\n duration: 250,\n ease: d3Ease.easeCubicInOut\n};\n\nfunction inherit(node, id) {\n var timing;\n while (!(timing = node.__transition) || !(timing = timing[id])) {\n if (!(node = node.parentNode)) {\n return defaultTiming.time = d3Timer.now(), defaultTiming;\n }\n }\n return timing;\n}\n\nvar selection_transition = function(name) {\n var id,\n timing;\n\n if (name instanceof Transition) {\n id = name._id, name = name._name;\n } else {\n id = newId(), (timing = defaultTiming).time = d3Timer.now(), name = name == null ? null : name + "";\n }\n\n for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n schedule(node, name, id, i, group, timing || inherit(node, id));\n }\n }\n }\n\n return new Transition(groups, this._parents, name, id);\n};\n\nd3Selection.selection.prototype.interrupt = selection_interrupt;\nd3Selection.selection.prototype.transition = selection_transition;\n\nvar root = [null];\n\nvar active = function(node, name) {\n var schedules = node.__transition,\n schedule,\n i;\n\n if (schedules) {\n name = name == null ? null : name + "";\n for (i in schedules) {\n if ((schedule = schedules[i]).state > SCHEDULED && schedule.name === name) {\n return new Transition([[node]], root, name, +i);\n }\n }\n }\n\n return null;\n};\n\nexports.transition = transition;\nexports.active = active;\nexports.interrupt = interrupt;\n\nObject.defineProperty(exports, \'__esModule\', { value: true });\n\n})));\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/d3-transition/build/d3-transition.js\n// module id = 30\n// module chunks = 0\n//# sourceURL=webpack:///./~/d3-transition/build/d3-transition.js?')},function(module,exports,__webpack_require__){eval("// https://d3js.org/d3-timer/ Version 1.0.6. Copyright 2017 Mike Bostock.\n(function (global, factory) {\n\t true ? factory(exports) :\n\ttypeof define === 'function' && define.amd ? define(['exports'], factory) :\n\t(factory((global.d3 = global.d3 || {})));\n}(this, (function (exports) { 'use strict';\n\nvar frame = 0;\nvar timeout = 0;\nvar interval = 0;\nvar pokeDelay = 1000;\nvar taskHead;\nvar taskTail;\nvar clockLast = 0;\nvar clockNow = 0;\nvar clockSkew = 0;\nvar clock = typeof performance === \"object\" && performance.now ? performance : Date;\nvar setFrame = typeof window === \"object\" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) { setTimeout(f, 17); };\n\nfunction now() {\n return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);\n}\n\nfunction clearNow() {\n clockNow = 0;\n}\n\nfunction Timer() {\n this._call =\n this._time =\n this._next = null;\n}\n\nTimer.prototype = timer.prototype = {\n constructor: Timer,\n restart: function(callback, delay, time) {\n if (typeof callback !== \"function\") throw new TypeError(\"callback is not a function\");\n time = (time == null ? now() : +time) + (delay == null ? 0 : +delay);\n if (!this._next && taskTail !== this) {\n if (taskTail) taskTail._next = this;\n else taskHead = this;\n taskTail = this;\n }\n this._call = callback;\n this._time = time;\n sleep();\n },\n stop: function() {\n if (this._call) {\n this._call = null;\n this._time = Infinity;\n sleep();\n }\n }\n};\n\nfunction timer(callback, delay, time) {\n var t = new Timer;\n t.restart(callback, delay, time);\n return t;\n}\n\nfunction timerFlush() {\n now(); // Get the current time, if not already set.\n ++frame; // Pretend we’ve set an alarm, if we haven’t already.\n var t = taskHead, e;\n while (t) {\n if ((e = clockNow - t._time) >= 0) t._call.call(null, e);\n t = t._next;\n }\n --frame;\n}\n\nfunction wake() {\n clockNow = (clockLast = clock.now()) + clockSkew;\n frame = timeout = 0;\n try {\n timerFlush();\n } finally {\n frame = 0;\n nap();\n clockNow = 0;\n }\n}\n\nfunction poke() {\n var now = clock.now(), delay = now - clockLast;\n if (delay > pokeDelay) clockSkew -= delay, clockLast = now;\n}\n\nfunction nap() {\n var t0, t1 = taskHead, t2, time = Infinity;\n while (t1) {\n if (t1._call) {\n if (time > t1._time) time = t1._time;\n t0 = t1, t1 = t1._next;\n } else {\n t2 = t1._next, t1._next = null;\n t1 = t0 ? t0._next = t2 : taskHead = t2;\n }\n }\n taskTail = t0;\n sleep(time);\n}\n\nfunction sleep(time) {\n if (frame) return; // Soonest alarm already set, or will be.\n if (timeout) timeout = clearTimeout(timeout);\n var delay = time - clockNow;\n if (delay > 24) {\n if (time < Infinity) timeout = setTimeout(wake, delay);\n if (interval) interval = clearInterval(interval);\n } else {\n if (!interval) clockLast = clockNow, interval = setInterval(poke, pokeDelay);\n frame = 1, setFrame(wake);\n }\n}\n\nvar timeout$1 = function(callback, delay, time) {\n var t = new Timer;\n delay = delay == null ? 0 : +delay;\n t.restart(function(elapsed) {\n t.stop();\n callback(elapsed + delay);\n }, delay, time);\n return t;\n};\n\nvar interval$1 = function(callback, delay, time) {\n var t = new Timer, total = delay;\n if (delay == null) return t.restart(callback, delay, time), t;\n delay = +delay, time = time == null ? now() : +time;\n t.restart(function tick(elapsed) {\n elapsed += total;\n t.restart(tick, total += delay, time);\n callback(elapsed);\n }, delay, time);\n return t;\n};\n\nexports.now = now;\nexports.timer = timer;\nexports.timerFlush = timerFlush;\nexports.timeout = timeout$1;\nexports.interval = interval$1;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n})));\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/d3-timer/build/d3-timer.js\n// module id = 31\n// module chunks = 0\n//# sourceURL=webpack:///./~/d3-timer/build/d3-timer.js?"); | |
}])}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment