flins.visualize package

Submodules

flins.visualize.flat_render module

Support for rendering the tracts (and proteins within them) at the current timestep as an SVG. When changing this, [a list of named colors](https://www.december.com/html/spec/colorsvg.html) is useful.

flins.visualize.flat_render.plot_world(world, params={})[source]

Plot a world as a flat, unrolled, svg :Parameters: * world (flins.construct.World) – World to render as svg

  • params (dict keys in (y_span, y_sep, xm, ym)) – Set how tall tracts are (y_span), how far apart they are (y_sep), and the multipliers used to convert SVG units to pixels (ym, xm)

flins.visualize.movie module

Support for movie generation

class flins.visualize.movie.MovieGen(outname='out', temp_dir=None, fps=25, zoom=(1.0, 1.0), quiet=False)[source]

Bases: object

Generate a movie from a set of steps in the world or SVGs

Support the creation of movies from runs

Parameters
  • outname (str (out)) – Relative path for the output file

  • temp_dir (str) – Dir where we’ll do our work, deleted on exit if not specified

  • fps (int) – How many frames per sec for resulting movie

  • zoom (tuple of floats) – x and y zoom levels

  • quiet (boolean) – don’t show current status if True

add_svg(dwg)[source]

Render an svg to the temp dir

add_world(world)[source]

Add a world and render it as an svg

clean_up()[source]

Delete the temporary renders and the temp dirs if they were automatically created

show()[source]

Use ipython to display movie, intended for use in notebooks

write_movie()[source]

Convert svgs to pngs and then to an mp4 via ffmpeg

flins.visualize.svg module

Support for saving and displaying SVGs

flins.visualize.svg.display(dwg)[source]

Save to a temporary file and open (only on MacOS)

Parameters

dwg (SVG write.Drawing) – SVG to render to disk and open in Safari

flins.visualize.svg.jupyter(dwg)[source]

Show the drawing in jupyter

Parameters

dwg (SVG write.Drawing) – SVG to render via IPython.display

flins.visualize.svg.save(dwg, filename)[source]

Save an SVGA to a local file

Parameters
  • dwg (SVG write.Drawing) – SVG to render as a string and save to disk

  • filename (str) – Local filename to save to. Will append ‘.svg’ if not present.

flins.visualize.vis_actin module

Plot fancy versions of our proteins on matplotlib axes

This was transferred here from the protein classes themselves and is mostly for storage at this point.

flins.visualize.vis_actin.plot_actin(actin, ax=None, show=False, y=0)[source]

Plot an actin filament on an axis

flins.visualize.vis_space module

Plot things about our hex spaces and their tracts on matplotlib axes

flins.visualize.vis_space.plot_tractspace(ts, callback=None, show=False)[source]

Plot the tracts and what’s in them, optionally using a callback

Module contents