[英]Different image for nodes in Neptune Jupyter notebook
我已成功将 node.csv 和 edge.csv 加载到 AWS Neptune。
我试图根据相应的标签将顶点显示为图像。
例如,在 198.51.100.0 & adesai 和 198.51.100.0 之间有一条边也连接到 gramirez。
所以,我想为 IPAddress 显示一个 address.png,为 adesai & gramirez 显示一个 person.png。
我正在使用 Gremlin lanugage 并且我在下面尝试过,但它不起作用。
%%graph_notebook_vis_options<br>
{<br>
"nodes":{ "id":"0", "label": "User", "shape": "circularImage", "image": "person.png"},<br>
"nodes":{ "id":"1", "label": "User","shape": "circularImage", "image": "person.png"},<br>
"nodes":{ "id":"2", "label": "Restaurant","shape": "circularImage", "image": "restaurant.png"},<br>
"nodes":{ "id":"3", "label": "Restaurant","shape": "circularImage", "image": "restaurant.png"},<br>
"nodes":{ "id":"4", "label": "IPAddress","shape": "circularImage", "image": "address.png"}<br>
}
节点只是显示相同的图像。 任何人都可以建议吗? 谢谢你
这是从Air-Routes-Gremlin
示例笔记本中获取的示例,一旦安装了笔记本,就可以在Neptune/02-Visualization
文件夹中找到。 需要注意的关键是它需要作为组定义的一部分来完成。 将使用指定的图像或图标绘制与给定组匹配的任何内容。 您还可以在位于此处的项目的 Git 存储库中找到其他信息: https : //github.com/aws/graph-notebook
还可用的功能之一是能够更改颜色、添加图像或为组关联特定图标表示。 运行下面的两个单元格,您将看到墨西哥的所有机场都显示有墨西哥国旗,美国的所有机场都显示为蓝旗,加拿大的所有机场都显示为红色。
%%graph_notebook_vis_options
{
"groups": {
"['CA']": {"color": "red"},
"['MX']": {"shape": "image",
"image":"https://cdn.countryflags.com/thumbs/mexico/flag-round-250.png"},
"['US']": {
"shape": "icon",
"icon": {
"face": "FontAwesome",
"code": "\uf024",
"color": "blue"
}
}
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.