Module KhipuDraw
[hide private]
[frames] | no frames]

Module KhipuDraw

source code

KhipuDraw.py generates eps, svg, and/or pdf drawings of khipu.

Some examples of its use:

KhipuDraw.py --help
KhipuDraw.py UR001  ## generate out/UR001.eps and out/UR001.pdf
KhipuDraw.py -f eps UR001  ## generate out/UR001.eps
KhipuDraw.py -f svg UR001  ## generate out/UR001.svg
KhipuDraw.py -o foo UR001  ## generate foo/UR001.{eps,pdf}
KhipuDraw.py all  ## generate out/*.{eps,pdf}
KhipuDraw.py -d yourdatabase ...  ## use custom database


Classes [hide private]
  AccuratePrimaryCord
Draw primary cord with accurate horizontal spacing.
  KhipuTreeAccurateVertical
Hierarchical drawing of a khipu with accurate vertical spacing.
  KhipuKnotTreeAccurateVertical
  CordColormap
  SpecialCordColormap
  PopularCordColormap
  MultiletterPopularCordColormap
  Labelmap
  StringLabelmap
  NumberLabelmap
Functions [hide private]
 
draw_X(ps, x, y, radius) source code
 
dot_knot(type, turns) source code
 
simple_knot_S(ps, knot_key, (x, y, outer_width, inner_ratio, stroke_color, fill_color)) source code
 
reflect_knot(ps, knot, knot_key, (x, y, outer_width, inner_ratio, stroke_color, fill_color)) source code
 
simple_knot_Z(ps, (type, turns, direction), params) source code
 
figure_eight_knot_Z(ps, knot_key, (x, y, outer_width, inner_ratio, stroke_color, fill_color)) source code
 
figure_eight_knot_S(ps, (type, turns, direction), params) source code
 
long_2_knot_S(ps, knot_key, (x, y, outer_width, inner_ratio, stroke_color, fill_color)) source code
 
long_knot_S(k) source code
 
long_knot_Z(k) source code
 
cached_knot(ps, knot, (type, turns, direction), (x, y, outer_width, inner_ratio, stroke_color, fill_color)) source code
 
default_filename(khipu, **options) source code
 
render_svg(khipu, **options) source code
 
render_ps(khipu, **options) source code
 
render_vector(khipu, ps, ext, **options) source code
 
render_pdf(khipu, **options) source code
 
render(khipu, **options) source code
 
main() source code
Variables [hide private]
  ps_centimeter = 28.3464567
  special_strings = {'S1 E': (1, 0, 0), 'S1 L2': (1, 0, 0), 'S1 ...
  knotCache = {}
Variables Details [hide private]

special_strings

Value:
{'S1 E': (1, 0, 0),
 'S1 L2': (1, 0, 0),
 'S1 L3': (1, 0, 0),
 'S1 L4': (1, 0, 0),
 'S1 L5': (1, 0, 0),
 'S1 L6': (1, 0, 0),
 'S1 L7': (1, 0, 0),
 'S1 L8': (1, 0, 0),
...