jmgraph 3.1.92 → 3.1.94

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.
package/dist/jmgraph.js CHANGED
@@ -1978,11 +1978,11 @@ var jmEvents = /*#__PURE__*/function () {
1978
1978
  }
1979
1979
  }
1980
1980
  }, {
1981
- key: "destory",
1981
+ key: "destroy",
1982
1982
  value: // 销毁
1983
- function destory() {
1984
- this.mouseHandler.destory();
1985
- this.keyHandler.destory();
1983
+ function destroy() {
1984
+ this.mouseHandler.destroy();
1985
+ this.keyHandler.destroy();
1986
1986
  }
1987
1987
  }]);
1988
1988
 
@@ -2108,8 +2108,8 @@ var jmMouseEvent = /*#__PURE__*/function () {
2108
2108
  } // 销毁所有事件
2109
2109
 
2110
2110
  }, {
2111
- key: "destory",
2112
- value: function destory() {
2111
+ key: "destroy",
2112
+ value: function destroy() {
2113
2113
  for (var name in this.eventEvents) {
2114
2114
  var event = this.eventEvents[name];
2115
2115
  if (!event || !event.fun) continue;
@@ -2189,8 +2189,8 @@ var jmKeyEvent = /*#__PURE__*/function () {
2189
2189
  } // 销毁所有事件
2190
2190
 
2191
2191
  }, {
2192
- key: "destory",
2193
- value: function destory() {
2192
+ key: "destroy",
2193
+ value: function destroy() {
2194
2194
  for (var name in this.eventEvents) {
2195
2195
  var event = this.eventEvents[name];
2196
2196
  if (!event || !event.fun) continue;
@@ -2614,7 +2614,7 @@ var jmGraph = /*#__PURE__*/function (_jmControl) {
2614
2614
  }
2615
2615
 
2616
2616
  _this.canvas = canvas;
2617
- if (!_this.context) _this.context = canvas.getContext('2d');
2617
+ _this.context = canvas.getContext('2d');
2618
2618
 
2619
2619
  _this.__init(callback);
2620
2620
 
@@ -2672,9 +2672,7 @@ var jmGraph = /*#__PURE__*/function (_jmControl) {
2672
2672
 
2673
2673
  if (this.isWXMiniApp) {
2674
2674
  scale = wx.getSystemInfoSync().pixelRatio || 1;
2675
- }
2676
-
2677
- if (scale > 1) {
2675
+ } else if (scale > 1) {
2678
2676
  this.__normalSize = this.__normalSize || {
2679
2677
  width: 0,
2680
2678
  height: 0
@@ -2682,18 +2680,11 @@ var jmGraph = /*#__PURE__*/function (_jmControl) {
2682
2680
  w = w || this.__normalSize.width || this.width, h = h || this.__normalSize.height || this.height;
2683
2681
  if (w) this.__normalSize.width = w;
2684
2682
  if (h) this.__normalSize.height = h;
2685
-
2686
- if (this.canvas.style) {
2687
- this.canvas.style.width = w + "px";
2688
- this.canvas.style.height = h + "px";
2689
- this.canvas.height = h * scale;
2690
- this.canvas.width = w * scale;
2691
- this.context.scale(scale, scale);
2692
- } else {
2693
- this.canvas.height = h;
2694
- this.canvas.width = w;
2695
- }
2696
-
2683
+ this.canvas.style && (this.canvas.style.width = w + "px");
2684
+ this.canvas.style && (this.canvas.style.height = h + "px");
2685
+ this.canvas.height = h * scale;
2686
+ this.canvas.width = w * scale;
2687
+ this.context.scale(scale, scale);
2697
2688
  this.devicePixelRatio = scale;
2698
2689
  }
2699
2690
  }
@@ -3117,7 +3108,7 @@ var jmGraph = /*#__PURE__*/function (_jmControl) {
3117
3108
  this.___isAutoRefreshing = true;
3118
3109
 
3119
3110
  function update() {
3120
- if (self.destoryed) {
3111
+ if (self.destroyed) {
3121
3112
  self.___isAutoRefreshing = false;
3122
3113
  return; // 已销毁
3123
3114
  }
@@ -3134,10 +3125,10 @@ var jmGraph = /*#__PURE__*/function (_jmControl) {
3134
3125
  } // 销毁当前对象
3135
3126
 
3136
3127
  }, {
3137
- key: "destory",
3138
- value: function destory() {
3139
- this.eventHandler.destory();
3140
- this.destoryed = true; // 标记已销毁
3128
+ key: "destroy",
3129
+ value: function destroy() {
3130
+ this.eventHandler.destroy();
3131
+ this.destroyed = true; // 标记已销毁
3141
3132
  }
3142
3133
  }], [{
3143
3134
  key: "create",