Browse Source

chore(version): bump to v0.5.3

pull/2344/head v0.5.3
Yoshiya Hinosawa 7 years ago
parent
commit
3ca01bdf5c
  1. 2
      .bmp.yml
  2. 84
      c3.js
  3. 4
      c3.min.js
  4. 2
      component.json
  5. 4
      docs/index.html.haml
  6. 4
      docs/js/c3.min.js
  7. 2
      package.json
  8. 2
      src/core.js

2
.bmp.yml

@ -1,5 +1,5 @@
--- ---
version: 0.5.2 version: 0.5.3
commit: 'chore(version): bump to v%.%.%' commit: 'chore(version): bump to v%.%.%'
files: files:
src/core.js: 'version: "%.%.%"' src/core.js: 'version: "%.%.%"'

84
c3.js

@ -1,4 +1,4 @@
/* @license C3.js v0.5.2 | (c) C3 Team and other contributors | http://c3js.org/ */ /* @license C3.js v0.5.3 | (c) C3 Team and other contributors | http://c3js.org/ */
(function (global, factory) { (function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) : typeof define === 'function' && define.amd ? define(factory) :
@ -96,6 +96,21 @@
} }
}; };
var defineProperty = function (obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
};
var inherits = function (subClass, superClass) { var inherits = function (subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) { if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
@ -120,6 +135,10 @@
return call && (typeof call === "object" || typeof call === "function") ? call : self; return call && (typeof call === "object" || typeof call === "function") ? call : self;
}; };
var toArray = function (arr) {
return Array.isArray(arr) ? arr : Array.from(arr);
};
var isValue = function isValue(v) { var isValue = function isValue(v) {
return v || v === 0; return v || v === 0;
}; };
@ -978,7 +997,7 @@
$$.axes.subx.style("opacity", isHidden ? 0 : 1).call($$.subXAxis, transition); $$.axes.subx.style("opacity", isHidden ? 0 : 1).call($$.subXAxis, transition);
}; };
var c3 = { version: "0.5.2" }; var c3 = { version: "0.5.3" };
var c3_chart_fn; var c3_chart_fn;
var c3_chart_internal_fn; var c3_chart_internal_fn;
@ -5383,23 +5402,26 @@
}); });
}; };
c3_chart_internal_fn.convertXsvToData = function (xsv, parser) { c3_chart_internal_fn.convertXsvToData = function (xsv, parser) {
var rows = parser(xsv), var _parser$parseRows = parser.parseRows(xsv),
d; _parser$parseRows2 = toArray(_parser$parseRows),
if (rows.length === 1) { keys = _parser$parseRows2[0],
d = [{}]; rows = _parser$parseRows2.slice(1);
rows[0].forEach(function (id) {
d[0][id] = null; if (rows.length === 0) {
}); return { keys: keys, rows: [keys.reduce(function (row, key) {
return Object.assign(row, defineProperty({}, key, null));
}, {})] };
} else { } else {
d = parser(xsv); // [].concat() is to convert result into a plain array otherwise
// test is not happy because rows have properties.
return { keys: keys, rows: [].concat(parser.parse(xsv)) };
} }
return d;
}; };
c3_chart_internal_fn.convertCsvToData = function (csv) { c3_chart_internal_fn.convertCsvToData = function (csv) {
return this.convertXsvToData(csv, this.d3.csvParse); return this.convertXsvToData(csv, { parse: this.d3.csvParse, parseRows: this.d3.csvParseRows });
}; };
c3_chart_internal_fn.convertTsvToData = function (tsv) { c3_chart_internal_fn.convertTsvToData = function (tsv) {
return this.convertXsvToData(tsv, this.d3.tsvParse); return this.convertXsvToData(tsv, { parse: this.d3.tsvParse, parseRows: this.d3.tsvParseRows });
}; };
c3_chart_internal_fn.convertJsonToData = function (json, keys) { c3_chart_internal_fn.convertJsonToData = function (json, keys) {
var $$ = this, var $$ = this,
@ -5454,7 +5476,7 @@
/** /**
* Converts the rows to normalized data. * Converts the rows to normalized data.
* @param {any[][]} rows The row data * @param {any[][]} rows The row data
* @return {Object[]} * @return {Object}
*/ */
c3_chart_internal_fn.convertRowsToData = function (rows) { c3_chart_internal_fn.convertRowsToData = function (rows) {
var newRows = []; var newRows = [];
@ -5470,16 +5492,17 @@
} }
newRows.push(newRow); newRows.push(newRow);
} }
return newRows; return { keys: keys, rows: newRows };
}; };
/** /**
* Converts the columns to normalized data. * Converts the columns to normalized data.
* @param {any[][]} columns The column data * @param {any[][]} columns The column data
* @return {Object[]} * @return {Object}
*/ */
c3_chart_internal_fn.convertColumnsToData = function (columns) { c3_chart_internal_fn.convertColumnsToData = function (columns) {
var newRows = []; var newRows = [];
var keys = [];
for (var i = 0; i < columns.length; i++) { for (var i = 0; i < columns.length; i++) {
var key = columns[i][0]; var key = columns[i][0];
@ -5492,17 +5515,38 @@
} }
newRows[j - 1][key] = columns[i][j]; newRows[j - 1][key] = columns[i][j];
} }
keys.push(key);
} }
return newRows; return { keys: keys, rows: newRows };
}; };
/**
* Converts the data format into the target format.
* @param {!Object} data
* @param {!Array} data.keys Ordered list of target IDs.
* @param {!Array} data.rows Rows of data to convert.
* @param {boolean} appendXs True to append to $$.data.xs, False to replace.
* @return {!Array}
*/
c3_chart_internal_fn.convertDataToTargets = function (data, appendXs) { c3_chart_internal_fn.convertDataToTargets = function (data, appendXs) {
var $$ = this, var $$ = this,
config = $$.config, config = $$.config,
ids = $$.d3.keys(data[0]).filter($$.isNotX, $$), targets,
xs = $$.d3.keys(data[0]).filter($$.isX, $$), ids,
targets; xs,
keys;
// handles format where keys are not orderly provided
if (isArray(data)) {
keys = Object.keys(data[0]);
} else {
keys = data.keys;
data = data.rows;
}
ids = keys.filter($$.isNotX, $$);
xs = keys.filter($$.isX, $$);
// save x for update data by load when custom x and c3.x API // save x for update data by load when custom x and c3.x API
ids.forEach(function (id) { ids.forEach(function (id) {

4
c3.min.js vendored

File diff suppressed because one or more lines are too long

2
component.json

@ -2,7 +2,7 @@
"name": "c3", "name": "c3",
"repo": "masayuki0812/c3", "repo": "masayuki0812/c3",
"description": "A D3-based reusable chart library", "description": "A D3-based reusable chart library",
"version": "0.5.2", "version": "0.5.3",
"keywords": [], "keywords": [],
"dependencies": { "dependencies": {
"mbostock/d3": "v3.5.6" "mbostock/d3": "v3.5.6"

4
docs/index.html.haml

@ -38,6 +38,10 @@
%h3 Change Log %h3 Change Log
%ul %ul
%li
<a href="https://github.com/c3js/c3/releases/tag/v0.5.3">v0.5.3</a><span class="gray">&nbsp;-&nbsp;2018-04-12</span>
%ul
%li Bug fixes.
%li %li
<a href="https://github.com/c3js/c3/releases/tag/v0.5.2">v0.5.2</a><span class="gray">&nbsp;-&nbsp;2018-03-31</span> <a href="https://github.com/c3js/c3/releases/tag/v0.5.2">v0.5.2</a><span class="gray">&nbsp;-&nbsp;2018-03-31</span>
%ul %ul

4
docs/js/c3.min.js vendored

File diff suppressed because one or more lines are too long

2
package.json

@ -1,6 +1,6 @@
{ {
"name": "c3", "name": "c3",
"version": "0.5.2", "version": "0.5.3",
"description": "D3-based reusable chart library", "description": "D3-based reusable chart library",
"main": "c3.js", "main": "c3.js",
"scripts": { "scripts": {

2
src/core.js

@ -2,7 +2,7 @@ import Axis from './axis';
import CLASS from './class'; import CLASS from './class';
import { isValue, isFunction, isString, isUndefined, isDefined, ceil10, asHalfPixel, diffDomain, isEmpty, notEmpty, getOption, hasValue, sanitise, getPathBox } from './util'; import { isValue, isFunction, isString, isUndefined, isDefined, ceil10, asHalfPixel, diffDomain, isEmpty, notEmpty, getOption, hasValue, sanitise, getPathBox } from './util';
export var c3 = { version: "0.5.2" }; export var c3 = { version: "0.5.3" };
export var c3_chart_fn; export var c3_chart_fn;
export var c3_chart_internal_fn; export var c3_chart_internal_fn;

Loading…
Cancel
Save