jmchart 1.1.99 → 1.2.0

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.
@@ -3758,7 +3758,7 @@ define(['exports'], function (exports) { 'use strict';
3758
3758
  try {
3759
3759
 
3760
3760
  let img = this.getImage();
3761
- if(this.graph.isWXMiniApp && this.graph.canvas) {
3761
+ if(this.graph.isWXMiniApp && this.graph.canvas && typeof img === 'string') {
3762
3762
  // 图片对象
3763
3763
  const image = this.graph.canvas.createImage();
3764
3764
  // 图片加载完成回调
@@ -3780,6 +3780,10 @@ define(['exports'], function (exports) { 'use strict';
3780
3780
 
3781
3781
  // 绘制
3782
3782
  drawImg(img) {
3783
+ if(!img) {
3784
+ console.warn('image is empty');
3785
+ return;
3786
+ }
3783
3787
  let bounds = this.parent && this.parent.absoluteBounds?this.parent.absoluteBounds:this.absoluteBounds;
3784
3788
  if(!bounds) bounds = this.parent && this.parent.getAbsoluteBounds?this.parent.getAbsoluteBounds():this.getAbsoluteBounds();
3785
3789
  let p = this.getLocation();
@@ -3760,7 +3760,7 @@ class jmImage extends jmControl {
3760
3760
  try {
3761
3761
 
3762
3762
  let img = this.getImage();
3763
- if(this.graph.isWXMiniApp && this.graph.canvas) {
3763
+ if(this.graph.isWXMiniApp && this.graph.canvas && typeof img === 'string') {
3764
3764
  // 图片对象
3765
3765
  const image = this.graph.canvas.createImage();
3766
3766
  // 图片加载完成回调
@@ -3782,6 +3782,10 @@ class jmImage extends jmControl {
3782
3782
 
3783
3783
  // 绘制
3784
3784
  drawImg(img) {
3785
+ if(!img) {
3786
+ console.warn('image is empty');
3787
+ return;
3788
+ }
3785
3789
  let bounds = this.parent && this.parent.absoluteBounds?this.parent.absoluteBounds:this.absoluteBounds;
3786
3790
  if(!bounds) bounds = this.parent && this.parent.getAbsoluteBounds?this.parent.getAbsoluteBounds():this.getAbsoluteBounds();
3787
3791
  let p = this.getLocation();
@@ -3756,7 +3756,7 @@ class jmImage extends jmControl {
3756
3756
  try {
3757
3757
 
3758
3758
  let img = this.getImage();
3759
- if(this.graph.isWXMiniApp && this.graph.canvas) {
3759
+ if(this.graph.isWXMiniApp && this.graph.canvas && typeof img === 'string') {
3760
3760
  // 图片对象
3761
3761
  const image = this.graph.canvas.createImage();
3762
3762
  // 图片加载完成回调
@@ -3778,6 +3778,10 @@ class jmImage extends jmControl {
3778
3778
 
3779
3779
  // 绘制
3780
3780
  drawImg(img) {
3781
+ if(!img) {
3782
+ console.warn('image is empty');
3783
+ return;
3784
+ }
3781
3785
  let bounds = this.parent && this.parent.absoluteBounds?this.parent.absoluteBounds:this.absoluteBounds;
3782
3786
  if(!bounds) bounds = this.parent && this.parent.getAbsoluteBounds?this.parent.getAbsoluteBounds():this.getAbsoluteBounds();
3783
3787
  let p = this.getLocation();
@@ -3759,7 +3759,7 @@
3759
3759
  try {
3760
3760
 
3761
3761
  let img = this.getImage();
3762
- if(this.graph.isWXMiniApp && this.graph.canvas) {
3762
+ if(this.graph.isWXMiniApp && this.graph.canvas && typeof img === 'string') {
3763
3763
  // 图片对象
3764
3764
  const image = this.graph.canvas.createImage();
3765
3765
  // 图片加载完成回调
@@ -3781,6 +3781,10 @@
3781
3781
 
3782
3782
  // 绘制
3783
3783
  drawImg(img) {
3784
+ if(!img) {
3785
+ console.warn('image is empty');
3786
+ return;
3787
+ }
3784
3788
  let bounds = this.parent && this.parent.absoluteBounds?this.parent.absoluteBounds:this.absoluteBounds;
3785
3789
  if(!bounds) bounds = this.parent && this.parent.getAbsoluteBounds?this.parent.getAbsoluteBounds():this.getAbsoluteBounds();
3786
3790
  let p = this.getLocation();
@@ -3761,7 +3761,7 @@ System.register([], function (exports) {
3761
3761
  try {
3762
3762
 
3763
3763
  let img = this.getImage();
3764
- if(this.graph.isWXMiniApp && this.graph.canvas) {
3764
+ if(this.graph.isWXMiniApp && this.graph.canvas && typeof img === 'string') {
3765
3765
  // 图片对象
3766
3766
  const image = this.graph.canvas.createImage();
3767
3767
  // 图片加载完成回调
@@ -3783,6 +3783,10 @@ System.register([], function (exports) {
3783
3783
 
3784
3784
  // 绘制
3785
3785
  drawImg(img) {
3786
+ if(!img) {
3787
+ console.warn('image is empty');
3788
+ return;
3789
+ }
3786
3790
  let bounds = this.parent && this.parent.absoluteBounds?this.parent.absoluteBounds:this.absoluteBounds;
3787
3791
  if(!bounds) bounds = this.parent && this.parent.getAbsoluteBounds?this.parent.getAbsoluteBounds():this.getAbsoluteBounds();
3788
3792
  let p = this.getLocation();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jmchart",
3
- "version": "1.1.99",
3
+ "version": "1.2.0",
4
4
  "description": "chart",
5
5
  "main": "./index.js",
6
6
  "directories": {
@@ -28,7 +28,7 @@
28
28
  },
29
29
  "homepage": "https://github.com/jiamao/jmchart#readme",
30
30
  "dependencies": {
31
- "jmgraph": "^3.1.94"
31
+ "jmgraph": "^3.1.95"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@babel/core": "^7.10.2",