diff --git a/.bmp.yml b/.bmp.yml
index 4630434..778de9c 100644
--- a/.bmp.yml
+++ b/.bmp.yml
@@ -1,7 +1,7 @@
---
-version: 0.6.4
+version: 0.6.5
commit: 'chore(version): bump to v%.%.%'
files:
- src/util.js: 'version: "%.%.%"'
+ src/core.js: 'version: "%.%.%"'
package.json: '"version": "%.%.%"'
component.json: '"version": "%.%.%"'
diff --git a/c3.js b/c3.js
index 3e90587..81a9ca1 100644
--- a/c3.js
+++ b/c3.js
@@ -1,89 +1,10 @@
-/* @license C3.js v0.6.4 | (c) C3 Team and other contributors | http://c3js.org/ */
+/* @license C3.js v0.6.5 | (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_'
- };
-
function ChartInternal(api) {
var $$ = this;
$$.d3 = window.d3 ? window.d3 : typeof require !== 'undefined' ? require("d3") : undefined;
@@ -94,66 +15,6 @@
$$.axes = {};
}
- 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");
- }
-
- return call && (typeof call === "object" || typeof call === "function") ? call : self;
- };
-
- var c3 = { version: "0.6.4",
- chart: {
- fn: Chart.prototype,
- internal: {
- fn: ChartInternal.prototype
- }
- }
- };
-
function Chart(config) {
var $$ = this.internal = new ChartInternal(this);
$$.loadConfig(config);
@@ -170,77 +31,9 @@
bindThis(fn[key], target[key], argThis);
}
});
- })(c3.chart.fn, this, this);
+ })(Chart.prototype, this, this);
}
- c3.generate = function (config) {
- return new Chart(config);
- };
-
- function Component(owner, componentKey, fn) {
- this.owner = owner;
- c3.chart.internal[componentKey] = fn;
- }
-
- 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, '>') : 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 };
- };
-
- var c3_axis_fn;
- var c3_axis_internal_fn;
-
function AxisInternal(component, params) {
var internal = this;
internal.component = component;
@@ -266,24 +59,23 @@
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,
@@ -300,7 +92,7 @@
}
return ticks;
};
- c3_axis_internal_fn.copyScale = function () {
+ AxisInternal.prototype.copyScale = function () {
var internal = this;
var newScale = internal.scale.copy(),
domain;
@@ -310,17 +102,17 @@
}
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;
@@ -344,10 +136,10 @@
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));
@@ -359,7 +151,7 @@
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,
@@ -394,7 +186,7 @@
return split(splitted, tickText + "");
};
- c3_axis_internal_fn.ellipsify = function (splitted, max) {
+ AxisInternal.prototype.ellipsify = function (splitted, max) {
if (splitted.length <= max) {
return splitted;
}
@@ -415,36 +207,36 @@
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) {
@@ -457,7 +249,7 @@
return dy;
};
- c3_axis_internal_fn.generateAxis = function () {
+ AxisInternal.prototype.generateAxis = function () {
var internal = this,
d3 = internal.d3,
params = internal.params;
@@ -662,32 +454,177 @@
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',
+ 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_'
+ };
- function Axis(owner) {
- classCallCheck(this, Axis);
+ 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 fn = {
- fn: c3_axis_fn,
- internal: {
- fn: c3_axis_internal_fn
- }
- };
+ var classCallCheck = function (instance, Constructor) {
+ if (!(instance instanceof Constructor)) {
+ throw new TypeError("Cannot call a class as a function");
+ }
+ };
- var _this = possibleConstructorReturn(this, (Axis.__proto__ || Object.getPrototypeOf(Axis)).call(this, owner, 'axis', 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;
+ }
- _this.d3 = owner.d3;
- _this.internal = AxisInternal;
- return _this;
- }
+ return obj;
+ };
+
+ 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, '>') : 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;
@@ -701,7 +638,7 @@
.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 = {
@@ -732,7 +669,7 @@
return axis;
};
- c3_axis_fn.updateXAxisTickValues = function updateXAxisTickValues(targets, axis) {
+ Axis.prototype.updateXAxisTickValues = function updateXAxisTickValues(targets, axis) {
var $$ = this.owner,
config = $$.config,
tickValues;
@@ -747,7 +684,7 @@
}
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 = {
@@ -763,11 +700,11 @@
}
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,
@@ -789,19 +726,19 @@
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;
@@ -814,11 +751,11 @@
}
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);
@@ -834,7 +771,7 @@
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 {
@@ -848,28 +785,28 @@
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;
@@ -877,39 +814,39 @@
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();
@@ -919,7 +856,7 @@
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) {
@@ -928,7 +865,7 @@
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) {
@@ -937,19 +874,19 @@
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,
@@ -989,7 +926,7 @@
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),
@@ -998,7 +935,7 @@
(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;
@@ -1009,12 +946,12 @@
// 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,
@@ -1051,7 +988,7 @@
}
return tickValues;
};
- c3_axis_fn.generateTransitions = function generateTransitions(duration) {
+ Axis.prototype.generateTransitions = function generateTransitions(duration) {
var $$ = this.owner,
axes = $$.axes;
return {
@@ -1061,7 +998,7 @@
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);
@@ -1070,19 +1007,32 @@
$$.axes.subx.style("opacity", isHidden ? 0 : 1).call($$.subXAxis, transition);
};
- var c3_chart_fn;
- var c3_chart_internal_fn;
-
- c3_chart_fn = c3.chart.fn;
- c3_chart_internal_fn = c3.chart.internal.fn;
+ var c3 = {
+ version: "0.6.5",
+ chart: {
+ fn: Chart.prototype,
+ internal: {
+ fn: ChartInternal.prototype,
+ axis: {
+ fn: Axis.prototype,
+ internal: {
+ fn: AxisInternal.prototype
+ }
+ }
+ }
+ },
+ generate: function generate(config) {
+ return new Chart(config);
+ }
+ };
- 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;
@@ -1101,14 +1051,24 @@
}
};
- 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;
@@ -1179,7 +1139,7 @@
$$.axes.subx = d3.selectAll([]); // needs when excluding subchart.js
};
- c3_chart_internal_fn.initChartElements = function () {
+ ChartInternal.prototype.initChartElements = function () {
if (this.initBar) {
this.initBar();
}
@@ -1197,7 +1157,7 @@
}
};
- c3_chart_internal_fn.initWithData = function (data) {
+ ChartInternal.prototype.initWithData = function (data) {
var $$ = this,
d3 = $$.d3,
config = $$.config;
@@ -1359,7 +1319,7 @@
$$.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 () {
@@ -1378,7 +1338,7 @@
}
};
- c3_chart_internal_fn.updateSizes = function () {
+ ChartInternal.prototype.updateSizes = function () {
var $$ = this,
config = $$.config;
var legendHeight = $$.legend ? $$.getLegendHeight() : 0,
@@ -1461,7 +1421,7 @@
}
};
- c3_chart_internal_fn.updateTargets = function (targets) {
+ ChartInternal.prototype.updateTargets = function (targets) {
var $$ = this;
/*-- Main --*/
@@ -1489,14 +1449,14 @@
// 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,
@@ -1733,7 +1693,7 @@
});
};
- c3_chart_internal_fn.updateAndRedraw = function (options) {
+ ChartInternal.prototype.updateAndRedraw = function (options) {
var $$ = this,
config = $$.config,
transitions;
@@ -1761,7 +1721,7 @@
// Draw with new sizes & scales
$$.redraw(options, transitions);
};
- c3_chart_internal_fn.redrawWithoutRescale = function () {
+ ChartInternal.prototype.redrawWithoutRescale = function () {
this.redraw({
withY: false,
withSubchart: false,
@@ -1770,23 +1730,23 @@
});
};
- 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,
@@ -1818,24 +1778,24 @@
}
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()) {
@@ -1845,16 +1805,16 @@
}
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,
@@ -1889,7 +1849,7 @@
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) {
@@ -1900,7 +1860,7 @@
}
};
- 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);
@@ -1912,7 +1872,7 @@
$$.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) {
@@ -1929,7 +1889,7 @@
$$.transformAll(false);
};
- c3_chart_internal_fn.observeInserted = function (selection) {
+ ChartInternal.prototype.observeInserted = function (selection) {
var $$ = this,
observer;
if (typeof MutationObserver === 'undefined') {
@@ -1964,10 +1924,14 @@
}
});
});
- 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;
@@ -2037,8 +2001,9 @@
}
};
- c3_chart_internal_fn.generateResize = function () {
+ ChartInternal.prototype.generateResize = function () {
var resizeFunctions = [];
+
function callResizeFunctions() {
resizeFunctions.forEach(function (f) {
f();
@@ -2058,7 +2023,7 @@
return callResizeFunctions;
};
- c3_chart_internal_fn.endall = function (transition, callback) {
+ ChartInternal.prototype.endall = function (transition, callback) {
var n = 0;
transition.each(function () {
++n;
@@ -2068,7 +2033,7 @@
}
});
};
- c3_chart_internal_fn.generateWait = function () {
+ ChartInternal.prototype.generateWait = function () {
var transitionsToWait = [],
f = function f(callback) {
var timer = setInterval(function () {
@@ -2098,7 +2063,7 @@
return f;
};
- c3_chart_internal_fn.parseDate = function (date) {
+ ChartInternal.prototype.parseDate = function (date) {
var $$ = this,
parsedDate;
if (date instanceof Date) {
@@ -2116,7 +2081,7 @@
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
@@ -2132,22 +2097,8 @@
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 */
@@ -2251,16 +2202,26 @@
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);
@@ -2277,16 +2238,26 @@
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);
@@ -2303,16 +2274,26 @@
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);
@@ -2329,16 +2310,26 @@
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);
@@ -2359,36 +2350,66 @@
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);
@@ -2409,36 +2430,66 @@
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);
@@ -2457,26 +2508,46 @@
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);
@@ -2495,26 +2566,46 @@
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);
@@ -2536,41 +2627,76 @@
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);
@@ -2592,41 +2718,76 @@
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);
@@ -2642,11 +2803,16 @@
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);
@@ -2662,11 +2828,16 @@
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);
@@ -2682,11 +2853,16 @@
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);
@@ -2702,11 +2878,16 @@
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);
@@ -2725,26 +2906,46 @@
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);
@@ -2763,26 +2964,46 @@
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);
@@ -2799,16 +3020,26 @@
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);
@@ -2825,16 +3056,26 @@
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.
@@ -2927,7 +3168,10 @@
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);
};
@@ -2952,15 +3196,24 @@
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
@@ -3336,32 +3589,82 @@
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.";
@@ -3405,8 +3708,8 @@
/* 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) {
@@ -3416,7 +3719,7 @@
}
// 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) {
@@ -3442,7 +3745,7 @@
};
}
};
- c3_chart_fn.axis.min = function (min) {
+ Chart.prototype.axis.min = function (min) {
var $$ = this.internal,
config = $$.config;
if (arguments.length) {
@@ -3468,7 +3771,7 @@
};
}
};
- 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);
@@ -3484,7 +3787,7 @@
}
};
- c3_chart_fn.category = function (i, category) {
+ Chart.prototype.category = function (i, category) {
var $$ = this.internal,
config = $$.config;
if (arguments.length > 1) {
@@ -3493,7 +3796,7 @@
}
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) {
@@ -3504,7 +3807,7 @@
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;
@@ -3512,12 +3815,12 @@
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);
@@ -3552,21 +3855,21 @@
};
// 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) {
@@ -3577,18 +3880,18 @@
}
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,
@@ -3745,7 +4048,7 @@
});
};
- c3_chart_internal_fn.generateFlow = function (args) {
+ ChartInternal.prototype.generateFlow = function (args) {
var $$ = this,
config = $$.config,
d3 = $$.d3;
@@ -3877,7 +4180,7 @@
};
};
- c3_chart_fn.focus = function (targetIds) {
+ Chart.prototype.focus = function (targetIds) {
var $$ = this.internal,
candidates;
@@ -3896,7 +4199,7 @@
});
};
- c3_chart_fn.defocus = function (targetIds) {
+ Chart.prototype.defocus = function (targetIds) {
var $$ = this.internal,
candidates;
@@ -3913,7 +4216,7 @@
$$.defocusedTargetIds = targetIds;
};
- c3_chart_fn.revert = function (targetIds) {
+ Chart.prototype.revert = function (targetIds) {
var $$ = this.internal,
candidates;
@@ -3935,7 +4238,7 @@
$$.defocusedTargetIds = [];
};
- c3_chart_fn.xgrids = function (grids) {
+ Chart.prototype.xgrids = function (grids) {
var $$ = this.internal,
config = $$.config;
if (!grids) {
@@ -3945,17 +4248,17 @@
$$.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) {
@@ -3965,17 +4268,17 @@
$$.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)) {
@@ -3986,19 +4289,19 @@
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
@@ -4007,7 +4310,7 @@
}
// 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) {
@@ -4047,7 +4350,7 @@
}
};
- c3_chart_fn.unload = function (args) {
+ Chart.prototype.unload = function (args) {
var $$ = this.internal;
args = args || {};
if (args instanceof Array) {
@@ -4063,7 +4366,7 @@
});
};
- c3_chart_fn.regions = function (regions) {
+ Chart.prototype.regions = function (regions) {
var $$ = this.internal,
config = $$.config;
if (!regions) {
@@ -4073,7 +4376,7 @@
$$.redrawWithoutRescale();
return config.regions;
};
- c3_chart_fn.regions.add = function (regions) {
+ Chart.prototype.regions.add = function (regions) {
var $$ = this.internal,
config = $$.config;
if (!regions) {
@@ -4083,7 +4386,7 @@
$$.redrawWithoutRescale();
return config.regions;
};
- c3_chart_fn.regions.remove = function (options) {
+ Chart.prototype.regions.remove = function (options) {
var $$ = this.internal,
config = $$.config,
duration,
@@ -4115,7 +4418,7 @@
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 () {
@@ -4126,7 +4429,7 @@
});
}));
};
- c3_chart_fn.select = function (ids, indices, resetOther) {
+ Chart.prototype.select = function (ids, indices, resetOther) {
var $$ = this.internal,
d3 = $$.d3,
config = $$.config;
@@ -4155,7 +4458,7 @@
}
});
};
- c3_chart_fn.unselect = function (ids, indices) {
+ Chart.prototype.unselect = function (ids, indices) {
var $$ = this.internal,
d3 = $$.d3,
config = $$.config;
@@ -4183,7 +4486,7 @@
});
};
- c3_chart_fn.show = function (targetIds, options) {
+ Chart.prototype.show = function (targetIds, options) {
var $$ = this.internal,
targets;
@@ -4204,7 +4507,7 @@
$$.redraw({ withUpdateOrgXDomain: true, withUpdateXDomain: true, withLegend: true });
};
- c3_chart_fn.hide = function (targetIds, options) {
+ Chart.prototype.hide = function (targetIds, options) {
var $$ = this.internal,
targets;
@@ -4226,7 +4529,7 @@
$$.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) {
@@ -4234,8 +4537,8 @@
});
};
- 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,
@@ -4266,20 +4569,20 @@
$$.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 };
@@ -4290,7 +4593,7 @@
$$.updateAndRedraw(options);
};
- c3_chart_fn.x = function (x) {
+ Chart.prototype.x = function (x) {
var $$ = this.internal;
if (arguments.length) {
$$.updateTargetX($$.data.targets, x);
@@ -4298,7 +4601,7 @@
}
return $$.data.xs;
};
- c3_chart_fn.xs = function (xs) {
+ Chart.prototype.xs = function (xs) {
var $$ = this.internal;
if (arguments.length) {
$$.updateTargetXs($$.data.targets, xs);
@@ -4307,7 +4610,7 @@
return $$.data.xs;
};
- c3_chart_fn.zoom = function (domain) {
+ Chart.prototype.zoom = function (domain) {
var $$ = this.internal;
if (domain) {
if ($$.isTimeSeries()) {
@@ -4327,12 +4630,12 @@
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();
@@ -4342,7 +4645,7 @@
}
};
- c3_chart_fn.zoom.max = function (max) {
+ Chart.prototype.zoom.max = function (max) {
var $$ = this.internal,
config = $$.config,
d3 = $$.d3;
@@ -4353,7 +4656,7 @@
}
};
- c3_chart_fn.zoom.min = function (min) {
+ Chart.prototype.zoom.min = function (min) {
var $$ = this.internal,
config = $$.config,
d3 = $$.d3;
@@ -4364,7 +4667,7 @@
}
};
- 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);
@@ -4380,7 +4683,7 @@
}
};
- c3_chart_internal_fn.initPie = function () {
+ ChartInternal.prototype.initPie = function () {
var $$ = this,
d3 = $$.d3;
$$.pie = d3.pie().value(function (d) {
@@ -4402,7 +4705,7 @@
$$.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,
@@ -4414,14 +4717,14 @@
$$.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,
@@ -4460,7 +4763,7 @@
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,
@@ -4482,7 +4785,7 @@
return newArc;
};
- c3_chart_internal_fn.getSvgArcExpanded = function (rate) {
+ ChartInternal.prototype.getSvgArcExpanded = function (rate) {
rate = rate || 1;
var $$ = this,
hasGaugeType = $$.hasType('gauge'),
@@ -4499,11 +4802,11 @@
};
};
- 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),
@@ -4536,14 +4839,14 @@
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,
@@ -4552,7 +4855,7 @@
});
};
- c3_chart_internal_fn.textForArcLabel = function (d) {
+ ChartInternal.prototype.textForArcLabel = function (d) {
var $$ = this,
updated,
value,
@@ -4573,14 +4876,14 @@
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;
@@ -4609,7 +4912,7 @@
});
};
- c3_chart_internal_fn.unexpandArc = function (targetIds) {
+ ChartInternal.prototype.unexpandArc = function (targetIds) {
var $$ = this;
if ($$.transiting) {
@@ -4624,7 +4927,7 @@
$$.svg.selectAll('.' + CLASS.arc);
};
- c3_chart_internal_fn.expandDuration = function (id) {
+ ChartInternal.prototype.expandDuration = function (id) {
var $$ = this,
config = $$.config;
@@ -4639,13 +4942,13 @@
}
};
- 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;
@@ -4658,14 +4961,14 @@
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;
@@ -4677,18 +4980,18 @@
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,
@@ -4706,13 +5009,13 @@
//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,
@@ -4887,7 +5190,7 @@
$$.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);
@@ -4896,11 +5199,11 @@
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;
@@ -4908,10 +5211,10 @@
}
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++) {
@@ -4922,66 +5225,66 @@
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 = '';
@@ -4990,110 +5293,110 @@
}
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,
@@ -5125,7 +5428,7 @@
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,
@@ -5148,7 +5451,7 @@
} : null;
};
- c3_chart_internal_fn.getDefaultConfig = function () {
+ ChartInternal.prototype.getDefaultConfig = function () {
var config = {
bindto: '#chart',
svg_classname: undefined,
@@ -5394,9 +5697,9 @@
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,
@@ -5424,7 +5727,7 @@
});
};
- 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,
@@ -5447,7 +5750,7 @@
throw error;
});
};
- c3_chart_internal_fn.convertXsvToData = function (xsv) {
+ ChartInternal.prototype.convertXsvToData = function (xsv) {
var keys = xsv.columns,
rows = xsv;
if (rows.length === 0) {
@@ -5460,7 +5763,7 @@
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,
@@ -5495,7 +5798,7 @@
}
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('.');
@@ -5515,7 +5818,7 @@
* @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];
@@ -5537,7 +5840,7 @@
* @param {any[][]} columns The column data
* @return {Object}
*/
- c3_chart_internal_fn.convertColumnsToData = function (columns) {
+ ChartInternal.prototype.convertColumnsToData = function (columns) {
var newRows = [];
var keys = [];
@@ -5566,7 +5869,7 @@
* @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,
@@ -5697,20 +6000,20 @@
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) : [];
@@ -5721,26 +6024,26 @@
});
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) {
@@ -5749,13 +6052,13 @@
}
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) {
@@ -5764,7 +6067,7 @@
$$.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]) {
@@ -5772,7 +6075,7 @@
}
});
};
- c3_chart_internal_fn.generateTargetX = function (rawX, id, index) {
+ ChartInternal.prototype.generateTargetX = function (rawX, id, index) {
var $$ = this,
x;
if ($$.isTimeSeries()) {
@@ -5784,31 +6087,35 @@
}
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++) {
@@ -5818,19 +6125,19 @@
}
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) {
@@ -5846,7 +6153,7 @@
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) {
@@ -5854,12 +6161,12 @@
}
}
};
- 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) {
@@ -5867,12 +6174,12 @@
}
}
};
- 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] = [];
@@ -5882,7 +6189,7 @@
});
return ys;
};
- c3_chart_internal_fn.checkValueInTargets = function (targets, checker) {
+ ChartInternal.prototype.checkValueInTargets = function (targets, checker) {
var ids = Object.keys(targets),
i,
j,
@@ -5897,25 +6204,25 @@
}
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(),
@@ -5938,26 +6245,26 @@
};
}
};
- 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,
@@ -5968,7 +6275,7 @@
};
});
};
- 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;
@@ -5977,7 +6284,7 @@
}
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;
@@ -5988,12 +6295,12 @@
}).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;
@@ -6005,7 +6312,7 @@
// 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;
@@ -6033,7 +6340,7 @@
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,
@@ -6042,7 +6349,7 @@
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;
@@ -6067,7 +6374,7 @@
return converted;
};
- c3_chart_internal_fn.updateDataAttributes = function (name, attrs) {
+ ChartInternal.prototype.updateDataAttributes = function (name, attrs) {
var $$ = this,
config = $$.config,
current = config['data_' + name];
@@ -6077,11 +6384,13 @@
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
@@ -6118,7 +6427,7 @@
args.done();
}
};
- c3_chart_internal_fn.loadFromArgs = function (args) {
+ ChartInternal.prototype.loadFromArgs = function (args) {
var $$ = this;
if (args.data) {
$$.load($$.convertDataToTargets(args.data), args);
@@ -6136,7 +6445,7 @@
$$.load(null, args);
}
};
- c3_chart_internal_fn.unload = function (targetIds, done) {
+ ChartInternal.prototype.unload = function (targetIds, done) {
var $$ = this;
if (!done) {
done = function done() {};
@@ -6167,7 +6476,7 @@
});
};
- c3_chart_internal_fn.getYDomainMin = function (targets) {
+ ChartInternal.prototype.getYDomainMin = function (targets) {
var $$ = this,
config = $$.config,
ids = $$.mapToIds(targets),
@@ -6213,7 +6522,7 @@
return $$.d3.min(ys[key]);
}));
};
- c3_chart_internal_fn.getYDomainMax = function (targets) {
+ ChartInternal.prototype.getYDomainMax = function (targets) {
var $$ = this,
config = $$.config,
ids = $$.mapToIds(targets),
@@ -6259,7 +6568,7 @@
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) {
@@ -6364,7 +6673,7 @@
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) {
@@ -6373,7 +6682,7 @@
});
});
};
- 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) {
@@ -6382,7 +6691,7 @@
});
});
};
- c3_chart_internal_fn.getXDomainPadding = function (domain) {
+ ChartInternal.prototype.getXDomainPadding = function (domain) {
var $$ = this,
config = $$.config,
diff = domain[1] - domain[0],
@@ -6408,7 +6717,7 @@
}
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],
@@ -6434,7 +6743,7 @@
}
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;
@@ -6460,7 +6769,7 @@
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];
@@ -6475,7 +6784,7 @@
return domain;
};
- c3_chart_internal_fn.drag = function (mouse) {
+ ChartInternal.prototype.drag = function (mouse) {
var $$ = this,
config = $$.config,
main = $$.main,
@@ -6542,7 +6851,7 @@
});
};
- c3_chart_internal_fn.dragstart = function (mouse) {
+ ChartInternal.prototype.dragstart = function (mouse) {
var $$ = this,
config = $$.config;
if ($$.hasArcType()) {
@@ -6556,7 +6865,7 @@
$$.dragging = true;
};
- c3_chart_internal_fn.dragend = function () {
+ ChartInternal.prototype.dragend = function () {
var $$ = this,
config = $$.config;
if ($$.hasArcType()) {
@@ -6570,7 +6879,7 @@
$$.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;
@@ -6579,25 +6888,25 @@
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,
@@ -6621,7 +6930,7 @@
return format;
};
- c3_chart_internal_fn.initGrid = function () {
+ ChartInternal.prototype.initGrid = function () {
var $$ = this,
config = $$.config,
d3 = $$.d3;
@@ -6640,7 +6949,7 @@
$$.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);
@@ -6648,7 +6957,7 @@
$$.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,
@@ -6688,7 +6997,7 @@
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);
@@ -6702,19 +7011,19 @@
$$.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,
@@ -6767,7 +7076,7 @@
// 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($$),
@@ -6777,7 +7086,7 @@
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) {
@@ -6795,15 +7104,15 @@
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,
@@ -6829,7 +7138,7 @@
}
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) {
@@ -6842,7 +7151,7 @@
return true;
};
};
- c3_chart_internal_fn.removeGridLines = function (params, forX) {
+ ChartInternal.prototype.removeGridLines = function (params, forX) {
var $$ = this,
config = $$.config,
toRemove = $$.getGridFilterToRemove(params),
@@ -6859,7 +7168,7 @@
}
};
- c3_chart_internal_fn.initEventRect = function () {
+ ChartInternal.prototype.initEventRect = function () {
var $$ = this,
config = $$.config;
@@ -6875,7 +7184,7 @@
}
}
};
- c3_chart_internal_fn.redrawEventRect = function () {
+ ChartInternal.prototype.redrawEventRect = function () {
var $$ = this,
d3 = $$.d3,
config = $$.config,
@@ -7001,11 +7310,11 @@
$$.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(),
@@ -7018,7 +7327,7 @@
eventRect.dispatchEvent(event);
};
- c3_chart_internal_fn.initLegend = function () {
+ ChartInternal.prototype.initLegend = function () {
var $$ = this;
$$.legendItemTextBox = {};
$$.legendHasRendered = false;
@@ -7032,11 +7341,11 @@
// 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 = {
@@ -7051,24 +7360,24 @@
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) {
@@ -7080,13 +7389,13 @@
}
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) {
@@ -7096,14 +7405,14 @@
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) {
@@ -7118,7 +7427,7 @@
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)) {
@@ -7128,10 +7437,10 @@
$$.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;
@@ -7379,11 +7688,11 @@
$$.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;
@@ -7395,14 +7704,14 @@
$$.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,
@@ -7414,7 +7723,7 @@
}
return xPos;
};
- c3_chart_internal_fn.regionY = function (d) {
+ ChartInternal.prototype.regionY = function (d) {
var $$ = this,
config = $$.config,
yPos,
@@ -7426,7 +7735,7 @@
}
return yPos;
};
- c3_chart_internal_fn.regionWidth = function (d) {
+ ChartInternal.prototype.regionWidth = function (d) {
var $$ = this,
config = $$.config,
start = $$.regionX(d),
@@ -7439,7 +7748,7 @@
}
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),
@@ -7452,14 +7761,14 @@
}
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,
@@ -7499,20 +7808,20 @@
}
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;
@@ -7559,7 +7868,7 @@
}
};
- 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($$),
@@ -7575,16 +7884,16 @@
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) {
@@ -7593,7 +7902,7 @@
});
}
};
- 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) {
@@ -7602,10 +7911,10 @@
});
}
};
- 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') {
@@ -7620,7 +7929,7 @@
}
return toggle;
};
- c3_chart_internal_fn.toggleShape = function (that, d, i) {
+ ChartInternal.prototype.toggleShape = function (that, d, i) {
var $$ = this,
d3 = $$.d3,
config = $$.config,
@@ -7642,11 +7951,11 @@
}
};
- 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,
@@ -7663,7 +7972,7 @@
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($$),
@@ -7676,31 +7985,31 @@
$$.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);
@@ -7717,7 +8026,7 @@
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,
@@ -7743,7 +8052,7 @@
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),
@@ -7759,7 +8068,7 @@
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 = {},
@@ -7785,7 +8094,7 @@
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) {
@@ -7793,14 +8102,14 @@
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) {
@@ -7835,7 +8144,7 @@
return offset;
};
};
- c3_chart_internal_fn.isWithinShape = function (that, d) {
+ ChartInternal.prototype.isWithinShape = function (that, d) {
var $$ = this,
shape = $$.d3.select(that),
isWithin;
@@ -7849,7 +8158,7 @@
return isWithin;
};
- c3_chart_internal_fn.getInterpolate = function (d) {
+ ChartInternal.prototype.getInterpolate = function (d) {
var $$ = this,
d3 = $$.d3,
types = {
@@ -7879,11 +8188,11 @@
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,
@@ -7917,7 +8226,7 @@
// 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);
@@ -7926,10 +8235,10 @@
}).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(),
@@ -7974,7 +8283,7 @@
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,
@@ -8003,7 +8312,7 @@
};
};
- c3_chart_internal_fn.lineWithRegions = function (d, x, y, _regions) {
+ ChartInternal.prototype.lineWithRegions = function (d, x, y, _regions) {
var $$ = this,
config = $$.config,
prev = -1,
@@ -8120,7 +8429,7 @@
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($$));
@@ -8130,10 +8439,10 @@
$$.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(),
@@ -8176,10 +8485,10 @@
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,
@@ -8207,22 +8516,22 @@
};
};
- 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;
@@ -8237,11 +8546,11 @@
};
}
};
- 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) {
@@ -8249,19 +8558,19 @@
}
$$.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) {
@@ -8270,12 +8579,12 @@
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),
@@ -8283,22 +8592,22 @@
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;
@@ -8307,11 +8616,11 @@
}
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)) {
@@ -8325,7 +8634,7 @@
return ceil10($$.getAxisWidthByAxisId('y', withoutRecompute));
}
};
- c3_chart_internal_fn.getCurrentPaddingRight = function () {
+ ChartInternal.prototype.getCurrentPaddingRight = function () {
var $$ = this,
config = $$.config,
defaultPadding = 10,
@@ -8342,7 +8651,7 @@
}
};
- c3_chart_internal_fn.getParentRectValue = function (key) {
+ ChartInternal.prototype.getParentRectValue = function (key) {
var parent = this.selectChart.node(),
v;
while (parent && parent.tagName !== 'BODY') {
@@ -8362,15 +8671,15 @@
}
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,
@@ -8383,12 +8692,12 @@
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;
@@ -8415,7 +8724,7 @@
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.
@@ -8481,7 +8790,7 @@
};
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')),
@@ -8506,13 +8815,13 @@
// 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,
@@ -8547,27 +8856,27 @@
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($$));
@@ -8577,10 +8886,10 @@
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,
@@ -8617,7 +8926,7 @@
}
}
};
- c3_chart_internal_fn.redrawForBrush = function () {
+ ChartInternal.prototype.redrawForBrush = function () {
var $$ = this,
x = $$.x,
d3 = $$.d3,
@@ -8635,7 +8944,7 @@
$$.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) {
@@ -8649,7 +8958,7 @@
$$.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;
@@ -8659,12 +8968,12 @@
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($$),
@@ -8676,7 +8985,7 @@
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($$),
@@ -8692,10 +9001,10 @@
});
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'),
@@ -8706,7 +9015,7 @@
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),
@@ -8717,7 +9026,7 @@
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,
@@ -8738,7 +9047,7 @@
}
return xPos;
};
- c3_chart_internal_fn.getYForText = function (points, d, textElement) {
+ ChartInternal.prototype.getYForText = function (points, d, textElement) {
var $$ = this,
box = textElement.getBoundingClientRect(),
yPos;
@@ -8768,15 +9077,15 @@
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',
@@ -8791,16 +9100,16 @@
}
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;
@@ -8822,7 +9131,7 @@
$$.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;
@@ -8891,7 +9200,7 @@
};
}
};
- 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,
@@ -8938,7 +9247,7 @@
}
return text + "";
};
- c3_chart_internal_fn.tooltipPosition = function (dataToShow, tWidth, tHeight, element) {
+ ChartInternal.prototype.tooltipPosition = function (dataToShow, tWidth, tHeight, element) {
var $$ = this,
config = $$.config,
d3 = $$.d3;
@@ -8974,9 +9283,12 @@
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;
@@ -8984,7 +9296,7 @@
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;
}
@@ -8998,11 +9310,11 @@
// 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) {
@@ -9013,7 +9325,7 @@
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;
@@ -9036,53 +9348,53 @@
}
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
@@ -9090,26 +9402,26 @@
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,
@@ -9156,13 +9468,13 @@
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.getZoomDomain = function () {
var $$ = this,
config = $$.config,
d3 = $$.d3,
@@ -9170,7 +9482,7 @@
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,
diff --git a/c3.min.js b/c3.min.js
index 948ac67..9a8f960 100644
--- a/c3.min.js
+++ b/c3.min.js
@@ -1,2 +1,2 @@
-/* @license C3.js v0.6.4 | (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 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",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_"};function i(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={}}var o="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},n={version:"0.6.4",chart:{fn:e.prototype,internal:{fn:i.prototype}}};function e(t){var e=this.internal=new i(this);e.loadConfig(t),e.beforeInit(t),e.init(),e.afterInit(t),function e(i,n,a){Object.keys(i).forEach(function(t){n[t]=i[t].bind(a),0/g,">"):t},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}};function p(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()}(s=p.prototype).axisX=function(t,e,i){t.attr("transform",function(t){return"translate("+Math.ceil(e(t)+i)+", 0)"})},s.axisY=function(t,e){t.attr("transform",function(t){return"translate(0,"+Math.ceil(e(t))+")"})},s.scaleExtent=function(t){var e=t[0],i=t[t.length-1];return ee.getTotalLength())break;i--}while(0=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)._writeListToPath(),t},window.SVGPathSegList.prototype.replaceItem=function(t,e){return this._checkPathSynchronizedToList(),t._owningPathSegList&&(t=t.clone()),this._checkValidIndex(e),((this._list[e]=t)._owningPathSegList=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)._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 n=this,e=function(){this.pathSegList=[]};e.prototype.appendSegment=function(t){this.pathSegList.push(t)};var i=function(t){this._string=t,this._currentIndex=0,this._endIndex=this._string.length,this._previousCommand=window.SVGPathSeg.PATHSEG_UNKNOWN,this._skipOptionalSpaces()};i.prototype._isCurrentSpace=function(){var t=this._string[this._currentIndex];return t<=" "&&(" "==t||"\n"==t||"\t"==t||"\r"==t||"\f"==t)},i.prototype._skipOptionalSpaces=function(){for(;this._currentIndex=this._endIndex||this._string.charAt(this._currentIndex)<"0"||"9"=this._endIndex||this._string.charAt(this._currentIndex)<"0"||"9"=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}},i.prototype.parseSegment=function(){var t=this._string[this._currentIndex],e=this._pathSegTypeFromChar(t);if(e==window.SVGPathSeg.PATHSEG_UNKNOWN){if(this._previousCommand==window.SVGPathSeg.PATHSEG_UNKNOWN)return null;if((e=this._nextCommandHelper(t,this._previousCommand))==window.SVGPathSeg.PATHSEG_UNKNOWN)return null}else this._currentIndex++;switch(this._previousCommand=e){case window.SVGPathSeg.PATHSEG_MOVETO_REL:return new window.SVGPathSegMovetoRel(n,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_MOVETO_ABS:return new window.SVGPathSegMovetoAbs(n,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_REL:return new window.SVGPathSegLinetoRel(n,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_ABS:return new window.SVGPathSegLinetoAbs(n,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL:return new window.SVGPathSegLinetoHorizontalRel(n,this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS:return new window.SVGPathSegLinetoHorizontalAbs(n,this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL:return new window.SVGPathSegLinetoVerticalRel(n,this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS:return new window.SVGPathSegLinetoVerticalAbs(n,this._parseNumber());case window.SVGPathSeg.PATHSEG_CLOSEPATH:return this._skipOptionalSpaces(),new window.SVGPathSegClosePath(n);case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL:var i={x1:this._parseNumber(),y1:this._parseNumber(),x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new window.SVGPathSegCurvetoCubicRel(n,i.x,i.y,i.x1,i.y1,i.x2,i.y2);case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS:return i={x1:this._parseNumber(),y1:this._parseNumber(),x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegCurvetoCubicAbs(n,i.x,i.y,i.x1,i.y1,i.x2,i.y2);case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL:return i={x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegCurvetoCubicSmoothRel(n,i.x,i.y,i.x2,i.y2);case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS:return i={x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegCurvetoCubicSmoothAbs(n,i.x,i.y,i.x2,i.y2);case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL:return i={x1:this._parseNumber(),y1:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegCurvetoQuadraticRel(n,i.x,i.y,i.x1,i.y1);case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS:return i={x1:this._parseNumber(),y1:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegCurvetoQuadraticAbs(n,i.x,i.y,i.x1,i.y1);case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL:return new window.SVGPathSegCurvetoQuadraticSmoothRel(n,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS:return new window.SVGPathSegCurvetoQuadraticSmoothAbs(n,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_ARC_REL:return i={x1:this._parseNumber(),y1:this._parseNumber(),arcAngle:this._parseNumber(),arcLarge:this._parseArcFlag(),arcSweep:this._parseArcFlag(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegArcRel(n,i.x,i.y,i.x1,i.y1,i.arcAngle,i.arcLarge,i.arcSweep);case window.SVGPathSeg.PATHSEG_ARC_ABS:return i={x1:this._parseNumber(),y1:this._parseNumber(),arcAngle:this._parseNumber(),arcLarge:this._parseArcFlag(),arcSweep:this._parseArcFlag(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegArcAbs(n,i.x,i.y,i.x1,i.y1,i.arcAngle,i.arcLarge,i.arcSweep);default:throw"Unknown path seg type."}};var a=new e,r=new i(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))}),x.axis=function(){},x.axis.labels=function(e){var i=this.internal;arguments.length&&(Object.keys(e).forEach(function(t){i.axis.setLabelText(t,e[t])}),i.axis.updateLabels())},x.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":o(t))?(P(t.x)&&(i.axis_x_max=t.x),P(t.y)&&(i.axis_y_max=t.y),P(t.y2)&&(i.axis_y2_max=t.y2)):i.axis_y_max=i.axis_y2_max=t,e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})},x.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":o(t))?(P(t.x)&&(i.axis_x_min=t.x),P(t.y)&&(i.axis_y_min=t.y),P(t.y2)&&(i.axis_y2_min=t.y2)):i.axis_y_min=i.axis_y2_min=t,e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})},x.axis.range=function(t){if(!arguments.length)return{max:this.axis.max(),min:this.axis.min()};k(t.max)&&this.axis.max(t.max),k(t.min)&&this.axis.min(t.min)},x.category=function(t,e){var i=this.internal,n=i.config;return 1'":;\[\]\/|~`{}\\])/g,"\\$1")},m.selectorTarget=function(t,e){return(e||"")+"."+Y.target+this.getTargetSelectorSuffix(t)},m.selectorTargets=function(t,e){var i=this;return(t=t||[]).length?t.map(function(t){return i.selectorTarget(t,e)}):null},m.selectorLegend=function(t){return"."+Y.legendItem+this.getTargetSelectorSuffix(t)},m.selectorLegends=function(t){var e=this;return t&&t.length?t.map(function(t){return e.selectorLegend(t)}):null},m.getClipPath=function(t){return"url("+(0<=window.navigator.appVersion.toLowerCase().indexOf("msie 9.")?"":document.URL.split("#")[0])+"#"+t+")"},m.appendClip=function(t,e){return t.append("clipPath").attr("id",e).append("rect")},m.getAxisClipX=function(t){var e=Math.max(30,this.margin.left);return t?-(1+e):-(e-1)},m.getAxisClipY=function(t){return t?-20:-this.margin.top},m.getXAxisClipX=function(){return this.getAxisClipX(!this.config.axis_rotated)},m.getXAxisClipY=function(){return this.getAxisClipY(!this.config.axis_rotated)},m.getYAxisClipX=function(){return this.config.axis_y_inner?-1:this.getAxisClipX(this.config.axis_rotated)},m.getYAxisClipY=function(){return this.getAxisClipY(this.config.axis_rotated)},m.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},m.getAxisClipHeight=function(t){return(t?this.margin.bottom:this.margin.top+this.height)+20},m.getXAxisClipWidth=function(){return this.getAxisClipWidth(!this.config.axis_rotated)},m.getXAxisClipHeight=function(){return this.getAxisClipHeight(!this.config.axis_rotated)},m.getYAxisClipWidth=function(){return this.getAxisClipWidth(this.config.axis_rotated)+(this.config.axis_y_inner?20:0)},m.getYAxisClipHeight=function(){return this.getAxisClipHeight(this.config.axis_rotated)},m.generateColor=function(){var t=this.config,e=this.d3,n=t.data_colors,a=C(t.color_pattern)?t.color_pattern:e.schemeCategory10,r=t.data_color,s=[];return function(t){var e,i=t.id||t.data&&t.data.id||t;return n[i]instanceof Function?e=n[i](t):n[i]?e=n[i]:(s.indexOf(i)<0&&s.push(i),e=a[s.indexOf(i)%a.length],n[i]=e),r instanceof Function?r(e,t):e}},m.generateLevelColor=function(){var t=this.config,n=t.color_pattern,e=t.color_threshold,a="value"===e.unit,r=e.values&&e.values.length?e.values:[],s=e.max||100;return C(t.color_threshold)?function(t){var e,i=n[n.length-1];for(e=0;eo&&(s=s.filter(function(t){return(""+t).indexOf(".")<0}));return s},m.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}},m.removeGridLines=function(t,e){var i=this.config,n=this.getGridFilterToRemove(t),a=function(t){return!n(t)},r=e?Y.xgridLines:Y.ygridLines,s=e?Y.xgridLine:Y.ygridLine;this.main.select("."+r).selectAll("."+s).filter(n).transition().duration(i.transition_duration).style("opacity",0).remove(),e?i.grid_x_lines=i.grid_x_lines.filter(a):i.grid_y_lines=i.grid_y_lines.filter(a)},m.initEventRect=function(){var t=this,e=t.config;t.main.select("."+Y.chart).append("g").attr("class",Y.eventRects).style("fill-opacity",0),t.eventRect=t.main.select("."+Y.eventRects).append("rect").attr("class",Y.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)))},m.redrawEventRect=function(){var t,e,a=this,r=a.d3,s=a.config;function o(){a.svg.select("."+Y.eventRect).style("cursor",null),a.hideXGridFocus(),a.hideTooltip(),a.unexpandCircles(),a.unexpandBars()}t=a.width,e=a.height,a.main.select("."+Y.eventRects).style("cursor",s.zoom_enabled?s.axis_rotated?"ns-resize":"ew-resize":null),a.eventRect.attr("x",0).attr("y",0).attr("width",t).attr("height",e).on("mouseout",s.interaction_enabled?function(){s&&(a.hasArcType()||o())}:null).on("mousemove",s.interaction_enabled?function(){var t,e,i,n;a.dragging||a.hasArcType(t)||(t=a.filterTargetsToShow(a.data.targets),e=r.mouse(this),i=a.findClosestFromTargets(t,e),!a.mouseover||i&&i.id===a.mouseover.id||(s.data_onmouseout.call(a.api,a.mouseover),a.mouseover=void 0),i?(n=(a.isScatterType(i)||!s.tooltip_grouped?[i]:a.filterByX(t,i.x)).map(function(t){return a.addName(t)}),a.showTooltip(n,this),s.point_focus_expand_enabled&&(a.unexpandCircles(),n.forEach(function(t){a.expandCircles(t.index,t.id,!1)})),a.expandBars(i.index,i.id,!0),a.showXGridFocus(n),(a.isBarType(i.id)||a.dist(i,e)i.bar_width_max?i.bar_width_max:n},m.getBars=function(t,e){return(e?this.main.selectAll("."+Y.bars+this.getTargetSelectorSuffix(e)):this.main).selectAll("."+Y.bar+(P(t)?"-"+t:""))},m.expandBars=function(t,e,i){i&&this.unexpandBars(),this.getBars(t,e).classed(Y.EXPANDED,!0)},m.unexpandBars=function(t){this.getBars(t).classed(Y.EXPANDED,!1)},m.generateDrawBar=function(t,e){var r=this.config,s=this.generateGetBarPoints(t,e);return function(t,e){var i=s(t,e),n=r.axis_rotated?1:0,a=r.axis_rotated?0:1;return"M "+i[0][n]+","+i[0][a]+" L"+i[1][n]+","+i[1][a]+" L"+i[2][n]+","+i[2][a]+" L"+i[3][n]+","+i[3][a]+" z"}},m.generateGetBarPoints=function(t,e){var s=this,i=e?s.subXAxis:s.xAxis,n=t.__max__+1,o=s.getBarW(i,n),c=s.getShapeX(o,n,t,!!e),d=s.getShapeY(!!e),u=s.getShapeOffset(s.isBarType,t,!!e),l=o*(s.config.bar_space/2),h=e?s.getSubYScale:s.getYScale;return function(t,e){var i=h.call(s,t.id)(0),n=u(t,e)||i,a=c(t),r=d(t);return s.config.axis_rotated&&(0r.width?n=r.width-s.width:n<0&&(n=4)),n},m.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||(nthis.height&&(n=this.height-4)),n},m.initTitle=function(){this.title=this.svg.append("text").text(this.config.title_text).attr("class",this.CLASS.title)},m.redrawTitle=function(){var t=this;t.title.attr("x",t.xForTitle.bind(t)).attr("y",t.yForTitle.bind(t))},m.xForTitle=function(){var t=this,e=t.config,i=e.title_position||"left";return 0<=i.indexOf("right")?t.currentWidth-t.getTextRect(t.title.node().textContent,t.CLASS.title,t.title.node()).width-e.title_padding.right:0<=i.indexOf("center")?(t.currentWidth-t.getTextRect(t.title.node().textContent,t.CLASS.title,t.title.node()).width)/2:e.title_padding.left},m.yForTitle=function(){var t=this;return t.config.title_padding.top+t.getTextRect(t.title.node().textContent,t.CLASS.title,t.title.node()).height},m.getTitlePadding=function(){return this.yForTitle()+this.config.title_padding.bottom},m.initTooltip=function(){var t,e=this,i=e.config;if(e.tooltip=e.selectChart.style("position","relative").append("div").attr("class",Y.tooltipContainer).style("position","absolute").style("pointer-events","none").style("display","none"),i.tooltip_init_show){if(e.isTimeSeries()&&c(i.tooltip_init_x)){for(i.tooltip_init_x=e.parseDate(i.tooltip_init_x),t=0;t"+(s||0===s?""+s+" |
":"")),void 0!==(o=_(f(t[r].value,t[r].ratio,t[r].id,t[r].index,t))))){if(null===t[r].name)continue;c=_(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+="",a+=""+c+" | ",a+=""+o+" | ",a+="
"}return a+""},m.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),cd.currentHeight&&(o-=i+30)),o<0&&(o=0),{top:o,left:r}},m.showTooltip=function(t,e){var i,n,a,r=this,s=r.config,o=r.hasArcType(),c=t.filter(function(t){return t&&P(t.value)}),d=s.tooltip_position||m.tooltipPosition;0!==c.length&&s.tooltip_show&&(r.tooltip.html(s.tooltip_contents.call(r,t,r.axis.getXAxisTickFormat(),r.getYFormat(o),r.color)).style("display","block"),i=r.tooltip.property("offsetWidth"),n=r.tooltip.property("offsetHeight"),a=d.call(this,c,i,n,e),r.tooltip.style("top",a.top+"px").style("left",a.left+"px"))},m.hideTooltip=function(){this.tooltip.style("display","none")},m.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)},m.hasType=function(i,t){var n=this.config.data_types,a=!1;return(t=t||this.data.targets)&&t.length?t.forEach(function(t){var e=n[t.id];(e&&0<=e.indexOf(i)||!e&&"line"===i)&&(a=!0)}):Object.keys(n).length?Object.keys(n).forEach(function(t){n[t]===i&&(a=!0)}):a=this.config.data_type===i,a},m.hasArcType=function(t){return this.hasType("pie",t)||this.hasType("donut",t)||this.hasType("gauge",t)},m.isLineType=function(t){var e=this.config,i=c(t)?t:t.id;return!e.data_types[i]||0<=["line","spline","area","area-spline","step","area-step"].indexOf(e.data_types[i])},m.isStepType=function(t){var e=c(t)?t:t.id;return 0<=["step","area-step"].indexOf(this.config.data_types[e])},m.isSplineType=function(t){var e=c(t)?t:t.id;return 0<=["spline","area-spline"].indexOf(this.config.data_types[e])},m.isAreaType=function(t){var e=c(t)?t:t.id;return 0<=["area","area-spline","area-step"].indexOf(this.config.data_types[e])},m.isBarType=function(t){var e=c(t)?t:t.id;return"bar"===this.config.data_types[e]},m.isScatterType=function(t){var e=c(t)?t:t.id;return"scatter"===this.config.data_types[e]},m.isPieType=function(t){var e=c(t)?t:t.id;return"pie"===this.config.data_types[e]},m.isGaugeType=function(t){var e=c(t)?t:t.id;return"gauge"===this.config.data_types[e]},m.isDonutType=function(t){var e=c(t)?t:t.id;return"donut"===this.config.data_types[e]},m.isArcType=function(t){return this.isPieType(t)||this.isDonutType(t)||this.isGaugeType(t)},m.lineData=function(t){return this.isLineType(t)?[t]:[]},m.arcData=function(t){return this.isArcType(t.data)?[t]:[]},m.barData=function(t){return this.isBarType(t)?t.values:[]},m.lineOrScatterData=function(t){return this.isLineType(t)||this.isScatterType(t)?t.values:[]},m.barOrLineData=function(t){return this.isBarType(t)||this.isLineType(t)?t.values:[]},m.isSafari=function(){var t=window.navigator.userAgent;return 0<=t.indexOf("Safari")&&t.indexOf("Chrome")<0},m.isChrome=function(){return 0<=window.navigator.userAgent.indexOf("Chrome")},m.initZoom=function(){var e,i=this,n=i.d3,a=i.config;return i.zoom=n.zoom().on("start",function(){var t=n.event.sourceEvent;t&&"brush"===t.type||(e=t,a.zoom_onzoomstart.call(i.api,t))}).on("zoom",function(){var t=n.event.sourceEvent;t&&"brush"===t.type||i.redrawForZoom.call(i)}).on("end",function(){var t=n.event.sourceEvent;t&&"brush"===t.type||t&&e.clientX===t.clientX&&e.clientY===t.clientY||a.zoom_onzoomend.call(i.api,i.x.orgDomain())}),i.zoom.updateDomain=function(){return n.event&&n.event.transform&&i.x.domain(n.event.transform.rescaleX(i.subX).domain()),this},i.zoom.updateExtent=function(){return this.scaleExtent([1,1/0]).translateExtent([[0,0],[i.width,i.height]]).extent([[0,0],[i.width,i.height]]),this},i.zoom.update=function(){return this.updateExtent().updateDomain()},i.zoom.updateExtent()},m.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)},m.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])]},m.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()))},n});
\ No newline at end of file
+/* @license C3.js v0.6.5 | (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 u(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 u(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/g,">"):t},d=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.owner=e,this.d3=e.d3,this.internal=i};d.prototype.init=function(){var t=this.owner,e=t.config,i=t.main;t.axes.x=i.append("g").attr("class",Y.axis+" "+Y.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",Y.axisXLabel).attr("transform",e.axis_rotated?"rotate(-90)":"").style("text-anchor",this.textAnchorForXAxisLabel.bind(this)),t.axes.y=i.append("g").attr("class",Y.axis+" "+Y.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",Y.axisYLabel).attr("transform",e.axis_rotated?"":"rotate(-90)").style("text-anchor",this.textAnchorForYAxisLabel.bind(this)),t.axes.y2=i.append("g").attr("class",Y.axis+" "+Y.axisY2).attr("transform",t.getTranslate("y2")).style("visibility",e.axis_y2_show?"visible":"hidden"),t.axes.y2.append("text").attr("class",Y.axisY2Label).attr("transform",e.axis_rotated?"":"rotate(-90)").style("text-anchor",this.textAnchorForY2AxisLabel.bind(this))},d.prototype.getXAxis=function(t,e,i,n,r,a,o){var s=this.owner,c=s.config,d={isCategory:s.isCategorized(),withOuterTick:r,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:o?0:c.axis_x_tick_rotate,withoutTransition:a},u=new this.internal(this,d).axis.scale(t).orient(e);return s.isTimeSeries()&&n&&"function"!=typeof n&&(n=n.map(function(t){return s.parseDate(t)})),u.tickFormat(i).tickValues(n),s.isCategorized()&&(u.tickCentered(c.axis_x_tick_centered),l(c.axis_x_tick_culling)&&(c.axis_x_tick_culling=!1)),u},d.prototype.updateXAxisTickValues=function(t,e){var i,n=this.owner,r=n.config;return(r.axis_x_tick_fit||r.axis_x_tick_count)&&(i=this.generateTickValues(n.mapTargetsToUniqueXs(t),r.axis_x_tick_count,n.isTimeSeries())),e?e.tickValues(i):(n.xAxis.tickValues(i),n.subXAxis.tickValues(i)),i},d.prototype.getYAxis=function(t,e,i,n,r,a,o){var s=this.owner,c=s.config,d={withOuterTick:r,withoutTransition:a,tickTextRotate:o?0:c.axis_y_tick_rotate},u=new this.internal(this,d).axis.scale(t).orient(e).tickFormat(i);return s.isTimeSeriesY()?u.ticks(c.axis_y_tick_time_type,c.axis_y_tick_time_interval):u.tickValues(n),u},d.prototype.getId=function(t){var e=this.owner.config;return t in e.data_axes?e.data_axes[t]:"y"},d.prototype.getXAxisTickFormat=function(){var e=this.owner,i=e.config,n=e.isTimeSeries()?e.defaultAxisTimeFormat:e.isCategorized()?e.categoryName:function(t){return t};return i.axis_x_tick_format&&(h(i.axis_x_tick_format)?n=i.axis_x_tick_format:e.isTimeSeries()&&(n=function(t){return t?e.axisTimeFormat(i.axis_x_tick_format)(t):""})),h(n)?function(t){return n.call(e,t)}:n},d.prototype.getTickValues=function(t,e){return t||(e?e.tickValues():void 0)},d.prototype.getXAxisTickValues=function(){return this.getTickValues(this.owner.config.axis_x_tick_values,this.owner.xAxis)},d.prototype.getYAxisTickValues=function(){return this.getTickValues(this.owner.config.axis_y_tick_values,this.owner.yAxis)},d.prototype.getY2AxisTickValues=function(){return this.getTickValues(this.owner.config.axis_y2_tick_values,this.owner.y2Axis)},d.prototype.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},d.prototype.getLabelText=function(t){var e=this.getLabelOptionByAxisId(t);return c(e)?e:e?e.text:null},d.prototype.setLabelText=function(t,e){var i=this.owner.config,n=this.getLabelOptionByAxisId(t);c(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)},d.prototype.getLabelPosition=function(t,e){var i=this.getLabelOptionByAxisId(t),n=i&&"object"===(void 0===i?"undefined":s(i))&&i.position?i.position:e;return{isInner:0<=n.indexOf("inner"),isOuter:0<=n.indexOf("outer"),isLeft:0<=n.indexOf("left"),isCenter:0<=n.indexOf("center"),isRight:0<=n.indexOf("right"),isTop:0<=n.indexOf("top"),isMiddle:0<=n.indexOf("middle"),isBottom:0<=n.indexOf("bottom")}},d.prototype.getXAxisLabelPosition=function(){return this.getLabelPosition("x",this.owner.config.axis_rotated?"inner-top":"inner-right")},d.prototype.getYAxisLabelPosition=function(){return this.getLabelPosition("y",this.owner.config.axis_rotated?"inner-right":"inner-top")},d.prototype.getY2AxisLabelPosition=function(){return this.getLabelPosition("y2",this.owner.config.axis_rotated?"inner-right":"inner-top")},d.prototype.getLabelPositionById=function(t){return"y2"===t?this.getY2AxisLabelPosition():"y"===t?this.getYAxisLabelPosition():this.getXAxisLabelPosition()},d.prototype.textForXAxisLabel=function(){return this.getLabelText("x")},d.prototype.textForYAxisLabel=function(){return this.getLabelText("y")},d.prototype.textForY2AxisLabel=function(){return this.getLabelText("y2")},d.prototype.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},d.prototype.dxForAxisLabel=function(t,e){return t?e.isLeft?"0.5em":e.isRight?"-0.5em":"0":e.isTop?"-0.5em":e.isBottom?"0.5em":"0"},d.prototype.textAnchorForAxisLabel=function(t,e){return t?e.isLeft?"start":e.isCenter?"middle":"end":e.isBottom?"start":e.isMiddle?"middle":"end"},d.prototype.xForXAxisLabel=function(){return this.xForAxisLabel(!this.owner.config.axis_rotated,this.getXAxisLabelPosition())},d.prototype.xForYAxisLabel=function(){return this.xForAxisLabel(this.owner.config.axis_rotated,this.getYAxisLabelPosition())},d.prototype.xForY2AxisLabel=function(){return this.xForAxisLabel(this.owner.config.axis_rotated,this.getY2AxisLabelPosition())},d.prototype.dxForXAxisLabel=function(){return this.dxForAxisLabel(!this.owner.config.axis_rotated,this.getXAxisLabelPosition())},d.prototype.dxForYAxisLabel=function(){return this.dxForAxisLabel(this.owner.config.axis_rotated,this.getYAxisLabelPosition())},d.prototype.dxForY2AxisLabel=function(){return this.dxForAxisLabel(this.owner.config.axis_rotated,this.getY2AxisLabelPosition())},d.prototype.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"},d.prototype.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)},d.prototype.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)},d.prototype.textAnchorForXAxisLabel=function(){var t=this.owner;return this.textAnchorForAxisLabel(!t.config.axis_rotated,this.getXAxisLabelPosition())},d.prototype.textAnchorForYAxisLabel=function(){var t=this.owner;return this.textAnchorForAxisLabel(t.config.axis_rotated,this.getYAxisLabelPosition())},d.prototype.textAnchorForY2AxisLabel=function(){var t=this.owner;return this.textAnchorForAxisLabel(t.config.axis_rotated,this.getY2AxisLabelPosition())},d.prototype.getMaxTickWidth=function(t,e){var i,n,r,a,o=this.owner,s=o.config,c=0;return e&&o.currentMaxTickWidths[t]||(o.svg&&(i=o.filterTargetsToShow(o.data.targets),"y"===t?(n=o.y.copy().domain(o.getYDomain(i,"y")),r=this.getYAxis(n,o.yOrient,s.axis_y_tick_format,o.yAxisTickValues,!1,!0,!0)):"y2"===t?(n=o.y2.copy().domain(o.getYDomain(i,"y2")),r=this.getYAxis(n,o.y2Orient,s.axis_y2_tick_format,o.y2AxisTickValues,!1,!0,!0)):(n=o.x.copy().domain(o.getXDomain(i)),r=this.getXAxis(n,o.xOrient,o.xAxisTickFormat,o.xAxisTickValues,!1,!0,!0),this.updateXAxisTickValues(i,r)),(a=o.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(r).each(function(){o.d3.select(this).selectAll("text").each(function(){var t=this.getBoundingClientRect();ce.getTotalLength())break;i--}while(0=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)._writeListToPath(),t},window.SVGPathSegList.prototype.replaceItem=function(t,e){return this._checkPathSynchronizedToList(),t._owningPathSegList&&(t=t.clone()),this._checkValidIndex(e),((this._list[e]=t)._owningPathSegList=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)._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 n=this,e=function(){this.pathSegList=[]};e.prototype.appendSegment=function(t){this.pathSegList.push(t)};var i=function(t){this._string=t,this._currentIndex=0,this._endIndex=this._string.length,this._previousCommand=window.SVGPathSeg.PATHSEG_UNKNOWN,this._skipOptionalSpaces()};i.prototype._isCurrentSpace=function(){var t=this._string[this._currentIndex];return t<=" "&&(" "==t||"\n"==t||"\t"==t||"\r"==t||"\f"==t)},i.prototype._skipOptionalSpaces=function(){for(;this._currentIndex=this._endIndex||this._string.charAt(this._currentIndex)<"0"||"9"=this._endIndex||this._string.charAt(this._currentIndex)<"0"||"9"=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}},i.prototype.parseSegment=function(){var t=this._string[this._currentIndex],e=this._pathSegTypeFromChar(t);if(e==window.SVGPathSeg.PATHSEG_UNKNOWN){if(this._previousCommand==window.SVGPathSeg.PATHSEG_UNKNOWN)return null;if((e=this._nextCommandHelper(t,this._previousCommand))==window.SVGPathSeg.PATHSEG_UNKNOWN)return null}else this._currentIndex++;switch(this._previousCommand=e){case window.SVGPathSeg.PATHSEG_MOVETO_REL:return new window.SVGPathSegMovetoRel(n,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_MOVETO_ABS:return new window.SVGPathSegMovetoAbs(n,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_REL:return new window.SVGPathSegLinetoRel(n,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_ABS:return new window.SVGPathSegLinetoAbs(n,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL:return new window.SVGPathSegLinetoHorizontalRel(n,this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS:return new window.SVGPathSegLinetoHorizontalAbs(n,this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL:return new window.SVGPathSegLinetoVerticalRel(n,this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS:return new window.SVGPathSegLinetoVerticalAbs(n,this._parseNumber());case window.SVGPathSeg.PATHSEG_CLOSEPATH:return this._skipOptionalSpaces(),new window.SVGPathSegClosePath(n);case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL:var i={x1:this._parseNumber(),y1:this._parseNumber(),x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new window.SVGPathSegCurvetoCubicRel(n,i.x,i.y,i.x1,i.y1,i.x2,i.y2);case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS:return i={x1:this._parseNumber(),y1:this._parseNumber(),x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegCurvetoCubicAbs(n,i.x,i.y,i.x1,i.y1,i.x2,i.y2);case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL:return i={x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegCurvetoCubicSmoothRel(n,i.x,i.y,i.x2,i.y2);case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS:return i={x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegCurvetoCubicSmoothAbs(n,i.x,i.y,i.x2,i.y2);case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL:return i={x1:this._parseNumber(),y1:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegCurvetoQuadraticRel(n,i.x,i.y,i.x1,i.y1);case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS:return i={x1:this._parseNumber(),y1:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegCurvetoQuadraticAbs(n,i.x,i.y,i.x1,i.y1);case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL:return new window.SVGPathSegCurvetoQuadraticSmoothRel(n,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS:return new window.SVGPathSegCurvetoQuadraticSmoothAbs(n,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_ARC_REL:return i={x1:this._parseNumber(),y1:this._parseNumber(),arcAngle:this._parseNumber(),arcLarge:this._parseArcFlag(),arcSweep:this._parseArcFlag(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegArcRel(n,i.x,i.y,i.x1,i.y1,i.arcAngle,i.arcLarge,i.arcSweep);case window.SVGPathSeg.PATHSEG_ARC_ABS:return i={x1:this._parseNumber(),y1:this._parseNumber(),arcAngle:this._parseNumber(),arcLarge:this._parseArcFlag(),arcSweep:this._parseArcFlag(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegArcAbs(n,i.x,i.y,i.x1,i.y1,i.arcAngle,i.arcLarge,i.arcSweep);default:throw"Unknown path seg type."}};var r=new e,a=new i(t);if(!a.initialCommandIsMoveTo())return[];for(;a.hasMoreData();){var o=a.parseSegment();if(!o)return[];r.appendSegment(o)}return r.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))}),(n.prototype.axis=function(){}).labels=function(e){var i=this.internal;arguments.length&&(Object.keys(e).forEach(function(t){i.axis.setLabelText(t,e[t])}),i.axis.updateLabels())},n.prototype.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":s(t))?(P(t.x)&&(i.axis_x_max=t.x),P(t.y)&&(i.axis_y_max=t.y),P(t.y2)&&(i.axis_y2_max=t.y2)):i.axis_y_max=i.axis_y2_max=t,e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})},n.prototype.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":s(t))?(P(t.x)&&(i.axis_x_min=t.x),P(t.y)&&(i.axis_y_min=t.y),P(t.y2)&&(i.axis_y2_min=t.y2)):i.axis_y_min=i.axis_y2_min=t,e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})},n.prototype.axis.range=function(t){if(!arguments.length)return{max:this.axis.max(),min:this.axis.min()};D(t.max)&&this.axis.max(t.max),D(t.min)&&this.axis.min(t.min)},n.prototype.category=function(t,e){var i=this.internal,n=i.config;return 1'":;\[\]\/|~`{}\\])/g,"\\$1")},u.prototype.selectorTarget=function(t,e){return(e||"")+"."+Y.target+this.getTargetSelectorSuffix(t)},u.prototype.selectorTargets=function(t,e){var i=this;return(t=t||[]).length?t.map(function(t){return i.selectorTarget(t,e)}):null},u.prototype.selectorLegend=function(t){return"."+Y.legendItem+this.getTargetSelectorSuffix(t)},u.prototype.selectorLegends=function(t){var e=this;return t&&t.length?t.map(function(t){return e.selectorLegend(t)}):null},u.prototype.getClipPath=function(t){return"url("+(0<=window.navigator.appVersion.toLowerCase().indexOf("msie 9.")?"":document.URL.split("#")[0])+"#"+t+")"},u.prototype.appendClip=function(t,e){return t.append("clipPath").attr("id",e).append("rect")},u.prototype.getAxisClipX=function(t){var e=Math.max(30,this.margin.left);return t?-(1+e):-(e-1)},u.prototype.getAxisClipY=function(t){return t?-20:-this.margin.top},u.prototype.getXAxisClipX=function(){return this.getAxisClipX(!this.config.axis_rotated)},u.prototype.getXAxisClipY=function(){return this.getAxisClipY(!this.config.axis_rotated)},u.prototype.getYAxisClipX=function(){return this.config.axis_y_inner?-1:this.getAxisClipX(this.config.axis_rotated)},u.prototype.getYAxisClipY=function(){return this.getAxisClipY(this.config.axis_rotated)},u.prototype.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},u.prototype.getAxisClipHeight=function(t){return(t?this.margin.bottom:this.margin.top+this.height)+20},u.prototype.getXAxisClipWidth=function(){return this.getAxisClipWidth(!this.config.axis_rotated)},u.prototype.getXAxisClipHeight=function(){return this.getAxisClipHeight(!this.config.axis_rotated)},u.prototype.getYAxisClipWidth=function(){return this.getAxisClipWidth(this.config.axis_rotated)+(this.config.axis_y_inner?20:0)},u.prototype.getYAxisClipHeight=function(){return this.getAxisClipHeight(this.config.axis_rotated)},u.prototype.generateColor=function(){var t=this.config,e=this.d3,n=t.data_colors,r=C(t.color_pattern)?t.color_pattern:e.schemeCategory10,a=t.data_color,o=[];return function(t){var e,i=t.id||t.data&&t.data.id||t;return n[i]instanceof Function?e=n[i](t):n[i]?e=n[i]:(o.indexOf(i)<0&&o.push(i),e=r[o.indexOf(i)%r.length],n[i]=e),a instanceof Function?a(e,t):e}},u.prototype.generateLevelColor=function(){var t=this.config,n=t.color_pattern,e=t.color_threshold,r="value"===e.unit,a=e.values&&e.values.length?e.values:[],o=e.max||100;return C(t.color_threshold)?function(t){var e,i=n[n.length-1];for(e=0;es&&(o=o.filter(function(t){return(""+t).indexOf(".")<0}));return o},u.prototype.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}},u.prototype.removeGridLines=function(t,e){var i=this.config,n=this.getGridFilterToRemove(t),r=function(t){return!n(t)},a=e?Y.xgridLines:Y.ygridLines,o=e?Y.xgridLine:Y.ygridLine;this.main.select("."+a).selectAll("."+o).filter(n).transition().duration(i.transition_duration).style("opacity",0).remove(),e?i.grid_x_lines=i.grid_x_lines.filter(r):i.grid_y_lines=i.grid_y_lines.filter(r)},u.prototype.initEventRect=function(){var t=this,e=t.config;t.main.select("."+Y.chart).append("g").attr("class",Y.eventRects).style("fill-opacity",0),t.eventRect=t.main.select("."+Y.eventRects).append("rect").attr("class",Y.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)))},u.prototype.redrawEventRect=function(){var t,e,r=this,a=r.d3,o=r.config;function s(){r.svg.select("."+Y.eventRect).style("cursor",null),r.hideXGridFocus(),r.hideTooltip(),r.unexpandCircles(),r.unexpandBars()}t=r.width,e=r.height,r.main.select("."+Y.eventRects).style("cursor",o.zoom_enabled?o.axis_rotated?"ns-resize":"ew-resize":null),r.eventRect.attr("x",0).attr("y",0).attr("width",t).attr("height",e).on("mouseout",o.interaction_enabled?function(){o&&(r.hasArcType()||s())}:null).on("mousemove",o.interaction_enabled?function(){var t,e,i,n;r.dragging||r.hasArcType(t)||(t=r.filterTargetsToShow(r.data.targets),e=a.mouse(this),i=r.findClosestFromTargets(t,e),!r.mouseover||i&&i.id===r.mouseover.id||(o.data_onmouseout.call(r.api,r.mouseover),r.mouseover=void 0),i?(n=(r.isScatterType(i)||!o.tooltip_grouped?[i]:r.filterByX(t,i.x)).map(function(t){return r.addName(t)}),r.showTooltip(n,this),o.point_focus_expand_enabled&&(r.unexpandCircles(),n.forEach(function(t){r.expandCircles(t.index,t.id,!1)})),r.expandBars(i.index,i.id,!0),r.showXGridFocus(n),(r.isBarType(i.id)||r.dist(i,e)i.bar_width_max?i.bar_width_max:n},u.prototype.getBars=function(t,e){return(e?this.main.selectAll("."+Y.bars+this.getTargetSelectorSuffix(e)):this.main).selectAll("."+Y.bar+(P(t)?"-"+t:""))},u.prototype.expandBars=function(t,e,i){i&&this.unexpandBars(),this.getBars(t,e).classed(Y.EXPANDED,!0)},u.prototype.unexpandBars=function(t){this.getBars(t).classed(Y.EXPANDED,!1)},u.prototype.generateDrawBar=function(t,e){var a=this.config,o=this.generateGetBarPoints(t,e);return function(t,e){var i=o(t,e),n=a.axis_rotated?1:0,r=a.axis_rotated?0:1;return"M "+i[0][n]+","+i[0][r]+" L"+i[1][n]+","+i[1][r]+" L"+i[2][n]+","+i[2][r]+" L"+i[3][n]+","+i[3][r]+" z"}},u.prototype.generateGetBarPoints=function(t,e){var o=this,i=e?o.subXAxis:o.xAxis,n=t.__max__+1,s=o.getBarW(i,n),c=o.getShapeX(s,n,t,!!e),d=o.getShapeY(!!e),u=o.getShapeOffset(o.isBarType,t,!!e),l=s*(o.config.bar_space/2),h=e?o.getSubYScale:o.getYScale;return function(t,e){var i=h.call(o,t.id)(0),n=u(t,e)||i,r=c(t),a=d(t);return o.config.axis_rotated&&(0a.width?n=a.width-o.width:n<0&&(n=4)),n},u.prototype.getYForText=function(t,e,i){var n,r=this,a=i.getBoundingClientRect();return r.config.axis_rotated?n=(t[0][0]+t[2][0]+.6*a.height)/2:(n=t[2][1],e.value<0||0===e.value&&!r.hasPositiveValue?(n+=a.height,r.isBarType(e)&&r.isSafari()?n-=3:!r.isBarType(e)&&r.isChrome()&&(n+=3)):n+=r.isBarType(e)?-3:-6),null!==e.value||r.config.axis_rotated||(nthis.height&&(n=this.height-4)),n},u.prototype.initTitle=function(){this.title=this.svg.append("text").text(this.config.title_text).attr("class",this.CLASS.title)},u.prototype.redrawTitle=function(){var t=this;t.title.attr("x",t.xForTitle.bind(t)).attr("y",t.yForTitle.bind(t))},u.prototype.xForTitle=function(){var t=this,e=t.config,i=e.title_position||"left";return 0<=i.indexOf("right")?t.currentWidth-t.getTextRect(t.title.node().textContent,t.CLASS.title,t.title.node()).width-e.title_padding.right:0<=i.indexOf("center")?(t.currentWidth-t.getTextRect(t.title.node().textContent,t.CLASS.title,t.title.node()).width)/2:e.title_padding.left},u.prototype.yForTitle=function(){var t=this;return t.config.title_padding.top+t.getTextRect(t.title.node().textContent,t.CLASS.title,t.title.node()).height},u.prototype.getTitlePadding=function(){return this.yForTitle()+this.config.title_padding.bottom},u.prototype.initTooltip=function(){var t,e=this,i=e.config;if(e.tooltip=e.selectChart.style("position","relative").append("div").attr("class",Y.tooltipContainer).style("position","absolute").style("pointer-events","none").style("display","none"),i.tooltip_init_show){if(e.isTimeSeries()&&c(i.tooltip_init_x)){for(i.tooltip_init_x=e.parseDate(i.tooltip_init_x),t=0;t"+(o||0===o?""+o+" |
":"")),void 0!==(s=_(p(t[a].value,t[a].ratio,t[a].id,t[a].index,t))))){if(null===t[a].name)continue;c=_(g(t[a].name,t[a].ratio,t[a].id,t[a].index)),d=u.levelColor?u.levelColor(t[a].value):n(t[a].id),r+="",r+=""+c+" | ",r+=""+s+" | ",r+="
"}return r+""},u.prototype.tooltipPosition=function(t,e,i,n){var r,a,o,s,c,d=this,u=d.config,l=d.d3,h=d.hasArcType(),g=l.mouse(n);return h?(a=(d.width-(d.isLegendRight?d.getLegendWidth():0))/2+g[0],s=(d.hasType("gauge")?d.height:d.height/2)+g[1]+20):(r=d.getSvgLeft(!0),u.axis_rotated?(o=(a=r+g[0]+100)+e,c=d.currentWidth-d.getCurrentPaddingRight(),s=d.x(t[0].x)+20):(o=(a=r+d.getCurrentPaddingLeft(!0)+d.x(t[0].x)+20)+e,c=r+d.currentWidth-d.getCurrentPaddingRight(),s=g[1]+15),cd.currentHeight&&(s-=i+30)),s<0&&(s=0),{top:s,left:a}},u.prototype.showTooltip=function(t,e){var i,n,r,a=this,o=a.config,s=a.hasArcType(),c=t.filter(function(t){return t&&P(t.value)}),d=o.tooltip_position||u.prototype.tooltipPosition;0!==c.length&&o.tooltip_show&&(a.tooltip.html(o.tooltip_contents.call(a,t,a.axis.getXAxisTickFormat(),a.getYFormat(s),a.color)).style("display","block"),i=a.tooltip.property("offsetWidth"),n=a.tooltip.property("offsetHeight"),r=d.call(this,c,i,n,e),a.tooltip.style("top",r.top+"px").style("left",r.left+"px"))},u.prototype.hideTooltip=function(){this.tooltip.style("display","none")},u.prototype.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)},u.prototype.hasType=function(i,t){var n=this.config.data_types,r=!1;return(t=t||this.data.targets)&&t.length?t.forEach(function(t){var e=n[t.id];(e&&0<=e.indexOf(i)||!e&&"line"===i)&&(r=!0)}):Object.keys(n).length?Object.keys(n).forEach(function(t){n[t]===i&&(r=!0)}):r=this.config.data_type===i,r},u.prototype.hasArcType=function(t){return this.hasType("pie",t)||this.hasType("donut",t)||this.hasType("gauge",t)},u.prototype.isLineType=function(t){var e=this.config,i=c(t)?t:t.id;return!e.data_types[i]||0<=["line","spline","area","area-spline","step","area-step"].indexOf(e.data_types[i])},u.prototype.isStepType=function(t){var e=c(t)?t:t.id;return 0<=["step","area-step"].indexOf(this.config.data_types[e])},u.prototype.isSplineType=function(t){var e=c(t)?t:t.id;return 0<=["spline","area-spline"].indexOf(this.config.data_types[e])},u.prototype.isAreaType=function(t){var e=c(t)?t:t.id;return 0<=["area","area-spline","area-step"].indexOf(this.config.data_types[e])},u.prototype.isBarType=function(t){var e=c(t)?t:t.id;return"bar"===this.config.data_types[e]},u.prototype.isScatterType=function(t){var e=c(t)?t:t.id;return"scatter"===this.config.data_types[e]},u.prototype.isPieType=function(t){var e=c(t)?t:t.id;return"pie"===this.config.data_types[e]},u.prototype.isGaugeType=function(t){var e=c(t)?t:t.id;return"gauge"===this.config.data_types[e]},u.prototype.isDonutType=function(t){var e=c(t)?t:t.id;return"donut"===this.config.data_types[e]},u.prototype.isArcType=function(t){return this.isPieType(t)||this.isDonutType(t)||this.isGaugeType(t)},u.prototype.lineData=function(t){return this.isLineType(t)?[t]:[]},u.prototype.arcData=function(t){return this.isArcType(t.data)?[t]:[]},u.prototype.barData=function(t){return this.isBarType(t)?t.values:[]},u.prototype.lineOrScatterData=function(t){return this.isLineType(t)||this.isScatterType(t)?t.values:[]},u.prototype.barOrLineData=function(t){return this.isBarType(t)||this.isLineType(t)?t.values:[]},u.prototype.isSafari=function(){var t=window.navigator.userAgent;return 0<=t.indexOf("Safari")&&t.indexOf("Chrome")<0},u.prototype.isChrome=function(){return 0<=window.navigator.userAgent.indexOf("Chrome")},u.prototype.initZoom=function(){var e,i=this,n=i.d3,r=i.config;return i.zoom=n.zoom().on("start",function(){var t=n.event.sourceEvent;t&&"brush"===t.type||(e=t,r.zoom_onzoomstart.call(i.api,t))}).on("zoom",function(){var t=n.event.sourceEvent;t&&"brush"===t.type||i.redrawForZoom.call(i)}).on("end",function(){var t=n.event.sourceEvent;t&&"brush"===t.type||t&&e.clientX===t.clientX&&e.clientY===t.clientY||r.zoom_onzoomend.call(i.api,i.x.orgDomain())}),i.zoom.updateDomain=function(){return n.event&&n.event.transform&&i.x.domain(n.event.transform.rescaleX(i.subX).domain()),this},i.zoom.updateExtent=function(){return this.scaleExtent([1,1/0]).translateExtent([[0,0],[i.width,i.height]]).extent([[0,0],[i.width,i.height]]),this},i.zoom.update=function(){return this.updateExtent().updateDomain()},i.zoom.updateExtent()},u.prototype.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)},u.prototype.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])]},u.prototype.redrawForZoom=function(){var t=this,e=t.d3,i=t.config,n=t.zoom,r=t.x;i.zoom_enabled&&0!==t.filterTargetsToShow(t.data.targets).length&&(n.update(),t.isCategorized()&&r.orgDomain()[0]===t.orgXDomain[0]&&r.domain([t.orgXDomain[0]-1e-10,r.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,r.orgDomain()))},t});
\ No newline at end of file
diff --git a/component.json b/component.json
index 89ae4fe..76d6521 100644
--- a/component.json
+++ b/component.json
@@ -2,7 +2,7 @@
"name": "c3",
"repo": "masayuki0812/c3",
"description": "A D3-based reusable chart library",
- "version": "0.6.4",
+ "version": "0.6.5",
"keywords": [],
"dependencies": {
"mbostock/d3": "v5.0.0"
diff --git a/docs/index.html.haml b/docs/index.html.haml
index cec37e9..ddf565f 100644
--- a/docs/index.html.haml
+++ b/docs/index.html.haml
@@ -38,6 +38,10 @@
%h3 Change Log
%ul
+ %li
+ v0.6.5 - 2018-07-14
+ %ul
+ %li Fix bug of hidden legend option.
%li
v0.6.4 - 2018-07-12
%ul
diff --git a/docs/js/c3.min.js b/docs/js/c3.min.js
index 948ac67..9a8f960 100644
--- a/docs/js/c3.min.js
+++ b/docs/js/c3.min.js
@@ -1,2 +1,2 @@
-/* @license C3.js v0.6.4 | (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 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",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_"};function i(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={}}var o="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},n={version:"0.6.4",chart:{fn:e.prototype,internal:{fn:i.prototype}}};function e(t){var e=this.internal=new i(this);e.loadConfig(t),e.beforeInit(t),e.init(),e.afterInit(t),function e(i,n,a){Object.keys(i).forEach(function(t){n[t]=i[t].bind(a),0/g,">"):t},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}};function p(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()}(s=p.prototype).axisX=function(t,e,i){t.attr("transform",function(t){return"translate("+Math.ceil(e(t)+i)+", 0)"})},s.axisY=function(t,e){t.attr("transform",function(t){return"translate(0,"+Math.ceil(e(t))+")"})},s.scaleExtent=function(t){var e=t[0],i=t[t.length-1];return ee.getTotalLength())break;i--}while(0=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)._writeListToPath(),t},window.SVGPathSegList.prototype.replaceItem=function(t,e){return this._checkPathSynchronizedToList(),t._owningPathSegList&&(t=t.clone()),this._checkValidIndex(e),((this._list[e]=t)._owningPathSegList=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)._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 n=this,e=function(){this.pathSegList=[]};e.prototype.appendSegment=function(t){this.pathSegList.push(t)};var i=function(t){this._string=t,this._currentIndex=0,this._endIndex=this._string.length,this._previousCommand=window.SVGPathSeg.PATHSEG_UNKNOWN,this._skipOptionalSpaces()};i.prototype._isCurrentSpace=function(){var t=this._string[this._currentIndex];return t<=" "&&(" "==t||"\n"==t||"\t"==t||"\r"==t||"\f"==t)},i.prototype._skipOptionalSpaces=function(){for(;this._currentIndex=this._endIndex||this._string.charAt(this._currentIndex)<"0"||"9"=this._endIndex||this._string.charAt(this._currentIndex)<"0"||"9"=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}},i.prototype.parseSegment=function(){var t=this._string[this._currentIndex],e=this._pathSegTypeFromChar(t);if(e==window.SVGPathSeg.PATHSEG_UNKNOWN){if(this._previousCommand==window.SVGPathSeg.PATHSEG_UNKNOWN)return null;if((e=this._nextCommandHelper(t,this._previousCommand))==window.SVGPathSeg.PATHSEG_UNKNOWN)return null}else this._currentIndex++;switch(this._previousCommand=e){case window.SVGPathSeg.PATHSEG_MOVETO_REL:return new window.SVGPathSegMovetoRel(n,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_MOVETO_ABS:return new window.SVGPathSegMovetoAbs(n,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_REL:return new window.SVGPathSegLinetoRel(n,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_ABS:return new window.SVGPathSegLinetoAbs(n,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL:return new window.SVGPathSegLinetoHorizontalRel(n,this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS:return new window.SVGPathSegLinetoHorizontalAbs(n,this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL:return new window.SVGPathSegLinetoVerticalRel(n,this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS:return new window.SVGPathSegLinetoVerticalAbs(n,this._parseNumber());case window.SVGPathSeg.PATHSEG_CLOSEPATH:return this._skipOptionalSpaces(),new window.SVGPathSegClosePath(n);case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL:var i={x1:this._parseNumber(),y1:this._parseNumber(),x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new window.SVGPathSegCurvetoCubicRel(n,i.x,i.y,i.x1,i.y1,i.x2,i.y2);case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS:return i={x1:this._parseNumber(),y1:this._parseNumber(),x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegCurvetoCubicAbs(n,i.x,i.y,i.x1,i.y1,i.x2,i.y2);case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL:return i={x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegCurvetoCubicSmoothRel(n,i.x,i.y,i.x2,i.y2);case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS:return i={x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegCurvetoCubicSmoothAbs(n,i.x,i.y,i.x2,i.y2);case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL:return i={x1:this._parseNumber(),y1:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegCurvetoQuadraticRel(n,i.x,i.y,i.x1,i.y1);case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS:return i={x1:this._parseNumber(),y1:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegCurvetoQuadraticAbs(n,i.x,i.y,i.x1,i.y1);case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL:return new window.SVGPathSegCurvetoQuadraticSmoothRel(n,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS:return new window.SVGPathSegCurvetoQuadraticSmoothAbs(n,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_ARC_REL:return i={x1:this._parseNumber(),y1:this._parseNumber(),arcAngle:this._parseNumber(),arcLarge:this._parseArcFlag(),arcSweep:this._parseArcFlag(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegArcRel(n,i.x,i.y,i.x1,i.y1,i.arcAngle,i.arcLarge,i.arcSweep);case window.SVGPathSeg.PATHSEG_ARC_ABS:return i={x1:this._parseNumber(),y1:this._parseNumber(),arcAngle:this._parseNumber(),arcLarge:this._parseArcFlag(),arcSweep:this._parseArcFlag(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegArcAbs(n,i.x,i.y,i.x1,i.y1,i.arcAngle,i.arcLarge,i.arcSweep);default:throw"Unknown path seg type."}};var a=new e,r=new i(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))}),x.axis=function(){},x.axis.labels=function(e){var i=this.internal;arguments.length&&(Object.keys(e).forEach(function(t){i.axis.setLabelText(t,e[t])}),i.axis.updateLabels())},x.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":o(t))?(P(t.x)&&(i.axis_x_max=t.x),P(t.y)&&(i.axis_y_max=t.y),P(t.y2)&&(i.axis_y2_max=t.y2)):i.axis_y_max=i.axis_y2_max=t,e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})},x.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":o(t))?(P(t.x)&&(i.axis_x_min=t.x),P(t.y)&&(i.axis_y_min=t.y),P(t.y2)&&(i.axis_y2_min=t.y2)):i.axis_y_min=i.axis_y2_min=t,e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})},x.axis.range=function(t){if(!arguments.length)return{max:this.axis.max(),min:this.axis.min()};k(t.max)&&this.axis.max(t.max),k(t.min)&&this.axis.min(t.min)},x.category=function(t,e){var i=this.internal,n=i.config;return 1'":;\[\]\/|~`{}\\])/g,"\\$1")},m.selectorTarget=function(t,e){return(e||"")+"."+Y.target+this.getTargetSelectorSuffix(t)},m.selectorTargets=function(t,e){var i=this;return(t=t||[]).length?t.map(function(t){return i.selectorTarget(t,e)}):null},m.selectorLegend=function(t){return"."+Y.legendItem+this.getTargetSelectorSuffix(t)},m.selectorLegends=function(t){var e=this;return t&&t.length?t.map(function(t){return e.selectorLegend(t)}):null},m.getClipPath=function(t){return"url("+(0<=window.navigator.appVersion.toLowerCase().indexOf("msie 9.")?"":document.URL.split("#")[0])+"#"+t+")"},m.appendClip=function(t,e){return t.append("clipPath").attr("id",e).append("rect")},m.getAxisClipX=function(t){var e=Math.max(30,this.margin.left);return t?-(1+e):-(e-1)},m.getAxisClipY=function(t){return t?-20:-this.margin.top},m.getXAxisClipX=function(){return this.getAxisClipX(!this.config.axis_rotated)},m.getXAxisClipY=function(){return this.getAxisClipY(!this.config.axis_rotated)},m.getYAxisClipX=function(){return this.config.axis_y_inner?-1:this.getAxisClipX(this.config.axis_rotated)},m.getYAxisClipY=function(){return this.getAxisClipY(this.config.axis_rotated)},m.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},m.getAxisClipHeight=function(t){return(t?this.margin.bottom:this.margin.top+this.height)+20},m.getXAxisClipWidth=function(){return this.getAxisClipWidth(!this.config.axis_rotated)},m.getXAxisClipHeight=function(){return this.getAxisClipHeight(!this.config.axis_rotated)},m.getYAxisClipWidth=function(){return this.getAxisClipWidth(this.config.axis_rotated)+(this.config.axis_y_inner?20:0)},m.getYAxisClipHeight=function(){return this.getAxisClipHeight(this.config.axis_rotated)},m.generateColor=function(){var t=this.config,e=this.d3,n=t.data_colors,a=C(t.color_pattern)?t.color_pattern:e.schemeCategory10,r=t.data_color,s=[];return function(t){var e,i=t.id||t.data&&t.data.id||t;return n[i]instanceof Function?e=n[i](t):n[i]?e=n[i]:(s.indexOf(i)<0&&s.push(i),e=a[s.indexOf(i)%a.length],n[i]=e),r instanceof Function?r(e,t):e}},m.generateLevelColor=function(){var t=this.config,n=t.color_pattern,e=t.color_threshold,a="value"===e.unit,r=e.values&&e.values.length?e.values:[],s=e.max||100;return C(t.color_threshold)?function(t){var e,i=n[n.length-1];for(e=0;eo&&(s=s.filter(function(t){return(""+t).indexOf(".")<0}));return s},m.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}},m.removeGridLines=function(t,e){var i=this.config,n=this.getGridFilterToRemove(t),a=function(t){return!n(t)},r=e?Y.xgridLines:Y.ygridLines,s=e?Y.xgridLine:Y.ygridLine;this.main.select("."+r).selectAll("."+s).filter(n).transition().duration(i.transition_duration).style("opacity",0).remove(),e?i.grid_x_lines=i.grid_x_lines.filter(a):i.grid_y_lines=i.grid_y_lines.filter(a)},m.initEventRect=function(){var t=this,e=t.config;t.main.select("."+Y.chart).append("g").attr("class",Y.eventRects).style("fill-opacity",0),t.eventRect=t.main.select("."+Y.eventRects).append("rect").attr("class",Y.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)))},m.redrawEventRect=function(){var t,e,a=this,r=a.d3,s=a.config;function o(){a.svg.select("."+Y.eventRect).style("cursor",null),a.hideXGridFocus(),a.hideTooltip(),a.unexpandCircles(),a.unexpandBars()}t=a.width,e=a.height,a.main.select("."+Y.eventRects).style("cursor",s.zoom_enabled?s.axis_rotated?"ns-resize":"ew-resize":null),a.eventRect.attr("x",0).attr("y",0).attr("width",t).attr("height",e).on("mouseout",s.interaction_enabled?function(){s&&(a.hasArcType()||o())}:null).on("mousemove",s.interaction_enabled?function(){var t,e,i,n;a.dragging||a.hasArcType(t)||(t=a.filterTargetsToShow(a.data.targets),e=r.mouse(this),i=a.findClosestFromTargets(t,e),!a.mouseover||i&&i.id===a.mouseover.id||(s.data_onmouseout.call(a.api,a.mouseover),a.mouseover=void 0),i?(n=(a.isScatterType(i)||!s.tooltip_grouped?[i]:a.filterByX(t,i.x)).map(function(t){return a.addName(t)}),a.showTooltip(n,this),s.point_focus_expand_enabled&&(a.unexpandCircles(),n.forEach(function(t){a.expandCircles(t.index,t.id,!1)})),a.expandBars(i.index,i.id,!0),a.showXGridFocus(n),(a.isBarType(i.id)||a.dist(i,e)i.bar_width_max?i.bar_width_max:n},m.getBars=function(t,e){return(e?this.main.selectAll("."+Y.bars+this.getTargetSelectorSuffix(e)):this.main).selectAll("."+Y.bar+(P(t)?"-"+t:""))},m.expandBars=function(t,e,i){i&&this.unexpandBars(),this.getBars(t,e).classed(Y.EXPANDED,!0)},m.unexpandBars=function(t){this.getBars(t).classed(Y.EXPANDED,!1)},m.generateDrawBar=function(t,e){var r=this.config,s=this.generateGetBarPoints(t,e);return function(t,e){var i=s(t,e),n=r.axis_rotated?1:0,a=r.axis_rotated?0:1;return"M "+i[0][n]+","+i[0][a]+" L"+i[1][n]+","+i[1][a]+" L"+i[2][n]+","+i[2][a]+" L"+i[3][n]+","+i[3][a]+" z"}},m.generateGetBarPoints=function(t,e){var s=this,i=e?s.subXAxis:s.xAxis,n=t.__max__+1,o=s.getBarW(i,n),c=s.getShapeX(o,n,t,!!e),d=s.getShapeY(!!e),u=s.getShapeOffset(s.isBarType,t,!!e),l=o*(s.config.bar_space/2),h=e?s.getSubYScale:s.getYScale;return function(t,e){var i=h.call(s,t.id)(0),n=u(t,e)||i,a=c(t),r=d(t);return s.config.axis_rotated&&(0r.width?n=r.width-s.width:n<0&&(n=4)),n},m.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||(nthis.height&&(n=this.height-4)),n},m.initTitle=function(){this.title=this.svg.append("text").text(this.config.title_text).attr("class",this.CLASS.title)},m.redrawTitle=function(){var t=this;t.title.attr("x",t.xForTitle.bind(t)).attr("y",t.yForTitle.bind(t))},m.xForTitle=function(){var t=this,e=t.config,i=e.title_position||"left";return 0<=i.indexOf("right")?t.currentWidth-t.getTextRect(t.title.node().textContent,t.CLASS.title,t.title.node()).width-e.title_padding.right:0<=i.indexOf("center")?(t.currentWidth-t.getTextRect(t.title.node().textContent,t.CLASS.title,t.title.node()).width)/2:e.title_padding.left},m.yForTitle=function(){var t=this;return t.config.title_padding.top+t.getTextRect(t.title.node().textContent,t.CLASS.title,t.title.node()).height},m.getTitlePadding=function(){return this.yForTitle()+this.config.title_padding.bottom},m.initTooltip=function(){var t,e=this,i=e.config;if(e.tooltip=e.selectChart.style("position","relative").append("div").attr("class",Y.tooltipContainer).style("position","absolute").style("pointer-events","none").style("display","none"),i.tooltip_init_show){if(e.isTimeSeries()&&c(i.tooltip_init_x)){for(i.tooltip_init_x=e.parseDate(i.tooltip_init_x),t=0;t"+(s||0===s?""+s+" |
":"")),void 0!==(o=_(f(t[r].value,t[r].ratio,t[r].id,t[r].index,t))))){if(null===t[r].name)continue;c=_(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+="",a+=""+c+" | ",a+=""+o+" | ",a+="
"}return a+""},m.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),cd.currentHeight&&(o-=i+30)),o<0&&(o=0),{top:o,left:r}},m.showTooltip=function(t,e){var i,n,a,r=this,s=r.config,o=r.hasArcType(),c=t.filter(function(t){return t&&P(t.value)}),d=s.tooltip_position||m.tooltipPosition;0!==c.length&&s.tooltip_show&&(r.tooltip.html(s.tooltip_contents.call(r,t,r.axis.getXAxisTickFormat(),r.getYFormat(o),r.color)).style("display","block"),i=r.tooltip.property("offsetWidth"),n=r.tooltip.property("offsetHeight"),a=d.call(this,c,i,n,e),r.tooltip.style("top",a.top+"px").style("left",a.left+"px"))},m.hideTooltip=function(){this.tooltip.style("display","none")},m.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)},m.hasType=function(i,t){var n=this.config.data_types,a=!1;return(t=t||this.data.targets)&&t.length?t.forEach(function(t){var e=n[t.id];(e&&0<=e.indexOf(i)||!e&&"line"===i)&&(a=!0)}):Object.keys(n).length?Object.keys(n).forEach(function(t){n[t]===i&&(a=!0)}):a=this.config.data_type===i,a},m.hasArcType=function(t){return this.hasType("pie",t)||this.hasType("donut",t)||this.hasType("gauge",t)},m.isLineType=function(t){var e=this.config,i=c(t)?t:t.id;return!e.data_types[i]||0<=["line","spline","area","area-spline","step","area-step"].indexOf(e.data_types[i])},m.isStepType=function(t){var e=c(t)?t:t.id;return 0<=["step","area-step"].indexOf(this.config.data_types[e])},m.isSplineType=function(t){var e=c(t)?t:t.id;return 0<=["spline","area-spline"].indexOf(this.config.data_types[e])},m.isAreaType=function(t){var e=c(t)?t:t.id;return 0<=["area","area-spline","area-step"].indexOf(this.config.data_types[e])},m.isBarType=function(t){var e=c(t)?t:t.id;return"bar"===this.config.data_types[e]},m.isScatterType=function(t){var e=c(t)?t:t.id;return"scatter"===this.config.data_types[e]},m.isPieType=function(t){var e=c(t)?t:t.id;return"pie"===this.config.data_types[e]},m.isGaugeType=function(t){var e=c(t)?t:t.id;return"gauge"===this.config.data_types[e]},m.isDonutType=function(t){var e=c(t)?t:t.id;return"donut"===this.config.data_types[e]},m.isArcType=function(t){return this.isPieType(t)||this.isDonutType(t)||this.isGaugeType(t)},m.lineData=function(t){return this.isLineType(t)?[t]:[]},m.arcData=function(t){return this.isArcType(t.data)?[t]:[]},m.barData=function(t){return this.isBarType(t)?t.values:[]},m.lineOrScatterData=function(t){return this.isLineType(t)||this.isScatterType(t)?t.values:[]},m.barOrLineData=function(t){return this.isBarType(t)||this.isLineType(t)?t.values:[]},m.isSafari=function(){var t=window.navigator.userAgent;return 0<=t.indexOf("Safari")&&t.indexOf("Chrome")<0},m.isChrome=function(){return 0<=window.navigator.userAgent.indexOf("Chrome")},m.initZoom=function(){var e,i=this,n=i.d3,a=i.config;return i.zoom=n.zoom().on("start",function(){var t=n.event.sourceEvent;t&&"brush"===t.type||(e=t,a.zoom_onzoomstart.call(i.api,t))}).on("zoom",function(){var t=n.event.sourceEvent;t&&"brush"===t.type||i.redrawForZoom.call(i)}).on("end",function(){var t=n.event.sourceEvent;t&&"brush"===t.type||t&&e.clientX===t.clientX&&e.clientY===t.clientY||a.zoom_onzoomend.call(i.api,i.x.orgDomain())}),i.zoom.updateDomain=function(){return n.event&&n.event.transform&&i.x.domain(n.event.transform.rescaleX(i.subX).domain()),this},i.zoom.updateExtent=function(){return this.scaleExtent([1,1/0]).translateExtent([[0,0],[i.width,i.height]]).extent([[0,0],[i.width,i.height]]),this},i.zoom.update=function(){return this.updateExtent().updateDomain()},i.zoom.updateExtent()},m.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)},m.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])]},m.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()))},n});
\ No newline at end of file
+/* @license C3.js v0.6.5 | (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 u(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 u(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/g,">"):t},d=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.owner=e,this.d3=e.d3,this.internal=i};d.prototype.init=function(){var t=this.owner,e=t.config,i=t.main;t.axes.x=i.append("g").attr("class",Y.axis+" "+Y.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",Y.axisXLabel).attr("transform",e.axis_rotated?"rotate(-90)":"").style("text-anchor",this.textAnchorForXAxisLabel.bind(this)),t.axes.y=i.append("g").attr("class",Y.axis+" "+Y.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",Y.axisYLabel).attr("transform",e.axis_rotated?"":"rotate(-90)").style("text-anchor",this.textAnchorForYAxisLabel.bind(this)),t.axes.y2=i.append("g").attr("class",Y.axis+" "+Y.axisY2).attr("transform",t.getTranslate("y2")).style("visibility",e.axis_y2_show?"visible":"hidden"),t.axes.y2.append("text").attr("class",Y.axisY2Label).attr("transform",e.axis_rotated?"":"rotate(-90)").style("text-anchor",this.textAnchorForY2AxisLabel.bind(this))},d.prototype.getXAxis=function(t,e,i,n,r,a,o){var s=this.owner,c=s.config,d={isCategory:s.isCategorized(),withOuterTick:r,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:o?0:c.axis_x_tick_rotate,withoutTransition:a},u=new this.internal(this,d).axis.scale(t).orient(e);return s.isTimeSeries()&&n&&"function"!=typeof n&&(n=n.map(function(t){return s.parseDate(t)})),u.tickFormat(i).tickValues(n),s.isCategorized()&&(u.tickCentered(c.axis_x_tick_centered),l(c.axis_x_tick_culling)&&(c.axis_x_tick_culling=!1)),u},d.prototype.updateXAxisTickValues=function(t,e){var i,n=this.owner,r=n.config;return(r.axis_x_tick_fit||r.axis_x_tick_count)&&(i=this.generateTickValues(n.mapTargetsToUniqueXs(t),r.axis_x_tick_count,n.isTimeSeries())),e?e.tickValues(i):(n.xAxis.tickValues(i),n.subXAxis.tickValues(i)),i},d.prototype.getYAxis=function(t,e,i,n,r,a,o){var s=this.owner,c=s.config,d={withOuterTick:r,withoutTransition:a,tickTextRotate:o?0:c.axis_y_tick_rotate},u=new this.internal(this,d).axis.scale(t).orient(e).tickFormat(i);return s.isTimeSeriesY()?u.ticks(c.axis_y_tick_time_type,c.axis_y_tick_time_interval):u.tickValues(n),u},d.prototype.getId=function(t){var e=this.owner.config;return t in e.data_axes?e.data_axes[t]:"y"},d.prototype.getXAxisTickFormat=function(){var e=this.owner,i=e.config,n=e.isTimeSeries()?e.defaultAxisTimeFormat:e.isCategorized()?e.categoryName:function(t){return t};return i.axis_x_tick_format&&(h(i.axis_x_tick_format)?n=i.axis_x_tick_format:e.isTimeSeries()&&(n=function(t){return t?e.axisTimeFormat(i.axis_x_tick_format)(t):""})),h(n)?function(t){return n.call(e,t)}:n},d.prototype.getTickValues=function(t,e){return t||(e?e.tickValues():void 0)},d.prototype.getXAxisTickValues=function(){return this.getTickValues(this.owner.config.axis_x_tick_values,this.owner.xAxis)},d.prototype.getYAxisTickValues=function(){return this.getTickValues(this.owner.config.axis_y_tick_values,this.owner.yAxis)},d.prototype.getY2AxisTickValues=function(){return this.getTickValues(this.owner.config.axis_y2_tick_values,this.owner.y2Axis)},d.prototype.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},d.prototype.getLabelText=function(t){var e=this.getLabelOptionByAxisId(t);return c(e)?e:e?e.text:null},d.prototype.setLabelText=function(t,e){var i=this.owner.config,n=this.getLabelOptionByAxisId(t);c(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)},d.prototype.getLabelPosition=function(t,e){var i=this.getLabelOptionByAxisId(t),n=i&&"object"===(void 0===i?"undefined":s(i))&&i.position?i.position:e;return{isInner:0<=n.indexOf("inner"),isOuter:0<=n.indexOf("outer"),isLeft:0<=n.indexOf("left"),isCenter:0<=n.indexOf("center"),isRight:0<=n.indexOf("right"),isTop:0<=n.indexOf("top"),isMiddle:0<=n.indexOf("middle"),isBottom:0<=n.indexOf("bottom")}},d.prototype.getXAxisLabelPosition=function(){return this.getLabelPosition("x",this.owner.config.axis_rotated?"inner-top":"inner-right")},d.prototype.getYAxisLabelPosition=function(){return this.getLabelPosition("y",this.owner.config.axis_rotated?"inner-right":"inner-top")},d.prototype.getY2AxisLabelPosition=function(){return this.getLabelPosition("y2",this.owner.config.axis_rotated?"inner-right":"inner-top")},d.prototype.getLabelPositionById=function(t){return"y2"===t?this.getY2AxisLabelPosition():"y"===t?this.getYAxisLabelPosition():this.getXAxisLabelPosition()},d.prototype.textForXAxisLabel=function(){return this.getLabelText("x")},d.prototype.textForYAxisLabel=function(){return this.getLabelText("y")},d.prototype.textForY2AxisLabel=function(){return this.getLabelText("y2")},d.prototype.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},d.prototype.dxForAxisLabel=function(t,e){return t?e.isLeft?"0.5em":e.isRight?"-0.5em":"0":e.isTop?"-0.5em":e.isBottom?"0.5em":"0"},d.prototype.textAnchorForAxisLabel=function(t,e){return t?e.isLeft?"start":e.isCenter?"middle":"end":e.isBottom?"start":e.isMiddle?"middle":"end"},d.prototype.xForXAxisLabel=function(){return this.xForAxisLabel(!this.owner.config.axis_rotated,this.getXAxisLabelPosition())},d.prototype.xForYAxisLabel=function(){return this.xForAxisLabel(this.owner.config.axis_rotated,this.getYAxisLabelPosition())},d.prototype.xForY2AxisLabel=function(){return this.xForAxisLabel(this.owner.config.axis_rotated,this.getY2AxisLabelPosition())},d.prototype.dxForXAxisLabel=function(){return this.dxForAxisLabel(!this.owner.config.axis_rotated,this.getXAxisLabelPosition())},d.prototype.dxForYAxisLabel=function(){return this.dxForAxisLabel(this.owner.config.axis_rotated,this.getYAxisLabelPosition())},d.prototype.dxForY2AxisLabel=function(){return this.dxForAxisLabel(this.owner.config.axis_rotated,this.getY2AxisLabelPosition())},d.prototype.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"},d.prototype.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)},d.prototype.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)},d.prototype.textAnchorForXAxisLabel=function(){var t=this.owner;return this.textAnchorForAxisLabel(!t.config.axis_rotated,this.getXAxisLabelPosition())},d.prototype.textAnchorForYAxisLabel=function(){var t=this.owner;return this.textAnchorForAxisLabel(t.config.axis_rotated,this.getYAxisLabelPosition())},d.prototype.textAnchorForY2AxisLabel=function(){var t=this.owner;return this.textAnchorForAxisLabel(t.config.axis_rotated,this.getY2AxisLabelPosition())},d.prototype.getMaxTickWidth=function(t,e){var i,n,r,a,o=this.owner,s=o.config,c=0;return e&&o.currentMaxTickWidths[t]||(o.svg&&(i=o.filterTargetsToShow(o.data.targets),"y"===t?(n=o.y.copy().domain(o.getYDomain(i,"y")),r=this.getYAxis(n,o.yOrient,s.axis_y_tick_format,o.yAxisTickValues,!1,!0,!0)):"y2"===t?(n=o.y2.copy().domain(o.getYDomain(i,"y2")),r=this.getYAxis(n,o.y2Orient,s.axis_y2_tick_format,o.y2AxisTickValues,!1,!0,!0)):(n=o.x.copy().domain(o.getXDomain(i)),r=this.getXAxis(n,o.xOrient,o.xAxisTickFormat,o.xAxisTickValues,!1,!0,!0),this.updateXAxisTickValues(i,r)),(a=o.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(r).each(function(){o.d3.select(this).selectAll("text").each(function(){var t=this.getBoundingClientRect();ce.getTotalLength())break;i--}while(0=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)._writeListToPath(),t},window.SVGPathSegList.prototype.replaceItem=function(t,e){return this._checkPathSynchronizedToList(),t._owningPathSegList&&(t=t.clone()),this._checkValidIndex(e),((this._list[e]=t)._owningPathSegList=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)._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 n=this,e=function(){this.pathSegList=[]};e.prototype.appendSegment=function(t){this.pathSegList.push(t)};var i=function(t){this._string=t,this._currentIndex=0,this._endIndex=this._string.length,this._previousCommand=window.SVGPathSeg.PATHSEG_UNKNOWN,this._skipOptionalSpaces()};i.prototype._isCurrentSpace=function(){var t=this._string[this._currentIndex];return t<=" "&&(" "==t||"\n"==t||"\t"==t||"\r"==t||"\f"==t)},i.prototype._skipOptionalSpaces=function(){for(;this._currentIndex=this._endIndex||this._string.charAt(this._currentIndex)<"0"||"9"=this._endIndex||this._string.charAt(this._currentIndex)<"0"||"9"=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}},i.prototype.parseSegment=function(){var t=this._string[this._currentIndex],e=this._pathSegTypeFromChar(t);if(e==window.SVGPathSeg.PATHSEG_UNKNOWN){if(this._previousCommand==window.SVGPathSeg.PATHSEG_UNKNOWN)return null;if((e=this._nextCommandHelper(t,this._previousCommand))==window.SVGPathSeg.PATHSEG_UNKNOWN)return null}else this._currentIndex++;switch(this._previousCommand=e){case window.SVGPathSeg.PATHSEG_MOVETO_REL:return new window.SVGPathSegMovetoRel(n,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_MOVETO_ABS:return new window.SVGPathSegMovetoAbs(n,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_REL:return new window.SVGPathSegLinetoRel(n,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_ABS:return new window.SVGPathSegLinetoAbs(n,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL:return new window.SVGPathSegLinetoHorizontalRel(n,this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS:return new window.SVGPathSegLinetoHorizontalAbs(n,this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL:return new window.SVGPathSegLinetoVerticalRel(n,this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS:return new window.SVGPathSegLinetoVerticalAbs(n,this._parseNumber());case window.SVGPathSeg.PATHSEG_CLOSEPATH:return this._skipOptionalSpaces(),new window.SVGPathSegClosePath(n);case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL:var i={x1:this._parseNumber(),y1:this._parseNumber(),x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new window.SVGPathSegCurvetoCubicRel(n,i.x,i.y,i.x1,i.y1,i.x2,i.y2);case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS:return i={x1:this._parseNumber(),y1:this._parseNumber(),x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegCurvetoCubicAbs(n,i.x,i.y,i.x1,i.y1,i.x2,i.y2);case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL:return i={x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegCurvetoCubicSmoothRel(n,i.x,i.y,i.x2,i.y2);case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS:return i={x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegCurvetoCubicSmoothAbs(n,i.x,i.y,i.x2,i.y2);case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL:return i={x1:this._parseNumber(),y1:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegCurvetoQuadraticRel(n,i.x,i.y,i.x1,i.y1);case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS:return i={x1:this._parseNumber(),y1:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegCurvetoQuadraticAbs(n,i.x,i.y,i.x1,i.y1);case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL:return new window.SVGPathSegCurvetoQuadraticSmoothRel(n,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS:return new window.SVGPathSegCurvetoQuadraticSmoothAbs(n,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_ARC_REL:return i={x1:this._parseNumber(),y1:this._parseNumber(),arcAngle:this._parseNumber(),arcLarge:this._parseArcFlag(),arcSweep:this._parseArcFlag(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegArcRel(n,i.x,i.y,i.x1,i.y1,i.arcAngle,i.arcLarge,i.arcSweep);case window.SVGPathSeg.PATHSEG_ARC_ABS:return i={x1:this._parseNumber(),y1:this._parseNumber(),arcAngle:this._parseNumber(),arcLarge:this._parseArcFlag(),arcSweep:this._parseArcFlag(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegArcAbs(n,i.x,i.y,i.x1,i.y1,i.arcAngle,i.arcLarge,i.arcSweep);default:throw"Unknown path seg type."}};var r=new e,a=new i(t);if(!a.initialCommandIsMoveTo())return[];for(;a.hasMoreData();){var o=a.parseSegment();if(!o)return[];r.appendSegment(o)}return r.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))}),(n.prototype.axis=function(){}).labels=function(e){var i=this.internal;arguments.length&&(Object.keys(e).forEach(function(t){i.axis.setLabelText(t,e[t])}),i.axis.updateLabels())},n.prototype.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":s(t))?(P(t.x)&&(i.axis_x_max=t.x),P(t.y)&&(i.axis_y_max=t.y),P(t.y2)&&(i.axis_y2_max=t.y2)):i.axis_y_max=i.axis_y2_max=t,e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})},n.prototype.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":s(t))?(P(t.x)&&(i.axis_x_min=t.x),P(t.y)&&(i.axis_y_min=t.y),P(t.y2)&&(i.axis_y2_min=t.y2)):i.axis_y_min=i.axis_y2_min=t,e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})},n.prototype.axis.range=function(t){if(!arguments.length)return{max:this.axis.max(),min:this.axis.min()};D(t.max)&&this.axis.max(t.max),D(t.min)&&this.axis.min(t.min)},n.prototype.category=function(t,e){var i=this.internal,n=i.config;return 1'":;\[\]\/|~`{}\\])/g,"\\$1")},u.prototype.selectorTarget=function(t,e){return(e||"")+"."+Y.target+this.getTargetSelectorSuffix(t)},u.prototype.selectorTargets=function(t,e){var i=this;return(t=t||[]).length?t.map(function(t){return i.selectorTarget(t,e)}):null},u.prototype.selectorLegend=function(t){return"."+Y.legendItem+this.getTargetSelectorSuffix(t)},u.prototype.selectorLegends=function(t){var e=this;return t&&t.length?t.map(function(t){return e.selectorLegend(t)}):null},u.prototype.getClipPath=function(t){return"url("+(0<=window.navigator.appVersion.toLowerCase().indexOf("msie 9.")?"":document.URL.split("#")[0])+"#"+t+")"},u.prototype.appendClip=function(t,e){return t.append("clipPath").attr("id",e).append("rect")},u.prototype.getAxisClipX=function(t){var e=Math.max(30,this.margin.left);return t?-(1+e):-(e-1)},u.prototype.getAxisClipY=function(t){return t?-20:-this.margin.top},u.prototype.getXAxisClipX=function(){return this.getAxisClipX(!this.config.axis_rotated)},u.prototype.getXAxisClipY=function(){return this.getAxisClipY(!this.config.axis_rotated)},u.prototype.getYAxisClipX=function(){return this.config.axis_y_inner?-1:this.getAxisClipX(this.config.axis_rotated)},u.prototype.getYAxisClipY=function(){return this.getAxisClipY(this.config.axis_rotated)},u.prototype.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},u.prototype.getAxisClipHeight=function(t){return(t?this.margin.bottom:this.margin.top+this.height)+20},u.prototype.getXAxisClipWidth=function(){return this.getAxisClipWidth(!this.config.axis_rotated)},u.prototype.getXAxisClipHeight=function(){return this.getAxisClipHeight(!this.config.axis_rotated)},u.prototype.getYAxisClipWidth=function(){return this.getAxisClipWidth(this.config.axis_rotated)+(this.config.axis_y_inner?20:0)},u.prototype.getYAxisClipHeight=function(){return this.getAxisClipHeight(this.config.axis_rotated)},u.prototype.generateColor=function(){var t=this.config,e=this.d3,n=t.data_colors,r=C(t.color_pattern)?t.color_pattern:e.schemeCategory10,a=t.data_color,o=[];return function(t){var e,i=t.id||t.data&&t.data.id||t;return n[i]instanceof Function?e=n[i](t):n[i]?e=n[i]:(o.indexOf(i)<0&&o.push(i),e=r[o.indexOf(i)%r.length],n[i]=e),a instanceof Function?a(e,t):e}},u.prototype.generateLevelColor=function(){var t=this.config,n=t.color_pattern,e=t.color_threshold,r="value"===e.unit,a=e.values&&e.values.length?e.values:[],o=e.max||100;return C(t.color_threshold)?function(t){var e,i=n[n.length-1];for(e=0;es&&(o=o.filter(function(t){return(""+t).indexOf(".")<0}));return o},u.prototype.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}},u.prototype.removeGridLines=function(t,e){var i=this.config,n=this.getGridFilterToRemove(t),r=function(t){return!n(t)},a=e?Y.xgridLines:Y.ygridLines,o=e?Y.xgridLine:Y.ygridLine;this.main.select("."+a).selectAll("."+o).filter(n).transition().duration(i.transition_duration).style("opacity",0).remove(),e?i.grid_x_lines=i.grid_x_lines.filter(r):i.grid_y_lines=i.grid_y_lines.filter(r)},u.prototype.initEventRect=function(){var t=this,e=t.config;t.main.select("."+Y.chart).append("g").attr("class",Y.eventRects).style("fill-opacity",0),t.eventRect=t.main.select("."+Y.eventRects).append("rect").attr("class",Y.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)))},u.prototype.redrawEventRect=function(){var t,e,r=this,a=r.d3,o=r.config;function s(){r.svg.select("."+Y.eventRect).style("cursor",null),r.hideXGridFocus(),r.hideTooltip(),r.unexpandCircles(),r.unexpandBars()}t=r.width,e=r.height,r.main.select("."+Y.eventRects).style("cursor",o.zoom_enabled?o.axis_rotated?"ns-resize":"ew-resize":null),r.eventRect.attr("x",0).attr("y",0).attr("width",t).attr("height",e).on("mouseout",o.interaction_enabled?function(){o&&(r.hasArcType()||s())}:null).on("mousemove",o.interaction_enabled?function(){var t,e,i,n;r.dragging||r.hasArcType(t)||(t=r.filterTargetsToShow(r.data.targets),e=a.mouse(this),i=r.findClosestFromTargets(t,e),!r.mouseover||i&&i.id===r.mouseover.id||(o.data_onmouseout.call(r.api,r.mouseover),r.mouseover=void 0),i?(n=(r.isScatterType(i)||!o.tooltip_grouped?[i]:r.filterByX(t,i.x)).map(function(t){return r.addName(t)}),r.showTooltip(n,this),o.point_focus_expand_enabled&&(r.unexpandCircles(),n.forEach(function(t){r.expandCircles(t.index,t.id,!1)})),r.expandBars(i.index,i.id,!0),r.showXGridFocus(n),(r.isBarType(i.id)||r.dist(i,e)i.bar_width_max?i.bar_width_max:n},u.prototype.getBars=function(t,e){return(e?this.main.selectAll("."+Y.bars+this.getTargetSelectorSuffix(e)):this.main).selectAll("."+Y.bar+(P(t)?"-"+t:""))},u.prototype.expandBars=function(t,e,i){i&&this.unexpandBars(),this.getBars(t,e).classed(Y.EXPANDED,!0)},u.prototype.unexpandBars=function(t){this.getBars(t).classed(Y.EXPANDED,!1)},u.prototype.generateDrawBar=function(t,e){var a=this.config,o=this.generateGetBarPoints(t,e);return function(t,e){var i=o(t,e),n=a.axis_rotated?1:0,r=a.axis_rotated?0:1;return"M "+i[0][n]+","+i[0][r]+" L"+i[1][n]+","+i[1][r]+" L"+i[2][n]+","+i[2][r]+" L"+i[3][n]+","+i[3][r]+" z"}},u.prototype.generateGetBarPoints=function(t,e){var o=this,i=e?o.subXAxis:o.xAxis,n=t.__max__+1,s=o.getBarW(i,n),c=o.getShapeX(s,n,t,!!e),d=o.getShapeY(!!e),u=o.getShapeOffset(o.isBarType,t,!!e),l=s*(o.config.bar_space/2),h=e?o.getSubYScale:o.getYScale;return function(t,e){var i=h.call(o,t.id)(0),n=u(t,e)||i,r=c(t),a=d(t);return o.config.axis_rotated&&(0a.width?n=a.width-o.width:n<0&&(n=4)),n},u.prototype.getYForText=function(t,e,i){var n,r=this,a=i.getBoundingClientRect();return r.config.axis_rotated?n=(t[0][0]+t[2][0]+.6*a.height)/2:(n=t[2][1],e.value<0||0===e.value&&!r.hasPositiveValue?(n+=a.height,r.isBarType(e)&&r.isSafari()?n-=3:!r.isBarType(e)&&r.isChrome()&&(n+=3)):n+=r.isBarType(e)?-3:-6),null!==e.value||r.config.axis_rotated||(nthis.height&&(n=this.height-4)),n},u.prototype.initTitle=function(){this.title=this.svg.append("text").text(this.config.title_text).attr("class",this.CLASS.title)},u.prototype.redrawTitle=function(){var t=this;t.title.attr("x",t.xForTitle.bind(t)).attr("y",t.yForTitle.bind(t))},u.prototype.xForTitle=function(){var t=this,e=t.config,i=e.title_position||"left";return 0<=i.indexOf("right")?t.currentWidth-t.getTextRect(t.title.node().textContent,t.CLASS.title,t.title.node()).width-e.title_padding.right:0<=i.indexOf("center")?(t.currentWidth-t.getTextRect(t.title.node().textContent,t.CLASS.title,t.title.node()).width)/2:e.title_padding.left},u.prototype.yForTitle=function(){var t=this;return t.config.title_padding.top+t.getTextRect(t.title.node().textContent,t.CLASS.title,t.title.node()).height},u.prototype.getTitlePadding=function(){return this.yForTitle()+this.config.title_padding.bottom},u.prototype.initTooltip=function(){var t,e=this,i=e.config;if(e.tooltip=e.selectChart.style("position","relative").append("div").attr("class",Y.tooltipContainer).style("position","absolute").style("pointer-events","none").style("display","none"),i.tooltip_init_show){if(e.isTimeSeries()&&c(i.tooltip_init_x)){for(i.tooltip_init_x=e.parseDate(i.tooltip_init_x),t=0;t"+(o||0===o?""+o+" |
":"")),void 0!==(s=_(p(t[a].value,t[a].ratio,t[a].id,t[a].index,t))))){if(null===t[a].name)continue;c=_(g(t[a].name,t[a].ratio,t[a].id,t[a].index)),d=u.levelColor?u.levelColor(t[a].value):n(t[a].id),r+="",r+=""+c+" | ",r+=""+s+" | ",r+="
"}return r+""},u.prototype.tooltipPosition=function(t,e,i,n){var r,a,o,s,c,d=this,u=d.config,l=d.d3,h=d.hasArcType(),g=l.mouse(n);return h?(a=(d.width-(d.isLegendRight?d.getLegendWidth():0))/2+g[0],s=(d.hasType("gauge")?d.height:d.height/2)+g[1]+20):(r=d.getSvgLeft(!0),u.axis_rotated?(o=(a=r+g[0]+100)+e,c=d.currentWidth-d.getCurrentPaddingRight(),s=d.x(t[0].x)+20):(o=(a=r+d.getCurrentPaddingLeft(!0)+d.x(t[0].x)+20)+e,c=r+d.currentWidth-d.getCurrentPaddingRight(),s=g[1]+15),cd.currentHeight&&(s-=i+30)),s<0&&(s=0),{top:s,left:a}},u.prototype.showTooltip=function(t,e){var i,n,r,a=this,o=a.config,s=a.hasArcType(),c=t.filter(function(t){return t&&P(t.value)}),d=o.tooltip_position||u.prototype.tooltipPosition;0!==c.length&&o.tooltip_show&&(a.tooltip.html(o.tooltip_contents.call(a,t,a.axis.getXAxisTickFormat(),a.getYFormat(s),a.color)).style("display","block"),i=a.tooltip.property("offsetWidth"),n=a.tooltip.property("offsetHeight"),r=d.call(this,c,i,n,e),a.tooltip.style("top",r.top+"px").style("left",r.left+"px"))},u.prototype.hideTooltip=function(){this.tooltip.style("display","none")},u.prototype.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)},u.prototype.hasType=function(i,t){var n=this.config.data_types,r=!1;return(t=t||this.data.targets)&&t.length?t.forEach(function(t){var e=n[t.id];(e&&0<=e.indexOf(i)||!e&&"line"===i)&&(r=!0)}):Object.keys(n).length?Object.keys(n).forEach(function(t){n[t]===i&&(r=!0)}):r=this.config.data_type===i,r},u.prototype.hasArcType=function(t){return this.hasType("pie",t)||this.hasType("donut",t)||this.hasType("gauge",t)},u.prototype.isLineType=function(t){var e=this.config,i=c(t)?t:t.id;return!e.data_types[i]||0<=["line","spline","area","area-spline","step","area-step"].indexOf(e.data_types[i])},u.prototype.isStepType=function(t){var e=c(t)?t:t.id;return 0<=["step","area-step"].indexOf(this.config.data_types[e])},u.prototype.isSplineType=function(t){var e=c(t)?t:t.id;return 0<=["spline","area-spline"].indexOf(this.config.data_types[e])},u.prototype.isAreaType=function(t){var e=c(t)?t:t.id;return 0<=["area","area-spline","area-step"].indexOf(this.config.data_types[e])},u.prototype.isBarType=function(t){var e=c(t)?t:t.id;return"bar"===this.config.data_types[e]},u.prototype.isScatterType=function(t){var e=c(t)?t:t.id;return"scatter"===this.config.data_types[e]},u.prototype.isPieType=function(t){var e=c(t)?t:t.id;return"pie"===this.config.data_types[e]},u.prototype.isGaugeType=function(t){var e=c(t)?t:t.id;return"gauge"===this.config.data_types[e]},u.prototype.isDonutType=function(t){var e=c(t)?t:t.id;return"donut"===this.config.data_types[e]},u.prototype.isArcType=function(t){return this.isPieType(t)||this.isDonutType(t)||this.isGaugeType(t)},u.prototype.lineData=function(t){return this.isLineType(t)?[t]:[]},u.prototype.arcData=function(t){return this.isArcType(t.data)?[t]:[]},u.prototype.barData=function(t){return this.isBarType(t)?t.values:[]},u.prototype.lineOrScatterData=function(t){return this.isLineType(t)||this.isScatterType(t)?t.values:[]},u.prototype.barOrLineData=function(t){return this.isBarType(t)||this.isLineType(t)?t.values:[]},u.prototype.isSafari=function(){var t=window.navigator.userAgent;return 0<=t.indexOf("Safari")&&t.indexOf("Chrome")<0},u.prototype.isChrome=function(){return 0<=window.navigator.userAgent.indexOf("Chrome")},u.prototype.initZoom=function(){var e,i=this,n=i.d3,r=i.config;return i.zoom=n.zoom().on("start",function(){var t=n.event.sourceEvent;t&&"brush"===t.type||(e=t,r.zoom_onzoomstart.call(i.api,t))}).on("zoom",function(){var t=n.event.sourceEvent;t&&"brush"===t.type||i.redrawForZoom.call(i)}).on("end",function(){var t=n.event.sourceEvent;t&&"brush"===t.type||t&&e.clientX===t.clientX&&e.clientY===t.clientY||r.zoom_onzoomend.call(i.api,i.x.orgDomain())}),i.zoom.updateDomain=function(){return n.event&&n.event.transform&&i.x.domain(n.event.transform.rescaleX(i.subX).domain()),this},i.zoom.updateExtent=function(){return this.scaleExtent([1,1/0]).translateExtent([[0,0],[i.width,i.height]]).extent([[0,0],[i.width,i.height]]),this},i.zoom.update=function(){return this.updateExtent().updateDomain()},i.zoom.updateExtent()},u.prototype.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)},u.prototype.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])]},u.prototype.redrawForZoom=function(){var t=this,e=t.d3,i=t.config,n=t.zoom,r=t.x;i.zoom_enabled&&0!==t.filterTargetsToShow(t.data.targets).length&&(n.update(),t.isCategorized()&&r.orgDomain()[0]===t.orgXDomain[0]&&r.domain([t.orgXDomain[0]-1e-10,r.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,r.orgDomain()))},t});
\ No newline at end of file
diff --git a/package.json b/package.json
index e1a7999..4bc7ee2 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "c3",
- "version": "0.6.4",
+ "version": "0.6.5",
"description": "D3-based reusable chart library",
"main": "c3.js",
"scripts": {
diff --git a/src/core.js b/src/core.js
index 6b6333b..e1886f0 100644
--- a/src/core.js
+++ b/src/core.js
@@ -20,7 +20,7 @@ import {
} from './util';
var c3 = {
- version: "0.6.4",
+ version: "0.6.5",
chart: {
fn: Chart.prototype,
internal: {