Skip to content

Commit

Permalink
chore(version): bump to v0.7.14
Browse files Browse the repository at this point in the history
  • Loading branch information
kt3k committed Feb 24, 2020
1 parent 07e8298 commit 43811cc
Show file tree
Hide file tree
Showing 11 changed files with 238 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .bmp.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
version: 0.7.13
version: 0.7.14
commit: 'chore(version): bump to v%.%.%'
files:
src/core.js: 'version: "%.%.%"'
Expand Down
61 changes: 53 additions & 8 deletions c3.esm.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
/* @license C3.js v0.7.12 | (c) C3 Team and other contributors | http://c3js.org/ */
/* @license C3.js v0.7.14 | (c) C3 Team and other contributors | http://c3js.org/ */
import * as d3 from 'd3';

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

/**
* Returns Internet Explorer version number (or false if no Internet Explorer used).
*
* @param string agent Optional parameter to specify user agent
*/
var getIEVersion = function(agent) {
// https://stackoverflow.com/questions/19999388/check-if-user-is-using-ie
if (typeof agent === 'undefined') {
agent = window.navigator.userAgent;
}

let pos = agent.indexOf('MSIE '); // up to IE10
if (pos > 0) {
return parseInt(agent.substring(pos + 5, agent.indexOf('.', pos)), 10);
}

pos = agent.indexOf('Trident/'); // IE11
if (pos > 0) {
pos = agent.indexOf('rv:');
return parseInt(agent.substring(pos + 3, agent.indexOf('.', pos)), 10);
}

return false;
};

/**
* Returns whether the used browser is Internet Explorer.
*
* @param {Number} version Optional parameter to specify IE version
*/
var isIE = function(version) {
const ver = getIEVersion();

if (typeof version === 'undefined') {
return !!ver;
}

return version === ver;
};

function AxisInternal(component, params) {
var internal = this;
internal.component = component;
Expand Down Expand Up @@ -1025,7 +1069,7 @@ Axis.prototype.redraw = function redraw(duration, isHidden) {
};

var c3 = {
version: "0.7.12",
version: "0.7.14",
chart: {
fn: Chart.prototype,
internal: {
Expand Down Expand Up @@ -4656,7 +4700,7 @@ Chart.prototype.show = function (targetIds, options) {
targets = $$.svg.selectAll($$.selectorTargets(targetIds));

targets.transition()
.style('display', 'initial', 'important')
.style('display', isIE() ? 'block' : 'initial', 'important')
.style('opacity', 1, 'important')
.call($$.endall, function () {
targets.style('opacity', null).style('opacity', 1);
Expand Down Expand Up @@ -5243,7 +5287,9 @@ ChartInternal.prototype.redrawArc = function (duration, durationForExit, withTra
}
else {
mainArcLabelLine
.style("fill", function (d) { return $$.levelColor ? $$.levelColor(d.data.values[0].value) : $$.color(d.data); })
.style("fill", function (d) {
return $$.levelColor ? $$.levelColor(d.data.values.reduce(function (total, item) { return total + item.value; }, 0)) : $$.color(d.data);
})
.style("display", config.gauge_labelLine_show ? "" : "none")
.each(function (d) {
var lineLength = 0, lineThickness = 2, x = 0, y = 0, transform = "";
Expand Down Expand Up @@ -5352,7 +5398,7 @@ ChartInternal.prototype.redrawArc = function (duration, durationForExit, withTra
})
.attr("transform", withTransform ? "scale(1)" : "")
.style("fill", function (d) {
return $$.levelColor ? $$.levelColor(d.data.values[0].value) : $$.color(d.data.id);
return $$.levelColor ? $$.levelColor(d.data.values.reduce(function (total, item) { return total + item.value; }, 0)) : $$.color(d.data.id);
}) // Where gauge reading color would receive customization.
.call($$.endall, function () {
$$.transiting = false;
Expand Down Expand Up @@ -5596,8 +5642,7 @@ ChartInternal.prototype.selectorLegends = function (ids) {
};

ChartInternal.prototype.getClipPath = function (id) {
var isIE9 = window.navigator.appVersion.toLowerCase().indexOf("msie 9.") >= 0;
return "url(" + (isIE9 ? "" : document.URL.split('#')[0]) + "#" + id + ")";
return "url(" + (isIE(9) ? "" : document.URL.split('#')[0]) + "#" + id + ")";
};
ChartInternal.prototype.appendClip = function (parent, id) {
return parent.append("clipPath").attr("id", id).append("rect");
Expand Down Expand Up @@ -8195,7 +8240,7 @@ ChartInternal.prototype.updateLegend = function (targetIds, options, transitions
.data(targetIds);
(withTransition ? tiles.transition() : tiles)
.style('stroke', $$.levelColor ? function(id) {
return $$.levelColor($$.cache[id].values[0].value);
return $$.levelColor($$.cache[id].values.reduce(function (total, item) { return total + item.value; }, 0));
} : $$.color)
.attr('x1', x1ForLegendTile)
.attr('y1', yForLegendTile)
Expand Down
69 changes: 60 additions & 9 deletions c3.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* @license C3.js v0.7.12 | (c) C3 Team and other contributors | http://c3js.org/ */
/* @license C3.js v0.7.14 | (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) :
Expand Down Expand Up @@ -61,7 +61,11 @@
}

function ChartInternal(api) {
var $$ = this;
var $$ = this; // Note: This part will be replaced by rollup-plugin-modify
// When bundling esm output. Beware of changing this line.
// TODO: Maybe we should check that the modification by rollup-plugin-modify
// is valid during unit tests.

$$.d3 = window.d3 ? window.d3 : typeof require !== 'undefined' ? require("d3") : undefined;
$$.api = api;
$$.config = $$.getDefaultConfig();
Expand Down Expand Up @@ -195,6 +199,48 @@
var yEnd = box.y - sensitivity;
return xStart < point[0] && point[0] < xEnd && yEnd < point[1] && point[1] < yStart;
};
/**
* Returns Internet Explorer version number (or false if no Internet Explorer used).
*
* @param string agent Optional parameter to specify user agent
*/

var getIEVersion = function getIEVersion(agent) {
// https://stackoverflow.com/questions/19999388/check-if-user-is-using-ie
if (typeof agent === 'undefined') {
agent = window.navigator.userAgent;
}

var pos = agent.indexOf('MSIE '); // up to IE10

if (pos > 0) {
return parseInt(agent.substring(pos + 5, agent.indexOf('.', pos)), 10);
}

pos = agent.indexOf('Trident/'); // IE11

if (pos > 0) {
pos = agent.indexOf('rv:');
return parseInt(agent.substring(pos + 3, agent.indexOf('.', pos)), 10);
}

return false;
};
/**
* Returns whether the used browser is Internet Explorer.
*
* @param {Number} version Optional parameter to specify IE version
*/

var isIE = function isIE(version) {
var ver = getIEVersion();

if (typeof version === 'undefined') {
return !!ver;
}

return version === ver;
};

function AxisInternal(component, params) {
var internal = this;
Expand Down Expand Up @@ -1232,7 +1278,7 @@
};

var c3 = {
version: "0.7.12",
version: "0.7.14",
chart: {
fn: Chart.prototype,
internal: {
Expand Down Expand Up @@ -5215,7 +5261,7 @@
options = options || {};
$$.removeHiddenTargetIds(targetIds);
targets = $$.svg.selectAll($$.selectorTargets(targetIds));
targets.transition().style('display', 'initial', 'important').style('opacity', 1, 'important').call($$.endall, function () {
targets.transition().style('display', isIE() ? 'block' : 'initial', 'important').style('opacity', 1, 'important').call($$.endall, function () {
targets.style('opacity', null).style('opacity', 1);
});

Expand Down Expand Up @@ -5879,7 +5925,9 @@
mainArcLabelLine.style("display", "none");
} else {
mainArcLabelLine.style("fill", function (d) {
return $$.levelColor ? $$.levelColor(d.data.values[0].value) : $$.color(d.data);
return $$.levelColor ? $$.levelColor(d.data.values.reduce(function (total, item) {
return total + item.value;
}, 0)) : $$.color(d.data);
}).style("display", config.gauge_labelLine_show ? "" : "none").each(function (d) {
var lineLength = 0,
lineThickness = 2,
Expand Down Expand Up @@ -6005,7 +6053,9 @@
return $$.getArc(interpolated, true);
};
}).attr("transform", withTransform ? "scale(1)" : "").style("fill", function (d) {
return $$.levelColor ? $$.levelColor(d.data.values[0].value) : $$.color(d.data.id);
return $$.levelColor ? $$.levelColor(d.data.values.reduce(function (total, item) {
return total + item.value;
}, 0)) : $$.color(d.data.id);
}) // Where gauge reading color would receive customization.
.call($$.endall, function () {
$$.transiting = false;
Expand Down Expand Up @@ -6278,8 +6328,7 @@
};

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

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

if (background) {
Expand Down
4 changes: 2 additions & 2 deletions c3.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion component.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "c3",
"repo": "masayuki0812/c3",
"description": "A D3-based reusable chart library",
"version": "0.7.13",
"version": "0.7.14",
"keywords": [],
"dependencies": {
"mbostock/d3": "v5.0.0"
Expand Down
4 changes: 4 additions & 0 deletions docs/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@

%h3 Change Log
%ul
%li
<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>
%ul
%li Bug fixes.
%li
<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>
%ul
Expand Down
61 changes: 53 additions & 8 deletions docs/js/c3.esm.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
/* @license C3.js v0.7.12 | (c) C3 Team and other contributors | http://c3js.org/ */
/* @license C3.js v0.7.14 | (c) C3 Team and other contributors | http://c3js.org/ */
import * as d3 from 'd3';

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

/**
* Returns Internet Explorer version number (or false if no Internet Explorer used).
*
* @param string agent Optional parameter to specify user agent
*/
var getIEVersion = function(agent) {
// https://stackoverflow.com/questions/19999388/check-if-user-is-using-ie
if (typeof agent === 'undefined') {
agent = window.navigator.userAgent;
}

let pos = agent.indexOf('MSIE '); // up to IE10
if (pos > 0) {
return parseInt(agent.substring(pos + 5, agent.indexOf('.', pos)), 10);
}

pos = agent.indexOf('Trident/'); // IE11
if (pos > 0) {
pos = agent.indexOf('rv:');
return parseInt(agent.substring(pos + 3, agent.indexOf('.', pos)), 10);
}

return false;
};

/**
* Returns whether the used browser is Internet Explorer.
*
* @param {Number} version Optional parameter to specify IE version
*/
var isIE = function(version) {
const ver = getIEVersion();

if (typeof version === 'undefined') {
return !!ver;
}

return version === ver;
};

function AxisInternal(component, params) {
var internal = this;
internal.component = component;
Expand Down Expand Up @@ -1025,7 +1069,7 @@ Axis.prototype.redraw = function redraw(duration, isHidden) {
};

var c3 = {
version: "0.7.12",
version: "0.7.14",
chart: {
fn: Chart.prototype,
internal: {
Expand Down Expand Up @@ -4656,7 +4700,7 @@ Chart.prototype.show = function (targetIds, options) {
targets = $$.svg.selectAll($$.selectorTargets(targetIds));

targets.transition()
.style('display', 'initial', 'important')
.style('display', isIE() ? 'block' : 'initial', 'important')
.style('opacity', 1, 'important')
.call($$.endall, function () {
targets.style('opacity', null).style('opacity', 1);
Expand Down Expand Up @@ -5243,7 +5287,9 @@ ChartInternal.prototype.redrawArc = function (duration, durationForExit, withTra
}
else {
mainArcLabelLine
.style("fill", function (d) { return $$.levelColor ? $$.levelColor(d.data.values[0].value) : $$.color(d.data); })
.style("fill", function (d) {
return $$.levelColor ? $$.levelColor(d.data.values.reduce(function (total, item) { return total + item.value; }, 0)) : $$.color(d.data);
})
.style("display", config.gauge_labelLine_show ? "" : "none")
.each(function (d) {
var lineLength = 0, lineThickness = 2, x = 0, y = 0, transform = "";
Expand Down Expand Up @@ -5352,7 +5398,7 @@ ChartInternal.prototype.redrawArc = function (duration, durationForExit, withTra
})
.attr("transform", withTransform ? "scale(1)" : "")
.style("fill", function (d) {
return $$.levelColor ? $$.levelColor(d.data.values[0].value) : $$.color(d.data.id);
return $$.levelColor ? $$.levelColor(d.data.values.reduce(function (total, item) { return total + item.value; }, 0)) : $$.color(d.data.id);
}) // Where gauge reading color would receive customization.
.call($$.endall, function () {
$$.transiting = false;
Expand Down Expand Up @@ -5596,8 +5642,7 @@ ChartInternal.prototype.selectorLegends = function (ids) {
};

ChartInternal.prototype.getClipPath = function (id) {
var isIE9 = window.navigator.appVersion.toLowerCase().indexOf("msie 9.") >= 0;
return "url(" + (isIE9 ? "" : document.URL.split('#')[0]) + "#" + id + ")";
return "url(" + (isIE(9) ? "" : document.URL.split('#')[0]) + "#" + id + ")";
};
ChartInternal.prototype.appendClip = function (parent, id) {
return parent.append("clipPath").attr("id", id).append("rect");
Expand Down Expand Up @@ -8195,7 +8240,7 @@ ChartInternal.prototype.updateLegend = function (targetIds, options, transitions
.data(targetIds);
(withTransition ? tiles.transition() : tiles)
.style('stroke', $$.levelColor ? function(id) {
return $$.levelColor($$.cache[id].values[0].value);
return $$.levelColor($$.cache[id].values.reduce(function (total, item) { return total + item.value; }, 0));
} : $$.color)
.attr('x1', x1ForLegendTile)
.attr('y1', yForLegendTile)
Expand Down
Loading

0 comments on commit 43811cc

Please sign in to comment.