widget_graphs_visual

Module Contents

class on_graph_click_interface[source]

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

abstract graph_clicked(self, theGraphsVisual, index_graph, index_trace, indices_points)[source]

Action to perform when a graph is clicked

Parameters
  • theGraphsVisual – class widget_graphs_visual that has called the method

  • index_graph – Index of the graph that has been clicked

  • index_trace – Index of the trace that has been clicked

  • indices_points – graph Indices of the points that have been clicked

Returns

abstract get_name(self)[source]
class widget_graphs_visual(theGraphs, **kwargs)[source]

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)[source]

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)[source]
update_graphs(self, singleUpdate=True)[source]

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)[source]

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

exportGraphs(self)[source]

Export the graphs

export_txt(self, filename_txt)[source]
export_svg(self, filename)[source]
static export_pdf(filename_svg, filename_pdf)[source]
static export_png(filename_svg, filename_png)[source]
export_tikz(self, foldername_tikz)[source]
get_graph(self, idGraph)[source]

Get corresponding GraphVisual of the graph idGraph

keyPressEvent(self, event)[source]

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

delete_graph(self, idGraph)[source]

Delete the graph idGraph

delete(self)[source]
get_all_graphsVisual(self)[source]

Return a dictionary {idGraph: GraphVisual}.

get_layout_buttons(self)[source]

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

set_actionOnClick(self, theActionOnClick)[source]

Action to perform when the graph is clicked

Parameters

theActionOnClickon_graph_click_interface

Returns

set_title(self, idGraph, titleName, **kwargs)[source]

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')[source]

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