virtual_knitting_machine.visualizer.knitting_machine_state_visualizer module
Contains the Knitting Visualizer class.
- format_svg(svg_file)[source]
Processes a given svg file and adds whitespace to make it human-readable. White space includes new lines for every tag and tabs to show which tags are within other tags. :param svg_file: The name of the svg file to reformat :type svg_file: str
- class Knitting_Machine_State_Visualizer(machine_state, diagram_settings=None)[source]
Bases:
objectRenders a given knitting machine state in an SVG format similar to diagrams used ACT Lab publications.
- __init__(machine_state, diagram_settings=None)[source]
- Parameters:
machine_state (Knitting_Machine_State) – The machine state to render. Should be a Knitting_Machine or a snapshot.
diagram_settings (Diagram_Settings) – The diagram settings for this rendering.
- property size: tuple[float, float]
Returns: tuple[float, float]: The size of this diagram by its width and height.