簡體   English   中英

Neptune Jupyter notebook 中節點的不同圖像

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM