Skip to content

Commit

Permalink
Merge branch 'master' of github.com:3-manifolds/PLink
Browse files Browse the repository at this point in the history
  • Loading branch information
culler committed Apr 6, 2023
2 parents ddec019 + c9470c8 commit db75644
Show file tree
Hide file tree
Showing 36 changed files with 28,051 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ plink_app/dmg-maker/PLink.dmg
plink_app/*.egg/
plink_src/doc/_static/*
plink.egg-info/*
plink_src/doc/
plink_src/doc/*.html
plink_src/doc/_sources/
plink_src/doc/searchindex.js
plink_src/doc/objects.inv
plink_src/doc/_images/
plink_src/doc/_images/
plink_src/plink.egg-info/
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ PLink is a full featured graphical editor for knot and link projections,
using the cross-platform GUI toolkit Tk. The primary focus is on
piecewise-linear link projections, but it also supports a "smooth
mode" and can export images in PostScript, PDF, SVG, and TikZ formats.
See the `PLink home page <https://t3m.math.uic.edu/plink/doc>`_
See the `PLink home page <https://3-manifolds.github.io/PLink>`_
for complete details.

This is a pure Python module and you can install it via
`pip <https://pip.pypa.io/en/latest/>`_.
See `the documentation
<https://t3m.math.uic.edu/plink/doc/installing>`_
<https://3-manifolds.github.io/PLink/installing>`_
for more.

You can browse the source code `here <https://github.com/3-manifolds/PLink>`_.
Expand Down
4 changes: 4 additions & 0 deletions docs/.buildinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: a2b77d2f05a5232ed18a2f2ab45e005c
tags: 645f666f9bcd5a90fca523b33c5a78b7
Empty file added docs/.nojekyll
Empty file.
Binary file added docs/_images/plink-action.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
128 changes: 128 additions & 0 deletions docs/_sources/index.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
.. PLink documentation master file, created by
sphinx-quickstart on Wed Apr 29 21:34:28 2009.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
How to use PLink
=================================

PLink draws piecewise linear link projections. Components may be
points, PL arcs, or PL circles. Line segments are oriented consistently in
each component. Different components are different colors.

.. image:: plink-action.png

Drawing Basics
------------------------------

* When using the mouse to draw a link with PLink, you should always
*click-and-release*. Do not hold the mouse button down while drawing.
PLink requires only the left mouse button.

* The default state of the editor is indicated by the arrow cursor.
In this state, click-and-release the left mouse button on the
background to place a starting vertex and begin drawing. The vertex
will be connected to the pencil cursor by a thin red line.
Click-and-release to place a second vertex. The two vertices will
then be joined by an edge. Continue to draw other vertices and edges
to your heart's content.

* To stop drawing, either click twice on the same vertex to create an
arc, or click on an endpoint vertex. The latter operation will
either create a circle component or join together two arc
components.

* When the cursor hovers over a vertex it changes to the open hand.
From this state you can drag a vertex to a new location with a
click-and-release on the vertex. The vertex will become enclosed in
a circular cursor. Move it to where you want it to go and click the
left (or middle) button to place it. If you drag one endpoint on
top of another, they will meld.

* Shift-clicking on a vertex will transform the crossing to a virtual
crossing, indicated by a black dot. Virtual link diagrams can be
used as input to Twister.

* When the cursor hovers over an edge, not too close to a vertex or
crossing, it changes to the push-me-pull-you cursor. Clicking in
this state will change the orientation of the component containing
the edge.

* When the cursor hovers over a crossing it changes to the yin-yang
recycling cursor. Clicking while in this state changes the the
handedness of the crossing.

* Double-clicking on an endpoint vertex will restart drawing from
that vertex. Double-clicking on a non-endpoint vertex will break
the link at that point and begin drawing with the old incoming edge.

* While in drawing state, hitting the Delete key removes the last
vertex before the cursor. If no vertices remain, the drawing state
ends and the active component is removed. This can be used to
remove a segment from the diagram. Double-click a vertex; hit
Delete to remove the incoming segment at that vertex; then click the
vertex again to reconnect.

* You will not be allowed to create edges that pass too close to a
vertex or a crossing, or to place vertices too close to edges or to
crossings or to other vertices. If you attempt to do any of these
things, *PLink will beep at you*.

Miscellaneous Features
---------------------------------

The window can be resized to allow for different sizes of link
projections, and the arrow keys can be used to slide the projection
around in order to make more room on one side or another. The keys
'+', '-', and '0' can be used to zoom in, zoom out, or resize the
diagram to fit the size of the window.

The "Tools" menu can be used to make the projection alternating
(provided that all components are circles), or to clear the screen, or
to reflect the projection in the xy-plane, changing all crossings.
The "Preserve diagram" option disables any operation which could
change the combinatorics of the diagram; a vertex can be moved, but it
cannot be moved across an edge and its adjacent edges cannot be moved
across a vertex. The "Smooth" option opens a new window with a smooth
version of the diagram, rendered with cubic Bezier splines. When used
within SnapPy, the "Tools" menu includes the "Send to SnapPy" command.

There also are options in the "Tools" menu for zooming or panning
the diagram, but these operations are usually more easily done with
the arrow keys or the '+', '-', and '0' keys.

The "File" menu can be used to save the projection as a SnapPea
link projection file. (This can be done from the drawing state as
well, in which case the "hot vertex" is remembered in the file!). The
"File->Open File" command will read a SnapPea link projection file,
and restart drawing if the projection was saved while drawing.

The "Info" menu selects information about the link projection to be
displayed in the info line at the bottom. Various encoding schemes
for link projections are supported, as well as the blackboard framing
curves, expressed in meridian-longitude coordinates. Cutting and
pasting from the info line is supported. The numerical and
alphabetical Dowker-Thistlethwaite codes are displayed in an extended
form which includes a full description of the planar embedding. The
string printed in the info line is also accepted as input to SnapPy's
Manifold constructor. Paste the DT code between the apostrophes in
Manifold(''). The "DT labels" option displays the indexing used in
computing the Dowker-Thistlethwaite codes.

Credits
=============

Written by `Marc Culler <http://math.uic.edu/~culler>`_ and `Nathan Dunfield <http://dunfield.info>`_.

Contents
============

.. toctree::
:maxdepth: 2

installing
plink


45 changes: 45 additions & 0 deletions docs/_sources/installing.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
.. Installing PLink
Installing and running PLink
======================================================

Mac OS X
---------------

Simply download `PLink.dmg <http://math.uic.edu/t3m/plink/PLink.dmg>`_
and copy PLink.app to the Applications folder. Double-click to start
it, just like any other application.

Windows
-------------------

Install `Python <http://python.org>`_ and use `pip
<https://pip.pypa.io/en/latest/>`_ (included in recent versions) to
get plink. For example::

pip install plink
python -m plink.app

-------------------------------------------------------

You will need to have Python (> 2.4), Tk (>= 8.4), and Tkinter
installed to run plink; for instance, if you are using Debian or
Ubuntu, just install the package "python-tk".

If you have root privileges and `pip <https://pip.pypa.io/en/latest/>`_, simply do::

pip install plink

This installs a shell-command called "plink" which starts PLink.

If you don't have root privileges, add the "--user" flag to the end of
the above install command. You can then run plink via::

python -m plink.app


Source code
-----------------------------------

You can download and browse the source code
`here <https://github.com/3-manifolds/PLink>`_.
29 changes: 29 additions & 0 deletions docs/_sources/plink.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
.. Technical documentation for the plink module.
plink -- A Python/Tk link editor
======================================================

Technical documentation of the Python objects that underly PLink. Of
interest only to Marc, Nathan, or similar folks.

.. automodule:: plink
.. autoclass:: LinkEditor
:members:
:undoc-members:

.. automodule:: plink.arrow
.. autoclass:: Arrow
:members:
:undoc-members:

.. automodule:: plink.crossings
.. autoclass:: Crossing
:members:
:undoc-members:
.. autoclass:: ECrossing
:members:
:undoc-members:




134 changes: 134 additions & 0 deletions docs/_static/_sphinx_javascript_frameworks_compat.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
/*
* _sphinx_javascript_frameworks_compat.js
* ~~~~~~~~~~
*
* Compatability shim for jQuery and underscores.js.
*
* WILL BE REMOVED IN Sphinx 6.0
* xref RemovedInSphinx60Warning
*
*/

/**
* select a different prefix for underscore
*/
$u = _.noConflict();


/**
* small helper function to urldecode strings
*
* See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent#Decoding_query_parameters_from_a_URL
*/
jQuery.urldecode = function(x) {
if (!x) {
return x
}
return decodeURIComponent(x.replace(/\+/g, ' '));
};

/**
* small helper function to urlencode strings
*/
jQuery.urlencode = encodeURIComponent;

/**
* This function returns the parsed url parameters of the
* current request. Multiple values per key are supported,
* it will always return arrays of strings for the value parts.
*/
jQuery.getQueryParameters = function(s) {
if (typeof s === 'undefined')
s = document.location.search;
var parts = s.substr(s.indexOf('?') + 1).split('&');
var result = {};
for (var i = 0; i < parts.length; i++) {
var tmp = parts[i].split('=', 2);
var key = jQuery.urldecode(tmp[0]);
var value = jQuery.urldecode(tmp[1]);
if (key in result)
result[key].push(value);
else
result[key] = [value];
}
return result;
};

/**
* highlight a given string on a jquery object by wrapping it in
* span elements with the given class name.
*/
jQuery.fn.highlightText = function(text, className) {
function highlight(node, addItems) {
if (node.nodeType === 3) {
var val = node.nodeValue;
var pos = val.toLowerCase().indexOf(text);
if (pos >= 0 &&
!jQuery(node.parentNode).hasClass(className) &&
!jQuery(node.parentNode).hasClass("nohighlight")) {
var span;
var isInSVG = jQuery(node).closest("body, svg, foreignObject").is("svg");
if (isInSVG) {
span = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
} else {
span = document.createElement("span");
span.className = className;
}
span.appendChild(document.createTextNode(val.substr(pos, text.length)));
node.parentNode.insertBefore(span, node.parentNode.insertBefore(
document.createTextNode(val.substr(pos + text.length)),
node.nextSibling));
node.nodeValue = val.substr(0, pos);
if (isInSVG) {
var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect");
var bbox = node.parentElement.getBBox();
rect.x.baseVal.value = bbox.x;
rect.y.baseVal.value = bbox.y;
rect.width.baseVal.value = bbox.width;
rect.height.baseVal.value = bbox.height;
rect.setAttribute('class', className);
addItems.push({
"parent": node.parentNode,
"target": rect});
}
}
}
else if (!jQuery(node).is("button, select, textarea")) {
jQuery.each(node.childNodes, function() {
highlight(this, addItems);
});
}
}
var addItems = [];
var result = this.each(function() {
highlight(this, addItems);
});
for (var i = 0; i < addItems.length; ++i) {
jQuery(addItems[i].parent).before(addItems[i].target);
}
return result;
};

/*
* backward compatibility for jQuery.browser
* This will be supported until firefox bug is fixed.
*/
if (!jQuery.browser) {
jQuery.uaMatch = function(ua) {
ua = ua.toLowerCase();

var match = /(chrome)[ \/]([\w.]+)/.exec(ua) ||
/(webkit)[ \/]([\w.]+)/.exec(ua) ||
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) ||
/(msie) ([\w.]+)/.exec(ua) ||
ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) ||
[];

return {
browser: match[ 1 ] || "",
version: match[ 2 ] || "0"
};
};
jQuery.browser = {};
jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true;
}
Loading

0 comments on commit db75644

Please sign in to comment.