rqt_dotgraph.xdot_qt module

Visualize dot graphs via the xdot format.

class rqt_dotgraph.xdot_qt.Animation(dot_widget)

Bases: object

start()
step = 0.03
stop()
tick()
class rqt_dotgraph.xdot_qt.BezierShape(pen, points, filled=False)

Bases: Shape

Used to draw a bezier curve with QPainter.

draw(painter, highlight=False)

Draw this shape with the given cairo context.

class rqt_dotgraph.xdot_qt.CompoundShape(shapes)

Bases: Shape

Used to draw a set of shapes with QPainter.

draw(cr, highlight=False)

Draw this shape with the given cairo context.

class rqt_dotgraph.xdot_qt.DotLexer(buf=None, pos=0, filename=None, fp=None)

Bases: Lexer

filter(type, text)
scanner = <rqt_dotgraph.xdot_qt.DotScanner object>
class rqt_dotgraph.xdot_qt.DotParser(lexer)

Bases: Parser

handle_edge(src_id, dst_id, attrs)
handle_graph(attrs)
handle_node(id, attrs)
parse()
parse_attr()
parse_attrs()
parse_graph()
parse_id()
parse_node_id()
parse_stmt()
parse_subgraph()
class rqt_dotgraph.xdot_qt.DotScanner

Bases: Scanner

ignorecase = True
literals = {'digraph': 15, 'edge': 17, 'graph': 14, 'node': 16, 'strict': 13, 'subgraph': 18}
symbols = {'+': 12, ',': 8, ':': 9, ';': 10, '=': 11, '[': 4, ']': 5, '{': 6, '}': 7}
tokens = [(-2, '[ \\t\\f\\r\\n\\v]+|//[^\\r\\n]*|/\\*.*?\\*/|#[^\\r\\n]*', False), (0, '[a-zA-Z_\\x80-\\xff][a-zA-Z0-9_\\x80-\\xff]*', True), (0, '-?(?:\\.[0-9]+|[0-9]+(?:\\.[0-9]*)?)', False), (1, '"[^"\\\\]*(?:\\\\.[^"\\\\]*)*"', False), (2, '<[^<>]*(?:<[^<>]*>[^<>]*)*>', False), (3, '-[>-]', False)]
class rqt_dotgraph.xdot_qt.DotWidget(*args: Any, **kwargs: Any)

Bases: QWidget

Qt widget that draws dot graphs.

POS_INCREMENT = 100
ZOOM_INCREMENT = 1.25
ZOOM_TO_FIT_MARGIN = 12
animate_to(x, y)
filter = 'dot'
get_current_pos()
get_drag_action(event)
get_jump(x, y)
get_url(x, y)
is_click(event, click_fuzz=4, click_timeout=1.0)
keyPressEvent(event)
mouseMoveEvent(event)
mousePressEvent(event)
mouseReleaseEvent(event)
on_area_scroll_event(area, event)
on_area_size_allocate(area, allocation)
on_zoom_100()
on_zoom_fit()
on_zoom_in()
on_zoom_out()
paintEvent(event=None)
register_select_callback(cb)
reload()
set_current_pos(x, y)
set_dotcode(dotcode, filename='<stdin>', center=True)
set_filter(filter)
set_highlight(items)
set_xdotcode(xdotcode, center=True)
wheelEvent(event)
window_to_graph(x, y)
zoom_image(zoom_ratio, center=False, pos=None)
zoom_to_area(x1, y1, x2, y2)
zoom_to_fit()
class rqt_dotgraph.xdot_qt.DotWindow(*args: Any, **kwargs: Any)

Bases: QMainWindow

add_actions(target, actions)
add_recent_file(filename)
create_action(text, slot=None, shortcut=None, icon=None, tip=None, checkable=False, signal='triggered()')
on_open()
on_reload()
open_file(filename=None)
set_dotcode(dotcode, filename='<stdin>')
set_filter(filter)
set_xdotcode(xdotcode, filename='<stdin>')
update_file(filename)
update_file_menu()
class rqt_dotgraph.xdot_qt.DragAction(dot_widget)

Bases: object

abort()
drag(deltax, deltay)
draw(cr)
on_button_press(event)
on_button_release(event)
on_motion_notify(event)
start()
stop()
class rqt_dotgraph.xdot_qt.Edge(src, dst, points, shapes, url, tooltip)

Bases: Element

RADIUS = 10
get_jump(x, y)
class rqt_dotgraph.xdot_qt.Element(shapes)

Bases: CompoundShape

Base class for graph nodes and edges.

get_jump(x, y)
get_url(x, y)
class rqt_dotgraph.xdot_qt.EllipseShape(pen, x0, y0, w, h, filled=False)

Bases: Shape

Used to draw an ellipse shape with a QPainter.

draw(painter, highlight=False)

Draw this shape with the given cairo context.

class rqt_dotgraph.xdot_qt.Graph(width=1, height=1, shapes=(), nodes=(), edges=(), subgraph_shapes={})

Bases: Shape

draw(cr, highlight_items=None)

Draw this shape with the given cairo context.

get_jump(x, y)
get_size()
get_url(x, y)
class rqt_dotgraph.xdot_qt.Jump(item, x, y, highlight=None, url=None)

Bases: object

Represents a jump to another node’s position on the canvas.

class rqt_dotgraph.xdot_qt.Lexer(buf=None, pos=0, filename=None, fp=None)

Bases: object

consume(text)
newline_re = re.compile('\\r\\n?|\\n')
next()
scanner = None
tabsize = 8
class rqt_dotgraph.xdot_qt.LineShape(pen, points)

Bases: Shape

Used to draw a line with QPainter.

draw(painter, highlight=False)

Draw this shape with the given cairo context.

class rqt_dotgraph.xdot_qt.LinearAnimation(dot_widget)

Bases: Animation

animate(t)
duration = 0.6
start()
tick()
class rqt_dotgraph.xdot_qt.MoveToAnimation(dot_widget, target_x, target_y)

Bases: LinearAnimation

animate(t)
class rqt_dotgraph.xdot_qt.NoAnimation(dot_widget)

Bases: Animation

start()
stop()
class rqt_dotgraph.xdot_qt.Node(x, y, w, h, shapes, url, tooltip)

Bases: Element

An abstract node in the graph, it’s spatial location, and it’s visual representation.

get_jump(x, y)
get_url(x, y)

Get the elemnt’s metadata.

is_inside(x, y)

Use to check for 2D-picking via the mouse.

param x: The x position on the canvas param y: The y position on the canvas

class rqt_dotgraph.xdot_qt.NullAction(dot_widget)

Bases: DragAction

on_motion_notify(event)
class rqt_dotgraph.xdot_qt.PanAction(dot_widget)

Bases: DragAction

abort()
drag(deltax, deltay)
start()
stop()
exception rqt_dotgraph.xdot_qt.ParseError(msg=None, filename=None, line=None, col=None)

Bases: Exception

class rqt_dotgraph.xdot_qt.Parser(lexer)

Bases: object

consume()
match(type)
skip(type)
class rqt_dotgraph.xdot_qt.Pen

Bases: object

Store pen attributes.

copy()

Create a copy of this pen.

highlighted()

Highlight the pen.

class rqt_dotgraph.xdot_qt.PolygonShape(pen, points, filled=False)

Bases: Shape

Used to draw a polygon with QPainter.

draw(painter, highlight=False)

Draw this shape with the given cairo context.

class rqt_dotgraph.xdot_qt.Scanner

Bases: object

Stateless scanner.

ignorecase = False
literals = {}
next(buf, pos)
symbols = {}
tokens = []
class rqt_dotgraph.xdot_qt.Shape

Bases: object

Abstract base class for all the drawing shapes.

draw(cr, highlight=False)

Draw this shape with the given cairo context.

select_pen(highlight)

Select the pen to highlight.

class rqt_dotgraph.xdot_qt.TextShape(pen, x, y, j, w, t)

Bases: Shape

Used to draw a text shape with a QPainter.

CENTER = 0
LEFT = -1
RIGHT = 1
draw(painter, highlight=False)

Draw this shape with the given cairo context.

class rqt_dotgraph.xdot_qt.Token(type, text, line, col)

Bases: object

class rqt_dotgraph.xdot_qt.Url(item, url, highlight=None)

Bases: object

Represents a graphviz URL.

class rqt_dotgraph.xdot_qt.XDotAttrParser(parser, buf)

Bases: object

Parser for xdot drawing attributes.

See Also

handle_bezier(points, filled=False)
handle_color(color, filled=False)
handle_ellipse(x0, y0, w, h, filled=False)
handle_font(size, name)
handle_line(points)
handle_linestyle(style)
handle_linewidth(linewidth)
handle_polygon(points, filled=False)
handle_text(x, y, j, w, t)
classmethod hex2float(hex_val)

Convert hex value to float.

lookup_color(c)
parse()
read_code()
read_color()
read_float()
read_number()
read_point()
read_polygon()
read_text()
transform(x, y)
unescape(buf)
class rqt_dotgraph.xdot_qt.XDotParser(xdotcode)

Bases: DotParser

handle_edge(src_id, dst_id, attrs)
handle_graph(attrs)
handle_node(id, attrs)
parse()
parse_edge_pos(pos)
parse_node_pos(pos)
transform(x, y)
class rqt_dotgraph.xdot_qt.ZoomAction(dot_widget)

Bases: DragAction

drag(deltax, deltay)
class rqt_dotgraph.xdot_qt.ZoomAreaAction(dot_widget)

Bases: DragAction

abort()
drag(deltax, deltay)
draw(painter)
stop()
class rqt_dotgraph.xdot_qt.ZoomToAnimation(dot_widget, target_x, target_y)

Bases: MoveToAnimation

animate(t)
rqt_dotgraph.xdot_qt.closeEvent(self, event)
rqt_dotgraph.xdot_qt.main()

Run this as a standalone program.

rqt_dotgraph.xdot_qt.square_distance(x1, y1, x2, y2)
rqt_dotgraph.xdot_qt.stop(self)