Skip to content

Commit f8fe6b9

Browse files
committed
yFiles for HTML 2.5 demos
1 parent 10891fc commit f8fe6b9

File tree

2,842 files changed

+101719
-540809
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,842 files changed

+101719
-540809
lines changed

demos/.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
**/dist/
33
**/node_modules/
44
/03-tutorial-application-features/webgl-rendering/resources/*.json
5+
/complete/tree-of-life/resources/TreeOfLifeData.json
56
/internal/webgl-performance-tests/resources/*.json
7+
/resources/style/demo.css
68
/starter-kits/**
79
/view/large-graphs/resources/*.json
810
/view/rendering-optimizations/resources/*.json

demos/01-tutorial-getting-started/01-graphcomponent/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Getting Started Tutorial - Step 1
1010

1111
How to create a basic view.
1212

13-
This step introduces class [GraphComponent](https://docs.yworks.com/yfileshtml/#/api/GraphComponent), which is the central UI element for working with graphs. The application does not provide any interactive features except mouse wheel zooming, which is enabled by default. It is merely meant as a very basic example of how to display a GraphComponent within a web page.
13+
This step introduces class [GraphComponent](https://docs.yworks.com/yfileshtml/#/api/GraphComponent), which is the [central UI element for working with graphs](https://docs.yworks.com/yfileshtml/#/dguide/getting_started-application). The application does not provide any interactive features except mouse wheel zooming, which is enabled by default. It is merely meant as a very basic example of how to display a GraphComponent within a web page.
1414

1515
See the sources for details.
1616

demos/01-tutorial-getting-started/01-graphcomponent/SampleApplication.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/****************************************************************************
22
** @license
3-
** This demo file is part of yFiles for HTML 2.4.
3+
** This demo file is part of yFiles for HTML 2.5.
44
** Copyright (c) 2000-2022 by yWorks GmbH, Vor dem Kreuzberg 28,
55
** 72070 Tuebingen, Germany. All rights reserved.
66
**
@@ -28,15 +28,15 @@
2828
***************************************************************************/
2929
import { ExteriorLabelModel, GraphComponent, License } from 'yfiles'
3030

31-
import loadJson from '../../resources/load-json.js'
31+
import { fetchLicense } from '../../resources/fetch-license.js'
3232

3333
import { enableWorkarounds } from '../../utils/Workarounds.js'
3434

3535
/**
36-
* @param {!object} licenseData
36+
* @returns {!Promise}
3737
*/
38-
function run(licenseData) {
39-
License.value = licenseData
38+
async function run() {
39+
License.value = await fetchLicense()
4040

4141
const graphComponent = new GraphComponent('#graphComponent')
4242
// create one simple node as an example
@@ -48,4 +48,5 @@ function run(licenseData) {
4848
}
4949

5050
enableWorkarounds()
51-
loadJson().then(run)
51+
// noinspection JSIgnoredPromiseFromCall
52+
run()

demos/01-tutorial-getting-started/01-graphcomponent/SampleApplication.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/****************************************************************************
22
** @license
3-
** This demo file is part of yFiles for HTML 2.4.
3+
** This demo file is part of yFiles for HTML 2.5.
44
** Copyright (c) 2000-2022 by yWorks GmbH, Vor dem Kreuzberg 28,
55
** 72070 Tuebingen, Germany. All rights reserved.
66
**
@@ -28,12 +28,12 @@
2828
***************************************************************************/
2929
import { ExteriorLabelModel, GraphComponent, License } from 'yfiles'
3030

31-
import loadJson from '../../resources/load-json'
31+
import { fetchLicense } from '../../resources/fetch-license'
3232

3333
import { enableWorkarounds } from '../../utils/Workarounds'
3434

35-
function run(licenseData: object): void {
36-
License.value = licenseData
35+
async function run(): Promise<void> {
36+
License.value = await fetchLicense()
3737

3838
const graphComponent = new GraphComponent('#graphComponent')
3939
// create one simple node as an example
@@ -45,4 +45,5 @@ function run(licenseData: object): void {
4545
}
4646

4747
enableWorkarounds()
48-
loadJson().then(run)
48+
// noinspection JSIgnoredPromiseFromCall
49+
run()

demos/01-tutorial-getting-started/01-graphcomponent/index.html

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
<!-- ////////////////////////////////////////////////////////////////////////
1212
// @license
13-
// This demo file is part of yFiles for HTML 2.4.
13+
// This demo file is part of yFiles for HTML 2.5.
1414
// Copyright (c) 2000-2022 by yWorks GmbH, Vor dem Kreuzberg 28,
1515
// 72070 Tuebingen, Germany. All rights reserved.
1616
//
@@ -81,9 +81,7 @@ <h1>Creating the View</h1>
8181

8282
<p>
8383
This step introduces class <a href="https://docs.yworks.com/yfileshtml/#/api/GraphComponent" target="_blank">GraphComponent</a>, which is the
84-
<dguide section="getting_started-application"
85-
>central UI element for working with graphs</dguide
86-
>. The application does not provide any interactive features except mouse wheel zooming,
84+
<a href="https://docs.yworks.com/yfileshtml/#/dguide/getting_started-application" target="_blank">central UI element for working with graphs</a>. The application does not provide any interactive features except mouse wheel zooming,
8785
which is enabled by default. It is merely meant as a very basic example of how to display a
8886
GraphComponent within a web page.
8987
</p>

demos/01-tutorial-getting-started/02-graph-element-creation/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ Getting Started Tutorial - Step 2
1010

1111
How to create a graph programmatically.
1212

13-
This step shows how to create the basic graph elements.
13+
This step shows how to [create the basic graph elements](https://docs.yworks.com/yfileshtml/#/dguide/getting_started-creating_graph_elements).
1414

1515
See the sources for details.

demos/01-tutorial-getting-started/02-graph-element-creation/SampleApplication.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/****************************************************************************
22
** @license
3-
** This demo file is part of yFiles for HTML 2.4.
3+
** This demo file is part of yFiles for HTML 2.5.
44
** Copyright (c) 2000-2022 by yWorks GmbH, Vor dem Kreuzberg 28,
55
** 72070 Tuebingen, Germany. All rights reserved.
66
**
@@ -27,17 +27,17 @@
2727
**
2828
***************************************************************************/
2929
import { FreeNodePortLocationModel, GraphComponent, License, Point, Rect } from 'yfiles'
30-
import { checkLicense, showApp } from '../../resources/demo-app.js'
31-
import loadJson from '../../resources/load-json.js'
30+
import { showApp } from '../../resources/demo-app.js'
31+
import { fetchLicense } from '../../resources/fetch-license.js'
3232

3333
/** @type {GraphComponent} */
3434
let graphComponent = null
3535

3636
/**
37-
* @param {!object} licenseData
37+
* @returns {!Promise}
3838
*/
39-
function run(licenseData) {
40-
License.value = licenseData
39+
async function run() {
40+
License.value = await fetchLicense()
4141
// Initialize the GraphComponent and place it in the div with CSS selector #graphComponent
4242
graphComponent = new GraphComponent('#graphComponent')
4343

@@ -120,5 +120,5 @@ function populateGraph() {
120120

121121
// ////////////////////////////////////////////////////
122122

123-
// start tutorial
124-
loadJson().then(checkLicense).then(run)
123+
// noinspection JSIgnoredPromiseFromCall
124+
run()

demos/01-tutorial-getting-started/02-graph-element-creation/SampleApplication.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/****************************************************************************
22
** @license
3-
** This demo file is part of yFiles for HTML 2.4.
3+
** This demo file is part of yFiles for HTML 2.5.
44
** Copyright (c) 2000-2022 by yWorks GmbH, Vor dem Kreuzberg 28,
55
** 72070 Tuebingen, Germany. All rights reserved.
66
**
@@ -27,14 +27,14 @@
2727
**
2828
***************************************************************************/
2929
import { FreeNodePortLocationModel, GraphComponent, License, Point, Rect } from 'yfiles'
30-
import { checkLicense, showApp } from '../../resources/demo-app'
31-
import loadJson from '../../resources/load-json'
30+
import { showApp } from '../../resources/demo-app'
31+
import { fetchLicense } from '../../resources/fetch-license'
3232

3333
// @ts-ignore
3434
let graphComponent: GraphComponent = null
3535

36-
function run(licenseData: object): void {
37-
License.value = licenseData
36+
async function run(): Promise<void> {
37+
License.value = await fetchLicense()
3838
// Initialize the GraphComponent and place it in the div with CSS selector #graphComponent
3939
graphComponent = new GraphComponent('#graphComponent')
4040

@@ -117,5 +117,5 @@ function populateGraph(): void {
117117

118118
// ////////////////////////////////////////////////////
119119

120-
// start tutorial
121-
loadJson().then(checkLicense).then(run)
120+
// noinspection JSIgnoredPromiseFromCall
121+
run()

demos/01-tutorial-getting-started/02-graph-element-creation/index.html

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<!-- ////////////////////////////////////////////////////////////////////////
99
// @license
10-
// This demo file is part of yFiles for HTML 2.4.
10+
// This demo file is part of yFiles for HTML 2.5.
1111
// Copyright (c) 2000-2022 by yWorks GmbH, Vor dem Kreuzberg 28,
1212
// 72070 Tuebingen, Germany. All rights reserved.
1313
//
@@ -41,9 +41,6 @@
4141
<script src="../../resources/filesystem-warning.js"></script>
4242
</head>
4343
<body class="demo-has-left">
44-
<!--
45-
The sidebar for the overview and description text
46-
-->
4744
<aside class="demo-sidebar demo-left">
4845
<div class="demo-sidebar-header">
4946
<a href="https://www.yworks.com/products/yfiles" class="demo-left-logo"></a>
@@ -57,9 +54,7 @@ <h1>Creating Graph Elements</h1>
5754

5855
<p>
5956
This step shows how to
60-
<dguide section="getting_started-creating_graph_elements"
61-
>create the basic graph elements</dguide
62-
>.
57+
<a href="https://docs.yworks.com/yfileshtml/#/dguide/getting_started-creating_graph_elements" target="_blank">create the basic graph elements</a>.
6358
</p>
6459

6560
<p>See the sources for details.</p>

demos/01-tutorial-getting-started/03-managing-viewport/SampleApplication.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/****************************************************************************
22
** @license
3-
** This demo file is part of yFiles for HTML 2.4.
3+
** This demo file is part of yFiles for HTML 2.5.
44
** Copyright (c) 2000-2022 by yWorks GmbH, Vor dem Kreuzberg 28,
55
** 72070 Tuebingen, Germany. All rights reserved.
66
**
@@ -37,17 +37,17 @@ import {
3737
Rect
3838
} from 'yfiles'
3939

40-
import { bindCommand, checkLicense, showApp } from '../../resources/demo-app.js'
41-
import loadJson from '../../resources/load-json.js'
40+
import { bindCommand, showApp } from '../../resources/demo-app.js'
41+
import { fetchLicense } from '../../resources/fetch-license.js'
4242

4343
/** @type {GraphComponent} */
4444
let graphComponent = null
4545

4646
/**
47-
* @param {!object} licenseData
47+
* @returns {!Promise}
4848
*/
49-
function run(licenseData) {
50-
License.value = licenseData
49+
async function run() {
50+
License.value = await fetchLicense()
5151
// Initialize the GraphComponent and place it in the div with CSS selector #graphComponent
5252
graphComponent = new GraphComponent('#graphComponent')
5353

@@ -141,8 +141,8 @@ function populateGraph() {
141141
/**
142142
* Updates the content rectangle to encompass all existing graph elements.
143143
* If you create your graph elements programmatically, the content rectangle
144-
* (i.e. the rectangle in <b>world coordinates</b>
145-
* that encloses the graph) is <b>not</b> updated automatically to enclose these elements.
144+
* (i.e. the rectangle in __world coordinates__
145+
* that encloses the graph) is __not__ updated automatically to enclose these elements.
146146
* Typically, this manifests in wrong/missing scrollbars, incorrect {@link GraphOverviewComponent}
147147
* behavior and the like.
148148
*
@@ -154,7 +154,7 @@ function populateGraph() {
154154
*
155155
* Uncomment various combinations of lines in this method and observe the different effects.
156156
*
157-
* The following demos in this tutorial will assume that you've called <code>GraphComponent.fitGraphBounds()</code>
157+
* The following demos in this tutorial will assume that you've called {@link GraphComponent.fitGraphBounds}
158158
* in this method.
159159
*/
160160
function updateViewport() {
@@ -187,5 +187,5 @@ function registerCommands() {
187187
bindCommand("button[data-command='ZoomOriginal']", ICommand.ZOOM, graphComponent, 1.0)
188188
}
189189

190-
// start tutorial
191-
loadJson().then(checkLicense).then(run)
190+
// noinspection JSIgnoredPromiseFromCall
191+
run()

demos/01-tutorial-getting-started/03-managing-viewport/SampleApplication.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/****************************************************************************
22
** @license
3-
** This demo file is part of yFiles for HTML 2.4.
3+
** This demo file is part of yFiles for HTML 2.5.
44
** Copyright (c) 2000-2022 by yWorks GmbH, Vor dem Kreuzberg 28,
55
** 72070 Tuebingen, Germany. All rights reserved.
66
**
@@ -37,14 +37,14 @@ import {
3737
Rect
3838
} from 'yfiles'
3939

40-
import { bindCommand, checkLicense, showApp } from '../../resources/demo-app'
41-
import loadJson from '../../resources/load-json'
40+
import { bindCommand, showApp } from '../../resources/demo-app'
41+
import { fetchLicense } from '../../resources/fetch-license'
4242

4343
// @ts-ignore
4444
let graphComponent: GraphComponent = null
4545

46-
function run(licenseData: object): void {
47-
License.value = licenseData
46+
async function run(): Promise<void> {
47+
License.value = await fetchLicense()
4848
// Initialize the GraphComponent and place it in the div with CSS selector #graphComponent
4949
graphComponent = new GraphComponent('#graphComponent')
5050

@@ -138,8 +138,8 @@ function populateGraph(): void {
138138
/**
139139
* Updates the content rectangle to encompass all existing graph elements.
140140
* If you create your graph elements programmatically, the content rectangle
141-
* (i.e. the rectangle in <b>world coordinates</b>
142-
* that encloses the graph) is <b>not</b> updated automatically to enclose these elements.
141+
* (i.e. the rectangle in __world coordinates__
142+
* that encloses the graph) is __not__ updated automatically to enclose these elements.
143143
* Typically, this manifests in wrong/missing scrollbars, incorrect {@link GraphOverviewComponent}
144144
* behavior and the like.
145145
*
@@ -151,7 +151,7 @@ function populateGraph(): void {
151151
*
152152
* Uncomment various combinations of lines in this method and observe the different effects.
153153
*
154-
* The following demos in this tutorial will assume that you've called <code>GraphComponent.fitGraphBounds()</code>
154+
* The following demos in this tutorial will assume that you've called {@link GraphComponent.fitGraphBounds}
155155
* in this method.
156156
*/
157157
function updateViewport(): void {
@@ -184,5 +184,5 @@ function registerCommands(): void {
184184
bindCommand("button[data-command='ZoomOriginal']", ICommand.ZOOM, graphComponent, 1.0)
185185
}
186186

187-
// start tutorial
188-
loadJson().then(checkLicense).then(run)
187+
// noinspection JSIgnoredPromiseFromCall
188+
run()

demos/01-tutorial-getting-started/03-managing-viewport/index.html

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<!-- ////////////////////////////////////////////////////////////////////////
99
// @license
10-
// This demo file is part of yFiles for HTML 2.4.
10+
// This demo file is part of yFiles for HTML 2.5.
1111
// Copyright (c) 2000-2022 by yWorks GmbH, Vor dem Kreuzberg 28,
1212
// 72070 Tuebingen, Germany. All rights reserved.
1313
//
@@ -41,9 +41,6 @@
4141
<script src="../../resources/filesystem-warning.js"></script>
4242
</head>
4343
<body class="demo-has-left">
44-
<!--
45-
The sidebar for the overview and description text
46-
-->
4744
<aside class="demo-sidebar demo-left">
4845
<div class="demo-sidebar-header">
4946
<a href="https://www.yworks.com/products/yfiles" class="demo-left-logo"></a>

demos/01-tutorial-getting-started/04-setting-styles/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Getting Started Tutorial - Step 4
1010

1111
How to influence visual appearance.
1212

13-
This step shows how to configure the visual appearance of graph elements using styles.
13+
This step shows how to [configure the visual appearance of graph elements](https://docs.yworks.com/yfileshtml/#/dguide/getting_started-setting_styles) using styles.
1414

1515
yFiles for HTML offers a set of predefined and configurable item styles for various use-cases. The tutorial [02 Custom Styles](../../README.html#tutorial-custom-styles) shows in detail how to create a custom style from scratch.
1616

0 commit comments

Comments
 (0)