diff --git a/d3-legend.js b/d3-legend.js index 818f470..9206a55 100644 --- a/d3-legend.js +++ b/d3-legend.js @@ -464,11 +464,11 @@ })); },{}],2:[function(require,module,exports){ -// https://d3js.org/d3-collection/ Version 1.0.2. Copyright 2016 Mike Bostock. +// https://d3js.org/d3-collection/ Version 1.0.4. Copyright 2017 Mike Bostock. (function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : - typeof define === 'function' && define.amd ? define(['exports'], factory) : - (factory((global.d3 = global.d3 || {}))); + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (factory((global.d3 = global.d3 || {}))); }(this, (function (exports) { 'use strict'; var prefix = "$"; @@ -553,10 +553,10 @@ var nest = function() { nest; function apply(array, depth, createResult, setResult) { - if (depth >= keys.length) return rollup != null - ? rollup(array) : (sortValues != null - ? array.sort(sortValues) - : array); + if (depth >= keys.length) { + if (sortValues != null) array.sort(sortValues); + return rollup != null ? rollup(array) : array; + } var i = -1, n = array.length, @@ -683,11 +683,11 @@ Object.defineProperty(exports, '__esModule', { value: true }); }))); },{}],3:[function(require,module,exports){ -// https://d3js.org/d3-color/ Version 1.0.2. Copyright 2016 Mike Bostock. +// https://d3js.org/d3-color/ Version 1.0.3. Copyright 2017 Mike Bostock. (function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : - typeof define === 'function' && define.amd ? define(['exports'], factory) : - (factory((global.d3 = global.d3 || {}))); + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (factory((global.d3 = global.d3 || {}))); }(this, (function (exports) { 'use strict'; var define = function(constructor, factory, prototype) { @@ -1634,11 +1634,11 @@ Object.defineProperty(exports, '__esModule', { value: true }); })); },{}],6:[function(require,module,exports){ -// https://d3js.org/d3-interpolate/ Version 1.1.2. Copyright 2016 Mike Bostock. +// https://d3js.org/d3-interpolate/ Version 1.1.5. Copyright 2017 Mike Bostock. (function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-color')) : - typeof define === 'function' && define.amd ? define(['exports', 'd3-color'], factory) : - (factory((global.d3 = global.d3 || {}),global.d3)); + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-color')) : + typeof define === 'function' && define.amd ? define(['exports', 'd3-color'], factory) : + (factory((global.d3 = global.d3 || {}),global.d3)); }(this, (function (exports,d3Color) { 'use strict'; function basis(t1, v0, v1, v2, v3) { @@ -1707,14 +1707,14 @@ function nogamma(a, b) { return d ? linear(a, d) : constant(isNaN(a) ? b : a); } -var rgb$1 = (function rgbGamma(y) { +var rgb$1 = ((function rgbGamma(y) { var color$$1 = gamma(y); function rgb$$1(start, end) { var r = color$$1((start = d3Color.rgb(start)).r, (end = d3Color.rgb(end)).r), g = color$$1(start.g, end.g), b = color$$1(start.b, end.b), - opacity = color$$1(start.opacity, end.opacity); + opacity = nogamma(start.opacity, end.opacity); return function(t) { start.r = r(t); start.g = g(t); @@ -1727,7 +1727,7 @@ var rgb$1 = (function rgbGamma(y) { rgb$$1.gamma = rgbGamma; return rgb$$1; -})(1); +}))(1); function rgbSpline(spline) { return function(colors) { @@ -1880,7 +1880,7 @@ var value = function(a, b) { : b instanceof d3Color.color ? rgb$1 : b instanceof Date ? date : Array.isArray(b) ? array - : isNaN(b) ? object + : typeof b.valueOf !== "function" && typeof b.toString !== "function" || isNaN(b) ? object : number)(a, b); }; @@ -4058,11 +4058,11 @@ Object.defineProperty(exports, '__esModule', { value: true }); })); },{}],9:[function(require,module,exports){ -// https://d3js.org/d3-time-format/ Version 2.0.3. Copyright 2016 Mike Bostock. +// https://d3js.org/d3-time-format/ Version 2.1.0. Copyright 2017 Mike Bostock. (function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-time')) : - typeof define === 'function' && define.amd ? define(['exports', 'd3-time'], factory) : - (factory((global.d3 = global.d3 || {}),global.d3)); + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-time')) : + typeof define === 'function' && define.amd ? define(['exports', 'd3-time'], factory) : + (factory((global.d3 = global.d3 || {}),global.d3)); }(this, (function (exports,d3Time) { 'use strict'; function localDate(d) { @@ -4116,6 +4116,7 @@ function formatLocale(locale) { "c": null, "d": formatDayOfMonth, "e": formatDayOfMonth, + "f": formatMicroseconds, "H": formatHour24, "I": formatHour12, "j": formatDayOfYear, @@ -4123,9 +4124,13 @@ function formatLocale(locale) { "m": formatMonthNumber, "M": formatMinutes, "p": formatPeriod, + "Q": formatUnixTimestamp, + "s": formatUnixTimestampSeconds, "S": formatSeconds, + "u": formatWeekdayNumberMonday, "U": formatWeekNumberSunday, - "w": formatWeekdayNumber, + "V": formatWeekNumberISO, + "w": formatWeekdayNumberSunday, "W": formatWeekNumberMonday, "x": null, "X": null, @@ -4143,6 +4148,7 @@ function formatLocale(locale) { "c": null, "d": formatUTCDayOfMonth, "e": formatUTCDayOfMonth, + "f": formatUTCMicroseconds, "H": formatUTCHour24, "I": formatUTCHour12, "j": formatUTCDayOfYear, @@ -4150,9 +4156,13 @@ function formatLocale(locale) { "m": formatUTCMonthNumber, "M": formatUTCMinutes, "p": formatUTCPeriod, + "Q": formatUnixTimestamp, + "s": formatUnixTimestampSeconds, "S": formatUTCSeconds, + "u": formatUTCWeekdayNumberMonday, "U": formatUTCWeekNumberSunday, - "w": formatUTCWeekdayNumber, + "V": formatUTCWeekNumberISO, + "w": formatUTCWeekdayNumberSunday, "W": formatUTCWeekNumberMonday, "x": null, "X": null, @@ -4170,6 +4180,7 @@ function formatLocale(locale) { "c": parseLocaleDateTime, "d": parseDayOfMonth, "e": parseDayOfMonth, + "f": parseMicroseconds, "H": parseHour24, "I": parseHour24, "j": parseDayOfYear, @@ -4177,9 +4188,13 @@ function formatLocale(locale) { "m": parseMonthNumber, "M": parseMinutes, "p": parsePeriod, + "Q": parseUnixTimestamp, + "s": parseUnixTimestampSeconds, "S": parseSeconds, + "u": parseWeekdayNumberMonday, "U": parseWeekNumberSunday, - "w": parseWeekdayNumber, + "V": parseWeekNumberISO, + "w": parseWeekdayNumberSunday, "W": parseWeekNumberMonday, "x": parseLocaleDate, "X": parseLocaleTime, @@ -4228,16 +4243,38 @@ function formatLocale(locale) { function newParse(specifier, newDate) { return function(string) { var d = newYear(1900), - i = parseSpecifier(d, specifier, string += "", 0); + i = parseSpecifier(d, specifier, string += "", 0), + week, day; if (i != string.length) return null; + // If a UNIX timestamp is specified, return it. + if ("Q" in d) return new Date(d.Q); + // The am-pm flag is 0 for AM, and 1 for PM. if ("p" in d) d.H = d.H % 12 + d.p * 12; // Convert day-of-week and week-of-year to day-of-year. - if ("W" in d || "U" in d) { - if (!("w" in d)) d.w = "W" in d ? 1 : 0; - var day = "Z" in d ? utcDate(newYear(d.y)).getUTCDay() : newDate(newYear(d.y)).getDay(); + if ("V" in d) { + if (d.V < 1 || d.V > 53) return null; + if (!("w" in d)) d.w = 1; + if ("Z" in d) { + week = utcDate(newYear(d.y)), day = week.getUTCDay(); + week = day > 4 || day === 0 ? d3Time.utcMonday.ceil(week) : d3Time.utcMonday(week); + week = d3Time.utcDay.offset(week, (d.V - 1) * 7); + d.y = week.getUTCFullYear(); + d.m = week.getUTCMonth(); + d.d = week.getUTCDate() + (d.w + 6) % 7; + } else { + week = newDate(newYear(d.y)), day = week.getDay(); + week = day > 4 || day === 0 ? d3Time.timeMonday.ceil(week) : d3Time.timeMonday(week); + week = d3Time.timeDay.offset(week, (d.V - 1) * 7); + d.y = week.getFullYear(); + d.m = week.getMonth(); + d.d = week.getDate() + (d.w + 6) % 7; + } + } else if ("W" in d || "U" in d) { + if (!("w" in d)) d.w = "u" in d ? d.u % 7 : "W" in d ? 1 : 0; + day = "Z" in d ? utcDate(newYear(d.y)).getUTCDay() : newDate(newYear(d.y)).getDay(); d.m = 0; d.d = "W" in d ? (d.w + 6) % 7 + d.W * 7 - (day + 5) % 7 : d.w + d.U * 7 - (day + 6) % 7; } @@ -4381,7 +4418,7 @@ function formatLocale(locale) { var pads = {"-": "", "_": " ", "0": "0"}; var numberRe = /^\s*\d+/; var percentRe = /^%/; -var requoteRe = /[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g; +var requoteRe = /[\\^$*+?|[\]().{}]/g; function pad(value, fill, width) { var sign = value < 0 ? "-" : "", @@ -4404,18 +4441,28 @@ function formatLookup(names) { return map; } -function parseWeekdayNumber(d, string, i) { +function parseWeekdayNumberSunday(d, string, i) { var n = numberRe.exec(string.slice(i, i + 1)); return n ? (d.w = +n[0], i + n[0].length) : -1; } +function parseWeekdayNumberMonday(d, string, i) { + var n = numberRe.exec(string.slice(i, i + 1)); + return n ? (d.u = +n[0], i + n[0].length) : -1; +} + function parseWeekNumberSunday(d, string, i) { - var n = numberRe.exec(string.slice(i)); + var n = numberRe.exec(string.slice(i, i + 2)); return n ? (d.U = +n[0], i + n[0].length) : -1; } +function parseWeekNumberISO(d, string, i) { + var n = numberRe.exec(string.slice(i, i + 2)); + return n ? (d.V = +n[0], i + n[0].length) : -1; +} + function parseWeekNumberMonday(d, string, i) { - var n = numberRe.exec(string.slice(i)); + var n = numberRe.exec(string.slice(i, i + 2)); return n ? (d.W = +n[0], i + n[0].length) : -1; } @@ -4430,7 +4477,7 @@ function parseYear(d, string, i) { } function parseZone(d, string, i) { - var n = /^(Z)|([+-]\d\d)(?:\:?(\d\d))?/.exec(string.slice(i, i + 6)); + var n = /^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(string.slice(i, i + 6)); return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || "00")), i + n[0].length) : -1; } @@ -4469,11 +4516,26 @@ function parseMilliseconds(d, string, i) { return n ? (d.L = +n[0], i + n[0].length) : -1; } +function parseMicroseconds(d, string, i) { + var n = numberRe.exec(string.slice(i, i + 6)); + return n ? (d.L = Math.floor(n[0] / 1000), i + n[0].length) : -1; +} + function parseLiteralPercent(d, string, i) { var n = percentRe.exec(string.slice(i, i + 1)); return n ? i + n[0].length : -1; } +function parseUnixTimestamp(d, string, i) { + var n = numberRe.exec(string.slice(i)); + return n ? (d.Q = +n[0], i + n[0].length) : -1; +} + +function parseUnixTimestampSeconds(d, string, i) { + var n = numberRe.exec(string.slice(i)); + return n ? (d.Q = (+n[0]) * 1000, i + n[0].length) : -1; +} + function formatDayOfMonth(d, p) { return pad(d.getDate(), p, 2); } @@ -4494,6 +4556,10 @@ function formatMilliseconds(d, p) { return pad(d.getMilliseconds(), p, 3); } +function formatMicroseconds(d, p) { + return formatMilliseconds(d, p) + "000"; +} + function formatMonthNumber(d, p) { return pad(d.getMonth() + 1, p, 2); } @@ -4506,11 +4572,22 @@ function formatSeconds(d, p) { return pad(d.getSeconds(), p, 2); } +function formatWeekdayNumberMonday(d) { + var day = d.getDay(); + return day === 0 ? 7 : day; +} + function formatWeekNumberSunday(d, p) { return pad(d3Time.timeSunday.count(d3Time.timeYear(d), d), p, 2); } -function formatWeekdayNumber(d) { +function formatWeekNumberISO(d, p) { + var day = d.getDay(); + d = (day >= 4 || day === 0) ? d3Time.timeThursday(d) : d3Time.timeThursday.ceil(d); + return pad(d3Time.timeThursday.count(d3Time.timeYear(d), d) + (d3Time.timeYear(d).getDay() === 4), p, 2); +} + +function formatWeekdayNumberSunday(d) { return d.getDay(); } @@ -4553,6 +4630,10 @@ function formatUTCMilliseconds(d, p) { return pad(d.getUTCMilliseconds(), p, 3); } +function formatUTCMicroseconds(d, p) { + return formatUTCMilliseconds(d, p) + "000"; +} + function formatUTCMonthNumber(d, p) { return pad(d.getUTCMonth() + 1, p, 2); } @@ -4565,11 +4646,22 @@ function formatUTCSeconds(d, p) { return pad(d.getUTCSeconds(), p, 2); } +function formatUTCWeekdayNumberMonday(d) { + var dow = d.getUTCDay(); + return dow === 0 ? 7 : dow; +} + function formatUTCWeekNumberSunday(d, p) { return pad(d3Time.utcSunday.count(d3Time.utcYear(d), d), p, 2); } -function formatUTCWeekdayNumber(d) { +function formatUTCWeekNumberISO(d, p) { + var day = d.getUTCDay(); + d = (day >= 4 || day === 0) ? d3Time.utcThursday(d) : d3Time.utcThursday.ceil(d); + return pad(d3Time.utcThursday.count(d3Time.utcYear(d), d) + (d3Time.utcYear(d).getUTCDay() === 4), p, 2); +} + +function formatUTCWeekdayNumberSunday(d) { return d.getUTCDay(); } @@ -4593,7 +4685,15 @@ function formatLiteralPercent() { return "%"; } -var locale$1; +function formatUnixTimestamp(d) { + return +d; +} + +function formatUnixTimestampSeconds(d) { + return Math.floor(+d / 1000); +} + +var locale; @@ -4611,12 +4711,12 @@ defaultLocale({ }); function defaultLocale(definition) { - locale$1 = formatLocale(definition); - exports.timeFormat = locale$1.format; - exports.timeParse = locale$1.parse; - exports.utcFormat = locale$1.utcFormat; - exports.utcParse = locale$1.utcParse; - return locale$1; + locale = formatLocale(definition); + exports.timeFormat = locale.format; + exports.timeParse = locale.parse; + exports.utcFormat = locale.utcFormat; + exports.utcParse = locale.utcParse; + return locale; } var isoSpecifier = "%Y-%m-%dT%H:%M:%S.%LZ"; @@ -4648,11 +4748,11 @@ Object.defineProperty(exports, '__esModule', { value: true }); }))); },{"d3-time":10}],10:[function(require,module,exports){ -// https://d3js.org/d3-time/ Version 1.0.4. Copyright 2016 Mike Bostock. +// https://d3js.org/d3-time/ Version 1.0.7. Copyright 2017 Mike Bostock. (function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : - typeof define === 'function' && define.amd ? define(['exports'], factory) : - (factory((global.d3 = global.d3 || {}))); + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (factory((global.d3 = global.d3 || {}))); }(this, (function (exports) { 'use strict'; var t0 = new Date; @@ -4693,7 +4793,13 @@ function newInterval(floori, offseti, count, field) { return newInterval(function(date) { if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1); }, function(date, step) { - if (date >= date) while (--step >= 0) while (offseti(date, 1), !test(date)) {} // eslint-disable-line no-empty + if (date >= date) { + if (step < 0) while (++step <= 0) { + while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty + } else while (--step >= 0) { + while (offseti(date, +1), !test(date)) {} // eslint-disable-line no-empty + } + } }); }; @@ -5091,7 +5197,7 @@ function color() { var cellEnter = cell.enter().append("g").attr("class", classPrefix + "cell"); cellEnter.append(shape).attr("class", classPrefix + "swatch"); - var shapes = svg.selectAll("g." + classPrefix + "cell " + shape).data(type.data); + var shapes = svg.selectAll("g." + classPrefix + "cell " + shape + "." + classPrefix + "swatch").data(type.data); //add event handlers _legend2.default.d3_addEvents(cellEnter, legendDispatcher); @@ -5135,20 +5241,18 @@ function color() { //positions cells and text if (orient === "vertical") { - (function () { - var cellSize = textSize.map(function (d, i) { - return Math.max(d.height, shapeSize[i].height); - }); + var cellSize = textSize.map(function (d, i) { + return Math.max(d.height, shapeSize[i].height); + }); - cellTrans = function cellTrans(d, i) { - var height = (0, _d3Array.sum)(cellSize.slice(0, i)); - return 'translate(0, ' + (height + i * shapePadding) + ')'; - }; + cellTrans = function cellTrans(d, i) { + var height = (0, _d3Array.sum)(cellSize.slice(0, i)); + return 'translate(0, ' + (height + i * shapePadding) + ')'; + }; - textTrans = function textTrans(d, i) { - return 'translate( ' + (shapeSize[i].width + shapeSize[i].x + labelOffset) + ', ' + (shapeSize[i].y + shapeSize[i].height / 2 + 5) + ')'; - }; - })(); + textTrans = function textTrans(d, i) { + return 'translate( ' + (shapeSize[i].width + shapeSize[i].x + labelOffset) + ', ' + (shapeSize[i].y + shapeSize[i].height / 2 + 5) + ')'; + }; } else if (orient === "horizontal") { cellTrans = function cellTrans(d, i) { return 'translate(' + i * (shapeSize[i].width + shapePadding) + ',0)'; @@ -5648,7 +5752,7 @@ function size() { var cellEnter = cell.enter().append("g").attr("class", classPrefix + "cell"); cellEnter.append(shape).attr("class", classPrefix + "swatch"); - var shapes = svg.selectAll("g." + classPrefix + "cell " + shape); + var shapes = svg.selectAll("g." + classPrefix + "cell " + shape + "." + classPrefix + "swatch"); //add event handlers _legend2.default.d3_addEvents(cellEnter, legendDispatcher); @@ -5701,36 +5805,32 @@ function size() { //positions cells and text if (orient === "vertical") { - (function () { - var cellSize = textSize.map(function (d, i) { - return Math.max(d.height, shapeSize[i].height); - }); - var y = shape == "circle" || shape == "line" ? shapeSize[0].height / 2 : 0; - cellTrans = function cellTrans(d, i) { - var height = (0, _d3Array.sum)(cellSize.slice(0, i)); + var cellSize = textSize.map(function (d, i) { + return Math.max(d.height, shapeSize[i].height); + }); + var y = shape == "circle" || shape == "line" ? shapeSize[0].height / 2 : 0; + cellTrans = function cellTrans(d, i) { + var height = (0, _d3Array.sum)(cellSize.slice(0, i)); - return "translate(0, " + (y + height + i * shapePadding) + ")"; - }; + return "translate(0, " + (y + height + i * shapePadding) + ")"; + }; - textTrans = function textTrans(d, i) { - return "translate( " + (maxW + labelOffset) + ",\n " + (shapeSize[i].y + shapeSize[i].height / 2 + 5) + ")"; - }; - })(); + textTrans = function textTrans(d, i) { + return "translate( " + (maxW + labelOffset) + ",\n " + (shapeSize[i].y + shapeSize[i].height / 2 + 5) + ")"; + }; } else if (orient === "horizontal") { - (function () { - cellTrans = function cellTrans(d, i) { - var width = (0, _d3Array.sum)(shapeSize.slice(0, i), function (d) { - return d.width; - }); - var y = shape == "circle" || shape == "line" ? maxH / 2 : 0; - return "translate(" + (width + i * shapePadding) + ", " + y + ")"; - }; + cellTrans = function cellTrans(d, i) { + var width = (0, _d3Array.sum)(shapeSize.slice(0, i), function (d) { + return d.width; + }); + var y = shape == "circle" || shape == "line" ? maxH / 2 : 0; + return "translate(" + (width + i * shapePadding) + ", " + y + ")"; + }; - var offset = shape == "line" ? maxH / 2 : maxH; - textTrans = function textTrans(d, i) { - return "translate( " + (shapeSize[i].width * textAlign + shapeSize[i].x) + ",\n " + (offset + labelOffset) + ")"; - }; - })(); + var offset = shape == "line" ? maxH / 2 : maxH; + textTrans = function textTrans(d, i) { + return "translate( " + (shapeSize[i].width * textAlign + shapeSize[i].x) + ",\n " + (offset + labelOffset) + ")"; + }; } _legend2.default.d3_placement(orient, cell, cellTrans, text, textTrans, labelAlign); @@ -5924,7 +6024,7 @@ function symbol() { var cellEnter = cell.enter().append("g").attr("class", classPrefix + "cell"); cellEnter.append(shape).attr("class", classPrefix + "swatch"); - var shapes = svg.selectAll("g." + classPrefix + "cell " + shape); + var shapes = svg.selectAll("g." + classPrefix + "cell " + shape + "." + classPrefix + "swatch"); //add event handlers _legend2.default.d3_addEvents(cellEnter, legendDispatcher); @@ -5962,19 +6062,17 @@ function symbol() { //positions cells and text if (orient === "vertical") { - (function () { - var cellSize = textSize.map(function (d, i) { - return Math.max(maxH, d.height); - }); + var cellSize = textSize.map(function (d, i) { + return Math.max(maxH, d.height); + }); - cellTrans = function cellTrans(d, i) { - var height = (0, _d3Array.sum)(cellSize.slice(0, i)); - return "translate(0, " + (height + i * shapePadding) + " )"; - }; - textTrans = function textTrans(d, i) { - return "translate( " + (maxW + labelOffset) + ",\n " + (shapeSize[i].y + shapeSize[i].height / 2 + 5) + ")"; - }; - })(); + cellTrans = function cellTrans(d, i) { + var height = (0, _d3Array.sum)(cellSize.slice(0, i)); + return "translate(0, " + (height + i * shapePadding) + " )"; + }; + textTrans = function textTrans(d, i) { + return "translate( " + (maxW + labelOffset) + ",\n " + (shapeSize[i].y + shapeSize[i].height / 2 + 5) + ")"; + }; } else if (orient === "horizontal") { cellTrans = function cellTrans(d, i) { return "translate( " + i * (maxW + shapePadding) + ",0)"; @@ -6127,4 +6225,4 @@ d3.legendSymbol = _symbol2.default; d3.legendHelpers = _helpers2.default; },{"./color":11,"./helpers":12,"./size":14,"./symbol":15}]},{},[16]) -//# sourceMappingURL=data:application/json;charset:utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJub2RlX21vZHVsZXMvZDMtYXJyYXkvYnVpbGQvZDMtYXJyYXkuanMiLCJub2RlX21vZH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tID0gMCxcbiAgICAgICAgYSxcbiAgICAgICAgZCxcbiAgICAgICAgcyA9IDAsXG4gICAgICAgIGkgPSAtMSxcbiAgICAgICAgaiA9IDA7XG5cbiAgICBpZiAoZiA9PSBudWxsKSB7XG4gICAgICB3aGlsZSAoKytpIDwgbikge1xuICAgICAgICBpZiAoIWlzTmFOKGEgPSBudW1iZXIoYXJyYXlbaV0pKSkge1xuICAgICAgICAgIGQgPSBhIC0gbTtcbiAgICAgICAgICBtICs9IGQgLyArK2o7XG4gICAgICAgICAgcyArPSBkICogKGEgLSBtKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cblxuICAgIGVsc2Uge1xuICAgICAgd2hpbGUgKCsraSA8IG4pIHtcbiAgICAgICAgaWYgKCFpc05hTihhID0gbnVtYmVyKGYoYXJyYXlbaV0sIGksIGFycmF5KSkpKSB7XG4gICAgICAgICAgZCA9IGEgLSBtO1xuICAgICAgICAgIG0gKz0gZCAvICsrajtcbiAgICAgICAgICBzICs9IGQgKiAoYSAtIG0pO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuXG4gICAgaWYgKGogPiAxKSByZXR1cm4gcyAvIChqIC0gMSk7XG4gIH1cblxuICBmdW5jdGlvbiBkZXZpYXRpb24oYXJyYXksIGYpIHtcbiAgICB2YXIgdiA9IHZhcmlhbmNlKGFycmF5LCBmKTtcbiAgICByZXR1cm4gdiA/IE1hdGguc3FydCh2KSA6IHY7XG4gIH1cblxuICBmdW5jdGlvbiBleHRlbnQoYXJyYXksIGYpIHtcbiAgICB2YXIgaSA9IC0xLFxuICAgICAgICBuID0gYXJyYXkubGVuZ3RoLFxuICAgICAgICBhLFxuICAgICAgICBiLFxuICAgICAgICBjO1xuXG4gICAgaWYgKGYgPT0gbnVsbCkge1xuICAgICAgd2hpbGUgKCsraSA8IG4pIGlmICgoYiA9IGFycmF5W2ldKSAhPSBudWxsICYmIGIgPj0gYikgeyBhID0gYyA9IGI7IGJyZWFrOyB9XG4gICAgICB3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XkgPSBkICsgXCJcIiwgaSA9IGluZGV4LmdldChrZXkpO1xuICAgICAgaWYgKCFpKSB7XG4gICAgICAgIGlmICh1bmtub3duICE9PSBpbXBsaWNpdCkgcmV0dXJuIHVua25vd247XG4gICAgICAgIGluZGV4LnNldChrZXksIGkgPSBkb21haW4ucHVzaChkKSk7XG4gICAgICB9XG4gICAgICByZXR1cm4gcmFuZ2VbKGkgLSAxKSAlIHJhbmdlLmxlbmd0aF07XG4gICAgfVxuXG4gICAgc2NhbGUuZG9tYWluID0gZnVuY3Rpb24oXykge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gZG9tYWluLnNsaWNlKCk7XG4gICAgICBkb21haW4gPSBbXSwgaW5kZXggPSBkM0NvbGxlY3Rpb24ubWFwKCk7XG4gICAgICB2YXIgaSA9IC0xLCBuID0gXy5sZW5ndGgsIGQsIGtleTtcbiAgICAgIHdoaWxlICgrK2kgPCBuKSBpZiAoIWluZGV4LmhhcyhrZXkgPSAoZCA9IF9baV0pICsgXCJcIikpIGluZGV4LnNldChrZXksIGRvbWFpbi5wdXNoKGQpKTtcbiAgICAgIHJldHVybiBzY2FsZTtcbiAgICB9O1xuXG4gICAgc2NhbGUucmFuZ2UgPSBmdW5jdGlvbihfKSB7XG4gICAgICByZXR1cm4gYXJndW1lbnRzLmxlbmd0aCA/IChyYW5nZSA9IHNsaWNlLmNhbGwoXyksIHNjYWxlKSA6IHJhbmdlLnNsaWNlKCk7XG4gICAgfTtcblxuICAgIHNjYWxlLnVua25vd24gPSBmdW5jdGlvbihfKSB7XG4gICAgICByZXR1cm4gYXJndW1lbnRzLmxlbmd0aCA/ICh1bmtub3duID0gXywgc2NhbGUpIDogdW5rbm93bjtcbiAgICB9O1xuXG4gICAgc2NhbGUuY29weSA9IGZ1bmN0aW9uKCkge1xuICAgICAgcmV0dXJuIG9yZGluYWwoKVxuICAgICAgICAgIC5kb21haW4oZG9tYWluKVxuICAgICAgICAgIC5yYW5nZSh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c2NhbGU7XG4gICAgfVxuXG4gICAgc2NhbGUuYmFzZSA9IGZ1bmN0aW9uKF8pIHtcbiAgICAgIHJldHVybiBhcmd1bWVudHMubGVuZ3RoID8gKGJhc2UgPSArXywgcmVzY2FsZSgpKSA6IGJhc2U7XG4gICAgfTtcblxuICAgIHNjYWxlLmRvbWFpbiA9IGZ1bmN0aW9uKF8pIHtcbiAgICAgIHJldHVybiBhcmd1bWVudHMubGVuZ3RoID8gKGRvbWFpbihfKSwgcmVzY2FsZSgpKSA6IGRvbWFpbigpO1xuICAgIH07XG5cbiAgICBzY2FsZS50aWNrcyA9IGZ1bmN0aW9uKGNvdW50KSB7XG4gICAgICB2YXIgZCA9IGRvbWFpbigpLFxuICAgICAgICAgIHUgPSBkWzBdLFxuICAgICAgICAgIHYgPSBkW2QubGVuZ3RoIC0gMV0sXG4gICAgICAgICAgcjtcblxuICAgICAgaWYgKHIgPSB2IDwgdSkgaSA9IHUsIHUgPSB2LCB2ID0gaTtcblxuICAgICAgdmFyIGkgPSBsb2dzKHUpLFxuICAgICAgICAgIGogPSBsb2dzKHYpLFxuICAgICAgICAgIHAsXG4gICAgICAgICAgayxcbiAgICAgICAgICB0LFxuICAgICAgICAgIG4gPSBjb3VudCA9PSBudWxsID8gMTAgOiArY291bnQsXG4gICAgICAgICAgeiA9IFtdO1xuXG4gICAgICBpZiAoIShiYXNlICUgMSkgJiYgaiAtIGkgPCBuKSB7XG4gICAgICAgIGkgPSBNYXRoLnJvdW5kKGkpIC0gMSwgaiA9IE1hdGgucm91bmQoaikgKyAxO1xuICAgICAgICBpZiAodSA+IDApIGZvciAoOyBpIDwgajsgKytpKSB7XG4gICAgICAgICAgZm9yIChrID0gMSwgcCA9IHBvd3MoaSk7IGsgPCBiYXNlOyArK2spIHtcbiAgICAgICAgICAgIHQgPSBwICogaztcbiAgICAgICAgICAgIGlmICh0IDwgdSkgY29udGludWU7XG4gICAgICAgICAgICBpZiAodCA+IHYpIGJyZWFrO1xuICAgICAgICAgICAgei5wdXNoKHQpO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIGZvciAoOyBpIDwgajsgKytpKSB7XG4gICAgICAgICAgZm9yIChrID0gYmFzZSAtIDEsIHAgPSBwb3dzKGkpOyBrID49IDE7IC0taykge1xuICAgICAgICAgICAgdCA9IHAgKiBrO1xuICAgICAgICAgICAgaWYgKHQgPCB1KSBjb250aW51ZTtcbiAgICAgICAgICAgIGlmICh0ID4gdikgYnJlYWs7XG4gICAgICAgICAgICB6LnB1c2godCk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICB6ID0gZDNBcnJheS50aWNrcyhpLCBqLCBNYXRoLm1pbihqIC0gaSwgbikpLm1hcChwb3dzKTtcbiAgICAgIH1cblxuICAgICAgcmV0dXJuIHIgPyB6LnJldmVyc2UoKSA6IHo7XG4gICAgfTtcblxuICAgIHNjYWxlLnRpY2tGb3JtYXQgPSBmdW5jdGlvbihjb3VudCwgc3BlY2lmaWVyKSB7XG4gICAgICBpZiAoc3BlY2lmaWVyID09IG51bGwpIHNwZWNpZmllciA9IGJhc2UgPT09IDEwID8gXCIuMGVcIiA6IFwiLFwiO1xuICAgICAgaWYgKHR5cGVvZiBzcGVjaWZpZXIgIT09IFwiZnVuY3Rpb25cIikgc3BlY2lmaWVyID0gZDNGb3JtYXQuZm9ybWF0KHNwZWNpZmllcik7XG4gICAgICBpZiAoY291bnQgPT09IEluZmluaXR5KSByZXR1cm4gc3BlY2lmaWVyO1xuICAgICAgaWYgKGNvdW50ID09IG51bGwpIGNvdW50ID0gMTA7XG4gICAgICB2YXIgayA9IE1hdGgubWF4KDEsIGJhc2UgKiBjb3VudCAvIHNjYWxlLnRpY2tzKCkubGVuZ3RoKTsgLy8gVE9ETyBmYXN0IGVzdGltYXRlP1xuICAgICAgcmV0dXJuIGZ1bmN0aW9uKGQpIHtcbiAgICAgICAgdmFyIGkgPSBkIC8gcG93cyhNYXRoLnJvdW5kKG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IGRhdGUgPyBmb3JtYXREYXkgOiBmb3JtYXRXZWVrKVxuICAgICAgICAgIDogeWVhcihkYXRlKSA8IGRhdGUgPyBmb3JtYXRNb250aFxuICAgICAgICAgIDogZm9ybWF0WWVhcikoZGF0ZSk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gdGlja0ludGVydmFsKGludGVydmFsLCBzdGFydCwgc3RvcCwgc3RlcCkge1xuICAgICAgaWYgKGludGVydmFsID09IG51bGwpIGludGVydmFsID0gMTA7XG5cbiAgICAgIC8vIElmIGEgZGVzaXJlZCB0aWNrIGNvdW50IGlzIHNwZWNpZmllZCwgcGljayBhIHJlYXNvbmFibGUgdGljayBpbnRlcnZhbFxuICAgICAgLy8gYmFzZWQgb24gdGhlIGV4dGVudCBvZiB0aGUgZG9tYWluIGFuZCBhIHJvdWdoIGVzdGltYXRlIG9mIHRpY2sgc2l6ZS5cbiAgICAgIC8vIE90aGVyd2lzZSwgYXNzdW1lIGludGVydmFsIGlzIGFscmVhZHkgYSB0aW1lIGludGVydmFsIGFuZCB1c2UgaXQuXG4gICAgICBpZiAodHlwZW9mIGludGVydmFsID09PSBcIm51bWJlclwiKSB7XG4gICAgICAgIHZhciB0YXJnZXQgPSBNYXRoLmFicyhzdG9wIC0gc3RhcnQpIC8gaW50ZXJ2YWwsXG4gICAgICAgICAgICBpID0gZDNBcnJheS5iaXNlY3RvcihmdW5jdGlvbihpKSB7IHJldHVybiBpWzJdOyB9KS5yaWdodCh0aWNrSW50ZXJ2YWxzLCB0YXJnZXQpO1xuICAgICAgICBpZiAoaSA9PT0gdGlja0ludGVydmFscy5sZW5ndGgpIHtcbiAgICAgICAgICBzdGVwID0gZDNBcnJheS50aWNrU3RlcChzdGFydCAvIGR1cmF0aW9uWWVhciwgc3RvcCAvIGR1cmF0aW9uWWVhciwgaW50ZXJ2YWwpO1xuICAgICAgICAgIGludGVydmFsID0geWVhcjtcbiAgICAgICAgfSBlbHNlIGlmIChpKSB7XG4gICAgICAgICAgaS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biAgfVxuXG4gIGZ1bmN0aW9uIHZhcmlhbmNlKGFycmF5LCBmKSB7XG4gICAgdmFyIG4gPSBhcnJheS5sZW5ndGgsXG4gICAgICAgIG0gPSAwLFxuICAgICAgICBhLFxuICAgICAgICBkLFxuICAgICAgICBzID0gMCxcbiAgICAgICAgaSA9IC0xLFxuICAgICAgICBqID0gMDtcblxuICAgIGlmIChmID09IG51bGwpIHtcbiAgICAgIHdoaWxlICgrK2kgPCBuKSB7XG4gICAgICAgIGlmICghaXNOYU4oYSA9IG51bWJlcihhcnJheVtpXSkpKSB7XG4gICAgICAgICAgZCA9IGEgLSBtO1xuICAgICAgICAgIG0gKz0gZCAvICsrajtcbiAgICAgICAgICBzICs9IGQgKiAoYSAtIG0pO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuXG4gICAgZWxzZSB7XG4gICAgICB3aGlsZSAoKytpIDwgbikge1xuICAgICAgICBpZiAoIWlzTmFOKGEgPSBudW1iZXIoZihhcnJheVtpXSwgaSwgYXJyYXkpKSkpIHtcbiAgICAgICAgICBkID0gYSAtIG07XG4gICAgICAgICAgbSArPSBkIC8gKytqO1xuICAgICAgICAgIHMgKz0gZCAqIChhIC0gbSk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9XG5cbiAgICBpZiAoaiA+IDEpIHJldHVybiBzIC8gKGogLSAxKTtcbiAgfVxuXG4gIGZ1bmN0aW9uIGRldmlhdGlvbihhcnJheSwgZikge1xuICAgIHZhciB2ID0gdmFyaWFuY2UoYXJyYXksIGYpO1xuICAgIHJldHVybiB2ID8gTWF0aC5zcXJ0KHYpIDogdjtcbiAgfVxuXG4gIGZ1bmN0aW9uIGV4dGVudChhcnJheSwgZikge1xuICAgIHZhciBpID0gLTEsXG4gICAgICAgIG4gPSBhcnJheS5sZW5ndGgsXG4gICAgICAgIGEsXG4gICAgICAgIGIsXG4gICAgICAgIGM7XG5cbiAgICBpZiAoZiA9PSBudWxsKSB7XG4gICAgICB3aGlsZSAoK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VuY3Rpb24odCkge1xuICAgICAgcmV0dXJuIFtcbiAgICAgICAgdXgwICsgdCAqIGR4LFxuICAgICAgICB1eTAgKyB0ICogZHksXG4gICAgICAgIHcwICogTWF0aC5leHAocmhvICogdCAqIFMpXG4gICAgICBdO1xuICAgIH07XG4gIH1cblxuICAvLyBHZW5lcmFsIGNhc2UuXG4gIGVsc2Uge1xuICAgIHZhciBkMSA9IE1hdGguc3FydChkMiksXG4gICAgICAgIGIwID0gKHcxICogdzEgLSB3MCAqIHcwICsgcmhvNCAqIGQyKSAvICgyICogdzAgKiByaG8yICogZDEpLFxuICAgICAgICBiMSA9ICh3MSAqIHcxIC0gdzAgKiB3MCAtIHJobzQgKiBkMikgLyAoMiAqIHcxICogcmhvMiAqIGQxKSxcbiAgICAgICAgcjAgPSBNYXRoLmxvZyhNYXRoLnNxcnQoYjAgKiBiMCArIDEpIC0gYjApLFxuICAgICAgICByMSA9IE1hdGgubG9nKE1hdGguc3FydChiMSAqIGIxICsgMSkgLSBiMSk7XG4gICAgUyA9IChyMSAtIHIwKSAvIHJobztcbiAgICBpID0gZnVuY3Rpb24odCkge1xuICAgICAgdmFyIHMgPSB0ICogUyxcbiAgICAgICAgICBjb3NocjAgPSBjb3NoKHIwKSxcbiAgICAgICAgICB1ID0gdzAgLyAocmhvMiAqIGQxKSAqIChjb3NocjAgKiB0YW5oKHJobyAqIHMgKyByMCkgLSBzaW5oKHIwKSk7XG4gICAgICByZXR1cm4gW1xuICAgICAgICB1eDAgKyB1ICogZHgsXG4gICAgICAgIHV5MCArIHUgKiBkeSxcbiAgICAgICAgdzAgKiBjb3NocjAgLyBjb3NoKHJobyAqIHMgKyByMClcbiAgICAgIF07XG4gICAgfTtcbiAgfVxuXG4gIGkuZHVyYXRpb24gPSBTICogMTAwMDtcblxuICByZXR1cm4gaTtcbn07XG5cbmZ1bmN0aW9uIGhzbCQxKGh1ZSQkMSkge1xuICByZXR1cm4gZnVuY3Rpb24oc3RhcnQsIGVuZCkge1xuIC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yYW5nZSA9IGZ1bmN0aW9uKF8pIHtcbiAgICAgIHJldHVybiBhcmd1bWVudHMubGVuZ3RoID8gKHJhbmdlID0gc2xpY2UuY2FsbChfKSwgc2NhbGUpIDogcmFuZ2Uuc2xpY2UoKTtcbiAgICB9O1xuXG4gICAgc2NhbGUudW5rbm93biA9IGZ1bmN0aW9uKF8pIHtcbiAgICAgIHJldHVybiBhcmd1bWVudHMubGVuZ3RoID8gKHVua25vd24gPSBfLCBzY2FsZSkgOiB1bmtub3duO1xuICAgIH07XG5cbiAgICBzY2FsZS5jb3B5ID0gZnVuY3Rpb24oKSB7XG4gICAgICByZXR1cm4gb3JkaW5hbCgpXG4gICAgICAgICAgLmRvbWFpbihkb21haW4pXG4gICAgICAgICAgLnJhbmdlKHJhbmdlKVxuICAgICAgICAgIC51bmtub3duKHVua25vd24pO1xuICAgIH07XG5cbiAgICByZXR1cm4gc2NhbGU7XG4gIH1cblxuICBmdW5jdGlvbiBiYW5kKCkge1xuICAgIHZhciBzY2FsZSA9IG9yZGluYWwoKS51bmtub3duKHVuZGVmaW5lZCksXG4gICAgICAgIGRvbWFpbiA9IHNjYWxlLmRvbWFpbixcbiAgICAgICAgb3JkaW5hbFJhbmdlID0gc2NhbGUucmFuZ2UsXG4gICAgICAgIHJhbmdlID0gWzAsIDFdLFxuICAgICAgICBzdGVwLFxuICAgICAgICBiYW5kd2lkdGgsXG4gICAgICAgIHJvdW5kID0gZmFsc2UsXG4gICAgICAgIHBhZGRpbmdJbm5lciA9IDAsXG4gICAgICAgIHBhZGRpbmdPdXRlciA9IDAsXG4gICAgICAgIGFsaWduID0gMC41O1xuXG4gICAgZGVsZXRlIHNjYWxlLnVua25vd247XG5cbiAgICBmdW5jdGlvbiByZXNjYWxlKCkge1xuICAgICAgdmFyIG4gPSBkb21haW4oKS5sZW5ndGgsXG4gICAgICAgICAgcmV2ZXJzZSA9IHJhbmdlWzFdIDwgcmFuZ2VbMF0sXG4gICAgICAgICAgc3RhcnQgPSByYW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HNjYWxlID0gY29udGludW91cyhkZWludGVycG9sYXRlJDEsIHJlaW50ZXJwb2xhdGUpLmRvbWFpbihbMSwgMTBdKSxcbiAgICAgICAgZG9tYWluID0gc2NhbGUuZG9tYWluLFxuICAgICAgICBiYXNlID0gMTAsXG4gICAgICAgIGxvZ3MgPSBsb2dwKDEwKSxcbiAgICAgICAgcG93cyA9IHBvd3AoMTApO1xuXG4gICAgZnVuY3Rpb24gcmVzY2FsZSgpIHtcbiAgICAgIGxvZ3MgPSBsb2dwKGJhc2UpLCBwb3dzID0gcG93cChiYXNlKTtcbiAgICAgIGlmIChkb21haW4oKVswXSA8IDApIGxvZ3MgPSByZWZsZWN0KGxvZ3MpLCBwb3dzID0gcmVmbGVjdChwb3dzKTtcbiAgICAgIHJldHVybiBzY2FsZTtcbiAgICB9XG5cbiAgICBzY2FsZS5iYXNlID0gZnVuY3Rpb24oXykge1xuICAgICAgcmV0dXJuIGFyZ3VtZW50cy5sZW5ndGggPyAoYmFzZSA9ICtfLCByZXNjYWxlKCkpIDogYmFzZTtcbiAgICB9O1xuXG4gICAgc2NhbGUuZG9tYWluID0gZnVuY3Rpb24oXykge1xuICAgICAgcmV0dXJuIGFyZ3VtZW50cy5sZW5ndGggPyAoZG9tYWluKF8pLCByZXNjYWxlKCkpIDogZG9tYWluKCk7XG4gICAgfTtcblxuICAgIHNjYWxlLnRpY2tzID0gZnVuY3Rpb24oY291bnQpIHtcbiAgICAgIHZhciBkID0gZG9tYWluKCksXG4gICAgICAgICAgdSA9IGRbMF0sXG4gICAgICAgICAgdiA9IGRbZC5sZW5ndGggLSAxXSxcbiAgICAgICAgICByO1xuXG4gICAgICBpZiAociA9IHYgPCB1KSBpID0gdSwgdSA9IHYsIHYgPSBpO1xuXG4gICAgICB2YXIgaSA9IGxvZ3ModSksXG4gICAgICAgICAgaiA9IGxvZ3ModiksXG4gICAgICAgICAgcCxcbiAgICAgICAgICBrLFxuICAgICAgICAgIHQsXG4gICAgICAgICAgbiA9IGNvdW50ID09IG51bGwgPyAxMCA6ICtjb3VudCxcbiAgICAgICAgICB6ID0gW107XG5cbiAgICAgIGlmICghKGJhc2UgJSAxKSAmJiBqIC0gaSA8IG4pIHtcbiAgICAgICAgaSA9IE1hdGgucm91bmQoaSkgLSAxLCBqID0gTWF0aC5yb3VuZChqKSArIDE7XG4gICAgICAgIGlmICh1ID4gMCkgZm9yICg7IGkgPCBqOyArK2kpIHtcbiAgICAgICAgICBmb3IgKGsgPSAxLCBwID0gcG93cyhpKTsgayA8IGJhc2U7ICsraykge1xuICAgICAgICAgICAgdCA9IHAgKiBrO1xuICAgICAgICAgICAgaWYgKHQgPCB1KSBjb250aW51ZTtcbiAgICAgICAgICAgIGlmICh0ID4gdikgYnJlYWs7XG4gICAgICAgICAgICB6LnB1c2godCk7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2UgZm9yICg7IGkgPCBqOyArK2kpIHtcbiAgICAgICAgICBmb3IgKGsgPSBiYXNlIC0gMSwgcCA9IHBvd3MoaSk7IGsgPj0gMTsgLS1rKSB7XG4gICAgICAgICAgICB0ID0gcCAqIGs7XG4gICAgICAgICAgICBpZiAodCA8IHUpIGNvbnRpbnVlO1xuICAgICAgICAgICAgaWYgKHQgPiB2KSBicmVhaztcbiAgICAgICAgICAgIHoucHVzaCh0KTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIHogPSBkM0FycmF5LnRpY2tzKGksIGosIE1hdGgubWluKGogLSBpLCBuKSkubWFwKHBvd3MpO1xuICAgICAgfVxuXG4gICAgICByZXR1cm4gciA/IHoucmV2ZXJzZSgpIDogejtcbiAgICB9O1xuXG4gICAgc2NhbGUudGlja0Zvcm1hdCA9IGZ1bmN0aW9uKGNvdW50LCBzcGVjaWZpZXIpIHtcbiAgICAgIGlmIChzcGVjaWZpZXIgPT0gbnVsbCkgc3BlY2lmaWVyID0gYmFzZSA9PT0gMTAgPyBcIi4wZVwiIDogXCIsXCI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MCA/IC1NYXRoLnBvdygteCwgZXhwb25lbnQpIDogTWF0aC5wb3coeCwgZXhwb25lbnQpO1xuICB9XG5cbiAgZnVuY3Rpb24gcG93KCkge1xuICAgIHZhciBleHBvbmVudCA9IDEsXG4gICAgICAgIHNjYWxlID0gY29udGludW91cyhkZWludGVycG9sYXRlLCByZWludGVycG9sYXRlKSxcbiAgICAgICAgZG9tYWluID0gc2NhbGUuZG9tYWluO1xuXG4gICAgZnVuY3Rpb24gZGVpbnRlcnBvbGF0ZShhLCBiKSB7XG4gICAgICByZXR1cm4gKGIgPSByYWlzZShiLCBleHBvbmVudCkgLSAoYSA9IHJhaXNlKGEsIGV4cG9uZW50KSkpXG4gICAgICAgICAgPyBmdW5jdGlvbih4KSB7IHJldHVybiAocmFpc2UoeCwgZXhwb25lbnQpIC0gYSkgLyBiOyB9XG4gICAgICAgICAgOiBjb25zdGFudChiKTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiByZWludGVycG9sYXRlKGEsIGIpIHtcbiAgICAgIGIgPSByYWlzZShiLCBleHBvbmVudCkgLSAoYSA9IHJhaXNlKGEsIGV4cG9uZW50KSk7XG4gICAgICByZXR1cm4gZnVuY3Rpb24odCkgeyByZXR1cm4gcmFpc2UoYSArIGIgKiB0LCAxIC8gZXhwb25lbnQpOyB9O1xuICAgIH1cblxuICAgIHNjYWxlLmV4cG9uZW50ID0gZnVuY3Rpb24oXykge1xuICAgICAgcmV0dXJuIGFyZ3VtZW50cy5sZW5ndGggPyAoZXhwb25lbnQgPSArXywgZG9tYWluKGRvbWFpbigpKSkgOiBleHBvbmVudDtcbiAgICB9O1xuXG4gICAgc2NhbGUuY29weSA9IGZ1bmN0aW9uKCkge1xuICAgICAgcmV0dXJuIGNvcHkoc2NhbGUsIHBvdygpLmV4cG9uZW50KGV4cG9uZW50KSk7XG4gICAgfTtcblxuICAgIHJldHVybiBsaW5lYXJpc2goc2NhbGUpO1xuICB9XG5cbiAgZnVuY3Rpb24gc3FydCgpIHtc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0KGxpbmUuam9pbihcIiBcIikpO1xuICAgICAgICBsaW5lID0gW3dvcmRdO1xuICAgICAgICB0c3BhbiA9IHRleHQuYXBwZW5kKFwidHNwYW5cIilcbiAgICAgICAgICAuYXR0cihcInhcIiwgMClcbiAgICAgICAgICAuYXR0cihcImR5XCIsIGxpbmVIZWlnaHQgKyBkeSArIFwiZW1cIikudGV4dCh3b3JkKTtcbiAgICAgIH1cbiAgICB9XG4gIH0pO1xufVxuXG5cbmNvbnN0IGQzX21lcmdlTGFiZWxzID0gKGdlbj1bXSwgbGFiZWxzLCBkb21haW4sIHJhbmdlKSA9PiB7XG5cbiAgICBpZiAodHlwZW9mIGxhYmVscyA9PT0gXCJvYmplY3RcIil7XG4gICAgICBpZihsYWJlbHMubGVuZ3RoID09PSAwKSByZXR1cm4gZ2VuO1xuXG4gICAgICBsZXQgaSA9IGxhYmVscy5sZW5ndGg7XG4gICAgICBmb3IgKDsgaSA8IGdlbi5sZW5ndGg7IGkrKykge1xuICAgICAgICBsYWJlbHMucHVzaChnZW5baV0pO1xuICAgICAgfVxuICAgICAgcmV0dXJuIGxhYmVscztcbiAgICB9IGVsc2UgaWYgKHR5cGVvZiBsYWJlbHMgPT09IFwiZnVuY3Rpb25cIikge1xuICAgICAgY29uc3QgY3VzdG9tTGFiZWxzID0gW11cbiAgICAgIGNvbnN0IGdlbkxlbmd0aCA9IGdlbi5sZW5ndGhcbiAgICAgIGZvciAobGV0IGk9MDsgaSA8IGdlbkxlbmd0aDsgaSsrKXtcbiAgICAgICAgY3VzdG9tTGFiZWxzLnB1c2gobGFiZWxzKHtcbiAgICAgICAgICBpLFxuICAgICAgICAgIGdlbkxlbmd0aCxcbiAgICAgICAgICBnZW5lcmF0ZWRMYWJlbHMgOiBnZW4sXG4gICAgICAgICAgZG9tYWluLFxuICAgICAgICAgIHJhbmdlIH0pKVxuICAgICAgfVxuICAgICAgcmV0dXJuIGN1c3RvbUxhYmVsc1xuICAgIH1cblxuICAgIHJldHVybiBnZW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pemUgPSBzaXplXG5kMy5sZWdlbmRTeW1ib2wgPSBzeW1ib2xcbmQzLmxlZ2VuZEhlbHBlcnMgPSBoZWxwZXJzXG4iXX0= diff --git a/d3-legend.min.js b/d3-legend.min.js index 7a7bb82..4ebc8f3 100644 --- a/d3-legend.min.js +++ b/d3-legend.min.js @@ -1,3 +1,3 @@ -!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;gb?1:a>=b?0:NaN}function c(a){return 1===a.length&&(a=d(a)),{left:function(b,c,d,e){for(null==d&&(d=0),null==e&&(e=b.length);d>>1;a(b[f],c)<0?d=f+1:e=f}return d},right:function(b,c,d,e){for(null==d&&(d=0),null==e&&(e=b.length);d>>1;a(b[f],c)>0?e=f:d=f+1}return d}}}function d(a){return function(c,d){return b(a(c),d)}}function e(a,b){return ba?1:b>=a?0:NaN}function f(a){return null===a?NaN:+a}function g(a,b){var c,d,e=a.length,g=0,h=0,i=-1,j=0;if(null==b)for(;++i1)return h/(j-1)}function h(a,b){var c=g(a,b);return c?Math.sqrt(c):c}function i(a,b){var c,d,e,f=-1,g=a.length;if(null==b){for(;++f=d){c=e=d;break}for(;++fd&&(c=d),e=d){c=e=d;break}for(;++fd&&(c=d),e=M?e*=10:f>=N?e*=5:f>=O&&(e*=2),b=k;)l.pop(),--n;var o,p=new Array(n+1);for(e=0;e<=n;++e)o=p[e]=[],o.x0=e>0?l[e-1]:j,o.x1=e=1)return+c(a[d-1],d-1,a);var d,e=(d-1)*b,g=Math.floor(e),h=+c(a[g],g,a),i=+c(a[g+1],g+1,a);return h+(i-h)*(e-g)}}function r(a,c,d){return a=L.call(a,f).sort(b),Math.ceil((d-c)/(2*(q(a,.75)-q(a,.25))*Math.pow(a.length,-1/3)))}function s(a,b,c){return Math.ceil((c-b)/(3.5*h(a)*Math.pow(a.length,-1/3)))}function t(a,b){var c,d,e=-1,f=a.length;if(null==b){for(;++e=d){c=d;break}for(;++ec&&(c=d)}else{for(;++e=d){c=d;break}for(;++ec&&(c=d)}return c}function u(a,b){var c,d=0,e=a.length,g=-1,h=e;if(null==b)for(;++g=0;)for(d=a[e],b=d.length;--b>=0;)c[--g]=d[b];return c}function x(a,b){var c,d,e=-1,f=a.length;if(null==b){for(;++e=d){c=d;break}for(;++ed&&(c=d)}else{for(;++e=d){c=d;break}for(;++ed&&(c=d)}return c}function y(a){for(var b=0,c=a.length-1,d=a[0],e=new Array(c<0?0:c);b=k.length)return null!=i?i(b):null!=h?b.sort(h):b;for(var g,j,l,m=-1,n=b.length,o=k[d++],p=c(),q=e();++mk.length)return a;var d,e=l[c-1];return null!=i&&c>=k.length?d=a.entries():(d=[],a.each(function(a,e){d.push({key:e,values:b(a,c)})})),null!=e?d.sort(function(a,b){return e(a.key,b.key)}):d}var h,i,j,k=[],l=[];return j={object:function(b){return a(b,0,d,e)},map:function(b){return a(b,0,f,g)},entries:function(c){return b(a(c,0,f,g),0)},key:function(a){return k.push(a),j},sortKeys:function(a){return l[k.length-1]=a,j},sortValues:function(a){return h=a,j},rollup:function(a){return i=a,j}}},l=c.prototype;h.prototype=i.prototype={constructor:h,has:l.has,add:function(a){return a+="",this[j+a]=a,this},remove:l.remove,clear:l.clear,values:l.keys,size:l.size,empty:l.empty,each:l.each};var m=function(a){var b=[];for(var c in a)b.push(c);return b},n=function(a){var b=[];for(var c in a)b.push(a[c]);return b},o=function(a){var b=[];for(var c in a)b.push({key:c,value:a[c]});return b};a.nest=k,a.set=i,a.map=c,a.keys=m,a.values=n,a.entries=o,Object.defineProperty(a,"__esModule",{value:!0})})},{}],3:[function(a,b,c){!function(a,d){"object"==typeof c&&"undefined"!=typeof b?d(c):"function"==typeof define&&define.amd?define(["exports"],d):d(a.d3=a.d3||{})}(this,function(a){"use strict";function b(a,b){var c=Object.create(a.prototype);for(var d in b)c[d]=b[d];return c}function c(){}function d(a){var b;return a=(a+"").trim().toLowerCase(),(b=H.exec(a))?(b=parseInt(b[1],16),new i(b>>8&15|b>>4&240,b>>4&15|240&b,(15&b)<<4|15&b,1)):(b=I.exec(a))?e(parseInt(b[1],16)):(b=J.exec(a))?new i(b[1],b[2],b[3],1):(b=K.exec(a))?new i(255*b[1]/100,255*b[2]/100,255*b[3]/100,1):(b=L.exec(a))?f(b[1],b[2],b[3],b[4]):(b=M.exec(a))?f(255*b[1]/100,255*b[2]/100,255*b[3]/100,b[4]):(b=N.exec(a))?j(b[1],b[2]/100,b[3]/100,1):(b=O.exec(a))?j(b[1],b[2]/100,b[3]/100,b[4]):P.hasOwnProperty(a)?e(P[a]):"transparent"===a?new i(NaN,NaN,NaN,0):null}function e(a){return new i(a>>16&255,a>>8&255,255&a,1)}function f(a,b,c,d){return d<=0&&(a=b=c=NaN),new i(a,b,c,d)}function g(a){return a instanceof c||(a=d(a)),a?(a=a.rgb(),new i(a.r,a.g,a.b,a.opacity)):new i}function h(a,b,c,d){return 1===arguments.length?g(a):new i(a,b,c,null==d?1:d)}function i(a,b,c,d){this.r=+a,this.g=+b,this.b=+c,this.opacity=+d}function j(a,b,c,d){return d<=0?a=b=c=NaN:c<=0||c>=1?a=b=NaN:b<=0&&(a=NaN),new m(a,b,c,d)}function k(a){if(a instanceof m)return new m(a.h,a.s,a.l,a.opacity);if(a instanceof c||(a=d(a)),!a)return new m;if(a instanceof m)return a;a=a.rgb();var b=a.r/255,e=a.g/255,f=a.b/255,g=Math.min(b,e,f),h=Math.max(b,e,f),i=NaN,j=h-g,k=(h+g)/2;return j?(i=b===h?(e-f)/j+6*(e0&&k<1?0:i,new m(i,j,k,a.opacity)}function l(a,b,c,d){return 1===arguments.length?k(a):new m(a,b,c,null==d?1:d)}function m(a,b,c,d){this.h=+a,this.s=+b,this.l=+c,this.opacity=+d}function n(a,b,c){return 255*(a<60?b+(c-b)*a/60:a<180?c:a<240?b+(c-b)*(240-a)/60:b)}function o(a){if(a instanceof q)return new q(a.l,a.a,a.b,a.opacity);if(a instanceof x){var b=a.h*Q;return new q(a.l,Math.cos(b)*a.c,Math.sin(b)*a.c,a.opacity)}a instanceof i||(a=g(a));var c=u(a.r),d=u(a.g),e=u(a.b),f=r((.4124564*c+.3575761*d+.1804375*e)/T),h=r((.2126729*c+.7151522*d+.072175*e)/U),j=r((.0193339*c+.119192*d+.9503041*e)/V);return new q(116*h-16,500*(f-h),200*(h-j),a.opacity)}function p(a,b,c,d){return 1===arguments.length?o(a):new q(a,b,c,null==d?1:d)}function q(a,b,c,d){this.l=+a,this.a=+b,this.b=+c,this.opacity=+d}function r(a){return a>Z?Math.pow(a,1/3):a/Y+W}function s(a){return a>X?a*a*a:Y*(a-W)}function t(a){return 255*(a<=.0031308?12.92*a:1.055*Math.pow(a,1/2.4)-.055)}function u(a){return(a/=255)<=.04045?a/12.92:Math.pow((a+.055)/1.055,2.4)}function v(a){if(a instanceof x)return new x(a.h,a.c,a.l,a.opacity);a instanceof q||(a=o(a));var b=Math.atan2(a.b,a.a)*R;return new x(b<0?b+360:b,Math.sqrt(a.a*a.a+a.b*a.b),a.l,a.opacity)}function w(a,b,c,d){return 1===arguments.length?v(a):new x(a,b,c,null==d?1:d)}function x(a,b,c,d){this.h=+a,this.c=+b,this.l=+c,this.opacity=+d}function y(a){if(a instanceof A)return new A(a.h,a.s,a.l,a.opacity);a instanceof i||(a=g(a));var b=a.r/255,c=a.g/255,d=a.b/255,e=(fa*d+da*b-ea*c)/(fa+da-ea),f=d-e,h=(ca*(c-e)-aa*f)/ba,j=Math.sqrt(h*h+f*f)/(ca*e*(1-e)),k=j?Math.atan2(h,f)*R-120:NaN;return new A(k<0?k+360:k,j,e,a.opacity)}function z(a,b,c,d){return 1===arguments.length?y(a):new A(a,b,c,null==d?1:d)}function A(a,b,c,d){this.h=+a,this.s=+b,this.l=+c,this.opacity=+d}var B=function(a,b,c){a.prototype=b.prototype=c,c.constructor=a},C=.7,D=1/C,E="\\s*([+-]?\\d+)\\s*",F="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",G="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",H=/^#([0-9a-f]{3})$/,I=/^#([0-9a-f]{6})$/,J=new RegExp("^rgb\\("+[E,E,E]+"\\)$"),K=new RegExp("^rgb\\("+[G,G,G]+"\\)$"),L=new RegExp("^rgba\\("+[E,E,E,F]+"\\)$"),M=new RegExp("^rgba\\("+[G,G,G,F]+"\\)$"),N=new RegExp("^hsl\\("+[F,G,G]+"\\)$"),O=new RegExp("^hsla\\("+[F,G,G,F]+"\\)$"),P={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};B(c,d,{displayable:function(){return this.rgb().displayable()},toString:function(){return this.rgb()+""}}),B(i,h,b(c,{brighter:function(a){return a=null==a?D:Math.pow(D,a),new i(this.r*a,this.g*a,this.b*a,this.opacity)},darker:function(a){return a=null==a?C:Math.pow(C,a),new i(this.r*a,this.g*a,this.b*a,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},toString:function(){var a=this.opacity;return a=isNaN(a)?1:Math.max(0,Math.min(1,a)),(1===a?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===a?")":", "+a+")")}})),B(m,l,b(c,{brighter:function(a){return a=null==a?D:Math.pow(D,a),new m(this.h,this.s,this.l*a,this.opacity)},darker:function(a){return a=null==a?C:Math.pow(C,a),new m(this.h,this.s,this.l*a,this.opacity)},rgb:function(){var a=this.h%360+360*(this.h<0),b=isNaN(a)||isNaN(this.s)?0:this.s,c=this.l,d=c+(c<.5?c:1-c)*b,e=2*c-d;return new i(n(a>=240?a-240:a+120,e,d),n(a,e,d),n(a<120?a+240:a-120,e,d),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var Q=Math.PI/180,R=180/Math.PI,S=18,T=.95047,U=1,V=1.08883,W=4/29,X=6/29,Y=3*X*X,Z=X*X*X;B(q,p,b(c,{brighter:function(a){return new q(this.l+S*(null==a?1:a),this.a,this.b,this.opacity)},darker:function(a){return new q(this.l-S*(null==a?1:a),this.a,this.b,this.opacity)},rgb:function(){var a=(this.l+16)/116,b=isNaN(this.a)?a:a+this.a/500,c=isNaN(this.b)?a:a-this.b/200;return a=U*s(a),b=T*s(b),c=V*s(c),new i(t(3.2404542*b-1.5371385*a-.4985314*c),t(-.969266*b+1.8760108*a+.041556*c),t(.0556434*b-.2040259*a+1.0572252*c),this.opacity)}})),B(x,w,b(c,{brighter:function(a){return new x(this.h,this.c,this.l+S*(null==a?1:a),this.opacity)},darker:function(a){return new x(this.h,this.c,this.l-S*(null==a?1:a),this.opacity)},rgb:function(){return o(this).rgb()}}));var $=-.14861,_=1.78277,aa=-.29227,ba=-.90649,ca=1.97294,da=ca*ba,ea=ca*_,fa=_*aa-ba*$;B(A,z,b(c,{brighter:function(a){return a=null==a?D:Math.pow(D,a),new A(this.h,this.s,this.l*a,this.opacity)},darker:function(a){return a=null==a?C:Math.pow(C,a),new A(this.h,this.s,this.l*a,this.opacity)},rgb:function(){var a=isNaN(this.h)?0:(this.h+120)*Q,b=+this.l,c=isNaN(this.s)?0:this.s*b*(1-b),d=Math.cos(a),e=Math.sin(a);return new i(255*(b+c*($*d+_*e)),255*(b+c*(aa*d+ba*e)),255*(b+c*(ca*d)),this.opacity)}})),a.color=d,a.rgb=h,a.hsl=l,a.lab=p,a.hcl=w,a.cubehelix=z,Object.defineProperty(a,"__esModule",{value:!0})})},{}],4:[function(a,b,c){!function(a,d){"object"==typeof c&&"undefined"!=typeof b?d(c):"function"==typeof define&&define.amd?define(["exports"],d):d(a.d3=a.d3||{})}(this,function(a){"use strict";function b(){for(var a,b=0,d=arguments.length,e={};b=0&&(c=a.slice(d+1),a=a.slice(0,d)),a&&!b.hasOwnProperty(a))throw new Error("unknown type: "+a);return{type:a,name:c}})}function e(a,b){for(var c,d=0,e=a.length;d0)for(var c,d,e=new Array(c),f=0;f1?d[0]+d.slice(2):d,+a.slice(c+1)]}function c(a){return a=b(Math.abs(a)),a?a[1]:NaN}function d(a,b){return function(c,d){for(var e=c.length,f=[],g=0,h=a[0],i=0;e>0&&h>0&&(i+h+1>d&&(h=Math.max(1,d-i)),f.push(c.substring(e-=h,e+h)),!((i+=h+1)>d));)h=a[g=(g+1)%a.length];return f.reverse().join(b)}}function e(a,b){a=a.toPrecision(b);a:for(var c,d=a.length,e=1,f=-1;e0&&(f=0)}return f>0?a.slice(0,f)+a.slice(c+1):a}function f(a,c){var d=b(a,c);if(!d)return a+"";var e=d[0],f=d[1],g=f-(p=3*Math.max(-8,Math.min(8,Math.floor(f/3))))+1,h=e.length;return g===h?e:g>h?e+new Array(g-h+1).join("0"):g>0?e.slice(0,g)+"."+e.slice(g):"0."+new Array(1-g).join("0")+b(a,Math.max(0,c+g-1))[0]}function g(a,c){var d=b(a,c);if(!d)return a+"";var e=d[0],f=d[1];return f<0?"0."+new Array(-f).join("0")+e:e.length>f+1?e.slice(0,f+1)+"."+e.slice(f+1):e+new Array(f-e.length+2).join("0")}function h(a){return new i(a)}function i(a){if(!(b=r.exec(a)))throw new Error("invalid format: "+a);var b,c=b[1]||" ",d=b[2]||">",e=b[3]||"-",f=b[4]||"",g=!!b[5],h=b[6]&&+b[6],i=!!b[7],j=b[8]&&+b[8].slice(1),k=b[9]||"";"n"===k?(i=!0,k="g"):q[k]||(k=""),(g||"0"===c&&"="===d)&&(g=!0,c="0",d="="),this.fill=c,this.align=d,this.sign=e,this.symbol=f,this.zero=g,this.width=h,this.comma=i,this.precision=j,this.type=k}function j(a){return a}function k(a){function b(a){function b(a){var b,g,h,j=r,q=s;if("c"===o)q=u(a)+q,a="";else{a=+a;var w=(a<0||1/a<0)&&(a*=-1,!0);if(a=u(a,n),w)for(b=-1,g=a.length,w=!1;++bh||h>57){q=(46===h?i+a.slice(b+1):a.slice(b))+q,a=a.slice(0,b);break}}m&&!k&&(a=f(a,1/0));var x=j.length+a.length+q.length,y=x>1)+j+a+q+y.slice(x)}return y+j+a+q}a=h(a);var c=a.fill,d=a.align,e=a.sign,j=a.symbol,k=a.zero,l=a.width,m=a.comma,n=a.precision,o=a.type,r="$"===j?g[0]:"#"===j&&/[boxX]/.test(o)?"0"+o.toLowerCase():"",s="$"===j?g[1]:/[%p]/.test(o)?"%":"",u=q[o],v=!o||/[defgprs%]/.test(o);return n=null==n?o?6:12:/[gprs]/.test(o)?Math.max(1,Math.min(21,n)):Math.max(0,Math.min(20,n)),b.toString=function(){return a+""},b}function e(a,d){var e=b((a=h(a),a.type="f",a)),f=3*Math.max(-8,Math.min(8,Math.floor(c(d)/3))),g=Math.pow(10,-f),i=t[8+f/3];return function(a){return e(g*a)+i}}var f=a.grouping&&a.thousands?d(a.grouping,a.thousands):j,g=a.currency,i=a.decimal;return{format:b,formatPrefix:e}}function l(b){return s=k(b),a.format=s.format,a.formatPrefix=s.formatPrefix,s}function m(a){return Math.max(0,-c(Math.abs(a)))}function n(a,b){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(c(b)/3)))-c(Math.abs(a)))}function o(a,b){return a=Math.abs(a),b=Math.abs(b)-a,Math.max(0,c(b)-c(a))+1}var p,q={"":e,"%":function(a,b){return(100*a).toFixed(b)},b:function(a){return Math.round(a).toString(2)},c:function(a){return a+""},d:function(a){return Math.round(a).toString(10)},e:function(a,b){return a.toExponential(b)},f:function(a,b){return a.toFixed(b)},g:function(a,b){return a.toPrecision(b)},o:function(a){return Math.round(a).toString(8)},p:function(a,b){return g(100*a,b)},r:g,s:f,X:function(a){return Math.round(a).toString(16).toUpperCase()},x:function(a){return Math.round(a).toString(16)}},r=/^(?:(.)?([<>=^]))?([+\-\( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?([a-z%])?$/i;i.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+this.type};var s,t=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];l({decimal:".",thousands:",",grouping:[3],currency:["$",""]}),a.formatDefaultLocale=l,a.formatLocale=k,a.formatSpecifier=h,a.precisionFixed=m,a.precisionPrefix=n,a.precisionRound=o,Object.defineProperty(a,"__esModule",{value:!0})})},{}],6:[function(a,b,c){!function(d,e){"object"==typeof c&&"undefined"!=typeof b?e(c,a("d3-color")):"function"==typeof define&&define.amd?define(["exports","d3-color"],e):e(d.d3=d.d3||{},d.d3)}(this,function(a,b){"use strict";function c(a,b,c,d,e){var f=a*a,g=f*a;return((1-3*a+3*f-g)*b+(4-6*f+3*g)*c+(1+3*a+3*f-3*g)*d+g*e)/6}function d(a,b){return function(c){return a+c*b}}function e(a,b,c){return a=Math.pow(a,c),b=Math.pow(b,c)-a,c=1/c,function(d){return Math.pow(a+d*b,c)}}function f(a,b){var c=b-a;return c?d(a,c>180||c<-180?c-360*Math.round(c/360):c):B(isNaN(a)?b:a)}function g(a){return 1===(a=+a)?h:function(b,c){return c-b?e(b,c,a):B(isNaN(b)?c:b)}}function h(a,b){var c=b-a;return c?d(a,c):B(isNaN(a)?b:a)}function i(a){return function(c){var d,e,f=c.length,g=new Array(f),h=new Array(f),i=new Array(f);for(d=0;d180?b+=360:b-a>180&&(a+=360),f.push({i:c.push(e(c)+"rotate(",null,d)-2,x:H(a,b)})):b&&c.push(e(c)+"rotate("+b+d)}function h(a,b,c,f){a!==b?f.push({i:c.push(e(c)+"skewX(",null,d)-2,x:H(a,b)}):b&&c.push(e(c)+"skewX("+b+d)}function i(a,b,c,d,f,g){if(a!==c||b!==d){var h=f.push(e(f)+"scale(",null,",",null,")");g.push({i:h-4,x:H(a,c)},{i:h-2,x:H(b,d)})}else 1===c&&1===d||f.push(e(f)+"scale("+c+","+d+")")}return function(b,c){var d=[],e=[];return b=a(b),c=a(c),f(b.translateX,b.translateY,c.translateX,c.translateY,d,e),g(b.rotate,c.rotate,d,e),h(b.skewX,c.skewX,d,e),i(b.scaleX,b.scaleY,c.scaleX,c.scaleY,d,e),b=c=null,function(a){for(var b,c=-1,f=e.length;++c=1?(d=1,b-1):Math.floor(d*b),f=a[e],g=a[e+1],h=e>0?a[e-1]:2*f-g,i=ef&&(e=b.slice(f,e),h[g]?h[g]+=e:h[++g]=e),(c=c[0])===(d=d[0])?h[g]?h[g]+=d:h[++g]=d:(h[++g]=null,i.push({i:g,x:H(c,d)})),f=K.lastIndex;return f=c?1:d(a)}}}function q(a){return function(b,c){var d=a(b=+b,c=+c);return function(a){return a<=0?b:a>=1?c:d(a)}}}function r(a,b,c,d){var e=a[0],f=a[1],g=b[0],h=b[1];return f2?s:r,g=h=null,e}function e(b){return(g||(g=f(i,j,l?p(a):a,k)))(+b)}var f,g,h,i=$,j=$,k=d.interpolate,l=!1;return e.invert=function(a){return(h||(h=f(j,i,o,l?q(b):b)))(+a)},e.domain=function(a){return arguments.length?(i=X.call(a,n),c()):i.slice()},e.range=function(a){return arguments.length?(j=Y.call(a),c()):j.slice()},e.rangeRound=function(a){return j=Y.call(a),k=d.interpolateRound,c()},e.clamp=function(a){return arguments.length?(l=!!a,c()):l},e.interpolate=function(a){return arguments.length?(k=a,c()):k},c()}function v(a,c,d){var f,g=a[0],h=a[a.length-1],i=b.tickStep(g,h,null==c?10:c);switch(d=e.formatSpecifier(null==d?",f":d),d.type){case"s":var j=Math.max(Math.abs(g),Math.abs(h));return null!=d.precision||isNaN(f=e.precisionPrefix(i,j))||(d.precision=f),e.formatPrefix(d,j);case"":case"e":case"g":case"p":case"r":null!=d.precision||isNaN(f=e.precisionRound(i,Math.max(Math.abs(g),Math.abs(h))))||(d.precision=f-("e"===d.type));break;case"f":case"%":null!=d.precision||isNaN(f=e.precisionFixed(i))||(d.precision=f-2*("%"===d.type))}return e.format(d)}function w(a){var c=a.domain;return a.ticks=function(a){var d=c();return b.ticks(d[0],d[d.length-1],null==a?10:a)},a.tickFormat=function(a,b){return v(c(),a,b)},a.nice=function(d){var e=c(),f=e.length-1,g=null==d?10:d,h=e[0],i=e[f],j=b.tickStep(h,i,g);return j&&(j=b.tickStep(Math.floor(h/j)*j,Math.ceil(i/j)*j,g),e[0]=Math.floor(h/j)*j,e[f]=Math.ceil(i/j)*j,c(e)),a},a}function x(){var a=u(o,d.interpolateNumber);return a.copy=function(){return t(a,x())},w(a)}function y(){function a(a){return+a}var b=[0,1];return a.invert=a,a.domain=a.range=function(c){return arguments.length?(b=X.call(c,n),a):b.slice()},a.copy=function(){return y().domain(b)},w(a)}function z(a,b){a=a.slice();var c,d=0,e=a.length-1,f=a[d],g=a[e];return g0){for(;nj)break;q.push(m)}}else for(;n=1;--l)if(m=k*l,!(mj)break;q.push(m)}}else q=b.ticks(n,o,Math.min(o-n,p)).map(h);return c?q.reverse():q},c.tickFormat=function(a,b){if(null==b&&(b=10===f?".0e":","),"function"!=typeof b&&(b=e.format(b)),a===1/0)return b;null==a&&(a=10);var d=Math.max(1,f*a/c.ticks().length);return function(a){var c=a/h(Math.round(g(a)));return c*f0?f[b-1]:d[0],b=f?[g[f-1],e]:[g[b-1],g[b]]},a.copy=function(){return L().domain([d,e]).range(h)},w(a)}function M(){function a(a){if(a<=a)return d[b.bisect(c,a,0,e)]}var c=[.5],d=[0,1],e=1;return a.domain=function(b){return arguments.length?(c=Y.call(b),e=Math.min(c.length,d.length-1),a):c.slice()},a.range=function(b){return arguments.length?(d=Y.call(b),e=Math.min(c.length,d.length-1),a):d.slice()},a.invertExtent=function(a){var b=d.indexOf(a);return[c[b-1],c[b]]},a.copy=function(){return M().domain(c).range(d)},a}function N(a){return new Date(a)}function O(a){return a instanceof Date?+a:+new Date(+a)}function P(a,c,e,f,g,h,i,j,k){function l(b){return(i(b)1)&&(a-=Math.floor(a));var b=Math.abs(a-.5);return na.h=360*a-100,na.s=1.5-1.5*b,na.l=.8-.9*b,na+""}function U(a){var b=a.length;return function(c){return a[Math.max(0,Math.min(b-1,Math.floor(c*b)))]}}function V(a){function b(b){var f=(b-c)/(d-c);return a(e?Math.max(0,Math.min(1,f)):f)}var c=0,d=1,e=!1;return b.domain=function(a){return arguments.length?(c=+a[0],d=+a[1],b):[c,d]},b.clamp=function(a){return arguments.length?(e=!!a,b):e},b.interpolator=function(c){return arguments.length?(a=c,b):a},b.copy=function(){return V(a).domain([c,d]).clamp(e)},w(b)}var W=Array.prototype,X=W.map,Y=W.slice,Z={name:"implicit"},$=[0,1],_=1e3,aa=60*_,ba=60*aa,ca=24*ba,da=7*ca,ea=30*ca,fa=365*ca,ga=S("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),ha=S("393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6"),ia=S("3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9"),ja=S("1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5"),ka=d.interpolateCubehelixLong(h.cubehelix(300,.5,0),h.cubehelix(-240,.5,1)),la=d.interpolateCubehelixLong(h.cubehelix(-100,.75,.35),h.cubehelix(80,1.5,.8)),ma=d.interpolateCubehelixLong(h.cubehelix(260,.75,.35),h.cubehelix(80,1.5,.8)),na=h.cubehelix(),oa=U(S("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),pa=U(S("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),qa=U(S("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),ra=U(S("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));a.scaleBand=j,a.scalePoint=l,a.scaleIdentity=y,a.scaleLinear=x,a.scaleLog=G,a.scaleOrdinal=i,a.scaleImplicit=Z,a.scalePow=I,a.scaleSqrt=J,a.scaleQuantile=K,a.scaleQuantize=L,a.scaleThreshold=M,a.scaleTime=Q,a.scaleUtc=R,a.schemeCategory10=ga,a.schemeCategory20b=ha,a.schemeCategory20c=ia,a.schemeCategory20=ja,a.interpolateCubehelixDefault=ka,a.interpolateRainbow=T,a.interpolateWarm=la,a.interpolateCool=ma,a.interpolateViridis=oa,a.interpolateMagma=pa,a.interpolateInferno=qa,a.interpolatePlasma=ra,a.scaleSequential=V,Object.defineProperty(a,"__esModule",{value:!0})})},{"d3-array":1,"d3-collection":2,"d3-color":3,"d3-format":5,"d3-interpolate":6,"d3-time":10,"d3-time-format":9}],8:[function(a,b,c){!function(a,d){"object"==typeof c&&"undefined"!=typeof b?d(c):"function"==typeof define&&define.amd?define(["exports"],d):d(a.d3=a.d3||{})}(this,function(a){"use strict";function b(a){var b=a+="",c=b.indexOf(":");return c>=0&&"xmlns"!==(b=a.slice(0,c))&&(a=a.slice(c+1)),Qa.hasOwnProperty(b)?{space:Qa[b],local:a}:a}function c(a){return function(){var b=this.ownerDocument,c=this.namespaceURI;return c===Pa&&b.documentElement.namespaceURI===Pa?b.createElement(a):b.createElementNS(c,a)}}function d(a){return function(){return this.ownerDocument.createElementNS(a.space,a.local)}}function e(a){var e=b(a);return(e.local?d:c)(e)}function f(){return new g}function g(){this._="@"+(++Ra).toString(36)}function h(a,b,c){return a=i(a,b,c),function(b){var c=b.relatedTarget;c&&(c===this||8&c.compareDocumentPosition(this))||a.call(this,b)}}function i(b,c,d){return function(e){var f=a.event;a.event=e;try{b.call(this,this.__data__,c,d)}finally{a.event=f}}}function j(a){return a.trim().split(/^|\s+/).map(function(a){var b="",c=a.indexOf(".");return c>=0&&(b=a.slice(c+1),a=a.slice(0,c)),{type:a,name:b}})}function k(a){return function(){var b=this.__on;if(b){for(var c,d=0,e=-1,f=b.length;d=v&&(v=u+1);!(t=q[v])&&++v=0;)(d=e[f])&&(g&&g!==d.nextSibling&&g.parentNode.insertBefore(d,g),g=d);return this}function I(a){function b(b,c){return b&&c?a(b.__data__,c.__data__):!b-!c}a||(a=J);for(var c=this._groups,d=c.length,e=new Array(d),f=0;fb?1:a>=b?0:NaN}function K(){var a=arguments[0];return arguments[0]=this,a.apply(null,arguments),this}function L(){var a=new Array(this.size()),b=-1;return this.each(function(){a[++b]=this}),a}function M(){for(var a=this._groups,b=0,c=a.length;b1?this.each((null==b?Y:"function"==typeof b?$:Z)(a,b,null==c?"":c)):X(d=this.node()).getComputedStyle(d,null).getPropertyValue(a)}function aa(a){return function(){delete this[a]}}function ba(a,b){return function(){this[a]=b}}function ca(a,b){return function(){var c=b.apply(this,arguments);null==c?delete this[a]:this[a]=c}}function da(a,b){return arguments.length>1?this.each((null==b?aa:"function"==typeof b?ca:ba)(a,b)):this.node()[a]}function ea(a){return a.trim().split(/^|\s+/)}function fa(a){return a.classList||new ga(a)}function ga(a){this._node=a,this._names=ea(a.getAttribute("class")||"")}function ha(a,b){for(var c=fa(a),d=-1,e=b.length;++d=0&&(this._names.splice(b,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(a){return this._names.indexOf(a)>=0}};var Za=[null];Ja.prototype=Ka.prototype={constructor:Ja,select:t,selectAll:w,filter:x,data:E,enter:z,exit:F,merge:G,order:H,sort:I,call:K,nodes:L,node:M,size:N,empty:O,each:P,attr:W,style:_,property:da,classed:ma,text:qa,html:ua,raise:wa,lower:ya,append:za,insert:Ba,remove:Da,datum:Ea,on:m,dispatch:Ia},a.creator=e,a.local=f,a.matcher=Va,a.mouse=q,a.namespace=b,a.namespaces=Qa,a.select=La,a.selectAll=Ma,a.selection=Ka,a.selector=s,a.selectorAll=v,a.touch=Na,a.touches=Oa,a.window=X,a.customEvent=n,Object.defineProperty(a,"__esModule",{value:!0})})},{}],9:[function(a,b,c){!function(d,e){"object"==typeof c&&"undefined"!=typeof b?e(c,a("d3-time")):"function"==typeof define&&define.amd?define(["exports","d3-time"],e):e(d.d3=d.d3||{},d.d3)}(this,function(a,b){"use strict";function c(a){if(0<=a.y&&a.y<100){var b=new Date(-1,a.m,a.d,a.H,a.M,a.S,a.L);return b.setFullYear(a.y),b}return new Date(a.y,a.m,a.d,a.H,a.M,a.S,a.L)}function d(a){if(0<=a.y&&a.y<100){var b=new Date(Date.UTC(-1,a.m,a.d,a.H,a.M,a.S,a.L));return b.setUTCFullYear(a.y),b}return new Date(Date.UTC(a.y,a.m,a.d,a.H,a.M,a.S,a.L))}function e(a){return{y:a,m:0,d:1,H:0,M:0,S:0,L:0}}function f(a){function b(a,b){return function(c){var d,e,f,g=[],h=-1,i=0,j=a.length;for(c instanceof Date||(c=new Date(+c));++h=i)return-1;if(e=b.charCodeAt(g++), -37===e){if(e=b.charAt(g++),f=La[e in da?b.charAt(g++):e],!f||(d=f(a,c,d))<0)return-1}else if(e!=c.charCodeAt(d++))return-1}return d}function h(a,b,c){var d=za.exec(b.slice(c));return d?(a.p=Aa[d[0].toLowerCase()],c+d[0].length):-1}function _(a,b,c){var d=Da.exec(b.slice(c));return d?(a.w=Ea[d[0].toLowerCase()],c+d[0].length):-1}function aa(a,b,c){var d=Ba.exec(b.slice(c));return d?(a.w=Ca[d[0].toLowerCase()],c+d[0].length):-1}function ba(a,b,c){var d=Ha.exec(b.slice(c));return d?(a.m=Ia[d[0].toLowerCase()],c+d[0].length):-1}function ca(a,b,c){var d=Fa.exec(b.slice(c));return d?(a.m=Ga[d[0].toLowerCase()],c+d[0].length):-1}function ea(a,b,c){return g(a,ra,b,c)}function fa(a,b,c){return g(a,sa,b,c)}function ga(a,b,c){return g(a,ta,b,c)}function ha(a){return wa[a.getDay()]}function ia(a){return va[a.getDay()]}function ja(a){return ya[a.getMonth()]}function ka(a){return xa[a.getMonth()]}function la(a){return ua[+(a.getHours()>=12)]}function ma(a){return wa[a.getUTCDay()]}function na(a){return va[a.getUTCDay()]}function oa(a){return ya[a.getUTCMonth()]}function pa(a){return xa[a.getUTCMonth()]}function qa(a){return ua[+(a.getUTCHours()>=12)]}var ra=a.dateTime,sa=a.date,ta=a.time,ua=a.periods,va=a.days,wa=a.shortDays,xa=a.months,ya=a.shortMonths,za=i(ua),Aa=j(ua),Ba=i(va),Ca=j(va),Da=i(wa),Ea=j(wa),Fa=i(xa),Ga=j(xa),Ha=i(ya),Ia=j(ya),Ja={a:ha,A:ia,b:ja,B:ka,c:null,d:y,e:y,H:z,I:A,j:B,L:C,m:D,M:E,p:la,S:F,U:G,w:H,W:I,x:null,X:null,y:J,Y:K,Z:L,"%":$},Ka={a:ma,A:na,b:oa,B:pa,c:null,d:M,e:M,H:N,I:O,j:P,L:Q,m:R,M:S,p:qa,S:T,U:U,w:V,W:W,x:null,X:null,y:X,Y:Y,Z:Z,"%":$},La={a:_,A:aa,b:ba,B:ca,c:ea,d:r,e:r,H:t,I:t,j:s,L:w,m:q,M:u,p:h,S:v,U:l,w:k,W:m,x:fa,X:ga,y:o,Y:n,Z:p,"%":x};return Ja.x=b(sa,Ja),Ja.X=b(ta,Ja),Ja.c=b(ra,Ja),Ka.x=b(sa,Ka),Ka.X=b(ta,Ka),Ka.c=b(ra,Ka),{format:function(a){var c=b(a+="",Ja);return c.toString=function(){return a},c},parse:function(a){var b=f(a+="",c);return b.toString=function(){return a},b},utcFormat:function(a){var c=b(a+="",Ka);return c.toString=function(){return a},c},utcParse:function(a){var b=f(a,d);return b.toString=function(){return a},b}}}function g(a,b,c){var d=a<0?"-":"",e=(d?-a:a)+"",f=e.length;return d+(f68?1900:2e3),c+d[0].length):-1}function p(a,b,c){var d=/^(Z)|([+-]\d\d)(?:\:?(\d\d))?/.exec(b.slice(c,c+6));return d?(a.Z=d[1]?0:-(d[2]+(d[3]||"00")),c+d[0].length):-1}function q(a,b,c){var d=ea.exec(b.slice(c,c+2));return d?(a.m=d[0]-1,c+d[0].length):-1}function r(a,b,c){var d=ea.exec(b.slice(c,c+2));return d?(a.d=+d[0],c+d[0].length):-1}function s(a,b,c){var d=ea.exec(b.slice(c,c+3));return d?(a.m=0,a.d=+d[0],c+d[0].length):-1}function t(a,b,c){var d=ea.exec(b.slice(c,c+2));return d?(a.H=+d[0],c+d[0].length):-1}function u(a,b,c){var d=ea.exec(b.slice(c,c+2));return d?(a.M=+d[0],c+d[0].length):-1}function v(a,b,c){var d=ea.exec(b.slice(c,c+2));return d?(a.S=+d[0],c+d[0].length):-1}function w(a,b,c){var d=ea.exec(b.slice(c,c+3));return d?(a.L=+d[0],c+d[0].length):-1}function x(a,b,c){var d=fa.exec(b.slice(c,c+1));return d?c+d[0].length:-1}function y(a,b){return g(a.getDate(),b,2)}function z(a,b){return g(a.getHours(),b,2)}function A(a,b){return g(a.getHours()%12||12,b,2)}function B(a,c){return g(1+b.timeDay.count(b.timeYear(a),a),c,3)}function C(a,b){return g(a.getMilliseconds(),b,3)}function D(a,b){return g(a.getMonth()+1,b,2)}function E(a,b){return g(a.getMinutes(),b,2)}function F(a,b){return g(a.getSeconds(),b,2)}function G(a,c){return g(b.timeSunday.count(b.timeYear(a),a),c,2)}function H(a){return a.getDay()}function I(a,c){return g(b.timeMonday.count(b.timeYear(a),a),c,2)}function J(a,b){return g(a.getFullYear()%100,b,2)}function K(a,b){return g(a.getFullYear()%1e4,b,4)}function L(a){var b=a.getTimezoneOffset();return(b>0?"-":(b*=-1,"+"))+g(b/60|0,"0",2)+g(b%60,"0",2)}function M(a,b){return g(a.getUTCDate(),b,2)}function N(a,b){return g(a.getUTCHours(),b,2)}function O(a,b){return g(a.getUTCHours()%12||12,b,2)}function P(a,c){return g(1+b.utcDay.count(b.utcYear(a),a),c,3)}function Q(a,b){return g(a.getUTCMilliseconds(),b,3)}function R(a,b){return g(a.getUTCMonth()+1,b,2)}function S(a,b){return g(a.getUTCMinutes(),b,2)}function T(a,b){return g(a.getUTCSeconds(),b,2)}function U(a,c){return g(b.utcSunday.count(b.utcYear(a),a),c,2)}function V(a){return a.getUTCDay()}function W(a,c){return g(b.utcMonday.count(b.utcYear(a),a),c,2)}function X(a,b){return g(a.getUTCFullYear()%100,b,2)}function Y(a,b){return g(a.getUTCFullYear()%1e4,b,4)}function Z(){return"+0000"}function $(){return"%"}function _(b){return ca=f(b),a.timeFormat=ca.format,a.timeParse=ca.parse,a.utcFormat=ca.utcFormat,a.utcParse=ca.utcParse,ca}function aa(a){return a.toISOString()}function ba(a){var b=new Date(a);return isNaN(b)?null:b}var ca,da={"-":"",_:" ",0:"0"},ea=/^\s*\d+/,fa=/^%/,ga=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;_({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var ha="%Y-%m-%dT%H:%M:%S.%LZ",ia=Date.prototype.toISOString?aa:a.utcFormat(ha),ja=+new Date("2000-01-01T00:00:00.000Z")?ba:a.utcParse(ha);a.timeFormatDefaultLocale=_,a.timeFormatLocale=f,a.isoFormat=ia,a.isoParse=ja,Object.defineProperty(a,"__esModule",{value:!0})})},{"d3-time":10}],10:[function(a,b,c){!function(a,d){"object"==typeof c&&"undefined"!=typeof b?d(c):"function"==typeof define&&define.amd?define(["exports"],d):d(a.d3=a.d3||{})}(this,function(a){"use strict";function b(a,c,d,g){function h(b){return a(b=new Date(+b)),b}return h.floor=h,h.ceil=function(b){return a(b=new Date(b-1)),c(b,1),a(b),b},h.round=function(a){var b=h(a),c=h.ceil(a);return a-b0))return f;do f.push(new Date(+b));while(c(b,e),a(b),b=b)for(;a(b),!d(b);)b.setTime(b-1)},function(a,b){if(a>=a)for(;--b>=0;)for(;c(a,1),!d(a););})},d&&(h.count=function(b,c){return e.setTime(+b),f.setTime(+c),a(e),a(f),Math.floor(d(e,f))},h.every=function(a){return a=Math.floor(a),isFinite(a)&&a>0?a>1?h.filter(g?function(b){return g(b)%a===0}:function(b){return h.count(0,b)%a===0}):h:null}),h}function c(a){return b(function(b){b.setDate(b.getDate()-(b.getDay()+7-a)%7),b.setHours(0,0,0,0)},function(a,b){a.setDate(a.getDate()+7*b)},function(a,b){return(b-a-(b.getTimezoneOffset()-a.getTimezoneOffset())*j)/m})}function d(a){return b(function(b){b.setUTCDate(b.getUTCDate()-(b.getUTCDay()+7-a)%7),b.setUTCHours(0,0,0,0)},function(a,b){a.setUTCDate(a.getUTCDate()+7*b)},function(a,b){return(b-a)/m})}var e=new Date,f=new Date,g=b(function(){},function(a,b){a.setTime(+a+b)},function(a,b){return b-a});g.every=function(a){return a=Math.floor(a),isFinite(a)&&a>0?a>1?b(function(b){b.setTime(Math.floor(b/a)*a)},function(b,c){b.setTime(+b+c*a)},function(b,c){return(c-b)/a}):g:null};var h=g.range,i=1e3,j=6e4,k=36e5,l=864e5,m=6048e5,n=b(function(a){a.setTime(Math.floor(a/i)*i)},function(a,b){a.setTime(+a+b*i)},function(a,b){return(b-a)/i},function(a){return a.getUTCSeconds()}),o=n.range,p=b(function(a){a.setTime(Math.floor(a/j)*j)},function(a,b){a.setTime(+a+b*j)},function(a,b){return(b-a)/j},function(a){return a.getMinutes()}),q=p.range,r=b(function(a){var b=a.getTimezoneOffset()*j%k;b<0&&(b+=k),a.setTime(Math.floor((+a-b)/k)*k+b)},function(a,b){a.setTime(+a+b*k)},function(a,b){return(b-a)/k},function(a){return a.getHours()}),s=r.range,t=b(function(a){a.setHours(0,0,0,0)},function(a,b){a.setDate(a.getDate()+b)},function(a,b){return(b-a-(b.getTimezoneOffset()-a.getTimezoneOffset())*j)/l},function(a){return a.getDate()-1}),u=t.range,v=c(0),w=c(1),x=c(2),y=c(3),z=c(4),A=c(5),B=c(6),C=v.range,D=w.range,E=x.range,F=y.range,G=z.range,H=A.range,I=B.range,J=b(function(a){a.setDate(1),a.setHours(0,0,0,0)},function(a,b){a.setMonth(a.getMonth()+b)},function(a,b){return b.getMonth()-a.getMonth()+12*(b.getFullYear()-a.getFullYear())},function(a){return a.getMonth()}),K=J.range,L=b(function(a){a.setMonth(0,1),a.setHours(0,0,0,0)},function(a,b){a.setFullYear(a.getFullYear()+b)},function(a,b){return b.getFullYear()-a.getFullYear()},function(a){return a.getFullYear()});L.every=function(a){return isFinite(a=Math.floor(a))&&a>0?b(function(b){b.setFullYear(Math.floor(b.getFullYear()/a)*a),b.setMonth(0,1),b.setHours(0,0,0,0)},function(b,c){b.setFullYear(b.getFullYear()+c*a)}):null};var M=L.range,N=b(function(a){a.setUTCSeconds(0,0)},function(a,b){a.setTime(+a+b*j)},function(a,b){return(b-a)/j},function(a){return a.getUTCMinutes()}),O=N.range,P=b(function(a){a.setUTCMinutes(0,0,0)},function(a,b){a.setTime(+a+b*k)},function(a,b){return(b-a)/k},function(a){return a.getUTCHours()}),Q=P.range,R=b(function(a){a.setUTCHours(0,0,0,0)},function(a,b){a.setUTCDate(a.getUTCDate()+b)},function(a,b){return(b-a)/l},function(a){return a.getUTCDate()-1}),S=R.range,T=d(0),U=d(1),V=d(2),W=d(3),X=d(4),Y=d(5),Z=d(6),$=T.range,_=U.range,aa=V.range,ba=W.range,ca=X.range,da=Y.range,ea=Z.range,fa=b(function(a){a.setUTCDate(1),a.setUTCHours(0,0,0,0)},function(a,b){a.setUTCMonth(a.getUTCMonth()+b)},function(a,b){return b.getUTCMonth()-a.getUTCMonth()+12*(b.getUTCFullYear()-a.getUTCFullYear())},function(a){return a.getUTCMonth()}),ga=fa.range,ha=b(function(a){a.setUTCMonth(0,1),a.setUTCHours(0,0,0,0)},function(a,b){a.setUTCFullYear(a.getUTCFullYear()+b)},function(a,b){return b.getUTCFullYear()-a.getUTCFullYear()},function(a){return a.getUTCFullYear()});ha.every=function(a){return isFinite(a=Math.floor(a))&&a>0?b(function(b){b.setUTCFullYear(Math.floor(b.getUTCFullYear()/a)*a),b.setUTCMonth(0,1),b.setUTCHours(0,0,0,0)},function(b,c){b.setUTCFullYear(b.getUTCFullYear()+c*a)}):null};var ia=ha.range;a.timeInterval=b,a.timeMillisecond=g,a.timeMilliseconds=h,a.utcMillisecond=g,a.utcMilliseconds=h,a.timeSecond=n,a.timeSeconds=o,a.utcSecond=n,a.utcSeconds=o,a.timeMinute=p,a.timeMinutes=q,a.timeHour=r,a.timeHours=s,a.timeDay=t,a.timeDays=u,a.timeWeek=v,a.timeWeeks=C,a.timeSunday=v,a.timeSundays=C,a.timeMonday=w,a.timeMondays=D,a.timeTuesday=x,a.timeTuesdays=E,a.timeWednesday=y,a.timeWednesdays=F,a.timeThursday=z,a.timeThursdays=G,a.timeFriday=A,a.timeFridays=H,a.timeSaturday=B,a.timeSaturdays=I,a.timeMonth=J,a.timeMonths=K,a.timeYear=L,a.timeYears=M,a.utcMinute=N,a.utcMinutes=O,a.utcHour=P,a.utcHours=Q,a.utcDay=R,a.utcDays=S,a.utcWeek=T,a.utcWeeks=$,a.utcSunday=T,a.utcSundays=$,a.utcMonday=U,a.utcMondays=_,a.utcTuesday=V,a.utcTuesdays=aa,a.utcWednesday=W,a.utcWednesdays=ba,a.utcThursday=X,a.utcThursdays=ca,a.utcFriday=Y,a.utcFridays=da,a.utcSaturday=Z,a.utcSaturdays=ea,a.utcMonth=fa,a.utcMonths=ga,a.utcYear=ha,a.utcYears=ia,Object.defineProperty(a,"__esModule",{value:!0})})},{}],11:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(a){var h=g.default.d3_calcType(b,z,m,o,s.format(t),w),i=a.selectAll("g").data([b]);i.enter().append("g").attr("class",p+"legendCells"),n&&g.default.d3_filterCells(h,n);var j=a.select("."+p+"legendCells").selectAll("."+p+"cell").data(h.data),D=j.enter().append("g").attr("class",p+"cell");D.append(c).attr("class",p+"swatch");var E=a.selectAll("g."+p+"cell "+c).data(h.data);g.default.d3_addEvents(D,C),j.exit().transition().style("opacity",0).remove(),E.exit().transition().style("opacity",0).remove(),E=E.merge(E),g.default.d3_drawShapes(c,E,e,d,f,A),g.default.d3_addText(a,D,h.labels,p,x),j=D.merge(j);var F=j.selectAll("text"),G=F.nodes().map(function(a){return a.getBBox()}),H=E.nodes().map(function(a){return a.getBBox()});q?E.attr("class",function(a){return p+"swatch "+h.feature(a)}):"line"==c?E.style("stroke",h.feature):E.style("fill",h.feature);var I=void 0,J=void 0,K="start"==v?0:"middle"==v?.5:1;"vertical"===y?!function(){var a=G.map(function(a,b){return Math.max(a.height,H[b].height)});I=function(b,c){var d=(0,k.sum)(a.slice(0,c));return"translate(0, "+(d+c*l)+")"},J=function(a,b){return"translate( "+(H[b].width+H[b].x+u)+", "+(H[b].y+H[b].height/2+5)+")"}}():"horizontal"===y&&(I=function(a,b){return"translate("+b*(H[b].width+l)+",0)"},J=function(a,b){return"translate("+(H[b].width*K+H[b].x)+",\n "+(H[b].height+H[b].y+u+8)+")"}),g.default.d3_placement(y,j,I,F,J,v),g.default.d3_title(a,r,p,B),j.transition().style("opacity",1)}var b=(0,i.scaleLinear)(),c="rect",d=15,e=15,f=10,l=2,m=[5],n=void 0,o=[],p="",q=!1,r="",s=g.default.d3_defaultLocale,t=g.default.d3_defaultFormatSpecifier,u=10,v="middle",w=g.default.d3_defaultDelimiter,x=void 0,y="vertical",z=!1,A=void 0,B=void 0,C=(0,h.dispatch)("cellover","cellout","cellclick");return a.scale=function(c){return arguments.length?(b=c,a):b},a.cells=function(b){return arguments.length?((b.length>1||b>=2)&&(m=b),a):m},a.cellFilter=function(b){return arguments.length?(n=b,a):n},a.shape=function(b,d){return arguments.length?(("rect"==b||"circle"==b||"line"==b||"path"==b&&"string"==typeof d)&&(c=b,A=d),a):c},a.shapeWidth=function(b){return arguments.length?(d=+b,a):d},a.shapeHeight=function(b){return arguments.length?(e=+b,a):e},a.shapeRadius=function(b){return arguments.length?(f=+b,a):f},a.shapePadding=function(b){return arguments.length?(l=+b,a):l},a.labels=function(b){return arguments.length?(o=b,a):o},a.labelAlign=function(b){return arguments.length?("start"!=b&&"end"!=b&&"middle"!=b||(v=b),a):v},a.locale=function(b){return arguments.length?(s=(0,j.formatLocale)(b),a):s},a.labelFormat=function(b){return arguments.length?(t=(0,j.formatSpecifier)(b),a):a.locale().format(t)},a.labelOffset=function(b){return arguments.length?(u=+b,a):u},a.labelDelimiter=function(b){return arguments.length?(w=b,a):w},a.labelWrap=function(b){return arguments.length?(x=b,a):x},a.useClass=function(b){return arguments.length?(b!==!0&&b!==!1||(q=b),a):q},a.orient=function(b){return arguments.length?(b=b.toLowerCase(),"horizontal"!=b&&"vertical"!=b||(y=b),a):y},a.ascending=function(b){return arguments.length?(z=!!b,a):z},a.classPrefix=function(b){return arguments.length?(p=b,a):p},a.title=function(b){return arguments.length?(r=b,a):r},a.titleWidth=function(b){return arguments.length?(B=b,a):B},a.textWrap=function(b){return arguments.length?(textWrap=b,a):textWrap},a.on=function(){var b=C.on.apply(C,arguments);return b===C?a:b},a}Object.defineProperty(c,"__esModule",{value:!0}),c.default=e;var f=a("./legend"),g=d(f),h=a("d3-dispatch"),i=a("d3-scale"),j=a("d3-format"),k=a("d3-array")},{"./legend":13,"d3-array":1,"d3-dispatch":4,"d3-format":5,"d3-scale":7}],12:[function(a,b,c){"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d=c.thresholdLabels=function(a){var b=a.i,c=a.genLength,d=a.generatedLabels;return 0===b?d[b].replace("NaN to","Less than"):b===c-1?"More than "+d[c-1].replace(" to NaN",""):d[b]};c.default={thresholdLabels:d}},{}],13:[function(a,b,c){"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},e=a("d3-selection"),f=a("d3-format"),g=function(a){return a},h=function(a){for(var b=[],c=0,d=a.length;cb&&f.length>1&&(f.pop(),i.text(f.join(" ")),f=[a],i=c.append("tspan").attr("x",0).attr("dy",g+h+"em").text(a))})},j=function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],b=arguments[1],c=arguments[2],e=arguments[3];if("object"===("undefined"==typeof b?"undefined":d(b))){if(0===b.length)return a;for(var f=b.length;f1)d=b;else for(var e=a.domain(),f=(e[e.length-1]-e[0])/(b-1),g=0;g1||b>=2)&&(f=b),a):f},a.cellFilter=function(b){return arguments.length?(l=b,a):l},a.shape=function(b,d){return arguments.length?("rect"!=b&&"circle"!=b&&"line"!=b||(c=b,x=d),a):c},a.shapeWidth=function(b){return arguments.length?(d=+b,a):d},a.shapePadding=function(b){return arguments.length?(e=+b,a):e},a.labels=function(b){return arguments.length?(m=b,a):m},a.labelAlign=function(b){return arguments.length?("start"!=b&&"end"!=b&&"middle"!=b||(s=b),a):s},a.locale=function(b){return arguments.length?(p=(0,j.formatLocale)(b),a):p},a.labelFormat=function(b){return arguments.length?(q=(0,j.formatSpecifier)(b),a):a.locale().format(q)},a.labelOffset=function(b){return arguments.length?(r=+b,a):r},a.labelDelimiter=function(b){return arguments.length?(t=b,a):t},a.labelWrap=function(b){return arguments.length?(u=b,a):u},a.orient=function(b){return arguments.length?(b=b.toLowerCase(),"horizontal"!=b&&"vertical"!=b||(v=b),a):v},a.ascending=function(b){return arguments.length?(w=!!b,a):w},a.classPrefix=function(b){return arguments.length?(n=b,a):n},a.title=function(b){return arguments.length?(o=b,a):o},a.titleWidth=function(b){return arguments.length?(y=b,a):y},a.on=function(){var b=z.on.apply(z,arguments);return b===z?a:b},a}Object.defineProperty(c,"__esModule",{value:!0}),c.default=e;var f=a("./legend"),g=d(f),h=a("d3-dispatch"),i=a("d3-scale"),j=a("d3-format"),k=a("d3-array")},{"./legend":13,"d3-array":1,"d3-dispatch":4,"d3-format":5,"d3-scale":7}],15:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(a){var h=g.default.d3_calcType(b,y,m,o,r.format(s),v),i=a.selectAll("g").data([b]);n&&g.default.d3_filterCells(h,n),i.enter().append("g").attr("class",p+"legendCells");var j=a.select("."+p+"legendCells").selectAll("."+p+"cell").data(h.data),B=j.enter().append("g").attr("class",p+"cell");B.append(c).attr("class",p+"swatch");var C=a.selectAll("g."+p+"cell "+c);g.default.d3_addEvents(B,A),j.exit().transition().style("opacity",0).remove(),C.exit().transition().style("opacity",0).remove(),C=C.merge(C),g.default.d3_drawShapes(c,C,e,d,f,h.feature),g.default.d3_addText(a,B,h.labels,p,w),j=B.merge(j);var D=j.selectAll("text"),E=D.nodes().map(function(a){return a.getBBox()}),F=C.nodes().map(function(a){return a.getBBox()}),G=(0,k.max)(F,function(a){return a.height}),H=(0,k.max)(F,function(a){return a.width}),I=void 0,J=void 0,K="start"==t?0:"middle"==t?.5:1;"vertical"===x?!function(){var a=E.map(function(a,b){return Math.max(G,a.height)});I=function(b,c){var d=(0,k.sum)(a.slice(0,c));return"translate(0, "+(d+c*l)+" )"},J=function(a,b){return"translate( "+(H+u)+",\n "+(F[b].y+F[b].height/2+5)+")"}}():"horizontal"===x&&(I=function(a,b){return"translate( "+b*(H+l)+",0)"},J=function(a,b){return"translate( "+(F[b].width*K+F[b].x)+",\n "+(G+u)+")"}),g.default.d3_placement(x,j,I,D,J,t),g.default.d3_title(a,q,p,z),j.transition().style("opacity",1)}var b=(0,i.scaleLinear)(),c="path",d=15,e=15,f=10,l=5,m=[5],n=void 0,o=[],p="",q="",r=g.default.d3_defaultLocale,s=g.default.d3_defaultFormatSpecifier,t="middle",u=10,v=g.default.d3_defaultDelimiter,w=void 0,x="vertical",y=!1,z=void 0,A=(0,h.dispatch)("cellover","cellout","cellclick");return a.scale=function(c){return arguments.length?(b=c,a):b},a.cells=function(b){return arguments.length?((b.length>1||b>=2)&&(m=b),a):m},a.cellFilter=function(b){return arguments.length?(n=b,a):n},a.shapePadding=function(b){return arguments.length?(l=+b,a):l},a.labels=function(b){return arguments.length?(o=b,a):o},a.labelAlign=function(b){return arguments.length?("start"!=b&&"end"!=b&&"middle"!=b||(t=b),a):t},a.locale=function(b){return arguments.length?(r=(0,j.formatLocale)(b),a):r},a.labelFormat=function(b){return arguments.length?(s=(0,j.formatSpecifier)(b),a):a.locale().format(s)},a.labelOffset=function(b){return arguments.length?(u=+b,a):u},a.labelDelimiter=function(b){return arguments.length?(v=b,a):v},a.labelWrap=function(b){return arguments.length?(w=b,a):w},a.orient=function(b){return arguments.length?(b=b.toLowerCase(),"horizontal"!=b&&"vertical"!=b||(x=b),a):x},a.ascending=function(b){return arguments.length?(y=!!b,a):y},a.classPrefix=function(b){return arguments.length?(p=b,a):p},a.title=function(b){return arguments.length?(q=b,a):q},a.titleWidth=function(b){return arguments.length?(z=b,a):z},a.on=function(){var b=A.on.apply(A,arguments);return b===A?a:b},a}Object.defineProperty(c,"__esModule",{value:!0}),c.default=e;var f=a("./legend"),g=d(f),h=a("d3-dispatch"),i=a("d3-scale"),j=a("d3-format"),k=a("d3-array")},{"./legend":13,"d3-array":1,"d3-dispatch":4,"d3-format":5,"d3-scale":7}],16:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{default:a}}var e=a("./color"),f=d(e),g=a("./size"),h=d(g),i=a("./symbol"),j=d(i),k=a("./helpers"),l=d(k);d3.legendColor=f.default,d3.legendSize=h.default,d3.legendSymbol=j.default,d3.legendHelpers=l.default},{"./color":11,"./helpers":12,"./size":14,"./symbol":15}]},{},[16]); \ No newline at end of file +!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c||a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;gb?1:a>=b?0:NaN}function c(a){return 1===a.length&&(a=d(a)),{left:function(b,c,d,e){for(null==d&&(d=0),null==e&&(e=b.length);d>>1;a(b[f],c)<0?d=f+1:e=f}return d},right:function(b,c,d,e){for(null==d&&(d=0),null==e&&(e=b.length);d>>1;a(b[f],c)>0?e=f:d=f+1}return d}}}function d(a){return function(c,d){return b(a(c),d)}}function e(a,b){return ba?1:b>=a?0:NaN}function f(a){return null===a?NaN:+a}function g(a,b){var c,d,e=a.length,g=0,h=0,i=-1,j=0;if(null==b)for(;++i1)return h/(j-1)}function h(a,b){var c=g(a,b);return c?Math.sqrt(c):c}function i(a,b){var c,d,e,f=-1,g=a.length;if(null==b){for(;++f=d){c=e=d;break}for(;++fd&&(c=d),e=d){c=e=d;break}for(;++fd&&(c=d),e=M?e*=10:f>=N?e*=5:f>=O&&(e*=2),b=k;)l.pop(),--n;var o,p=new Array(n+1);for(e=0;e<=n;++e)o=p[e]=[],o.x0=e>0?l[e-1]:j,o.x1=e=1)return+c(a[d-1],d-1,a);var d,e=(d-1)*b,g=Math.floor(e),h=+c(a[g],g,a);return h+(+c(a[g+1],g+1,a)-h)*(e-g)}}function r(a,c,d){return a=L.call(a,f).sort(b),Math.ceil((d-c)/(2*(q(a,.75)-q(a,.25))*Math.pow(a.length,-1/3)))}function s(a,b,c){return Math.ceil((c-b)/(3.5*h(a)*Math.pow(a.length,-1/3)))}function t(a,b){var c,d,e=-1,f=a.length;if(null==b){for(;++e=d){c=d;break}for(;++ec&&(c=d)}else{for(;++e=d){c=d;break}for(;++ec&&(c=d)}return c}function u(a,b){var c,d=0,e=a.length,g=-1,h=e;if(null==b)for(;++g=0;)for(d=a[e],b=d.length;--b>=0;)c[--g]=d[b];return c}function x(a,b){var c,d,e=-1,f=a.length;if(null==b){for(;++e=d){c=d;break}for(;++ed&&(c=d)}else{for(;++e=d){c=d;break}for(;++ed&&(c=d)}return c}function y(a){for(var b=0,c=a.length-1,d=a[0],e=new Array(c<0?0:c);b=k.length)return null!=h&&b.sort(h),null!=i?i(b):b;for(var g,j,l,m=-1,n=b.length,o=k[d++],p=c(),q=e();++mk.length)return a;var d,e=l[c-1];return null!=i&&c>=k.length?d=a.entries():(d=[],a.each(function(a,e){d.push({key:e,values:b(a,c)})})),null!=e?d.sort(function(a,b){return e(a.key,b.key)}):d}var h,i,j,k=[],l=[];return j={object:function(b){return a(b,0,d,e)},map:function(b){return a(b,0,f,g)},entries:function(c){return b(a(c,0,f,g),0)},key:function(a){return k.push(a),j},sortKeys:function(a){return l[k.length-1]=a,j},sortValues:function(a){return h=a,j},rollup:function(a){return i=a,j}}},l=c.prototype;h.prototype=i.prototype={constructor:h,has:l.has,add:function(a){return a+="",this[j+a]=a,this},remove:l.remove,clear:l.clear,values:l.keys,size:l.size,empty:l.empty,each:l.each};var m=function(a){var b=[];for(var c in a)b.push(c);return b},n=function(a){var b=[];for(var c in a)b.push(a[c]);return b},o=function(a){var b=[];for(var c in a)b.push({key:c,value:a[c]});return b};a.nest=k,a.set=i,a.map=c,a.keys=m,a.values=n,a.entries=o,Object.defineProperty(a,"__esModule",{value:!0})})},{}],3:[function(a,b,c){!function(a,d){"object"==typeof c&&void 0!==b?d(c):"function"==typeof define&&define.amd?define(["exports"],d):d(a.d3=a.d3||{})}(this,function(a){"use strict";function b(a,b){var c=Object.create(a.prototype);for(var d in b)c[d]=b[d];return c}function c(){}function d(a){var b;return a=(a+"").trim().toLowerCase(),(b=H.exec(a))?(b=parseInt(b[1],16),new i(b>>8&15|b>>4&240,b>>4&15|240&b,(15&b)<<4|15&b,1)):(b=I.exec(a))?e(parseInt(b[1],16)):(b=J.exec(a))?new i(b[1],b[2],b[3],1):(b=K.exec(a))?new i(255*b[1]/100,255*b[2]/100,255*b[3]/100,1):(b=L.exec(a))?f(b[1],b[2],b[3],b[4]):(b=M.exec(a))?f(255*b[1]/100,255*b[2]/100,255*b[3]/100,b[4]):(b=N.exec(a))?j(b[1],b[2]/100,b[3]/100,1):(b=O.exec(a))?j(b[1],b[2]/100,b[3]/100,b[4]):P.hasOwnProperty(a)?e(P[a]):"transparent"===a?new i(NaN,NaN,NaN,0):null}function e(a){return new i(a>>16&255,a>>8&255,255&a,1)}function f(a,b,c,d){return d<=0&&(a=b=c=NaN),new i(a,b,c,d)}function g(a){return a instanceof c||(a=d(a)),a?(a=a.rgb(),new i(a.r,a.g,a.b,a.opacity)):new i}function h(a,b,c,d){return 1===arguments.length?g(a):new i(a,b,c,null==d?1:d)}function i(a,b,c,d){this.r=+a,this.g=+b,this.b=+c,this.opacity=+d}function j(a,b,c,d){return d<=0?a=b=c=NaN:c<=0||c>=1?a=b=NaN:b<=0&&(a=NaN),new m(a,b,c,d)}function k(a){if(a instanceof m)return new m(a.h,a.s,a.l,a.opacity);if(a instanceof c||(a=d(a)),!a)return new m;if(a instanceof m)return a;a=a.rgb();var b=a.r/255,e=a.g/255,f=a.b/255,g=Math.min(b,e,f),h=Math.max(b,e,f),i=NaN,j=h-g,k=(h+g)/2;return j?(i=b===h?(e-f)/j+6*(e0&&k<1?0:i,new m(i,j,k,a.opacity)}function l(a,b,c,d){return 1===arguments.length?k(a):new m(a,b,c,null==d?1:d)}function m(a,b,c,d){this.h=+a,this.s=+b,this.l=+c,this.opacity=+d}function n(a,b,c){return 255*(a<60?b+(c-b)*a/60:a<180?c:a<240?b+(c-b)*(240-a)/60:b)}function o(a){if(a instanceof q)return new q(a.l,a.a,a.b,a.opacity);if(a instanceof x){var b=a.h*Q;return new q(a.l,Math.cos(b)*a.c,Math.sin(b)*a.c,a.opacity)}a instanceof i||(a=g(a));var c=u(a.r),d=u(a.g),e=u(a.b),f=r((.4124564*c+.3575761*d+.1804375*e)/T),h=r((.2126729*c+.7151522*d+.072175*e)/U);return new q(116*h-16,500*(f-h),200*(h-r((.0193339*c+.119192*d+.9503041*e)/V)),a.opacity)}function p(a,b,c,d){return 1===arguments.length?o(a):new q(a,b,c,null==d?1:d)}function q(a,b,c,d){this.l=+a,this.a=+b,this.b=+c,this.opacity=+d}function r(a){return a>Z?Math.pow(a,1/3):a/Y+W}function s(a){return a>X?a*a*a:Y*(a-W)}function t(a){return 255*(a<=.0031308?12.92*a:1.055*Math.pow(a,1/2.4)-.055)}function u(a){return(a/=255)<=.04045?a/12.92:Math.pow((a+.055)/1.055,2.4)}function v(a){if(a instanceof x)return new x(a.h,a.c,a.l,a.opacity);a instanceof q||(a=o(a));var b=Math.atan2(a.b,a.a)*R;return new x(b<0?b+360:b,Math.sqrt(a.a*a.a+a.b*a.b),a.l,a.opacity)}function w(a,b,c,d){return 1===arguments.length?v(a):new x(a,b,c,null==d?1:d)}function x(a,b,c,d){this.h=+a,this.c=+b,this.l=+c,this.opacity=+d}function y(a){if(a instanceof A)return new A(a.h,a.s,a.l,a.opacity);a instanceof i||(a=g(a));var b=a.r/255,c=a.g/255,d=a.b/255,e=(fa*d+da*b-ea*c)/(fa+da-ea),f=d-e,h=(ca*(c-e)-aa*f)/ba,j=Math.sqrt(h*h+f*f)/(ca*e*(1-e)),k=j?Math.atan2(h,f)*R-120:NaN;return new A(k<0?k+360:k,j,e,a.opacity)}function z(a,b,c,d){return 1===arguments.length?y(a):new A(a,b,c,null==d?1:d)}function A(a,b,c,d){this.h=+a,this.s=+b,this.l=+c,this.opacity=+d}var B=function(a,b,c){a.prototype=b.prototype=c,c.constructor=a},C=.7,D=1/C,E="\\s*([+-]?\\d+)\\s*",F="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",G="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",H=/^#([0-9a-f]{3})$/,I=/^#([0-9a-f]{6})$/,J=new RegExp("^rgb\\("+[E,E,E]+"\\)$"),K=new RegExp("^rgb\\("+[G,G,G]+"\\)$"),L=new RegExp("^rgba\\("+[E,E,E,F]+"\\)$"),M=new RegExp("^rgba\\("+[G,G,G,F]+"\\)$"),N=new RegExp("^hsl\\("+[F,G,G]+"\\)$"),O=new RegExp("^hsla\\("+[F,G,G,F]+"\\)$"),P={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};B(c,d,{displayable:function(){return this.rgb().displayable()},toString:function(){return this.rgb()+""}}),B(i,h,b(c,{brighter:function(a){return a=null==a?D:Math.pow(D,a),new i(this.r*a,this.g*a,this.b*a,this.opacity)},darker:function(a){return a=null==a?C:Math.pow(C,a),new i(this.r*a,this.g*a,this.b*a,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},toString:function(){var a=this.opacity;return a=isNaN(a)?1:Math.max(0,Math.min(1,a)),(1===a?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===a?")":", "+a+")")}})),B(m,l,b(c,{brighter:function(a){return a=null==a?D:Math.pow(D,a),new m(this.h,this.s,this.l*a,this.opacity)},darker:function(a){return a=null==a?C:Math.pow(C,a),new m(this.h,this.s,this.l*a,this.opacity)},rgb:function(){var a=this.h%360+360*(this.h<0),b=isNaN(a)||isNaN(this.s)?0:this.s,c=this.l,d=c+(c<.5?c:1-c)*b,e=2*c-d;return new i(n(a>=240?a-240:a+120,e,d),n(a,e,d),n(a<120?a+240:a-120,e,d),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var Q=Math.PI/180,R=180/Math.PI,S=18,T=.95047,U=1,V=1.08883,W=4/29,X=6/29,Y=3*X*X,Z=X*X*X;B(q,p,b(c,{brighter:function(a){return new q(this.l+S*(null==a?1:a),this.a,this.b,this.opacity)},darker:function(a){return new q(this.l-S*(null==a?1:a),this.a,this.b,this.opacity)},rgb:function(){var a=(this.l+16)/116,b=isNaN(this.a)?a:a+this.a/500,c=isNaN(this.b)?a:a-this.b/200;return a=U*s(a),b=T*s(b),c=V*s(c),new i(t(3.2404542*b-1.5371385*a-.4985314*c),t(-.969266*b+1.8760108*a+.041556*c),t(.0556434*b-.2040259*a+1.0572252*c),this.opacity)}})),B(x,w,b(c,{brighter:function(a){return new x(this.h,this.c,this.l+S*(null==a?1:a),this.opacity)},darker:function(a){return new x(this.h,this.c,this.l-S*(null==a?1:a),this.opacity)},rgb:function(){return o(this).rgb()}}));var $=-.14861,_=1.78277,aa=-.29227,ba=-.90649,ca=1.97294,da=ca*ba,ea=ca*_,fa=_*aa-ba*$;B(A,z,b(c,{brighter:function(a){return a=null==a?D:Math.pow(D,a),new A(this.h,this.s,this.l*a,this.opacity)},darker:function(a){return a=null==a?C:Math.pow(C,a),new A(this.h,this.s,this.l*a,this.opacity)},rgb:function(){var a=isNaN(this.h)?0:(this.h+120)*Q,b=+this.l,c=isNaN(this.s)?0:this.s*b*(1-b),d=Math.cos(a),e=Math.sin(a);return new i(255*(b+c*($*d+_*e)),255*(b+c*(aa*d+ba*e)),255*(b+c*(ca*d)),this.opacity)}})),a.color=d,a.rgb=h,a.hsl=l,a.lab=p,a.hcl=w,a.cubehelix=z,Object.defineProperty(a,"__esModule",{value:!0})})},{}],4:[function(a,b,c){!function(a,d){"object"==typeof c&&void 0!==b?d(c):"function"==typeof define&&define.amd?define(["exports"],d):d(a.d3=a.d3||{})}(this,function(a){"use strict";function b(){for(var a,b=0,d=arguments.length,e={};b=0&&(c=a.slice(d+1),a=a.slice(0,d)),a&&!b.hasOwnProperty(a))throw new Error("unknown type: "+a);return{type:a,name:c}})}function e(a,b){for(var c,d=0,e=a.length;d0)for(var c,d,e=new Array(c),f=0;f1?d[0]+d.slice(2):d,+a.slice(c+1)]}function c(a){return a=b(Math.abs(a)),a?a[1]:NaN}function d(a,b){return function(c,d){for(var e=c.length,f=[],g=0,h=a[0],i=0;e>0&&h>0&&(i+h+1>d&&(h=Math.max(1,d-i)),f.push(c.substring(e-=h,e+h)),!((i+=h+1)>d));)h=a[g=(g+1)%a.length];return f.reverse().join(b)}}function e(a,b){a=a.toPrecision(b);a:for(var c,d=a.length,e=1,f=-1;e0&&(f=0)}return f>0?a.slice(0,f)+a.slice(c+1):a}function f(a,c){var d=b(a,c);if(!d)return a+"";var e=d[0],f=d[1],g=f-(p=3*Math.max(-8,Math.min(8,Math.floor(f/3))))+1,h=e.length;return g===h?e:g>h?e+new Array(g-h+1).join("0"):g>0?e.slice(0,g)+"."+e.slice(g):"0."+new Array(1-g).join("0")+b(a,Math.max(0,c+g-1))[0]}function g(a,c){var d=b(a,c);if(!d)return a+"";var e=d[0],f=d[1];return f<0?"0."+new Array(-f).join("0")+e:e.length>f+1?e.slice(0,f+1)+"."+e.slice(f+1):e+new Array(f-e.length+2).join("0")}function h(a){return new i(a)}function i(a){if(!(b=r.exec(a)))throw new Error("invalid format: "+a);var b,c=b[1]||" ",d=b[2]||">",e=b[3]||"-",f=b[4]||"",g=!!b[5],h=b[6]&&+b[6],i=!!b[7],j=b[8]&&+b[8].slice(1),k=b[9]||"";"n"===k?(i=!0,k="g"):q[k]||(k=""),(g||"0"===c&&"="===d)&&(g=!0,c="0",d="="),this.fill=c,this.align=d,this.sign=e,this.symbol=f,this.zero=g,this.width=h,this.comma=i,this.precision=j,this.type=k}function j(a){return a}function k(a){function b(a){function b(a){var b,g,h,j=r,q=s;if("c"===o)q=u(a)+q,a="";else{a=+a;var w=(a<0||1/a<0)&&(a*=-1,!0);if(a=u(a,n),w)for(b=-1,g=a.length,w=!1;++b(h=a.charCodeAt(b))||h>57){q=(46===h?i+a.slice(b+1):a.slice(b))+q,a=a.slice(0,b);break}}m&&!k&&(a=f(a,1/0));var x=j.length+a.length+q.length,y=x>1)+j+a+q+y.slice(x)}return y+j+a+q}a=h(a);var c=a.fill,d=a.align,e=a.sign,j=a.symbol,k=a.zero,l=a.width,m=a.comma,n=a.precision,o=a.type,r="$"===j?g[0]:"#"===j&&/[boxX]/.test(o)?"0"+o.toLowerCase():"",s="$"===j?g[1]:/[%p]/.test(o)?"%":"",u=q[o],v=!o||/[defgprs%]/.test(o);return n=null==n?o?6:12:/[gprs]/.test(o)?Math.max(1,Math.min(21,n)):Math.max(0,Math.min(20,n)),b.toString=function(){return a+""},b}function e(a,d){var e=b((a=h(a),a.type="f",a)),f=3*Math.max(-8,Math.min(8,Math.floor(c(d)/3))),g=Math.pow(10,-f),i=t[8+f/3];return function(a){return e(g*a)+i}}var f=a.grouping&&a.thousands?d(a.grouping,a.thousands):j,g=a.currency,i=a.decimal;return{format:b,formatPrefix:e}}function l(b){return s=k(b),a.format=s.format,a.formatPrefix=s.formatPrefix,s}function m(a){return Math.max(0,-c(Math.abs(a)))}function n(a,b){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(c(b)/3)))-c(Math.abs(a)))}function o(a,b){return a=Math.abs(a),b=Math.abs(b)-a,Math.max(0,c(b)-c(a))+1}var p,q={"":e,"%":function(a,b){return(100*a).toFixed(b)},b:function(a){return Math.round(a).toString(2)},c:function(a){return a+""},d:function(a){return Math.round(a).toString(10)},e:function(a,b){return a.toExponential(b)},f:function(a,b){return a.toFixed(b)},g:function(a,b){return a.toPrecision(b)},o:function(a){return Math.round(a).toString(8)},p:function(a,b){return g(100*a,b)},r:g,s:f,X:function(a){return Math.round(a).toString(16).toUpperCase()},x:function(a){return Math.round(a).toString(16)}},r=/^(?:(.)?([<>=^]))?([+\-\( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?([a-z%])?$/i;i.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+this.type};var s,t=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];l({decimal:".",thousands:",",grouping:[3],currency:["$",""]}),a.formatDefaultLocale=l,a.formatLocale=k,a.formatSpecifier=h,a.precisionFixed=m,a.precisionPrefix=n,a.precisionRound=o,Object.defineProperty(a,"__esModule",{value:!0})})},{}],6:[function(a,b,c){!function(d,e){"object"==typeof c&&void 0!==b?e(c,a("d3-color")):"function"==typeof define&&define.amd?define(["exports","d3-color"],e):e(d.d3=d.d3||{},d.d3)}(this,function(a,b){"use strict";function c(a,b,c,d,e){var f=a*a,g=f*a;return((1-3*a+3*f-g)*b+(4-6*f+3*g)*c+(1+3*a+3*f-3*g)*d+g*e)/6}function d(a,b){return function(c){return a+c*b}}function e(a,b,c){return a=Math.pow(a,c),b=Math.pow(b,c)-a,c=1/c,function(d){return Math.pow(a+d*b,c)}}function f(a,b){var c=b-a;return c?d(a,c>180||c<-180?c-360*Math.round(c/360):c):B(isNaN(a)?b:a)}function g(a){return 1==(a=+a)?h:function(b,c){return c-b?e(b,c,a):B(isNaN(b)?c:b)}}function h(a,b){var c=b-a;return c?d(a,c):B(isNaN(a)?b:a)}function i(a){return function(c){var d,e,f=c.length,g=new Array(f),h=new Array(f),i=new Array(f);for(d=0;d180?b+=360:b-a>180&&(a+=360),f.push({i:c.push(e(c)+"rotate(",null,d)-2,x:H(a,b)})):b&&c.push(e(c)+"rotate("+b+d)}function h(a,b,c,f){a!==b?f.push({i:c.push(e(c)+"skewX(",null,d)-2,x:H(a,b)}):b&&c.push(e(c)+"skewX("+b+d)}function i(a,b,c,d,f,g){if(a!==c||b!==d){var h=f.push(e(f)+"scale(",null,",",null,")");g.push({i:h-4,x:H(a,c)},{i:h-2,x:H(b,d)})}else 1===c&&1===d||f.push(e(f)+"scale("+c+","+d+")")}return function(b,c){var d=[],e=[];return b=a(b),c=a(c),f(b.translateX,b.translateY,c.translateX,c.translateY,d,e),g(b.rotate,c.rotate,d,e),h(b.skewX,c.skewX,d,e),i(b.scaleX,b.scaleY,c.scaleX,c.scaleY,d,e),b=c=null,function(a){for(var b,c=-1,f=e.length;++c=1?(d=1,b-1):Math.floor(d*b),f=a[e],g=a[e+1],h=e>0?a[e-1]:2*f-g,i=ef&&(e=b.slice(f,e),h[g]?h[g]+=e:h[++g]=e),(c=c[0])===(d=d[0])?h[g]?h[g]+=d:h[++g]=d:(h[++g]=null,i.push({i:g,x:H(c,d)})),f=K.lastIndex;return f=c?1:d(a)}}}function q(a){return function(b,c){var d=a(b=+b,c=+c);return function(a){return a<=0?b:a>=1?c:d(a)}}}function r(a,b,c,d){var e=a[0],f=a[1],g=b[0],h=b[1];return f2?s:r,g=h=null,e}function e(b){return(g||(g=f(i,j,l?p(a):a,k)))(+b)}var f,g,h,i=$,j=$,k=d.interpolate,l=!1;return e.invert=function(a){return(h||(h=f(j,i,o,l?q(b):b)))(+a)},e.domain=function(a){return arguments.length?(i=X.call(a,n),c()):i.slice()},e.range=function(a){return arguments.length?(j=Y.call(a),c()):j.slice()},e.rangeRound=function(a){return j=Y.call(a),k=d.interpolateRound,c()},e.clamp=function(a){return arguments.length?(l=!!a,c()):l},e.interpolate=function(a){return arguments.length?(k=a,c()):k},c()}function v(a,c,d){var f,g=a[0],h=a[a.length-1],i=b.tickStep(g,h,null==c?10:c);switch(d=e.formatSpecifier(null==d?",f":d),d.type){case"s":var j=Math.max(Math.abs(g),Math.abs(h));return null!=d.precision||isNaN(f=e.precisionPrefix(i,j))||(d.precision=f),e.formatPrefix(d,j);case"":case"e":case"g":case"p":case"r":null!=d.precision||isNaN(f=e.precisionRound(i,Math.max(Math.abs(g),Math.abs(h))))||(d.precision=f-("e"===d.type));break;case"f":case"%":null!=d.precision||isNaN(f=e.precisionFixed(i))||(d.precision=f-2*("%"===d.type))}return e.format(d)}function w(a){var c=a.domain;return a.ticks=function(a){var d=c();return b.ticks(d[0],d[d.length-1],null==a?10:a)},a.tickFormat=function(a,b){return v(c(),a,b)},a.nice=function(d){var e=c(),f=e.length-1,g=null==d?10:d,h=e[0],i=e[f],j=b.tickStep(h,i,g);return j&&(j=b.tickStep(Math.floor(h/j)*j,Math.ceil(i/j)*j,g),e[0]=Math.floor(h/j)*j,e[f]=Math.ceil(i/j)*j,c(e)),a},a}function x(){var a=u(o,d.interpolateNumber);return a.copy=function(){return t(a,x())},w(a)}function y(){function a(a){return+a}var b=[0,1];return a.invert=a,a.domain=a.range=function(c){return arguments.length?(b=X.call(c,n),a):b.slice()},a.copy=function(){return y().domain(b)},w(a)}function z(a,b){a=a.slice();var c,d=0,e=a.length-1,f=a[d],g=a[e];return g0){for(;nj)break;q.push(m)}}else for(;n=1;--l)if(!((m=k*l)j)break;q.push(m)}}else q=b.ticks(n,o,Math.min(o-n,p)).map(h);return c?q.reverse():q},c.tickFormat=function(a,b){if(null==b&&(b=10===f?".0e":","),"function"!=typeof b&&(b=e.format(b)),a===1/0)return b;null==a&&(a=10);var d=Math.max(1,f*a/c.ticks().length);return function(a){var c=a/h(Math.round(g(a)));return c*f0?f[b-1]:d[0],b=f?[g[f-1],e]:[g[b-1],g[b]]},a.copy=function(){return L().domain([d,e]).range(h)},w(a)}function M(){function a(a){if(a<=a)return d[b.bisect(c,a,0,e)]}var c=[.5],d=[0,1],e=1;return a.domain=function(b){return arguments.length?(c=Y.call(b),e=Math.min(c.length,d.length-1),a):c.slice()},a.range=function(b){return arguments.length?(d=Y.call(b),e=Math.min(c.length,d.length-1),a):d.slice()},a.invertExtent=function(a){var b=d.indexOf(a);return[c[b-1],c[b]]},a.copy=function(){return M().domain(c).range(d)},a}function N(a){return new Date(a)}function O(a){return a instanceof Date?+a:+new Date(+a)}function P(a,c,e,f,g,h,i,j,k){function l(b){return(i(b)1)&&(a-=Math.floor(a));var b=Math.abs(a-.5);return na.h=360*a-100,na.s=1.5-1.5*b,na.l=.8-.9*b,na+""}function U(a){var b=a.length;return function(c){return a[Math.max(0,Math.min(b-1,Math.floor(c*b)))]}}function V(a){function b(b){var f=(b-c)/(d-c);return a(e?Math.max(0,Math.min(1,f)):f)}var c=0,d=1,e=!1;return b.domain=function(a){return arguments.length?(c=+a[0],d=+a[1],b):[c,d]},b.clamp=function(a){return arguments.length?(e=!!a,b):e},b.interpolator=function(c){return arguments.length?(a=c,b):a},b.copy=function(){return V(a).domain([c,d]).clamp(e)},w(b)}var W=Array.prototype,X=W.map,Y=W.slice,Z={name:"implicit"},$=[0,1],_=1e3,aa=60*_,ba=60*aa,ca=24*ba,da=7*ca,ea=30*ca,fa=365*ca,ga=S("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),ha=S("393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6"),ia=S("3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9"),ja=S("1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5"),ka=d.interpolateCubehelixLong(h.cubehelix(300,.5,0),h.cubehelix(-240,.5,1)),la=d.interpolateCubehelixLong(h.cubehelix(-100,.75,.35),h.cubehelix(80,1.5,.8)),ma=d.interpolateCubehelixLong(h.cubehelix(260,.75,.35),h.cubehelix(80,1.5,.8)),na=h.cubehelix(),oa=U(S("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),pa=U(S("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),qa=U(S("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),ra=U(S("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));a.scaleBand=j,a.scalePoint=l,a.scaleIdentity=y,a.scaleLinear=x,a.scaleLog=G,a.scaleOrdinal=i,a.scaleImplicit=Z,a.scalePow=I,a.scaleSqrt=J,a.scaleQuantile=K,a.scaleQuantize=L,a.scaleThreshold=M,a.scaleTime=Q,a.scaleUtc=R,a.schemeCategory10=ga,a.schemeCategory20b=ha,a.schemeCategory20c=ia,a.schemeCategory20=ja,a.interpolateCubehelixDefault=ka,a.interpolateRainbow=T,a.interpolateWarm=la,a.interpolateCool=ma,a.interpolateViridis=oa,a.interpolateMagma=pa,a.interpolateInferno=qa,a.interpolatePlasma=ra,a.scaleSequential=V,Object.defineProperty(a,"__esModule",{value:!0})})},{"d3-array":1,"d3-collection":2,"d3-color":3,"d3-format":5,"d3-interpolate":6,"d3-time":10,"d3-time-format":9}],8:[function(a,b,c){!function(a,d){"object"==typeof c&&void 0!==b?d(c):"function"==typeof define&&define.amd?define(["exports"],d):d(a.d3=a.d3||{})}(this,function(a){"use strict";function b(a){var b=a+="",c=b.indexOf(":");return c>=0&&"xmlns"!==(b=a.slice(0,c))&&(a=a.slice(c+1)),Qa.hasOwnProperty(b)?{space:Qa[b],local:a}:a}function c(a){return function(){var b=this.ownerDocument,c=this.namespaceURI;return c===Pa&&b.documentElement.namespaceURI===Pa?b.createElement(a):b.createElementNS(c,a)}}function d(a){return function(){return this.ownerDocument.createElementNS(a.space,a.local)}}function e(a){var e=b(a);return(e.local?d:c)(e)}function f(){return new g}function g(){this._="@"+(++Ra).toString(36)}function h(a,b,c){return a=i(a,b,c),function(b){var c=b.relatedTarget;c&&(c===this||8&c.compareDocumentPosition(this))||a.call(this,b)}}function i(b,c,d){return function(e){var f=a.event;a.event=e;try{b.call(this,this.__data__,c,d)}finally{a.event=f}}}function j(a){return a.trim().split(/^|\s+/).map(function(a){var b="",c=a.indexOf(".");return c>=0&&(b=a.slice(c+1),a=a.slice(0,c)),{type:a,name:b}})}function k(a){return function(){var b=this.__on;if(b){for(var c,d=0,e=-1,f=b.length;d=u&&(u=t+1);!(s=q[u])&&++u=0;)(d=e[f])&&(g&&g!==d.nextSibling&&g.parentNode.insertBefore(d,g),g=d);return this}function I(a){function b(b,c){return b&&c?a(b.__data__,c.__data__):!b-!c}a||(a=J);for(var c=this._groups,d=c.length,e=new Array(d),f=0;fb?1:a>=b?0:NaN}function K(){var a=arguments[0];return arguments[0]=this,a.apply(null,arguments),this}function L(){var a=new Array(this.size()),b=-1;return this.each(function(){a[++b]=this}),a}function M(){for(var a=this._groups,b=0,c=a.length;b1?this.each((null==b?Y:"function"==typeof b?$:Z)(a,b,null==c?"":c)):X(d=this.node()).getComputedStyle(d,null).getPropertyValue(a)}function aa(a){return function(){delete this[a]}}function ba(a,b){return function(){this[a]=b}}function ca(a,b){return function(){var c=b.apply(this,arguments);null==c?delete this[a]:this[a]=c}}function da(a,b){return arguments.length>1?this.each((null==b?aa:"function"==typeof b?ca:ba)(a,b)):this.node()[a]}function ea(a){return a.trim().split(/^|\s+/)}function fa(a){return a.classList||new ga(a)}function ga(a){this._node=a,this._names=ea(a.getAttribute("class")||"")}function ha(a,b){for(var c=fa(a),d=-1,e=b.length;++d=0&&(this._names.splice(b,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(a){return this._names.indexOf(a)>=0}};var Ya=[null];Ja.prototype=Ka.prototype={constructor:Ja,select:t,selectAll:w,filter:x,data:E,enter:z,exit:F,merge:G,order:H,sort:I,call:K,nodes:L,node:M,size:N,empty:O,each:P,attr:W,style:_,property:da,classed:ma,text:qa,html:ua,raise:wa,lower:ya,append:za,insert:Ba,remove:Da,datum:Ea,on:m,dispatch:Ia},a.creator=e,a.local=f,a.matcher=Va,a.mouse=q,a.namespace=b,a.namespaces=Qa,a.select=La,a.selectAll=Ma,a.selection=Ka,a.selector=s,a.selectorAll=v,a.touch=Na,a.touches=Oa,a.window=X,a.customEvent=n,Object.defineProperty(a,"__esModule",{value:!0})})},{}],9:[function(a,b,c){!function(d,e){"object"==typeof c&&void 0!==b?e(c,a("d3-time")):"function"==typeof define&&define.amd?define(["exports","d3-time"],e):e(d.d3=d.d3||{},d.d3)}(this,function(a,b){"use strict";function c(a){if(0<=a.y&&a.y<100){var b=new Date(-1,a.m,a.d,a.H,a.M,a.S,a.L);return b.setFullYear(a.y),b}return new Date(a.y,a.m,a.d,a.H,a.M,a.S,a.L)}function d(a){if(0<=a.y&&a.y<100){var b=new Date(Date.UTC(-1,a.m,a.d,a.H,a.M,a.S,a.L));return b.setUTCFullYear(a.y),b}return new Date(Date.UTC(a.y,a.m,a.d,a.H,a.M,a.S,a.L))}function e(a){return{y:a,m:0,d:1,H:0,M:0,S:0,L:0}}function f(a){function f(a,b){return function(c){var d,e,f,g=[],h=-1,i=0,j=a.length;for(c instanceof Date||(c=new Date(+c));++h53)return null;"w"in j||(j.w=1),"Z"in j?(g=d(e(j.y)),i=g.getUTCDay(),g=i>4||0===i?b.utcMonday.ceil(g):b.utcMonday(g),g=b.utcDay.offset(g,7*(j.V-1)),j.y=g.getUTCFullYear(),j.m=g.getUTCMonth(),j.d=g.getUTCDate()+(j.w+6)%7):(g=c(e(j.y)),i=g.getDay(), +g=i>4||0===i?b.timeMonday.ceil(g):b.timeMonday(g),g=b.timeDay.offset(g,7*(j.V-1)),j.y=g.getFullYear(),j.m=g.getMonth(),j.d=g.getDate()+(j.w+6)%7)}else("W"in j||"U"in j)&&("w"in j||(j.w="u"in j?j.u%7:"W"in j?1:0),i="Z"in j?d(e(j.y)).getUTCDay():c(e(j.y)).getDay(),j.m=0,j.d="W"in j?(j.w+6)%7+7*j.W-(i+5)%7:j.w+7*j.U-(i+6)%7);return"Z"in j?(j.H+=j.Z/100|0,j.M+=j.Z%100,d(j)):c(j)}}function h(a,b,c,d){for(var e,f,g=0,h=b.length,i=c.length;g=i)return-1;if(37===(e=b.charCodeAt(g++))){if(e=b.charAt(g++),!(f=Za[e in qa?b.charAt(g++):e])||(d=f(a,c,d))<0)return-1}else if(e!=c.charCodeAt(d++))return-1}return d}function ma(a,b,c){var d=Na.exec(b.slice(c));return d?(a.p=Oa[d[0].toLowerCase()],c+d[0].length):-1}function na(a,b,c){var d=Ra.exec(b.slice(c));return d?(a.w=Sa[d[0].toLowerCase()],c+d[0].length):-1}function oa(a,b,c){var d=Pa.exec(b.slice(c));return d?(a.w=Qa[d[0].toLowerCase()],c+d[0].length):-1}function pa(a,b,c){var d=Va.exec(b.slice(c));return d?(a.m=Wa[d[0].toLowerCase()],c+d[0].length):-1}function ra(a,b,c){var d=Ta.exec(b.slice(c));return d?(a.m=Ua[d[0].toLowerCase()],c+d[0].length):-1}function sa(a,b,c){return h(a,Fa,b,c)}function ta(a,b,c){return h(a,Ga,b,c)}function ua(a,b,c){return h(a,Ha,b,c)}function va(a){return Ka[a.getDay()]}function wa(a){return Ja[a.getDay()]}function xa(a){return Ma[a.getMonth()]}function ya(a){return La[a.getMonth()]}function za(a){return Ia[+(a.getHours()>=12)]}function Aa(a){return Ka[a.getUTCDay()]}function Ba(a){return Ja[a.getUTCDay()]}function Ca(a){return Ma[a.getUTCMonth()]}function Da(a){return La[a.getUTCMonth()]}function Ea(a){return Ia[+(a.getUTCHours()>=12)]}var Fa=a.dateTime,Ga=a.date,Ha=a.time,Ia=a.periods,Ja=a.days,Ka=a.shortDays,La=a.months,Ma=a.shortMonths,Na=i(Ia),Oa=j(Ia),Pa=i(Ja),Qa=j(Ja),Ra=i(Ka),Sa=j(Ka),Ta=i(La),Ua=j(La),Va=i(Ma),Wa=j(Ma),Xa={a:va,A:wa,b:xa,B:ya,c:null,d:D,e:D,f:I,H:E,I:F,j:G,L:H,m:J,M:K,p:za,Q:ka,s:la,S:L,u:M,U:N,V:O,w:P,W:Q,x:null,X:null,y:R,Y:S,Z:T,"%":ja},Ya={a:Aa,A:Ba,b:Ca,B:Da,c:null,d:U,e:U,f:Z,H:V,I:W,j:X,L:Y,m:$,M:_,p:Ea,Q:ka,s:la,S:aa,u:ba,U:ca,V:da,w:ea,W:fa,x:null,X:null,y:ga,Y:ha,Z:ia,"%":ja},Za={a:na,A:oa,b:pa,B:ra,c:sa,d:t,e:t,f:z,H:v,I:v,j:u,L:y,m:s,M:w,p:ma,Q:B,s:C,S:x,u:l,U:m,V:n,w:k,W:o,x:ta,X:ua,y:q,Y:p,Z:r,"%":A};return Xa.x=f(Ga,Xa),Xa.X=f(Ha,Xa),Xa.c=f(Fa,Xa),Ya.x=f(Ga,Ya),Ya.X=f(Ha,Ya),Ya.c=f(Fa,Ya),{format:function(a){var b=f(a+="",Xa);return b.toString=function(){return a},b},parse:function(a){var b=g(a+="",c);return b.toString=function(){return a},b},utcFormat:function(a){var b=f(a+="",Ya);return b.toString=function(){return a},b},utcParse:function(a){var b=g(a,d);return b.toString=function(){return a},b}}}function g(a,b,c){var d=a<0?"-":"",e=(d?-a:a)+"",f=e.length;return d+(f68?1900:2e3),c+d[0].length):-1}function r(a,b,c){var d=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(b.slice(c,c+6));return d?(a.Z=d[1]?0:-(d[2]+(d[3]||"00")),c+d[0].length):-1}function s(a,b,c){var d=ra.exec(b.slice(c,c+2));return d?(a.m=d[0]-1,c+d[0].length):-1}function t(a,b,c){var d=ra.exec(b.slice(c,c+2));return d?(a.d=+d[0],c+d[0].length):-1}function u(a,b,c){var d=ra.exec(b.slice(c,c+3));return d?(a.m=0,a.d=+d[0],c+d[0].length):-1}function v(a,b,c){var d=ra.exec(b.slice(c,c+2));return d?(a.H=+d[0],c+d[0].length):-1}function w(a,b,c){var d=ra.exec(b.slice(c,c+2));return d?(a.M=+d[0],c+d[0].length):-1}function x(a,b,c){var d=ra.exec(b.slice(c,c+2));return d?(a.S=+d[0],c+d[0].length):-1}function y(a,b,c){var d=ra.exec(b.slice(c,c+3));return d?(a.L=+d[0],c+d[0].length):-1}function z(a,b,c){var d=ra.exec(b.slice(c,c+6));return d?(a.L=Math.floor(d[0]/1e3),c+d[0].length):-1}function A(a,b,c){var d=sa.exec(b.slice(c,c+1));return d?c+d[0].length:-1}function B(a,b,c){var d=ra.exec(b.slice(c));return d?(a.Q=+d[0],c+d[0].length):-1}function C(a,b,c){var d=ra.exec(b.slice(c));return d?(a.Q=1e3*+d[0],c+d[0].length):-1}function D(a,b){return g(a.getDate(),b,2)}function E(a,b){return g(a.getHours(),b,2)}function F(a,b){return g(a.getHours()%12||12,b,2)}function G(a,c){return g(1+b.timeDay.count(b.timeYear(a),a),c,3)}function H(a,b){return g(a.getMilliseconds(),b,3)}function I(a,b){return H(a,b)+"000"}function J(a,b){return g(a.getMonth()+1,b,2)}function K(a,b){return g(a.getMinutes(),b,2)}function L(a,b){return g(a.getSeconds(),b,2)}function M(a){var b=a.getDay();return 0===b?7:b}function N(a,c){return g(b.timeSunday.count(b.timeYear(a),a),c,2)}function O(a,c){var d=a.getDay();return a=d>=4||0===d?b.timeThursday(a):b.timeThursday.ceil(a),g(b.timeThursday.count(b.timeYear(a),a)+(4===b.timeYear(a).getDay()),c,2)}function P(a){return a.getDay()}function Q(a,c){return g(b.timeMonday.count(b.timeYear(a),a),c,2)}function R(a,b){return g(a.getFullYear()%100,b,2)}function S(a,b){return g(a.getFullYear()%1e4,b,4)}function T(a){var b=a.getTimezoneOffset();return(b>0?"-":(b*=-1,"+"))+g(b/60|0,"0",2)+g(b%60,"0",2)}function U(a,b){return g(a.getUTCDate(),b,2)}function V(a,b){return g(a.getUTCHours(),b,2)}function W(a,b){return g(a.getUTCHours()%12||12,b,2)}function X(a,c){return g(1+b.utcDay.count(b.utcYear(a),a),c,3)}function Y(a,b){return g(a.getUTCMilliseconds(),b,3)}function Z(a,b){return Y(a,b)+"000"}function $(a,b){return g(a.getUTCMonth()+1,b,2)}function _(a,b){return g(a.getUTCMinutes(),b,2)}function aa(a,b){return g(a.getUTCSeconds(),b,2)}function ba(a){var b=a.getUTCDay();return 0===b?7:b}function ca(a,c){return g(b.utcSunday.count(b.utcYear(a),a),c,2)}function da(a,c){var d=a.getUTCDay();return a=d>=4||0===d?b.utcThursday(a):b.utcThursday.ceil(a),g(b.utcThursday.count(b.utcYear(a),a)+(4===b.utcYear(a).getUTCDay()),c,2)}function ea(a){return a.getUTCDay()}function fa(a,c){return g(b.utcMonday.count(b.utcYear(a),a),c,2)}function ga(a,b){return g(a.getUTCFullYear()%100,b,2)}function ha(a,b){return g(a.getUTCFullYear()%1e4,b,4)}function ia(){return"+0000"}function ja(){return"%"}function ka(a){return+a}function la(a){return Math.floor(+a/1e3)}function ma(b){return pa=f(b),a.timeFormat=pa.format,a.timeParse=pa.parse,a.utcFormat=pa.utcFormat,a.utcParse=pa.utcParse,pa}function na(a){return a.toISOString()}function oa(a){var b=new Date(a);return isNaN(b)?null:b}var pa,qa={"-":"",_:" ",0:"0"},ra=/^\s*\d+/,sa=/^%/,ta=/[\\^$*+?|[\]().{}]/g;ma({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var ua="%Y-%m-%dT%H:%M:%S.%LZ",va=Date.prototype.toISOString?na:a.utcFormat(ua),wa=+new Date("2000-01-01T00:00:00.000Z")?oa:a.utcParse(ua);a.timeFormatDefaultLocale=ma,a.timeFormatLocale=f,a.isoFormat=va,a.isoParse=wa,Object.defineProperty(a,"__esModule",{value:!0})})},{"d3-time":10}],10:[function(a,b,c){!function(a,d){"object"==typeof c&&void 0!==b?d(c):"function"==typeof define&&define.amd?define(["exports"],d):d(a.d3=a.d3||{})}(this,function(a){"use strict";function b(a,c,d,g){function h(b){return a(b=new Date(+b)),b}return h.floor=h,h.ceil=function(b){return a(b=new Date(b-1)),c(b,1),a(b),b},h.round=function(a){var b=h(a),c=h.ceil(a);return a-b0))return f;do{f.push(new Date(+b))}while(c(b,e),a(b),b=b)for(;a(b),!d(b);)b.setTime(b-1)},function(a,b){if(a>=a)if(b<0)for(;++b<=0;)for(;c(a,-1),!d(a););else for(;--b>=0;)for(;c(a,1),!d(a););})},d&&(h.count=function(b,c){return e.setTime(+b),f.setTime(+c),a(e),a(f),Math.floor(d(e,f))},h.every=function(a){return a=Math.floor(a),isFinite(a)&&a>0?a>1?h.filter(g?function(b){return g(b)%a==0}:function(b){return h.count(0,b)%a==0}):h:null}),h}function c(a){return b(function(b){b.setDate(b.getDate()-(b.getDay()+7-a)%7),b.setHours(0,0,0,0)},function(a,b){a.setDate(a.getDate()+7*b)},function(a,b){return(b-a-(b.getTimezoneOffset()-a.getTimezoneOffset())*j)/m})}function d(a){return b(function(b){b.setUTCDate(b.getUTCDate()-(b.getUTCDay()+7-a)%7),b.setUTCHours(0,0,0,0)},function(a,b){a.setUTCDate(a.getUTCDate()+7*b)},function(a,b){return(b-a)/m})}var e=new Date,f=new Date,g=b(function(){},function(a,b){a.setTime(+a+b)},function(a,b){return b-a});g.every=function(a){return a=Math.floor(a),isFinite(a)&&a>0?a>1?b(function(b){b.setTime(Math.floor(b/a)*a)},function(b,c){b.setTime(+b+c*a)},function(b,c){return(c-b)/a}):g:null};var h=g.range,i=1e3,j=6e4,k=36e5,l=864e5,m=6048e5,n=b(function(a){a.setTime(Math.floor(a/i)*i)},function(a,b){a.setTime(+a+b*i)},function(a,b){return(b-a)/i},function(a){return a.getUTCSeconds()}),o=n.range,p=b(function(a){a.setTime(Math.floor(a/j)*j)},function(a,b){a.setTime(+a+b*j)},function(a,b){return(b-a)/j},function(a){return a.getMinutes()}),q=p.range,r=b(function(a){var b=a.getTimezoneOffset()*j%k;b<0&&(b+=k),a.setTime(Math.floor((+a-b)/k)*k+b)},function(a,b){a.setTime(+a+b*k)},function(a,b){return(b-a)/k},function(a){return a.getHours()}),s=r.range,t=b(function(a){a.setHours(0,0,0,0)},function(a,b){a.setDate(a.getDate()+b)},function(a,b){return(b-a-(b.getTimezoneOffset()-a.getTimezoneOffset())*j)/l},function(a){return a.getDate()-1}),u=t.range,v=c(0),w=c(1),x=c(2),y=c(3),z=c(4),A=c(5),B=c(6),C=v.range,D=w.range,E=x.range,F=y.range,G=z.range,H=A.range,I=B.range,J=b(function(a){a.setDate(1),a.setHours(0,0,0,0)},function(a,b){a.setMonth(a.getMonth()+b)},function(a,b){return b.getMonth()-a.getMonth()+12*(b.getFullYear()-a.getFullYear())},function(a){return a.getMonth()}),K=J.range,L=b(function(a){a.setMonth(0,1),a.setHours(0,0,0,0)},function(a,b){a.setFullYear(a.getFullYear()+b)},function(a,b){return b.getFullYear()-a.getFullYear()},function(a){return a.getFullYear()});L.every=function(a){return isFinite(a=Math.floor(a))&&a>0?b(function(b){b.setFullYear(Math.floor(b.getFullYear()/a)*a),b.setMonth(0,1),b.setHours(0,0,0,0)},function(b,c){b.setFullYear(b.getFullYear()+c*a)}):null};var M=L.range,N=b(function(a){a.setUTCSeconds(0,0)},function(a,b){a.setTime(+a+b*j)},function(a,b){return(b-a)/j},function(a){return a.getUTCMinutes()}),O=N.range,P=b(function(a){a.setUTCMinutes(0,0,0)},function(a,b){a.setTime(+a+b*k)},function(a,b){return(b-a)/k},function(a){return a.getUTCHours()}),Q=P.range,R=b(function(a){a.setUTCHours(0,0,0,0)},function(a,b){a.setUTCDate(a.getUTCDate()+b)},function(a,b){return(b-a)/l},function(a){return a.getUTCDate()-1}),S=R.range,T=d(0),U=d(1),V=d(2),W=d(3),X=d(4),Y=d(5),Z=d(6),$=T.range,_=U.range,aa=V.range,ba=W.range,ca=X.range,da=Y.range,ea=Z.range,fa=b(function(a){a.setUTCDate(1),a.setUTCHours(0,0,0,0)},function(a,b){a.setUTCMonth(a.getUTCMonth()+b)},function(a,b){return b.getUTCMonth()-a.getUTCMonth()+12*(b.getUTCFullYear()-a.getUTCFullYear())},function(a){return a.getUTCMonth()}),ga=fa.range,ha=b(function(a){a.setUTCMonth(0,1),a.setUTCHours(0,0,0,0)},function(a,b){a.setUTCFullYear(a.getUTCFullYear()+b)},function(a,b){return b.getUTCFullYear()-a.getUTCFullYear()},function(a){return a.getUTCFullYear()});ha.every=function(a){return isFinite(a=Math.floor(a))&&a>0?b(function(b){b.setUTCFullYear(Math.floor(b.getUTCFullYear()/a)*a),b.setUTCMonth(0,1),b.setUTCHours(0,0,0,0)},function(b,c){b.setUTCFullYear(b.getUTCFullYear()+c*a)}):null};var ia=ha.range;a.timeInterval=b,a.timeMillisecond=g,a.timeMilliseconds=h,a.utcMillisecond=g,a.utcMilliseconds=h,a.timeSecond=n,a.timeSeconds=o,a.utcSecond=n,a.utcSeconds=o,a.timeMinute=p,a.timeMinutes=q,a.timeHour=r,a.timeHours=s,a.timeDay=t,a.timeDays=u,a.timeWeek=v,a.timeWeeks=C,a.timeSunday=v,a.timeSundays=C,a.timeMonday=w,a.timeMondays=D,a.timeTuesday=x,a.timeTuesdays=E,a.timeWednesday=y,a.timeWednesdays=F,a.timeThursday=z,a.timeThursdays=G,a.timeFriday=A,a.timeFridays=H,a.timeSaturday=B,a.timeSaturdays=I,a.timeMonth=J,a.timeMonths=K,a.timeYear=L,a.timeYears=M,a.utcMinute=N,a.utcMinutes=O,a.utcHour=P,a.utcHours=Q,a.utcDay=R,a.utcDays=S,a.utcWeek=T,a.utcWeeks=$,a.utcSunday=T,a.utcSundays=$,a.utcMonday=U,a.utcMondays=_,a.utcTuesday=V,a.utcTuesdays=aa,a.utcWednesday=W,a.utcWednesdays=ba,a.utcThursday=X,a.utcThursdays=ca,a.utcFriday=Y,a.utcFridays=da,a.utcSaturday=Z,a.utcSaturdays=ea,a.utcMonth=fa,a.utcMonths=ga,a.utcYear=ha,a.utcYears=ia,Object.defineProperty(a,"__esModule",{value:!0})})},{}],11:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(a){var h=g.default.d3_calcType(b,z,m,o,s.format(t),w);a.selectAll("g").data([b]).enter().append("g").attr("class",p+"legendCells"),n&&g.default.d3_filterCells(h,n);var i=a.select("."+p+"legendCells").selectAll("."+p+"cell").data(h.data),j=i.enter().append("g").attr("class",p+"cell");j.append(c).attr("class",p+"swatch");var D=a.selectAll("g."+p+"cell "+c+"."+p+"swatch").data(h.data);g.default.d3_addEvents(j,C),i.exit().transition().style("opacity",0).remove(),D.exit().transition().style("opacity",0).remove(),D=D.merge(D),g.default.d3_drawShapes(c,D,e,d,f,A),g.default.d3_addText(a,j,h.labels,p,x),i=j.merge(i);var E=i.selectAll("text"),F=E.nodes().map(function(a){return a.getBBox()}),G=D.nodes().map(function(a){return a.getBBox()});q?D.attr("class",function(a){return p+"swatch "+h.feature(a)}):"line"==c?D.style("stroke",h.feature):D.style("fill",h.feature);var H=void 0,I=void 0,J="start"==v?0:"middle"==v?.5:1;if("vertical"===y){var K=F.map(function(a,b){return Math.max(a.height,G[b].height)});H=function(a,b){return"translate(0, "+((0,k.sum)(K.slice(0,b))+b*l)+")"},I=function(a,b){return"translate( "+(G[b].width+G[b].x+u)+", "+(G[b].y+G[b].height/2+5)+")"}}else"horizontal"===y&&(H=function(a,b){return"translate("+b*(G[b].width+l)+",0)"},I=function(a,b){return"translate("+(G[b].width*J+G[b].x)+",\n "+(G[b].height+G[b].y+u+8)+")"});g.default.d3_placement(y,i,H,E,I,v),g.default.d3_title(a,r,p,B),i.transition().style("opacity",1)}var b=(0,i.scaleLinear)(),c="rect",d=15,e=15,f=10,l=2,m=[5],n=void 0,o=[],p="",q=!1,r="",s=g.default.d3_defaultLocale,t=g.default.d3_defaultFormatSpecifier,u=10,v="middle",w=g.default.d3_defaultDelimiter,x=void 0,y="vertical",z=!1,A=void 0,B=void 0,C=(0,h.dispatch)("cellover","cellout","cellclick");return a.scale=function(c){return arguments.length?(b=c,a):b},a.cells=function(b){return arguments.length?((b.length>1||b>=2)&&(m=b),a):m},a.cellFilter=function(b){return arguments.length?(n=b,a):n},a.shape=function(b,d){return arguments.length?(("rect"==b||"circle"==b||"line"==b||"path"==b&&"string"==typeof d)&&(c=b,A=d),a):c},a.shapeWidth=function(b){return arguments.length?(d=+b,a):d},a.shapeHeight=function(b){return arguments.length?(e=+b,a):e},a.shapeRadius=function(b){return arguments.length?(f=+b,a):f},a.shapePadding=function(b){return arguments.length?(l=+b,a):l},a.labels=function(b){return arguments.length?(o=b,a):o},a.labelAlign=function(b){return arguments.length?("start"!=b&&"end"!=b&&"middle"!=b||(v=b),a):v},a.locale=function(b){return arguments.length?(s=(0,j.formatLocale)(b),a):s},a.labelFormat=function(b){return arguments.length?(t=(0,j.formatSpecifier)(b),a):a.locale().format(t)},a.labelOffset=function(b){return arguments.length?(u=+b,a):u},a.labelDelimiter=function(b){return arguments.length?(w=b,a):w},a.labelWrap=function(b){return arguments.length?(x=b,a):x},a.useClass=function(b){return arguments.length?(!0!==b&&!1!==b||(q=b),a):q},a.orient=function(b){return arguments.length?(b=b.toLowerCase(),"horizontal"!=b&&"vertical"!=b||(y=b),a):y},a.ascending=function(b){return arguments.length?(z=!!b,a):z},a.classPrefix=function(b){return arguments.length?(p=b,a):p},a.title=function(b){return arguments.length?(r=b,a):r},a.titleWidth=function(b){return arguments.length?(B=b,a):B},a.textWrap=function(b){return arguments.length?(textWrap=b,a):textWrap},a.on=function(){var b=C.on.apply(C,arguments);return b===C?a:b},a}Object.defineProperty(c,"__esModule",{value:!0}),c.default=e;var f=a("./legend"),g=d(f),h=a("d3-dispatch"),i=a("d3-scale"),j=a("d3-format"),k=a("d3-array")},{"./legend":13,"d3-array":1,"d3-dispatch":4,"d3-format":5,"d3-scale":7}],12:[function(a,b,c){"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d=c.thresholdLabels=function(a){var b=a.i,c=a.genLength,d=a.generatedLabels;return 0===b?d[b].replace("NaN to","Less than"):b===c-1?"More than "+d[c-1].replace(" to NaN",""):d[b]};c.default={thresholdLabels:d}},{}],13:[function(a,b,c){"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},e=a("d3-selection"),f=a("d3-format"),g=function(a){return a},h=function(a){for(var b=[],c=0,d=a.length;cb&&f.length>1&&(f.pop(),i.text(f.join(" ")),f=[a],i=c.append("tspan").attr("x",0).attr("dy",g+h+"em").text(a))})},j=function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],b=arguments[1],c=arguments[2],e=arguments[3];if("object"===(void 0===b?"undefined":d(b))){if(0===b.length)return a;for(var f=b.length;f1)d=b;else for(var e=a.domain(),f=(e[e.length-1]-e[0])/(b-1),g=0;g1||b>=2)&&(f=b),a):f},a.cellFilter=function(b){return arguments.length?(l=b,a):l},a.shape=function(b,d){return arguments.length?("rect"!=b&&"circle"!=b&&"line"!=b||(c=b,x=d),a):c},a.shapeWidth=function(b){return arguments.length?(d=+b,a):d},a.shapePadding=function(b){return arguments.length?(e=+b,a):e},a.labels=function(b){return arguments.length?(m=b,a):m},a.labelAlign=function(b){return arguments.length?("start"!=b&&"end"!=b&&"middle"!=b||(s=b),a):s},a.locale=function(b){return arguments.length?(p=(0,j.formatLocale)(b),a):p},a.labelFormat=function(b){return arguments.length?(q=(0,j.formatSpecifier)(b),a):a.locale().format(q)},a.labelOffset=function(b){return arguments.length?(r=+b,a):r},a.labelDelimiter=function(b){return arguments.length?(t=b,a):t},a.labelWrap=function(b){return arguments.length?(u=b,a):u},a.orient=function(b){return arguments.length?(b=b.toLowerCase(),"horizontal"!=b&&"vertical"!=b||(v=b),a):v},a.ascending=function(b){return arguments.length?(w=!!b,a):w},a.classPrefix=function(b){return arguments.length?(n=b,a):n},a.title=function(b){return arguments.length?(o=b,a):o},a.titleWidth=function(b){return arguments.length?(y=b,a):y},a.on=function(){var b=z.on.apply(z,arguments);return b===z?a:b},a}Object.defineProperty(c,"__esModule",{value:!0}),c.default=e;var f=a("./legend"),g=d(f),h=a("d3-dispatch"),i=a("d3-scale"),j=a("d3-format"),k=a("d3-array")},{"./legend":13,"d3-array":1,"d3-dispatch":4,"d3-format":5,"d3-scale":7}],15:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(a){var h=g.default.d3_calcType(b,y,m,o,r.format(s),v),i=a.selectAll("g").data([b]);n&&g.default.d3_filterCells(h,n),i.enter().append("g").attr("class",p+"legendCells");var j=a.select("."+p+"legendCells").selectAll("."+p+"cell").data(h.data),B=j.enter().append("g").attr("class",p+"cell");B.append(c).attr("class",p+"swatch");var C=a.selectAll("g."+p+"cell "+c+"."+p+"swatch");g.default.d3_addEvents(B,A),j.exit().transition().style("opacity",0).remove(),C.exit().transition().style("opacity",0).remove(),C=C.merge(C),g.default.d3_drawShapes(c,C,e,d,f,h.feature),g.default.d3_addText(a,B,h.labels,p,w),j=B.merge(j);var D=j.selectAll("text"),E=D.nodes().map(function(a){return a.getBBox()}),F=C.nodes().map(function(a){return a.getBBox()}),G=(0,k.max)(F,function(a){return a.height}),H=(0,k.max)(F,function(a){return a.width}),I=void 0,J=void 0,K="start"==t?0:"middle"==t?.5:1;if("vertical"===x){var L=E.map(function(a,b){return Math.max(G,a.height)});I=function(a,b){return"translate(0, "+((0,k.sum)(L.slice(0,b))+b*l)+" )"},J=function(a,b){return"translate( "+(H+u)+",\n "+(F[b].y+F[b].height/2+5)+")"}}else"horizontal"===x&&(I=function(a,b){return"translate( "+b*(H+l)+",0)"},J=function(a,b){return"translate( "+(F[b].width*K+F[b].x)+",\n "+(G+u)+")"});g.default.d3_placement(x,j,I,D,J,t),g.default.d3_title(a,q,p,z),j.transition().style("opacity",1)}var b=(0,i.scaleLinear)(),c="path",d=15,e=15,f=10,l=5,m=[5],n=void 0,o=[],p="",q="",r=g.default.d3_defaultLocale,s=g.default.d3_defaultFormatSpecifier,t="middle",u=10,v=g.default.d3_defaultDelimiter,w=void 0,x="vertical",y=!1,z=void 0,A=(0,h.dispatch)("cellover","cellout","cellclick");return a.scale=function(c){return arguments.length?(b=c,a):b},a.cells=function(b){return arguments.length?((b.length>1||b>=2)&&(m=b),a):m},a.cellFilter=function(b){return arguments.length?(n=b,a):n},a.shapePadding=function(b){return arguments.length?(l=+b,a):l},a.labels=function(b){return arguments.length?(o=b,a):o},a.labelAlign=function(b){return arguments.length?("start"!=b&&"end"!=b&&"middle"!=b||(t=b),a):t},a.locale=function(b){return arguments.length?(r=(0,j.formatLocale)(b),a):r},a.labelFormat=function(b){return arguments.length?(s=(0,j.formatSpecifier)(b),a):a.locale().format(s)},a.labelOffset=function(b){return arguments.length?(u=+b,a):u},a.labelDelimiter=function(b){return arguments.length?(v=b,a):v},a.labelWrap=function(b){return arguments.length?(w=b,a):w},a.orient=function(b){return arguments.length?(b=b.toLowerCase(),"horizontal"!=b&&"vertical"!=b||(x=b),a):x},a.ascending=function(b){return arguments.length?(y=!!b,a):y},a.classPrefix=function(b){return arguments.length?(p=b,a):p},a.title=function(b){return arguments.length?(q=b,a):q},a.titleWidth=function(b){return arguments.length?(z=b,a):z},a.on=function(){var b=A.on.apply(A,arguments);return b===A?a:b},a}Object.defineProperty(c,"__esModule",{value:!0}),c.default=e;var f=a("./legend"),g=d(f),h=a("d3-dispatch"),i=a("d3-scale"),j=a("d3-format"),k=a("d3-array")},{"./legend":13,"d3-array":1,"d3-dispatch":4,"d3-format":5,"d3-scale":7}],16:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{default:a}}var e=a("./color"),f=d(e),g=a("./size"),h=d(g),i=a("./symbol"),j=d(i),k=a("./helpers"),l=d(k);d3.legendColor=f.default,d3.legendSize=h.default,d3.legendSymbol=j.default,d3.legendHelpers=l.default},{"./color":11,"./helpers":12,"./size":14,"./symbol":15}]},{},[16]); \ No newline at end of file diff --git a/docs/d3-legend.min.js b/docs/d3-legend.min.js index 7a7bb82..4ebc8f3 100644 --- a/docs/d3-legend.min.js +++ b/docs/d3-legend.min.js @@ -1,3 +1,3 @@ -!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;gb?1:a>=b?0:NaN}function c(a){return 1===a.length&&(a=d(a)),{left:function(b,c,d,e){for(null==d&&(d=0),null==e&&(e=b.length);d>>1;a(b[f],c)<0?d=f+1:e=f}return d},right:function(b,c,d,e){for(null==d&&(d=0),null==e&&(e=b.length);d>>1;a(b[f],c)>0?e=f:d=f+1}return d}}}function d(a){return function(c,d){return b(a(c),d)}}function e(a,b){return ba?1:b>=a?0:NaN}function f(a){return null===a?NaN:+a}function g(a,b){var c,d,e=a.length,g=0,h=0,i=-1,j=0;if(null==b)for(;++i1)return h/(j-1)}function h(a,b){var c=g(a,b);return c?Math.sqrt(c):c}function i(a,b){var c,d,e,f=-1,g=a.length;if(null==b){for(;++f=d){c=e=d;break}for(;++fd&&(c=d),e=d){c=e=d;break}for(;++fd&&(c=d),e=M?e*=10:f>=N?e*=5:f>=O&&(e*=2),b=k;)l.pop(),--n;var o,p=new Array(n+1);for(e=0;e<=n;++e)o=p[e]=[],o.x0=e>0?l[e-1]:j,o.x1=e=1)return+c(a[d-1],d-1,a);var d,e=(d-1)*b,g=Math.floor(e),h=+c(a[g],g,a),i=+c(a[g+1],g+1,a);return h+(i-h)*(e-g)}}function r(a,c,d){return a=L.call(a,f).sort(b),Math.ceil((d-c)/(2*(q(a,.75)-q(a,.25))*Math.pow(a.length,-1/3)))}function s(a,b,c){return Math.ceil((c-b)/(3.5*h(a)*Math.pow(a.length,-1/3)))}function t(a,b){var c,d,e=-1,f=a.length;if(null==b){for(;++e=d){c=d;break}for(;++ec&&(c=d)}else{for(;++e=d){c=d;break}for(;++ec&&(c=d)}return c}function u(a,b){var c,d=0,e=a.length,g=-1,h=e;if(null==b)for(;++g=0;)for(d=a[e],b=d.length;--b>=0;)c[--g]=d[b];return c}function x(a,b){var c,d,e=-1,f=a.length;if(null==b){for(;++e=d){c=d;break}for(;++ed&&(c=d)}else{for(;++e=d){c=d;break}for(;++ed&&(c=d)}return c}function y(a){for(var b=0,c=a.length-1,d=a[0],e=new Array(c<0?0:c);b=k.length)return null!=i?i(b):null!=h?b.sort(h):b;for(var g,j,l,m=-1,n=b.length,o=k[d++],p=c(),q=e();++mk.length)return a;var d,e=l[c-1];return null!=i&&c>=k.length?d=a.entries():(d=[],a.each(function(a,e){d.push({key:e,values:b(a,c)})})),null!=e?d.sort(function(a,b){return e(a.key,b.key)}):d}var h,i,j,k=[],l=[];return j={object:function(b){return a(b,0,d,e)},map:function(b){return a(b,0,f,g)},entries:function(c){return b(a(c,0,f,g),0)},key:function(a){return k.push(a),j},sortKeys:function(a){return l[k.length-1]=a,j},sortValues:function(a){return h=a,j},rollup:function(a){return i=a,j}}},l=c.prototype;h.prototype=i.prototype={constructor:h,has:l.has,add:function(a){return a+="",this[j+a]=a,this},remove:l.remove,clear:l.clear,values:l.keys,size:l.size,empty:l.empty,each:l.each};var m=function(a){var b=[];for(var c in a)b.push(c);return b},n=function(a){var b=[];for(var c in a)b.push(a[c]);return b},o=function(a){var b=[];for(var c in a)b.push({key:c,value:a[c]});return b};a.nest=k,a.set=i,a.map=c,a.keys=m,a.values=n,a.entries=o,Object.defineProperty(a,"__esModule",{value:!0})})},{}],3:[function(a,b,c){!function(a,d){"object"==typeof c&&"undefined"!=typeof b?d(c):"function"==typeof define&&define.amd?define(["exports"],d):d(a.d3=a.d3||{})}(this,function(a){"use strict";function b(a,b){var c=Object.create(a.prototype);for(var d in b)c[d]=b[d];return c}function c(){}function d(a){var b;return a=(a+"").trim().toLowerCase(),(b=H.exec(a))?(b=parseInt(b[1],16),new i(b>>8&15|b>>4&240,b>>4&15|240&b,(15&b)<<4|15&b,1)):(b=I.exec(a))?e(parseInt(b[1],16)):(b=J.exec(a))?new i(b[1],b[2],b[3],1):(b=K.exec(a))?new i(255*b[1]/100,255*b[2]/100,255*b[3]/100,1):(b=L.exec(a))?f(b[1],b[2],b[3],b[4]):(b=M.exec(a))?f(255*b[1]/100,255*b[2]/100,255*b[3]/100,b[4]):(b=N.exec(a))?j(b[1],b[2]/100,b[3]/100,1):(b=O.exec(a))?j(b[1],b[2]/100,b[3]/100,b[4]):P.hasOwnProperty(a)?e(P[a]):"transparent"===a?new i(NaN,NaN,NaN,0):null}function e(a){return new i(a>>16&255,a>>8&255,255&a,1)}function f(a,b,c,d){return d<=0&&(a=b=c=NaN),new i(a,b,c,d)}function g(a){return a instanceof c||(a=d(a)),a?(a=a.rgb(),new i(a.r,a.g,a.b,a.opacity)):new i}function h(a,b,c,d){return 1===arguments.length?g(a):new i(a,b,c,null==d?1:d)}function i(a,b,c,d){this.r=+a,this.g=+b,this.b=+c,this.opacity=+d}function j(a,b,c,d){return d<=0?a=b=c=NaN:c<=0||c>=1?a=b=NaN:b<=0&&(a=NaN),new m(a,b,c,d)}function k(a){if(a instanceof m)return new m(a.h,a.s,a.l,a.opacity);if(a instanceof c||(a=d(a)),!a)return new m;if(a instanceof m)return a;a=a.rgb();var b=a.r/255,e=a.g/255,f=a.b/255,g=Math.min(b,e,f),h=Math.max(b,e,f),i=NaN,j=h-g,k=(h+g)/2;return j?(i=b===h?(e-f)/j+6*(e0&&k<1?0:i,new m(i,j,k,a.opacity)}function l(a,b,c,d){return 1===arguments.length?k(a):new m(a,b,c,null==d?1:d)}function m(a,b,c,d){this.h=+a,this.s=+b,this.l=+c,this.opacity=+d}function n(a,b,c){return 255*(a<60?b+(c-b)*a/60:a<180?c:a<240?b+(c-b)*(240-a)/60:b)}function o(a){if(a instanceof q)return new q(a.l,a.a,a.b,a.opacity);if(a instanceof x){var b=a.h*Q;return new q(a.l,Math.cos(b)*a.c,Math.sin(b)*a.c,a.opacity)}a instanceof i||(a=g(a));var c=u(a.r),d=u(a.g),e=u(a.b),f=r((.4124564*c+.3575761*d+.1804375*e)/T),h=r((.2126729*c+.7151522*d+.072175*e)/U),j=r((.0193339*c+.119192*d+.9503041*e)/V);return new q(116*h-16,500*(f-h),200*(h-j),a.opacity)}function p(a,b,c,d){return 1===arguments.length?o(a):new q(a,b,c,null==d?1:d)}function q(a,b,c,d){this.l=+a,this.a=+b,this.b=+c,this.opacity=+d}function r(a){return a>Z?Math.pow(a,1/3):a/Y+W}function s(a){return a>X?a*a*a:Y*(a-W)}function t(a){return 255*(a<=.0031308?12.92*a:1.055*Math.pow(a,1/2.4)-.055)}function u(a){return(a/=255)<=.04045?a/12.92:Math.pow((a+.055)/1.055,2.4)}function v(a){if(a instanceof x)return new x(a.h,a.c,a.l,a.opacity);a instanceof q||(a=o(a));var b=Math.atan2(a.b,a.a)*R;return new x(b<0?b+360:b,Math.sqrt(a.a*a.a+a.b*a.b),a.l,a.opacity)}function w(a,b,c,d){return 1===arguments.length?v(a):new x(a,b,c,null==d?1:d)}function x(a,b,c,d){this.h=+a,this.c=+b,this.l=+c,this.opacity=+d}function y(a){if(a instanceof A)return new A(a.h,a.s,a.l,a.opacity);a instanceof i||(a=g(a));var b=a.r/255,c=a.g/255,d=a.b/255,e=(fa*d+da*b-ea*c)/(fa+da-ea),f=d-e,h=(ca*(c-e)-aa*f)/ba,j=Math.sqrt(h*h+f*f)/(ca*e*(1-e)),k=j?Math.atan2(h,f)*R-120:NaN;return new A(k<0?k+360:k,j,e,a.opacity)}function z(a,b,c,d){return 1===arguments.length?y(a):new A(a,b,c,null==d?1:d)}function A(a,b,c,d){this.h=+a,this.s=+b,this.l=+c,this.opacity=+d}var B=function(a,b,c){a.prototype=b.prototype=c,c.constructor=a},C=.7,D=1/C,E="\\s*([+-]?\\d+)\\s*",F="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",G="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",H=/^#([0-9a-f]{3})$/,I=/^#([0-9a-f]{6})$/,J=new RegExp("^rgb\\("+[E,E,E]+"\\)$"),K=new RegExp("^rgb\\("+[G,G,G]+"\\)$"),L=new RegExp("^rgba\\("+[E,E,E,F]+"\\)$"),M=new RegExp("^rgba\\("+[G,G,G,F]+"\\)$"),N=new RegExp("^hsl\\("+[F,G,G]+"\\)$"),O=new RegExp("^hsla\\("+[F,G,G,F]+"\\)$"),P={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};B(c,d,{displayable:function(){return this.rgb().displayable()},toString:function(){return this.rgb()+""}}),B(i,h,b(c,{brighter:function(a){return a=null==a?D:Math.pow(D,a),new i(this.r*a,this.g*a,this.b*a,this.opacity)},darker:function(a){return a=null==a?C:Math.pow(C,a),new i(this.r*a,this.g*a,this.b*a,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},toString:function(){var a=this.opacity;return a=isNaN(a)?1:Math.max(0,Math.min(1,a)),(1===a?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===a?")":", "+a+")")}})),B(m,l,b(c,{brighter:function(a){return a=null==a?D:Math.pow(D,a),new m(this.h,this.s,this.l*a,this.opacity)},darker:function(a){return a=null==a?C:Math.pow(C,a),new m(this.h,this.s,this.l*a,this.opacity)},rgb:function(){var a=this.h%360+360*(this.h<0),b=isNaN(a)||isNaN(this.s)?0:this.s,c=this.l,d=c+(c<.5?c:1-c)*b,e=2*c-d;return new i(n(a>=240?a-240:a+120,e,d),n(a,e,d),n(a<120?a+240:a-120,e,d),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var Q=Math.PI/180,R=180/Math.PI,S=18,T=.95047,U=1,V=1.08883,W=4/29,X=6/29,Y=3*X*X,Z=X*X*X;B(q,p,b(c,{brighter:function(a){return new q(this.l+S*(null==a?1:a),this.a,this.b,this.opacity)},darker:function(a){return new q(this.l-S*(null==a?1:a),this.a,this.b,this.opacity)},rgb:function(){var a=(this.l+16)/116,b=isNaN(this.a)?a:a+this.a/500,c=isNaN(this.b)?a:a-this.b/200;return a=U*s(a),b=T*s(b),c=V*s(c),new i(t(3.2404542*b-1.5371385*a-.4985314*c),t(-.969266*b+1.8760108*a+.041556*c),t(.0556434*b-.2040259*a+1.0572252*c),this.opacity)}})),B(x,w,b(c,{brighter:function(a){return new x(this.h,this.c,this.l+S*(null==a?1:a),this.opacity)},darker:function(a){return new x(this.h,this.c,this.l-S*(null==a?1:a),this.opacity)},rgb:function(){return o(this).rgb()}}));var $=-.14861,_=1.78277,aa=-.29227,ba=-.90649,ca=1.97294,da=ca*ba,ea=ca*_,fa=_*aa-ba*$;B(A,z,b(c,{brighter:function(a){return a=null==a?D:Math.pow(D,a),new A(this.h,this.s,this.l*a,this.opacity)},darker:function(a){return a=null==a?C:Math.pow(C,a),new A(this.h,this.s,this.l*a,this.opacity)},rgb:function(){var a=isNaN(this.h)?0:(this.h+120)*Q,b=+this.l,c=isNaN(this.s)?0:this.s*b*(1-b),d=Math.cos(a),e=Math.sin(a);return new i(255*(b+c*($*d+_*e)),255*(b+c*(aa*d+ba*e)),255*(b+c*(ca*d)),this.opacity)}})),a.color=d,a.rgb=h,a.hsl=l,a.lab=p,a.hcl=w,a.cubehelix=z,Object.defineProperty(a,"__esModule",{value:!0})})},{}],4:[function(a,b,c){!function(a,d){"object"==typeof c&&"undefined"!=typeof b?d(c):"function"==typeof define&&define.amd?define(["exports"],d):d(a.d3=a.d3||{})}(this,function(a){"use strict";function b(){for(var a,b=0,d=arguments.length,e={};b=0&&(c=a.slice(d+1),a=a.slice(0,d)),a&&!b.hasOwnProperty(a))throw new Error("unknown type: "+a);return{type:a,name:c}})}function e(a,b){for(var c,d=0,e=a.length;d0)for(var c,d,e=new Array(c),f=0;f1?d[0]+d.slice(2):d,+a.slice(c+1)]}function c(a){return a=b(Math.abs(a)),a?a[1]:NaN}function d(a,b){return function(c,d){for(var e=c.length,f=[],g=0,h=a[0],i=0;e>0&&h>0&&(i+h+1>d&&(h=Math.max(1,d-i)),f.push(c.substring(e-=h,e+h)),!((i+=h+1)>d));)h=a[g=(g+1)%a.length];return f.reverse().join(b)}}function e(a,b){a=a.toPrecision(b);a:for(var c,d=a.length,e=1,f=-1;e0&&(f=0)}return f>0?a.slice(0,f)+a.slice(c+1):a}function f(a,c){var d=b(a,c);if(!d)return a+"";var e=d[0],f=d[1],g=f-(p=3*Math.max(-8,Math.min(8,Math.floor(f/3))))+1,h=e.length;return g===h?e:g>h?e+new Array(g-h+1).join("0"):g>0?e.slice(0,g)+"."+e.slice(g):"0."+new Array(1-g).join("0")+b(a,Math.max(0,c+g-1))[0]}function g(a,c){var d=b(a,c);if(!d)return a+"";var e=d[0],f=d[1];return f<0?"0."+new Array(-f).join("0")+e:e.length>f+1?e.slice(0,f+1)+"."+e.slice(f+1):e+new Array(f-e.length+2).join("0")}function h(a){return new i(a)}function i(a){if(!(b=r.exec(a)))throw new Error("invalid format: "+a);var b,c=b[1]||" ",d=b[2]||">",e=b[3]||"-",f=b[4]||"",g=!!b[5],h=b[6]&&+b[6],i=!!b[7],j=b[8]&&+b[8].slice(1),k=b[9]||"";"n"===k?(i=!0,k="g"):q[k]||(k=""),(g||"0"===c&&"="===d)&&(g=!0,c="0",d="="),this.fill=c,this.align=d,this.sign=e,this.symbol=f,this.zero=g,this.width=h,this.comma=i,this.precision=j,this.type=k}function j(a){return a}function k(a){function b(a){function b(a){var b,g,h,j=r,q=s;if("c"===o)q=u(a)+q,a="";else{a=+a;var w=(a<0||1/a<0)&&(a*=-1,!0);if(a=u(a,n),w)for(b=-1,g=a.length,w=!1;++bh||h>57){q=(46===h?i+a.slice(b+1):a.slice(b))+q,a=a.slice(0,b);break}}m&&!k&&(a=f(a,1/0));var x=j.length+a.length+q.length,y=x>1)+j+a+q+y.slice(x)}return y+j+a+q}a=h(a);var c=a.fill,d=a.align,e=a.sign,j=a.symbol,k=a.zero,l=a.width,m=a.comma,n=a.precision,o=a.type,r="$"===j?g[0]:"#"===j&&/[boxX]/.test(o)?"0"+o.toLowerCase():"",s="$"===j?g[1]:/[%p]/.test(o)?"%":"",u=q[o],v=!o||/[defgprs%]/.test(o);return n=null==n?o?6:12:/[gprs]/.test(o)?Math.max(1,Math.min(21,n)):Math.max(0,Math.min(20,n)),b.toString=function(){return a+""},b}function e(a,d){var e=b((a=h(a),a.type="f",a)),f=3*Math.max(-8,Math.min(8,Math.floor(c(d)/3))),g=Math.pow(10,-f),i=t[8+f/3];return function(a){return e(g*a)+i}}var f=a.grouping&&a.thousands?d(a.grouping,a.thousands):j,g=a.currency,i=a.decimal;return{format:b,formatPrefix:e}}function l(b){return s=k(b),a.format=s.format,a.formatPrefix=s.formatPrefix,s}function m(a){return Math.max(0,-c(Math.abs(a)))}function n(a,b){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(c(b)/3)))-c(Math.abs(a)))}function o(a,b){return a=Math.abs(a),b=Math.abs(b)-a,Math.max(0,c(b)-c(a))+1}var p,q={"":e,"%":function(a,b){return(100*a).toFixed(b)},b:function(a){return Math.round(a).toString(2)},c:function(a){return a+""},d:function(a){return Math.round(a).toString(10)},e:function(a,b){return a.toExponential(b)},f:function(a,b){return a.toFixed(b)},g:function(a,b){return a.toPrecision(b)},o:function(a){return Math.round(a).toString(8)},p:function(a,b){return g(100*a,b)},r:g,s:f,X:function(a){return Math.round(a).toString(16).toUpperCase()},x:function(a){return Math.round(a).toString(16)}},r=/^(?:(.)?([<>=^]))?([+\-\( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?([a-z%])?$/i;i.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+this.type};var s,t=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];l({decimal:".",thousands:",",grouping:[3],currency:["$",""]}),a.formatDefaultLocale=l,a.formatLocale=k,a.formatSpecifier=h,a.precisionFixed=m,a.precisionPrefix=n,a.precisionRound=o,Object.defineProperty(a,"__esModule",{value:!0})})},{}],6:[function(a,b,c){!function(d,e){"object"==typeof c&&"undefined"!=typeof b?e(c,a("d3-color")):"function"==typeof define&&define.amd?define(["exports","d3-color"],e):e(d.d3=d.d3||{},d.d3)}(this,function(a,b){"use strict";function c(a,b,c,d,e){var f=a*a,g=f*a;return((1-3*a+3*f-g)*b+(4-6*f+3*g)*c+(1+3*a+3*f-3*g)*d+g*e)/6}function d(a,b){return function(c){return a+c*b}}function e(a,b,c){return a=Math.pow(a,c),b=Math.pow(b,c)-a,c=1/c,function(d){return Math.pow(a+d*b,c)}}function f(a,b){var c=b-a;return c?d(a,c>180||c<-180?c-360*Math.round(c/360):c):B(isNaN(a)?b:a)}function g(a){return 1===(a=+a)?h:function(b,c){return c-b?e(b,c,a):B(isNaN(b)?c:b)}}function h(a,b){var c=b-a;return c?d(a,c):B(isNaN(a)?b:a)}function i(a){return function(c){var d,e,f=c.length,g=new Array(f),h=new Array(f),i=new Array(f);for(d=0;d180?b+=360:b-a>180&&(a+=360),f.push({i:c.push(e(c)+"rotate(",null,d)-2,x:H(a,b)})):b&&c.push(e(c)+"rotate("+b+d)}function h(a,b,c,f){a!==b?f.push({i:c.push(e(c)+"skewX(",null,d)-2,x:H(a,b)}):b&&c.push(e(c)+"skewX("+b+d)}function i(a,b,c,d,f,g){if(a!==c||b!==d){var h=f.push(e(f)+"scale(",null,",",null,")");g.push({i:h-4,x:H(a,c)},{i:h-2,x:H(b,d)})}else 1===c&&1===d||f.push(e(f)+"scale("+c+","+d+")")}return function(b,c){var d=[],e=[];return b=a(b),c=a(c),f(b.translateX,b.translateY,c.translateX,c.translateY,d,e),g(b.rotate,c.rotate,d,e),h(b.skewX,c.skewX,d,e),i(b.scaleX,b.scaleY,c.scaleX,c.scaleY,d,e),b=c=null,function(a){for(var b,c=-1,f=e.length;++c=1?(d=1,b-1):Math.floor(d*b),f=a[e],g=a[e+1],h=e>0?a[e-1]:2*f-g,i=ef&&(e=b.slice(f,e),h[g]?h[g]+=e:h[++g]=e),(c=c[0])===(d=d[0])?h[g]?h[g]+=d:h[++g]=d:(h[++g]=null,i.push({i:g,x:H(c,d)})),f=K.lastIndex;return f=c?1:d(a)}}}function q(a){return function(b,c){var d=a(b=+b,c=+c);return function(a){return a<=0?b:a>=1?c:d(a)}}}function r(a,b,c,d){var e=a[0],f=a[1],g=b[0],h=b[1];return f2?s:r,g=h=null,e}function e(b){return(g||(g=f(i,j,l?p(a):a,k)))(+b)}var f,g,h,i=$,j=$,k=d.interpolate,l=!1;return e.invert=function(a){return(h||(h=f(j,i,o,l?q(b):b)))(+a)},e.domain=function(a){return arguments.length?(i=X.call(a,n),c()):i.slice()},e.range=function(a){return arguments.length?(j=Y.call(a),c()):j.slice()},e.rangeRound=function(a){return j=Y.call(a),k=d.interpolateRound,c()},e.clamp=function(a){return arguments.length?(l=!!a,c()):l},e.interpolate=function(a){return arguments.length?(k=a,c()):k},c()}function v(a,c,d){var f,g=a[0],h=a[a.length-1],i=b.tickStep(g,h,null==c?10:c);switch(d=e.formatSpecifier(null==d?",f":d),d.type){case"s":var j=Math.max(Math.abs(g),Math.abs(h));return null!=d.precision||isNaN(f=e.precisionPrefix(i,j))||(d.precision=f),e.formatPrefix(d,j);case"":case"e":case"g":case"p":case"r":null!=d.precision||isNaN(f=e.precisionRound(i,Math.max(Math.abs(g),Math.abs(h))))||(d.precision=f-("e"===d.type));break;case"f":case"%":null!=d.precision||isNaN(f=e.precisionFixed(i))||(d.precision=f-2*("%"===d.type))}return e.format(d)}function w(a){var c=a.domain;return a.ticks=function(a){var d=c();return b.ticks(d[0],d[d.length-1],null==a?10:a)},a.tickFormat=function(a,b){return v(c(),a,b)},a.nice=function(d){var e=c(),f=e.length-1,g=null==d?10:d,h=e[0],i=e[f],j=b.tickStep(h,i,g);return j&&(j=b.tickStep(Math.floor(h/j)*j,Math.ceil(i/j)*j,g),e[0]=Math.floor(h/j)*j,e[f]=Math.ceil(i/j)*j,c(e)),a},a}function x(){var a=u(o,d.interpolateNumber);return a.copy=function(){return t(a,x())},w(a)}function y(){function a(a){return+a}var b=[0,1];return a.invert=a,a.domain=a.range=function(c){return arguments.length?(b=X.call(c,n),a):b.slice()},a.copy=function(){return y().domain(b)},w(a)}function z(a,b){a=a.slice();var c,d=0,e=a.length-1,f=a[d],g=a[e];return g0){for(;nj)break;q.push(m)}}else for(;n=1;--l)if(m=k*l,!(mj)break;q.push(m)}}else q=b.ticks(n,o,Math.min(o-n,p)).map(h);return c?q.reverse():q},c.tickFormat=function(a,b){if(null==b&&(b=10===f?".0e":","),"function"!=typeof b&&(b=e.format(b)),a===1/0)return b;null==a&&(a=10);var d=Math.max(1,f*a/c.ticks().length);return function(a){var c=a/h(Math.round(g(a)));return c*f0?f[b-1]:d[0],b=f?[g[f-1],e]:[g[b-1],g[b]]},a.copy=function(){return L().domain([d,e]).range(h)},w(a)}function M(){function a(a){if(a<=a)return d[b.bisect(c,a,0,e)]}var c=[.5],d=[0,1],e=1;return a.domain=function(b){return arguments.length?(c=Y.call(b),e=Math.min(c.length,d.length-1),a):c.slice()},a.range=function(b){return arguments.length?(d=Y.call(b),e=Math.min(c.length,d.length-1),a):d.slice()},a.invertExtent=function(a){var b=d.indexOf(a);return[c[b-1],c[b]]},a.copy=function(){return M().domain(c).range(d)},a}function N(a){return new Date(a)}function O(a){return a instanceof Date?+a:+new Date(+a)}function P(a,c,e,f,g,h,i,j,k){function l(b){return(i(b)1)&&(a-=Math.floor(a));var b=Math.abs(a-.5);return na.h=360*a-100,na.s=1.5-1.5*b,na.l=.8-.9*b,na+""}function U(a){var b=a.length;return function(c){return a[Math.max(0,Math.min(b-1,Math.floor(c*b)))]}}function V(a){function b(b){var f=(b-c)/(d-c);return a(e?Math.max(0,Math.min(1,f)):f)}var c=0,d=1,e=!1;return b.domain=function(a){return arguments.length?(c=+a[0],d=+a[1],b):[c,d]},b.clamp=function(a){return arguments.length?(e=!!a,b):e},b.interpolator=function(c){return arguments.length?(a=c,b):a},b.copy=function(){return V(a).domain([c,d]).clamp(e)},w(b)}var W=Array.prototype,X=W.map,Y=W.slice,Z={name:"implicit"},$=[0,1],_=1e3,aa=60*_,ba=60*aa,ca=24*ba,da=7*ca,ea=30*ca,fa=365*ca,ga=S("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),ha=S("393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6"),ia=S("3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9"),ja=S("1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5"),ka=d.interpolateCubehelixLong(h.cubehelix(300,.5,0),h.cubehelix(-240,.5,1)),la=d.interpolateCubehelixLong(h.cubehelix(-100,.75,.35),h.cubehelix(80,1.5,.8)),ma=d.interpolateCubehelixLong(h.cubehelix(260,.75,.35),h.cubehelix(80,1.5,.8)),na=h.cubehelix(),oa=U(S("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),pa=U(S("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),qa=U(S("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),ra=U(S("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));a.scaleBand=j,a.scalePoint=l,a.scaleIdentity=y,a.scaleLinear=x,a.scaleLog=G,a.scaleOrdinal=i,a.scaleImplicit=Z,a.scalePow=I,a.scaleSqrt=J,a.scaleQuantile=K,a.scaleQuantize=L,a.scaleThreshold=M,a.scaleTime=Q,a.scaleUtc=R,a.schemeCategory10=ga,a.schemeCategory20b=ha,a.schemeCategory20c=ia,a.schemeCategory20=ja,a.interpolateCubehelixDefault=ka,a.interpolateRainbow=T,a.interpolateWarm=la,a.interpolateCool=ma,a.interpolateViridis=oa,a.interpolateMagma=pa,a.interpolateInferno=qa,a.interpolatePlasma=ra,a.scaleSequential=V,Object.defineProperty(a,"__esModule",{value:!0})})},{"d3-array":1,"d3-collection":2,"d3-color":3,"d3-format":5,"d3-interpolate":6,"d3-time":10,"d3-time-format":9}],8:[function(a,b,c){!function(a,d){"object"==typeof c&&"undefined"!=typeof b?d(c):"function"==typeof define&&define.amd?define(["exports"],d):d(a.d3=a.d3||{})}(this,function(a){"use strict";function b(a){var b=a+="",c=b.indexOf(":");return c>=0&&"xmlns"!==(b=a.slice(0,c))&&(a=a.slice(c+1)),Qa.hasOwnProperty(b)?{space:Qa[b],local:a}:a}function c(a){return function(){var b=this.ownerDocument,c=this.namespaceURI;return c===Pa&&b.documentElement.namespaceURI===Pa?b.createElement(a):b.createElementNS(c,a)}}function d(a){return function(){return this.ownerDocument.createElementNS(a.space,a.local)}}function e(a){var e=b(a);return(e.local?d:c)(e)}function f(){return new g}function g(){this._="@"+(++Ra).toString(36)}function h(a,b,c){return a=i(a,b,c),function(b){var c=b.relatedTarget;c&&(c===this||8&c.compareDocumentPosition(this))||a.call(this,b)}}function i(b,c,d){return function(e){var f=a.event;a.event=e;try{b.call(this,this.__data__,c,d)}finally{a.event=f}}}function j(a){return a.trim().split(/^|\s+/).map(function(a){var b="",c=a.indexOf(".");return c>=0&&(b=a.slice(c+1),a=a.slice(0,c)),{type:a,name:b}})}function k(a){return function(){var b=this.__on;if(b){for(var c,d=0,e=-1,f=b.length;d=v&&(v=u+1);!(t=q[v])&&++v=0;)(d=e[f])&&(g&&g!==d.nextSibling&&g.parentNode.insertBefore(d,g),g=d);return this}function I(a){function b(b,c){return b&&c?a(b.__data__,c.__data__):!b-!c}a||(a=J);for(var c=this._groups,d=c.length,e=new Array(d),f=0;fb?1:a>=b?0:NaN}function K(){var a=arguments[0];return arguments[0]=this,a.apply(null,arguments),this}function L(){var a=new Array(this.size()),b=-1;return this.each(function(){a[++b]=this}),a}function M(){for(var a=this._groups,b=0,c=a.length;b1?this.each((null==b?Y:"function"==typeof b?$:Z)(a,b,null==c?"":c)):X(d=this.node()).getComputedStyle(d,null).getPropertyValue(a)}function aa(a){return function(){delete this[a]}}function ba(a,b){return function(){this[a]=b}}function ca(a,b){return function(){var c=b.apply(this,arguments);null==c?delete this[a]:this[a]=c}}function da(a,b){return arguments.length>1?this.each((null==b?aa:"function"==typeof b?ca:ba)(a,b)):this.node()[a]}function ea(a){return a.trim().split(/^|\s+/)}function fa(a){return a.classList||new ga(a)}function ga(a){this._node=a,this._names=ea(a.getAttribute("class")||"")}function ha(a,b){for(var c=fa(a),d=-1,e=b.length;++d=0&&(this._names.splice(b,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(a){return this._names.indexOf(a)>=0}};var Za=[null];Ja.prototype=Ka.prototype={constructor:Ja,select:t,selectAll:w,filter:x,data:E,enter:z,exit:F,merge:G,order:H,sort:I,call:K,nodes:L,node:M,size:N,empty:O,each:P,attr:W,style:_,property:da,classed:ma,text:qa,html:ua,raise:wa,lower:ya,append:za,insert:Ba,remove:Da,datum:Ea,on:m,dispatch:Ia},a.creator=e,a.local=f,a.matcher=Va,a.mouse=q,a.namespace=b,a.namespaces=Qa,a.select=La,a.selectAll=Ma,a.selection=Ka,a.selector=s,a.selectorAll=v,a.touch=Na,a.touches=Oa,a.window=X,a.customEvent=n,Object.defineProperty(a,"__esModule",{value:!0})})},{}],9:[function(a,b,c){!function(d,e){"object"==typeof c&&"undefined"!=typeof b?e(c,a("d3-time")):"function"==typeof define&&define.amd?define(["exports","d3-time"],e):e(d.d3=d.d3||{},d.d3)}(this,function(a,b){"use strict";function c(a){if(0<=a.y&&a.y<100){var b=new Date(-1,a.m,a.d,a.H,a.M,a.S,a.L);return b.setFullYear(a.y),b}return new Date(a.y,a.m,a.d,a.H,a.M,a.S,a.L)}function d(a){if(0<=a.y&&a.y<100){var b=new Date(Date.UTC(-1,a.m,a.d,a.H,a.M,a.S,a.L));return b.setUTCFullYear(a.y),b}return new Date(Date.UTC(a.y,a.m,a.d,a.H,a.M,a.S,a.L))}function e(a){return{y:a,m:0,d:1,H:0,M:0,S:0,L:0}}function f(a){function b(a,b){return function(c){var d,e,f,g=[],h=-1,i=0,j=a.length;for(c instanceof Date||(c=new Date(+c));++h=i)return-1;if(e=b.charCodeAt(g++), -37===e){if(e=b.charAt(g++),f=La[e in da?b.charAt(g++):e],!f||(d=f(a,c,d))<0)return-1}else if(e!=c.charCodeAt(d++))return-1}return d}function h(a,b,c){var d=za.exec(b.slice(c));return d?(a.p=Aa[d[0].toLowerCase()],c+d[0].length):-1}function _(a,b,c){var d=Da.exec(b.slice(c));return d?(a.w=Ea[d[0].toLowerCase()],c+d[0].length):-1}function aa(a,b,c){var d=Ba.exec(b.slice(c));return d?(a.w=Ca[d[0].toLowerCase()],c+d[0].length):-1}function ba(a,b,c){var d=Ha.exec(b.slice(c));return d?(a.m=Ia[d[0].toLowerCase()],c+d[0].length):-1}function ca(a,b,c){var d=Fa.exec(b.slice(c));return d?(a.m=Ga[d[0].toLowerCase()],c+d[0].length):-1}function ea(a,b,c){return g(a,ra,b,c)}function fa(a,b,c){return g(a,sa,b,c)}function ga(a,b,c){return g(a,ta,b,c)}function ha(a){return wa[a.getDay()]}function ia(a){return va[a.getDay()]}function ja(a){return ya[a.getMonth()]}function ka(a){return xa[a.getMonth()]}function la(a){return ua[+(a.getHours()>=12)]}function ma(a){return wa[a.getUTCDay()]}function na(a){return va[a.getUTCDay()]}function oa(a){return ya[a.getUTCMonth()]}function pa(a){return xa[a.getUTCMonth()]}function qa(a){return ua[+(a.getUTCHours()>=12)]}var ra=a.dateTime,sa=a.date,ta=a.time,ua=a.periods,va=a.days,wa=a.shortDays,xa=a.months,ya=a.shortMonths,za=i(ua),Aa=j(ua),Ba=i(va),Ca=j(va),Da=i(wa),Ea=j(wa),Fa=i(xa),Ga=j(xa),Ha=i(ya),Ia=j(ya),Ja={a:ha,A:ia,b:ja,B:ka,c:null,d:y,e:y,H:z,I:A,j:B,L:C,m:D,M:E,p:la,S:F,U:G,w:H,W:I,x:null,X:null,y:J,Y:K,Z:L,"%":$},Ka={a:ma,A:na,b:oa,B:pa,c:null,d:M,e:M,H:N,I:O,j:P,L:Q,m:R,M:S,p:qa,S:T,U:U,w:V,W:W,x:null,X:null,y:X,Y:Y,Z:Z,"%":$},La={a:_,A:aa,b:ba,B:ca,c:ea,d:r,e:r,H:t,I:t,j:s,L:w,m:q,M:u,p:h,S:v,U:l,w:k,W:m,x:fa,X:ga,y:o,Y:n,Z:p,"%":x};return Ja.x=b(sa,Ja),Ja.X=b(ta,Ja),Ja.c=b(ra,Ja),Ka.x=b(sa,Ka),Ka.X=b(ta,Ka),Ka.c=b(ra,Ka),{format:function(a){var c=b(a+="",Ja);return c.toString=function(){return a},c},parse:function(a){var b=f(a+="",c);return b.toString=function(){return a},b},utcFormat:function(a){var c=b(a+="",Ka);return c.toString=function(){return a},c},utcParse:function(a){var b=f(a,d);return b.toString=function(){return a},b}}}function g(a,b,c){var d=a<0?"-":"",e=(d?-a:a)+"",f=e.length;return d+(f68?1900:2e3),c+d[0].length):-1}function p(a,b,c){var d=/^(Z)|([+-]\d\d)(?:\:?(\d\d))?/.exec(b.slice(c,c+6));return d?(a.Z=d[1]?0:-(d[2]+(d[3]||"00")),c+d[0].length):-1}function q(a,b,c){var d=ea.exec(b.slice(c,c+2));return d?(a.m=d[0]-1,c+d[0].length):-1}function r(a,b,c){var d=ea.exec(b.slice(c,c+2));return d?(a.d=+d[0],c+d[0].length):-1}function s(a,b,c){var d=ea.exec(b.slice(c,c+3));return d?(a.m=0,a.d=+d[0],c+d[0].length):-1}function t(a,b,c){var d=ea.exec(b.slice(c,c+2));return d?(a.H=+d[0],c+d[0].length):-1}function u(a,b,c){var d=ea.exec(b.slice(c,c+2));return d?(a.M=+d[0],c+d[0].length):-1}function v(a,b,c){var d=ea.exec(b.slice(c,c+2));return d?(a.S=+d[0],c+d[0].length):-1}function w(a,b,c){var d=ea.exec(b.slice(c,c+3));return d?(a.L=+d[0],c+d[0].length):-1}function x(a,b,c){var d=fa.exec(b.slice(c,c+1));return d?c+d[0].length:-1}function y(a,b){return g(a.getDate(),b,2)}function z(a,b){return g(a.getHours(),b,2)}function A(a,b){return g(a.getHours()%12||12,b,2)}function B(a,c){return g(1+b.timeDay.count(b.timeYear(a),a),c,3)}function C(a,b){return g(a.getMilliseconds(),b,3)}function D(a,b){return g(a.getMonth()+1,b,2)}function E(a,b){return g(a.getMinutes(),b,2)}function F(a,b){return g(a.getSeconds(),b,2)}function G(a,c){return g(b.timeSunday.count(b.timeYear(a),a),c,2)}function H(a){return a.getDay()}function I(a,c){return g(b.timeMonday.count(b.timeYear(a),a),c,2)}function J(a,b){return g(a.getFullYear()%100,b,2)}function K(a,b){return g(a.getFullYear()%1e4,b,4)}function L(a){var b=a.getTimezoneOffset();return(b>0?"-":(b*=-1,"+"))+g(b/60|0,"0",2)+g(b%60,"0",2)}function M(a,b){return g(a.getUTCDate(),b,2)}function N(a,b){return g(a.getUTCHours(),b,2)}function O(a,b){return g(a.getUTCHours()%12||12,b,2)}function P(a,c){return g(1+b.utcDay.count(b.utcYear(a),a),c,3)}function Q(a,b){return g(a.getUTCMilliseconds(),b,3)}function R(a,b){return g(a.getUTCMonth()+1,b,2)}function S(a,b){return g(a.getUTCMinutes(),b,2)}function T(a,b){return g(a.getUTCSeconds(),b,2)}function U(a,c){return g(b.utcSunday.count(b.utcYear(a),a),c,2)}function V(a){return a.getUTCDay()}function W(a,c){return g(b.utcMonday.count(b.utcYear(a),a),c,2)}function X(a,b){return g(a.getUTCFullYear()%100,b,2)}function Y(a,b){return g(a.getUTCFullYear()%1e4,b,4)}function Z(){return"+0000"}function $(){return"%"}function _(b){return ca=f(b),a.timeFormat=ca.format,a.timeParse=ca.parse,a.utcFormat=ca.utcFormat,a.utcParse=ca.utcParse,ca}function aa(a){return a.toISOString()}function ba(a){var b=new Date(a);return isNaN(b)?null:b}var ca,da={"-":"",_:" ",0:"0"},ea=/^\s*\d+/,fa=/^%/,ga=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;_({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var ha="%Y-%m-%dT%H:%M:%S.%LZ",ia=Date.prototype.toISOString?aa:a.utcFormat(ha),ja=+new Date("2000-01-01T00:00:00.000Z")?ba:a.utcParse(ha);a.timeFormatDefaultLocale=_,a.timeFormatLocale=f,a.isoFormat=ia,a.isoParse=ja,Object.defineProperty(a,"__esModule",{value:!0})})},{"d3-time":10}],10:[function(a,b,c){!function(a,d){"object"==typeof c&&"undefined"!=typeof b?d(c):"function"==typeof define&&define.amd?define(["exports"],d):d(a.d3=a.d3||{})}(this,function(a){"use strict";function b(a,c,d,g){function h(b){return a(b=new Date(+b)),b}return h.floor=h,h.ceil=function(b){return a(b=new Date(b-1)),c(b,1),a(b),b},h.round=function(a){var b=h(a),c=h.ceil(a);return a-b0))return f;do f.push(new Date(+b));while(c(b,e),a(b),b=b)for(;a(b),!d(b);)b.setTime(b-1)},function(a,b){if(a>=a)for(;--b>=0;)for(;c(a,1),!d(a););})},d&&(h.count=function(b,c){return e.setTime(+b),f.setTime(+c),a(e),a(f),Math.floor(d(e,f))},h.every=function(a){return a=Math.floor(a),isFinite(a)&&a>0?a>1?h.filter(g?function(b){return g(b)%a===0}:function(b){return h.count(0,b)%a===0}):h:null}),h}function c(a){return b(function(b){b.setDate(b.getDate()-(b.getDay()+7-a)%7),b.setHours(0,0,0,0)},function(a,b){a.setDate(a.getDate()+7*b)},function(a,b){return(b-a-(b.getTimezoneOffset()-a.getTimezoneOffset())*j)/m})}function d(a){return b(function(b){b.setUTCDate(b.getUTCDate()-(b.getUTCDay()+7-a)%7),b.setUTCHours(0,0,0,0)},function(a,b){a.setUTCDate(a.getUTCDate()+7*b)},function(a,b){return(b-a)/m})}var e=new Date,f=new Date,g=b(function(){},function(a,b){a.setTime(+a+b)},function(a,b){return b-a});g.every=function(a){return a=Math.floor(a),isFinite(a)&&a>0?a>1?b(function(b){b.setTime(Math.floor(b/a)*a)},function(b,c){b.setTime(+b+c*a)},function(b,c){return(c-b)/a}):g:null};var h=g.range,i=1e3,j=6e4,k=36e5,l=864e5,m=6048e5,n=b(function(a){a.setTime(Math.floor(a/i)*i)},function(a,b){a.setTime(+a+b*i)},function(a,b){return(b-a)/i},function(a){return a.getUTCSeconds()}),o=n.range,p=b(function(a){a.setTime(Math.floor(a/j)*j)},function(a,b){a.setTime(+a+b*j)},function(a,b){return(b-a)/j},function(a){return a.getMinutes()}),q=p.range,r=b(function(a){var b=a.getTimezoneOffset()*j%k;b<0&&(b+=k),a.setTime(Math.floor((+a-b)/k)*k+b)},function(a,b){a.setTime(+a+b*k)},function(a,b){return(b-a)/k},function(a){return a.getHours()}),s=r.range,t=b(function(a){a.setHours(0,0,0,0)},function(a,b){a.setDate(a.getDate()+b)},function(a,b){return(b-a-(b.getTimezoneOffset()-a.getTimezoneOffset())*j)/l},function(a){return a.getDate()-1}),u=t.range,v=c(0),w=c(1),x=c(2),y=c(3),z=c(4),A=c(5),B=c(6),C=v.range,D=w.range,E=x.range,F=y.range,G=z.range,H=A.range,I=B.range,J=b(function(a){a.setDate(1),a.setHours(0,0,0,0)},function(a,b){a.setMonth(a.getMonth()+b)},function(a,b){return b.getMonth()-a.getMonth()+12*(b.getFullYear()-a.getFullYear())},function(a){return a.getMonth()}),K=J.range,L=b(function(a){a.setMonth(0,1),a.setHours(0,0,0,0)},function(a,b){a.setFullYear(a.getFullYear()+b)},function(a,b){return b.getFullYear()-a.getFullYear()},function(a){return a.getFullYear()});L.every=function(a){return isFinite(a=Math.floor(a))&&a>0?b(function(b){b.setFullYear(Math.floor(b.getFullYear()/a)*a),b.setMonth(0,1),b.setHours(0,0,0,0)},function(b,c){b.setFullYear(b.getFullYear()+c*a)}):null};var M=L.range,N=b(function(a){a.setUTCSeconds(0,0)},function(a,b){a.setTime(+a+b*j)},function(a,b){return(b-a)/j},function(a){return a.getUTCMinutes()}),O=N.range,P=b(function(a){a.setUTCMinutes(0,0,0)},function(a,b){a.setTime(+a+b*k)},function(a,b){return(b-a)/k},function(a){return a.getUTCHours()}),Q=P.range,R=b(function(a){a.setUTCHours(0,0,0,0)},function(a,b){a.setUTCDate(a.getUTCDate()+b)},function(a,b){return(b-a)/l},function(a){return a.getUTCDate()-1}),S=R.range,T=d(0),U=d(1),V=d(2),W=d(3),X=d(4),Y=d(5),Z=d(6),$=T.range,_=U.range,aa=V.range,ba=W.range,ca=X.range,da=Y.range,ea=Z.range,fa=b(function(a){a.setUTCDate(1),a.setUTCHours(0,0,0,0)},function(a,b){a.setUTCMonth(a.getUTCMonth()+b)},function(a,b){return b.getUTCMonth()-a.getUTCMonth()+12*(b.getUTCFullYear()-a.getUTCFullYear())},function(a){return a.getUTCMonth()}),ga=fa.range,ha=b(function(a){a.setUTCMonth(0,1),a.setUTCHours(0,0,0,0)},function(a,b){a.setUTCFullYear(a.getUTCFullYear()+b)},function(a,b){return b.getUTCFullYear()-a.getUTCFullYear()},function(a){return a.getUTCFullYear()});ha.every=function(a){return isFinite(a=Math.floor(a))&&a>0?b(function(b){b.setUTCFullYear(Math.floor(b.getUTCFullYear()/a)*a),b.setUTCMonth(0,1),b.setUTCHours(0,0,0,0)},function(b,c){b.setUTCFullYear(b.getUTCFullYear()+c*a)}):null};var ia=ha.range;a.timeInterval=b,a.timeMillisecond=g,a.timeMilliseconds=h,a.utcMillisecond=g,a.utcMilliseconds=h,a.timeSecond=n,a.timeSeconds=o,a.utcSecond=n,a.utcSeconds=o,a.timeMinute=p,a.timeMinutes=q,a.timeHour=r,a.timeHours=s,a.timeDay=t,a.timeDays=u,a.timeWeek=v,a.timeWeeks=C,a.timeSunday=v,a.timeSundays=C,a.timeMonday=w,a.timeMondays=D,a.timeTuesday=x,a.timeTuesdays=E,a.timeWednesday=y,a.timeWednesdays=F,a.timeThursday=z,a.timeThursdays=G,a.timeFriday=A,a.timeFridays=H,a.timeSaturday=B,a.timeSaturdays=I,a.timeMonth=J,a.timeMonths=K,a.timeYear=L,a.timeYears=M,a.utcMinute=N,a.utcMinutes=O,a.utcHour=P,a.utcHours=Q,a.utcDay=R,a.utcDays=S,a.utcWeek=T,a.utcWeeks=$,a.utcSunday=T,a.utcSundays=$,a.utcMonday=U,a.utcMondays=_,a.utcTuesday=V,a.utcTuesdays=aa,a.utcWednesday=W,a.utcWednesdays=ba,a.utcThursday=X,a.utcThursdays=ca,a.utcFriday=Y,a.utcFridays=da,a.utcSaturday=Z,a.utcSaturdays=ea,a.utcMonth=fa,a.utcMonths=ga,a.utcYear=ha,a.utcYears=ia,Object.defineProperty(a,"__esModule",{value:!0})})},{}],11:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(a){var h=g.default.d3_calcType(b,z,m,o,s.format(t),w),i=a.selectAll("g").data([b]);i.enter().append("g").attr("class",p+"legendCells"),n&&g.default.d3_filterCells(h,n);var j=a.select("."+p+"legendCells").selectAll("."+p+"cell").data(h.data),D=j.enter().append("g").attr("class",p+"cell");D.append(c).attr("class",p+"swatch");var E=a.selectAll("g."+p+"cell "+c).data(h.data);g.default.d3_addEvents(D,C),j.exit().transition().style("opacity",0).remove(),E.exit().transition().style("opacity",0).remove(),E=E.merge(E),g.default.d3_drawShapes(c,E,e,d,f,A),g.default.d3_addText(a,D,h.labels,p,x),j=D.merge(j);var F=j.selectAll("text"),G=F.nodes().map(function(a){return a.getBBox()}),H=E.nodes().map(function(a){return a.getBBox()});q?E.attr("class",function(a){return p+"swatch "+h.feature(a)}):"line"==c?E.style("stroke",h.feature):E.style("fill",h.feature);var I=void 0,J=void 0,K="start"==v?0:"middle"==v?.5:1;"vertical"===y?!function(){var a=G.map(function(a,b){return Math.max(a.height,H[b].height)});I=function(b,c){var d=(0,k.sum)(a.slice(0,c));return"translate(0, "+(d+c*l)+")"},J=function(a,b){return"translate( "+(H[b].width+H[b].x+u)+", "+(H[b].y+H[b].height/2+5)+")"}}():"horizontal"===y&&(I=function(a,b){return"translate("+b*(H[b].width+l)+",0)"},J=function(a,b){return"translate("+(H[b].width*K+H[b].x)+",\n "+(H[b].height+H[b].y+u+8)+")"}),g.default.d3_placement(y,j,I,F,J,v),g.default.d3_title(a,r,p,B),j.transition().style("opacity",1)}var b=(0,i.scaleLinear)(),c="rect",d=15,e=15,f=10,l=2,m=[5],n=void 0,o=[],p="",q=!1,r="",s=g.default.d3_defaultLocale,t=g.default.d3_defaultFormatSpecifier,u=10,v="middle",w=g.default.d3_defaultDelimiter,x=void 0,y="vertical",z=!1,A=void 0,B=void 0,C=(0,h.dispatch)("cellover","cellout","cellclick");return a.scale=function(c){return arguments.length?(b=c,a):b},a.cells=function(b){return arguments.length?((b.length>1||b>=2)&&(m=b),a):m},a.cellFilter=function(b){return arguments.length?(n=b,a):n},a.shape=function(b,d){return arguments.length?(("rect"==b||"circle"==b||"line"==b||"path"==b&&"string"==typeof d)&&(c=b,A=d),a):c},a.shapeWidth=function(b){return arguments.length?(d=+b,a):d},a.shapeHeight=function(b){return arguments.length?(e=+b,a):e},a.shapeRadius=function(b){return arguments.length?(f=+b,a):f},a.shapePadding=function(b){return arguments.length?(l=+b,a):l},a.labels=function(b){return arguments.length?(o=b,a):o},a.labelAlign=function(b){return arguments.length?("start"!=b&&"end"!=b&&"middle"!=b||(v=b),a):v},a.locale=function(b){return arguments.length?(s=(0,j.formatLocale)(b),a):s},a.labelFormat=function(b){return arguments.length?(t=(0,j.formatSpecifier)(b),a):a.locale().format(t)},a.labelOffset=function(b){return arguments.length?(u=+b,a):u},a.labelDelimiter=function(b){return arguments.length?(w=b,a):w},a.labelWrap=function(b){return arguments.length?(x=b,a):x},a.useClass=function(b){return arguments.length?(b!==!0&&b!==!1||(q=b),a):q},a.orient=function(b){return arguments.length?(b=b.toLowerCase(),"horizontal"!=b&&"vertical"!=b||(y=b),a):y},a.ascending=function(b){return arguments.length?(z=!!b,a):z},a.classPrefix=function(b){return arguments.length?(p=b,a):p},a.title=function(b){return arguments.length?(r=b,a):r},a.titleWidth=function(b){return arguments.length?(B=b,a):B},a.textWrap=function(b){return arguments.length?(textWrap=b,a):textWrap},a.on=function(){var b=C.on.apply(C,arguments);return b===C?a:b},a}Object.defineProperty(c,"__esModule",{value:!0}),c.default=e;var f=a("./legend"),g=d(f),h=a("d3-dispatch"),i=a("d3-scale"),j=a("d3-format"),k=a("d3-array")},{"./legend":13,"d3-array":1,"d3-dispatch":4,"d3-format":5,"d3-scale":7}],12:[function(a,b,c){"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d=c.thresholdLabels=function(a){var b=a.i,c=a.genLength,d=a.generatedLabels;return 0===b?d[b].replace("NaN to","Less than"):b===c-1?"More than "+d[c-1].replace(" to NaN",""):d[b]};c.default={thresholdLabels:d}},{}],13:[function(a,b,c){"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},e=a("d3-selection"),f=a("d3-format"),g=function(a){return a},h=function(a){for(var b=[],c=0,d=a.length;cb&&f.length>1&&(f.pop(),i.text(f.join(" ")),f=[a],i=c.append("tspan").attr("x",0).attr("dy",g+h+"em").text(a))})},j=function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],b=arguments[1],c=arguments[2],e=arguments[3];if("object"===("undefined"==typeof b?"undefined":d(b))){if(0===b.length)return a;for(var f=b.length;f1)d=b;else for(var e=a.domain(),f=(e[e.length-1]-e[0])/(b-1),g=0;g1||b>=2)&&(f=b),a):f},a.cellFilter=function(b){return arguments.length?(l=b,a):l},a.shape=function(b,d){return arguments.length?("rect"!=b&&"circle"!=b&&"line"!=b||(c=b,x=d),a):c},a.shapeWidth=function(b){return arguments.length?(d=+b,a):d},a.shapePadding=function(b){return arguments.length?(e=+b,a):e},a.labels=function(b){return arguments.length?(m=b,a):m},a.labelAlign=function(b){return arguments.length?("start"!=b&&"end"!=b&&"middle"!=b||(s=b),a):s},a.locale=function(b){return arguments.length?(p=(0,j.formatLocale)(b),a):p},a.labelFormat=function(b){return arguments.length?(q=(0,j.formatSpecifier)(b),a):a.locale().format(q)},a.labelOffset=function(b){return arguments.length?(r=+b,a):r},a.labelDelimiter=function(b){return arguments.length?(t=b,a):t},a.labelWrap=function(b){return arguments.length?(u=b,a):u},a.orient=function(b){return arguments.length?(b=b.toLowerCase(),"horizontal"!=b&&"vertical"!=b||(v=b),a):v},a.ascending=function(b){return arguments.length?(w=!!b,a):w},a.classPrefix=function(b){return arguments.length?(n=b,a):n},a.title=function(b){return arguments.length?(o=b,a):o},a.titleWidth=function(b){return arguments.length?(y=b,a):y},a.on=function(){var b=z.on.apply(z,arguments);return b===z?a:b},a}Object.defineProperty(c,"__esModule",{value:!0}),c.default=e;var f=a("./legend"),g=d(f),h=a("d3-dispatch"),i=a("d3-scale"),j=a("d3-format"),k=a("d3-array")},{"./legend":13,"d3-array":1,"d3-dispatch":4,"d3-format":5,"d3-scale":7}],15:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(a){var h=g.default.d3_calcType(b,y,m,o,r.format(s),v),i=a.selectAll("g").data([b]);n&&g.default.d3_filterCells(h,n),i.enter().append("g").attr("class",p+"legendCells");var j=a.select("."+p+"legendCells").selectAll("."+p+"cell").data(h.data),B=j.enter().append("g").attr("class",p+"cell");B.append(c).attr("class",p+"swatch");var C=a.selectAll("g."+p+"cell "+c);g.default.d3_addEvents(B,A),j.exit().transition().style("opacity",0).remove(),C.exit().transition().style("opacity",0).remove(),C=C.merge(C),g.default.d3_drawShapes(c,C,e,d,f,h.feature),g.default.d3_addText(a,B,h.labels,p,w),j=B.merge(j);var D=j.selectAll("text"),E=D.nodes().map(function(a){return a.getBBox()}),F=C.nodes().map(function(a){return a.getBBox()}),G=(0,k.max)(F,function(a){return a.height}),H=(0,k.max)(F,function(a){return a.width}),I=void 0,J=void 0,K="start"==t?0:"middle"==t?.5:1;"vertical"===x?!function(){var a=E.map(function(a,b){return Math.max(G,a.height)});I=function(b,c){var d=(0,k.sum)(a.slice(0,c));return"translate(0, "+(d+c*l)+" )"},J=function(a,b){return"translate( "+(H+u)+",\n "+(F[b].y+F[b].height/2+5)+")"}}():"horizontal"===x&&(I=function(a,b){return"translate( "+b*(H+l)+",0)"},J=function(a,b){return"translate( "+(F[b].width*K+F[b].x)+",\n "+(G+u)+")"}),g.default.d3_placement(x,j,I,D,J,t),g.default.d3_title(a,q,p,z),j.transition().style("opacity",1)}var b=(0,i.scaleLinear)(),c="path",d=15,e=15,f=10,l=5,m=[5],n=void 0,o=[],p="",q="",r=g.default.d3_defaultLocale,s=g.default.d3_defaultFormatSpecifier,t="middle",u=10,v=g.default.d3_defaultDelimiter,w=void 0,x="vertical",y=!1,z=void 0,A=(0,h.dispatch)("cellover","cellout","cellclick");return a.scale=function(c){return arguments.length?(b=c,a):b},a.cells=function(b){return arguments.length?((b.length>1||b>=2)&&(m=b),a):m},a.cellFilter=function(b){return arguments.length?(n=b,a):n},a.shapePadding=function(b){return arguments.length?(l=+b,a):l},a.labels=function(b){return arguments.length?(o=b,a):o},a.labelAlign=function(b){return arguments.length?("start"!=b&&"end"!=b&&"middle"!=b||(t=b),a):t},a.locale=function(b){return arguments.length?(r=(0,j.formatLocale)(b),a):r},a.labelFormat=function(b){return arguments.length?(s=(0,j.formatSpecifier)(b),a):a.locale().format(s)},a.labelOffset=function(b){return arguments.length?(u=+b,a):u},a.labelDelimiter=function(b){return arguments.length?(v=b,a):v},a.labelWrap=function(b){return arguments.length?(w=b,a):w},a.orient=function(b){return arguments.length?(b=b.toLowerCase(),"horizontal"!=b&&"vertical"!=b||(x=b),a):x},a.ascending=function(b){return arguments.length?(y=!!b,a):y},a.classPrefix=function(b){return arguments.length?(p=b,a):p},a.title=function(b){return arguments.length?(q=b,a):q},a.titleWidth=function(b){return arguments.length?(z=b,a):z},a.on=function(){var b=A.on.apply(A,arguments);return b===A?a:b},a}Object.defineProperty(c,"__esModule",{value:!0}),c.default=e;var f=a("./legend"),g=d(f),h=a("d3-dispatch"),i=a("d3-scale"),j=a("d3-format"),k=a("d3-array")},{"./legend":13,"d3-array":1,"d3-dispatch":4,"d3-format":5,"d3-scale":7}],16:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{default:a}}var e=a("./color"),f=d(e),g=a("./size"),h=d(g),i=a("./symbol"),j=d(i),k=a("./helpers"),l=d(k);d3.legendColor=f.default,d3.legendSize=h.default,d3.legendSymbol=j.default,d3.legendHelpers=l.default},{"./color":11,"./helpers":12,"./size":14,"./symbol":15}]},{},[16]); \ No newline at end of file +!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c||a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;gb?1:a>=b?0:NaN}function c(a){return 1===a.length&&(a=d(a)),{left:function(b,c,d,e){for(null==d&&(d=0),null==e&&(e=b.length);d>>1;a(b[f],c)<0?d=f+1:e=f}return d},right:function(b,c,d,e){for(null==d&&(d=0),null==e&&(e=b.length);d>>1;a(b[f],c)>0?e=f:d=f+1}return d}}}function d(a){return function(c,d){return b(a(c),d)}}function e(a,b){return ba?1:b>=a?0:NaN}function f(a){return null===a?NaN:+a}function g(a,b){var c,d,e=a.length,g=0,h=0,i=-1,j=0;if(null==b)for(;++i1)return h/(j-1)}function h(a,b){var c=g(a,b);return c?Math.sqrt(c):c}function i(a,b){var c,d,e,f=-1,g=a.length;if(null==b){for(;++f=d){c=e=d;break}for(;++fd&&(c=d),e=d){c=e=d;break}for(;++fd&&(c=d),e=M?e*=10:f>=N?e*=5:f>=O&&(e*=2),b=k;)l.pop(),--n;var o,p=new Array(n+1);for(e=0;e<=n;++e)o=p[e]=[],o.x0=e>0?l[e-1]:j,o.x1=e=1)return+c(a[d-1],d-1,a);var d,e=(d-1)*b,g=Math.floor(e),h=+c(a[g],g,a);return h+(+c(a[g+1],g+1,a)-h)*(e-g)}}function r(a,c,d){return a=L.call(a,f).sort(b),Math.ceil((d-c)/(2*(q(a,.75)-q(a,.25))*Math.pow(a.length,-1/3)))}function s(a,b,c){return Math.ceil((c-b)/(3.5*h(a)*Math.pow(a.length,-1/3)))}function t(a,b){var c,d,e=-1,f=a.length;if(null==b){for(;++e=d){c=d;break}for(;++ec&&(c=d)}else{for(;++e=d){c=d;break}for(;++ec&&(c=d)}return c}function u(a,b){var c,d=0,e=a.length,g=-1,h=e;if(null==b)for(;++g=0;)for(d=a[e],b=d.length;--b>=0;)c[--g]=d[b];return c}function x(a,b){var c,d,e=-1,f=a.length;if(null==b){for(;++e=d){c=d;break}for(;++ed&&(c=d)}else{for(;++e=d){c=d;break}for(;++ed&&(c=d)}return c}function y(a){for(var b=0,c=a.length-1,d=a[0],e=new Array(c<0?0:c);b=k.length)return null!=h&&b.sort(h),null!=i?i(b):b;for(var g,j,l,m=-1,n=b.length,o=k[d++],p=c(),q=e();++mk.length)return a;var d,e=l[c-1];return null!=i&&c>=k.length?d=a.entries():(d=[],a.each(function(a,e){d.push({key:e,values:b(a,c)})})),null!=e?d.sort(function(a,b){return e(a.key,b.key)}):d}var h,i,j,k=[],l=[];return j={object:function(b){return a(b,0,d,e)},map:function(b){return a(b,0,f,g)},entries:function(c){return b(a(c,0,f,g),0)},key:function(a){return k.push(a),j},sortKeys:function(a){return l[k.length-1]=a,j},sortValues:function(a){return h=a,j},rollup:function(a){return i=a,j}}},l=c.prototype;h.prototype=i.prototype={constructor:h,has:l.has,add:function(a){return a+="",this[j+a]=a,this},remove:l.remove,clear:l.clear,values:l.keys,size:l.size,empty:l.empty,each:l.each};var m=function(a){var b=[];for(var c in a)b.push(c);return b},n=function(a){var b=[];for(var c in a)b.push(a[c]);return b},o=function(a){var b=[];for(var c in a)b.push({key:c,value:a[c]});return b};a.nest=k,a.set=i,a.map=c,a.keys=m,a.values=n,a.entries=o,Object.defineProperty(a,"__esModule",{value:!0})})},{}],3:[function(a,b,c){!function(a,d){"object"==typeof c&&void 0!==b?d(c):"function"==typeof define&&define.amd?define(["exports"],d):d(a.d3=a.d3||{})}(this,function(a){"use strict";function b(a,b){var c=Object.create(a.prototype);for(var d in b)c[d]=b[d];return c}function c(){}function d(a){var b;return a=(a+"").trim().toLowerCase(),(b=H.exec(a))?(b=parseInt(b[1],16),new i(b>>8&15|b>>4&240,b>>4&15|240&b,(15&b)<<4|15&b,1)):(b=I.exec(a))?e(parseInt(b[1],16)):(b=J.exec(a))?new i(b[1],b[2],b[3],1):(b=K.exec(a))?new i(255*b[1]/100,255*b[2]/100,255*b[3]/100,1):(b=L.exec(a))?f(b[1],b[2],b[3],b[4]):(b=M.exec(a))?f(255*b[1]/100,255*b[2]/100,255*b[3]/100,b[4]):(b=N.exec(a))?j(b[1],b[2]/100,b[3]/100,1):(b=O.exec(a))?j(b[1],b[2]/100,b[3]/100,b[4]):P.hasOwnProperty(a)?e(P[a]):"transparent"===a?new i(NaN,NaN,NaN,0):null}function e(a){return new i(a>>16&255,a>>8&255,255&a,1)}function f(a,b,c,d){return d<=0&&(a=b=c=NaN),new i(a,b,c,d)}function g(a){return a instanceof c||(a=d(a)),a?(a=a.rgb(),new i(a.r,a.g,a.b,a.opacity)):new i}function h(a,b,c,d){return 1===arguments.length?g(a):new i(a,b,c,null==d?1:d)}function i(a,b,c,d){this.r=+a,this.g=+b,this.b=+c,this.opacity=+d}function j(a,b,c,d){return d<=0?a=b=c=NaN:c<=0||c>=1?a=b=NaN:b<=0&&(a=NaN),new m(a,b,c,d)}function k(a){if(a instanceof m)return new m(a.h,a.s,a.l,a.opacity);if(a instanceof c||(a=d(a)),!a)return new m;if(a instanceof m)return a;a=a.rgb();var b=a.r/255,e=a.g/255,f=a.b/255,g=Math.min(b,e,f),h=Math.max(b,e,f),i=NaN,j=h-g,k=(h+g)/2;return j?(i=b===h?(e-f)/j+6*(e0&&k<1?0:i,new m(i,j,k,a.opacity)}function l(a,b,c,d){return 1===arguments.length?k(a):new m(a,b,c,null==d?1:d)}function m(a,b,c,d){this.h=+a,this.s=+b,this.l=+c,this.opacity=+d}function n(a,b,c){return 255*(a<60?b+(c-b)*a/60:a<180?c:a<240?b+(c-b)*(240-a)/60:b)}function o(a){if(a instanceof q)return new q(a.l,a.a,a.b,a.opacity);if(a instanceof x){var b=a.h*Q;return new q(a.l,Math.cos(b)*a.c,Math.sin(b)*a.c,a.opacity)}a instanceof i||(a=g(a));var c=u(a.r),d=u(a.g),e=u(a.b),f=r((.4124564*c+.3575761*d+.1804375*e)/T),h=r((.2126729*c+.7151522*d+.072175*e)/U);return new q(116*h-16,500*(f-h),200*(h-r((.0193339*c+.119192*d+.9503041*e)/V)),a.opacity)}function p(a,b,c,d){return 1===arguments.length?o(a):new q(a,b,c,null==d?1:d)}function q(a,b,c,d){this.l=+a,this.a=+b,this.b=+c,this.opacity=+d}function r(a){return a>Z?Math.pow(a,1/3):a/Y+W}function s(a){return a>X?a*a*a:Y*(a-W)}function t(a){return 255*(a<=.0031308?12.92*a:1.055*Math.pow(a,1/2.4)-.055)}function u(a){return(a/=255)<=.04045?a/12.92:Math.pow((a+.055)/1.055,2.4)}function v(a){if(a instanceof x)return new x(a.h,a.c,a.l,a.opacity);a instanceof q||(a=o(a));var b=Math.atan2(a.b,a.a)*R;return new x(b<0?b+360:b,Math.sqrt(a.a*a.a+a.b*a.b),a.l,a.opacity)}function w(a,b,c,d){return 1===arguments.length?v(a):new x(a,b,c,null==d?1:d)}function x(a,b,c,d){this.h=+a,this.c=+b,this.l=+c,this.opacity=+d}function y(a){if(a instanceof A)return new A(a.h,a.s,a.l,a.opacity);a instanceof i||(a=g(a));var b=a.r/255,c=a.g/255,d=a.b/255,e=(fa*d+da*b-ea*c)/(fa+da-ea),f=d-e,h=(ca*(c-e)-aa*f)/ba,j=Math.sqrt(h*h+f*f)/(ca*e*(1-e)),k=j?Math.atan2(h,f)*R-120:NaN;return new A(k<0?k+360:k,j,e,a.opacity)}function z(a,b,c,d){return 1===arguments.length?y(a):new A(a,b,c,null==d?1:d)}function A(a,b,c,d){this.h=+a,this.s=+b,this.l=+c,this.opacity=+d}var B=function(a,b,c){a.prototype=b.prototype=c,c.constructor=a},C=.7,D=1/C,E="\\s*([+-]?\\d+)\\s*",F="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",G="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",H=/^#([0-9a-f]{3})$/,I=/^#([0-9a-f]{6})$/,J=new RegExp("^rgb\\("+[E,E,E]+"\\)$"),K=new RegExp("^rgb\\("+[G,G,G]+"\\)$"),L=new RegExp("^rgba\\("+[E,E,E,F]+"\\)$"),M=new RegExp("^rgba\\("+[G,G,G,F]+"\\)$"),N=new RegExp("^hsl\\("+[F,G,G]+"\\)$"),O=new RegExp("^hsla\\("+[F,G,G,F]+"\\)$"),P={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};B(c,d,{displayable:function(){return this.rgb().displayable()},toString:function(){return this.rgb()+""}}),B(i,h,b(c,{brighter:function(a){return a=null==a?D:Math.pow(D,a),new i(this.r*a,this.g*a,this.b*a,this.opacity)},darker:function(a){return a=null==a?C:Math.pow(C,a),new i(this.r*a,this.g*a,this.b*a,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},toString:function(){var a=this.opacity;return a=isNaN(a)?1:Math.max(0,Math.min(1,a)),(1===a?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===a?")":", "+a+")")}})),B(m,l,b(c,{brighter:function(a){return a=null==a?D:Math.pow(D,a),new m(this.h,this.s,this.l*a,this.opacity)},darker:function(a){return a=null==a?C:Math.pow(C,a),new m(this.h,this.s,this.l*a,this.opacity)},rgb:function(){var a=this.h%360+360*(this.h<0),b=isNaN(a)||isNaN(this.s)?0:this.s,c=this.l,d=c+(c<.5?c:1-c)*b,e=2*c-d;return new i(n(a>=240?a-240:a+120,e,d),n(a,e,d),n(a<120?a+240:a-120,e,d),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var Q=Math.PI/180,R=180/Math.PI,S=18,T=.95047,U=1,V=1.08883,W=4/29,X=6/29,Y=3*X*X,Z=X*X*X;B(q,p,b(c,{brighter:function(a){return new q(this.l+S*(null==a?1:a),this.a,this.b,this.opacity)},darker:function(a){return new q(this.l-S*(null==a?1:a),this.a,this.b,this.opacity)},rgb:function(){var a=(this.l+16)/116,b=isNaN(this.a)?a:a+this.a/500,c=isNaN(this.b)?a:a-this.b/200;return a=U*s(a),b=T*s(b),c=V*s(c),new i(t(3.2404542*b-1.5371385*a-.4985314*c),t(-.969266*b+1.8760108*a+.041556*c),t(.0556434*b-.2040259*a+1.0572252*c),this.opacity)}})),B(x,w,b(c,{brighter:function(a){return new x(this.h,this.c,this.l+S*(null==a?1:a),this.opacity)},darker:function(a){return new x(this.h,this.c,this.l-S*(null==a?1:a),this.opacity)},rgb:function(){return o(this).rgb()}}));var $=-.14861,_=1.78277,aa=-.29227,ba=-.90649,ca=1.97294,da=ca*ba,ea=ca*_,fa=_*aa-ba*$;B(A,z,b(c,{brighter:function(a){return a=null==a?D:Math.pow(D,a),new A(this.h,this.s,this.l*a,this.opacity)},darker:function(a){return a=null==a?C:Math.pow(C,a),new A(this.h,this.s,this.l*a,this.opacity)},rgb:function(){var a=isNaN(this.h)?0:(this.h+120)*Q,b=+this.l,c=isNaN(this.s)?0:this.s*b*(1-b),d=Math.cos(a),e=Math.sin(a);return new i(255*(b+c*($*d+_*e)),255*(b+c*(aa*d+ba*e)),255*(b+c*(ca*d)),this.opacity)}})),a.color=d,a.rgb=h,a.hsl=l,a.lab=p,a.hcl=w,a.cubehelix=z,Object.defineProperty(a,"__esModule",{value:!0})})},{}],4:[function(a,b,c){!function(a,d){"object"==typeof c&&void 0!==b?d(c):"function"==typeof define&&define.amd?define(["exports"],d):d(a.d3=a.d3||{})}(this,function(a){"use strict";function b(){for(var a,b=0,d=arguments.length,e={};b=0&&(c=a.slice(d+1),a=a.slice(0,d)),a&&!b.hasOwnProperty(a))throw new Error("unknown type: "+a);return{type:a,name:c}})}function e(a,b){for(var c,d=0,e=a.length;d0)for(var c,d,e=new Array(c),f=0;f1?d[0]+d.slice(2):d,+a.slice(c+1)]}function c(a){return a=b(Math.abs(a)),a?a[1]:NaN}function d(a,b){return function(c,d){for(var e=c.length,f=[],g=0,h=a[0],i=0;e>0&&h>0&&(i+h+1>d&&(h=Math.max(1,d-i)),f.push(c.substring(e-=h,e+h)),!((i+=h+1)>d));)h=a[g=(g+1)%a.length];return f.reverse().join(b)}}function e(a,b){a=a.toPrecision(b);a:for(var c,d=a.length,e=1,f=-1;e0&&(f=0)}return f>0?a.slice(0,f)+a.slice(c+1):a}function f(a,c){var d=b(a,c);if(!d)return a+"";var e=d[0],f=d[1],g=f-(p=3*Math.max(-8,Math.min(8,Math.floor(f/3))))+1,h=e.length;return g===h?e:g>h?e+new Array(g-h+1).join("0"):g>0?e.slice(0,g)+"."+e.slice(g):"0."+new Array(1-g).join("0")+b(a,Math.max(0,c+g-1))[0]}function g(a,c){var d=b(a,c);if(!d)return a+"";var e=d[0],f=d[1];return f<0?"0."+new Array(-f).join("0")+e:e.length>f+1?e.slice(0,f+1)+"."+e.slice(f+1):e+new Array(f-e.length+2).join("0")}function h(a){return new i(a)}function i(a){if(!(b=r.exec(a)))throw new Error("invalid format: "+a);var b,c=b[1]||" ",d=b[2]||">",e=b[3]||"-",f=b[4]||"",g=!!b[5],h=b[6]&&+b[6],i=!!b[7],j=b[8]&&+b[8].slice(1),k=b[9]||"";"n"===k?(i=!0,k="g"):q[k]||(k=""),(g||"0"===c&&"="===d)&&(g=!0,c="0",d="="),this.fill=c,this.align=d,this.sign=e,this.symbol=f,this.zero=g,this.width=h,this.comma=i,this.precision=j,this.type=k}function j(a){return a}function k(a){function b(a){function b(a){var b,g,h,j=r,q=s;if("c"===o)q=u(a)+q,a="";else{a=+a;var w=(a<0||1/a<0)&&(a*=-1,!0);if(a=u(a,n),w)for(b=-1,g=a.length,w=!1;++b(h=a.charCodeAt(b))||h>57){q=(46===h?i+a.slice(b+1):a.slice(b))+q,a=a.slice(0,b);break}}m&&!k&&(a=f(a,1/0));var x=j.length+a.length+q.length,y=x>1)+j+a+q+y.slice(x)}return y+j+a+q}a=h(a);var c=a.fill,d=a.align,e=a.sign,j=a.symbol,k=a.zero,l=a.width,m=a.comma,n=a.precision,o=a.type,r="$"===j?g[0]:"#"===j&&/[boxX]/.test(o)?"0"+o.toLowerCase():"",s="$"===j?g[1]:/[%p]/.test(o)?"%":"",u=q[o],v=!o||/[defgprs%]/.test(o);return n=null==n?o?6:12:/[gprs]/.test(o)?Math.max(1,Math.min(21,n)):Math.max(0,Math.min(20,n)),b.toString=function(){return a+""},b}function e(a,d){var e=b((a=h(a),a.type="f",a)),f=3*Math.max(-8,Math.min(8,Math.floor(c(d)/3))),g=Math.pow(10,-f),i=t[8+f/3];return function(a){return e(g*a)+i}}var f=a.grouping&&a.thousands?d(a.grouping,a.thousands):j,g=a.currency,i=a.decimal;return{format:b,formatPrefix:e}}function l(b){return s=k(b),a.format=s.format,a.formatPrefix=s.formatPrefix,s}function m(a){return Math.max(0,-c(Math.abs(a)))}function n(a,b){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(c(b)/3)))-c(Math.abs(a)))}function o(a,b){return a=Math.abs(a),b=Math.abs(b)-a,Math.max(0,c(b)-c(a))+1}var p,q={"":e,"%":function(a,b){return(100*a).toFixed(b)},b:function(a){return Math.round(a).toString(2)},c:function(a){return a+""},d:function(a){return Math.round(a).toString(10)},e:function(a,b){return a.toExponential(b)},f:function(a,b){return a.toFixed(b)},g:function(a,b){return a.toPrecision(b)},o:function(a){return Math.round(a).toString(8)},p:function(a,b){return g(100*a,b)},r:g,s:f,X:function(a){return Math.round(a).toString(16).toUpperCase()},x:function(a){return Math.round(a).toString(16)}},r=/^(?:(.)?([<>=^]))?([+\-\( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?([a-z%])?$/i;i.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+this.type};var s,t=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];l({decimal:".",thousands:",",grouping:[3],currency:["$",""]}),a.formatDefaultLocale=l,a.formatLocale=k,a.formatSpecifier=h,a.precisionFixed=m,a.precisionPrefix=n,a.precisionRound=o,Object.defineProperty(a,"__esModule",{value:!0})})},{}],6:[function(a,b,c){!function(d,e){"object"==typeof c&&void 0!==b?e(c,a("d3-color")):"function"==typeof define&&define.amd?define(["exports","d3-color"],e):e(d.d3=d.d3||{},d.d3)}(this,function(a,b){"use strict";function c(a,b,c,d,e){var f=a*a,g=f*a;return((1-3*a+3*f-g)*b+(4-6*f+3*g)*c+(1+3*a+3*f-3*g)*d+g*e)/6}function d(a,b){return function(c){return a+c*b}}function e(a,b,c){return a=Math.pow(a,c),b=Math.pow(b,c)-a,c=1/c,function(d){return Math.pow(a+d*b,c)}}function f(a,b){var c=b-a;return c?d(a,c>180||c<-180?c-360*Math.round(c/360):c):B(isNaN(a)?b:a)}function g(a){return 1==(a=+a)?h:function(b,c){return c-b?e(b,c,a):B(isNaN(b)?c:b)}}function h(a,b){var c=b-a;return c?d(a,c):B(isNaN(a)?b:a)}function i(a){return function(c){var d,e,f=c.length,g=new Array(f),h=new Array(f),i=new Array(f);for(d=0;d180?b+=360:b-a>180&&(a+=360),f.push({i:c.push(e(c)+"rotate(",null,d)-2,x:H(a,b)})):b&&c.push(e(c)+"rotate("+b+d)}function h(a,b,c,f){a!==b?f.push({i:c.push(e(c)+"skewX(",null,d)-2,x:H(a,b)}):b&&c.push(e(c)+"skewX("+b+d)}function i(a,b,c,d,f,g){if(a!==c||b!==d){var h=f.push(e(f)+"scale(",null,",",null,")");g.push({i:h-4,x:H(a,c)},{i:h-2,x:H(b,d)})}else 1===c&&1===d||f.push(e(f)+"scale("+c+","+d+")")}return function(b,c){var d=[],e=[];return b=a(b),c=a(c),f(b.translateX,b.translateY,c.translateX,c.translateY,d,e),g(b.rotate,c.rotate,d,e),h(b.skewX,c.skewX,d,e),i(b.scaleX,b.scaleY,c.scaleX,c.scaleY,d,e),b=c=null,function(a){for(var b,c=-1,f=e.length;++c=1?(d=1,b-1):Math.floor(d*b),f=a[e],g=a[e+1],h=e>0?a[e-1]:2*f-g,i=ef&&(e=b.slice(f,e),h[g]?h[g]+=e:h[++g]=e),(c=c[0])===(d=d[0])?h[g]?h[g]+=d:h[++g]=d:(h[++g]=null,i.push({i:g,x:H(c,d)})),f=K.lastIndex;return f=c?1:d(a)}}}function q(a){return function(b,c){var d=a(b=+b,c=+c);return function(a){return a<=0?b:a>=1?c:d(a)}}}function r(a,b,c,d){var e=a[0],f=a[1],g=b[0],h=b[1];return f2?s:r,g=h=null,e}function e(b){return(g||(g=f(i,j,l?p(a):a,k)))(+b)}var f,g,h,i=$,j=$,k=d.interpolate,l=!1;return e.invert=function(a){return(h||(h=f(j,i,o,l?q(b):b)))(+a)},e.domain=function(a){return arguments.length?(i=X.call(a,n),c()):i.slice()},e.range=function(a){return arguments.length?(j=Y.call(a),c()):j.slice()},e.rangeRound=function(a){return j=Y.call(a),k=d.interpolateRound,c()},e.clamp=function(a){return arguments.length?(l=!!a,c()):l},e.interpolate=function(a){return arguments.length?(k=a,c()):k},c()}function v(a,c,d){var f,g=a[0],h=a[a.length-1],i=b.tickStep(g,h,null==c?10:c);switch(d=e.formatSpecifier(null==d?",f":d),d.type){case"s":var j=Math.max(Math.abs(g),Math.abs(h));return null!=d.precision||isNaN(f=e.precisionPrefix(i,j))||(d.precision=f),e.formatPrefix(d,j);case"":case"e":case"g":case"p":case"r":null!=d.precision||isNaN(f=e.precisionRound(i,Math.max(Math.abs(g),Math.abs(h))))||(d.precision=f-("e"===d.type));break;case"f":case"%":null!=d.precision||isNaN(f=e.precisionFixed(i))||(d.precision=f-2*("%"===d.type))}return e.format(d)}function w(a){var c=a.domain;return a.ticks=function(a){var d=c();return b.ticks(d[0],d[d.length-1],null==a?10:a)},a.tickFormat=function(a,b){return v(c(),a,b)},a.nice=function(d){var e=c(),f=e.length-1,g=null==d?10:d,h=e[0],i=e[f],j=b.tickStep(h,i,g);return j&&(j=b.tickStep(Math.floor(h/j)*j,Math.ceil(i/j)*j,g),e[0]=Math.floor(h/j)*j,e[f]=Math.ceil(i/j)*j,c(e)),a},a}function x(){var a=u(o,d.interpolateNumber);return a.copy=function(){return t(a,x())},w(a)}function y(){function a(a){return+a}var b=[0,1];return a.invert=a,a.domain=a.range=function(c){return arguments.length?(b=X.call(c,n),a):b.slice()},a.copy=function(){return y().domain(b)},w(a)}function z(a,b){a=a.slice();var c,d=0,e=a.length-1,f=a[d],g=a[e];return g0){for(;nj)break;q.push(m)}}else for(;n=1;--l)if(!((m=k*l)j)break;q.push(m)}}else q=b.ticks(n,o,Math.min(o-n,p)).map(h);return c?q.reverse():q},c.tickFormat=function(a,b){if(null==b&&(b=10===f?".0e":","),"function"!=typeof b&&(b=e.format(b)),a===1/0)return b;null==a&&(a=10);var d=Math.max(1,f*a/c.ticks().length);return function(a){var c=a/h(Math.round(g(a)));return c*f0?f[b-1]:d[0],b=f?[g[f-1],e]:[g[b-1],g[b]]},a.copy=function(){return L().domain([d,e]).range(h)},w(a)}function M(){function a(a){if(a<=a)return d[b.bisect(c,a,0,e)]}var c=[.5],d=[0,1],e=1;return a.domain=function(b){return arguments.length?(c=Y.call(b),e=Math.min(c.length,d.length-1),a):c.slice()},a.range=function(b){return arguments.length?(d=Y.call(b),e=Math.min(c.length,d.length-1),a):d.slice()},a.invertExtent=function(a){var b=d.indexOf(a);return[c[b-1],c[b]]},a.copy=function(){return M().domain(c).range(d)},a}function N(a){return new Date(a)}function O(a){return a instanceof Date?+a:+new Date(+a)}function P(a,c,e,f,g,h,i,j,k){function l(b){return(i(b)1)&&(a-=Math.floor(a));var b=Math.abs(a-.5);return na.h=360*a-100,na.s=1.5-1.5*b,na.l=.8-.9*b,na+""}function U(a){var b=a.length;return function(c){return a[Math.max(0,Math.min(b-1,Math.floor(c*b)))]}}function V(a){function b(b){var f=(b-c)/(d-c);return a(e?Math.max(0,Math.min(1,f)):f)}var c=0,d=1,e=!1;return b.domain=function(a){return arguments.length?(c=+a[0],d=+a[1],b):[c,d]},b.clamp=function(a){return arguments.length?(e=!!a,b):e},b.interpolator=function(c){return arguments.length?(a=c,b):a},b.copy=function(){return V(a).domain([c,d]).clamp(e)},w(b)}var W=Array.prototype,X=W.map,Y=W.slice,Z={name:"implicit"},$=[0,1],_=1e3,aa=60*_,ba=60*aa,ca=24*ba,da=7*ca,ea=30*ca,fa=365*ca,ga=S("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),ha=S("393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6"),ia=S("3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9"),ja=S("1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5"),ka=d.interpolateCubehelixLong(h.cubehelix(300,.5,0),h.cubehelix(-240,.5,1)),la=d.interpolateCubehelixLong(h.cubehelix(-100,.75,.35),h.cubehelix(80,1.5,.8)),ma=d.interpolateCubehelixLong(h.cubehelix(260,.75,.35),h.cubehelix(80,1.5,.8)),na=h.cubehelix(),oa=U(S("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),pa=U(S("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),qa=U(S("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),ra=U(S("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));a.scaleBand=j,a.scalePoint=l,a.scaleIdentity=y,a.scaleLinear=x,a.scaleLog=G,a.scaleOrdinal=i,a.scaleImplicit=Z,a.scalePow=I,a.scaleSqrt=J,a.scaleQuantile=K,a.scaleQuantize=L,a.scaleThreshold=M,a.scaleTime=Q,a.scaleUtc=R,a.schemeCategory10=ga,a.schemeCategory20b=ha,a.schemeCategory20c=ia,a.schemeCategory20=ja,a.interpolateCubehelixDefault=ka,a.interpolateRainbow=T,a.interpolateWarm=la,a.interpolateCool=ma,a.interpolateViridis=oa,a.interpolateMagma=pa,a.interpolateInferno=qa,a.interpolatePlasma=ra,a.scaleSequential=V,Object.defineProperty(a,"__esModule",{value:!0})})},{"d3-array":1,"d3-collection":2,"d3-color":3,"d3-format":5,"d3-interpolate":6,"d3-time":10,"d3-time-format":9}],8:[function(a,b,c){!function(a,d){"object"==typeof c&&void 0!==b?d(c):"function"==typeof define&&define.amd?define(["exports"],d):d(a.d3=a.d3||{})}(this,function(a){"use strict";function b(a){var b=a+="",c=b.indexOf(":");return c>=0&&"xmlns"!==(b=a.slice(0,c))&&(a=a.slice(c+1)),Qa.hasOwnProperty(b)?{space:Qa[b],local:a}:a}function c(a){return function(){var b=this.ownerDocument,c=this.namespaceURI;return c===Pa&&b.documentElement.namespaceURI===Pa?b.createElement(a):b.createElementNS(c,a)}}function d(a){return function(){return this.ownerDocument.createElementNS(a.space,a.local)}}function e(a){var e=b(a);return(e.local?d:c)(e)}function f(){return new g}function g(){this._="@"+(++Ra).toString(36)}function h(a,b,c){return a=i(a,b,c),function(b){var c=b.relatedTarget;c&&(c===this||8&c.compareDocumentPosition(this))||a.call(this,b)}}function i(b,c,d){return function(e){var f=a.event;a.event=e;try{b.call(this,this.__data__,c,d)}finally{a.event=f}}}function j(a){return a.trim().split(/^|\s+/).map(function(a){var b="",c=a.indexOf(".");return c>=0&&(b=a.slice(c+1),a=a.slice(0,c)),{type:a,name:b}})}function k(a){return function(){var b=this.__on;if(b){for(var c,d=0,e=-1,f=b.length;d=u&&(u=t+1);!(s=q[u])&&++u=0;)(d=e[f])&&(g&&g!==d.nextSibling&&g.parentNode.insertBefore(d,g),g=d);return this}function I(a){function b(b,c){return b&&c?a(b.__data__,c.__data__):!b-!c}a||(a=J);for(var c=this._groups,d=c.length,e=new Array(d),f=0;fb?1:a>=b?0:NaN}function K(){var a=arguments[0];return arguments[0]=this,a.apply(null,arguments),this}function L(){var a=new Array(this.size()),b=-1;return this.each(function(){a[++b]=this}),a}function M(){for(var a=this._groups,b=0,c=a.length;b1?this.each((null==b?Y:"function"==typeof b?$:Z)(a,b,null==c?"":c)):X(d=this.node()).getComputedStyle(d,null).getPropertyValue(a)}function aa(a){return function(){delete this[a]}}function ba(a,b){return function(){this[a]=b}}function ca(a,b){return function(){var c=b.apply(this,arguments);null==c?delete this[a]:this[a]=c}}function da(a,b){return arguments.length>1?this.each((null==b?aa:"function"==typeof b?ca:ba)(a,b)):this.node()[a]}function ea(a){return a.trim().split(/^|\s+/)}function fa(a){return a.classList||new ga(a)}function ga(a){this._node=a,this._names=ea(a.getAttribute("class")||"")}function ha(a,b){for(var c=fa(a),d=-1,e=b.length;++d=0&&(this._names.splice(b,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(a){return this._names.indexOf(a)>=0}};var Ya=[null];Ja.prototype=Ka.prototype={constructor:Ja,select:t,selectAll:w,filter:x,data:E,enter:z,exit:F,merge:G,order:H,sort:I,call:K,nodes:L,node:M,size:N,empty:O,each:P,attr:W,style:_,property:da,classed:ma,text:qa,html:ua,raise:wa,lower:ya,append:za,insert:Ba,remove:Da,datum:Ea,on:m,dispatch:Ia},a.creator=e,a.local=f,a.matcher=Va,a.mouse=q,a.namespace=b,a.namespaces=Qa,a.select=La,a.selectAll=Ma,a.selection=Ka,a.selector=s,a.selectorAll=v,a.touch=Na,a.touches=Oa,a.window=X,a.customEvent=n,Object.defineProperty(a,"__esModule",{value:!0})})},{}],9:[function(a,b,c){!function(d,e){"object"==typeof c&&void 0!==b?e(c,a("d3-time")):"function"==typeof define&&define.amd?define(["exports","d3-time"],e):e(d.d3=d.d3||{},d.d3)}(this,function(a,b){"use strict";function c(a){if(0<=a.y&&a.y<100){var b=new Date(-1,a.m,a.d,a.H,a.M,a.S,a.L);return b.setFullYear(a.y),b}return new Date(a.y,a.m,a.d,a.H,a.M,a.S,a.L)}function d(a){if(0<=a.y&&a.y<100){var b=new Date(Date.UTC(-1,a.m,a.d,a.H,a.M,a.S,a.L));return b.setUTCFullYear(a.y),b}return new Date(Date.UTC(a.y,a.m,a.d,a.H,a.M,a.S,a.L))}function e(a){return{y:a,m:0,d:1,H:0,M:0,S:0,L:0}}function f(a){function f(a,b){return function(c){var d,e,f,g=[],h=-1,i=0,j=a.length;for(c instanceof Date||(c=new Date(+c));++h53)return null;"w"in j||(j.w=1),"Z"in j?(g=d(e(j.y)),i=g.getUTCDay(),g=i>4||0===i?b.utcMonday.ceil(g):b.utcMonday(g),g=b.utcDay.offset(g,7*(j.V-1)),j.y=g.getUTCFullYear(),j.m=g.getUTCMonth(),j.d=g.getUTCDate()+(j.w+6)%7):(g=c(e(j.y)),i=g.getDay(), +g=i>4||0===i?b.timeMonday.ceil(g):b.timeMonday(g),g=b.timeDay.offset(g,7*(j.V-1)),j.y=g.getFullYear(),j.m=g.getMonth(),j.d=g.getDate()+(j.w+6)%7)}else("W"in j||"U"in j)&&("w"in j||(j.w="u"in j?j.u%7:"W"in j?1:0),i="Z"in j?d(e(j.y)).getUTCDay():c(e(j.y)).getDay(),j.m=0,j.d="W"in j?(j.w+6)%7+7*j.W-(i+5)%7:j.w+7*j.U-(i+6)%7);return"Z"in j?(j.H+=j.Z/100|0,j.M+=j.Z%100,d(j)):c(j)}}function h(a,b,c,d){for(var e,f,g=0,h=b.length,i=c.length;g=i)return-1;if(37===(e=b.charCodeAt(g++))){if(e=b.charAt(g++),!(f=Za[e in qa?b.charAt(g++):e])||(d=f(a,c,d))<0)return-1}else if(e!=c.charCodeAt(d++))return-1}return d}function ma(a,b,c){var d=Na.exec(b.slice(c));return d?(a.p=Oa[d[0].toLowerCase()],c+d[0].length):-1}function na(a,b,c){var d=Ra.exec(b.slice(c));return d?(a.w=Sa[d[0].toLowerCase()],c+d[0].length):-1}function oa(a,b,c){var d=Pa.exec(b.slice(c));return d?(a.w=Qa[d[0].toLowerCase()],c+d[0].length):-1}function pa(a,b,c){var d=Va.exec(b.slice(c));return d?(a.m=Wa[d[0].toLowerCase()],c+d[0].length):-1}function ra(a,b,c){var d=Ta.exec(b.slice(c));return d?(a.m=Ua[d[0].toLowerCase()],c+d[0].length):-1}function sa(a,b,c){return h(a,Fa,b,c)}function ta(a,b,c){return h(a,Ga,b,c)}function ua(a,b,c){return h(a,Ha,b,c)}function va(a){return Ka[a.getDay()]}function wa(a){return Ja[a.getDay()]}function xa(a){return Ma[a.getMonth()]}function ya(a){return La[a.getMonth()]}function za(a){return Ia[+(a.getHours()>=12)]}function Aa(a){return Ka[a.getUTCDay()]}function Ba(a){return Ja[a.getUTCDay()]}function Ca(a){return Ma[a.getUTCMonth()]}function Da(a){return La[a.getUTCMonth()]}function Ea(a){return Ia[+(a.getUTCHours()>=12)]}var Fa=a.dateTime,Ga=a.date,Ha=a.time,Ia=a.periods,Ja=a.days,Ka=a.shortDays,La=a.months,Ma=a.shortMonths,Na=i(Ia),Oa=j(Ia),Pa=i(Ja),Qa=j(Ja),Ra=i(Ka),Sa=j(Ka),Ta=i(La),Ua=j(La),Va=i(Ma),Wa=j(Ma),Xa={a:va,A:wa,b:xa,B:ya,c:null,d:D,e:D,f:I,H:E,I:F,j:G,L:H,m:J,M:K,p:za,Q:ka,s:la,S:L,u:M,U:N,V:O,w:P,W:Q,x:null,X:null,y:R,Y:S,Z:T,"%":ja},Ya={a:Aa,A:Ba,b:Ca,B:Da,c:null,d:U,e:U,f:Z,H:V,I:W,j:X,L:Y,m:$,M:_,p:Ea,Q:ka,s:la,S:aa,u:ba,U:ca,V:da,w:ea,W:fa,x:null,X:null,y:ga,Y:ha,Z:ia,"%":ja},Za={a:na,A:oa,b:pa,B:ra,c:sa,d:t,e:t,f:z,H:v,I:v,j:u,L:y,m:s,M:w,p:ma,Q:B,s:C,S:x,u:l,U:m,V:n,w:k,W:o,x:ta,X:ua,y:q,Y:p,Z:r,"%":A};return Xa.x=f(Ga,Xa),Xa.X=f(Ha,Xa),Xa.c=f(Fa,Xa),Ya.x=f(Ga,Ya),Ya.X=f(Ha,Ya),Ya.c=f(Fa,Ya),{format:function(a){var b=f(a+="",Xa);return b.toString=function(){return a},b},parse:function(a){var b=g(a+="",c);return b.toString=function(){return a},b},utcFormat:function(a){var b=f(a+="",Ya);return b.toString=function(){return a},b},utcParse:function(a){var b=g(a,d);return b.toString=function(){return a},b}}}function g(a,b,c){var d=a<0?"-":"",e=(d?-a:a)+"",f=e.length;return d+(f68?1900:2e3),c+d[0].length):-1}function r(a,b,c){var d=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(b.slice(c,c+6));return d?(a.Z=d[1]?0:-(d[2]+(d[3]||"00")),c+d[0].length):-1}function s(a,b,c){var d=ra.exec(b.slice(c,c+2));return d?(a.m=d[0]-1,c+d[0].length):-1}function t(a,b,c){var d=ra.exec(b.slice(c,c+2));return d?(a.d=+d[0],c+d[0].length):-1}function u(a,b,c){var d=ra.exec(b.slice(c,c+3));return d?(a.m=0,a.d=+d[0],c+d[0].length):-1}function v(a,b,c){var d=ra.exec(b.slice(c,c+2));return d?(a.H=+d[0],c+d[0].length):-1}function w(a,b,c){var d=ra.exec(b.slice(c,c+2));return d?(a.M=+d[0],c+d[0].length):-1}function x(a,b,c){var d=ra.exec(b.slice(c,c+2));return d?(a.S=+d[0],c+d[0].length):-1}function y(a,b,c){var d=ra.exec(b.slice(c,c+3));return d?(a.L=+d[0],c+d[0].length):-1}function z(a,b,c){var d=ra.exec(b.slice(c,c+6));return d?(a.L=Math.floor(d[0]/1e3),c+d[0].length):-1}function A(a,b,c){var d=sa.exec(b.slice(c,c+1));return d?c+d[0].length:-1}function B(a,b,c){var d=ra.exec(b.slice(c));return d?(a.Q=+d[0],c+d[0].length):-1}function C(a,b,c){var d=ra.exec(b.slice(c));return d?(a.Q=1e3*+d[0],c+d[0].length):-1}function D(a,b){return g(a.getDate(),b,2)}function E(a,b){return g(a.getHours(),b,2)}function F(a,b){return g(a.getHours()%12||12,b,2)}function G(a,c){return g(1+b.timeDay.count(b.timeYear(a),a),c,3)}function H(a,b){return g(a.getMilliseconds(),b,3)}function I(a,b){return H(a,b)+"000"}function J(a,b){return g(a.getMonth()+1,b,2)}function K(a,b){return g(a.getMinutes(),b,2)}function L(a,b){return g(a.getSeconds(),b,2)}function M(a){var b=a.getDay();return 0===b?7:b}function N(a,c){return g(b.timeSunday.count(b.timeYear(a),a),c,2)}function O(a,c){var d=a.getDay();return a=d>=4||0===d?b.timeThursday(a):b.timeThursday.ceil(a),g(b.timeThursday.count(b.timeYear(a),a)+(4===b.timeYear(a).getDay()),c,2)}function P(a){return a.getDay()}function Q(a,c){return g(b.timeMonday.count(b.timeYear(a),a),c,2)}function R(a,b){return g(a.getFullYear()%100,b,2)}function S(a,b){return g(a.getFullYear()%1e4,b,4)}function T(a){var b=a.getTimezoneOffset();return(b>0?"-":(b*=-1,"+"))+g(b/60|0,"0",2)+g(b%60,"0",2)}function U(a,b){return g(a.getUTCDate(),b,2)}function V(a,b){return g(a.getUTCHours(),b,2)}function W(a,b){return g(a.getUTCHours()%12||12,b,2)}function X(a,c){return g(1+b.utcDay.count(b.utcYear(a),a),c,3)}function Y(a,b){return g(a.getUTCMilliseconds(),b,3)}function Z(a,b){return Y(a,b)+"000"}function $(a,b){return g(a.getUTCMonth()+1,b,2)}function _(a,b){return g(a.getUTCMinutes(),b,2)}function aa(a,b){return g(a.getUTCSeconds(),b,2)}function ba(a){var b=a.getUTCDay();return 0===b?7:b}function ca(a,c){return g(b.utcSunday.count(b.utcYear(a),a),c,2)}function da(a,c){var d=a.getUTCDay();return a=d>=4||0===d?b.utcThursday(a):b.utcThursday.ceil(a),g(b.utcThursday.count(b.utcYear(a),a)+(4===b.utcYear(a).getUTCDay()),c,2)}function ea(a){return a.getUTCDay()}function fa(a,c){return g(b.utcMonday.count(b.utcYear(a),a),c,2)}function ga(a,b){return g(a.getUTCFullYear()%100,b,2)}function ha(a,b){return g(a.getUTCFullYear()%1e4,b,4)}function ia(){return"+0000"}function ja(){return"%"}function ka(a){return+a}function la(a){return Math.floor(+a/1e3)}function ma(b){return pa=f(b),a.timeFormat=pa.format,a.timeParse=pa.parse,a.utcFormat=pa.utcFormat,a.utcParse=pa.utcParse,pa}function na(a){return a.toISOString()}function oa(a){var b=new Date(a);return isNaN(b)?null:b}var pa,qa={"-":"",_:" ",0:"0"},ra=/^\s*\d+/,sa=/^%/,ta=/[\\^$*+?|[\]().{}]/g;ma({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var ua="%Y-%m-%dT%H:%M:%S.%LZ",va=Date.prototype.toISOString?na:a.utcFormat(ua),wa=+new Date("2000-01-01T00:00:00.000Z")?oa:a.utcParse(ua);a.timeFormatDefaultLocale=ma,a.timeFormatLocale=f,a.isoFormat=va,a.isoParse=wa,Object.defineProperty(a,"__esModule",{value:!0})})},{"d3-time":10}],10:[function(a,b,c){!function(a,d){"object"==typeof c&&void 0!==b?d(c):"function"==typeof define&&define.amd?define(["exports"],d):d(a.d3=a.d3||{})}(this,function(a){"use strict";function b(a,c,d,g){function h(b){return a(b=new Date(+b)),b}return h.floor=h,h.ceil=function(b){return a(b=new Date(b-1)),c(b,1),a(b),b},h.round=function(a){var b=h(a),c=h.ceil(a);return a-b0))return f;do{f.push(new Date(+b))}while(c(b,e),a(b),b=b)for(;a(b),!d(b);)b.setTime(b-1)},function(a,b){if(a>=a)if(b<0)for(;++b<=0;)for(;c(a,-1),!d(a););else for(;--b>=0;)for(;c(a,1),!d(a););})},d&&(h.count=function(b,c){return e.setTime(+b),f.setTime(+c),a(e),a(f),Math.floor(d(e,f))},h.every=function(a){return a=Math.floor(a),isFinite(a)&&a>0?a>1?h.filter(g?function(b){return g(b)%a==0}:function(b){return h.count(0,b)%a==0}):h:null}),h}function c(a){return b(function(b){b.setDate(b.getDate()-(b.getDay()+7-a)%7),b.setHours(0,0,0,0)},function(a,b){a.setDate(a.getDate()+7*b)},function(a,b){return(b-a-(b.getTimezoneOffset()-a.getTimezoneOffset())*j)/m})}function d(a){return b(function(b){b.setUTCDate(b.getUTCDate()-(b.getUTCDay()+7-a)%7),b.setUTCHours(0,0,0,0)},function(a,b){a.setUTCDate(a.getUTCDate()+7*b)},function(a,b){return(b-a)/m})}var e=new Date,f=new Date,g=b(function(){},function(a,b){a.setTime(+a+b)},function(a,b){return b-a});g.every=function(a){return a=Math.floor(a),isFinite(a)&&a>0?a>1?b(function(b){b.setTime(Math.floor(b/a)*a)},function(b,c){b.setTime(+b+c*a)},function(b,c){return(c-b)/a}):g:null};var h=g.range,i=1e3,j=6e4,k=36e5,l=864e5,m=6048e5,n=b(function(a){a.setTime(Math.floor(a/i)*i)},function(a,b){a.setTime(+a+b*i)},function(a,b){return(b-a)/i},function(a){return a.getUTCSeconds()}),o=n.range,p=b(function(a){a.setTime(Math.floor(a/j)*j)},function(a,b){a.setTime(+a+b*j)},function(a,b){return(b-a)/j},function(a){return a.getMinutes()}),q=p.range,r=b(function(a){var b=a.getTimezoneOffset()*j%k;b<0&&(b+=k),a.setTime(Math.floor((+a-b)/k)*k+b)},function(a,b){a.setTime(+a+b*k)},function(a,b){return(b-a)/k},function(a){return a.getHours()}),s=r.range,t=b(function(a){a.setHours(0,0,0,0)},function(a,b){a.setDate(a.getDate()+b)},function(a,b){return(b-a-(b.getTimezoneOffset()-a.getTimezoneOffset())*j)/l},function(a){return a.getDate()-1}),u=t.range,v=c(0),w=c(1),x=c(2),y=c(3),z=c(4),A=c(5),B=c(6),C=v.range,D=w.range,E=x.range,F=y.range,G=z.range,H=A.range,I=B.range,J=b(function(a){a.setDate(1),a.setHours(0,0,0,0)},function(a,b){a.setMonth(a.getMonth()+b)},function(a,b){return b.getMonth()-a.getMonth()+12*(b.getFullYear()-a.getFullYear())},function(a){return a.getMonth()}),K=J.range,L=b(function(a){a.setMonth(0,1),a.setHours(0,0,0,0)},function(a,b){a.setFullYear(a.getFullYear()+b)},function(a,b){return b.getFullYear()-a.getFullYear()},function(a){return a.getFullYear()});L.every=function(a){return isFinite(a=Math.floor(a))&&a>0?b(function(b){b.setFullYear(Math.floor(b.getFullYear()/a)*a),b.setMonth(0,1),b.setHours(0,0,0,0)},function(b,c){b.setFullYear(b.getFullYear()+c*a)}):null};var M=L.range,N=b(function(a){a.setUTCSeconds(0,0)},function(a,b){a.setTime(+a+b*j)},function(a,b){return(b-a)/j},function(a){return a.getUTCMinutes()}),O=N.range,P=b(function(a){a.setUTCMinutes(0,0,0)},function(a,b){a.setTime(+a+b*k)},function(a,b){return(b-a)/k},function(a){return a.getUTCHours()}),Q=P.range,R=b(function(a){a.setUTCHours(0,0,0,0)},function(a,b){a.setUTCDate(a.getUTCDate()+b)},function(a,b){return(b-a)/l},function(a){return a.getUTCDate()-1}),S=R.range,T=d(0),U=d(1),V=d(2),W=d(3),X=d(4),Y=d(5),Z=d(6),$=T.range,_=U.range,aa=V.range,ba=W.range,ca=X.range,da=Y.range,ea=Z.range,fa=b(function(a){a.setUTCDate(1),a.setUTCHours(0,0,0,0)},function(a,b){a.setUTCMonth(a.getUTCMonth()+b)},function(a,b){return b.getUTCMonth()-a.getUTCMonth()+12*(b.getUTCFullYear()-a.getUTCFullYear())},function(a){return a.getUTCMonth()}),ga=fa.range,ha=b(function(a){a.setUTCMonth(0,1),a.setUTCHours(0,0,0,0)},function(a,b){a.setUTCFullYear(a.getUTCFullYear()+b)},function(a,b){return b.getUTCFullYear()-a.getUTCFullYear()},function(a){return a.getUTCFullYear()});ha.every=function(a){return isFinite(a=Math.floor(a))&&a>0?b(function(b){b.setUTCFullYear(Math.floor(b.getUTCFullYear()/a)*a),b.setUTCMonth(0,1),b.setUTCHours(0,0,0,0)},function(b,c){b.setUTCFullYear(b.getUTCFullYear()+c*a)}):null};var ia=ha.range;a.timeInterval=b,a.timeMillisecond=g,a.timeMilliseconds=h,a.utcMillisecond=g,a.utcMilliseconds=h,a.timeSecond=n,a.timeSeconds=o,a.utcSecond=n,a.utcSeconds=o,a.timeMinute=p,a.timeMinutes=q,a.timeHour=r,a.timeHours=s,a.timeDay=t,a.timeDays=u,a.timeWeek=v,a.timeWeeks=C,a.timeSunday=v,a.timeSundays=C,a.timeMonday=w,a.timeMondays=D,a.timeTuesday=x,a.timeTuesdays=E,a.timeWednesday=y,a.timeWednesdays=F,a.timeThursday=z,a.timeThursdays=G,a.timeFriday=A,a.timeFridays=H,a.timeSaturday=B,a.timeSaturdays=I,a.timeMonth=J,a.timeMonths=K,a.timeYear=L,a.timeYears=M,a.utcMinute=N,a.utcMinutes=O,a.utcHour=P,a.utcHours=Q,a.utcDay=R,a.utcDays=S,a.utcWeek=T,a.utcWeeks=$,a.utcSunday=T,a.utcSundays=$,a.utcMonday=U,a.utcMondays=_,a.utcTuesday=V,a.utcTuesdays=aa,a.utcWednesday=W,a.utcWednesdays=ba,a.utcThursday=X,a.utcThursdays=ca,a.utcFriday=Y,a.utcFridays=da,a.utcSaturday=Z,a.utcSaturdays=ea,a.utcMonth=fa,a.utcMonths=ga,a.utcYear=ha,a.utcYears=ia,Object.defineProperty(a,"__esModule",{value:!0})})},{}],11:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(a){var h=g.default.d3_calcType(b,z,m,o,s.format(t),w);a.selectAll("g").data([b]).enter().append("g").attr("class",p+"legendCells"),n&&g.default.d3_filterCells(h,n);var i=a.select("."+p+"legendCells").selectAll("."+p+"cell").data(h.data),j=i.enter().append("g").attr("class",p+"cell");j.append(c).attr("class",p+"swatch");var D=a.selectAll("g."+p+"cell "+c+"."+p+"swatch").data(h.data);g.default.d3_addEvents(j,C),i.exit().transition().style("opacity",0).remove(),D.exit().transition().style("opacity",0).remove(),D=D.merge(D),g.default.d3_drawShapes(c,D,e,d,f,A),g.default.d3_addText(a,j,h.labels,p,x),i=j.merge(i);var E=i.selectAll("text"),F=E.nodes().map(function(a){return a.getBBox()}),G=D.nodes().map(function(a){return a.getBBox()});q?D.attr("class",function(a){return p+"swatch "+h.feature(a)}):"line"==c?D.style("stroke",h.feature):D.style("fill",h.feature);var H=void 0,I=void 0,J="start"==v?0:"middle"==v?.5:1;if("vertical"===y){var K=F.map(function(a,b){return Math.max(a.height,G[b].height)});H=function(a,b){return"translate(0, "+((0,k.sum)(K.slice(0,b))+b*l)+")"},I=function(a,b){return"translate( "+(G[b].width+G[b].x+u)+", "+(G[b].y+G[b].height/2+5)+")"}}else"horizontal"===y&&(H=function(a,b){return"translate("+b*(G[b].width+l)+",0)"},I=function(a,b){return"translate("+(G[b].width*J+G[b].x)+",\n "+(G[b].height+G[b].y+u+8)+")"});g.default.d3_placement(y,i,H,E,I,v),g.default.d3_title(a,r,p,B),i.transition().style("opacity",1)}var b=(0,i.scaleLinear)(),c="rect",d=15,e=15,f=10,l=2,m=[5],n=void 0,o=[],p="",q=!1,r="",s=g.default.d3_defaultLocale,t=g.default.d3_defaultFormatSpecifier,u=10,v="middle",w=g.default.d3_defaultDelimiter,x=void 0,y="vertical",z=!1,A=void 0,B=void 0,C=(0,h.dispatch)("cellover","cellout","cellclick");return a.scale=function(c){return arguments.length?(b=c,a):b},a.cells=function(b){return arguments.length?((b.length>1||b>=2)&&(m=b),a):m},a.cellFilter=function(b){return arguments.length?(n=b,a):n},a.shape=function(b,d){return arguments.length?(("rect"==b||"circle"==b||"line"==b||"path"==b&&"string"==typeof d)&&(c=b,A=d),a):c},a.shapeWidth=function(b){return arguments.length?(d=+b,a):d},a.shapeHeight=function(b){return arguments.length?(e=+b,a):e},a.shapeRadius=function(b){return arguments.length?(f=+b,a):f},a.shapePadding=function(b){return arguments.length?(l=+b,a):l},a.labels=function(b){return arguments.length?(o=b,a):o},a.labelAlign=function(b){return arguments.length?("start"!=b&&"end"!=b&&"middle"!=b||(v=b),a):v},a.locale=function(b){return arguments.length?(s=(0,j.formatLocale)(b),a):s},a.labelFormat=function(b){return arguments.length?(t=(0,j.formatSpecifier)(b),a):a.locale().format(t)},a.labelOffset=function(b){return arguments.length?(u=+b,a):u},a.labelDelimiter=function(b){return arguments.length?(w=b,a):w},a.labelWrap=function(b){return arguments.length?(x=b,a):x},a.useClass=function(b){return arguments.length?(!0!==b&&!1!==b||(q=b),a):q},a.orient=function(b){return arguments.length?(b=b.toLowerCase(),"horizontal"!=b&&"vertical"!=b||(y=b),a):y},a.ascending=function(b){return arguments.length?(z=!!b,a):z},a.classPrefix=function(b){return arguments.length?(p=b,a):p},a.title=function(b){return arguments.length?(r=b,a):r},a.titleWidth=function(b){return arguments.length?(B=b,a):B},a.textWrap=function(b){return arguments.length?(textWrap=b,a):textWrap},a.on=function(){var b=C.on.apply(C,arguments);return b===C?a:b},a}Object.defineProperty(c,"__esModule",{value:!0}),c.default=e;var f=a("./legend"),g=d(f),h=a("d3-dispatch"),i=a("d3-scale"),j=a("d3-format"),k=a("d3-array")},{"./legend":13,"d3-array":1,"d3-dispatch":4,"d3-format":5,"d3-scale":7}],12:[function(a,b,c){"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d=c.thresholdLabels=function(a){var b=a.i,c=a.genLength,d=a.generatedLabels;return 0===b?d[b].replace("NaN to","Less than"):b===c-1?"More than "+d[c-1].replace(" to NaN",""):d[b]};c.default={thresholdLabels:d}},{}],13:[function(a,b,c){"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},e=a("d3-selection"),f=a("d3-format"),g=function(a){return a},h=function(a){for(var b=[],c=0,d=a.length;cb&&f.length>1&&(f.pop(),i.text(f.join(" ")),f=[a],i=c.append("tspan").attr("x",0).attr("dy",g+h+"em").text(a))})},j=function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],b=arguments[1],c=arguments[2],e=arguments[3];if("object"===(void 0===b?"undefined":d(b))){if(0===b.length)return a;for(var f=b.length;f1)d=b;else for(var e=a.domain(),f=(e[e.length-1]-e[0])/(b-1),g=0;g1||b>=2)&&(f=b),a):f},a.cellFilter=function(b){return arguments.length?(l=b,a):l},a.shape=function(b,d){return arguments.length?("rect"!=b&&"circle"!=b&&"line"!=b||(c=b,x=d),a):c},a.shapeWidth=function(b){return arguments.length?(d=+b,a):d},a.shapePadding=function(b){return arguments.length?(e=+b,a):e},a.labels=function(b){return arguments.length?(m=b,a):m},a.labelAlign=function(b){return arguments.length?("start"!=b&&"end"!=b&&"middle"!=b||(s=b),a):s},a.locale=function(b){return arguments.length?(p=(0,j.formatLocale)(b),a):p},a.labelFormat=function(b){return arguments.length?(q=(0,j.formatSpecifier)(b),a):a.locale().format(q)},a.labelOffset=function(b){return arguments.length?(r=+b,a):r},a.labelDelimiter=function(b){return arguments.length?(t=b,a):t},a.labelWrap=function(b){return arguments.length?(u=b,a):u},a.orient=function(b){return arguments.length?(b=b.toLowerCase(),"horizontal"!=b&&"vertical"!=b||(v=b),a):v},a.ascending=function(b){return arguments.length?(w=!!b,a):w},a.classPrefix=function(b){return arguments.length?(n=b,a):n},a.title=function(b){return arguments.length?(o=b,a):o},a.titleWidth=function(b){return arguments.length?(y=b,a):y},a.on=function(){var b=z.on.apply(z,arguments);return b===z?a:b},a}Object.defineProperty(c,"__esModule",{value:!0}),c.default=e;var f=a("./legend"),g=d(f),h=a("d3-dispatch"),i=a("d3-scale"),j=a("d3-format"),k=a("d3-array")},{"./legend":13,"d3-array":1,"d3-dispatch":4,"d3-format":5,"d3-scale":7}],15:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{default:a}}function e(){function a(a){var h=g.default.d3_calcType(b,y,m,o,r.format(s),v),i=a.selectAll("g").data([b]);n&&g.default.d3_filterCells(h,n),i.enter().append("g").attr("class",p+"legendCells");var j=a.select("."+p+"legendCells").selectAll("."+p+"cell").data(h.data),B=j.enter().append("g").attr("class",p+"cell");B.append(c).attr("class",p+"swatch");var C=a.selectAll("g."+p+"cell "+c+"."+p+"swatch");g.default.d3_addEvents(B,A),j.exit().transition().style("opacity",0).remove(),C.exit().transition().style("opacity",0).remove(),C=C.merge(C),g.default.d3_drawShapes(c,C,e,d,f,h.feature),g.default.d3_addText(a,B,h.labels,p,w),j=B.merge(j);var D=j.selectAll("text"),E=D.nodes().map(function(a){return a.getBBox()}),F=C.nodes().map(function(a){return a.getBBox()}),G=(0,k.max)(F,function(a){return a.height}),H=(0,k.max)(F,function(a){return a.width}),I=void 0,J=void 0,K="start"==t?0:"middle"==t?.5:1;if("vertical"===x){var L=E.map(function(a,b){return Math.max(G,a.height)});I=function(a,b){return"translate(0, "+((0,k.sum)(L.slice(0,b))+b*l)+" )"},J=function(a,b){return"translate( "+(H+u)+",\n "+(F[b].y+F[b].height/2+5)+")"}}else"horizontal"===x&&(I=function(a,b){return"translate( "+b*(H+l)+",0)"},J=function(a,b){return"translate( "+(F[b].width*K+F[b].x)+",\n "+(G+u)+")"});g.default.d3_placement(x,j,I,D,J,t),g.default.d3_title(a,q,p,z),j.transition().style("opacity",1)}var b=(0,i.scaleLinear)(),c="path",d=15,e=15,f=10,l=5,m=[5],n=void 0,o=[],p="",q="",r=g.default.d3_defaultLocale,s=g.default.d3_defaultFormatSpecifier,t="middle",u=10,v=g.default.d3_defaultDelimiter,w=void 0,x="vertical",y=!1,z=void 0,A=(0,h.dispatch)("cellover","cellout","cellclick");return a.scale=function(c){return arguments.length?(b=c,a):b},a.cells=function(b){return arguments.length?((b.length>1||b>=2)&&(m=b),a):m},a.cellFilter=function(b){return arguments.length?(n=b,a):n},a.shapePadding=function(b){return arguments.length?(l=+b,a):l},a.labels=function(b){return arguments.length?(o=b,a):o},a.labelAlign=function(b){return arguments.length?("start"!=b&&"end"!=b&&"middle"!=b||(t=b),a):t},a.locale=function(b){return arguments.length?(r=(0,j.formatLocale)(b),a):r},a.labelFormat=function(b){return arguments.length?(s=(0,j.formatSpecifier)(b),a):a.locale().format(s)},a.labelOffset=function(b){return arguments.length?(u=+b,a):u},a.labelDelimiter=function(b){return arguments.length?(v=b,a):v},a.labelWrap=function(b){return arguments.length?(w=b,a):w},a.orient=function(b){return arguments.length?(b=b.toLowerCase(),"horizontal"!=b&&"vertical"!=b||(x=b),a):x},a.ascending=function(b){return arguments.length?(y=!!b,a):y},a.classPrefix=function(b){return arguments.length?(p=b,a):p},a.title=function(b){return arguments.length?(q=b,a):q},a.titleWidth=function(b){return arguments.length?(z=b,a):z},a.on=function(){var b=A.on.apply(A,arguments);return b===A?a:b},a}Object.defineProperty(c,"__esModule",{value:!0}),c.default=e;var f=a("./legend"),g=d(f),h=a("d3-dispatch"),i=a("d3-scale"),j=a("d3-format"),k=a("d3-array")},{"./legend":13,"d3-array":1,"d3-dispatch":4,"d3-format":5,"d3-scale":7}],16:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{default:a}}var e=a("./color"),f=d(e),g=a("./size"),h=d(g),i=a("./symbol"),j=d(i),k=a("./helpers"),l=d(k);d3.legendColor=f.default,d3.legendSize=h.default,d3.legendSymbol=j.default,d3.legendHelpers=l.default},{"./color":11,"./helpers":12,"./size":14,"./symbol":15}]},{},[16]); \ No newline at end of file diff --git a/docs/docs.min.js b/docs/docs.min.js index 743ee31..f3fe9bf 100644 --- a/docs/docs.min.js +++ b/docs/docs.min.js @@ -1,2 +1,2 @@ -!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g/g,">").replace(/"/g,""").replace(/'/g,"'")}function h(a){return a.replace(/&([#\w]+);/g,function(a,b){return b=b.toLowerCase(),"colon"===b?":":"#"===b.charAt(0)?"x"===b.charAt(1)?String.fromCharCode(parseInt(b.substring(2),16)):String.fromCharCode(+b.substring(1)):""})}function i(a,b){return a=a.source,b=b||"",function c(d,e){return d?(e=e.source||e,e=e.replace(/(^|[^\[])\^/g,"$1"),a=a.replace(d,e),c):new RegExp(a,b)}}function j(){}function k(a){for(var b,c,d=1;dAn error occured:

"+g(m.message+"",!0)+"
";throw m}}var m={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:j,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:j,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:j,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};m.bullet=/(?:[*+-]|\d+\.)/,m.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,m.item=i(m.item,"gm")(/bull/g,m.bullet)(),m.list=i(m.list)(/bull/g,m.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+m.def.source+")")(),m.blockquote=i(m.blockquote)("def",m.def)(),m._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b",m.html=i(m.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/])*?>/)(/tag/g,m._tag)(),m.paragraph=i(m.paragraph)("hr",m.hr)("heading",m.heading)("lheading",m.lheading)("blockquote",m.blockquote)("tag","<"+m._tag)("def",m.def)(),m.normal=k({},m),m.gfm=k({},m.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),m.gfm.paragraph=i(m.paragraph)("(?!","(?!"+m.gfm.fences.source.replace("\\1","\\2")+"|"+m.list.source.replace("\\1","\\3")+"|")(),m.tables=k({},m.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),a.rules=m,a.lex=function(b,c){var d=new a(c);return d.lex(b)},a.prototype.lex=function(a){return a=a.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(a,!0)},a.prototype.token=function(a,b,c){for(var d,e,f,g,h,i,j,k,l,a=a.replace(/^ +$/gm,"");a;)if((f=this.rules.newline.exec(a))&&(a=a.substring(f[0].length),f[0].length>1&&this.tokens.push({type:"space"})),f=this.rules.code.exec(a))a=a.substring(f[0].length),f=f[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?f:f.replace(/\n+$/,"")});else if(f=this.rules.fences.exec(a))a=a.substring(f[0].length),this.tokens.push({type:"code",lang:f[2],text:f[3]||""});else if(f=this.rules.heading.exec(a))a=a.substring(f[0].length),this.tokens.push({type:"heading",depth:f[1].length,text:f[2]});else if(b&&(f=this.rules.nptable.exec(a))){for(a=a.substring(f[0].length),i={type:"table",header:f[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:f[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:f[3].replace(/\n$/,"").split("\n")},k=0;k ?/gm,""),this.token(f,b,!0),this.tokens.push({type:"blockquote_end"});else if(f=this.rules.list.exec(a)){for(a=a.substring(f[0].length),g=f[2],this.tokens.push({type:"list_start",ordered:g.length>1}),f=f[0].match(this.rules.item),d=!1,l=f.length,k=0;k1&&h.length>1||(a=f.slice(k+1).join("\n")+a,k=l-1)),e=d||/\n\n(?!\s*$)/.test(i),k!==l-1&&(d="\n"===i.charAt(i.length-1),e||(e=d)),this.tokens.push({type:e?"loose_item_start":"list_item_start"}),this.token(i,!1,c),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(f=this.rules.html.exec(a))a=a.substring(f[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===f[1]||"script"===f[1]||"style"===f[1]),text:f[0]});else if(!c&&b&&(f=this.rules.def.exec(a)))a=a.substring(f[0].length),this.tokens.links[f[1].toLowerCase()]={href:f[2],title:f[3]};else if(b&&(f=this.rules.table.exec(a))){for(a=a.substring(f[0].length),i={type:"table",header:f[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:f[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:f[3].replace(/(?: *\| *)?\n$/,"").split("\n")},k=0;k])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:j,tag:/^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:j,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/,n.link=i(n.link)("inside",n._inside)("href",n._href)(),n.reflink=i(n.reflink)("inside",n._inside)(),n.normal=k({},n),n.pedantic=k({},n.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),n.gfm=k({},n.normal,{escape:i(n.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:i(n.text)("]|","~]|")("|","|https?://|")()}),n.breaks=k({},n.gfm,{br:i(n.br)("{2,}","*")(),text:i(n.gfm.text)("{2,}","*")()}),d.rules=n,d.output=function(a,b,c){var e=new d(b,c);return e.output(a)},d.prototype.output=function(a){for(var b,c,d,e,f="";a;)if(e=this.rules.escape.exec(a))a=a.substring(e[0].length),f+=e[1];else if(e=this.rules.autolink.exec(a))a=a.substring(e[0].length),"@"===e[2]?(c=":"===e[1].charAt(6)?this.mangle(e[1].substring(7)):this.mangle(e[1]),d=this.mangle("mailto:")+c):(c=g(e[1]),d=c),f+=this.renderer.link(d,null,c);else if(this.inLink||!(e=this.rules.url.exec(a))){if(e=this.rules.tag.exec(a))!this.inLink&&/^/i.test(e[0])&&(this.inLink=!1),a=a.substring(e[0].length),f+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(e[0]):g(e[0]):e[0];else if(e=this.rules.link.exec(a))a=a.substring(e[0].length),this.inLink=!0,f+=this.outputLink(e,{href:e[2],title:e[3]}),this.inLink=!1;else if((e=this.rules.reflink.exec(a))||(e=this.rules.nolink.exec(a))){if(a=a.substring(e[0].length),b=(e[2]||e[1]).replace(/\s+/g," "),b=this.links[b.toLowerCase()],!b||!b.href){f+=e[0].charAt(0),a=e[0].substring(1)+a; -continue}this.inLink=!0,f+=this.outputLink(e,b),this.inLink=!1}else if(e=this.rules.strong.exec(a))a=a.substring(e[0].length),f+=this.renderer.strong(this.output(e[2]||e[1]));else if(e=this.rules.em.exec(a))a=a.substring(e[0].length),f+=this.renderer.em(this.output(e[2]||e[1]));else if(e=this.rules.code.exec(a))a=a.substring(e[0].length),f+=this.renderer.codespan(g(e[2],!0));else if(e=this.rules.br.exec(a))a=a.substring(e[0].length),f+=this.renderer.br();else if(e=this.rules.del.exec(a))a=a.substring(e[0].length),f+=this.renderer.del(this.output(e[1]));else if(e=this.rules.text.exec(a))a=a.substring(e[0].length),f+=this.renderer.text(g(this.smartypants(e[0])));else if(a)throw new Error("Infinite loop on byte: "+a.charCodeAt(0))}else a=a.substring(e[0].length),c=g(e[1]),d=c,f+=this.renderer.link(d,null,c);return f},d.prototype.outputLink=function(a,b){var c=g(b.href),d=b.title?g(b.title):null;return"!"!==a[0].charAt(0)?this.renderer.link(c,d,this.output(a[1])):this.renderer.image(c,d,g(a[1]))},d.prototype.smartypants=function(a){return this.options.smartypants?a.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014\/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014\/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):a},d.prototype.mangle=function(a){if(!this.options.mangle)return a;for(var b,c="",d=a.length,e=0;e.5&&(b="x"+b.toString(16)),c+="&#"+b+";";return c},e.prototype.code=function(a,b,c){if(this.options.highlight){var d=this.options.highlight(a,b);null!=d&&d!==a&&(c=!0,a=d)}return b?'
'+(c?a:g(a,!0))+"\n
\n":"
"+(c?a:g(a,!0))+"\n
"},e.prototype.blockquote=function(a){return"
\n"+a+"
\n"},e.prototype.html=function(a){return a},e.prototype.heading=function(a,b,c){return"'+a+"\n"},e.prototype.hr=function(){return this.options.xhtml?"
\n":"
\n"},e.prototype.list=function(a,b){var c=b?"ol":"ul";return"<"+c+">\n"+a+"\n"},e.prototype.listitem=function(a){return"
  • "+a+"
  • \n"},e.prototype.paragraph=function(a){return"

    "+a+"

    \n"},e.prototype.table=function(a,b){return"\n\n"+a+"\n\n"+b+"\n
    \n"},e.prototype.tablerow=function(a){return"\n"+a+"\n"},e.prototype.tablecell=function(a,b){var c=b.header?"th":"td",d=b.align?"<"+c+' style="text-align:'+b.align+'">':"<"+c+">";return d+a+"\n"},e.prototype.strong=function(a){return""+a+""},e.prototype.em=function(a){return""+a+""},e.prototype.codespan=function(a){return""+a+""},e.prototype.br=function(){return this.options.xhtml?"
    ":"
    "},e.prototype.del=function(a){return""+a+""},e.prototype.link=function(a,b,c){if(this.options.sanitize){try{var d=decodeURIComponent(h(a)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return""}if(0===d.indexOf("javascript:")||0===d.indexOf("vbscript:"))return""}var f='
    "},e.prototype.image=function(a,b,c){var d=''+c+'":">"},e.prototype.text=function(a){return a},f.parse=function(a,b,c){var d=new f(b,c);return d.parse(a)},f.prototype.parse=function(a){this.inline=new d(a.links,this.options,this.renderer),this.tokens=a.reverse();for(var b="";this.next();)b+=this.tok();return b},f.prototype.next=function(){return this.token=this.tokens.pop()},f.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},f.prototype.parseText=function(){for(var a=this.token.text;"text"===this.peek().type;)a+="\n"+this.next().text;return this.inline.output(a)},f.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var a,b,c,d,e,f="",g="";for(c="",a=0;a/g,">").replace(/"/g,""").replace(/'/g,"'")}function h(a){return a.replace(/&([#\w]+);/g,function(a,b){return b=b.toLowerCase(),"colon"===b?":":"#"===b.charAt(0)?"x"===b.charAt(1)?String.fromCharCode(parseInt(b.substring(2),16)):String.fromCharCode(+b.substring(1)):""})}function i(a,b){return a=a.source,b=b||"",function c(d,e){return d?(e=e.source||e,e=e.replace(/(^|[^\[])\^/g,"$1"),a=a.replace(d,e),c):new RegExp(a,b)}}function j(){}function k(a){for(var b,c,d=1;dAn error occured:

    "+g(n.message+"",!0)+"
    ";throw n}}var m={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:j,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:j,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:j,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};m.bullet=/(?:[*+-]|\d+\.)/,m.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,m.item=i(m.item,"gm")(/bull/g,m.bullet)(),m.list=i(m.list)(/bull/g,m.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+m.def.source+")")(),m.blockquote=i(m.blockquote)("def",m.def)(),m._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b",m.html=i(m.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/])*?>/)(/tag/g,m._tag)(),m.paragraph=i(m.paragraph)("hr",m.hr)("heading",m.heading)("lheading",m.lheading)("blockquote",m.blockquote)("tag","<"+m._tag)("def",m.def)(),m.normal=k({},m),m.gfm=k({},m.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),m.gfm.paragraph=i(m.paragraph)("(?!","(?!"+m.gfm.fences.source.replace("\\1","\\2")+"|"+m.list.source.replace("\\1","\\3")+"|")(),m.tables=k({},m.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),a.rules=m,a.lex=function(b,c){return new a(c).lex(b)},a.prototype.lex=function(a){return a=a.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(a,!0)},a.prototype.token=function(a,b,c){for(var d,e,f,g,h,i,j,k,l,a=a.replace(/^ +$/gm,"");a;)if((f=this.rules.newline.exec(a))&&(a=a.substring(f[0].length),f[0].length>1&&this.tokens.push({type:"space"})),f=this.rules.code.exec(a))a=a.substring(f[0].length),f=f[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?f:f.replace(/\n+$/,"")});else if(f=this.rules.fences.exec(a))a=a.substring(f[0].length),this.tokens.push({type:"code",lang:f[2],text:f[3]||""});else if(f=this.rules.heading.exec(a))a=a.substring(f[0].length),this.tokens.push({type:"heading",depth:f[1].length,text:f[2]});else if(b&&(f=this.rules.nptable.exec(a))){for(a=a.substring(f[0].length),i={type:"table",header:f[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:f[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:f[3].replace(/\n$/,"").split("\n")},k=0;k ?/gm,""),this.token(f,b,!0),this.tokens.push({type:"blockquote_end"});else if(f=this.rules.list.exec(a)){for(a=a.substring(f[0].length),g=f[2],this.tokens.push({type:"list_start",ordered:g.length>1}),f=f[0].match(this.rules.item),d=!1,l=f.length,k=0;k1&&h.length>1||(a=f.slice(k+1).join("\n")+a,k=l-1)),e=d||/\n\n(?!\s*$)/.test(i),k!==l-1&&(d="\n"===i.charAt(i.length-1),e||(e=d)),this.tokens.push({type:e?"loose_item_start":"list_item_start"}),this.token(i,!1,c),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(f=this.rules.html.exec(a))a=a.substring(f[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===f[1]||"script"===f[1]||"style"===f[1]),text:f[0]});else if(!c&&b&&(f=this.rules.def.exec(a)))a=a.substring(f[0].length),this.tokens.links[f[1].toLowerCase()]={href:f[2],title:f[3]};else if(b&&(f=this.rules.table.exec(a))){for(a=a.substring(f[0].length),i={type:"table",header:f[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:f[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:f[3].replace(/(?: *\| *)?\n$/,"").split("\n")},k=0;k])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:j,tag:/^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:j,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/,n.link=i(n.link)("inside",n._inside)("href",n._href)(),n.reflink=i(n.reflink)("inside",n._inside)(),n.normal=k({},n),n.pedantic=k({},n.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),n.gfm=k({},n.normal,{escape:i(n.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:i(n.text)("]|","~]|")("|","|https?://|")()}),n.breaks=k({},n.gfm,{br:i(n.br)("{2,}","*")(),text:i(n.gfm.text)("{2,}","*")()}),d.rules=n,d.output=function(a,b,c){return new d(b,c).output(a)},d.prototype.output=function(a){for(var b,c,d,e,f="";a;)if(e=this.rules.escape.exec(a))a=a.substring(e[0].length),f+=e[1];else if(e=this.rules.autolink.exec(a))a=a.substring(e[0].length),"@"===e[2]?(c=":"===e[1].charAt(6)?this.mangle(e[1].substring(7)):this.mangle(e[1]),d=this.mangle("mailto:")+c):(c=g(e[1]),d=c),f+=this.renderer.link(d,null,c);else if(this.inLink||!(e=this.rules.url.exec(a))){if(e=this.rules.tag.exec(a))!this.inLink&&/^
    /i.test(e[0])&&(this.inLink=!1),a=a.substring(e[0].length),f+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(e[0]):g(e[0]):e[0];else if(e=this.rules.link.exec(a))a=a.substring(e[0].length),this.inLink=!0,f+=this.outputLink(e,{href:e[2],title:e[3]}),this.inLink=!1;else if((e=this.rules.reflink.exec(a))||(e=this.rules.nolink.exec(a))){if(a=a.substring(e[0].length),b=(e[2]||e[1]).replace(/\s+/g," "),!(b=this.links[b.toLowerCase()])||!b.href){f+=e[0].charAt(0),a=e[0].substring(1)+a;continue} +this.inLink=!0,f+=this.outputLink(e,b),this.inLink=!1}else if(e=this.rules.strong.exec(a))a=a.substring(e[0].length),f+=this.renderer.strong(this.output(e[2]||e[1]));else if(e=this.rules.em.exec(a))a=a.substring(e[0].length),f+=this.renderer.em(this.output(e[2]||e[1]));else if(e=this.rules.code.exec(a))a=a.substring(e[0].length),f+=this.renderer.codespan(g(e[2],!0));else if(e=this.rules.br.exec(a))a=a.substring(e[0].length),f+=this.renderer.br();else if(e=this.rules.del.exec(a))a=a.substring(e[0].length),f+=this.renderer.del(this.output(e[1]));else if(e=this.rules.text.exec(a))a=a.substring(e[0].length),f+=this.renderer.text(g(this.smartypants(e[0])));else if(a)throw new Error("Infinite loop on byte: "+a.charCodeAt(0))}else a=a.substring(e[0].length),c=g(e[1]),d=c,f+=this.renderer.link(d,null,c);return f},d.prototype.outputLink=function(a,b){var c=g(b.href),d=b.title?g(b.title):null;return"!"!==a[0].charAt(0)?this.renderer.link(c,d,this.output(a[1])):this.renderer.image(c,d,g(a[1]))},d.prototype.smartypants=function(a){return this.options.smartypants?a.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014\/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014\/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):a},d.prototype.mangle=function(a){if(!this.options.mangle)return a;for(var b,c="",d=a.length,e=0;e.5&&(b="x"+b.toString(16)),c+="&#"+b+";";return c},e.prototype.code=function(a,b,c){if(this.options.highlight){var d=this.options.highlight(a,b);null!=d&&d!==a&&(c=!0,a=d)}return b?'
    '+(c?a:g(a,!0))+"\n
    \n":"
    "+(c?a:g(a,!0))+"\n
    "},e.prototype.blockquote=function(a){return"
    \n"+a+"
    \n"},e.prototype.html=function(a){return a},e.prototype.heading=function(a,b,c){return"'+a+"\n"},e.prototype.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},e.prototype.list=function(a,b){var c=b?"ol":"ul";return"<"+c+">\n"+a+"\n"},e.prototype.listitem=function(a){return"
  • "+a+"
  • \n"},e.prototype.paragraph=function(a){return"

    "+a+"

    \n"},e.prototype.table=function(a,b){return"\n\n"+a+"\n\n"+b+"\n
    \n"},e.prototype.tablerow=function(a){return"\n"+a+"\n"},e.prototype.tablecell=function(a,b){var c=b.header?"th":"td";return(b.align?"<"+c+' style="text-align:'+b.align+'">':"<"+c+">")+a+"\n"},e.prototype.strong=function(a){return""+a+""},e.prototype.em=function(a){return""+a+""},e.prototype.codespan=function(a){return""+a+""},e.prototype.br=function(){return this.options.xhtml?"
    ":"
    "},e.prototype.del=function(a){return""+a+""},e.prototype.link=function(a,b,c){if(this.options.sanitize){try{var d=decodeURIComponent(h(a)).replace(/[^\w:]/g,"").toLowerCase()}catch(f){return""}if(0===d.indexOf("javascript:")||0===d.indexOf("vbscript:"))return""}var e='
    "},e.prototype.image=function(a,b,c){var d=''+c+'":">"},e.prototype.text=function(a){return a},f.parse=function(a,b,c){return new f(b,c).parse(a)},f.prototype.parse=function(a){this.inline=new d(a.links,this.options,this.renderer),this.tokens=a.reverse();for(var b="";this.next();)b+=this.tok();return b},f.prototype.next=function(){return this.token=this.tokens.pop()},f.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},f.prototype.parseText=function(){for(var a=this.token.text;"text"===this.peek().type;)a+="\n"+this.next().text;return this.inline.output(a)},f.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var a,b,c,d,e="",f="";for(c="",a=0;a d\n\nconst d3_reverse = (arr) => {\n const mirror = [];\n for (let i = 0, l = arr.length; i < l; i++) {\n mirror[i] = arr[l-i-1];\n }\n return mirror;\n}\n\n//Text wrapping code adapted from Mike Bostock\nconst d3_textWrapping = (text, width) => {\n text.each(function() {\n var text = select(this),\n words = text.text().split(/\\s+/).reverse(),\n word,\n line = [],\n lineNumber = 0,\n lineHeight = 1.2, //ems\n y = text.attr(\"y\"),\n dy = parseFloat(text.attr(\"dy\")) || 0,\n tspan = text.text(null)\n .append(\"tspan\")\n .attr(\"x\", 0)\n .attr(\"dy\", dy + \"em\");\n\n while (word = words.pop()) {\n line.push(word);\n tspan.text(line.join(\" \"));\n if (tspan.node().getComputedTextLength() > width && line.length > 1) {\n line.pop();\n tspan.text(line.join(\" \"));\n line = [word];\n tspan = text.append(\"tspan\")\n .attr(\"x\", 0)\n .attr(\"dy\", lineHeight + dy + \"em\").text(word);\n }\n }\n });\n}\n\n\nconst d3_mergeLabels = (gen=[], labels, domain, range) => {\n\n if (typeof labels === \"object\"){\n if(labels.length === 0) return gen;\n\n let i = labels.length;\n for (; i < gen.length; i++) {\n labels.push(gen[i]);\n }\n return labels;\n } else if (typeof labels === \"function\") {\n const customLabels = []\n const genLength = gen.length\n for (let i=0; i < genLength; i++){\n customLabels.push(labels({\n i,\n genLength,\n generatedLabels : gen,\n domain,\n range }))\n }\n return customLabels\n }\n\n return gen;\n }\n\nconst d3_linearLegend = (scale, cells, labelFormat) => {\n let data = [];\n\n if (cells.length > 1){\n data = cells;\n\n } else {\n const domain = scale.domain(),\n increment = (domain[domain.length - 1] - domain[0])/(cells - 1)\n let i = 0;\n\n for (; i < cells; i++){\n data.push(domain[0] + i*increment);\n }\n }\n\n const labels = data.map(labelFormat);\n return {data: data,\n labels: labels,\n feature: d => scale(d)};\n}\n\nconst d3_quantLegend = (scale, labelFormat, labelDelimiter) => {\n const labels = scale.range().map( d => {\n const invert = scale.invertExtent(d);\n return labelFormat(invert[0]) + \" \" + labelDelimiter + \" \" + labelFormat(invert[1]);\n });\n\n return {data: scale.range(),\n labels: labels,\n feature: d3_identity\n };\n}\n\nconst d3_ordinalLegend= scale => ({data: scale.domain(),\n labels: scale.domain(),\n feature: d => scale(d) }\n)\n\nconst d3_cellOver = (cellDispatcher, d, obj) => {\n cellDispatcher.call(\"cellover\", obj, d);\n}\n\nconst d3_cellOut = (cellDispatcher, d, obj) => {\n cellDispatcher.call(\"cellout\", obj, d);\n}\n\nconst d3_cellClick = (cellDispatcher, d, obj) => {\n cellDispatcher.call(\"cellclick\", obj, d);\n}\n\n\nexport default {\n\n d3_drawShapes: (shape, shapes, shapeHeight, shapeWidth, shapeRadius, path) => {\n if (shape === \"rect\"){\n shapes.attr(\"height\", shapeHeight)\n .attr(\"width\", shapeWidth);\n\n } else if (shape === \"circle\") {\n shapes.attr(\"r\", shapeRadius)\n\n } else if (shape === \"line\") {\n shapes.attr(\"x1\", 0).attr(\"x2\", shapeWidth).attr(\"y1\", 0).attr(\"y2\", 0);\n\n } else if (shape === \"path\") {\n shapes.attr(\"d\", path);\n }\n },\n\n d3_addText: function (svg, enter, labels, classPrefix, labelWidth){\n enter.append(\"text\").attr(\"class\", classPrefix + \"label\");\n const text = svg.selectAll(`g.${classPrefix}cell text.${classPrefix}label`)\n .data(labels)\n .text(d3_identity);\n\n if (labelWidth){\n svg.selectAll(`g.${classPrefix}cell text.${classPrefix}label`)\n .call(d3_textWrapping, labelWidth)\n }\n\n return text\n },\n\n d3_calcType: function (scale, ascending, cells, labels, labelFormat, labelDelimiter){\n const type = scale.invertExtent ?\n d3_quantLegend(scale, labelFormat, labelDelimiter) : scale.ticks ?\n d3_linearLegend(scale, cells, labelFormat) : d3_ordinalLegend(scale);\n\n //for d3.scaleSequential that doesn't have a range function\n const range = scale.range && scale.range() || scale.domain()\n type.labels = d3_mergeLabels(type.labels, labels, scale.domain(), range);\n\n if (ascending) {\n type.labels = d3_reverse(type.labels);\n type.data = d3_reverse(type.data);\n }\n\n return type;\n },\n\n d3_filterCells: (type, cellFilter) => {\n let filterCells = type.data.map((d, i) => ({ data: d, label: type.labels[i] }))\n .filter(cellFilter)\n const dataValues = filterCells.map(d => d.data)\n const labelValues = filterCells.map(d => d.label)\n type.data = type.data.filter(d => dataValues.indexOf(d) !== -1)\n type.labels = type.labels.filter(d => labelValues.indexOf(d) !== -1)\n return type\n },\n\n d3_placement: (orient, cell, cellTrans, text, textTrans, labelAlign) => {\n cell.attr(\"transform\", cellTrans);\n text.attr(\"transform\", textTrans);\n if (orient === \"horizontal\"){\n text.style(\"text-anchor\", labelAlign);\n }\n },\n\n d3_addEvents: function(cells, dispatcher){\n cells.on(\"mouseover.legend\", function (d) { d3_cellOver(dispatcher, d, this); })\n .on(\"mouseout.legend\", function (d) { d3_cellOut(dispatcher, d, this); })\n .on(\"click.legend\", function (d) { d3_cellClick(dispatcher, d, this); });\n },\n\n d3_title: (svg, title, classPrefix, titleWidth) => {\n if (title !== \"\"){\n\n const titleText = svg.selectAll('text.' + classPrefix + 'legendTitle');\n\n titleText.data([title])\n .enter()\n .append('text')\n .attr('class', classPrefix + 'legendTitle');\n\n svg.selectAll('text.' + classPrefix + 'legendTitle')\n .text(title)\n\n if (titleWidth){\n svg.selectAll('text.' + classPrefix + 'legendTitle')\n .call(d3_textWrapping, titleWidth)\n }\n\n const cellsSvg = svg.select('.' + classPrefix + 'legendCells')\n const yOffset = svg.select('.' + classPrefix + 'legendTitle').nodes()\n .map(d => d.getBBox().height)[0],\n\n xOffset = -cellsSvg.nodes().map(function(d) { return d.getBBox().x})[0];\n cellsSvg.attr('transform', 'translate(' + xOffset + ',' + (yOffset) + ')');\n\n }\n },\n\n d3_defaultLocale: {\n format,\n formatPrefix\n },\n\n d3_defaultFormatSpecifier: '.01f',\n\n d3_defaultDelimiter: 'to'\n}\n","import helper from './legend';\nimport { dispatch } from 'd3-dispatch';\nimport { scaleLinear } from 'd3-scale';\nimport { formatLocale, formatSpecifier } from 'd3-format';\n\nimport { sum } from 'd3-array';\n\nexport default function color(){\n\n let scale = scaleLinear(),\n shape = \"rect\",\n shapeWidth = 15,\n shapeHeight = 15,\n shapeRadius = 10,\n shapePadding = 2,\n cells = [5],\n cellFilter,\n labels = [],\n classPrefix = \"\",\n useClass = false,\n title = \"\",\n locale = helper.d3_defaultLocale,\n specifier = helper.d3_defaultFormatSpecifier,\n labelOffset = 10,\n labelAlign = \"middle\",\n labelDelimiter = helper.d3_defaultDelimiter,\n labelWrap,\n orient = \"vertical\",\n ascending = false,\n path,\n titleWidth,\n legendDispatcher = dispatch(\"cellover\", \"cellout\", \"cellclick\");\n\n function legend(svg) {\n\n const type = helper.d3_calcType(scale, ascending, cells, labels, locale.format(specifier), labelDelimiter),\n legendG = svg.selectAll('g').data([scale]);\n\n legendG.enter().append('g').attr('class', classPrefix + 'legendCells');\n\n if (cellFilter){\n helper.d3_filterCells(type, cellFilter)\n }\n\n let cell = svg.select('.' + classPrefix + 'legendCells')\n .selectAll(\".\" + classPrefix + \"cell\").data(type.data)\n\n const cellEnter = cell.enter().append(\"g\")\n .attr(\"class\", classPrefix + \"cell\")\n cellEnter.append(shape).attr(\"class\", classPrefix + \"swatch\")\n\n let shapes = svg.selectAll(\"g.\" + classPrefix + \"cell \" + shape).data(type.data);\n\n //add event handlers\n helper.d3_addEvents(cellEnter, legendDispatcher);\n\n cell.exit().transition().style(\"opacity\", 0).remove();\n shapes.exit().transition().style(\"opacity\", 0).remove();\n\n shapes = shapes.merge(shapes);\n\n helper.d3_drawShapes(shape, shapes, shapeHeight, shapeWidth, shapeRadius, path);\n helper.d3_addText( svg, cellEnter, type.labels, classPrefix, labelWrap)\n\n // we need to merge the selection, otherwise changes in the legend (e.g. change of orientation) are applied only to the new cells and not the existing ones.\n cell = cellEnter.merge(cell);\n\n // sets placement\n const text = cell.selectAll(\"text\"),\n textSize = text.nodes().map(d => d.getBBox()),\n shapeSize = shapes.nodes().map( d => d.getBBox());\n //sets scale\n //everything is fill except for line which is stroke,\n if (!useClass){\n if (shape == \"line\"){\n shapes.style(\"stroke\", type.feature);\n } else {\n shapes.style(\"fill\", type.feature);\n }\n } else {\n shapes.attr(\"class\", d => `${classPrefix}swatch ${type.feature(d)}`);\n }\n\n let cellTrans,\n textTrans,\n textAlign = (labelAlign == \"start\") ? 0 : (labelAlign == \"middle\") ? 0.5 : 1;\n\n //positions cells and text\n if (orient === \"vertical\"){\n const cellSize = textSize.map((d, i) => Math.max(d.height, shapeSize[i].height))\n\n cellTrans = (d, i) => {\n const height = sum(cellSize.slice(0, i));\n return `translate(0, ${height + i*shapePadding})`}\n\n textTrans = (d,i) => `translate( ${(shapeSize[i].width + shapeSize[i].x +\n labelOffset)}, ${(shapeSize[i].y + shapeSize[i].height/2 + 5)})`;\n\n } else if (orient === \"horizontal\"){\n cellTrans = (d,i) => `translate(${(i * (shapeSize[i].width + shapePadding))},0)`\n textTrans = (d,i) => `translate(${(shapeSize[i].width*textAlign + shapeSize[i].x)},\n ${(shapeSize[i].height + shapeSize[i].y + labelOffset + 8)})`;\n }\n\n helper.d3_placement(orient, cell, cellTrans, text, textTrans, labelAlign);\n helper.d3_title(svg, title, classPrefix, titleWidth);\n\n cell.transition().style(\"opacity\", 1);\n\n }\n\n legend.scale = function(_) {\n if (!arguments.length) return scale;\n scale = _;\n return legend;\n };\n\n legend.cells = function(_) {\n if (!arguments.length) return cells;\n if (_.length > 1 || _ >= 2 ){\n cells = _;\n }\n return legend;\n };\n\n legend.cellFilter = function(_) {\n if (!arguments.length) return cellFilter;\n cellFilter = _;\n return legend;\n };\n\n legend.shape = function(_, d) {\n if (!arguments.length) return shape;\n if (_ == \"rect\" || _ == \"circle\" || _ == \"line\" || (_ == \"path\" && (typeof d === 'string')) ){\n shape = _;\n path = d;\n }\n return legend;\n };\n\n legend.shapeWidth = function(_) {\n if (!arguments.length) return shapeWidth;\n shapeWidth = +_;\n return legend;\n };\n\n legend.shapeHeight = function(_) {\n if (!arguments.length) return shapeHeight;\n shapeHeight = +_;\n return legend;\n };\n\n legend.shapeRadius = function(_) {\n if (!arguments.length) return shapeRadius;\n shapeRadius = +_;\n return legend;\n };\n\n legend.shapePadding = function(_) {\n if (!arguments.length) return shapePadding;\n shapePadding = +_;\n return legend;\n };\n\n legend.labels = function(_) {\n if (!arguments.length) return labels;\n labels = _;\n return legend;\n };\n\n legend.labelAlign = function(_) {\n if (!arguments.length) return labelAlign;\n if (_ == \"start\" || _ == \"end\" || _ == \"middle\") {\n labelAlign = _;\n }\n return legend;\n };\n\n legend.locale = function(_) {\n if (!arguments.length) return locale;\n locale = formatLocale(_)\n return legend\n };\n\n legend.labelFormat = function(_) {\n if (!arguments.length) return legend.locale().format(specifier);\n specifier = formatSpecifier(_)\n return legend;\n };\n\n legend.labelOffset = function(_) {\n if (!arguments.length) return labelOffset;\n labelOffset = +_;\n return legend;\n };\n\n legend.labelDelimiter = function(_) {\n if (!arguments.length) return labelDelimiter;\n labelDelimiter = _;\n return legend;\n };\n\n legend.labelWrap = function(_) {\n if (!arguments.length) return labelWrap;\n labelWrap = _;\n return legend;\n };\n\n legend.useClass = function(_) {\n if (!arguments.length) return useClass;\n if (_ === true || _ === false){\n useClass = _;\n }\n return legend;\n };\n\n legend.orient = function(_){\n if (!arguments.length) return orient;\n _ = _.toLowerCase();\n if (_ == \"horizontal\" || _ == \"vertical\") {\n orient = _;\n }\n return legend;\n };\n\n legend.ascending = function(_) {\n if (!arguments.length) return ascending;\n ascending = !!_;\n return legend;\n };\n\n legend.classPrefix = function(_) {\n if (!arguments.length) return classPrefix;\n classPrefix = _;\n return legend;\n };\n\n legend.title = function(_) {\n if (!arguments.length) return title;\n title = _;\n return legend;\n };\n\n legend.titleWidth = function(_) {\n if (!arguments.length) return titleWidth;\n titleWidth = _;\n return legend;\n };\n\n legend.textWrap = function(_) {\n if (!arguments.length) return textWrap;\n textWrap = _;\n return legend;\n }\n\n legend.on = function(){\n const value = legendDispatcher.on.apply(legendDispatcher, arguments)\n return value === legendDispatcher ? legend : value;\n }\n\n return legend;\n\n};\n","import helper from \"./legend\"\nimport { dispatch } from \"d3-dispatch\"\nimport { scaleLinear } from \"d3-scale\"\nimport { formatLocale, formatSpecifier } from \"d3-format\"\nimport { sum, max } from \"d3-array\"\n\nexport default function size() {\n let scale = scaleLinear(),\n shape = \"rect\",\n shapeWidth = 15,\n shapePadding = 2,\n cells = [5],\n cellFilter,\n labels = [],\n classPrefix = \"\",\n title = \"\",\n locale = helper.d3_defaultLocale,\n specifier = helper.d3_defaultFormatSpecifier,\n labelOffset = 10,\n labelAlign = \"middle\",\n labelDelimiter = helper.d3_defaultDelimiter,\n labelWrap,\n orient = \"vertical\",\n ascending = false,\n path,\n titleWidth,\n legendDispatcher = dispatch(\"cellover\", \"cellout\", \"cellclick\")\n\n function legend(svg) {\n const type = helper.d3_calcType(\n scale,\n ascending,\n cells,\n labels,\n locale.format(specifier),\n labelDelimiter\n ),\n legendG = svg.selectAll(\"g\").data([scale])\n\n if (cellFilter) {\n helper.d3_filterCells(type, cellFilter)\n }\n\n legendG\n .enter()\n .append(\"g\")\n .attr(\"class\", classPrefix + \"legendCells\")\n\n let cell = svg\n .select(\".\" + classPrefix + \"legendCells\")\n .selectAll(\".\" + classPrefix + \"cell\")\n .data(type.data)\n const cellEnter = cell\n .enter()\n .append(\"g\")\n .attr(\"class\", classPrefix + \"cell\")\n cellEnter.append(shape).attr(\"class\", classPrefix + \"swatch\")\n\n let shapes = svg.selectAll(\"g.\" + classPrefix + \"cell \" + shape)\n\n //add event handlers\n helper.d3_addEvents(cellEnter, legendDispatcher)\n\n cell\n .exit()\n .transition()\n .style(\"opacity\", 0)\n .remove()\n\n shapes\n .exit()\n .transition()\n .style(\"opacity\", 0)\n .remove()\n shapes = shapes.merge(shapes)\n\n //creates shape\n if (shape === \"line\") {\n helper.d3_drawShapes(shape, shapes, 0, shapeWidth)\n shapes.attr(\"stroke-width\", type.feature)\n } else {\n helper.d3_drawShapes(\n shape,\n shapes,\n type.feature,\n type.feature,\n type.feature,\n path\n )\n }\n\n const text = helper.d3_addText(\n svg,\n cellEnter,\n type.labels,\n classPrefix,\n labelWrap\n )\n\n // we need to merge the selection, otherwise changes in the legend (e.g. change of orientation) are applied only to the new cells and not the existing ones.\n cell = cellEnter.merge(cell)\n\n //sets placement\n\n const textSize = text.nodes().map(d => d.getBBox()),\n shapeSize = shapes.nodes().map((d, i) => {\n const bbox = d.getBBox()\n const stroke = scale(type.data[i])\n\n if (shape === \"line\" && orient === \"horizontal\") {\n bbox.height = bbox.height + stroke\n } else if (shape === \"line\" && orient === \"vertical\") {\n bbox.width = bbox.width\n }\n return bbox\n })\n //console.log('SHAPESIZE')\n const maxH = max(shapeSize, d => d.height + d.y),\n maxW = max(shapeSize, d => d.width + d.x)\n\n let cellTrans,\n textTrans,\n textAlign = labelAlign == \"start\" ? 0 : labelAlign == \"middle\" ? 0.5 : 1\n\n //positions cells and text\n if (orient === \"vertical\") {\n const cellSize = textSize.map((d, i) =>\n Math.max(d.height, shapeSize[i].height)\n )\n const y =\n shape == \"circle\" || shape == \"line\" ? shapeSize[0].height / 2 : 0\n cellTrans = (d, i) => {\n const height = sum(cellSize.slice(0, i))\n\n return `translate(0, ${y + height + i * shapePadding})`\n }\n\n textTrans = (d, i) => `translate( ${maxW + labelOffset},\n ${shapeSize[i].y + shapeSize[i].height / 2 + 5})`\n } else if (orient === \"horizontal\") {\n cellTrans = (d, i) => {\n const width = sum(shapeSize.slice(0, i), d => d.width)\n const y = shape == \"circle\" || shape == \"line\" ? maxH / 2 : 0\n return `translate(${width + i * shapePadding}, ${y})`\n }\n\n const offset = shape == \"line\" ? maxH / 2 : maxH\n textTrans = (d, i) => {\n return `translate( ${shapeSize[i].width * textAlign + shapeSize[i].x},\n ${offset + labelOffset})`\n }\n }\n\n helper.d3_placement(orient, cell, cellTrans, text, textTrans, labelAlign)\n helper.d3_title(svg, title, classPrefix, titleWidth)\n\n cell.transition().style(\"opacity\", 1)\n }\n\n legend.scale = function(_) {\n if (!arguments.length) return scale\n scale = _\n return legend\n }\n\n legend.cells = function(_) {\n if (!arguments.length) return cells\n if (_.length > 1 || _ >= 2) {\n cells = _\n }\n return legend\n }\n\n legend.cellFilter = function(_) {\n if (!arguments.length) return cellFilter\n cellFilter = _\n return legend\n }\n\n legend.shape = function(_, d) {\n if (!arguments.length) return shape\n if (_ == \"rect\" || _ == \"circle\" || _ == \"line\") {\n shape = _\n path = d\n }\n return legend\n }\n\n legend.shapeWidth = function(_) {\n if (!arguments.length) return shapeWidth\n shapeWidth = +_\n return legend\n }\n\n legend.shapePadding = function(_) {\n if (!arguments.length) return shapePadding\n shapePadding = +_\n return legend\n }\n\n legend.labels = function(_) {\n if (!arguments.length) return labels\n labels = _\n return legend\n }\n\n legend.labelAlign = function(_) {\n if (!arguments.length) return labelAlign\n if (_ == \"start\" || _ == \"end\" || _ == \"middle\") {\n labelAlign = _\n }\n return legend\n }\n\n legend.locale = function(_) {\n if (!arguments.length) return locale\n locale = formatLocale(_)\n return legend\n }\n\n legend.labelFormat = function(_) {\n if (!arguments.length) return legend.locale().format(specifier)\n specifier = formatSpecifier(_)\n return legend\n }\n\n legend.labelOffset = function(_) {\n if (!arguments.length) return labelOffset\n labelOffset = +_\n return legend\n }\n\n legend.labelDelimiter = function(_) {\n if (!arguments.length) return labelDelimiter\n labelDelimiter = _\n return legend\n }\n\n legend.labelWrap = function(_) {\n if (!arguments.length) return labelWrap\n labelWrap = _\n return legend\n }\n\n legend.orient = function(_) {\n if (!arguments.length) return orient\n _ = _.toLowerCase()\n if (_ == \"horizontal\" || _ == \"vertical\") {\n orient = _\n }\n return legend\n }\n\n legend.ascending = function(_) {\n if (!arguments.length) return ascending\n ascending = !!_\n return legend\n }\n\n legend.classPrefix = function(_) {\n if (!arguments.length) return classPrefix\n classPrefix = _\n return legend\n }\n\n legend.title = function(_) {\n if (!arguments.length) return title\n title = _\n return legend\n }\n\n legend.titleWidth = function(_) {\n if (!arguments.length) return titleWidth\n titleWidth = _\n return legend\n }\n\n legend.on = function() {\n const value = legendDispatcher.on.apply(legendDispatcher, arguments)\n return value === legendDispatcher ? legend : value\n }\n\n return legend\n}\n","import helper from \"./legend\"\nimport { dispatch } from \"d3-dispatch\"\nimport { scaleLinear } from \"d3-scale\"\nimport { formatLocale, formatSpecifier } from \"d3-format\"\nimport { sum, max } from \"d3-array\"\n\nexport default function symbol() {\n let scale = scaleLinear(),\n shape = \"path\",\n shapeWidth = 15,\n shapeHeight = 15,\n shapeRadius = 10,\n shapePadding = 5,\n cells = [5],\n cellFilter,\n labels = [],\n classPrefix = \"\",\n title = \"\",\n locale = helper.d3_defaultLocale,\n specifier = helper.d3_defaultFormatSpecifier,\n labelAlign = \"middle\",\n labelOffset = 10,\n labelDelimiter = helper.d3_defaultDelimiter,\n labelWrap,\n orient = \"vertical\",\n ascending = false,\n titleWidth,\n legendDispatcher = dispatch(\"cellover\", \"cellout\", \"cellclick\")\n\n function legend(svg) {\n const type = helper.d3_calcType(\n scale,\n ascending,\n cells,\n labels,\n locale.format(specifier),\n labelDelimiter\n ),\n legendG = svg.selectAll(\"g\").data([scale])\n\n if (cellFilter) {\n helper.d3_filterCells(type, cellFilter)\n }\n\n legendG\n .enter()\n .append(\"g\")\n .attr(\"class\", classPrefix + \"legendCells\")\n\n let cell = svg\n .select(\".\" + classPrefix + \"legendCells\")\n .selectAll(\".\" + classPrefix + \"cell\")\n .data(type.data)\n const cellEnter = cell\n .enter()\n .append(\"g\")\n .attr(\"class\", classPrefix + \"cell\")\n cellEnter.append(shape).attr(\"class\", classPrefix + \"swatch\")\n\n let shapes = svg.selectAll(\"g.\" + classPrefix + \"cell \" + shape)\n\n //add event handlers\n helper.d3_addEvents(cellEnter, legendDispatcher)\n\n //remove old shapes\n cell\n .exit()\n .transition()\n .style(\"opacity\", 0)\n .remove()\n shapes\n .exit()\n .transition()\n .style(\"opacity\", 0)\n .remove()\n shapes = shapes.merge(shapes)\n\n helper.d3_drawShapes(\n shape,\n shapes,\n shapeHeight,\n shapeWidth,\n shapeRadius,\n type.feature\n )\n helper.d3_addText(svg, cellEnter, type.labels, classPrefix, labelWrap)\n\n // we need to merge the selection, otherwise changes in the legend (e.g. change of orientation) are applied only to the new cells and not the existing ones.\n cell = cellEnter.merge(cell)\n\n // sets placement\n const text = cell.selectAll(\"text\"),\n textSize = text.nodes().map(d => d.getBBox()),\n shapeSize = shapes.nodes().map(d => d.getBBox())\n\n const maxH = max(shapeSize, d => d.height),\n maxW = max(shapeSize, d => d.width)\n\n let cellTrans,\n textTrans,\n textAlign = labelAlign == \"start\" ? 0 : labelAlign == \"middle\" ? 0.5 : 1\n\n //positions cells and text\n if (orient === \"vertical\") {\n const cellSize = textSize.map((d, i) => Math.max(maxH, d.height))\n\n cellTrans = (d, i) => {\n const height = sum(cellSize.slice(0, i))\n return `translate(0, ${height + i * shapePadding} )`\n }\n textTrans = (d, i) => `translate( ${maxW + labelOffset},\n ${shapeSize[i].y + shapeSize[i].height / 2 + 5})`\n } else if (orient === \"horizontal\") {\n cellTrans = (d, i) => `translate( ${i * (maxW + shapePadding)},0)`\n textTrans = (d, i) => `translate( ${shapeSize[i].width * textAlign +\n shapeSize[i].x},\n ${maxH + labelOffset})`\n }\n\n helper.d3_placement(orient, cell, cellTrans, text, textTrans, labelAlign)\n helper.d3_title(svg, title, classPrefix, titleWidth)\n cell.transition().style(\"opacity\", 1)\n }\n\n legend.scale = function(_) {\n if (!arguments.length) return scale\n scale = _\n return legend\n }\n\n legend.cells = function(_) {\n if (!arguments.length) return cells\n if (_.length > 1 || _ >= 2) {\n cells = _\n }\n return legend\n }\n\n legend.cellFilter = function(_) {\n if (!arguments.length) return cellFilter\n cellFilter = _\n return legend\n }\n\n legend.shapePadding = function(_) {\n if (!arguments.length) return shapePadding\n shapePadding = +_\n return legend\n }\n\n legend.labels = function(_) {\n if (!arguments.length) return labels\n labels = _\n return legend\n }\n\n legend.labelAlign = function(_) {\n if (!arguments.length) return labelAlign\n if (_ == \"start\" || _ == \"end\" || _ == \"middle\") {\n labelAlign = _\n }\n return legend\n }\n\n legend.locale = function(_) {\n if (!arguments.length) return locale\n locale = formatLocale(_)\n return legend\n }\n\n legend.labelFormat = function(_) {\n if (!arguments.length) return legend.locale().format(specifier)\n specifier = formatSpecifier(_)\n return legend\n }\n\n legend.labelOffset = function(_) {\n if (!arguments.length) return labelOffset\n labelOffset = +_\n return legend\n }\n\n legend.labelDelimiter = function(_) {\n if (!arguments.length) return labelDelimiter\n labelDelimiter = _\n return legend\n }\n\n legend.labelWrap = function(_) {\n if (!arguments.length) return labelWrap\n labelWrap = _\n return legend\n }\n\n legend.orient = function(_) {\n if (!arguments.length) return orient\n _ = _.toLowerCase()\n if (_ == \"horizontal\" || _ == \"vertical\") {\n orient = _\n }\n return legend\n }\n\n legend.ascending = function(_) {\n if (!arguments.length) return ascending\n ascending = !!_\n return legend\n }\n\n legend.classPrefix = function(_) {\n if (!arguments.length) return classPrefix\n classPrefix = _\n return legend\n }\n\n legend.title = function(_) {\n if (!arguments.length) return title\n title = _\n return legend\n }\n\n legend.titleWidth = function(_) {\n if (!arguments.length) return titleWidth\n titleWidth = _\n return legend\n }\n\n legend.on = function() {\n const value = legendDispatcher.on.apply(legendDispatcher, arguments)\n return value === legendDispatcher ? legend : value\n }\n\n return legend\n}\n","export const thresholdLabels = function({ i, genLength, generatedLabels }){\n\n if (i === 0 ){\n return generatedLabels[i].replace('NaN to', 'Less than')\n } else if (i === genLength - 1) {\n return `More than ${generatedLabels[genLength - 1].replace(' to NaN', '')}`\n }\n return generatedLabels[i]\n}\n\nexport default {\n thresholdLabels\n}\n","import legendColor from './src/color'\nimport legendSize from './src/size'\nimport legendSymbol from './src/symbol'\nimport legendHelpers from './src/helpers'\n\nexport { legendColor, legendSize, legendSymbol, legendHelpers }\n\nexport default {\n legendColor,\n legendSize,\n legendSymbol,\n legendHelpers\n};\n"],"names":["d3_identity","d","d3_reverse","arr","mirror","i","l","length","d3_textWrapping","text","width","each","select","words","split","reverse","word","line","lineNumber","lineHeight","attr","dy","parseFloat","tspan","append","pop","push","join","node","getComputedTextLength","d3_mergeLabels","gen","labels","domain","range","customLabels","genLength","d3_linearLegend","scale","cells","labelFormat","data","increment","map","d3_quantLegend","labelDelimiter","invert","invertExtent","d3_ordinalLegend","d3_cellOver","cellDispatcher","obj","call","d3_cellOut","d3_cellClick","shape","shapes","shapeHeight","shapeWidth","shapeRadius","path","svg","enter","classPrefix","labelWidth","selectAll","ascending","type","ticks","cellFilter","filterCells","label","filter","dataValues","labelValues","indexOf","orient","cell","cellTrans","textTrans","labelAlign","style","dispatcher","on","title","titleWidth","titleText","cellsSvg","yOffset","nodes","getBBox","height","xOffset","x","color","scaleLinear","shapePadding","useClass","locale","helper","d3_defaultLocale","specifier","d3_defaultFormatSpecifier","labelOffset","d3_defaultDelimiter","labelWrap","legendDispatcher","dispatch","legend","d3_calcType","format","legendG","d3_filterCells","cellEnter","d3_addEvents","exit","transition","remove","merge","d3_drawShapes","d3_addText","textSize","shapeSize","feature","textAlign","cellSize","Math","max","sum","slice","y","d3_placement","d3_title","_","arguments","formatLocale","formatSpecifier","toLowerCase","textWrap","value","apply","size","bbox","stroke","maxH","maxW","offset","symbol","thresholdLabels","generatedLabels","replace"],"mappings":";;;;;;;;;;;;AAGA,IAAMA,cAAe,SAAfA,WAAe,CAACC,CAAD;SAAOA,CAAP;CAArB;;AAEA,IAAMC,aAAa,SAAbA,UAAa,CAACC,GAAD,EAAS;MACpBC,SAAS,EAAf;OACK,IAAIC,IAAI,CAAR,EAAWC,IAAIH,IAAII,MAAxB,EAAgCF,IAAIC,CAApC,EAAuCD,GAAvC,EAA4C;WACnCA,CAAP,IAAYF,IAAIG,IAAED,CAAF,GAAI,CAAR,CAAZ;;SAEKD,MAAP;CALF;;;AASA,IAAMI,kBAAkB,SAAlBA,eAAkB,CAACC,IAAD,EAAOC,KAAP,EAAiB;OAClCC,IAAL,CAAU,YAAW;QACfF,OAAOG,mBAAO,IAAP,CAAX;QACIC,QAAQJ,KAAKA,IAAL,GAAYK,KAAZ,CAAkB,KAAlB,EAAyBC,OAAzB,EADZ;QAEIC,IAFJ;QAGIC,OAAO,EAHX;QAIIC,aAAa,CAJjB;QAKIC,aAAa,GALjB;;QAMQV,KAAKW,IAAL,CAAU,GAAV,CANR;QAOIC,KAAKC,WAAWb,KAAKW,IAAL,CAAU,IAAV,CAAX,KAA+B,CAPxC;QAQIG,QAAQd,KAAKA,IAAL,CAAU,IAAV,EACLe,MADK,CACE,OADF,EAELJ,IAFK,CAEA,GAFA,EAEK,CAFL,EAG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uB,OAAO8E,UAAP;iBACVgD,CAAb;WACOzB,MAAP;GAHF;;SAMOzB,EAAP,GAAY,YAAW;QACfwD,QAAQjC,iBAAiBvB,EAAjB,CAAoByD,KAApB,CAA0BlC,gBAA1B,EAA4C4B,SAA5C,CAAd;WACOK,UAAUjC,gBAAV,GAA6BE,MAA7B,GAAsC+B,KAA7C;GAFF;;SAKO/B,MAAP;;;ACxOK,IAAMwC,kBAAkB,SAAlBA,eAAkB,OAA2C;MAAhC/I,CAAgC,QAAhCA,CAAgC;MAA7B+B,SAA6B,QAA7BA,SAA6B;MAAlBiH,eAAkB,QAAlBA,eAAkB;;;MAEpEhJ,MAAM,CAAV,EAAa;WACJgJ,gBAAgBhJ,CAAhB,EAAmBiJ,OAAnB,CAA2B,QAA3B,EAAqC,WAArC,CAAP;GADF,MAEO,IAAIjJ,MAAM+B,YAAY,CAAtB,EAAyB;0BACViH,gBAAgBjH,YAAY,CAA5B,EAA+BkH,OAA/B,CAAuC,SAAvC,EAAkD,EAAlD,CAApB;;SAEKD,gBAAgBhJ,CAAhB,CAAP;CAPK;;AAUP,oBAAe;;CAAf;;ACHA,YAAe;oBAAA;kBAAA;sBAAA;;CAAf;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"indexRollup.js","sources":["src/legend.js","src/color.js","src/size.js","src/symbol.js","src/helpers.js","index.js"],"sourcesContent":["import { select } from 'd3-selection'\nimport { format, formatPrefix } from 'd3-format'\n\nconst d3_identity = (d) => d\n\nconst d3_reverse = (arr) => {\n const mirror = [];\n for (let i = 0, l = arr.length; i < l; i++) {\n mirror[i] = arr[l-i-1];\n }\n return mirror;\n}\n\n//Text wrapping code adapted from Mike Bostock\nconst d3_textWrapping = (text, width) => {\n text.each(function() {\n var text = select(this),\n words = text.text().split(/\\s+/).reverse(),\n word,\n line = [],\n lineNumber = 0,\n lineHeight = 1.2, //ems\n y = text.attr(\"y\"),\n dy = parseFloat(text.attr(\"dy\")) || 0,\n tspan = text.text(null)\n .append(\"tspan\")\n .attr(\"x\", 0)\n .attr(\"dy\", dy + \"em\");\n\n while (word = words.pop()) {\n line.push(word);\n tspan.text(line.join(\" \"));\n if (tspan.node().getComputedTextLength() > width && line.length > 1) {\n line.pop();\n tspan.text(line.join(\" \"));\n line = [word];\n tspan = text.append(\"tspan\")\n .attr(\"x\", 0)\n .attr(\"dy\", lineHeight + dy + \"em\").text(word);\n }\n }\n });\n}\n\n\nconst d3_mergeLabels = (gen=[], labels, domain, range) => {\n\n if (typeof labels === \"object\"){\n if(labels.length === 0) return gen;\n\n let i = labels.length;\n for (; i < gen.length; i++) {\n labels.push(gen[i]);\n }\n return labels;\n } else if (typeof labels === \"function\") {\n const customLabels = []\n const genLength = gen.length\n for (let i=0; i < genLength; i++){\n customLabels.push(labels({\n i,\n genLength,\n generatedLabels : gen,\n domain,\n range }))\n }\n return customLabels\n }\n\n return gen;\n }\n\nconst d3_linearLegend = (scale, cells, labelFormat) => {\n let data = [];\n\n if (cells.length > 1){\n data = cells;\n\n } else {\n const domain = scale.domain(),\n increment = (domain[domain.length - 1] - domain[0])/(cells - 1)\n let i = 0;\n\n for (; i < cells; i++){\n data.push(domain[0] + i*increment);\n }\n }\n\n const labels = data.map(labelFormat);\n return {data: data,\n labels: labels,\n feature: d => scale(d)};\n}\n\nconst d3_quantLegend = (scale, labelFormat, labelDelimiter) => {\n const labels = scale.range().map( d => {\n const invert = scale.invertExtent(d);\n return labelFormat(invert[0]) + \" \" + labelDelimiter + \" \" + labelFormat(invert[1]);\n });\n\n return {data: scale.range(),\n labels: labels,\n feature: d3_identity\n };\n}\n\nconst d3_ordinalLegend= scale => ({data: scale.domain(),\n labels: scale.domain(),\n feature: d => scale(d) }\n)\n\nconst d3_cellOver = (cellDispatcher, d, obj) => {\n cellDispatcher.call(\"cellover\", obj, d);\n}\n\nconst d3_cellOut = (cellDispatcher, d, obj) => {\n cellDispatcher.call(\"cellout\", obj, d);\n}\n\nconst d3_cellClick = (cellDispatcher, d, obj) => {\n cellDispatcher.call(\"cellclick\", obj, d);\n}\n\n\nexport default {\n\n d3_drawShapes: (shape, shapes, shapeHeight, shapeWidth, shapeRadius, path) => {\n if (shape === \"rect\"){\n shapes.attr(\"height\", shapeHeight)\n .attr(\"width\", shapeWidth);\n\n } else if (shape === \"circle\") {\n shapes.attr(\"r\", shapeRadius)\n\n } else if (shape === \"line\") {\n shapes.attr(\"x1\", 0).attr(\"x2\", shapeWidth).attr(\"y1\", 0).attr(\"y2\", 0);\n\n } else if (shape === \"path\") {\n shapes.attr(\"d\", path);\n }\n },\n\n d3_addText: function (svg, enter, labels, classPrefix, labelWidth){\n enter.append(\"text\").attr(\"class\", classPrefix + \"label\");\n const text = svg.selectAll(`g.${classPrefix}cell text.${classPrefix}label`)\n .data(labels)\n .text(d3_identity);\n\n if (labelWidth){\n svg.selectAll(`g.${classPrefix}cell text.${classPrefix}label`)\n .call(d3_textWrapping, labelWidth)\n }\n\n return text\n },\n\n d3_calcType: function (scale, ascending, cells, labels, labelFormat, labelDelimiter){\n const type = scale.invertExtent ?\n d3_quantLegend(scale, labelFormat, labelDelimiter) : scale.ticks ?\n d3_linearLegend(scale, cells, labelFormat) : d3_ordinalLegend(scale);\n\n //for d3.scaleSequential that doesn't have a range function\n const range = scale.range && scale.range() || scale.domain()\n type.labels = d3_mergeLabels(type.labels, labels, scale.domain(), range);\n\n if (ascending) {\n type.labels = d3_reverse(type.labels);\n type.data = d3_reverse(type.data);\n }\n\n return type;\n },\n\n d3_filterCells: (type, cellFilter) => {\n let filterCells = type.data.map((d, i) => ({ data: d, label: type.labels[i] }))\n .filter(cellFilter)\n const dataValues = filterCells.map(d => d.data)\n const labelValues = filterCells.map(d => d.label)\n type.data = type.data.filter(d => dataValues.indexOf(d) !== -1)\n type.labels = type.labels.filter(d => labelValues.indexOf(d) !== -1)\n return type\n },\n\n d3_placement: (orient, cell, cellTrans, text, textTrans, labelAlign) => {\n cell.attr(\"transform\", cellTrans);\n text.attr(\"transform\", textTrans);\n if (orient === \"horizontal\"){\n text.style(\"text-anchor\", labelAlign);\n }\n },\n\n d3_addEvents: function(cells, dispatcher){\n cells.on(\"mouseover.legend\", function (d) { d3_cellOver(dispatcher, d, this); })\n .on(\"mouseout.legend\", function (d) { d3_cellOut(dispatcher, d, this); })\n .on(\"click.legend\", function (d) { d3_cellClick(dispatcher, d, this); });\n },\n\n d3_title: (svg, title, classPrefix, titleWidth) => {\n if (title !== \"\"){\n\n const titleText = svg.selectAll('text.' + classPrefix + 'legendTitle');\n\n titleText.data([title])\n .enter()\n .append('text')\n .attr('class', classPrefix + 'legendTitle');\n\n svg.selectAll('text.' + classPrefix + 'legendTitle')\n .text(title)\n\n if (titleWidth){\n svg.selectAll('text.' + classPrefix + 'legendTitle')\n .call(d3_textWrapping, titleWidth)\n }\n\n const cellsSvg = svg.select('.' + classPrefix + 'legendCells')\n const yOffset = svg.select('.' + classPrefix + 'legendTitle').nodes()\n .map(d => d.getBBox().height)[0],\n\n xOffset = -cellsSvg.nodes().map(function(d) { return d.getBBox().x})[0];\n cellsSvg.attr('transform', 'translate(' + xOffset + ',' + (yOffset) + ')');\n\n }\n },\n\n d3_defaultLocale: {\n format,\n formatPrefix\n },\n\n d3_defaultFormatSpecifier: '.01f',\n\n d3_defaultDelimiter: 'to'\n}\n","import helper from './legend';\nimport { dispatch } from 'd3-dispatch';\nimport { scaleLinear } from 'd3-scale';\nimport { formatLocale, formatSpecifier } from 'd3-format';\n\nimport { sum } from 'd3-array';\n\nexport default function color(){\n\n let scale = scaleLinear(),\n shape = \"rect\",\n shapeWidth = 15,\n shapeHeight = 15,\n shapeRadius = 10,\n shapePadding = 2,\n cells = [5],\n cellFilter,\n labels = [],\n classPrefix = \"\",\n useClass = false,\n title = \"\",\n locale = helper.d3_defaultLocale,\n specifier = helper.d3_defaultFormatSpecifier,\n labelOffset = 10,\n labelAlign = \"middle\",\n labelDelimiter = helper.d3_defaultDelimiter,\n labelWrap,\n orient = \"vertical\",\n ascending = false,\n path,\n titleWidth,\n legendDispatcher = dispatch(\"cellover\", \"cellout\", \"cellclick\");\n\n function legend(svg) {\n\n const type = helper.d3_calcType(scale, ascending, cells, labels, locale.format(specifier), labelDelimiter),\n legendG = svg.selectAll('g').data([scale]);\n\n legendG.enter().append('g').attr('class', classPrefix + 'legendCells');\n\n if (cellFilter){\n helper.d3_filterCells(type, cellFilter)\n }\n\n let cell = svg.select('.' + classPrefix + 'legendCells')\n .selectAll(\".\" + classPrefix + \"cell\").data(type.data)\n\n const cellEnter = cell.enter().append(\"g\")\n .attr(\"class\", classPrefix + \"cell\")\n cellEnter.append(shape).attr(\"class\", classPrefix + \"swatch\")\n\n let shapes = svg.selectAll(\"g.\" + classPrefix + \"cell \" + shape + \".\" + classPrefix + \"swatch\").data(type.data);\n\n //add event handlers\n helper.d3_addEvents(cellEnter, legendDispatcher);\n\n cell.exit().transition().style(\"opacity\", 0).remove();\n shapes.exit().transition().style(\"opacity\", 0).remove();\n\n shapes = shapes.merge(shapes);\n\n helper.d3_drawShapes(shape, shapes, shapeHeight, shapeWidth, shapeRadius, path);\n helper.d3_addText( svg, cellEnter, type.labels, classPrefix, labelWrap)\n\n // we need to merge the selection, otherwise changes in the legend (e.g. change of orientation) are applied only to the new cells and not the existing ones.\n cell = cellEnter.merge(cell);\n\n // sets placement\n const text = cell.selectAll(\"text\"),\n textSize = text.nodes().map(d => d.getBBox()),\n shapeSize = shapes.nodes().map( d => d.getBBox());\n //sets scale\n //everything is fill except for line which is stroke,\n if (!useClass){\n if (shape == \"line\"){\n shapes.style(\"stroke\", type.feature);\n } else {\n shapes.style(\"fill\", type.feature);\n }\n } else {\n shapes.attr(\"class\", d => `${classPrefix}swatch ${type.feature(d)}`);\n }\n\n let cellTrans,\n textTrans,\n textAlign = (labelAlign == \"start\") ? 0 : (labelAlign == \"middle\") ? 0.5 : 1;\n\n //positions cells and text\n if (orient === \"vertical\"){\n const cellSize = textSize.map((d, i) => Math.max(d.height, shapeSize[i].height))\n\n cellTrans = (d, i) => {\n const height = sum(cellSize.slice(0, i));\n return `translate(0, ${height + i*shapePadding})`}\n\n textTrans = (d,i) => `translate( ${(shapeSize[i].width + shapeSize[i].x +\n labelOffset)}, ${(shapeSize[i].y + shapeSize[i].height/2 + 5)})`;\n\n } else if (orient === \"horizontal\"){\n cellTrans = (d,i) => `translate(${(i * (shapeSize[i].width + shapePadding))},0)`\n textTrans = (d,i) => `translate(${(shapeSize[i].width*textAlign + shapeSize[i].x)},\n ${(shapeSize[i].height + shapeSize[i].y + labelOffset + 8)})`;\n }\n\n helper.d3_placement(orient, cell, cellTrans, text, textTrans, labelAlign);\n helper.d3_title(svg, title, classPrefix, titleWidth);\n\n cell.transition().style(\"opacity\", 1);\n\n }\n\n legend.scale = function(_) {\n if (!arguments.length) return scale;\n scale = _;\n return legend;\n };\n\n legend.cells = function(_) {\n if (!arguments.length) return cells;\n if (_.length > 1 || _ >= 2 ){\n cells = _;\n }\n return legend;\n };\n\n legend.cellFilter = function(_) {\n if (!arguments.length) return cellFilter;\n cellFilter = _;\n return legend;\n };\n\n legend.shape = function(_, d) {\n if (!arguments.length) return shape;\n if (_ == \"rect\" || _ == \"circle\" || _ == \"line\" || (_ == \"path\" && (typeof d === 'string')) ){\n shape = _;\n path = d;\n }\n return legend;\n };\n\n legend.shapeWidth = function(_) {\n if (!arguments.length) return shapeWidth;\n shapeWidth = +_;\n return legend;\n };\n\n legend.shapeHeight = function(_) {\n if (!arguments.length) return shapeHeight;\n shapeHeight = +_;\n return legend;\n };\n\n legend.shapeRadius = function(_) {\n if (!arguments.length) return shapeRadius;\n shapeRadius = +_;\n return legend;\n };\n\n legend.shapePadding = function(_) {\n if (!arguments.length) return shapePadding;\n shapePadding = +_;\n return legend;\n };\n\n legend.labels = function(_) {\n if (!arguments.length) return labels;\n labels = _;\n return legend;\n };\n\n legend.labelAlign = function(_) {\n if (!arguments.length) return labelAlign;\n if (_ == \"start\" || _ == \"end\" || _ == \"middle\") {\n labelAlign = _;\n }\n return legend;\n };\n\n legend.locale = function(_) {\n if (!arguments.length) return locale;\n locale = formatLocale(_)\n return legend\n };\n\n legend.labelFormat = function(_) {\n if (!arguments.length) return legend.locale().format(specifier);\n specifier = formatSpecifier(_)\n return legend;\n };\n\n legend.labelOffset = function(_) {\n if (!arguments.length) return labelOffset;\n labelOffset = +_;\n return legend;\n };\n\n legend.labelDelimiter = function(_) {\n if (!arguments.length) return labelDelimiter;\n labelDelimiter = _;\n return legend;\n };\n\n legend.labelWrap = function(_) {\n if (!arguments.length) return labelWrap;\n labelWrap = _;\n return legend;\n };\n\n legend.useClass = function(_) {\n if (!arguments.length) return useClass;\n if (_ === true || _ === false){\n useClass = _;\n }\n return legend;\n };\n\n legend.orient = function(_){\n if (!arguments.length) return orient;\n _ = _.toLowerCase();\n if (_ == \"horizontal\" || _ == \"vertical\") {\n orient = _;\n }\n return legend;\n };\n\n legend.ascending = function(_) {\n if (!arguments.length) return ascending;\n ascending = !!_;\n return legend;\n };\n\n legend.classPrefix = function(_) {\n if (!arguments.length) return classPrefix;\n classPrefix = _;\n return legend;\n };\n\n legend.title = function(_) {\n if (!arguments.length) return title;\n title = _;\n return legend;\n };\n\n legend.titleWidth = function(_) {\n if (!arguments.length) return titleWidth;\n titleWidth = _;\n return legend;\n };\n\n legend.textWrap = function(_) {\n if (!arguments.length) return textWrap;\n textWrap = _;\n return legend;\n }\n\n legend.on = function(){\n const value = legendDispatcher.on.apply(legendDispatcher, arguments)\n return value === legendDispatcher ? legend : value;\n }\n\n return legend;\n\n};\n","import helper from \"./legend\"\nimport { dispatch } from \"d3-dispatch\"\nimport { scaleLinear } from \"d3-scale\"\nimport { formatLocale, formatSpecifier } from \"d3-format\"\nimport { sum, max } from \"d3-array\"\n\nexport default function size() {\n let scale = scaleLinear(),\n shape = \"rect\",\n shapeWidth = 15,\n shapePadding = 2,\n cells = [5],\n cellFilter,\n labels = [],\n classPrefix = \"\",\n title = \"\",\n locale = helper.d3_defaultLocale,\n specifier = helper.d3_defaultFormatSpecifier,\n labelOffset = 10,\n labelAlign = \"middle\",\n labelDelimiter = helper.d3_defaultDelimiter,\n labelWrap,\n orient = \"vertical\",\n ascending = false,\n path,\n titleWidth,\n legendDispatcher = dispatch(\"cellover\", \"cellout\", \"cellclick\")\n\n function legend(svg) {\n const type = helper.d3_calcType(\n scale,\n ascending,\n cells,\n labels,\n locale.format(specifier),\n labelDelimiter\n ),\n legendG = svg.selectAll(\"g\").data([scale])\n\n if (cellFilter) {\n helper.d3_filterCells(type, cellFilter)\n }\n\n legendG\n .enter()\n .append(\"g\")\n .attr(\"class\", classPrefix + \"legendCells\")\n\n let cell = svg\n .select(\".\" + classPrefix + \"legendCells\")\n .selectAll(\".\" + classPrefix + \"cell\")\n .data(type.data)\n const cellEnter = cell\n .enter()\n .append(\"g\")\n .attr(\"class\", classPrefix + \"cell\")\n cellEnter.append(shape).attr(\"class\", classPrefix + \"swatch\")\n\n let shapes = svg.selectAll(\"g.\" + classPrefix + \"cell \" + shape + \".\" + classPrefix + \"swatch\")\n\n //add event handlers\n helper.d3_addEvents(cellEnter, legendDispatcher)\n\n cell\n .exit()\n .transition()\n .style(\"opacity\", 0)\n .remove()\n\n shapes\n .exit()\n .transition()\n .style(\"opacity\", 0)\n .remove()\n shapes = shapes.merge(shapes)\n\n //creates shape\n if (shape === \"line\") {\n helper.d3_drawShapes(shape, shapes, 0, shapeWidth)\n shapes.attr(\"stroke-width\", type.feature)\n } else {\n helper.d3_drawShapes(\n shape,\n shapes,\n type.feature,\n type.feature,\n type.feature,\n path\n )\n }\n\n const text = helper.d3_addText(\n svg,\n cellEnter,\n type.labels,\n classPrefix,\n labelWrap\n )\n\n // we need to merge the selection, otherwise changes in the legend (e.g. change of orientation) are applied only to the new cells and not the existing ones.\n cell = cellEnter.merge(cell)\n\n //sets placement\n\n const textSize = text.nodes().map(d => d.getBBox()),\n shapeSize = shapes.nodes().map((d, i) => {\n const bbox = d.getBBox()\n const stroke = scale(type.data[i])\n\n if (shape === \"line\" && orient === \"horizontal\") {\n bbox.height = bbox.height + stroke\n } else if (shape === \"line\" && orient === \"vertical\") {\n bbox.width = bbox.width\n }\n return bbox\n })\n //console.log('SHAPESIZE')\n const maxH = max(shapeSize, d => d.height + d.y),\n maxW = max(shapeSize, d => d.width + d.x)\n\n let cellTrans,\n textTrans,\n textAlign = labelAlign == \"start\" ? 0 : labelAlign == \"middle\" ? 0.5 : 1\n\n //positions cells and text\n if (orient === \"vertical\") {\n const cellSize = textSize.map((d, i) =>\n Math.max(d.height, shapeSize[i].height)\n )\n const y =\n shape == \"circle\" || shape == \"line\" ? shapeSize[0].height / 2 : 0\n cellTrans = (d, i) => {\n const height = sum(cellSize.slice(0, i))\n\n return `translate(0, ${y + height + i * shapePadding})`\n }\n\n textTrans = (d, i) => `translate( ${maxW + labelOffset},\n ${shapeSize[i].y + shapeSize[i].height / 2 + 5})`\n } else if (orient === \"horizontal\") {\n cellTrans = (d, i) => {\n const width = sum(shapeSize.slice(0, i), d => d.width)\n const y = shape == \"circle\" || shape == \"line\" ? maxH / 2 : 0\n return `translate(${width + i * shapePadding}, ${y})`\n }\n\n const offset = shape == \"line\" ? maxH / 2 : maxH\n textTrans = (d, i) => {\n return `translate( ${shapeSize[i].width * textAlign + shapeSize[i].x},\n ${offset + labelOffset})`\n }\n }\n\n helper.d3_placement(orient, cell, cellTrans, text, textTrans, labelAlign)\n helper.d3_title(svg, title, classPrefix, titleWidth)\n\n cell.transition().style(\"opacity\", 1)\n }\n\n legend.scale = function(_) {\n if (!arguments.length) return scale\n scale = _\n return legend\n }\n\n legend.cells = function(_) {\n if (!arguments.length) return cells\n if (_.length > 1 || _ >= 2) {\n cells = _\n }\n return legend\n }\n\n legend.cellFilter = function(_) {\n if (!arguments.length) return cellFilter\n cellFilter = _\n return legend\n }\n\n legend.shape = function(_, d) {\n if (!arguments.length) return shape\n if (_ == \"rect\" || _ == \"circle\" || _ == \"line\") {\n shape = _\n path = d\n }\n return legend\n }\n\n legend.shapeWidth = function(_) {\n if (!arguments.length) return shapeWidth\n shapeWidth = +_\n return legend\n }\n\n legend.shapePadding = function(_) {\n if (!arguments.length) return shapePadding\n shapePadding = +_\n return legend\n }\n\n legend.labels = function(_) {\n if (!arguments.length) return labels\n labels = _\n return legend\n }\n\n legend.labelAlign = function(_) {\n if (!arguments.length) return labelAlign\n if (_ == \"start\" || _ == \"end\" || _ == \"middle\") {\n labelAlign = _\n }\n return legend\n }\n\n legend.locale = function(_) {\n if (!arguments.length) return locale\n locale = formatLocale(_)\n return legend\n }\n\n legend.labelFormat = function(_) {\n if (!arguments.length) return legend.locale().format(specifier)\n specifier = formatSpecifier(_)\n return legend\n }\n\n legend.labelOffset = function(_) {\n if (!arguments.length) return labelOffset\n labelOffset = +_\n return legend\n }\n\n legend.labelDelimiter = function(_) {\n if (!arguments.length) return labelDelimiter\n labelDelimiter = _\n return legend\n }\n\n legend.labelWrap = function(_) {\n if (!arguments.length) return labelWrap\n labelWrap = _\n return legend\n }\n\n legend.orient = function(_) {\n if (!arguments.length) return orient\n _ = _.toLowerCase()\n if (_ == \"horizontal\" || _ == \"vertical\") {\n orient = _\n }\n return legend\n }\n\n legend.ascending = function(_) {\n if (!arguments.length) return ascending\n ascending = !!_\n return legend\n }\n\n legend.classPrefix = function(_) {\n if (!arguments.length) return classPrefix\n classPrefix = _\n return legend\n }\n\n legend.title = function(_) {\n if (!arguments.length) return title\n title = _\n return legend\n }\n\n legend.titleWidth = function(_) {\n if (!arguments.length) return titleWidth\n titleWidth = _\n return legend\n }\n\n legend.on = function() {\n const value = legendDispatcher.on.apply(legendDispatcher, arguments)\n return value === legendDispatcher ? legend : value\n }\n\n return legend\n}\n","import helper from \"./legend\"\nimport { dispatch } from \"d3-dispatch\"\nimport { scaleLinear } from \"d3-scale\"\nimport { formatLocale, formatSpecifier } from \"d3-format\"\nimport { sum, max } from \"d3-array\"\n\nexport default function symbol() {\n let scale = scaleLinear(),\n shape = \"path\",\n shapeWidth = 15,\n shapeHeight = 15,\n shapeRadius = 10,\n shapePadding = 5,\n cells = [5],\n cellFilter,\n labels = [],\n classPrefix = \"\",\n title = \"\",\n locale = helper.d3_defaultLocale,\n specifier = helper.d3_defaultFormatSpecifier,\n labelAlign = \"middle\",\n labelOffset = 10,\n labelDelimiter = helper.d3_defaultDelimiter,\n labelWrap,\n orient = \"vertical\",\n ascending = false,\n titleWidth,\n legendDispatcher = dispatch(\"cellover\", \"cellout\", \"cellclick\")\n\n function legend(svg) {\n const type = helper.d3_calcType(\n scale,\n ascending,\n cells,\n labels,\n locale.format(specifier),\n labelDelimiter\n ),\n legendG = svg.selectAll(\"g\").data([scale])\n\n if (cellFilter) {\n helper.d3_filterCells(type, cellFilter)\n }\n\n legendG\n .enter()\n .append(\"g\")\n .attr(\"class\", classPrefix + \"legendCells\")\n\n let cell = svg\n .select(\".\" + classPrefix + \"legendCells\")\n .selectAll(\".\" + classPrefix + \"cell\")\n .data(type.data)\n const cellEnter = cell\n .enter()\n .append(\"g\")\n .attr(\"class\", classPrefix + \"cell\")\n cellEnter.append(shape).attr(\"class\", classPrefix + \"swatch\")\n\n let shapes = svg.selectAll(\"g.\" + classPrefix + \"cell \" + shape + \".\" + classPrefix + \"swatch\")\n\n //add event handlers\n helper.d3_addEvents(cellEnter, legendDispatcher)\n\n //remove old shapes\n cell\n .exit()\n .transition()\n .style(\"opacity\", 0)\n .remove()\n shapes\n .exit()\n .transition()\n .style(\"opacity\", 0)\n .remove()\n shapes = shapes.merge(shapes)\n\n helper.d3_drawShapes(\n shape,\n shapes,\n shapeHeight,\n shapeWidth,\n shapeRadius,\n type.feature\n )\n helper.d3_addText(svg, cellEnter, type.labels, classPrefix, labelWrap)\n\n // we need to merge the selection, otherwise changes in the legend (e.g. change of orientation) are applied only to the new cells and not the existing ones.\n cell = cellEnter.merge(cell)\n\n // sets placement\n const text = cell.selectAll(\"text\"),\n textSize = text.nodes().map(d => d.getBBox()),\n shapeSize = shapes.nodes().map(d => d.getBBox())\n\n const maxH = max(shapeSize, d => d.height),\n maxW = max(shapeSize, d => d.width)\n\n let cellTrans,\n textTrans,\n textAlign = labelAlign == \"start\" ? 0 : labelAlign == \"middle\" ? 0.5 : 1\n\n //positions cells and text\n if (orient === \"vertical\") {\n const cellSize = textSize.map((d, i) => Math.max(maxH, d.height))\n\n cellTrans = (d, i) => {\n const height = sum(cellSize.slice(0, i))\n return `translate(0, ${height + i * shapePadding} )`\n }\n textTrans = (d, i) => `translate( ${maxW + labelOffset},\n ${shapeSize[i].y + shapeSize[i].height / 2 + 5})`\n } else if (orient === \"horizontal\") {\n cellTrans = (d, i) => `translate( ${i * (maxW + shapePadding)},0)`\n textTrans = (d, i) => `translate( ${shapeSize[i].width * textAlign +\n shapeSize[i].x},\n ${maxH + labelOffset})`\n }\n\n helper.d3_placement(orient, cell, cellTrans, text, textTrans, labelAlign)\n helper.d3_title(svg, title, classPrefix, titleWidth)\n cell.transition().style(\"opacity\", 1)\n }\n\n legend.scale = function(_) {\n if (!arguments.length) return scale\n scale = _\n return legend\n }\n\n legend.cells = function(_) {\n if (!arguments.length) return cells\n if (_.length > 1 || _ >= 2) {\n cells = _\n }\n return legend\n }\n\n legend.cellFilter = function(_) {\n if (!arguments.length) return cellFilter\n cellFilter = _\n return legend\n }\n\n legend.shapePadding = function(_) {\n if (!arguments.length) return shapePadding\n shapePadding = +_\n return legend\n }\n\n legend.labels = function(_) {\n if (!arguments.length) return labels\n labels = _\n return legend\n }\n\n legend.labelAlign = function(_) {\n if (!arguments.length) return labelAlign\n if (_ == \"start\" || _ == \"end\" || _ == \"middle\") {\n labelAlign = _\n }\n return legend\n }\n\n legend.locale = function(_) {\n if (!arguments.length) return locale\n locale = formatLocale(_)\n return legend\n }\n\n legend.labelFormat = function(_) {\n if (!arguments.length) return legend.locale().format(specifier)\n specifier = formatSpecifier(_)\n return legend\n }\n\n legend.labelOffset = function(_) {\n if (!arguments.length) return labelOffset\n labelOffset = +_\n return legend\n }\n\n legend.labelDelimiter = function(_) {\n if (!arguments.length) return labelDelimiter\n labelDelimiter = _\n return legend\n }\n\n legend.labelWrap = function(_) {\n if (!arguments.length) return labelWrap\n labelWrap = _\n return legend\n }\n\n legend.orient = function(_) {\n if (!arguments.length) return orient\n _ = _.toLowerCase()\n if (_ == \"horizontal\" || _ == \"vertical\") {\n orient = _\n }\n return legend\n }\n\n legend.ascending = function(_) {\n if (!arguments.length) return ascending\n ascending = !!_\n return legend\n }\n\n legend.classPrefix = function(_) {\n if (!arguments.length) return classPrefix\n classPrefix = _\n return legend\n }\n\n legend.title = function(_) {\n if (!arguments.length) return title\n title = _\n return legend\n }\n\n legend.titleWidth = function(_) {\n if (!arguments.length) return titleWidth\n titleWidth = _\n return legend\n }\n\n legend.on = function() {\n const value = legendDispatcher.on.apply(legendDispatcher, arguments)\n return value === legendDispatcher ? legend : value\n }\n\n return legend\n}\n","export const thresholdLabels = function({ i, genLength, generatedLabels }){\n\n if (i === 0 ){\n return generatedLabels[i].replace('NaN to', 'Less than')\n } else if (i === genLength - 1) {\n return `More than ${generatedLabels[genLength - 1].replace(' to NaN', '')}`\n }\n return generatedLabels[i]\n}\n\nexport default {\n thresholdLabels\n}\n","import legendColor from './src/color'\nimport legendSize from './src/size'\nimport legendSymbol from './src/symbol'\nimport legendHelpers from './src/helpers'\n\nexport { legendColor, legendSize, legendSymbol, legendHelpers }\n\nexport default {\n legendColor,\n legendSize,\n legendSymbol,\n legendHelpers\n};\n"],"names":["d3_identity","d","d3_reverse","arr","mirror","i","l","length","d3_textWrapping","text","width","each","select","words","split","reverse","word","line","lineNumber","lineHeight","attr","dy","parseFloat","tspan","append","pop","push","join","node","getComputedTextLength","d3_mergeLabels","gen","labels","domain","range","customLabels","genLength","d3_linearLegend","scale","cells","labelFormat","data","increment","map","d3_quantLegend","labelDelimiter","invert","invertExtent","d3_ordinalLegend","d3_cellOver","cellDispatcher","obj","call","d3_cellOut","d3_cellClick","shape","shapes","shapeHeight","shapeWidth","shapeRadius","path","svg","enter","classPrefix","labelWidth","selectAll","ascending","type","ticks","cellFilter","filterCells","label","filter","dataValues","labelValues","indexOf","orient","cell","cellTrans","textTrans","labelAlign","style","dispatcher","on","title","titleWidth","titleText","cellsSvg","yOffset","nodes","getBBox","height","xOffset","x","color","scaleLinear","shapePadding","useClass","locale","helper","d3_defaultLocale","specifier","d3_defaultFormatSpecifier","labelOffset","d3_defaultDelimiter","labelWrap","legendDispatcher","dispatch","legend","d3_calcType","format","legendG","d3_filterCells","cellEnter","d3_addEvents","exit","transition","remove","merge","d3_drawShapes","d3_addText","textSize","shapeSize","feature","textAlign","cellSize","Math","max","sum","slice","y","d3_placement","d3_title","_","arguments","formatLocale","formatSpecifier","toLowerCase","textWrap","value","apply","size","bbox","stroke","maxH","maxW","offset","symbol","thresholdLabels","generatedLabels","replace"],"mappings":";;;;;;;;;;;;AAGA,IAAMA,cAAe,SAAfA,WAAe,CAACC,CAAD;SAAOA,CAAP;CAArB;;AAEA,IAAMC,aAAa,SAAbA,UAAa,CAACC,GAAD,EAAS;MACpBC,SAAS,EAAf;OACK,IAAIC,IAAI,CAAR,EAAWC,IAAIH,IAAII,MAAxB,EAAgCF,IAAIC,CAApC,EAAuCD,GAAvC,EAA4C;WACnCA,CAAP,IAAYF,IAAIG,IAAED,CAAF,GAAI,CAAR,CAAZ;;SAEKD,MAAP;CALF;;;AASA,IAAMI,kBAAkB,SAAlBA,eAAkB,CAACC,IAAD,EAAOC,KAAP,EAAiB;OAClCC,IAAL,CAAU,YAAW;QACfF,OAAOG,mBAAO,IAAP,CAAX;QACIC,QAAQJ,KAAKA,IAAL,GAAYK,KAAZ,CAAkB,KAAlB,EAAyBC,OAAzB,EADZ;QAEIC,IAFJ;QAGIC,OAAO,EAHX;QAIIC,aAAa,CAJjB;QAKIC,aAAa,GALjB;;QAMQV,KAAKW,IAAL,CAAU,GAAV,CANR;QAOIC,KAAKC,WAAWb,KAAKW,IAAL,CAAU,IAAV,CAAX,KAA+B,CAPxC;QAQIG,QAAQd,KAAKA,IAAL,CAAU,IAAV,EACLe,MADK,CACE,OADF,E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CAAT,EAAY;QACrB,CAACC,UAAU/H,MAAf,EAAuB,OAAO6E,KAAP;YACfiD,CAAR;WACOzB,MAAP;GAHF;;SAMOvB,UAAP,GAAoB,UAASgD,CAAT,EAAY;QAC1B,CAACC,UAAU/H,MAAf,EAAuB,OAAO8E,UAAP;iBACVgD,CAAb;WACOzB,MAAP;GAHF;;SAMOzB,EAAP,GAAY,YAAW;QACfwD,QAAQjC,iBAAiBvB,EAAjB,CAAoByD,KAApB,CAA0BlC,gBAA1B,EAA4C4B,SAA5C,CAAd;WACOK,UAAUjC,gBAAV,GAA6BE,MAA7B,GAAsC+B,KAA7C;GAFF;;SAKO/B,MAAP;;;ACxOK,IAAMwC,kBAAkB,SAAlBA,eAAkB,OAA2C;MAAhC/I,CAAgC,QAAhCA,CAAgC;MAA7B+B,SAA6B,QAA7BA,SAA6B;MAAlBiH,eAAkB,QAAlBA,eAAkB;;;MAEpEhJ,MAAM,CAAV,EAAa;WACJgJ,gBAAgBhJ,CAAhB,EAAmBiJ,OAAnB,CAA2B,QAA3B,EAAqC,WAArC,CAAP;GADF,MAEO,IAAIjJ,MAAM+B,YAAY,CAAtB,EAAyB;0BACViH,gBAAgBjH,YAAY,CAA5B,EAA+BkH,OAA/B,CAAuC,SAAvC,EAAkD,EAAlD,CAApB;;SAEKD,gBAAgBhJ,CAAhB,CAAP;CAPK;;AAUP,oBAAe;;CAAf;;ACHA,YAAe;oBAAA;kBAAA;sBAAA;;CAAf;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/indexRollupNext.js b/indexRollupNext.js index b24aacd..c49ffe2 100644 --- a/indexRollupNext.js +++ b/indexRollupNext.js @@ -289,7 +289,7 @@ function color() { var cellEnter = cell.enter().append("g").attr("class", classPrefix + "cell"); cellEnter.append(shape).attr("class", classPrefix + "swatch"); - var shapes = svg.selectAll("g." + classPrefix + "cell " + shape).data(type.data); + var shapes = svg.selectAll("g." + classPrefix + "cell " + shape + "." + classPrefix + "swatch").data(type.data); //add event handlers helper.d3_addEvents(cellEnter, legendDispatcher); @@ -333,20 +333,18 @@ function color() { //positions cells and text if (orient === "vertical") { - (function () { - var cellSize = textSize.map(function (d, i) { - return Math.max(d.height, shapeSize[i].height); - }); + var cellSize = textSize.map(function (d, i) { + return Math.max(d.height, shapeSize[i].height); + }); - cellTrans = function cellTrans(d, i) { - var height = sum(cellSize.slice(0, i)); - return 'translate(0, ' + (height + i * shapePadding) + ')'; - }; + cellTrans = function cellTrans(d, i) { + var height = sum(cellSize.slice(0, i)); + return 'translate(0, ' + (height + i * shapePadding) + ')'; + }; - textTrans = function textTrans(d, i) { - return 'translate( ' + (shapeSize[i].width + shapeSize[i].x + labelOffset) + ', ' + (shapeSize[i].y + shapeSize[i].height / 2 + 5) + ')'; - }; - })(); + textTrans = function textTrans(d, i) { + return 'translate( ' + (shapeSize[i].width + shapeSize[i].x + labelOffset) + ', ' + (shapeSize[i].y + shapeSize[i].height / 2 + 5) + ')'; + }; } else if (orient === "horizontal") { cellTrans = function cellTrans(d, i) { return 'translate(' + i * (shapeSize[i].width + shapePadding) + ',0)'; @@ -550,7 +548,7 @@ function size() { var cellEnter = cell.enter().append("g").attr("class", classPrefix + "cell"); cellEnter.append(shape).attr("class", classPrefix + "swatch"); - var shapes = svg.selectAll("g." + classPrefix + "cell " + shape); + var shapes = svg.selectAll("g." + classPrefix + "cell " + shape + "." + classPrefix + "swatch"); //add event handlers helper.d3_addEvents(cellEnter, legendDispatcher); @@ -603,36 +601,32 @@ function size() { //positions cells and text if (orient === "vertical") { - (function () { - var cellSize = textSize.map(function (d, i) { - return Math.max(d.height, shapeSize[i].height); - }); - var y = shape == "circle" || shape == "line" ? shapeSize[0].height / 2 : 0; - cellTrans = function cellTrans(d, i) { - var height = sum(cellSize.slice(0, i)); + var cellSize = textSize.map(function (d, i) { + return Math.max(d.height, shapeSize[i].height); + }); + var y = shape == "circle" || shape == "line" ? shapeSize[0].height / 2 : 0; + cellTrans = function cellTrans(d, i) { + var height = sum(cellSize.slice(0, i)); - return "translate(0, " + (y + height + i * shapePadding) + ")"; - }; + return "translate(0, " + (y + height + i * shapePadding) + ")"; + }; - textTrans = function textTrans(d, i) { - return "translate( " + (maxW + labelOffset) + ",\n " + (shapeSize[i].y + shapeSize[i].height / 2 + 5) + ")"; - }; - })(); + textTrans = function textTrans(d, i) { + return "translate( " + (maxW + labelOffset) + ",\n " + (shapeSize[i].y + shapeSize[i].height / 2 + 5) + ")"; + }; } else if (orient === "horizontal") { - (function () { - cellTrans = function cellTrans(d, i) { - var width = sum(shapeSize.slice(0, i), function (d) { - return d.width; - }); - var y = shape == "circle" || shape == "line" ? maxH / 2 : 0; - return "translate(" + (width + i * shapePadding) + ", " + y + ")"; - }; - - var offset = shape == "line" ? maxH / 2 : maxH; - textTrans = function textTrans(d, i) { - return "translate( " + (shapeSize[i].width * textAlign + shapeSize[i].x) + ",\n " + (offset + labelOffset) + ")"; - }; - })(); + cellTrans = function cellTrans(d, i) { + var width = sum(shapeSize.slice(0, i), function (d) { + return d.width; + }); + var y = shape == "circle" || shape == "line" ? maxH / 2 : 0; + return "translate(" + (width + i * shapePadding) + ", " + y + ")"; + }; + + var offset = shape == "line" ? maxH / 2 : maxH; + textTrans = function textTrans(d, i) { + return "translate( " + (shapeSize[i].width * textAlign + shapeSize[i].x) + ",\n " + (offset + labelOffset) + ")"; + }; } helper.d3_placement(orient, cell, cellTrans, text, textTrans, labelAlign); @@ -804,7 +798,7 @@ function symbol() { var cellEnter = cell.enter().append("g").attr("class", classPrefix + "cell"); cellEnter.append(shape).attr("class", classPrefix + "swatch"); - var shapes = svg.selectAll("g." + classPrefix + "cell " + shape); + var shapes = svg.selectAll("g." + classPrefix + "cell " + shape + "." + classPrefix + "swatch"); //add event handlers helper.d3_addEvents(cellEnter, legendDispatcher); @@ -842,19 +836,17 @@ function symbol() { //positions cells and text if (orient === "vertical") { - (function () { - var cellSize = textSize.map(function (d, i) { - return Math.max(maxH, d.height); - }); + var cellSize = textSize.map(function (d, i) { + return Math.max(maxH, d.height); + }); - cellTrans = function cellTrans(d, i) { - var height = sum(cellSize.slice(0, i)); - return "translate(0, " + (height + i * shapePadding) + " )"; - }; - textTrans = function textTrans(d, i) { - return "translate( " + (maxW + labelOffset) + ",\n " + (shapeSize[i].y + shapeSize[i].height / 2 + 5) + ")"; - }; - })(); + cellTrans = function cellTrans(d, i) { + var height = sum(cellSize.slice(0, i)); + return "translate(0, " + (height + i * shapePadding) + " )"; + }; + textTrans = function textTrans(d, i) { + return "translate( " + (maxW + labelOffset) + ",\n " + (shapeSize[i].y + shapeSize[i].height / 2 + 5) + ")"; + }; } else if (orient === "horizontal") { cellTrans = function cellTrans(d, i) { return "translate( " + i * (maxW + shapePadding) + ",0)"; @@ -1005,5 +997,6 @@ var index = { legendHelpers: legendHelpers }; -export { color as legendColor, size as legendSize, symbol as legendSymbol, legendHelpers };export default index; +export { color as legendColor, size as legendSize, symbol as legendSymbol, legendHelpers }; +export default index; //# sourceMappingURL=indexRollupNext.js.map diff --git a/indexRollupNext.js.map b/indexRollupNext.js.map index 5bdba59..037f709 100644 --- a/indexRollupNext.js.map +++ b/indexRollupNext.js.map @@ -1 +1 @@ -{"version":3,"file":"indexRollupNext.js","sources":["src/legend.js","src/color.js","src/size.js","src/symbol.js","src/helpers.js","index.js"],"sourcesContent":["import { select } from 'd3-selection'\nimport { format, formatPrefix } from 'd3-format'\n\nconst d3_identity = (d) => d\n\nconst d3_reverse = (arr) => {\n const mirror = [];\n for (let i = 0, l = arr.length; i < l; i++) {\n mirror[i] = arr[l-i-1];\n }\n return mirror;\n}\n\n//Text wrapping code adapted from Mike Bostock\nconst d3_textWrapping = (text, width) => {\n text.each(function() {\n var text = select(this),\n words = text.text().split(/\\s+/).reverse(),\n word,\n line = [],\n lineNumber = 0,\n lineHeight = 1.2, //ems\n y = text.attr(\"y\"),\n dy = parseFloat(text.attr(\"dy\")) || 0,\n tspan = text.text(null)\n .append(\"tspan\")\n .attr(\"x\", 0)\n .attr(\"dy\", dy + \"em\");\n\n while (word = words.pop()) {\n line.push(word);\n tspan.text(line.join(\" \"));\n if (tspan.node().getComputedTextLength() > width && line.length > 1) {\n line.pop();\n tspan.text(line.join(\" \"));\n line = [word];\n tspan = text.append(\"tspan\")\n .attr(\"x\", 0)\n .attr(\"dy\", lineHeight + dy + \"em\").text(word);\n }\n }\n });\n}\n\n\nconst d3_mergeLabels = (gen=[], labels, domain, range) => {\n\n if (typeof labels === \"object\"){\n if(labels.length === 0) return gen;\n\n let i = labels.length;\n for (; i < gen.length; i++) {\n labels.push(gen[i]);\n }\n return labels;\n } else if (typeof labels === \"function\") {\n const customLabels = []\n const genLength = gen.length\n for (let i=0; i < genLength; i++){\n customLabels.push(labels({\n i,\n genLength,\n generatedLabels : gen,\n domain,\n range }))\n }\n return customLabels\n }\n\n return gen;\n }\n\nconst d3_linearLegend = (scale, cells, labelFormat) => {\n let data = [];\n\n if (cells.length > 1){\n data = cells;\n\n } else {\n const domain = scale.domain(),\n increment = (domain[domain.length - 1] - domain[0])/(cells - 1)\n let i = 0;\n\n for (; i < cells; i++){\n data.push(domain[0] + i*increment);\n }\n }\n\n const labels = data.map(labelFormat);\n return {data: data,\n labels: labels,\n feature: d => scale(d)};\n}\n\nconst d3_quantLegend = (scale, labelFormat, labelDelimiter) => {\n const labels = scale.range().map( d => {\n const invert = scale.invertExtent(d);\n return labelFormat(invert[0]) + \" \" + labelDelimiter + \" \" + labelFormat(invert[1]);\n });\n\n return {data: scale.range(),\n labels: labels,\n feature: d3_identity\n };\n}\n\nconst d3_ordinalLegend= scale => ({data: scale.domain(),\n labels: scale.domain(),\n feature: d => scale(d) }\n)\n\nconst d3_cellOver = (cellDispatcher, d, obj) => {\n cellDispatcher.call(\"cellover\", obj, d);\n}\n\nconst d3_cellOut = (cellDispatcher, d, obj) => {\n cellDispatcher.call(\"cellout\", obj, d);\n}\n\nconst d3_cellClick = (cellDispatcher, d, obj) => {\n cellDispatcher.call(\"cellclick\", obj, d);\n}\n\n\nexport default {\n\n d3_drawShapes: (shape, shapes, shapeHeight, shapeWidth, shapeRadius, path) => {\n if (shape === \"rect\"){\n shapes.attr(\"height\", shapeHeight)\n .attr(\"width\", shapeWidth);\n\n } else if (shape === \"circle\") {\n shapes.attr(\"r\", shapeRadius)\n\n } else if (shape === \"line\") {\n shapes.attr(\"x1\", 0).attr(\"x2\", shapeWidth).attr(\"y1\", 0).attr(\"y2\", 0);\n\n } else if (shape === \"path\") {\n shapes.attr(\"d\", path);\n }\n },\n\n d3_addText: function (svg, enter, labels, classPrefix, labelWidth){\n enter.append(\"text\").attr(\"class\", classPrefix + \"label\");\n const text = svg.selectAll(`g.${classPrefix}cell text.${classPrefix}label`)\n .data(labels)\n .text(d3_identity);\n\n if (labelWidth){\n svg.selectAll(`g.${classPrefix}cell text.${classPrefix}label`)\n .call(d3_textWrapping, labelWidth)\n }\n\n return text\n },\n\n d3_calcType: function (scale, ascending, cells, labels, labelFormat, labelDelimiter){\n const type = scale.invertExtent ?\n d3_quantLegend(scale, labelFormat, labelDelimiter) : scale.ticks ?\n d3_linearLegend(scale, cells, labelFormat) : d3_ordinalLegend(scale);\n\n //for d3.scaleSequential that doesn't have a range function\n const range = scale.range && scale.range() || scale.domain()\n type.labels = d3_mergeLabels(type.labels, labels, scale.domain(), range);\n\n if (ascending) {\n type.labels = d3_reverse(type.labels);\n type.data = d3_reverse(type.data);\n }\n\n return type;\n },\n\n d3_filterCells: (type, cellFilter) => {\n let filterCells = type.data.map((d, i) => ({ data: d, label: type.labels[i] }))\n .filter(cellFilter)\n const dataValues = filterCells.map(d => d.data)\n const labelValues = filterCells.map(d => d.label)\n type.data = type.data.filter(d => dataValues.indexOf(d) !== -1)\n type.labels = type.labels.filter(d => labelValues.indexOf(d) !== -1)\n return type\n },\n\n d3_placement: (orient, cell, cellTrans, text, textTrans, labelAlign) => {\n cell.attr(\"transform\", cellTrans);\n text.attr(\"transform\", textTrans);\n if (orient === \"horizontal\"){\n text.style(\"text-anchor\", labelAlign);\n }\n },\n\n d3_addEvents: function(cells, dispatcher){\n cells.on(\"mouseover.legend\", function (d) { d3_cellOver(dispatcher, d, this); })\n .on(\"mouseout.legend\", function (d) { d3_cellOut(dispatcher, d, this); })\n .on(\"click.legend\", function (d) { d3_cellClick(dispatcher, d, this); });\n },\n\n d3_title: (svg, title, classPrefix, titleWidth) => {\n if (title !== \"\"){\n\n const titleText = svg.selectAll('text.' + classPrefix + 'legendTitle');\n\n titleText.data([title])\n .enter()\n .append('text')\n .attr('class', classPrefix + 'legendTitle');\n\n svg.selectAll('text.' + classPrefix + 'legendTitle')\n .text(title)\n\n if (titleWidth){\n svg.selectAll('text.' + classPrefix + 'legendTitle')\n .call(d3_textWrapping, titleWidth)\n }\n\n const cellsSvg = svg.select('.' + classPrefix + 'legendCells')\n const yOffset = svg.select('.' + classPrefix + 'legendTitle').nodes()\n .map(d => d.getBBox().height)[0],\n\n xOffset = -cellsSvg.nodes().map(function(d) { return d.getBBox().x})[0];\n cellsSvg.attr('transform', 'translate(' + xOffset + ',' + (yOffset) + ')');\n\n }\n },\n\n d3_defaultLocale: {\n format,\n formatPrefix\n },\n\n d3_defaultFormatSpecifier: '.01f',\n\n d3_defaultDelimiter: 'to'\n}\n","import helper from './legend';\nimport { dispatch } from 'd3-dispatch';\nimport { scaleLinear } from 'd3-scale';\nimport { formatLocale, formatSpecifier } from 'd3-format';\n\nimport { sum } from 'd3-array';\n\nexport default function color(){\n\n let scale = scaleLinear(),\n shape = \"rect\",\n shapeWidth = 15,\n shapeHeight = 15,\n shapeRadius = 10,\n shapePadding = 2,\n cells = [5],\n cellFilter,\n labels = [],\n classPrefix = \"\",\n useClass = false,\n title = \"\",\n locale = helper.d3_defaultLocale,\n specifier = helper.d3_defaultFormatSpecifier,\n labelOffset = 10,\n labelAlign = \"middle\",\n labelDelimiter = helper.d3_defaultDelimiter,\n labelWrap,\n orient = \"vertical\",\n ascending = false,\n path,\n titleWidth,\n legendDispatcher = dispatch(\"cellover\", \"cellout\", \"cellclick\");\n\n function legend(svg) {\n\n const type = helper.d3_calcType(scale, ascending, cells, labels, locale.format(specifier), labelDelimiter),\n legendG = svg.selectAll('g').data([scale]);\n\n legendG.enter().append('g').attr('class', classPrefix + 'legendCells');\n\n if (cellFilter){\n helper.d3_filterCells(type, cellFilter)\n }\n\n let cell = svg.select('.' + classPrefix + 'legendCells')\n .selectAll(\".\" + classPrefix + \"cell\").data(type.data)\n\n const cellEnter = cell.enter().append(\"g\")\n .attr(\"class\", classPrefix + \"cell\")\n cellEnter.append(shape).attr(\"class\", classPrefix + \"swatch\")\n\n let shapes = svg.selectAll(\"g.\" + classPrefix + \"cell \" + shape).data(type.data);\n\n //add event handlers\n helper.d3_addEvents(cellEnter, legendDispatcher);\n\n cell.exit().transition().style(\"opacity\", 0).remove();\n shapes.exit().transition().style(\"opacity\", 0).remove();\n\n shapes = shapes.merge(shapes);\n\n helper.d3_drawShapes(shape, shapes, shapeHeight, shapeWidth, shapeRadius, path);\n helper.d3_addText( svg, cellEnter, type.labels, classPrefix, labelWrap)\n\n // we need to merge the selection, otherwise changes in the legend (e.g. change of orientation) are applied only to the new cells and not the existing ones.\n cell = cellEnter.merge(cell);\n\n // sets placement\n const text = cell.selectAll(\"text\"),\n textSize = text.nodes().map(d => d.getBBox()),\n shapeSize = shapes.nodes().map( d => d.getBBox());\n //sets scale\n //everything is fill except for line which is stroke,\n if (!useClass){\n if (shape == \"line\"){\n shapes.style(\"stroke\", type.feature);\n } else {\n shapes.style(\"fill\", type.feature);\n }\n } else {\n shapes.attr(\"class\", d => `${classPrefix}swatch ${type.feature(d)}`);\n }\n\n let cellTrans,\n textTrans,\n textAlign = (labelAlign == \"start\") ? 0 : (labelAlign == \"middle\") ? 0.5 : 1;\n\n //positions cells and text\n if (orient === \"vertical\"){\n const cellSize = textSize.map((d, i) => Math.max(d.height, shapeSize[i].height))\n\n cellTrans = (d, i) => {\n const height = sum(cellSize.slice(0, i));\n return `translate(0, ${height + i*shapePadding})`}\n\n textTrans = (d,i) => `translate( ${(shapeSize[i].width + shapeSize[i].x +\n labelOffset)}, ${(shapeSize[i].y + shapeSize[i].height/2 + 5)})`;\n\n } else if (orient === \"horizontal\"){\n cellTrans = (d,i) => `translate(${(i * (shapeSize[i].width + shapePadding))},0)`\n textTrans = (d,i) => `translate(${(shapeSize[i].width*textAlign + shapeSize[i].x)},\n ${(shapeSize[i].height + shapeSize[i].y + labelOffset + 8)})`;\n }\n\n helper.d3_placement(orient, cell, cellTrans, text, textTrans, labelAlign);\n helper.d3_title(svg, title, classPrefix, titleWidth);\n\n cell.transition().style(\"opacity\", 1);\n\n }\n\n legend.scale = function(_) {\n if (!arguments.length) return scale;\n scale = _;\n return legend;\n };\n\n legend.cells = function(_) {\n if (!arguments.length) return cells;\n if (_.length > 1 || _ >= 2 ){\n cells = _;\n }\n return legend;\n };\n\n legend.cellFilter = function(_) {\n if (!arguments.length) return cellFilter;\n cellFilter = _;\n return legend;\n };\n\n legend.shape = function(_, d) {\n if (!arguments.length) return shape;\n if (_ == \"rect\" || _ == \"circle\" || _ == \"line\" || (_ == \"path\" && (typeof d === 'string')) ){\n shape = _;\n path = d;\n }\n return legend;\n };\n\n legend.shapeWidth = function(_) {\n if (!arguments.length) return shapeWidth;\n shapeWidth = +_;\n return legend;\n };\n\n legend.shapeHeight = function(_) {\n if (!arguments.length) return shapeHeight;\n shapeHeight = +_;\n return legend;\n };\n\n legend.shapeRadius = function(_) {\n if (!arguments.length) return shapeRadius;\n shapeRadius = +_;\n return legend;\n };\n\n legend.shapePadding = function(_) {\n if (!arguments.length) return shapePadding;\n shapePadding = +_;\n return legend;\n };\n\n legend.labels = function(_) {\n if (!arguments.length) return labels;\n labels = _;\n return legend;\n };\n\n legend.labelAlign = function(_) {\n if (!arguments.length) return labelAlign;\n if (_ == \"start\" || _ == \"end\" || _ == \"middle\") {\n labelAlign = _;\n }\n return legend;\n };\n\n legend.locale = function(_) {\n if (!arguments.length) return locale;\n locale = formatLocale(_)\n return legend\n };\n\n legend.labelFormat = function(_) {\n if (!arguments.length) return legend.locale().format(specifier);\n specifier = formatSpecifier(_)\n return legend;\n };\n\n legend.labelOffset = function(_) {\n if (!arguments.length) return labelOffset;\n labelOffset = +_;\n return legend;\n };\n\n legend.labelDelimiter = function(_) {\n if (!arguments.length) return labelDelimiter;\n labelDelimiter = _;\n return legend;\n };\n\n legend.labelWrap = function(_) {\n if (!arguments.length) return labelWrap;\n labelWrap = _;\n return legend;\n };\n\n legend.useClass = function(_) {\n if (!arguments.length) return useClass;\n if (_ === true || _ === false){\n useClass = _;\n }\n return legend;\n };\n\n legend.orient = function(_){\n if (!arguments.length) return orient;\n _ = _.toLowerCase();\n if (_ == \"horizontal\" || _ == \"vertical\") {\n orient = _;\n }\n return legend;\n };\n\n legend.ascending = function(_) {\n if (!arguments.length) return ascending;\n ascending = !!_;\n return legend;\n };\n\n legend.classPrefix = function(_) {\n if (!arguments.length) return classPrefix;\n classPrefix = _;\n return legend;\n };\n\n legend.title = function(_) {\n if (!arguments.length) return title;\n title = _;\n return legend;\n };\n\n legend.titleWidth = function(_) {\n if (!arguments.length) return titleWidth;\n titleWidth = _;\n return legend;\n };\n\n legend.textWrap = function(_) {\n if (!arguments.length) return textWrap;\n textWrap = _;\n return legend;\n }\n\n legend.on = function(){\n const value = legendDispatcher.on.apply(legendDispatcher, arguments)\n return value === legendDispatcher ? legend : value;\n }\n\n return legend;\n\n};\n","import helper from \"./legend\"\nimport { dispatch } from \"d3-dispatch\"\nimport { scaleLinear } from \"d3-scale\"\nimport { formatLocale, formatSpecifier } from \"d3-format\"\nimport { sum, max } from \"d3-array\"\n\nexport default function size() {\n let scale = scaleLinear(),\n shape = \"rect\",\n shapeWidth = 15,\n shapePadding = 2,\n cells = [5],\n cellFilter,\n labels = [],\n classPrefix = \"\",\n title = \"\",\n locale = helper.d3_defaultLocale,\n specifier = helper.d3_defaultFormatSpecifier,\n labelOffset = 10,\n labelAlign = \"middle\",\n labelDelimiter = helper.d3_defaultDelimiter,\n labelWrap,\n orient = \"vertical\",\n ascending = false,\n path,\n titleWidth,\n legendDispatcher = dispatch(\"cellover\", \"cellout\", \"cellclick\")\n\n function legend(svg) {\n const type = helper.d3_calcType(\n scale,\n ascending,\n cells,\n labels,\n locale.format(specifier),\n labelDelimiter\n ),\n legendG = svg.selectAll(\"g\").data([scale])\n\n if (cellFilter) {\n helper.d3_filterCells(type, cellFilter)\n }\n\n legendG\n .enter()\n .append(\"g\")\n .attr(\"class\", classPrefix + \"legendCells\")\n\n let cell = svg\n .select(\".\" + classPrefix + \"legendCells\")\n .selectAll(\".\" + classPrefix + \"cell\")\n .data(type.data)\n const cellEnter = cell\n .enter()\n .append(\"g\")\n .attr(\"class\", classPrefix + \"cell\")\n cellEnter.append(shape).attr(\"class\", classPrefix + \"swatch\")\n\n let shapes = svg.selectAll(\"g.\" + classPrefix + \"cell \" + shape)\n\n //add event handlers\n helper.d3_addEvents(cellEnter, legendDispatcher)\n\n cell\n .exit()\n .transition()\n .style(\"opacity\", 0)\n .remove()\n\n shapes\n .exit()\n .transition()\n .style(\"opacity\", 0)\n .remove()\n shapes = shapes.merge(shapes)\n\n //creates shape\n if (shape === \"line\") {\n helper.d3_drawShapes(shape, shapes, 0, shapeWidth)\n shapes.attr(\"stroke-width\", type.feature)\n } else {\n helper.d3_drawShapes(\n shape,\n shapes,\n type.feature,\n type.feature,\n type.feature,\n path\n )\n }\n\n const text = helper.d3_addText(\n svg,\n cellEnter,\n type.labels,\n classPrefix,\n labelWrap\n )\n\n // we need to merge the selection, otherwise changes in the legend (e.g. change of orientation) are applied only to the new cells and not the existing ones.\n cell = cellEnter.merge(cell)\n\n //sets placement\n\n const textSize = text.nodes().map(d => d.getBBox()),\n shapeSize = shapes.nodes().map((d, i) => {\n const bbox = d.getBBox()\n const stroke = scale(type.data[i])\n\n if (shape === \"line\" && orient === \"horizontal\") {\n bbox.height = bbox.height + stroke\n } else if (shape === \"line\" && orient === \"vertical\") {\n bbox.width = bbox.width\n }\n return bbox\n })\n //console.log('SHAPESIZE')\n const maxH = max(shapeSize, d => d.height + d.y),\n maxW = max(shapeSize, d => d.width + d.x)\n\n let cellTrans,\n textTrans,\n textAlign = labelAlign == \"start\" ? 0 : labelAlign == \"middle\" ? 0.5 : 1\n\n //positions cells and text\n if (orient === \"vertical\") {\n const cellSize = textSize.map((d, i) =>\n Math.max(d.height, shapeSize[i].height)\n )\n const y =\n shape == \"circle\" || shape == \"line\" ? shapeSize[0].height / 2 : 0\n cellTrans = (d, i) => {\n const height = sum(cellSize.slice(0, i))\n\n return `translate(0, ${y + height + i * shapePadding})`\n }\n\n textTrans = (d, i) => `translate( ${maxW + labelOffset},\n ${shapeSize[i].y + shapeSize[i].height / 2 + 5})`\n } else if (orient === \"horizontal\") {\n cellTrans = (d, i) => {\n const width = sum(shapeSize.slice(0, i), d => d.width)\n const y = shape == \"circle\" || shape == \"line\" ? maxH / 2 : 0\n return `translate(${width + i * shapePadding}, ${y})`\n }\n\n const offset = shape == \"line\" ? maxH / 2 : maxH\n textTrans = (d, i) => {\n return `translate( ${shapeSize[i].width * textAlign + shapeSize[i].x},\n ${offset + labelOffset})`\n }\n }\n\n helper.d3_placement(orient, cell, cellTrans, text, textTrans, labelAlign)\n helper.d3_title(svg, title, classPrefix, titleWidth)\n\n cell.transition().style(\"opacity\", 1)\n }\n\n legend.scale = function(_) {\n if (!arguments.length) return scale\n scale = _\n return legend\n }\n\n legend.cells = function(_) {\n if (!arguments.length) return cells\n if (_.length > 1 || _ >= 2) {\n cells = _\n }\n return legend\n }\n\n legend.cellFilter = function(_) {\n if (!arguments.length) return cellFilter\n cellFilter = _\n return legend\n }\n\n legend.shape = function(_, d) {\n if (!arguments.length) return shape\n if (_ == \"rect\" || _ == \"circle\" || _ == \"line\") {\n shape = _\n path = d\n }\n return legend\n }\n\n legend.shapeWidth = function(_) {\n if (!arguments.length) return shapeWidth\n shapeWidth = +_\n return legend\n }\n\n legend.shapePadding = function(_) {\n if (!arguments.length) return shapePadding\n shapePadding = +_\n return legend\n }\n\n legend.labels = function(_) {\n if (!arguments.length) return labels\n labels = _\n return legend\n }\n\n legend.labelAlign = function(_) {\n if (!arguments.length) return labelAlign\n if (_ == \"start\" || _ == \"end\" || _ == \"middle\") {\n labelAlign = _\n }\n return legend\n }\n\n legend.locale = function(_) {\n if (!arguments.length) return locale\n locale = formatLocale(_)\n return legend\n }\n\n legend.labelFormat = function(_) {\n if (!arguments.length) return legend.locale().format(specifier)\n specifier = formatSpecifier(_)\n return legend\n }\n\n legend.labelOffset = function(_) {\n if (!arguments.length) return labelOffset\n labelOffset = +_\n return legend\n }\n\n legend.labelDelimiter = function(_) {\n if (!arguments.length) return labelDelimiter\n labelDelimiter = _\n return legend\n }\n\n legend.labelWrap = function(_) {\n if (!arguments.length) return labelWrap\n labelWrap = _\n return legend\n }\n\n legend.orient = function(_) {\n if (!arguments.length) return orient\n _ = _.toLowerCase()\n if (_ == \"horizontal\" || _ == \"vertical\") {\n orient = _\n }\n return legend\n }\n\n legend.ascending = function(_) {\n if (!arguments.length) return ascending\n ascending = !!_\n return legend\n }\n\n legend.classPrefix = function(_) {\n if (!arguments.length) return classPrefix\n classPrefix = _\n return legend\n }\n\n legend.title = function(_) {\n if (!arguments.length) return title\n title = _\n return legend\n }\n\n legend.titleWidth = function(_) {\n if (!arguments.length) return titleWidth\n titleWidth = _\n return legend\n }\n\n legend.on = function() {\n const value = legendDispatcher.on.apply(legendDispatcher, arguments)\n return value === legendDispatcher ? legend : value\n }\n\n return legend\n}\n","import helper from \"./legend\"\nimport { dispatch } from \"d3-dispatch\"\nimport { scaleLinear } from \"d3-scale\"\nimport { formatLocale, formatSpecifier } from \"d3-format\"\nimport { sum, max } from \"d3-array\"\n\nexport default function symbol() {\n let scale = scaleLinear(),\n shape = \"path\",\n shapeWidth = 15,\n shapeHeight = 15,\n shapeRadius = 10,\n shapePadding = 5,\n cells = [5],\n cellFilter,\n labels = [],\n classPrefix = \"\",\n title = \"\",\n locale = helper.d3_defaultLocale,\n specifier = helper.d3_defaultFormatSpecifier,\n labelAlign = \"middle\",\n labelOffset = 10,\n labelDelimiter = helper.d3_defaultDelimiter,\n labelWrap,\n orient = \"vertical\",\n ascending = false,\n titleWidth,\n legendDispatcher = dispatch(\"cellover\", \"cellout\", \"cellclick\")\n\n function legend(svg) {\n const type = helper.d3_calcType(\n scale,\n ascending,\n cells,\n labels,\n locale.format(specifier),\n labelDelimiter\n ),\n legendG = svg.selectAll(\"g\").data([scale])\n\n if (cellFilter) {\n helper.d3_filterCells(type, cellFilter)\n }\n\n legendG\n .enter()\n .append(\"g\")\n .attr(\"class\", classPrefix + \"legendCells\")\n\n let cell = svg\n .select(\".\" + classPrefix + \"legendCells\")\n .selectAll(\".\" + classPrefix + \"cell\")\n .data(type.data)\n const cellEnter = cell\n .enter()\n .append(\"g\")\n .attr(\"class\", classPrefix + \"cell\")\n cellEnter.append(shape).attr(\"class\", classPrefix + \"swatch\")\n\n let shapes = svg.selectAll(\"g.\" + classPrefix + \"cell \" + shape)\n\n //add event handlers\n helper.d3_addEvents(cellEnter, legendDispatcher)\n\n //remove old shapes\n cell\n .exit()\n .transition()\n .style(\"opacity\", 0)\n .remove()\n shapes\n .exit()\n .transition()\n .style(\"opacity\", 0)\n .remove()\n shapes = shapes.merge(shapes)\n\n helper.d3_drawShapes(\n shape,\n shapes,\n shapeHeight,\n shapeWidth,\n shapeRadius,\n type.feature\n )\n helper.d3_addText(svg, cellEnter, type.labels, classPrefix, labelWrap)\n\n // we need to merge the selection, otherwise changes in the legend (e.g. change of orientation) are applied only to the new cells and not the existing ones.\n cell = cellEnter.merge(cell)\n\n // sets placement\n const text = cell.selectAll(\"text\"),\n textSize = text.nodes().map(d => d.getBBox()),\n shapeSize = shapes.nodes().map(d => d.getBBox())\n\n const maxH = max(shapeSize, d => d.height),\n maxW = max(shapeSize, d => d.width)\n\n let cellTrans,\n textTrans,\n textAlign = labelAlign == \"start\" ? 0 : labelAlign == \"middle\" ? 0.5 : 1\n\n //positions cells and text\n if (orient === \"vertical\") {\n const cellSize = textSize.map((d, i) => Math.max(maxH, d.height))\n\n cellTrans = (d, i) => {\n const height = sum(cellSize.slice(0, i))\n return `translate(0, ${height + i * shapePadding} )`\n }\n textTrans = (d, i) => `translate( ${maxW + labelOffset},\n ${shapeSize[i].y + shapeSize[i].height / 2 + 5})`\n } else if (orient === \"horizontal\") {\n cellTrans = (d, i) => `translate( ${i * (maxW + shapePadding)},0)`\n textTrans = (d, i) => `translate( ${shapeSize[i].width * textAlign +\n shapeSize[i].x},\n ${maxH + labelOffset})`\n }\n\n helper.d3_placement(orient, cell, cellTrans, text, textTrans, labelAlign)\n helper.d3_title(svg, title, classPrefix, titleWidth)\n cell.transition().style(\"opacity\", 1)\n }\n\n legend.scale = function(_) {\n if (!arguments.length) return scale\n scale = _\n return legend\n }\n\n legend.cells = function(_) {\n if (!arguments.length) return cells\n if (_.length > 1 || _ >= 2) {\n cells = _\n }\n return legend\n }\n\n legend.cellFilter = function(_) {\n if (!arguments.length) return cellFilter\n cellFilter = _\n return legend\n }\n\n legend.shapePadding = function(_) {\n if (!arguments.length) return shapePadding\n shapePadding = +_\n return legend\n }\n\n legend.labels = function(_) {\n if (!arguments.length) return labels\n labels = _\n return legend\n }\n\n legend.labelAlign = function(_) {\n if (!arguments.length) return labelAlign\n if (_ == \"start\" || _ == \"end\" || _ == \"middle\") {\n labelAlign = _\n }\n return legend\n }\n\n legend.locale = function(_) {\n if (!arguments.length) return locale\n locale = formatLocale(_)\n return legend\n }\n\n legend.labelFormat = function(_) {\n if (!arguments.length) return legend.locale().format(specifier)\n specifier = formatSpecifier(_)\n return legend\n }\n\n legend.labelOffset = function(_) {\n if (!arguments.length) return labelOffset\n labelOffset = +_\n return legend\n }\n\n legend.labelDelimiter = function(_) {\n if (!arguments.length) return labelDelimiter\n labelDelimiter = _\n return legend\n }\n\n legend.labelWrap = function(_) {\n if (!arguments.length) return labelWrap\n labelWrap = _\n return legend\n }\n\n legend.orient = function(_) {\n if (!arguments.length) return orient\n _ = _.toLowerCase()\n if (_ == \"horizontal\" || _ == \"vertical\") {\n orient = _\n }\n return legend\n }\n\n legend.ascending = function(_) {\n if (!arguments.length) return ascending\n ascending = !!_\n return legend\n }\n\n legend.classPrefix = function(_) {\n if (!arguments.length) return classPrefix\n classPrefix = _\n return legend\n }\n\n legend.title = function(_) {\n if (!arguments.length) return title\n title = _\n return legend\n }\n\n legend.titleWidth = function(_) {\n if (!arguments.length) return titleWidth\n titleWidth = _\n return legend\n }\n\n legend.on = function() {\n const value = legendDispatcher.on.apply(legendDispatcher, arguments)\n return value === legendDispatcher ? legend : value\n }\n\n return legend\n}\n","export const thresholdLabels = function({ i, genLength, generatedLabels }){\n\n if (i === 0 ){\n return generatedLabels[i].replace('NaN to', 'Less than')\n } else if (i === genLength - 1) {\n return `More than ${generatedLabels[genLength - 1].replace(' to NaN', '')}`\n }\n return generatedLabels[i]\n}\n\nexport default {\n thresholdLabels\n}\n","import legendColor from './src/color'\nimport legendSize from './src/size'\nimport legendSymbol from './src/symbol'\nimport legendHelpers from './src/helpers'\n\nexport { legendColor, legendSize, legendSymbol, legendHelpers }\n\nexport default {\n legendColor,\n legendSize,\n legendSymbol,\n legendHelpers\n};\n"],"names":["d3_identity","d","d3_reverse","arr","mirror","i","l","length","d3_textWrapping","text","width","each","select","words","split","reverse","word","line","lineNumber","lineHeight","attr","dy","parseFloat","tspan","append","pop","push","join","node","getComputedTextLength","d3_mergeLabels","gen","labels","domain","range","customLabels","genLength","d3_linearLegend","scale","cells","labelFormat","data","increment","map","d3_quantLegend","labelDelimiter","invert","invertExtent","d3_ordinalLegend","d3_cellOver","cellDispatcher","obj","call","d3_cellOut","d3_cellClick","shape","shapes","shapeHeight","shapeWidth","shapeRadius","path","svg","enter","classPrefix","labelWidth","selectAll","ascending","type","ticks","cellFilter","filterCells","label","filter","dataValues","labelValues","indexOf","orient","cell","cellTrans","textTrans","labelAlign","style","dispatcher","on","title","titleWidth","titleText","cellsSvg","yOffset","nodes","getBBox","height","xOffset","x","color","scaleLinear","shapePadding","useClass","locale","helper","d3_defaultLocale","specifier","d3_defaultFormatSpecifier","labelOffset","d3_defaultDelimiter","labelWrap","legendDispatcher","dispatch","legend","d3_calcType","format","legendG","d3_filterCells","cellEnter","d3_addEvents","exit","transition","remove","merge","d3_drawShapes","d3_addText","textSize","shapeSize","feature","textAlign","cellSize","Math","max","sum","slice","y","d3_placement","d3_title","_","arguments","formatLocale","formatSpecifier","toLowerCase","textWrap","value","apply","size","bbox","stroke","maxH","maxW","offset","symbol","thresholdLabels","generatedLabels","replace"],"mappings":";;;;;;;;;;;;AAGA,IAAMA,cAAe,SAAfA,WAAe,CAACC,CAAD;SAAOA,CAAP;CAArB;;AAEA,IAAMC,aAAa,SAAbA,UAAa,CAACC,GAAD,EAAS;MACpBC,SAAS,EAAf;OACK,IAAIC,IAAI,CAAR,EAAWC,IAAIH,IAAII,MAAxB,EAAgCF,IAAIC,CAApC,EAAuCD,GAAvC,EAA4C;WACnCA,CAAP,IAAYF,IAAIG,IAAED,CAAF,GAAI,CAAR,CAAZ;;SAEKD,MAAP;CALF;;;AASA,IAAMI,kBAAkB,SAAlBA,eAAkB,CAACC,IAAD,EAAOC,KAAP,EAAiB;OAClCC,IAAL,CAAU,YAAW;QACfF,OAAOG,OAAO,IAAP,CAAX;QACIC,QAAQJ,KAAKA,IAAL,GAAYK,KAAZ,CAAkB,KAAlB,EAAyBC,OAAzB,EADZ;QAEIC,IAFJ;QAGIC,OAAO,EAHX;QAIIC,aAAa,CAJjB;QAKIC,aAAa,GALjB;;QAMQV,KAAKW,IAAL,CAAU,GAAV,CANR;QAOIC,KAAKC,WAAWb,KAAKW,IAAL,CAAU,IAAV,CAAX,KAA+B,CAPxC;QAQIG,QAAQd,KAAKA,IAAL,CAAU,IAAV,EACLe,MADK,CACE,OADF,EAELJ,IAFK,CAEA,GAFA,EAEK,CAFL,EAGLA,IAHK,CAGA,IAHA,EAGMC,KAAK,IAHX,CARZ;;WAaOL,OAAOH,MAAMY,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ACfwD,QAAQjC,iBAAiBvB,EAAjB,CAAoByD,KAApB,CAA0BlC,gBAA1B,EAA4C4B,SAA5C,CAAd;WACOK,UAAUjC,gBAAV,GAA6BE,MAA7B,GAAsC+B,KAA7C;GAFF;;SAKO/B,MAAP;;;ACxOK,IAAMwC,kBAAkB,SAAlBA,eAAkB,OAA2C;MAAhC/I,CAAgC,QAAhCA,CAAgC;MAA7B+B,SAA6B,QAA7BA,SAA6B;MAAlBiH,eAAkB,QAAlBA,eAAkB;;;MAEpEhJ,MAAM,CAAV,EAAa;WACJgJ,gBAAgBhJ,CAAhB,EAAmBiJ,OAAnB,CAA2B,QAA3B,EAAqC,WAArC,CAAP;GADF,MAEO,IAAIjJ,MAAM+B,YAAY,CAAtB,EAAyB;0BACViH,gBAAgBjH,YAAY,CAA5B,EAA+BkH,OAA/B,CAAuC,SAAvC,EAAkD,EAAlD,CAApB;;SAEKD,gBAAgBhJ,CAAhB,CAAP;CAPK;;AAUP,oBAAe;;CAAf;;ACHA,YAAe;oBAAA;kBAAA;sBAAA;;CAAf;;"} \ No newline at end of file +{"version":3,"file":"indexRollupNext.js","sources":["src/legend.js","src/color.js","src/size.js","src/symbol.js","src/helpers.js","index.js"],"sourcesContent":["import { select } from 'd3-selection'\nimport { format, formatPrefix } from 'd3-format'\n\nconst d3_identity = (d) => d\n\nconst d3_reverse = (arr) => {\n const mirror = [];\n for (let i = 0, l = arr.length; i < l; i++) {\n mirror[i] = arr[l-i-1];\n }\n return mirror;\n}\n\n//Text wrapping code adapted from Mike Bostock\nconst d3_textWrapping = (text, width) => {\n text.each(function() {\n var text = select(this),\n words = text.text().split(/\\s+/).reverse(),\n word,\n line = [],\n lineNumber = 0,\n lineHeight = 1.2, //ems\n y = text.attr(\"y\"),\n dy = parseFloat(text.attr(\"dy\")) || 0,\n tspan = text.text(null)\n .append(\"tspan\")\n .attr(\"x\", 0)\n .attr(\"dy\", dy + \"em\");\n\n while (word = words.pop()) {\n line.push(word);\n tspan.text(line.join(\" \"));\n if (tspan.node().getComputedTextLength() > width && line.length > 1) {\n line.pop();\n tspan.text(line.join(\" \"));\n line = [word];\n tspan = text.append(\"tspan\")\n .attr(\"x\", 0)\n .attr(\"dy\", lineHeight + dy + \"em\").text(word);\n }\n }\n });\n}\n\n\nconst d3_mergeLabels = (gen=[], labels, domain, range) => {\n\n if (typeof labels === \"object\"){\n if(labels.length === 0) return gen;\n\n let i = labels.length;\n for (; i < gen.length; i++) {\n labels.push(gen[i]);\n }\n return labels;\n } else if (typeof labels === \"function\") {\n const customLabels = []\n const genLength = gen.length\n for (let i=0; i < genLength; i++){\n customLabels.push(labels({\n i,\n genLength,\n generatedLabels : gen,\n domain,\n range }))\n }\n return customLabels\n }\n\n return gen;\n }\n\nconst d3_linearLegend = (scale, cells, labelFormat) => {\n let data = [];\n\n if (cells.length > 1){\n data = cells;\n\n } else {\n const domain = scale.domain(),\n increment = (domain[domain.length - 1] - domain[0])/(cells - 1)\n let i = 0;\n\n for (; i < cells; i++){\n data.push(domain[0] + i*increment);\n }\n }\n\n const labels = data.map(labelFormat);\n return {data: data,\n labels: labels,\n feature: d => scale(d)};\n}\n\nconst d3_quantLegend = (scale, labelFormat, labelDelimiter) => {\n const labels = scale.range().map( d => {\n const invert = scale.invertExtent(d);\n return labelFormat(invert[0]) + \" \" + labelDelimiter + \" \" + labelFormat(invert[1]);\n });\n\n return {data: scale.range(),\n labels: labels,\n feature: d3_identity\n };\n}\n\nconst d3_ordinalLegend= scale => ({data: scale.domain(),\n labels: scale.domain(),\n feature: d => scale(d) }\n)\n\nconst d3_cellOver = (cellDispatcher, d, obj) => {\n cellDispatcher.call(\"cellover\", obj, d);\n}\n\nconst d3_cellOut = (cellDispatcher, d, obj) => {\n cellDispatcher.call(\"cellout\", obj, d);\n}\n\nconst d3_cellClick = (cellDispatcher, d, obj) => {\n cellDispatcher.call(\"cellclick\", obj, d);\n}\n\n\nexport default {\n\n d3_drawShapes: (shape, shapes, shapeHeight, shapeWidth, shapeRadius, path) => {\n if (shape === \"rect\"){\n shapes.attr(\"height\", shapeHeight)\n .attr(\"width\", shapeWidth);\n\n } else if (shape === \"circle\") {\n shapes.attr(\"r\", shapeRadius)\n\n } else if (shape === \"line\") {\n shapes.attr(\"x1\", 0).attr(\"x2\", shapeWidth).attr(\"y1\", 0).attr(\"y2\", 0);\n\n } else if (shape === \"path\") {\n shapes.attr(\"d\", path);\n }\n },\n\n d3_addText: function (svg, enter, labels, classPrefix, labelWidth){\n enter.append(\"text\").attr(\"class\", classPrefix + \"label\");\n const text = svg.selectAll(`g.${classPrefix}cell text.${classPrefix}label`)\n .data(labels)\n .text(d3_identity);\n\n if (labelWidth){\n svg.selectAll(`g.${classPrefix}cell text.${classPrefix}label`)\n .call(d3_textWrapping, labelWidth)\n }\n\n return text\n },\n\n d3_calcType: function (scale, ascending, cells, labels, labelFormat, labelDelimiter){\n const type = scale.invertExtent ?\n d3_quantLegend(scale, labelFormat, labelDelimiter) : scale.ticks ?\n d3_linearLegend(scale, cells, labelFormat) : d3_ordinalLegend(scale);\n\n //for d3.scaleSequential that doesn't have a range function\n const range = scale.range && scale.range() || scale.domain()\n type.labels = d3_mergeLabels(type.labels, labels, scale.domain(), range);\n\n if (ascending) {\n type.labels = d3_reverse(type.labels);\n type.data = d3_reverse(type.data);\n }\n\n return type;\n },\n\n d3_filterCells: (type, cellFilter) => {\n let filterCells = type.data.map((d, i) => ({ data: d, label: type.labels[i] }))\n .filter(cellFilter)\n const dataValues = filterCells.map(d => d.data)\n const labelValues = filterCells.map(d => d.label)\n type.data = type.data.filter(d => dataValues.indexOf(d) !== -1)\n type.labels = type.labels.filter(d => labelValues.indexOf(d) !== -1)\n return type\n },\n\n d3_placement: (orient, cell, cellTrans, text, textTrans, labelAlign) => {\n cell.attr(\"transform\", cellTrans);\n text.attr(\"transform\", textTrans);\n if (orient === \"horizontal\"){\n text.style(\"text-anchor\", labelAlign);\n }\n },\n\n d3_addEvents: function(cells, dispatcher){\n cells.on(\"mouseover.legend\", function (d) { d3_cellOver(dispatcher, d, this); })\n .on(\"mouseout.legend\", function (d) { d3_cellOut(dispatcher, d, this); })\n .on(\"click.legend\", function (d) { d3_cellClick(dispatcher, d, this); });\n },\n\n d3_title: (svg, title, classPrefix, titleWidth) => {\n if (title !== \"\"){\n\n const titleText = svg.selectAll('text.' + classPrefix + 'legendTitle');\n\n titleText.data([title])\n .enter()\n .append('text')\n .attr('class', classPrefix + 'legendTitle');\n\n svg.selectAll('text.' + classPrefix + 'legendTitle')\n .text(title)\n\n if (titleWidth){\n svg.selectAll('text.' + classPrefix + 'legendTitle')\n .call(d3_textWrapping, titleWidth)\n }\n\n const cellsSvg = svg.select('.' + classPrefix + 'legendCells')\n const yOffset = svg.select('.' + classPrefix + 'legendTitle').nodes()\n .map(d => d.getBBox().height)[0],\n\n xOffset = -cellsSvg.nodes().map(function(d) { return d.getBBox().x})[0];\n cellsSvg.attr('transform', 'translate(' + xOffset + ',' + (yOffset) + ')');\n\n }\n },\n\n d3_defaultLocale: {\n format,\n formatPrefix\n },\n\n d3_defaultFormatSpecifier: '.01f',\n\n d3_defaultDelimiter: 'to'\n}\n","import helper from './legend';\nimport { dispatch } from 'd3-dispatch';\nimport { scaleLinear } from 'd3-scale';\nimport { formatLocale, formatSpecifier } from 'd3-format';\n\nimport { sum } from 'd3-array';\n\nexport default function color(){\n\n let scale = scaleLinear(),\n shape = \"rect\",\n shapeWidth = 15,\n shapeHeight = 15,\n shapeRadius = 10,\n shapePadding = 2,\n cells = [5],\n cellFilter,\n labels = [],\n classPrefix = \"\",\n useClass = false,\n title = \"\",\n locale = helper.d3_defaultLocale,\n specifier = helper.d3_defaultFormatSpecifier,\n labelOffset = 10,\n labelAlign = \"middle\",\n labelDelimiter = helper.d3_defaultDelimiter,\n labelWrap,\n orient = \"vertical\",\n ascending = false,\n path,\n titleWidth,\n legendDispatcher = dispatch(\"cellover\", \"cellout\", \"cellclick\");\n\n function legend(svg) {\n\n const type = helper.d3_calcType(scale, ascending, cells, labels, locale.format(specifier), labelDelimiter),\n legendG = svg.selectAll('g').data([scale]);\n\n legendG.enter().append('g').attr('class', classPrefix + 'legendCells');\n\n if (cellFilter){\n helper.d3_filterCells(type, cellFilter)\n }\n\n let cell = svg.select('.' + classPrefix + 'legendCells')\n .selectAll(\".\" + classPrefix + \"cell\").data(type.data)\n\n const cellEnter = cell.enter().append(\"g\")\n .attr(\"class\", classPrefix + \"cell\")\n cellEnter.append(shape).attr(\"class\", classPrefix + \"swatch\")\n\n let shapes = svg.selectAll(\"g.\" + classPrefix + \"cell \" + shape + \".\" + classPrefix + \"swatch\").data(type.data);\n\n //add event handlers\n helper.d3_addEvents(cellEnter, legendDispatcher);\n\n cell.exit().transition().style(\"opacity\", 0).remove();\n shapes.exit().transition().style(\"opacity\", 0).remove();\n\n shapes = shapes.merge(shapes);\n\n helper.d3_drawShapes(shape, shapes, shapeHeight, shapeWidth, shapeRadius, path);\n helper.d3_addText( svg, cellEnter, type.labels, classPrefix, labelWrap)\n\n // we need to merge the selection, otherwise changes in the legend (e.g. change of orientation) are applied only to the new cells and not the existing ones.\n cell = cellEnter.merge(cell);\n\n // sets placement\n const text = cell.selectAll(\"text\"),\n textSize = text.nodes().map(d => d.getBBox()),\n shapeSize = shapes.nodes().map( d => d.getBBox());\n //sets scale\n //everything is fill except for line which is stroke,\n if (!useClass){\n if (shape == \"line\"){\n shapes.style(\"stroke\", type.feature);\n } else {\n shapes.style(\"fill\", type.feature);\n }\n } else {\n shapes.attr(\"class\", d => `${classPrefix}swatch ${type.feature(d)}`);\n }\n\n let cellTrans,\n textTrans,\n textAlign = (labelAlign == \"start\") ? 0 : (labelAlign == \"middle\") ? 0.5 : 1;\n\n //positions cells and text\n if (orient === \"vertical\"){\n const cellSize = textSize.map((d, i) => Math.max(d.height, shapeSize[i].height))\n\n cellTrans = (d, i) => {\n const height = sum(cellSize.slice(0, i));\n return `translate(0, ${height + i*shapePadding})`}\n\n textTrans = (d,i) => `translate( ${(shapeSize[i].width + shapeSize[i].x +\n labelOffset)}, ${(shapeSize[i].y + shapeSize[i].height/2 + 5)})`;\n\n } else if (orient === \"horizontal\"){\n cellTrans = (d,i) => `translate(${(i * (shapeSize[i].width + shapePadding))},0)`\n textTrans = (d,i) => `translate(${(shapeSize[i].width*textAlign + shapeSize[i].x)},\n ${(shapeSize[i].height + shapeSize[i].y + labelOffset + 8)})`;\n }\n\n helper.d3_placement(orient, cell, cellTrans, text, textTrans, labelAlign);\n helper.d3_title(svg, title, classPrefix, titleWidth);\n\n cell.transition().style(\"opacity\", 1);\n\n }\n\n legend.scale = function(_) {\n if (!arguments.length) return scale;\n scale = _;\n return legend;\n };\n\n legend.cells = function(_) {\n if (!arguments.length) return cells;\n if (_.length > 1 || _ >= 2 ){\n cells = _;\n }\n return legend;\n };\n\n legend.cellFilter = function(_) {\n if (!arguments.length) return cellFilter;\n cellFilter = _;\n return legend;\n };\n\n legend.shape = function(_, d) {\n if (!arguments.length) return shape;\n if (_ == \"rect\" || _ == \"circle\" || _ == \"line\" || (_ == \"path\" && (typeof d === 'string')) ){\n shape = _;\n path = d;\n }\n return legend;\n };\n\n legend.shapeWidth = function(_) {\n if (!arguments.length) return shapeWidth;\n shapeWidth = +_;\n return legend;\n };\n\n legend.shapeHeight = function(_) {\n if (!arguments.length) return shapeHeight;\n shapeHeight = +_;\n return legend;\n };\n\n legend.shapeRadius = function(_) {\n if (!arguments.length) return shapeRadius;\n shapeRadius = +_;\n return legend;\n };\n\n legend.shapePadding = function(_) {\n if (!arguments.length) return shapePadding;\n shapePadding = +_;\n return legend;\n };\n\n legend.labels = function(_) {\n if (!arguments.length) return labels;\n labels = _;\n return legend;\n };\n\n legend.labelAlign = function(_) {\n if (!arguments.length) return labelAlign;\n if (_ == \"start\" || _ == \"end\" || _ == \"middle\") {\n labelAlign = _;\n }\n return legend;\n };\n\n legend.locale = function(_) {\n if (!arguments.length) return locale;\n locale = formatLocale(_)\n return legend\n };\n\n legend.labelFormat = function(_) {\n if (!arguments.length) return legend.locale().format(specifier);\n specifier = formatSpecifier(_)\n return legend;\n };\n\n legend.labelOffset = function(_) {\n if (!arguments.length) return labelOffset;\n labelOffset = +_;\n return legend;\n };\n\n legend.labelDelimiter = function(_) {\n if (!arguments.length) return labelDelimiter;\n labelDelimiter = _;\n return legend;\n };\n\n legend.labelWrap = function(_) {\n if (!arguments.length) return labelWrap;\n labelWrap = _;\n return legend;\n };\n\n legend.useClass = function(_) {\n if (!arguments.length) return useClass;\n if (_ === true || _ === false){\n useClass = _;\n }\n return legend;\n };\n\n legend.orient = function(_){\n if (!arguments.length) return orient;\n _ = _.toLowerCase();\n if (_ == \"horizontal\" || _ == \"vertical\") {\n orient = _;\n }\n return legend;\n };\n\n legend.ascending = function(_) {\n if (!arguments.length) return ascending;\n ascending = !!_;\n return legend;\n };\n\n legend.classPrefix = function(_) {\n if (!arguments.length) return classPrefix;\n classPrefix = _;\n return legend;\n };\n\n legend.title = function(_) {\n if (!arguments.length) return title;\n title = _;\n return legend;\n };\n\n legend.titleWidth = function(_) {\n if (!arguments.length) return titleWidth;\n titleWidth = _;\n return legend;\n };\n\n legend.textWrap = function(_) {\n if (!arguments.length) return textWrap;\n textWrap = _;\n return legend;\n }\n\n legend.on = function(){\n const value = legendDispatcher.on.apply(legendDispatcher, arguments)\n return value === legendDispatcher ? legend : value;\n }\n\n return legend;\n\n};\n","import helper from \"./legend\"\nimport { dispatch } from \"d3-dispatch\"\nimport { scaleLinear } from \"d3-scale\"\nimport { formatLocale, formatSpecifier } from \"d3-format\"\nimport { sum, max } from \"d3-array\"\n\nexport default function size() {\n let scale = scaleLinear(),\n shape = \"rect\",\n shapeWidth = 15,\n shapePadding = 2,\n cells = [5],\n cellFilter,\n labels = [],\n classPrefix = \"\",\n title = \"\",\n locale = helper.d3_defaultLocale,\n specifier = helper.d3_defaultFormatSpecifier,\n labelOffset = 10,\n labelAlign = \"middle\",\n labelDelimiter = helper.d3_defaultDelimiter,\n labelWrap,\n orient = \"vertical\",\n ascending = false,\n path,\n titleWidth,\n legendDispatcher = dispatch(\"cellover\", \"cellout\", \"cellclick\")\n\n function legend(svg) {\n const type = helper.d3_calcType(\n scale,\n ascending,\n cells,\n labels,\n locale.format(specifier),\n labelDelimiter\n ),\n legendG = svg.selectAll(\"g\").data([scale])\n\n if (cellFilter) {\n helper.d3_filterCells(type, cellFilter)\n }\n\n legendG\n .enter()\n .append(\"g\")\n .attr(\"class\", classPrefix + \"legendCells\")\n\n let cell = svg\n .select(\".\" + classPrefix + \"legendCells\")\n .selectAll(\".\" + classPrefix + \"cell\")\n .data(type.data)\n const cellEnter = cell\n .enter()\n .append(\"g\")\n .attr(\"class\", classPrefix + \"cell\")\n cellEnter.append(shape).attr(\"class\", classPrefix + \"swatch\")\n\n let shapes = svg.selectAll(\"g.\" + classPrefix + \"cell \" + shape + \".\" + classPrefix + \"swatch\")\n\n //add event handlers\n helper.d3_addEvents(cellEnter, legendDispatcher)\n\n cell\n .exit()\n .transition()\n .style(\"opacity\", 0)\n .remove()\n\n shapes\n .exit()\n .transition()\n .style(\"opacity\", 0)\n .remove()\n shapes = shapes.merge(shapes)\n\n //creates shape\n if (shape === \"line\") {\n helper.d3_drawShapes(shape, shapes, 0, shapeWidth)\n shapes.attr(\"stroke-width\", type.feature)\n } else {\n helper.d3_drawShapes(\n shape,\n shapes,\n type.feature,\n type.feature,\n type.feature,\n path\n )\n }\n\n const text = helper.d3_addText(\n svg,\n cellEnter,\n type.labels,\n classPrefix,\n labelWrap\n )\n\n // we need to merge the selection, otherwise changes in the legend (e.g. change of orientation) are applied only to the new cells and not the existing ones.\n cell = cellEnter.merge(cell)\n\n //sets placement\n\n const textSize = text.nodes().map(d => d.getBBox()),\n shapeSize = shapes.nodes().map((d, i) => {\n const bbox = d.getBBox()\n const stroke = scale(type.data[i])\n\n if (shape === \"line\" && orient === \"horizontal\") {\n bbox.height = bbox.height + stroke\n } else if (shape === \"line\" && orient === \"vertical\") {\n bbox.width = bbox.width\n }\n return bbox\n })\n //console.log('SHAPESIZE')\n const maxH = max(shapeSize, d => d.height + d.y),\n maxW = max(shapeSize, d => d.width + d.x)\n\n let cellTrans,\n textTrans,\n textAlign = labelAlign == \"start\" ? 0 : labelAlign == \"middle\" ? 0.5 : 1\n\n //positions cells and text\n if (orient === \"vertical\") {\n const cellSize = textSize.map((d, i) =>\n Math.max(d.height, shapeSize[i].height)\n )\n const y =\n shape == \"circle\" || shape == \"line\" ? shapeSize[0].height / 2 : 0\n cellTrans = (d, i) => {\n const height = sum(cellSize.slice(0, i))\n\n return `translate(0, ${y + height + i * shapePadding})`\n }\n\n textTrans = (d, i) => `translate( ${maxW + labelOffset},\n ${shapeSize[i].y + shapeSize[i].height / 2 + 5})`\n } else if (orient === \"horizontal\") {\n cellTrans = (d, i) => {\n const width = sum(shapeSize.slice(0, i), d => d.width)\n const y = shape == \"circle\" || shape == \"line\" ? maxH / 2 : 0\n return `translate(${width + i * shapePadding}, ${y})`\n }\n\n const offset = shape == \"line\" ? maxH / 2 : maxH\n textTrans = (d, i) => {\n return `translate( ${shapeSize[i].width * textAlign + shapeSize[i].x},\n ${offset + labelOffset})`\n }\n }\n\n helper.d3_placement(orient, cell, cellTrans, text, textTrans, labelAlign)\n helper.d3_title(svg, title, classPrefix, titleWidth)\n\n cell.transition().style(\"opacity\", 1)\n }\n\n legend.scale = function(_) {\n if (!arguments.length) return scale\n scale = _\n return legend\n }\n\n legend.cells = function(_) {\n if (!arguments.length) return cells\n if (_.length > 1 || _ >= 2) {\n cells = _\n }\n return legend\n }\n\n legend.cellFilter = function(_) {\n if (!arguments.length) return cellFilter\n cellFilter = _\n return legend\n }\n\n legend.shape = function(_, d) {\n if (!arguments.length) return shape\n if (_ == \"rect\" || _ == \"circle\" || _ == \"line\") {\n shape = _\n path = d\n }\n return legend\n }\n\n legend.shapeWidth = function(_) {\n if (!arguments.length) return shapeWidth\n shapeWidth = +_\n return legend\n }\n\n legend.shapePadding = function(_) {\n if (!arguments.length) return shapePadding\n shapePadding = +_\n return legend\n }\n\n legend.labels = function(_) {\n if (!arguments.length) return labels\n labels = _\n return legend\n }\n\n legend.labelAlign = function(_) {\n if (!arguments.length) return labelAlign\n if (_ == \"start\" || _ == \"end\" || _ == \"middle\") {\n labelAlign = _\n }\n return legend\n }\n\n legend.locale = function(_) {\n if (!arguments.length) return locale\n locale = formatLocale(_)\n return legend\n }\n\n legend.labelFormat = function(_) {\n if (!arguments.length) return legend.locale().format(specifier)\n specifier = formatSpecifier(_)\n return legend\n }\n\n legend.labelOffset = function(_) {\n if (!arguments.length) return labelOffset\n labelOffset = +_\n return legend\n }\n\n legend.labelDelimiter = function(_) {\n if (!arguments.length) return labelDelimiter\n labelDelimiter = _\n return legend\n }\n\n legend.labelWrap = function(_) {\n if (!arguments.length) return labelWrap\n labelWrap = _\n return legend\n }\n\n legend.orient = function(_) {\n if (!arguments.length) return orient\n _ = _.toLowerCase()\n if (_ == \"horizontal\" || _ == \"vertical\") {\n orient = _\n }\n return legend\n }\n\n legend.ascending = function(_) {\n if (!arguments.length) return ascending\n ascending = !!_\n return legend\n }\n\n legend.classPrefix = function(_) {\n if (!arguments.length) return classPrefix\n classPrefix = _\n return legend\n }\n\n legend.title = function(_) {\n if (!arguments.length) return title\n title = _\n return legend\n }\n\n legend.titleWidth = function(_) {\n if (!arguments.length) return titleWidth\n titleWidth = _\n return legend\n }\n\n legend.on = function() {\n const value = legendDispatcher.on.apply(legendDispatcher, arguments)\n return value === legendDispatcher ? legend : value\n }\n\n return legend\n}\n","import helper from \"./legend\"\nimport { dispatch } from \"d3-dispatch\"\nimport { scaleLinear } from \"d3-scale\"\nimport { formatLocale, formatSpecifier } from \"d3-format\"\nimport { sum, max } from \"d3-array\"\n\nexport default function symbol() {\n let scale = scaleLinear(),\n shape = \"path\",\n shapeWidth = 15,\n shapeHeight = 15,\n shapeRadius = 10,\n shapePadding = 5,\n cells = [5],\n cellFilter,\n labels = [],\n classPrefix = \"\",\n title = \"\",\n locale = helper.d3_defaultLocale,\n specifier = helper.d3_defaultFormatSpecifier,\n labelAlign = \"middle\",\n labelOffset = 10,\n labelDelimiter = helper.d3_defaultDelimiter,\n labelWrap,\n orient = \"vertical\",\n ascending = false,\n titleWidth,\n legendDispatcher = dispatch(\"cellover\", \"cellout\", \"cellclick\")\n\n function legend(svg) {\n const type = helper.d3_calcType(\n scale,\n ascending,\n cells,\n labels,\n locale.format(specifier),\n labelDelimiter\n ),\n legendG = svg.selectAll(\"g\").data([scale])\n\n if (cellFilter) {\n helper.d3_filterCells(type, cellFilter)\n }\n\n legendG\n .enter()\n .append(\"g\")\n .attr(\"class\", classPrefix + \"legendCells\")\n\n let cell = svg\n .select(\".\" + classPrefix + \"legendCells\")\n .selectAll(\".\" + classPrefix + \"cell\")\n .data(type.data)\n const cellEnter = cell\n .enter()\n .append(\"g\")\n .attr(\"class\", classPrefix + \"cell\")\n cellEnter.append(shape).attr(\"class\", classPrefix + \"swatch\")\n\n let shapes = svg.selectAll(\"g.\" + classPrefix + \"cell \" + shape + \".\" + classPrefix + \"swatch\")\n\n //add event handlers\n helper.d3_addEvents(cellEnter, legendDispatcher)\n\n //remove old shapes\n cell\n .exit()\n .transition()\n .style(\"opacity\", 0)\n .remove()\n shapes\n .exit()\n .transition()\n .style(\"opacity\", 0)\n .remove()\n shapes = shapes.merge(shapes)\n\n helper.d3_drawShapes(\n shape,\n shapes,\n shapeHeight,\n shapeWidth,\n shapeRadius,\n type.feature\n )\n helper.d3_addText(svg, cellEnter, type.labels, classPrefix, labelWrap)\n\n // we need to merge the selection, otherwise changes in the legend (e.g. change of orientation) are applied only to the new cells and not the existing ones.\n cell = cellEnter.merge(cell)\n\n // sets placement\n const text = cell.selectAll(\"text\"),\n textSize = text.nodes().map(d => d.getBBox()),\n shapeSize = shapes.nodes().map(d => d.getBBox())\n\n const maxH = max(shapeSize, d => d.height),\n maxW = max(shapeSize, d => d.width)\n\n let cellTrans,\n textTrans,\n textAlign = labelAlign == \"start\" ? 0 : labelAlign == \"middle\" ? 0.5 : 1\n\n //positions cells and text\n if (orient === \"vertical\") {\n const cellSize = textSize.map((d, i) => Math.max(maxH, d.height))\n\n cellTrans = (d, i) => {\n const height = sum(cellSize.slice(0, i))\n return `translate(0, ${height + i * shapePadding} )`\n }\n textTrans = (d, i) => `translate( ${maxW + labelOffset},\n ${shapeSize[i].y + shapeSize[i].height / 2 + 5})`\n } else if (orient === \"horizontal\") {\n cellTrans = (d, i) => `translate( ${i * (maxW + shapePadding)},0)`\n textTrans = (d, i) => `translate( ${shapeSize[i].width * textAlign +\n shapeSize[i].x},\n ${maxH + labelOffset})`\n }\n\n helper.d3_placement(orient, cell, cellTrans, text, textTrans, labelAlign)\n helper.d3_title(svg, title, classPrefix, titleWidth)\n cell.transition().style(\"opacity\", 1)\n }\n\n legend.scale = function(_) {\n if (!arguments.length) return scale\n scale = _\n return legend\n }\n\n legend.cells = function(_) {\n if (!arguments.length) return cells\n if (_.length > 1 || _ >= 2) {\n cells = _\n }\n return legend\n }\n\n legend.cellFilter = function(_) {\n if (!arguments.length) return cellFilter\n cellFilter = _\n return legend\n }\n\n legend.shapePadding = function(_) {\n if (!arguments.length) return shapePadding\n shapePadding = +_\n return legend\n }\n\n legend.labels = function(_) {\n if (!arguments.length) return labels\n labels = _\n return legend\n }\n\n legend.labelAlign = function(_) {\n if (!arguments.length) return labelAlign\n if (_ == \"start\" || _ == \"end\" || _ == \"middle\") {\n labelAlign = _\n }\n return legend\n }\n\n legend.locale = function(_) {\n if (!arguments.length) return locale\n locale = formatLocale(_)\n return legend\n }\n\n legend.labelFormat = function(_) {\n if (!arguments.length) return legend.locale().format(specifier)\n specifier = formatSpecifier(_)\n return legend\n }\n\n legend.labelOffset = function(_) {\n if (!arguments.length) return labelOffset\n labelOffset = +_\n return legend\n }\n\n legend.labelDelimiter = function(_) {\n if (!arguments.length) return labelDelimiter\n labelDelimiter = _\n return legend\n }\n\n legend.labelWrap = function(_) {\n if (!arguments.length) return labelWrap\n labelWrap = _\n return legend\n }\n\n legend.orient = function(_) {\n if (!arguments.length) return orient\n _ = _.toLowerCase()\n if (_ == \"horizontal\" || _ == \"vertical\") {\n orient = _\n }\n return legend\n }\n\n legend.ascending = function(_) {\n if (!arguments.length) return ascending\n ascending = !!_\n return legend\n }\n\n legend.classPrefix = function(_) {\n if (!arguments.length) return classPrefix\n classPrefix = _\n return legend\n }\n\n legend.title = function(_) {\n if (!arguments.length) return title\n title = _\n return legend\n }\n\n legend.titleWidth = function(_) {\n if (!arguments.length) return titleWidth\n titleWidth = _\n return legend\n }\n\n legend.on = function() {\n const value = legendDispatcher.on.apply(legendDispatcher, arguments)\n return value === legendDispatcher ? legend : value\n }\n\n return legend\n}\n","export const thresholdLabels = function({ i, genLength, generatedLabels }){\n\n if (i === 0 ){\n return generatedLabels[i].replace('NaN to', 'Less than')\n } else if (i === genLength - 1) {\n return `More than ${generatedLabels[genLength - 1].replace(' to NaN', '')}`\n }\n return generatedLabels[i]\n}\n\nexport default {\n thresholdLabels\n}\n","import legendColor from './src/color'\nimport legendSize from './src/size'\nimport legendSymbol from './src/symbol'\nimport legendHelpers from './src/helpers'\n\nexport { legendColor, legendSize, legendSymbol, legendHelpers }\n\nexport default {\n legendColor,\n legendSize,\n legendSymbol,\n legendHelpers\n};\n"],"names":["d3_identity","d","d3_reverse","arr","mirror","i","l","length","d3_textWrapping","text","width","each","select","words","split","reverse","word","line","lineNumber","lineHeight","attr","dy","parseFloat","tspan","append","pop","push","join","node","getComputedTextLength","d3_mergeLabels","gen","labels","domain","range","customLabels","genLength","d3_linearLegend","scale","cells","labelFormat","data","increment","map","d3_quantLegend","labelDelimiter","invert","invertExtent","d3_ordinalLegend","d3_cellOver","cellDispatcher","obj","call","d3_cellOut","d3_cellClick","shape","shapes","shapeHeight","shapeWidth","shapeRadius","path","svg","enter","classPrefix","labelWidth","selectAll","ascending","type","ticks","cellFilter","filterCells","label","filter","dataValues","labelValues","indexOf","orient","cell","cellTrans","textTrans","labelAlign","style","dispatcher","on","title","titleWidth","titleText","cellsSvg","yOffset","nodes","getBBox","height","xOffset","x","color","scaleLinear","shapePadding","useClass","locale","helper","d3_defaultLocale","specifier","d3_defaultFormatSpecifier","labelOffset","d3_defaultDelimiter","labelWrap","legendDispatcher","dispatch","legend","d3_calcType","format","legendG","d3_filterCells","cellEnter","d3_addEvents","exit","transition","remove","merge","d3_drawShapes","d3_addText","textSize","shapeSize","feature","textAlign","cellSize","Math","max","sum","slice","y","d3_placement","d3_title","_","arguments","formatLocale","formatSpecifier","toLowerCase","textWrap","value","apply","size","bbox","stroke","maxH","maxW","offset","symbol","thresholdLabels","generatedLabels","replace"],"mappings":";;;;;;;;;;;;AAGA,IAAMA,cAAe,SAAfA,WAAe,CAACC,CAAD;SAAOA,CAAP;CAArB;;AAEA,IAAMC,aAAa,SAAbA,UAAa,CAACC,GAAD,EAAS;MACpBC,SAAS,EAAf;OACK,IAAIC,IAAI,CAAR,EAAWC,IAAIH,IAAII,MAAxB,EAAgCF,IAAIC,CAApC,EAAuCD,GAAvC,EAA4C;WACnCA,CAAP,IAAYF,IAAIG,IAAED,CAAF,GAAI,CAAR,CAAZ;;SAEKD,MAAP;CALF;;;AASA,IAAMI,kBAAkB,SAAlBA,eAAkB,CAACC,IAAD,EAAOC,KAAP,EAAiB;OAClCC,IAAL,CAAU,YAAW;QACfF,OAAOG,OAAO,IAAP,CAAX;QACIC,QAAQJ,KAAKA,IAAL,GAAYK,KAAZ,CAAkB,KAAlB,EAAyBC,OAAzB,EADZ;QAEIC,IAFJ;QAGIC,OAAO,EAHX;QAIIC,aAAa,CAJjB;QAKIC,aAAa,GALjB;;QAMQV,KAAKW,IAAL,CAAU,GAAV,CANR;QAOIC,KAAKC,WAAWb,KAAKW,IAAL,CAAU,IAAV,CAAX,KAA+B,CAPxC;QAQIG,QAAQd,KAAKA,IAAL,CAAU,IAAV,EACLe,MADK,CACE,OADF,EAELJ,IAFK,CAEA,GAFA,EAEK,CAFL,EAGLA,IAHK,CAGA,IAHA,EAGMC,KAAK,IAHX,CARZ;;W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B,UAAP,GAAoB,UAASgD,CAAT,EAAY;QAC1B,CAACC,UAAU/H,MAAf,EAAuB,OAAO8E,UAAP;iBACVgD,CAAb;WACOzB,MAAP;GAHF;;SAMOzB,EAAP,GAAY,YAAW;QACfwD,QAAQjC,iBAAiBvB,EAAjB,CAAoByD,KAApB,CAA0BlC,gBAA1B,EAA4C4B,SAA5C,CAAd;WACOK,UAAUjC,gBAAV,GAA6BE,MAA7B,GAAsC+B,KAA7C;GAFF;;SAKO/B,MAAP;;;ACxOK,IAAMwC,kBAAkB,SAAlBA,eAAkB,OAA2C;MAAhC/I,CAAgC,QAAhCA,CAAgC;MAA7B+B,SAA6B,QAA7BA,SAA6B;MAAlBiH,eAAkB,QAAlBA,eAAkB;;;MAEpEhJ,MAAM,CAAV,EAAa;WACJgJ,gBAAgBhJ,CAAhB,EAAmBiJ,OAAnB,CAA2B,QAA3B,EAAqC,WAArC,CAAP;GADF,MAEO,IAAIjJ,MAAM+B,YAAY,CAAtB,EAAyB;0BACViH,gBAAgBjH,YAAY,CAA5B,EAA+BkH,OAA/B,CAAuC,SAAvC,EAAkD,EAAlD,CAApB;;SAEKD,gBAAgBhJ,CAAhB,CAAP;CAPK;;AAUP,oBAAe;;CAAf;;ACHA,YAAe;oBAAA;kBAAA;sBAAA;;CAAf;;;;;"} \ No newline at end of file diff --git a/src/color.js b/src/color.js index e735a61..6b99807 100644 --- a/src/color.js +++ b/src/color.js @@ -49,7 +49,7 @@ export default function color(){ .attr("class", classPrefix + "cell") cellEnter.append(shape).attr("class", classPrefix + "swatch") - let shapes = svg.selectAll("g." + classPrefix + "cell " + shape).data(type.data); + let shapes = svg.selectAll("g." + classPrefix + "cell " + shape + "." + classPrefix + "swatch").data(type.data); //add event handlers helper.d3_addEvents(cellEnter, legendDispatcher); diff --git a/src/size.js b/src/size.js index 8e6d990..4d644ac 100644 --- a/src/size.js +++ b/src/size.js @@ -56,7 +56,7 @@ export default function size() { .attr("class", classPrefix + "cell") cellEnter.append(shape).attr("class", classPrefix + "swatch") - let shapes = svg.selectAll("g." + classPrefix + "cell " + shape) + let shapes = svg.selectAll("g." + classPrefix + "cell " + shape + "." + classPrefix + "swatch") //add event handlers helper.d3_addEvents(cellEnter, legendDispatcher) diff --git a/src/symbol.js b/src/symbol.js index e1cd1ed..b6320b9 100644 --- a/src/symbol.js +++ b/src/symbol.js @@ -57,7 +57,7 @@ export default function symbol() { .attr("class", classPrefix + "cell") cellEnter.append(shape).attr("class", classPrefix + "swatch") - let shapes = svg.selectAll("g." + classPrefix + "cell " + shape) + let shapes = svg.selectAll("g." + classPrefix + "cell " + shape + "." + classPrefix + "swatch") //add event handlers helper.d3_addEvents(cellEnter, legendDispatcher)