Bladeren bron

[fix] width and dataByIndex update problem

tags/1.2.0
Prateeksha Singh 7 jaren geleden
bovenliggende
commit
1ba567dc24
12 gewijzigde bestanden met toevoegingen van 36 en 18 verwijderingen
  1. +13
    -5
      dist/frappe-charts.esm.js
  2. +1
    -1
      dist/frappe-charts.min.cjs.js
  3. +1
    -1
      dist/frappe-charts.min.esm.js
  4. +1
    -1
      dist/frappe-charts.min.iife.js
  5. +1
    -1
      dist/frappe-charts.min.iife.js.map
  6. +1
    -1
      docs/assets/js/frappe-charts.min.js
  7. +1
    -1
      docs/assets/js/frappe-charts.min.js.map
  8. +8
    -1
      docs/assets/js/index.min.js
  9. +1
    -1
      docs/assets/js/index.min.js.map
  10. +3
    -2
      src/js/charts/AxisChart.js
  11. +2
    -1
      src/js/charts/BaseChart.js
  12. +3
    -2
      src/js/charts/Heatmap.js

+ 13
- 5
dist/frappe-charts.esm.js Bestand weergeven

@@ -298,6 +298,10 @@ class SvgTip {
}
}

/**
* Returns the value of a number upto 2 decimal places.
* @param {Number} d Any number
*/
function floatTwo(d) {
return parseFloat(d.toFixed(2));
}
@@ -1458,8 +1462,9 @@ class BaseChart {
bindTooltip() {}

draw(onlyWidthChange=false, init=false) {
this.calc(onlyWidthChange);
this.updateWidth();

this.calc(onlyWidthChange);
this.makeChartArea();
this.setupComponents();

@@ -2718,12 +2723,13 @@ class Heatmap extends BaseChart {
let d = this.data;
let spacing = this.discreteDomains ? NO_OF_YEAR_MONTHS : 0;
this.independentWidth = (getWeeksBetween(d.start, d.end)
+ spacing) * COL_WIDTH + m.margins.right + m.margins.left;
+ spacing) * COL_WIDTH + getExtraWidth(m);
}

updateWidth() {
let spacing = this.discreteDomains ? NO_OF_YEAR_MONTHS : 0;
this.baseWidth = (this.state.noOfWeeks + spacing) * COL_WIDTH
let noOfWeeks = this.state.noOfWeeks ? this.state.noOfWeeks : 52;
this.baseWidth = (noOfWeeks + spacing) * COL_WIDTH
+ getExtraWidth(this.measures);
}

@@ -3139,8 +3145,9 @@ class AxisChart extends BaseChart {

calc(onlyWidthChange = false) {
this.calcXPositions();
if(onlyWidthChange) return;
this.calcYAxisParameters(this.getAllYValues(), this.type === 'line');
if(!onlyWidthChange) {
this.calcYAxisParameters(this.getAllYValues(), this.type === 'line');
}
this.makeDataByIndex();
}

@@ -3666,6 +3673,7 @@ class AxisChart extends BaseChart {
// removeDataPoint(index = 0) {}
}

// import MultiAxisChart from './charts/MultiAxisChart';
const chartTypes = {
bar: AxisChart,
line: AxisChart,


+ 1
- 1
dist/frappe-charts.min.cjs.js
Diff onderdrukt omdat het te groot bestand
Bestand weergeven


+ 1
- 1
dist/frappe-charts.min.esm.js
Diff onderdrukt omdat het te groot bestand
Bestand weergeven


+ 1
- 1
dist/frappe-charts.min.iife.js
Diff onderdrukt omdat het te groot bestand
Bestand weergeven


+ 1
- 1
dist/frappe-charts.min.iife.js.map
Diff onderdrukt omdat het te groot bestand
Bestand weergeven


+ 1
- 1
docs/assets/js/frappe-charts.min.js
Diff onderdrukt omdat het te groot bestand
Bestand weergeven


+ 1
- 1
docs/assets/js/frappe-charts.min.js.map
Diff onderdrukt omdat het te groot bestand
Bestand weergeven


+ 8
- 1
docs/assets/js/index.min.js Bestand weergeven

@@ -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) {
@@ -155,6 +160,8 @@ function addDays(date, numberOfDays) {
date.setDate(date.getDate() + numberOfDays);
}

// Composite Chart
// ================================================================================
var reportCountList = [152, 222, 199, 287, 534, 709, 1179, 1256, 1632, 1856, 1850];

var lineCompositeData = {


+ 1
- 1
docs/assets/js/index.min.js.map
Diff onderdrukt omdat het te groot bestand
Bestand weergeven


+ 3
- 2
src/js/charts/AxisChart.js Bestand weergeven

@@ -55,8 +55,9 @@ export default class AxisChart extends BaseChart {

calc(onlyWidthChange = false) {
this.calcXPositions();
if(onlyWidthChange) return;
this.calcYAxisParameters(this.getAllYValues(), this.type === 'line');
if(!onlyWidthChange) {
this.calcYAxisParameters(this.getAllYValues(), this.type === 'line');
}
this.makeDataByIndex();
}



+ 2
- 1
src/js/charts/BaseChart.js Bestand weergeven

@@ -127,8 +127,9 @@ export default class BaseChart {
bindTooltip() {}

draw(onlyWidthChange=false, init=false) {
this.calc(onlyWidthChange);
this.updateWidth();

this.calc(onlyWidthChange);
this.makeChartArea();
this.setupComponents();



+ 3
- 2
src/js/charts/Heatmap.js Bestand weergeven

@@ -39,12 +39,13 @@ export default class Heatmap extends BaseChart {
let d = this.data;
let spacing = this.discreteDomains ? NO_OF_YEAR_MONTHS : 0;
this.independentWidth = (getWeeksBetween(d.start, d.end)
+ spacing) * COL_WIDTH + m.margins.right + m.margins.left;
+ spacing) * COL_WIDTH + getExtraWidth(m);
}

updateWidth() {
let spacing = this.discreteDomains ? NO_OF_YEAR_MONTHS : 0;
this.baseWidth = (this.state.noOfWeeks + spacing) * COL_WIDTH
let noOfWeeks = this.state.noOfWeeks ? this.state.noOfWeeks : 52;
this.baseWidth = (noOfWeeks + spacing) * COL_WIDTH
+ getExtraWidth(this.measures);
}



Laden…
Annuleren
Opslaan