hilbert-chart-3d 0.4.0 → 0.5.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.
@@ -139,16 +139,34 @@ var index = Kapsule({
139
139
  };
140
140
  state.renderObjs.fitToBbox(roBbox, transitionDuration);
141
141
  });
142
+ return this;
142
143
  },
143
144
  zoomToFit: function (state, transitionDuration, padding) {
144
- state.renderObjs.zoomTofit(transitionDuration, padding);
145
+ state.renderObjs.zoomToFit(transitionDuration, padding);
145
146
  return this;
146
147
  },
148
+ getPositionAtVal: (state, ...args) => state.hilbert.getPositionAtVal(...args),
147
149
  _animationCycle(state) {
148
150
  // Frame cycle
149
151
  state.renderObjs.tick();
150
152
  state.animationFrameRequestId = requestAnimationFrame(this._animationCycle);
151
153
  },
154
+ cameraPosition: function (state, ...args) {
155
+ if (args.length) {
156
+ // setter
157
+ state.renderObjs.cameraPosition(...args);
158
+ return this;
159
+ }
160
+ return state.renderObjs.cameraPosition();
161
+ },
162
+ lights: function (state, ...args) {
163
+ if (args.length) {
164
+ // setter
165
+ state.renderObjs.lights(...args);
166
+ return this;
167
+ }
168
+ return state.renderObjs.lights();
169
+ },
152
170
  scene: state => state.renderObjs.scene(),
153
171
  // Expose scene
154
172
  camera: state => state.renderObjs.camera(),
@@ -187,14 +205,12 @@ var index = Kapsule({
187
205
  el.appendChild(roDomNode);
188
206
  const getHilbertObjData = (obj, intersection) => {
189
207
  if (!obj) return null;
190
- if (intersection && obj.isInstancedMesh) {
191
- return obj.userData.data?.[intersection.instanceId] || null;
192
- }
193
208
  const hilbertObj = getHilbertObj(obj);
194
- return hilbertObj?.__data || null;
209
+ const d = hilbertObj?.__data || null;
210
+ return intersection && hilbertObj.isInstancedMesh ? d?.[intersection.instanceId] : d;
195
211
  function getHilbertObj(object) {
196
212
  let obj = object;
197
- // recurse up object chain until finding the globe object
213
+ // recurse up object chain until finding the hilbert object
198
214
  while (obj && !obj.hasOwnProperty('__data')) {
199
215
  obj = obj.parent;
200
216
  }
@@ -223,7 +239,7 @@ var index = Kapsule({
223
239
  d ? state.onClick?.(d, ev) : state.onBackgroundClick?.(ev);
224
240
  });
225
241
  state.renderObjs.camera().position.z = 500;
226
- state.controlType === 'fly' && (state.renderObjs.controls().movementSpeed = 100);
242
+ state.controlType === 'fly' && (state.renderObjs.controls().movementSpeed = 80);
227
243
 
228
244
  //
229
245
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hilbert-chart-3d",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "A 3d hilbert space-filling curve D3 chart for representing one-dimensional lengths on a three-dimensional space.",
5
5
  "type": "module",
6
6
  "jsdelivr": "dist/hilbert-chart-3d.min.js",
@@ -45,7 +45,7 @@
45
45
  "accessor-fn": "1",
46
46
  "kapsule": "^1.16",
47
47
  "three": ">=0.179 <1",
48
- "three-hilbert": "*",
48
+ "three-hilbert": "1",
49
49
  "three-render-objects": "^1.44"
50
50
  },
51
51
  "devDependencies": {