我已经使用构建了一个图表networkx
,然后按照官方指南plotly
中的描述将其可视化。但是,我在图表中无缘无故地得到了一个随机的“新文本”标签。该标签不会出现在网络的某个特定区域中,而是取决于我缩放的位置(因此它可能会出现在一个部分上,然后如果我缩放另一部分,它会出现在那里)。
我检查了所有标签(节点或边缘),但正如预期的那样,那里没有问题。
我什至检查了代码中任何硬编码的“新文本”部分,但一切看起来都很好。
这里可能有什么问题?
这是用于可视化它的代码:
import networkx
import plotly.graph_objs as go
# set node positions
pos = nx.nx_pydot.graphviz_layout(G2)
# Nodes information
node_x = []
node_y = []
node_labels = []
for key, value in pos.items():
x, y = value[0], value[1]
node_x.append(x)
node_y.append(y)
node_labels.append(key)
# Edges information
edge_x = []
edge_y = []
edge_labels = []
for edge in G2.edges().data():
x0, y0 = pos[edge[0]]
x1, y1 = pos[edge[1]]
edge_x.append(x0)
edge_x.append(x1)
edge_x.append(None)
edge_y.append(y0)
edge_y.append(y1)
edge_y.append(None)
# …
Run Code Online (Sandbox Code Playgroud) 正如这里所宣布的,Dash 的热重载应该在debug=True
. 但是,这对我不起作用。我什至尝试明确设置dev_tools_hot_reload=True
.
我从 IDE 中保存了代码文件,但此后在 Web 界面上看不到任何更改。
即使重新加载页面也没有区别。我必须停止服务器并重新运行脚本。
可能是什么问题?
编辑
我正在使用 VSCode 并从 windows powershell(在 VSCode 终端之外)运行脚本。
从 conda-forge 安装新版本不起作用。