Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add svelte 5 + cornerstone project #1

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

mcullifer
Copy link

@mcullifer mcullifer commented Nov 28, 2024

  • Adds new svelte 5 project with example cornerstone viewport

The example project uses SvelteKit which by default has SSR enabled. It shows how to use $effect runes to initialize cornerstone and render the viewport once it's client side. You can add any number of viewports inside the <CornerstoneContext>...</CornerstoneContext> block which will scope an engine instance to the children() #snippet. If multiple contexts exist with the same engineId then it will re-use the existing one. The onReady events for <CornerstoneContext /> and <CornerstoneViewport /> have an optional cleanup function return value. The example shows how you can use this to clean up resources after a page navigation or some state change that unmounts them from the DOM.

To run: npm install & npm run dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant