Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# mpld3.plugins.connect(fig, tooltip, TopToolbar())
#set tick marks as blank
ax.axes.get_xaxis().set_ticks([])
ax.axes.get_yaxis().set_ticks([])
#set axis as blank
ax.axes.get_xaxis().set_visible(False)
ax.axes.get_yaxis().set_visible(False)
#next shoul be done at the en of loop for I guess
#TitFic = ['file:///D:/Doc-David/Developpement/SpyderWorkspace/Git-P2N/DATA/Banana/PatentContents/Metrics/' +Tit2FicName [lab] for lab in labels]
TitFic = ['file:///'+ Here +Tit2FicName [lab] for lab in labels]
tempoLab.append(labels)
tempoFic.append(TitFic)
interactive_legend = plugins.InteractiveLegendPlugin( memoFig , memoLab, legend_offset=(0,300),
alpha_unsel=0.1, alpha_over=0.9, start_visible=False)
interactive_legend2 = plugins.InteractiveLegendPlugin(memoFig2, memoLab2, legend_offset=(0,0),
alpha_unsel=0.1, alpha_over=0.8, start_visible=False)
#TitFics = []
#tempoFic=[]
mpld3.plugins.connect(fig,interactive_legend)
mpld3.plugins.connect(fig,interactive_legend2)
tooltip =dict()
for ligne in fig.get_axes()[0].lines:
Urls=[]
labels =[]
for point in ligne.get_xydata():
if tuple(point) in MemoPoints.keys():
Urls.append('file:///'+ Here +Tit2FicName [MemoPoints[tuple(point)]])
#set tick marks as blank
ax.axes.get_xaxis().set_ticks([])
ax.axes.get_yaxis().set_ticks([])
#set axis as blank
ax.axes.get_xaxis().set_visible(False)
ax.axes.get_yaxis().set_visible(False)
#next shoul be done at the en of loop for I guess
#TitFic = ['file:///D:/Doc-David/Developpement/SpyderWorkspace/Git-P2N/DATA/Banana/PatentContents/Metrics/' +Tit2FicName [lab] for lab in labels]
TitFic = ['file:///'+ Here +Tit2FicName [lab] for lab in labels]
tempoLab.append(labels)
tempoFic.append(TitFic)
interactive_legend = plugins.InteractiveLegendPlugin( memoFig , memoLab, legend_offset=(0,300),
alpha_unsel=0.1, alpha_over=0.9, start_visible=False)
interactive_legend2 = plugins.InteractiveLegendPlugin(memoFig2, memoLab2, legend_offset=(0,0),
alpha_unsel=0.1, alpha_over=0.8, start_visible=False)
#TitFics = []
#tempoFic=[]
mpld3.plugins.connect(fig,interactive_legend)
mpld3.plugins.connect(fig,interactive_legend2)
tooltip =dict()
for ligne in fig.get_axes()[0].lines:
Urls=[]
labels =[]
for point in ligne.get_xydata():
if tuple(point) in MemoPoints.keys():
Urls.append('file:///'+ Here +Tit2FicName [MemoPoints[tuple(point)]])
labels.append(MemoPoints[tuple(point)])
else:
ax.text(x, y, text, fontsize=10, color='k', fontname='monospace')
# Plot the router node labels
for node in (node for node in json_data['nodes'] if 'midpoint' not in node['id']):
x, y = node['pos'][1], node['pos'][0]
if node['failed'] is False:
text = node['name']
else:
text = node['name'] + ' (failed)'
ax.text(x, y, text, fontsize=15, color='k', fontname='monospace')
# Create interactive legend
line_collections, line_group_labels = _create_legend_line_collections(ax)
interactive_legend = plugins.InteractiveLegendPlugin(line_collections,
line_group_labels,
alpha_unsel=0.2,
alpha_over=1.8,
start_visible=True)
fig.subplots_adjust(right=0.85)
plugins.connect(fig, interactive_legend)
time_now = str(time.asctime())
ax.set_title("Network Graph:" + time_now, size=15)
plot_thread = threading.Thread(target=_run_plot)
plot_thread.start()