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

Support for bi-directional mindmaps #3

Open
ilyaminati opened this issue Dec 27, 2015 · 6 comments
Open

Support for bi-directional mindmaps #3

ilyaminati opened this issue Dec 27, 2015 · 6 comments

Comments

@ilyaminati
Copy link

Does the parser assume that there's exactly one root node? It'd be nice if it would allow for a mindmap that has a root node at the center, and child nodes both left and right of the root. Here's a simple test case:

## This is h2

## And another h2

# And an h1, ouch
@dundalek
Copy link
Owner

If you are missing a heading at certain level it creates a blank node to preserve hierarchy.
If you have multiple top-level nodes it creates extra root node to wrap them.

Your example will look like this:

image

Having nodes both on left and right from the root is not yet implemented.

@ilyaminati
Copy link
Author

Exactly. Those two are useful heuristics, but perhaps we could relax them, and work towards nodes on left and right of root.

Where in the code are these two heuristics? It might help in the conversation.

@dundalek
Copy link
Owner

I think the bi-directional display is not only limited to your case but can be used generally even for proper trees. Therefore it is the matter of the rendering and not parsing.

This d3 example can be used as a start, the changes are needed in view.mindmap.js. I think the trickiest part is to come up with good heuristics how to divide nodes between two sides, so that it is reasonably balanced.

As for the two heuristics, they are located in transform.headings.js.

@ilyaminati
Copy link
Author

Do you think it's reasonable to divide the nodes between the two sides NOT using a heuristic but instead using the order in the file? If an h2 comes before an h1, the node of the h2 goes left of the h1, otherwise it goes right.

@mralexgray
Copy link

I just woke up.... so this might make no sense.. but if "to the left" directives are implemented, it might be nice to also add implicit rules to force "to the top", and "to the bottom", too.. no?

@fzyzcjy
Copy link

fzyzcjy commented Aug 21, 2024

Hi, is there any updates? Thanks

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

4 participants