widget_graphs_visual

Module Contents

class on_graph_click_interface

Interface class for the action to perform when a point is clicked

class widget_graphs_visual(theGraphs, **kwargs)

Bases: PyQt5.QtWidgets.QWidget

Widget element to draw a graph. The traces and graphs to draw are defined in Graphs taken as argument. This widget is linked to the excellent third-party library pyqtgraph, under MIT license

signal_must_update
signal_graph_changed
set_graph_disposition(self, indexGraph, row=1, col=1, rowspan=1, colspan=1)

Change the graphs disposition.

Parameters:
  • indexGraph – index of the graph to change
  • row – row where to place the graph
  • col – column where to place the graph
  • rowspan – number of rows across which the graph spans
  • colspan – number of columns across which the graph spans
Returns:

__create_graph(self, idGraph)
__check_graphs(self)
on_click(self, plotDataItem, clicked_points)
update_graphs(self, singleUpdate=True)

This method is used to update the graph. This is fast but NOT safe (especially when working with threads). To limit the risks, please use self.signal_must_update.emit() instead.

Parameters:singleUpdate – if set to False, the graph will periodically refres each self.refreshtime
fast_update(self)

Use this method to update the graph in a fast way. NOT THREAD SAFE.

exportGraphs(self)

Export the graphs

get_graph(self, idGraph)

Get corresponding GraphVisual of the graph idGraph

keyPressEvent(self, event)

What happens if a key is pressed. R: reset the axes to their default value

delete_graph(self, idGraph)

Delete the graph idGraph

delete(self)
get_all_graphsVisual(self)

Return a dictionary {idGraph: GraphVisual}.

get_layout_buttons(self)

Get the QGraphicsLayout where it’s possible to add buttons, etc.

set_actionOnClick(self, theActionOnClick)

Action to perform when the graph is clicked

Parameters:theActionOnClickon_graph_click_interface
Returns:
set_title(self, idGraph, titleName, **kwargs)

Set title of the graph

Parameters:
  • idGraph – id of the graph
  • titleName – title to set
set_article_template(self, graph_size_x=8.8, graph_size_y=4.4, legendPosition='NW')

Method to set the graphs to article quality graph.

Parameters:
  • graph_size_x – width of the graph in cm
  • graph_size_y – height of the graph in cm
  • legendPosition – position of the legend (NE, SE, SW, NW)
Returns: