From 83e0b719406c26d8a2285c454a2bdd9a0d941540 Mon Sep 17 00:00:00 2001 From: Masayuki Tanaka Date: Mon, 8 Jan 2018 15:39:46 +0900 Subject: [PATCH] Remove functions not used --- src/axis.js | 3 --- src/data.js | 59 ----------------------------------------------------- src/size.js | 3 --- src/type.js | 3 --- 4 files changed, 68 deletions(-) diff --git a/src/axis.js b/src/axis.js index 8feb677..64f6096 100644 --- a/src/axis.js +++ b/src/axis.js @@ -102,9 +102,6 @@ c3_axis_internal_fn.updateTickTextCharSize = function (tick) { internal.tickTextCharSize = size; return size; }; -c3_axis_internal_fn.transitionise = function (selection) { - return this.params.withoutTransition ? selection : selection.transition(); -}; c3_axis_internal_fn.isVertical = function () { return this.orient === 'left' || this.orient === 'right'; }; diff --git a/src/data.js b/src/data.js index 8d8e3a6..a3d8517 100644 --- a/src/data.js +++ b/src/data.js @@ -42,14 +42,6 @@ c3_chart_internal_fn.addXs = function (xs) { $$.config.data_xs[id] = xs[id]; }); }; -c3_chart_internal_fn.hasMultipleX = function (xs) { -// return this.d3.set(Object.keys(xs).map(function (id) { return xs[id]; })).size() > 1; - return true; -}; -c3_chart_internal_fn.isMultipleX = function () { -// return notEmpty(this.config.data_xs) || !this.config.data_xSort || this.hasType('scatter'); - return true; -}; c3_chart_internal_fn.addName = function (data) { var $$ = this, name; if (data) { @@ -101,48 +93,10 @@ c3_chart_internal_fn.cloneTarget = function (target) { }) }; }; -c3_chart_internal_fn.updateXs = function () { - var $$ = this; - if ($$.data.targets.length) { - $$.xs = []; - $$.data.targets[0].values.forEach(function (v) { - $$.xs[v.index] = v.x; - }); - } -}; -c3_chart_internal_fn.getPrevX = function (i) { - var x = this.xs[i - 1]; - return typeof x !== 'undefined' ? x : null; -}; -c3_chart_internal_fn.getNextX = function (i) { - var x = this.xs[i + 1]; - return typeof x !== 'undefined' ? x : null; -}; c3_chart_internal_fn.getMaxDataCount = function () { var $$ = this; return $$.d3.max($$.data.targets, function (t) { return t.values.length; }); }; -c3_chart_internal_fn.getMaxDataCountTarget = function (targets) { - var length = targets.length, max = 0, maxTarget; - if (length > 1) { - targets.forEach(function (t) { - if (t.values.length > max) { - maxTarget = t; - max = t.values.length; - } - }); - } else { - maxTarget = length ? targets[0] : null; - } - return maxTarget; -}; -c3_chart_internal_fn.getEdgeX = function (targets) { - var $$ = this; - return !targets.length ? [0, 0] : [ - $$.d3.min(targets, function (t) { return t.values[0].x; }), - $$.d3.max(targets, function (t) { return t.values[t.values.length - 1].x; }) - ]; -}; c3_chart_internal_fn.mapToIds = function (targets) { return targets.map(function (d) { return d.id; }); }; @@ -306,19 +260,6 @@ c3_chart_internal_fn.isNoneArc = function (d) { c3_chart_internal_fn.isArc = function (d) { return 'data' in d && this.hasTarget(this.data.targets, d.data.id); }; -c3_chart_internal_fn.findSameXOfValues = function (values, index) { - var i, targetX = values[index].x, sames = []; - for (i = index - 1; i >= 0; i--) { - if (targetX !== values[i].x) { break; } - sames.push(values[i]); - } - for (i = index; i < values.length; i++) { - if (targetX !== values[i].x) { break; } - sames.push(values[i]); - } - return sames; -}; - c3_chart_internal_fn.findClosestFromTargets = function (targets, pos) { var $$ = this, candidates; diff --git a/src/size.js b/src/size.js index c4892ca..df565ee 100644 --- a/src/size.js +++ b/src/size.js @@ -114,6 +114,3 @@ c3_chart_internal_fn.getHorizontalAxisHeight = function (axisId) { return h + ($$.axis.getLabelPositionById(axisId).isInner ? 0 : 10) + (axisId === 'y2' ? -10 : 0); }; -c3_chart_internal_fn.getEventRectWidth = function () { - return Math.max(0, this.xAxis.tickInterval()); -}; diff --git a/src/type.js b/src/type.js index 620f7ef..72a4b6e 100644 --- a/src/type.js +++ b/src/type.js @@ -92,6 +92,3 @@ c3_chart_internal_fn.lineOrScatterData = function (d) { c3_chart_internal_fn.barOrLineData = function (d) { return this.isBarType(d) || this.isLineType(d) ? d.values : []; }; -c3_chart_internal_fn.isInterpolationType = function (type) { - return ['linear', 'linear-closed', 'basis', 'basis-open', 'basis-closed', 'bundle', 'cardinal', 'cardinal-open', 'cardinal-closed', 'monotone'].indexOf(type) >= 0; -};