Skip to content

Commit 5fba69f

Browse files
Merge pull request #11 from yWorks/dev
Dev
2 parents 586ff17 + 96e0312 commit 5fba69f

File tree

13 files changed

+180
-135
lines changed

13 files changed

+180
-135
lines changed

doc/src/content/features/CustomizingLayouts.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ function LayoutFlow() {
6262
6363
// run initial layout after the nodes have been measured
6464
useNodesMeasuredEffect(() => {
65-
// run the hierarchic layout with a given configuration
65+
// run the hierarchical layout with a given configuration
6666
// play around with the options and observe how the layout changes
6767
runLayout(layoutConfiguration)
6868
})

doc/src/content/layouts/CircularLayout.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ placed in a ray-like manner.
2424
Additional customization for individual graph elements, such as `nodeTypes`, `nodeMargins`, and more, can be achieved via
2525
the `CircularLayoutDataProvider`.
2626

27-
Feel free to play around with the hierarchic layout configuration in our [online playground](#my-playground).
27+
Feel free to play around with the circular layout configuration in our [online playground](#my-playground).
2828

2929
Extensive documentation detailing all available properties of the circular layout supported by *yFiles layouts for React Flow* can be
3030
found [here](https://docs.yworks.com/yfileshtml/#/api/CircularLayout).

doc/src/content/layouts/HierarchicLayout.mdx renamed to doc/src/content/layouts/HierarchicalLayout.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
2-
title: Hierarchic Layout
2+
title: Hierarchical Layout
33
section: 1
44
tags: []
55
---
66
import Playground from '../../components/Playground.astro'
77
import TypeLink from '../../components/TypeLink.astro'
88

9-
# Hierarchic Layout
9+
# Hierarchical Layout
1010

11-
The *hierarchic layout algorithm* arranges graphs in a hierarchic fashion. It aims to highlight the main direction
11+
The *hierarchical layout algorithm* arranges graphs in a hierarchical fashion. It aims to highlight the main direction
1212
or flow within a directed graph. The nodes of a graph are placed in hierarchically arranged layers such that
1313
the (majority of) edges of the graph show the same overall orientation, for example, top-to-bottom. Additionally,
1414
the ordering of the nodes within each layer is chosen in such a way that the number of edge crossings is small.
@@ -19,15 +19,15 @@ the ordering of the nodes within each layer is chosen in such a way that the num
1919

2020
The hierarchical layout algorithm offers extensive customization options through a wide array of properties accessible
2121
via `HierarchicalLayoutOptions`. Fundamental options include layout orientation, orthogonal edge routing, layer distance, and others.
22-
Moreover, the hierarchic layout supports grouped graphs. It also automatically places node and edge labels when the
22+
Moreover, the hierarchical layout supports grouped graphs. It also automatically places node and edge labels when the
2323
corresponding properties are activated.
2424

2525
Additional customization for individual graph elements, such as `sourcePortCandidates`, `nodeMargins`, and more, can be achieved via
2626
the `HierarchicalLayoutDataProvider`.
2727

28-
Feel free to play around with the hierarchic layout configuration in our [online playground](#my-playground).
28+
Feel free to play around with the hierarchical layout configuration in our [online playground](#my-playground).
2929

30-
Extensive documentation detailing all available properties of the hierarchic layout supported by *yFiles layouts for React Flow* can be
30+
Extensive documentation detailing all available properties of the hierarchical layout supported by *yFiles layouts for React Flow* can be
3131
found [here](https://docs.yworks.com/yfileshtml/#/dguide/hierarchical_layout#hierarchical_layout).
3232

3333
```tsx
@@ -49,7 +49,7 @@ runLayout({
4949

5050
## HierarchicalLayoutOptions
5151

52-
The configuration options for the hierarchic layout algorithm that arranges graphs in a hierarchic fashion. <p> For more information on the layout algorithm and its available settings, see [HierarchicalLayout](https://docs.yworks.com/yfileshtml/#/api/HierarchicalLayout).</p>
52+
The configuration options for the hierarchical layout algorithm that arranges graphs in a hierarchical fashion. <p> For more information on the layout algorithm and its available settings, see [HierarchicalLayout](https://docs.yworks.com/yfileshtml/#/api/HierarchicalLayout).</p>
5353

5454
| Name | Type |
5555
|---|---|

doc/src/content/layouts/RadialTreeLayout.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ placed in a ray-like manner.
2626
Additional customization for individual graph elements, such as `edgeLabelPreferredPlacements`, `nodeMargins`, and more, can be achieved via
2727
the `RadialTreeLayoutDataProvider`.
2828

29-
Feel free to play around with the hierarchic layout configuration in our [online playground](#my-playground).
29+
Feel free to play around with the radial tree layout configuration in our [online playground](#my-playground).
3030

3131
Extensive documentation detailing all available properties of the radial tree layout supported by *yFiles layouts for React Flow* can be
3232
found [here](https://docs.yworks.com/yfileshtml/#/api/RadialTreeLayout).

doc/src/content/layouts/TreeLayout.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import TypeLink from '../../components/TypeLink.astro'
1010

1111
The *Tree layout algorithm* is designed to arrange graphs in a tree fashion. It provides multiple different
1212
arrangements of trees and subtrees. Tree layout algorithms are commonly applied to visualize relational
13-
data and produce diagrams of high quality that are able to reveal possible hierarchic properties of
13+
data and produce diagrams of high quality that are able to reveal possible hierarchical properties of
1414
the graph. More precisely, they find applications in dataflow analysis, software engineering,
1515
bioinformatics and business administration.
1616

@@ -26,7 +26,7 @@ It also automatically places node labels when the corresponding properties are a
2626
Additional customization for individual graph elements, such as `edgeLabelPreferredPlacements`, `nodeMargins`, and more, can be achieved via
2727
the `TreeLayoutDataProvider`.
2828

29-
Feel free to play around with the hierarchic layout configuration in our [online playground](#my-playground).
29+
Feel free to play around with the tree layout configuration in our [online playground](#my-playground).
3030

3131
Extensive documentation detailing all available properties of the Tree layout supported by *yFiles layouts for React Flow* can be
3232
found [here](https://docs.yworks.com/yfileshtml/#/api/TreeLayout).

examples/src/labeled-layout/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ const LayoutFlow = () => {
131131
}
132132
disabled={layoutRunning}
133133
>
134-
Hierarchic Layout
134+
Hierarchical Layout
135135
</button>
136136
<button
137137
onClick={() =>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@yworks/yfiles-layout-reactflow-root",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"description": "",
55
"main": "index.js",
66
"license": "SEE LICENSE IN ./LICENSE",

yfiles-layout-reactflow/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ to yFiles is to use the [yFiles Dev Suite](https://www.npmjs.com/package/yfiles-
4242

4343
Add the yFiles dependency:
4444
```bash
45-
npm install <yFiles package path>/lib/yfiles-26.0.0+dev.tgz
45+
npm install <yFiles package path>/lib/yfiles-30.0.0+dev.tgz
4646
```
4747

4848
<details>

yfiles-layout-reactflow/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@yworks/yfiles-layout-reactflow",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"author": {
55
"name": "yFiles for HTML team @ yWorks GmbH",
66
"email": "[email protected]"

yfiles-layout-reactflow/src/layout/LayoutSupport.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { GraphComponent, IGraph, LayoutExecutor, LayoutExecutorAsync } from '@yf
22
import { getLayoutAlgorithm, getLayoutData } from './layout-algorithms.ts'
33
import { LayoutAlgorithmConfiguration, LayoutDataProvider } from './layout-types.ts'
44
import { registerWebWorker } from './WebWorkerSupport.ts'
5+
import { RefObject } from 'react'
56

67
export class LayoutSupport {
78
private readonly workerPromise: Promise<Worker> | null = null
@@ -17,21 +18,21 @@ export class LayoutSupport {
1718
graph: IGraph,
1819
layoutConfiguration: LayoutAlgorithmConfiguration,
1920
layoutDataProvider?: LayoutDataProvider<TNodeData, TEdgeData>,
20-
reactFlowElement?: HTMLDivElement
21+
reactFlowRef?: RefObject<HTMLDivElement>
2122
): Promise<void> {
2223
const executor =
2324
this.workerPromise !== null
2425
? await this.createLayoutExecutorAsync(
2526
graph,
2627
layoutConfiguration,
2728
layoutDataProvider,
28-
reactFlowElement
29+
reactFlowRef
2930
)
3031
: await this.createLayoutExecutor(
3132
graph,
3233
layoutConfiguration,
3334
layoutDataProvider,
34-
reactFlowElement
35+
reactFlowRef
3536
)
3637

3738
try {
@@ -50,14 +51,14 @@ export class LayoutSupport {
5051
graph: IGraph,
5152
layoutConfiguration: LayoutAlgorithmConfiguration,
5253
layoutDataProvider?: LayoutDataProvider<TNodeData, TEdgeData>,
53-
reactFlowElement?: HTMLDivElement
54+
reactFlowRef?: RefObject<HTMLDivElement>
5455
): Promise<LayoutExecutor> {
5556
const layoutAlgorithm = await getLayoutAlgorithm(layoutConfiguration)
5657
return Promise.resolve(
5758
new LayoutExecutor({
5859
graphComponent: new GraphComponent({ graph }),
5960
layout: layoutAlgorithm,
60-
layoutData: getLayoutData(layoutConfiguration.name, layoutDataProvider, reactFlowElement)
61+
layoutData: getLayoutData(layoutConfiguration.name, layoutDataProvider, reactFlowRef)
6162
})
6263
)
6364
}
@@ -66,7 +67,7 @@ export class LayoutSupport {
6667
graph: IGraph,
6768
layoutConfiguration: LayoutAlgorithmConfiguration,
6869
layoutDataProvider?: LayoutDataProvider<TNodeData, TEdgeData>,
69-
reactFlowElement?: HTMLDivElement
70+
reactFlowRef?: RefObject<HTMLDivElement>
7071
): Promise<LayoutExecutorAsync> {
7172
if (this.executor) {
7273
await this.executor.cancel()
@@ -97,7 +98,7 @@ export class LayoutSupport {
9798
messageHandler: webWorkerMessageHandler,
9899
graph,
99100
layoutDescriptor: layoutConfiguration,
100-
layoutData: getLayoutData(layoutConfiguration.name, layoutDataProvider, reactFlowElement)
101+
layoutData: getLayoutData(layoutConfiguration.name, layoutDataProvider, reactFlowRef)
101102
})
102103
return this.executor
103104
}

0 commit comments

Comments
 (0)