Пример #1
0
from igraph.drawing.colors import Palette, palettes
from igraph.drawing.graph import DefaultGraphDrawer
from igraph.drawing.utils import BoundingBox, Point, Rectangle
from igraph.utils import named_temporary_file

__all__ = ["BoundingBox", "DefaultGraphDrawer", "Plot", "Point", "Rectangle", "plot"]

__license__ = "GPL"

try:
    import cairo
except ImportError:
    # No cairo support is installed. Create a fake module
    # pylint: disable-msg=C0103
    from igraph.drawing.utils import FakeModule
    cairo = FakeModule()

IN_IPYTHON = False
try:
    # If this calls succeed without importing, we are in IPython and we can use the display facilities available via IPython
    get_ipython()
    IN_IPYTHON = True
except NameError:
    pass

#####################################################################

class Plot(object):
    """Class representing an arbitrary plot

    Every plot has an associated surface object where the plotting is done. The
Пример #2
0
"""Classes that help igraph communicate with Gephi (http://www.gephi.org)."""

from igraph.compat import property
import urllib.request, urllib.error, urllib.parse

try:
    # JSON is optional so we don't blow up with Python < 2.6
    import json
except ImportError:
    try:
        # Try with simplejson for Python < 2.6
        import simplejson as json
    except ImportError:
        # No simplejson either
        from igraph.drawing.utils import FakeModule
        json = FakeModule()

__all__ = [
    "GephiConnection", "GephiGraphStreamer", "GephiGraphStreamingAPIFormat"
]
__docformat__ = "restructuredtext en"
__license__ = """\
Copyright (C) 2006-2012  Tamás Nepusz <*****@*****.**>
Pázmány Péter sétány 1/a, 1117 Budapest, Hungary

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,