Skip to content

Commit 1e2f039

Browse files
committed
chore(version): bump to v0.7.4
1 parent 20dff29 commit 1e2f039

9 files changed

+145
-76
lines changed

.bmp.yml

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

c3.js

+66-34
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* @license C3.js v0.7.3 | (c) C3 Team and other contributors | http://c3js.org/ */
1+
/* @license C3.js v0.7.4 | (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) :
@@ -1161,7 +1161,7 @@
11611161
};
11621162

11631163
var c3 = {
1164-
version: "0.7.3",
1164+
version: "0.7.4",
11651165
chart: {
11661166
fn: Chart.prototype,
11671167
internal: {
@@ -1806,47 +1806,45 @@
18061806
});
18071807
}
18081808

1809-
if ($$.isTabVisible()) {
1809+
if (duration && $$.isTabVisible()) {
18101810
// Only use transition if tab visible. See #938.
1811-
if (duration) {
1812-
// transition should be derived from one transition
1813-
transition = d3.transition().duration(duration);
1814-
transitionsToWait = [];
1815-
[$$.redrawBar(drawBar, true, transition), $$.redrawLine(drawLine, true, transition), $$.redrawArea(drawArea, true, transition), $$.redrawCircle(cx, cy, true, transition), $$.redrawText(xForText, yForText, options.flow, true, transition), $$.redrawRegion(true, transition), $$.redrawGrid(true, transition)].forEach(function (transitions) {
1816-
transitions.forEach(function (transition) {
1817-
transitionsToWait.push(transition);
1818-
});
1819-
}); // Wait for end of transitions to call flow and onrendered callback
1820-
1821-
waitForDraw = $$.generateWait();
1822-
transitionsToWait.forEach(function (t) {
1823-
waitForDraw.add(t);
1824-
});
1825-
waitForDraw(function () {
1826-
if (flow) {
1827-
flow();
1828-
}
1829-
1830-
if (config.onrendered) {
1831-
config.onrendered.call($$);
1832-
}
1811+
// transition should be derived from one transition
1812+
transition = d3.transition().duration(duration);
1813+
transitionsToWait = [];
1814+
[$$.redrawBar(drawBar, true, transition), $$.redrawLine(drawLine, true, transition), $$.redrawArea(drawArea, true, transition), $$.redrawCircle(cx, cy, true, transition), $$.redrawText(xForText, yForText, options.flow, true, transition), $$.redrawRegion(true, transition), $$.redrawGrid(true, transition)].forEach(function (transitions) {
1815+
transitions.forEach(function (transition) {
1816+
transitionsToWait.push(transition);
18331817
});
1834-
} else {
1835-
$$.redrawBar(drawBar);
1836-
$$.redrawLine(drawLine);
1837-
$$.redrawArea(drawArea);
1838-
$$.redrawCircle(cx, cy);
1839-
$$.redrawText(xForText, yForText, options.flow);
1840-
$$.redrawRegion();
1841-
$$.redrawGrid();
1818+
}); // Wait for end of transitions to call flow and onrendered callback
18421819

1820+
waitForDraw = $$.generateWait();
1821+
transitionsToWait.forEach(function (t) {
1822+
waitForDraw.add(t);
1823+
});
1824+
waitForDraw(function () {
18431825
if (flow) {
18441826
flow();
18451827
}
18461828

18471829
if (config.onrendered) {
18481830
config.onrendered.call($$);
18491831
}
1832+
});
1833+
} else {
1834+
$$.redrawBar(drawBar);
1835+
$$.redrawLine(drawLine);
1836+
$$.redrawArea(drawArea);
1837+
$$.redrawCircle(cx, cy);
1838+
$$.redrawText(xForText, yForText, options.flow);
1839+
$$.redrawRegion();
1840+
$$.redrawGrid();
1841+
1842+
if (flow) {
1843+
flow();
1844+
}
1845+
1846+
if (config.onrendered) {
1847+
config.onrendered.call($$);
18501848
}
18511849
} // update fadein condition
18521850

@@ -4390,6 +4388,17 @@
43904388
return this.internal.updateDataAttributes('axes', axes);
43914389
};
43924390

4391+
Chart.prototype.donut = function () {};
4392+
4393+
Chart.prototype.donut.padAngle = function (padAngle) {
4394+
if (padAngle === undefined) {
4395+
return this.internal.config.donut_padAngle;
4396+
}
4397+
4398+
this.internal.config.donut_padAngle = padAngle;
4399+
this.flush();
4400+
};
4401+
43934402
Chart.prototype.flow = function (args) {
43944403
var $$ = this.internal,
43954404
targets,
@@ -4900,6 +4909,17 @@
49004909
});
49014910
};
49024911

4912+
Chart.prototype.pie = function () {};
4913+
4914+
Chart.prototype.pie.padAngle = function (padAngle) {
4915+
if (padAngle === undefined) {
4916+
return this.internal.config.pie_padAngle;
4917+
}
4918+
4919+
this.internal.config.pie_padAngle = padAngle;
4920+
this.flush();
4921+
};
4922+
49034923
Chart.prototype.regions = function (regions) {
49044924
var $$ = this.internal,
49054925
config = $$.config;
@@ -5265,7 +5285,7 @@
52655285
ChartInternal.prototype.initPie = function () {
52665286
var $$ = this,
52675287
d3 = $$.d3;
5268-
$$.pie = d3.pie().value(function (d) {
5288+
$$.pie = d3.pie().padAngle(this.getPadAngle.bind(this)).value(function (d) {
52695289
return d.values.reduce(function (a, b) {
52705290
return a + b.value;
52715291
}, 0);
@@ -5295,6 +5315,16 @@
52955315
$$.gaugeArcWidth = w ? w : gaugeArcWidth <= $$.radius - $$.innerRadius ? $$.radius - $$.innerRadius : gaugeArcWidth <= $$.radius ? gaugeArcWidth : $$.radius;
52965316
};
52975317

5318+
ChartInternal.prototype.getPadAngle = function () {
5319+
if (this.hasType('pie')) {
5320+
return this.config.pie_padAngle || 0;
5321+
} else if (this.hasType('donut')) {
5322+
return this.config.donut_padAngle || 0;
5323+
} else {
5324+
return 0;
5325+
}
5326+
};
5327+
52985328
ChartInternal.prototype.updateArc = function () {
52995329
var $$ = this;
53005330
$$.svgArc = $$.getSvgArc();
@@ -6311,6 +6341,7 @@
63116341
pie_label_ratio: undefined,
63126342
pie_expand: {},
63136343
pie_expand_duration: 50,
6344+
pie_padAngle: 0,
63146345
// gauge
63156346
gauge_fullCircle: false,
63166347
gauge_label_show: true,
@@ -6334,6 +6365,7 @@
63346365
donut_title: "",
63356366
donut_expand: {},
63366367
donut_expand_duration: 50,
6368+
donut_padAngle: 0,
63376369
// spline
63386370
spline_interpolation_type: 'cardinal',
63396371
// stanford

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.3",
5+
"version": "0.7.4",
66
"keywords": [],
77
"dependencies": {
88
"mbostock/d3": "v5.0.0"

docs/index.html.haml

+5
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@
3838

3939
%h3 Change Log
4040
%ul
41+
%li
42+
<a href="https://github.com/c3js/c3/releases/tag/v0.7.4">v0.7.4</a><span class="gray">&nbsp;-&nbsp;2019-08-09</span>
43+
%ul
44+
%li Add padAngle option.
45+
%li A bug fix.
4146
%li
4247
<a href="https://github.com/c3js/c3/releases/tag/v0.7.3">v0.7.3</a><span class="gray">&nbsp;-&nbsp;2019-07-29</span>
4348
%ul

docs/js/c3.js

+66-34
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* @license C3.js v0.7.3 | (c) C3 Team and other contributors | http://c3js.org/ */
1+
/* @license C3.js v0.7.4 | (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) :
@@ -1161,7 +1161,7 @@
11611161
};
11621162

11631163
var c3 = {
1164-
version: "0.7.3",
1164+
version: "0.7.4",
11651165
chart: {
11661166
fn: Chart.prototype,
11671167
internal: {
@@ -1806,47 +1806,45 @@
18061806
});
18071807
}
18081808

1809-
if ($$.isTabVisible()) {
1809+
if (duration && $$.isTabVisible()) {
18101810
// Only use transition if tab visible. See #938.
1811-
if (duration) {
1812-
// transition should be derived from one transition
1813-
transition = d3.transition().duration(duration);
1814-
transitionsToWait = [];
1815-
[$$.redrawBar(drawBar, true, transition), $$.redrawLine(drawLine, true, transition), $$.redrawArea(drawArea, true, transition), $$.redrawCircle(cx, cy, true, transition), $$.redrawText(xForText, yForText, options.flow, true, transition), $$.redrawRegion(true, transition), $$.redrawGrid(true, transition)].forEach(function (transitions) {
1816-
transitions.forEach(function (transition) {
1817-
transitionsToWait.push(transition);
1818-
});
1819-
}); // Wait for end of transitions to call flow and onrendered callback
1820-
1821-
waitForDraw = $$.generateWait();
1822-
transitionsToWait.forEach(function (t) {
1823-
waitForDraw.add(t);
1824-
});
1825-
waitForDraw(function () {
1826-
if (flow) {
1827-
flow();
1828-
}
1829-
1830-
if (config.onrendered) {
1831-
config.onrendered.call($$);
1832-
}
1811+
// transition should be derived from one transition
1812+
transition = d3.transition().duration(duration);
1813+
transitionsToWait = [];
1814+
[$$.redrawBar(drawBar, true, transition), $$.redrawLine(drawLine, true, transition), $$.redrawArea(drawArea, true, transition), $$.redrawCircle(cx, cy, true, transition), $$.redrawText(xForText, yForText, options.flow, true, transition), $$.redrawRegion(true, transition), $$.redrawGrid(true, transition)].forEach(function (transitions) {
1815+
transitions.forEach(function (transition) {
1816+
transitionsToWait.push(transition);
18331817
});
1834-
} else {
1835-
$$.redrawBar(drawBar);
1836-
$$.redrawLine(drawLine);
1837-
$$.redrawArea(drawArea);
1838-
$$.redrawCircle(cx, cy);
1839-
$$.redrawText(xForText, yForText, options.flow);
1840-
$$.redrawRegion();
1841-
$$.redrawGrid();
1818+
}); // Wait for end of transitions to call flow and onrendered callback
18421819

1820+
waitForDraw = $$.generateWait();
1821+
transitionsToWait.forEach(function (t) {
1822+
waitForDraw.add(t);
1823+
});
1824+
waitForDraw(function () {
18431825
if (flow) {
18441826
flow();
18451827
}
18461828

18471829
if (config.onrendered) {
18481830
config.onrendered.call($$);
18491831
}
1832+
});
1833+
} else {
1834+
$$.redrawBar(drawBar);
1835+
$$.redrawLine(drawLine);
1836+
$$.redrawArea(drawArea);
1837+
$$.redrawCircle(cx, cy);
1838+
$$.redrawText(xForText, yForText, options.flow);
1839+
$$.redrawRegion();
1840+
$$.redrawGrid();
1841+
1842+
if (flow) {
1843+
flow();
1844+
}
1845+
1846+
if (config.onrendered) {
1847+
config.onrendered.call($$);
18501848
}
18511849
} // update fadein condition
18521850

@@ -4390,6 +4388,17 @@
43904388
return this.internal.updateDataAttributes('axes', axes);
43914389
};
43924390

4391+
Chart.prototype.donut = function () {};
4392+
4393+
Chart.prototype.donut.padAngle = function (padAngle) {
4394+
if (padAngle === undefined) {
4395+
return this.internal.config.donut_padAngle;
4396+
}
4397+
4398+
this.internal.config.donut_padAngle = padAngle;
4399+
this.flush();
4400+
};
4401+
43934402
Chart.prototype.flow = function (args) {
43944403
var $$ = this.internal,
43954404
targets,
@@ -4900,6 +4909,17 @@
49004909
});
49014910
};
49024911

4912+
Chart.prototype.pie = function () {};
4913+
4914+
Chart.prototype.pie.padAngle = function (padAngle) {
4915+
if (padAngle === undefined) {
4916+
return this.internal.config.pie_padAngle;
4917+
}
4918+
4919+
this.internal.config.pie_padAngle = padAngle;
4920+
this.flush();
4921+
};
4922+
49034923
Chart.prototype.regions = function (regions) {
49044924
var $$ = this.internal,
49054925
config = $$.config;
@@ -5265,7 +5285,7 @@
52655285
ChartInternal.prototype.initPie = function () {
52665286
var $$ = this,
52675287
d3 = $$.d3;
5268-
$$.pie = d3.pie().value(function (d) {
5288+
$$.pie = d3.pie().padAngle(this.getPadAngle.bind(this)).value(function (d) {
52695289
return d.values.reduce(function (a, b) {
52705290
return a + b.value;
52715291
}, 0);
@@ -5295,6 +5315,16 @@
52955315
$$.gaugeArcWidth = w ? w : gaugeArcWidth <= $$.radius - $$.innerRadius ? $$.radius - $$.innerRadius : gaugeArcWidth <= $$.radius ? gaugeArcWidth : $$.radius;
52965316
};
52975317

5318+
ChartInternal.prototype.getPadAngle = function () {
5319+
if (this.hasType('pie')) {
5320+
return this.config.pie_padAngle || 0;
5321+
} else if (this.hasType('donut')) {
5322+
return this.config.donut_padAngle || 0;
5323+
} else {
5324+
return 0;
5325+
}
5326+
};
5327+
52985328
ChartInternal.prototype.updateArc = function () {
52995329
var $$ = this;
53005330
$$.svgArc = $$.getSvgArc();
@@ -6311,6 +6341,7 @@
63116341
pie_label_ratio: undefined,
63126342
pie_expand: {},
63136343
pie_expand_duration: 50,
6344+
pie_padAngle: 0,
63146345
// gauge
63156346
gauge_fullCircle: false,
63166347
gauge_label_show: true,
@@ -6334,6 +6365,7 @@
63346365
donut_title: "",
63356366
donut_expand: {},
63366367
donut_expand_duration: 50,
6368+
donut_padAngle: 0,
63376369
// spline
63386370
spline_interpolation_type: 'cardinal',
63396371
// stanford

docs/js/c3.min.js

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

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "c3",
3-
"version": "0.7.3",
3+
"version": "0.7.4",
44
"description": "D3-based reusable chart library",
55
"main": "c3.js",
66
"files": [

src/core.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {
2020
} from './util';
2121

2222
var c3 = {
23-
version: "0.7.3",
23+
version: "0.7.4",
2424
chart: {
2525
fn: Chart.prototype,
2626
internal: {

0 commit comments

Comments
 (0)