Reputation: 71
The following code displays all product nodes with fixed images:
labels: {
product: {
[NeoVis.NEOVIS_ADVANCED_CONFIG]: {
static: {
shape: "image",
image: "drone.svg"
}
}
}
},
I now want to display different images on each product node based on its image property, the code below doesn't work:
labels: {
product: {
[NeoVis.NEOVIS_ADVANCED_CONFIG]: {
static: {
shape: "image",
image: (props) => props.image
}
}
},
},
I tried another encoding, but it didn't work either:
labels: {
product: {
shape: 'image',
image: function(node) {
return node.properties.image ? node.properties.image : null;
}
}
},
would anyone please tell me what should I do? Thanks!
Upvotes: 0
Views: 113
Reputation: 1426
Try:
labels: {
product: {
[NeoVis.NEOVIS_ADVANCED_CONFIG]: {
static: {
shape: "image"
},
function: {
image: (node) => node.image
}
}
}
},
Upvotes: 0