tulipgui module API

Utility functions

tlp.loadGUIPlugins()

Loads Tulip plugins related to the tulipgui module (views, interactors, glyphs).

tlp.getAvailableViews()

New in version 3.8.

Returns a list of the views names currently available in Tulip.

Return type:list of string
tlp.addView(viewName, graph[, dataSet])

New in version 3.8.

Creates and adds a new Tulip view. If called through a Python Script editor in the main Tulip GUI, the view will be added in the Tulip workspace. If called through the classical Python shell, a dialog containing the view will be created and displayed. Returns an instance of the newly created view.

Parameters:
  • viewName (string) – the name of the view to create (use tlp.getAvailableViews() to know which ones are installed)
  • graph (tulip.tlp.Graph) – the graph to set on the new view
  • dataSet (tulip.tlp.Dataset) – the optional parameters of the view
Return type:

tlp.View

tlp.addNodeLinkDiagramView(graph)

New in version 3.8.

Convenient function for creating the principal view offered by Tulip : a node link diagram. Its call is equivalent to:

nodeLinkView = tlp.addView("Node Link Diagram view", graph)
Parameters:graph (tulip.tlp.Graph) – the graph to visualize
Return type:tlp.NodeLinkDiagramComponent
tlp.getOpenedViews()

New in version 3.8.

Returns a list of the views currently opened.

Return type:list of tlp.View
tlp.getViewsOfGraph(graph)

New in version 3.8.

Returns a list of views associated to a particular graph.

Parameters:graph (tulip.tlp.Graph) – the graph on which to find views
Return type:list of tlp.View
tlp.tileViews()

New in version 3.8.

Tiles the opened views in the current workspace (this function has no effect when called from the classical Python shell).

tlp.closeView(view)

New in version 3.8.

Closes an opened view.

Parameters:view (tlp.View) – the view to close
tlp.closeAllViews()

New in version 3.8.

Closes all opened views.

tlp.closeViewsRelatedToGraph(graph)

New in version 3.8.

Closes all the views associated to a particular graph.

Parameters:graph (tulip.tlp.Graph) – the graph on which to close views

tlp.View

class tlp.View

New in version 3.8.

This is the base class for Tulip data views. Use the following functions to get instances on such object :

draw()

Draws/Updates the view.

getData()

Returns the current parameters of the view.

Return type:tulip.tlp.DataSet
getGraph()

Returns the graph currently attached to the view.

Return type:tulip.tlp.Graph
getName()

Returns the name of the view.

Return type:string
resize(width, height)

Resizes the view windows. That method has effects only when working trough the classical Python interpreter.

Parameters:
  • width (integer) – the new width of the view window
  • height (integer) – the new height of the view window
savePicture(picturePath, width, height, center)

Takes a snapshot of the view (if the view supports it), and saves it to a picture on disk. Returns True if the operation succeeds.

Parameters:
  • picturePath (string) – the absolute path of the picture file with extension (used to infer image type)
  • width (integer) – the picture width
  • height (integer) – the picture height
  • center (boolean) – if True, center the view before taking the snapshot, otherwise use the current zoom and pan level
Return type:

boolean

setData(graph, dataSet)

Sets the graph and parameters for the view.

Parameters:
setGraph(graph)

Sets the graph for the view. The current parameters will be kept.

Parameters:graph (tulip.tlp.Graph) – the graph from which the view will be drawn.
setOptionsWidgetsVisible(visible)

Shows / hides the options widgets located on the left side of the view. That method has effects only when working trough the classical Python interpreter.

Parameters:visible (boolean) – the state of the options widgets visibility
setPos(x, y)

Set the position on screen of the view windows. That method has effects only when working trough the classical Python interpreter.

Parameters:
  • x (integer) – the new x position of the view window
  • y (integer) – the new y position of the view window
setVisible(visible)

Hides / Shows the view window. That method has effects only when working trough the classical Python interpreter. It can be usefull for scripts that only needs. to save visualizations snaphots to disk. View windows can be hidden and the script will terminate directly instead of waiting for the views windows to be closed by the user. However, the view window needs to be displayed at least once in order to correctly initialize the OpenGL context.

Parameters:visible (boolean) – the state of the view window visibility

tlp.NodeLinkDiagramComponent

class tlp.NodeLinkDiagramComponent

New in version 3.8.

Bases: tlp.View

That class represents the main type of view offered by Tulip : a node link diagram.

centerView()

Centers the view according to the current view window size and draws it.

geCenterViewOnSetGraph()

Returns the state of the automatic centering when setting a new graph on the view.

Return type:boolean
getRenderingParameters()

Returns a copy of the current rendering parameters for the node link diagram view.

Return type:tulipogl.tlp.GlGraphRenderingParameters
hideOverview(hideOverview)

Hides / displays the overview in the top left corner of the view.

Parameters:hideOverview (boolean) – whether to hide the overview
setCenterViewOnSetGraph(center)

Activates / desactivates the automatic centering of the view when setting a new graph on it.

Parameters:center (boolean) – the state of the automatic centering
setRenderingParameters(parameters)

Sets the rendering parameters for the node link diagram view.

Parameters:parameters (tulipogl.tlp.GlGraphRenderingParameters) – the new rendering parameters

Table Of Contents

Previous topic

tulipogl module API

This Page