FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: make the OrgChart story better work by tbouffard · Pull Request #532 · maxGraph/maxGraph · GitHub

forked from jgraph/mxgraph
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .ts  (4) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
1 change: 1 addition & 0 deletions packages/core/src/index.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ export * as mathUtils from './util/mathUtils';
export * as printUtils from './util/printUtils';
export * as stringUtils from './util/StringUtils';
export * as styleUtils from './util/styleUtils';
export * as treeTraversalUtils from './util/treeTraversal';
export * as utils from './util/Utils';
export * as xmlUtils from './util/xmlUtils';

Expand Down
4 changes: 4 additions & 0 deletions packages/core/src/util/treeTraversal.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ export function findTreeRoots(
* @param inverse Optional boolean to traverse in inverse direction. Default is false.
* This is ignored if directed is false.
*/
// TODO move from mxGraph class --> document in migration guide
// check if we change the signature of the function by using an object as parameter as in graphlayout
export function traverse(
vertex: Cell | null = null,
directed = true,
Expand All @@ -123,7 +125,9 @@ export function traverse(
visited: Dictionary<Cell, boolean> | null = null,
inverse = false
) {
// TODO simplify: exit right away if the 2 parameters are null
if (func != null && vertex != null) {
// TODO remove the default values management here as this can be done in the signature (visited = new Dictionary<Cell, boolean>())
directed = directed != null ? directed : true;
inverse = inverse != null ? inverse : false;
visited = visited || new Dictionary<Cell, boolean>();
Expand Down
6 changes: 6 additions & 0 deletions packages/core/src/view/Graph.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,12 @@ class Graph extends EventSource {
const newParent = change.child.getParent();
this.view.invalidate(change.child, true, true);

// TODO verify if change is needed
// from PR 88 fix, 1st element in if was "newParent &&"
// if (newParent == null || !this.getDataModel().contains(newParent) || newParent.isCollapsed())
// original mxGraph
// if (!this.model.contains(newParent) || this.isCellCollapsed(newParent))
// condition changed in #115
if (
!newParent ||
!this.getDataModel().contains(newParent) ||
Expand Down
Loading

Back | FazBrowse Home | New Git URL