Skip to content

Commit

Permalink
chore(version): bump to v0.7.8
Browse files Browse the repository at this point in the history
  • Loading branch information
kt3k committed Aug 25, 2019
1 parent 09423b6 commit 2bc2488
Show file tree
Hide file tree
Showing 13 changed files with 220 additions and 172 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.7
version: 0.7.8
commit: 'chore(version): bump to v%.%.%'
files:
src/core.js: 'version: "%.%.%"'
Expand Down
4 changes: 4 additions & 0 deletions c3.css
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@
}

/*-- Point --*/
.c3-circle {
fill: currentColor;
}

.c3-circle._expanded_ {
stroke-width: 1px;
stroke: white;
Expand Down
179 changes: 98 additions & 81 deletions c3.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* @license C3.js v0.7.7 | (c) C3 Team and other contributors | http://c3js.org/ */
/* @license C3.js v0.7.8 | (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 @@ -94,6 +94,92 @@
})(Chart.prototype, this, this);
}

var asHalfPixel = function asHalfPixel(n) {
return Math.ceil(n) + 0.5;
};
var ceil10 = function ceil10(v) {
return Math.ceil(v / 10) * 10;
};
var diffDomain = function diffDomain(d) {
return d[1] - d[0];
};
var getOption = function getOption(options, key, defaultValue) {
return isDefined(options[key]) ? options[key] : defaultValue;
};
var getPathBox = function getPathBox(path) {
var box = getBBox(path),
items = [path.pathSegList.getItem(0), path.pathSegList.getItem(1)],
minX = items[0].x,
minY = Math.min(items[0].y, items[1].y);
return {
x: minX,
y: minY,
width: box.width,
height: box.height
};
};
var getBBox = function getBBox(element) {
try {
return element.getBBox();
} catch (ignore) {
// Firefox will throw an exception if getBBox() is called whereas the
// element is rendered with display:none
// See https://github.com/c3js/c3/issues/2692
// The previous code was using `getBoundingClientRect` which was returning
// everything at 0 in this case so let's reproduce this behavior here.
return {
x: 0,
y: 0,
width: 0,
height: 0
};
}
};
var hasValue = function hasValue(dict, value) {
var found = false;
Object.keys(dict).forEach(function (key) {
if (dict[key] === value) {
found = true;
}
});
return found;
};
var isArray = function isArray(o) {
return Array.isArray(o);
};
var isDefined = function isDefined(v) {
return typeof v !== 'undefined';
};
var isEmpty = function isEmpty(o) {
return typeof o === 'undefined' || o === null || isString(o) && o.length === 0 || _typeof(o) === 'object' && Object.keys(o).length === 0;
};
var isFunction = function isFunction(o) {
return typeof o === 'function';
};
var isNumber = function isNumber(o) {
return typeof o === 'number';
};
var isString = function isString(o) {
return typeof o === 'string';
};
var isUndefined = function isUndefined(v) {
return typeof v === 'undefined';
};
var isValue = function isValue(v) {
return v || v === 0;
};
var notEmpty = function notEmpty(o) {
return !isEmpty(o);
};
var sanitise = function sanitise(str) {
return typeof str === 'string' ? str.replace(/</g, '&lt;').replace(/>/g, '&gt;') : str;
};
var flattenArray = function flattenArray(arr) {
var _ref;

return Array.isArray(arr) ? (_ref = []).concat.apply(_ref, _toConsumableArray(arr)) : [];
};

function AxisInternal(component, params) {
var internal = this;
internal.component = component;
Expand Down Expand Up @@ -197,7 +283,7 @@
tick.select('text').text(function (d) {
return internal.textFormatted(d);
}).each(function (d) {
var box = this.getBBox(),
var box = getBBox(this),
text = internal.textFormatted(d),
h = box.height,
w = text ? box.width / text.length : undefined;
Expand Down Expand Up @@ -660,75 +746,6 @@
INCLUDED: '_included_'
};

var asHalfPixel = function asHalfPixel(n) {
return Math.ceil(n) + 0.5;
};
var ceil10 = function ceil10(v) {
return Math.ceil(v / 10) * 10;
};
var diffDomain = function diffDomain(d) {
return d[1] - d[0];
};
var getOption = function getOption(options, key, defaultValue) {
return isDefined(options[key]) ? options[key] : defaultValue;
};
var getPathBox = function getPathBox(path) {
var box = path.getBBox(),
items = [path.pathSegList.getItem(0), path.pathSegList.getItem(1)],
minX = items[0].x,
minY = Math.min(items[0].y, items[1].y);
return {
x: minX,
y: minY,
width: box.width,
height: box.height
};
};
var hasValue = function hasValue(dict, value) {
var found = false;
Object.keys(dict).forEach(function (key) {
if (dict[key] === value) {
found = true;
}
});
return found;
};
var isArray = function isArray(o) {
return Array.isArray(o);
};
var isDefined = function isDefined(v) {
return typeof v !== 'undefined';
};
var isEmpty = function isEmpty(o) {
return typeof o === 'undefined' || o === null || isString(o) && o.length === 0 || _typeof(o) === 'object' && Object.keys(o).length === 0;
};
var isFunction = function isFunction(o) {
return typeof o === 'function';
};
var isNumber = function isNumber(o) {
return typeof o === 'number';
};
var isString = function isString(o) {
return typeof o === 'string';
};
var isUndefined = function isUndefined(v) {
return typeof v === 'undefined';
};
var isValue = function isValue(v) {
return v || v === 0;
};
var notEmpty = function notEmpty(o) {
return !isEmpty(o);
};
var sanitise = function sanitise(str) {
return typeof str === 'string' ? str.replace(/</g, '&lt;').replace(/>/g, '&gt;') : str;
};
var flattenArray = function flattenArray(arr) {
var _ref;

return Array.isArray(arr) ? (_ref = []).concat.apply(_ref, _toConsumableArray(arr)) : [];
};

var Axis = function Axis(owner) {
_classCallCheck(this, Axis);

Expand Down Expand Up @@ -1090,7 +1107,7 @@
dummy = $$.d3.select('body').append('div').classed('c3', true);
svg = dummy.append("svg").style('visibility', 'hidden').style('position', 'fixed').style('top', 0).style('left', 0), svg.append('g').call(axis).each(function () {
$$.d3.select(this).selectAll('text').each(function () {
var box = this.getBBox();
var box = getBBox(this);

if (maxWidth < box.width) {
maxWidth = box.width;
Expand Down Expand Up @@ -1199,7 +1216,7 @@
};

var c3 = {
version: "0.7.7",
version: "0.7.8",
chart: {
fn: Chart.prototype,
internal: {
Expand Down Expand Up @@ -7393,7 +7410,7 @@
$$.selectChart.select('svg').selectAll('.dummy').data([min, max]).enter().append('text').text(function (d) {
return $$.dataLabelFormat(d.id)(d);
}).each(function (d, i) {
lengths[i] = this.getBBox()[key] * paddingCoef;
lengths[i] = getBBox(this)[key] * paddingCoef;
}).remove();
return lengths;
};
Expand Down Expand Up @@ -9439,7 +9456,7 @@
return false;
}

var box = that.getBBox(),
var box = getBBox(that),
seg0 = that.pathSegList.getItem(0),
seg1 = that.pathSegList.getItem(1),
x = Math.min(seg0.x, seg1.x),
Expand Down Expand Up @@ -9952,15 +9969,15 @@
ChartInternal.prototype.updateCircle = function (cx, cy) {
var $$ = this;
var mainCircle = $$.main.selectAll('.' + CLASS.circles).selectAll('.' + CLASS.circle).data($$.lineOrScatterOrStanfordData.bind($$));
var mainCircleEnter = mainCircle.enter().append("circle").attr('shape-rendering', 'crispEdges').attr("class", $$.classCircle.bind($$)).attr("cx", cx).attr("cy", cy).attr("r", $$.pointR.bind($$)).style("fill", $$.isStanfordGraphType() ? $$.getStanfordPointColor.bind($$) : $$.color);
var mainCircleEnter = mainCircle.enter().append("circle").attr('shape-rendering', $$.isStanfordGraphType() ? 'crispEdges' : '').attr("class", $$.classCircle.bind($$)).attr("cx", cx).attr("cy", cy).attr("r", $$.pointR.bind($$)).style("color", $$.isStanfordGraphType() ? $$.getStanfordPointColor.bind($$) : $$.color);
$$.mainCircle = mainCircleEnter.merge(mainCircle).style("opacity", $$.isStanfordGraphType() ? 1 : $$.initialOpacityForCircle.bind($$));
mainCircle.exit().style("opacity", 0);
};

ChartInternal.prototype.redrawCircle = function (cx, cy, withTransition, transition) {
var $$ = this,
selectedCircles = $$.main.selectAll('.' + CLASS.selectedCircle);
return [(withTransition ? $$.mainCircle.transition(transition) : $$.mainCircle).style('opacity', this.opacityForCircle.bind($$)).style("fill", $$.isStanfordGraphType() ? $$.getStanfordPointColor.bind($$) : $$.color).attr("cx", cx).attr("cy", cy), (withTransition ? selectedCircles.transition(transition) : selectedCircles).attr("cx", cx).attr("cy", cy)];
return [(withTransition ? $$.mainCircle.transition(transition) : $$.mainCircle).style('opacity', this.opacityForCircle.bind($$)).style("color", $$.isStanfordGraphType() ? $$.getStanfordPointColor.bind($$) : $$.color).attr("cx", cx).attr("cy", cy), (withTransition ? selectedCircles.transition(transition) : selectedCircles).attr("cx", cx).attr("cy", cy)];
};

ChartInternal.prototype.circleX = function (d) {
Expand Down Expand Up @@ -10523,7 +10540,7 @@
font = this.d3.select(element).style('font'),
rect;
svg.selectAll('.dummy').data([text]).enter().append('text').classed(cls ? cls : "", true).style('font', font).text(text).each(function () {
rect = this.getBBox();
rect = getBBox(this);
});
dummy.remove();
return rect;
Expand All @@ -10543,7 +10560,7 @@

ChartInternal.prototype.getXForText = function (points, d, textElement) {
var $$ = this,
box = textElement.getBBox(),
box = getBBox(textElement),
xPos,
padding;

Expand All @@ -10568,7 +10585,7 @@

ChartInternal.prototype.getYForText = function (points, d, textElement) {
var $$ = this,
box = textElement.getBBox(),
box = getBBox(textElement),
yPos;

if ($$.config.axis_rotated) {
Expand Down Expand Up @@ -10708,7 +10725,7 @@

ChartInternal.prototype.xForColorScale = function () {
var $$ = this;
return $$.config.stanford_padding.right + $$.colorScale.node().getBBox().width;
return $$.config.stanford_padding.right + getBBox($$.colorScale.node()).width;
};

ChartInternal.prototype.getColorScalePadding = function () {
Expand Down
2 changes: 1 addition & 1 deletion c3.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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.7",
"version": "0.7.8",
"keywords": [],
"dependencies": {
"mbostock/d3": "v5.0.0"
Expand Down
4 changes: 4 additions & 0 deletions docs/css/c3.css
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@
}

/*-- Point --*/
.c3-circle {
fill: currentColor;
}

.c3-circle._expanded_ {
stroke-width: 1px;
stroke: white;
Expand Down
Loading

0 comments on commit 2bc2488

Please sign in to comment.