Skip to content

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