zincjs 1.16.0 → 1.16.1

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/build/zinc.js CHANGED
@@ -32,7 +32,7 @@ module.exports = require("url-polyfill");
32
32
  /***/ ((module) => {
33
33
 
34
34
  "use strict";
35
- module.exports = /*#__PURE__*/JSON.parse('{"name":"zincjs","version":"1.16.0","description":"ZincJS (Web-based-Zinc-Visualisation)","main":"build/zinc.js","directories":{"doc":"docs"},"files":["package.json","LICENSE","README.md","src/*","build/zinc.js","build/zinc.frontend.js","build/zinc.js.map","webpack.config.js"],"scripts":{"build-bundle":"webpack --config webpack.frontend.js; webpack --config webpack.backend.js","build-backend":"webpack --config webpack.backend.js","test":"npm --prefix ./test install && npm --prefix ./test run test-ci","changelog":"auto-changelog -p --output CHANGELOG.md --template keepachangelog","jsdoc":"jsdoc -c jsdoc_conf.json","version":"npm run build-bundle;npm run jsdoc;npm run changelog; git add CHANGELOG.md docs","release:beta":"npm version prerelease --preid=beta; npm publish --tag beta","release:minor":"npm version minor; npm publish","release:patch":"npm version patch; npm publish"},"repository":{"type":"git","url":"git+https://github.com/alan-wu/ZincJS.git"},"keywords":["library","webgl","3d","zincjs"],"author":"Alan Wu <alan.wu@auckland.ac.nz>","license":"MIT","bugs":{"url":"https://github.com/alan-wu/ZincJS/issues"},"homepage":"http://alan-wu.github.io/ZincJS/","devDependencies":{"@babel/core":"^7.23.9","@babel/preset-env":"^7.23.9","auto-changelog":"^2.4.0","babel-loader":"^9.1.3","babel-preset-minify":"^0.5.1","file-loader":"^6.2.0","jsdoc":"^4.0.2","raw-loader":"^4.0.2","webpack":"^5.90.3","webpack-cli":"^5.1.4","webpack-node-externals":"^3.0.0"},"dependencies":{"css-element-queries":"^1.2.2","lodash":"^4.17.19","promise-polyfill":"^8.1.3","three":"^0.130.1","three-spritetext":"1.6.2","url-loader":"^4.1.1","url-polyfill":"^1.1.7","webworkify-webpack":"^2.1.5"}}');
35
+ module.exports = /*#__PURE__*/JSON.parse('{"name":"zincjs","version":"1.16.1","description":"ZincJS (Web-based-Zinc-Visualisation)","main":"build/zinc.js","directories":{"doc":"docs"},"files":["package.json","LICENSE","README.md","src/*","build/zinc.js","build/zinc.frontend.js","build/zinc.js.map","webpack.config.js"],"scripts":{"build-bundle":"webpack --config webpack.frontend.js; webpack --config webpack.backend.js","build-backend":"webpack --config webpack.backend.js","test":"npm --prefix ./test install && npm --prefix ./test run test-ci","changelog":"auto-changelog -p --output CHANGELOG.md --template keepachangelog","jsdoc":"jsdoc -c jsdoc_conf.json","version":"npm run build-bundle;npm run jsdoc;npm run changelog; git add CHANGELOG.md docs","release:beta":"npm version prerelease --preid=beta; npm publish --tag beta","release:minor":"npm version minor; npm publish","release:patch":"npm version patch; npm publish"},"repository":{"type":"git","url":"git+https://github.com/alan-wu/ZincJS.git"},"keywords":["library","webgl","3d","zincjs"],"author":"Alan Wu <alan.wu@auckland.ac.nz>","license":"MIT","bugs":{"url":"https://github.com/alan-wu/ZincJS/issues"},"homepage":"http://alan-wu.github.io/ZincJS/","devDependencies":{"@babel/core":"^7.23.9","@babel/preset-env":"^7.23.9","auto-changelog":"^2.4.0","babel-loader":"^9.1.3","babel-preset-minify":"^0.5.1","file-loader":"^6.2.0","jsdoc":"^4.0.2","raw-loader":"^4.0.2","webpack":"^5.90.3","webpack-cli":"^5.1.4","webpack-node-externals":"^3.0.0"},"dependencies":{"css-element-queries":"^1.2.2","lodash":"^4.17.19","promise-polyfill":"^8.1.3","three":"^0.130.1","three-spritetext":"1.6.2","url-loader":"^4.1.1","url-polyfill":"^1.1.7","webworkify-webpack":"^2.1.5"}}');
36
36
 
37
37
  /***/ }),
38
38
  /* 3 */
@@ -610,45 +610,45 @@ var THREE=__webpack_require__(4),Glyph=function(geometry,materialIn,idIn,glyphse
610
610
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
611
611
 
612
612
  var SpriteText=(__webpack_require__(7)["default"]);/**
613
- * Bitmap labels, this is used with {@link Glyph} to
613
+ * Bitmap labels, this is used with {@link Glyph} to
614
614
  * provide labels.
615
- *
615
+ *
616
616
  * @param {String} textIn - Text to be displayed dwith the label.
617
617
  * @param {THREE.Color} colour - Colour to be set for the label.
618
- *
618
+ *
619
619
  * @class
620
620
  * @author Alan Wu
621
621
  * @return {Label}
622
622
  */exports.Label=function(textIn,colour){var text=textIn,sprite=void 0;/**
623
623
  * Get the current position in an array containing the x, y and z
624
624
  * coordinates.
625
- *
625
+ *
626
626
  * @return {Array}
627
627
  */ /**
628
628
  * Set the position of the label in 3D coordinates.
629
- *
629
+ *
630
630
  * @param {Number} x - x coordinate to be set.
631
631
  * @param {Number} y - y coordinate to be set.
632
632
  * @param {Number} z - z coordinate to be set.
633
633
  */ /**
634
634
  * Set the colour of the label
635
- *
635
+ *
636
636
  * @param {THREE.Color} colour - colour to be set
637
637
  */ /**
638
638
  * Scale the label.
639
- *
639
+ *
640
640
  * @param {Number} scaling - Scale to be set.
641
641
  */ /**
642
642
  * Free up the memory
643
643
  */ /**
644
644
  * Get the intrnal sprite.
645
- *
645
+ *
646
646
  * @return {THREE.Sprite}
647
647
  */ /**
648
648
  * Get the text.
649
- *
649
+ *
650
650
  * @return {String}
651
- */sprite=colour?new SpriteText(text,.015,colour.getStyle()):new SpriteText(text,.015),sprite.fontFace="Asap",sprite.fontWeight=700,sprite.material.map.generateMipmaps=!1,sprite.material.sizeAttenuation=!1,sprite.center.x=-.05,sprite.center.y=0,this.getPosition=()=>sprite?[sprite.position.x,sprite.position.y,sprite.position.z]:[0,0,0],this.setPosition=(x,y,z)=>{sprite&&sprite.position.set(x,y,z)},this.setColour=colour=>{sprite.color=colour.getStyle()},this.setScale=scaling=>{sprite&&0<scaling&&sprite.scale.set(scaling,scaling,1)},this.dispose=()=>{//sprite.dispose();
651
+ */sprite=colour?new SpriteText(text,.015,colour.getStyle()):new SpriteText(text,.015),sprite.fontFace="Asap",sprite.fontWeight=700,sprite.material.map.generateMipmaps=!1,sprite.material.sizeAttenuation=!1,sprite.center.x=-.05,sprite.center.y=0,this.getPosition=()=>sprite?[sprite.position.x,sprite.position.y,sprite.position.z]:[0,0,0],this.setPosition=(x,y,z)=>{sprite&&sprite.position.set(x,y,z)},this.setColour=colour=>{console.log(sprite),colour&&(sprite.color=colour.getStyle())},this.setScale=scaling=>{sprite&&0<scaling&&sprite.scale.set(scaling,scaling,1)},this.dispose=()=>{//sprite.dispose();
652
652
  },this.getSprite=()=>sprite,this.getString=()=>text};
653
653
 
654
654
  /***/ }),
@@ -796,7 +796,7 @@ return!!(_this.video&&3<=_this.video.readyState)},function initialise(){document
796
796
 
797
797
  var THREE=__webpack_require__(4),Points=(__webpack_require__(23).Points),toBufferGeometry=(__webpack_require__(5).toBufferGeometry),getCircularTexture=(__webpack_require__(5).getCircularTexture),Label=(__webpack_require__(17).Label),Pointset=function(){(__webpack_require__(10).ZincObject).call(this),this.isPointset=!0;var labelSets=[];/**
798
798
  * Create the pointsets using geometry and material.
799
- *
799
+ *
800
800
  * @param {THREE.Geomtry} geometryIn - Geometry of points to be rendered.
801
801
  * @param {THREE.Material} materialIn - Material to be set for the lines.
802
802
  * @param {Object} options - Provide various options
@@ -812,12 +812,20 @@ var THREE=__webpack_require__(4),Points=(__webpack_require__(23).Points),toBuffe
812
812
  * if the number of coords equals to the number labels provided.
813
813
  * @param {Number} colour - A hex value of the colour for the points
814
814
  */ /**
815
+ * Set the colour of the pointset and its label using the hex value
816
+ *
817
+ * @param {Number} hex - hex value of color to be set
818
+ */ /**
819
+ * Set the colour of the pointset and its label
820
+ *
821
+ * @param {THREE.Color} colour - colour to be set
822
+ */ /**
815
823
  * Set the size of the points.
816
- *
824
+ *
817
825
  * @param {Number} size - size to be set.
818
826
  */ /**
819
827
  * Turn size attenuation on/off based on the flag.
820
- *
828
+ *
821
829
  * @param {Boolean} flag - Determin either size attenuation
822
830
  * should be on or off.
823
831
  */ /**
@@ -826,14 +834,14 @@ var THREE=__webpack_require__(4),Points=(__webpack_require__(23).Points),toBuffe
826
834
  * Edit Vertice in index.
827
835
  */ /**
828
836
  * Turn size attenuation on/off based on the flag.
829
- *
837
+ *
830
838
  * @param {Boolean} flag - Determin either size attenuation
831
839
  * should be on or off.
832
- */this.addPoints=(coords,labels,colour)=>{if(coords&&0<coords.length){var current=this.drawRange-1,geometry=this.addVertices(coords),mesh=this.getMorph();if(!mesh){var material=new THREE.PointsMaterial({alphaTest:.5,size:10,color:colour,sizeAttenuation:!1});geometry.colorsNeedUpdate=!0,this.createMesh(geometry,material,{localTimeEnabled:!1,localMorphColour:!1})}var end=current+coords.length,index=0;if(Array.isArray(labels)&&labels.length===coords.length||"string"==typeof labels)for(current;current+index<end;){var labelText="string"==typeof labels?labels:labels[index];addLabel(index,coords[index],labelText,colour),index++}this.region&&(this.region.pickableUpdateRequired=!0)}},this.setSize=size=>{this.morph&&this.morph.material&&(this.morph.material.size=size,this.morph.material.needsUpdate=!0)},this.setSizeAttenuation=flag=>{this.morph&&this.morph.material&&(this.morph.material.sizeAttenuation=flag,this.morph.material.needsUpdate=!0)},this.getVerticesByIndex=function(index){if(0<=index&&this.drawRange>index){var positionAttribute=this.getMorph().geometry.getAttribute("position");return[positionAttribute.getX(index),positionAttribute.getY(index),positionAttribute.getZ(index)]}},this.editVertices=function(coords,i){if(coords&&coords.length){var mesh=this.getMorph(),maxIndex=i+coords.length-1;if(!mesh||0>i||maxIndex>=this.drawRange)return;var positionAttribute=mesh.geometry.getAttribute("position"),index=i;coords.forEach(coord=>{var label=labelSets[index];label&&label.setPosition(coord[0],coord[1],coord[2]),positionAttribute.setXYZ(index++,coord[0],coord[1],coord[2])}),positionAttribute.needsUpdate=!0,this.boundingBoxUpdateRequired=!0}},this.render=(delta,playAnimation,cameraControls,options)=>{this.morph&&cameraControls&&(this.morph.sizePerPixel=cameraControls.pixelHeight),Pointset.prototype.render.call(this,delta,playAnimation,cameraControls,options)}};/**
840
+ */this.addPoints=(coords,labels,colour)=>{if(coords&&0<coords.length){var current=this.drawRange-1,geometry=this.addVertices(coords),mesh=this.getMorph();if(!mesh){var material=new THREE.PointsMaterial({alphaTest:.5,size:10,color:colour,sizeAttenuation:!1});geometry.colorsNeedUpdate=!0,this.createMesh(geometry,material,{localTimeEnabled:!1,localMorphColour:!1})}var end=current+coords.length,index=0;if(Array.isArray(labels)&&labels.length===coords.length||"string"==typeof labels)for(current;current+index<end;){var labelText="string"==typeof labels?labels:labels[index];addLabel(index,coords[index],labelText,colour),index++}this.region&&(this.region.pickableUpdateRequired=!0)}},this.setColourHex=function(hex){this._lod._material.color.setHex(hex),this._lod._secondaryMaterial&&this._lod._secondaryMaterial.color.setHex(hex);for(var i=0;i<labelSets.length;i++)labelSets[i]&&labelSets[i].setColour(this._lod._material.color)},this.setColour=colour=>{this._lod.setColour(colour);for(var i=0;i<labelSets.length;i++)labelSets[i]&&labelSets[i].setColour(this._lod._material.color)},this.setSize=size=>{this.morph&&this.morph.material&&(this.morph.material.size=size,this.morph.material.needsUpdate=!0)},this.setSizeAttenuation=flag=>{this.morph&&this.morph.material&&(this.morph.material.sizeAttenuation=flag,this.morph.material.needsUpdate=!0)},this.getVerticesByIndex=function(index){if(0<=index&&this.drawRange>index){var positionAttribute=this.getMorph().geometry.getAttribute("position");return[positionAttribute.getX(index),positionAttribute.getY(index),positionAttribute.getZ(index)]}},this.editVertices=function(coords,i){if(coords&&coords.length){var mesh=this.getMorph(),maxIndex=i+coords.length-1;if(!mesh||0>i||maxIndex>=this.drawRange)return;var positionAttribute=mesh.geometry.getAttribute("position"),index=i;coords.forEach(coord=>{var label=labelSets[index];label&&label.setPosition(coord[0],coord[1],coord[2]),positionAttribute.setXYZ(index++,coord[0],coord[1],coord[2])}),positionAttribute.needsUpdate=!0,this.boundingBoxUpdateRequired=!0}},this.render=(delta,playAnimation,cameraControls,options)=>{this.morph&&cameraControls&&(this.morph.sizePerPixel=cameraControls.pixelHeight),Pointset.prototype.render.call(this,delta,playAnimation,cameraControls,options)}};/**
833
841
  * Provides an object which stores points and provides method which controls its position.
834
842
  * This is created when a valid json file containing point is read into a {@link Zinc.Scene}
835
843
  * object.
836
- *
844
+ *
837
845
  * @class
838
846
  * @author Alan Wu
839
847
  * @return {Pointset}