MCPcopy
hub / github.com/penrose/penrose

github.com/penrose/penrose @v3.3.0 sqlite

repository ↗ · DeepWiki ↗ · release v3.3.0 ↗
2,108 symbols 5,880 edges 276 files 50 documented · 2%
README

Penrose npm (scoped) license Build Discord Twitter: @UsePenrose

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.

Extension points exported contracts — how you extend this code

Arc (Interface)
internal: half of an edge, where direction and one node are implicit
packages/core/src/utils/Graph.ts
MultiChoiceProblemProps (Interface)
(no doc)
packages/components/src/MultipleChoiceProblem.tsx
Preset (Interface)
(no doc)
packages/edgeworth/src/examples.ts
Trio (Interface)
(no doc)
packages/roger/index.ts
DragWidgetProps (Interface)
(no doc)
packages/editor/src/components/InteractiveWidget.tsx
BoolSignal (Interface)
(no doc)
packages/solids/src/util.ts
Contributor (Interface)
(no doc)
packages/docs-site/src/contributors.data.ts
Style (Interface)
(no doc)
packages/examples/src/index.ts

Core symbols most depended-on inside this repo

mul
called by 644
packages/bloom/src/core/computation.ts
realT
called by 263
packages/core/src/utils/Util.ts
noWarn
called by 253
packages/core/src/utils/Util.ts
real2T
called by 199
packages/core/src/utils/Util.ts
valueT
called by 198
packages/core/src/utils/Util.ts
get
called by 181
packages/core/src/utils/Graph.ts
floatV
called by 126
packages/core/src/utils/Util.ts
ifCond
called by 122
packages/core/src/engine/AutodiffFunctions.ts

Shape

Function 1,677
Interface 308
Method 84
Class 36
Enum 3

Languages

TypeScript100%
Python1%

Modules by API surface

packages/bloom/src/core/computation.ts204 symbols
packages/core/src/compiler/Style.ts118 symbols
packages/core/src/utils/Util.ts97 symbols
packages/core/src/lib/Functions.ts79 symbols
packages/core/src/types/errors.ts77 symbols
packages/core/src/compiler/Substance.ts69 symbols
packages/core/src/engine/EngineUtils.ts48 symbols
packages/edgeworth/src/analysis/SubstanceAnalysis.ts45 symbols
packages/edgeworth/src/synthesis/Mutation.ts43 symbols
packages/core/src/utils/Error.ts39 symbols
packages/edgeworth/src/synthesis/Synthesizer.ts31 symbols
packages/core/src/lib/Constraints.ts31 symbols

Dependencies from manifests, versioned

@babel/cli7 · 1×
@babel/core7.18.0 · 1×
@babel/preset-typescript7 · 1×
@datastructures-js/queue4.1.3 · 1×
@lezer-unofficial/printer1.0.1 · 1×
@lezer/generator1.7.0 · 1×
@material-ui/core4.12.3 · 1×
@mdx-js/preact2.1.5 · 1×
@penrose/bloom3.3.0 · 1×
@penrose/core3.3.0 · 1×
@penrose/editor3.3.0 · 1×

For agents

$ claude mcp add penrose \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact