GithubHelp home page GithubHelp logo

thirs / graph-editor-web Goto Github PK

View Code? Open in Web Editor NEW

This project forked from amblafont/graph-editor-web

0.0 0.0 0.0 981 KB

An online graph editor written in Elm

Home Page: https://amblafont.github.io/graph-editor/index.html

License: MIT License

HTML 13.13% Elm 66.75% JavaScript 1.16% TeX 16.36% TypeScript 2.53% Makefile 0.06%

graph-editor-web's Introduction

A diagram editor in your browser. Try it out: https://amblafont.github.io/graph-editor/index.html. See https://www.youtube.com/watch?v=iWSw4RK8wEk and https://amblafont.github.io/articles/yade.pdf for a short presentation.

To test offline: open index.html in your browser. The button "open directory" might not work because of the file system API security restrictions, unless you open the page on a local web server. Alternatively you can install the web application (an install button will show up at the top of the html file if your browser allows it).

There is also a vscode extension which embeds the web app to provide Coq mechanisation features (see https://github.com/amblafont/vscode-yade-example).

Easy editing of latex documents

The button "open directory" offers easy editing of diagrams in latex documents (see the directory tools/ for an example). It relies on the files system API, so it does not work (yet?) with Firefox or Safari. You must pick a directory which includes a file "yade-config.json". This file must contain a field "watchedFile" which indicates the file to be watched. Other fields may be specified: check the top of the file watcher.ts.

Compiling the web app

  • elm make src/Main.elm --output=elm.js
  • tsc watcher.ts

(or download the latest elm.js and watcher.js from https://amblafont.github.io/graph-editor/elm.js and https://amblafont.github.io/graph-editor/watcher.js)

Ipc capabilities

(This section may be slightly outdated.)

This is also the interface used for communicating when it is embeded in a vscode webview.

Examples:

  • sends { key : "incomplete-equation", content: {statement :"{ f ; {_} = {_}}", script:string } when pressing 'I' on a selected diagram with two unnamed arrows.
  • sends { key : "generate-proof", content: coq-script } when generating a coq script from the diagram
  • receives { key : 'load', content: content} where content is a json graph or an equation of the user-friendly format, and loads it in the editor
  • sends { key : "apply-proof", content: {statement:"{ f ; {_} = {_}}", script:string } } when pressing 'I' on a selected proof node in a diagram
  • receives { key: "applied-proof", content : {statement : string, script: string} } Three cases: If a subdiagram or a proof node is selected, unifies the statement with the unnamed arrows and add (or mark it as validated) the proof node If a chain is selected, creates the other branch and the proof node

graph-editor-web's People

Contributors

amblafont avatar thirs 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.