Skip to content

Commit 0f250e1

Browse files
committed
yFiles for HTML 2.5.0.4 demos
1 parent 50ae3b6 commit 0f250e1

File tree

38 files changed

+98
-98
lines changed

38 files changed

+98
-98
lines changed

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.0.3</a> demo applications are available in
112+
The <a href="https://www.yworks.com/products/yfiles-for-html">yFiles for HTML 2.5.0.4</a> demo applications are available in
113113
both JavaScript and TypeScript, with only a few exceptions.
114114
</p>
115115
<div class="js-only">

demos/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ This folder and its subfolders contain demo applications which illustrate the di
261261
<img src="resources/image/nodejs.png" alt="Node.js screenshot" width="128" height="96" /> | [Node.js](loading/nodejs) | Shows how to run a yFiles layout algorithm in a <a href='https://nodejs.org/' target='_blank'>Node.js&reg;</a> environment.
262262
<img src="resources/image/amdloading.png" alt="AMD Loading screenshot" width="128" height="96" /> | [AMD Loading](loading/amdloading) | Loads the yFiles library modules with the AMD loading standard (require.js).
263263
<img src="resources/image/esmodules.png" alt="ES Module Loading screenshot" width="128" height="96" /> | [ES Module Loading](loading/esmodules) | Loads the yFiles module resources using ES module imports.
264-
<img src="resources/image/browserify.png" alt="Browserify screenshot" width="128" height="96" /> | [Browserify](loading/browserify/README.html) | Shows how to bundle the yFiles library in a <a href="http://browserify.org" target="_blank">Browserify</a> project.
264+
<img src="resources/image/browserify.png" alt="Browserify screenshot" width="128" height="96" /> | [Browserify](loading/browserify/README.html) | Shows how to bundle the yFiles library in a <a href="https://browserify.org" target="_blank">Browserify</a> project.
265265
<img src="resources/image/rollupjs.png" alt="Rollup.js screenshot" width="128" height="96" /> | [Rollup.js](loading/rollupjs/README.html) | Shows how to bundle the yFiles library in a <a href="https://rollupjs.org" target="_blank">rollup</a> project.
266266
<img src="resources/image/scriptloading.png" alt="Script Loading screenshot" width="128" height="96" /> | [Script Loading](loading/scriptloading) | Loads the yFiles modules using plain old &lt;script&gt; tags.
267267
<img src="resources/image/webworker.png" alt="Web Worker Webpack screenshot" width="128" height="96" /> | [Web Worker Webpack](loading/webworker-webpack/README.html) | Shows how to run a yFiles layout algorithm in a Web Worker task using Webpack.

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.0.3-->
31+
<!--Created by yFiles for HTML 2.5.0.4-->
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/demo-server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "demo-server-for-yfiles-for-html",
3-
"version": "25.0.3",
3+
"version": "25.0.4",
44
"description": "A Node.js Express server for the yFiles for HTML demos and tutorials.",
55
"author": "yWorks GmbH <yfileshtml@yworks.com>",
66
"license": "https://www.yworks.com/products/yfiles-for-html/sla",

demos/input/button-input-mode/ButtonInputMode.js

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -281,20 +281,19 @@ export class ButtonInputMode extends InputModeBase {
281281
* @type {!ILabelStyle}
282282
*/
283283
get focusedButtonStyle() {
284-
return (this.buttonLabelManager?.descriptor).focusedButtonStyle
284+
return this.buttonLabelManager.descriptor.focusedButtonStyle
285285
}
286286

287287
/**
288288
* @type {!ILabelStyle}
289289
*/
290290
set focusedButtonStyle(style) {
291-
;(this.buttonLabelManager?.descriptor).focusedButtonStyle = style
291+
this.buttonLabelManager.descriptor.focusedButtonStyle = style
292292
}
293293

294294
constructor() {
295295
super()
296296
this.buttons = null
297-
this.buttonLabelManager = null
298297
this.queryButtonsListener = null
299298
this.itemRemovedListener = this.onItemRemoved.bind(this)
300299
this.onMouseMoveListener = this.onMouseMove.bind(this)
@@ -327,22 +326,23 @@ export class ButtonInputMode extends InputModeBase {
327326
this.clearPending = false
328327
this.priority = 0
329328
this.exclusive = true
330-
this.createButtonLabelCollectionModel()
329+
this.buttonLabelManager = this.createButtonLabelCollectionModel()
331330
this._cursor = Cursor.POINTER
332331
this.tooltipMode.duration = TimeSpan.fromSeconds(5)
333332
}
334333

335334
createButtonLabelCollectionModel() {
336-
this.buttonLabelManager = new CollectionModelManager(Button.$class)
337-
this.buttonLabelManager.descriptor = new ButtonDescriptor()
338-
this.buttonLabelManager.model = new ObservableCollection()
335+
const buttonLabelManager = new CollectionModelManager(Button.$class)
336+
buttonLabelManager.descriptor = new ButtonDescriptor()
337+
buttonLabelManager.model = new ObservableCollection()
338+
return buttonLabelManager
339339
}
340340

341341
/**
342342
* @type {!ObservableCollection.<Button>}
343343
*/
344344
get buttonLabels() {
345-
return this.buttonLabelManager?.model
345+
return this.buttonLabelManager.model
346346
}
347347

348348
/**
@@ -678,7 +678,7 @@ export class ButtonInputMode extends InputModeBase {
678678
* @param {!Point} location
679679
*/
680680
updateHoveredItem(location) {
681-
const hitItem = this.getHitItem(this.inputModeContext?.canvasComponent, location)
681+
const hitItem = this.getHitItem(location)
682682
if (hitItem != this.hoveredOwner) {
683683
// hovered model item has changed
684684
if (hitItem) {
@@ -726,10 +726,10 @@ export class ButtonInputMode extends InputModeBase {
726726
* @type {?Button}
727727
*/
728728
set focusedButton(focusedButton) {
729-
;(this.buttonLabelManager?.descriptor).focusedButton = focusedButton
729+
this.buttonLabelManager.descriptor.focusedButton = focusedButton
730730
this._focusedButton = focusedButton
731731
if (focusedButton) {
732-
this.buttonLabelManager?.update(focusedButton)
732+
this.buttonLabelManager.update(focusedButton)
733733
}
734734
this.inputModeContext?.canvasComponent?.invalidate()
735735
}
@@ -755,7 +755,7 @@ export class ButtonInputMode extends InputModeBase {
755755
this.triggerAction(hitButton)
756756
}
757757
} else if (rightClick && this.buttonTrigger === ButtonTrigger.RIGHT_CLICK) {
758-
const hitItem = this.getHitItem(sender, evt.location)
758+
const hitItem = this.getHitItem(evt.location)
759759
if (hitItem && hitItem != this.buttonOwner) {
760760
this.showButtons(hitItem)
761761
} else {
@@ -822,10 +822,9 @@ export class ButtonInputMode extends InputModeBase {
822822
}
823823

824824
/**
825-
* @param {!GraphComponent} graphComponent
826825
* @param {!Point} location
827826
*/
828-
getHitItem(graphComponent, location) {
827+
getHitItem(location) {
829828
const context = this.inputModeContext
830829
const hitTester = context.lookup(IHitTester.$class)
831830
let hitItem = hitTester

demos/input/button-input-mode/ButtonInputMode.ts

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ export enum ButtonTrigger {
160160
*/
161161
export class ButtonInputMode extends InputModeBase {
162162
private buttons: Button[] | null = null
163-
private buttonLabelManager: CollectionModelManager<Button> | null = null
163+
private buttonLabelManager: CollectionModelManager<Button>
164164
private queryButtonsListener: QueryButtonsListener | null = null
165165
private itemRemovedListener = this.onItemRemoved.bind(this)
166166
private onMouseMoveListener = this.onMouseMove.bind(this)
@@ -295,30 +295,31 @@ export class ButtonInputMode extends InputModeBase {
295295
* Using the {@link Key.TAB} the focus can be moved to the next button.
296296
*/
297297
get focusedButtonStyle(): ILabelStyle {
298-
return (this.buttonLabelManager?.descriptor as ButtonDescriptor).focusedButtonStyle
298+
return (this.buttonLabelManager.descriptor as ButtonDescriptor).focusedButtonStyle
299299
}
300300

301301
set focusedButtonStyle(style: ILabelStyle) {
302-
;(this.buttonLabelManager?.descriptor as ButtonDescriptor).focusedButtonStyle = style
302+
;(this.buttonLabelManager.descriptor as ButtonDescriptor).focusedButtonStyle = style
303303
}
304304

305305
constructor() {
306306
super()
307307
this.priority = 0
308308
this.exclusive = true
309-
this.createButtonLabelCollectionModel()
309+
this.buttonLabelManager = this.createButtonLabelCollectionModel()
310310
this._cursor = Cursor.POINTER
311311
this.tooltipMode.duration = TimeSpan.fromSeconds(5)
312312
}
313313

314314
private createButtonLabelCollectionModel() {
315-
this.buttonLabelManager = new CollectionModelManager<Button>(Button.$class)
316-
this.buttonLabelManager.descriptor = new ButtonDescriptor()
317-
this.buttonLabelManager.model = new ObservableCollection<Button>()
315+
const buttonLabelManager = new CollectionModelManager<Button>(Button.$class)
316+
buttonLabelManager.descriptor = new ButtonDescriptor()
317+
buttonLabelManager.model = new ObservableCollection<Button>()
318+
return buttonLabelManager
318319
}
319320

320321
private get buttonLabels(): ObservableCollection<Button> {
321-
return this.buttonLabelManager?.model as ObservableCollection<Button>
322+
return this.buttonLabelManager.model as ObservableCollection<Button>
322323
}
323324

324325
/**
@@ -358,7 +359,7 @@ export class ButtonInputMode extends InputModeBase {
358359
// get the bounding rectangle around all the buttons in this set
359360
const wholeBounds = this.buttons.reduce((previousValue, currentValue) => {
360361
const boundsProvider =
361-
this.buttonLabelManager!.descriptor!.getBoundsProvider(currentValue)
362+
this.buttonLabelManager.descriptor!.getBoundsProvider(currentValue)
362363
return Rect.add(previousValue, boundsProvider.getBounds(canvasContext))
363364
}, Rect.EMPTY)
364365
// get the bounds for the owner of the buttons
@@ -442,7 +443,7 @@ export class ButtonInputMode extends InputModeBase {
442443

443444
private getHitButtons(context: IInputModeContext, location: Point) {
444445
return context
445-
.canvasComponent!.hitElementsAt(context, location, this.buttonLabelManager!.canvasObjectGroup)
446+
.canvasComponent!.hitElementsAt(context, location, this.buttonLabelManager.canvasObjectGroup)
446447
.map(canvasObject => canvasObject.userObject as Button)
447448
}
448449

@@ -453,7 +454,7 @@ export class ButtonInputMode extends InputModeBase {
453454
install(context: IInputModeContext, controller: ConcurrencyController) {
454455
super.install(context, controller)
455456
const graphComponent = context.canvasComponent as GraphComponent
456-
this.buttonLabelManager!.canvasObjectGroup = graphComponent.inputModeGroup.addGroup()
457+
this.buttonLabelManager.canvasObjectGroup = graphComponent.inputModeGroup.addGroup()
457458
graphComponent.addMouseMoveListener(this.onMouseMoveListener)
458459
graphComponent.addMouseDragListener(this.onMouseDragListener)
459460
graphComponent.addMouseLeaveListener(this.onMouseMoveListener)
@@ -493,7 +494,7 @@ export class ButtonInputMode extends InputModeBase {
493494
graphComponent.removeMouseDragListener(this.onMouseDragListener)
494495
graphComponent.removeMouseLeaveListener(this.onMouseMoveListener)
495496
this.updateHoveredButton(null)
496-
this.buttonLabelManager!.canvasObjectGroup!.remove()
497+
this.buttonLabelManager.canvasObjectGroup!.remove()
497498
super.uninstall(context)
498499
}
499500

@@ -573,9 +574,9 @@ export class ButtonInputMode extends InputModeBase {
573574
const tooltipWorldSize = this.calculateTooltipWorldSize(button.tooltip)
574575

575576
// get the bounds of the button using the ButtonDescriptor
576-
const buttonBounds = this.buttonLabelManager!.descriptor!.getBoundsProvider(button).getBounds(
577-
this.inputModeContext!.canvasComponent!.canvasContext
578-
)
577+
const buttonBounds = this.buttonLabelManager
578+
.descriptor!.getBoundsProvider(button)
579+
.getBounds(this.inputModeContext!.canvasComponent!.canvasContext)
579580

580581
// horizontally the tooltip is centered with the button center
581582
const x = buttonBounds.centerX - tooltipWorldSize.width / 2
@@ -618,10 +619,7 @@ export class ButtonInputMode extends InputModeBase {
618619
}
619620

620621
private updateHoveredItem(location: Point) {
621-
const hitItem = this.getHitItem(
622-
this.inputModeContext?.canvasComponent as GraphComponent,
623-
location
624-
)
622+
const hitItem = this.getHitItem(location)
625623
if (hitItem != this.hoveredOwner) {
626624
// hovered model item has changed
627625
if (hitItem) {
@@ -665,10 +663,10 @@ export class ButtonInputMode extends InputModeBase {
665663
* @param focusedButton The button to focus or `null` if no button shall be focused.
666664
*/
667665
public set focusedButton(focusedButton: Button | null) {
668-
;(this.buttonLabelManager?.descriptor as ButtonDescriptor).focusedButton = focusedButton
666+
;(this.buttonLabelManager.descriptor as ButtonDescriptor).focusedButton = focusedButton
669667
this._focusedButton = focusedButton
670668
if (focusedButton) {
671-
this.buttonLabelManager?.update(focusedButton)
669+
this.buttonLabelManager.update(focusedButton)
672670
}
673671
this.inputModeContext?.canvasComponent?.invalidate()
674672
}
@@ -687,7 +685,7 @@ export class ButtonInputMode extends InputModeBase {
687685
this.triggerAction(hitButton)
688686
}
689687
} else if (rightClick && this.buttonTrigger === ButtonTrigger.RIGHT_CLICK) {
690-
const hitItem = this.getHitItem(sender as GraphComponent, evt.location)
688+
const hitItem = this.getHitItem(evt.location)
691689
if (hitItem && hitItem != this.buttonOwner) {
692690
this.showButtons(hitItem)
693691
} else {
@@ -738,7 +736,7 @@ export class ButtonInputMode extends InputModeBase {
738736
button.onAction(button)
739737
}
740738

741-
private getHitItem(graphComponent: GraphComponent, location: Point) {
739+
private getHitItem(location: Point) {
742740
const context = this.inputModeContext!
743741
const hitTester = context.lookup(IHitTester.$class) as IHitTester<IModelItem>
744742
let hitItem: IModelItem | null = hitTester

demos/layout/custom-layout-stage/MoveNodesAsideStage.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,17 @@ export default class MoveNodesAsideStage extends LayoutStageBase {
7676

7777
const asideNodes = []
7878

79-
for (const node of graph.nodes) {
80-
// For each node, get the original node and see whether the tag specifies that it
81-
// should be handled specially.
82-
const iNode = originalNodeDp?.get(node)
83-
if (iNode?.tag?.moveAside) {
84-
// If so, hide the node for now ...
85-
hider.hide(node)
86-
// ... and remember it for later use
87-
asideNodes.push(node)
79+
if (originalNodeDp) {
80+
for (const node of graph.nodes) {
81+
// For each node, get the original node and see whether the tag specifies that it
82+
// should be handled specially.
83+
const iNode = originalNodeDp.get(node)
84+
if (iNode?.tag?.moveAside) {
85+
// If so, hide the node for now ...
86+
hider.hide(node)
87+
// ... and remember it for later use
88+
asideNodes.push(node)
89+
}
8890
}
8991
}
9092

demos/layout/custom-layout-stage/MoveNodesAsideStage.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,17 @@ export default class MoveNodesAsideStage extends LayoutStageBase {
7373

7474
const asideNodes: YNode[] = []
7575

76-
for (const node of graph.nodes) {
77-
// For each node, get the original node and see whether the tag specifies that it
78-
// should be handled specially.
79-
const iNode = originalNodeDp?.get(node) as INode
80-
if (iNode?.tag?.moveAside) {
81-
// If so, hide the node for now ...
82-
hider.hide(node)
83-
// ... and remember it for later use
84-
asideNodes.push(node)
76+
if (originalNodeDp) {
77+
for (const node of graph.nodes) {
78+
// For each node, get the original node and see whether the tag specifies that it
79+
// should be handled specially.
80+
const iNode = originalNodeDp.get(node) as INode | null
81+
if (iNode?.tag?.moveAside) {
82+
// If so, hide the node for now ...
83+
hider.hide(node)
84+
// ... and remember it for later use
85+
asideNodes.push(node)
86+
}
8587
}
8688
}
8789

demos/layout/layoutstyles/resources/edge-labels.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.0.3-->
31+
<!--Created by yFiles for HTML 2.5.0.4-->
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
<key id="d0" for="node" attr.name="NodeLabels" y:attr.uri="http://www.yworks.com/xml/yfiles-common/2.0/NodeLabels"/>
3434
<key id="d1" for="node" attr.name="NodeGeometry" y:attr.uri="http://www.yworks.com/xml/yfiles-common/2.0/NodeGeometry"/>

demos/layout/organicsubstructures/resources/parallel.graphml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828
//
2929
////////////////////////////////////////////////////////////////////////-->
30-
<!--Created by yFiles for HTML 2.5.0.3-->
30+
<!--Created by yFiles for HTML 2.5.0.4-->
3131
<graphml
3232
xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://www.yworks.com/xml/schema/graphml.html/2.0/ygraphml.xsd "
3333
xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:y="http://www.yworks.com/xml/yfiles-common/3.0"

demos/loading/browserify/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"build": "browserify ./src/browserify-demo.js -o ./dist/bundle.js"
99
},
1010
"dependencies": {
11-
"yfiles-umd": "../../../lib-dev/yfiles-umd-25.0.3+dev.tgz",
11+
"yfiles-umd": "../../../lib-dev/yfiles-umd-25.0.4+dev.tgz",
1212
"color": "4.2.3"
1313
},
1414
"devDependencies": {

demos/loading/nodejs/server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
"dependencies": {
1010
"express": "4.18.1",
1111
"body-parser": "1.20.0",
12-
"yfiles-umd": "../../../../lib-dev/yfiles-umd-25.0.3+dev.tgz"
12+
"yfiles-umd": "../../../../lib-dev/yfiles-umd-25.0.4+dev.tgz"
1313
}
1414
}

demos/loading/rollupjs/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"private": true,
77
"scripts": {
88
"postinstall": "node -e \"require('fs').copyFileSync('../../../lib/license.json','./src/license.json');\"",
9-
"build": "node --max-old-space-size=4096 ./node_modules/grunt/bin/grunt",
10-
"production": "node --max-old-space-size=4096 ./node_modules/grunt/bin/grunt production"
9+
"build": "node --max-old-space-size=8000 ./node_modules/grunt/bin/grunt",
10+
"production": "node --max-old-space-size=8000 ./node_modules/grunt/bin/grunt production"
1111
},
1212
"devDependencies": {
1313
"@babel/core": "^7.18.5",
@@ -29,6 +29,6 @@
2929
"core-js": "^3.23.1",
3030
"regenerator-runtime": "^0.13.9",
3131
"unfetch": "^4.2.0",
32-
"yfiles": "../../../lib-dev/yfiles-25.0.3+dev.tgz"
32+
"yfiles": "../../../lib-dev/yfiles-25.0.4+dev.tgz"
3333
}
3434
}

demos/loading/rollupjs/src/RollupJsDemo.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ const layoutWorker = new LayoutWorker()
4141

4242
License.value = license
4343

44-
enableWorkarounds()
45-
4644
// Create a GraphComponent and enable interactive editing
4745
const graphComponent = new GraphComponent('graphComponent')
4846
const graph = graphComponent.graph

demos/loading/vite/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
"devDependencies": {
1313
"typescript": "^4.9.5",
1414
"vite": "^4.1.1",
15-
"yfiles": "../../../lib-dev/yfiles-25.0.3+dev.tgz"
15+
"yfiles": "../../../lib-dev/yfiles-25.0.4+dev.tgz"
1616
}
1717
}

0 commit comments

Comments
 (0)