Browse Source

Core 0.3.0

merge-requests/11/head
vargburz 3 years ago
parent
commit
884cbd9217
  1. 4
      dist/index.js
  2. 2
      examples/demo.html
  3. 8
      package-lock.json
  4. 2
      package.json
  5. 3
      src/index.ts

4
dist/index.js vendored

File diff suppressed because one or more lines are too long

2
examples/demo.html

@ -15,7 +15,7 @@
const data1 = Array.from({ length: arrayLength }, (el, idx) => [startTime + idx * 10000, Math.floor(Math.random() * 40)]); const data1 = Array.from({ length: arrayLength }, (el, idx) => [startTime + idx * 10000, Math.floor(Math.random() * 40)]);
const data2 = Array.from({ length: arrayLength }, (el, idx) => [startTime + idx * 10000, Math.floor(Math.random() * 100)]); const data2 = Array.from({ length: arrayLength }, (el, idx) => [startTime + idx * 10000, Math.floor(Math.random() * 100)]);
const data3 = Array.from({ length: arrayLength }, (el, idx) => [startTime + idx * 10000, Math.floor(Math.random() * 20) + 90]); const data3 = Array.from({ length: arrayLength }, (el, idx) => [startTime + idx * 10000, Math.floor(Math.random() * 20) + 90]);
const zoomIn = (ranges) => { const range = ranges[0]; options.axis.x.range = range; pod.updateData(undefined, options) } const zoomIn = (ranges) => { pod.render(); }
const zoomOut = (ranges) => { console.log('zoomout'); options.axis.x.range = undefined; pod.updateData(undefined, options) } const zoomOut = (ranges) => { console.log('zoomout'); options.axis.x.range = undefined; pod.updateData(undefined, options) }
let options = { let options = {
renderLegend: false, usePanning: false, axis: { y: { invert: false, range: [0, 350] }, x: { format: 'time' } }, renderLegend: false, usePanning: false, axis: { y: { invert: false, range: [0, 350] }, x: { format: 'time' } },

8
package-lock.json generated

@ -1,13 +1,13 @@
{ {
"name": "@chartwerk/line-pod", "name": "@chartwerk/line-pod",
"version": "0.2.4", "version": "0.4.1",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
"@chartwerk/core": { "@chartwerk/core": {
"version": "0.1.1", "version": "0.3.0",
"resolved": "https://registry.npmjs.org/@chartwerk/core/-/core-0.1.1.tgz", "resolved": "https://registry.npmjs.org/@chartwerk/core/-/core-0.3.0.tgz",
"integrity": "sha512-AgERJVR6agOXULOQsc7sQHM7INP8iaF+kGj2c08DYTZ6SmIUGJFWpcSVTTccZZ3Szf/ypiI60tC1bgTKaIchTg==" "integrity": "sha512-Dnw/akMqBvWEQDlzcendAzHsqzLE+jcWVU7fYnsXLFKCZT+JJL2cMpBv/aZ24/pw7WZQg2ORdLgAfLc3Ph9kuA=="
}, },
"@types/d3": { "@types/d3": {
"version": "5.16.4", "version": "5.16.4",

2
package.json

@ -15,7 +15,7 @@
"author": "CorpGlory", "author": "CorpGlory",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"@chartwerk/core": "^0.2.0" "@chartwerk/core": "^0.3.0"
}, },
"devDependencies": { "devDependencies": {
"@types/d3": "5.16.4", "@types/d3": "5.16.4",

3
src/index.ts

@ -18,6 +18,8 @@ export class LinePod extends ChartwerkPod<LineTimeSerie, LineOptions> {
} }
renderMetrics(): void { renderMetrics(): void {
this.d3.select('.metrics-container').remove();
this.updateCrosshair(); this.updateCrosshair();
this.initLineGenerator(); this.initLineGenerator();
@ -72,7 +74,6 @@ export class LinePod extends ChartwerkPod<LineTimeSerie, LineOptions> {
} }
public appendData(data: [number, number][]): void { public appendData(data: [number, number][]): void {
this.clearScaleCache();
for(let idx = 0; idx < this.series.length; ++idx) { for(let idx = 0; idx < this.series.length; ++idx) {
if(this.series[idx].visible === false) { if(this.series[idx].visible === false) {

Loading…
Cancel
Save