beyond-rails 0.0.224 → 0.0.225

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e55ddcbe0f96833cc9e26265b631aceee22acdfc4939e0f6b60e1b4c46498886
4
- data.tar.gz: cf17d9695a7e2132a571b8caec00640c3082d951bc01893bb5df7948cc359a38
3
+ metadata.gz: 5e4265a216a874f0d0601c2ffb2166a1fd7faa9cb5453aa9e23ca0f09a3a4f7f
4
+ data.tar.gz: 8cc3c1212f19a02734fca2dc4b542d67dab8514483952a0ea2725d124c8d5e3d
5
5
  SHA512:
6
- metadata.gz: 2a1b89d81dc3785d4f1cd9c9d2612a8ab144684c1b4904e802394a50be0b5edec0f4087d9998cb466143433a481fb8703a70bfd330f88763e900acc351b0ee9c
7
- data.tar.gz: 37ccae788cc332c9a25d7dd92f2e6a4ec6dc44ee37d49b160b38abea4a0b10ff3d9bfc2bcb08673fbb0ae60d43560ce45771227e20599a579012c8a239dc5977
6
+ metadata.gz: dc7afcff18a3f923bb9eb0a30bf48df340add79ed3ac4a20d312061286fb6ba716cdc0a7e813c86143c1c7d0e00780a0589aafad58e6c8861c3f60f61cf77633
7
+ data.tar.gz: 84f4d67e13db8aa0e05662e4d70728126aac064be37f78536b21621de25a1625552942fc1b6ef4695dfc8b40b7b48c5d9ff6dbe0d9455879f05f8aca5d0dc735
@@ -83,6 +83,10 @@ export default class LineChart {
83
83
  this.bindPointMouseOver()
84
84
  }
85
85
 
86
+ get noData() {
87
+ return (this.xLabelRows.length === 0) && (this.yLabelRows.length === 0)
88
+ }
89
+
86
90
  get contentWidth() {
87
91
  return this.width - (this.xPadding * 2) - this.yLabelMargin -
88
92
  this.yLabelWidth - (this.xLabelWidth / 2)
@@ -469,8 +473,13 @@ export default class LineChart {
469
473
  this.setLabelHeights()
470
474
  this.setAxisData()
471
475
  this.updateLabelSizeForAutoStep()
476
+
477
+ if (this.noData) {
478
+ return this.raf(() => this.clear())
479
+ }
480
+
472
481
  this.setPointPos()
473
- this.draw()
482
+ this.raf(() => this.draw())
474
483
  })
475
484
  }
476
485
 
@@ -522,6 +531,10 @@ export default class LineChart {
522
531
  this.setLabelHeights()
523
532
  this.setAxisData()
524
533
  this.updateLabelSizeForAutoStep()
534
+
535
+ if (this.noData) {
536
+ return this.raf(() => this.clear())
537
+ }
525
538
  this.setPointPos()
526
539
  this.raf(() => this.draw())
527
540
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beyond-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.224
4
+ version: 0.0.225
5
5
  platform: ruby
6
6
  authors:
7
7
  - kmsheng