update c3 and d3
authorgregor herrmann <gregor@toastfreeware.priv.at>
Thu, 9 Aug 2018 13:22:35 +0000 (15:22 +0200)
committergregor herrmann <gregor@toastfreeware.priv.at>
Thu, 9 Aug 2018 13:22:35 +0000 (15:22 +0200)
c3: 0.6.7
d3: 5.5.0

web/static/c3.css
web/static/c3.js
web/static/c3.min.css
web/static/c3.min.js
web/static/d3.js
web/static/d3.min.js

index cb1ae3223a6c91fee825ba42a6eaabb78fc2b1de..7f7cda8910c7eb0a2cafcf020b25de91ff09c504 100644 (file)
 /*-- Chart --*/
 .c3 svg {
   font: 10px sans-serif;
-  -webkit-tap-highlight-color: transparent; }
+  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
+}
 
 .c3 path, .c3 line {
   fill: none;
-  stroke: #000; }
+  stroke: #000;
+}
 
 .c3 text {
   -webkit-user-select: none;
   -moz-user-select: none;
-  user-select: none; }
+  user-select: none;
+}
 
 .c3-legend-item-tile,
 .c3-xgrid-focus,
 .c3-ygrid,
 .c3-event-rect,
 .c3-bars path {
-  shape-rendering: crispEdges; }
+  shape-rendering: crispEdges;
+}
 
 .c3-chart-arc path {
-  stroke: #fff; }
+  stroke: #fff;
+}
 
 .c3-chart-arc rect {
   stroke: white;
-  stroke-width: 1; }
+  stroke-width: 1;
+}
 
 .c3-chart-arc text {
   fill: #fff;
-  font-size: 13px; }
+  font-size: 13px;
+}
 
 /*-- Axis --*/
 /*-- Grid --*/
 .c3-grid line {
-  stroke: #aaa; }
+  stroke: #aaa;
+}
 
 .c3-grid text {
-  fill: #aaa; }
+  fill: #aaa;
+}
 
 .c3-xgrid, .c3-ygrid {
-  stroke-dasharray: 3 3; }
+  stroke-dasharray: 3 3;
+}
 
 /*-- Text on Chart --*/
 .c3-text.c3-empty {
   fill: #808080;
-  font-size: 2em; }
+  font-size: 2em;
+}
 
 /*-- Line --*/
 .c3-line {
-  stroke-width: 1px; }
+  stroke-width: 1px;
+}
 
 /*-- Point --*/
 .c3-circle._expanded_ {
   stroke-width: 1px;
-  stroke: white; }
+  stroke: white;
+}
 
 .c3-selected-circle {
   fill: white;
-  stroke-width: 2px; }
+  stroke-width: 2px;
+}
 
 /*-- Bar --*/
 .c3-bar {
-  stroke-width: 0; }
+  stroke-width: 0;
+}
 
 .c3-bar._expanded_ {
   fill-opacity: 1;
-  fill-opacity: 0.75; }
+  fill-opacity: 0.75;
+}
 
 /*-- Focus --*/
 .c3-target.c3-focused {
-  opacity: 1; }
+  opacity: 1;
+}
 
 .c3-target.c3-focused path.c3-line, .c3-target.c3-focused path.c3-step {
-  stroke-width: 2px; }
+  stroke-width: 2px;
+}
 
 .c3-target.c3-defocused {
-  opacity: 0.3 !important; }
+  opacity: 0.3 !important;
+}
 
 /*-- Region --*/
 .c3-region {
   fill: steelblue;
-  fill-opacity: .1; }
+  fill-opacity: 0.1;
+}
 
 /*-- Brush --*/
 .c3-brush .extent {
-  fill-opacity: .1; }
+  fill-opacity: 0.1;
+}
 
 /*-- Select - Drag --*/
 /*-- Legend --*/
 .c3-legend-item {
-  font-size: 12px; }
+  font-size: 12px;
+}
 
 .c3-legend-item-hidden {
-  opacity: 0.15; }
+  opacity: 0.15;
+}
 
 .c3-legend-background {
   opacity: 0.75;
   fill: white;
   stroke: lightgray;
-  stroke-width: 1; }
+  stroke-width: 1;
+}
 
 /*-- Title --*/
 .c3-title {
-  font: 14px sans-serif; }
+  font: 14px sans-serif;
+}
 
 /*-- Tooltip --*/
 .c3-tooltip-container {
-  z-index: 10; }
+  z-index: 10;
+}
 
 .c3-tooltip {
   border-collapse: collapse;
   -webkit-box-shadow: 7px 7px 12px -9px #777777;
   -moz-box-shadow: 7px 7px 12px -9px #777777;
   box-shadow: 7px 7px 12px -9px #777777;
-  opacity: 0.9; }
+  opacity: 0.9;
+}
 
 .c3-tooltip tr {
-  border: 1px solid #CCC; }
+  border: 1px solid #CCC;
+}
 
 .c3-tooltip th {
   background-color: #aaa;
   font-size: 14px;
   padding: 2px 5px;
   text-align: left;
-  color: #FFF; }
+  color: #FFF;
+}
 
 .c3-tooltip td {
   font-size: 13px;
   padding: 3px 6px;
   background-color: #fff;
-  border-left: 1px dotted #999; }
+  border-left: 1px dotted #999;
+}
 
 .c3-tooltip td > span {
   display: inline-block;
   width: 10px;
   height: 10px;
-  margin-right: 6px; }
+  margin-right: 6px;
+}
 
 .c3-tooltip td.value {
-  text-align: right; }
+  text-align: right;
+}
 
 /*-- Area --*/
 .c3-area {
   stroke-width: 0;
-  opacity: 0.2; }
+  opacity: 0.2;
+}
 
 /*-- Arc --*/
 .c3-chart-arcs-title {
   dominant-baseline: middle;
-  font-size: 1.3em; }
+  font-size: 1.3em;
+}
 
 .c3-chart-arcs .c3-chart-arcs-background {
   fill: #e0e0e0;
-  stroke: #FFF; }
+  stroke: #FFF;
+}
 
 .c3-chart-arcs .c3-chart-arcs-gauge-unit {
   fill: #000;
-  font-size: 16px; }
+  font-size: 16px;
+}
 
 .c3-chart-arcs .c3-chart-arcs-gauge-max {
-  fill: #777; }
+  fill: #777;
+}
 
 .c3-chart-arcs .c3-chart-arcs-gauge-min {
-  fill: #777; }
+  fill: #777;
+}
 
 .c3-chart-arc .c3-gauge-value {
   fill: #000;
-  /*  font-size: 28px !important;*/ }
+  /*  font-size: 28px !important;*/
+}
 
 .c3-chart-arc.c3-target g path {
-  opacity: 1; }
+  opacity: 1;
+}
 
 .c3-chart-arc.c3-target.c3-focused g path {
-  opacity: 1; }
+  opacity: 1;
+}
+
+/*-- Zoom --*/
+.c3-drag-zoom.enabled {
+  pointer-events: all !important;
+  visibility: visible;
+}
+
+.c3-drag-zoom.disabled {
+  pointer-events: none !important;
+  visibility: hidden;
+}
+
+.c3-drag-zoom .extent {
+  fill-opacity: 0.1;
+}
index ff42e0fbb262b90c4853033069e7e0c881b4d66b..04eb151a3d4925a1c00ab3238337973699741675 100644 (file)
-/* @license C3.js v0.6.1 | (c) C3 Team and other contributors | http://c3js.org/ */
+/* @license C3.js v0.6.7 | (c) C3 Team and other contributors | http://c3js.org/ */
 (function (global, factory) {
     typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
     typeof define === 'function' && define.amd ? define(factory) :
     (global.c3 = factory());
 }(this, (function () { 'use strict';
 
-    var CLASS = {
-        target: 'c3-target',
-        chart: 'c3-chart',
-        chartLine: 'c3-chart-line',
-        chartLines: 'c3-chart-lines',
-        chartBar: 'c3-chart-bar',
-        chartBars: 'c3-chart-bars',
-        chartText: 'c3-chart-text',
-        chartTexts: 'c3-chart-texts',
-        chartArc: 'c3-chart-arc',
-        chartArcs: 'c3-chart-arcs',
-        chartArcsTitle: 'c3-chart-arcs-title',
-        chartArcsBackground: 'c3-chart-arcs-background',
-        chartArcsGaugeUnit: 'c3-chart-arcs-gauge-unit',
-        chartArcsGaugeMax: 'c3-chart-arcs-gauge-max',
-        chartArcsGaugeMin: 'c3-chart-arcs-gauge-min',
-        selectedCircle: 'c3-selected-circle',
-        selectedCircles: 'c3-selected-circles',
-        eventRect: 'c3-event-rect',
-        eventRects: 'c3-event-rects',
-        eventRectsSingle: 'c3-event-rects-single',
-        eventRectsMultiple: 'c3-event-rects-multiple',
-        zoomRect: 'c3-zoom-rect',
-        brush: 'c3-brush',
-        focused: 'c3-focused',
-        defocused: 'c3-defocused',
-        region: 'c3-region',
-        regions: 'c3-regions',
-        title: 'c3-title',
-        tooltipContainer: 'c3-tooltip-container',
-        tooltip: 'c3-tooltip',
-        tooltipName: 'c3-tooltip-name',
-        shape: 'c3-shape',
-        shapes: 'c3-shapes',
-        line: 'c3-line',
-        lines: 'c3-lines',
-        bar: 'c3-bar',
-        bars: 'c3-bars',
-        circle: 'c3-circle',
-        circles: 'c3-circles',
-        arc: 'c3-arc',
-        arcLabelLine: 'c3-arc-label-line',
-        arcs: 'c3-arcs',
-        area: 'c3-area',
-        areas: 'c3-areas',
-        empty: 'c3-empty',
-        text: 'c3-text',
-        texts: 'c3-texts',
-        gaugeValue: 'c3-gauge-value',
-        grid: 'c3-grid',
-        gridLines: 'c3-grid-lines',
-        xgrid: 'c3-xgrid',
-        xgrids: 'c3-xgrids',
-        xgridLine: 'c3-xgrid-line',
-        xgridLines: 'c3-xgrid-lines',
-        xgridFocus: 'c3-xgrid-focus',
-        ygrid: 'c3-ygrid',
-        ygrids: 'c3-ygrids',
-        ygridLine: 'c3-ygrid-line',
-        ygridLines: 'c3-ygrid-lines',
-        axis: 'c3-axis',
-        axisX: 'c3-axis-x',
-        axisXLabel: 'c3-axis-x-label',
-        axisY: 'c3-axis-y',
-        axisYLabel: 'c3-axis-y-label',
-        axisY2: 'c3-axis-y2',
-        axisY2Label: 'c3-axis-y2-label',
-        legendBackground: 'c3-legend-background',
-        legendItem: 'c3-legend-item',
-        legendItemEvent: 'c3-legend-item-event',
-        legendItemTile: 'c3-legend-item-tile',
-        legendItemHidden: 'c3-legend-item-hidden',
-        legendItemFocused: 'c3-legend-item-focused',
-        dragarea: 'c3-dragarea',
-        EXPANDED: '_expanded_',
-        SELECTED: '_selected_',
-        INCLUDED: '_included_'
-    };
-
-    var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
-      return typeof obj;
-    } : function (obj) {
-      return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
-    };
-
-    var classCallCheck = function (instance, Constructor) {
-      if (!(instance instanceof Constructor)) {
-        throw new TypeError("Cannot call a class as a function");
-      }
-    };
-
-    var defineProperty = function (obj, key, value) {
-      if (key in obj) {
-        Object.defineProperty(obj, key, {
-          value: value,
-          enumerable: true,
-          configurable: true,
-          writable: true
-        });
-      } else {
-        obj[key] = value;
-      }
-
-      return obj;
-    };
-
-    var inherits = function (subClass, superClass) {
-      if (typeof superClass !== "function" && superClass !== null) {
-        throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
-      }
-
-      subClass.prototype = Object.create(superClass && superClass.prototype, {
-        constructor: {
-          value: subClass,
-          enumerable: false,
-          writable: true,
-          configurable: true
-        }
-      });
-      if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
-    };
-
-    var possibleConstructorReturn = function (self, call) {
-      if (!self) {
-        throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
-      }
+    function ChartInternal(api) {
+        var $$ = this;
+        $$.d3 = window.d3 ? window.d3 : typeof require !== 'undefined' ? require("d3") : undefined;
+        $$.api = api;
+        $$.config = $$.getDefaultConfig();
+        $$.data = {};
+        $$.cache = {};
+        $$.axes = {};
+    }
 
-      return call && (typeof call === "object" || typeof call === "function") ? call : self;
-    };
+    function Chart(config) {
+        var $$ = this.internal = new ChartInternal(this);
+        $$.loadConfig(config);
 
-    var isValue = function isValue(v) {
-        return v || v === 0;
-    };
-    var isFunction = function isFunction(o) {
-        return typeof o === 'function';
-    };
-    var isArray = function isArray(o) {
-        return Array.isArray(o);
-    };
-    var isString = function isString(o) {
-        return typeof o === 'string';
-    };
-    var isUndefined = function isUndefined(v) {
-        return typeof v === 'undefined';
-    };
-    var isDefined = function isDefined(v) {
-        return typeof v !== 'undefined';
-    };
-    var ceil10 = function ceil10(v) {
-        return Math.ceil(v / 10) * 10;
-    };
-    var asHalfPixel = function asHalfPixel(n) {
-        return Math.ceil(n) + 0.5;
-    };
-    var diffDomain = function diffDomain(d) {
-        return d[1] - d[0];
-    };
-    var isEmpty = function isEmpty(o) {
-        return typeof o === 'undefined' || o === null || isString(o) && o.length === 0 || (typeof o === 'undefined' ? 'undefined' : _typeof(o)) === 'object' && Object.keys(o).length === 0;
-    };
-    var notEmpty = function notEmpty(o) {
-        return !c3_chart_internal_fn.isEmpty(o);
-    };
-    var getOption = function getOption(options, key, defaultValue) {
-        return isDefined(options[key]) ? options[key] : defaultValue;
-    };
-    var hasValue = function hasValue(dict, value) {
-        var found = false;
-        Object.keys(dict).forEach(function (key) {
-            if (dict[key] === value) {
-                found = true;
-            }
-        });
-        return found;
-    };
-    var sanitise = function sanitise(str) {
-        return typeof str === 'string' ? str.replace(/</g, '&lt;').replace(/>/g, '&gt;') : str;
-    };
-    var getPathBox = function getPathBox(path) {
-        var box = path.getBoundingClientRect(),
-            items = [path.pathSegList.getItem(0), path.pathSegList.getItem(1)],
-            minX = items[0].x,
-            minY = Math.min(items[0].y, items[1].y);
-        return { x: minX, y: minY, width: box.width, height: box.height };
-    };
+        $$.beforeInit(config);
+        $$.init();
+        $$.afterInit(config);
 
-    var c3_axis_fn;
-    var c3_axis_internal_fn;
+        // bind "this" to nested API
+        (function bindThis(fn, target, argThis) {
+            Object.keys(fn).forEach(function (key) {
+                target[key] = fn[key].bind(argThis);
+                if (Object.keys(fn[key]).length > 0) {
+                    bindThis(fn[key], target[key], argThis);
+                }
+            });
+        })(Chart.prototype, this, this);
+    }
 
     function AxisInternal(component, params) {
         var internal = this;
 
         internal.axis = internal.generateAxis();
     }
-    c3_axis_internal_fn = AxisInternal.prototype;
 
-    c3_axis_internal_fn.axisX = function (selection, x, tickOffset) {
+    AxisInternal.prototype.axisX = function (selection, x, tickOffset) {
         selection.attr("transform", function (d) {
             return "translate(" + Math.ceil(x(d) + tickOffset) + ", 0)";
         });
     };
-    c3_axis_internal_fn.axisY = function (selection, y) {
+    AxisInternal.prototype.axisY = function (selection, y) {
         selection.attr("transform", function (d) {
             return "translate(0," + Math.ceil(y(d)) + ")";
         });
     };
-    c3_axis_internal_fn.scaleExtent = function (domain) {
+    AxisInternal.prototype.scaleExtent = function (domain) {
         var start = domain[0],
             stop = domain[domain.length - 1];
         return start < stop ? [start, stop] : [stop, start];
     };
-    c3_axis_internal_fn.generateTicks = function (scale) {
+    AxisInternal.prototype.generateTicks = function (scale) {
         var internal = this;
         var i,
             domain,
         }
         return ticks;
     };
-    c3_axis_internal_fn.copyScale = function () {
+    AxisInternal.prototype.copyScale = function () {
         var internal = this;
         var newScale = internal.scale.copy(),
             domain;
         }
         return newScale;
     };
-    c3_axis_internal_fn.textFormatted = function (v) {
+    AxisInternal.prototype.textFormatted = function (v) {
         var internal = this,
             formatted = internal.tickFormat ? internal.tickFormat(v) : v;
         return typeof formatted !== 'undefined' ? formatted : '';
     };
-    c3_axis_internal_fn.updateRange = function () {
+    AxisInternal.prototype.updateRange = function () {
         var internal = this;
         internal.range = internal.scale.rangeExtent ? internal.scale.rangeExtent() : internal.scaleExtent(internal.scale.range());
         return internal.range;
     };
-    c3_axis_internal_fn.updateTickTextCharSize = function (tick) {
+    AxisInternal.prototype.updateTickTextCharSize = function (tick) {
         var internal = this;
         if (internal.tickTextCharSize) {
             return internal.tickTextCharSize;
         internal.tickTextCharSize = size;
         return size;
     };
-    c3_axis_internal_fn.isVertical = function () {
+    AxisInternal.prototype.isVertical = function () {
         return this.orient === 'left' || this.orient === 'right';
     };
-    c3_axis_internal_fn.tspanData = function (d, i, scale) {
+    AxisInternal.prototype.tspanData = function (d, i, scale) {
         var internal = this;
         var splitted = internal.params.tickMultiline ? internal.splitTickText(d, scale) : [].concat(internal.textFormatted(d));
 
             return { index: i, splitted: s, length: splitted.length };
         });
     };
-    c3_axis_internal_fn.splitTickText = function (d, scale) {
+    AxisInternal.prototype.splitTickText = function (d, scale) {
         var internal = this,
             tickText = internal.textFormatted(d),
             maxWidth = internal.params.tickWidth,
 
         return split(splitted, tickText + "");
     };
-    c3_axis_internal_fn.ellipsify = function (splitted, max) {
+    AxisInternal.prototype.ellipsify = function (splitted, max) {
         if (splitted.length <= max) {
             return splitted;
         }
 
         return ellipsified;
     };
-    c3_axis_internal_fn.updateTickLength = function () {
+    AxisInternal.prototype.updateTickLength = function () {
         var internal = this;
         internal.tickLength = Math.max(internal.innerTickSize, 0) + internal.tickPadding;
     };
-    c3_axis_internal_fn.lineY2 = function (d) {
+    AxisInternal.prototype.lineY2 = function (d) {
         var internal = this,
             tickPosition = internal.scale(d) + (internal.tickCentered ? 0 : internal.tickOffset);
         return internal.range[0] < tickPosition && tickPosition < internal.range[1] ? internal.innerTickSize : 0;
     };
-    c3_axis_internal_fn.textY = function () {
+    AxisInternal.prototype.textY = function () {
         var internal = this,
             rotate = internal.tickTextRotate;
         return rotate ? 11.5 - 2.5 * (rotate / 15) * (rotate > 0 ? 1 : -1) : internal.tickLength;
     };
-    c3_axis_internal_fn.textTransform = function () {
+    AxisInternal.prototype.textTransform = function () {
         var internal = this,
             rotate = internal.tickTextRotate;
         return rotate ? "rotate(" + rotate + ")" : "";
     };
-    c3_axis_internal_fn.textTextAnchor = function () {
+    AxisInternal.prototype.textTextAnchor = function () {
         var internal = this,
             rotate = internal.tickTextRotate;
         return rotate ? rotate > 0 ? "start" : "end" : "middle";
     };
-    c3_axis_internal_fn.tspanDx = function () {
+    AxisInternal.prototype.tspanDx = function () {
         var internal = this,
             rotate = internal.tickTextRotate;
         return rotate ? 8 * Math.sin(Math.PI * (rotate / 180)) : 0;
     };
-    c3_axis_internal_fn.tspanDy = function (d, i) {
+    AxisInternal.prototype.tspanDy = function (d, i) {
         var internal = this,
             dy = internal.tickTextCharSize.h;
         if (i === 0) {
         return dy;
     };
 
-    c3_axis_internal_fn.generateAxis = function () {
+    AxisInternal.prototype.generateAxis = function () {
         var internal = this,
             d3 = internal.d3,
             params = internal.params;
         return axis;
     };
 
-    var Axis = function (_Component) {
-        inherits(Axis, _Component);
+    var CLASS = {
+        target: 'c3-target',
+        chart: 'c3-chart',
+        chartLine: 'c3-chart-line',
+        chartLines: 'c3-chart-lines',
+        chartBar: 'c3-chart-bar',
+        chartBars: 'c3-chart-bars',
+        chartText: 'c3-chart-text',
+        chartTexts: 'c3-chart-texts',
+        chartArc: 'c3-chart-arc',
+        chartArcs: 'c3-chart-arcs',
+        chartArcsTitle: 'c3-chart-arcs-title',
+        chartArcsBackground: 'c3-chart-arcs-background',
+        chartArcsGaugeUnit: 'c3-chart-arcs-gauge-unit',
+        chartArcsGaugeMax: 'c3-chart-arcs-gauge-max',
+        chartArcsGaugeMin: 'c3-chart-arcs-gauge-min',
+        selectedCircle: 'c3-selected-circle',
+        selectedCircles: 'c3-selected-circles',
+        eventRect: 'c3-event-rect',
+        eventRects: 'c3-event-rects',
+        eventRectsSingle: 'c3-event-rects-single',
+        eventRectsMultiple: 'c3-event-rects-multiple',
+        zoomRect: 'c3-zoom-rect',
+        brush: 'c3-brush',
+        dragZoom: 'c3-drag-zoom',
+        focused: 'c3-focused',
+        defocused: 'c3-defocused',
+        region: 'c3-region',
+        regions: 'c3-regions',
+        title: 'c3-title',
+        tooltipContainer: 'c3-tooltip-container',
+        tooltip: 'c3-tooltip',
+        tooltipName: 'c3-tooltip-name',
+        shape: 'c3-shape',
+        shapes: 'c3-shapes',
+        line: 'c3-line',
+        lines: 'c3-lines',
+        bar: 'c3-bar',
+        bars: 'c3-bars',
+        circle: 'c3-circle',
+        circles: 'c3-circles',
+        arc: 'c3-arc',
+        arcLabelLine: 'c3-arc-label-line',
+        arcs: 'c3-arcs',
+        area: 'c3-area',
+        areas: 'c3-areas',
+        empty: 'c3-empty',
+        text: 'c3-text',
+        texts: 'c3-texts',
+        gaugeValue: 'c3-gauge-value',
+        grid: 'c3-grid',
+        gridLines: 'c3-grid-lines',
+        xgrid: 'c3-xgrid',
+        xgrids: 'c3-xgrids',
+        xgridLine: 'c3-xgrid-line',
+        xgridLines: 'c3-xgrid-lines',
+        xgridFocus: 'c3-xgrid-focus',
+        ygrid: 'c3-ygrid',
+        ygrids: 'c3-ygrids',
+        ygridLine: 'c3-ygrid-line',
+        ygridLines: 'c3-ygrid-lines',
+        axis: 'c3-axis',
+        axisX: 'c3-axis-x',
+        axisXLabel: 'c3-axis-x-label',
+        axisY: 'c3-axis-y',
+        axisYLabel: 'c3-axis-y-label',
+        axisY2: 'c3-axis-y2',
+        axisY2Label: 'c3-axis-y2-label',
+        legendBackground: 'c3-legend-background',
+        legendItem: 'c3-legend-item',
+        legendItemEvent: 'c3-legend-item-event',
+        legendItemTile: 'c3-legend-item-tile',
+        legendItemHidden: 'c3-legend-item-hidden',
+        legendItemFocused: 'c3-legend-item-focused',
+        dragarea: 'c3-dragarea',
+        EXPANDED: '_expanded_',
+        SELECTED: '_selected_',
+        INCLUDED: '_included_'
+    };
+
+    var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
+      return typeof obj;
+    } : function (obj) {
+      return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
+    };
 
-        function Axis(owner) {
-            classCallCheck(this, Axis);
+    var classCallCheck = function (instance, Constructor) {
+      if (!(instance instanceof Constructor)) {
+        throw new TypeError("Cannot call a class as a function");
+      }
+    };
 
-            var fn = {
-                fn: c3_axis_fn,
-                internal: {
-                    fn: c3_axis_internal_fn
-                }
-            };
+    var defineProperty = function (obj, key, value) {
+      if (key in obj) {
+        Object.defineProperty(obj, key, {
+          value: value,
+          enumerable: true,
+          configurable: true,
+          writable: true
+        });
+      } else {
+        obj[key] = value;
+      }
 
-            var _this = possibleConstructorReturn(this, (Axis.__proto__ || Object.getPrototypeOf(Axis)).call(this, owner, 'axis', fn));
+      return obj;
+    };
 
-            _this.d3 = owner.d3;
-            _this.internal = AxisInternal;
-            return _this;
-        }
+    var asHalfPixel = function asHalfPixel(n) {
+        return Math.ceil(n) + 0.5;
+    };
+    var ceil10 = function ceil10(v) {
+        return Math.ceil(v / 10) * 10;
+    };
+    var diffDomain = function diffDomain(d) {
+        return d[1] - d[0];
+    };
+    var getOption = function getOption(options, key, defaultValue) {
+        return isDefined(options[key]) ? options[key] : defaultValue;
+    };
+    var getPathBox = function getPathBox(path) {
+        var box = path.getBoundingClientRect(),
+            items = [path.pathSegList.getItem(0), path.pathSegList.getItem(1)],
+            minX = items[0].x,
+            minY = Math.min(items[0].y, items[1].y);
+        return { x: minX, y: minY, width: box.width, height: box.height };
+    };
+    var hasValue = function hasValue(dict, value) {
+        var found = false;
+        Object.keys(dict).forEach(function (key) {
+            if (dict[key] === value) {
+                found = true;
+            }
+        });
+        return found;
+    };
+    var isArray = function isArray(o) {
+        return Array.isArray(o);
+    };
+    var isDefined = function isDefined(v) {
+        return typeof v !== 'undefined';
+    };
+    var isEmpty = function isEmpty(o) {
+        return typeof o === 'undefined' || o === null || isString(o) && o.length === 0 || (typeof o === 'undefined' ? 'undefined' : _typeof(o)) === 'object' && Object.keys(o).length === 0;
+    };
+    var isFunction = function isFunction(o) {
+        return typeof o === 'function';
+    };
+    var isString = function isString(o) {
+        return typeof o === 'string';
+    };
+    var isUndefined = function isUndefined(v) {
+        return typeof v === 'undefined';
+    };
+    var isValue = function isValue(v) {
+        return v || v === 0;
+    };
+    var notEmpty = function notEmpty(o) {
+        return !isEmpty(o);
+    };
+    var sanitise = function sanitise(str) {
+        return typeof str === 'string' ? str.replace(/</g, '&lt;').replace(/>/g, '&gt;') : str;
+    };
 
-        return Axis;
-    }(Component);
+    var Axis = function Axis(owner) {
+        classCallCheck(this, Axis);
 
-    c3_axis_fn = Axis.prototype;
+        this.owner = owner;
+        this.d3 = owner.d3;
+        this.internal = AxisInternal;
+    };
 
-    c3_axis_fn.init = function init() {
+    Axis.prototype.init = function init() {
         var $$ = this.owner,
             config = $$.config,
             main = $$.main;
         .attr("transform", $$.getTranslate('y2')).style("visibility", config.axis_y2_show ? 'visible' : 'hidden');
         $$.axes.y2.append("text").attr("class", CLASS.axisY2Label).attr("transform", config.axis_rotated ? "" : "rotate(-90)").style("text-anchor", this.textAnchorForY2AxisLabel.bind(this));
     };
-    c3_axis_fn.getXAxis = function getXAxis(scale, orient, tickFormat, tickValues, withOuterTick, withoutTransition, withoutRotateTickText) {
+    Axis.prototype.getXAxis = function getXAxis(scale, orient, tickFormat, tickValues, withOuterTick, withoutTransition, withoutRotateTickText) {
         var $$ = this.owner,
             config = $$.config,
             axisParams = {
 
         return axis;
     };
-    c3_axis_fn.updateXAxisTickValues = function updateXAxisTickValues(targets, axis) {
+    Axis.prototype.updateXAxisTickValues = function updateXAxisTickValues(targets, axis) {
         var $$ = this.owner,
             config = $$.config,
             tickValues;
         }
         return tickValues;
     };
-    c3_axis_fn.getYAxis = function getYAxis(scale, orient, tickFormat, tickValues, withOuterTick, withoutTransition, withoutRotateTickText) {
+    Axis.prototype.getYAxis = function getYAxis(scale, orient, tickFormat, tickValues, withOuterTick, withoutTransition, withoutRotateTickText) {
         var $$ = this.owner,
             config = $$.config,
             axisParams = {
         }
         return axis;
     };
-    c3_axis_fn.getId = function getId(id) {
+    Axis.prototype.getId = function getId(id) {
         var config = this.owner.config;
         return id in config.data_axes ? config.data_axes[id] : 'y';
     };
-    c3_axis_fn.getXAxisTickFormat = function getXAxisTickFormat() {
+    Axis.prototype.getXAxisTickFormat = function getXAxisTickFormat() {
         // #2251 previously set any negative values to a whole number,
         // however both should be truncated according to the users format specification
         var $$ = this.owner,
             return format.call($$, v);
         } : format;
     };
-    c3_axis_fn.getTickValues = function getTickValues(tickValues, axis) {
+    Axis.prototype.getTickValues = function getTickValues(tickValues, axis) {
         return tickValues ? tickValues : axis ? axis.tickValues() : undefined;
     };
-    c3_axis_fn.getXAxisTickValues = function getXAxisTickValues() {
+    Axis.prototype.getXAxisTickValues = function getXAxisTickValues() {
         return this.getTickValues(this.owner.config.axis_x_tick_values, this.owner.xAxis);
     };
-    c3_axis_fn.getYAxisTickValues = function getYAxisTickValues() {
+    Axis.prototype.getYAxisTickValues = function getYAxisTickValues() {
         return this.getTickValues(this.owner.config.axis_y_tick_values, this.owner.yAxis);
     };
-    c3_axis_fn.getY2AxisTickValues = function getY2AxisTickValues() {
+    Axis.prototype.getY2AxisTickValues = function getY2AxisTickValues() {
         return this.getTickValues(this.owner.config.axis_y2_tick_values, this.owner.y2Axis);
     };
-    c3_axis_fn.getLabelOptionByAxisId = function getLabelOptionByAxisId(axisId) {
+    Axis.prototype.getLabelOptionByAxisId = function getLabelOptionByAxisId(axisId) {
         var $$ = this.owner,
             config = $$.config,
             option;
         }
         return option;
     };
-    c3_axis_fn.getLabelText = function getLabelText(axisId) {
+    Axis.prototype.getLabelText = function getLabelText(axisId) {
         var option = this.getLabelOptionByAxisId(axisId);
         return isString(option) ? option : option ? option.text : null;
     };
-    c3_axis_fn.setLabelText = function setLabelText(axisId, text) {
+    Axis.prototype.setLabelText = function setLabelText(axisId, text) {
         var $$ = this.owner,
             config = $$.config,
             option = this.getLabelOptionByAxisId(axisId);
             option.text = text;
         }
     };
-    c3_axis_fn.getLabelPosition = function getLabelPosition(axisId, defaultPosition) {
+    Axis.prototype.getLabelPosition = function getLabelPosition(axisId, defaultPosition) {
         var option = this.getLabelOptionByAxisId(axisId),
             position = option && (typeof option === 'undefined' ? 'undefined' : _typeof(option)) === 'object' && option.position ? option.position : defaultPosition;
         return {
             isBottom: position.indexOf('bottom') >= 0
         };
     };
-    c3_axis_fn.getXAxisLabelPosition = function getXAxisLabelPosition() {
+    Axis.prototype.getXAxisLabelPosition = function getXAxisLabelPosition() {
         return this.getLabelPosition('x', this.owner.config.axis_rotated ? 'inner-top' : 'inner-right');
     };
-    c3_axis_fn.getYAxisLabelPosition = function getYAxisLabelPosition() {
+    Axis.prototype.getYAxisLabelPosition = function getYAxisLabelPosition() {
         return this.getLabelPosition('y', this.owner.config.axis_rotated ? 'inner-right' : 'inner-top');
     };
-    c3_axis_fn.getY2AxisLabelPosition = function getY2AxisLabelPosition() {
+    Axis.prototype.getY2AxisLabelPosition = function getY2AxisLabelPosition() {
         return this.getLabelPosition('y2', this.owner.config.axis_rotated ? 'inner-right' : 'inner-top');
     };
-    c3_axis_fn.getLabelPositionById = function getLabelPositionById(id) {
+    Axis.prototype.getLabelPositionById = function getLabelPositionById(id) {
         return id === 'y2' ? this.getY2AxisLabelPosition() : id === 'y' ? this.getYAxisLabelPosition() : this.getXAxisLabelPosition();
     };
-    c3_axis_fn.textForXAxisLabel = function textForXAxisLabel() {
+    Axis.prototype.textForXAxisLabel = function textForXAxisLabel() {
         return this.getLabelText('x');
     };
-    c3_axis_fn.textForYAxisLabel = function textForYAxisLabel() {
+    Axis.prototype.textForYAxisLabel = function textForYAxisLabel() {
         return this.getLabelText('y');
     };
-    c3_axis_fn.textForY2AxisLabel = function textForY2AxisLabel() {
+    Axis.prototype.textForY2AxisLabel = function textForY2AxisLabel() {
         return this.getLabelText('y2');
     };
-    c3_axis_fn.xForAxisLabel = function xForAxisLabel(forHorizontal, position) {
+    Axis.prototype.xForAxisLabel = function xForAxisLabel(forHorizontal, position) {
         var $$ = this.owner;
         if (forHorizontal) {
             return position.isLeft ? 0 : position.isCenter ? $$.width / 2 : $$.width;
             return position.isBottom ? -$$.height : position.isMiddle ? -$$.height / 2 : 0;
         }
     };
-    c3_axis_fn.dxForAxisLabel = function dxForAxisLabel(forHorizontal, position) {
+    Axis.prototype.dxForAxisLabel = function dxForAxisLabel(forHorizontal, position) {
         if (forHorizontal) {
             return position.isLeft ? "0.5em" : position.isRight ? "-0.5em" : "0";
         } else {
             return position.isTop ? "-0.5em" : position.isBottom ? "0.5em" : "0";
         }
     };
-    c3_axis_fn.textAnchorForAxisLabel = function textAnchorForAxisLabel(forHorizontal, position) {
+    Axis.prototype.textAnchorForAxisLabel = function textAnchorForAxisLabel(forHorizontal, position) {
         if (forHorizontal) {
             return position.isLeft ? 'start' : position.isCenter ? 'middle' : 'end';
         } else {
             return position.isBottom ? 'start' : position.isMiddle ? 'middle' : 'end';
         }
     };
-    c3_axis_fn.xForXAxisLabel = function xForXAxisLabel() {
+    Axis.prototype.xForXAxisLabel = function xForXAxisLabel() {
         return this.xForAxisLabel(!this.owner.config.axis_rotated, this.getXAxisLabelPosition());
     };
-    c3_axis_fn.xForYAxisLabel = function xForYAxisLabel() {
+    Axis.prototype.xForYAxisLabel = function xForYAxisLabel() {
         return this.xForAxisLabel(this.owner.config.axis_rotated, this.getYAxisLabelPosition());
     };
-    c3_axis_fn.xForY2AxisLabel = function xForY2AxisLabel() {
+    Axis.prototype.xForY2AxisLabel = function xForY2AxisLabel() {
         return this.xForAxisLabel(this.owner.config.axis_rotated, this.getY2AxisLabelPosition());
     };
-    c3_axis_fn.dxForXAxisLabel = function dxForXAxisLabel() {
+    Axis.prototype.dxForXAxisLabel = function dxForXAxisLabel() {
         return this.dxForAxisLabel(!this.owner.config.axis_rotated, this.getXAxisLabelPosition());
     };
-    c3_axis_fn.dxForYAxisLabel = function dxForYAxisLabel() {
+    Axis.prototype.dxForYAxisLabel = function dxForYAxisLabel() {
         return this.dxForAxisLabel(this.owner.config.axis_rotated, this.getYAxisLabelPosition());
     };
-    c3_axis_fn.dxForY2AxisLabel = function dxForY2AxisLabel() {
+    Axis.prototype.dxForY2AxisLabel = function dxForY2AxisLabel() {
         return this.dxForAxisLabel(this.owner.config.axis_rotated, this.getY2AxisLabelPosition());
     };
-    c3_axis_fn.dyForXAxisLabel = function dyForXAxisLabel() {
+    Axis.prototype.dyForXAxisLabel = function dyForXAxisLabel() {
         var $$ = this.owner,
             config = $$.config,
             position = this.getXAxisLabelPosition();
             return position.isInner ? "-0.5em" : config.axis_x_height ? config.axis_x_height - 10 : "3em";
         }
     };
-    c3_axis_fn.dyForYAxisLabel = function dyForYAxisLabel() {
+    Axis.prototype.dyForYAxisLabel = function dyForYAxisLabel() {
         var $$ = this.owner,
             position = this.getYAxisLabelPosition();
         if ($$.config.axis_rotated) {
             return position.isInner ? "1.2em" : -10 - ($$.config.axis_y_inner ? 0 : this.getMaxTickWidth('y') + 10);
         }
     };
-    c3_axis_fn.dyForY2AxisLabel = function dyForY2AxisLabel() {
+    Axis.prototype.dyForY2AxisLabel = function dyForY2AxisLabel() {
         var $$ = this.owner,
             position = this.getY2AxisLabelPosition();
         if ($$.config.axis_rotated) {
             return position.isInner ? "-0.5em" : 15 + ($$.config.axis_y2_inner ? 0 : this.getMaxTickWidth('y2') + 15);
         }
     };
-    c3_axis_fn.textAnchorForXAxisLabel = function textAnchorForXAxisLabel() {
+    Axis.prototype.textAnchorForXAxisLabel = function textAnchorForXAxisLabel() {
         var $$ = this.owner;
         return this.textAnchorForAxisLabel(!$$.config.axis_rotated, this.getXAxisLabelPosition());
     };
-    c3_axis_fn.textAnchorForYAxisLabel = function textAnchorForYAxisLabel() {
+    Axis.prototype.textAnchorForYAxisLabel = function textAnchorForYAxisLabel() {
         var $$ = this.owner;
         return this.textAnchorForAxisLabel($$.config.axis_rotated, this.getYAxisLabelPosition());
     };
-    c3_axis_fn.textAnchorForY2AxisLabel = function textAnchorForY2AxisLabel() {
+    Axis.prototype.textAnchorForY2AxisLabel = function textAnchorForY2AxisLabel() {
         var $$ = this.owner;
         return this.textAnchorForAxisLabel($$.config.axis_rotated, this.getY2AxisLabelPosition());
     };
-    c3_axis_fn.getMaxTickWidth = function getMaxTickWidth(id, withoutRecompute) {
+    Axis.prototype.getMaxTickWidth = function getMaxTickWidth(id, withoutRecompute) {
         var $$ = this.owner,
             config = $$.config,
             maxWidth = 0,
         return $$.currentMaxTickWidths[id];
     };
 
-    c3_axis_fn.updateLabels = function updateLabels(withTransition) {
+    Axis.prototype.updateLabels = function updateLabels(withTransition) {
         var $$ = this.owner;
         var axisXLabel = $$.main.select('.' + CLASS.axisX + ' .' + CLASS.axisXLabel),
             axisYLabel = $$.main.select('.' + CLASS.axisY + ' .' + CLASS.axisYLabel),
         (withTransition ? axisYLabel.transition() : axisYLabel).attr("x", this.xForYAxisLabel.bind(this)).attr("dx", this.dxForYAxisLabel.bind(this)).attr("dy", this.dyForYAxisLabel.bind(this)).text(this.textForYAxisLabel.bind(this));
         (withTransition ? axisY2Label.transition() : axisY2Label).attr("x", this.xForY2AxisLabel.bind(this)).attr("dx", this.dxForY2AxisLabel.bind(this)).attr("dy", this.dyForY2AxisLabel.bind(this)).text(this.textForY2AxisLabel.bind(this));
     };
-    c3_axis_fn.getPadding = function getPadding(padding, key, defaultValue, domainLength) {
+    Axis.prototype.getPadding = function getPadding(padding, key, defaultValue, domainLength) {
         var p = typeof padding === 'number' ? padding : padding[key];
         if (!isValue(p)) {
             return defaultValue;
         // assume padding is pixels if unit is not specified
         return this.convertPixelsToAxisPadding(p, domainLength);
     };
-    c3_axis_fn.convertPixelsToAxisPadding = function convertPixelsToAxisPadding(pixels, domainLength) {
+    Axis.prototype.convertPixelsToAxisPadding = function convertPixelsToAxisPadding(pixels, domainLength) {
         var $$ = this.owner,
             length = $$.config.axis_rotated ? $$.width : $$.height;
         return domainLength * (pixels / length);
     };
-    c3_axis_fn.generateTickValues = function generateTickValues(values, tickCount, forTimeSeries) {
+    Axis.prototype.generateTickValues = function generateTickValues(values, tickCount, forTimeSeries) {
         var tickValues = values,
             targetCount,
             start,
         }
         return tickValues;
     };
-    c3_axis_fn.generateTransitions = function generateTransitions(duration) {
+    Axis.prototype.generateTransitions = function generateTransitions(duration) {
         var $$ = this.owner,
             axes = $$.axes;
         return {
             axisSubX: duration ? axes.subx.transition().duration(duration) : axes.subx
         };
     };
-    c3_axis_fn.redraw = function redraw(duration, isHidden) {
+    Axis.prototype.redraw = function redraw(duration, isHidden) {
         var $$ = this.owner,
             transition = duration ? $$.d3.transition().duration(duration) : null;
         $$.axes.x.style("opacity", isHidden ? 0 : 1).call($$.xAxis, transition);
         $$.axes.subx.style("opacity", isHidden ? 0 : 1).call($$.subXAxis, transition);
     };
 
-    var c3 = { version: "0.6.1" };
-
-    var c3_chart_fn;
-    var c3_chart_internal_fn;
-
-    function Component(owner, componentKey, fn) {
-        this.owner = owner;
-        c3.chart.internal[componentKey] = fn;
-    }
-
-    function Chart(config) {
-        var $$ = this.internal = new ChartInternal(this);
-        $$.loadConfig(config);
-
-        $$.beforeInit(config);
-        $$.init();
-        $$.afterInit(config);
-
-        // bind "this" to nested API
-        (function bindThis(fn, target, argThis) {
-            Object.keys(fn).forEach(function (key) {
-                target[key] = fn[key].bind(argThis);
-                if (Object.keys(fn[key]).length > 0) {
-                    bindThis(fn[key], target[key], argThis);
+    var c3 = {
+        version: "0.6.7",
+        chart: {
+            fn: Chart.prototype,
+            internal: {
+                fn: ChartInternal.prototype,
+                axis: {
+                    fn: Axis.prototype,
+                    internal: {
+                        fn: AxisInternal.prototype
+                    }
                 }
-            });
-        })(c3_chart_fn, this, this);
-    }
-
-    function ChartInternal(api) {
-        var $$ = this;
-        $$.d3 = window.d3 ? window.d3 : typeof require !== 'undefined' ? require("d3") : undefined;
-        $$.api = api;
-        $$.config = $$.getDefaultConfig();
-        $$.data = {};
-        $$.cache = {};
-        $$.axes = {};
-    }
-
-    c3.generate = function (config) {
-        return new Chart(config);
-    };
-
-    c3.chart = {
-        fn: Chart.prototype,
-        internal: {
-            fn: ChartInternal.prototype
+            }
+        },
+        generate: function generate(config) {
+            return new Chart(config);
         }
     };
-    c3_chart_fn = c3.chart.fn;
-    c3_chart_internal_fn = c3.chart.internal.fn;
 
-    c3_chart_internal_fn.beforeInit = function () {
+    ChartInternal.prototype.beforeInit = function () {
         // can do something
     };
-    c3_chart_internal_fn.afterInit = function () {
+    ChartInternal.prototype.afterInit = function () {
         // can do something
     };
-    c3_chart_internal_fn.init = function () {
+    ChartInternal.prototype.init = function () {
         var $$ = this,
             config = $$.config;
 
         }
     };
 
-    c3_chart_internal_fn.initParams = function () {
+    ChartInternal.prototype.initParams = function () {
         var $$ = this,
             d3 = $$.d3,
             config = $$.config;
 
         // MEMO: clipId needs to be unique because it conflicts when multiple charts exist
-        $$.clipId = "c3-" + +new Date() + '-clip', $$.clipIdForXAxis = $$.clipId + '-xaxis', $$.clipIdForYAxis = $$.clipId + '-yaxis', $$.clipIdForGrid = $$.clipId + '-grid', $$.clipIdForSubchart = $$.clipId + '-subchart', $$.clipPath = $$.getClipPath($$.clipId), $$.clipPathForXAxis = $$.getClipPath($$.clipIdForXAxis), $$.clipPathForYAxis = $$.getClipPath($$.clipIdForYAxis);
-        $$.clipPathForGrid = $$.getClipPath($$.clipIdForGrid), $$.clipPathForSubchart = $$.getClipPath($$.clipIdForSubchart), $$.dragStart = null;
+        $$.clipId = "c3-" + +new Date() + '-clip';
+        $$.clipIdForXAxis = $$.clipId + '-xaxis';
+        $$.clipIdForYAxis = $$.clipId + '-yaxis';
+        $$.clipIdForGrid = $$.clipId + '-grid';
+        $$.clipIdForSubchart = $$.clipId + '-subchart';
+        $$.clipPath = $$.getClipPath($$.clipId);
+        $$.clipPathForXAxis = $$.getClipPath($$.clipIdForXAxis);
+        $$.clipPathForYAxis = $$.getClipPath($$.clipIdForYAxis);
+        $$.clipPathForGrid = $$.getClipPath($$.clipIdForGrid);
+        $$.clipPathForSubchart = $$.getClipPath($$.clipIdForSubchart);
+
+        $$.dragStart = null;
         $$.dragging = false;
         $$.flowing = false;
         $$.cancelClick = false;
         $$.axes.subx = d3.selectAll([]); // needs when excluding subchart.js
     };
 
-    c3_chart_internal_fn.initChartElements = function () {
+    ChartInternal.prototype.initChartElements = function () {
         if (this.initBar) {
             this.initBar();
         }
         }
     };
 
-    c3_chart_internal_fn.initWithData = function (data) {
+    ChartInternal.prototype.initWithData = function (data) {
         var $$ = this,
             d3 = $$.d3,
             config = $$.config;
         if ($$.initPie) {
             $$.initPie();
         }
+        if ($$.initDragZoom) {
+            $$.initDragZoom();
+        }
         if ($$.initSubchart) {
             $$.initSubchart();
         }
             $$.initGridLines();
         }
 
+        // Cover whole with rects for events
+        $$.initEventRect();
+
         // Define g for chart
         $$.initChartElements();
 
         // Set targets
         $$.updateTargets($$.data.targets);
 
-        // Cover whole with rects for events
-        $$.initEventRect();
-
         // Set default extent if defined
         if (config.axis_x_selection) {
             $$.brush.selectionAsValue($$.getDefaultSelection());
         $$.api.element = $$.selectChart.node();
     };
 
-    c3_chart_internal_fn.smoothLines = function (el, type) {
+    ChartInternal.prototype.smoothLines = function (el, type) {
         var $$ = this;
         if (type === 'grid') {
             el.each(function () {
         }
     };
 
-    c3_chart_internal_fn.updateSizes = function () {
+    ChartInternal.prototype.updateSizes = function () {
         var $$ = this,
             config = $$.config;
         var legendHeight = $$.legend ? $$.getLegendHeight() : 0,
         }
     };
 
-    c3_chart_internal_fn.updateTargets = function (targets) {
+    ChartInternal.prototype.updateTargets = function (targets) {
         var $$ = this;
 
         /*-- Main --*/
         // Fade-in each chart
         $$.showTargets();
     };
-    c3_chart_internal_fn.showTargets = function () {
+    ChartInternal.prototype.showTargets = function () {
         var $$ = this;
         $$.svg.selectAll('.' + CLASS.target).filter(function (d) {
             return $$.isTargetToShow(d.id);
         }).transition().duration($$.config.transition_duration).style("opacity", 1);
     };
 
-    c3_chart_internal_fn.redraw = function (options, transitions) {
+    ChartInternal.prototype.redraw = function (options, transitions) {
         var $$ = this,
             main = $$.main,
             d3 = $$.d3,
         });
     };
 
-    c3_chart_internal_fn.updateAndRedraw = function (options) {
+    ChartInternal.prototype.updateAndRedraw = function (options) {
         var $$ = this,
             config = $$.config,
             transitions;
         // Draw with new sizes & scales
         $$.redraw(options, transitions);
     };
-    c3_chart_internal_fn.redrawWithoutRescale = function () {
+    ChartInternal.prototype.redrawWithoutRescale = function () {
         this.redraw({
             withY: false,
             withSubchart: false,
         });
     };
 
-    c3_chart_internal_fn.isTimeSeries = function () {
+    ChartInternal.prototype.isTimeSeries = function () {
         return this.config.axis_x_type === 'timeseries';
     };
-    c3_chart_internal_fn.isCategorized = function () {
+    ChartInternal.prototype.isCategorized = function () {
         return this.config.axis_x_type.indexOf('categor') >= 0;
     };
-    c3_chart_internal_fn.isCustomX = function () {
+    ChartInternal.prototype.isCustomX = function () {
         var $$ = this,
             config = $$.config;
         return !$$.isTimeSeries() && (config.data_x || notEmpty(config.data_xs));
     };
 
-    c3_chart_internal_fn.isTimeSeriesY = function () {
+    ChartInternal.prototype.isTimeSeriesY = function () {
         return this.config.axis_y_type === 'timeseries';
     };
 
-    c3_chart_internal_fn.getTranslate = function (target) {
+    ChartInternal.prototype.getTranslate = function (target) {
         var $$ = this,
             config = $$.config,
             x,
         }
         return "translate(" + x + "," + y + ")";
     };
-    c3_chart_internal_fn.initialOpacity = function (d) {
+    ChartInternal.prototype.initialOpacity = function (d) {
         return d.value !== null && this.withoutFadeIn[d.id] ? 1 : 0;
     };
-    c3_chart_internal_fn.initialOpacityForCircle = function (d) {
+    ChartInternal.prototype.initialOpacityForCircle = function (d) {
         return d.value !== null && this.withoutFadeIn[d.id] ? this.opacityForCircle(d) : 0;
     };
-    c3_chart_internal_fn.opacityForCircle = function (d) {
+    ChartInternal.prototype.opacityForCircle = function (d) {
         var isPointShouldBeShown = isFunction(this.config.point_show) ? this.config.point_show(d) : this.config.point_show;
         var opacity = isPointShouldBeShown ? 1 : 0;
         return isValue(d.value) ? this.isScatterType(d) ? 0.5 : opacity : 0;
     };
-    c3_chart_internal_fn.opacityForText = function () {
+    ChartInternal.prototype.opacityForText = function () {
         return this.hasDataLabel() ? 1 : 0;
     };
-    c3_chart_internal_fn.xx = function (d) {
+    ChartInternal.prototype.xx = function (d) {
         return d ? this.x(d.x) : null;
     };
-    c3_chart_internal_fn.xv = function (d) {
+    ChartInternal.prototype.xv = function (d) {
         var $$ = this,
             value = d.value;
         if ($$.isTimeSeries()) {
         }
         return Math.ceil($$.x(value));
     };
-    c3_chart_internal_fn.yv = function (d) {
+    ChartInternal.prototype.yv = function (d) {
         var $$ = this,
             yScale = d.axis && d.axis === 'y2' ? $$.y2 : $$.y;
         return Math.ceil(yScale(d.value));
     };
-    c3_chart_internal_fn.subxx = function (d) {
+    ChartInternal.prototype.subxx = function (d) {
         return d ? this.subX(d.x) : null;
     };
 
-    c3_chart_internal_fn.transformMain = function (withTransition, transitions) {
+    ChartInternal.prototype.transformMain = function (withTransition, transitions) {
         var $$ = this,
             xAxis,
             yAxis,
         y2Axis.attr("transform", $$.getTranslate('y2'));
         $$.main.select('.' + CLASS.chartArcs).attr("transform", $$.getTranslate('arc'));
     };
-    c3_chart_internal_fn.transformAll = function (withTransition, transitions) {
+    ChartInternal.prototype.transformAll = function (withTransition, transitions) {
         var $$ = this;
         $$.transformMain(withTransition, transitions);
         if ($$.config.subchart_show) {
         }
     };
 
-    c3_chart_internal_fn.updateSvgSize = function () {
+    ChartInternal.prototype.updateSvgSize = function () {
         var $$ = this,
             brush = $$.svg.select(".c3-brush .overlay");
         $$.svg.attr('width', $$.currentWidth).attr('height', $$.currentHeight);
         $$.selectChart.style('max-height', $$.currentHeight + "px");
     };
 
-    c3_chart_internal_fn.updateDimension = function (withoutAxis) {
+    ChartInternal.prototype.updateDimension = function (withoutAxis) {
         var $$ = this;
         if (!withoutAxis) {
             if ($$.config.axis_rotated) {
         $$.transformAll(false);
     };
 
-    c3_chart_internal_fn.observeInserted = function (selection) {
+    ChartInternal.prototype.observeInserted = function (selection) {
         var $$ = this,
             observer;
         if (typeof MutationObserver === 'undefined') {
                 }
             });
         });
-        observer.observe(selection.node(), { attributes: true, childList: true, characterData: true });
+        observer.observe(selection.node(), {
+            attributes: true,
+            childList: true,
+            characterData: true
+        });
     };
 
-    c3_chart_internal_fn.bindResize = function () {
+    ChartInternal.prototype.bindResize = function () {
         var $$ = this,
             config = $$.config;
 
         }
     };
 
-    c3_chart_internal_fn.generateResize = function () {
+    ChartInternal.prototype.generateResize = function () {
         var resizeFunctions = [];
+
         function callResizeFunctions() {
             resizeFunctions.forEach(function (f) {
                 f();
         return callResizeFunctions;
     };
 
-    c3_chart_internal_fn.endall = function (transition, callback) {
+    ChartInternal.prototype.endall = function (transition, callback) {
         var n = 0;
         transition.each(function () {
             ++n;
             }
         });
     };
-    c3_chart_internal_fn.generateWait = function () {
+    ChartInternal.prototype.generateWait = function () {
         var transitionsToWait = [],
             f = function f(callback) {
             var timer = setInterval(function () {
         return f;
     };
 
-    c3_chart_internal_fn.parseDate = function (date) {
+    ChartInternal.prototype.parseDate = function (date) {
         var $$ = this,
             parsedDate;
         if (date instanceof Date) {
         return parsedDate;
     };
 
-    c3_chart_internal_fn.isTabVisible = function () {
+    ChartInternal.prototype.isTabVisible = function () {
         var hidden;
         if (typeof document.hidden !== "undefined") {
             // Opera 12.10 and Firefox 18 and later support
         return document[hidden] ? false : true;
     };
 
-    c3_chart_internal_fn.isValue = isValue;
-    c3_chart_internal_fn.isFunction = isFunction;
-    c3_chart_internal_fn.isString = isString;
-    c3_chart_internal_fn.isUndefined = isUndefined;
-    c3_chart_internal_fn.isDefined = isDefined;
-    c3_chart_internal_fn.ceil10 = ceil10;
-    c3_chart_internal_fn.asHalfPixel = asHalfPixel;
-    c3_chart_internal_fn.diffDomain = diffDomain;
-    c3_chart_internal_fn.isEmpty = isEmpty;
-    c3_chart_internal_fn.notEmpty = notEmpty;
-    c3_chart_internal_fn.notEmpty = notEmpty;
-    c3_chart_internal_fn.getOption = getOption;
-    c3_chart_internal_fn.hasValue = hasValue;
-    c3_chart_internal_fn.sanitise = sanitise;
-    c3_chart_internal_fn.getPathBox = getPathBox;
-    c3_chart_internal_fn.CLASS = CLASS;
+    ChartInternal.prototype.getPathBox = getPathBox;
+    ChartInternal.prototype.CLASS = CLASS;
 
     /* jshint ignore:start */
 
             window.SVGPathSegMovetoAbs.prototype.clone = function () {
                 return new window.SVGPathSegMovetoAbs(undefined, this._x, this._y);
             };
-            Object.defineProperty(window.SVGPathSegMovetoAbs.prototype, "x", { get: function get() {
+            Object.defineProperty(window.SVGPathSegMovetoAbs.prototype, "x", {
+                get: function get() {
                     return this._x;
-                }, set: function set(x) {
-                    this._x = x;this._segmentChanged();
-                }, enumerable: true });
-            Object.defineProperty(window.SVGPathSegMovetoAbs.prototype, "y", { get: function get() {
+                },
+                set: function set(x) {
+                    this._x = x;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
+            Object.defineProperty(window.SVGPathSegMovetoAbs.prototype, "y", {
+                get: function get() {
                     return this._y;
-                }, set: function set(y) {
-                    this._y = y;this._segmentChanged();
-                }, enumerable: true });
+                },
+                set: function set(y) {
+                    this._y = y;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
 
             window.SVGPathSegMovetoRel = function (owningPathSegList, x, y) {
                 window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_MOVETO_REL, "m", owningPathSegList);
             window.SVGPathSegMovetoRel.prototype.clone = function () {
                 return new window.SVGPathSegMovetoRel(undefined, this._x, this._y);
             };
-            Object.defineProperty(window.SVGPathSegMovetoRel.prototype, "x", { get: function get() {
+            Object.defineProperty(window.SVGPathSegMovetoRel.prototype, "x", {
+                get: function get() {
                     return this._x;
-                }, set: function set(x) {
-                    this._x = x;this._segmentChanged();
-                }, enumerable: true });
-            Object.defineProperty(window.SVGPathSegMovetoRel.prototype, "y", { get: function get() {
+                },
+                set: function set(x) {
+                    this._x = x;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
+            Object.defineProperty(window.SVGPathSegMovetoRel.prototype, "y", {
+                get: function get() {
                     return this._y;
-                }, set: function set(y) {
-                    this._y = y;this._segmentChanged();
-                }, enumerable: true });
+                },
+                set: function set(y) {
+                    this._y = y;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
 
             window.SVGPathSegLinetoAbs = function (owningPathSegList, x, y) {
                 window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_LINETO_ABS, "L", owningPathSegList);
             window.SVGPathSegLinetoAbs.prototype.clone = function () {
                 return new window.SVGPathSegLinetoAbs(undefined, this._x, this._y);
             };
-            Object.defineProperty(window.SVGPathSegLinetoAbs.prototype, "x", { get: function get() {
+            Object.defineProperty(window.SVGPathSegLinetoAbs.prototype, "x", {
+                get: function get() {
                     return this._x;
-                }, set: function set(x) {
-                    this._x = x;this._segmentChanged();
-                }, enumerable: true });
-            Object.defineProperty(window.SVGPathSegLinetoAbs.prototype, "y", { get: function get() {
+                },
+                set: function set(x) {
+                    this._x = x;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
+            Object.defineProperty(window.SVGPathSegLinetoAbs.prototype, "y", {
+                get: function get() {
                     return this._y;
-                }, set: function set(y) {
-                    this._y = y;this._segmentChanged();
-                }, enumerable: true });
+                },
+                set: function set(y) {
+                    this._y = y;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
 
             window.SVGPathSegLinetoRel = function (owningPathSegList, x, y) {
                 window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_LINETO_REL, "l", owningPathSegList);
             window.SVGPathSegLinetoRel.prototype.clone = function () {
                 return new window.SVGPathSegLinetoRel(undefined, this._x, this._y);
             };
-            Object.defineProperty(window.SVGPathSegLinetoRel.prototype, "x", { get: function get() {
+            Object.defineProperty(window.SVGPathSegLinetoRel.prototype, "x", {
+                get: function get() {
                     return this._x;
-                }, set: function set(x) {
-                    this._x = x;this._segmentChanged();
-                }, enumerable: true });
-            Object.defineProperty(window.SVGPathSegLinetoRel.prototype, "y", { get: function get() {
+                },
+                set: function set(x) {
+                    this._x = x;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
+            Object.defineProperty(window.SVGPathSegLinetoRel.prototype, "y", {
+                get: function get() {
                     return this._y;
-                }, set: function set(y) {
-                    this._y = y;this._segmentChanged();
-                }, enumerable: true });
+                },
+                set: function set(y) {
+                    this._y = y;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
 
             window.SVGPathSegCurvetoCubicAbs = function (owningPathSegList, x, y, x1, y1, x2, y2) {
                 window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS, "C", owningPathSegList);
             window.SVGPathSegCurvetoCubicAbs.prototype.clone = function () {
                 return new window.SVGPathSegCurvetoCubicAbs(undefined, this._x, this._y, this._x1, this._y1, this._x2, this._y2);
             };
-            Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype, "x", { get: function get() {
+            Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype, "x", {
+                get: function get() {
                     return this._x;
-                }, set: function set(x) {
-                    this._x = x;this._segmentChanged();
-                }, enumerable: true });
-            Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype, "y", { get: function get() {
+                },
+                set: function set(x) {
+                    this._x = x;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
+            Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype, "y", {
+                get: function get() {
                     return this._y;
-                }, set: function set(y) {
-                    this._y = y;this._segmentChanged();
-                }, enumerable: true });
-            Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype, "x1", { get: function get() {
+                },
+                set: function set(y) {
+                    this._y = y;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
+            Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype, "x1", {
+                get: function get() {
                     return this._x1;
-                }, set: function set(x1) {
-                    this._x1 = x1;this._segmentChanged();
-                }, enumerable: true });
-            Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype, "y1", { get: function get() {
+                },
+                set: function set(x1) {
+                    this._x1 = x1;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
+            Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype, "y1", {
+                get: function get() {
                     return this._y1;
-                }, set: function set(y1) {
-                    this._y1 = y1;this._segmentChanged();
-                }, enumerable: true });
-            Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype, "x2", { get: function get() {
+                },
+                set: function set(y1) {
+                    this._y1 = y1;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
+            Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype, "x2", {
+                get: function get() {
                     return this._x2;
-                }, set: function set(x2) {
-                    this._x2 = x2;this._segmentChanged();
-                }, enumerable: true });
-            Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype, "y2", { get: function get() {
+                },
+                set: function set(x2) {
+                    this._x2 = x2;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
+            Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype, "y2", {
+                get: function get() {
                     return this._y2;
-                }, set: function set(y2) {
-                    this._y2 = y2;this._segmentChanged();
-                }, enumerable: true });
+                },
+                set: function set(y2) {
+                    this._y2 = y2;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
 
             window.SVGPathSegCurvetoCubicRel = function (owningPathSegList, x, y, x1, y1, x2, y2) {
                 window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL, "c", owningPathSegList);
             window.SVGPathSegCurvetoCubicRel.prototype.clone = function () {
                 return new window.SVGPathSegCurvetoCubicRel(undefined, this._x, this._y, this._x1, this._y1, this._x2, this._y2);
             };
-            Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype, "x", { get: function get() {
+            Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype, "x", {
+                get: function get() {
                     return this._x;
-                }, set: function set(x) {
-                    this._x = x;this._segmentChanged();
-                }, enumerable: true });
-            Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype, "y", { get: function get() {
+                },
+                set: function set(x) {
+                    this._x = x;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
+            Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype, "y", {
+                get: function get() {
                     return this._y;
-                }, set: function set(y) {
-                    this._y = y;this._segmentChanged();
-                }, enumerable: true });
-            Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype, "x1", { get: function get() {
+                },
+                set: function set(y) {
+                    this._y = y;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
+            Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype, "x1", {
+                get: function get() {
                     return this._x1;
-                }, set: function set(x1) {
-                    this._x1 = x1;this._segmentChanged();
-                }, enumerable: true });
-            Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype, "y1", { get: function get() {
+                },
+                set: function set(x1) {
+                    this._x1 = x1;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
+            Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype, "y1", {
+                get: function get() {
                     return this._y1;
-                }, set: function set(y1) {
-                    this._y1 = y1;this._segmentChanged();
-                }, enumerable: true });
-            Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype, "x2", { get: function get() {
+                },
+                set: function set(y1) {
+                    this._y1 = y1;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
+            Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype, "x2", {
+                get: function get() {
                     return this._x2;
-                }, set: function set(x2) {
-                    this._x2 = x2;this._segmentChanged();
-                }, enumerable: true });
-            Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype, "y2", { get: function get() {
+                },
+                set: function set(x2) {
+                    this._x2 = x2;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
+            Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype, "y2", {
+                get: function get() {
                     return this._y2;
-                }, set: function set(y2) {
-                    this._y2 = y2;this._segmentChanged();
-                }, enumerable: true });
+                },
+                set: function set(y2) {
+                    this._y2 = y2;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
 
             window.SVGPathSegCurvetoQuadraticAbs = function (owningPathSegList, x, y, x1, y1) {
                 window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS, "Q", owningPathSegList);
             window.SVGPathSegCurvetoQuadraticAbs.prototype.clone = function () {
                 return new window.SVGPathSegCurvetoQuadraticAbs(undefined, this._x, this._y, this._x1, this._y1);
             };
-            Object.defineProperty(window.SVGPathSegCurvetoQuadraticAbs.prototype, "x", { get: function get() {
+            Object.defineProperty(window.SVGPathSegCurvetoQuadraticAbs.prototype, "x", {
+                get: function get() {
                     return this._x;
-                }, set: function set(x) {
-                    this._x = x;this._segmentChanged();
-                }, enumerable: true });
-            Object.defineProperty(window.SVGPathSegCurvetoQuadraticAbs.prototype, "y", { get: function get() {
+                },
+                set: function set(x) {
+                    this._x = x;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
+            Object.defineProperty(window.SVGPathSegCurvetoQuadraticAbs.prototype, "y", {
+                get: function get() {
                     return this._y;
-                }, set: function set(y) {
-                    this._y = y;this._segmentChanged();
-                }, enumerable: true });
-            Object.defineProperty(window.SVGPathSegCurvetoQuadraticAbs.prototype, "x1", { get: function get() {
+                },
+                set: function set(y) {
+                    this._y = y;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
+            Object.defineProperty(window.SVGPathSegCurvetoQuadraticAbs.prototype, "x1", {
+                get: function get() {
                     return this._x1;
-                }, set: function set(x1) {
-                    this._x1 = x1;this._segmentChanged();
-                }, enumerable: true });
-            Object.defineProperty(window.SVGPathSegCurvetoQuadraticAbs.prototype, "y1", { get: function get() {
+                },
+                set: function set(x1) {
+                    this._x1 = x1;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
+            Object.defineProperty(window.SVGPathSegCurvetoQuadraticAbs.prototype, "y1", {
+                get: function get() {
                     return this._y1;
-                }, set: function set(y1) {
-                    this._y1 = y1;this._segmentChanged();
-                }, enumerable: true });
+                },
+                set: function set(y1) {
+                    this._y1 = y1;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
 
             window.SVGPathSegCurvetoQuadraticRel = function (owningPathSegList, x, y, x1, y1) {
                 window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL, "q", owningPathSegList);
             window.SVGPathSegCurvetoQuadraticRel.prototype.clone = function () {
                 return new window.SVGPathSegCurvetoQuadraticRel(undefined, this._x, this._y, this._x1, this._y1);
             };
-            Object.defineProperty(window.SVGPathSegCurvetoQuadraticRel.prototype, "x", { get: function get() {
+            Object.defineProperty(window.SVGPathSegCurvetoQuadraticRel.prototype, "x", {
+                get: function get() {
                     return this._x;
-                }, set: function set(x) {
-                    this._x = x;this._segmentChanged();
-                }, enumerable: true });
-            Object.defineProperty(window.SVGPathSegCurvetoQuadraticRel.prototype, "y", { get: function get() {
+                },
+                set: function set(x) {
+                    this._x = x;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
+            Object.defineProperty(window.SVGPathSegCurvetoQuadraticRel.prototype, "y", {
+                get: function get() {
                     return this._y;
-                }, set: function set(y) {
-                    this._y = y;this._segmentChanged();
-                }, enumerable: true });
-            Object.defineProperty(window.SVGPathSegCurvetoQuadraticRel.prototype, "x1", { get: function get() {
+                },
+                set: function set(y) {
+                    this._y = y;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
+            Object.defineProperty(window.SVGPathSegCurvetoQuadraticRel.prototype, "x1", {
+                get: function get() {
                     return this._x1;
-                }, set: function set(x1) {
-                    this._x1 = x1;this._segmentChanged();
-                }, enumerable: true });
-            Object.defineProperty(window.SVGPathSegCurvetoQuadraticRel.prototype, "y1", { get: function get() {
+                },
+                set: function set(x1) {
+                    this._x1 = x1;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
+            Object.defineProperty(window.SVGPathSegCurvetoQuadraticRel.prototype, "y1", {
+                get: function get() {
                     return this._y1;
-                }, set: function set(y1) {
-                    this._y1 = y1;this._segmentChanged();
-                }, enumerable: true });
+                },
+                set: function set(y1) {
+                    this._y1 = y1;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
 
             window.SVGPathSegArcAbs = function (owningPathSegList, x, y, r1, r2, angle, largeArcFlag, sweepFlag) {
                 window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_ARC_ABS, "A", owningPathSegList);
             window.SVGPathSegArcAbs.prototype.clone = function () {
                 return new window.SVGPathSegArcAbs(undefined, this._x, this._y, this._r1, this._r2, this._angle, this._largeArcFlag, this._sweepFlag);
             };
-            Object.defineProperty(window.SVGPathSegArcAbs.prototype, "x", { get: function get() {
+            Object.defineProperty(window.SVGPathSegArcAbs.prototype, "x", {
+                get: function get() {
                     return this._x;
-                }, set: function set(x) {
-                    this._x = x;this._segmentChanged();
-                }, enumerable: true });
-            Object.defineProperty(window.SVGPathSegArcAbs.prototype, "y", { get: function get() {
+                },
+                set: function set(x) {
+                    this._x = x;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
+            Object.defineProperty(window.SVGPathSegArcAbs.prototype, "y", {
+                get: function get() {
                     return this._y;
-                }, set: function set(y) {
-                    this._y = y;this._segmentChanged();
-                }, enumerable: true });
-            Object.defineProperty(window.SVGPathSegArcAbs.prototype, "r1", { get: function get() {
+                },
+                set: function set(y) {
+                    this._y = y;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
+            Object.defineProperty(window.SVGPathSegArcAbs.prototype, "r1", {
+                get: function get() {
                     return this._r1;
-                }, set: function set(r1) {
-                    this._r1 = r1;this._segmentChanged();
-                }, enumerable: true });
-            Object.defineProperty(window.SVGPathSegArcAbs.prototype, "r2", { get: function get() {
+                },
+                set: function set(r1) {
+                    this._r1 = r1;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
+            Object.defineProperty(window.SVGPathSegArcAbs.prototype, "r2", {
+                get: function get() {
                     return this._r2;
-                }, set: function set(r2) {
-                    this._r2 = r2;this._segmentChanged();
-                }, enumerable: true });
-            Object.defineProperty(window.SVGPathSegArcAbs.prototype, "angle", { get: function get() {
+                },
+                set: function set(r2) {
+                    this._r2 = r2;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
+            Object.defineProperty(window.SVGPathSegArcAbs.prototype, "angle", {
+                get: function get() {
                     return this._angle;
-                }, set: function set(angle) {
-                    this._angle = angle;this._segmentChanged();
-                }, enumerable: true });
-            Object.defineProperty(window.SVGPathSegArcAbs.prototype, "largeArcFlag", { get: function get() {
+                },
+                set: function set(angle) {
+                    this._angle = angle;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
+            Object.defineProperty(window.SVGPathSegArcAbs.prototype, "largeArcFlag", {
+                get: function get() {
                     return this._largeArcFlag;
-                }, set: function set(largeArcFlag) {
-                    this._largeArcFlag = largeArcFlag;this._segmentChanged();
-                }, enumerable: true });
-            Object.defineProperty(window.SVGPathSegArcAbs.prototype, "sweepFlag", { get: function get() {
+                },
+                set: function set(largeArcFlag) {
+                    this._largeArcFlag = largeArcFlag;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
+            Object.defineProperty(window.SVGPathSegArcAbs.prototype, "sweepFlag", {
+                get: function get() {
                     return this._sweepFlag;
-                }, set: function set(sweepFlag) {
-                    this._sweepFlag = sweepFlag;this._segmentChanged();
-                }, enumerable: true });
+                },
+                set: function set(sweepFlag) {
+                    this._sweepFlag = sweepFlag;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
 
             window.SVGPathSegArcRel = function (owningPathSegList, x, y, r1, r2, angle, largeArcFlag, sweepFlag) {
                 window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_ARC_REL, "a", owningPathSegList);
             window.SVGPathSegArcRel.prototype.clone = function () {
                 return new window.SVGPathSegArcRel(undefined, this._x, this._y, this._r1, this._r2, this._angle, this._largeArcFlag, this._sweepFlag);
             };
-            Object.defineProperty(window.SVGPathSegArcRel.prototype, "x", { get: function get() {
+            Object.defineProperty(window.SVGPathSegArcRel.prototype, "x", {
+                get: function get() {
                     return this._x;
-                }, set: function set(x) {
-                    this._x = x;this._segmentChanged();
-                }, enumerable: true });
-            Object.defineProperty(window.SVGPathSegArcRel.prototype, "y", { get: function get() {
+                },
+                set: function set(x) {
+                    this._x = x;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
+            Object.defineProperty(window.SVGPathSegArcRel.prototype, "y", {
+                get: function get() {
                     return this._y;
-                }, set: function set(y) {
-                    this._y = y;this._segmentChanged();
-                }, enumerable: true });
-            Object.defineProperty(window.SVGPathSegArcRel.prototype, "r1", { get: function get() {
+                },
+                set: function set(y) {
+                    this._y = y;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
+            Object.defineProperty(window.SVGPathSegArcRel.prototype, "r1", {
+                get: function get() {
                     return this._r1;
-                }, set: function set(r1) {
-                    this._r1 = r1;this._segmentChanged();
-                }, enumerable: true });
-            Object.defineProperty(window.SVGPathSegArcRel.prototype, "r2", { get: function get() {
+                },
+                set: function set(r1) {
+                    this._r1 = r1;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
+            Object.defineProperty(window.SVGPathSegArcRel.prototype, "r2", {
+                get: function get() {
                     return this._r2;
-                }, set: function set(r2) {
-                    this._r2 = r2;this._segmentChanged();
-                }, enumerable: true });
-            Object.defineProperty(window.SVGPathSegArcRel.prototype, "angle", { get: function get() {
+                },
+                set: function set(r2) {
+                    this._r2 = r2;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
+            Object.defineProperty(window.SVGPathSegArcRel.prototype, "angle", {
+                get: function get() {
                     return this._angle;
-                }, set: function set(angle) {
-                    this._angle = angle;this._segmentChanged();
-                }, enumerable: true });
-            Object.defineProperty(window.SVGPathSegArcRel.prototype, "largeArcFlag", { get: function get() {
+                },
+                set: function set(angle) {
+                    this._angle = angle;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
+            Object.defineProperty(window.SVGPathSegArcRel.prototype, "largeArcFlag", {
+                get: function get() {
                     return this._largeArcFlag;
-                }, set: function set(largeArcFlag) {
-                    this._largeArcFlag = largeArcFlag;this._segmentChanged();
-                }, enumerable: true });
-            Object.defineProperty(window.SVGPathSegArcRel.prototype, "sweepFlag", { get: function get() {
+                },
+                set: function set(largeArcFlag) {
+                    this._largeArcFlag = largeArcFlag;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
+            Object.defineProperty(window.SVGPathSegArcRel.prototype, "sweepFlag", {
+                get: function get() {
                     return this._sweepFlag;
-                }, set: function set(sweepFlag) {
-                    this._sweepFlag = sweepFlag;this._segmentChanged();
-                }, enumerable: true });
+                },
+                set: function set(sweepFlag) {
+                    this._sweepFlag = sweepFlag;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
 
             window.SVGPathSegLinetoHorizontalAbs = function (owningPathSegList, x) {
                 window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS, "H", owningPathSegList);
             window.SVGPathSegLinetoHorizontalAbs.prototype.clone = function () {
                 return new window.SVGPathSegLinetoHorizontalAbs(undefined, this._x);
             };
-            Object.defineProperty(window.SVGPathSegLinetoHorizontalAbs.prototype, "x", { get: function get() {
+            Object.defineProperty(window.SVGPathSegLinetoHorizontalAbs.prototype, "x", {
+                get: function get() {
                     return this._x;
-                }, set: function set(x) {
-                    this._x = x;this._segmentChanged();
-                }, enumerable: true });
+                },
+                set: function set(x) {
+                    this._x = x;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
 
             window.SVGPathSegLinetoHorizontalRel = function (owningPathSegList, x) {
                 window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL, "h", owningPathSegList);
             window.SVGPathSegLinetoHorizontalRel.prototype.clone = function () {
                 return new window.SVGPathSegLinetoHorizontalRel(undefined, this._x);
             };
-            Object.defineProperty(window.SVGPathSegLinetoHorizontalRel.prototype, "x", { get: function get() {
+            Object.defineProperty(window.SVGPathSegLinetoHorizontalRel.prototype, "x", {
+                get: function get() {
                     return this._x;
-                }, set: function set(x) {
-                    this._x = x;this._segmentChanged();
-                }, enumerable: true });
+                },
+                set: function set(x) {
+                    this._x = x;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
 
             window.SVGPathSegLinetoVerticalAbs = function (owningPathSegList, y) {
                 window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS, "V", owningPathSegList);
             window.SVGPathSegLinetoVerticalAbs.prototype.clone = function () {
                 return new window.SVGPathSegLinetoVerticalAbs(undefined, this._y);
             };
-            Object.defineProperty(window.SVGPathSegLinetoVerticalAbs.prototype, "y", { get: function get() {
+            Object.defineProperty(window.SVGPathSegLinetoVerticalAbs.prototype, "y", {
+                get: function get() {
                     return this._y;
-                }, set: function set(y) {
-                    this._y = y;this._segmentChanged();
-                }, enumerable: true });
+                },
+                set: function set(y) {
+                    this._y = y;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
 
             window.SVGPathSegLinetoVerticalRel = function (owningPathSegList, y) {
                 window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL, "v", owningPathSegList);
             window.SVGPathSegLinetoVerticalRel.prototype.clone = function () {
                 return new window.SVGPathSegLinetoVerticalRel(undefined, this._y);
             };
-            Object.defineProperty(window.SVGPathSegLinetoVerticalRel.prototype, "y", { get: function get() {
+            Object.defineProperty(window.SVGPathSegLinetoVerticalRel.prototype, "y", {
+                get: function get() {
                     return this._y;
-                }, set: function set(y) {
-                    this._y = y;this._segmentChanged();
-                }, enumerable: true });
+                },
+                set: function set(y) {
+                    this._y = y;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
 
             window.SVGPathSegCurvetoCubicSmoothAbs = function (owningPathSegList, x, y, x2, y2) {
                 window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS, "S", owningPathSegList);
             window.SVGPathSegCurvetoCubicSmoothAbs.prototype.clone = function () {
                 return new window.SVGPathSegCurvetoCubicSmoothAbs(undefined, this._x, this._y, this._x2, this._y2);
             };
-            Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothAbs.prototype, "x", { get: function get() {
+            Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothAbs.prototype, "x", {
+                get: function get() {
                     return this._x;
-                }, set: function set(x) {
-                    this._x = x;this._segmentChanged();
-                }, enumerable: true });
-            Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothAbs.prototype, "y", { get: function get() {
+                },
+                set: function set(x) {
+                    this._x = x;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
+            Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothAbs.prototype, "y", {
+                get: function get() {
                     return this._y;
-                }, set: function set(y) {
-                    this._y = y;this._segmentChanged();
-                }, enumerable: true });
-            Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothAbs.prototype, "x2", { get: function get() {
+                },
+                set: function set(y) {
+                    this._y = y;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
+            Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothAbs.prototype, "x2", {
+                get: function get() {
                     return this._x2;
-                }, set: function set(x2) {
-                    this._x2 = x2;this._segmentChanged();
-                }, enumerable: true });
-            Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothAbs.prototype, "y2", { get: function get() {
+                },
+                set: function set(x2) {
+                    this._x2 = x2;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
+            Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothAbs.prototype, "y2", {
+                get: function get() {
                     return this._y2;
-                }, set: function set(y2) {
-                    this._y2 = y2;this._segmentChanged();
-                }, enumerable: true });
+                },
+                set: function set(y2) {
+                    this._y2 = y2;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
 
             window.SVGPathSegCurvetoCubicSmoothRel = function (owningPathSegList, x, y, x2, y2) {
                 window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL, "s", owningPathSegList);
             window.SVGPathSegCurvetoCubicSmoothRel.prototype.clone = function () {
                 return new window.SVGPathSegCurvetoCubicSmoothRel(undefined, this._x, this._y, this._x2, this._y2);
             };
-            Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothRel.prototype, "x", { get: function get() {
+            Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothRel.prototype, "x", {
+                get: function get() {
                     return this._x;
-                }, set: function set(x) {
-                    this._x = x;this._segmentChanged();
-                }, enumerable: true });
-            Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothRel.prototype, "y", { get: function get() {
+                },
+                set: function set(x) {
+                    this._x = x;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
+            Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothRel.prototype, "y", {
+                get: function get() {
                     return this._y;
-                }, set: function set(y) {
-                    this._y = y;this._segmentChanged();
-                }, enumerable: true });
-            Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothRel.prototype, "x2", { get: function get() {
+                },
+                set: function set(y) {
+                    this._y = y;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
+            Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothRel.prototype, "x2", {
+                get: function get() {
                     return this._x2;
-                }, set: function set(x2) {
-                    this._x2 = x2;this._segmentChanged();
-                }, enumerable: true });
-            Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothRel.prototype, "y2", { get: function get() {
+                },
+                set: function set(x2) {
+                    this._x2 = x2;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
+            Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothRel.prototype, "y2", {
+                get: function get() {
                     return this._y2;
-                }, set: function set(y2) {
-                    this._y2 = y2;this._segmentChanged();
-                }, enumerable: true });
+                },
+                set: function set(y2) {
+                    this._y2 = y2;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
 
             window.SVGPathSegCurvetoQuadraticSmoothAbs = function (owningPathSegList, x, y) {
                 window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS, "T", owningPathSegList);
             window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype.clone = function () {
                 return new window.SVGPathSegCurvetoQuadraticSmoothAbs(undefined, this._x, this._y);
             };
-            Object.defineProperty(window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype, "x", { get: function get() {
+            Object.defineProperty(window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype, "x", {
+                get: function get() {
                     return this._x;
-                }, set: function set(x) {
-                    this._x = x;this._segmentChanged();
-                }, enumerable: true });
-            Object.defineProperty(window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype, "y", { get: function get() {
+                },
+                set: function set(x) {
+                    this._x = x;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
+            Object.defineProperty(window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype, "y", {
+                get: function get() {
                     return this._y;
-                }, set: function set(y) {
-                    this._y = y;this._segmentChanged();
-                }, enumerable: true });
+                },
+                set: function set(y) {
+                    this._y = y;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
 
             window.SVGPathSegCurvetoQuadraticSmoothRel = function (owningPathSegList, x, y) {
                 window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL, "t", owningPathSegList);
             window.SVGPathSegCurvetoQuadraticSmoothRel.prototype.clone = function () {
                 return new window.SVGPathSegCurvetoQuadraticSmoothRel(undefined, this._x, this._y);
             };
-            Object.defineProperty(window.SVGPathSegCurvetoQuadraticSmoothRel.prototype, "x", { get: function get() {
+            Object.defineProperty(window.SVGPathSegCurvetoQuadraticSmoothRel.prototype, "x", {
+                get: function get() {
                     return this._x;
-                }, set: function set(x) {
-                    this._x = x;this._segmentChanged();
-                }, enumerable: true });
-            Object.defineProperty(window.SVGPathSegCurvetoQuadraticSmoothRel.prototype, "y", { get: function get() {
+                },
+                set: function set(x) {
+                    this._x = x;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
+            Object.defineProperty(window.SVGPathSegCurvetoQuadraticSmoothRel.prototype, "y", {
+                get: function get() {
                     return this._y;
-                }, set: function set(y) {
-                    this._y = y;this._segmentChanged();
-                }, enumerable: true });
+                },
+                set: function set(y) {
+                    this._y = y;
+                    this._segmentChanged();
+                },
+                enumerable: true
+            });
 
             // Add createSVGPathSeg* functions to window.SVGPathElement.
             // Spec: http://www.w3.org/TR/SVG11/single-page.html#paths-Interfacewindow.SVGPathElement.
                 this._list = this._parsePath(this._pathElement.getAttribute("d"));
 
                 // Use a MutationObserver to catch changes to the path's "d" attribute.
-                this._mutationObserverConfig = { "attributes": true, "attributeFilter": ["d"] };
+                this._mutationObserverConfig = {
+                    "attributes": true,
+                    "attributeFilter": ["d"]
+                };
                 this._pathElementMutationObserver = new MutationObserver(this._updateListFromPathMutations.bind(this));
                 this._pathElementMutationObserver.observe(this._pathElement, this._mutationObserverConfig);
             };
                 enumerable: true
             });
             // FIXME: The following are not implemented and simply return window.SVGPathElement.pathSegList.
-            Object.defineProperty(window.SVGPathElement.prototype, "normalizedPathSegList", { get: function get() {
+            Object.defineProperty(window.SVGPathElement.prototype, "normalizedPathSegList", {
+                get: function get() {
                     return this.pathSegList;
-                }, enumerable: true });
-            Object.defineProperty(window.SVGPathElement.prototype, "animatedPathSegList", { get: function get() {
+                },
+                enumerable: true
+            });
+            Object.defineProperty(window.SVGPathElement.prototype, "animatedPathSegList", {
+                get: function get() {
                     return this.pathSegList;
-                }, enumerable: true });
-            Object.defineProperty(window.SVGPathElement.prototype, "animatedNormalizedPathSegList", { get: function get() {
+                },
+                enumerable: true
+            });
+            Object.defineProperty(window.SVGPathElement.prototype, "animatedNormalizedPathSegList", {
+                get: function get() {
                     return this.pathSegList;
-                }, enumerable: true });
+                },
+                enumerable: true
+            });
 
             // Process any pending mutations to the path element and update the list as needed.
             // This should be the first call of all public functions and is needed because
                             this._skipOptionalSpaces();
                             return new window.SVGPathSegClosePath(owningPathSegList);
                         case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL:
-                            var points = { x1: this._parseNumber(), y1: this._parseNumber(), x2: this._parseNumber(), y2: this._parseNumber(), x: this._parseNumber(), y: this._parseNumber() };
+                            var points = {
+                                x1: this._parseNumber(),
+                                y1: this._parseNumber(),
+                                x2: this._parseNumber(),
+                                y2: this._parseNumber(),
+                                x: this._parseNumber(),
+                                y: this._parseNumber()
+                            };
                             return new window.SVGPathSegCurvetoCubicRel(owningPathSegList, points.x, points.y, points.x1, points.y1, points.x2, points.y2);
                         case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS:
-                            var points = { x1: this._parseNumber(), y1: this._parseNumber(), x2: this._parseNumber(), y2: this._parseNumber(), x: this._parseNumber(), y: this._parseNumber() };
+                            var points = {
+                                x1: this._parseNumber(),
+                                y1: this._parseNumber(),
+                                x2: this._parseNumber(),
+                                y2: this._parseNumber(),
+                                x: this._parseNumber(),
+                                y: this._parseNumber()
+                            };
                             return new window.SVGPathSegCurvetoCubicAbs(owningPathSegList, points.x, points.y, points.x1, points.y1, points.x2, points.y2);
                         case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL:
-                            var points = { x2: this._parseNumber(), y2: this._parseNumber(), x: this._parseNumber(), y: this._parseNumber() };
+                            var points = {
+                                x2: this._parseNumber(),
+                                y2: this._parseNumber(),
+                                x: this._parseNumber(),
+                                y: this._parseNumber()
+                            };
                             return new window.SVGPathSegCurvetoCubicSmoothRel(owningPathSegList, points.x, points.y, points.x2, points.y2);
                         case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS:
-                            var points = { x2: this._parseNumber(), y2: this._parseNumber(), x: this._parseNumber(), y: this._parseNumber() };
+                            var points = {
+                                x2: this._parseNumber(),
+                                y2: this._parseNumber(),
+                                x: this._parseNumber(),
+                                y: this._parseNumber()
+                            };
                             return new window.SVGPathSegCurvetoCubicSmoothAbs(owningPathSegList, points.x, points.y, points.x2, points.y2);
                         case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL:
-                            var points = { x1: this._parseNumber(), y1: this._parseNumber(), x: this._parseNumber(), y: this._parseNumber() };
+                            var points = {
+                                x1: this._parseNumber(),
+                                y1: this._parseNumber(),
+                                x: this._parseNumber(),
+                                y: this._parseNumber()
+                            };
                             return new window.SVGPathSegCurvetoQuadraticRel(owningPathSegList, points.x, points.y, points.x1, points.y1);
                         case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS:
-                            var points = { x1: this._parseNumber(), y1: this._parseNumber(), x: this._parseNumber(), y: this._parseNumber() };
+                            var points = {
+                                x1: this._parseNumber(),
+                                y1: this._parseNumber(),
+                                x: this._parseNumber(),
+                                y: this._parseNumber()
+                            };
                             return new window.SVGPathSegCurvetoQuadraticAbs(owningPathSegList, points.x, points.y, points.x1, points.y1);
                         case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL:
                             return new window.SVGPathSegCurvetoQuadraticSmoothRel(owningPathSegList, this._parseNumber(), this._parseNumber());
                         case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS:
                             return new window.SVGPathSegCurvetoQuadraticSmoothAbs(owningPathSegList, this._parseNumber(), this._parseNumber());
                         case window.SVGPathSeg.PATHSEG_ARC_REL:
-                            var points = { x1: this._parseNumber(), y1: this._parseNumber(), arcAngle: this._parseNumber(), arcLarge: this._parseArcFlag(), arcSweep: this._parseArcFlag(), x: this._parseNumber(), y: this._parseNumber() };
+                            var points = {
+                                x1: this._parseNumber(),
+                                y1: this._parseNumber(),
+                                arcAngle: this._parseNumber(),
+                                arcLarge: this._parseArcFlag(),
+                                arcSweep: this._parseArcFlag(),
+                                x: this._parseNumber(),
+                                y: this._parseNumber()
+                            };
                             return new window.SVGPathSegArcRel(owningPathSegList, points.x, points.y, points.x1, points.y1, points.arcAngle, points.arcLarge, points.arcSweep);
                         case window.SVGPathSeg.PATHSEG_ARC_ABS:
-                            var points = { x1: this._parseNumber(), y1: this._parseNumber(), arcAngle: this._parseNumber(), arcLarge: this._parseArcFlag(), arcSweep: this._parseArcFlag(), x: this._parseNumber(), y: this._parseNumber() };
+                            var points = {
+                                x1: this._parseNumber(),
+                                y1: this._parseNumber(),
+                                arcAngle: this._parseNumber(),
+                                arcLarge: this._parseArcFlag(),
+                                arcSweep: this._parseArcFlag(),
+                                x: this._parseNumber(),
+                                y: this._parseNumber()
+                            };
                             return new window.SVGPathSegArcAbs(owningPathSegList, points.x, points.y, points.x1, points.y1, points.arcAngle, points.arcLarge, points.arcSweep);
                         default:
                             throw "Unknown path seg type.";
 
     /* jshint ignore:end */
 
-    c3_chart_fn.axis = function () {};
-    c3_chart_fn.axis.labels = function (labels) {
+    Chart.prototype.axis = function () {};
+    Chart.prototype.axis.labels = function (labels) {
         var $$ = this.internal;
         if (arguments.length) {
             Object.keys(labels).forEach(function (axisId) {
         }
         // TODO: return some values?
     };
-    c3_chart_fn.axis.max = function (max) {
+    Chart.prototype.axis.max = function (max) {
         var $$ = this.internal,
             config = $$.config;
         if (arguments.length) {
             };
         }
     };
-    c3_chart_fn.axis.min = function (min) {
+    Chart.prototype.axis.min = function (min) {
         var $$ = this.internal,
             config = $$.config;
         if (arguments.length) {
             };
         }
     };
-    c3_chart_fn.axis.range = function (range) {
+    Chart.prototype.axis.range = function (range) {
         if (arguments.length) {
             if (isDefined(range.max)) {
                 this.axis.max(range.max);
         }
     };
 
-    c3_chart_fn.category = function (i, category) {
+    Chart.prototype.category = function (i, category) {
         var $$ = this.internal,
             config = $$.config;
         if (arguments.length > 1) {
         }
         return config.axis_x_categories[i];
     };
-    c3_chart_fn.categories = function (categories) {
+    Chart.prototype.categories = function (categories) {
         var $$ = this.internal,
             config = $$.config;
         if (!arguments.length) {
         return config.axis_x_categories;
     };
 
-    c3_chart_fn.resize = function (size) {
+    Chart.prototype.resize = function (size) {
         var $$ = this.internal,
             config = $$.config;
         config.size_width = size ? size.width : null;
         this.flush();
     };
 
-    c3_chart_fn.flush = function () {
+    Chart.prototype.flush = function () {
         var $$ = this.internal;
         $$.updateAndRedraw({ withLegend: true, withTransition: false, withTransitionForTransform: false });
     };
 
-    c3_chart_fn.destroy = function () {
+    Chart.prototype.destroy = function () {
         var $$ = this.internal;
 
         window.clearInterval($$.intervalForObserveInserted);
     };
 
     // TODO: fix
-    c3_chart_fn.color = function (id) {
+    Chart.prototype.color = function (id) {
         var $$ = this.internal;
         return $$.color(id); // more patterns
     };
 
-    c3_chart_fn.data = function (targetIds) {
+    Chart.prototype.data = function (targetIds) {
         var targets = this.internal.data.targets;
         return typeof targetIds === 'undefined' ? targets : targets.filter(function (t) {
             return [].concat(targetIds).indexOf(t.id) >= 0;
         });
     };
-    c3_chart_fn.data.shown = function (targetIds) {
+    Chart.prototype.data.shown = function (targetIds) {
         return this.internal.filterTargetsToShow(this.data(targetIds));
     };
-    c3_chart_fn.data.values = function (targetId) {
+    Chart.prototype.data.values = function (targetId) {
         var targets,
             values = null;
         if (targetId) {
         }
         return values;
     };
-    c3_chart_fn.data.names = function (names) {
+    Chart.prototype.data.names = function (names) {
         this.internal.clearLegendItemTextBoxCache();
         return this.internal.updateDataAttributes('names', names);
     };
-    c3_chart_fn.data.colors = function (colors) {
+    Chart.prototype.data.colors = function (colors) {
         return this.internal.updateDataAttributes('colors', colors);
     };
-    c3_chart_fn.data.axes = function (axes) {
+    Chart.prototype.data.axes = function (axes) {
         return this.internal.updateDataAttributes('axes', axes);
     };
 
-    c3_chart_fn.flow = function (args) {
+    Chart.prototype.flow = function (args) {
         var $$ = this.internal,
             targets,
             data,
         });
     };
 
-    c3_chart_internal_fn.generateFlow = function (args) {
+    ChartInternal.prototype.generateFlow = function (args) {
         var $$ = this,
             config = $$.config,
             d3 = $$.d3;
         };
     };
 
-    c3_chart_fn.focus = function (targetIds) {
+    Chart.prototype.focus = function (targetIds) {
         var $$ = this.internal,
             candidates;
 
         });
     };
 
-    c3_chart_fn.defocus = function (targetIds) {
+    Chart.prototype.defocus = function (targetIds) {
         var $$ = this.internal,
             candidates;
 
         $$.defocusedTargetIds = targetIds;
     };
 
-    c3_chart_fn.revert = function (targetIds) {
+    Chart.prototype.revert = function (targetIds) {
         var $$ = this.internal,
             candidates;
 
         $$.defocusedTargetIds = [];
     };
 
-    c3_chart_fn.xgrids = function (grids) {
+    Chart.prototype.xgrids = function (grids) {
         var $$ = this.internal,
             config = $$.config;
         if (!grids) {
         $$.redrawWithoutRescale();
         return config.grid_x_lines;
     };
-    c3_chart_fn.xgrids.add = function (grids) {
+    Chart.prototype.xgrids.add = function (grids) {
         var $$ = this.internal;
         return this.xgrids($$.config.grid_x_lines.concat(grids ? grids : []));
     };
-    c3_chart_fn.xgrids.remove = function (params) {
+    Chart.prototype.xgrids.remove = function (params) {
         // TODO: multiple
         var $$ = this.internal;
         $$.removeGridLines(params, true);
     };
 
-    c3_chart_fn.ygrids = function (grids) {
+    Chart.prototype.ygrids = function (grids) {
         var $$ = this.internal,
             config = $$.config;
         if (!grids) {
         $$.redrawWithoutRescale();
         return config.grid_y_lines;
     };
-    c3_chart_fn.ygrids.add = function (grids) {
+    Chart.prototype.ygrids.add = function (grids) {
         var $$ = this.internal;
         return this.ygrids($$.config.grid_y_lines.concat(grids ? grids : []));
     };
-    c3_chart_fn.ygrids.remove = function (params) {
+    Chart.prototype.ygrids.remove = function (params) {
         // TODO: multiple
         var $$ = this.internal;
         $$.removeGridLines(params, false);
     };
 
-    c3_chart_fn.groups = function (groups) {
+    Chart.prototype.groups = function (groups) {
         var $$ = this.internal,
             config = $$.config;
         if (isUndefined(groups)) {
         return config.data_groups;
     };
 
-    c3_chart_fn.legend = function () {};
-    c3_chart_fn.legend.show = function (targetIds) {
+    Chart.prototype.legend = function () {};
+    Chart.prototype.legend.show = function (targetIds) {
         var $$ = this.internal;
         $$.showLegend($$.mapToTargetIds(targetIds));
         $$.updateAndRedraw({ withLegend: true });
     };
-    c3_chart_fn.legend.hide = function (targetIds) {
+    Chart.prototype.legend.hide = function (targetIds) {
         var $$ = this.internal;
         $$.hideLegend($$.mapToTargetIds(targetIds));
-        $$.updateAndRedraw({ withLegend: true });
+        $$.updateAndRedraw({ withLegend: false });
     };
 
-    c3_chart_fn.load = function (args) {
+    Chart.prototype.load = function (args) {
         var $$ = this.internal,
             config = $$.config;
         // update xs if specified
         }
         // update names if exists
         if ('names' in args) {
-            c3_chart_fn.data.names.bind(this)(args.names);
+            Chart.prototype.data.names.bind(this)(args.names);
         }
         // update classes if exists
         if ('classes' in args) {
         }
     };
 
-    c3_chart_fn.unload = function (args) {
+    Chart.prototype.unload = function (args) {
         var $$ = this.internal;
         args = args || {};
         if (args instanceof Array) {
         });
     };
 
-    c3_chart_fn.regions = function (regions) {
+    Chart.prototype.regions = function (regions) {
         var $$ = this.internal,
             config = $$.config;
         if (!regions) {
         $$.redrawWithoutRescale();
         return config.regions;
     };
-    c3_chart_fn.regions.add = function (regions) {
+    Chart.prototype.regions.add = function (regions) {
         var $$ = this.internal,
             config = $$.config;
         if (!regions) {
         $$.redrawWithoutRescale();
         return config.regions;
     };
-    c3_chart_fn.regions.remove = function (options) {
+    Chart.prototype.regions.remove = function (options) {
         var $$ = this.internal,
             config = $$.config,
             duration,
         return config.regions;
     };
 
-    c3_chart_fn.selected = function (targetId) {
+    Chart.prototype.selected = function (targetId) {
         var $$ = this.internal,
             d3 = $$.d3;
         return d3.merge($$.main.selectAll('.' + CLASS.shapes + $$.getTargetSelectorSuffix(targetId)).selectAll('.' + CLASS.shape).filter(function () {
             });
         }));
     };
-    c3_chart_fn.select = function (ids, indices, resetOther) {
+    Chart.prototype.select = function (ids, indices, resetOther) {
         var $$ = this.internal,
             d3 = $$.d3,
             config = $$.config;
             }
         });
     };
-    c3_chart_fn.unselect = function (ids, indices) {
+    Chart.prototype.unselect = function (ids, indices) {
         var $$ = this.internal,
             d3 = $$.d3,
             config = $$.config;
         });
     };
 
-    c3_chart_fn.show = function (targetIds, options) {
+    Chart.prototype.show = function (targetIds, options) {
         var $$ = this.internal,
             targets;
 
         $$.redraw({ withUpdateOrgXDomain: true, withUpdateXDomain: true, withLegend: true });
     };
 
-    c3_chart_fn.hide = function (targetIds, options) {
+    Chart.prototype.hide = function (targetIds, options) {
         var $$ = this.internal,
             targets;
 
         $$.redraw({ withUpdateOrgXDomain: true, withUpdateXDomain: true, withLegend: true });
     };
 
-    c3_chart_fn.toggle = function (targetIds, options) {
+    Chart.prototype.toggle = function (targetIds, options) {
         var that = this,
             $$ = this.internal;
         $$.mapToTargetIds(targetIds).forEach(function (targetId) {
         });
     };
 
-    c3_chart_fn.tooltip = function () {};
-    c3_chart_fn.tooltip.show = function (args) {
+    Chart.prototype.tooltip = function () {};
+    Chart.prototype.tooltip.show = function (args) {
         var $$ = this.internal,
             targets,
             data,
 
         $$.config.tooltip_onshow.call($$, data);
     };
-    c3_chart_fn.tooltip.hide = function () {
+    Chart.prototype.tooltip.hide = function () {
         // TODO: get target data by checking the state of focus
         this.internal.dispatchEvent('mouseout', 0);
 
         this.internal.config.tooltip_onhide.call(this);
     };
 
-    c3_chart_fn.transform = function (type, targetIds) {
+    Chart.prototype.transform = function (type, targetIds) {
         var $$ = this.internal,
             options = ['pie', 'donut'].indexOf(type) >= 0 ? { withTransform: true } : null;
         $$.transformTo(targetIds, type, options);
     };
 
-    c3_chart_internal_fn.transformTo = function (targetIds, type, optionsForRedraw) {
+    ChartInternal.prototype.transformTo = function (targetIds, type, optionsForRedraw) {
         var $$ = this,
             withTransitionForAxis = !$$.hasArcType(),
             options = optionsForRedraw || { withTransitionForAxis: withTransitionForAxis };
         $$.updateAndRedraw(options);
     };
 
-    c3_chart_fn.x = function (x) {
+    Chart.prototype.x = function (x) {
         var $$ = this.internal;
         if (arguments.length) {
             $$.updateTargetX($$.data.targets, x);
         }
         return $$.data.xs;
     };
-    c3_chart_fn.xs = function (xs) {
+    Chart.prototype.xs = function (xs) {
         var $$ = this.internal;
         if (arguments.length) {
             $$.updateTargetXs($$.data.targets, xs);
         return $$.data.xs;
     };
 
-    c3_chart_fn.zoom = function (domain) {
+    Chart.prototype.zoom = function (domain) {
         var $$ = this.internal;
         if (domain) {
             if ($$.isTimeSeries()) {
             return $$.x.domain();
         }
     };
-    c3_chart_fn.zoom.enable = function (enabled) {
+    Chart.prototype.zoom.enable = function (enabled) {
         var $$ = this.internal;
         $$.config.zoom_enabled = enabled;
         $$.updateAndRedraw();
     };
-    c3_chart_fn.unzoom = function () {
+    Chart.prototype.unzoom = function () {
         var $$ = this.internal;
         if ($$.config.subchart_show) {
             $$.brush.clear();
         }
     };
 
-    c3_chart_fn.zoom.max = function (max) {
+    Chart.prototype.zoom.max = function (max) {
         var $$ = this.internal,
             config = $$.config,
             d3 = $$.d3;
         }
     };
 
-    c3_chart_fn.zoom.min = function (min) {
+    Chart.prototype.zoom.min = function (min) {
         var $$ = this.internal,
             config = $$.config,
             d3 = $$.d3;
         }
     };
 
-    c3_chart_fn.zoom.range = function (range) {
+    Chart.prototype.zoom.range = function (range) {
         if (arguments.length) {
             if (isDefined(range.max)) {
                 this.domain.max(range.max);
         }
     };
 
-    c3_chart_internal_fn.initPie = function () {
+    ChartInternal.prototype.initPie = function () {
         var $$ = this,
             d3 = $$.d3;
         $$.pie = d3.pie().value(function (d) {
         $$.pie.sort(orderFct || null);
     };
 
-    c3_chart_internal_fn.updateRadius = function () {
+    ChartInternal.prototype.updateRadius = function () {
         var $$ = this,
             config = $$.config,
             w = config.gauge_width || config.donut_width,
         $$.gaugeArcWidth = w ? w : gaugeArcWidth <= $$.radius - $$.innerRadius ? $$.radius - $$.innerRadius : gaugeArcWidth <= $$.radius ? gaugeArcWidth : $$.radius;
     };
 
-    c3_chart_internal_fn.updateArc = function () {
+    ChartInternal.prototype.updateArc = function () {
         var $$ = this;
         $$.svgArc = $$.getSvgArc();
         $$.svgArcExpanded = $$.getSvgArcExpanded();
         $$.svgArcExpandedSub = $$.getSvgArcExpanded(0.98);
     };
 
-    c3_chart_internal_fn.updateAngle = function (d) {
+    ChartInternal.prototype.updateAngle = function (d) {
         var $$ = this,
             config = $$.config,
             found = false,
         return found ? d : null;
     };
 
-    c3_chart_internal_fn.getSvgArc = function () {
+    ChartInternal.prototype.getSvgArc = function () {
         var $$ = this,
             hasGaugeType = $$.hasType('gauge'),
             singleArcWidth = $$.gaugeArcWidth / $$.filterTargetsToShow($$.data.targets).length,
         return newArc;
     };
 
-    c3_chart_internal_fn.getSvgArcExpanded = function (rate) {
+    ChartInternal.prototype.getSvgArcExpanded = function (rate) {
         rate = rate || 1;
         var $$ = this,
             hasGaugeType = $$.hasType('gauge'),
         };
     };
 
-    c3_chart_internal_fn.getArc = function (d, withoutUpdate, force) {
+    ChartInternal.prototype.getArc = function (d, withoutUpdate, force) {
         return force || this.isArcType(d.data) ? this.svgArc(d, withoutUpdate) : "M 0 0";
     };
 
-    c3_chart_internal_fn.transformForArcLabel = function (d) {
+    ChartInternal.prototype.transformForArcLabel = function (d) {
         var $$ = this,
             config = $$.config,
             updated = $$.updateAngle(d),
         return translate;
     };
 
-    c3_chart_internal_fn.getArcRatio = function (d) {
+    ChartInternal.prototype.getArcRatio = function (d) {
         var $$ = this,
             config = $$.config,
             whole = Math.PI * ($$.hasType('gauge') && !config.gauge_fullCircle ? 1 : 2);
         return d ? (d.endAngle - d.startAngle) / whole : null;
     };
 
-    c3_chart_internal_fn.convertToArcData = function (d) {
+    ChartInternal.prototype.convertToArcData = function (d) {
         return this.addName({
             id: d.data.id,
             value: d.value,
         });
     };
 
-    c3_chart_internal_fn.textForArcLabel = function (d) {
+    ChartInternal.prototype.textForArcLabel = function (d) {
         var $$ = this,
             updated,
             value,
         return format ? format(value, ratio, id) : $$.defaultArcValueFormat(value, ratio);
     };
 
-    c3_chart_internal_fn.textForGaugeMinMax = function (value, isMax) {
+    ChartInternal.prototype.textForGaugeMinMax = function (value, isMax) {
         var $$ = this,
             format = $$.getGaugeLabelExtents();
 
         return format ? format(value, isMax) : value;
     };
 
-    c3_chart_internal_fn.expandArc = function (targetIds) {
+    ChartInternal.prototype.expandArc = function (targetIds) {
         var $$ = this,
             interval;
 
                 return;
             }
             $$.d3.select(this).selectAll('path').transition().duration($$.expandDuration(d.data.id)).attr("d", $$.svgArcExpanded).transition().duration($$.expandDuration(d.data.id) * 2).attr("d", $$.svgArcExpandedSub).each(function (d) {
-                if ($$.isDonutType(d.data)) {
-                    // callback here
-                }
+                if ($$.isDonutType(d.data)) ;
             });
         });
     };
 
-    c3_chart_internal_fn.unexpandArc = function (targetIds) {
+    ChartInternal.prototype.unexpandArc = function (targetIds) {
         var $$ = this;
 
         if ($$.transiting) {
         $$.svg.selectAll('.' + CLASS.arc);
     };
 
-    c3_chart_internal_fn.expandDuration = function (id) {
+    ChartInternal.prototype.expandDuration = function (id) {
         var $$ = this,
             config = $$.config;
 
         }
     };
 
-    c3_chart_internal_fn.shouldExpand = function (id) {
+    ChartInternal.prototype.shouldExpand = function (id) {
         var $$ = this,
             config = $$.config;
         return $$.isDonutType(id) && config.donut_expand || $$.isGaugeType(id) && config.gauge_expand || $$.isPieType(id) && config.pie_expand;
     };
 
-    c3_chart_internal_fn.shouldShowArcLabel = function () {
+    ChartInternal.prototype.shouldShowArcLabel = function () {
         var $$ = this,
             config = $$.config,
             shouldShow = true;
         return shouldShow;
     };
 
-    c3_chart_internal_fn.meetsArcLabelThreshold = function (ratio) {
+    ChartInternal.prototype.meetsArcLabelThreshold = function (ratio) {
         var $$ = this,
             config = $$.config,
             threshold = $$.hasType('donut') ? config.donut_label_threshold : config.pie_label_threshold;
         return ratio >= threshold;
     };
 
-    c3_chart_internal_fn.getArcLabelFormat = function () {
+    ChartInternal.prototype.getArcLabelFormat = function () {
         var $$ = this,
             config = $$.config,
             format = config.pie_label_format;
         return format;
     };
 
-    c3_chart_internal_fn.getGaugeLabelExtents = function () {
+    ChartInternal.prototype.getGaugeLabelExtents = function () {
         var $$ = this,
             config = $$.config;
         return config.gauge_label_extents;
     };
 
-    c3_chart_internal_fn.getArcTitle = function () {
+    ChartInternal.prototype.getArcTitle = function () {
         var $$ = this;
         return $$.hasType('donut') ? $$.config.donut_title : "";
     };
 
-    c3_chart_internal_fn.updateTargetsForArc = function (targets) {
+    ChartInternal.prototype.updateTargetsForArc = function (targets) {
         var $$ = this,
             main = $$.main,
             mainPies,
         //mainPieUpdate.exit().remove();
     };
 
-    c3_chart_internal_fn.initArc = function () {
+    ChartInternal.prototype.initArc = function () {
         var $$ = this;
         $$.arcs = $$.main.select('.' + CLASS.chart).append("g").attr("class", CLASS.chartArcs).attr("transform", $$.getTranslate('arc'));
         $$.arcs.append('text').attr('class', CLASS.chartArcsTitle).style("text-anchor", "middle").text($$.getArcTitle());
     };
 
-    c3_chart_internal_fn.redrawArc = function (duration, durationForExit, withTransform) {
+    ChartInternal.prototype.redrawArc = function (duration, durationForExit, withTransform) {
         var $$ = this,
             d3 = $$.d3,
             config = $$.config,
             main = $$.main,
             arcs,
             mainArc,
-            backgroundArc,
             arcLabelLines,
             mainArcLabelLine,
             hasGaugeType = $$.hasType('gauge');
 
         if (hasGaugeType) {
             var index = 0;
-            backgroundArc = $$.arcs.select('g.' + CLASS.chartArcsBackground).selectAll('path.' + CLASS.chartArcsBackground).data($$.data.targets);
-            backgroundArc.enter().append("path");
-            backgroundArc.attr("class", function (d, i) {
+            var backgroundArc = $$.arcs.select('g.' + CLASS.chartArcsBackground).selectAll('path.' + CLASS.chartArcsBackground).data($$.data.targets);
+
+            backgroundArc.enter().append("path").attr("class", function (d, i) {
                 return CLASS.chartArcsBackground + ' ' + CLASS.chartArcsBackground + '-' + i;
-            }).attr("d", function (d1) {
+            }).merge(backgroundArc).attr("d", function (d1) {
                 if ($$.hiddenTargetIds.indexOf(d1.id) >= 0) {
                     return "M 0 0";
                 }
                 };
                 return $$.getArc(d, true, true);
             });
+
             backgroundArc.exit().remove();
 
             $$.arcs.select('.' + CLASS.chartArcsGaugeUnit).attr("dy", ".75em").text(config.gauge_label_show ? config.gauge_units : '');
             $$.arcs.select('.' + CLASS.chartArcsGaugeMax).attr("dx", $$.innerRadius + ($$.radius - $$.innerRadius) / (config.gauge_fullCircle ? 1 : 2) + "px").attr("dy", "1.2em").text(config.gauge_label_show ? $$.textForGaugeMinMax(config.gauge_max, true) : '');
         }
     };
-    c3_chart_internal_fn.initGauge = function () {
+    ChartInternal.prototype.initGauge = function () {
         var arcs = this.arcs;
         if (this.hasType('gauge')) {
             arcs.append('g').attr("class", CLASS.chartArcsBackground);
             arcs.append("text").attr("class", CLASS.chartArcsGaugeMax).style("text-anchor", "middle").style("pointer-events", "none");
         }
     };
-    c3_chart_internal_fn.getGaugeLabelHeight = function () {
+    ChartInternal.prototype.getGaugeLabelHeight = function () {
         return this.config.gauge_label_show ? 20 : 0;
     };
 
-    c3_chart_internal_fn.hasCaches = function (ids) {
+    ChartInternal.prototype.hasCaches = function (ids) {
         for (var i = 0; i < ids.length; i++) {
             if (!(ids[i] in this.cache)) {
                 return false;
         }
         return true;
     };
-    c3_chart_internal_fn.addCache = function (id, target) {
+    ChartInternal.prototype.addCache = function (id, target) {
         this.cache[id] = this.cloneTarget(target);
     };
-    c3_chart_internal_fn.getCaches = function (ids) {
+    ChartInternal.prototype.getCaches = function (ids) {
         var targets = [],
             i;
         for (i = 0; i < ids.length; i++) {
         return targets;
     };
 
-    c3_chart_internal_fn.categoryName = function (i) {
+    ChartInternal.prototype.categoryName = function (i) {
         var config = this.config;
         return i < config.axis_x_categories.length ? config.axis_x_categories[i] : i;
     };
 
-    c3_chart_internal_fn.generateTargetClass = function (targetId) {
+    ChartInternal.prototype.generateTargetClass = function (targetId) {
         return targetId || targetId === 0 ? ('-' + targetId).replace(/\s/g, '-') : '';
     };
-    c3_chart_internal_fn.generateClass = function (prefix, targetId) {
+    ChartInternal.prototype.generateClass = function (prefix, targetId) {
         return " " + prefix + " " + prefix + this.generateTargetClass(targetId);
     };
-    c3_chart_internal_fn.classText = function (d) {
+    ChartInternal.prototype.classText = function (d) {
         return this.generateClass(CLASS.text, d.index);
     };
-    c3_chart_internal_fn.classTexts = function (d) {
+    ChartInternal.prototype.classTexts = function (d) {
         return this.generateClass(CLASS.texts, d.id);
     };
-    c3_chart_internal_fn.classShape = function (d) {
+    ChartInternal.prototype.classShape = function (d) {
         return this.generateClass(CLASS.shape, d.index);
     };
-    c3_chart_internal_fn.classShapes = function (d) {
+    ChartInternal.prototype.classShapes = function (d) {
         return this.generateClass(CLASS.shapes, d.id);
     };
-    c3_chart_internal_fn.classLine = function (d) {
+    ChartInternal.prototype.classLine = function (d) {
         return this.classShape(d) + this.generateClass(CLASS.line, d.id);
     };
-    c3_chart_internal_fn.classLines = function (d) {
+    ChartInternal.prototype.classLines = function (d) {
         return this.classShapes(d) + this.generateClass(CLASS.lines, d.id);
     };
-    c3_chart_internal_fn.classCircle = function (d) {
+    ChartInternal.prototype.classCircle = function (d) {
         return this.classShape(d) + this.generateClass(CLASS.circle, d.index);
     };
-    c3_chart_internal_fn.classCircles = function (d) {
+    ChartInternal.prototype.classCircles = function (d) {
         return this.classShapes(d) + this.generateClass(CLASS.circles, d.id);
     };
-    c3_chart_internal_fn.classBar = function (d) {
+    ChartInternal.prototype.classBar = function (d) {
         return this.classShape(d) + this.generateClass(CLASS.bar, d.index);
     };
-    c3_chart_internal_fn.classBars = function (d) {
+    ChartInternal.prototype.classBars = function (d) {
         return this.classShapes(d) + this.generateClass(CLASS.bars, d.id);
     };
-    c3_chart_internal_fn.classArc = function (d) {
+    ChartInternal.prototype.classArc = function (d) {
         return this.classShape(d.data) + this.generateClass(CLASS.arc, d.data.id);
     };
-    c3_chart_internal_fn.classArcs = function (d) {
+    ChartInternal.prototype.classArcs = function (d) {
         return this.classShapes(d.data) + this.generateClass(CLASS.arcs, d.data.id);
     };
-    c3_chart_internal_fn.classArea = function (d) {
+    ChartInternal.prototype.classArea = function (d) {
         return this.classShape(d) + this.generateClass(CLASS.area, d.id);
     };
-    c3_chart_internal_fn.classAreas = function (d) {
+    ChartInternal.prototype.classAreas = function (d) {
         return this.classShapes(d) + this.generateClass(CLASS.areas, d.id);
     };
-    c3_chart_internal_fn.classRegion = function (d, i) {
+    ChartInternal.prototype.classRegion = function (d, i) {
         return this.generateClass(CLASS.region, i) + ' ' + ('class' in d ? d['class'] : '');
     };
-    c3_chart_internal_fn.classEvent = function (d) {
+    ChartInternal.prototype.classEvent = function (d) {
         return this.generateClass(CLASS.eventRect, d.index);
     };
-    c3_chart_internal_fn.classTarget = function (id) {
+    ChartInternal.prototype.classTarget = function (id) {
         var $$ = this;
         var additionalClassSuffix = $$.config.data_classes[id],
             additionalClass = '';
         }
         return $$.generateClass(CLASS.target, id) + additionalClass;
     };
-    c3_chart_internal_fn.classFocus = function (d) {
+    ChartInternal.prototype.classFocus = function (d) {
         return this.classFocused(d) + this.classDefocused(d);
     };
-    c3_chart_internal_fn.classFocused = function (d) {
+    ChartInternal.prototype.classFocused = function (d) {
         return ' ' + (this.focusedTargetIds.indexOf(d.id) >= 0 ? CLASS.focused : '');
     };
-    c3_chart_internal_fn.classDefocused = function (d) {
+    ChartInternal.prototype.classDefocused = function (d) {
         return ' ' + (this.defocusedTargetIds.indexOf(d.id) >= 0 ? CLASS.defocused : '');
     };
-    c3_chart_internal_fn.classChartText = function (d) {
+    ChartInternal.prototype.classChartText = function (d) {
         return CLASS.chartText + this.classTarget(d.id);
     };
-    c3_chart_internal_fn.classChartLine = function (d) {
+    ChartInternal.prototype.classChartLine = function (d) {
         return CLASS.chartLine + this.classTarget(d.id);
     };
-    c3_chart_internal_fn.classChartBar = function (d) {
+    ChartInternal.prototype.classChartBar = function (d) {
         return CLASS.chartBar + this.classTarget(d.id);
     };
-    c3_chart_internal_fn.classChartArc = function (d) {
+    ChartInternal.prototype.classChartArc = function (d) {
         return CLASS.chartArc + this.classTarget(d.data.id);
     };
-    c3_chart_internal_fn.getTargetSelectorSuffix = function (targetId) {
+    ChartInternal.prototype.getTargetSelectorSuffix = function (targetId) {
         return this.generateTargetClass(targetId).replace(/([?!@#$%^&*()_=+,.<>'":;\[\]\/|~`{}\\])/g, '\\$1');
     };
-    c3_chart_internal_fn.selectorTarget = function (id, prefix) {
+    ChartInternal.prototype.selectorTarget = function (id, prefix) {
         return (prefix || '') + '.' + CLASS.target + this.getTargetSelectorSuffix(id);
     };
-    c3_chart_internal_fn.selectorTargets = function (ids, prefix) {
+    ChartInternal.prototype.selectorTargets = function (ids, prefix) {
         var $$ = this;
         ids = ids || [];
         return ids.length ? ids.map(function (id) {
             return $$.selectorTarget(id, prefix);
         }) : null;
     };
-    c3_chart_internal_fn.selectorLegend = function (id) {
+    ChartInternal.prototype.selectorLegend = function (id) {
         return '.' + CLASS.legendItem + this.getTargetSelectorSuffix(id);
     };
-    c3_chart_internal_fn.selectorLegends = function (ids) {
+    ChartInternal.prototype.selectorLegends = function (ids) {
         var $$ = this;
         return ids && ids.length ? ids.map(function (id) {
             return $$.selectorLegend(id);
         }) : null;
     };
 
-    c3_chart_internal_fn.getClipPath = function (id) {
+    ChartInternal.prototype.getClipPath = function (id) {
         var isIE9 = window.navigator.appVersion.toLowerCase().indexOf("msie 9.") >= 0;
         return "url(" + (isIE9 ? "" : document.URL.split('#')[0]) + "#" + id + ")";
     };
-    c3_chart_internal_fn.appendClip = function (parent, id) {
+    ChartInternal.prototype.appendClip = function (parent, id) {
         return parent.append("clipPath").attr("id", id).append("rect");
     };
-    c3_chart_internal_fn.getAxisClipX = function (forHorizontal) {
+    ChartInternal.prototype.getAxisClipX = function (forHorizontal) {
         // axis line width + padding for left
         var left = Math.max(30, this.margin.left);
         return forHorizontal ? -(1 + left) : -(left - 1);
     };
-    c3_chart_internal_fn.getAxisClipY = function (forHorizontal) {
+    ChartInternal.prototype.getAxisClipY = function (forHorizontal) {
         return forHorizontal ? -20 : -this.margin.top;
     };
-    c3_chart_internal_fn.getXAxisClipX = function () {
+    ChartInternal.prototype.getXAxisClipX = function () {
         var $$ = this;
         return $$.getAxisClipX(!$$.config.axis_rotated);
     };
-    c3_chart_internal_fn.getXAxisClipY = function () {
+    ChartInternal.prototype.getXAxisClipY = function () {
         var $$ = this;
         return $$.getAxisClipY(!$$.config.axis_rotated);
     };
-    c3_chart_internal_fn.getYAxisClipX = function () {
+    ChartInternal.prototype.getYAxisClipX = function () {
         var $$ = this;
         return $$.config.axis_y_inner ? -1 : $$.getAxisClipX($$.config.axis_rotated);
     };
-    c3_chart_internal_fn.getYAxisClipY = function () {
+    ChartInternal.prototype.getYAxisClipY = function () {
         var $$ = this;
         return $$.getAxisClipY($$.config.axis_rotated);
     };
-    c3_chart_internal_fn.getAxisClipWidth = function (forHorizontal) {
+    ChartInternal.prototype.getAxisClipWidth = function (forHorizontal) {
         var $$ = this,
             left = Math.max(30, $$.margin.left),
             right = Math.max(30, $$.margin.right);
         // width + axis line width + padding for left/right
         return forHorizontal ? $$.width + 2 + left + right : $$.margin.left + 20;
     };
-    c3_chart_internal_fn.getAxisClipHeight = function (forHorizontal) {
+    ChartInternal.prototype.getAxisClipHeight = function (forHorizontal) {
         // less than 20 is not enough to show the axis label 'outer' without legend
         return (forHorizontal ? this.margin.bottom : this.margin.top + this.height) + 20;
     };
-    c3_chart_internal_fn.getXAxisClipWidth = function () {
+    ChartInternal.prototype.getXAxisClipWidth = function () {
         var $$ = this;
         return $$.getAxisClipWidth(!$$.config.axis_rotated);
     };
-    c3_chart_internal_fn.getXAxisClipHeight = function () {
+    ChartInternal.prototype.getXAxisClipHeight = function () {
         var $$ = this;
         return $$.getAxisClipHeight(!$$.config.axis_rotated);
     };
-    c3_chart_internal_fn.getYAxisClipWidth = function () {
+    ChartInternal.prototype.getYAxisClipWidth = function () {
         var $$ = this;
         return $$.getAxisClipWidth($$.config.axis_rotated) + ($$.config.axis_y_inner ? 20 : 0);
     };
-    c3_chart_internal_fn.getYAxisClipHeight = function () {
+    ChartInternal.prototype.getYAxisClipHeight = function () {
         var $$ = this;
         return $$.getAxisClipHeight($$.config.axis_rotated);
     };
 
-    c3_chart_internal_fn.generateColor = function () {
+    ChartInternal.prototype.generateColor = function () {
         var $$ = this,
             config = $$.config,
             d3 = $$.d3,
             return callback instanceof Function ? callback(color, d) : color;
         };
     };
-    c3_chart_internal_fn.generateLevelColor = function () {
+    ChartInternal.prototype.generateLevelColor = function () {
         var $$ = this,
             config = $$.config,
             colors = config.color_pattern,
         } : null;
     };
 
-    c3_chart_internal_fn.getDefaultConfig = function () {
+    ChartInternal.prototype.getDefaultConfig = function () {
         var config = {
             bindto: '#chart',
             svg_classname: undefined,
             resize_auto: true,
             zoom_enabled: false,
             zoom_initialRange: undefined,
+            zoom_type: 'scroll',
+            zoom_disableDefaultBehavior: false,
             zoom_privileged: false,
             zoom_rescale: false,
             zoom_onzoom: function zoom_onzoom() {},
 
         return config;
     };
-    c3_chart_internal_fn.additionalConfig = {};
+    ChartInternal.prototype.additionalConfig = {};
 
-    c3_chart_internal_fn.loadConfig = function (config) {
+    ChartInternal.prototype.loadConfig = function (config) {
         var this_config = this.config,
             target,
             keys,
         });
     };
 
-    c3_chart_internal_fn.convertUrlToData = function (url, mimeType, headers, keys, done) {
+    ChartInternal.prototype.convertUrlToData = function (url, mimeType, headers, keys, done) {
         var $$ = this,
             type = mimeType ? mimeType : 'csv',
             f,
             throw error;
         });
     };
-    c3_chart_internal_fn.convertXsvToData = function (xsv) {
+    ChartInternal.prototype.convertXsvToData = function (xsv) {
         var keys = xsv.columns,
             rows = xsv;
         if (rows.length === 0) {
             return { keys: keys, rows: [].concat(xsv) };
         }
     };
-    c3_chart_internal_fn.convertJsonToData = function (json, keys) {
+    ChartInternal.prototype.convertJsonToData = function (json, keys) {
         var $$ = this,
             new_rows = [],
             targetKeys,
         }
         return data;
     };
-    c3_chart_internal_fn.findValueInJson = function (object, path) {
+    ChartInternal.prototype.findValueInJson = function (object, path) {
         path = path.replace(/\[(\w+)\]/g, '.$1'); // convert indexes to properties (replace [] with .)
         path = path.replace(/^\./, ''); // strip a leading dot
         var pathArray = path.split('.');
      * @param {any[][]} rows The row data
      * @return {Object}
      */
-    c3_chart_internal_fn.convertRowsToData = function (rows) {
+    ChartInternal.prototype.convertRowsToData = function (rows) {
         var newRows = [];
         var keys = rows[0];
 
      * @param {any[][]} columns The column data
      * @return {Object}
      */
-    c3_chart_internal_fn.convertColumnsToData = function (columns) {
+    ChartInternal.prototype.convertColumnsToData = function (columns) {
         var newRows = [];
         var keys = [];
 
      * @param {boolean} appendXs True to append to $$.data.xs, False to replace.
      * @return {!Array}
      */
-    c3_chart_internal_fn.convertDataToTargets = function (data, appendXs) {
+    ChartInternal.prototype.convertDataToTargets = function (data, appendXs) {
         var $$ = this,
             config = $$.config,
             targets,
         return targets;
     };
 
-    c3_chart_internal_fn.isX = function (key) {
+    ChartInternal.prototype.isX = function (key) {
         var $$ = this,
             config = $$.config;
         return config.data_x && key === config.data_x || notEmpty(config.data_xs) && hasValue(config.data_xs, key);
     };
-    c3_chart_internal_fn.isNotX = function (key) {
+    ChartInternal.prototype.isNotX = function (key) {
         return !this.isX(key);
     };
-    c3_chart_internal_fn.getXKey = function (id) {
+    ChartInternal.prototype.getXKey = function (id) {
         var $$ = this,
             config = $$.config;
         return config.data_x ? config.data_x : notEmpty(config.data_xs) ? config.data_xs[id] : null;
     };
-    c3_chart_internal_fn.getXValuesOfXKey = function (key, targets) {
+    ChartInternal.prototype.getXValuesOfXKey = function (key, targets) {
         var $$ = this,
             xValues,
             ids = targets && notEmpty(targets) ? $$.mapToIds(targets) : [];
         });
         return xValues;
     };
-    c3_chart_internal_fn.getXValue = function (id, i) {
+    ChartInternal.prototype.getXValue = function (id, i) {
         var $$ = this;
         return id in $$.data.xs && $$.data.xs[id] && isValue($$.data.xs[id][i]) ? $$.data.xs[id][i] : i;
     };
-    c3_chart_internal_fn.getOtherTargetXs = function () {
+    ChartInternal.prototype.getOtherTargetXs = function () {
         var $$ = this,
             idsForX = Object.keys($$.data.xs);
         return idsForX.length ? $$.data.xs[idsForX[0]] : null;
     };
-    c3_chart_internal_fn.getOtherTargetX = function (index) {
+    ChartInternal.prototype.getOtherTargetX = function (index) {
         var xs = this.getOtherTargetXs();
         return xs && index < xs.length ? xs[index] : null;
     };
-    c3_chart_internal_fn.addXs = function (xs) {
+    ChartInternal.prototype.addXs = function (xs) {
         var $$ = this;
         Object.keys(xs).forEach(function (id) {
             $$.config.data_xs[id] = xs[id];
         });
     };
-    c3_chart_internal_fn.addName = function (data) {
+    ChartInternal.prototype.addName = function (data) {
         var $$ = this,
             name;
         if (data) {
         }
         return data;
     };
-    c3_chart_internal_fn.getValueOnIndex = function (values, index) {
+    ChartInternal.prototype.getValueOnIndex = function (values, index) {
         var valueOnIndex = values.filter(function (v) {
             return v.index === index;
         });
         return valueOnIndex.length ? valueOnIndex[0] : null;
     };
-    c3_chart_internal_fn.updateTargetX = function (targets, x) {
+    ChartInternal.prototype.updateTargetX = function (targets, x) {
         var $$ = this;
         targets.forEach(function (t) {
             t.values.forEach(function (v, i) {
             $$.data.xs[t.id] = x;
         });
     };
-    c3_chart_internal_fn.updateTargetXs = function (targets, xs) {
+    ChartInternal.prototype.updateTargetXs = function (targets, xs) {
         var $$ = this;
         targets.forEach(function (t) {
             if (xs[t.id]) {
             }
         });
     };
-    c3_chart_internal_fn.generateTargetX = function (rawX, id, index) {
+    ChartInternal.prototype.generateTargetX = function (rawX, id, index) {
         var $$ = this,
             x;
         if ($$.isTimeSeries()) {
         }
         return x;
     };
-    c3_chart_internal_fn.cloneTarget = function (target) {
+    ChartInternal.prototype.cloneTarget = function (target) {
         return {
             id: target.id,
             id_org: target.id_org,
             values: target.values.map(function (d) {
-                return { x: d.x, value: d.value, id: d.id };
+                return {
+                    x: d.x,
+                    value: d.value,
+                    id: d.id
+                };
             })
         };
     };
-    c3_chart_internal_fn.getMaxDataCount = function () {
+    ChartInternal.prototype.getMaxDataCount = function () {
         var $$ = this;
         return $$.d3.max($$.data.targets, function (t) {
             return t.values.length;
         });
     };
-    c3_chart_internal_fn.mapToIds = function (targets) {
+    ChartInternal.prototype.mapToIds = function (targets) {
         return targets.map(function (d) {
             return d.id;
         });
     };
-    c3_chart_internal_fn.mapToTargetIds = function (ids) {
+    ChartInternal.prototype.mapToTargetIds = function (ids) {
         var $$ = this;
         return ids ? [].concat(ids) : $$.mapToIds($$.data.targets);
     };
-    c3_chart_internal_fn.hasTarget = function (targets, id) {
+    ChartInternal.prototype.hasTarget = function (targets, id) {
         var ids = this.mapToIds(targets),
             i;
         for (i = 0; i < ids.length; i++) {
         }
         return false;
     };
-    c3_chart_internal_fn.isTargetToShow = function (targetId) {
+    ChartInternal.prototype.isTargetToShow = function (targetId) {
         return this.hiddenTargetIds.indexOf(targetId) < 0;
     };
-    c3_chart_internal_fn.isLegendToShow = function (targetId) {
+    ChartInternal.prototype.isLegendToShow = function (targetId) {
         return this.hiddenLegendIds.indexOf(targetId) < 0;
     };
-    c3_chart_internal_fn.filterTargetsToShow = function (targets) {
+    ChartInternal.prototype.filterTargetsToShow = function (targets) {
         var $$ = this;
         return targets.filter(function (t) {
             return $$.isTargetToShow(t.id);
         });
     };
-    c3_chart_internal_fn.mapTargetsToUniqueXs = function (targets) {
+    ChartInternal.prototype.mapTargetsToUniqueXs = function (targets) {
         var $$ = this;
         var xs = $$.d3.set($$.d3.merge(targets.map(function (t) {
             return t.values.map(function (v) {
             return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
         });
     };
-    c3_chart_internal_fn.addHiddenTargetIds = function (targetIds) {
+    ChartInternal.prototype.addHiddenTargetIds = function (targetIds) {
         targetIds = targetIds instanceof Array ? targetIds : new Array(targetIds);
         for (var i = 0; i < targetIds.length; i++) {
             if (this.hiddenTargetIds.indexOf(targetIds[i]) < 0) {
             }
         }
     };
-    c3_chart_internal_fn.removeHiddenTargetIds = function (targetIds) {
+    ChartInternal.prototype.removeHiddenTargetIds = function (targetIds) {
         this.hiddenTargetIds = this.hiddenTargetIds.filter(function (id) {
             return targetIds.indexOf(id) < 0;
         });
     };
-    c3_chart_internal_fn.addHiddenLegendIds = function (targetIds) {
+    ChartInternal.prototype.addHiddenLegendIds = function (targetIds) {
         targetIds = targetIds instanceof Array ? targetIds : new Array(targetIds);
         for (var i = 0; i < targetIds.length; i++) {
             if (this.hiddenLegendIds.indexOf(targetIds[i]) < 0) {
             }
         }
     };
-    c3_chart_internal_fn.removeHiddenLegendIds = function (targetIds) {
+    ChartInternal.prototype.removeHiddenLegendIds = function (targetIds) {
         this.hiddenLegendIds = this.hiddenLegendIds.filter(function (id) {
             return targetIds.indexOf(id) < 0;
         });
     };
-    c3_chart_internal_fn.getValuesAsIdKeyed = function (targets) {
+    ChartInternal.prototype.getValuesAsIdKeyed = function (targets) {
         var ys = {};
         targets.forEach(function (t) {
             ys[t.id] = [];
         });
         return ys;
     };
-    c3_chart_internal_fn.checkValueInTargets = function (targets, checker) {
+    ChartInternal.prototype.checkValueInTargets = function (targets, checker) {
         var ids = Object.keys(targets),
             i,
             j,
         }
         return false;
     };
-    c3_chart_internal_fn.hasNegativeValueInTargets = function (targets) {
+    ChartInternal.prototype.hasNegativeValueInTargets = function (targets) {
         return this.checkValueInTargets(targets, function (v) {
             return v < 0;
         });
     };
-    c3_chart_internal_fn.hasPositiveValueInTargets = function (targets) {
+    ChartInternal.prototype.hasPositiveValueInTargets = function (targets) {
         return this.checkValueInTargets(targets, function (v) {
             return v > 0;
         });
     };
-    c3_chart_internal_fn.isOrderDesc = function () {
+    ChartInternal.prototype.isOrderDesc = function () {
         var config = this.config;
         return typeof config.data_order === 'string' && config.data_order.toLowerCase() === 'desc';
     };
-    c3_chart_internal_fn.isOrderAsc = function () {
+    ChartInternal.prototype.isOrderAsc = function () {
         var config = this.config;
         return typeof config.data_order === 'string' && config.data_order.toLowerCase() === 'asc';
     };
-    c3_chart_internal_fn.getOrderFunction = function () {
+    ChartInternal.prototype.getOrderFunction = function () {
         var $$ = this,
             config = $$.config,
             orderAsc = $$.isOrderAsc(),
             };
         }
     };
-    c3_chart_internal_fn.orderTargets = function (targets) {
+    ChartInternal.prototype.orderTargets = function (targets) {
         var fct = this.getOrderFunction();
         if (fct) {
             targets.sort(fct);
         }
         return targets;
     };
-    c3_chart_internal_fn.filterByX = function (targets, x) {
+    ChartInternal.prototype.filterByX = function (targets, x) {
         return this.d3.merge(targets.map(function (t) {
             return t.values;
         })).filter(function (v) {
             return v.x - x === 0;
         });
     };
-    c3_chart_internal_fn.filterRemoveNull = function (data) {
+    ChartInternal.prototype.filterRemoveNull = function (data) {
         return data.filter(function (d) {
             return isValue(d.value);
         });
     };
-    c3_chart_internal_fn.filterByXDomain = function (targets, xDomain) {
+    ChartInternal.prototype.filterByXDomain = function (targets, xDomain) {
         return targets.map(function (t) {
             return {
                 id: t.id,
             };
         });
     };
-    c3_chart_internal_fn.hasDataLabel = function () {
+    ChartInternal.prototype.hasDataLabel = function () {
         var config = this.config;
         if (typeof config.data_labels === 'boolean' && config.data_labels) {
             return true;
         }
         return false;
     };
-    c3_chart_internal_fn.getDataLabelLength = function (min, max, key) {
+    ChartInternal.prototype.getDataLabelLength = function (min, max, key) {
         var $$ = this,
             lengths = [0, 0],
             paddingCoef = 1.3;
         }).remove();
         return lengths;
     };
-    c3_chart_internal_fn.isNoneArc = function (d) {
+    ChartInternal.prototype.isNoneArc = function (d) {
         return this.hasTarget(this.data.targets, d.id);
-    }, c3_chart_internal_fn.isArc = function (d) {
+    }, ChartInternal.prototype.isArc = function (d) {
         return 'data' in d && this.hasTarget(this.data.targets, d.data.id);
     };
-    c3_chart_internal_fn.findClosestFromTargets = function (targets, pos) {
+    ChartInternal.prototype.findClosestFromTargets = function (targets, pos) {
         var $$ = this,
             candidates;
 
         // decide closest point and return
         return $$.findClosest(candidates, pos);
     };
-    c3_chart_internal_fn.findClosest = function (values, pos) {
+    ChartInternal.prototype.findClosest = function (values, pos) {
         var $$ = this,
             minDist = $$.config.point_sensitivity,
             closest;
 
         return closest;
     };
-    c3_chart_internal_fn.dist = function (data, pos) {
+    ChartInternal.prototype.dist = function (data, pos) {
         var $$ = this,
             config = $$.config,
             xIndex = config.axis_rotated ? 1 : 0,
             x = $$.x(data.x);
         return Math.sqrt(Math.pow(x - pos[xIndex], 2) + Math.pow(y - pos[yIndex], 2));
     };
-    c3_chart_internal_fn.convertValuesToStep = function (values) {
+    ChartInternal.prototype.convertValuesToStep = function (values) {
         var converted = [].concat(values),
             i;
 
 
         return converted;
     };
-    c3_chart_internal_fn.updateDataAttributes = function (name, attrs) {
+    ChartInternal.prototype.updateDataAttributes = function (name, attrs) {
         var $$ = this,
             config = $$.config,
             current = config['data_' + name];
         Object.keys(attrs).forEach(function (id) {
             current[id] = attrs[id];
         });
-        $$.redraw({ withLegend: true });
+        $$.redraw({
+            withLegend: true
+        });
         return current;
     };
 
-    c3_chart_internal_fn.load = function (targets, args) {
+    ChartInternal.prototype.load = function (targets, args) {
         var $$ = this;
         if (targets) {
             // filter loading targets if needed
             args.done();
         }
     };
-    c3_chart_internal_fn.loadFromArgs = function (args) {
+    ChartInternal.prototype.loadFromArgs = function (args) {
         var $$ = this;
         if (args.data) {
             $$.load($$.convertDataToTargets(args.data), args);
             $$.load(null, args);
         }
     };
-    c3_chart_internal_fn.unload = function (targetIds, done) {
+    ChartInternal.prototype.unload = function (targetIds, done) {
         var $$ = this;
         if (!done) {
             done = function done() {};
         });
     };
 
-    c3_chart_internal_fn.getYDomainMin = function (targets) {
+    ChartInternal.prototype.getYDomainMin = function (targets) {
         var $$ = this,
             config = $$.config,
             ids = $$.mapToIds(targets),
             return $$.d3.min(ys[key]);
         }));
     };
-    c3_chart_internal_fn.getYDomainMax = function (targets) {
+    ChartInternal.prototype.getYDomainMax = function (targets) {
         var $$ = this,
             config = $$.config,
             ids = $$.mapToIds(targets),
             return $$.d3.max(ys[key]);
         }));
     };
-    c3_chart_internal_fn.getYDomain = function (targets, axisId, xDomain) {
+    ChartInternal.prototype.getYDomain = function (targets, axisId, xDomain) {
         var $$ = this,
             config = $$.config,
             targetsByAxisId = targets.filter(function (t) {
         domain = [yDomainMin - padding_bottom, yDomainMax + padding_top];
         return isInverted ? domain.reverse() : domain;
     };
-    c3_chart_internal_fn.getXDomainMin = function (targets) {
+    ChartInternal.prototype.getXDomainMin = function (targets) {
         var $$ = this,
             config = $$.config;
         return isDefined(config.axis_x_min) ? $$.isTimeSeries() ? this.parseDate(config.axis_x_min) : config.axis_x_min : $$.d3.min(targets, function (t) {
             });
         });
     };
-    c3_chart_internal_fn.getXDomainMax = function (targets) {
+    ChartInternal.prototype.getXDomainMax = function (targets) {
         var $$ = this,
             config = $$.config;
         return isDefined(config.axis_x_max) ? $$.isTimeSeries() ? this.parseDate(config.axis_x_max) : config.axis_x_max : $$.d3.max(targets, function (t) {
             });
         });
     };
-    c3_chart_internal_fn.getXDomainPadding = function (domain) {
+    ChartInternal.prototype.getXDomainPadding = function (domain) {
         var $$ = this,
             config = $$.config,
             diff = domain[1] - domain[0],
         }
         return { left: paddingLeft, right: paddingRight };
     };
-    c3_chart_internal_fn.getXDomain = function (targets) {
+    ChartInternal.prototype.getXDomain = function (targets) {
         var $$ = this,
             xDomain = [$$.getXDomainMin(targets), $$.getXDomainMax(targets)],
             firstX = xDomain[0],
         }
         return [min, max];
     };
-    c3_chart_internal_fn.updateXDomain = function (targets, withUpdateXDomain, withUpdateOrgXDomain, withTrim, domain) {
+    ChartInternal.prototype.updateXDomain = function (targets, withUpdateXDomain, withUpdateOrgXDomain, withTrim, domain) {
         var $$ = this,
             config = $$.config;
 
 
         return $$.x.domain();
     };
-    c3_chart_internal_fn.trimXDomain = function (domain) {
+    ChartInternal.prototype.trimXDomain = function (domain) {
         var zoomDomain = this.getZoomDomain(),
             min = zoomDomain[0],
             max = zoomDomain[1];
         return domain;
     };
 
-    c3_chart_internal_fn.drag = function (mouse) {
+    ChartInternal.prototype.drag = function (mouse) {
         var $$ = this,
             config = $$.config,
             main = $$.main,
         });
     };
 
-    c3_chart_internal_fn.dragstart = function (mouse) {
+    ChartInternal.prototype.dragstart = function (mouse) {
         var $$ = this,
             config = $$.config;
         if ($$.hasArcType()) {
         $$.dragging = true;
     };
 
-    c3_chart_internal_fn.dragend = function () {
+    ChartInternal.prototype.dragend = function () {
         var $$ = this,
             config = $$.config;
         if ($$.hasArcType()) {
         $$.dragging = false;
     };
 
-    c3_chart_internal_fn.getYFormat = function (forArc) {
+    ChartInternal.prototype.getYFormat = function (forArc) {
         var $$ = this,
             formatForY = forArc && !$$.hasType('gauge') ? $$.defaultArcValueFormat : $$.yFormat,
             formatForY2 = forArc && !$$.hasType('gauge') ? $$.defaultArcValueFormat : $$.y2Format;
             return format.call($$, v, ratio);
         };
     };
-    c3_chart_internal_fn.yFormat = function (v) {
+    ChartInternal.prototype.yFormat = function (v) {
         var $$ = this,
             config = $$.config,
             format = config.axis_y_tick_format ? config.axis_y_tick_format : $$.defaultValueFormat;
         return format(v);
     };
-    c3_chart_internal_fn.y2Format = function (v) {
+    ChartInternal.prototype.y2Format = function (v) {
         var $$ = this,
             config = $$.config,
             format = config.axis_y2_tick_format ? config.axis_y2_tick_format : $$.defaultValueFormat;
         return format(v);
     };
-    c3_chart_internal_fn.defaultValueFormat = function (v) {
+    ChartInternal.prototype.defaultValueFormat = function (v) {
         return isValue(v) ? +v : "";
     };
-    c3_chart_internal_fn.defaultArcValueFormat = function (v, ratio) {
+    ChartInternal.prototype.defaultArcValueFormat = function (v, ratio) {
         return (ratio * 100).toFixed(1) + '%';
     };
-    c3_chart_internal_fn.dataLabelFormat = function (targetId) {
+    ChartInternal.prototype.dataLabelFormat = function (targetId) {
         var $$ = this,
             data_labels = $$.config.data_labels,
             format,
         return format;
     };
 
-    c3_chart_internal_fn.initGrid = function () {
+    ChartInternal.prototype.initGrid = function () {
         var $$ = this,
             config = $$.config,
             d3 = $$.d3;
             $$.initGridLines();
         }
     };
-    c3_chart_internal_fn.initGridLines = function () {
+    ChartInternal.prototype.initGridLines = function () {
         var $$ = this,
             d3 = $$.d3;
         $$.gridLines = $$.main.append('g').attr("clip-path", $$.clipPathForGrid).attr('class', CLASS.grid + ' ' + CLASS.gridLines);
         $$.gridLines.append('g').attr('class', CLASS.ygridLines);
         $$.xgridLines = d3.selectAll([]);
     };
-    c3_chart_internal_fn.updateXGrid = function (withoutUpdate) {
+    ChartInternal.prototype.updateXGrid = function (withoutUpdate) {
         var $$ = this,
             config = $$.config,
             d3 = $$.d3,
         xgrid.exit().remove();
     };
 
-    c3_chart_internal_fn.updateYGrid = function () {
+    ChartInternal.prototype.updateYGrid = function () {
         var $$ = this,
             config = $$.config,
             gridValues = $$.yAxis.tickValues() || $$.y.ticks(config.grid_y_ticks);
         $$.smoothLines($$.ygrid, 'grid');
     };
 
-    c3_chart_internal_fn.gridTextAnchor = function (d) {
+    ChartInternal.prototype.gridTextAnchor = function (d) {
         return d.position ? d.position : "end";
     };
-    c3_chart_internal_fn.gridTextDx = function (d) {
+    ChartInternal.prototype.gridTextDx = function (d) {
         return d.position === 'start' ? 4 : d.position === 'middle' ? 0 : -4;
     };
-    c3_chart_internal_fn.xGridTextX = function (d) {
+    ChartInternal.prototype.xGridTextX = function (d) {
         return d.position === 'start' ? -this.height : d.position === 'middle' ? -this.height / 2 : 0;
     };
-    c3_chart_internal_fn.yGridTextX = function (d) {
+    ChartInternal.prototype.yGridTextX = function (d) {
         return d.position === 'start' ? 0 : d.position === 'middle' ? this.width / 2 : this.width;
     };
-    c3_chart_internal_fn.updateGrid = function (duration) {
+    ChartInternal.prototype.updateGrid = function (duration) {
         var $$ = this,
             main = $$.main,
             config = $$.config,
         // exit
         ygridLine.exit().transition().duration(duration).style("opacity", 0).remove();
     };
-    c3_chart_internal_fn.redrawGrid = function (withTransition, transition) {
+    ChartInternal.prototype.redrawGrid = function (withTransition, transition) {
         var $$ = this,
             config = $$.config,
             xv = $$.xv.bind($$),
             return d.text;
         }).style("opacity", 1)];
     };
-    c3_chart_internal_fn.showXGridFocus = function (selectedData) {
+    ChartInternal.prototype.showXGridFocus = function (selectedData) {
         var $$ = this,
             config = $$.config,
             dataToShow = selectedData.filter(function (d) {
         focusEl.style("visibility", "visible").data([dataToShow[0]]).attr(config.axis_rotated ? 'y1' : 'x1', xx).attr(config.axis_rotated ? 'y2' : 'x2', xx);
         $$.smoothLines(focusEl, 'grid');
     };
-    c3_chart_internal_fn.hideXGridFocus = function () {
+    ChartInternal.prototype.hideXGridFocus = function () {
         this.main.select('line.' + CLASS.xgridFocus).style("visibility", "hidden");
     };
-    c3_chart_internal_fn.updateXgridFocus = function () {
+    ChartInternal.prototype.updateXgridFocus = function () {
         var $$ = this,
             config = $$.config;
         $$.main.select('line.' + CLASS.xgridFocus).attr("x1", config.axis_rotated ? 0 : -10).attr("x2", config.axis_rotated ? $$.width : -10).attr("y1", config.axis_rotated ? -10 : 0).attr("y2", config.axis_rotated ? -10 : $$.height);
     };
-    c3_chart_internal_fn.generateGridData = function (type, scale) {
+    ChartInternal.prototype.generateGridData = function (type, scale) {
         var $$ = this,
             gridData = [],
             xDomain,
         }
         return gridData;
     };
-    c3_chart_internal_fn.getGridFilterToRemove = function (params) {
+    ChartInternal.prototype.getGridFilterToRemove = function (params) {
         return params ? function (line) {
             var found = false;
             [].concat(params).forEach(function (param) {
             return true;
         };
     };
-    c3_chart_internal_fn.removeGridLines = function (params, forX) {
+    ChartInternal.prototype.removeGridLines = function (params, forX) {
         var $$ = this,
             config = $$.config,
             toRemove = $$.getGridFilterToRemove(params),
         }
     };
 
-    c3_chart_internal_fn.initEventRect = function () {
+    ChartInternal.prototype.initEventRect = function () {
         var $$ = this,
             config = $$.config;
 
             }
         }
     };
-    c3_chart_internal_fn.redrawEventRect = function () {
+    ChartInternal.prototype.redrawEventRect = function () {
         var $$ = this,
             d3 = $$.d3,
             config = $$.config,
             $$.dragend();
         }) : function () {});
     };
-    c3_chart_internal_fn.getMousePosition = function (data) {
+    ChartInternal.prototype.getMousePosition = function (data) {
         var $$ = this;
         return [$$.x(data.x), $$.getYScale(data.id)(data.value)];
     };
-    c3_chart_internal_fn.dispatchEvent = function (type, mouse) {
+    ChartInternal.prototype.dispatchEvent = function (type, mouse) {
         var $$ = this,
             selector = '.' + CLASS.eventRect,
             eventRect = $$.main.select(selector).node(),
         eventRect.dispatchEvent(event);
     };
 
-    c3_chart_internal_fn.initLegend = function () {
+    ChartInternal.prototype.initLegend = function () {
         var $$ = this;
         $$.legendItemTextBox = {};
         $$.legendHasRendered = false;
         // MEMO: translate will be upated by this, so transform not needed in updateLegend()
         $$.updateLegendWithDefaults();
     };
-    c3_chart_internal_fn.updateLegendWithDefaults = function () {
+    ChartInternal.prototype.updateLegendWithDefaults = function () {
         var $$ = this;
         $$.updateLegend($$.mapToIds($$.data.targets), { withTransform: false, withTransitionForTransform: false, withTransition: false });
     };
-    c3_chart_internal_fn.updateSizeForLegend = function (legendHeight, legendWidth) {
+    ChartInternal.prototype.updateSizeForLegend = function (legendHeight, legendWidth) {
         var $$ = this,
             config = $$.config,
             insetLegendPosition = {
             left: $$.isLegendRight ? $$.currentWidth - legendWidth : $$.isLegendInset ? insetLegendPosition.left : 0
         };
     };
-    c3_chart_internal_fn.transformLegend = function (withTransition) {
+    ChartInternal.prototype.transformLegend = function (withTransition) {
         var $$ = this;
         (withTransition ? $$.legend.transition() : $$.legend).attr("transform", $$.getTranslate('legend'));
     };
-    c3_chart_internal_fn.updateLegendStep = function (step) {
+    ChartInternal.prototype.updateLegendStep = function (step) {
         this.legendStep = step;
     };
-    c3_chart_internal_fn.updateLegendItemWidth = function (w) {
+    ChartInternal.prototype.updateLegendItemWidth = function (w) {
         this.legendItemWidth = w;
     };
-    c3_chart_internal_fn.updateLegendItemHeight = function (h) {
+    ChartInternal.prototype.updateLegendItemHeight = function (h) {
         this.legendItemHeight = h;
     };
-    c3_chart_internal_fn.getLegendWidth = function () {
+    ChartInternal.prototype.getLegendWidth = function () {
         var $$ = this;
         return $$.config.legend_show ? $$.isLegendRight || $$.isLegendInset ? $$.legendItemWidth * ($$.legendStep + 1) : $$.currentWidth : 0;
     };
-    c3_chart_internal_fn.getLegendHeight = function () {
+    ChartInternal.prototype.getLegendHeight = function () {
         var $$ = this,
             h = 0;
         if ($$.config.legend_show) {
         }
         return h;
     };
-    c3_chart_internal_fn.opacityForLegend = function (legendItem) {
+    ChartInternal.prototype.opacityForLegend = function (legendItem) {
         return legendItem.classed(CLASS.legendItemHidden) ? null : 1;
     };
-    c3_chart_internal_fn.opacityForUnfocusedLegend = function (legendItem) {
+    ChartInternal.prototype.opacityForUnfocusedLegend = function (legendItem) {
         return legendItem.classed(CLASS.legendItemHidden) ? null : 0.3;
     };
-    c3_chart_internal_fn.toggleFocusLegend = function (targetIds, focus) {
+    ChartInternal.prototype.toggleFocusLegend = function (targetIds, focus) {
         var $$ = this;
         targetIds = $$.mapToTargetIds(targetIds);
         $$.legend.selectAll('.' + CLASS.legendItem).filter(function (id) {
             return opacity.call($$, $$.d3.select(this));
         });
     };
-    c3_chart_internal_fn.revertLegend = function () {
+    ChartInternal.prototype.revertLegend = function () {
         var $$ = this,
             d3 = $$.d3;
         $$.legend.selectAll('.' + CLASS.legendItem).classed(CLASS.legendItemFocused, false).transition().duration(100).style('opacity', function () {
             return $$.opacityForLegend(d3.select(this));
         });
     };
-    c3_chart_internal_fn.showLegend = function (targetIds) {
+    ChartInternal.prototype.showLegend = function (targetIds) {
         var $$ = this,
             config = $$.config;
         if (!config.legend_show) {
             return $$.opacityForLegend($$.d3.select(this));
         });
     };
-    c3_chart_internal_fn.hideLegend = function (targetIds) {
+    ChartInternal.prototype.hideLegend = function (targetIds) {
         var $$ = this,
             config = $$.config;
         if (config.legend_show && isEmpty(targetIds)) {
         $$.addHiddenLegendIds(targetIds);
         $$.legend.selectAll($$.selectorLegends(targetIds)).style('opacity', 0).style('visibility', 'hidden');
     };
-    c3_chart_internal_fn.clearLegendItemTextBoxCache = function () {
+    ChartInternal.prototype.clearLegendItemTextBoxCache = function () {
         this.legendItemTextBox = {};
     };
-    c3_chart_internal_fn.updateLegend = function (targetIds, options, transitions) {
+    ChartInternal.prototype.updateLegend = function (targetIds, options, transitions) {
         var $$ = this,
             config = $$.config;
         var xForLegend, xForLegendText, xForLegendRect, yForLegend, yForLegendText, yForLegendRect, x1ForLegendTile, x2ForLegendTile, yForLegendTile;
         $$.legendHasRendered = true;
     };
 
-    c3_chart_internal_fn.initRegion = function () {
+    ChartInternal.prototype.initRegion = function () {
         var $$ = this;
         $$.region = $$.main.append('g').attr("clip-path", $$.clipPath).attr("class", CLASS.regions);
     };
-    c3_chart_internal_fn.updateRegion = function (duration) {
+    ChartInternal.prototype.updateRegion = function (duration) {
         var $$ = this,
             config = $$.config;
 
         $$.mainRegion = mainRegionEnter.merge(mainRegion).attr('class', $$.classRegion.bind($$));
         mainRegion.exit().transition().duration(duration).style("opacity", 0).remove();
     };
-    c3_chart_internal_fn.redrawRegion = function (withTransition, transition) {
+    ChartInternal.prototype.redrawRegion = function (withTransition, transition) {
         var $$ = this,
             regions = $$.mainRegion;
         return [(withTransition ? regions.transition(transition) : regions).attr("x", $$.regionX.bind($$)).attr("y", $$.regionY.bind($$)).attr("width", $$.regionWidth.bind($$)).attr("height", $$.regionHeight.bind($$)).style("fill-opacity", function (d) {
             return isValue(d.opacity) ? d.opacity : 0.1;
         })];
     };
-    c3_chart_internal_fn.regionX = function (d) {
+    ChartInternal.prototype.regionX = function (d) {
         var $$ = this,
             config = $$.config,
             xPos,
         }
         return xPos;
     };
-    c3_chart_internal_fn.regionY = function (d) {
+    ChartInternal.prototype.regionY = function (d) {
         var $$ = this,
             config = $$.config,
             yPos,
         }
         return yPos;
     };
-    c3_chart_internal_fn.regionWidth = function (d) {
+    ChartInternal.prototype.regionWidth = function (d) {
         var $$ = this,
             config = $$.config,
             start = $$.regionX(d),
         }
         return end < start ? 0 : end - start;
     };
-    c3_chart_internal_fn.regionHeight = function (d) {
+    ChartInternal.prototype.regionHeight = function (d) {
         var $$ = this,
             config = $$.config,
             start = this.regionY(d),
         }
         return end < start ? 0 : end - start;
     };
-    c3_chart_internal_fn.isRegionOnX = function (d) {
+    ChartInternal.prototype.isRegionOnX = function (d) {
         return !d.axis || d.axis === 'x';
     };
 
-    c3_chart_internal_fn.getScale = function (min, max, forTimeseries) {
+    ChartInternal.prototype.getScale = function (min, max, forTimeseries) {
         return (forTimeseries ? this.d3.scaleTime() : this.d3.scaleLinear()).range([min, max]);
     };
-    c3_chart_internal_fn.getX = function (min, max, domain, offset) {
+    ChartInternal.prototype.getX = function (min, max, domain, offset) {
         var $$ = this,
             scale = $$.getScale(min, max, $$.isTimeSeries()),
             _scale = domain ? scale.domain(domain) : scale,
         }
         return scale;
     };
-    c3_chart_internal_fn.getY = function (min, max, domain) {
+    ChartInternal.prototype.getY = function (min, max, domain) {
         var scale = this.getScale(min, max, this.isTimeSeriesY());
         if (domain) {
             scale.domain(domain);
         }
         return scale;
     };
-    c3_chart_internal_fn.getYScale = function (id) {
+    ChartInternal.prototype.getYScale = function (id) {
         return this.axis.getId(id) === 'y2' ? this.y2 : this.y;
     };
-    c3_chart_internal_fn.getSubYScale = function (id) {
+    ChartInternal.prototype.getSubYScale = function (id) {
         return this.axis.getId(id) === 'y2' ? this.subY2 : this.subY;
     };
-    c3_chart_internal_fn.updateScales = function () {
+    ChartInternal.prototype.updateScales = function () {
         var $$ = this,
             config = $$.config,
             forInit = !$$.x;
         }
     };
 
-    c3_chart_internal_fn.selectPoint = function (target, d, i) {
+    ChartInternal.prototype.selectPoint = function (target, d, i) {
         var $$ = this,
             config = $$.config,
             cx = (config.axis_rotated ? $$.circleY : $$.circleX).bind($$),
             return $$.pointSelectR(d) * 1.4;
         }).transition().duration(100).attr("r", r);
     };
-    c3_chart_internal_fn.unselectPoint = function (target, d, i) {
+    ChartInternal.prototype.unselectPoint = function (target, d, i) {
         var $$ = this;
         $$.config.data_onunselected.call($$.api, d, target.node());
         // remove selected-circle from low layer g
         $$.main.select('.' + CLASS.selectedCircles + $$.getTargetSelectorSuffix(d.id)).selectAll('.' + CLASS.selectedCircle + '-' + i).transition().duration(100).attr('r', 0).remove();
     };
-    c3_chart_internal_fn.togglePoint = function (selected, target, d, i) {
+    ChartInternal.prototype.togglePoint = function (selected, target, d, i) {
         selected ? this.selectPoint(target, d, i) : this.unselectPoint(target, d, i);
     };
-    c3_chart_internal_fn.selectPath = function (target, d) {
+    ChartInternal.prototype.selectPath = function (target, d) {
         var $$ = this;
         $$.config.data_onselected.call($$, d, target.node());
         if ($$.config.interaction_brighten) {
             });
         }
     };
-    c3_chart_internal_fn.unselectPath = function (target, d) {
+    ChartInternal.prototype.unselectPath = function (target, d) {
         var $$ = this;
         $$.config.data_onunselected.call($$, d, target.node());
         if ($$.config.interaction_brighten) {
             });
         }
     };
-    c3_chart_internal_fn.togglePath = function (selected, target, d, i) {
+    ChartInternal.prototype.togglePath = function (selected, target, d, i) {
         selected ? this.selectPath(target, d, i) : this.unselectPath(target, d, i);
     };
-    c3_chart_internal_fn.getToggle = function (that, d) {
+    ChartInternal.prototype.getToggle = function (that, d) {
         var $$ = this,
             toggle;
         if (that.nodeName === 'circle') {
         }
         return toggle;
     };
-    c3_chart_internal_fn.toggleShape = function (that, d, i) {
+    ChartInternal.prototype.toggleShape = function (that, d, i) {
         var $$ = this,
             d3 = $$.d3,
             config = $$.config,
         }
     };
 
-    c3_chart_internal_fn.initBar = function () {
+    ChartInternal.prototype.initBar = function () {
         var $$ = this;
         $$.main.select('.' + CLASS.chart).append("g").attr("class", CLASS.chartBars);
     };
-    c3_chart_internal_fn.updateTargetsForBar = function (targets) {
+    ChartInternal.prototype.updateTargetsForBar = function (targets) {
         var $$ = this,
             config = $$.config,
             mainBars,
             return config.data_selection_isselectable(d) ? "pointer" : null;
         });
     };
-    c3_chart_internal_fn.updateBar = function (durationForExit) {
+    ChartInternal.prototype.updateBar = function (durationForExit) {
         var $$ = this,
             barData = $$.barData.bind($$),
             classBar = $$.classBar.bind($$),
         $$.mainBar = mainBarEnter.merge(mainBar).style("opacity", initialOpacity);
         mainBar.exit().transition().duration(durationForExit).style("opacity", 0);
     };
-    c3_chart_internal_fn.redrawBar = function (drawBar, withTransition, transition) {
+    ChartInternal.prototype.redrawBar = function (drawBar, withTransition, transition) {
         return [(withTransition ? this.mainBar.transition(transition) : this.mainBar).attr('d', drawBar).style("stroke", this.color).style("fill", this.color).style("opacity", 1)];
     };
-    c3_chart_internal_fn.getBarW = function (axis, barTargetsNum) {
+    ChartInternal.prototype.getBarW = function (axis, barTargetsNum) {
         var $$ = this,
             config = $$.config,
             w = typeof config.bar_width === 'number' ? config.bar_width : barTargetsNum ? axis.tickInterval() * config.bar_width_ratio / barTargetsNum : 0;
         return config.bar_width_max && w > config.bar_width_max ? config.bar_width_max : w;
     };
-    c3_chart_internal_fn.getBars = function (i, id) {
+    ChartInternal.prototype.getBars = function (i, id) {
         var $$ = this;
         return (id ? $$.main.selectAll('.' + CLASS.bars + $$.getTargetSelectorSuffix(id)) : $$.main).selectAll('.' + CLASS.bar + (isValue(i) ? '-' + i : ''));
     };
-    c3_chart_internal_fn.expandBars = function (i, id, reset) {
+    ChartInternal.prototype.expandBars = function (i, id, reset) {
         var $$ = this;
         if (reset) {
             $$.unexpandBars();
         }
         $$.getBars(i, id).classed(CLASS.EXPANDED, true);
     };
-    c3_chart_internal_fn.unexpandBars = function (i) {
+    ChartInternal.prototype.unexpandBars = function (i) {
         var $$ = this;
         $$.getBars(i).classed(CLASS.EXPANDED, false);
     };
-    c3_chart_internal_fn.generateDrawBar = function (barIndices, isSub) {
+    ChartInternal.prototype.generateDrawBar = function (barIndices, isSub) {
         var $$ = this,
             config = $$.config,
             getPoints = $$.generateGetBarPoints(barIndices, isSub);
             return path;
         };
     };
-    c3_chart_internal_fn.generateGetBarPoints = function (barIndices, isSub) {
+    ChartInternal.prototype.generateGetBarPoints = function (barIndices, isSub) {
         var $$ = this,
             axis = isSub ? $$.subXAxis : $$.xAxis,
             barTargetsNum = barIndices.__max__ + 1,
             return [[posX + barSpaceOffset, offset], [posX + barSpaceOffset, posY - (y0 - offset)], [posX + barW - barSpaceOffset, posY - (y0 - offset)], [posX + barW - barSpaceOffset, offset]];
         };
     };
-    c3_chart_internal_fn.isWithinBar = function (mouse, that) {
+    ChartInternal.prototype.isWithinBar = function (mouse, that) {
         var box = that.getBoundingClientRect(),
             seg0 = that.pathSegList.getItem(0),
             seg1 = that.pathSegList.getItem(1),
         return sx < mouse[0] && mouse[0] < ex && ey < mouse[1] && mouse[1] < sy;
     };
 
-    c3_chart_internal_fn.getShapeIndices = function (typeFilter) {
+    ChartInternal.prototype.getShapeIndices = function (typeFilter) {
         var $$ = this,
             config = $$.config,
             indices = {},
         indices.__max__ = i - 1;
         return indices;
     };
-    c3_chart_internal_fn.getShapeX = function (offset, targetsNum, indices, isSub) {
+    ChartInternal.prototype.getShapeX = function (offset, targetsNum, indices, isSub) {
         var $$ = this,
             scale = isSub ? $$.subX : $$.x;
         return function (d) {
             return d.x || d.x === 0 ? scale(d.x) - offset * (targetsNum / 2 - index) : 0;
         };
     };
-    c3_chart_internal_fn.getShapeY = function (isSub) {
+    ChartInternal.prototype.getShapeY = function (isSub) {
         var $$ = this;
         return function (d) {
             var scale = isSub ? $$.getSubYScale(d.id) : $$.getYScale(d.id);
             return scale(d.value);
         };
     };
-    c3_chart_internal_fn.getShapeOffset = function (typeFilter, indices, isSub) {
+    ChartInternal.prototype.getShapeOffset = function (typeFilter, indices, isSub) {
         var $$ = this,
             targets = $$.orderTargets($$.filterTargetsToShow($$.data.targets.filter(typeFilter, $$))),
             targetIds = targets.map(function (t) {
             return offset;
         };
     };
-    c3_chart_internal_fn.isWithinShape = function (that, d) {
+    ChartInternal.prototype.isWithinShape = function (that, d) {
         var $$ = this,
             shape = $$.d3.select(that),
             isWithin;
         return isWithin;
     };
 
-    c3_chart_internal_fn.getInterpolate = function (d) {
+    ChartInternal.prototype.getInterpolate = function (d) {
         var $$ = this,
             d3 = $$.d3,
             types = {
             'cardinal-open': d3.curveCardinalOpen,
             'cardinal-closed': d3.curveCardinalClosed,
             'monotone': d3.curveMonotoneX,
-            'step': d3.curveStep
+            'step': d3.curveStep,
+            'step-before': d3.curveStepBefore,
+            'step-after': d3.curveStepAfter
         },
             type;
 
         return type;
     };
 
-    c3_chart_internal_fn.initLine = function () {
+    ChartInternal.prototype.initLine = function () {
         var $$ = this;
         $$.main.select('.' + CLASS.chart).append("g").attr("class", CLASS.chartLines);
     };
-    c3_chart_internal_fn.updateTargetsForLine = function (targets) {
+    ChartInternal.prototype.updateTargetsForLine = function (targets) {
         var $$ = this,
             config = $$.config,
             mainLines,
         // MEMO: can not keep same color...
         //mainLineUpdate.exit().remove();
     };
-    c3_chart_internal_fn.updateLine = function (durationForExit) {
+    ChartInternal.prototype.updateLine = function (durationForExit) {
         var $$ = this;
         var mainLine = $$.main.selectAll('.' + CLASS.lines).selectAll('.' + CLASS.line).data($$.lineData.bind($$));
         var mainLineEnter = mainLine.enter().append('path').attr('class', $$.classLine.bind($$)).style("stroke", $$.color);
         }).attr('transform', null);
         mainLine.exit().transition().duration(durationForExit).style('opacity', 0);
     };
-    c3_chart_internal_fn.redrawLine = function (drawLine, withTransition, transition) {
+    ChartInternal.prototype.redrawLine = function (drawLine, withTransition, transition) {
         return [(withTransition ? this.mainLine.transition(transition) : this.mainLine).attr("d", drawLine).style("stroke", this.color).style("opacity", 1)];
     };
-    c3_chart_internal_fn.generateDrawLine = function (lineIndices, isSub) {
+    ChartInternal.prototype.generateDrawLine = function (lineIndices, isSub) {
         var $$ = this,
             config = $$.config,
             line = $$.d3.line(),
             return path ? path : "M 0 0";
         };
     };
-    c3_chart_internal_fn.generateGetLinePoints = function (lineIndices, isSub) {
+    ChartInternal.prototype.generateGetLinePoints = function (lineIndices, isSub) {
         // partial duplication of generateGetBarPoints
         var $$ = this,
             config = $$.config,
         };
     };
 
-    c3_chart_internal_fn.lineWithRegions = function (d, x, y, _regions) {
+    ChartInternal.prototype.lineWithRegions = function (d, x, y, _regions) {
         var $$ = this,
             config = $$.config,
             prev = -1,
         return s;
     };
 
-    c3_chart_internal_fn.updateArea = function (durationForExit) {
+    ChartInternal.prototype.updateArea = function (durationForExit) {
         var $$ = this,
             d3 = $$.d3;
         var mainArea = $$.main.selectAll('.' + CLASS.areas).selectAll('.' + CLASS.area).data($$.lineData.bind($$));
         $$.mainArea = mainAreaEnter.merge(mainArea).style("opacity", $$.orgAreaOpacity);
         mainArea.exit().transition().duration(durationForExit).style('opacity', 0);
     };
-    c3_chart_internal_fn.redrawArea = function (drawArea, withTransition, transition) {
+    ChartInternal.prototype.redrawArea = function (drawArea, withTransition, transition) {
         return [(withTransition ? this.mainArea.transition(transition) : this.mainArea).attr("d", drawArea).style("fill", this.color).style("opacity", this.orgAreaOpacity)];
     };
-    c3_chart_internal_fn.generateDrawArea = function (areaIndices, isSub) {
+    ChartInternal.prototype.generateDrawArea = function (areaIndices, isSub) {
         var $$ = this,
             config = $$.config,
             area = $$.d3.area(),
             return path ? path : "M 0 0";
         };
     };
-    c3_chart_internal_fn.getAreaBaseValue = function () {
+    ChartInternal.prototype.getAreaBaseValue = function () {
         return 0;
     };
-    c3_chart_internal_fn.generateGetAreaPoints = function (areaIndices, isSub) {
+    ChartInternal.prototype.generateGetAreaPoints = function (areaIndices, isSub) {
         // partial duplication of generateGetBarPoints
         var $$ = this,
             config = $$.config,
         };
     };
 
-    c3_chart_internal_fn.updateCircle = function (cx, cy) {
+    ChartInternal.prototype.updateCircle = function (cx, cy) {
         var $$ = this;
         var mainCircle = $$.main.selectAll('.' + CLASS.circles).selectAll('.' + CLASS.circle).data($$.lineOrScatterData.bind($$));
         var mainCircleEnter = mainCircle.enter().append("circle").attr("class", $$.classCircle.bind($$)).attr("cx", cx).attr("cy", cy).attr("r", $$.pointR.bind($$)).style("fill", $$.color);
         $$.mainCircle = mainCircleEnter.merge(mainCircle).style("opacity", $$.initialOpacityForCircle.bind($$));
         mainCircle.exit().style("opacity", 0);
     };
-    c3_chart_internal_fn.redrawCircle = function (cx, cy, withTransition, transition) {
+    ChartInternal.prototype.redrawCircle = function (cx, cy, withTransition, transition) {
         var $$ = this,
             selectedCircles = $$.main.selectAll('.' + CLASS.selectedCircle);
         return [(withTransition ? $$.mainCircle.transition(transition) : $$.mainCircle).style('opacity', this.opacityForCircle.bind($$)).style("fill", $$.color).attr("cx", cx).attr("cy", cy), (withTransition ? selectedCircles.transition(transition) : selectedCircles).attr("cx", cx).attr("cy", cy)];
     };
-    c3_chart_internal_fn.circleX = function (d) {
+    ChartInternal.prototype.circleX = function (d) {
         return d.x || d.x === 0 ? this.x(d.x) : null;
     };
-    c3_chart_internal_fn.updateCircleY = function () {
+    ChartInternal.prototype.updateCircleY = function () {
         var $$ = this,
             lineIndices,
             getPoints;
             };
         }
     };
-    c3_chart_internal_fn.getCircles = function (i, id) {
+    ChartInternal.prototype.getCircles = function (i, id) {
         var $$ = this;
         return (id ? $$.main.selectAll('.' + CLASS.circles + $$.getTargetSelectorSuffix(id)) : $$.main).selectAll('.' + CLASS.circle + (isValue(i) ? '-' + i : ''));
     };
-    c3_chart_internal_fn.expandCircles = function (i, id, reset) {
+    ChartInternal.prototype.expandCircles = function (i, id, reset) {
         var $$ = this,
             r = $$.pointExpandedR.bind($$);
         if (reset) {
         }
         $$.getCircles(i, id).classed(CLASS.EXPANDED, true).attr('r', r);
     };
-    c3_chart_internal_fn.unexpandCircles = function (i) {
+    ChartInternal.prototype.unexpandCircles = function (i) {
         var $$ = this,
             r = $$.pointR.bind($$);
         $$.getCircles(i).filter(function () {
             return $$.d3.select(this).classed(CLASS.EXPANDED);
         }).classed(CLASS.EXPANDED, false).attr('r', r);
     };
-    c3_chart_internal_fn.pointR = function (d) {
+    ChartInternal.prototype.pointR = function (d) {
         var $$ = this,
             config = $$.config;
         return $$.isStepType(d) ? 0 : isFunction(config.point_r) ? config.point_r(d) : config.point_r;
     };
-    c3_chart_internal_fn.pointExpandedR = function (d) {
+    ChartInternal.prototype.pointExpandedR = function (d) {
         var $$ = this,
             config = $$.config;
         if (config.point_focus_expand_enabled) {
             return $$.pointR(d);
         }
     };
-    c3_chart_internal_fn.pointSelectR = function (d) {
+    ChartInternal.prototype.pointSelectR = function (d) {
         var $$ = this,
             config = $$.config;
         return isFunction(config.point_select_r) ? config.point_select_r(d) : config.point_select_r ? config.point_select_r : $$.pointR(d) * 4;
     };
-    c3_chart_internal_fn.isWithinCircle = function (that, r) {
+    ChartInternal.prototype.isWithinCircle = function (that, r) {
         var d3 = this.d3,
             mouse = d3.mouse(that),
             d3_this = d3.select(that),
             cy = +d3_this.attr("cy");
         return Math.sqrt(Math.pow(cx - mouse[0], 2) + Math.pow(cy - mouse[1], 2)) < r;
     };
-    c3_chart_internal_fn.isWithinStep = function (that, y) {
+    ChartInternal.prototype.isWithinStep = function (that, y) {
         return Math.abs(y - this.d3.mouse(that)[1]) < 30;
     };
 
-    c3_chart_internal_fn.getCurrentWidth = function () {
+    ChartInternal.prototype.getCurrentWidth = function () {
         var $$ = this,
             config = $$.config;
         return config.size_width ? config.size_width : $$.getParentWidth();
     };
-    c3_chart_internal_fn.getCurrentHeight = function () {
+    ChartInternal.prototype.getCurrentHeight = function () {
         var $$ = this,
             config = $$.config,
             h = config.size_height ? config.size_height : $$.getParentHeight();
         return h > 0 ? h : 320 / ($$.hasType('gauge') && !config.gauge_fullCircle ? 2 : 1);
     };
-    c3_chart_internal_fn.getCurrentPaddingTop = function () {
+    ChartInternal.prototype.getCurrentPaddingTop = function () {
         var $$ = this,
             config = $$.config,
             padding = isValue(config.padding_top) ? config.padding_top : 0;
         }
         return padding;
     };
-    c3_chart_internal_fn.getCurrentPaddingBottom = function () {
+    ChartInternal.prototype.getCurrentPaddingBottom = function () {
         var config = this.config;
         return isValue(config.padding_bottom) ? config.padding_bottom : 0;
     };
-    c3_chart_internal_fn.getCurrentPaddingLeft = function (withoutRecompute) {
+    ChartInternal.prototype.getCurrentPaddingLeft = function (withoutRecompute) {
         var $$ = this,
             config = $$.config;
         if (isValue(config.padding_left)) {
             return ceil10($$.getAxisWidthByAxisId('y', withoutRecompute));
         }
     };
-    c3_chart_internal_fn.getCurrentPaddingRight = function () {
+    ChartInternal.prototype.getCurrentPaddingRight = function () {
         var $$ = this,
             config = $$.config,
             defaultPadding = 10,
         }
     };
 
-    c3_chart_internal_fn.getParentRectValue = function (key) {
+    ChartInternal.prototype.getParentRectValue = function (key) {
         var parent = this.selectChart.node(),
             v;
         while (parent && parent.tagName !== 'BODY') {
         }
         return v;
     };
-    c3_chart_internal_fn.getParentWidth = function () {
+    ChartInternal.prototype.getParentWidth = function () {
         return this.getParentRectValue('width');
     };
-    c3_chart_internal_fn.getParentHeight = function () {
+    ChartInternal.prototype.getParentHeight = function () {
         var h = this.selectChart.style('height');
         return h.indexOf('px') > 0 ? +h.replace('px', '') : 0;
     };
 
-    c3_chart_internal_fn.getSvgLeft = function (withoutRecompute) {
+    ChartInternal.prototype.getSvgLeft = function (withoutRecompute) {
         var $$ = this,
             config = $$.config,
             hasLeftAxisRect = config.axis_rotated || !config.axis_rotated && !config.axis_y_inner,
         return svgLeft > 0 ? svgLeft : 0;
     };
 
-    c3_chart_internal_fn.getAxisWidthByAxisId = function (id, withoutRecompute) {
+    ChartInternal.prototype.getAxisWidthByAxisId = function (id, withoutRecompute) {
         var $$ = this,
             position = $$.axis.getLabelPositionById(id);
         return $$.axis.getMaxTickWidth(id, withoutRecompute) + (position.isInner ? 20 : 40);
     };
-    c3_chart_internal_fn.getHorizontalAxisHeight = function (axisId) {
+    ChartInternal.prototype.getHorizontalAxisHeight = function (axisId) {
         var $$ = this,
             config = $$.config,
             h = 30;
         return h + ($$.axis.getLabelPositionById(axisId).isInner ? 0 : 10) + (axisId === 'y2' ? -10 : 0);
     };
 
-    c3_chart_internal_fn.initBrush = function (scale) {
+    ChartInternal.prototype.initBrush = function (scale) {
         var $$ = this,
             d3 = $$.d3;
         // TODO: dynamically change brushY/brushX according to axis_rotated.
         };
         return $$.brush.updateScale(scale);
     };
-    c3_chart_internal_fn.initSubchart = function () {
+    ChartInternal.prototype.initSubchart = function () {
         var $$ = this,
             config = $$.config,
             context = $$.context = $$.svg.append("g").attr("transform", $$.getTranslate('context')),
         // Add Axis
         $$.axes.subx = context.append("g").attr("class", CLASS.axisX).attr("transform", $$.getTranslate('subx')).attr("clip-path", config.axis_rotated ? "" : $$.clipPathForXAxis);
     };
-    c3_chart_internal_fn.initSubchartBrush = function () {
+    ChartInternal.prototype.initSubchartBrush = function () {
         var $$ = this;
         // Add extent rect for Brush
         $$.initBrush($$.subX).updateExtent();
         $$.context.select('.' + CLASS.brush).call($$.brush);
     };
-    c3_chart_internal_fn.updateTargetsForSubchart = function (targets) {
+    ChartInternal.prototype.updateTargetsForSubchart = function (targets) {
         var $$ = this,
             context = $$.context,
             config = $$.config,
             context.selectAll('.' + CLASS.brush + ' rect').attr(config.axis_rotated ? "width" : "height", config.axis_rotated ? $$.width2 : $$.height2);
         }
     };
-    c3_chart_internal_fn.updateBarForSubchart = function (durationForExit) {
+    ChartInternal.prototype.updateBarForSubchart = function (durationForExit) {
         var $$ = this;
         var contextBar = $$.context.selectAll('.' + CLASS.bars).selectAll('.' + CLASS.bar).data($$.barData.bind($$));
         var contextBarEnter = contextBar.enter().append('path').attr("class", $$.classBar.bind($$)).style("stroke", 'none').style("fill", $$.color);
         contextBar.exit().transition().duration(durationForExit).style('opacity', 0).remove();
         $$.contextBar = contextBarEnter.merge(contextBar).style("opacity", $$.initialOpacity.bind($$));
     };
-    c3_chart_internal_fn.redrawBarForSubchart = function (drawBarOnSub, withTransition, duration) {
+    ChartInternal.prototype.redrawBarForSubchart = function (drawBarOnSub, withTransition, duration) {
         (withTransition ? this.contextBar.transition(Math.random().toString()).duration(duration) : this.contextBar).attr('d', drawBarOnSub).style('opacity', 1);
     };
-    c3_chart_internal_fn.updateLineForSubchart = function (durationForExit) {
+    ChartInternal.prototype.updateLineForSubchart = function (durationForExit) {
         var $$ = this;
         var contextLine = $$.context.selectAll('.' + CLASS.lines).selectAll('.' + CLASS.line).data($$.lineData.bind($$));
         var contextLineEnter = contextLine.enter().append('path').attr('class', $$.classLine.bind($$)).style('stroke', $$.color);
         contextLine.exit().transition().duration(durationForExit).style('opacity', 0).remove();
         $$.contextLine = contextLineEnter.merge(contextLine).style("opacity", $$.initialOpacity.bind($$));
     };
-    c3_chart_internal_fn.redrawLineForSubchart = function (drawLineOnSub, withTransition, duration) {
+    ChartInternal.prototype.redrawLineForSubchart = function (drawLineOnSub, withTransition, duration) {
         (withTransition ? this.contextLine.transition(Math.random().toString()).duration(duration) : this.contextLine).attr("d", drawLineOnSub).style('opacity', 1);
     };
-    c3_chart_internal_fn.updateAreaForSubchart = function (durationForExit) {
+    ChartInternal.prototype.updateAreaForSubchart = function (durationForExit) {
         var $$ = this,
             d3 = $$.d3;
         var contextArea = $$.context.selectAll('.' + CLASS.areas).selectAll('.' + CLASS.area).data($$.lineData.bind($$));
         contextArea.exit().transition().duration(durationForExit).style('opacity', 0).remove();
         $$.contextArea = contextAreaEnter.merge(contextArea).style("opacity", 0);
     };
-    c3_chart_internal_fn.redrawAreaForSubchart = function (drawAreaOnSub, withTransition, duration) {
+    ChartInternal.prototype.redrawAreaForSubchart = function (drawAreaOnSub, withTransition, duration) {
         (withTransition ? this.contextArea.transition(Math.random().toString()).duration(duration) : this.contextArea).attr("d", drawAreaOnSub).style("fill", this.color).style("opacity", this.orgAreaOpacity);
     };
-    c3_chart_internal_fn.redrawSubchart = function (withSubchart, transitions, duration, durationForExit, areaIndices, barIndices, lineIndices) {
+    ChartInternal.prototype.redrawSubchart = function (withSubchart, transitions, duration, durationForExit, areaIndices, barIndices, lineIndices) {
         var $$ = this,
             d3 = $$.d3,
             config = $$.config,
             }
         }
     };
-    c3_chart_internal_fn.redrawForBrush = function () {
+    ChartInternal.prototype.redrawForBrush = function () {
         var $$ = this,
             x = $$.x,
             d3 = $$.d3,
         $$.main.select('.' + CLASS.eventRect).call($$.zoom.transform, d3.zoomIdentity.scale($$.width / (s[1] - s[0])).translate(-s[0], 0));
         $$.config.subchart_onbrush.call($$.api, x.orgDomain());
     };
-    c3_chart_internal_fn.transformContext = function (withTransition, transitions) {
+    ChartInternal.prototype.transformContext = function (withTransition, transitions) {
         var $$ = this,
             subXAxis;
         if (transitions && transitions.axisSubX) {
         $$.context.attr("transform", $$.getTranslate('context'));
         subXAxis.attr("transform", $$.getTranslate('subx'));
     };
-    c3_chart_internal_fn.getDefaultSelection = function () {
+    ChartInternal.prototype.getDefaultSelection = function () {
         var $$ = this,
             config = $$.config,
             selection = isFunction(config.axis_x_selection) ? config.axis_x_selection($$.getXDomain($$.data.targets)) : config.axis_x_selection;
         return selection;
     };
 
-    c3_chart_internal_fn.initText = function () {
+    ChartInternal.prototype.initText = function () {
         var $$ = this;
         $$.main.select('.' + CLASS.chart).append("g").attr("class", CLASS.chartTexts);
         $$.mainText = $$.d3.selectAll([]);
     };
-    c3_chart_internal_fn.updateTargetsForText = function (targets) {
+    ChartInternal.prototype.updateTargetsForText = function (targets) {
         var $$ = this,
             classChartText = $$.classChartText.bind($$),
             classTexts = $$.classTexts.bind($$),
             return classChartText(d) + classFocus(d);
         });
     };
-    c3_chart_internal_fn.updateText = function (xForText, yForText, durationForExit) {
+    ChartInternal.prototype.updateText = function (xForText, yForText, durationForExit) {
         var $$ = this,
             config = $$.config,
             barOrLineData = $$.barOrLineData.bind($$),
         });
         mainText.exit().transition().duration(durationForExit).style('fill-opacity', 0).remove();
     };
-    c3_chart_internal_fn.redrawText = function (xForText, yForText, forFlow, withTransition, transition) {
+    ChartInternal.prototype.redrawText = function (xForText, yForText, forFlow, withTransition, transition) {
         return [(withTransition ? this.mainText.transition(transition) : this.mainText).attr('x', xForText).attr('y', yForText).style("fill", this.color).style("fill-opacity", forFlow ? 0 : this.opacityForText.bind(this))];
     };
-    c3_chart_internal_fn.getTextRect = function (text, cls, element) {
+    ChartInternal.prototype.getTextRect = function (text, cls, element) {
         var dummy = this.d3.select('body').append('div').classed('c3', true),
             svg = dummy.append("svg").style('visibility', 'hidden').style('position', 'fixed').style('top', 0).style('left', 0),
             font = this.d3.select(element).style('font'),
         dummy.remove();
         return rect;
     };
-    c3_chart_internal_fn.generateXYForText = function (areaIndices, barIndices, lineIndices, forX) {
+    ChartInternal.prototype.generateXYForText = function (areaIndices, barIndices, lineIndices, forX) {
         var $$ = this,
             getAreaPoints = $$.generateGetAreaPoints(areaIndices, false),
             getBarPoints = $$.generateGetBarPoints(barIndices, false),
             return getter.call($$, getPoints(d, i), d, this);
         };
     };
-    c3_chart_internal_fn.getXForText = function (points, d, textElement) {
+    ChartInternal.prototype.getXForText = function (points, d, textElement) {
         var $$ = this,
             box = textElement.getBoundingClientRect(),
             xPos,
         }
         return xPos;
     };
-    c3_chart_internal_fn.getYForText = function (points, d, textElement) {
+    ChartInternal.prototype.getYForText = function (points, d, textElement) {
         var $$ = this,
             box = textElement.getBoundingClientRect(),
             yPos;
         return yPos;
     };
 
-    c3_chart_internal_fn.initTitle = function () {
+    ChartInternal.prototype.initTitle = function () {
         var $$ = this;
         $$.title = $$.svg.append("text").text($$.config.title_text).attr("class", $$.CLASS.title);
     };
-    c3_chart_internal_fn.redrawTitle = function () {
+    ChartInternal.prototype.redrawTitle = function () {
         var $$ = this;
         $$.title.attr("x", $$.xForTitle.bind($$)).attr("y", $$.yForTitle.bind($$));
     };
-    c3_chart_internal_fn.xForTitle = function () {
+    ChartInternal.prototype.xForTitle = function () {
         var $$ = this,
             config = $$.config,
             position = config.title_position || 'left',
         }
         return x;
     };
-    c3_chart_internal_fn.yForTitle = function () {
+    ChartInternal.prototype.yForTitle = function () {
         var $$ = this;
         return $$.config.title_padding.top + $$.getTextRect($$.title.node().textContent, $$.CLASS.title, $$.title.node()).height;
     };
-    c3_chart_internal_fn.getTitlePadding = function () {
+    ChartInternal.prototype.getTitlePadding = function () {
         var $$ = this;
         return $$.yForTitle() + $$.config.title_padding.bottom;
     };
 
-    c3_chart_internal_fn.initTooltip = function () {
+    ChartInternal.prototype.initTooltip = function () {
         var $$ = this,
             config = $$.config,
             i;
             $$.tooltip.style("top", config.tooltip_init_position.top).style("left", config.tooltip_init_position.left).style("display", "block");
         }
     };
-    c3_chart_internal_fn.getTooltipSortFunction = function () {
+    ChartInternal.prototype.getTooltipSortFunction = function () {
         var $$ = this,
             config = $$.config;
 
             };
         }
     };
-    c3_chart_internal_fn.getTooltipContent = function (d, defaultTitleFormat, defaultValueFormat, color) {
+    ChartInternal.prototype.getTooltipContent = function (d, defaultTitleFormat, defaultValueFormat, color) {
         var $$ = this,
             config = $$.config,
             titleFormat = config.tooltip_format_title || defaultTitleFormat,
         }
         return text + "</table>";
     };
-    c3_chart_internal_fn.tooltipPosition = function (dataToShow, tWidth, tHeight, element) {
+    ChartInternal.prototype.tooltipPosition = function (dataToShow, tWidth, tHeight, element) {
         var $$ = this,
             config = $$.config,
             d3 = $$.d3;
         if (tooltipTop < 0) {
             tooltipTop = 0;
         }
-        return { top: tooltipTop, left: tooltipLeft };
+        return {
+            top: tooltipTop,
+            left: tooltipLeft
+        };
     };
-    c3_chart_internal_fn.showTooltip = function (selectedData, element) {
+    ChartInternal.prototype.showTooltip = function (selectedData, element) {
         var $$ = this,
             config = $$.config;
         var tWidth, tHeight, position;
             dataToShow = selectedData.filter(function (d) {
             return d && isValue(d.value);
         }),
-            positionFunction = config.tooltip_position || c3_chart_internal_fn.tooltipPosition;
+            positionFunction = config.tooltip_position || ChartInternal.prototype.tooltipPosition;
         if (dataToShow.length === 0 || !config.tooltip_show) {
             return;
         }
         // Set tooltip
         $$.tooltip.style("top", position.top + "px").style("left", position.left + 'px');
     };
-    c3_chart_internal_fn.hideTooltip = function () {
+    ChartInternal.prototype.hideTooltip = function () {
         this.tooltip.style("display", "none");
     };
 
-    c3_chart_internal_fn.setTargetType = function (targetIds, type) {
+    ChartInternal.prototype.setTargetType = function (targetIds, type) {
         var $$ = this,
             config = $$.config;
         $$.mapToTargetIds(targetIds).forEach(function (id) {
             config.data_type = type;
         }
     };
-    c3_chart_internal_fn.hasType = function (type, targets) {
+    ChartInternal.prototype.hasType = function (type, targets) {
         var $$ = this,
             types = $$.config.data_types,
             has = false;
         }
         return has;
     };
-    c3_chart_internal_fn.hasArcType = function (targets) {
+    ChartInternal.prototype.hasArcType = function (targets) {
         return this.hasType('pie', targets) || this.hasType('donut', targets) || this.hasType('gauge', targets);
     };
-    c3_chart_internal_fn.isLineType = function (d) {
+    ChartInternal.prototype.isLineType = function (d) {
         var config = this.config,
             id = isString(d) ? d : d.id;
         return !config.data_types[id] || ['line', 'spline', 'area', 'area-spline', 'step', 'area-step'].indexOf(config.data_types[id]) >= 0;
     };
-    c3_chart_internal_fn.isStepType = function (d) {
+    ChartInternal.prototype.isStepType = function (d) {
         var id = isString(d) ? d : d.id;
         return ['step', 'area-step'].indexOf(this.config.data_types[id]) >= 0;
     };
-    c3_chart_internal_fn.isSplineType = function (d) {
+    ChartInternal.prototype.isSplineType = function (d) {
         var id = isString(d) ? d : d.id;
         return ['spline', 'area-spline'].indexOf(this.config.data_types[id]) >= 0;
     };
-    c3_chart_internal_fn.isAreaType = function (d) {
+    ChartInternal.prototype.isAreaType = function (d) {
         var id = isString(d) ? d : d.id;
         return ['area', 'area-spline', 'area-step'].indexOf(this.config.data_types[id]) >= 0;
     };
-    c3_chart_internal_fn.isBarType = function (d) {
+    ChartInternal.prototype.isBarType = function (d) {
         var id = isString(d) ? d : d.id;
         return this.config.data_types[id] === 'bar';
     };
-    c3_chart_internal_fn.isScatterType = function (d) {
+    ChartInternal.prototype.isScatterType = function (d) {
         var id = isString(d) ? d : d.id;
         return this.config.data_types[id] === 'scatter';
     };
-    c3_chart_internal_fn.isPieType = function (d) {
+    ChartInternal.prototype.isPieType = function (d) {
         var id = isString(d) ? d : d.id;
         return this.config.data_types[id] === 'pie';
     };
-    c3_chart_internal_fn.isGaugeType = function (d) {
+    ChartInternal.prototype.isGaugeType = function (d) {
         var id = isString(d) ? d : d.id;
         return this.config.data_types[id] === 'gauge';
     };
-    c3_chart_internal_fn.isDonutType = function (d) {
+    ChartInternal.prototype.isDonutType = function (d) {
         var id = isString(d) ? d : d.id;
         return this.config.data_types[id] === 'donut';
     };
-    c3_chart_internal_fn.isArcType = function (d) {
+    ChartInternal.prototype.isArcType = function (d) {
         return this.isPieType(d) || this.isDonutType(d) || this.isGaugeType(d);
     };
-    c3_chart_internal_fn.lineData = function (d) {
+    ChartInternal.prototype.lineData = function (d) {
         return this.isLineType(d) ? [d] : [];
     };
-    c3_chart_internal_fn.arcData = function (d) {
+    ChartInternal.prototype.arcData = function (d) {
         return this.isArcType(d.data) ? [d] : [];
     };
     /* not used
      return isScatterType(d) ? d.values : [];
      }
      */
-    c3_chart_internal_fn.barData = function (d) {
+    ChartInternal.prototype.barData = function (d) {
         return this.isBarType(d) ? d.values : [];
     };
-    c3_chart_internal_fn.lineOrScatterData = function (d) {
+    ChartInternal.prototype.lineOrScatterData = function (d) {
         return this.isLineType(d) || this.isScatterType(d) ? d.values : [];
     };
-    c3_chart_internal_fn.barOrLineData = function (d) {
+    ChartInternal.prototype.barOrLineData = function (d) {
         return this.isBarType(d) || this.isLineType(d) ? d.values : [];
     };
 
-    c3_chart_internal_fn.isSafari = function () {
+    ChartInternal.prototype.isSafari = function () {
         var ua = window.navigator.userAgent;
         return ua.indexOf('Safari') >= 0 && ua.indexOf('Chrome') < 0;
     };
-    c3_chart_internal_fn.isChrome = function () {
+    ChartInternal.prototype.isChrome = function () {
         var ua = window.navigator.userAgent;
         return ua.indexOf('Chrome') >= 0;
     };
 
-    c3_chart_internal_fn.initZoom = function () {
+    ChartInternal.prototype.initZoom = function () {
         var $$ = this,
             d3 = $$.d3,
             config = $$.config,
             startEvent;
 
         $$.zoom = d3.zoom().on("start", function () {
+            if (config.zoom_type !== 'scroll') {
+                return;
+            }
+
             var e = d3.event.sourceEvent;
             if (e && e.type === "brush") {
                 return;
             startEvent = e;
             config.zoom_onzoomstart.call($$.api, e);
         }).on("zoom", function () {
+            if (config.zoom_type !== 'scroll') {
+                return;
+            }
+
             var e = d3.event.sourceEvent;
             if (e && e.type === "brush") {
                 return;
             }
-            $$.redrawForZoom.call($$);
+
+            $$.redrawForZoom();
+
+            config.zoom_onzoom.call($$.api, $$.x.orgDomain());
         }).on('end', function () {
+            if (config.zoom_type !== 'scroll') {
+                return;
+            }
+
             var e = d3.event.sourceEvent;
             if (e && e.type === "brush") {
                 return;
 
         return $$.zoom.updateExtent();
     };
-    c3_chart_internal_fn.zoomTransform = function (range) {
+    ChartInternal.prototype.zoomTransform = function (range) {
         var $$ = this,
             s = [$$.x(range[0]), $$.x(range[1])];
         return $$.d3.zoomIdentity.scale($$.width / (s[1] - s[0])).translate(-s[0], 0);
     };
 
-    c3_chart_internal_fn.getZoomDomain = function () {
+    ChartInternal.prototype.initDragZoom = function () {
+        var $$ = this;
+        var d3 = $$.d3;
+        var config = $$.config;
+        var context = $$.context = $$.svg;
+        var brushXPos = $$.margin.left + 20.5;
+        var brushYPos = $$.margin.top + 0.5;
+
+        if (!(config.zoom_type === 'drag' && config.zoom_enabled)) {
+            return;
+        }
+
+        var getZoomedDomain = function getZoomedDomain(selection) {
+            return selection && selection.map(function (x) {
+                return $$.x.invert(x);
+            });
+        };
+
+        var brush = $$.dragZoomBrush = d3.brushX().on("start", function () {
+            $$.api.unzoom();
+
+            $$.svg.select("." + CLASS.dragZoom).classed("disabled", false);
+
+            config.zoom_onzoomstart.call($$.api, d3.event.sourceEvent);
+        }).on("brush", function () {
+            config.zoom_onzoom.call($$.api, getZoomedDomain(d3.event.selection));
+        }).on("end", function () {
+            if (d3.event.selection == null) {
+                return;
+            }
+
+            var zoomedDomain = getZoomedDomain(d3.event.selection);
+
+            if (!config.zoom_disableDefaultBehavior) {
+                $$.api.zoom(zoomedDomain);
+            }
+
+            $$.svg.select("." + CLASS.dragZoom).classed("disabled", true);
+
+            config.zoom_onzoomend.call($$.api, zoomedDomain);
+        });
+
+        context.append("g").classed(CLASS.dragZoom, true).attr("clip-path", $$.clipPath).attr("transform", "translate(" + brushXPos + "," + brushYPos + ")").call(brush);
+    };
+
+    ChartInternal.prototype.getZoomDomain = function () {
         var $$ = this,
             config = $$.config,
             d3 = $$.d3,
             max = d3.max([$$.orgXDomain[1], config.zoom_x_max]);
         return [min, max];
     };
-    c3_chart_internal_fn.redrawForZoom = function () {
+    ChartInternal.prototype.redrawForZoom = function () {
         var $$ = this,
             d3 = $$.d3,
             config = $$.config,
 
         zoom.update();
 
+        if (config.zoom_disableDefaultBehavior) {
+            return;
+        }
+
         if ($$.isCategorized() && x.orgDomain()[0] === $$.orgXDomain[0]) {
             x.domain([$$.orgXDomain[0] - 1e-10, x.orgDomain()[1]]);
         }
+
         $$.redraw({
             withTransition: false,
             withY: config.zoom_rescale,
             withEventRect: false,
             withDimension: false
         });
+
         if (d3.event.sourceEvent && d3.event.sourceEvent.type === 'mousemove') {
             $$.cancelClick = true;
         }
-        config.zoom_onzoom.call($$.api, x.orgDomain());
     };
 
     return c3;
index 3162ac8de92b98809f158ff340fb690f137f87f4..b62e5f542ea9c537a0aac832f7d5347d709e3f0f 100644 (file)
@@ -1 +1 @@
-.c3 svg{font:10px sans-serif;-webkit-tap-highlight-color:transparent}.c3 line,.c3 path{fill:none;stroke:#000}.c3 text{-webkit-user-select:none;-moz-user-select:none;user-select:none}.c3-bars path,.c3-event-rect,.c3-legend-item-tile,.c3-xgrid-focus,.c3-ygrid{shape-rendering:crispEdges}.c3-chart-arc path{stroke:#fff}.c3-chart-arc rect{stroke:#fff;stroke-width:1}.c3-chart-arc text{fill:#fff;font-size:13px}.c3-grid line{stroke:#aaa}.c3-grid text{fill:#aaa}.c3-xgrid,.c3-ygrid{stroke-dasharray:3 3}.c3-text.c3-empty{fill:grey;font-size:2em}.c3-line{stroke-width:1px}.c3-circle._expanded_{stroke-width:1px;stroke:#fff}.c3-selected-circle{fill:#fff;stroke-width:2px}.c3-bar{stroke-width:0}.c3-bar._expanded_{fill-opacity:1;fill-opacity:.75}.c3-target.c3-focused{opacity:1}.c3-target.c3-focused path.c3-line,.c3-target.c3-focused path.c3-step{stroke-width:2px}.c3-target.c3-defocused{opacity:.3!important}.c3-region{fill:#4682b4;fill-opacity:.1}.c3-brush .extent{fill-opacity:.1}.c3-legend-item{font-size:12px}.c3-legend-item-hidden{opacity:.15}.c3-legend-background{opacity:.75;fill:#fff;stroke:#d3d3d3;stroke-width:1}.c3-title{font:14px sans-serif}.c3-tooltip-container{z-index:10}.c3-tooltip{border-collapse:collapse;border-spacing:0;background-color:#fff;empty-cells:show;-webkit-box-shadow:7px 7px 12px -9px #777;-moz-box-shadow:7px 7px 12px -9px #777;box-shadow:7px 7px 12px -9px #777;opacity:.9}.c3-tooltip tr{border:1px solid #ccc}.c3-tooltip th{background-color:#aaa;font-size:14px;padding:2px 5px;text-align:left;color:#fff}.c3-tooltip td{font-size:13px;padding:3px 6px;background-color:#fff;border-left:1px dotted #999}.c3-tooltip td>span{display:inline-block;width:10px;height:10px;margin-right:6px}.c3-tooltip td.value{text-align:right}.c3-area{stroke-width:0;opacity:.2}.c3-chart-arcs-title{dominant-baseline:middle;font-size:1.3em}.c3-chart-arcs .c3-chart-arcs-background{fill:#e0e0e0;stroke:#fff}.c3-chart-arcs .c3-chart-arcs-gauge-unit{fill:#000;font-size:16px}.c3-chart-arcs .c3-chart-arcs-gauge-max{fill:#777}.c3-chart-arcs .c3-chart-arcs-gauge-min{fill:#777}.c3-chart-arc .c3-gauge-value{fill:#000}.c3-chart-arc.c3-target g path{opacity:1}.c3-chart-arc.c3-target.c3-focused g path{opacity:1}
\ No newline at end of file
+.c3 svg{font:10px sans-serif;-webkit-tap-highlight-color:transparent}.c3 line,.c3 path{fill:none;stroke:#000}.c3 text{-webkit-user-select:none;-moz-user-select:none;user-select:none}.c3-bars path,.c3-event-rect,.c3-legend-item-tile,.c3-xgrid-focus,.c3-ygrid{shape-rendering:crispEdges}.c3-chart-arc path{stroke:#fff}.c3-chart-arc rect{stroke:#fff;stroke-width:1}.c3-chart-arc text{fill:#fff;font-size:13px}.c3-grid line{stroke:#aaa}.c3-grid text{fill:#aaa}.c3-xgrid,.c3-ygrid{stroke-dasharray:3 3}.c3-text.c3-empty{fill:grey;font-size:2em}.c3-line{stroke-width:1px}.c3-circle._expanded_{stroke-width:1px;stroke:#fff}.c3-selected-circle{fill:#fff;stroke-width:2px}.c3-bar{stroke-width:0}.c3-bar._expanded_{fill-opacity:1;fill-opacity:.75}.c3-target.c3-focused{opacity:1}.c3-target.c3-focused path.c3-line,.c3-target.c3-focused path.c3-step{stroke-width:2px}.c3-target.c3-defocused{opacity:.3!important}.c3-region{fill:#4682b4;fill-opacity:.1}.c3-brush .extent{fill-opacity:.1}.c3-legend-item{font-size:12px}.c3-legend-item-hidden{opacity:.15}.c3-legend-background{opacity:.75;fill:#fff;stroke:#d3d3d3;stroke-width:1}.c3-title{font:14px sans-serif}.c3-tooltip-container{z-index:10}.c3-tooltip{border-collapse:collapse;border-spacing:0;background-color:#fff;empty-cells:show;-webkit-box-shadow:7px 7px 12px -9px #777;-moz-box-shadow:7px 7px 12px -9px #777;box-shadow:7px 7px 12px -9px #777;opacity:.9}.c3-tooltip tr{border:1px solid #ccc}.c3-tooltip th{background-color:#aaa;font-size:14px;padding:2px 5px;text-align:left;color:#fff}.c3-tooltip td{font-size:13px;padding:3px 6px;background-color:#fff;border-left:1px dotted #999}.c3-tooltip td>span{display:inline-block;width:10px;height:10px;margin-right:6px}.c3-tooltip td.value{text-align:right}.c3-area{stroke-width:0;opacity:.2}.c3-chart-arcs-title{dominant-baseline:middle;font-size:1.3em}.c3-chart-arcs .c3-chart-arcs-background{fill:#e0e0e0;stroke:#fff}.c3-chart-arcs .c3-chart-arcs-gauge-unit{fill:#000;font-size:16px}.c3-chart-arcs .c3-chart-arcs-gauge-max{fill:#777}.c3-chart-arcs .c3-chart-arcs-gauge-min{fill:#777}.c3-chart-arc .c3-gauge-value{fill:#000}.c3-chart-arc.c3-target g path{opacity:1}.c3-chart-arc.c3-target.c3-focused g path{opacity:1}.c3-drag-zoom.enabled{pointer-events:all!important;visibility:visible}.c3-drag-zoom.disabled{pointer-events:none!important;visibility:hidden}.c3-drag-zoom .extent{fill-opacity:.1}
\ No newline at end of file
index bf38311da36ff1f01e86a211fb9679e1e1c3bc89..a5a21e9e1104734c8073b515732b50d72b1ca758 100644 (file)
@@ -1,2 +1,2 @@
-/* @license C3.js v0.6.1 | (c) C3 Team and other contributors | http://c3js.org/ */
-!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.c3=e()}(this,function(){"use strict";var t,e,i={target:"c3-target",chart:"c3-chart",chartLine:"c3-chart-line",chartLines:"c3-chart-lines",chartBar:"c3-chart-bar",chartBars:"c3-chart-bars",chartText:"c3-chart-text",chartTexts:"c3-chart-texts",chartArc:"c3-chart-arc",chartArcs:"c3-chart-arcs",chartArcsTitle:"c3-chart-arcs-title",chartArcsBackground:"c3-chart-arcs-background",chartArcsGaugeUnit:"c3-chart-arcs-gauge-unit",chartArcsGaugeMax:"c3-chart-arcs-gauge-max",chartArcsGaugeMin:"c3-chart-arcs-gauge-min",selectedCircle:"c3-selected-circle",selectedCircles:"c3-selected-circles",eventRect:"c3-event-rect",eventRects:"c3-event-rects",eventRectsSingle:"c3-event-rects-single",eventRectsMultiple:"c3-event-rects-multiple",zoomRect:"c3-zoom-rect",brush:"c3-brush",focused:"c3-focused",defocused:"c3-defocused",region:"c3-region",regions:"c3-regions",title:"c3-title",tooltipContainer:"c3-tooltip-container",tooltip:"c3-tooltip",tooltipName:"c3-tooltip-name",shape:"c3-shape",shapes:"c3-shapes",line:"c3-line",lines:"c3-lines",bar:"c3-bar",bars:"c3-bars",circle:"c3-circle",circles:"c3-circles",arc:"c3-arc",arcLabelLine:"c3-arc-label-line",arcs:"c3-arcs",area:"c3-area",areas:"c3-areas",empty:"c3-empty",text:"c3-text",texts:"c3-texts",gaugeValue:"c3-gauge-value",grid:"c3-grid",gridLines:"c3-grid-lines",xgrid:"c3-xgrid",xgrids:"c3-xgrids",xgridLine:"c3-xgrid-line",xgridLines:"c3-xgrid-lines",xgridFocus:"c3-xgrid-focus",ygrid:"c3-ygrid",ygrids:"c3-ygrids",ygridLine:"c3-ygrid-line",ygridLines:"c3-ygrid-lines",axis:"c3-axis",axisX:"c3-axis-x",axisXLabel:"c3-axis-x-label",axisY:"c3-axis-y",axisYLabel:"c3-axis-y-label",axisY2:"c3-axis-y2",axisY2Label:"c3-axis-y2-label",legendBackground:"c3-legend-background",legendItem:"c3-legend-item",legendItemEvent:"c3-legend-item-event",legendItemTile:"c3-legend-item-tile",legendItemHidden:"c3-legend-item-hidden",legendItemFocused:"c3-legend-item-focused",dragarea:"c3-dragarea",EXPANDED:"_expanded_",SELECTED:"_selected_",INCLUDED:"_included_"},n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},s=function(t){return t||0===t},o=function(t){return"function"==typeof t},c=function(t){return Array.isArray(t)},d=function(t){return"string"==typeof t},u=function(t){return void 0===t},l=function(t){return void 0!==t},h=function(t){return 10*Math.ceil(t/10)},g=function(t){return Math.ceil(t)+.5},f=function(t){return t[1]-t[0]},p=function(t){return null==t||d(t)&&0===t.length||"object"===(void 0===t?"undefined":n(t))&&0===Object.keys(t).length},_=function(t){return!T.isEmpty(t)},x=function(t,e,i){return l(t[e])?t[e]:i},y=function(t,e){var i=!1;return Object.keys(t).forEach(function(n){t[n]===e&&(i=!0)}),i},m=function(t){return"string"==typeof t?t.replace(/</g,"&lt;").replace(/>/g,"&gt;"):t},S=function(t){var e=t.getBoundingClientRect(),i=[t.pathSegList.getItem(0),t.pathSegList.getItem(1)];return{x:i[0].x,y:Math.min(i[0].y,i[1].y),width:e.width,height:e.height}};function w(t,e){var i=this;i.component=t,i.params=e||{},i.d3=t.d3,i.scale=i.d3.scaleLinear(),i.range,i.orient="bottom",i.innerTickSize=6,i.outerTickSize=this.params.withOuterTick?6:0,i.tickPadding=3,i.tickValues=null,i.tickFormat,i.tickArguments,i.tickOffset=0,i.tickCulling=!0,i.tickCentered,i.tickTextCharSize,i.tickTextRotate=i.params.tickTextRotate,i.tickLength,i.axis=i.generateAxis()}(e=w.prototype).axisX=function(t,e,i){t.attr("transform",function(t){return"translate("+Math.ceil(e(t)+i)+", 0)"})},e.axisY=function(t,e){t.attr("transform",function(t){return"translate(0,"+Math.ceil(e(t))+")"})},e.scaleExtent=function(t){var e=t[0],i=t[t.length-1];return e<i?[e,i]:[i,e]},e.generateTicks=function(t){var e,i,n=[];if(t.ticks)return t.ticks.apply(t,this.tickArguments);for(i=t.domain(),e=Math.ceil(i[0]);e<i[1];e++)n.push(e);return n.length>0&&n[0]>0&&n.unshift(n[0]-(n[1]-n[0])),n},e.copyScale=function(){var t,e=this.scale.copy();return this.params.isCategory&&(t=this.scale.domain(),e.domain([t[0],t[1]-1])),e},e.textFormatted=function(t){var e=this.tickFormat?this.tickFormat(t):t;return void 0!==e?e:""},e.updateRange=function(){var t=this;return t.range=t.scale.rangeExtent?t.scale.rangeExtent():t.scaleExtent(t.scale.range()),t.range},e.updateTickTextCharSize=function(t){var e=this;if(e.tickTextCharSize)return e.tickTextCharSize;var i={h:11.5,w:5.5};return t.select("text").text(function(t){return e.textFormatted(t)}).each(function(t){var n=this.getBoundingClientRect(),a=e.textFormatted(t),r=n.height,s=a?n.width/a.length:void 0;r&&s&&(i.h=r,i.w=s)}).text(""),e.tickTextCharSize=i,i},e.isVertical=function(){return"left"===this.orient||"right"===this.orient},e.tspanData=function(t,e,i){var n=this,a=n.params.tickMultiline?n.splitTickText(t,i):[].concat(n.textFormatted(t));return n.params.tickMultiline&&n.params.tickMultilineMax>0&&(a=n.ellipsify(a,n.params.tickMultilineMax)),a.map(function(t){return{index:e,splitted:t,length:a.length}})},e.splitTickText=function(t,e){var i,n,a,r=this,s=r.textFormatted(t),o=r.params.tickWidth;if("[object Array]"===Object.prototype.toString.call(s))return s;return(!o||o<=0)&&(o=r.isVertical()?95:r.params.isCategory?Math.ceil(e(1)-e(0))-12:110),function t(e,s){n=void 0;for(var c=1;c<s.length;c++)if(" "===s.charAt(c)&&(n=c),i=s.substr(0,c+1),a=r.tickTextCharSize.w*i.length,o<a)return t(e.concat(s.substr(0,n||c)),s.slice(n?n+1:c));return e.concat(s)}([],s+"")},e.ellipsify=function(t,e){if(t.length<=e)return t;for(var i=t.slice(0,e),n=3,a=e-1;a>=0;a--){var r=i[a].length;if(i[a]=i[a].substr(0,r-n).padEnd(r,"."),(n-=r)<=0)break}return i},e.updateTickLength=function(){this.tickLength=Math.max(this.innerTickSize,0)+this.tickPadding},e.lineY2=function(t){var e=this,i=e.scale(t)+(e.tickCentered?0:e.tickOffset);return e.range[0]<i&&i<e.range[1]?e.innerTickSize:0},e.textY=function(){var t=this.tickTextRotate;return t?11.5-t/15*2.5*(t>0?1:-1):this.tickLength},e.textTransform=function(){var t=this.tickTextRotate;return t?"rotate("+t+")":""},e.textTextAnchor=function(){var t=this.tickTextRotate;return t?t>0?"start":"end":"middle"},e.tspanDx=function(){var t=this.tickTextRotate;return t?8*Math.sin(Math.PI*(t/180)):0},e.tspanDy=function(t,e){var i=this.tickTextCharSize.h;return 0===e&&(i=this.isVertical()?-((t.length-1)*(this.tickTextCharSize.h/2)-3):".71em"),i},e.generateAxis=function(){var t=this,e=t.d3,i=t.params;function n(a,r){var s;return a.each(function(){var a,o,c,d=n.g=e.select(this),u=this.__chart__||t.scale,l=this.__chart__=t.copyScale(),h=t.tickValues?t.tickValues:t.generateTicks(l),g=d.selectAll(".tick").data(h,l),f=g.enter().insert("g",".domain").attr("class","tick").style("opacity",1e-6),p=g.exit().remove(),_=g.merge(f);i.isCategory?(t.tickOffset=Math.ceil((l(1)-l(0))/2),o=t.tickCentered?0:t.tickOffset,c=t.tickCentered?t.tickOffset:0):t.tickOffset=o=0,t.updateRange(),t.updateTickLength(),t.updateTickTextCharSize(d.select(".tick"));var x=_.select("line").merge(f.append("line")),y=_.select("text").merge(f.append("text")),m=_.selectAll("text").selectAll("tspan").data(function(e,i){return t.tspanData(e,i,l)}),S=m.enter().append("tspan").merge(m).text(function(t){return t.splitted});m.exit().remove();var w=d.selectAll(".domain").data([0]),v=w.enter().append("path").merge(w).attr("class","domain");switch(t.orient){case"bottom":a=t.axisX,x.attr("x1",o).attr("x2",o).attr("y2",function(e,i){return t.lineY2(e,i)}),y.attr("x",0).attr("y",function(e,i){return t.textY(e,i)}).attr("transform",function(e,i){return t.textTransform(e,i)}).style("text-anchor",function(e,i){return t.textTextAnchor(e,i)}),S.attr("x",0).attr("dy",function(e,i){return t.tspanDy(e,i)}).attr("dx",function(e,i){return t.tspanDx(e,i)}),v.attr("d","M"+t.range[0]+","+t.outerTickSize+"V0H"+t.range[1]+"V"+t.outerTickSize);break;case"top":a=t.axisX,x.attr("x1",o).attr("x2",o).attr("y2",function(e,i){return-1*t.lineY2(e,i)}),y.attr("x",0).attr("y",function(e,n){return-1*t.textY(e,n)-(i.isCategory?2:t.tickLength-2)}).attr("transform",function(e,i){return t.textTransform(e,i)}).style("text-anchor",function(e,i){return t.textTextAnchor(e,i)}),S.attr("x",0).attr("dy",function(e,i){return t.tspanDy(e,i)}).attr("dx",function(e,i){return t.tspanDx(e,i)}),v.attr("d","M"+t.range[0]+","+-t.outerTickSize+"V0H"+t.range[1]+"V"+-t.outerTickSize);break;case"left":a=t.axisY,x.attr("x2",-t.innerTickSize).attr("y1",c).attr("y2",c),y.attr("x",-t.tickLength).attr("y",t.tickOffset).style("text-anchor","end"),S.attr("x",-t.tickLength).attr("dy",function(e,i){return t.tspanDy(e,i)}),v.attr("d","M"+-t.outerTickSize+","+t.range[0]+"H0V"+t.range[1]+"H"+-t.outerTickSize);break;case"right":a=t.axisY,x.attr("x2",t.innerTickSize).attr("y1",c).attr("y2",c),y.attr("x",t.tickLength).attr("y",t.tickOffset).style("text-anchor","start"),S.attr("x",t.tickLength).attr("dy",function(e,i){return t.tspanDy(e,i)}),v.attr("d","M"+t.outerTickSize+","+t.range[0]+"H0V"+t.range[1]+"H"+t.outerTickSize)}if(l.rangeBand){var b=l,T=b.rangeBand()/2;u=l=function(t){return b(t)+T}}else u.rangeBand?u=l:p.call(a,l,t.tickOffset);f.call(a,u,t.tickOffset),s=(r?_.transition(r):_).style("opacity",1).call(a,l,t.tickOffset)}),s}return n.scale=function(e){return arguments.length?(t.scale=e,n):t.scale},n.orient=function(e){return arguments.length?(t.orient=e in{top:1,right:1,bottom:1,left:1}?e+"":"bottom",n):t.orient},n.tickFormat=function(e){return arguments.length?(t.tickFormat=e,n):t.tickFormat},n.tickCentered=function(e){return arguments.length?(t.tickCentered=e,n):t.tickCentered},n.tickOffset=function(){return t.tickOffset},n.tickInterval=function(){var e;return(e=i.isCategory?2*t.tickOffset:(n.g.select("path.domain").node().getTotalLength()-2*t.outerTickSize)/n.g.selectAll("line").size())===1/0?0:e},n.ticks=function(){return arguments.length?(t.tickArguments=arguments,n):t.tickArguments},n.tickCulling=function(e){return arguments.length?(t.tickCulling=e,n):t.tickCulling},n.tickValues=function(e){if("function"==typeof e)t.tickValues=function(){return e(t.scale.domain())};else{if(!arguments.length)return t.tickValues;t.tickValues=e}return n},n};var v=function(i){function n(i){a(this,n);var s={fn:t,internal:{fn:e}},o=r(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,i,"axis",s));return o.d3=i.d3,o.internal=w,o}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(n,P),n}();(t=v.prototype).init=function(){var t=this.owner,e=t.config,n=t.main;t.axes.x=n.append("g").attr("class",i.axis+" "+i.axisX).attr("clip-path",e.axis_x_inner?"":t.clipPathForXAxis).attr("transform",t.getTranslate("x")).style("visibility",e.axis_x_show?"visible":"hidden"),t.axes.x.append("text").attr("class",i.axisXLabel).attr("transform",e.axis_rotated?"rotate(-90)":"").style("text-anchor",this.textAnchorForXAxisLabel.bind(this)),t.axes.y=n.append("g").attr("class",i.axis+" "+i.axisY).attr("clip-path",e.axis_y_inner?"":t.clipPathForYAxis).attr("transform",t.getTranslate("y")).style("visibility",e.axis_y_show?"visible":"hidden"),t.axes.y.append("text").attr("class",i.axisYLabel).attr("transform",e.axis_rotated?"":"rotate(-90)").style("text-anchor",this.textAnchorForYAxisLabel.bind(this)),t.axes.y2=n.append("g").attr("class",i.axis+" "+i.axisY2).attr("transform",t.getTranslate("y2")).style("visibility",e.axis_y2_show?"visible":"hidden"),t.axes.y2.append("text").attr("class",i.axisY2Label).attr("transform",e.axis_rotated?"":"rotate(-90)").style("text-anchor",this.textAnchorForY2AxisLabel.bind(this))},t.getXAxis=function(t,e,i,n,a,r,s){var o=this.owner,c=o.config,d={isCategory:o.isCategorized(),withOuterTick:a,tickMultiline:c.axis_x_tick_multiline,tickMultilineMax:c.axis_x_tick_multiline?Number(c.axis_x_tick_multilineMax):0,tickWidth:c.axis_x_tick_width,tickTextRotate:s?0:c.axis_x_tick_rotate,withoutTransition:r},u=new this.internal(this,d).axis.scale(t).orient(e);return o.isTimeSeries()&&n&&"function"!=typeof n&&(n=n.map(function(t){return o.parseDate(t)})),u.tickFormat(i).tickValues(n),o.isCategorized()&&(u.tickCentered(c.axis_x_tick_centered),p(c.axis_x_tick_culling)&&(c.axis_x_tick_culling=!1)),u},t.updateXAxisTickValues=function(t,e){var i,n=this.owner,a=n.config;return(a.axis_x_tick_fit||a.axis_x_tick_count)&&(i=this.generateTickValues(n.mapTargetsToUniqueXs(t),a.axis_x_tick_count,n.isTimeSeries())),e?e.tickValues(i):(n.xAxis.tickValues(i),n.subXAxis.tickValues(i)),i},t.getYAxis=function(t,e,i,n,a,r,s){var o=this.owner,c=o.config,d={withOuterTick:a,withoutTransition:r,tickTextRotate:s?0:c.axis_y_tick_rotate},u=new this.internal(this,d).axis.scale(t).orient(e).tickFormat(i);return o.isTimeSeriesY()?u.ticks(c.axis_y_tick_time_type,c.axis_y_tick_time_interval):u.tickValues(n),u},t.getId=function(t){var e=this.owner.config;return t in e.data_axes?e.data_axes[t]:"y"},t.getXAxisTickFormat=function(){var t=this.owner,e=t.config,i=t.isTimeSeries()?t.defaultAxisTimeFormat:t.isCategorized()?t.categoryName:function(t){return t};return e.axis_x_tick_format&&(o(e.axis_x_tick_format)?i=e.axis_x_tick_format:t.isTimeSeries()&&(i=function(i){return i?t.axisTimeFormat(e.axis_x_tick_format)(i):""})),o(i)?function(e){return i.call(t,e)}:i},t.getTickValues=function(t,e){return t||(e?e.tickValues():void 0)},t.getXAxisTickValues=function(){return this.getTickValues(this.owner.config.axis_x_tick_values,this.owner.xAxis)},t.getYAxisTickValues=function(){return this.getTickValues(this.owner.config.axis_y_tick_values,this.owner.yAxis)},t.getY2AxisTickValues=function(){return this.getTickValues(this.owner.config.axis_y2_tick_values,this.owner.y2Axis)},t.getLabelOptionByAxisId=function(t){var e,i=this.owner.config;return"y"===t?e=i.axis_y_label:"y2"===t?e=i.axis_y2_label:"x"===t&&(e=i.axis_x_label),e},t.getLabelText=function(t){var e=this.getLabelOptionByAxisId(t);return d(e)?e:e?e.text:null},t.setLabelText=function(t,e){var i=this.owner.config,n=this.getLabelOptionByAxisId(t);d(n)?"y"===t?i.axis_y_label=e:"y2"===t?i.axis_y2_label=e:"x"===t&&(i.axis_x_label=e):n&&(n.text=e)},t.getLabelPosition=function(t,e){var i=this.getLabelOptionByAxisId(t),a=i&&"object"===(void 0===i?"undefined":n(i))&&i.position?i.position:e;return{isInner:a.indexOf("inner")>=0,isOuter:a.indexOf("outer")>=0,isLeft:a.indexOf("left")>=0,isCenter:a.indexOf("center")>=0,isRight:a.indexOf("right")>=0,isTop:a.indexOf("top")>=0,isMiddle:a.indexOf("middle")>=0,isBottom:a.indexOf("bottom")>=0}},t.getXAxisLabelPosition=function(){return this.getLabelPosition("x",this.owner.config.axis_rotated?"inner-top":"inner-right")},t.getYAxisLabelPosition=function(){return this.getLabelPosition("y",this.owner.config.axis_rotated?"inner-right":"inner-top")},t.getY2AxisLabelPosition=function(){return this.getLabelPosition("y2",this.owner.config.axis_rotated?"inner-right":"inner-top")},t.getLabelPositionById=function(t){return"y2"===t?this.getY2AxisLabelPosition():"y"===t?this.getYAxisLabelPosition():this.getXAxisLabelPosition()},t.textForXAxisLabel=function(){return this.getLabelText("x")},t.textForYAxisLabel=function(){return this.getLabelText("y")},t.textForY2AxisLabel=function(){return this.getLabelText("y2")},t.xForAxisLabel=function(t,e){var i=this.owner;return t?e.isLeft?0:e.isCenter?i.width/2:i.width:e.isBottom?-i.height:e.isMiddle?-i.height/2:0},t.dxForAxisLabel=function(t,e){return t?e.isLeft?"0.5em":e.isRight?"-0.5em":"0":e.isTop?"-0.5em":e.isBottom?"0.5em":"0"},t.textAnchorForAxisLabel=function(t,e){return t?e.isLeft?"start":e.isCenter?"middle":"end":e.isBottom?"start":e.isMiddle?"middle":"end"},t.xForXAxisLabel=function(){return this.xForAxisLabel(!this.owner.config.axis_rotated,this.getXAxisLabelPosition())},t.xForYAxisLabel=function(){return this.xForAxisLabel(this.owner.config.axis_rotated,this.getYAxisLabelPosition())},t.xForY2AxisLabel=function(){return this.xForAxisLabel(this.owner.config.axis_rotated,this.getY2AxisLabelPosition())},t.dxForXAxisLabel=function(){return this.dxForAxisLabel(!this.owner.config.axis_rotated,this.getXAxisLabelPosition())},t.dxForYAxisLabel=function(){return this.dxForAxisLabel(this.owner.config.axis_rotated,this.getYAxisLabelPosition())},t.dxForY2AxisLabel=function(){return this.dxForAxisLabel(this.owner.config.axis_rotated,this.getY2AxisLabelPosition())},t.dyForXAxisLabel=function(){var t=this.owner,e=t.config,i=this.getXAxisLabelPosition();return e.axis_rotated?i.isInner?"1.2em":-25-(t.config.axis_x_inner?0:this.getMaxTickWidth("x")):i.isInner?"-0.5em":e.axis_x_height?e.axis_x_height-10:"3em"},t.dyForYAxisLabel=function(){var t=this.owner,e=this.getYAxisLabelPosition();return t.config.axis_rotated?e.isInner?"-0.5em":"3em":e.isInner?"1.2em":-10-(t.config.axis_y_inner?0:this.getMaxTickWidth("y")+10)},t.dyForY2AxisLabel=function(){var t=this.owner,e=this.getY2AxisLabelPosition();return t.config.axis_rotated?e.isInner?"1.2em":"-2.2em":e.isInner?"-0.5em":15+(t.config.axis_y2_inner?0:this.getMaxTickWidth("y2")+15)},t.textAnchorForXAxisLabel=function(){var t=this.owner;return this.textAnchorForAxisLabel(!t.config.axis_rotated,this.getXAxisLabelPosition())},t.textAnchorForYAxisLabel=function(){var t=this.owner;return this.textAnchorForAxisLabel(t.config.axis_rotated,this.getYAxisLabelPosition())},t.textAnchorForY2AxisLabel=function(){var t=this.owner;return this.textAnchorForAxisLabel(t.config.axis_rotated,this.getY2AxisLabelPosition())},t.getMaxTickWidth=function(t,e){var i,n,a,r,s=this.owner,o=s.config,c=0;return e&&s.currentMaxTickWidths[t]?s.currentMaxTickWidths[t]:(s.svg&&(i=s.filterTargetsToShow(s.data.targets),"y"===t?(n=s.y.copy().domain(s.getYDomain(i,"y")),a=this.getYAxis(n,s.yOrient,o.axis_y_tick_format,s.yAxisTickValues,!1,!0,!0)):"y2"===t?(n=s.y2.copy().domain(s.getYDomain(i,"y2")),a=this.getYAxis(n,s.y2Orient,o.axis_y2_tick_format,s.y2AxisTickValues,!1,!0,!0)):(n=s.x.copy().domain(s.getXDomain(i)),a=this.getXAxis(n,s.xOrient,s.xAxisTickFormat,s.xAxisTickValues,!1,!0,!0),this.updateXAxisTickValues(i,a)),(r=s.d3.select("body").append("div").classed("c3",!0)).append("svg").style("visibility","hidden").style("position","fixed").style("top",0).style("left",0).append("g").call(a).each(function(){s.d3.select(this).selectAll("text").each(function(){var t=this.getBoundingClientRect();c<t.width&&(c=t.width)}),r.remove()})),s.currentMaxTickWidths[t]=c<=0?s.currentMaxTickWidths[t]:c,s.currentMaxTickWidths[t])},t.updateLabels=function(t){var e=this.owner,n=e.main.select("."+i.axisX+" ."+i.axisXLabel),a=e.main.select("."+i.axisY+" ."+i.axisYLabel),r=e.main.select("."+i.axisY2+" ."+i.axisY2Label);(t?n.transition():n).attr("x",this.xForXAxisLabel.bind(this)).attr("dx",this.dxForXAxisLabel.bind(this)).attr("dy",this.dyForXAxisLabel.bind(this)).text(this.textForXAxisLabel.bind(this)),(t?a.transition():a).attr("x",this.xForYAxisLabel.bind(this)).attr("dx",this.dxForYAxisLabel.bind(this)).attr("dy",this.dyForYAxisLabel.bind(this)).text(this.textForYAxisLabel.bind(this)),(t?r.transition():r).attr("x",this.xForY2AxisLabel.bind(this)).attr("dx",this.dxForY2AxisLabel.bind(this)).attr("dy",this.dyForY2AxisLabel.bind(this)).text(this.textForY2AxisLabel.bind(this))},t.getPadding=function(t,e,i,n){var a="number"==typeof t?t:t[e];return s(a)?"ratio"===t.unit?t[e]*n:this.convertPixelsToAxisPadding(a,n):i},t.convertPixelsToAxisPadding=function(t,e){var i=this.owner;return e*(t/(i.config.axis_rotated?i.width:i.height))},t.generateTickValues=function(t,e,i){var n,a,r,s,c,d,u,l=t;if(e)if(1===(n=o(e)?e():e))l=[t[0]];else if(2===n)l=[t[0],t[t.length-1]];else if(n>2){for(s=n-2,a=t[0],c=((r=t[t.length-1])-a)/(s+1),l=[a],d=0;d<s;d++)u=+a+c*(d+1),l.push(i?new Date(u):u);l.push(r)}return i||(l=l.sort(function(t,e){return t-e})),l},t.generateTransitions=function(t){var e=this.owner.axes;return{axisX:t?e.x.transition().duration(t):e.x,axisY:t?e.y.transition().duration(t):e.y,axisY2:t?e.y2.transition().duration(t):e.y2,axisSubX:t?e.subx.transition().duration(t):e.subx}},t.redraw=function(t,e){var i=this.owner,n=t?i.d3.transition().duration(t):null;i.axes.x.style("opacity",e?0:1).call(i.xAxis,n),i.axes.y.style("opacity",e?0:1).call(i.yAxis,n),i.axes.y2.style("opacity",e?0:1).call(i.y2Axis,n),i.axes.subx.style("opacity",e?0:1).call(i.subXAxis,n)};var b,T,A={version:"0.6.1"};function P(t,e,i){this.owner=t,A.chart.internal[e]=i}function C(t){var e=this.internal=new L(this);e.loadConfig(t),e.beforeInit(t),e.init(),e.afterInit(t),function t(e,i,n){Object.keys(e).forEach(function(a){i[a]=e[a].bind(n),Object.keys(e[a]).length>0&&t(e[a],i[a],n)})}(b,this,this)}function L(t){var e=this;e.d3=window.d3?window.d3:"undefined"!=typeof require?require("d3"):void 0,e.api=t,e.config=e.getDefaultConfig(),e.data={},e.cache={},e.axes={}}return A.generate=function(t){return new C(t)},A.chart={fn:C.prototype,internal:{fn:L.prototype}},b=A.chart.fn,(T=A.chart.internal.fn).beforeInit=function(){},T.afterInit=function(){},T.init=function(){var t=this,e=t.config;if(t.initParams(),e.data_url)t.convertUrlToData(e.data_url,e.data_mimeType,e.data_headers,e.data_keys,t.initWithData);else if(e.data_json)t.initWithData(t.convertJsonToData(e.data_json,e.data_keys));else if(e.data_rows)t.initWithData(t.convertRowsToData(e.data_rows));else{if(!e.data_columns)throw Error("url or json or rows or columns is required.");t.initWithData(t.convertColumnsToData(e.data_columns))}},T.initParams=function(){var t=this,e=t.d3,i=t.config;t.clipId="c3-"+ +new Date+"-clip",t.clipIdForXAxis=t.clipId+"-xaxis",t.clipIdForYAxis=t.clipId+"-yaxis",t.clipIdForGrid=t.clipId+"-grid",t.clipIdForSubchart=t.clipId+"-subchart",t.clipPath=t.getClipPath(t.clipId),t.clipPathForXAxis=t.getClipPath(t.clipIdForXAxis),t.clipPathForYAxis=t.getClipPath(t.clipIdForYAxis),t.clipPathForGrid=t.getClipPath(t.clipIdForGrid),t.clipPathForSubchart=t.getClipPath(t.clipIdForSubchart),t.dragStart=null,t.dragging=!1,t.flowing=!1,t.cancelClick=!1,t.mouseover=!1,t.transiting=!1,t.color=t.generateColor(),t.levelColor=t.generateLevelColor(),t.dataTimeParse=(i.data_xLocaltime?e.timeParse:e.utcParse)(t.config.data_xFormat),t.axisTimeFormat=i.axis_x_localtime?e.timeFormat:e.utcFormat,t.defaultAxisTimeFormat=function(t){return t.getMilliseconds()?e.timeFormat(".%L")(t):t.getSeconds()?e.timeFormat(":%S")(t):t.getMinutes()?e.timeFormat("%I:%M")(t):t.getHours()?e.timeFormat("%I %p")(t):t.getDay()&&1!==t.getDate()?e.timeFormat("%-m/%-d")(t):1!==t.getDate()?e.timeFormat("%-m/%-d")(t):t.getMonth()?e.timeFormat("%-m/%-d")(t):e.timeFormat("%Y/%-m/%-d")(t)},t.hiddenTargetIds=[],t.hiddenLegendIds=[],t.focusedTargetIds=[],t.defocusedTargetIds=[],t.xOrient=i.axis_rotated?i.axis_x_inner?"right":"left":i.axis_x_inner?"top":"bottom",t.yOrient=i.axis_rotated?i.axis_y_inner?"top":"bottom":i.axis_y_inner?"right":"left",t.y2Orient=i.axis_rotated?i.axis_y2_inner?"bottom":"top":i.axis_y2_inner?"left":"right",t.subXOrient=i.axis_rotated?"left":"bottom",t.isLegendRight="right"===i.legend_position,t.isLegendInset="inset"===i.legend_position,t.isLegendTop="top-left"===i.legend_inset_anchor||"top-right"===i.legend_inset_anchor,t.isLegendLeft="top-left"===i.legend_inset_anchor||"bottom-left"===i.legend_inset_anchor,t.legendStep=0,t.legendItemWidth=0,t.legendItemHeight=0,t.currentMaxTickWidths={x:0,y:0,y2:0},t.rotated_padding_left=30,t.rotated_padding_right=i.axis_rotated&&!i.axis_x_show?0:30,t.rotated_padding_top=5,t.withoutFadeIn={},t.intervalForObserveInserted=void 0,t.axes.subx=e.selectAll([])},T.initChartElements=function(){this.initBar&&this.initBar(),this.initLine&&this.initLine(),this.initArc&&this.initArc(),this.initGauge&&this.initGauge(),this.initText&&this.initText()},T.initWithData=function(t){var e,n,a=this,r=a.d3,s=a.config,o=!0;a.axis=new v(a),s.bindto?"function"==typeof s.bindto.node?a.selectChart=s.bindto:a.selectChart=r.select(s.bindto):a.selectChart=r.selectAll([]),a.selectChart.empty()&&(a.selectChart=r.select(document.createElement("div")).style("opacity",0),a.observeInserted(a.selectChart),o=!1),a.selectChart.html("").classed("c3",!0),a.data.xs={},a.data.targets=a.convertDataToTargets(t),s.data_filter&&(a.data.targets=a.data.targets.filter(s.data_filter)),s.data_hide&&a.addHiddenTargetIds(!0===s.data_hide?a.mapToIds(a.data.targets):s.data_hide),s.legend_hide&&a.addHiddenLegendIds(!0===s.legend_hide?a.mapToIds(a.data.targets):s.legend_hide),a.updateSizes(),a.updateScales(),a.x.domain(r.extent(a.getXDomain(a.data.targets))),a.y.domain(a.getYDomain(a.data.targets,"y")),a.y2.domain(a.getYDomain(a.data.targets,"y2")),a.subX.domain(a.x.domain()),a.subY.domain(a.y.domain()),a.subY2.domain(a.y2.domain()),a.orgXDomain=a.x.domain(),a.svg=a.selectChart.append("svg").style("overflow","hidden").on("mouseenter",function(){return s.onmouseover.call(a)}).on("mouseleave",function(){return s.onmouseout.call(a)}),a.config.svg_classname&&a.svg.attr("class",a.config.svg_classname),e=a.svg.append("defs"),a.clipChart=a.appendClip(e,a.clipId),a.clipXAxis=a.appendClip(e,a.clipIdForXAxis),a.clipYAxis=a.appendClip(e,a.clipIdForYAxis),a.clipGrid=a.appendClip(e,a.clipIdForGrid),a.clipSubchart=a.appendClip(e,a.clipIdForSubchart),a.updateSvgSize(),n=a.main=a.svg.append("g").attr("transform",a.getTranslate("main")),a.initPie&&a.initPie(),a.initSubchart&&a.initSubchart(),a.initTooltip&&a.initTooltip(),a.initLegend&&a.initLegend(),a.initTitle&&a.initTitle(),a.initZoom&&a.initZoom(),a.initSubchartBrush&&a.initSubchartBrush(),n.append("text").attr("class",i.text+" "+i.empty).attr("text-anchor","middle").attr("dominant-baseline","middle"),a.initRegion(),a.initGrid(),n.append("g").attr("clip-path",a.clipPath).attr("class",i.chart),s.grid_lines_front&&a.initGridLines(),a.initChartElements(),a.axis.init(),a.updateTargets(a.data.targets),a.initEventRect(),s.axis_x_selection&&a.brush.selectionAsValue(a.getDefaultSelection()),o&&(a.updateDimension(),a.config.oninit.call(a),a.redraw({withTransition:!1,withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withTransitionForAxis:!1})),a.bindResize(),a.api.element=a.selectChart.node()},T.smoothLines=function(t,e){var i=this;"grid"===e&&t.each(function(){var t=i.d3.select(this),e=t.attr("x1"),n=t.attr("x2"),a=t.attr("y1"),r=t.attr("y2");t.attr({x1:Math.ceil(e),x2:Math.ceil(n),y1:Math.ceil(a),y2:Math.ceil(r)})})},T.updateSizes=function(){var t=this,e=t.config,i=t.legend?t.getLegendHeight():0,n=t.legend?t.getLegendWidth():0,a=t.isLegendRight||t.isLegendInset?0:i,r=t.hasArcType(),s=e.axis_rotated||r?0:t.getHorizontalAxisHeight("x"),o=e.subchart_show&&!r?e.subchart_size_height+s:0;t.currentWidth=t.getCurrentWidth(),t.currentHeight=t.getCurrentHeight(),t.margin=e.axis_rotated?{top:t.getHorizontalAxisHeight("y2")+t.getCurrentPaddingTop(),right:r?0:t.getCurrentPaddingRight(),bottom:t.getHorizontalAxisHeight("y")+a+t.getCurrentPaddingBottom(),left:o+(r?0:t.getCurrentPaddingLeft())}:{top:4+t.getCurrentPaddingTop(),right:r?0:t.getCurrentPaddingRight(),bottom:s+o+a+t.getCurrentPaddingBottom(),left:r?0:t.getCurrentPaddingLeft()},t.margin2=e.axis_rotated?{top:t.margin.top,right:NaN,bottom:20+a,left:t.rotated_padding_left}:{top:t.currentHeight-o-a,right:NaN,bottom:s+a,left:t.margin.left},t.margin3={top:0,right:NaN,bottom:0,left:0},t.updateSizeForLegend&&t.updateSizeForLegend(i,n),t.width=t.currentWidth-t.margin.left-t.margin.right,t.height=t.currentHeight-t.margin.top-t.margin.bottom,t.width<0&&(t.width=0),t.height<0&&(t.height=0),t.width2=e.axis_rotated?t.margin.left-t.rotated_padding_left-t.rotated_padding_right:t.width,t.height2=e.axis_rotated?t.height:t.currentHeight-t.margin2.top-t.margin2.bottom,t.width2<0&&(t.width2=0),t.height2<0&&(t.height2=0),t.arcWidth=t.width-(t.isLegendRight?n+10:0),t.arcHeight=t.height-(t.isLegendRight?0:10),t.hasType("gauge")&&!e.gauge_fullCircle&&(t.arcHeight+=t.height-t.getGaugeLabelHeight()),t.updateRadius&&t.updateRadius(),t.isLegendRight&&r&&(t.margin3.left=t.arcWidth/2+1.1*t.radiusExpanded)},T.updateTargets=function(t){var e=this;e.updateTargetsForText(t),e.updateTargetsForBar(t),e.updateTargetsForLine(t),e.hasArcType()&&e.updateTargetsForArc&&e.updateTargetsForArc(t),e.updateTargetsForSubchart&&e.updateTargetsForSubchart(t),e.showTargets()},T.showTargets=function(){var t=this;t.svg.selectAll("."+i.target).filter(function(e){return t.isTargetToShow(e.id)}).transition().duration(t.config.transition_duration).style("opacity",1)},T.redraw=function(t,e){var n,a,r,s,o,c,d,u,l,h,g,f,p,_,y,m,S,w,v,b,T,A,P,C,L,V,G,E,O,I,R,k=this,D=k.main,F=k.d3,X=k.config,M=k.getShapeIndices(k.isAreaType),z=k.getShapeIndices(k.isBarType),H=k.getShapeIndices(k.isLineType),B=k.hasArcType(),Y=k.filterTargetsToShow(k.data.targets),N=k.xv.bind(k);if(n=x(t=t||{},"withY",!0),a=x(t,"withSubchart",!0),r=x(t,"withTransition",!0),c=x(t,"withTransform",!1),d=x(t,"withUpdateXDomain",!1),u=x(t,"withUpdateOrgXDomain",!1),l=x(t,"withTrimXDomain",!0),p=x(t,"withUpdateXAxis",d),h=x(t,"withLegend",!1),g=x(t,"withEventRect",!0),f=x(t,"withDimension",!0),s=x(t,"withTransitionForExit",r),o=x(t,"withTransitionForAxis",r),v=r?X.transition_duration:0,b=s?v:0,T=o?v:0,e=e||k.axis.generateTransitions(T),h&&X.legend_show?k.updateLegend(k.mapToIds(k.data.targets),t,e):f&&k.updateDimension(!0),k.isCategorized()&&0===Y.length&&k.x.domain([0,k.axes.x.selectAll(".tick").size()]),Y.length?(k.updateXDomain(Y,d,u,l),X.axis_x_tick_values||(V=k.axis.updateXAxisTickValues(Y))):(k.xAxis.tickValues([]),k.subXAxis.tickValues([])),X.zoom_rescale&&!t.flow&&(O=k.x.orgDomain()),k.y.domain(k.getYDomain(Y,"y",O)),k.y2.domain(k.getYDomain(Y,"y2",O)),!X.axis_y_tick_values&&X.axis_y_tick_count&&k.yAxis.tickValues(k.axis.generateTickValues(k.y.domain(),X.axis_y_tick_count)),!X.axis_y2_tick_values&&X.axis_y2_tick_count&&k.y2Axis.tickValues(k.axis.generateTickValues(k.y2.domain(),X.axis_y2_tick_count)),k.axis.redraw(T,B),k.axis.updateLabels(r),(d||p)&&Y.length)if(X.axis_x_tick_culling&&V){for(G=1;G<V.length;G++)if(V.length/G<X.axis_x_tick_culling_max){E=G;break}k.svg.selectAll("."+i.axisX+" .tick text").each(function(t){var e=V.indexOf(t);e>=0&&F.select(this).style("display",e%E?"none":"block")})}else k.svg.selectAll("."+i.axisX+" .tick text").style("display","block");_=k.generateDrawArea?k.generateDrawArea(M,!1):void 0,y=k.generateDrawBar?k.generateDrawBar(z):void 0,m=k.generateDrawLine?k.generateDrawLine(H,!1):void 0,S=k.generateXYForText(M,z,H,!0),w=k.generateXYForText(M,z,H,!1),k.updateCircleY(),I=(k.config.axis_rotated?k.circleY:k.circleX).bind(k),R=(k.config.axis_rotated?k.circleX:k.circleY).bind(k),n&&(k.subY.domain(k.getYDomain(Y,"y")),k.subY2.domain(k.getYDomain(Y,"y2"))),k.updateXgridFocus(),D.select("text."+i.text+"."+i.empty).attr("x",k.width/2).attr("y",k.height/2).text(X.data_empty_label_text).transition().style("opacity",Y.length?0:1),g&&k.redrawEventRect(),k.updateGrid(v),k.updateRegion(v),k.updateBar(b),k.updateLine(b),k.updateArea(b),k.updateCircle(I,R),k.hasDataLabel()&&k.updateText(S,w,b),k.redrawTitle&&k.redrawTitle(),k.redrawArc&&k.redrawArc(v,b,c),k.redrawSubchart&&k.redrawSubchart(a,e,v,b,M,z,H),D.selectAll("."+i.selectedCircles).filter(k.isBarType.bind(k)).selectAll("circle").remove(),t.flow&&(C=k.generateFlow({targets:Y,flow:t.flow,duration:t.flow.duration,drawBar:y,drawLine:m,drawArea:_,cx:I,cy:R,xv:N,xForText:S,yForText:w})),k.isTabVisible()&&(v?(L=F.transition().duration(v),A=[],[k.redrawBar(y,!0,L),k.redrawLine(m,!0,L),k.redrawArea(_,!0,L),k.redrawCircle(I,R,!0,L),k.redrawText(S,w,t.flow,!0,L),k.redrawRegion(!0,L),k.redrawGrid(!0,L)].forEach(function(t){t.forEach(function(t){A.push(t)})}),P=k.generateWait(),A.forEach(function(t){P.add(t)}),P(function(){C&&C(),X.onrendered&&X.onrendered.call(k)})):(k.redrawBar(y),k.redrawLine(m),k.redrawArea(_),k.redrawCircle(I,R),k.redrawText(S,w,t.flow),k.redrawRegion(),k.redrawGrid(),C&&C(),X.onrendered&&X.onrendered.call(k))),k.mapToIds(k.data.targets).forEach(function(t){k.withoutFadeIn[t]=!0})},T.updateAndRedraw=function(t){var e,i=this,n=i.config;(t=t||{}).withTransition=x(t,"withTransition",!0),t.withTransform=x(t,"withTransform",!1),t.withLegend=x(t,"withLegend",!1),t.withUpdateXDomain=x(t,"withUpdateXDomain",!0),t.withUpdateOrgXDomain=x(t,"withUpdateOrgXDomain",!0),t.withTransitionForExit=!1,t.withTransitionForTransform=x(t,"withTransitionForTransform",t.withTransition),i.updateSizes(),t.withLegend&&n.legend_show||(e=i.axis.generateTransitions(t.withTransitionForAxis?n.transition_duration:0),i.updateScales(),i.updateSvgSize(),i.transformAll(t.withTransitionForTransform,e)),i.redraw(t,e)},T.redrawWithoutRescale=function(){this.redraw({withY:!1,withSubchart:!1,withEventRect:!1,withTransitionForAxis:!1})},T.isTimeSeries=function(){return"timeseries"===this.config.axis_x_type},T.isCategorized=function(){return this.config.axis_x_type.indexOf("categor")>=0},T.isCustomX=function(){var t=this.config;return!this.isTimeSeries()&&(t.data_x||_(t.data_xs))},T.isTimeSeriesY=function(){return"timeseries"===this.config.axis_y_type},T.getTranslate=function(t){var e,i,n=this,a=n.config;return"main"===t?(e=g(n.margin.left),i=g(n.margin.top)):"context"===t?(e=g(n.margin2.left),i=g(n.margin2.top)):"legend"===t?(e=n.margin3.left,i=n.margin3.top):"x"===t?(e=0,i=a.axis_rotated?0:n.height):"y"===t?(e=0,i=a.axis_rotated?n.height:0):"y2"===t?(e=a.axis_rotated?0:n.width,i=a.axis_rotated?1:0):"subx"===t?(e=0,i=a.axis_rotated?0:n.height2):"arc"===t&&(e=n.arcWidth/2,i=n.arcHeight/2-(n.hasType("gauge")?6:0)),"translate("+e+","+i+")"},T.initialOpacity=function(t){return null!==t.value&&this.withoutFadeIn[t.id]?1:0},T.initialOpacityForCircle=function(t){return null!==t.value&&this.withoutFadeIn[t.id]?this.opacityForCircle(t):0},T.opacityForCircle=function(t){var e=(o(this.config.point_show)?this.config.point_show(t):this.config.point_show)?1:0;return s(t.value)?this.isScatterType(t)?.5:e:0},T.opacityForText=function(){return this.hasDataLabel()?1:0},T.xx=function(t){return t?this.x(t.x):null},T.xv=function(t){var e=this,i=t.value;return e.isTimeSeries()?i=e.parseDate(t.value):e.isCategorized()&&"string"==typeof t.value&&(i=e.config.axis_x_categories.indexOf(t.value)),Math.ceil(e.x(i))},T.yv=function(t){var e=t.axis&&"y2"===t.axis?this.y2:this.y;return Math.ceil(e(t.value))},T.subxx=function(t){return t?this.subX(t.x):null},T.transformMain=function(t,e){var n,a,r,s=this;e&&e.axisX?n=e.axisX:(n=s.main.select("."+i.axisX),t&&(n=n.transition())),e&&e.axisY?a=e.axisY:(a=s.main.select("."+i.axisY),t&&(a=a.transition())),e&&e.axisY2?r=e.axisY2:(r=s.main.select("."+i.axisY2),t&&(r=r.transition())),(t?s.main.transition():s.main).attr("transform",s.getTranslate("main")),n.attr("transform",s.getTranslate("x")),a.attr("transform",s.getTranslate("y")),r.attr("transform",s.getTranslate("y2")),s.main.select("."+i.chartArcs).attr("transform",s.getTranslate("arc"))},T.transformAll=function(t,e){var i=this;i.transformMain(t,e),i.config.subchart_show&&i.transformContext(t,e),i.legend&&i.transformLegend(t)},T.updateSvgSize=function(){var t=this,e=t.svg.select(".c3-brush .overlay");t.svg.attr("width",t.currentWidth).attr("height",t.currentHeight),t.svg.selectAll(["#"+t.clipId,"#"+t.clipIdForGrid]).select("rect").attr("width",t.width).attr("height",t.height),t.svg.select("#"+t.clipIdForXAxis).select("rect").attr("x",t.getXAxisClipX.bind(t)).attr("y",t.getXAxisClipY.bind(t)).attr("width",t.getXAxisClipWidth.bind(t)).attr("height",t.getXAxisClipHeight.bind(t)),t.svg.select("#"+t.clipIdForYAxis).select("rect").attr("x",t.getYAxisClipX.bind(t)).attr("y",t.getYAxisClipY.bind(t)).attr("width",t.getYAxisClipWidth.bind(t)).attr("height",t.getYAxisClipHeight.bind(t)),t.svg.select("#"+t.clipIdForSubchart).select("rect").attr("width",t.width).attr("height",e.size()?e.attr("height"):0),t.selectChart.style("max-height",t.currentHeight+"px")},T.updateDimension=function(t){var e=this;t||(e.config.axis_rotated?(e.axes.x.call(e.xAxis),e.axes.subx.call(e.subXAxis)):(e.axes.y.call(e.yAxis),e.axes.y2.call(e.y2Axis))),e.updateSizes(),e.updateScales(),e.updateSvgSize(),e.transformAll(!1)},T.observeInserted=function(t){var e,i=this;"undefined"!=typeof MutationObserver?(e=new MutationObserver(function(n){n.forEach(function(n){"childList"===n.type&&n.previousSibling&&(e.disconnect(),i.intervalForObserveInserted=window.setInterval(function(){t.node().parentNode&&(window.clearInterval(i.intervalForObserveInserted),i.updateDimension(),i.brush&&i.brush.update(),i.config.oninit.call(i),i.redraw({withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withTransition:!1,withTransitionForTransform:!1,withLegend:!0}),t.transition().style("opacity",1))},10))})})).observe(t.node(),{attributes:!0,childList:!0,characterData:!0}):window.console.error("MutationObserver not defined.")},T.bindResize=function(){var t=this,e=t.config;if(t.resizeFunction=t.generateResize(),t.resizeFunction.add(function(){e.onresize.call(t)}),e.resize_auto&&t.resizeFunction.add(function(){void 0!==t.resizeTimeout&&window.clearTimeout(t.resizeTimeout),t.resizeTimeout=window.setTimeout(function(){delete t.resizeTimeout,t.updateAndRedraw({withUpdateXDomain:!1,withUpdateOrgXDomain:!1,withTransition:!1,withTransitionForTransform:!1,withLegend:!0}),t.brush&&t.brush.update()},100)}),t.resizeFunction.add(function(){e.onresized.call(t)}),t.resizeIfElementDisplayed=function(){null!=t.api&&t.api.element.offsetParent&&t.resizeFunction()},window.attachEvent)window.attachEvent("onresize",t.resizeIfElementDisplayed);else if(window.addEventListener)window.addEventListener("resize",t.resizeIfElementDisplayed,!1);else{var i=window.onresize;i?i.add&&i.remove||(i=t.generateResize()).add(window.onresize):i=t.generateResize(),i.add(t.resizeFunction),window.onresize=function(){t.api.element.offsetParent&&i()}}},T.generateResize=function(){var t=[];function e(){t.forEach(function(t){t()})}return e.add=function(e){t.push(e)},e.remove=function(e){for(var i=0;i<t.length;i++)if(t[i]===e){t.splice(i,1);break}},e},T.endall=function(t,e){var i=0;t.each(function(){++i}).on("end",function(){--i||e.apply(this,arguments)})},T.generateWait=function(){var t=[],e=function(e){var i=setInterval(function(){var n=0;t.forEach(function(t){if(t.empty())n+=1;else try{t.transition()}catch(t){n+=1}}),n===t.length&&(clearInterval(i),e&&e())},50)};return e.add=function(e){t.push(e)},e},T.parseDate=function(t){var e;return t instanceof Date?e=t:"string"==typeof t?e=this.dataTimeParse(t):"object"===(void 0===t?"undefined":n(t))?e=new Date(+t):"number"!=typeof t||isNaN(t)||(e=new Date(+t)),e&&!isNaN(+e)||window.console.error("Failed to parse x '"+t+"' to Date object"),e},T.isTabVisible=function(){var t;return void 0!==document.hidden?t="hidden":void 0!==document.mozHidden?t="mozHidden":void 0!==document.msHidden?t="msHidden":void 0!==document.webkitHidden&&(t="webkitHidden"),!document[t]},T.isValue=s,T.isFunction=o,T.isString=d,T.isUndefined=u,T.isDefined=l,T.ceil10=h,T.asHalfPixel=g,T.diffDomain=f,T.isEmpty=p,T.notEmpty=_,T.notEmpty=_,T.getOption=x,T.hasValue=y,T.sanitise=m,T.getPathBox=S,T.CLASS=i,Function.prototype.bind||(Function.prototype.bind=function(t){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var e=Array.prototype.slice.call(arguments,1),i=this,n=function(){},a=function(){return i.apply(this instanceof n?this:t,e.concat(Array.prototype.slice.call(arguments)))};return n.prototype=this.prototype,a.prototype=new n,a}),"SVGPathSeg"in window||(window.SVGPathSeg=function(t,e,i){this.pathSegType=t,this.pathSegTypeAsLetter=e,this._owningPathSegList=i},window.SVGPathSeg.prototype.classname="SVGPathSeg",window.SVGPathSeg.PATHSEG_UNKNOWN=0,window.SVGPathSeg.PATHSEG_CLOSEPATH=1,window.SVGPathSeg.PATHSEG_MOVETO_ABS=2,window.SVGPathSeg.PATHSEG_MOVETO_REL=3,window.SVGPathSeg.PATHSEG_LINETO_ABS=4,window.SVGPathSeg.PATHSEG_LINETO_REL=5,window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS=6,window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL=7,window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS=8,window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL=9,window.SVGPathSeg.PATHSEG_ARC_ABS=10,window.SVGPathSeg.PATHSEG_ARC_REL=11,window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS=12,window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL=13,window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS=14,window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL=15,window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS=16,window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL=17,window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS=18,window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL=19,window.SVGPathSeg.prototype._segmentChanged=function(){this._owningPathSegList&&this._owningPathSegList.segmentChanged(this)},window.SVGPathSegClosePath=function(t){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_CLOSEPATH,"z",t)},window.SVGPathSegClosePath.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegClosePath.prototype.toString=function(){return"[object SVGPathSegClosePath]"},window.SVGPathSegClosePath.prototype._asPathString=function(){return this.pathSegTypeAsLetter},window.SVGPathSegClosePath.prototype.clone=function(){return new window.SVGPathSegClosePath(void 0)},window.SVGPathSegMovetoAbs=function(t,e,i){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_MOVETO_ABS,"M",t),this._x=e,this._y=i},window.SVGPathSegMovetoAbs.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegMovetoAbs.prototype.toString=function(){return"[object SVGPathSegMovetoAbs]"},window.SVGPathSegMovetoAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},window.SVGPathSegMovetoAbs.prototype.clone=function(){return new window.SVGPathSegMovetoAbs(void 0,this._x,this._y)},Object.defineProperty(window.SVGPathSegMovetoAbs.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegMovetoAbs.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegMovetoRel=function(t,e,i){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_MOVETO_REL,"m",t),this._x=e,this._y=i},window.SVGPathSegMovetoRel.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegMovetoRel.prototype.toString=function(){return"[object SVGPathSegMovetoRel]"},window.SVGPathSegMovetoRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},window.SVGPathSegMovetoRel.prototype.clone=function(){return new window.SVGPathSegMovetoRel(void 0,this._x,this._y)},Object.defineProperty(window.SVGPathSegMovetoRel.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegMovetoRel.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegLinetoAbs=function(t,e,i){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_LINETO_ABS,"L",t),this._x=e,this._y=i},window.SVGPathSegLinetoAbs.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegLinetoAbs.prototype.toString=function(){return"[object SVGPathSegLinetoAbs]"},window.SVGPathSegLinetoAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},window.SVGPathSegLinetoAbs.prototype.clone=function(){return new window.SVGPathSegLinetoAbs(void 0,this._x,this._y)},Object.defineProperty(window.SVGPathSegLinetoAbs.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegLinetoAbs.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegLinetoRel=function(t,e,i){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_LINETO_REL,"l",t),this._x=e,this._y=i},window.SVGPathSegLinetoRel.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegLinetoRel.prototype.toString=function(){return"[object SVGPathSegLinetoRel]"},window.SVGPathSegLinetoRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},window.SVGPathSegLinetoRel.prototype.clone=function(){return new window.SVGPathSegLinetoRel(void 0,this._x,this._y)},Object.defineProperty(window.SVGPathSegLinetoRel.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegLinetoRel.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegCurvetoCubicAbs=function(t,e,i,n,a,r,s){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS,"C",t),this._x=e,this._y=i,this._x1=n,this._y1=a,this._x2=r,this._y2=s},window.SVGPathSegCurvetoCubicAbs.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegCurvetoCubicAbs.prototype.toString=function(){return"[object SVGPathSegCurvetoCubicAbs]"},window.SVGPathSegCurvetoCubicAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x2+" "+this._y2+" "+this._x+" "+this._y},window.SVGPathSegCurvetoCubicAbs.prototype.clone=function(){return new window.SVGPathSegCurvetoCubicAbs(void 0,this._x,this._y,this._x1,this._y1,this._x2,this._y2)},Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype,"x1",{get:function(){return this._x1},set:function(t){this._x1=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype,"y1",{get:function(){return this._y1},set:function(t){this._y1=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype,"x2",{get:function(){return this._x2},set:function(t){this._x2=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype,"y2",{get:function(){return this._y2},set:function(t){this._y2=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegCurvetoCubicRel=function(t,e,i,n,a,r,s){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL,"c",t),this._x=e,this._y=i,this._x1=n,this._y1=a,this._x2=r,this._y2=s},window.SVGPathSegCurvetoCubicRel.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegCurvetoCubicRel.prototype.toString=function(){return"[object SVGPathSegCurvetoCubicRel]"},window.SVGPathSegCurvetoCubicRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x2+" "+this._y2+" "+this._x+" "+this._y},window.SVGPathSegCurvetoCubicRel.prototype.clone=function(){return new window.SVGPathSegCurvetoCubicRel(void 0,this._x,this._y,this._x1,this._y1,this._x2,this._y2)},Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype,"x1",{get:function(){return this._x1},set:function(t){this._x1=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype,"y1",{get:function(){return this._y1},set:function(t){this._y1=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype,"x2",{get:function(){return this._x2},set:function(t){this._x2=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype,"y2",{get:function(){return this._y2},set:function(t){this._y2=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegCurvetoQuadraticAbs=function(t,e,i,n,a){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS,"Q",t),this._x=e,this._y=i,this._x1=n,this._y1=a},window.SVGPathSegCurvetoQuadraticAbs.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegCurvetoQuadraticAbs.prototype.toString=function(){return"[object SVGPathSegCurvetoQuadraticAbs]"},window.SVGPathSegCurvetoQuadraticAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x+" "+this._y},window.SVGPathSegCurvetoQuadraticAbs.prototype.clone=function(){return new window.SVGPathSegCurvetoQuadraticAbs(void 0,this._x,this._y,this._x1,this._y1)},Object.defineProperty(window.SVGPathSegCurvetoQuadraticAbs.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoQuadraticAbs.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoQuadraticAbs.prototype,"x1",{get:function(){return this._x1},set:function(t){this._x1=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoQuadraticAbs.prototype,"y1",{get:function(){return this._y1},set:function(t){this._y1=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegCurvetoQuadraticRel=function(t,e,i,n,a){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL,"q",t),this._x=e,this._y=i,this._x1=n,this._y1=a},window.SVGPathSegCurvetoQuadraticRel.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegCurvetoQuadraticRel.prototype.toString=function(){return"[object SVGPathSegCurvetoQuadraticRel]"},window.SVGPathSegCurvetoQuadraticRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x+" "+this._y},window.SVGPathSegCurvetoQuadraticRel.prototype.clone=function(){return new window.SVGPathSegCurvetoQuadraticRel(void 0,this._x,this._y,this._x1,this._y1)},Object.defineProperty(window.SVGPathSegCurvetoQuadraticRel.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoQuadraticRel.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoQuadraticRel.prototype,"x1",{get:function(){return this._x1},set:function(t){this._x1=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoQuadraticRel.prototype,"y1",{get:function(){return this._y1},set:function(t){this._y1=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegArcAbs=function(t,e,i,n,a,r,s,o){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_ARC_ABS,"A",t),this._x=e,this._y=i,this._r1=n,this._r2=a,this._angle=r,this._largeArcFlag=s,this._sweepFlag=o},window.SVGPathSegArcAbs.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegArcAbs.prototype.toString=function(){return"[object SVGPathSegArcAbs]"},window.SVGPathSegArcAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._r1+" "+this._r2+" "+this._angle+" "+(this._largeArcFlag?"1":"0")+" "+(this._sweepFlag?"1":"0")+" "+this._x+" "+this._y},window.SVGPathSegArcAbs.prototype.clone=function(){return new window.SVGPathSegArcAbs(void 0,this._x,this._y,this._r1,this._r2,this._angle,this._largeArcFlag,this._sweepFlag)},Object.defineProperty(window.SVGPathSegArcAbs.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcAbs.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcAbs.prototype,"r1",{get:function(){return this._r1},set:function(t){this._r1=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcAbs.prototype,"r2",{get:function(){return this._r2},set:function(t){this._r2=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcAbs.prototype,"angle",{get:function(){return this._angle},set:function(t){this._angle=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcAbs.prototype,"largeArcFlag",{get:function(){return this._largeArcFlag},set:function(t){this._largeArcFlag=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcAbs.prototype,"sweepFlag",{get:function(){return this._sweepFlag},set:function(t){this._sweepFlag=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegArcRel=function(t,e,i,n,a,r,s,o){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_ARC_REL,"a",t),this._x=e,this._y=i,this._r1=n,this._r2=a,this._angle=r,this._largeArcFlag=s,this._sweepFlag=o},window.SVGPathSegArcRel.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegArcRel.prototype.toString=function(){return"[object SVGPathSegArcRel]"},window.SVGPathSegArcRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._r1+" "+this._r2+" "+this._angle+" "+(this._largeArcFlag?"1":"0")+" "+(this._sweepFlag?"1":"0")+" "+this._x+" "+this._y},window.SVGPathSegArcRel.prototype.clone=function(){return new window.SVGPathSegArcRel(void 0,this._x,this._y,this._r1,this._r2,this._angle,this._largeArcFlag,this._sweepFlag)},Object.defineProperty(window.SVGPathSegArcRel.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcRel.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcRel.prototype,"r1",{get:function(){return this._r1},set:function(t){this._r1=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcRel.prototype,"r2",{get:function(){return this._r2},set:function(t){this._r2=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcRel.prototype,"angle",{get:function(){return this._angle},set:function(t){this._angle=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcRel.prototype,"largeArcFlag",{get:function(){return this._largeArcFlag},set:function(t){this._largeArcFlag=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcRel.prototype,"sweepFlag",{get:function(){return this._sweepFlag},set:function(t){this._sweepFlag=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegLinetoHorizontalAbs=function(t,e){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS,"H",t),this._x=e},window.SVGPathSegLinetoHorizontalAbs.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegLinetoHorizontalAbs.prototype.toString=function(){return"[object SVGPathSegLinetoHorizontalAbs]"},window.SVGPathSegLinetoHorizontalAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x},window.SVGPathSegLinetoHorizontalAbs.prototype.clone=function(){return new window.SVGPathSegLinetoHorizontalAbs(void 0,this._x)},Object.defineProperty(window.SVGPathSegLinetoHorizontalAbs.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegLinetoHorizontalRel=function(t,e){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL,"h",t),this._x=e},window.SVGPathSegLinetoHorizontalRel.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegLinetoHorizontalRel.prototype.toString=function(){return"[object SVGPathSegLinetoHorizontalRel]"},window.SVGPathSegLinetoHorizontalRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x},window.SVGPathSegLinetoHorizontalRel.prototype.clone=function(){return new window.SVGPathSegLinetoHorizontalRel(void 0,this._x)},Object.defineProperty(window.SVGPathSegLinetoHorizontalRel.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegLinetoVerticalAbs=function(t,e){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS,"V",t),this._y=e},window.SVGPathSegLinetoVerticalAbs.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegLinetoVerticalAbs.prototype.toString=function(){return"[object SVGPathSegLinetoVerticalAbs]"},window.SVGPathSegLinetoVerticalAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._y},window.SVGPathSegLinetoVerticalAbs.prototype.clone=function(){return new window.SVGPathSegLinetoVerticalAbs(void 0,this._y)},Object.defineProperty(window.SVGPathSegLinetoVerticalAbs.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegLinetoVerticalRel=function(t,e){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL,"v",t),this._y=e},window.SVGPathSegLinetoVerticalRel.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegLinetoVerticalRel.prototype.toString=function(){return"[object SVGPathSegLinetoVerticalRel]"},window.SVGPathSegLinetoVerticalRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._y},window.SVGPathSegLinetoVerticalRel.prototype.clone=function(){return new window.SVGPathSegLinetoVerticalRel(void 0,this._y)},Object.defineProperty(window.SVGPathSegLinetoVerticalRel.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegCurvetoCubicSmoothAbs=function(t,e,i,n,a){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS,"S",t),this._x=e,this._y=i,this._x2=n,this._y2=a},window.SVGPathSegCurvetoCubicSmoothAbs.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegCurvetoCubicSmoothAbs.prototype.toString=function(){return"[object SVGPathSegCurvetoCubicSmoothAbs]"},window.SVGPathSegCurvetoCubicSmoothAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x2+" "+this._y2+" "+this._x+" "+this._y},window.SVGPathSegCurvetoCubicSmoothAbs.prototype.clone=function(){return new window.SVGPathSegCurvetoCubicSmoothAbs(void 0,this._x,this._y,this._x2,this._y2)},Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothAbs.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothAbs.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothAbs.prototype,"x2",{get:function(){return this._x2},set:function(t){this._x2=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothAbs.prototype,"y2",{get:function(){return this._y2},set:function(t){this._y2=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegCurvetoCubicSmoothRel=function(t,e,i,n,a){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL,"s",t),this._x=e,this._y=i,this._x2=n,this._y2=a},window.SVGPathSegCurvetoCubicSmoothRel.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegCurvetoCubicSmoothRel.prototype.toString=function(){return"[object SVGPathSegCurvetoCubicSmoothRel]"},window.SVGPathSegCurvetoCubicSmoothRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x2+" "+this._y2+" "+this._x+" "+this._y},window.SVGPathSegCurvetoCubicSmoothRel.prototype.clone=function(){return new window.SVGPathSegCurvetoCubicSmoothRel(void 0,this._x,this._y,this._x2,this._y2)},Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothRel.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothRel.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothRel.prototype,"x2",{get:function(){return this._x2},set:function(t){this._x2=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothRel.prototype,"y2",{get:function(){return this._y2},set:function(t){this._y2=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegCurvetoQuadraticSmoothAbs=function(t,e,i){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS,"T",t),this._x=e,this._y=i},window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype.toString=function(){return"[object SVGPathSegCurvetoQuadraticSmoothAbs]"},window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype.clone=function(){return new window.SVGPathSegCurvetoQuadraticSmoothAbs(void 0,this._x,this._y)},Object.defineProperty(window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegCurvetoQuadraticSmoothRel=function(t,e,i){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL,"t",t),this._x=e,this._y=i},window.SVGPathSegCurvetoQuadraticSmoothRel.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegCurvetoQuadraticSmoothRel.prototype.toString=function(){return"[object SVGPathSegCurvetoQuadraticSmoothRel]"},window.SVGPathSegCurvetoQuadraticSmoothRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},window.SVGPathSegCurvetoQuadraticSmoothRel.prototype.clone=function(){return new window.SVGPathSegCurvetoQuadraticSmoothRel(void 0,this._x,this._y)},Object.defineProperty(window.SVGPathSegCurvetoQuadraticSmoothRel.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoQuadraticSmoothRel.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),window.SVGPathElement.prototype.createSVGPathSegClosePath=function(){return new window.SVGPathSegClosePath(void 0)},window.SVGPathElement.prototype.createSVGPathSegMovetoAbs=function(t,e){return new window.SVGPathSegMovetoAbs(void 0,t,e)},window.SVGPathElement.prototype.createSVGPathSegMovetoRel=function(t,e){return new window.SVGPathSegMovetoRel(void 0,t,e)},window.SVGPathElement.prototype.createSVGPathSegLinetoAbs=function(t,e){return new window.SVGPathSegLinetoAbs(void 0,t,e)},window.SVGPathElement.prototype.createSVGPathSegLinetoRel=function(t,e){return new window.SVGPathSegLinetoRel(void 0,t,e)},window.SVGPathElement.prototype.createSVGPathSegCurvetoCubicAbs=function(t,e,i,n,a,r){return new window.SVGPathSegCurvetoCubicAbs(void 0,t,e,i,n,a,r)},window.SVGPathElement.prototype.createSVGPathSegCurvetoCubicRel=function(t,e,i,n,a,r){return new window.SVGPathSegCurvetoCubicRel(void 0,t,e,i,n,a,r)},window.SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticAbs=function(t,e,i,n){return new window.SVGPathSegCurvetoQuadraticAbs(void 0,t,e,i,n)},window.SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticRel=function(t,e,i,n){return new window.SVGPathSegCurvetoQuadraticRel(void 0,t,e,i,n)},window.SVGPathElement.prototype.createSVGPathSegArcAbs=function(t,e,i,n,a,r,s){return new window.SVGPathSegArcAbs(void 0,t,e,i,n,a,r,s)},window.SVGPathElement.prototype.createSVGPathSegArcRel=function(t,e,i,n,a,r,s){return new window.SVGPathSegArcRel(void 0,t,e,i,n,a,r,s)},window.SVGPathElement.prototype.createSVGPathSegLinetoHorizontalAbs=function(t){return new window.SVGPathSegLinetoHorizontalAbs(void 0,t)},window.SVGPathElement.prototype.createSVGPathSegLinetoHorizontalRel=function(t){return new window.SVGPathSegLinetoHorizontalRel(void 0,t)},window.SVGPathElement.prototype.createSVGPathSegLinetoVerticalAbs=function(t){return new window.SVGPathSegLinetoVerticalAbs(void 0,t)},window.SVGPathElement.prototype.createSVGPathSegLinetoVerticalRel=function(t){return new window.SVGPathSegLinetoVerticalRel(void 0,t)},window.SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothAbs=function(t,e,i,n){return new window.SVGPathSegCurvetoCubicSmoothAbs(void 0,t,e,i,n)},window.SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothRel=function(t,e,i,n){return new window.SVGPathSegCurvetoCubicSmoothRel(void 0,t,e,i,n)},window.SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothAbs=function(t,e){return new window.SVGPathSegCurvetoQuadraticSmoothAbs(void 0,t,e)},window.SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothRel=function(t,e){return new window.SVGPathSegCurvetoQuadraticSmoothRel(void 0,t,e)},"getPathSegAtLength"in window.SVGPathElement.prototype||(window.SVGPathElement.prototype.getPathSegAtLength=function(t){if(void 0===t||!isFinite(t))throw"Invalid arguments.";var e=document.createElementNS("http://www.w3.org/2000/svg","path");e.setAttribute("d",this.getAttribute("d"));var i=e.pathSegList.numberOfItems-1;if(i<=0)return 0;do{if(e.pathSegList.removeItem(i),t>e.getTotalLength())break;i--}while(i>0);return i})),"SVGPathSegList"in window||(window.SVGPathSegList=function(t){this._pathElement=t,this._list=this._parsePath(this._pathElement.getAttribute("d")),this._mutationObserverConfig={attributes:!0,attributeFilter:["d"]},this._pathElementMutationObserver=new MutationObserver(this._updateListFromPathMutations.bind(this)),this._pathElementMutationObserver.observe(this._pathElement,this._mutationObserverConfig)},window.SVGPathSegList.prototype.classname="SVGPathSegList",Object.defineProperty(window.SVGPathSegList.prototype,"numberOfItems",{get:function(){return this._checkPathSynchronizedToList(),this._list.length},enumerable:!0}),Object.defineProperty(window.SVGPathElement.prototype,"pathSegList",{get:function(){return this._pathSegList||(this._pathSegList=new window.SVGPathSegList(this)),this._pathSegList},enumerable:!0}),Object.defineProperty(window.SVGPathElement.prototype,"normalizedPathSegList",{get:function(){return this.pathSegList},enumerable:!0}),Object.defineProperty(window.SVGPathElement.prototype,"animatedPathSegList",{get:function(){return this.pathSegList},enumerable:!0}),Object.defineProperty(window.SVGPathElement.prototype,"animatedNormalizedPathSegList",{get:function(){return this.pathSegList},enumerable:!0}),window.SVGPathSegList.prototype._checkPathSynchronizedToList=function(){this._updateListFromPathMutations(this._pathElementMutationObserver.takeRecords())},window.SVGPathSegList.prototype._updateListFromPathMutations=function(t){if(this._pathElement){var e=!1;t.forEach(function(t){"d"==t.attributeName&&(e=!0)}),e&&(this._list=this._parsePath(this._pathElement.getAttribute("d")))}},window.SVGPathSegList.prototype._writeListToPath=function(){this._pathElementMutationObserver.disconnect(),this._pathElement.setAttribute("d",window.SVGPathSegList._pathSegArrayAsString(this._list)),this._pathElementMutationObserver.observe(this._pathElement,this._mutationObserverConfig)},window.SVGPathSegList.prototype.segmentChanged=function(t){this._writeListToPath()},window.SVGPathSegList.prototype.clear=function(){this._checkPathSynchronizedToList(),this._list.forEach(function(t){t._owningPathSegList=null}),this._list=[],this._writeListToPath()},window.SVGPathSegList.prototype.initialize=function(t){return this._checkPathSynchronizedToList(),this._list=[t],t._owningPathSegList=this,this._writeListToPath(),t},window.SVGPathSegList.prototype._checkValidIndex=function(t){if(isNaN(t)||t<0||t>=this.numberOfItems)throw"INDEX_SIZE_ERR"},window.SVGPathSegList.prototype.getItem=function(t){return this._checkPathSynchronizedToList(),this._checkValidIndex(t),this._list[t]},window.SVGPathSegList.prototype.insertItemBefore=function(t,e){return this._checkPathSynchronizedToList(),e>this.numberOfItems&&(e=this.numberOfItems),t._owningPathSegList&&(t=t.clone()),this._list.splice(e,0,t),t._owningPathSegList=this,this._writeListToPath(),t},window.SVGPathSegList.prototype.replaceItem=function(t,e){return this._checkPathSynchronizedToList(),t._owningPathSegList&&(t=t.clone()),this._checkValidIndex(e),this._list[e]=t,t._owningPathSegList=this,this._writeListToPath(),t},window.SVGPathSegList.prototype.removeItem=function(t){this._checkPathSynchronizedToList(),this._checkValidIndex(t);var e=this._list[t];return this._list.splice(t,1),this._writeListToPath(),e},window.SVGPathSegList.prototype.appendItem=function(t){return this._checkPathSynchronizedToList(),t._owningPathSegList&&(t=t.clone()),this._list.push(t),t._owningPathSegList=this,this._writeListToPath(),t},window.SVGPathSegList._pathSegArrayAsString=function(t){var e="",i=!0;return t.forEach(function(t){i?(i=!1,e+=t._asPathString()):e+=" "+t._asPathString()}),e},window.SVGPathSegList.prototype._parsePath=function(t){if(!t||0==t.length)return[];var e=this,i=function(){this.pathSegList=[]};i.prototype.appendSegment=function(t){this.pathSegList.push(t)};var n=function(t){this._string=t,this._currentIndex=0,this._endIndex=this._string.length,this._previousCommand=window.SVGPathSeg.PATHSEG_UNKNOWN,this._skipOptionalSpaces()};n.prototype._isCurrentSpace=function(){var t=this._string[this._currentIndex];return t<=" "&&(" "==t||"\n"==t||"\t"==t||"\r"==t||"\f"==t)},n.prototype._skipOptionalSpaces=function(){for(;this._currentIndex<this._endIndex&&this._isCurrentSpace();)this._currentIndex++;return this._currentIndex<this._endIndex},n.prototype._skipOptionalSpacesOrDelimiter=function(){return!(this._currentIndex<this._endIndex&&!this._isCurrentSpace()&&","!=this._string.charAt(this._currentIndex))&&(this._skipOptionalSpaces()&&this._currentIndex<this._endIndex&&","==this._string.charAt(this._currentIndex)&&(this._currentIndex++,this._skipOptionalSpaces()),this._currentIndex<this._endIndex)},n.prototype.hasMoreData=function(){return this._currentIndex<this._endIndex},n.prototype.peekSegmentType=function(){var t=this._string[this._currentIndex];return this._pathSegTypeFromChar(t)},n.prototype._pathSegTypeFromChar=function(t){switch(t){case"Z":case"z":return window.SVGPathSeg.PATHSEG_CLOSEPATH;case"M":return window.SVGPathSeg.PATHSEG_MOVETO_ABS;case"m":return window.SVGPathSeg.PATHSEG_MOVETO_REL;case"L":return window.SVGPathSeg.PATHSEG_LINETO_ABS;case"l":return window.SVGPathSeg.PATHSEG_LINETO_REL;case"C":return window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS;case"c":return window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL;case"Q":return window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS;case"q":return window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL;case"A":return window.SVGPathSeg.PATHSEG_ARC_ABS;case"a":return window.SVGPathSeg.PATHSEG_ARC_REL;case"H":return window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS;case"h":return window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL;case"V":return window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS;case"v":return window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL;case"S":return window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS;case"s":return window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL;case"T":return window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS;case"t":return window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL;default:return window.SVGPathSeg.PATHSEG_UNKNOWN}},n.prototype._nextCommandHelper=function(t,e){return("+"==t||"-"==t||"."==t||t>="0"&&t<="9")&&e!=window.SVGPathSeg.PATHSEG_CLOSEPATH?e==window.SVGPathSeg.PATHSEG_MOVETO_ABS?window.SVGPathSeg.PATHSEG_LINETO_ABS:e==window.SVGPathSeg.PATHSEG_MOVETO_REL?window.SVGPathSeg.PATHSEG_LINETO_REL:e:window.SVGPathSeg.PATHSEG_UNKNOWN},n.prototype.initialCommandIsMoveTo=function(){if(!this.hasMoreData())return!0;var t=this.peekSegmentType();return t==window.SVGPathSeg.PATHSEG_MOVETO_ABS||t==window.SVGPathSeg.PATHSEG_MOVETO_REL},n.prototype._parseNumber=function(){var t=0,e=0,i=1,n=0,a=1,r=1,s=this._currentIndex;if(this._skipOptionalSpaces(),this._currentIndex<this._endIndex&&"+"==this._string.charAt(this._currentIndex)?this._currentIndex++:this._currentIndex<this._endIndex&&"-"==this._string.charAt(this._currentIndex)&&(this._currentIndex++,a=-1),!(this._currentIndex==this._endIndex||(this._string.charAt(this._currentIndex)<"0"||this._string.charAt(this._currentIndex)>"9")&&"."!=this._string.charAt(this._currentIndex))){for(var o=this._currentIndex;this._currentIndex<this._endIndex&&this._string.charAt(this._currentIndex)>="0"&&this._string.charAt(this._currentIndex)<="9";)this._currentIndex++;if(this._currentIndex!=o)for(var c=this._currentIndex-1,d=1;c>=o;)e+=d*(this._string.charAt(c--)-"0"),d*=10;if(this._currentIndex<this._endIndex&&"."==this._string.charAt(this._currentIndex)){if(this._currentIndex++,this._currentIndex>=this._endIndex||this._string.charAt(this._currentIndex)<"0"||this._string.charAt(this._currentIndex)>"9")return;for(;this._currentIndex<this._endIndex&&this._string.charAt(this._currentIndex)>="0"&&this._string.charAt(this._currentIndex)<="9";)i*=10,n+=(this._string.charAt(this._currentIndex)-"0")/i,this._currentIndex+=1}if(this._currentIndex!=s&&this._currentIndex+1<this._endIndex&&("e"==this._string.charAt(this._currentIndex)||"E"==this._string.charAt(this._currentIndex))&&"x"!=this._string.charAt(this._currentIndex+1)&&"m"!=this._string.charAt(this._currentIndex+1)){if(this._currentIndex++,"+"==this._string.charAt(this._currentIndex)?this._currentIndex++:"-"==this._string.charAt(this._currentIndex)&&(this._currentIndex++,r=-1),this._currentIndex>=this._endIndex||this._string.charAt(this._currentIndex)<"0"||this._string.charAt(this._currentIndex)>"9")return;for(;this._currentIndex<this._endIndex&&this._string.charAt(this._currentIndex)>="0"&&this._string.charAt(this._currentIndex)<="9";)t*=10,t+=this._string.charAt(this._currentIndex)-"0",this._currentIndex++}var u=e+n;if(u*=a,t&&(u*=Math.pow(10,r*t)),s!=this._currentIndex)return this._skipOptionalSpacesOrDelimiter(),u}},n.prototype._parseArcFlag=function(){if(!(this._currentIndex>=this._endIndex)){var t=!1,e=this._string.charAt(this._currentIndex++);if("0"==e)t=!1;else{if("1"!=e)return;t=!0}return this._skipOptionalSpacesOrDelimiter(),t}},n.prototype.parseSegment=function(){var t=this._string[this._currentIndex],i=this._pathSegTypeFromChar(t);if(i==window.SVGPathSeg.PATHSEG_UNKNOWN){if(this._previousCommand==window.SVGPathSeg.PATHSEG_UNKNOWN)return null;if((i=this._nextCommandHelper(t,this._previousCommand))==window.SVGPathSeg.PATHSEG_UNKNOWN)return null}else this._currentIndex++;switch(this._previousCommand=i,i){case window.SVGPathSeg.PATHSEG_MOVETO_REL:return new window.SVGPathSegMovetoRel(e,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_MOVETO_ABS:return new window.SVGPathSegMovetoAbs(e,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_REL:return new window.SVGPathSegLinetoRel(e,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_ABS:return new window.SVGPathSegLinetoAbs(e,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL:return new window.SVGPathSegLinetoHorizontalRel(e,this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS:return new window.SVGPathSegLinetoHorizontalAbs(e,this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL:return new window.SVGPathSegLinetoVerticalRel(e,this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS:return new window.SVGPathSegLinetoVerticalAbs(e,this._parseNumber());case window.SVGPathSeg.PATHSEG_CLOSEPATH:return this._skipOptionalSpaces(),new window.SVGPathSegClosePath(e);case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL:var n={x1:this._parseNumber(),y1:this._parseNumber(),x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new window.SVGPathSegCurvetoCubicRel(e,n.x,n.y,n.x1,n.y1,n.x2,n.y2);case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS:return n={x1:this._parseNumber(),y1:this._parseNumber(),x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegCurvetoCubicAbs(e,n.x,n.y,n.x1,n.y1,n.x2,n.y2);case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL:return n={x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegCurvetoCubicSmoothRel(e,n.x,n.y,n.x2,n.y2);case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS:return n={x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegCurvetoCubicSmoothAbs(e,n.x,n.y,n.x2,n.y2);case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL:return n={x1:this._parseNumber(),y1:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegCurvetoQuadraticRel(e,n.x,n.y,n.x1,n.y1);case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS:return n={x1:this._parseNumber(),y1:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegCurvetoQuadraticAbs(e,n.x,n.y,n.x1,n.y1);case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL:return new window.SVGPathSegCurvetoQuadraticSmoothRel(e,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS:return new window.SVGPathSegCurvetoQuadraticSmoothAbs(e,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_ARC_REL:return n={x1:this._parseNumber(),y1:this._parseNumber(),arcAngle:this._parseNumber(),arcLarge:this._parseArcFlag(),arcSweep:this._parseArcFlag(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegArcRel(e,n.x,n.y,n.x1,n.y1,n.arcAngle,n.arcLarge,n.arcSweep);case window.SVGPathSeg.PATHSEG_ARC_ABS:return n={x1:this._parseNumber(),y1:this._parseNumber(),arcAngle:this._parseNumber(),arcLarge:this._parseArcFlag(),arcSweep:this._parseArcFlag(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegArcAbs(e,n.x,n.y,n.x1,n.y1,n.arcAngle,n.arcLarge,n.arcSweep);default:throw"Unknown path seg type."}};var a=new i,r=new n(t);if(!r.initialCommandIsMoveTo())return[];for(;r.hasMoreData();){var s=r.parseSegment();if(!s)return[];a.appendSegment(s)}return a.pathSegList}),String.prototype.padEnd||(String.prototype.padEnd=function(t,e){return t>>=0,e=String(void 0!==e?e:" "),this.length>t?String(this):((t-=this.length)>e.length&&(e+=e.repeat(t/e.length)),String(this)+e.slice(0,t))}),b.axis=function(){},b.axis.labels=function(t){var e=this.internal;arguments.length&&(Object.keys(t).forEach(function(i){e.axis.setLabelText(i,t[i])}),e.axis.updateLabels())},b.axis.max=function(t){var e=this.internal,i=e.config;if(!arguments.length)return{x:i.axis_x_max,y:i.axis_y_max,y2:i.axis_y2_max};"object"===(void 0===t?"undefined":n(t))?(s(t.x)&&(i.axis_x_max=t.x),s(t.y)&&(i.axis_y_max=t.y),s(t.y2)&&(i.axis_y2_max=t.y2)):i.axis_y_max=i.axis_y2_max=t,e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})},b.axis.min=function(t){var e=this.internal,i=e.config;if(!arguments.length)return{x:i.axis_x_min,y:i.axis_y_min,y2:i.axis_y2_min};"object"===(void 0===t?"undefined":n(t))?(s(t.x)&&(i.axis_x_min=t.x),s(t.y)&&(i.axis_y_min=t.y),s(t.y2)&&(i.axis_y2_min=t.y2)):i.axis_y_min=i.axis_y2_min=t,e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})},b.axis.range=function(t){if(!arguments.length)return{max:this.axis.max(),min:this.axis.min()};l(t.max)&&this.axis.max(t.max),l(t.min)&&this.axis.min(t.min)},b.category=function(t,e){var i=this.internal,n=i.config;return arguments.length>1&&(n.axis_x_categories[t]=e,i.redraw()),n.axis_x_categories[t]},b.categories=function(t){var e=this.internal,i=e.config;return arguments.length?(i.axis_x_categories=t,e.redraw(),i.axis_x_categories):i.axis_x_categories},b.resize=function(t){var e=this.internal.config;e.size_width=t?t.width:null,e.size_height=t?t.height:null,this.flush()},b.flush=function(){this.internal.updateAndRedraw({withLegend:!0,withTransition:!1,withTransitionForTransform:!1})},b.destroy=function(){var t=this.internal;if(window.clearInterval(t.intervalForObserveInserted),void 0!==t.resizeTimeout&&window.clearTimeout(t.resizeTimeout),window.detachEvent)window.detachEvent("onresize",t.resizeIfElementDisplayed);else if(window.removeEventListener)window.removeEventListener("resize",t.resizeIfElementDisplayed);else{var e=window.onresize;e&&e.add&&e.remove&&e.remove(t.resizeFunction)}return t.resizeFunction.remove(),t.selectChart.classed("c3",!1).html(""),Object.keys(t).forEach(function(e){t[e]=null}),null},b.color=function(t){return this.internal.color(t)},b.data=function(t){var e=this.internal.data.targets;return void 0===t?e:e.filter(function(e){return[].concat(t).indexOf(e.id)>=0})},b.data.shown=function(t){return this.internal.filterTargetsToShow(this.data(t))},b.data.values=function(t){var e,i=null;return t&&(i=(e=this.data(t))[0]?e[0].values.map(function(t){return t.value}):null),i},b.data.names=function(t){return this.internal.clearLegendItemTextBoxCache(),this.internal.updateDataAttributes("names",t)},b.data.colors=function(t){return this.internal.updateDataAttributes("colors",t)},b.data.axes=function(t){return this.internal.updateDataAttributes("axes",t)},b.flow=function(t){var e,i,n,a,r,o,c,d=this.internal,u=[],h=d.getMaxDataCount(),g=0,f=0;if(t.json)i=d.convertJsonToData(t.json,t.keys);else if(t.rows)i=d.convertRowsToData(t.rows);else{if(!t.columns)return;i=d.convertColumnsToData(t.columns)}e=d.convertDataToTargets(i,!0),d.data.targets.forEach(function(t){var i,n,a=!1;for(i=0;i<e.length;i++)if(t.id===e[i].id){for(a=!0,t.values[t.values.length-1]&&(f=t.values[t.values.length-1].index+1),g=e[i].values.length,n=0;n<g;n++)e[i].values[n].index=f+n,d.isTimeSeries()||(e[i].values[n].x=f+n);t.values=t.values.concat(e[i].values),e.splice(i,1);break}a||u.push(t.id)}),d.data.targets.forEach(function(t){var e,i;for(e=0;e<u.length;e++)if(t.id===u[e])for(f=t.values[t.values.length-1].index+1,i=0;i<g;i++)t.values.push({id:t.id,index:f+i,x:d.isTimeSeries()?d.getOtherTargetX(f+i):f+i,value:null})}),d.data.targets.length&&e.forEach(function(t){var e,i=[];for(e=d.data.targets[0].values[0].index;e<f;e++)i.push({id:t.id,index:e,x:d.isTimeSeries()?d.getOtherTargetX(e):e,value:null});t.values.forEach(function(t){t.index+=f,d.isTimeSeries()||(t.x+=f)}),t.values=i.concat(t.values)}),d.data.targets=d.data.targets.concat(e),d.getMaxDataCount(),r=(a=d.data.targets[0]).values[0],l(t.to)?(g=0,c=d.isTimeSeries()?d.parseDate(t.to):t.to,a.values.forEach(function(t){t.x<c&&g++})):l(t.length)&&(g=t.length),h?1===h&&d.isTimeSeries()&&(o=(a.values[a.values.length-1].x-r.x)/2,n=[new Date(+r.x-o),new Date(+r.x+o)],d.updateXDomain(null,!0,!0,!1,n)):(o=d.isTimeSeries()?a.values.length>1?a.values[a.values.length-1].x-r.x:r.x-d.getXDomain(d.data.targets)[0]:1,n=[r.x-o,r.x],d.updateXDomain(null,!0,!0,!1,n)),d.updateTargets(d.data.targets),d.redraw({flow:{index:r.index,length:g,duration:s(t.duration)?t.duration:d.config.transition_duration,done:t.done,orgDataCount:h},withLegend:!0,withTransition:h>1,withTrimXDomain:!1,withUpdateXAxis:!0})},T.generateFlow=function(t){var e=this,n=e.config,a=e.d3;return function(){var r,s,o,c,d,u,l,h,g,p,_,x=t.targets,y=t.flow,m=t.drawBar,S=t.drawLine,w=t.drawArea,v=t.cx,b=t.cy,T=t.xv,A=t.xForText,P=t.yForText,C=t.duration,L=y.index,V=y.length,G=e.getValueOnIndex(e.data.targets[0].values,L),E=e.getValueOnIndex(e.data.targets[0].values,L+V),O=e.x.domain(),I=y.duration||C,R=y.done||function(){},k=e.generateWait();e.flowing=!0,e.data.targets.forEach(function(t){t.values.splice(0,V)}),o=e.updateXDomain(x,!0,!0),e.updateXGrid&&e.updateXGrid(!0),c=e.xgrid||a.selectAll([]),d=e.xgridLines||a.selectAll([]),u=e.mainRegion||a.selectAll([]),l=e.mainText||a.selectAll([]),h=e.mainBar||a.selectAll([]),g=e.mainLine||a.selectAll([]),p=e.mainArea||a.selectAll([]),_=e.mainCircle||a.selectAll([]),y.orgDataCount?r=1===y.orgDataCount||(G&&G.x)===(E&&E.x)?e.x(O[0])-e.x(o[0]):e.isTimeSeries()?e.x(O[0])-e.x(o[0]):e.x(G.x)-e.x(E.x):1!==e.data.targets[0].values.length?r=e.x(O[0])-e.x(o[0]):e.isTimeSeries()?(G=e.getValueOnIndex(e.data.targets[0].values,0),E=e.getValueOnIndex(e.data.targets[0].values,e.data.targets[0].values.length-1),r=e.x(G.x)-e.x(E.x)):r=f(o)/2,s="translate("+r+",0) scale("+f(O)/f(o)+",1)",e.hideXGridFocus();var D=a.transition().ease(a.easeLinear).duration(I);k.add(e.xAxis(e.axes.x,D)),k.add(h.transition(D).attr("transform",s)),k.add(g.transition(D).attr("transform",s)),k.add(p.transition(D).attr("transform",s)),k.add(_.transition(D).attr("transform",s)),k.add(l.transition(D).attr("transform",s)),k.add(u.filter(e.isRegionOnX).transition(D).attr("transform",s)),k.add(c.transition(D).attr("transform",s)),k.add(d.transition(D).attr("transform",s)),k(function(){var t,a=[],r=[];if(V){for(t=0;t<V;t++)a.push("."+i.shape+"-"+(L+t)),r.push("."+i.text+"-"+(L+t));e.svg.selectAll("."+i.shapes).selectAll(a).remove(),e.svg.selectAll("."+i.texts).selectAll(r).remove(),e.svg.select("."+i.xgrid).remove()}c.attr("transform",null).attr("x1",e.xgridAttr.x1).attr("x2",e.xgridAttr.x2).attr("y1",e.xgridAttr.y1).attr("y2",e.xgridAttr.y2).style("opacity",e.xgridAttr.opacity),d.attr("transform",null),d.select("line").attr("x1",n.axis_rotated?0:T).attr("x2",n.axis_rotated?e.width:T),d.select("text").attr("x",n.axis_rotated?e.width:0).attr("y",T),h.attr("transform",null).attr("d",m),g.attr("transform",null).attr("d",S),p.attr("transform",null).attr("d",w),_.attr("transform",null).attr("cx",v).attr("cy",b),l.attr("transform",null).attr("x",A).attr("y",P).style("fill-opacity",e.opacityForText.bind(e)),u.attr("transform",null),u.filter(e.isRegionOnX).attr("x",e.regionX.bind(e)).attr("width",e.regionWidth.bind(e)),R(),e.flowing=!1})}},b.focus=function(t){var e,n=this.internal;t=n.mapToTargetIds(t),e=n.svg.selectAll(n.selectorTargets(t.filter(n.isTargetToShow,n))),this.revert(),this.defocus(),e.classed(i.focused,!0).classed(i.defocused,!1),n.hasArcType()&&n.expandArc(t),n.toggleFocusLegend(t,!0),n.focusedTargetIds=t,n.defocusedTargetIds=n.defocusedTargetIds.filter(function(e){return t.indexOf(e)<0})},b.defocus=function(t){var e=this.internal;t=e.mapToTargetIds(t),e.svg.selectAll(e.selectorTargets(t.filter(e.isTargetToShow,e))).classed(i.focused,!1).classed(i.defocused,!0),e.hasArcType()&&e.unexpandArc(t),e.toggleFocusLegend(t,!1),e.focusedTargetIds=e.focusedTargetIds.filter(function(e){return t.indexOf(e)<0}),e.defocusedTargetIds=t},b.revert=function(t){var e=this.internal;t=e.mapToTargetIds(t),e.svg.selectAll(e.selectorTargets(t)).classed(i.focused,!1).classed(i.defocused,!1),e.hasArcType()&&e.unexpandArc(t),e.config.legend_show&&(e.showLegend(t.filter(e.isLegendToShow.bind(e))),e.legend.selectAll(e.selectorLegends(t)).filter(function(){return e.d3.select(this).classed(i.legendItemFocused)}).classed(i.legendItemFocused,!1)),e.focusedTargetIds=[],e.defocusedTargetIds=[]},b.xgrids=function(t){var e=this.internal,i=e.config;return t?(i.grid_x_lines=t,e.redrawWithoutRescale(),i.grid_x_lines):i.grid_x_lines},b.xgrids.add=function(t){var e=this.internal;return this.xgrids(e.config.grid_x_lines.concat(t||[]))},b.xgrids.remove=function(t){this.internal.removeGridLines(t,!0)},b.ygrids=function(t){var e=this.internal,i=e.config;return t?(i.grid_y_lines=t,e.redrawWithoutRescale(),i.grid_y_lines):i.grid_y_lines},b.ygrids.add=function(t){var e=this.internal;return this.ygrids(e.config.grid_y_lines.concat(t||[]))},b.ygrids.remove=function(t){this.internal.removeGridLines(t,!1)},b.groups=function(t){var e=this.internal,i=e.config;return u(t)?i.data_groups:(i.data_groups=t,e.redraw(),i.data_groups)},b.legend=function(){},b.legend.show=function(t){var e=this.internal;e.showLegend(e.mapToTargetIds(t)),e.updateAndRedraw({withLegend:!0})},b.legend.hide=function(t){var e=this.internal;e.hideLegend(e.mapToTargetIds(t)),e.updateAndRedraw({withLegend:!0})},b.load=function(t){var e=this.internal,i=e.config;t.xs&&e.addXs(t.xs),"names"in t&&b.data.names.bind(this)(t.names),"classes"in t&&Object.keys(t.classes).forEach(function(e){i.data_classes[e]=t.classes[e]}),"categories"in t&&e.isCategorized()&&(i.axis_x_categories=t.categories),"axes"in t&&Object.keys(t.axes).forEach(function(e){i.data_axes[e]=t.axes[e]}),"colors"in t&&Object.keys(t.colors).forEach(function(e){i.data_colors[e]=t.colors[e]}),"cacheIds"in t&&e.hasCaches(t.cacheIds)?e.load(e.getCaches(t.cacheIds),t.done):"unload"in t?e.unload(e.mapToTargetIds("boolean"==typeof t.unload&&t.unload?null:t.unload),function(){e.loadFromArgs(t)}):e.loadFromArgs(t)},b.unload=function(t){var e=this.internal;(t=t||{})instanceof Array?t={ids:t}:"string"==typeof t&&(t={ids:[t]}),e.unload(e.mapToTargetIds(t.ids),function(){e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),t.done&&t.done()})},b.regions=function(t){var e=this.internal,i=e.config;return t?(i.regions=t,e.redrawWithoutRescale(),i.regions):i.regions},b.regions.add=function(t){var e=this.internal,i=e.config;return t?(i.regions=i.regions.concat(t),e.redrawWithoutRescale(),i.regions):i.regions},b.regions.remove=function(t){var e,n,a,r=this.internal,s=r.config;return t=t||{},e=r.getOption(t,"duration",s.transition_duration),n=r.getOption(t,"classes",[i.region]),a=r.main.select("."+i.regions).selectAll(n.map(function(t){return"."+t})),(e?a.transition().duration(e):a).style("opacity",0).remove(),s.regions=s.regions.filter(function(t){var e=!1;return!t.class||(t.class.split(" ").forEach(function(t){n.indexOf(t)>=0&&(e=!0)}),!e)}),s.regions},b.selected=function(t){var e=this.internal,n=e.d3;return n.merge(e.main.selectAll("."+i.shapes+e.getTargetSelectorSuffix(t)).selectAll("."+i.shape).filter(function(){return n.select(this).classed(i.SELECTED)}).map(function(t){return t.map(function(t){var e=t.__data__;return e.data?e.data:e})}))},b.select=function(t,e,n){var a=this.internal,r=a.d3,s=a.config;s.data_selection_enabled&&a.main.selectAll("."+i.shapes).selectAll("."+i.shape).each(function(o,c){var d=r.select(this),u=o.data?o.data.id:o.id,h=a.getToggle(this,o).bind(a),g=s.data_selection_grouped||!t||t.indexOf(u)>=0,f=!e||e.indexOf(c)>=0,p=d.classed(i.SELECTED);d.classed(i.line)||d.classed(i.area)||(g&&f?s.data_selection_isselectable(o)&&!p&&h(!0,d.classed(i.SELECTED,!0),o,c):l(n)&&n&&p&&h(!1,d.classed(i.SELECTED,!1),o,c))})},b.unselect=function(t,e){var n=this.internal,a=n.d3,r=n.config;r.data_selection_enabled&&n.main.selectAll("."+i.shapes).selectAll("."+i.shape).each(function(s,o){var c=a.select(this),d=s.data?s.data.id:s.id,u=n.getToggle(this,s).bind(n),l=r.data_selection_grouped||!t||t.indexOf(d)>=0,h=!e||e.indexOf(o)>=0,g=c.classed(i.SELECTED);c.classed(i.line)||c.classed(i.area)||l&&h&&r.data_selection_isselectable(s)&&g&&u(!1,c.classed(i.SELECTED,!1),s,o)})},b.show=function(t,e){var i,n=this.internal;t=n.mapToTargetIds(t),e=e||{},n.removeHiddenTargetIds(t),(i=n.svg.selectAll(n.selectorTargets(t))).transition().style("display","initial","important").style("opacity",1,"important").call(n.endall,function(){i.style("opacity",null).style("opacity",1)}),e.withLegend&&n.showLegend(t),n.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},b.hide=function(t,e){var i,n=this.internal;t=n.mapToTargetIds(t),e=e||{},n.addHiddenTargetIds(t),(i=n.svg.selectAll(n.selectorTargets(t))).transition().style("opacity",0,"important").call(n.endall,function(){i.style("opacity",null).style("opacity",0),i.style("display","none")}),e.withLegend&&n.hideLegend(t),n.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},b.toggle=function(t,e){var i=this,n=this.internal;n.mapToTargetIds(t).forEach(function(t){n.isTargetToShow(t)?i.hide(t,e):i.show(t,e)})},b.tooltip=function(){},b.tooltip.show=function(t){var e,i,n=this.internal,a={};t.mouse?a=t.mouse:(t.data?i=t.data:void 0!==t.x&&(e=t.id?n.data.targets.filter(function(e){return e.id===t.id}):n.data.targets,i=n.filterByX(e,t.x).slice(0,1)[0]),a=i?n.getMousePosition(i):null),n.dispatchEvent("mousemove",a),n.config.tooltip_onshow.call(n,i)},b.tooltip.hide=function(){this.internal.dispatchEvent("mouseout",0),this.internal.config.tooltip_onhide.call(this)},b.transform=function(t,e){var i=this.internal,n=["pie","donut"].indexOf(t)>=0?{withTransform:!0}:null;i.transformTo(e,t,n)},T.transformTo=function(t,e,i){var n=this,a=!n.hasArcType(),r=i||{withTransitionForAxis:a};r.withTransitionForTransform=!1,n.transiting=!1,n.setTargetType(t,e),n.updateTargets(n.data.targets),n.updateAndRedraw(r)},b.x=function(t){var e=this.internal;return arguments.length&&(e.updateTargetX(e.data.targets,t),e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),e.data.xs},b.xs=function(t){var e=this.internal;return arguments.length&&(e.updateTargetXs(e.data.targets,t),e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),e.data.xs},b.zoom=function(t){var e=this.internal;return t?(e.isTimeSeries()&&(t=t.map(function(t){return e.parseDate(t)})),e.config.subchart_show?e.brush.selectionAsValue(t,!0):(e.updateXDomain(null,!0,!1,!1,t),e.redraw({withY:e.config.zoom_rescale,withSubchart:!1})),e.config.zoom_onzoom.call(this,e.x.orgDomain()),t):e.x.domain()},b.zoom.enable=function(t){var e=this.internal;e.config.zoom_enabled=t,e.updateAndRedraw()},b.unzoom=function(){var t=this.internal;t.config.subchart_show?t.brush.clear():(t.updateXDomain(null,!0,!1,!1,t.subX.domain()),t.redraw({withY:t.config.zoom_rescale,withSubchart:!1}))},b.zoom.max=function(t){var e=this.internal,i=e.config,n=e.d3;if(0!==t&&!t)return i.zoom_x_max;i.zoom_x_max=n.max([e.orgXDomain[1],t])},b.zoom.min=function(t){var e=this.internal,i=e.config,n=e.d3;if(0!==t&&!t)return i.zoom_x_min;i.zoom_x_min=n.min([e.orgXDomain[0],t])},b.zoom.range=function(t){if(!arguments.length)return{max:this.domain.max(),min:this.domain.min()};l(t.max)&&this.domain.max(t.max),l(t.min)&&this.domain.min(t.min)},T.initPie=function(){var t=this,e=t.d3;t.pie=e.pie().value(function(t){return t.values.reduce(function(t,e){return t+e.value},0)});var i=t.getOrderFunction();if(i&&(t.isOrderAsc()||t.isOrderDesc())){var n=i;i=function(t,e){return-1*n(t,e)}}t.pie.sort(i||null)},T.updateRadius=function(){var t=this,e=t.config,i=e.gauge_width||e.donut_width,n=t.filterTargetsToShow(t.data.targets).length*t.config.gauge_arcs_minWidth;t.radiusExpanded=Math.min(t.arcWidth,t.arcHeight)/2*(t.hasType("gauge")?.85:1),t.radius=.95*t.radiusExpanded,t.innerRadiusRatio=i?(t.radius-i)/t.radius:.6,t.innerRadius=t.hasType("donut")||t.hasType("gauge")?t.radius*t.innerRadiusRatio:0,t.gaugeArcWidth=i||(n<=t.radius-t.innerRadius?t.radius-t.innerRadius:n<=t.radius?n:t.radius)},T.updateArc=function(){var t=this;t.svgArc=t.getSvgArc(),t.svgArcExpanded=t.getSvgArcExpanded(),t.svgArcExpandedSub=t.getSvgArcExpanded(.98)},T.updateAngle=function(t){var e,i,n,a,r=this,s=r.config,o=!1,c=0;return s?(r.pie(r.filterTargetsToShow(r.data.targets)).forEach(function(e){o||e.data.id!==t.data.id||(o=!0,(t=e).index=c),c++}),isNaN(t.startAngle)&&(t.startAngle=0),isNaN(t.endAngle)&&(t.endAngle=t.startAngle),r.isGaugeType(t.data)&&(e=s.gauge_min,i=s.gauge_max,n=Math.PI*(s.gauge_fullCircle?2:1)/(i-e),a=t.value<e?0:t.value<i?t.value-e:i-e,t.startAngle=s.gauge_startingAngle,t.endAngle=t.startAngle+n*a),o?t:null):null},T.getSvgArc=function(){var t=this,e=t.hasType("gauge"),i=t.gaugeArcWidth/t.filterTargetsToShow(t.data.targets).length,n=t.d3.arc().outerRadius(function(n){return e?t.radius-i*n.index:t.radius}).innerRadius(function(n){return e?t.radius-i*(n.index+1):t.innerRadius}),a=function(e,i){var a;return i?n(e):(a=t.updateAngle(e))?n(a):"M 0 0"};return a.centroid=n.centroid,a},T.getSvgArcExpanded=function(t){t=t||1;var e=this,i=e.hasType("gauge"),n=e.gaugeArcWidth/e.filterTargetsToShow(e.data.targets).length,a=Math.min(e.radiusExpanded*t-e.radius,.8*n-100*(1-t)),r=e.d3.arc().outerRadius(function(r){return i?e.radius-n*r.index+a:e.radiusExpanded*t}).innerRadius(function(t){return i?e.radius-n*(t.index+1):e.innerRadius});return function(t){var i=e.updateAngle(t);return i?r(i):"M 0 0"}},T.getArc=function(t,e,i){return i||this.isArcType(t.data)?this.svgArc(t,e):"M 0 0"},T.transformForArcLabel=function(t){var e,i,n,a,r,s=this,c=s.config,d=s.updateAngle(t),u="",l=s.hasType("gauge");if(d&&!l)e=this.svgArc.centroid(d),i=isNaN(e[0])?0:e[0],n=isNaN(e[1])?0:e[1],a=Math.sqrt(i*i+n*n),u="translate("+i*(r=s.hasType("donut")&&c.donut_label_ratio?o(c.donut_label_ratio)?c.donut_label_ratio(t,s.radius,a):c.donut_label_ratio:s.hasType("pie")&&c.pie_label_ratio?o(c.pie_label_ratio)?c.pie_label_ratio(t,s.radius,a):c.pie_label_ratio:s.radius&&a?(36/s.radius>.375?1.175-36/s.radius:.8)*s.radius/a:0)+","+n*r+")";else if(d&&l&&s.filterTargetsToShow(s.data.targets).length>1){var h=Math.sin(d.endAngle-Math.PI/2);u="translate("+(i=Math.cos(d.endAngle-Math.PI/2)*(s.radiusExpanded+25))+","+(n=h*(s.radiusExpanded+15-Math.abs(10*h))+3)+")"}return u},T.getArcRatio=function(t){var e=this.config,i=Math.PI*(this.hasType("gauge")&&!e.gauge_fullCircle?1:2);return t?(t.endAngle-t.startAngle)/i:null},T.convertToArcData=function(t){return this.addName({id:t.data.id,value:t.value,ratio:this.getArcRatio(t),index:t.index})},T.textForArcLabel=function(t){var e,i,n,a,r,s=this;return s.shouldShowArcLabel()?(i=(e=s.updateAngle(t))?e.value:null,n=s.getArcRatio(e),a=t.data.id,s.hasType("gauge")||s.meetsArcLabelThreshold(n)?(r=s.getArcLabelFormat())?r(i,n,a):s.defaultArcValueFormat(i,n):""):""},T.textForGaugeMinMax=function(t,e){var i=this.getGaugeLabelExtents();return i?i(t,e):t},T.expandArc=function(t){var e,n=this;n.transiting?e=window.setInterval(function(){n.transiting||(window.clearInterval(e),n.legend.selectAll(".c3-legend-item-focused").size()>0&&n.expandArc(t))},10):(t=n.mapToTargetIds(t),n.svg.selectAll(n.selectorTargets(t,"."+i.chartArc)).each(function(t){n.shouldExpand(t.data.id)&&n.d3.select(this).selectAll("path").transition().duration(n.expandDuration(t.data.id)).attr("d",n.svgArcExpanded).transition().duration(2*n.expandDuration(t.data.id)).attr("d",n.svgArcExpandedSub).each(function(t){n.isDonutType(t.data)})}))},T.unexpandArc=function(t){var e=this;e.transiting||(t=e.mapToTargetIds(t),e.svg.selectAll(e.selectorTargets(t,"."+i.chartArc)).selectAll("path").transition().duration(function(t){return e.expandDuration(t.data.id)}).attr("d",e.svgArc),e.svg.selectAll("."+i.arc))},T.expandDuration=function(t){var e=this.config;return this.isDonutType(t)?e.donut_expand_duration:this.isGaugeType(t)?e.gauge_expand_duration:this.isPieType(t)?e.pie_expand_duration:50},T.shouldExpand=function(t){var e=this.config;return this.isDonutType(t)&&e.donut_expand||this.isGaugeType(t)&&e.gauge_expand||this.isPieType(t)&&e.pie_expand},T.shouldShowArcLabel=function(){var t=this.config,e=!0;return this.hasType("donut")?e=t.donut_label_show:this.hasType("pie")&&(e=t.pie_label_show),e},T.meetsArcLabelThreshold=function(t){var e=this.config;return t>=(this.hasType("donut")?e.donut_label_threshold:e.pie_label_threshold)},T.getArcLabelFormat=function(){var t=this.config,e=t.pie_label_format;return this.hasType("gauge")?e=t.gauge_label_format:this.hasType("donut")&&(e=t.donut_label_format),e},T.getGaugeLabelExtents=function(){return this.config.gauge_label_extents},T.getArcTitle=function(){return this.hasType("donut")?this.config.donut_title:""},T.updateTargetsForArc=function(t){var e,n=this,a=n.main,r=n.classChartArc.bind(n),s=n.classArcs.bind(n),o=n.classFocus.bind(n);(e=a.select("."+i.chartArcs).selectAll("."+i.chartArc).data(n.pie(t)).attr("class",function(t){return r(t)+o(t.data)}).enter().append("g").attr("class",r)).append("g").attr("class",s),e.append("text").attr("dy",n.hasType("gauge")?"-.1em":".35em").style("opacity",0).style("text-anchor","middle").style("pointer-events","none")},T.initArc=function(){var t=this;t.arcs=t.main.select("."+i.chart).append("g").attr("class",i.chartArcs).attr("transform",t.getTranslate("arc")),t.arcs.append("text").attr("class",i.chartArcsTitle).style("text-anchor","middle").text(t.getArcTitle())},T.redrawArc=function(t,e,n){var a,r,s,o,c,d=this,u=d.d3,l=d.config,h=d.main,g=d.hasType("gauge");if(r=(a=h.selectAll("."+i.arcs).selectAll("."+i.arc).data(d.arcData.bind(d))).enter().append("path").attr("class",d.classArc.bind(d)).style("fill",function(t){return d.color(t.data)}).style("cursor",function(t){return l.interaction_enabled&&l.data_selection_isselectable(t)?"pointer":null}).each(function(t){d.isGaugeType(t.data)&&(t.startAngle=t.endAngle=l.gauge_startingAngle),this._current=t}).merge(a),g&&(c=(o=h.selectAll("."+i.arcs).selectAll("."+i.arcLabelLine).data(d.arcData.bind(d))).enter().append("rect").attr("class",function(t){return i.arcLabelLine+" "+i.target+" "+i.target+"-"+t.data.id}).merge(o),1===d.filterTargetsToShow(d.data.targets).length?c.style("display","none"):c.style("fill",function(t){return l.color_pattern.length>0?d.levelColor(t.data.values[0].value):d.color(t.data)}).style("display",l.gauge_labelLine_show?"":"none").each(function(t){var e=0,i=0,n=0,a="";if(d.hiddenTargetIds.indexOf(t.data.id)<0){var r=d.updateAngle(t),s=d.gaugeArcWidth/d.filterTargetsToShow(d.data.targets).length*(r.index+1),o=r.endAngle-Math.PI/2,c=d.radius-s,l=o-(0===c?0:1/c);e=d.radiusExpanded-d.radius+s,i=Math.cos(l)*c,n=Math.sin(l)*c,a="rotate("+180*o/Math.PI+", "+i+", "+n+")"}u.select(this).attr("x",i).attr("y",n).attr("width",e).attr("height",2).attr("transform",a).style("stroke-dasharray","0, "+(e+2)+", 0")})),r.attr("transform",function(t){return!d.isGaugeType(t.data)&&n?"scale(0)":""}).on("mouseover",l.interaction_enabled?function(t){var e,i;d.transiting||(e=d.updateAngle(t))&&(i=d.convertToArcData(e),d.expandArc(e.data.id),d.api.focus(e.data.id),d.toggleFocusLegend(e.data.id,!0),d.config.data_onmouseover(i,this))}:null).on("mousemove",l.interaction_enabled?function(t){var e,i=d.updateAngle(t);i&&(e=[d.convertToArcData(i)],d.showTooltip(e,this))}:null).on("mouseout",l.interaction_enabled?function(t){var e,i;d.transiting||(e=d.updateAngle(t))&&(i=d.convertToArcData(e),d.unexpandArc(e.data.id),d.api.revert(),d.revertLegend(),d.hideTooltip(),d.config.data_onmouseout(i,this))}:null).on("click",l.interaction_enabled?function(t,e){var i,n=d.updateAngle(t);n&&(i=d.convertToArcData(n),d.toggleShape&&d.toggleShape(this,i,e),d.config.data_onclick.call(d.api,i,this))}:null).each(function(){d.transiting=!0}).transition().duration(t).attrTween("d",function(t){var e,i=d.updateAngle(t);return i?(isNaN(this._current.startAngle)&&(this._current.startAngle=0),isNaN(this._current.endAngle)&&(this._current.endAngle=this._current.startAngle),e=u.interpolate(this._current,i),this._current=e(0),function(i){var n=e(i);return n.data=t.data,d.getArc(n,!0)}):function(){return"M 0 0"}}).attr("transform",n?"scale(1)":"").style("fill",function(t){return d.levelColor?d.levelColor(t.data.values[0].value):d.color(t.data.id)}).call(d.endall,function(){d.transiting=!1}),a.exit().transition().duration(e).style("opacity",0).remove(),h.selectAll("."+i.chartArc).select("text").style("opacity",0).attr("class",function(t){return d.isGaugeType(t.data)?i.gaugeValue:""}).text(d.textForArcLabel.bind(d)).attr("transform",d.transformForArcLabel.bind(d)).style("font-size",function(t){return d.isGaugeType(t.data)&&1===d.filterTargetsToShow(d.data.targets).length?Math.round(d.radius/5)+"px":""}).transition().duration(t).style("opacity",function(t){return d.isTargetToShow(t.data.id)&&d.isArcType(t.data)?1:0}),h.select("."+i.chartArcsTitle).style("opacity",d.hasType("donut")||g?1:0),g){var f=0;(s=d.arcs.select("g."+i.chartArcsBackground).selectAll("path."+i.chartArcsBackground).data(d.data.targets)).enter().append("path"),s.attr("class",function(t,e){return i.chartArcsBackground+" "+i.chartArcsBackground+"-"+e}).attr("d",function(t){if(d.hiddenTargetIds.indexOf(t.id)>=0)return"M 0 0";var e={data:[{value:l.gauge_max}],startAngle:l.gauge_startingAngle,endAngle:-1*l.gauge_startingAngle*(l.gauge_fullCircle?Math.PI:1),index:f++};return d.getArc(e,!0,!0)}),s.exit().remove(),d.arcs.select("."+i.chartArcsGaugeUnit).attr("dy",".75em").text(l.gauge_label_show?l.gauge_units:""),d.arcs.select("."+i.chartArcsGaugeMin).attr("dx",-1*(d.innerRadius+(d.radius-d.innerRadius)/(l.gauge_fullCircle?1:2))+"px").attr("dy","1.2em").text(l.gauge_label_show?d.textForGaugeMinMax(l.gauge_min,!1):""),d.arcs.select("."+i.chartArcsGaugeMax).attr("dx",d.innerRadius+(d.radius-d.innerRadius)/(l.gauge_fullCircle?1:2)+"px").attr("dy","1.2em").text(l.gauge_label_show?d.textForGaugeMinMax(l.gauge_max,!0):"")}},T.initGauge=function(){var t=this.arcs;this.hasType("gauge")&&(t.append("g").attr("class",i.chartArcsBackground),t.append("text").attr("class",i.chartArcsGaugeUnit).style("text-anchor","middle").style("pointer-events","none"),t.append("text").attr("class",i.chartArcsGaugeMin).style("text-anchor","middle").style("pointer-events","none"),t.append("text").attr("class",i.chartArcsGaugeMax).style("text-anchor","middle").style("pointer-events","none"))},T.getGaugeLabelHeight=function(){return this.config.gauge_label_show?20:0},T.hasCaches=function(t){for(var e=0;e<t.length;e++)if(!(t[e]in this.cache))return!1;return!0},T.addCache=function(t,e){this.cache[t]=this.cloneTarget(e)},T.getCaches=function(t){var e,i=[];for(e=0;e<t.length;e++)t[e]in this.cache&&i.push(this.cloneTarget(this.cache[t[e]]));return i},T.categoryName=function(t){var e=this.config;return t<e.axis_x_categories.length?e.axis_x_categories[t]:t},T.generateTargetClass=function(t){return t||0===t?("-"+t).replace(/\s/g,"-"):""},T.generateClass=function(t,e){return" "+t+" "+t+this.generateTargetClass(e)},T.classText=function(t){return this.generateClass(i.text,t.index)},T.classTexts=function(t){return this.generateClass(i.texts,t.id)},T.classShape=function(t){return this.generateClass(i.shape,t.index)},T.classShapes=function(t){return this.generateClass(i.shapes,t.id)},T.classLine=function(t){return this.classShape(t)+this.generateClass(i.line,t.id)},T.classLines=function(t){return this.classShapes(t)+this.generateClass(i.lines,t.id)},T.classCircle=function(t){return this.classShape(t)+this.generateClass(i.circle,t.index)},T.classCircles=function(t){return this.classShapes(t)+this.generateClass(i.circles,t.id)},T.classBar=function(t){return this.classShape(t)+this.generateClass(i.bar,t.index)},T.classBars=function(t){return this.classShapes(t)+this.generateClass(i.bars,t.id)},T.classArc=function(t){return this.classShape(t.data)+this.generateClass(i.arc,t.data.id)},T.classArcs=function(t){return this.classShapes(t.data)+this.generateClass(i.arcs,t.data.id)},T.classArea=function(t){return this.classShape(t)+this.generateClass(i.area,t.id)},T.classAreas=function(t){return this.classShapes(t)+this.generateClass(i.areas,t.id)},T.classRegion=function(t,e){return this.generateClass(i.region,e)+" "+("class"in t?t.class:"")},T.classEvent=function(t){return this.generateClass(i.eventRect,t.index)},T.classTarget=function(t){var e=this.config.data_classes[t],n="";return e&&(n=" "+i.target+"-"+e),this.generateClass(i.target,t)+n},T.classFocus=function(t){return this.classFocused(t)+this.classDefocused(t)},T.classFocused=function(t){return" "+(this.focusedTargetIds.indexOf(t.id)>=0?i.focused:"")},T.classDefocused=function(t){return" "+(this.defocusedTargetIds.indexOf(t.id)>=0?i.defocused:"")},T.classChartText=function(t){return i.chartText+this.classTarget(t.id)},T.classChartLine=function(t){return i.chartLine+this.classTarget(t.id)},T.classChartBar=function(t){return i.chartBar+this.classTarget(t.id)},T.classChartArc=function(t){return i.chartArc+this.classTarget(t.data.id)},T.getTargetSelectorSuffix=function(t){return this.generateTargetClass(t).replace(/([?!@#$%^&*()_=+,.<>'":;\[\]\/|~`{}\\])/g,"\\$1")},T.selectorTarget=function(t,e){return(e||"")+"."+i.target+this.getTargetSelectorSuffix(t)},T.selectorTargets=function(t,e){var i=this;return(t=t||[]).length?t.map(function(t){return i.selectorTarget(t,e)}):null},T.selectorLegend=function(t){return"."+i.legendItem+this.getTargetSelectorSuffix(t)},T.selectorLegends=function(t){var e=this;return t&&t.length?t.map(function(t){return e.selectorLegend(t)}):null},T.getClipPath=function(t){return"url("+(window.navigator.appVersion.toLowerCase().indexOf("msie 9.")>=0?"":document.URL.split("#")[0])+"#"+t+")"},T.appendClip=function(t,e){return t.append("clipPath").attr("id",e).append("rect")},T.getAxisClipX=function(t){var e=Math.max(30,this.margin.left);return t?-(1+e):-(e-1)},T.getAxisClipY=function(t){return t?-20:-this.margin.top},T.getXAxisClipX=function(){return this.getAxisClipX(!this.config.axis_rotated)},T.getXAxisClipY=function(){return this.getAxisClipY(!this.config.axis_rotated)},T.getYAxisClipX=function(){return this.config.axis_y_inner?-1:this.getAxisClipX(this.config.axis_rotated)},T.getYAxisClipY=function(){return this.getAxisClipY(this.config.axis_rotated)},T.getAxisClipWidth=function(t){var e=Math.max(30,this.margin.left),i=Math.max(30,this.margin.right);return t?this.width+2+e+i:this.margin.left+20},T.getAxisClipHeight=function(t){return(t?this.margin.bottom:this.margin.top+this.height)+20},T.getXAxisClipWidth=function(){return this.getAxisClipWidth(!this.config.axis_rotated)},T.getXAxisClipHeight=function(){return this.getAxisClipHeight(!this.config.axis_rotated)},T.getYAxisClipWidth=function(){return this.getAxisClipWidth(this.config.axis_rotated)+(this.config.axis_y_inner?20:0)},T.getYAxisClipHeight=function(){return this.getAxisClipHeight(this.config.axis_rotated)},T.generateColor=function(){var t=this.config,e=this.d3,i=t.data_colors,n=_(t.color_pattern)?t.color_pattern:e.schemeCategory10,a=t.data_color,r=[];return function(t){var e,s=t.id||t.data&&t.data.id||t;return i[s]instanceof Function?e=i[s](t):i[s]?e=i[s]:(r.indexOf(s)<0&&r.push(s),e=n[r.indexOf(s)%n.length],i[s]=e),a instanceof Function?a(e,t):e}},T.generateLevelColor=function(){var t=this.config,e=t.color_pattern,i=t.color_threshold,n="value"===i.unit,a=i.values&&i.values.length?i.values:[],r=i.max||100;return _(t.color_threshold)?function(t){var i,s=e[e.length-1];for(i=0;i<a.length;i++)if((n?t:100*t/r)<a[i]){s=e[i];break}return s}:null},T.getDefaultConfig=function(){var t={bindto:"#chart",svg_classname:void 0,size_width:void 0,size_height:void 0,padding_left:void 0,padding_right:void 0,padding_top:void 0,padding_bottom:void 0,resize_auto:!0,zoom_enabled:!1,zoom_initialRange:void 0,zoom_privileged:!1,zoom_rescale:!1,zoom_onzoom:function(){},zoom_onzoomstart:function(){},zoom_onzoomend:function(){},zoom_x_min:void 0,zoom_x_max:void 0,interaction_brighten:!0,interaction_enabled:!0,onmouseover:function(){},onmouseout:function(){},onresize:function(){},onresized:function(){},oninit:function(){},onrendered:function(){},transition_duration:350,data_x:void 0,data_xs:{},data_xFormat:"%Y-%m-%d",data_xLocaltime:!0,data_xSort:!0,data_idConverter:function(t){return t},data_names:{},data_classes:{},data_groups:[],data_axes:{},data_type:void 0,data_types:{},data_labels:{},data_order:"desc",data_regions:{},data_color:void 0,data_colors:{},data_hide:!1,data_filter:void 0,data_selection_enabled:!1,data_selection_grouped:!1,data_selection_isselectable:function(){return!0},data_selection_multiple:!0,data_selection_draggable:!1,data_onclick:function(){},data_onmouseover:function(){},data_onmouseout:function(){},data_onselected:function(){},data_onunselected:function(){},data_url:void 0,data_headers:void 0,data_json:void 0,data_rows:void 0,data_columns:void 0,data_mimeType:void 0,data_keys:void 0,data_empty_label_text:"",subchart_show:!1,subchart_size_height:60,subchart_axis_x_show:!0,subchart_onbrush:function(){},color_pattern:[],color_threshold:{},legend_show:!0,legend_hide:!1,legend_position:"bottom",legend_inset_anchor:"top-left",legend_inset_x:10,legend_inset_y:0,legend_inset_step:void 0,legend_item_onclick:void 0,legend_item_onmouseover:void 0,legend_item_onmouseout:void 0,legend_equally:!1,legend_padding:0,legend_item_tile_width:10,legend_item_tile_height:10,axis_rotated:!1,axis_x_show:!0,axis_x_type:"indexed",axis_x_localtime:!0,axis_x_categories:[],axis_x_tick_centered:!1,axis_x_tick_format:void 0,axis_x_tick_culling:{},axis_x_tick_culling_max:10,axis_x_tick_count:void 0,axis_x_tick_fit:!0,axis_x_tick_values:null,axis_x_tick_rotate:0,axis_x_tick_outer:!0,axis_x_tick_multiline:!0,axis_x_tick_multilineMax:0,axis_x_tick_width:null,axis_x_max:void 0,axis_x_min:void 0,axis_x_padding:{},axis_x_height:void 0,axis_x_selection:void 0,axis_x_label:{},axis_x_inner:void 0,axis_y_show:!0,axis_y_type:void 0,axis_y_max:void 0,axis_y_min:void 0,axis_y_inverted:!1,axis_y_center:void 0,axis_y_inner:void 0,axis_y_label:{},axis_y_tick_format:void 0,axis_y_tick_outer:!0,axis_y_tick_values:null,axis_y_tick_rotate:0,axis_y_tick_count:void 0,axis_y_tick_time_type:void 0,axis_y_tick_time_interval:void 0,axis_y_padding:{},axis_y_default:void 0,axis_y2_show:!1,axis_y2_max:void 0,axis_y2_min:void 0,axis_y2_inverted:!1,axis_y2_center:void 0,axis_y2_inner:void 0,axis_y2_label:{},axis_y2_tick_format:void 0,axis_y2_tick_outer:!0,axis_y2_tick_values:null,axis_y2_tick_count:void 0,axis_y2_padding:{},axis_y2_default:void 0,grid_x_show:!1,grid_x_type:"tick",grid_x_lines:[],grid_y_show:!1,grid_y_lines:[],grid_y_ticks:10,grid_focus_show:!0,grid_lines_front:!0,point_show:!0,point_r:2.5,point_sensitivity:10,point_focus_expand_enabled:!0,point_focus_expand_r:void 0,point_select_r:void 0,line_connectNull:!1,line_step_type:"step",bar_width:void 0,bar_width_ratio:.6,bar_width_max:void 0,bar_zerobased:!0,bar_space:0,area_zerobased:!0,area_above:!1,pie_label_show:!0,pie_label_format:void 0,pie_label_threshold:.05,pie_label_ratio:void 0,pie_expand:{},pie_expand_duration:50,gauge_fullCircle:!1,gauge_label_show:!0,gauge_labelLine_show:!0,gauge_label_format:void 0,gauge_min:0,gauge_max:100,gauge_startingAngle:-1*Math.PI/2,gauge_label_extents:void 0,gauge_units:void 0,gauge_width:void 0,gauge_arcs_minWidth:5,gauge_expand:{},gauge_expand_duration:50,donut_label_show:!0,donut_label_format:void 0,donut_label_threshold:.05,donut_label_ratio:void 0,donut_width:void 0,donut_title:"",donut_expand:{},donut_expand_duration:50,spline_interpolation_type:"cardinal",regions:[],tooltip_show:!0,tooltip_grouped:!0,tooltip_order:void 0,tooltip_format_title:void 0,tooltip_format_name:void 0,tooltip_format_value:void 0,tooltip_position:void 0,tooltip_contents:function(t,e,i,n){return this.getTooltipContent?this.getTooltipContent(t,e,i,n):""},tooltip_init_show:!1,tooltip_init_x:0,tooltip_init_position:{top:"0px",left:"50px"},tooltip_onshow:function(){},tooltip_onhide:function(){},title_text:void 0,title_padding:{top:0,right:0,bottom:0,left:0},title_position:"top-center"};return Object.keys(this.additionalConfig).forEach(function(e){t[e]=this.additionalConfig[e]},this),t},T.additionalConfig={},T.loadConfig=function(t){var e,i,a,r=this.config;Object.keys(r).forEach(function(s){e=t,i=s.split("_"),a=function t(){var a=i.shift();return a&&e&&"object"===(void 0===e?"undefined":n(e))&&a in e?(e=e[a],t()):a?void 0:e}(),l(a)&&(r[s]=a)})},T.convertUrlToData=function(t,e,i,n,a){var r,s,o=this,c=e||"csv";"json"===c?(r=o.d3.json,s=o.convertJsonToData):"tsv"===c?(r=o.d3.tsv,s=o.convertXsvToData):(r=o.d3.csv,s=o.convertXsvToData),r(t,i).then(function(t){a.call(o,s.call(o,t,n))}).catch(function(t){throw t})},T.convertXsvToData=function(t){var e=t.columns;return 0===t.length?{keys:e,rows:[e.reduce(function(t,e){return Object.assign(t,(a=null,(n=e)in(i={})?Object.defineProperty(i,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):i[n]=a,i));var i,n,a},{})]}:{keys:e,rows:[].concat(t)}},T.convertJsonToData=function(t,e){var i,n,a=this,r=[];return e?(e.x?(i=e.value.concat(e.x),a.config.data_x=e.x):i=e.value,r.push(i),t.forEach(function(t){var e=[];i.forEach(function(i){var n=a.findValueInJson(t,i);u(n)&&(n=null),e.push(n)}),r.push(e)}),n=a.convertRowsToData(r)):(Object.keys(t).forEach(function(e){r.push([e].concat(t[e]))}),n=a.convertColumnsToData(r)),n},T.findValueInJson=function(t,e){for(var i=(e=(e=e.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"")).split("."),n=0;n<i.length;++n){var a=i[n];if(!(a in t))return;t=t[a]}return t},T.convertRowsToData=function(t){for(var e=[],i=t[0],n=1;n<t.length;n++){for(var a={},r=0;r<t[n].length;r++){if(u(t[n][r]))throw new Error("Source data is missing a component at ("+n+","+r+")!");a[i[r]]=t[n][r]}e.push(a)}return{keys:i,rows:e}},T.convertColumnsToData=function(t){for(var e=[],i=[],n=0;n<t.length;n++){for(var a=t[n][0],r=1;r<t[n].length;r++){if(u(e[r-1])&&(e[r-1]={}),u(t[n][r]))throw new Error("Source data is missing a component at ("+n+","+r+")!");e[r-1][a]=t[n][r]}i.push(a)}return{keys:i,rows:e}},T.convertDataToTargets=function(t,e){var i,n,a,r,o=this,d=o.config;return c(t)?r=Object.keys(t[0]):(r=t.keys,t=t.rows),n=r.filter(o.isNotX,o),a=r.filter(o.isX,o),n.forEach(function(i){var n=o.getXKey(i);o.isCustomX()||o.isTimeSeries()?a.indexOf(n)>=0?o.data.xs[i]=(e&&o.data.xs[i]?o.data.xs[i]:[]).concat(t.map(function(t){return t[n]}).filter(s).map(function(t,e){return o.generateTargetX(t,i,e)})):d.data_x?o.data.xs[i]=o.getOtherTargetXs():_(d.data_xs)&&(o.data.xs[i]=o.getXValuesOfXKey(n,o.data.targets)):o.data.xs[i]=t.map(function(t,e){return e})}),n.forEach(function(t){if(!o.data.xs[t])throw new Error('x is not defined for id = "'+t+'".')}),(i=n.map(function(e,i){var n=d.data_idConverter(e);return{id:n,id_org:e,values:t.map(function(t,a){var r,s=t[o.getXKey(e)],c=null===t[e]||isNaN(t[e])?null:+t[e];return o.isCustomX()&&o.isCategorized()&&!u(s)?(0===i&&0===a&&(d.axis_x_categories=[]),-1===(r=d.axis_x_categories.indexOf(s))&&(r=d.axis_x_categories.length,d.axis_x_categories.push(s))):r=o.generateTargetX(s,e,a),(u(t[e])||o.data.xs[e].length<=a)&&(r=void 0),{x:r,value:c,id:n}}).filter(function(t){return l(t.x)})}})).forEach(function(t){var e;d.data_xSort&&(t.values=t.values.sort(function(t,e){return(t.x||0===t.x?t.x:1/0)-(e.x||0===e.x?e.x:1/0)})),e=0,t.values.forEach(function(t){t.index=e++}),o.data.xs[t.id].sort(function(t,e){return t-e})}),o.hasNegativeValue=o.hasNegativeValueInTargets(i),o.hasPositiveValue=o.hasPositiveValueInTargets(i),d.data_type&&o.setTargetType(o.mapToIds(i).filter(function(t){return!(t in d.data_types)}),d.data_type),i.forEach(function(t){o.addCache(t.id_org,t)}),i},T.isX=function(t){var e=this.config;return e.data_x&&t===e.data_x||_(e.data_xs)&&y(e.data_xs,t)},T.isNotX=function(t){return!this.isX(t)},T.getXKey=function(t){var e=this.config;return e.data_x?e.data_x:_(e.data_xs)?e.data_xs[t]:null},T.getXValuesOfXKey=function(t,e){var i,n=this;return(e&&_(e)?n.mapToIds(e):[]).forEach(function(e){n.getXKey(e)===t&&(i=n.data.xs[e])}),i},T.getXValue=function(t,e){return t in this.data.xs&&this.data.xs[t]&&s(this.data.xs[t][e])?this.data.xs[t][e]:e},T.getOtherTargetXs=function(){var t=Object.keys(this.data.xs);return t.length?this.data.xs[t[0]]:null},T.getOtherTargetX=function(t){var e=this.getOtherTargetXs();return e&&t<e.length?e[t]:null},T.addXs=function(t){var e=this;Object.keys(t).forEach(function(i){e.config.data_xs[i]=t[i]})},T.addName=function(t){var e;return t&&(e=this.config.data_names[t.id],t.name=void 0!==e?e:t.id),t},T.getValueOnIndex=function(t,e){var i=t.filter(function(t){return t.index===e});return i.length?i[0]:null},T.updateTargetX=function(t,e){var i=this;t.forEach(function(t){t.values.forEach(function(n,a){n.x=i.generateTargetX(e[a],t.id,a)}),i.data.xs[t.id]=e})},T.updateTargetXs=function(t,e){var i=this;t.forEach(function(t){e[t.id]&&i.updateTargetX([t],e[t.id])})},T.generateTargetX=function(t,e,i){var n=this;return n.isTimeSeries()?t?n.parseDate(t):n.parseDate(n.getXValue(e,i)):n.isCustomX()&&!n.isCategorized()?s(t)?+t:n.getXValue(e,i):i},T.cloneTarget=function(t){return{id:t.id,id_org:t.id_org,values:t.values.map(function(t){return{x:t.x,value:t.value,id:t.id}})}},T.getMaxDataCount=function(){return this.d3.max(this.data.targets,function(t){return t.values.length})},T.mapToIds=function(t){return t.map(function(t){return t.id})},T.mapToTargetIds=function(t){return t?[].concat(t):this.mapToIds(this.data.targets)},T.hasTarget=function(t,e){var i,n=this.mapToIds(t);for(i=0;i<n.length;i++)if(n[i]===e)return!0;return!1},T.isTargetToShow=function(t){return this.hiddenTargetIds.indexOf(t)<0},T.isLegendToShow=function(t){return this.hiddenLegendIds.indexOf(t)<0},T.filterTargetsToShow=function(t){var e=this;return t.filter(function(t){return e.isTargetToShow(t.id)})},T.mapTargetsToUniqueXs=function(t){var e=this.d3.set(this.d3.merge(t.map(function(t){return t.values.map(function(t){return+t.x})}))).values();return(e=this.isTimeSeries()?e.map(function(t){return new Date(+t)}):e.map(function(t){return+t})).sort(function(t,e){return t<e?-1:t>e?1:t>=e?0:NaN})},T.addHiddenTargetIds=function(t){t=t instanceof Array?t:new Array(t);for(var e=0;e<t.length;e++)this.hiddenTargetIds.indexOf(t[e])<0&&(this.hiddenTargetIds=this.hiddenTargetIds.concat(t[e]))},T.removeHiddenTargetIds=function(t){this.hiddenTargetIds=this.hiddenTargetIds.filter(function(e){return t.indexOf(e)<0})},T.addHiddenLegendIds=function(t){t=t instanceof Array?t:new Array(t);for(var e=0;e<t.length;e++)this.hiddenLegendIds.indexOf(t[e])<0&&(this.hiddenLegendIds=this.hiddenLegendIds.concat(t[e]))},T.removeHiddenLegendIds=function(t){this.hiddenLegendIds=this.hiddenLegendIds.filter(function(e){return t.indexOf(e)<0})},T.getValuesAsIdKeyed=function(t){var e={};return t.forEach(function(t){e[t.id]=[],t.values.forEach(function(i){e[t.id].push(i.value)})}),e},T.checkValueInTargets=function(t,e){var i,n,a,r=Object.keys(t);for(i=0;i<r.length;i++)for(a=t[r[i]].values,n=0;n<a.length;n++)if(e(a[n].value))return!0;return!1},T.hasNegativeValueInTargets=function(t){return this.checkValueInTargets(t,function(t){return t<0})},T.hasPositiveValueInTargets=function(t){return this.checkValueInTargets(t,function(t){return t>0})},T.isOrderDesc=function(){var t=this.config;return"string"==typeof t.data_order&&"desc"===t.data_order.toLowerCase()},T.isOrderAsc=function(){var t=this.config;return"string"==typeof t.data_order&&"asc"===t.data_order.toLowerCase()},T.getOrderFunction=function(){var t=this.config,e=this.isOrderAsc(),i=this.isOrderDesc();if(e||i){var n=function(t,e){return t+Math.abs(e.value)};return function(t,i){var a=t.values.reduce(n,0),r=i.values.reduce(n,0);return e?r-a:a-r}}if(o(t.data_order))return t.data_order;if(c(t.data_order)){var a=t.data_order;return function(t,e){return a.indexOf(t.id)-a.indexOf(e.id)}}},T.orderTargets=function(t){var e=this.getOrderFunction();return e&&t.sort(e),t},T.filterByX=function(t,e){return this.d3.merge(t.map(function(t){return t.values})).filter(function(t){return t.x-e==0})},T.filterRemoveNull=function(t){return t.filter(function(t){return s(t.value)})},T.filterByXDomain=function(t,e){return t.map(function(t){return{id:t.id,id_org:t.id_org,values:t.values.filter(function(t){return e[0]<=t.x&&t.x<=e[1]})}})},T.hasDataLabel=function(){var t=this.config;return!("boolean"!=typeof t.data_labels||!t.data_labels)||!("object"!==n(t.data_labels)||!_(t.data_labels))},T.getDataLabelLength=function(t,e,i){var n=this,a=[0,0];return n.selectChart.select("svg").selectAll(".dummy").data([t,e]).enter().append("text").text(function(t){return n.dataLabelFormat(t.id)(t)}).each(function(t,e){a[e]=1.3*this.getBoundingClientRect()[i]}).remove(),a},T.isNoneArc=function(t){return this.hasTarget(this.data.targets,t.id)},T.isArc=function(t){return"data"in t&&this.hasTarget(this.data.targets,t.data.id)},T.findClosestFromTargets=function(t,e){var i,n=this;return i=t.map(function(t){return n.findClosest(t.values,e)}),n.findClosest(i,e)},T.findClosest=function(t,e){var n,a=this,r=a.config.point_sensitivity;return t.filter(function(t){return t&&a.isBarType(t.id)}).forEach(function(t){var e=a.main.select("."+i.bars+a.getTargetSelectorSuffix(t.id)+" ."+i.bar+"-"+t.index).node();!n&&a.isWithinBar(a.d3.mouse(e),e)&&(n=t)}),t.filter(function(t){return t&&!a.isBarType(t.id)}).forEach(function(t){var i=a.dist(t,e);i<r&&(r=i,n=t)}),n},T.dist=function(t,e){var i=this.config,n=i.axis_rotated?1:0,a=i.axis_rotated?0:1,r=this.circleY(t,t.index),s=this.x(t.x);return Math.sqrt(Math.pow(s-e[n],2)+Math.pow(r-e[a],2))},T.convertValuesToStep=function(t){var e,i=[].concat(t);if(!this.isCategorized())return t;for(e=t.length+1;0<e;e--)i[e]=i[e-1];return i[0]={x:i[0].x-1,value:i[0].value,id:i[0].id},i[t.length+1]={x:i[t.length].x+1,value:i[t.length].value,id:i[t.length].id},i},T.updateDataAttributes=function(t,e){var i=this.config["data_"+t];return void 0===e?i:(Object.keys(e).forEach(function(t){i[t]=e[t]}),this.redraw({withLegend:!0}),i)},T.load=function(t,e){var i=this;t&&(e.filter&&(t=t.filter(e.filter)),(e.type||e.types)&&t.forEach(function(t){var n=e.types&&e.types[t.id]?e.types[t.id]:e.type;i.setTargetType(t.id,n)}),i.data.targets.forEach(function(e){for(var i=0;i<t.length;i++)if(e.id===t[i].id){e.values=t[i].values,t.splice(i,1);break}}),i.data.targets=i.data.targets.concat(t)),i.updateTargets(i.data.targets),i.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),e.done&&e.done()},T.loadFromArgs=function(t){var e=this;t.data?e.load(e.convertDataToTargets(t.data),t):t.url?e.convertUrlToData(t.url,t.mimeType,t.headers,t.keys,function(i){e.load(e.convertDataToTargets(i),t)}):t.json?e.load(e.convertDataToTargets(e.convertJsonToData(t.json,t.keys)),t):t.rows?e.load(e.convertDataToTargets(e.convertRowsToData(t.rows)),t):t.columns?e.load(e.convertDataToTargets(e.convertColumnsToData(t.columns)),t):e.load(null,t)},T.unload=function(t,e){var n=this;e||(e=function(){}),(t=t.filter(function(t){return n.hasTarget(n.data.targets,t)}))&&0!==t.length?(n.svg.selectAll(t.map(function(t){return n.selectorTarget(t)})).transition().style("opacity",0).remove().call(n.endall,e),t.forEach(function(t){n.withoutFadeIn[t]=!1,n.legend&&n.legend.selectAll("."+i.legendItem+n.getTargetSelectorSuffix(t)).remove(),n.data.targets=n.data.targets.filter(function(e){return e.id!==t})})):e()},T.getYDomainMin=function(t){var e,i,n,a,r,s,o=this,c=o.config,d=o.mapToIds(t),u=o.getValuesAsIdKeyed(t);if(c.data_groups.length>0)for(s=o.hasNegativeValueInTargets(t),e=0;e<c.data_groups.length;e++)if(0!==(a=c.data_groups[e].filter(function(t){return d.indexOf(t)>=0})).length)for(n=a[0],s&&u[n]&&u[n].forEach(function(t,e){u[n][e]=t<0?t:0}),i=1;i<a.length;i++)r=a[i],u[r]&&u[r].forEach(function(t,e){o.axis.getId(r)!==o.axis.getId(n)||!u[n]||s&&+t>0||(u[n][e]+=+t)});return o.d3.min(Object.keys(u).map(function(t){return o.d3.min(u[t])}))},T.getYDomainMax=function(t){var e,i,n,a,r,s,o=this,c=o.config,d=o.mapToIds(t),u=o.getValuesAsIdKeyed(t);if(c.data_groups.length>0)for(s=o.hasPositiveValueInTargets(t),e=0;e<c.data_groups.length;e++)if(0!==(a=c.data_groups[e].filter(function(t){return d.indexOf(t)>=0})).length)for(n=a[0],s&&u[n]&&u[n].forEach(function(t,e){u[n][e]=t>0?t:0}),i=1;i<a.length;i++)r=a[i],u[r]&&u[r].forEach(function(t,e){o.axis.getId(r)!==o.axis.getId(n)||!u[n]||s&&+t<0||(u[n][e]+=+t)});return o.d3.max(Object.keys(u).map(function(t){return o.d3.max(u[t])}))},T.getYDomain=function(t,e,i){var n,a,r,o,c,d,u,l,h,g,p=this,x=p.config,y=t.filter(function(t){return p.axis.getId(t.id)===e}),m=i?p.filterByXDomain(y,i):y,S="y2"===e?x.axis_y2_min:x.axis_y_min,w="y2"===e?x.axis_y2_max:x.axis_y_max,v=p.getYDomainMin(m),b=p.getYDomainMax(m),T="y2"===e?x.axis_y2_center:x.axis_y_center,A=p.hasType("bar",m)&&x.bar_zerobased||p.hasType("area",m)&&x.area_zerobased,P="y2"===e?x.axis_y2_inverted:x.axis_y_inverted,C=p.hasDataLabel()&&x.axis_rotated,L=p.hasDataLabel()&&!x.axis_rotated;return v=s(S)?S:s(w)?v<w?v:w-10:v,b=s(w)?w:s(S)?S<b?b:S+10:b,0===m.length?"y2"===e?p.y2.domain():p.y.domain():(isNaN(v)&&(v=0),isNaN(b)&&(b=v),v===b&&(v<0?b=0:v=0),h=v>=0&&b>=0,g=v<=0&&b<=0,(s(S)&&h||s(w)&&g)&&(A=!1),A&&(h&&(v=0),g&&(b=0)),r=o=.1*(a=Math.abs(b-v)),void 0!==T&&(b=T+(c=Math.max(Math.abs(v),Math.abs(b))),v=T-c),C?(d=p.getDataLabelLength(v,b,"width"),u=f(p.y.range()),r+=a*((l=[d[0]/u,d[1]/u])[1]/(1-l[0]-l[1])),o+=a*(l[0]/(1-l[0]-l[1]))):L&&(d=p.getDataLabelLength(v,b,"height"),r+=p.axis.convertPixelsToAxisPadding(d[1],a),o+=p.axis.convertPixelsToAxisPadding(d[0],a)),"y"===e&&_(x.axis_y_padding)&&(r=p.axis.getPadding(x.axis_y_padding,"top",r,a),o=p.axis.getPadding(x.axis_y_padding,"bottom",o,a)),"y2"===e&&_(x.axis_y2_padding)&&(r=p.axis.getPadding(x.axis_y2_padding,"top",r,a),o=p.axis.getPadding(x.axis_y2_padding,"bottom",o,a)),A&&(h&&(o=v),g&&(r=-b)),n=[v-o,b+r],P?n.reverse():n)},T.getXDomainMin=function(t){var e=this,i=e.config;return l(i.axis_x_min)?e.isTimeSeries()?this.parseDate(i.axis_x_min):i.axis_x_min:e.d3.min(t,function(t){return e.d3.min(t.values,function(t){return t.x})})},T.getXDomainMax=function(t){var e=this,i=e.config;return l(i.axis_x_max)?e.isTimeSeries()?this.parseDate(i.axis_x_max):i.axis_x_max:e.d3.max(t,function(t){return e.d3.max(t.values,function(t){return t.x})})},T.getXDomainPadding=function(t){var e,i,a,r,o=this.config,c=t[1]-t[0];return i=this.isCategorized()?0:this.hasType("bar")?(e=this.getMaxDataCount())>1?c/(e-1)/2:.5:.01*c,"object"===n(o.axis_x_padding)&&_(o.axis_x_padding)?(a=s(o.axis_x_padding.left)?o.axis_x_padding.left:i,r=s(o.axis_x_padding.right)?o.axis_x_padding.right:i):a=r="number"==typeof o.axis_x_padding?o.axis_x_padding:i,{left:a,right:r}},T.getXDomain=function(t){var e=this,i=[e.getXDomainMin(t),e.getXDomainMax(t)],n=i[0],a=i[1],r=e.getXDomainPadding(i),s=0,o=0;return n-a!=0||e.isCategorized()||(e.isTimeSeries()?(n=new Date(.5*n.getTime()),a=new Date(1.5*a.getTime())):(n=0===n?1:.5*n,a=0===a?-1:1.5*a)),(n||0===n)&&(s=e.isTimeSeries()?new Date(n.getTime()-r.left):n-r.left),(a||0===a)&&(o=e.isTimeSeries()?new Date(a.getTime()+r.right):a+r.right),[s,o]},T.updateXDomain=function(t,e,i,n,a){var r=this,s=r.config;return i&&(r.x.domain(a||r.d3.extent(r.getXDomain(t))),r.orgXDomain=r.x.domain(),s.zoom_enabled&&r.zoom.update(),r.subX.domain(r.x.domain()),r.brush&&r.brush.updateScale(r.subX)),e&&r.x.domain(a||(!r.brush||r.brush.empty()?r.orgXDomain:r.brush.selectionAsValue())),n&&r.x.domain(r.trimXDomain(r.x.orgDomain())),r.x.domain()},T.trimXDomain=function(t){var e=this.getZoomDomain(),i=e[0],n=e[1];return t[0]<=i&&(t[1]=+t[1]+(i-t[0]),t[0]=i),n<=t[1]&&(t[0]=+t[0]-(t[1]-n),t[1]=n),t},T.drag=function(t){var e,n,a,r,s,o,c,d,u=this,l=u.config,h=u.main,g=u.d3;u.hasArcType()||l.data_selection_enabled&&l.data_selection_multiple&&(e=u.dragStart[0],n=u.dragStart[1],a=t[0],r=t[1],s=Math.min(e,a),o=Math.max(e,a),c=l.data_selection_grouped?u.margin.top:Math.min(n,r),d=l.data_selection_grouped?u.height:Math.max(n,r),h.select("."+i.dragarea).attr("x",s).attr("y",c).attr("width",o-s).attr("height",d-c),h.selectAll("."+i.shapes).selectAll("."+i.shape).filter(function(t){return l.data_selection_isselectable(t)}).each(function(t,e){var n,a,r,l,h,f,p=g.select(this),_=p.classed(i.SELECTED),x=p.classed(i.INCLUDED),y=!1;if(p.classed(i.circle))n=1*p.attr("cx"),a=1*p.attr("cy"),h=u.togglePoint,y=s<n&&n<o&&c<a&&a<d;else{if(!p.classed(i.bar))return;n=(f=S(this)).x,a=f.y,r=f.width,l=f.height,h=u.togglePath,y=!(o<n||n+r<s||d<a||a+l<c)}y^x&&(p.classed(i.INCLUDED,!x),p.classed(i.SELECTED,!_),h.call(u,!_,p,t,e))}))},T.dragstart=function(t){var e=this,n=e.config;e.hasArcType()||n.data_selection_enabled&&(e.dragStart=t,e.main.select("."+i.chart).append("rect").attr("class",i.dragarea).style("opacity",.1),e.dragging=!0)},T.dragend=function(){var t=this,e=t.config;t.hasArcType()||e.data_selection_enabled&&(t.main.select("."+i.dragarea).transition().duration(100).style("opacity",0).remove(),t.main.selectAll("."+i.shape).classed(i.INCLUDED,!1),t.dragging=!1)},T.getYFormat=function(t){var e=this,i=t&&!e.hasType("gauge")?e.defaultArcValueFormat:e.yFormat,n=t&&!e.hasType("gauge")?e.defaultArcValueFormat:e.y2Format;return function(t,a,r){return("y2"===e.axis.getId(r)?n:i).call(e,t,a)}},T.yFormat=function(t){var e=this.config;return(e.axis_y_tick_format?e.axis_y_tick_format:this.defaultValueFormat)(t)},T.y2Format=function(t){var e=this.config;return(e.axis_y2_tick_format?e.axis_y2_tick_format:this.defaultValueFormat)(t)},T.defaultValueFormat=function(t){return s(t)?+t:""},T.defaultArcValueFormat=function(t,e){return(100*e).toFixed(1)+"%"},T.dataLabelFormat=function(t){var e=this.config.data_labels,i=function(t){return s(t)?+t:""};return"function"==typeof e.format?e.format:"object"===n(e.format)?e.format[t]?!0===e.format[t]?i:e.format[t]:function(){return""}:i},T.initGrid=function(){var t=this,e=t.config,n=t.d3;t.grid=t.main.append("g").attr("clip-path",t.clipPathForGrid).attr("class",i.grid),e.grid_x_show&&t.grid.append("g").attr("class",i.xgrids),e.grid_y_show&&t.grid.append("g").attr("class",i.ygrids),e.grid_focus_show&&t.grid.append("g").attr("class",i.xgridFocus).append("line").attr("class",i.xgridFocus),t.xgrid=n.selectAll([]),e.grid_lines_front||t.initGridLines()},T.initGridLines=function(){var t=this,e=t.d3;t.gridLines=t.main.append("g").attr("clip-path",t.clipPathForGrid).attr("class",i.grid+" "+i.gridLines),t.gridLines.append("g").attr("class",i.xgridLines),t.gridLines.append("g").attr("class",i.ygridLines),t.xgridLines=e.selectAll([])},T.updateXGrid=function(t){var e=this,n=e.config,a=e.d3,r=e.generateGridData(n.grid_x_type,e.x),s=e.isCategorized()?e.xAxis.tickOffset():0;e.xgridAttr=n.axis_rotated?{x1:0,x2:e.width,y1:function(t){return e.x(t)-s},y2:function(t){return e.x(t)-s}}:{x1:function(t){return e.x(t)+s},x2:function(t){return e.x(t)+s},y1:0,y2:e.height},e.xgridAttr.opacity=function(){return+a.select(this).attr(n.axis_rotated?"y1":"x1")===(n.axis_rotated?e.height:0)?0:1};var o=e.main.select("."+i.xgrids).selectAll("."+i.xgrid).data(r),c=o.enter().append("line").attr("class",i.xgrid).attr("x1",e.xgridAttr.x1).attr("x2",e.xgridAttr.x2).attr("y1",e.xgridAttr.y1).attr("y2",e.xgridAttr.y2).style("opacity",0);e.xgrid=c.merge(o),t||e.xgrid.attr("x1",e.xgridAttr.x1).attr("x2",e.xgridAttr.x2).attr("y1",e.xgridAttr.y1).attr("y2",e.xgridAttr.y2).style("opacity",e.xgridAttr.opacity),o.exit().remove()},T.updateYGrid=function(){var t=this,e=t.config,n=t.yAxis.tickValues()||t.y.ticks(e.grid_y_ticks),a=t.main.select("."+i.ygrids).selectAll("."+i.ygrid).data(n),r=a.enter().append("line").attr("class",i.ygrid);t.ygrid=r.merge(a),t.ygrid.attr("x1",e.axis_rotated?t.y:0).attr("x2",e.axis_rotated?t.y:t.width).attr("y1",e.axis_rotated?0:t.y).attr("y2",e.axis_rotated?t.height:t.y),a.exit().remove(),t.smoothLines(t.ygrid,"grid")},T.gridTextAnchor=function(t){return t.position?t.position:"end"},T.gridTextDx=function(t){return"start"===t.position?4:"middle"===t.position?0:-4},T.xGridTextX=function(t){return"start"===t.position?-this.height:"middle"===t.position?-this.height/2:0},T.yGridTextX=function(t){return"start"===t.position?0:"middle"===t.position?this.width/2:this.width},T.updateGrid=function(t){var e,n,a,r,s=this,o=s.main,c=s.config,d=s.xv.bind(s),u=s.yv.bind(s),l=s.xGridTextX.bind(s),h=s.yGridTextX.bind(s);s.grid.style("visibility",s.hasArcType()?"hidden":"visible"),o.select("line."+i.xgridFocus).style("visibility","hidden"),c.grid_x_show&&s.updateXGrid(),(n=(e=o.select("."+i.xgridLines).selectAll("."+i.xgridLine).data(c.grid_x_lines)).enter().append("g").attr("class",function(t){return i.xgridLine+(t.class?" "+t.class:"")})).append("line").attr("x1",c.axis_rotated?0:d).attr("x2",c.axis_rotated?s.width:d).attr("y1",c.axis_rotated?d:0).attr("y2",c.axis_rotated?d:s.height).style("opacity",0),n.append("text").attr("text-anchor",s.gridTextAnchor).attr("transform",c.axis_rotated?"":"rotate(-90)").attr("x",c.axis_rotated?h:l).attr("y",d).attr("dx",s.gridTextDx).attr("dy",-5).style("opacity",0),s.xgridLines=n.merge(e),e.exit().transition().duration(t).style("opacity",0).remove(),c.grid_y_show&&s.updateYGrid(),(r=(a=o.select("."+i.ygridLines).selectAll("."+i.ygridLine).data(c.grid_y_lines)).enter().append("g").attr("class",function(t){return i.ygridLine+(t.class?" "+t.class:"")})).append("line").attr("x1",c.axis_rotated?u:0).attr("x2",c.axis_rotated?u:s.width).attr("y1",c.axis_rotated?0:u).attr("y2",c.axis_rotated?s.height:u).style("opacity",0),r.append("text").attr("text-anchor",s.gridTextAnchor).attr("transform",c.axis_rotated?"rotate(-90)":"").attr("x",c.axis_rotated?l:h).attr("y",u).attr("dx",s.gridTextDx).attr("dy",-5).style("opacity",0),s.ygridLines=r.merge(a),s.ygridLines.select("line").transition().duration(t).attr("x1",c.axis_rotated?u:0).attr("x2",c.axis_rotated?u:s.width).attr("y1",c.axis_rotated?0:u).attr("y2",c.axis_rotated?s.height:u).style("opacity",1),s.ygridLines.select("text").transition().duration(t).attr("x",c.axis_rotated?s.xGridTextX.bind(s):s.yGridTextX.bind(s)).attr("y",u).text(function(t){return t.text}).style("opacity",1),a.exit().transition().duration(t).style("opacity",0).remove()},T.redrawGrid=function(t,e){var i=this,n=i.config,a=i.xv.bind(i),r=i.xgridLines.select("line"),s=i.xgridLines.select("text");return[(t?r.transition(e):r).attr("x1",n.axis_rotated?0:a).attr("x2",n.axis_rotated?i.width:a).attr("y1",n.axis_rotated?a:0).attr("y2",n.axis_rotated?a:i.height).style("opacity",1),(t?s.transition(e):s).attr("x",n.axis_rotated?i.yGridTextX.bind(i):i.xGridTextX.bind(i)).attr("y",a).text(function(t){return t.text}).style("opacity",1)]},T.showXGridFocus=function(t){var e=this,n=e.config,a=t.filter(function(t){return t&&s(t.value)}),r=e.main.selectAll("line."+i.xgridFocus),o=e.xx.bind(e);n.tooltip_show&&(e.hasType("scatter")||e.hasArcType()||(r.style("visibility","visible").data([a[0]]).attr(n.axis_rotated?"y1":"x1",o).attr(n.axis_rotated?"y2":"x2",o),e.smoothLines(r,"grid")))},T.hideXGridFocus=function(){this.main.select("line."+i.xgridFocus).style("visibility","hidden")},T.updateXgridFocus=function(){var t=this.config;this.main.select("line."+i.xgridFocus).attr("x1",t.axis_rotated?0:-10).attr("x2",t.axis_rotated?this.width:-10).attr("y1",t.axis_rotated?-10:0).attr("y2",t.axis_rotated?-10:this.height)},T.generateGridData=function(t,e){var n,a,r,s,o=[],c=this.main.select("."+i.axisX).selectAll(".tick").size();if("year"===t)for(a=(n=this.getXDomain())[0].getFullYear(),r=n[1].getFullYear(),s=a;s<=r;s++)o.push(new Date(s+"-01-01 00:00:00"));else(o=e.ticks(10)).length>c&&(o=o.filter(function(t){return(""+t).indexOf(".")<0}));return o},T.getGridFilterToRemove=function(t){return t?function(e){var i=!1;return[].concat(t).forEach(function(t){("value"in t&&e.value===t.value||"class"in t&&e.class===t.class)&&(i=!0)}),i}:function(){return!0}},T.removeGridLines=function(t,e){var n=this.config,a=this.getGridFilterToRemove(t),r=function(t){return!a(t)},s=e?i.xgridLines:i.ygridLines,o=e?i.xgridLine:i.ygridLine;this.main.select("."+s).selectAll("."+o).filter(a).transition().duration(n.transition_duration).style("opacity",0).remove(),e?n.grid_x_lines=n.grid_x_lines.filter(r):n.grid_y_lines=n.grid_y_lines.filter(r)},T.initEventRect=function(){var t=this,e=t.config;t.main.select("."+i.chart).append("g").attr("class",i.eventRects).style("fill-opacity",0),t.eventRect=t.main.select("."+i.eventRects).append("rect").attr("class",i.eventRect),e.zoom_enabled&&t.zoom&&(t.eventRect.call(t.zoom).on("dblclick.zoom",null),e.zoom_initialRange&&t.eventRect.transition().duration(0).call(t.zoom.transform,t.zoomTransform(e.zoom_initialRange)))},T.redrawEventRect=function(){var t,e,n=this,a=n.d3,r=n.config;function s(){n.svg.select("."+i.eventRect).style("cursor",null),n.hideXGridFocus(),n.hideTooltip(),n.unexpandCircles(),n.unexpandBars()}t=n.width,e=n.height,n.main.select("."+i.eventRects).style("cursor",r.zoom_enabled?r.axis_rotated?"ns-resize":"ew-resize":null),n.eventRect.attr("x",0).attr("y",0).attr("width",t).attr("height",e).on("mouseout",r.interaction_enabled?function(){r&&(n.hasArcType()||s())}:null).on("mousemove",r.interaction_enabled?function(){var t,e,o,c;n.dragging||n.hasArcType(t)||(t=n.filterTargetsToShow(n.data.targets),e=a.mouse(this),o=n.findClosestFromTargets(t,e),!n.mouseover||o&&o.id===n.mouseover.id||(r.data_onmouseout.call(n.api,n.mouseover),n.mouseover=void 0),o?(c=(n.isScatterType(o)||!r.tooltip_grouped?[o]:n.filterByX(t,o.x)).map(function(t){return n.addName(t)}),n.showTooltip(c,this),r.point_focus_expand_enabled&&(n.unexpandCircles(),c.forEach(function(t){n.expandCircles(t.index,t.id,!1)})),n.expandBars(o.index,o.id,!0),n.showXGridFocus(c),(n.isBarType(o.id)||n.dist(o,e)<r.point_sensitivity)&&(n.svg.select("."+i.eventRect).style("cursor","pointer"),n.mouseover||(r.data_onmouseover.call(n.api,o),n.mouseover=o))):s())}:null).on("click",r.interaction_enabled?function(){var t,e,s;n.hasArcType(t)||(t=n.filterTargetsToShow(n.data.targets),e=a.mouse(this),(s=n.findClosestFromTargets(t,e))&&(n.isBarType(s.id)||n.dist(s,e)<r.point_sensitivity)&&(n.isScatterType(s)||!r.data_selection_grouped?[s]:n.filterByX(t,s.x)).forEach(function(t){n.main.selectAll("."+i.shapes+n.getTargetSelectorSuffix(t.id)).selectAll("."+i.shape+"-"+t.index).each(function(){(r.data_selection_grouped||n.isWithinShape(this,t))&&(n.toggleShape(this,t,t.index),r.data_onclick.call(n.api,t,this))})}))}:null).call(r.interaction_enabled&&r.data_selection_draggable&&n.drag?a.drag().on("drag",function(){n.drag(a.mouse(this))}).on("start",function(){n.dragstart(a.mouse(this))}).on("end",function(){n.dragend()}):function(){})},T.getMousePosition=function(t){return[this.x(t.x),this.getYScale(t.id)(t.value)]},T.dispatchEvent=function(t,e){var n="."+i.eventRect,a=this.main.select(n).node(),r=a.getBoundingClientRect(),s=r.left+(e?e[0]:0),o=r.top+(e?e[1]:0),c=document.createEvent("MouseEvents");c.initMouseEvent(t,!0,!0,window,0,s,o,s,o,!1,!1,!1,!1,0,null),a.dispatchEvent(c)},T.initLegend=function(){var t=this;if(t.legendItemTextBox={},t.legendHasRendered=!1,t.legend=t.svg.append("g").attr("transform",t.getTranslate("legend")),!t.config.legend_show)return t.legend.style("visibility","hidden"),void(t.hiddenLegendIds=t.mapToIds(t.data.targets));t.updateLegendWithDefaults()},T.updateLegendWithDefaults=function(){this.updateLegend(this.mapToIds(this.data.targets),{withTransform:!1,withTransitionForTransform:!1,withTransition:!1})},T.updateSizeForLegend=function(t,e){var i=this,n=i.config,a={top:i.isLegendTop?i.getCurrentPaddingTop()+n.legend_inset_y+5.5:i.currentHeight-t-i.getCurrentPaddingBottom()-n.legend_inset_y,left:i.isLegendLeft?i.getCurrentPaddingLeft()+n.legend_inset_x+.5:i.currentWidth-e-i.getCurrentPaddingRight()-n.legend_inset_x+.5};i.margin3={top:i.isLegendRight?0:i.isLegendInset?a.top:i.currentHeight-t,right:NaN,bottom:0,left:i.isLegendRight?i.currentWidth-e:i.isLegendInset?a.left:0}},T.transformLegend=function(t){(t?this.legend.transition():this.legend).attr("transform",this.getTranslate("legend"))},T.updateLegendStep=function(t){this.legendStep=t},T.updateLegendItemWidth=function(t){this.legendItemWidth=t},T.updateLegendItemHeight=function(t){this.legendItemHeight=t},T.getLegendWidth=function(){var t=this;return t.config.legend_show?t.isLegendRight||t.isLegendInset?t.legendItemWidth*(t.legendStep+1):t.currentWidth:0},T.getLegendHeight=function(){var t=this,e=0;return t.config.legend_show&&(e=t.isLegendRight?t.currentHeight:Math.max(20,t.legendItemHeight)*(t.legendStep+1)),e},T.opacityForLegend=function(t){return t.classed(i.legendItemHidden)?null:1},T.opacityForUnfocusedLegend=function(t){return t.classed(i.legendItemHidden)?null:.3},T.toggleFocusLegend=function(t,e){var n=this;t=n.mapToTargetIds(t),n.legend.selectAll("."+i.legendItem).filter(function(e){return t.indexOf(e)>=0}).classed(i.legendItemFocused,e).transition().duration(100).style("opacity",function(){return(e?n.opacityForLegend:n.opacityForUnfocusedLegend).call(n,n.d3.select(this))})},T.revertLegend=function(){var t=this,e=t.d3;t.legend.selectAll("."+i.legendItem).classed(i.legendItemFocused,!1).transition().duration(100).style("opacity",function(){return t.opacityForLegend(e.select(this))})},T.showLegend=function(t){var e=this,i=e.config;i.legend_show||(i.legend_show=!0,e.legend.style("visibility","visible"),e.legendHasRendered||e.updateLegendWithDefaults()),e.removeHiddenLegendIds(t),e.legend.selectAll(e.selectorLegends(t)).style("visibility","visible").transition().style("opacity",function(){return e.opacityForLegend(e.d3.select(this))})},T.hideLegend=function(t){var e=this,i=e.config;i.legend_show&&p(t)&&(i.legend_show=!1,e.legend.style("visibility","hidden")),e.addHiddenLegendIds(t),e.legend.selectAll(e.selectorLegends(t)).style("opacity",0).style("visibility","hidden")},T.clearLegendItemTextBoxCache=function(){this.legendItemTextBox={}},T.updateLegend=function(t,e,n){var a,r,s,o,c,d,u,h,g,f,p,_,y,m,S,w,v=this,b=v.config,T=4,A=10,P=0,C=0,L=10,V=b.legend_item_tile_width+5,G=0,E={},O={},I={},R=[0],k={},D=0;function F(e,n,a){var r,s,o,c,d=0===a,u=a===t.length-1,l=(o=e,c=n,v.legendItemTextBox[c]||(v.legendItemTextBox[c]=v.getTextRect(o.textContent,i.legendItem,o)),v.legendItemTextBox[c]),h=l.width+V+(!u||v.isLegendRight||v.isLegendInset?A:0)+b.legend_padding,g=l.height+T,f=v.isLegendRight||v.isLegendInset?g:h,p=v.isLegendRight||v.isLegendInset?v.getLegendHeight():v.getLegendWidth();function _(t,e){e||(r=(p-G-f)/2)<L&&(r=(p-f)/2,G=0,D++),k[t]=D,R[D]=v.isLegendInset?10:r,E[t]=G,G+=f}d&&(G=0,D=0,P=0,C=0),!b.legend_show||v.isLegendToShow(n)?(O[n]=h,I[n]=g,(!P||h>=P)&&(P=h),(!C||g>=C)&&(C=g),s=v.isLegendRight||v.isLegendInset?C:P,b.legend_equally?(Object.keys(O).forEach(function(t){O[t]=P}),Object.keys(I).forEach(function(t){I[t]=C}),(r=(p-s*t.length)/2)<L?(G=0,D=0,t.forEach(function(t){_(t)})):_(n,!0)):_(n)):O[n]=I[n]=k[n]=E[n]=0}t=t.filter(function(t){return!l(b.data_names[t])||null!==b.data_names[t]}),p=x(e=e||{},"withTransition",!0),_=x(e,"withTransitionForTransform",!0),v.isLegendInset&&(D=b.legend_inset_step?b.legend_inset_step:t.length,v.updateLegendStep(D)),v.isLegendRight?(a=function(t){return P*k[t]},o=function(t){return R[k[t]]+E[t]}):v.isLegendInset?(a=function(t){return P*k[t]+10},o=function(t){return R[k[t]]+E[t]}):(a=function(t){return R[k[t]]+E[t]},o=function(t){return C*k[t]}),r=function(t,e){return a(t,e)+4+b.legend_item_tile_width},c=function(t,e){return o(t,e)+9},s=function(t,e){return a(t,e)},d=function(t,e){return o(t,e)-5},u=function(t,e){return a(t,e)-2},h=function(t,e){return a(t,e)-2+b.legend_item_tile_width},g=function(t,e){return o(t,e)+4},(f=v.legend.selectAll("."+i.legendItem).data(t).enter().append("g").attr("class",function(t){return v.generateClass(i.legendItem,t)}).style("visibility",function(t){return v.isLegendToShow(t)?"visible":"hidden"}).style("cursor","pointer").on("click",function(t){b.legend_item_onclick?b.legend_item_onclick.call(v,t):v.d3.event.altKey?(v.api.hide(),v.api.show(t)):(v.api.toggle(t),v.isTargetToShow(t)?v.api.focus(t):v.api.revert())}).on("mouseover",function(t){b.legend_item_onmouseover?b.legend_item_onmouseover.call(v,t):(v.d3.select(this).classed(i.legendItemFocused,!0),!v.transiting&&v.isTargetToShow(t)&&v.api.focus(t))}).on("mouseout",function(t){b.legend_item_onmouseout?b.legend_item_onmouseout.call(v,t):(v.d3.select(this).classed(i.legendItemFocused,!1),v.api.revert())})).append("text").text(function(t){return l(b.data_names[t])?b.data_names[t]:t}).each(function(t,e){F(this,t,e)}).style("pointer-events","none").attr("x",v.isLegendRight||v.isLegendInset?r:-200).attr("y",v.isLegendRight||v.isLegendInset?-200:c),f.append("rect").attr("class",i.legendItemEvent).style("fill-opacity",0).attr("x",v.isLegendRight||v.isLegendInset?s:-200).attr("y",v.isLegendRight||v.isLegendInset?-200:d),f.append("line").attr("class",i.legendItemTile).style("stroke",v.color).style("pointer-events","none").attr("x1",v.isLegendRight||v.isLegendInset?u:-200).attr("y1",v.isLegendRight||v.isLegendInset?-200:g).attr("x2",v.isLegendRight||v.isLegendInset?h:-200).attr("y2",v.isLegendRight||v.isLegendInset?-200:g).attr("stroke-width",b.legend_item_tile_height),w=v.legend.select("."+i.legendBackground+" rect"),v.isLegendInset&&P>0&&0===w.size()&&(w=v.legend.insert("g","."+i.legendItem).attr("class",i.legendBackground).append("rect")),y=v.legend.selectAll("text").data(t).text(function(t){return l(b.data_names[t])?b.data_names[t]:t}).each(function(t,e){F(this,t,e)}),(p?y.transition():y).attr("x",r).attr("y",c),m=v.legend.selectAll("rect."+i.legendItemEvent).data(t),(p?m.transition():m).attr("width",function(t){return O[t]}).attr("height",function(t){return I[t]}).attr("x",s).attr("y",d),S=v.legend.selectAll("line."+i.legendItemTile).data(t),(p?S.transition():S).style("stroke",v.levelColor?function(t){return v.levelColor(v.cache[t].values[0].value)}:v.color).attr("x1",u).attr("y1",g).attr("x2",h).attr("y2",g),w&&(p?w.transition():w).attr("height",v.getLegendHeight()-12).attr("width",P*(D+1)+10),v.legend.selectAll("."+i.legendItem).classed(i.legendItemHidden,function(t){return!v.isTargetToShow(t)}),v.updateLegendItemWidth(P),v.updateLegendItemHeight(C),v.updateLegendStep(D),v.updateSizes(),v.updateScales(),v.updateSvgSize(),v.transformAll(_,n),v.legendHasRendered=!0},T.initRegion=function(){this.region=this.main.append("g").attr("clip-path",this.clipPath).attr("class",i.regions)},T.updateRegion=function(t){var e=this,n=e.config;e.region.style("visibility",e.hasArcType()?"hidden":"visible");var a=e.main.select("."+i.regions).selectAll("."+i.region).data(n.regions),r=a.enter().append("rect").attr("x",e.regionX.bind(e)).attr("y",e.regionY.bind(e)).attr("width",e.regionWidth.bind(e)).attr("height",e.regionHeight.bind(e)).style("fill-opacity",0);e.mainRegion=r.merge(a).attr("class",e.classRegion.bind(e)),a.exit().transition().duration(t).style("opacity",0).remove()},T.redrawRegion=function(t,e){var i=this,n=i.mainRegion;return[(t?n.transition(e):n).attr("x",i.regionX.bind(i)).attr("y",i.regionY.bind(i)).attr("width",i.regionWidth.bind(i)).attr("height",i.regionHeight.bind(i)).style("fill-opacity",function(t){return s(t.opacity)?t.opacity:.1})]},T.regionX=function(t){var e=this,i=e.config,n="y"===t.axis?e.y:e.y2;return"y"===t.axis||"y2"===t.axis?i.axis_rotated&&"start"in t?n(t.start):0:i.axis_rotated?0:"start"in t?e.x(e.isTimeSeries()?e.parseDate(t.start):t.start):0},T.regionY=function(t){var e=this,i=e.config,n="y"===t.axis?e.y:e.y2;return"y"===t.axis||"y2"===t.axis?i.axis_rotated?0:"end"in t?n(t.end):0:i.axis_rotated&&"start"in t?e.x(e.isTimeSeries()?e.parseDate(t.start):t.start):0},T.regionWidth=function(t){var e,i=this,n=i.config,a=i.regionX(t),r="y"===t.axis?i.y:i.y2;return(e="y"===t.axis||"y2"===t.axis?n.axis_rotated&&"end"in t?r(t.end):i.width:n.axis_rotated?i.width:"end"in t?i.x(i.isTimeSeries()?i.parseDate(t.end):t.end):i.width)<a?0:e-a},T.regionHeight=function(t){var e,i=this,n=i.config,a=this.regionY(t),r="y"===t.axis?i.y:i.y2;return(e="y"===t.axis||"y2"===t.axis?n.axis_rotated?i.height:"start"in t?r(t.start):i.height:n.axis_rotated&&"end"in t?i.x(i.isTimeSeries()?i.parseDate(t.end):t.end):i.height)<a?0:e-a},T.isRegionOnX=function(t){return!t.axis||"x"===t.axis},T.getScale=function(t,e,i){return(i?this.d3.scaleTime():this.d3.scaleLinear()).range([t,e])},T.getX=function(t,e,i,n){var a,r=this.getScale(t,e,this.isTimeSeries()),s=i?r.domain(i):r;for(a in this.isCategorized()?(n=n||function(){return 0},r=function(t,e){var i=s(t)+n(t);return e?i:Math.ceil(i)}):r=function(t,e){var i=s(t);return e?i:Math.ceil(i)},s)r[a]=s[a];return r.orgDomain=function(){return s.domain()},this.isCategorized()&&(r.domain=function(t){return arguments.length?(s.domain(t),r):[(t=this.orgDomain())[0],t[1]+1]}),r},T.getY=function(t,e,i){var n=this.getScale(t,e,this.isTimeSeriesY());return i&&n.domain(i),n},T.getYScale=function(t){return"y2"===this.axis.getId(t)?this.y2:this.y},T.getSubYScale=function(t){return"y2"===this.axis.getId(t)?this.subY2:this.subY},T.updateScales=function(){var t=this,e=t.config,i=!t.x;t.xMin=e.axis_rotated?1:0,t.xMax=e.axis_rotated?t.height:t.width,t.yMin=e.axis_rotated?0:t.height,t.yMax=e.axis_rotated?t.width:1,t.subXMin=t.xMin,t.subXMax=t.xMax,t.subYMin=e.axis_rotated?0:t.height2,t.subYMax=e.axis_rotated?t.width2:1,t.x=t.getX(t.xMin,t.xMax,i?void 0:t.x.orgDomain(),function(){return t.xAxis.tickOffset()}),t.y=t.getY(t.yMin,t.yMax,i?e.axis_y_default:t.y.domain()),t.y2=t.getY(t.yMin,t.yMax,i?e.axis_y2_default:t.y2.domain()),t.subX=t.getX(t.xMin,t.xMax,t.orgXDomain,function(e){return e%1?0:t.subXAxis.tickOffset()}),t.subY=t.getY(t.subYMin,t.subYMax,i?e.axis_y_default:t.subY.domain()),t.subY2=t.getY(t.subYMin,t.subYMax,i?e.axis_y2_default:t.subY2.domain()),t.xAxisTickFormat=t.axis.getXAxisTickFormat(),t.xAxisTickValues=t.axis.getXAxisTickValues(),t.yAxisTickValues=t.axis.getYAxisTickValues(),t.y2AxisTickValues=t.axis.getY2AxisTickValues(),t.xAxis=t.axis.getXAxis(t.x,t.xOrient,t.xAxisTickFormat,t.xAxisTickValues,e.axis_x_tick_outer),t.subXAxis=t.axis.getXAxis(t.subX,t.subXOrient,t.xAxisTickFormat,t.xAxisTickValues,e.axis_x_tick_outer),t.yAxis=t.axis.getYAxis(t.y,t.yOrient,e.axis_y_tick_format,t.yAxisTickValues,e.axis_y_tick_outer),t.y2Axis=t.axis.getYAxis(t.y2,t.y2Orient,e.axis_y2_tick_format,t.y2AxisTickValues,e.axis_y2_tick_outer),i||t.brush&&t.brush.updateScale(t.subX),t.updateArc&&t.updateArc()},T.selectPoint=function(t,e,n){var a=this,r=a.config,s=(r.axis_rotated?a.circleY:a.circleX).bind(a),o=(r.axis_rotated?a.circleX:a.circleY).bind(a),c=a.pointSelectR.bind(a);r.data_onselected.call(a.api,e,t.node()),a.main.select("."+i.selectedCircles+a.getTargetSelectorSuffix(e.id)).selectAll("."+i.selectedCircle+"-"+n).data([e]).enter().append("circle").attr("class",function(){return a.generateClass(i.selectedCircle,n)}).attr("cx",s).attr("cy",o).attr("stroke",function(){return a.color(e)}).attr("r",function(t){return 1.4*a.pointSelectR(t)}).transition().duration(100).attr("r",c)},T.unselectPoint=function(t,e,n){this.config.data_onunselected.call(this.api,e,t.node()),this.main.select("."+i.selectedCircles+this.getTargetSelectorSuffix(e.id)).selectAll("."+i.selectedCircle+"-"+n).transition().duration(100).attr("r",0).remove()},T.togglePoint=function(t,e,i,n){t?this.selectPoint(e,i,n):this.unselectPoint(e,i,n)},T.selectPath=function(t,e){var i=this;i.config.data_onselected.call(i,e,t.node()),i.config.interaction_brighten&&t.transition().duration(100).style("fill",function(){return i.d3.rgb(i.color(e)).brighter(.75)})},T.unselectPath=function(t,e){var i=this;i.config.data_onunselected.call(i,e,t.node()),i.config.interaction_brighten&&t.transition().duration(100).style("fill",function(){return i.color(e)})},T.togglePath=function(t,e,i,n){t?this.selectPath(e,i,n):this.unselectPath(e,i,n)},T.getToggle=function(t,e){var i;return"circle"===t.nodeName?i=this.isStepType(e)?function(){}:this.togglePoint:"path"===t.nodeName&&(i=this.togglePath),i},T.toggleShape=function(t,e,n){var a=this,r=a.d3,s=a.config,o=r.select(t),c=o.classed(i.SELECTED),d=a.getToggle(t,e).bind(a);s.data_selection_enabled&&s.data_selection_isselectable(e)&&(s.data_selection_multiple||a.main.selectAll("."+i.shapes+(s.data_selection_grouped?a.getTargetSelectorSuffix(e.id):"")).selectAll("."+i.shape).each(function(t,e){var n=r.select(this);n.classed(i.SELECTED)&&d(!1,n.classed(i.SELECTED,!1),t,e)}),o.classed(i.SELECTED,!c),d(!c,o,e,n))},T.initBar=function(){this.main.select("."+i.chart).append("g").attr("class",i.chartBars)},T.updateTargetsForBar=function(t){var e=this,n=e.config,a=e.classChartBar.bind(e),r=e.classBars.bind(e),s=e.classFocus.bind(e);e.main.select("."+i.chartBars).selectAll("."+i.chartBar).data(t).attr("class",function(t){return a(t)+s(t)}).enter().append("g").attr("class",a).style("pointer-events","none").append("g").attr("class",r).style("cursor",function(t){return n.data_selection_isselectable(t)?"pointer":null})},T.updateBar=function(t){var e=this,n=e.barData.bind(e),a=e.classBar.bind(e),r=e.initialOpacity.bind(e),s=function(t){return e.color(t.id)},o=e.main.selectAll("."+i.bars).selectAll("."+i.bar).data(n),c=o.enter().append("path").attr("class",a).style("stroke",s).style("fill",s);e.mainBar=c.merge(o).style("opacity",r),o.exit().transition().duration(t).style("opacity",0)},T.redrawBar=function(t,e,i){return[(e?this.mainBar.transition(i):this.mainBar).attr("d",t).style("stroke",this.color).style("fill",this.color).style("opacity",1)]},T.getBarW=function(t,e){var i=this.config,n="number"==typeof i.bar_width?i.bar_width:e?t.tickInterval()*i.bar_width_ratio/e:0;return i.bar_width_max&&n>i.bar_width_max?i.bar_width_max:n},T.getBars=function(t,e){return(e?this.main.selectAll("."+i.bars+this.getTargetSelectorSuffix(e)):this.main).selectAll("."+i.bar+(s(t)?"-"+t:""))},T.expandBars=function(t,e,n){n&&this.unexpandBars(),this.getBars(t,e).classed(i.EXPANDED,!0)},T.unexpandBars=function(t){this.getBars(t).classed(i.EXPANDED,!1)},T.generateDrawBar=function(t,e){var i=this.config,n=this.generateGetBarPoints(t,e);return function(t,e){var a=n(t,e),r=i.axis_rotated?1:0,s=i.axis_rotated?0:1;return"M "+a[0][r]+","+a[0][s]+" L"+a[1][r]+","+a[1][s]+" L"+a[2][r]+","+a[2][s]+" L"+a[3][r]+","+a[3][s]+" z"}},T.generateGetBarPoints=function(t,e){var i=this,n=e?i.subXAxis:i.xAxis,a=t.__max__+1,r=i.getBarW(n,a),s=i.getShapeX(r,a,t,!!e),o=i.getShapeY(!!e),c=i.getShapeOffset(i.isBarType,t,!!e),d=r*(i.config.bar_space/2),u=e?i.getSubYScale:i.getYScale;return function(t,e){var n=u.call(i,t.id)(0),a=c(t,e)||n,l=s(t),h=o(t);return i.config.axis_rotated&&(0<t.value&&h<n||t.value<0&&n<h)&&(h=n),[[l+d,a],[l+d,h-(n-a)],[l+r-d,h-(n-a)],[l+r-d,a]]}},T.isWithinBar=function(t,e){var i=e.getBoundingClientRect(),n=e.pathSegList.getItem(0),a=e.pathSegList.getItem(1),r=Math.min(n.x,a.x),s=Math.min(n.y,a.y),o=r+i.width+2,c=s+i.height+2,d=s-2;return r-2<t[0]&&t[0]<o&&d<t[1]&&t[1]<c},T.getShapeIndices=function(t){var e,i,n=this.config,a={},r=0;return this.filterTargetsToShow(this.data.targets.filter(t,this)).forEach(function(t){for(e=0;e<n.data_groups.length;e++)if(!(n.data_groups[e].indexOf(t.id)<0))for(i=0;i<n.data_groups[e].length;i++)if(n.data_groups[e][i]in a){a[t.id]=a[n.data_groups[e][i]];break}u(a[t.id])&&(a[t.id]=r++)}),a.__max__=r-1,a},T.getShapeX=function(t,e,i,n){var a=n?this.subX:this.x;return function(n){var r=n.id in i?i[n.id]:0;return n.x||0===n.x?a(n.x)-t*(e/2-r):0}},T.getShapeY=function(t){var e=this;return function(i){return(t?e.getSubYScale(i.id):e.getYScale(i.id))(i.value)}},T.getShapeOffset=function(t,e,i){var n=this,a=n.orderTargets(n.filterTargetsToShow(n.data.targets.filter(t,n))),r=a.map(function(t){return t.id});return function(t,s){var o=i?n.getSubYScale(t.id):n.getYScale(t.id),c=o(0),d=c;return a.forEach(function(i){var a=n.isStepType(t)?n.convertValuesToStep(i.values):i.values;i.id!==t.id&&e[i.id]===e[t.id]&&r.indexOf(i.id)<r.indexOf(t.id)&&(void 0!==a[s]&&+a[s].x==+t.x||(s=-1,a.forEach(function(e,i){e.x===t.x&&(s=i)})),s in a&&a[s].value*t.value>=0&&(d+=o(a[s].value)-c))}),d}},T.isWithinShape=function(t,e){var n,a=this,r=a.d3.select(t);return a.isTargetToShow(e.id)?"circle"===t.nodeName?n=a.isStepType(e)?a.isWithinStep(t,a.getYScale(e.id)(e.value)):a.isWithinCircle(t,1.5*a.pointSelectR(e)):"path"===t.nodeName&&(n=!r.classed(i.bar)||a.isWithinBar(a.d3.mouse(t),t)):n=!1,n},T.getInterpolate=function(t){var e=this,i=e.d3,n={linear:i.curveLinear,"linear-closed":i.curveLinearClosed,basis:i.curveBasis,"basis-open":i.curveBasisOpen,"basis-closed":i.curveBasisClosed,bundle:i.curveBundle,cardinal:i.curveCardinal,"cardinal-open":i.curveCardinalOpen,"cardinal-closed":i.curveCardinalClosed,monotone:i.curveMonotoneX,step:i.curveStep};return e.isSplineType(t)?n[e.config.spline_interpolation_type]||n.cardinal:e.isStepType(t)?n[e.config.line_step_type]:n.linear},T.initLine=function(){this.main.select("."+i.chart).append("g").attr("class",i.chartLines)},T.updateTargetsForLine=function(t){var e,n=this,a=n.config,r=n.classChartLine.bind(n),s=n.classLines.bind(n),o=n.classAreas.bind(n),c=n.classCircles.bind(n),d=n.classFocus.bind(n);(e=n.main.select("."+i.chartLines).selectAll("."+i.chartLine).data(t).attr("class",function(t){return r(t)+d(t)}).enter().append("g").attr("class",r).style("opacity",0).style("pointer-events","none")).append("g").attr("class",s),e.append("g").attr("class",o),e.append("g").attr("class",function(t){return n.generateClass(i.selectedCircles,t.id)}),e.append("g").attr("class",c).style("cursor",function(t){return a.data_selection_isselectable(t)?"pointer":null}),t.forEach(function(t){n.main.selectAll("."+i.selectedCircles+n.getTargetSelectorSuffix(t.id)).selectAll("."+i.selectedCircle).each(function(e){e.value=t.values[e.index].value})})},T.updateLine=function(t){var e=this,n=e.main.selectAll("."+i.lines).selectAll("."+i.line).data(e.lineData.bind(e)),a=n.enter().append("path").attr("class",e.classLine.bind(e)).style("stroke",e.color);e.mainLine=a.merge(n).style("opacity",e.initialOpacity.bind(e)).style("shape-rendering",function(t){return e.isStepType(t)?"crispEdges":""}).attr("transform",null),n.exit().transition().duration(t).style("opacity",0)},T.redrawLine=function(t,e,i){return[(e?this.mainLine.transition(i):this.mainLine).attr("d",t).style("stroke",this.color).style("opacity",1)]},T.generateDrawLine=function(t,e){var i=this,n=i.config,a=i.d3.line(),r=i.generateGetLinePoints(t,e),s=e?i.getSubYScale:i.getYScale,o=function(t){return(e?i.subxx:i.xx).call(i,t)},c=function(t,e){return n.data_groups.length>0?r(t,e)[0][1]:s.call(i,t.id)(t.value)};return a=n.axis_rotated?a.x(c).y(o):a.x(o).y(c),n.line_connectNull||(a=a.defined(function(t){return null!=t.value})),function(t){var r,o=n.line_connectNull?i.filterRemoveNull(t.values):t.values,c=e?i.subX:i.x,d=s.call(i,t.id),u=0,l=0;return i.isLineType(t)?n.data_regions[t.id]?r=i.lineWithRegions(o,c,d,n.data_regions[t.id]):(i.isStepType(t)&&(o=i.convertValuesToStep(o)),r=a.curve(i.getInterpolate(t))(o)):(o[0]&&(u=c(o[0].x),l=d(o[0].value)),r=n.axis_rotated?"M "+l+" "+u:"M "+u+" "+l),r||"M 0 0"}},T.generateGetLinePoints=function(t,e){var i=this,n=i.config,a=t.__max__+1,r=i.getShapeX(0,a,t,!!e),s=i.getShapeY(!!e),o=i.getShapeOffset(i.isLineType,t,!!e),c=e?i.getSubYScale:i.getYScale;return function(t,e){var a=c.call(i,t.id)(0),d=o(t,e)||a,u=r(t),l=s(t);return n.axis_rotated&&(0<t.value&&l<a||t.value<0&&a<l)&&(l=a),[[u,l-(a-d)],[u,l-(a-d)],[u,l-(a-d)],[u,l-(a-d)]]}},T.lineWithRegions=function(t,e,i,n){var a,r,s,o,c,d,h,g,f,p,_,x=this,y=x.config,m="M",S=x.isCategorized()?.5:0,w=[];function v(t,e){var i;for(i=0;i<e.length;i++)if(e[i].start<t&&t<=e[i].end)return!0;return!1}if(l(n))for(a=0;a<n.length;a++)w[a]={},u(n[a].start)?w[a].start=t[0].x:w[a].start=x.isTimeSeries()?x.parseDate(n[a].start):n[a].start,u(n[a].end)?w[a].end=t[t.length-1].x:w[a].end=x.isTimeSeries()?x.parseDate(n[a].end):n[a].end;function b(t){return"M"+t[0][0]+" "+t[0][1]+" "+t[1][0]+" "+t[1][1]}for(p=y.axis_rotated?function(t){return i(t.value)}:function(t){return e(t.x)},_=y.axis_rotated?function(t){return e(t.x)}:function(t){return i(t.value)},s=x.isTimeSeries()?function(t,n,a,r){var s=t.x.getTime(),o=n.x-t.x,d=new Date(s+o*a),u=new Date(s+o*(a+r));return b(y.axis_rotated?[[i(c(a)),e(d)],[i(c(a+r)),e(u)]]:[[e(d),i(c(a))],[e(u),i(c(a+r))]])}:function(t,n,a,r){return b(y.axis_rotated?[[i(c(a),!0),e(o(a))],[i(c(a+r),!0),e(o(a+r))]]:[[e(o(a),!0),i(c(a))],[e(o(a+r),!0),i(c(a+r))]])},a=0;a<t.length;a++){if(u(w)||!v(t[a].x,w))m+=" "+p(t[a])+" "+_(t[a]);else for(o=x.getScale(t[a-1].x+S,t[a].x+S,x.isTimeSeries()),c=x.getScale(t[a-1].value,t[a].value),d=e(t[a].x)-e(t[a-1].x),h=i(t[a].value)-i(t[a-1].value),f=2*(g=2/Math.sqrt(Math.pow(d,2)+Math.pow(h,2))),r=g;r<=1;r+=f)m+=s(t[a-1],t[a],r,g);t[a].x}return m},T.updateArea=function(t){var e=this,n=e.d3,a=e.main.selectAll("."+i.areas).selectAll("."+i.area).data(e.lineData.bind(e)),r=a.enter().append("path").attr("class",e.classArea.bind(e)).style("fill",e.color).style("opacity",function(){return e.orgAreaOpacity=+n.select(this).style("opacity"),0});e.mainArea=r.merge(a).style("opacity",e.orgAreaOpacity),a.exit().transition().duration(t).style("opacity",0)},T.redrawArea=function(t,e,i){return[(e?this.mainArea.transition(i):this.mainArea).attr("d",t).style("fill",this.color).style("opacity",this.orgAreaOpacity)]},T.generateDrawArea=function(t,e){var i=this,n=i.config,a=i.d3.area(),r=i.generateGetAreaPoints(t,e),s=e?i.getSubYScale:i.getYScale,o=function(t){return(e?i.subxx:i.xx).call(i,t)},c=function(t,e){return n.data_groups.length>0?r(t,e)[0][1]:s.call(i,t.id)(i.getAreaBaseValue(t.id))},d=function(t,e){return n.data_groups.length>0?r(t,e)[1][1]:s.call(i,t.id)(t.value)};return a=n.axis_rotated?a.x0(c).x1(d).y(o):a.x(o).y0(n.area_above?0:c).y1(d),n.line_connectNull||(a=a.defined(function(t){return null!==t.value})),function(t){var e,r=n.line_connectNull?i.filterRemoveNull(t.values):t.values,s=0,o=0;return i.isAreaType(t)?(i.isStepType(t)&&(r=i.convertValuesToStep(r)),e=a.curve(i.getInterpolate(t))(r)):(r[0]&&(s=i.x(r[0].x),o=i.getYScale(t.id)(r[0].value)),e=n.axis_rotated?"M "+o+" "+s:"M "+s+" "+o),e||"M 0 0"}},T.getAreaBaseValue=function(){return 0},T.generateGetAreaPoints=function(t,e){var i=this,n=i.config,a=t.__max__+1,r=i.getShapeX(0,a,t,!!e),s=i.getShapeY(!!e),o=i.getShapeOffset(i.isAreaType,t,!!e),c=e?i.getSubYScale:i.getYScale;return function(t,e){var a=c.call(i,t.id)(0),d=o(t,e)||a,u=r(t),l=s(t);return n.axis_rotated&&(0<t.value&&l<a||t.value<0&&a<l)&&(l=a),[[u,d],[u,l-(a-d)],[u,l-(a-d)],[u,d]]}},T.updateCircle=function(t,e){var n=this,a=n.main.selectAll("."+i.circles).selectAll("."+i.circle).data(n.lineOrScatterData.bind(n)),r=a.enter().append("circle").attr("class",n.classCircle.bind(n)).attr("cx",t).attr("cy",e).attr("r",n.pointR.bind(n)).style("fill",n.color);n.mainCircle=r.merge(a).style("opacity",n.initialOpacityForCircle.bind(n)),a.exit().style("opacity",0)},T.redrawCircle=function(t,e,n,a){var r=this,s=r.main.selectAll("."+i.selectedCircle);return[(n?r.mainCircle.transition(a):r.mainCircle).style("opacity",this.opacityForCircle.bind(r)).style("fill",r.color).attr("cx",t).attr("cy",e),(n?s.transition(a):s).attr("cx",t).attr("cy",e)]},T.circleX=function(t){return t.x||0===t.x?this.x(t.x):null},T.updateCircleY=function(){var t,e,i=this;i.config.data_groups.length>0?(t=i.getShapeIndices(i.isLineType),e=i.generateGetLinePoints(t),i.circleY=function(t,i){return e(t,i)[0][1]}):i.circleY=function(t){return i.getYScale(t.id)(t.value)}},T.getCircles=function(t,e){return(e?this.main.selectAll("."+i.circles+this.getTargetSelectorSuffix(e)):this.main).selectAll("."+i.circle+(s(t)?"-"+t:""))},T.expandCircles=function(t,e,n){var a=this.pointExpandedR.bind(this);n&&this.unexpandCircles(),this.getCircles(t,e).classed(i.EXPANDED,!0).attr("r",a)},T.unexpandCircles=function(t){var e=this,n=e.pointR.bind(e);e.getCircles(t).filter(function(){return e.d3.select(this).classed(i.EXPANDED)}).classed(i.EXPANDED,!1).attr("r",n)},T.pointR=function(t){var e=this.config;return this.isStepType(t)?0:o(e.point_r)?e.point_r(t):e.point_r},T.pointExpandedR=function(t){var e=this.config;return e.point_focus_expand_enabled?o(e.point_focus_expand_r)?e.point_focus_expand_r(t):e.point_focus_expand_r?e.point_focus_expand_r:1.75*this.pointR(t):this.pointR(t)},T.pointSelectR=function(t){var e=this.config;return o(e.point_select_r)?e.point_select_r(t):e.point_select_r?e.point_select_r:4*this.pointR(t)},T.isWithinCircle=function(t,e){var i=this.d3,n=i.mouse(t),a=i.select(t),r=+a.attr("cx"),s=+a.attr("cy");return Math.sqrt(Math.pow(r-n[0],2)+Math.pow(s-n[1],2))<e},T.isWithinStep=function(t,e){return Math.abs(e-this.d3.mouse(t)[1])<30},T.getCurrentWidth=function(){var t=this.config;return t.size_width?t.size_width:this.getParentWidth()},T.getCurrentHeight=function(){var t=this.config,e=t.size_height?t.size_height:this.getParentHeight();return e>0?e:320/(this.hasType("gauge")&&!t.gauge_fullCircle?2:1)},T.getCurrentPaddingTop=function(){var t=this.config,e=s(t.padding_top)?t.padding_top:0;return this.title&&this.title.node()&&(e+=this.getTitlePadding()),e},T.getCurrentPaddingBottom=function(){var t=this.config;return s(t.padding_bottom)?t.padding_bottom:0},T.getCurrentPaddingLeft=function(t){var e=this.config;return s(e.padding_left)?e.padding_left:e.axis_rotated?!e.axis_x_show||e.axis_x_inner?1:Math.max(h(this.getAxisWidthByAxisId("x",t)),40):!e.axis_y_show||e.axis_y_inner?this.axis.getYAxisLabelPosition().isOuter?30:1:h(this.getAxisWidthByAxisId("y",t))},T.getCurrentPaddingRight=function(){var t=this,e=t.config,i=t.isLegendRight?t.getLegendWidth()+20:0;return s(e.padding_right)?e.padding_right+1:e.axis_rotated?10+i:!e.axis_y2_show||e.axis_y2_inner?2+i+(t.axis.getY2AxisLabelPosition().isOuter?20:0):h(t.getAxisWidthByAxisId("y2"))+i},T.getParentRectValue=function(t){for(var e,i=this.selectChart.node();i&&"BODY"!==i.tagName;){try{e=i.getBoundingClientRect()[t]}catch(n){"width"===t&&(e=i.offsetWidth)}if(e)break;i=i.parentNode}return e},T.getParentWidth=function(){return this.getParentRectValue("width")},T.getParentHeight=function(){var t=this.selectChart.style("height");return t.indexOf("px")>0?+t.replace("px",""):0},T.getSvgLeft=function(t){var e=this,n=e.config,a=n.axis_rotated||!n.axis_rotated&&!n.axis_y_inner,r=n.axis_rotated?i.axisX:i.axisY,s=e.main.select("."+r).node(),o=s&&a?s.getBoundingClientRect():{right:0},c=e.selectChart.node().getBoundingClientRect(),d=e.hasArcType(),u=o.right-c.left-(d?0:e.getCurrentPaddingLeft(t));return u>0?u:0},T.getAxisWidthByAxisId=function(t,e){var i=this.axis.getLabelPositionById(t);return this.axis.getMaxTickWidth(t,e)+(i.isInner?20:40)},T.getHorizontalAxisHeight=function(t){var e=this,i=e.config,n=30;return"x"!==t||i.axis_x_show?"x"===t&&i.axis_x_height?i.axis_x_height:"y"!==t||i.axis_y_show?"y2"!==t||i.axis_y2_show?("x"===t&&!i.axis_rotated&&i.axis_x_tick_rotate&&(n=30+e.axis.getMaxTickWidth(t)*Math.cos(Math.PI*(90-Math.abs(i.axis_x_tick_rotate))/180)),"y"===t&&i.axis_rotated&&i.axis_y_tick_rotate&&(n=30+e.axis.getMaxTickWidth(t)*Math.cos(Math.PI*(90-Math.abs(i.axis_y_tick_rotate))/180)),n+(e.axis.getLabelPositionById(t).isInner?0:10)+("y2"===t?-10:0)):e.rotated_padding_top:!i.legend_show||e.isLegendRight||e.isLegendInset?1:10:8},T.initBrush=function(t){var e=this,n=e.d3;return e.brush=(e.config.axis_rotated?n.brushY():n.brushX()).on("brush",function(){var t=n.event.sourceEvent;t&&"zoom"===t.type||e.redrawForBrush()}).on("end",function(){var t=n.event.sourceEvent;t&&"zoom"===t.type||e.brush.empty()&&t&&"end"!==t.type&&e.brush.clear()}),e.brush.updateExtent=function(){var t,i=this.scale.range();return t=e.config.axis_rotated?[[0,i[0]],[e.width2,i[1]]]:[[i[0],0],[i[1],e.height2]],this.extent(t),this},e.brush.updateScale=function(t){return this.scale=t,this},e.brush.update=function(t){this.updateScale(t||e.subX).updateExtent(),e.context.select("."+i.brush).call(this)},e.brush.clear=function(){e.context.select("."+i.brush).call(e.brush.move,null)},e.brush.selection=function(){return n.brushSelection(e.context.select("."+i.brush).node())},e.brush.selectionAsValue=function(t,n){var a,r;return t?(e.context&&(a=[this.scale(t[0]),this.scale(t[1])],r=e.context.select("."+i.brush),n&&(r=r.transition()),e.brush.move(r,a)),[]):(a=e.brush.selection()||[0,0],[this.scale.invert(a[0]),this.scale.invert(a[1])])},e.brush.empty=function(){var t=e.brush.selection();return!t||t[0]===t[1]},e.brush.updateScale(t)},T.initSubchart=function(){var t=this,e=t.config,n=t.context=t.svg.append("g").attr("transform",t.getTranslate("context")),a=e.subchart_show?"visible":"hidden";n.style("visibility",a),n.append("g").attr("clip-path",t.clipPathForSubchart).attr("class",i.chart),n.select("."+i.chart).append("g").attr("class",i.chartBars),n.select("."+i.chart).append("g").attr("class",i.chartLines),n.append("g").attr("clip-path",t.clipPath).attr("class",i.brush),t.axes.subx=n.append("g").attr("class",i.axisX).attr("transform",t.getTranslate("subx")).attr("clip-path",e.axis_rotated?"":t.clipPathForXAxis)},T.initSubchartBrush=function(){this.initBrush(this.subX).updateExtent(),this.context.select("."+i.brush).call(this.brush)},T.updateTargetsForSubchart=function(t){var e,n,a,r,s=this,o=s.context,c=s.config,d=s.classChartBar.bind(s),u=s.classBars.bind(s),l=s.classChartLine.bind(s),h=s.classLines.bind(s),g=s.classAreas.bind(s);c.subchart_show&&((a=(r=o.select("."+i.chartBars).selectAll("."+i.chartBar).data(t)).enter().append("g").style("opacity",0)).merge(r).attr("class",d),a.append("g").attr("class",u),(e=(n=o.select("."+i.chartLines).selectAll("."+i.chartLine).data(t)).enter().append("g").style("opacity",0)).merge(n).attr("class",l),e.append("g").attr("class",h),e.append("g").attr("class",g),o.selectAll("."+i.brush+" rect").attr(c.axis_rotated?"width":"height",c.axis_rotated?s.width2:s.height2))},T.updateBarForSubchart=function(t){var e=this,n=e.context.selectAll("."+i.bars).selectAll("."+i.bar).data(e.barData.bind(e)),a=n.enter().append("path").attr("class",e.classBar.bind(e)).style("stroke","none").style("fill",e.color);n.exit().transition().duration(t).style("opacity",0).remove(),e.contextBar=a.merge(n).style("opacity",e.initialOpacity.bind(e))},T.redrawBarForSubchart=function(t,e,i){(e?this.contextBar.transition(Math.random().toString()).duration(i):this.contextBar).attr("d",t).style("opacity",1)},T.updateLineForSubchart=function(t){var e=this,n=e.context.selectAll("."+i.lines).selectAll("."+i.line).data(e.lineData.bind(e)),a=n.enter().append("path").attr("class",e.classLine.bind(e)).style("stroke",e.color);n.exit().transition().duration(t).style("opacity",0).remove(),e.contextLine=a.merge(n).style("opacity",e.initialOpacity.bind(e))},T.redrawLineForSubchart=function(t,e,i){(e?this.contextLine.transition(Math.random().toString()).duration(i):this.contextLine).attr("d",t).style("opacity",1)},T.updateAreaForSubchart=function(t){var e=this,n=e.d3,a=e.context.selectAll("."+i.areas).selectAll("."+i.area).data(e.lineData.bind(e)),r=a.enter().append("path").attr("class",e.classArea.bind(e)).style("fill",e.color).style("opacity",function(){return e.orgAreaOpacity=+n.select(this).style("opacity"),0});a.exit().transition().duration(t).style("opacity",0).remove(),e.contextArea=r.merge(a).style("opacity",0)},T.redrawAreaForSubchart=function(t,e,i){(e?this.contextArea.transition(Math.random().toString()).duration(i):this.contextArea).attr("d",t).style("fill",this.color).style("opacity",this.orgAreaOpacity)},T.redrawSubchart=function(t,e,i,n,a,r,s){var o,c,d,u=this,l=u.d3,h=u.config;u.context.style("visibility",h.subchart_show?"visible":"hidden"),h.subchart_show&&(l.event&&"zoom"===l.event.type&&u.brush.selectionAsValue(u.x.orgDomain()),t&&(u.brush.empty()||u.brush.selectionAsValue(u.x.orgDomain()),o=u.generateDrawArea(a,!0),c=u.generateDrawBar(r,!0),d=u.generateDrawLine(s,!0),u.updateBarForSubchart(i),u.updateLineForSubchart(i),u.updateAreaForSubchart(i),u.redrawBarForSubchart(c,i,i),u.redrawLineForSubchart(d,i,i),u.redrawAreaForSubchart(o,i,i)))},T.redrawForBrush=function(){var t,e=this,n=e.x,a=e.d3;e.redraw({withTransition:!1,withY:e.config.zoom_rescale,withSubchart:!1,withUpdateXDomain:!0,withEventRect:!1,withDimension:!1}),t=a.event.selection||e.brush.scale.range(),e.main.select("."+i.eventRect).call(e.zoom.transform,a.zoomIdentity.scale(e.width/(t[1]-t[0])).translate(-t[0],0)),e.config.subchart_onbrush.call(e.api,n.orgDomain())},T.transformContext=function(t,e){var n;e&&e.axisSubX?n=e.axisSubX:(n=this.context.select("."+i.axisX),t&&(n=n.transition())),this.context.attr("transform",this.getTranslate("context")),n.attr("transform",this.getTranslate("subx"))},T.getDefaultSelection=function(){var t=this,e=t.config,i=o(e.axis_x_selection)?e.axis_x_selection(t.getXDomain(t.data.targets)):e.axis_x_selection;return t.isTimeSeries()&&(i=[t.parseDate(i[0]),t.parseDate(i[1])]),i},T.initText=function(){this.main.select("."+i.chart).append("g").attr("class",i.chartTexts),this.mainText=this.d3.selectAll([])},T.updateTargetsForText=function(t){var e=this,n=e.classChartText.bind(e),a=e.classTexts.bind(e),r=e.classFocus.bind(e),s=e.main.select("."+i.chartTexts).selectAll("."+i.chartText).data(t),o=s.enter().append("g").attr("class",n).style("opacity",0).style("pointer-events","none");o.append("g").attr("class",a),o.merge(s).attr("class",function(t){return n(t)+r(t)})},T.updateText=function(t,e,n){var a=this,r=a.config,s=a.barOrLineData.bind(a),o=a.classText.bind(a),c=a.main.selectAll("."+i.texts).selectAll("."+i.text).data(s),d=c.enter().append("text").attr("class",o).attr("text-anchor",function(t){return r.axis_rotated?t.value<0?"end":"start":"middle"}).style("stroke","none").attr("x",t).attr("y",e).style("fill",function(t){return a.color(t)}).style("fill-opacity",0);a.mainText=d.merge(c).text(function(t,e,i){return a.dataLabelFormat(t.id)(t.value,t.id,e,i)}),c.exit().transition().duration(n).style("fill-opacity",0).remove()},T.redrawText=function(t,e,i,n,a){return[(n?this.mainText.transition(a):this.mainText).attr("x",t).attr("y",e).style("fill",this.color).style("fill-opacity",i?0:this.opacityForText.bind(this))]},T.getTextRect=function(t,e,i){var n,a=this.d3.select("body").append("div").classed("c3",!0),r=a.append("svg").style("visibility","hidden").style("position","fixed").style("top",0).style("left",0),s=this.d3.select(i).style("font");return r.selectAll(".dummy").data([t]).enter().append("text").classed(e||"",!0).style("font",s).text(t).each(function(){n=this.getBoundingClientRect()}),a.remove(),n},T.generateXYForText=function(t,e,i,n){var a=this,r=a.generateGetAreaPoints(t,!1),s=a.generateGetBarPoints(e,!1),o=a.generateGetLinePoints(i,!1),c=n?a.getXForText:a.getYForText;return function(t,e){var i=a.isAreaType(t)?r:a.isBarType(t)?s:o;return c.call(a,i(t,e),t,this)}},T.getXForText=function(t,e,i){var n,a,r=this,s=i.getBoundingClientRect();return r.config.axis_rotated?(a=r.isBarType(e)?4:6,n=t[2][1]+a*(e.value<0?-1:1)):n=r.hasType("bar")?(t[2][0]+t[0][0])/2:t[0][0],null===e.value&&(n>r.width?n=r.width-s.width:n<0&&(n=4)),n},T.getYForText=function(t,e,i){var n,a=this,r=i.getBoundingClientRect();return a.config.axis_rotated?n=(t[0][0]+t[2][0]+.6*r.height)/2:(n=t[2][1],e.value<0||0===e.value&&!a.hasPositiveValue?(n+=r.height,a.isBarType(e)&&a.isSafari()?n-=3:!a.isBarType(e)&&a.isChrome()&&(n+=3)):n+=a.isBarType(e)?-3:-6),null!==e.value||a.config.axis_rotated||(n<r.height?n=r.height:n>this.height&&(n=this.height-4)),n},T.initTitle=function(){this.title=this.svg.append("text").text(this.config.title_text).attr("class",this.CLASS.title)},T.redrawTitle=function(){var t=this;t.title.attr("x",t.xForTitle.bind(t)).attr("y",t.yForTitle.bind(t))},T.xForTitle=function(){var t=this,e=t.config,i=e.title_position||"left";return i.indexOf("right")>=0?t.currentWidth-t.getTextRect(t.title.node().textContent,t.CLASS.title,t.title.node()).width-e.title_padding.right:i.indexOf("center")>=0?(t.currentWidth-t.getTextRect(t.title.node().textContent,t.CLASS.title,t.title.node()).width)/2:e.title_padding.left},T.yForTitle=function(){var t=this;return t.config.title_padding.top+t.getTextRect(t.title.node().textContent,t.CLASS.title,t.title.node()).height},T.getTitlePadding=function(){return this.yForTitle()+this.config.title_padding.bottom},T.initTooltip=function(){var t,e=this,n=e.config;if(e.tooltip=e.selectChart.style("position","relative").append("div").attr("class",i.tooltipContainer).style("position","absolute").style("pointer-events","none").style("display","none"),n.tooltip_init_show){if(e.isTimeSeries()&&d(n.tooltip_init_x)){for(n.tooltip_init_x=e.parseDate(n.tooltip_init_x),t=0;t<e.data.targets[0].values.length&&e.data.targets[0].values[t].x-n.tooltip_init_x!=0;t++);n.tooltip_init_x=t}e.tooltip.html(n.tooltip_contents.call(e,e.data.targets.map(function(t){return e.addName(t.values[n.tooltip_init_x])}),e.axis.getXAxisTickFormat(),e.getYFormat(e.hasArcType()),e.color)),e.tooltip.style("top",n.tooltip_init_position.top).style("left",n.tooltip_init_position.left).style("display","block")}},T.getTooltipSortFunction=function(){var t=this,e=t.config;if(0!==e.data_groups.length&&void 0===e.tooltip_order){var i=t.orderTargets(t.data.targets).map(function(t){return t.id});return(t.isOrderAsc()||t.isOrderDesc())&&(i=i.reverse()),function(t,e){return i.indexOf(t.id)-i.indexOf(e.id)}}var n=e.tooltip_order;void 0===n&&(n=e.data_order);var a=function(t){return t?t.value:null};if(d(n)&&"asc"===n.toLowerCase())return function(t,e){return a(t)-a(e)};if(d(n)&&"desc"===n.toLowerCase())return function(t,e){return a(e)-a(t)};if(o(n)){var r=n;return void 0===e.tooltip_order&&(r=function(t,e){return n(t?{id:t.id,values:[t]}:null,e?{id:e.id,values:[e]}:null)}),r}return c(n)?function(t,e){return n.indexOf(t.id)-n.indexOf(e.id)}:void 0},T.getTooltipContent=function(t,e,i,n){var a,r,s,o,c,d,u=this,l=u.config,h=l.tooltip_format_title||e,g=l.tooltip_format_name||function(t){return t},f=l.tooltip_format_value||i,p=this.getTooltipSortFunction();for(p&&t.sort(p),r=0;r<t.length;r++)if(t[r]&&(t[r].value||0===t[r].value)&&(a||(s=m(h?h(t[r].x):t[r].x),a="<table class='"+u.CLASS.tooltip+"'>"+(s||0===s?"<tr><th colspan='2'>"+s+"</th></tr>":"")),void 0!==(o=m(f(t[r].value,t[r].ratio,t[r].id,t[r].index,t))))){if(null===t[r].name)continue;c=m(g(t[r].name,t[r].ratio,t[r].id,t[r].index)),d=u.levelColor?u.levelColor(t[r].value):n(t[r].id),a+="<tr class='"+u.CLASS.tooltipName+"-"+u.getTargetSelectorSuffix(t[r].id)+"'>",a+="<td class='name'><span style='background-color:"+d+"'></span>"+c+"</td>",a+="<td class='value'>"+o+"</td>",a+="</tr>"}return a+"</table>"},T.tooltipPosition=function(t,e,i,n){var a,r,s,o,c,d=this,u=d.config,l=d.d3,h=d.hasArcType(),g=l.mouse(n);return h?(r=(d.width-(d.isLegendRight?d.getLegendWidth():0))/2+g[0],o=(d.hasType("gauge")?d.height:d.height/2)+g[1]+20):(a=d.getSvgLeft(!0),u.axis_rotated?(s=(r=a+g[0]+100)+e,c=d.currentWidth-d.getCurrentPaddingRight(),o=d.x(t[0].x)+20):(s=(r=a+d.getCurrentPaddingLeft(!0)+d.x(t[0].x)+20)+e,c=a+d.currentWidth-d.getCurrentPaddingRight(),o=g[1]+15),s>c&&(r-=s-c+20),o+i>d.currentHeight&&(o-=i+30)),o<0&&(o=0),{top:o,left:r}},T.showTooltip=function(t,e){var i,n,a,r=this,o=r.config,c=r.hasArcType(),d=t.filter(function(t){return t&&s(t.value)}),u=o.tooltip_position||T.tooltipPosition;0!==d.length&&o.tooltip_show&&(r.tooltip.html(o.tooltip_contents.call(r,t,r.axis.getXAxisTickFormat(),r.getYFormat(c),r.color)).style("display","block"),i=r.tooltip.property("offsetWidth"),n=r.tooltip.property("offsetHeight"),a=u.call(this,d,i,n,e),r.tooltip.style("top",a.top+"px").style("left",a.left+"px"))},T.hideTooltip=function(){this.tooltip.style("display","none")},T.setTargetType=function(t,e){var i=this,n=i.config;i.mapToTargetIds(t).forEach(function(t){i.withoutFadeIn[t]=e===n.data_types[t],n.data_types[t]=e}),t||(n.data_type=e)},T.hasType=function(t,e){var i=this.config.data_types,n=!1;return(e=e||this.data.targets)&&e.length?e.forEach(function(e){var a=i[e.id];(a&&a.indexOf(t)>=0||!a&&"line"===t)&&(n=!0)}):Object.keys(i).length?Object.keys(i).forEach(function(e){i[e]===t&&(n=!0)}):n=this.config.data_type===t,n},T.hasArcType=function(t){return this.hasType("pie",t)||this.hasType("donut",t)||this.hasType("gauge",t)},T.isLineType=function(t){var e=this.config,i=d(t)?t:t.id;return!e.data_types[i]||["line","spline","area","area-spline","step","area-step"].indexOf(e.data_types[i])>=0},T.isStepType=function(t){var e=d(t)?t:t.id;return["step","area-step"].indexOf(this.config.data_types[e])>=0},T.isSplineType=function(t){var e=d(t)?t:t.id;return["spline","area-spline"].indexOf(this.config.data_types[e])>=0},T.isAreaType=function(t){var e=d(t)?t:t.id;return["area","area-spline","area-step"].indexOf(this.config.data_types[e])>=0},T.isBarType=function(t){var e=d(t)?t:t.id;return"bar"===this.config.data_types[e]},T.isScatterType=function(t){var e=d(t)?t:t.id;return"scatter"===this.config.data_types[e]},T.isPieType=function(t){var e=d(t)?t:t.id;return"pie"===this.config.data_types[e]},T.isGaugeType=function(t){var e=d(t)?t:t.id;return"gauge"===this.config.data_types[e]},T.isDonutType=function(t){var e=d(t)?t:t.id;return"donut"===this.config.data_types[e]},T.isArcType=function(t){return this.isPieType(t)||this.isDonutType(t)||this.isGaugeType(t)},T.lineData=function(t){return this.isLineType(t)?[t]:[]},T.arcData=function(t){return this.isArcType(t.data)?[t]:[]},T.barData=function(t){return this.isBarType(t)?t.values:[]},T.lineOrScatterData=function(t){return this.isLineType(t)||this.isScatterType(t)?t.values:[]},T.barOrLineData=function(t){return this.isBarType(t)||this.isLineType(t)?t.values:[]},T.isSafari=function(){var t=window.navigator.userAgent;return t.indexOf("Safari")>=0&&t.indexOf("Chrome")<0},T.isChrome=function(){return window.navigator.userAgent.indexOf("Chrome")>=0},T.initZoom=function(){var t,e=this,i=e.d3,n=e.config;return e.zoom=i.zoom().on("start",function(){var a=i.event.sourceEvent;a&&"brush"===a.type||(t=a,n.zoom_onzoomstart.call(e.api,a))}).on("zoom",function(){var t=i.event.sourceEvent;t&&"brush"===t.type||e.redrawForZoom.call(e)}).on("end",function(){var a=i.event.sourceEvent;a&&"brush"===a.type||a&&t.clientX===a.clientX&&t.clientY===a.clientY||n.zoom_onzoomend.call(e.api,e.x.orgDomain())}),e.zoom.updateDomain=function(){return i.event&&i.event.transform&&e.x.domain(i.event.transform.rescaleX(e.subX).domain()),this},e.zoom.updateExtent=function(){return this.scaleExtent([1,1/0]).translateExtent([[0,0],[e.width,e.height]]).extent([[0,0],[e.width,e.height]]),this},e.zoom.update=function(){return this.updateExtent().updateDomain()},e.zoom.updateExtent()},T.zoomTransform=function(t){var e=[this.x(t[0]),this.x(t[1])];return this.d3.zoomIdentity.scale(this.width/(e[1]-e[0])).translate(-e[0],0)},T.getZoomDomain=function(){var t=this.config,e=this.d3;return[e.min([this.orgXDomain[0],t.zoom_x_min]),e.max([this.orgXDomain[1],t.zoom_x_max])]},T.redrawForZoom=function(){var t=this,e=t.d3,i=t.config,n=t.zoom,a=t.x;i.zoom_enabled&&0!==t.filterTargetsToShow(t.data.targets).length&&(n.update(),t.isCategorized()&&a.orgDomain()[0]===t.orgXDomain[0]&&a.domain([t.orgXDomain[0]-1e-10,a.orgDomain()[1]]),t.redraw({withTransition:!1,withY:i.zoom_rescale,withSubchart:!1,withEventRect:!1,withDimension:!1}),e.event.sourceEvent&&"mousemove"===e.event.sourceEvent.type&&(t.cancelClick=!0),i.zoom_onzoom.call(t.api,a.orgDomain()))},A});
\ No newline at end of file
+/* @license C3.js v0.6.7 | (c) C3 Team and other contributors | http://c3js.org/ */
+!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.c3=e()}(this,function(){"use strict";function l(t){var e=this;e.d3=window.d3?window.d3:"undefined"!=typeof require?require("d3"):void 0,e.api=t,e.config=e.getDefaultConfig(),e.data={},e.cache={},e.axes={}}function n(t){var e=this.internal=new l(this);e.loadConfig(t),e.beforeInit(t),e.init(),e.afterInit(t),function e(i,n,r){Object.keys(i).forEach(function(t){n[t]=i[t].bind(r),0<Object.keys(i[t]).length&&e(i[t],n[t],r)})}(n.prototype,this,this)}function i(t,e){var i=this;i.component=t,i.params=e||{},i.d3=t.d3,i.scale=i.d3.scaleLinear(),i.range,i.orient="bottom",i.innerTickSize=6,i.outerTickSize=this.params.withOuterTick?6:0,i.tickPadding=3,i.tickValues=null,i.tickFormat,i.tickArguments,i.tickOffset=0,i.tickCulling=!0,i.tickCentered,i.tickTextCharSize,i.tickTextRotate=i.params.tickTextRotate,i.tickLength,i.axis=i.generateAxis()}i.prototype.axisX=function(t,e,i){t.attr("transform",function(t){return"translate("+Math.ceil(e(t)+i)+", 0)"})},i.prototype.axisY=function(t,e){t.attr("transform",function(t){return"translate(0,"+Math.ceil(e(t))+")"})},i.prototype.scaleExtent=function(t){var e=t[0],i=t[t.length-1];return e<i?[e,i]:[i,e]},i.prototype.generateTicks=function(t){var e,i,n=[];if(t.ticks)return t.ticks.apply(t,this.tickArguments);for(i=t.domain(),e=Math.ceil(i[0]);e<i[1];e++)n.push(e);return 0<n.length&&0<n[0]&&n.unshift(n[0]-(n[1]-n[0])),n},i.prototype.copyScale=function(){var t,e=this,i=e.scale.copy();return e.params.isCategory&&(t=e.scale.domain(),i.domain([t[0],t[1]-1])),i},i.prototype.textFormatted=function(t){var e=this.tickFormat?this.tickFormat(t):t;return void 0!==e?e:""},i.prototype.updateRange=function(){var t=this;return t.range=t.scale.rangeExtent?t.scale.rangeExtent():t.scaleExtent(t.scale.range()),t.range},i.prototype.updateTickTextCharSize=function(t){var a=this;if(a.tickTextCharSize)return a.tickTextCharSize;var o={h:11.5,w:5.5};return t.select("text").text(function(t){return a.textFormatted(t)}).each(function(t){var e=this.getBoundingClientRect(),i=a.textFormatted(t),n=e.height,r=i?e.width/i.length:void 0;n&&r&&(o.h=n,o.w=r)}).text(""),a.tickTextCharSize=o},i.prototype.isVertical=function(){return"left"===this.orient||"right"===this.orient},i.prototype.tspanData=function(t,e,i){var n=this,r=n.params.tickMultiline?n.splitTickText(t,i):[].concat(n.textFormatted(t));return n.params.tickMultiline&&0<n.params.tickMultilineMax&&(r=n.ellipsify(r,n.params.tickMultilineMax)),r.map(function(t){return{index:e,splitted:t,length:r.length}})},i.prototype.splitTickText=function(t,e){var r,a,o,s=this,i=s.textFormatted(t),c=s.params.tickWidth;if("[object Array]"===Object.prototype.toString.call(i))return i;return(!c||c<=0)&&(c=s.isVertical()?95:s.params.isCategory?Math.ceil(e(1)-e(0))-12:110),function t(e,i){a=void 0;for(var n=1;n<i.length;n++)if(" "===i.charAt(n)&&(a=n),r=i.substr(0,n+1),o=s.tickTextCharSize.w*r.length,c<o)return t(e.concat(i.substr(0,a||n)),i.slice(a?a+1:n));return e.concat(i)}([],i+"")},i.prototype.ellipsify=function(t,e){if(t.length<=e)return t;for(var i=t.slice(0,e),n=3,r=e-1;0<=r;r--){var a=i[r].length;if(i[r]=i[r].substr(0,a-n).padEnd(a,"."),(n-=a)<=0)break}return i},i.prototype.updateTickLength=function(){this.tickLength=Math.max(this.innerTickSize,0)+this.tickPadding},i.prototype.lineY2=function(t){var e=this,i=e.scale(t)+(e.tickCentered?0:e.tickOffset);return e.range[0]<i&&i<e.range[1]?e.innerTickSize:0},i.prototype.textY=function(){var t=this.tickTextRotate;return t?11.5-t/15*2.5*(0<t?1:-1):this.tickLength},i.prototype.textTransform=function(){var t=this.tickTextRotate;return t?"rotate("+t+")":""},i.prototype.textTextAnchor=function(){var t=this.tickTextRotate;return t?0<t?"start":"end":"middle"},i.prototype.tspanDx=function(){var t=this.tickTextRotate;return t?8*Math.sin(Math.PI*(t/180)):0},i.prototype.tspanDy=function(t,e){var i=this.tickTextCharSize.h;return 0===e&&(i=this.isVertical()?-((t.length-1)*(this.tickTextCharSize.h/2)-3):".71em"),i},i.prototype.generateAxis=function(){var w=this,v=w.d3,b=w.params;function A(t,m){var S;return t.each(function(){var t,e,i,n=A.g=v.select(this),r=this.__chart__||w.scale,a=this.__chart__=w.copyScale(),o=w.tickValues?w.tickValues:w.generateTicks(a),s=n.selectAll(".tick").data(o,a),c=s.enter().insert("g",".domain").attr("class","tick").style("opacity",1e-6),d=s.exit().remove(),l=s.merge(c);b.isCategory?(w.tickOffset=Math.ceil((a(1)-a(0))/2),e=w.tickCentered?0:w.tickOffset,i=w.tickCentered?w.tickOffset:0):w.tickOffset=e=0,w.updateRange(),w.updateTickLength(),w.updateTickTextCharSize(n.select(".tick"));var u=l.select("line").merge(c.append("line")),h=l.select("text").merge(c.append("text")),g=l.selectAll("text").selectAll("tspan").data(function(t,e){return w.tspanData(t,e,a)}),p=g.enter().append("tspan").merge(g).text(function(t){return t.splitted});g.exit().remove();var f=n.selectAll(".domain").data([0]),_=f.enter().append("path").merge(f).attr("class","domain");switch(w.orient){case"bottom":t=w.axisX,u.attr("x1",e).attr("x2",e).attr("y2",function(t,e){return w.lineY2(t,e)}),h.attr("x",0).attr("y",function(t,e){return w.textY(t,e)}).attr("transform",function(t,e){return w.textTransform(t,e)}).style("text-anchor",function(t,e){return w.textTextAnchor(t,e)}),p.attr("x",0).attr("dy",function(t,e){return w.tspanDy(t,e)}).attr("dx",function(t,e){return w.tspanDx(t,e)}),_.attr("d","M"+w.range[0]+","+w.outerTickSize+"V0H"+w.range[1]+"V"+w.outerTickSize);break;case"top":t=w.axisX,u.attr("x1",e).attr("x2",e).attr("y2",function(t,e){return-1*w.lineY2(t,e)}),h.attr("x",0).attr("y",function(t,e){return-1*w.textY(t,e)-(b.isCategory?2:w.tickLength-2)}).attr("transform",function(t,e){return w.textTransform(t,e)}).style("text-anchor",function(t,e){return w.textTextAnchor(t,e)}),p.attr("x",0).attr("dy",function(t,e){return w.tspanDy(t,e)}).attr("dx",function(t,e){return w.tspanDx(t,e)}),_.attr("d","M"+w.range[0]+","+-w.outerTickSize+"V0H"+w.range[1]+"V"+-w.outerTickSize);break;case"left":t=w.axisY,u.attr("x2",-w.innerTickSize).attr("y1",i).attr("y2",i),h.attr("x",-w.tickLength).attr("y",w.tickOffset).style("text-anchor","end"),p.attr("x",-w.tickLength).attr("dy",function(t,e){return w.tspanDy(t,e)}),_.attr("d","M"+-w.outerTickSize+","+w.range[0]+"H0V"+w.range[1]+"H"+-w.outerTickSize);break;case"right":t=w.axisY,u.attr("x2",w.innerTickSize).attr("y1",i).attr("y2",i),h.attr("x",w.tickLength).attr("y",w.tickOffset).style("text-anchor","start"),p.attr("x",w.tickLength).attr("dy",function(t,e){return w.tspanDy(t,e)}),_.attr("d","M"+w.outerTickSize+","+w.range[0]+"H0V"+w.range[1]+"H"+w.outerTickSize)}if(a.rangeBand){var x=a,y=x.rangeBand()/2;r=a=function(t){return x(t)+y}}else r.rangeBand?r=a:d.call(t,a,w.tickOffset);c.call(t,r,w.tickOffset),S=(m?l.transition(m):l).style("opacity",1).call(t,a,w.tickOffset)}),S}return A.scale=function(t){return arguments.length?(w.scale=t,A):w.scale},A.orient=function(t){return arguments.length?(w.orient=t in{top:1,right:1,bottom:1,left:1}?t+"":"bottom",A):w.orient},A.tickFormat=function(t){return arguments.length?(w.tickFormat=t,A):w.tickFormat},A.tickCentered=function(t){return arguments.length?(w.tickCentered=t,A):w.tickCentered},A.tickOffset=function(){return w.tickOffset},A.tickInterval=function(){var t;return(t=b.isCategory?2*w.tickOffset:(A.g.select("path.domain").node().getTotalLength()-2*w.outerTickSize)/A.g.selectAll("line").size())===1/0?0:t},A.ticks=function(){return arguments.length?(w.tickArguments=arguments,A):w.tickArguments},A.tickCulling=function(t){return arguments.length?(w.tickCulling=t,A):w.tickCulling},A.tickValues=function(t){if("function"==typeof t)w.tickValues=function(){return t(w.scale.domain())};else{if(!arguments.length)return w.tickValues;w.tickValues=t}return A},A};var Y={target:"c3-target",chart:"c3-chart",chartLine:"c3-chart-line",chartLines:"c3-chart-lines",chartBar:"c3-chart-bar",chartBars:"c3-chart-bars",chartText:"c3-chart-text",chartTexts:"c3-chart-texts",chartArc:"c3-chart-arc",chartArcs:"c3-chart-arcs",chartArcsTitle:"c3-chart-arcs-title",chartArcsBackground:"c3-chart-arcs-background",chartArcsGaugeUnit:"c3-chart-arcs-gauge-unit",chartArcsGaugeMax:"c3-chart-arcs-gauge-max",chartArcsGaugeMin:"c3-chart-arcs-gauge-min",selectedCircle:"c3-selected-circle",selectedCircles:"c3-selected-circles",eventRect:"c3-event-rect",eventRects:"c3-event-rects",eventRectsSingle:"c3-event-rects-single",eventRectsMultiple:"c3-event-rects-multiple",zoomRect:"c3-zoom-rect",brush:"c3-brush",dragZoom:"c3-drag-zoom",focused:"c3-focused",defocused:"c3-defocused",region:"c3-region",regions:"c3-regions",title:"c3-title",tooltipContainer:"c3-tooltip-container",tooltip:"c3-tooltip",tooltipName:"c3-tooltip-name",shape:"c3-shape",shapes:"c3-shapes",line:"c3-line",lines:"c3-lines",bar:"c3-bar",bars:"c3-bars",circle:"c3-circle",circles:"c3-circles",arc:"c3-arc",arcLabelLine:"c3-arc-label-line",arcs:"c3-arcs",area:"c3-area",areas:"c3-areas",empty:"c3-empty",text:"c3-text",texts:"c3-texts",gaugeValue:"c3-gauge-value",grid:"c3-grid",gridLines:"c3-grid-lines",xgrid:"c3-xgrid",xgrids:"c3-xgrids",xgridLine:"c3-xgrid-line",xgridLines:"c3-xgrid-lines",xgridFocus:"c3-xgrid-focus",ygrid:"c3-ygrid",ygrids:"c3-ygrids",ygridLine:"c3-ygrid-line",ygridLines:"c3-ygrid-lines",axis:"c3-axis",axisX:"c3-axis-x",axisXLabel:"c3-axis-x-label",axisY:"c3-axis-y",axisYLabel:"c3-axis-y-label",axisY2:"c3-axis-y2",axisY2Label:"c3-axis-y2-label",legendBackground:"c3-legend-background",legendItem:"c3-legend-item",legendItemEvent:"c3-legend-item-event",legendItemTile:"c3-legend-item-tile",legendItemHidden:"c3-legend-item-hidden",legendItemFocused:"c3-legend-item-focused",dragarea:"c3-dragarea",EXPANDED:"_expanded_",SELECTED:"_selected_",INCLUDED:"_included_"},s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a=function(t){return Math.ceil(t)+.5},r=function(t){return 10*Math.ceil(t/10)},k=function(t){return t[1]-t[0]},N=function(t,e,i){return D(t[e])?t[e]:i},y=function(t){var e=t.getBoundingClientRect(),i=[t.pathSegList.getItem(0),t.pathSegList.getItem(1)];return{x:i[0].x,y:Math.min(i[0].y,i[1].y),width:e.width,height:e.height}},o=function(t){return Array.isArray(t)},D=function(t){return void 0!==t},u=function(t){return null==t||c(t)&&0===t.length||"object"===(void 0===t?"undefined":s(t))&&0===Object.keys(t).length},h=function(t){return"function"==typeof t},c=function(t){return"string"==typeof t},v=function(t){return void 0===t},P=function(t){return t||0===t},C=function(t){return!u(t)},_=function(t){return"string"==typeof t?t.replace(/</g,"&lt;").replace(/>/g,"&gt;"):t},d=function t(e){!function(t,e){if(!(t instanceo