Skip to content

fix(examples): remove unused vtk-root element#3543

Merged
finetjul merged 1 commit into
Kitware:masterfrom
Jo-Byr:fix-reslice-cursor-widget-example
Jul 9, 2026
Merged

fix(examples): remove unused vtk-root element#3543
finetjul merged 1 commit into
Kitware:masterfrom
Jo-Byr:fix-reslice-cursor-widget-example

Conversation

@Jo-Byr

@Jo-Byr Jo-Byr commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Context

Some examples have been broken since the switch to lil-gui, the example of ResliceCursorWidget is one of them. The widgets were displayed below a white div.

Results

The example is now correctly displayed.

Changes

Added a container element, by taking inspiration from DepthTest example.

PR and Code Checklist

  • semantic-release commit messages
  • Run npm run reformat to have correctly formatted code

Testing

Tested with

npm run build
npm run docs:generate
npm run docs:build
npm run docs:build-examples
npm run docs:serve 

@Jo-Byr Jo-Byr requested a review from finetjul July 6, 2026 13:37
@Jo-Byr Jo-Byr self-assigned this Jul 6, 2026

@finetjul finetjul left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please explain what the problem is/was ?

@Jo-Byr

Jo-Byr commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

Can you please explain what the problem is/was ?

I don't know why this fixes the problem.

As explained in the top comment, I noticed the example's content was present in the page, but under a blank div. I searched for a working example with a similar structure (one that uses document.createElement), which is DepthTest, and tested it.

@daker

daker commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

@Jo-Byr just remove the div with id "vtk-root" it was not used

https://github.com/Kitware/vtk-js/blob/master/Documentation/scripts/build-examples.mjs#L66

@Jo-Byr Jo-Byr force-pushed the fix-reslice-cursor-widget-example branch from eb0e1e7 to 190858a Compare July 7, 2026 06:32

@finetjul finetjul left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You also need to remove it from that example code that references 'vtk-root'.

Remove unused vtk-root element from generated examples HTML
@Jo-Byr Jo-Byr force-pushed the fix-reslice-cursor-widget-example branch from 190858a to 20dbb96 Compare July 8, 2026 07:07

@finetjul finetjul left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Please edit your PR opening comment.

@Jo-Byr Jo-Byr changed the title chore(ResliceCursorWidget): fix example fix(examples): remove unused vtk-root element Jul 9, 2026

@daker daker left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@finetjul finetjul added this pull request to the merge queue Jul 9, 2026
Merged via the queue into Kitware:master with commit 8c75d06 Jul 9, 2026
3 checks passed
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 36.2.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions Bot added the released Automated label label Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Automated label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants