Vite Loading Demo
This demo shows how to load yFiles for HTML with
Vite
as a loader for efficient web development and easy builds.
Also, a layout algorithm in a Web Worker thread without blocking the UI or main thread is
loaded using
Vite's built-in support for Web Workers.
Wait for the demo to load and once the layout button has become active (when the Web
Worker has initialized), push the layout button to run a layout asynchronously
See the sources for details.
Please note that the hot reloading features of this demo are completely
optional and definitely not required when using yFiles for HTML with vite. They are only
meant to show a simple example of hot reloading.
The demo code uses
module workers. Vite's
development build relies on browser native support and therefore currently only works in
some browser (e.g. Chrome). For unsupported browsers, client-sided layout calculation is
used as fallback.
Please see the Vitest section of the developer's guide
for details about using the Vitest framework with your yFiles for HTML application.