GithubHelp home page GithubHelp logo

fancy-mermaid's Introduction

fancy-mermaid

tool for making fancy mermaid graphs

two nodes relations

image

example code

# ********* create nodes *********
some = Node('some', max_inputs=1, max_outputs=1)
thing = Node('thing', max_inputs=0, max_outputs=1)
here = Node('here', max_inputs=2, max_outputs=0)
they = Node('they', max_inputs=3, max_outputs=2)
this = Node('this', max_inputs=1, max_outputs=3)
meow = Node('meow', max_inputs=3, max_outputs=1)
mandy = Node('mandy', max_inputs=1, max_outputs=1)
candy = Node('candy', max_inputs=1, max_outputs=1)
nodes = [some, thing, here, they, this, meow, mandy, candy]

# ********* create fancy mermaid *********
fancy = Fancy(nodes)
fancy.roll(quiet=False)
mermaid = fancy.make_mermaid(brackets='round')
print(mermaid)
write_file('mermaid.txt', mermaid)

fancy graphs examples

graph TD;
    2(third)-->0(first);
    0(first)-->1(second);
    1(second)-->2(third);

graph TD;
    0(some)-->2(here);
    6(mandy)-->2(here);
    6(mandy)-->0(some);
    6(mandy)-->4(this);
    6(mandy)-->7(candy);
    6(mandy)-->5(meow);
    1(thing)-->7(candy);
    4(this)-->7(candy);
    7(candy)-->3(they);
    4(this)-->3(they);
    4(this)-->5(meow);
    3(they)-->5(meow);
    5(meow)-->3(they);

graph TD;
    22(some14)-->17(some9);
    17(some9)-->21(some13);
    17(some9)-->5(five);
    5(five)-->19(some11);
    21(some13)-->16(some8);
    16(some8)-->8(some0);
    16(some8)-->3(third);
    10(some2)-->20(some12);
    20(some12)-->6(six);
    20(some12)-->2(second);
    13(some5)-->10(some2);
    10(some2)-->4(fourth);
    8(some0)-->22(some14);
    8(some0)-->9(some1);
    19(some11)-->1(first2);
    11(some3)-->1(first2);
    22(some14)-->1(first2);
    12(some4)-->1(first2);
    4(fourth)-->1(first2);
    0(first)-->1(first2);
    15(some7)-->1(first2);
    13(some5)-->1(first2);
    18(some10)-->1(first2);
    21(some13)-->1(first2);
    6(six)-->1(first2);
    14(some6)-->1(first2);
    9(some1)-->1(first2);
    2(second)-->1(first2);
    7(seven)-->1(first2);
    18(some10)-->11(some3);
    11(some3)-->15(some7);
    15(some7)-->0(first);
    9(some1)-->12(some4);
    12(some4)-->13(some5);
    14(some6)-->0(first);
    19(some11)-->0(first);
    0(first)-->18(some10);
    0(first)-->7(seven);

think of\todo

๐Ÿ”ฒ what if choice is in the list of inputs or outputs for a given node? then we don't lose shots, but we don't find any input/output. This needs to be fixed somehow by giving a while loop, or appropriate conditions that will filter out correctly available input and output nodes

โœ… allow_reverse - allow for reverse connections between nodes. In other case only one way connection is allowed. Its fine for now

๐Ÿ”ฒ implement somy copy method for node? https://stackoverflow.com/questions/45051720/best-practice-to-implement-copy-method

๐Ÿ”ฒ what about the random order of pairing inputs and outputs? currently we iterate first all inputs and then all outputs, so the results are not fully random

๐Ÿ”ฒ I realize that node should keep it restrictions independ on Fancy class object (todo, make sure its ok)

๐Ÿ”ฒ relation between nodes should be make in one node, for both of them, to not be omitted

๐Ÿ”ฒ remove make_input and make_output methods for Node class and implement fully connect method (also in Fancy class)

fancy-mermaid's People

Contributors

streanger avatar

Stargazers

 avatar

Watchers

 avatar  avatar

fancy-mermaid's Issues

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.