jaykalinani / penrose

Create beautiful diagrams just by typing mathematical notation in plain text.

Home Page:https://penrose.ink

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Penrose Build codecov code style: prettier license Twitter: @UsePenrose

Penrose is an early-stage system that is still in development. Our system is not ready for contributions or public use yet, but hopefully will be soon. Send us an email if you're interested in collaborating.

  • See the site for more information and examples.
  • See the wiki for more system-specific information on building, running, testing, and debugging the system.
  • For even more documentation, see Nimo Ni's README.

Example

Here's a simple Penrose visualization in the domain of set theory.

It's specified by the following Substance and Style programs.

  • tree.sub

    Set A
    Set B
    Set C
    Set D
    Set E
    Set F
    Set G
    Subset B A
    Subset C A
    Subset D B
    Subset E B
    Subset F C
    Subset G C
    NoIntersect E D
    NoIntersect F G
    NoIntersect B C
    
  • venn.sty

    Set x {
        shape = Circle { }
        constraint contains(x, x.label)
    }
    
    Intersect x y {
        constraint overlapping(x, y)
        constraint disjoint(y.label, x)
        constraint disjoint(x.label, y)
    }
    
    NoIntersect x y {
        constraint nonOverlapping(x, y)
    }
    
    Subset x y {
        constraint contains(y, x)
        constraint smallerThan(x, y)
        constraint disjoint(y.label, x)
    }
    
    NoSubset x y {
        objective repel(x, y)
        constraint disjoint(x, y)
        constraint disjoint(y.label, x)
        constraint disjoint(x.label, y)
        constraint nonOverlapping(x, y)
    }
    

Here's how the optimization looks live in the UI.

About

Create beautiful diagrams just by typing mathematical notation in plain text.

https://penrose.ink

License:MIT License


Languages

Language:TypeScript 91.3%Language:Nearley 2.9%Language:JavaScript 2.2%Language:Pug 0.9%Language:CSS 0.6%Language:Emacs Lisp 0.5%Language:HTML 0.5%Language:ASL 0.4%Language:TeX 0.3%Language:Vim Script 0.3%Language:Shell 0.1%Language:Batchfile 0.0%