Skip to content

Commit 7b411e8

Browse files
authored
Merge pull request #3225 from Kitware/master
Update v33 beta branch with changes from v32
2 parents e00ae96 + 472832c commit 7b411e8

File tree

163 files changed

+10614
-4396
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

163 files changed

+10614
-4396
lines changed

.github/workflows/build-test.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ jobs:
88
runs-on: ${{ matrix.os }}
99
strategy:
1010
matrix:
11-
os: [ubuntu-20.04]
12-
node: [18, 20]
11+
os: [ubuntu-24.04]
12+
node: [22]
1313
name: ${{ matrix.os }} and node ${{ matrix.node }}
1414
steps:
1515
- uses: actions/checkout@v2
@@ -25,9 +25,9 @@ jobs:
2525
run: npm run build:release
2626
- name: Archive build output
2727
if: github.event_name != 'merge_group'
28-
uses: actions/upload-artifact@v3
28+
uses: actions/upload-artifact@v4
2929
with:
30-
name: build-results
30+
name: build-results-${{ matrix.runs_on }}-node_${{ matrix.node }}
3131
path: dist
3232
retention-days: 15
3333
- name: Validate generated typescript definitions
@@ -38,9 +38,9 @@ jobs:
3838
run: xvfb-run --auto-servernum npm run test -- --browsers Chrome,Firefox
3939
- name: Archive test results
4040
if: github.event_name != 'merge_group' && (success() || failure())
41-
uses: actions/upload-artifact@v3
41+
uses: actions/upload-artifact@v4
4242
continue-on-error: true
4343
with:
44-
name: test-results
44+
name: test-results-${{ matrix.runs_on }}-node_${{ matrix.node }}
4545
path: Utilities/TestResults/Test-Report.html
4646
retention-days: 15

.github/workflows/pr-checks.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55

66
jobs:
77
pr-checks:
8-
runs-on: ubuntu-20.04
8+
runs-on: ubuntu-24.04
99
name: Check and lint PR
1010
steps:
1111
- uses: actions/checkout@v2

.github/workflows/publish.yml

+33-9
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
jobs:
1313
publish:
1414
name: Publish
15-
runs-on: ubuntu-20.04
15+
runs-on: ubuntu-24.04
1616
steps:
1717
- name: Checkout
1818
uses: actions/checkout@v2
@@ -21,7 +21,7 @@ jobs:
2121
- name: Setup node
2222
uses: actions/setup-node@v1
2323
with:
24-
node-version: 20
24+
node-version: 22
2525
- name: Install dependencies
2626
run: |
2727
npm ci
@@ -38,7 +38,7 @@ jobs:
3838
run: xvfb-run --auto-servernum npm run test -- --browsers Chrome,Firefox
3939
- name: Archive test results
4040
if: always()
41-
uses: actions/upload-artifact@v3
41+
uses: actions/upload-artifact@v4
4242
with:
4343
name: test-results
4444
path: Utilities/TestResults/Test-Report.html
@@ -51,11 +51,35 @@ jobs:
5151
git config --global user.name "Github Actions"
5252
git config --global user.email "[email protected]"
5353
npm run semantic-release
54+
deploy_docs:
55+
if: github.ref == 'refs/heads/master'
56+
permissions:
57+
pages: write
58+
id-token: write
59+
environment:
60+
name: github-pages
61+
url: ${{ steps.deployment.outputs.page_url }}
62+
runs-on: ubuntu-latest
63+
steps:
64+
- name: Checkout
65+
uses: actions/checkout@v2
66+
with:
67+
fetch-depth: 1
68+
- name: Setup node
69+
uses: actions/setup-node@v1
70+
with:
71+
node-version: 22
72+
- name: Install dependencies
73+
run: npm ci
74+
- name: Build
75+
run: npm run build:release
5476
- name: Build API docs
55-
if: github.ref == 'refs/heads/master'
5677
run: npm run doc:generate-api
57-
- name: Publish docs
58-
if: github.ref == 'refs/heads/master'
59-
env:
60-
GIT_PUBLISH_URL: https://${{ secrets.GH_PUBLISH_CREDS }}@github.com/Kitware/vtk-js.git
61-
run: npm run doc:publish
78+
- name: Build docs
79+
run: npm run doc:minified
80+
- name: Upload docs as a Pages artifact
81+
uses: actions/upload-pages-artifact@v3
82+
with:
83+
path: ./Documentation/build-tmp/public/
84+
- name: Deploy docs
85+
uses: actions/deploy-pages@v4

Documentation/content/docs/develop_test.md

+12-11
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ test('Validate vtkMyClass properties', (t) => {
4545
```js ClassName/test/testRendering.js
4646
import test from 'tape';
4747

48-
import vtkOpenGLRenderWindow from '../../../../Rendering/OpenGL/RenderWindow';
49-
import vtkRenderWindow from '../../../../Rendering/Core/RenderWindow';
50-
import vtkRenderer from '../../../../Rendering/Core/Renderer';
51-
import vtkConeSource from '../../../../Filters/Sources/ConeSource';
52-
import vtkActor from '../../../../Rendering/Core/Actor';
53-
import vtkMapper from '../../../../Rendering/Core/Mapper';
48+
import vtkOpenGLRenderWindow from '@kitware/vtk.js/Rendering/OpenGL/RenderWindow';
49+
import vtkRenderWindow from '@kitware/vtk.js/Rendering/Core/RenderWindow';
50+
import vtkRenderer from '@kitware/vtk.js/Rendering/Core/Renderer';
51+
import vtkConeSource from '@kitware/vtk.js/Filters/Sources/ConeSource';
52+
import vtkActor from '@kitware/vtk.js/Rendering/Core/Actor';
53+
import vtkMapper from '@kitware/vtk.js/Rendering/Core/Mapper';
5454

5555
import baseline from './testClassName.png';
56-
import testUtils from '../../../../Testing/testUtils';
56+
import testUtils from '@kitware/vtk.js/Testing/testUtils';
5757

5858
test.onlyIfWebGL('Test vtkClassName Rendering', (t) => {
5959
// Create some control UI
@@ -82,11 +82,12 @@ test.onlyIfWebGL('Test vtkClassName Rendering', (t) => {
8282
renderWindow.addView(glwindow);
8383
glwindow.setSize(400, 400);
8484

85-
glwindow.captureNextImage().then((image) => {
85+
const promise = glwindow.captureNextImage().then((image) => {
8686
// compareImages(image, baselines, testName, tapeContext, threshold = 5, nextCallback = null)
87-
testUtils.compareImages(image, [baseline], 'Filters/Sources/ConeSource/', t);
87+
return testUtils.compareImages(image, [baseline], 'Filters/Sources/ConeSource/', t);
8888
});
8989
renderWindow.render();
90+
return promise;
9091
});
9192
```
9293

@@ -133,9 +134,9 @@ Follow the following procedure to create a new baseline or change an existing ba
133134

134135
- Add an invalid baseline (any PNG file) and rename it as the required baseline.
135136
For example, to create a baseline for `testCylinder.js` copy *testCone.png* to *Sources/Filters/Sources/CylinderSource/test/testCylinder.png*.
136-
- Run the test as per [Running a single test for debugging](#Running-a-single-test-for-debugging). The test should fail because of the invalid baseline.
137+
- Run the test as per [Running a single test for debugging](#Running-a-single-test-for-debugging). The test should fail because of the invalid baseline.
137138
- The test execution creates a file **Utilities/TestResults/Test-Report.html**. Open this in the browser.
138139
- The file should show the test output versus the invalid baseline image, as well as a diff.
139140
Right-click on the test output image and save it as the valid baseline.
140141
- Re-run the test to ensure that it passes with the valid baseline.
141-
- Commit the baseline image to the git source tree.
142+
- Commit the baseline image to the git source tree.
Loading
Loading
Loading
Loading
Loading

Documentation/content/docs/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ You can learn more about what vtk.js can do for you via the [examples](../exampl
1919
VTK.js is a complete rewrite of VTK/C++ using plain JavaScript (ES6).
2020
The focus of the rewrite, so far, has been the rendering pipeline for ImageData and PolyData, the pipeline infrastructure, and frequently used readers (obj, stl, vtp, vti). Some filters are also provided as demonstrations. We are not aiming for vtk.js to provide the same set of filters that is available in VTK/C++, but vtk.js does provide the infrastructure needed to define pipelines and filters.
2121

22-
We have also started to explore a path where you can compile some bits of VTK/C++ into WebAssembly and to enable them to interact with vtk.js. With such interaction, you can pick and choose what you need to extract from VTK and enable it inside your web application. VTK/C++ WebAssembly can even be used for rendering, and examples can be found in [VTK repository](https://github.com/Kitware/VTK/tree/master/Examples/Emscripten/Cxx). Additionally [itk.js](https://insightsoftwareconsortium.github.io/itk-js/index.html) (which is ITK via WebAssembly) also provides proven implementations for several image filters and data readers. There are, however, some additional costs in terms of the size of the WebAssembly file that will have to be downloaded when visiting a VTK or ITK WebAssembly webpage; and we still have some work to do to streamline the vtk.js + VTK WebAssembly integrations.
22+
We have also started to explore a path where you can compile some bits of VTK/C++ into WebAssembly and to enable them to interact with vtk.js. With such interaction, you can pick and choose what you need to extract from VTK and enable it inside your web application. VTK/C++ WebAssembly can even be used for rendering, and examples can be found in [VTK repository](https://github.com/Kitware/VTK/tree/master/Examples/Emscripten/Cxx). Additionally [itk-wasm](https://wasm.itk.org/en/latest/) (which is ITK via WebAssembly) also provides proven implementations for several image filters and data readers. There are, however, some additional costs in terms of the size of the WebAssembly file that will have to be downloaded when visiting a VTK or ITK WebAssembly webpage; and we still have some work to do to streamline the vtk.js + VTK WebAssembly integrations.
2323

2424
In general if you want to stay in the pure JavaScript land, then vtk.js is perhaps the ideal solution for you. We welcome your feedback, including your contributions for new visualization filters, bug fixes, and examples.
2525

0 commit comments

Comments
 (0)