mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 11:11:53 +00:00
Merge pull request #175 from RobTheFiveNine/documentation/link-tooltips
Add documentation on customising link tooltips
This commit is contained in:
@@ -113,6 +113,25 @@ Slots have the next information:
|
|||||||
|
|
||||||
To retrieve the data traveling through a link you can call ```node.getInputData``` or ```node.getOutputData```
|
To retrieve the data traveling through a link you can call ```node.getInputData``` or ```node.getOutputData```
|
||||||
|
|
||||||
|
### Customising Link Tooltips
|
||||||
|
|
||||||
|
When hovering over a link that connects two nodes together, a tooltip will be shown allowing the user to see the data that is being output from one node to the other.
|
||||||
|
|
||||||
|
Sometimes, you may have a node that outputs an object, rather than a primitive value that can be easily represented (like a string). In these instances, the tooltip will default to showing `[Object]`.
|
||||||
|
|
||||||
|
If you need a more descriptive tooltip, you can achieve this by adding a `toToolTip` function to your object which returns the text you wish to display in the tooltip.
|
||||||
|
|
||||||
|
For example, to ensure the link from output slot 0 shows `A useful description`, the output object would look like this:
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
this.setOutputData(0, {
|
||||||
|
complexObject: {
|
||||||
|
yes: true,
|
||||||
|
},
|
||||||
|
toToolTip: () => 'A useful description',
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
### Define your Graph Node
|
### Define your Graph Node
|
||||||
|
|
||||||
When creating a class for a graph node here are some useful points:
|
When creating a class for a graph node here are some useful points:
|
||||||
|
|||||||
Reference in New Issue
Block a user