[merge] develop

This commit is contained in:
Prateeksha Singh 2018-04-19 09:19:58 +05:30
commit a0b4719456
15 changed files with 1389 additions and 94 deletions

View File

@ -6,5 +6,9 @@
}
}]
],
"plugins": ["external-helpers"]
"env": {
"test": {
"presets": ["env"]
}
}
}

14
.travis.yml Normal file
View File

@ -0,0 +1,14 @@
language: node_js
node_js:
- "6"
- "8"
before_install:
- make install
script:
- make test
after_success:
- make coveralls

View File

@ -1,4 +1,45 @@
-include .env
BASEDIR = $(realpath .)
BASEDIR = $(realpath .)
SRCDIR = $(BASEDIR)/src
DISTDIR = $(BASEDIR)/dist
DOCSDIR = $(BASEDIR)/docs
PROJECT = frappe-charts
NODEMOD = $(BASEDIR)/node_modules
NODEBIN = $(NODEMOD)/.bin
build: clean install
$(NODEBIN)/rollup \
--config $(BASEDIR)/rollup.config.js \
--watch=$(watch)
clean:
rm -rf \
$(BASEDIR)/.nyc_output \
$(BASEDIR)/.yarn-error.log
clear
install.dep:
ifeq ($(shell command -v yarn),)
@echo "Installing yarn..."
npm install -g yarn
endif
install: install.dep
yarn --cwd $(BASEDIR)
test: clean
$(NODEBIN)/cross-env \
NODE_ENV=test \
$(NODEBIN)/nyc \
$(NODEBIN)/mocha \
--require $(NODEMOD)/babel-register \
--recursive \
$(SRCDIR)/js/**/test/*.test.js
coveralls:
$(NODEBIN)/nyc report --reporter text-lcov | $(NODEBIN)/coveralls

View File

@ -1,6 +1,8 @@
<div align="center">
<img src="https://github.com/frappe/design/blob/master/logos/charts-logo.svg" height="128">
<h2>Frappe Charts</h2>
<a href="https://frappe.github.io/charts">
<h2>Frappe Charts</h2>
</a>
<p align="center">
<p>GitHub-inspired modern, intuitive and responsive charts with zero dependencies</p>
<a href="https://frappe.github.io/charts">
@ -10,6 +12,9 @@
</div>
<p align="center">
<a href="https://travis-ci.org/frappe/charts">
<img src="https://img.shields.io/travis/frappe/charts.svg?style=flat-square">
</a>
<a href="http://github.com/frappe/charts/tree/master/dist/js/frappe-charts.min.iife.js">
<img src="http://img.badgesize.io/frappe/charts/master/dist/frappe-charts.min.iife.js.svg?compression=gzip">
</a>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -46,6 +46,12 @@ var HEATMAP_COLORS_YELLOW = ['#ebedf0', '#fdf436', '#ffc700', '#ff9100', '#06001
// Universal constants
/**
* Returns the value of a number upto 2 decimal places.
* @param {Number} d Any number
*/
/**
* Returns whether or not two given arrays are equal.
* @param {Array} arr1 First array
@ -114,7 +120,6 @@ var MONTH_NAMES_SHORT = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug",
// https://stackoverflow.com/a/11252167/6495043
function clone(date) {
@ -294,6 +299,8 @@ var heatmapData = {
end: end
};
// ================================================================================
var c1 = document.querySelector("#chart-composite-1");
var c2 = document.querySelector("#chart-composite-2");

File diff suppressed because one or more lines are too long

View File

@ -36,16 +36,22 @@
"autoprefixer": "^8.2.0",
"babel-core": "^6.26.0",
"babel-plugin-external-helpers": "^6.22.0",
"babel-plugin-istanbul": "^4.1.5",
"babel-preset-env": "^1.6.1",
"babel-preset-latest": "^6.24.1",
"clean-css": "^4.1.11",
"babel-register": "^6.26.0",
"coveralls": "^3.0.0",
"cross-env": "^5.1.4",
"cssnano": "^3.10.0",
"eslint": "^4.18.2",
"fs": "0.0.1-security",
"livereload": "^0.6.3",
"mocha": "^5.0.5",
"node-sass": "^4.7.2",
"npm-run-all": "^4.1.1",
"postcss": "^6.0.21",
"nyc": "^11.6.0",
"postcss-cssnext": "^3.0.2",
"postcss-nested": "^2.1.2",
"precss": "^3.1.2",
@ -59,5 +65,6 @@
"rollup-plugin-uglify-es": "0.0.1",
"rollup-watch": "^4.3.1"
},
"dependencies": {}
"dependencies": {
}
}

View File

@ -71,7 +71,8 @@ export default [
]
}),
babel({
exclude: 'node_modules/**'
exclude: 'node_modules/**',
plugins: ['external-helpers']
}),
replace({
exclude: 'node_modules/**',

View File

@ -375,7 +375,7 @@ export default class AxisChart extends BaseChart {
xPos: s.xAxis.positions[index],
values: values,
yExtreme: s.yExtremes[index],
}
};
});
}

View File

@ -0,0 +1,10 @@
const assert = require('assert')
const helpers = require('../helpers')
describe('utils.helpers', () => {
it('should return a value fixed upto 2 decimals', () => {
assert.equal(helpers.floatTwo(1.234), 1.23);
assert.equal(helpers.floatTwo(1.456), 1.46);
assert.equal(helpers.floatTwo(1), 1.00);
});
});

1370
yarn.lock

File diff suppressed because it is too large Load Diff