Skip to content

Commit 43811cc

Browse files
committed
chore(version): bump to v0.7.14
1 parent 07e8298 commit 43811cc

11 files changed

+238
-42
lines changed

.bmp.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
version: 0.7.13
2+
version: 0.7.14
33
commit: 'chore(version): bump to v%.%.%'
44
files:
55
src/core.js: 'version: "%.%.%"'

c3.esm.js

+53-8
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
/* @license C3.js v0.7.12 | (c) C3 Team and other contributors | http://c3js.org/ */
1+
/* @license C3.js v0.7.14 | (c) C3 Team and other contributors | http://c3js.org/ */
22
import * as d3 from 'd3';
33

44
function ChartInternal(api) {
55
var $$ = this;
6+
// Note: This part will be replaced by rollup-plugin-modify
7+
// When bundling esm output. Beware of changing this line.
8+
// TODO: Maybe we should check that the modification by rollup-plugin-modify
9+
// is valid during unit tests.
610
$$.d3 = d3;
711
$$.api = api;
812
$$.config = $$.getDefaultConfig();
@@ -124,6 +128,46 @@ var isWithinBox = function(point, box, sensitivity = 0) {
124128
return xStart < point[0] && point[0] < xEnd && yEnd < point[1] && point[1] < yStart;
125129
};
126130

131+
/**
132+
* Returns Internet Explorer version number (or false if no Internet Explorer used).
133+
*
134+
* @param string agent Optional parameter to specify user agent
135+
*/
136+
var getIEVersion = function(agent) {
137+
// https://stackoverflow.com/questions/19999388/check-if-user-is-using-ie
138+
if (typeof agent === 'undefined') {
139+
agent = window.navigator.userAgent;
140+
}
141+
142+
let pos = agent.indexOf('MSIE '); // up to IE10
143+
if (pos > 0) {
144+
return parseInt(agent.substring(pos + 5, agent.indexOf('.', pos)), 10);
145+
}
146+
147+
pos = agent.indexOf('Trident/'); // IE11
148+
if (pos > 0) {
149+
pos = agent.indexOf('rv:');
150+
return parseInt(agent.substring(pos + 3, agent.indexOf('.', pos)), 10);
151+
}
152+
153+
return false;
154+
};
155+
156+
/**
157+
* Returns whether the used browser is Internet Explorer.
158+
*
159+
* @param {Number} version Optional parameter to specify IE version
160+
*/
161+
var isIE = function(version) {
162+
const ver = getIEVersion();
163+
164+
if (typeof version === 'undefined') {
165+
return !!ver;
166+
}
167+
168+
return version === ver;
169+
};
170+
127171
function AxisInternal(component, params) {
128172
var internal = this;
129173
internal.component = component;
@@ -1025,7 +1069,7 @@ Axis.prototype.redraw = function redraw(duration, isHidden) {
10251069
};
10261070

10271071
var c3 = {
1028-
version: "0.7.12",
1072+
version: "0.7.14",
10291073
chart: {
10301074
fn: Chart.prototype,
10311075
internal: {
@@ -4656,7 +4700,7 @@ Chart.prototype.show = function (targetIds, options) {
46564700
targets = $$.svg.selectAll($$.selectorTargets(targetIds));
46574701

46584702
targets.transition()
4659-
.style('display', 'initial', 'important')
4703+
.style('display', isIE() ? 'block' : 'initial', 'important')
46604704
.style('opacity', 1, 'important')
46614705
.call($$.endall, function () {
46624706
targets.style('opacity', null).style('opacity', 1);
@@ -5243,7 +5287,9 @@ ChartInternal.prototype.redrawArc = function (duration, durationForExit, withTra
52435287
}
52445288
else {
52455289
mainArcLabelLine
5246-
.style("fill", function (d) { return $$.levelColor ? $$.levelColor(d.data.values[0].value) : $$.color(d.data); })
5290+
.style("fill", function (d) {
5291+
return $$.levelColor ? $$.levelColor(d.data.values.reduce(function (total, item) { return total + item.value; }, 0)) : $$.color(d.data);
5292+
})
52475293
.style("display", config.gauge_labelLine_show ? "" : "none")
52485294
.each(function (d) {
52495295
var lineLength = 0, lineThickness = 2, x = 0, y = 0, transform = "";
@@ -5352,7 +5398,7 @@ ChartInternal.prototype.redrawArc = function (duration, durationForExit, withTra
53525398
})
53535399
.attr("transform", withTransform ? "scale(1)" : "")
53545400
.style("fill", function (d) {
5355-
return $$.levelColor ? $$.levelColor(d.data.values[0].value) : $$.color(d.data.id);
5401+
return $$.levelColor ? $$.levelColor(d.data.values.reduce(function (total, item) { return total + item.value; }, 0)) : $$.color(d.data.id);
53565402
}) // Where gauge reading color would receive customization.
53575403
.call($$.endall, function () {
53585404
$$.transiting = false;
@@ -5596,8 +5642,7 @@ ChartInternal.prototype.selectorLegends = function (ids) {
55965642
};
55975643

55985644
ChartInternal.prototype.getClipPath = function (id) {
5599-
var isIE9 = window.navigator.appVersion.toLowerCase().indexOf("msie 9.") >= 0;
5600-
return "url(" + (isIE9 ? "" : document.URL.split('#')[0]) + "#" + id + ")";
5645+
return "url(" + (isIE(9) ? "" : document.URL.split('#')[0]) + "#" + id + ")";
56015646
};
56025647
ChartInternal.prototype.appendClip = function (parent, id) {
56035648
return parent.append("clipPath").attr("id", id).append("rect");
@@ -8195,7 +8240,7 @@ ChartInternal.prototype.updateLegend = function (targetIds, options, transitions
81958240
.data(targetIds);
81968241
(withTransition ? tiles.transition() : tiles)
81978242
.style('stroke', $$.levelColor ? function(id) {
8198-
return $$.levelColor($$.cache[id].values[0].value);
8243+
return $$.levelColor($$.cache[id].values.reduce(function (total, item) { return total + item.value; }, 0));
81998244
} : $$.color)
82008245
.attr('x1', x1ForLegendTile)
82018246
.attr('y1', yForLegendTile)

c3.js

+60-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* @license C3.js v0.7.12 | (c) C3 Team and other contributors | http://c3js.org/ */
1+
/* @license C3.js v0.7.14 | (c) C3 Team and other contributors | http://c3js.org/ */
22
(function (global, factory) {
33
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
44
typeof define === 'function' && define.amd ? define(factory) :
@@ -61,7 +61,11 @@
6161
}
6262

6363
function ChartInternal(api) {
64-
var $$ = this;
64+
var $$ = this; // Note: This part will be replaced by rollup-plugin-modify
65+
// When bundling esm output. Beware of changing this line.
66+
// TODO: Maybe we should check that the modification by rollup-plugin-modify
67+
// is valid during unit tests.
68+
6569
$$.d3 = window.d3 ? window.d3 : typeof require !== 'undefined' ? require("d3") : undefined;
6670
$$.api = api;
6771
$$.config = $$.getDefaultConfig();
@@ -195,6 +199,48 @@
195199
var yEnd = box.y - sensitivity;
196200
return xStart < point[0] && point[0] < xEnd && yEnd < point[1] && point[1] < yStart;
197201
};
202+
/**
203+
* Returns Internet Explorer version number (or false if no Internet Explorer used).
204+
*
205+
* @param string agent Optional parameter to specify user agent
206+
*/
207+
208+
var getIEVersion = function getIEVersion(agent) {
209+
// https://stackoverflow.com/questions/19999388/check-if-user-is-using-ie
210+
if (typeof agent === 'undefined') {
211+
agent = window.navigator.userAgent;
212+
}
213+
214+
var pos = agent.indexOf('MSIE '); // up to IE10
215+
216+
if (pos > 0) {
217+
return parseInt(agent.substring(pos + 5, agent.indexOf('.', pos)), 10);
218+
}
219+
220+
pos = agent.indexOf('Trident/'); // IE11
221+
222+
if (pos > 0) {
223+
pos = agent.indexOf('rv:');
224+
return parseInt(agent.substring(pos + 3, agent.indexOf('.', pos)), 10);
225+
}
226+
227+
return false;
228+
};
229+
/**
230+
* Returns whether the used browser is Internet Explorer.
231+
*
232+
* @param {Number} version Optional parameter to specify IE version
233+
*/
234+
235+
var isIE = function isIE(version) {
236+
var ver = getIEVersion();
237+
238+
if (typeof version === 'undefined') {
239+
return !!ver;
240+
}
241+
242+
return version === ver;
243+
};
198244

199245
function AxisInternal(component, params) {
200246
var internal = this;
@@ -1232,7 +1278,7 @@
12321278
};
12331279

12341280
var c3 = {
1235-
version: "0.7.12",
1281+
version: "0.7.14",
12361282
chart: {
12371283
fn: Chart.prototype,
12381284
internal: {
@@ -5215,7 +5261,7 @@
52155261
options = options || {};
52165262
$$.removeHiddenTargetIds(targetIds);
52175263
targets = $$.svg.selectAll($$.selectorTargets(targetIds));
5218-
targets.transition().style('display', 'initial', 'important').style('opacity', 1, 'important').call($$.endall, function () {
5264+
targets.transition().style('display', isIE() ? 'block' : 'initial', 'important').style('opacity', 1, 'important').call($$.endall, function () {
52195265
targets.style('opacity', null).style('opacity', 1);
52205266
});
52215267

@@ -5879,7 +5925,9 @@
58795925
mainArcLabelLine.style("display", "none");
58805926
} else {
58815927
mainArcLabelLine.style("fill", function (d) {
5882-
return $$.levelColor ? $$.levelColor(d.data.values[0].value) : $$.color(d.data);
5928+
return $$.levelColor ? $$.levelColor(d.data.values.reduce(function (total, item) {
5929+
return total + item.value;
5930+
}, 0)) : $$.color(d.data);
58835931
}).style("display", config.gauge_labelLine_show ? "" : "none").each(function (d) {
58845932
var lineLength = 0,
58855933
lineThickness = 2,
@@ -6005,7 +6053,9 @@
60056053
return $$.getArc(interpolated, true);
60066054
};
60076055
}).attr("transform", withTransform ? "scale(1)" : "").style("fill", function (d) {
6008-
return $$.levelColor ? $$.levelColor(d.data.values[0].value) : $$.color(d.data.id);
6056+
return $$.levelColor ? $$.levelColor(d.data.values.reduce(function (total, item) {
6057+
return total + item.value;
6058+
}, 0)) : $$.color(d.data.id);
60096059
}) // Where gauge reading color would receive customization.
60106060
.call($$.endall, function () {
60116061
$$.transiting = false;
@@ -6278,8 +6328,7 @@
62786328
};
62796329

62806330
ChartInternal.prototype.getClipPath = function (id) {
6281-
var isIE9 = window.navigator.appVersion.toLowerCase().indexOf("msie 9.") >= 0;
6282-
return "url(" + (isIE9 ? "" : document.URL.split('#')[0]) + "#" + id + ")";
6331+
return "url(" + (isIE(9) ? "" : document.URL.split('#')[0]) + "#" + id + ")";
62836332
};
62846333

62856334
ChartInternal.prototype.appendClip = function (parent, id) {
@@ -9254,7 +9303,9 @@
92549303
}).attr('x', xForLegendRect).attr('y', yForLegendRect);
92559304
tiles = $$.legend.selectAll('line.' + CLASS.legendItemTile).data(targetIds);
92569305
(withTransition ? tiles.transition() : tiles).style('stroke', $$.levelColor ? function (id) {
9257-
return $$.levelColor($$.cache[id].values[0].value);
9306+
return $$.levelColor($$.cache[id].values.reduce(function (total, item) {
9307+
return total + item.value;
9308+
}, 0));
92589309
} : $$.color).attr('x1', x1ForLegendTile).attr('y1', yForLegendTile).attr('x2', x2ForLegendTile).attr('y2', yForLegendTile);
92599310

92609311
if (background) {

c3.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

component.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "c3",
33
"repo": "masayuki0812/c3",
44
"description": "A D3-based reusable chart library",
5-
"version": "0.7.13",
5+
"version": "0.7.14",
66
"keywords": [],
77
"dependencies": {
88
"mbostock/d3": "v5.0.0"

docs/index.html.haml

+4
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@
3838

3939
%h3 Change Log
4040
%ul
41+
%li
42+
<a href="https://github.com/c3js/c3/releases/tag/v0.7.14">v0.7.14</a><span class="gray">&nbsp;-&nbsp;2020-02-24</span>
43+
%ul
44+
%li Bug fixes.
4145
%li
4246
<a href="https://github.com/c3js/c3/releases/tag/v0.7.12">v0.7.12</a><span class="gray">&nbsp;-&nbsp;2019-10-04</span>
4347
%ul

docs/js/c3.esm.js

+53-8
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
/* @license C3.js v0.7.12 | (c) C3 Team and other contributors | http://c3js.org/ */
1+
/* @license C3.js v0.7.14 | (c) C3 Team and other contributors | http://c3js.org/ */
22
import * as d3 from 'd3';
33

44
function ChartInternal(api) {
55
var $$ = this;
6+
// Note: This part will be replaced by rollup-plugin-modify
7+
// When bundling esm output. Beware of changing this line.
8+
// TODO: Maybe we should check that the modification by rollup-plugin-modify
9+
// is valid during unit tests.
610
$$.d3 = d3;
711
$$.api = api;
812
$$.config = $$.getDefaultConfig();
@@ -124,6 +128,46 @@ var isWithinBox = function(point, box, sensitivity = 0) {
124128
return xStart < point[0] && point[0] < xEnd && yEnd < point[1] && point[1] < yStart;
125129
};
126130

131+
/**
132+
* Returns Internet Explorer version number (or false if no Internet Explorer used).
133+
*
134+
* @param string agent Optional parameter to specify user agent
135+
*/
136+
var getIEVersion = function(agent) {
137+
// https://stackoverflow.com/questions/19999388/check-if-user-is-using-ie
138+
if (typeof agent === 'undefined') {
139+
agent = window.navigator.userAgent;
140+
}
141+
142+
let pos = agent.indexOf('MSIE '); // up to IE10
143+
if (pos > 0) {
144+
return parseInt(agent.substring(pos + 5, agent.indexOf('.', pos)), 10);
145+
}
146+
147+
pos = agent.indexOf('Trident/'); // IE11
148+
if (pos > 0) {
149+
pos = agent.indexOf('rv:');
150+
return parseInt(agent.substring(pos + 3, agent.indexOf('.', pos)), 10);
151+
}
152+
153+
return false;
154+
};
155+
156+
/**
157+
* Returns whether the used browser is Internet Explorer.
158+
*
159+
* @param {Number} version Optional parameter to specify IE version
160+
*/
161+
var isIE = function(version) {
162+
const ver = getIEVersion();
163+
164+
if (typeof version === 'undefined') {
165+
return !!ver;
166+
}
167+
168+
return version === ver;
169+
};
170+
127171
function AxisInternal(component, params) {
128172
var internal = this;
129173
internal.component = component;
@@ -1025,7 +1069,7 @@ Axis.prototype.redraw = function redraw(duration, isHidden) {
10251069
};
10261070

10271071
var c3 = {
1028-
version: "0.7.12",
1072+
version: "0.7.14",
10291073
chart: {
10301074
fn: Chart.prototype,
10311075
internal: {
@@ -4656,7 +4700,7 @@ Chart.prototype.show = function (targetIds, options) {
46564700
targets = $$.svg.selectAll($$.selectorTargets(targetIds));
46574701

46584702
targets.transition()
4659-
.style('display', 'initial', 'important')
4703+
.style('display', isIE() ? 'block' : 'initial', 'important')
46604704
.style('opacity', 1, 'important')
46614705
.call($$.endall, function () {
46624706
targets.style('opacity', null).style('opacity', 1);
@@ -5243,7 +5287,9 @@ ChartInternal.prototype.redrawArc = function (duration, durationForExit, withTra
52435287
}
52445288
else {
52455289
mainArcLabelLine
5246-
.style("fill", function (d) { return $$.levelColor ? $$.levelColor(d.data.values[0].value) : $$.color(d.data); })
5290+
.style("fill", function (d) {
5291+
return $$.levelColor ? $$.levelColor(d.data.values.reduce(function (total, item) { return total + item.value; }, 0)) : $$.color(d.data);
5292+
})
52475293
.style("display", config.gauge_labelLine_show ? "" : "none")
52485294
.each(function (d) {
52495295
var lineLength = 0, lineThickness = 2, x = 0, y = 0, transform = "";
@@ -5352,7 +5398,7 @@ ChartInternal.prototype.redrawArc = function (duration, durationForExit, withTra
53525398
})
53535399
.attr("transform", withTransform ? "scale(1)" : "")
53545400
.style("fill", function (d) {
5355-
return $$.levelColor ? $$.levelColor(d.data.values[0].value) : $$.color(d.data.id);
5401+
return $$.levelColor ? $$.levelColor(d.data.values.reduce(function (total, item) { return total + item.value; }, 0)) : $$.color(d.data.id);
53565402
}) // Where gauge reading color would receive customization.
53575403
.call($$.endall, function () {
53585404
$$.transiting = false;
@@ -5596,8 +5642,7 @@ ChartInternal.prototype.selectorLegends = function (ids) {
55965642
};
55975643

55985644
ChartInternal.prototype.getClipPath = function (id) {
5599-
var isIE9 = window.navigator.appVersion.toLowerCase().indexOf("msie 9.") >= 0;
5600-
return "url(" + (isIE9 ? "" : document.URL.split('#')[0]) + "#" + id + ")";
5645+
return "url(" + (isIE(9) ? "" : document.URL.split('#')[0]) + "#" + id + ")";
56015646
};
56025647
ChartInternal.prototype.appendClip = function (parent, id) {
56035648
return parent.append("clipPath").attr("id", id).append("rect");
@@ -8195,7 +8240,7 @@ ChartInternal.prototype.updateLegend = function (targetIds, options, transitions
81958240
.data(targetIds);
81968241
(withTransition ? tiles.transition() : tiles)
81978242
.style('stroke', $$.levelColor ? function(id) {
8198-
return $$.levelColor($$.cache[id].values[0].value);
8243+
return $$.levelColor($$.cache[id].values.reduce(function (total, item) { return total + item.value; }, 0));
81998244
} : $$.color)
82008245
.attr('x1', x1ForLegendTile)
82018246
.attr('y1', yForLegendTile)

0 commit comments

Comments
 (0)