@kitware/vtk.js 30.3.0 → 30.3.2

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.
@@ -45,20 +45,18 @@ function applyTextStyle(ctx, style) {
45
45
  ctx.fillStyle = style.fontColor;
46
46
  ctx.font = `${style.fontStyle} ${style.fontSize}px ${style.fontFamily}`;
47
47
  }
48
- function defaultGenerateTicks(publicApi, model) {
49
- return dataBounds => {
50
- const ticks = [];
51
- const tickStrings = [];
52
- for (let i = 0; i < 3; i++) {
53
- const scale = d3.scaleLinear().domain([dataBounds[i * 2], dataBounds[i * 2 + 1]]);
54
- ticks[i] = scale.ticks(5);
55
- const format = scale.tickFormat(5);
56
- tickStrings[i] = ticks[i].map(format);
57
- }
58
- return {
59
- ticks,
60
- tickStrings
61
- };
48
+ function defaultGenerateTicks(dataBounds) {
49
+ const ticks = [];
50
+ const tickStrings = [];
51
+ for (let i = 0; i < 3; i++) {
52
+ const scale = d3.scaleLinear().domain([dataBounds[i * 2], dataBounds[i * 2 + 1]]);
53
+ ticks[i] = scale.ticks(5);
54
+ const format = scale.tickFormat(5);
55
+ tickStrings[i] = ticks[i].map(format);
56
+ }
57
+ return {
58
+ ticks,
59
+ tickStrings
62
60
  };
63
61
  }
64
62
 
@@ -694,7 +692,7 @@ function defaultValues(publicAPI, model, initialValues) {
694
692
  axisLabels: null,
695
693
  axisTitlePixelOffset: 35.0,
696
694
  tickLabelPixelOffset: 12.0,
697
- generateTicks: defaultGenerateTicks(),
695
+ generateTicks: defaultGenerateTicks,
698
696
  ...initialValues,
699
697
  axisTextStyle: {
700
698
  fontColor: 'white',
@@ -731,7 +729,9 @@ function extend(publicAPI, model) {
731
729
  model._tmAtlas = new Map();
732
730
 
733
731
  // for texture atlas
734
- model.tmTexture = vtkTexture.newInstance();
732
+ model.tmTexture = vtkTexture.newInstance({
733
+ resizable: true
734
+ });
735
735
  model.tmTexture.setInterpolate(false);
736
736
  publicAPI.getProperty().setDiffuse(0.0);
737
737
  publicAPI.getProperty().setAmbient(1.0);
@@ -761,7 +761,8 @@ const newInstance = macro.newInstance(extend, 'vtkCubeAxesActor');
761
761
  var vtkCubeAxesActor$1 = {
762
762
  newInstance,
763
763
  extend,
764
- newCubeAxesActorHelper
764
+ newCubeAxesActorHelper,
765
+ defaultGenerateTicks
765
766
  };
766
767
 
767
768
  export { vtkCubeAxesActor$1 as default, extend, newInstance };
@@ -89,7 +89,7 @@ export interface vtkRenderer extends vtkViewport {
89
89
  /**
90
90
  * Create and add a light to renderer.
91
91
  */
92
- createLight(): vtkLight;
92
+ createLight(): void;
93
93
 
94
94
  /**
95
95
  * Compute the bounding box of all the visible props Used in ResetCamera() and ResetCameraClippingRange()
@@ -342,12 +342,12 @@ export interface vtkRenderer extends vtkViewport {
342
342
  getVolumesByReference(): vtkVolume[];
343
343
 
344
344
  /**
345
- * Create a new Camera sutible for use with this type of Renderer.
345
+ * Create a new Camera suitable for use with this type of Renderer.
346
346
  */
347
347
  makeCamera(): vtkCamera;
348
348
 
349
349
  /**
350
- * Create a new Light sutible for use with this type of Renderer.
350
+ * Create a new Light suitable for use with this type of Renderer.
351
351
  */
352
352
  makeLight(): vtkLight;
353
353
 
@@ -1,4 +1,26 @@
1
+ import { Nullable } from '../../../types';
2
+ import { InteractionMethodsName, lineNames } from './Constants';
1
3
  import vtkAbstractWidget from '../../Core/AbstractWidget';
2
4
 
5
+ type TLineName = (typeof lineNames)[number];
6
+
7
+ type TCursorStyles = {
8
+ [key in InteractionMethodsName]?: string;
9
+ } & {
10
+ default?: string
11
+ };
12
+
3
13
  export default interface vtkResliceCursorWidgetDefaultInstance extends vtkAbstractWidget {
14
+ getActiveInteraction(): Nullable<InteractionMethodsName>;
15
+
16
+ setKeepOrthogonality(keepOrthogonality: boolean): boolean;
17
+ getKeepOrthogonality(): boolean;
18
+
19
+ setCursorStyles(cursorStyles: TCursorStyles): boolean;
20
+ getCursorStyles(): TCursorStyles;
21
+
22
+ setEnableTranslation(enableTranslation: boolean): void;
23
+ setEnableRotation(enableRotation: boolean): void;
24
+
25
+ getActiveLineName(): TLineName | undefined;
4
26
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitware/vtk.js",
3
- "version": "30.3.0",
3
+ "version": "30.3.2",
4
4
  "description": "Visualization Toolkit for the Web",
5
5
  "keywords": [
6
6
  "3d",
@@ -131,7 +131,7 @@
131
131
  "peerDependencies": {
132
132
  "@babel/preset-env": "^7.17.10",
133
133
  "autoprefixer": "^10.4.7",
134
- "wslink": "^1.1.0"
134
+ "wslink": ">=1.1.0 || ^2.0.0"
135
135
  },
136
136
  "scripts": {
137
137
  "validate": "prettier --config ./prettier.config.js --list-different \"Sources/**/*.js\" \"Examples/**/*.js\"",