Skip to main content

Large graphs analysis and drawing

Project description

Module description

Graphs play an important role in many research areas, such as biology, microelectronics, social sciences, data mining, and computer science. Tulip (http://tulip.labri.fr) [1] is an Information Visualization framework dedicated to the analysis and visualization of such relational data. Written in C++ the framework enables the development of algorithms, visual encodings, interaction techniques, data models, and domain-specific visualizations.

The Tulip core library is available to the Python community through the Tulip-Python bindings [2]. The bindings have been developed using the SIP tool [3] from Riverbank Computed Limited, allowing to easily create quality Python bindings for any C/C++ library. The main features provided by the bindings are the following ones:

  • Creation and manipulation of graphs : Tulip provides an efficient graph data structure for storing large and complex networks. It is also one of the few that offer the possibility to efficiently define and navigate graph hierarchies or cluster trees (nested sub-graphs).

  • Storage of data on graph elements : Tulip allows to associate different kind of serializable data (boolean, integer, float, string, …) and visual attributes (layout, color, size, …) to graph elements. All these data can be easily accessed from the Tulip graph data structure facilitating the development of algorithms.

  • Application of algorithms of different types on graph : Tulip has been designed to be easily extensible and provides a variety of graph algorithms (layout, metric, clustering, …) implemented as C++ plugins. All these algorithms can be called from Python. As Tulip is dedicated to graph visualization, it is provided with numerous state of the art graph layout algorithms but also a bridge to the Open Graph Drawing Framework (http://www.ogdf.net) [4]

Example

The following script imports the dependency graph from the locally installed pip packages, draws it using a force directed layout algorithm and serializes the resulting graph to a file through the TLP graph format. The imported graph can then be visualized through the Tulip software or the use of the dedicated tulipgui module, enabling to create the OpenGL visualizations available in Tulip from Python.

import pip
import re

from tulip import *

# create a new empty graph
graph = tlp.newGraph()

# dictionnary mapping package name to graph node
packageNode = {}

# iterate over locally installed pip packages
for d in pip.get_installed_distributions():
  # add a node associated to the package
  n = graph.addNode()
  packageNode[d.key] = n
  # set node label for use with Tulip visualizations components
  graph['viewLabel'][n] = d.key

# iterate over locally installed pip packages
for d in pip.get_installed_distributions():
  # iterate over package requirements
  for r in d.requires():
    # process requirement name to get its pip package name :
    # switch to lower case and remove version infos if any
    s = str(r).lower()
    match = re.search('|'.join(map(re.escape, '<=>')), s)
    if match:
      s = s[:match.start()]
    # add an edge between the pip package and its dependency in the graph
    graph.addEdge(packageNode[d.key], packageNode[s])

# apply a force directed layout algorithm on the graph then a connected component packing algorithm.
# algorithms are called with their default parameters.
# resulting layout will be stored in the defaut graph layout property named 'viewLayout'
graph.applyLayoutAlgorithm('Fast Multipole Multilevel Embedder (OGDF)')
graph.applyLayoutAlgorithm('Connected Component Packing (Polyomino)')

# serializes the graph to a file using the TLP graph format,
# that file can then be opened with the Tulip software for visualization purposes.
tlp.saveGraph(graph, 'pip_deps.tlp')

References

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

tulip_python-4.8.0-cp35-none-win_amd64.whl (12.5 MB view details)

Uploaded CPython 3.5 Windows x86-64

tulip_python-4.8.0-cp35-none-win32.whl (12.0 MB view details)

Uploaded CPython 3.5 Windows x86

tulip_python-4.8.0-cp35-cp35m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (15.8 MB view details)

Uploaded CPython 3.5m macOS 10.10+ Intel (x86-64, i386) macOS 10.10+ x86-64 macOS 10.6+ Intel (x86-64, i386) macOS 10.9+ Intel (x86-64, i386) macOS 10.9+ x86-64

tulip_python-4.8.0-cp34-none-win_amd64.whl (12.5 MB view details)

Uploaded CPython 3.4 Windows x86-64

tulip_python-4.8.0-cp34-none-win32.whl (12.0 MB view details)

Uploaded CPython 3.4 Windows x86

tulip_python-4.8.0-cp34-cp34m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (15.8 MB view details)

Uploaded CPython 3.4m macOS 10.10+ Intel (x86-64, i386) macOS 10.10+ x86-64 macOS 10.6+ Intel (x86-64, i386) macOS 10.9+ Intel (x86-64, i386) macOS 10.9+ x86-64

tulip_python-4.8.0-cp33-none-win_amd64.whl (12.5 MB view details)

Uploaded CPython 3.3 Windows x86-64

tulip_python-4.8.0-cp33-none-win32.whl (12.0 MB view details)

Uploaded CPython 3.3 Windows x86

tulip_python-4.8.0-cp33-cp33m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (15.8 MB view details)

Uploaded CPython 3.3m macOS 10.10+ Intel (x86-64, i386) macOS 10.10+ x86-64 macOS 10.6+ Intel (x86-64, i386) macOS 10.9+ Intel (x86-64, i386) macOS 10.9+ x86-64

tulip_python-4.8.0-cp27-none-win_amd64.whl (12.5 MB view details)

Uploaded CPython 2.7 Windows x86-64

tulip_python-4.8.0-cp27-none-win32.whl (12.0 MB view details)

Uploaded CPython 2.7 Windows x86

tulip_python-4.8.0-cp27-none-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (15.8 MB view details)

Uploaded CPython 2.7 macOS 10.10+ Intel (x86-64, i386) macOS 10.10+ x86-64 macOS 10.6+ Intel (x86-64, i386) macOS 10.9+ Intel (x86-64, i386) macOS 10.9+ x86-64

File details

Details for the file tulip_python-4.8.0-cp35-none-win_amd64.whl.

File metadata

File hashes

Hashes for tulip_python-4.8.0-cp35-none-win_amd64.whl
Algorithm Hash digest
SHA256 132cd5924e89bcf3bb698637c775dc9e601b65eb0c96b5463795d0bafc8a8938
MD5 f96914a87b4e1c8a6cec8a25254c53dd
BLAKE2b-256 c71798e3757e74b44a6858b46c35fcbc19ebf31c9ff7521fa2988cac1a9ac40d

See more details on using hashes here.

File details

Details for the file tulip_python-4.8.0-cp35-none-win32.whl.

File metadata

File hashes

Hashes for tulip_python-4.8.0-cp35-none-win32.whl
Algorithm Hash digest
SHA256 63a936161bb4e3a74a3539cca55490c08c90be4b3be335c83ac1c9afbd3e60b5
MD5 3317895f32e3d61923d8e03db14da2a5
BLAKE2b-256 b1a8477489ba15564e068c399e43239361023dac7a390cc08cd949268bd3010d

See more details on using hashes here.

File details

Details for the file tulip_python-4.8.0-cp35-cp35m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl.

File metadata

File hashes

Hashes for tulip_python-4.8.0-cp35-cp35m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Algorithm Hash digest
SHA256 32b92d703e935b178ae651d2e75e609e5a8a9da96713414da99f0cab6b9d346a
MD5 239248c12a4923f4e876337b09c5b3a6
BLAKE2b-256 26c4f1df61de90428f0f30d65a67d38b0edb71ace5668e848425098da1710287

See more details on using hashes here.

File details

Details for the file tulip_python-4.8.0-cp34-none-win_amd64.whl.

File metadata

File hashes

Hashes for tulip_python-4.8.0-cp34-none-win_amd64.whl
Algorithm Hash digest
SHA256 3e910a49cc7503daf4dae0515f7735100fd283429bf42bd6cbadcc8d7a0cc014
MD5 ca13e349f49e636d816fbf08280788f8
BLAKE2b-256 107e7e1016ca35eff17083ed668878b16ac58eadeff35c48c2a4205debf3376b

See more details on using hashes here.

File details

Details for the file tulip_python-4.8.0-cp34-none-win32.whl.

File metadata

File hashes

Hashes for tulip_python-4.8.0-cp34-none-win32.whl
Algorithm Hash digest
SHA256 1fc1f49797e3c8a188896027392333d074a62240249624df9eb1ef5619124b11
MD5 f965a2b4a69072ec6a61b4eb7b1eca35
BLAKE2b-256 703943202285d8646d75e27debcb75670c3e5eaf529faab575e451230a32cb93

See more details on using hashes here.

File details

Details for the file tulip_python-4.8.0-cp34-cp34m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl.

File metadata

File hashes

Hashes for tulip_python-4.8.0-cp34-cp34m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Algorithm Hash digest
SHA256 77ea81aa5fcb6aa4235d3572619d19e6a9403678285acce9cde877d04323fabf
MD5 15f95cd5fc2abbaa920e91313e3023c9
BLAKE2b-256 11870c9053226febfb0635ed4e34bf8bb9d4d54593f135eefa44e8407f89edf1

See more details on using hashes here.

File details

Details for the file tulip_python-4.8.0-cp33-none-win_amd64.whl.

File metadata

File hashes

Hashes for tulip_python-4.8.0-cp33-none-win_amd64.whl
Algorithm Hash digest
SHA256 fc489ce66ac4cadf505131cfa748421bf6951748ae2215776469d6e773fac5c9
MD5 54818bf7b2c055d1fdd78e2745c48163
BLAKE2b-256 46644d954ac1905a04fd1c2f3172a4979c929ec399b5dc40c395e21a133a47bd

See more details on using hashes here.

File details

Details for the file tulip_python-4.8.0-cp33-none-win32.whl.

File metadata

File hashes

Hashes for tulip_python-4.8.0-cp33-none-win32.whl
Algorithm Hash digest
SHA256 0f568743d7c347d1940f464192c026a11be16ccceaf770e1a21327268a67f5e4
MD5 2bf8950382c11383d47e1b59666388b2
BLAKE2b-256 297f8d9663c7b03ce2bb20b9e8e21ce85e73cb711f0cd0bc4f2c54b479921e55

See more details on using hashes here.

File details

Details for the file tulip_python-4.8.0-cp33-cp33m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl.

File metadata

File hashes

Hashes for tulip_python-4.8.0-cp33-cp33m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Algorithm Hash digest
SHA256 569d0e94235e492dbbaf837e54dc646bff25e765951aa5c6c3fc4ddab6c977a4
MD5 2461298fddb102318047edc1c27724a1
BLAKE2b-256 bbcb6c665e9c4eba26a46022170549b0d07b76133eabf7317c011076385c567e

See more details on using hashes here.

File details

Details for the file tulip_python-4.8.0-cp27-none-win_amd64.whl.

File metadata

File hashes

Hashes for tulip_python-4.8.0-cp27-none-win_amd64.whl
Algorithm Hash digest
SHA256 32f063ee1eb81348e923f6dec0d9619a2615b6b16ec43661455e4cda71278a9a
MD5 87063cf0e5c18003d224579251dcce41
BLAKE2b-256 ab839fe85585a5f88fa1136f1968cebcf4e3bd06c609198114bb11bff03d0d5e

See more details on using hashes here.

File details

Details for the file tulip_python-4.8.0-cp27-none-win32.whl.

File metadata

File hashes

Hashes for tulip_python-4.8.0-cp27-none-win32.whl
Algorithm Hash digest
SHA256 0056e479ba2f4dda62b0fbeff9d2c3f6bcb058d36efb47b5c36a4299879a4a85
MD5 8916d96a4e378ae265e98889b1effa6c
BLAKE2b-256 7fcb59f437729c0a086a658fa34cc4ea871e5aebfdee79e50d33eeebba5cca43

See more details on using hashes here.

File details

Details for the file tulip_python-4.8.0-cp27-none-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl.

File metadata

File hashes

Hashes for tulip_python-4.8.0-cp27-none-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Algorithm Hash digest
SHA256 8121c32c7a17765aff623ac1ba93d00c4fcf9e8c697f28b577513dcdd5826ea6
MD5 c3cc1669ef8de41fb2af679ef7857cf8
BLAKE2b-256 60ce7438a141846905293686e10844fbb9711cbb10eabbdb46cecdc7aee46bbe

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page