Giter Site home page Giter Site logo

shamansir / genui Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 223 KB

Describe UI structure for generative graphics with universal configuration files

Home Page: https://package.elm-lang.org/packages/shamansir/genui/latest/

License: MIT License

Dhall 32.30% Shell 0.11% HTML 1.87% JavaScript 6.79% Elm 58.93%

genui's Introduction

GenUI

GenUI means Generative User Interface (Definition). It appeared from thought that many controls for generative graphics and art, which we produce at CAI, have a similar number of common inputs (number, text, color, X/Y, etc.), and this kind of UI commonly has such inputs grouped in folders. So we decided that may be we may abstract from visual representation of those and define their properties in some unified way. It provides us with the ability to switch between many implementations, such as dat.gui or Tron and to switch between specific sets of controls as well (i.e. a set for development and a set for production).

The definition is very minimal and presented in both DHALL and Elm languages, yet for the moment they are not checked in terms that they produce the same result.

For an example of such definition, see gradient.dhall.

DHALL version may produce JSON and YAML representations.

Elm version may:

  • Produce
    • JSON definition;
    • YAML definition;
    • Descriptive definition;
    • (soon) DHALL definition;
    • A graph of controls with folders as branches and controls as nodes;
    • JSON with current values from the UI;
    • YAML with current values from the UI;
  • Parse
    • JSON definition;
    • YAML definition;
    • JSON with new values to apply to the UI;
    • YAML with new values to apply to the UI;

The JSON variant is considered as the specification of the language schema. Also, JSON schema is added to test the produced definitions on similarity and according to current version.

Generate example

Install dhall-to-json and dhall-to-yaml. (How to install)

For MacOS, it is:

brew install dhall-to-json dhall-to-yaml

And run:

sh ./generate-yaml.sh gradient
sh ./generate-json.sh gradient

Test according to schema

npm install -g ajv-cli or brew install ajv

sh ./test-json.sh gradient
sh ./test-json.sh gradient.dev

Demo

Run elm reactor in the cloned repository and open src/Demo.elm. Copy and paste a JSON there.

genui's People

Watchers

 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.