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

Feature/Add node spacing to flowchart configuration #1176

Merged

Conversation

GDFaber
Copy link
Member

@GDFaber GDFaber commented Jan 5, 2020

📑 Summary

Added nodeSpacing and rankSpacing to flowchart configuration settings.

Resolves #1152

📏 Design Decisions

Set dagre parameters nodesep and ranksep when calling setGraph() in the flowchart renderer.

📋 Tasks

Make sure you

  • 📖 have read the contribution guidelines
  • 💻 have added unit/e2e tests (if appropriate)
  • 🔖 targeted develop branch

@GDFaber GDFaber changed the title #1152 add node spacing to flowchart configuration Feature/Add node spacing to flowchart configuration Jan 5, 2020
@GDFaber GDFaber closed this Jan 7, 2020
@GDFaber GDFaber reopened this Jan 7, 2020
Copy link
Collaborator

@knsv knsv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! I like that you can override the default value via config. What if we also add a way of setting this in the actual graph definition.

@knsv knsv merged commit 144f65c into mermaid-js:develop Jan 8, 2020
@GDFaber
Copy link
Member Author

GDFaber commented Jan 8, 2020

I think that's a good idea. The values could then be set for separete graphs as well.
For instance, it could be something like this:

Current usage:

  1. apply config settings if they were used
  2. otherwise use default values
graph LR 
...

Additional settings in graph definition:

  1. apply settings from definition if they were used
  2. apply configuration settings if they were used
  3. otherwise use default values
graph LR
spacing 100,40 // sets nodesep to 100 and ranksep to 40
...

Optional: short notation

graph LR
spacing 75 // sets both nodesep and ranksep to 75
...

@sionzee
Copy link

sionzee commented Mar 23, 2020

@knsv, @GDFaber
Any plans to integrate the spacing into the graph definition? It will be really useful. 👍

@GDFaber
Copy link
Member Author

GDFaber commented Mar 23, 2020

Hi @sionzeecz, I completely forgot to add an issue for this extension. Thank you for reminding me.

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

Successfully merging this pull request may close these issues.

How to stretch line length
3 participants