浏览代码

[fix] update API

tags/1.2.0
Prateeksha Singh 7 年前
父节点
当前提交
092fc240dc
共有 11 个文件被更改,包括 28 次插入16 次删除
  1. +9
    -6
      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. +3
    -1
      docs/assets/js/index.js
  9. +1
    -2
      docs/index.html
  10. +1
    -1
      src/js/charts/AxisChart.js
  11. +8
    -0
      src/js/charts/BaseChart.js

+ 9
- 6
dist/frappe-charts.esm.js 查看文件

@@ -230,10 +230,6 @@ const DEFAULT_CHAR_WIDTH = 7;
const ANGLE_RATIO = Math.PI / 180; const ANGLE_RATIO = Math.PI / 180;
const FULL_ANGLE = 360; const FULL_ANGLE = 360;


/**
* Returns the value of a number upto 2 decimal places.
* @param {Number} d Any number
*/
function floatTwo(d) { function floatTwo(d) {
return parseFloat(d.toFixed(2)); return parseFloat(d.toFixed(2));
} }
@@ -1410,6 +1406,14 @@ class BaseChart {
onDownArrow() {} onDownArrow() {}
onEnterKey() {} onEnterKey() {}


addDataPoint() {}
removeDataPoint() {}

getDataPoint() {}
setCurrentDataPoint() {}

updateDataset() {}

getDifferentChart(type) { getDifferentChart(type) {
return getDifferentChart(type, this.type, this.parent, this.rawChartArgs); return getDifferentChart(type, this.type, this.parent, this.rawChartArgs);
} }
@@ -3132,10 +3136,10 @@ class AxisChart extends BaseChart {
// Render overlays // Render overlays
this.overlayGuides.map(d => { this.overlayGuides.map(d => {
let currentUnit = d.units[this.state.currentIndex]; let currentUnit = d.units[this.state.currentIndex];

d.overlay = makeOverlay[d.type](currentUnit); d.overlay = makeOverlay[d.type](currentUnit);
this.drawArea.appendChild(d.overlay); this.drawArea.appendChild(d.overlay);
}); });

} }


updateOverlayGuides() { updateOverlayGuides() {
@@ -3248,7 +3252,6 @@ class AxisChart extends BaseChart {
// removeDataPoint(index = 0) {} // removeDataPoint(index = 0) {}
} }


// import MultiAxisChart from './charts/MultiAxisChart';
const chartTypes = { const chartTypes = {
// multiaxis: MultiAxisChart, // multiaxis: MultiAxisChart,
percentage: PercentageChart, percentage: PercentageChart,


+ 1
- 1
dist/frappe-charts.min.cjs.js
文件差异内容过多而无法显示
查看文件


+ 1
- 1
dist/frappe-charts.min.esm.js
文件差异内容过多而无法显示
查看文件


+ 1
- 1
dist/frappe-charts.min.iife.js
文件差异内容过多而无法显示
查看文件


+ 1
- 1
dist/frappe-charts.min.iife.js.map
文件差异内容过多而无法显示
查看文件


+ 1
- 1
docs/assets/js/frappe-charts.min.js
文件差异内容过多而无法显示
查看文件


+ 1
- 1
docs/assets/js/frappe-charts.min.js.map
文件差异内容过多而无法显示
查看文件


+ 3
- 1
docs/assets/js/index.js 查看文件

@@ -447,7 +447,7 @@ for (var i = 0; i< 375; i++) {
timestamp = Math.floor(timestamp - 86400).toFixed(1); timestamp = Math.floor(timestamp - 86400).toFixed(1);
} }


new Chart("#chart-heatmap", {
let heatmap = new Chart("#chart-heatmap", {
data: heatmapData, data: heatmapData,
type: 'heatmap', type: 'heatmap',
legendScale: [0, 1, 2, 4, 5], legendScale: [0, 1, 2, 4, 5],
@@ -456,6 +456,8 @@ new Chart("#chart-heatmap", {
legendColors: ['#ebedf0', '#fdf436', '#ffc700', '#ff9100', '#06001c'] legendColors: ['#ebedf0', '#fdf436', '#ffc700', '#ff9100', '#06001c']
}); });


// console.log(heatmapData, heatmap);

Array.prototype.slice.call( Array.prototype.slice.call(
document.querySelectorAll('.heatmap-mode-buttons button') document.querySelectorAll('.heatmap-mode-buttons button')
).map(el => { ).map(el => {


+ 1
- 2
docs/index.html 查看文件

@@ -191,8 +191,7 @@
<button type="button" class="btn btn-sm btn-secondary" data-color="default">Default green</button> <button type="button" class="btn btn-sm btn-secondary" data-color="default">Default green</button>
<button type="button" class="btn btn-sm btn-secondary active" data-color="halloween">GitHub's Halloween</button> <button type="button" class="btn btn-sm btn-secondary active" data-color="halloween">GitHub's Halloween</button>
</div> </div>
<pre><code class="hljs javascript margin-vertical-px"> let heatmap = new Chart({
parent: "#heatmap",
<pre><code class="hljs javascript margin-vertical-px"> let heatmap = new Chart("#heatmap", {
type: 'heatmap', type: 'heatmap',
height: 115, height: 115,
data: heatmapData, // object with date/timestamp-value pairs data: heatmapData, // object with date/timestamp-value pairs


+ 1
- 1
src/js/charts/AxisChart.js 查看文件

@@ -439,10 +439,10 @@ export default class AxisChart extends BaseChart {
// Render overlays // Render overlays
this.overlayGuides.map(d => { this.overlayGuides.map(d => {
let currentUnit = d.units[this.state.currentIndex]; let currentUnit = d.units[this.state.currentIndex];

d.overlay = makeOverlay[d.type](currentUnit); d.overlay = makeOverlay[d.type](currentUnit);
this.drawArea.appendChild(d.overlay); this.drawArea.appendChild(d.overlay);
}); });

} }


updateOverlayGuides() { updateOverlayGuides() {


+ 8
- 0
src/js/charts/BaseChart.js 查看文件

@@ -268,6 +268,14 @@ export default class BaseChart {
onDownArrow() {} onDownArrow() {}
onEnterKey() {} onEnterKey() {}


addDataPoint() {}
removeDataPoint() {}

getDataPoint() {}
setCurrentDataPoint() {}

updateDataset() {}

getDifferentChart(type) { getDifferentChart(type) {
return getDifferentChart(type, this.type, this.parent, this.rawChartArgs); return getDifferentChart(type, this.type, this.parent, this.rawChartArgs);
} }


正在加载...
取消
保存