Giter VIP home page Giter VIP logo

dry-draw's Introduction

DRYDraw

Don't Repeat Yourself when making drawings!

DRYDraw allows you to create a template SVG file to represent many permutations of the same drawing. You can embed logical expressions wrapped in @(...) into @if attributes and string content. An API located here evaluates the expressions and replaces parameters with given values. This templating engine does NOT throw errors for undefined parameters. It simply outputs them as @(...) expressions. The end result is the ability to make one drawing represent all permutations.

Features

  • Supports the following operations (try them out!):
    • Arithmetic:
      • @(a - b / 2 + 4 * a)
      • @(2**a - b)
    • Logic
      • @(a <= b)
      • @(a > b ? 3 : 5)
    • String
      • @(a == "a string")
  • Displays output SVG
    • Conditional elements are indicated visually
    • Mouse over the image to conditions for elements
  • Supports other common templating features like loops and instantiation

app-screenshot

Technologies used

  • React.js
  • Sinatra
  • ReDuxml - I wrote this a while ago and this app is a showcase for its features
  • React-Designer - My fork of an unmaintained project by Fatih Erikli
  • SVGInline
  • axios
  • Firebase for front-end deployment
  • Heroku for back-end deployment

Future development

  • Front-end
    • Visual editor has bug where state does not update for newly selected object
    • User authentication
    • Save history of SVG transforms to Firebase
    • Navigate through transform history
    • Let user define default parameter values
    • Better transitions for unneeded parts of interface
    • More built in examples
    • Allow SVGs of any size
    • Re-incorporate other SVG editing features from original React-Designer
    • Use basic regex parsing to ensure expression is valid
  • Back-end
    • Back end is seeing a mysterious query param: {“captures”: []}
    • Support more string operations
    • Have HTML landing page for API users
    • Get CORS working for all use cases
    • Support enum parameters

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.