piotrjustyna / drakon-renderer Goto Github PK
View Code? Open in Web Editor NEW(string -> svg drakon diagram) type of thing
License: MIT License
(string -> svg drakon diagram) type of thing
License: MIT License
Something like this: source: https://drakonhub.com/how-to-flowchart
N
-> command, fixed layoutingwhere N
is an arbitrary, finite, positive number, say in range 0-10.
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.
Optional, but would be really good to learn it instead of depending on chained cli commands.
What would be very handy is a debug mode in which we should render:
Some good examples here: https://drakonhub.com/drakon-examples
Buy a puppy
example looks especially interesting - relatively simple and easy to render using just sdoc ppr.
Introduce text in steps:
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.
Now it serves no purpose, steps don’t need names in the current implementation.
I feel I could use more guidance regarding code formatting and linting. It could also be useful for ci. I read here: https://analysis-tools.dev/tag/haskell that hlint is recommended and it also looks to be easy to install since we now have cabal fully leveraged.
https://github.com/ndmitchell/hlint/blob/master/README.md#installing-and-running-hlint
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:
Replacing lists with maps should bring performance benefits, let's just make sure we can measure them first.
properties:
Point V2 Double
)At the moment the connections need to be performed one by one. It would be good to automatically connect all steps.
Now that I'm preparing to implement decisions, a tree would be a much better data structure to represent diagrams.
All step types bar the start type can have multiple steps connecting to it.
The challenge is going to be to:
them all.
Time to extract some modules (e.g. constants, shapes, etc.). Cabal project seems reasonable.
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.
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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.