plink – A Python/Tk link editor
Technical documentation of the Python objects that underly PLink. Of
interest only to Marc, Nathan, or similar folks.
-
class plink.LinkEditor(root=None, no_arcs=False, callback=None, cb_menu='', title='PLink Editor')
A graphical link drawing tool based on the one embedded in Jeff Weeks’
original SnapPea program.
-
SnapPea_KLPProjection()
Constructs a python simulation of a SnapPea KLPProjection
(Kernel Link Projection) structure. See Jeff Weeks’ SnapPea
file link_projection.h for definitions. Here the KLPCrossings
are modeled by dictionaries. This method requires that all
components be closed. A side effect is that the KLP attributes
of all crossings are updated.
The following excerpt from link_projection.h describes the
main convention:
If you view a crossing (from above) so that the strands go in the
direction of the postive x- and y-axes, then the strand going in
the x-direction is the KLPStrandX, and the strand going in the
y-direction is the KLPStrandY. Note that this definition does not
depend on which is the overstrand and which is the understrand:
KLPStrandY
^
|
----+---> KLPStrandX
|
|
-
SnapPea_projection_file()
- Returns a string containing the contents of a SnapPea link
projection file.
-
about()
-
arrow_components(include_isolated_vertices=False)
- Returns a list of lists of arrows, one per component of the diagram.
-
clear()
-
clear_text()
-
clicked_on_arrow(vertex)
-
create_colors()
-
crossing_components()
- Returns a list of lists of ECrossings, one per component,
where the corresponding crossings are ordered consecutively
through the component. Requires that all components be closed.
-
cursor_on_arrow(point)
-
destroy_arrow(arrow)
-
do_callback()
-
done()
-
double_click(event)
- Event handler for mouse double-clicks.
-
dt_code(snap_style=False)
Returns the Dowker-Thistlethwaite code as a list of even integers
and a list of the number of crossings in each component.
If snap_style is set to True, it returns the alphabetical
Dowker-Thistlethwaite code as used by Oliver Goodman’s Snap.
-
dt_normal()
- Displays the standard Dowker-Thistlethwaite code as a sequence
of signed even integers. (Ignores free loops.)
-
dt_snap()
- Displays the alphabetical Dowker-Thistlethwaite code as used
by Oliver Goodman’s Snap.
-
end_dragging_state()
-
generic_arrow(arrow)
-
generic_vertex(vertex)
-
goto_drawing_state(x1, y1)
-
goto_start_state()
-
howto()
-
initialize()
-
key_press(event)
- Handler for keypress events.
-
load(file_name=None)
-
make_alternating()
- Changes crossings to make the projection alternating.
Requires that all components be closed.
-
mouse_moved(event)
- Handler for mouse motion events.
-
not_done()
-
reflect()
-
reopen()
-
save()
-
save_image(color_mode='color')
-
show_color_keys()
-
single_click(event)
- Event handler for mouse clicks.
-
update_crossings(this_arrow)
-
update_crosspoints()
-
verify_drag()
-
warn_arcs()
-
write_text(string)
-
class plink.Arrow(start, end, canvas=None, hidden=False, color='black')
An arrow in a PL link diagram.
-
draw(crossings=[], recurse=True)
-
erase()
- Prepare the arrow for the garbage collector.
-
expose(crossings=[])
-
freeze()
-
hide()
-
reverse(crossings=[])
-
set_color(color)
-
set_end(vertex, crossings=[])
-
set_start(vertex, crossings=[])
-
too_close(vertex)
-
vectorize()
-
class plink.Crossing(over, under)
A pair of crossing arrows in a PL link diagram.
-
clear_hits()
-
height(arrow)
-
hit(count)
-
locate()
-
reverse()
-
sign()
-
strand(arrow)
-
class plink.ECrossing(crossing, arrow)
A pair: (Crossing, Arrow), where the Arrow is involved in the Crossing.
The ECrossings correspond 1-1 with edges of the link diagram.
-
goes_over()
-
pair()