The Demo Server
Due to the use of symbolic names in import
statements, the demos will not function correctly when launched directly from the file system or served through a regular web server.
To run them in a standard browser, these symbolic names need to be resolved to actual filenames.
Several methods can achieve this resolution. While almost all popular build toolchains can be employed, many are too complex for this specific, simple task. Therefore, we recommend accessing the demos through the included demo server, which is a local Vite server serving the demo applications.
If you prefer not to use our demo server, you can use tools such as webpack, Vite, rollup, Parcel, or lighter alternatives like @web/dev-server. The package includes demos illustrating how to configure each of these tools. The configuration is generally straightforward, and the tool-specific documentation should work seamlessly with yFiles for HTML.
Prerequisites
The demo server requires Node.js and npm to be installed. To install Node.js, go to https://nodejs.org, download the installer suitable for your system, and install it. Node.js distributions from https://nodejs.org include npm.
We recommend installing the 'LTS' or the 'Current' version.
Running the Demo Server
You can start the demo server using one of the following methods: through the provided configuration in the WebStorm project, using the corresponding task in the Visual Studio Code workspace, or by running the following command in the yFiles for HTML root folder:
> npm start
This command installs the required dependencies in the node_modules
directory and starts the server.
After the server starts, its welcome page should automatically open in your browser.
If it does not, manually navigate your browser to http://localhost:4242/README.html.
To start a specific demo or tutorial, use the links provided on the landing page. Because the demo server hosts all application files from the same domain, this configuration avoids cross-domain issues that some demos might encounter in certain browsers.