storybook-eol / react-treebeard

React Tree View Component. Data-Driven, Fast, Efficient and Customisable.
http://storybooks.github.io/react-treebeard
MIT License
1.69k stars 294 forks source link

[Question] Display more than the name #254

Closed bbassac closed 3 years ago

bbassac commented 3 years ago

Is there a ways to display more attributes in a tool tip, or on a sub-line ? Ex : { "name": "app.js", "active": true, "attributes" : { key1 : "aaa", key2:"bbb"} } With the labels aaa et bbb displayed under the "app.js"

bbassac commented 3 years ago
Find a way with creating a NodeLabel class and refering into render:
 nodeLabelComponent={{
                                    render: <NodeLabel className='myLabelComponentInSvg' />,
                                    foreignObjectWrapper: {
                                    y: -22
                                    }
                                }}/> 

and

export class NodeLabel extends React.PureComponent { render() { const { className, nodeData } = this.props; return (

{nodeData.attributes.Type+':'}
{nodeData.name}
      )
}

}