Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: Separate the code responsible for generating a diagram from the user interface #70

Open
ggrossetie opened this issue Aug 21, 2023 · 0 comments

Comments

@ggrossetie
Copy link

Hey!

My use case is to use SankeyMATIC as a rendering engine. Basically, I want to send text input and get an image as a result (with as few dependency as possible).

As far as I can tell, the parser/render function are coupled with the UI. For instance, the msg "class" is using DOM element on the page to display messages. Similarly, there are a lot of interactions between the rendering process and the UI elements (node colors, labels, layout, size...).

I would like to introduce the following function:

/**
 *
 * @param {string} input Text input
 * @param  {} options A list of options
 */
export default function sankey(input, options)

Not sure what the function should return but as a first step we can specify an element ID (on the HTML page) where the <svg> will be generated (and return void)

The UI will be built upon this library.

Please let me know if you would consider a pull request. I made a quick prototype on my fork: https://github.com/yuzutech/sankeymatic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant