diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index f5f8432ade7..39a3f7c4693 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -8,8 +8,8 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-20.04] - node: [18, 20] + os: [ubuntu-24.04] + node: [22] name: ${{ matrix.os }} and node ${{ matrix.node }} steps: - uses: actions/checkout@v2 @@ -25,9 +25,9 @@ jobs: run: npm run build:release - name: Archive build output if: github.event_name != 'merge_group' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: build-results + name: build-results-${{ matrix.runs_on }}-node_${{ matrix.node }} path: dist retention-days: 15 - name: Validate generated typescript definitions @@ -38,9 +38,9 @@ jobs: run: xvfb-run --auto-servernum npm run test -- --browsers Chrome,Firefox - name: Archive test results if: github.event_name != 'merge_group' && (success() || failure()) - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 continue-on-error: true with: - name: test-results + name: test-results-${{ matrix.runs_on }}-node_${{ matrix.node }} path: Utilities/TestResults/Test-Report.html retention-days: 15 diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index b33448de740..b24e9d7aaa6 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -5,7 +5,7 @@ on: jobs: pr-checks: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 name: Check and lint PR steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7362fda28e7..780f89cbc52 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -12,7 +12,7 @@ on: jobs: publish: name: Publish - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v2 @@ -21,7 +21,7 @@ jobs: - name: Setup node uses: actions/setup-node@v1 with: - node-version: 20 + node-version: 22 - name: Install dependencies run: | npm ci @@ -38,7 +38,7 @@ jobs: run: xvfb-run --auto-servernum npm run test -- --browsers Chrome,Firefox - name: Archive test results if: always() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: test-results path: Utilities/TestResults/Test-Report.html @@ -51,11 +51,35 @@ jobs: git config --global user.name "Github Actions" git config --global user.email "sebastien.jourdain@kitware.com" npm run semantic-release + deploy_docs: + if: github.ref == 'refs/heads/master' + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 1 + - name: Setup node + uses: actions/setup-node@v1 + with: + node-version: 22 + - name: Install dependencies + run: npm ci + - name: Build + run: npm run build:release - name: Build API docs - if: github.ref == 'refs/heads/master' run: npm run doc:generate-api - - name: Publish docs - if: github.ref == 'refs/heads/master' - env: - GIT_PUBLISH_URL: https://${{ secrets.GH_PUBLISH_CREDS }}@github.com/Kitware/vtk-js.git - run: npm run doc:publish + - name: Build docs + run: npm run doc:minified + - name: Upload docs as a Pages artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ./Documentation/build-tmp/public/ + - name: Deploy docs + uses: actions/deploy-pages@v4 diff --git a/Documentation/content/docs/develop_test.md b/Documentation/content/docs/develop_test.md index 99bdd19e253..8e5818bfea8 100644 --- a/Documentation/content/docs/develop_test.md +++ b/Documentation/content/docs/develop_test.md @@ -45,15 +45,15 @@ test('Validate vtkMyClass properties', (t) => { ```js ClassName/test/testRendering.js import test from 'tape'; -import vtkOpenGLRenderWindow from '../../../../Rendering/OpenGL/RenderWindow'; -import vtkRenderWindow from '../../../../Rendering/Core/RenderWindow'; -import vtkRenderer from '../../../../Rendering/Core/Renderer'; -import vtkConeSource from '../../../../Filters/Sources/ConeSource'; -import vtkActor from '../../../../Rendering/Core/Actor'; -import vtkMapper from '../../../../Rendering/Core/Mapper'; +import vtkOpenGLRenderWindow from '@kitware/vtk.js/Rendering/OpenGL/RenderWindow'; +import vtkRenderWindow from '@kitware/vtk.js/Rendering/Core/RenderWindow'; +import vtkRenderer from '@kitware/vtk.js/Rendering/Core/Renderer'; +import vtkConeSource from '@kitware/vtk.js/Filters/Sources/ConeSource'; +import vtkActor from '@kitware/vtk.js/Rendering/Core/Actor'; +import vtkMapper from '@kitware/vtk.js/Rendering/Core/Mapper'; import baseline from './testClassName.png'; -import testUtils from '../../../../Testing/testUtils'; +import testUtils from '@kitware/vtk.js/Testing/testUtils'; test.onlyIfWebGL('Test vtkClassName Rendering', (t) => { // Create some control UI @@ -82,11 +82,12 @@ test.onlyIfWebGL('Test vtkClassName Rendering', (t) => { renderWindow.addView(glwindow); glwindow.setSize(400, 400); - glwindow.captureNextImage().then((image) => { + const promise = glwindow.captureNextImage().then((image) => { // compareImages(image, baselines, testName, tapeContext, threshold = 5, nextCallback = null) - testUtils.compareImages(image, [baseline], 'Filters/Sources/ConeSource/', t); + return testUtils.compareImages(image, [baseline], 'Filters/Sources/ConeSource/', t); }); renderWindow.render(); + return promise; }); ``` @@ -133,9 +134,9 @@ Follow the following procedure to create a new baseline or change an existing ba - Add an invalid baseline (any PNG file) and rename it as the required baseline. For example, to create a baseline for `testCylinder.js` copy *testCone.png* to *Sources/Filters/Sources/CylinderSource/test/testCylinder.png*. -- 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. +- 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. - The test execution creates a file **Utilities/TestResults/Test-Report.html**. Open this in the browser. - The file should show the test output versus the invalid baseline image, as well as a diff. Right-click on the test output image and save it as the valid baseline. - Re-run the test to ensure that it passes with the valid baseline. -- Commit the baseline image to the git source tree. +- Commit the baseline image to the git source tree. diff --git a/Documentation/content/docs/gallery/GLTFImporterWithIcon.jpg b/Documentation/content/docs/gallery/GLTFImporterWithIcon.jpg new file mode 100644 index 00000000000..88cd7c320e6 Binary files /dev/null and b/Documentation/content/docs/gallery/GLTFImporterWithIcon.jpg differ diff --git a/Documentation/content/docs/gallery/IFCImporterWithIcon.jpg b/Documentation/content/docs/gallery/IFCImporterWithIcon.jpg new file mode 100644 index 00000000000..c5b2d1b2f7e Binary files /dev/null and b/Documentation/content/docs/gallery/IFCImporterWithIcon.jpg differ diff --git a/Documentation/content/docs/gallery/TGAReaderWithIcon.jpg b/Documentation/content/docs/gallery/TGAReaderWithIcon.jpg new file mode 100644 index 00000000000..d0cd9a8f691 Binary files /dev/null and b/Documentation/content/docs/gallery/TGAReaderWithIcon.jpg differ diff --git a/Documentation/content/docs/gallery/TIFFReaderWithIcon.jpg b/Documentation/content/docs/gallery/TIFFReaderWithIcon.jpg new file mode 100644 index 00000000000..30a56b4040c Binary files /dev/null and b/Documentation/content/docs/gallery/TIFFReaderWithIcon.jpg differ diff --git a/Documentation/content/docs/gallery/ThresholdPoints.jpg b/Documentation/content/docs/gallery/ThresholdPoints.jpg new file mode 100644 index 00000000000..f73511b262c Binary files /dev/null and b/Documentation/content/docs/gallery/ThresholdPoints.jpg differ diff --git a/Documentation/content/docs/index.md b/Documentation/content/docs/index.md index 83b7368bb91..cb86d80cda7 100644 --- a/Documentation/content/docs/index.md +++ b/Documentation/content/docs/index.md @@ -19,7 +19,7 @@ You can learn more about what vtk.js can do for you via the [examples](../exampl VTK.js is a complete rewrite of VTK/C++ using plain JavaScript (ES6). 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. -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. +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. 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. diff --git a/Documentation/content/examples/index.md b/Documentation/content/examples/index.md index b3969aac5b1..34dc0ffa1a4 100644 --- a/Documentation/content/examples/index.md +++ b/Documentation/content/examples/index.md @@ -1,392 +1,403 @@ -title: Examples ---- - - - -This will allow you to see the some live code running in your browser. Just pick a class on the left menu or in the category grouping below. The [Simple Cone](SimpleCone.html) is a good example to start with if you are new to VTK. - - - -[MultiSliceImageMapper]: ../docs/gallery/MultiSliceImageMapper.jpg -[PiecewiseGaussianWidget]: ../docs/gallery/PiecewiseGaussianWidget.jpg -[VolumeContour]: ../docs/gallery/VolumeContour.jpg - -# Applications - - - -[GeometryViewerBrainBloodVessels]: ../docs/gallery/GeometryViewerBrainBloodVessels2.jpg -[OBJViewerFerrari]: ../docs/gallery/OBJViewerFerrari.jpg -[SceneExplorerVesselWithStreamlines]: ../docs/gallery/SceneExplorerVesselWithStreamlines.jpg -[SkyboxViewer]: ../docs/gallery/SkyboxViewer.jpg -[VolumeViewer]: ../docs/gallery/VolumeViewer.jpg -[QuadView]: ../docs/gallery/QuadView.jpg - -# Geometry - -