Getting started with yFiles for HTML (2024)

First-time setupLearn about the prerequisites, running the demos, and how to get started if this is your first time developing with yFiles.5 to 10 minutes
Intro to yFilesLearn yFiles basics and find good entry points to start working on your project.
Your own yFiles appCreate your own yFiles project from scratch, or learn how to integrate yFiles into your existing project.

The easy way to start using yFiles - yFiles Dev Suite

The yFiles Dev Suite combines everything you need to get started with yFiles for HTML. Set up the SDK, learn the basics, and build your first graph apps.Simply run it from your terminal!

Requires a recent version of Node.js

First-time setup

The Getting Started section of the Developer's Guide explains the following steps in detail.
Of course, you need a yFiles package and a valid license to use yFiles. If you don't have one yet, you can download a free trial version from our customer center or via the yFiles Dev Suite.

Prerequisites

The demos need an installed Node.js to run properly.

Install Nodes.js 16 or newer

https://nodejs.org/

Getting started with yFiles for HTML (1)

load from Vimeo

Running the demos locally

The best way to run the demos locally is with the included dev server.

Run the start_demos script in the yFiles-for-HTML-Complete-2.6.0.4 directory:

start_demos.cmd (Windows)

start_demos.sh (Linux)

start_demos.command (MacOS)

Open the demos

You can explore them at /demos-ts or /demos-js.

Working with yFiles

Install an IDE

We recommend WebStorm (30 days free). You can also use Visual Studio Code as a free alternative.

Open the project

Open the yFiles-for-HTML-Complete-2.6.0.4 directory as project in your IDE.

WebStorm will automatically start the dev server in the background. So you don'thave to start the server manually each time.

Modify the demo code and observe 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. You can choose any of them, according to your personal preference.

Work through the interactive beginners tutorial

If you prefer to learn by exploring and experimenting, check out the yFiles Basic Features tutorial included in the package. It can be found relative to the package root, in the following directories:

Getting started with yFiles for HTML (2)/demos-ts/tutorial-yfiles-basic-features

Getting started with yFiles for HTML (3)/demos-js/tutorial-yfiles-basic-features

As a prerequisite for this tutorial, you need to have opened the packages' project in an IDE, as described before in First-time setup.

Open tutorial

Read and work through the written tutorial

The written tutorial takes you through the basic concepts of working with yFiles in a step-by-step manner. Links to detailed documentation are provided throughout this tutorial.

As a prerequisite for this tutorial, you need to have opened the packages' project in an IDE, as described before in First-time setup.

Open tutorial

Watch introductory videos

The yWorks YouTube channel provides several helpful videos introducing the most important steps and concepts. Start your journey to becoming a proficient yFiles developer.

Next steps

Experiment with demos

The yFiles package contains over 250 demos presenting the various features of the library and how to use them in your own code. We invite you to open the various demos in the IDE and experiment with them.

Getting started with yFiles for HTML (4)/demos-ts

Getting started with yFiles for HTML (5)/demos-js

Work through the interactive advanced tutorials

In addition to the introductory tutorial, you'll find tutorials that deal with specific topics:

Using the GraphBuilder class

Implementing a custom style for nodes

Implementing a custom style for edges

Implementing a custom style for labels

Implementing a custom style for ports

Further reading

The yFiles library includes comprehensive documentation about its concepts, features and API. Some entry points for beginners are:

The graph model: learn the very 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 user interactions with the graph

Customizing styles: learn to tweak the look and feel of the various graph elements

How to use the various 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.

Learn about the Development Mode to improve your development process:

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. Choose the one that suits you best.

yFiles Dev Suite project wizard

Create a basic project with just a few clicks in the yFiles Dev Suite. Automatically add application features like a context menu or a graph search. (powered by App Generator)

Getting started with yFiles for HTML (6)

load from Vimeo

Templates on GitHub

Our template apps for Vue.js, React and Angular provide a starting point for development.

Getting started with yFiles for HTML (7)

load from Vimeo

App Generator

The yFiles App Generator is an ETL tool that lets you rapidly prototype yFiles applications with custom data, styling, and graph layout.

Open App Generator

Getting started with yFiles for HTML (8)

load from Vimeo

Manual setup

Create your app manually in JavaScript or TypeScript.

Open instructions

Getting started with yFiles for HTML (9)

load from Vimeo

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 show 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/es-modules/yfiles-26.0.4-dev.tgz in your yFiles package and add it as a dependency to your package.json.

>npm install --save <yFiles package path>/lib-dev/es-modules/yfiles-26.0.4-dev.tgz

The npm module comes with support of 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.

Before you can start developing, register the yFiles for HTML license.

Using yFiles in a framework-specific project

Each framework comes with special requirements. We provide specific advice for most common toolkits.

Several demos showcase yFiles integration with different frameworks:

React Demo

Vue.js Demo

Angular CLI Demo

Getting started with yFiles for HTML (10)

Test and experience
yFiles free of charge!

Fully-functional yFiles version

Free access to our high-quality support, to help you start easily

More than 100 source-code examples for rapid prototyping

Extensive step-by-step source-code tutorials that cover the essentials

Free resources like our Developer’s Guide, documentation, IDE setup tips, and more

Try now

Why, how, what? —

Just ask the diagramming experts!

Getting started with yFiles for HTML (11)

Our team is happy to advise you – no strings attached. Let's talk about your project and find the perfect solution for your needs!

E-mail: hello@yworks.com

The data you enter will only be used to contact you regarding your request.
Learn more in our privacy policy.

Getting started with yFiles for HTML (2024)
Top Articles
Latest Posts
Article information

Author: Frankie Dare

Last Updated:

Views: 6311

Rating: 4.2 / 5 (53 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Frankie Dare

Birthday: 2000-01-27

Address: Suite 313 45115 Caridad Freeway, Port Barabaraville, MS 66713

Phone: +3769542039359

Job: Sales Manager

Hobby: Baton twirling, Stand-up comedy, Leather crafting, Rugby, tabletop games, Jigsaw puzzles, Air sports

Introduction: My name is Frankie Dare, I am a funny, beautiful, proud, fair, pleasant, cheerful, enthusiastic person who loves writing and wants to share my knowledge and understanding with you.