vislite 1.4.0-alpha.0 → 1.4.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.
Files changed (83) hide show
  1. package/CHANGELOG +307 -307
  2. package/lib/BarLayout/index.es.js +437 -437
  3. package/lib/BarLayout/index.es.min.js +2 -2
  4. package/lib/Buffer/index.es.js +35 -35
  5. package/lib/Buffer/index.es.min.js +1 -1
  6. package/lib/Canvas/index.es.js +774 -774
  7. package/lib/Canvas/index.es.min.js +1 -1
  8. package/lib/Cardinal/index.es.js +90 -90
  9. package/lib/Cardinal/index.es.min.js +1 -1
  10. package/lib/Eoap/index.es.js +33 -33
  11. package/lib/Eoap/index.es.min.js +1 -1
  12. package/lib/Hermite/index.es.js +35 -35
  13. package/lib/Hermite/index.es.min.js +1 -1
  14. package/lib/MapCoordinate/index.es.js +199 -199
  15. package/lib/MapCoordinate/index.es.min.js +1 -1
  16. package/lib/Matrix4/index.es.js +124 -124
  17. package/lib/Matrix4/index.es.min.js +1 -1
  18. package/lib/Mercator/index.es.js +19 -19
  19. package/lib/Mercator/index.es.min.js +1 -1
  20. package/lib/PieLayout/index.es.js +213 -213
  21. package/lib/PieLayout/index.es.min.js +2 -2
  22. package/lib/RawCanvas/index.es.js +704 -704
  23. package/lib/RawCanvas/index.es.min.js +1 -1
  24. package/lib/SVG/index.es.js +514 -514
  25. package/lib/SVG/index.es.min.js +1 -1
  26. package/lib/Shader/index.es.js +35 -35
  27. package/lib/Shader/index.es.min.js +1 -1
  28. package/lib/Texture/index.es.js +53 -53
  29. package/lib/Texture/index.es.min.js +1 -1
  30. package/lib/TreeLayout/index.es.js +397 -397
  31. package/lib/TreeLayout/index.es.min.js +2 -2
  32. package/lib/animation/index.es.js +110 -106
  33. package/lib/animation/index.es.min.js +3 -3
  34. package/lib/assemble/index.es.js +17 -17
  35. package/lib/assemble/index.es.min.js +1 -1
  36. package/lib/getLoopColors/index.es.js +35 -35
  37. package/lib/getLoopColors/index.es.min.js +1 -1
  38. package/lib/getWebGLContext/index.es.js +62 -62
  39. package/lib/getWebGLContext/index.es.min.js +1 -1
  40. package/lib/index.umd.js +2795 -2791
  41. package/lib/index.umd.min.js +5 -5
  42. package/lib/initOption/index.es.js +6 -6
  43. package/lib/initOption/index.es.min.js +1 -1
  44. package/lib/mergeOption/index.es.js +34 -34
  45. package/lib/mergeOption/index.es.min.js +1 -1
  46. package/lib/move/index.es.js +7 -7
  47. package/lib/move/index.es.min.js +1 -1
  48. package/lib/rotate/index.es.js +7 -7
  49. package/lib/rotate/index.es.min.js +1 -1
  50. package/lib/ruler/index.es.js +137 -137
  51. package/lib/ruler/index.es.min.js +1 -1
  52. package/lib/scale/index.es.js +6 -6
  53. package/lib/scale/index.es.min.js +1 -1
  54. package/lib/throttle/index.es.js +51 -51
  55. package/lib/throttle/index.es.min.js +2 -2
  56. package/package/BarLayout/index.ts +2 -2
  57. package/package/PieLayout/index.ts +2 -2
  58. package/package/animation/index.ts +6 -3
  59. package/package/index.ts +84 -84
  60. package/package/throttle/index.ts +2 -2
  61. package/package.json +75 -75
  62. package/src/SVG.ts +55 -55
  63. package/src/common/canvas/gradient.ts +31 -31
  64. package/src/common/svg/default.ts +29 -29
  65. package/src/common/svg/gradient.ts +53 -53
  66. package/src/common/svg/index.ts +332 -332
  67. package/src/common/tree/toPlainTree.ts +135 -135
  68. package/src/common/webgl/texture.ts +98 -98
  69. package/src/layout/BarLayout.ts +248 -248
  70. package/src/layout/PieLayout.ts +141 -141
  71. package/src/layout/TreeLayout.ts +197 -197
  72. package/types/Bar.d.ts +91 -91
  73. package/types/BarConfig.d.ts +4 -4
  74. package/types/BarLayout.d.ts +48 -48
  75. package/types/BarOption.d.ts +31 -31
  76. package/types/Pie.d.ts +73 -73
  77. package/types/PieConfig.d.ts +26 -26
  78. package/types/PieLayout.d.ts +40 -40
  79. package/types/PieOption.d.ts +21 -21
  80. package/types/SVG.d.ts +247 -247
  81. package/types/animation.d.ts +11 -5
  82. package/types/index.d.ts +195 -195
  83. package/types/throttle.d.ts +5 -5
@@ -1,10 +1,10 @@
1
1
  /*!
2
- * BarLayout of VISLite JavaScript Library v1.4.0-alpha.0
2
+ * BarLayout of VISLite JavaScript Library v1.4.0
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  */
5
5
  function t(t,i){for(var a in t)i[a]=t[a];return i}
6
6
  /*!
7
- * animation of OIPage v1.2.0
7
+ * animation of OIPage v1.3.0
8
8
  * git+https://github.com/oi-contrib/OIPage.git
9
9
  */
10
10
  var i,a=[];var n=function(){function n(i){void 0===i&&(i={}),this.name="BarLayout",this.__option={x:50,y:350,width:400,height:300,category:"xAxis",duration:200},this.__config=t(i,{})}return n.prototype.setOption=function(i){return t(i,this.__option),this},n.prototype.use=function(t){var i={coordinate:{x:this.__option.x,y:this.__option.y,width:this.__option.width,height:this.__option.height,xAxis:{type:"xAxis"===this.__option.category?"category":"value",data:[]},yAxis:{type:"xAxis"===this.__option.category?"value":"category",data:[]}},node:[]},a=void 0,n=void 0;if(t.data)for(var r=0,e=t.data;r<e.length;r++){var o=e[r];(void 0===a||o>a)&&(a=o),(void 0===n||o<n)&&(n=o)}else{if(!t.value)throw new Error("No data leads to parsing errors");for(var h=0,u=t.value;h<u.length;h++)for(var s=0,l=u[h].data;s<l.length;s++){o=l[s];(void 0===a||o>a)&&(a=o),(void 0===n||o<n)&&(n=o)}}var _,d,f=function(t,i,a,n){if(t<i){var r=i;i=t,t=r}else if(t==i)return[t];var e=function(t){for(var i=t<100&&t>-100?10:.1,a=-1,n=t;10==i?n>=-100&&n<=100:n<=-100||n>=100;)a+=1,n*=i;if(10==i)return Math.pow(10,a);for(var r="0.",e=1;e<a;e++)r+="0";return+(r+"1")}(t-i),o=Math.ceil((t-i)*e/a),h=function(a){var n=({3:2,4:5,6:5,7:5,8:10,9:10,11:10,12:10,13:15,14:15,16:15,17:15,18:20,19:20,21:20,22:20,23:25,24:25,26:25,27:25}[o+a]||o+a)/e,r=Math.floor(i/n)*n,h=[];h.push(r);for(var u=1;h[h.length-1]<t;u++)h.push(r+n*u);return h},u=h(0),s=function(){for(var t=[],a=u[u.length-1]-(null==n?void 0:n.max),r=0;r<u.length;r++)r+1<u.length&&u[r+1]-a<i||t.push(u[r]-a);return t},l=function(){for(var i=[],a=u[0]-(null==n?void 0:n.min),r=0;r<u.length&&(i[r]=u[r]-a,!(t<=i[r]));r++);return i};if(n){if("max"in n&&"min"in n&&n.max>=t&&n.min<=i){var _=function(){if(u[0]>=n.min&&u[u.length-1]<=n.max)return!0;var t=s();if(t[0]>=n.min&&t[t.length-1]<=n.max)return u=t,!0;var i=l();return i[0]>=n.min&&i[t.length-1]<=n.max?(u=i,!0):void 0};if(_())return u;for(var d=1;d<100;d++){if(u=h(d),_())return u;if(u=h(-d),_())return u}}"max"in n&&n.max>=t?n.max<u[u.length-1]&&(u=s()):"min"in n&&n.min<=i&&n.min>u[0]&&(u=l())}for(var f=0;f<u.length;f++){var v=u[f]+"";/\./.test(v)&&(/9{7,}$/.test(v)?(v=v.replace(/9{7,}$/,""),u[f]=+(v.substring(0,v.length-1)+(+v[v.length-1]+1))):/0{7,}\d$/.test(v)&&(u[f]=+v.replace(/0{7,}\d$/,"")))}return u}(a||0,n||0,5);"xAxis"===this.__option.category?(i.coordinate.xAxis.data=t.category,i.coordinate.yAxis.data=f,_=this.__option.width,d=-1*this.__option.height):(i.coordinate.xAxis.data=f,i.coordinate.yAxis.data=t.category,_=this.__option.height,d=this.__option.width);var v=[],p=_/t.category.length,c=.9*p,g=.05*p;if(t.data)for(var x=0;x<t.data.length;x++)v.push([g+p*x,c]);else{var y=c/t.value.length,m=.9*y,w=.05*y;for(x=0;x<t.value[0].data.length;x++){v[x]=[];for(var b=0;b<t.value.length;b++)v[x].push([g+p*x+y*b+w,m])}}var k=d/(f[f.length-1]-f[0]),A=function(t){return k*(t-f[0])};if("xAxis"===this.__option.category)if(t.data){var B=[];for(x=0;x<t.data.length;x++)B.push({x:this.__option.x+v[x][0],y:this.__option.y,width:v[x][1],height:A(t.data[x]),value:t.data[x]});i.node.push({bar:B})}else for(b=0;b<t.value.length;b++){for(B=[],x=0;x<t.value[b].data.length;x++)B.push({x:this.__option.x+v[x][b][0],y:this.__option.y,width:v[x][b][1],height:A(t.value[b].data[x]),value:t.value[b].data[x]});i.node.push({name:t.value[b].name,bar:B})}else if(t.data){for(B=[],x=0;x<t.data.length;x++)B.push({x:this.__option.x,y:this.__option.y-this.__option.height+v[x][0],width:A(t.data[x]),height:v[x][1],value:t.data[x]});i.node.push({bar:B})}else for(b=0;b<t.value.length;b++){for(B=[],x=0;x<t.value[b].data.length;x++)B.push({x:this.__option.x,y:this.__option.y-this.__option.height+v[x][b][0],width:A(t.value[b].data[x]),height:v[x][b][1],value:t.value[b].data[x]});i.node.push({name:t.value[b].name,bar:B})}return i},n.prototype.bind=function(t,i){return this.__rback=i,this.__oralBar=t,this.__preBar=this.use(this.__oralBar),this.__rback(this.__preBar),this},n.prototype.unbind=function(){return this.__rback=function(){return null},this.__oralBar=null,this.__preBar=null,this},n.prototype.doUpdate=function(){var t=this,n=this.use(this.__oralBar),r=JSON.parse(JSON.stringify(n));return function(t,n,r){arguments.length<2&&(n=400),arguments.length<3&&(r=function(){});var e={timer:function(t,i,n){if(!t)throw new Error("Tick is required!");var r=(new Date).valueOf()+"_"+(1e3*Math.random()).toFixed(0);return a.push({id:r,createTime:new Date,tick:t,duration:i,callback:n}),e.start(),r},start:function(){i||(i=setInterval(e.tick,13))},tick:function(){var t,i,n,r,o,h,u,s=a;for((a=[]).length=0,i=0;i<s.length;i++)t=(o=s[i]).createTime,n=o.tick,h=o.duration,r=o.callback,n(u=(u=(+(new Date).valueOf()-t.valueOf())/h)>1?1:u),u<1&&o.id?a.push(o):r(u);a.length<=0&&e.stop()},stop:function(){i&&(clearInterval(i),i=null)}},o=e.timer((function(i){t(i)}),n,r)}((function(i){t.__preBar,t.__rback(r)}),this.__option.duration,(function(){t.__preBar=n,t.__rback(t.__preBar)})),this},n}();export{n as default};
@@ -1,41 +1,41 @@
1
1
  /*!
2
- * Buffer of VISLite JavaScript Library v1.4.0-alpha.0
2
+ * Buffer of VISLite JavaScript Library v1.4.0
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  */
5
- var newBuffer = function (painter) {
6
- return painter.createBuffer();
7
- };
8
- var writeBuffer = function (painter, data, isElement, usage) {
9
- var TYPE = isElement ? painter.ELEMENT_ARRAY_BUFFER : painter.ARRAY_BUFFER;
10
- painter.bufferData(TYPE, data, usage);
11
- };
12
- var useBuffer = function (painter, location, size, type, stride, offset, normalized) {
13
- painter.vertexAttribPointer(location, size, type, normalized, stride, offset);
14
- painter.enableVertexAttribArray(location);
15
- };
16
- var BufferObject = (function () {
17
- function BufferObject(painter, isElement) {
18
- if (isElement === void 0) { isElement = false; }
19
- this.__painter = painter;
20
- this.__isElement = isElement;
21
- this.__buffer = newBuffer(painter);
22
- this.__type = isElement ? painter.ELEMENT_ARRAY_BUFFER : painter.ARRAY_BUFFER;
23
- }
24
- BufferObject.prototype.use = function () {
25
- this.__painter.bindBuffer(this.__type, this.__buffer);
26
- return this;
27
- };
28
- BufferObject.prototype.write = function (data) {
29
- writeBuffer(this.__painter, data, this.__isElement, this.__painter.STATIC_DRAW);
30
- this.__fsize = data.BYTES_PER_ELEMENT;
31
- return this;
32
- };
33
- BufferObject.prototype.divide = function (location, size, stride, offset) {
34
- if (offset === void 0) { offset = 0; }
35
- useBuffer(this.__painter, location, size, this.__painter.FLOAT, stride * this.__fsize, offset * this.__fsize, false);
36
- return this;
37
- };
38
- return BufferObject;
5
+ var newBuffer = function (painter) {
6
+ return painter.createBuffer();
7
+ };
8
+ var writeBuffer = function (painter, data, isElement, usage) {
9
+ var TYPE = isElement ? painter.ELEMENT_ARRAY_BUFFER : painter.ARRAY_BUFFER;
10
+ painter.bufferData(TYPE, data, usage);
11
+ };
12
+ var useBuffer = function (painter, location, size, type, stride, offset, normalized) {
13
+ painter.vertexAttribPointer(location, size, type, normalized, stride, offset);
14
+ painter.enableVertexAttribArray(location);
15
+ };
16
+ var BufferObject = (function () {
17
+ function BufferObject(painter, isElement) {
18
+ if (isElement === void 0) { isElement = false; }
19
+ this.__painter = painter;
20
+ this.__isElement = isElement;
21
+ this.__buffer = newBuffer(painter);
22
+ this.__type = isElement ? painter.ELEMENT_ARRAY_BUFFER : painter.ARRAY_BUFFER;
23
+ }
24
+ BufferObject.prototype.use = function () {
25
+ this.__painter.bindBuffer(this.__type, this.__buffer);
26
+ return this;
27
+ };
28
+ BufferObject.prototype.write = function (data) {
29
+ writeBuffer(this.__painter, data, this.__isElement, this.__painter.STATIC_DRAW);
30
+ this.__fsize = data.BYTES_PER_ELEMENT;
31
+ return this;
32
+ };
33
+ BufferObject.prototype.divide = function (location, size, stride, offset) {
34
+ if (offset === void 0) { offset = 0; }
35
+ useBuffer(this.__painter, location, size, this.__painter.FLOAT, stride * this.__fsize, offset * this.__fsize, false);
36
+ return this;
37
+ };
38
+ return BufferObject;
39
39
  }());
40
40
 
41
41
  export { BufferObject as default };
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Buffer of VISLite JavaScript Library v1.4.0-alpha.0
2
+ * Buffer of VISLite JavaScript Library v1.4.0
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  */
5
5
  var t=function(){function t(t,i){void 0===i&&(i=!1),this.__painter=t,this.__isElement=i,this.__buffer=function(t){return t.createBuffer()}(t),this.__type=i?t.ELEMENT_ARRAY_BUFFER:t.ARRAY_BUFFER}return t.prototype.use=function(){return this.__painter.bindBuffer(this.__type,this.__buffer),this},t.prototype.write=function(t){return function(t,i,e,_){var r=e?t.ELEMENT_ARRAY_BUFFER:t.ARRAY_BUFFER;t.bufferData(r,i,_)}(this.__painter,t,this.__isElement,this.__painter.STATIC_DRAW),this.__fsize=t.BYTES_PER_ELEMENT,this},t.prototype.divide=function(t,i,e,_){return void 0===_&&(_=0),function(t,i,e,_,r,n,s){t.vertexAttribPointer(i,e,_,s,r,n),t.enableVertexAttribArray(i)}(this.__painter,t,i,this.__painter.FLOAT,e*this.__fsize,_*this.__fsize,!1),this},t}();export{t as default};