jmgraph 3.2.3 → 3.2.4

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "family": "jmgraph",
3
3
  "name": "jmgraph",
4
- "version": "3.2.3",
4
+ "version": "3.2.4",
5
5
  "description": "一个简单的canvas画图库",
6
6
  "homepage": "http://graph.jm47.com/",
7
7
  "keywords": [
@@ -4,7 +4,7 @@ import {jmList} from "./jmList.js";
4
4
  import {jmGradient} from "./jmGradient.js";
5
5
  import {jmShadow} from "./jmShadow.js";
6
6
  import {jmProperty} from "./jmProperty.js";
7
- import WebglPath from "../lib/webgl/path.js";
7
+ //import WebglPath from "../lib/webgl/path.js";
8
8
 
9
9
  //样式名称,也当做白名单使用
10
10
  const jmStyleMap = {
@@ -58,13 +58,13 @@ export default class jmControl extends jmProperty {
58
58
  this.interactive = typeof params.interactive == 'undefined'? true : params.interactive;
59
59
 
60
60
  // webgl模式
61
- if(this.mode === 'webgl') {
61
+ /*if(this.mode === 'webgl') {
62
62
  this.webglControl = new WebglPath(this.graph, {
63
63
  style: this.style,
64
64
  isRegular: params.isRegular,
65
65
  needCut: params.needCut
66
66
  });
67
- }
67
+ }*/
68
68
 
69
69
  this.initializing();
70
70
 
@@ -803,7 +803,7 @@ export default class jmControl extends jmProperty {
803
803
  beginDraw() {
804
804
  this.getLocation(true);//重置位置信息
805
805
  this.context.beginPath && this.context.beginPath();
806
- if(this.webglControl && this.webglControl.beginDraw) this.webglControl.beginDraw();
806
+ //if(this.webglControl && this.webglControl.beginDraw) this.webglControl.beginDraw();
807
807
  }
808
808
 
809
809
  /**
@@ -814,23 +814,23 @@ export default class jmControl extends jmProperty {
814
814
  endDraw() {
815
815
  //如果当前为封闭路径
816
816
  if(this.style.close) {
817
- if(this.webglControl) this.webglControl.closePath();
818
- else this.context.closePath && this.context.closePath();
817
+ //if(this.webglControl) this.webglControl.closePath();
818
+ this.context.closePath && this.context.closePath();
819
819
  }
820
820
 
821
821
  if(this.style['fill']) {
822
- if(this.webglControl) {
822
+ /*if(this.webglControl) {
823
823
  const bounds = this.getBounds();
824
824
  this.webglControl.fill(bounds);
825
- }
826
- else this.context.fill && this.context.fill();
825
+ }*/
826
+ this.context.fill && this.context.fill();
827
827
  }
828
828
  if(this.style['stroke'] || (!this.style['fill'] && !this.is('jmGraph'))) {
829
- if(this.webglControl) this.webglControl.stroke();
830
- else this.context.stroke && this.context.stroke();
829
+ //if(this.webglControl) this.webglControl.stroke();
830
+ this.context.stroke && this.context.stroke();
831
831
  }
832
832
 
833
- if(this.webglControl && this.webglControl.endDraw) this.webglControl.endDraw();
833
+ //if(this.webglControl && this.webglControl.endDraw) this.webglControl.endDraw();
834
834
 
835
835
  this.needUpdate = false;
836
836
  }
@@ -845,13 +845,13 @@ export default class jmControl extends jmProperty {
845
845
  if(this.points && this.points.length > 0) {
846
846
  //获取当前控件的绝对位置
847
847
  const bounds = this.parent && this.parent.absoluteBounds?this.parent.absoluteBounds:this.absoluteBounds;
848
- if(this.webglControl) {
848
+ /*if(this.webglControl) {
849
849
  this.webglControl.setParentBounds(bounds);
850
850
  this.webglControl.draw([
851
851
  ...this.points
852
852
  ]);
853
- }
854
- else if(this.context && this.context.moveTo) {
853
+ }*/
854
+ if(this.context && this.context.moveTo) {
855
855
  this.context.moveTo(this.points[0].x + bounds.left,this.points[0].y + bounds.top);
856
856
  let len = this.points.length;
857
857
  for(let i=1; i < len;i++) {
@@ -27,7 +27,7 @@ export default class jmGraph extends jmControl {
27
27
  }
28
28
 
29
29
  option = option || {};
30
- option.mode = option.mode || '2d'; // webgl | 2d
30
+ option.mode = '2d'; // webgl | 2d 暂不支持webgl
31
31
  option.interactive = true;
32
32
  option.isRegular = true;// 规则的
33
33