Browse Source

chore: bump to 1.5.3 and update build

tags/1.5.3
Shivam Mishra 4 years ago
parent
commit
92a3df9690
9 changed files with 22 additions and 10 deletions
  1. +14
    -2
      dist/frappe-charts.esm.js
  2. +1
    -1
      dist/frappe-charts.min.cjs.js
  3. +1
    -1
      dist/frappe-charts.min.cjs.js.map
  4. +1
    -1
      dist/frappe-charts.min.esm.js
  5. +1
    -1
      dist/frappe-charts.min.esm.js.map
  6. +1
    -1
      dist/frappe-charts.min.iife.js
  7. +1
    -1
      dist/frappe-charts.min.iife.js.map
  8. +1
    -1
      package.json
  9. +1
    -1
      src/js/index.js

+ 14
- 2
dist/frappe-charts.esm.js View File

@@ -377,6 +377,16 @@ function isValidNumber(candidate, nonNegative=false) {
else return true; else return true;
} }


/**
* Round a number to the closes precision, max max precision 4
* @param {Number} d Any Number
*/
function round(d) {
// https://floating-point-gui.de/
// https://www.jacklmoore.com/notes/rounding-in-javascript/
return Number(Math.round(d + 'e4') + 'e-4');
}

function getBarHeightAndYAttr(yTop, zeroLine) { function getBarHeightAndYAttr(yTop, zeroLine) {
let height, y; let height, y;
if (yTop <= zeroLine) { if (yTop <= zeroLine) {
@@ -1811,6 +1821,7 @@ class AggregationChart extends BaseChart {
configure(args) { configure(args) {
super.configure(args); super.configure(args);


this.config.formatTooltipY = args.tooltipOptions.formatTooltipY;
this.config.maxSlices = args.maxSlices || 20; this.config.maxSlices = args.maxSlices || 20;
this.config.maxLegendPoints = args.maxLegendPoints || 20; this.config.maxLegendPoints = args.maxLegendPoints || 20;
} }
@@ -1844,7 +1855,7 @@ class AggregationChart extends BaseChart {


s.labels = []; s.labels = [];
totals.map(d => { totals.map(d => {
s.sliceTotals.push(d[0]);
s.sliceTotals.push(round(d[0]));
s.labels.push(d[1]); s.labels.push(d[1]);
}); });


@@ -1877,12 +1888,13 @@ class AggregationChart extends BaseChart {
} }
let x = barWidth * count + 5; let x = barWidth * count + 5;
let label = this.config.truncateLegends ? truncateString(s.labels[i], barWidth/10) : s.labels[i]; let label = this.config.truncateLegends ? truncateString(s.labels[i], barWidth/10) : s.labels[i];
let formatted = this.config.formatTooltipY ? this.config.formatTooltipY(d) : d;
let dot = legendDot( let dot = legendDot(
x, x,
y, y,
5, 5,
this.colors[i], this.colors[i],
`${label}: ${d}`,
`${label}: ${formatted}`,
false false
); );
this.legendArea.appendChild(dot); this.legendArea.appendChild(dot);


+ 1
- 1
dist/frappe-charts.min.cjs.js
File diff suppressed because it is too large
View File


+ 1
- 1
dist/frappe-charts.min.cjs.js.map
File diff suppressed because it is too large
View File


+ 1
- 1
dist/frappe-charts.min.esm.js
File diff suppressed because it is too large
View File


+ 1
- 1
dist/frappe-charts.min.esm.js.map
File diff suppressed because it is too large
View File


+ 1
- 1
dist/frappe-charts.min.iife.js
File diff suppressed because it is too large
View File


+ 1
- 1
dist/frappe-charts.min.iife.js.map
File diff suppressed because it is too large
View File


+ 1
- 1
package.json View File

@@ -1,6 +1,6 @@
{ {
"name": "frappe-charts", "name": "frappe-charts",
"version": "1.5.2",
"version": "1.5.3",
"description": "https://frappe.github.io/charts", "description": "https://frappe.github.io/charts",
"main": "dist/frappe-charts.min.cjs.js", "main": "dist/frappe-charts.min.cjs.js",
"module": "dist/frappe-charts.min.esm.js", "module": "dist/frappe-charts.min.esm.js",


+ 1
- 1
src/js/index.js View File

@@ -3,7 +3,7 @@ import * as Charts from './chart';
let frappe = { }; let frappe = { };


frappe.NAME = 'Frappe Charts'; frappe.NAME = 'Frappe Charts';
frappe.VERSION = '1.5.2';
frappe.VERSION = '1.5.3';


frappe = Object.assign({ }, frappe, Charts); frappe = Object.assign({ }, frappe, Charts);



Loading…
Cancel
Save