Code Monkey home page Code Monkey logo

drakon-renderer's Introduction

drakon-renderer

Haskell drakon renderer.

troubleshooting mode off

diagram

troubleshooting mode on

diagram

syntax

Proposed input syntax to be converted to diagram images:

Title t "title - description"
Action a1 "action - description"
End e "end - description"

t > a1
a1 > e

This would render something like the following mermaid:

stateDiagram-v2
state "title - description" as title
state "action - description" as action1
state "end - description" as end

title --> action1
action1 --> end

So two sections:

  • icon definitions
  • icon connections

But this is subject to change.

terminology

  • title - first step of a diagram
  • end - last step of a diagram
  • action - "do X" non-branching action, basic building block of a diagram
  • question - branching step with two possible outcomes:
    • yes
    • no

source 1

source 2

development environment

command description
./host.sh starts development environment
./build.sh builds and lints code
./run.sh runs code
hlint . scans the whole current directory with hlint
exit terminates development environment

resources

drakon-renderer's People

Contributors

piotrjustyna avatar

Stargazers

 avatar

Watchers

 avatar  avatar

drakon-renderer's Issues

text in steps

Introduce text in steps:

  • fixed max length
  • monospace
  • text should fit in all types of steps (lower and upper case)

cabal project

Time to extract some modules (e.g. constants, shapes, etc.). Cabal project seems reasonable.

make as build system

Optional, but would be really good to learn it instead of depending on chained cli commands.

use maps instead of lists

uniqueCoordinates :: Tree Step -> Double -> Double -> [(OriginCoordinates, Diagram B)] -> [(OriginCoordinates, Diagram B)]

Should ideally be converted to map as rendering can get expensive. Don't touch until we have:

  • good telemetry
  • significantly more complex diagrams

Replacing lists with maps should bring performance benefits, let's just make sure we can measure them first.

connections to multiple parents

At the moment I only have one parent per icon. Drakon diagrams allow for multiple connections to many parents, so this rendered will need it.

Let's start with one end icon being reachable from different steps.

multiple connections to end step

All step types bar the start type can have multiple steps connecting to it.

The challenge is going to be to:

  • position
  • connect

them all.

debug mode

What would be very handy is a debug mode in which we should render:

  • icon origin (icon marking where the rendering originates)
  • icon payload
  • rendering order
  • max width

implement decision step

Something like this: source: https://drakonhub.com/how-to-flowchart

  • decision rendered - single outcome, treat as a regular command step
  • chain: command -> decision -> command, fixed layouting
  • chain: command -> decision -> decision * N -> command, fixed layouting
  • automatic layouting
  • step dimensions expressed as cell proportions (already done with command steps)
  • automatic custom connections
  • decision outcome connections to next steps should be decorated with yes/no

where N is an arbitrary, finite, positive number, say in range 0-10.

start and end steps

  • introduce start and end steps
  • connect them to regular steps
  • rethink the idea of a regular step, we probably need something more specialised

String -> [Icon] input

Today we have:

String -> [Icon]

as input. Now we need:

String -> [Icon]

so that we can move on to actually formulating functional graphs from the parsed strings.

N parents where N > 1 and N < 10

Let's treat 10 as a magic number for the current stages of the project. Once more mature, the I can start experimenting with raising that number, but for now it's sufficient.

change how debugging info is displayed

At the moment rendered icon messages are displayed like this:

"quetion 1 | rendering order: 3 | max width: 0.0"

we can probably do better by displaying that information in multiple lines:

"quetion 1
rendering order: 3
max width: 0.0"

As a result, we could fit more text per icon or increase font size.

more convenient input

At the moment there is only one graph and it’s all hardcoded. It would be very convenient to have some sort of input graph string to enable quicker iterations.

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.