Skip to content

Commit d183034

Browse files
committed
yFiles for HTML 2.5.0.1 demos
1 parent f8fe6b9 commit d183034

File tree

80 files changed

+373
-249
lines changed

Some content is hidden

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

80 files changed

+373
-249
lines changed

demos/03-tutorial-application-features/markup-labels/SampleApplication.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ function createGraph(graph) {
160160
'<p><strong><code>&lt;u&gt;</code></strong>: <u>Underline text</u></p>\n' +
161161
'<p><strong><code>&lt;h1&gt;-&lt;h6&gt;</code></strong>: Heading 1-6</p>\n' +
162162
'<p><strong><code>&lt;p&gt;</code></strong>: A paragraph element.</p>\n' +
163-
'<p><strong><code>&lt;pre&gt;</code></strong>: A preformatted element which preserves newlines.</p>\n' +
164-
'<p><strong><code>&lt;code&gt;</code></strong>: A code element.</p>\n' +
163+
'<p><strong><code>&lt;pre&gt;</code></strong>:</p><pre>A preformatted element\n which preserves newlines and whitespaces.</pre>\n' +
164+
'<p><strong><code>&lt;code&gt;</code></strong>: <code>A code element</code></p>\n' +
165165
'<p><strong><code>&lt;small&gt;</code></strong>: <small>Small font-size</small></p>\n' +
166166
'<p><strong><code>&lt;large&gt;</code></strong>: <large>Large font-size</large></p>\n' +
167167
'<p><strong><code>&lt;[html color name]&gt;</code></strong>: Colored text, e.g. <blue>&lt;blue&gt;</blue></p>'

demos/03-tutorial-application-features/markup-labels/SampleApplication.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ function createGraph(graph: IGraph): void {
158158
'<p><strong><code>&lt;u&gt;</code></strong>: <u>Underline text</u></p>\n' +
159159
'<p><strong><code>&lt;h1&gt;-&lt;h6&gt;</code></strong>: Heading 1-6</p>\n' +
160160
'<p><strong><code>&lt;p&gt;</code></strong>: A paragraph element.</p>\n' +
161-
'<p><strong><code>&lt;pre&gt;</code></strong>: A preformatted element which preserves newlines.</p>\n' +
162-
'<p><strong><code>&lt;code&gt;</code></strong>: A code element.</p>\n' +
161+
'<p><strong><code>&lt;pre&gt;</code></strong>:</p><pre>A preformatted element\n which preserves newlines and whitespaces.</pre>\n' +
162+
'<p><strong><code>&lt;code&gt;</code></strong>: <code>A code element</code></p>\n' +
163163
'<p><strong><code>&lt;small&gt;</code></strong>: <small>Small font-size</small></p>\n' +
164164
'<p><strong><code>&lt;large&gt;</code></strong>: <large>Large font-size</large></p>\n' +
165165
'<p><strong><code>&lt;[html color name]&gt;</code></strong>: Colored text, e.g. <blue>&lt;blue&gt;</blue></p>'

demos/03-tutorial-application-features/webgl-rendering/WebGLRenderingDemo.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ import {
4444
Size,
4545
WebGL2FocusIndicatorManager,
4646
WebGL2GraphModelManager,
47-
WebGL2SelectionIndicatorManager
47+
WebGL2SelectionIndicatorManager,
48+
Workarounds
4849
} from 'yfiles'
4950

5051
import { bindAction, bindCommand, showApp } from '../../resources/demo-app.js'
@@ -101,6 +102,11 @@ function enableWebGLRendering(graphComponent) {
101102
graphComponent.graphModelManager = new WebGL2GraphModelManager()
102103
graphComponent.selectionIndicatorManager = new WebGL2SelectionIndicatorManager()
103104
graphComponent.focusIndicatorManager = new WebGL2FocusIndicatorManager()
105+
106+
// Optional: precompile the selection shaders
107+
// This has the effect that the selection is not rendered with a simple fallback style
108+
// the first time an element is selected, at the cost of initial load time
109+
Workarounds.precompileWebGLSelectionShaders = true
104110
}
105111

106112
/**

demos/03-tutorial-application-features/webgl-rendering/WebGLRenderingDemo.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ import {
4444
Size,
4545
WebGL2FocusIndicatorManager,
4646
WebGL2GraphModelManager,
47-
WebGL2SelectionIndicatorManager
47+
WebGL2SelectionIndicatorManager,
48+
Workarounds
4849
} from 'yfiles'
4950

5051
import { bindAction, bindCommand, showApp } from '../../resources/demo-app'
@@ -99,6 +100,11 @@ function enableWebGLRendering(graphComponent: GraphComponent) {
99100
graphComponent.graphModelManager = new WebGL2GraphModelManager()
100101
graphComponent.selectionIndicatorManager = new WebGL2SelectionIndicatorManager()
101102
graphComponent.focusIndicatorManager = new WebGL2FocusIndicatorManager()
103+
104+
// Optional: precompile the selection shaders
105+
// This has the effect that the selection is not rendered with a simple fallback style
106+
// the first time an element is selected, at the cost of initial load time
107+
Workarounds.precompileWebGLSelectionShaders = true
102108
}
103109

104110
/**

demos/04-tutorial-layout-features/compact-disk-groups/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The content of each group is arranged in a compact, circular way by [CompactDisk
1818

1919
### Code Snippet
2020

21-
You can copy the code snippet to configure the layout from [GitHub](https://github.com/yWorks/yfiles-for-html-demos/blob/master/demos/04-tutorial-layout-features/compact-disk/CompactDiskGroups.ts).
21+
You can copy the code snippet to configure the layout from [GitHub](https://github.com/yWorks/yfiles-for-html-demos/blob/master/demos/04-tutorial-layout-features/compact-disk-groups/CompactDiskGroups.ts).
2222

2323
### Documentation
2424

demos/04-tutorial-layout-features/compact-disk-groups/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ <h3>Code Snippet</h3>
7575
<p>
7676
You can copy the code snippet to configure the layout from
7777
<a
78-
href="https://github.com/yWorks/yfiles-for-html-demos/blob/master/demos/04-tutorial-layout-features/compact-disk/CompactDiskGroups.ts"
78+
href="https://github.com/yWorks/yfiles-for-html-demos/blob/master/demos/04-tutorial-layout-features/compact-disk-groups/CompactDiskGroups.ts"
7979
target="_blank"
8080
>GitHub</a
8181
>.

demos/README.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ <h2>Your browser does not support modern CSS</h2>
109109
<div class="content-wide">
110110
<div id="general-intro">
111111
<p class="first-paragraph">
112-
The <a href="https://www.yworks.com/products/yfiles-for-html">yFiles for HTML 2.5</a> demo applications are available in
112+
The <a href="https://www.yworks.com/products/yfiles-for-html">yFiles for HTML 2.5.0.1</a> demo applications are available in
113113
both JavaScript and TypeScript, with only a few exceptions.
114114
</p>
115115
<div class="js-only">

demos/analysis/graphanalysis/resources/substructures.graphml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
//
2929
////////////////////////////////////////////////////////////////////////-->
3030

31-
<!--Created by yFiles for HTML 2.5-->
31+
<!--Created by yFiles for HTML 2.5.0.1-->
3232
<graphml xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://www.yworks.com/xml/schema/graphml.html/2.0/ygraphml.xsd " xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:y="http://www.yworks.com/xml/yfiles-common/3.0" xmlns:x="http://www.yworks.com/xml/yfiles-common/markup/3.0" xmlns:yjs="http://www.yworks.com/xml/yfiles-for-html/2.0/xaml" xmlns:x0="http://www.yworks.com/yFilesHTML/demos/FlatDemoStyle/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
3333
<yjs:Stroke x:Key="8" fill="{y:GraphMLReference 9}"/>
3434
<graph id="G" edgedefault="directed">

demos/complete/bpmn/bpmn-view.js

Lines changed: 33 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10744,60 +10744,59 @@ export class EventPortStyle extends BaseClass(IPortStyle) {
1074410744
*/
1074510745
constructor() {
1074610746
super()
10747-
this._nodeStyle = new EventNodeStyle()
10748-
this._nodeStyle.characteristic = EventCharacteristic.BOUNDARY_INTERRUPTING
10749-
this._nodeStyle.type = EventType.COMPENSATION
10750-
const nodeStylePortStyleAdapter = new NodeStylePortStyleAdapter(this._nodeStyle)
10751-
nodeStylePortStyleAdapter.renderSize = BPMN_CONSTANTS_SIZES_EVENT_PORT
10752-
this._adapter = nodeStylePortStyleAdapter
10747+
const eventNodeStyle = new EventNodeStyle()
10748+
eventNodeStyle.characteristic = EventCharacteristic.BOUNDARY_INTERRUPTING
10749+
eventNodeStyle.type = EventType.COMPENSATION
10750+
this._nodeStyle = eventNodeStyle
10751+
this._renderSize = BPMN_CONSTANTS_SIZES_EVENT_PORT
1075310752
}
1075410753

1075510754
/**
1075610755
* Gets the event type for this style.
1075710756
* @type {number}
1075810757
*/
1075910758
get type() {
10760-
return this.eventNodeStyle.type
10759+
return this._nodeStyle.type
1076110760
}
1076210761

1076310762
/**
1076410763
* Sets the event type for this style.
1076510764
* @type {number}
1076610765
*/
1076710766
set type(value) {
10768-
this.eventNodeStyle.type = value
10767+
this._nodeStyle.type = value
1076910768
}
1077010769

1077110770
/**
1077210771
* Gets the event characteristic for this style.
1077310772
* @type {number}
1077410773
*/
1077510774
get characteristic() {
10776-
return this.eventNodeStyle.characteristic
10775+
return this._nodeStyle.characteristic
1077710776
}
1077810777

1077910778
/**
1078010779
* Sets the event characteristic for this style.
1078110780
* @type {number}
1078210781
*/
1078310782
set characteristic(value) {
10784-
this.eventNodeStyle.characteristic = value
10783+
this._nodeStyle.characteristic = value
1078510784
}
1078610785

1078710786
/**
1078810787
* Gets the size the port style is rendered with.
1078910788
* @type {!Size}
1079010789
*/
1079110790
get renderSize() {
10792-
return this._adapter.renderSize
10791+
return this._renderSize
1079310792
}
1079410793

1079510794
/**
1079610795
* Sets the size the port style is rendered with.
1079710796
* @type {!Size}
1079810797
*/
1079910798
set renderSize(value) {
10800-
this._adapter.renderSize = value
10799+
this._renderSize = value
1080110800
}
1080210801

1080310802
/**
@@ -10860,14 +10859,7 @@ export class EventPortStyle extends BaseClass(IPortStyle) {
1086010859
* @type {!EventNodeStyle}
1086110860
*/
1086210861
get eventNodeStyle() {
10863-
return this._adapter.nodeStyle
10864-
}
10865-
10866-
/**
10867-
* @type {!NodeStylePortStyleAdapter}
10868-
*/
10869-
get adapter() {
10870-
return this._adapter
10862+
return this._nodeStyle
1087110863
}
1087210864

1087310865
/**
@@ -10876,7 +10868,9 @@ export class EventPortStyle extends BaseClass(IPortStyle) {
1087610868
* @see Specified by {@link ICloneable.clone}.
1087710869
*/
1087810870
clone() {
10879-
return this.memberwiseClone()
10871+
const clone = this.memberwiseClone()
10872+
clone._nodeStyle = this._nodeStyle.clone()
10873+
return clone
1088010874
}
1088110875

1088210876
/**
@@ -10898,6 +10892,7 @@ class EventPortStyleRenderer extends BaseClass(IPortStyleRenderer, ILookup) {
1089810892
constructor() {
1089910893
super()
1090010894
this.fallbackLookup = null
10895+
this._adapter = new NodeStylePortStyleAdapter()
1090110896
}
1090210897

1090310898
/**
@@ -10914,7 +10909,7 @@ class EventPortStyleRenderer extends BaseClass(IPortStyleRenderer, ILookup) {
1091410909
* @see Specified by {@link IPortStyleRenderer.getVisualCreator}.
1091510910
*/
1091610911
getVisualCreator(port, style) {
10917-
const adapter = style.adapter
10912+
const adapter = this.getConfiguredAdapter(style)
1091810913
return adapter.renderer.getVisualCreator(port, adapter)
1091910914
}
1092010915

@@ -10930,7 +10925,7 @@ class EventPortStyleRenderer extends BaseClass(IPortStyleRenderer, ILookup) {
1093010925
* @see Specified by {@link IPortStyleRenderer.getBoundsProvider}.
1093110926
*/
1093210927
getBoundsProvider(port, style) {
10933-
const adapter = style.adapter
10928+
const adapter = this.getConfiguredAdapter(style)
1093410929
return adapter.renderer.getBoundsProvider(port, adapter)
1093510930
}
1093610931

@@ -10946,7 +10941,7 @@ class EventPortStyleRenderer extends BaseClass(IPortStyleRenderer, ILookup) {
1094610941
* @see Specified by {@link IPortStyleRenderer.getVisibilityTestable}.
1094710942
*/
1094810943
getVisibilityTestable(port, style) {
10949-
const adapter = style.adapter
10944+
const adapter = this.getConfiguredAdapter(style)
1095010945
return adapter.renderer.getVisibilityTestable(port, adapter)
1095110946
}
1095210947

@@ -10963,7 +10958,7 @@ class EventPortStyleRenderer extends BaseClass(IPortStyleRenderer, ILookup) {
1096310958
* @see Specified by {@link IPortStyleRenderer.getHitTestable}.
1096410959
*/
1096510960
getHitTestable(port, style) {
10966-
const adapter = style.adapter
10961+
const adapter = this.getConfiguredAdapter(style)
1096710962
return adapter.renderer.getHitTestable(port, adapter)
1096810963
}
1096910964

@@ -10979,7 +10974,7 @@ class EventPortStyleRenderer extends BaseClass(IPortStyleRenderer, ILookup) {
1097910974
* @see Specified by {@link IPortStyleRenderer.getMarqueeTestable}.
1098010975
*/
1098110976
getMarqueeTestable(port, style) {
10982-
const adapter = style.adapter
10977+
const adapter = this.getConfiguredAdapter(style)
1098310978
return adapter.renderer.getMarqueeTestable(port, adapter)
1098410979
}
1098510980

@@ -10994,7 +10989,7 @@ class EventPortStyleRenderer extends BaseClass(IPortStyleRenderer, ILookup) {
1099410989
* @see Specified by {@link IPortStyleRenderer.getContext}.
1099510990
*/
1099610991
getContext(port, style) {
10997-
const adapter = style.adapter
10992+
const adapter = this.getConfiguredAdapter(style)
1099810993
this.fallbackLookup = adapter.renderer.getContext(port, adapter)
1099910994
return this
1100010995
}
@@ -11021,6 +11016,17 @@ class EventPortStyleRenderer extends BaseClass(IPortStyleRenderer, ILookup) {
1102111016
return this.fallbackLookup ? this.fallbackLookup.lookup(type) : null
1102211017
}
1102311018

11019+
/**
11020+
* @param {!EventPortStyle} style
11021+
* @returns {!IPortStyle}
11022+
*/
11023+
getConfiguredAdapter(style) {
11024+
const adapter = this._adapter
11025+
adapter.nodeStyle = style.eventNodeStyle
11026+
adapter.renderSize = style.renderSize
11027+
return adapter
11028+
}
11029+
1102411030
/**
1102511031
* @type {!EventPortStyleRenderer}
1102611032
*/

0 commit comments

Comments
 (0)