huygens
This is a python package for drawing diagrams. Intended to have multiple backends, currently the only backend implemented uses cairo. Perhaps there will also be a PyX backend, or a TikZ backend.
The huygens package can also include text from via pdftex, pdflatex, xetex or xelatex.
The huygens.box and huygens.diagram modules build on the basic graphics primitives to define composable elements. Geometry and layout of these elements is generated using a linear constraint solver. Therefore, this system becomes a declarative graphics layout package.
The huygens package is at an early stage of development, so expect things to change drastically and without warning.
User guide
huygens Basic drawing functions. Lines, curves, text and so on.
huygens.turtle A simple Turtle class for sequentially building paths. Also fun.
huygens.sat A convenient interface to a linear programming constraint solver. Currently uses scipy.optimize.linprog
huygens.box
Structure figures into rectangular Box
s.
Various ways of combining these: HBox
, VBox
, TableBox
, etc.
The layout is determined by constraints, and so this uses
the huygens.sat
module.
huygens.diagram
Building on the box
module to make string diagrams.
See also
Some related projects:
Foundations of brick diagrams Describes horizontal and vertical composition of string diagrams.
diagrams A declarative, domain-specific language written in Haskell.
Compose.jl A declarative vector graphics library for Julia.
Experiments in Constraint-based Graphic Design Describes a DSL called "Basalt" written in Python, based on the logic of non-linear real arithmetic, which is an extension of linear programming. No code available.
Penrose "Create beautiful diagrams just by typing mathematical notation in plain text." Source here Written in Haskell. Users not welcome (yet).
Graphviz Declarative language for rendering heirarchical data structures. Apparently "20 year old code that was basically a prototype that escaped from the lab". See also this blog post.
TikZ Possibly the most widely used package for creating graphics for integration with latex documents.
Asymptote A custom language for doing vector graphics inspired by MetaPost.
manim Primarily used for animations, this library also has an interface to latex. It also is a python library using pycairo.
Copyright (c) 2018 - 2021.