zincjs 1.16.3 → 1.16.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,6 +1,6 @@
1
1
  {
2
2
  "name": "zincjs",
3
- "version": "1.16.3",
3
+ "version": "1.16.4",
4
4
  "description": "ZincJS (Web-based-Zinc-Visualisation)",
5
5
  "main": "build/zinc.js",
6
6
  "directories": {
@@ -8,7 +8,7 @@ const LineSegmentsGeometry = require("../three/line/LineSegmentsGeometry").LineS
8
8
  * Provides an object which stores lines.
9
9
  * This is created when a valid json file containing lines is read into a {@link Zinc.Scene}
10
10
  * object.
11
- *
11
+ *
12
12
  * @class
13
13
  * @author Alan Wu
14
14
  * @return {Lines}
@@ -20,7 +20,7 @@ const Lines2 = function () {
20
20
 
21
21
  /**
22
22
  * Create the line segements using geometry and material.
23
- *
23
+ *
24
24
  * @param {Array} arrayIn - Geometry of lines to be rendered.
25
25
  * @param {THREE.Material} materialIn - Material to be set for the lines.
26
26
  * @param {Object} options - Provide various options
@@ -43,7 +43,7 @@ const Lines2 = function () {
43
43
 
44
44
  /**
45
45
  * Set the width for the lines.
46
- *
46
+ *
47
47
  * @param {Number} width - Width of the lines.
48
48
  */
49
49
  this.setWidth = width => {
@@ -121,6 +121,7 @@ const Lines2 = function () {
121
121
  if (!mesh || 0 > i || maxIndex >= this.drawRange) {
122
122
  return;
123
123
  } else {
124
+
124
125
  let index = i * 3;
125
126
  coords.forEach(coord => {
126
127
  positions[index++] = coord[0];
@@ -66,7 +66,10 @@ const Pointset = function () {
66
66
  */
67
67
  this.addPoints = (coords, labels, colour) => {
68
68
  if (coords && coords.length > 0) {
69
- let current = this.drawRange - 1;
69
+ let current = this.drawRange;
70
+ if (current === -1) {
71
+ current = 0;
72
+ }
70
73
  const geometry = this.addVertices(coords);
71
74
  let mesh = this.getMorph();
72
75
  if (!mesh) {
@@ -76,13 +79,15 @@ const Pointset = function () {
76
79
  geometry.colorsNeedUpdate = true;
77
80
  this.createMesh(geometry, material, options);
78
81
  }
82
+
79
83
  let end = current + coords.length;
80
84
  let index = 0;
81
85
  if ((Array.isArray(labels) && labels.length === coords.length) ||
82
86
  (typeof labels === "string")) {
87
+ const size = labelSets.length;
83
88
  for (current; current + index < end;) {
84
89
  const labelText = typeof labels === "string" ? labels : labels[index];
85
- addLabel(index, coords[index], labelText, colour);
90
+ addLabel(current + index, coords[index], labelText, this._lod._material.color);
86
91
  index++;
87
92
  }
88
93
  }
@@ -199,6 +204,7 @@ const Pointset = function () {
199
204
  }
200
205
  Pointset.prototype.render.call(this, delta, playAnimation, cameraControls, options);
201
206
  }
207
+
202
208
  }
203
209
 
204
210
  Pointset.prototype = Object.create((require('./zincObject').ZincObject).prototype);