[merge] develop
This commit is contained in:
commit
a0b4719456
6
.babelrc
6
.babelrc
@ -6,5 +6,9 @@
|
|||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
],
|
],
|
||||||
"plugins": ["external-helpers"]
|
"env": {
|
||||||
|
"test": {
|
||||||
|
"presets": ["env"]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
14
.travis.yml
Normal file
14
.travis.yml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
language: node_js
|
||||||
|
|
||||||
|
node_js:
|
||||||
|
- "6"
|
||||||
|
- "8"
|
||||||
|
|
||||||
|
before_install:
|
||||||
|
- make install
|
||||||
|
|
||||||
|
script:
|
||||||
|
- make test
|
||||||
|
|
||||||
|
after_success:
|
||||||
|
- make coveralls
|
||||||
43
Makefile
43
Makefile
@ -1,4 +1,45 @@
|
|||||||
-include .env
|
-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
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
<div align="center">
|
<div align="center">
|
||||||
<img src="https://github.com/frappe/design/blob/master/logos/charts-logo.svg" height="128">
|
<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 align="center">
|
||||||
<p>GitHub-inspired modern, intuitive and responsive charts with zero dependencies</p>
|
<p>GitHub-inspired modern, intuitive and responsive charts with zero dependencies</p>
|
||||||
<a href="https://frappe.github.io/charts">
|
<a href="https://frappe.github.io/charts">
|
||||||
@ -10,6 +12,9 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p align="center">
|
<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">
|
<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">
|
<img src="http://img.badgesize.io/frappe/charts/master/dist/frappe-charts.min.iife.js.svg?compression=gzip">
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
2
dist/frappe-charts.min.cjs.js
vendored
2
dist/frappe-charts.min.cjs.js
vendored
File diff suppressed because one or more lines are too long
2
dist/frappe-charts.min.esm.js
vendored
2
dist/frappe-charts.min.esm.js
vendored
File diff suppressed because one or more lines are too long
2
dist/frappe-charts.min.iife.js.map
vendored
2
dist/frappe-charts.min.iife.js.map
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
9
docs/assets/js/index.min.js
vendored
9
docs/assets/js/index.min.js
vendored
@ -46,6 +46,12 @@ var HEATMAP_COLORS_YELLOW = ['#ebedf0', '#fdf436', '#ffc700', '#ff9100', '#06001
|
|||||||
|
|
||||||
// Universal constants
|
// 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.
|
* Returns whether or not two given arrays are equal.
|
||||||
* @param {Array} arr1 First array
|
* @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) {
|
function clone(date) {
|
||||||
@ -294,6 +299,8 @@ var heatmapData = {
|
|||||||
end: end
|
end: end
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// ================================================================================
|
||||||
|
|
||||||
var c1 = document.querySelector("#chart-composite-1");
|
var c1 = document.querySelector("#chart-composite-1");
|
||||||
var c2 = document.querySelector("#chart-composite-2");
|
var c2 = document.querySelector("#chart-composite-2");
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -36,16 +36,22 @@
|
|||||||
"autoprefixer": "^8.2.0",
|
"autoprefixer": "^8.2.0",
|
||||||
"babel-core": "^6.26.0",
|
"babel-core": "^6.26.0",
|
||||||
"babel-plugin-external-helpers": "^6.22.0",
|
"babel-plugin-external-helpers": "^6.22.0",
|
||||||
|
"babel-plugin-istanbul": "^4.1.5",
|
||||||
"babel-preset-env": "^1.6.1",
|
"babel-preset-env": "^1.6.1",
|
||||||
"babel-preset-latest": "^6.24.1",
|
"babel-preset-latest": "^6.24.1",
|
||||||
"clean-css": "^4.1.11",
|
"clean-css": "^4.1.11",
|
||||||
|
"babel-register": "^6.26.0",
|
||||||
|
"coveralls": "^3.0.0",
|
||||||
|
"cross-env": "^5.1.4",
|
||||||
"cssnano": "^3.10.0",
|
"cssnano": "^3.10.0",
|
||||||
"eslint": "^4.18.2",
|
"eslint": "^4.18.2",
|
||||||
"fs": "0.0.1-security",
|
"fs": "0.0.1-security",
|
||||||
"livereload": "^0.6.3",
|
"livereload": "^0.6.3",
|
||||||
|
"mocha": "^5.0.5",
|
||||||
"node-sass": "^4.7.2",
|
"node-sass": "^4.7.2",
|
||||||
"npm-run-all": "^4.1.1",
|
"npm-run-all": "^4.1.1",
|
||||||
"postcss": "^6.0.21",
|
"postcss": "^6.0.21",
|
||||||
|
"nyc": "^11.6.0",
|
||||||
"postcss-cssnext": "^3.0.2",
|
"postcss-cssnext": "^3.0.2",
|
||||||
"postcss-nested": "^2.1.2",
|
"postcss-nested": "^2.1.2",
|
||||||
"precss": "^3.1.2",
|
"precss": "^3.1.2",
|
||||||
@ -59,5 +65,6 @@
|
|||||||
"rollup-plugin-uglify-es": "0.0.1",
|
"rollup-plugin-uglify-es": "0.0.1",
|
||||||
"rollup-watch": "^4.3.1"
|
"rollup-watch": "^4.3.1"
|
||||||
},
|
},
|
||||||
"dependencies": {}
|
"dependencies": {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -71,7 +71,8 @@ export default [
|
|||||||
]
|
]
|
||||||
}),
|
}),
|
||||||
babel({
|
babel({
|
||||||
exclude: 'node_modules/**'
|
exclude: 'node_modules/**',
|
||||||
|
plugins: ['external-helpers']
|
||||||
}),
|
}),
|
||||||
replace({
|
replace({
|
||||||
exclude: 'node_modules/**',
|
exclude: 'node_modules/**',
|
||||||
|
|||||||
@ -375,7 +375,7 @@ export default class AxisChart extends BaseChart {
|
|||||||
xPos: s.xAxis.positions[index],
|
xPos: s.xAxis.positions[index],
|
||||||
values: values,
|
values: values,
|
||||||
yExtreme: s.yExtremes[index],
|
yExtreme: s.yExtremes[index],
|
||||||
}
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
10
src/js/utils/test/helpers.test.js
Normal file
10
src/js/utils/test/helpers.test.js
Normal 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);
|
||||||
|
});
|
||||||
|
});
|
||||||
Loading…
x
Reference in New Issue
Block a user