Getting started with yFiles for HTML
This guide will help you get started with yFiles for HTML, an advanced JavaScript/TypeScript Software Development Kit (SDK) for graph visualization and diagramming.
Here, you'll find everything you need to get started, including information on setting up your environment, running and exploring over 250 demos, learning the basics, and building your first interactive diagramming apps.
Whether you're evaluating yFiles or starting your first project, this page is the perfect place to begin.
If you are working with AI coding agents, use the following prompt to get started:
Start with an AI Coding Agent
Let your AI coding agent set up a yFiles project for you—just copy the prompt and paste it into your agent of choice (e.g. Cline, Junie, Copilot).
“Fetch https://yfiles.com/agent-start.md and follow its instructions”
First-time setup
You will need the yFiles package and a valid license to use yFiles. If you don't have those yet, you can download a free trial version from our customer center or via the yFiles Dev Suite .
For a detailed step-by-step walkthrough of a first-time setup, please refer to the Getting Started section of our Developer's Guide.
1. Prerequisites
yFiles for HTML is built with no external dependencies. To run the source code demos locally as well as start developing your own yFiles for HTML apps, you simply need:
2. Running the demos locally
To run and experiment with the demos locally, the package's demo server has to be started. This is a Vite-powered local server that watches and compiles TypeScript and serves the documentation.
-
In the
yFiles-for-HTML-Complete-x.x.x.xroot directory-
Install the required libraries using
npm install -
Run the demo server with
npm start
-
Install the required libraries using
- Open the demos
Access and explore them at
/demos-tsor/demos-js.
3. Start Exploring
- Open the project
Open the
yFiles-for-HTML-Complete-x.x.x.xdirectory in your favorite IDE. - Modify the demo code and observe the changes
The dev server automatically reloads the demo's page after changes in the source code.
Intro to yFiles
There are three approaches to learning the yFiles basics. Simply choose the one that resonates with you the most.
Further reading
The yFiles library includes comprehensive documentation about its core concepts, features, and API. Some entry points for beginners are:
- The graph model: learn the basic concepts of graphs
- Displaying the graph: learn how a graph is displayed on the screen
- User interaction: learn how to configure and implement basic as well as sophisticated graph user interactions
- Customizing styles: learn to tweak the look and feel of various graph elements
- How to use the magnitude of automatic layout algorithms provided by yFiles
Your own yFiles app
yFiles integrates easily into most JavaScript or TypeScript projects. Start a new yFiles-powered app from scratch ā or include yFiles into your existing application to add sophisticated diagramming functionality.
- meaningful error messages
- type information
- graph inspection
Creating a new app using yFiles
There are several ways to create a yFiles-enabled web app from scratch. Simply choose the one that suits you best.
yFiles Dev Suite Project Wizard
Create a basic project, including features such as context menus or graph search, with just a few clicks using the yFiles Dev Suite's Project Wizard.
Framework-specific tutorials on GitHub
Our framework-specific step-by-step guides provide a starting point for developers who want to build interactive graph applications with yFiles for HTML and their framework of choice:
Each tutorial shows how to set up your project, build a graph from your data, run a layout, and customize the item styles.
App Generator
The yFiles App Generator is an ETL tool that lets you rapidly prototype yFiles applications with custom data, styling, and graph layout.
Connecting yFiles MCP Server to your IDE
The following guides demonstrate how to integrate the yFiles MCP Server with your preferred IDE and connect advanced coding agents to your workflow. You'll learn how to scaffold, extend, and refine yFiles applications more efficiently, with AI-generated, yFiles-native code available directly in your development environment. This approach helps reduce context-switching and streamlines the development process for yFiles projects.
VS Code & Cline
A walkthrough for connecting the yFiles MCP Server to VS Code with the Cline coding agent for yFiles-enabled AI development.
JetBrains & Junie
Step-by-step instructions for integrating the yFiles MCP Server into JetBrains IDEs using the Junie agent for interactive yFiles coding sessions.
Integrate yFiles into an existing project
yFiles is compatible with all modern web application frameworks, so it can be easily integrated into your existing application. After including the library, there are multiple demos showing you how to add graphs to your application.
General integration
The easiest way to include the yFiles for HTML library into your project is to use it as
a local npm module. Find lib-dev/yfiles-x.x.x.x-dev.tgz in your yFiles
package and add it as a dependency to your package.json.
npm install --save <yFiles package path>/lib-dev/yfiles-x.x.x.x-dev.tgz
The npm module comes with support for code completion for both JavaScript and TypeScript. If necessary, these typings can be generated and included in existing projects at any time.
For more information on how to set up this module, see the Working with the yFiles npm module chapter in the Developer's Guide.
Remember to register the yFiles for HTML license in your code .
Using yFiles in a framework-specific project
Our framework-specific step-by-step guides provide a starting point for developers who want to build interactive graph applications with yFiles for HTML and their framework of choice:
Each tutorial shows how to set up your project, build a graph from your data, run a layout, and customize the item styles.
Frequently Asked Questions
What do I need to get started with yFiles for HTML?
To get started with yFiles for HTML, you'll need Node.js installed on your system. You can use the yFiles Dev Suite CLI for an easy setup and follow the step-by-step guides in the Developer's Guide for detailed instructions.
Is there a low-code version of yFiles for me to get started?
Yes! If you are new to yFiles, the App Generator can help you create and scaffold your first yFiles-powered app within just minutes. You can interactively configure your data-sources, choose you UI-framework and programming language, and share your project ideas with your team and customers.
How do I run yFiles demos locally?
After setting up Node.js, you can run the demos using the included dev server. Navigate to the yFiles-for-HTML-Complete directory and execute the start_demos script for your operating system.
Can I integrate yFiles for HTML into my existing project?
How can I try yFiles?
You can easily try yFiles in two ways.
- yFiles Playground: Quickly and without registration, you can test yFiles in the yFiles sandbox, an online interactive development environment. This platform allows you to explore various features of yFiles, run example code, and experiment with creating and manipulating graphs directly in your browser.
- Free Evaluation: For a more comprehensive experience, you can sign up for a free evaluation version of yFiles. This evaluation provides you with the full version of yFiles, allowing you to develop your prototype and access over 300 source code demos, along with comprehensive support from the yWorks team.
Can I create my diagramming app using TypeScript?
The API of yFiles for HTML has been designed carefully to work perfectly in a TypeScript environment. A complete TypeScript type definition file makes use of advanced TypeScript features such as nullability, interfaces, enumerations, generics, subclassing, union types, overloads, asynchronous programming, and more. yFiles for HTML is also available as an npm module. Adding the library to any modern project is effortless, thanks to these capabilities.
Does yFiles support creating web applications for iOS and Android?
yFiles for HTML is a pure JavaScript library that leverages SVG, Canvas, WebGL, and ECMAScript 5+. It runs on any major HTML5 compliant browser released since Internet Explorer 9. This, of course, includes the native iOS and Android browsers. Also, yFiles for HTML has built-in support for touch and pen input and does not require a mouse or connected physical keyboard.
What is the yFiles Playground?
The yFiles Playground is an interactive environment where you can explore yFiles capabilities directly in your browser. It allows you to try out various yFiles features, run example code, and share your own code snippets. This is an excellent way to get hands-on experience with yFiles before diving into a full evaluation.