-
Notifications
You must be signed in to change notification settings - Fork 367
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support labelField in MindMap, IndentedTree, Fishbone, FlowGraph (
#2801) * feat: support labelField in MindMap * feat: support labelField in IndentedTree * feat: support labelField in Fishbone * feat: support labelField in FlowDirectionGraph and FlowGraph * fix: typo
- Loading branch information
Showing
20 changed files
with
320 additions
and
147 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
13 changes: 11 additions & 2 deletions
13
packages/graphs/src/components/flow-direction-graph/types.ts
This file contains 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 |
---|---|---|
@@ -1,3 +1,12 @@ | ||
import { GraphOptions } from '../../types'; | ||
import type { NodeData } from '@antv/g6'; | ||
import type { GraphOptions } from '../../types'; | ||
|
||
export interface FlowDirectionGraphOptions extends GraphOptions {} | ||
export interface FlowDirectionGraphOptions extends GraphOptions { | ||
/** | ||
* Selects a field from the data to use as the label for the node. | ||
* If a string is provided, it will select the field as `data[labelField]`. | ||
* If a function is provided, it will call the function with the data and use the returned value. | ||
* @default (data) => data.id | ||
*/ | ||
labelField?: string | ((node: NodeData) => string); | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.