GithubHelp home page GithubHelp logo

yonahgoldberg / penrose Goto Github PK

View Code? Open in Web Editor NEW

This project forked from penrose/penrose

0.0 0.0 0.0 516.34 MB

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

Home Page: https://penrose.cs.cmu.edu

License: MIT License

Shell 0.07% JavaScript 0.91% Emacs Lisp 0.38% TypeScript 71.31% CSS 1.60% HTML 17.39% Batchfile 0.01% Pug 0.66% Vim Script 0.22% Nearley 2.21% Vue 0.24% Rust 2.53% Mathematica 2.48%

penrose's Introduction

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

Penrose is a platform that enables people to create beautiful diagrams just by typing mathematical 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.

Check out our SIGGRAPH '20 paper and video on Penrose!

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 PlumvilleCapybara104):

  • setTheory.domain:

    type Set
    
    predicate Not(Prop p1)
    predicate Intersecting(Set s1, Set s2)
    predicate IsSubset(Set s1, Set s2)
    
  • tree.substance:

    Set A, B, C, D, E, F, G
    
    IsSubset(B, A)
    IsSubset(C, A)
    IsSubset(D, B)
    IsSubset(E, B)
    IsSubset(F, C)
    IsSubset(G, C)
    
    Not(Intersecting(E, D))
    Not(Intersecting(F, G))
    Not(Intersecting(B, C))
    
    AutoLabel All
    
  • venn.style:

    canvas {
      width = 800
      height = 700
    }
    
    forall Set x {
      x.icon = Circle {
        strokeWidth : 0
      }
    
      x.text = Equation {
        string : x.label
        fontSize : "25px"
      }
    
      ensure contains(x.icon, x.text)
      encourage sameCenter(x.text, x.icon)
      x.textLayering = x.text above x.icon
    }
    
    forall Set x; Set y
    where IsSubset(x, y) {
      ensure smallerThan(x.icon, y.icon)
      ensure disjoint(y.text, x.icon, 10)
      ensure contains(y.icon, x.icon, 5)
      x.icon above y.icon
    }
    
    forall Set x; Set y
    where Not(Intersecting(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.

penrose's People

Contributors

apatriarca avatar cmumatt avatar dependabot[bot] avatar dormaayan avatar dsm0 avatar epost avatar geometrycollective avatar heleaf avatar hsharriman avatar jhvst avatar jiriminarcik avatar joshpoll avatar joshsunshine avatar keenancrane avatar liangyiliang avatar lmxlucy avatar maxkrieger avatar miyehn avatar mystic5pirit avatar rhit-chois3 avatar samestep avatar shellhal avatar strout18 avatar wodeni avatar ziyaowei avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.