当我单击节点以了解特定节点的整个故事时,我想突出显示整个路径,这是一个示例 - http://bl.ocks.org/git-ashish/8959771。
请检查此链接,您会发现在 javscript 中突出显示路径的功能,但请注意,此功能不符合我的要求,它突出显示与单击的节点相关的链接和与目标节点相关的链接。我想要的是突出显示与单击的节点相关的所有链接。
这是我需要的一个例子,
这是整个图表,我需要的是,当我点击曼谷时,它会突出显示数据框中与曼谷相同的所有节点,比如突出显示气候变化和能源短缺的链接, ....然后突出显示基础设施和生态系统,以及领导力和战略,以及....这就是我想要的。这是另一张图片,显示了与曼谷相关的节点,使用闪亮对其进行分析。
这是我在块和链接问题中使用 highlight_node_links 时会发生的情况,这是错误的,并且没有显示节点和曼谷之间的关系。
这是曼谷的数据,向您展示列之间的关系,当您使用这些数据时,它只会生成第二张图片。
structure(list(City = c("Bangkok", "Bangkok", "Bangkok", "Bangkok",
"Bangkok", "Bangkok", "Bangkok", "Bangkok", "Bangkok", "Bangkok",
"Bangkok", "Bangkok", "Bangkok", "Bangkok", "Bangkok", "Bangkok"
), ResiliencyChallenge = c("ClimateChange", "ClimateChange",
"ClimateChange", "ClimateChange", "ClimateChange", "InfrastructureFaliure",
"EnergyShortage", "Pollution", "Pollution", "Pollution", "TransportationSystemFailure",
"TransportationSystemFailure", "TransportationSystemFailure",
"TransportationSystemFailure", "TransportationSystemFailure",
"TransportationSystemFailure"), CRI.Dimesnsion.1 = c("Infrastructure & Ecosystems",
"Infrastructure & Ecosystems", "Infrastructure & Ecosystems",
"Infrastructure & Ecosystems", "Infrastructure & Ecosystems",
"Infrastructure & Ecosystems", "Infrastructure & Ecosystems",
"Leadership & Strategy", "Leadership & Strategy", "Infrastructure & Ecosystems",
"Infrastructure & Ecosystems", "Infrastructure & Ecosystems",
"Infrastructure & Ecosystems", "Infrastructure & Ecosystems",
"Infrastructure & Ecosystems", "Leadership & Strategy"), Implementation.time.frame = c("Short-term",
"Short-term", "Short-term", "Short-term", "Short-term", "Mid-term",
"Long-term", "Short-term", "Short-term", "Mid-term", "Mid-term",
"Short-term", "Short-term", "Short-term", "Short-term", "Short-term"
), Goal = c("Goal13", "Goal13", "Goal13", "Goal13", "Goal13",
"Goal12", "Goal12", "Goal11", "Goal11", "Goal11", "Goal11", "Goal11",
"Goal11", "Goal11", "Goal11", "Goal11")), .Names = c("City",
"ResiliencyChallenge", "CRI.Dimesnsion.1", "Implementation.time.frame",
"Goal"), class = "data.frame", row.names = c(NA, -16L))