Skip to content

Commit

Permalink
chore(version): bump to v0.7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
kt3k committed Aug 9, 2019
1 parent 20dff29 commit 1e2f039
Show file tree
Hide file tree
Showing 9 changed files with 145 additions and 76 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.3
version: 0.7.4
commit: 'chore(version): bump to v%.%.%'
files:
src/core.js: 'version: "%.%.%"'
Expand Down
100 changes: 66 additions & 34 deletions c3.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* @license C3.js v0.7.3 | (c) C3 Team and other contributors | http://c3js.org/ */
/* @license C3.js v0.7.4 | (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 @@ -1161,7 +1161,7 @@
};

var c3 = {
version: "0.7.3",
version: "0.7.4",
chart: {
fn: Chart.prototype,
internal: {
Expand Down Expand Up @@ -1806,47 +1806,45 @@
});
}

if ($$.isTabVisible()) {
if (duration && $$.isTabVisible()) {
// Only use transition if tab visible. See #938.
if (duration) {
// transition should be derived from one transition
transition = d3.transition().duration(duration);
transitionsToWait = [];
[$$.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) {
transitions.forEach(function (transition) {
transitionsToWait.push(transition);
});
}); // Wait for end of transitions to call flow and onrendered callback

waitForDraw = $$.generateWait();
transitionsToWait.forEach(function (t) {
waitForDraw.add(t);
});
waitForDraw(function () {
if (flow) {
flow();
}

if (config.onrendered) {
config.onrendered.call($$);
}
// transition should be derived from one transition
transition = d3.transition().duration(duration);
transitionsToWait = [];
[$$.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) {
transitions.forEach(function (transition) {
transitionsToWait.push(transition);
});
} else {
$$.redrawBar(drawBar);
$$.redrawLine(drawLine);
$$.redrawArea(drawArea);
$$.redrawCircle(cx, cy);
$$.redrawText(xForText, yForText, options.flow);
$$.redrawRegion();
$$.redrawGrid();
}); // Wait for end of transitions to call flow and onrendered callback

waitForDraw = $$.generateWait();
transitionsToWait.forEach(function (t) {
waitForDraw.add(t);
});
waitForDraw(function () {
if (flow) {
flow();
}

if (config.onrendered) {
config.onrendered.call($$);
}
});
} else {
$$.redrawBar(drawBar);
$$.redrawLine(drawLine);
$$.redrawArea(drawArea);
$$.redrawCircle(cx, cy);
$$.redrawText(xForText, yForText, options.flow);
$$.redrawRegion();
$$.redrawGrid();

if (flow) {
flow();
}

if (config.onrendered) {
config.onrendered.call($$);
}
} // update fadein condition

Expand Down Expand Up @@ -4390,6 +4388,17 @@
return this.internal.updateDataAttributes('axes', axes);
};

Chart.prototype.donut = function () {};

Chart.prototype.donut.padAngle = function (padAngle) {
if (padAngle === undefined) {
return this.internal.config.donut_padAngle;
}

this.internal.config.donut_padAngle = padAngle;
this.flush();
};

Chart.prototype.flow = function (args) {
var $$ = this.internal,
targets,
Expand Down Expand Up @@ -4900,6 +4909,17 @@
});
};

Chart.prototype.pie = function () {};

Chart.prototype.pie.padAngle = function (padAngle) {
if (padAngle === undefined) {
return this.internal.config.pie_padAngle;
}

this.internal.config.pie_padAngle = padAngle;
this.flush();
};

Chart.prototype.regions = function (regions) {
var $$ = this.internal,
config = $$.config;
Expand Down Expand Up @@ -5265,7 +5285,7 @@
ChartInternal.prototype.initPie = function () {
var $$ = this,
d3 = $$.d3;
$$.pie = d3.pie().value(function (d) {
$$.pie = d3.pie().padAngle(this.getPadAngle.bind(this)).value(function (d) {
return d.values.reduce(function (a, b) {
return a + b.value;
}, 0);
Expand Down Expand Up @@ -5295,6 +5315,16 @@
$$.gaugeArcWidth = w ? w : gaugeArcWidth <= $$.radius - $$.innerRadius ? $$.radius - $$.innerRadius : gaugeArcWidth <= $$.radius ? gaugeArcWidth : $$.radius;
};

ChartInternal.prototype.getPadAngle = function () {
if (this.hasType('pie')) {
return this.config.pie_padAngle || 0;
} else if (this.hasType('donut')) {
return this.config.donut_padAngle || 0;
} else {
return 0;
}
};

ChartInternal.prototype.updateArc = function () {
var $$ = this;
$$.svgArc = $$.getSvgArc();
Expand Down Expand Up @@ -6311,6 +6341,7 @@
pie_label_ratio: undefined,
pie_expand: {},
pie_expand_duration: 50,
pie_padAngle: 0,
// gauge
gauge_fullCircle: false,
gauge_label_show: true,
Expand All @@ -6334,6 +6365,7 @@
donut_title: "",
donut_expand: {},
donut_expand_duration: 50,
donut_padAngle: 0,
// spline
spline_interpolation_type: 'cardinal',
// stanford
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.3",
"version": "0.7.4",
"keywords": [],
"dependencies": {
"mbostock/d3": "v5.0.0"
Expand Down
5 changes: 5 additions & 0 deletions docs/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@

%h3 Change Log
%ul
%li
<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>
%ul
%li Add padAngle option.
%li A bug fix.
%li
<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>
%ul
Expand Down
100 changes: 66 additions & 34 deletions docs/js/c3.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* @license C3.js v0.7.3 | (c) C3 Team and other contributors | http://c3js.org/ */
/* @license C3.js v0.7.4 | (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 @@ -1161,7 +1161,7 @@
};

var c3 = {
version: "0.7.3",
version: "0.7.4",
chart: {
fn: Chart.prototype,
internal: {
Expand Down Expand Up @@ -1806,47 +1806,45 @@
});
}

if ($$.isTabVisible()) {
if (duration && $$.isTabVisible()) {
// Only use transition if tab visible. See #938.
if (duration) {
// transition should be derived from one transition
transition = d3.transition().duration(duration);
transitionsToWait = [];
[$$.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) {
transitions.forEach(function (transition) {
transitionsToWait.push(transition);
});
}); // Wait for end of transitions to call flow and onrendered callback

waitForDraw = $$.generateWait();
transitionsToWait.forEach(function (t) {
waitForDraw.add(t);
});
waitForDraw(function () {
if (flow) {
flow();
}

if (config.onrendered) {
config.onrendered.call($$);
}
// transition should be derived from one transition
transition = d3.transition().duration(duration);
transitionsToWait = [];
[$$.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) {
transitions.forEach(function (transition) {
transitionsToWait.push(transition);
});
} else {
$$.redrawBar(drawBar);
$$.redrawLine(drawLine);
$$.redrawArea(drawArea);
$$.redrawCircle(cx, cy);
$$.redrawText(xForText, yForText, options.flow);
$$.redrawRegion();
$$.redrawGrid();
}); // Wait for end of transitions to call flow and onrendered callback

waitForDraw = $$.generateWait();
transitionsToWait.forEach(function (t) {
waitForDraw.add(t);
});
waitForDraw(function () {
if (flow) {
flow();
}

if (config.onrendered) {
config.onrendered.call($$);
}
});
} else {
$$.redrawBar(drawBar);
$$.redrawLine(drawLine);
$$.redrawArea(drawArea);
$$.redrawCircle(cx, cy);
$$.redrawText(xForText, yForText, options.flow);
$$.redrawRegion();
$$.redrawGrid();

if (flow) {
flow();
}

if (config.onrendered) {
config.onrendered.call($$);
}
} // update fadein condition

Expand Down Expand Up @@ -4390,6 +4388,17 @@
return this.internal.updateDataAttributes('axes', axes);
};

Chart.prototype.donut = function () {};

Chart.prototype.donut.padAngle = function (padAngle) {
if (padAngle === undefined) {
return this.internal.config.donut_padAngle;
}

this.internal.config.donut_padAngle = padAngle;
this.flush();
};

Chart.prototype.flow = function (args) {
var $$ = this.internal,
targets,
Expand Down Expand Up @@ -4900,6 +4909,17 @@
});
};

Chart.prototype.pie = function () {};

Chart.prototype.pie.padAngle = function (padAngle) {
if (padAngle === undefined) {
return this.internal.config.pie_padAngle;
}

this.internal.config.pie_padAngle = padAngle;
this.flush();
};

Chart.prototype.regions = function (regions) {
var $$ = this.internal,
config = $$.config;
Expand Down Expand Up @@ -5265,7 +5285,7 @@
ChartInternal.prototype.initPie = function () {
var $$ = this,
d3 = $$.d3;
$$.pie = d3.pie().value(function (d) {
$$.pie = d3.pie().padAngle(this.getPadAngle.bind(this)).value(function (d) {
return d.values.reduce(function (a, b) {
return a + b.value;
}, 0);
Expand Down Expand Up @@ -5295,6 +5315,16 @@
$$.gaugeArcWidth = w ? w : gaugeArcWidth <= $$.radius - $$.innerRadius ? $$.radius - $$.innerRadius : gaugeArcWidth <= $$.radius ? gaugeArcWidth : $$.radius;
};

ChartInternal.prototype.getPadAngle = function () {
if (this.hasType('pie')) {
return this.config.pie_padAngle || 0;
} else if (this.hasType('donut')) {
return this.config.donut_padAngle || 0;
} else {
return 0;
}
};

ChartInternal.prototype.updateArc = function () {
var $$ = this;
$$.svgArc = $$.getSvgArc();
Expand Down Expand Up @@ -6311,6 +6341,7 @@
pie_label_ratio: undefined,
pie_expand: {},
pie_expand_duration: 50,
pie_padAngle: 0,
// gauge
gauge_fullCircle: false,
gauge_label_show: true,
Expand All @@ -6334,6 +6365,7 @@
donut_title: "",
donut_expand: {},
donut_expand_duration: 50,
donut_padAngle: 0,
// spline
spline_interpolation_type: 'cardinal',
// stanford
Expand Down
4 changes: 2 additions & 2 deletions docs/js/c3.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "c3",
"version": "0.7.3",
"version": "0.7.4",
"description": "D3-based reusable chart library",
"main": "c3.js",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
} from './util';

var c3 = {
version: "0.7.3",
version: "0.7.4",
chart: {
fn: Chart.prototype,
internal: {
Expand Down

0 comments on commit 1e2f039

Please sign in to comment.