Open TianMing2018 opened 2 years ago
maybe a update to the docs is more appropriate title to this issue
My bad, forgot to update readme 😅
How to set the title which property to display?
If you ended up here because you want to set a custom label for your nodes by using the advanced config. This worked for me:
// For a "Person" node that has "name" and "firstname" properties:
labels: {
Person: {
// label: "name", <-- I want to have a custom label but can only specifiy a key here
[Neovis.NEOVIS_ADVANCED_CONFIG]: {
static: {
//...
},
function: {
label: (node) =>
`${node.properties.name}, ${node.properties.firstname}`, // <--- Tweak this to your node properties and build your own label
},
},
},
an update is needed for 2.0.0 branch。 for example:
according to the example file
advanced-example.html
, .you need to customize lable through this waybut we still got the suggestion to use
(node) => viz.nodeToHtml(node, undefined)
insidedocs/index.html
or docs/modules.html