penrose /penrose
Create beautiful diagrams just by typing notation in plain text.
★ 8,015⑂ 363👁 115⑃ 1,200● 774▤ 15
+2
Daily
+3
Weekly
+22
Monthly
8,015
stars
363
forks
115
watchers
1,200
prs
774
issues
15
releases
README
Penrose
Penrose is a platform that enables people to
create beautiful diagrams just by typing notation in plain
text. The goal is to make it easy for non-experts to create and explore
high-quality diagrams and provide deeper insight into challenging technical
concepts. We aim to democratize the process of creating visual intuition.
Usage
You can try Penrose in your browser
without any installation. For a more detailed step-by-step introduction, check
out our tutorials. Or, for
more reference-style information, take a look at our
documentation.
Example
Here's a simple Penrose visualization in the domain of set theory.
It's specified by the following trio of Domain, Substance, and Style programs
(with variation MonsoonCaterpillar95943):
- setTheory.domain:
type Set
predicate Disjoint(Set s1, Set s2)
predicate Intersecting(Set s1, Set s2)
predicate Subset(Set s1, Set s2)
- tree.substance:
Set A, B, C, D, E, F, G
Subset(B, A)
Subset(C, A)
Subset(D, B)
Subset(E, B)
Subset(F, C)
Subset(G, C)
Disjoint(E, D)
Disjoint(F, G)
Disjoint(B, C)
AutoLabel All
- euler.style:
canvas {
width = 800
height = 700
}
forall Set x {
shape x.icon = Circle { }
shape x.text = Equation {
string : x.label
fontSize : "32px"
}
ensure contains(x.icon, x.text)
encourage norm(x.text.center - x.icon.center) == 0
layer x.text above x.icon
}
forall Set x; Set y
where Subset(x, y) {
ensure disjoint(y.text, x.icon, 10)
ensure contains(y.icon, x.icon, 5)
layer x.icon above y.icon
}
forall Set x; Set y
where Disjoint(x, y) {
ensure disjoint(x.icon, y.icon)
}
forall Set x; Set y
where Intersecting(x, y) {
ensure overlapping(x.icon, y.icon)
ensure disjoint(y.text, x.icon)
ensure disjoint(x.text, y.icon)
}
Contributing
See CONTRIBUTING.md.
License
This repository is licensed under the MIT License.Top issues
#608js/npm library?18 comments · 2021-06-25#763Restore sugared syntax / `notation`17 comments · 2022-01-06#1824feat: Add generic SVG `Element` shape to Style12 comments · 2024-07-05#1329Transformations10 comments · 2023-03-01#744Add a `symmetric` keyword to Domain predicates9 comments · 2022-01-03#1726Multiplicity in Domain type declarations8 comments · 2024-03-22#1070Stack overflow with too many substance objects8 comments · 2022-07-22#786Provide more structured/editable SVG output8 comments · 2022-01-07
Discussions
#1875rehype plugin for penrose0 comments · 2025-01-24#1861Using penrose and bloom in Observable Framework?2 comments · 2024-09-25#1615Offline use is more painful that is needs to be2 comments · 2023-08-20#949About mathematical funtions in Penrose4 comments · 2022-05-05#938yarn start Failure2 comments · 2022-04-25#719How does penrose compare to Metapost or Tikz?1 comments · 2021-12-26#679Lists in Substance and Style0 comments · 2021-11-03#653Bucket list issues0 comments · 2021-09-29
Latest release
v3.3.1 v3.3.1 2026-08-30What's Changed fix: Got Minimal Firefox support up and running by @RandomGamingDev in https://github.com/penrose/penrose/pull/1952 fix: swapped arguments for contains() call in predicates tutorial by @Galm007 in https://github.com/penrose/penrose/pull/1953 build: support Node 20 installs by @wodeni in https://github.com/penrose/penrose/pull/1959 fix(bloom): import Text shape type in DiagramBuilder by @jiwonMe in https://github.com/penrose/penrose/pull/1962 feat(bloom): add subtype selector matching by @jiwonMe in https://github.com/penrose/penrose/pull/1964 fix(editor): eliminated