Comparing version 0.4.18 to 0.4.19
@@ -5,3 +5,3 @@ { | ||
"description": "A D3-based reusable chart library", | ||
"version": "0.4.18", | ||
"version": "0.4.19", | ||
"keywords": [], | ||
@@ -8,0 +8,0 @@ "dependencies": { |
{ | ||
"name": "c3", | ||
"version": "0.4.18", | ||
"version": "0.4.19", | ||
"description": "D3-based reusable chart library", | ||
@@ -12,3 +12,3 @@ "main": "c3.js", | ||
"build:js:rollup": "rollup -c > c3.js", | ||
"build:js:uglify": "uglifyjs c3.js --compress --mangle -o c3.min.js", | ||
"build:js:uglify": "uglifyjs c3.js --compress --mangle --comments -o c3.min.js", | ||
"build:css": "npm run build:css:sass && npm run build:css:min", | ||
@@ -49,9 +49,9 @@ "build:css:sass": "node-sass src/scss/main.scss > c3.css", | ||
"babelify": "^7.3.0", | ||
"browserify": "^14.4.0", | ||
"browserify": "^15.0.0", | ||
"clean-css-cli": "^4.1.3", | ||
"codecov": "^2.2.0", | ||
"codecov": "^3.0.0", | ||
"jasmine-core": "^2.3.4", | ||
"jshint": "^2.9.4", | ||
"jshint-stylish": "^2.1.0", | ||
"karma": "^1.7.0", | ||
"karma": "^2.0.0", | ||
"karma-browserify": "^5.1.1", | ||
@@ -61,8 +61,8 @@ "karma-chrome-launcher": "^2.1.1", | ||
"karma-jasmine": "^1.1.0", | ||
"karma-spec-reporter": "0.0.31", | ||
"karma-spec-reporter": "0.0.32", | ||
"node-sass": "^4.5.3", | ||
"node-static": "^0.7.9", | ||
"nodemon": "^1.11.0", | ||
"rollup": "^0.49.0", | ||
"rollup-plugin-babel": "^3.0.0", | ||
"rollup": "^0.55.0", | ||
"rollup-plugin-babel": "^3.0.3", | ||
"uglify-js": "^3.0.15", | ||
@@ -69,0 +69,0 @@ "watchify": "^3.9.0" |
# c3 | ||
[![Build Status](https://travis-ci.org/c3js/c3.svg?branch=master)](https://travis-ci.org/c3js/c3) | ||
[![devDependency Status](https://david-dm.org/c3js/c3/dev-status.svg)](https://david-dm.org/c3js/c3#info=devDependencies) | ||
[![CircleCI](https://circleci.com/gh/c3js/c3.svg?style=shield)](https://circleci.com/gh/c3js/c3) | ||
[![license](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)](https://github.com/c3js/c3/blob/master/LICENSE) | ||
[![codecov.io](https://codecov.io/github/c3js/c3/coverage.svg?branch=master)](https://codecov.io/github/c3js/c3?branch=master) | ||
[![Greenkeeper badge](https://badges.greenkeeper.io/c3js/c3.svg)](https://greenkeeper.io/) | ||
[![jsDelivr Hits](https://data.jsdelivr.com/v1/package/npm/c3/badge?style=rounded)](https://www.jsdelivr.com/package/npm/c3) | ||
@@ -9,0 +9,0 @@ > c3 is a D3-based reusable chart library that enables deeper integration of charts into web applications. |
import babel from 'rollup-plugin-babel'; | ||
import pkg from './package.json' | ||
export default { | ||
entry: 'src/index.js', | ||
format: 'umd', | ||
moduleName: 'c3', | ||
input: 'src/index.js', | ||
output: { | ||
name: 'c3', | ||
format: 'umd', | ||
banner: `/* @license C3.js v${pkg.version} | (c) C3 Team and other contributors | http://c3js.org/ */` | ||
}, | ||
plugins: [babel({ | ||
@@ -8,0 +12,0 @@ presets: [['es2015', { |
@@ -405,3 +405,3 @@ describe('c3 chart axis', function () { | ||
it('should split tick text properly', function () { | ||
xit('should split tick text properly', function () { | ||
var tick = chart.internal.main.select('.c3-axis-x').select('g.tick'), | ||
@@ -408,0 +408,0 @@ tspans = tick.selectAll('tspan'), |
@@ -25,5 +25,5 @@ import { c3_chart_fn } from './core'; | ||
if (window.detachEvent) { | ||
window.detachEvent('onresize', $$.resizeFunction); | ||
window.detachEvent('onresize', $$.resizeIfElementDisplayed); | ||
} else if (window.removeEventListener) { | ||
window.removeEventListener('resize', $$.resizeFunction); | ||
window.removeEventListener('resize', $$.resizeIfElementDisplayed); | ||
} else { | ||
@@ -37,2 +37,5 @@ var wrapper = window.onresize; | ||
// remove the inner resize functions | ||
$$.resizeFunction.remove(); | ||
$$.selectChart.classed('c3', false).html(""); | ||
@@ -39,0 +42,0 @@ |
@@ -5,3 +5,3 @@ import Axis from './axis'; | ||
export var c3 = { version: "0.4.18" }; | ||
export var c3 = { version: "0.4.19" }; | ||
@@ -922,3 +922,3 @@ export var c3_chart_fn; | ||
$$.resizeFunction = $$.generateResize(); | ||
$$.resizeFunction = $$.generateResize(); // need to call .remove | ||
@@ -943,6 +943,15 @@ $$.resizeFunction.add(function () { | ||
$$.resizeIfElementDisplayed = function() { | ||
// if element not displayed skip it | ||
if ($$.api == null || !$$.api.element.offsetParent) { | ||
return; | ||
} | ||
$$.resizeFunction(); | ||
}; | ||
if (window.attachEvent) { | ||
window.attachEvent('onresize', $$.resizeFunction); | ||
window.attachEvent('onresize', $$.resizeIfElementDisplayed); | ||
} else if (window.addEventListener) { | ||
window.addEventListener('resize', $$.resizeFunction, false); | ||
window.addEventListener('resize', $$.resizeIfElementDisplayed, false); | ||
} else { | ||
@@ -961,3 +970,10 @@ // fallback to this, if this is a very old browser | ||
wrapper.add($$.resizeFunction); | ||
window.onresize = wrapper; | ||
window.onresize = function() { | ||
// if element not displayed skip it | ||
if (!$$.api.element.offsetParent) { | ||
return; | ||
} | ||
wrapper(); | ||
}; | ||
} | ||
@@ -964,0 +980,0 @@ }; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1477200
23090
229