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

Possibility of showing all diagrams in an editor/file #61

Closed
hallvard opened this issue Jun 8, 2018 · 16 comments
Closed

Possibility of showing all diagrams in an editor/file #61

hallvard opened this issue Jun 8, 2018 · 16 comments

Comments

@hallvard
Copy link
Owner

hallvard commented Jun 8, 2018

Currently, the diagram shown in the view is based on the editor cursor position (in general how the diagram provider uses the editor's state, typically the cursor/selection). You can have several diagrams in your editor, but only one is shown at a time. We should consider showing all the diagrams in an editor at once, and select the tab based on the cursor/selection. Perhaps you could even navigate in the editor when selecting a tab. Technically, we could reuse the tabbed design used with multi-page diagrams, perhaps even generate one large diagram from all diagrams with newpage commands in between.

@paulvi
Copy link

paulvi commented Jun 9, 2018

Tabs get unusable when number of diagrams it to big, like 10-20
that is easy to get in a list of diagrams
https://github.com/de-jcup/eclipse-asciidoctor-editor/blob/master/asciidoctor-editor-other/testscripts/21_diagrams_plantuml_only.adoc

@paulvi
Copy link

paulvi commented Jun 9, 2018

In that case it would be nice to have a clickable list.

There is problem though for any case that diagram do not have title,
so when there are many of them, just referencing to them is problematic.
... So simple numbering would help.

@hallvard
Copy link
Owner Author

A clickable (drop down) list makes sense. A "title" could be generated from the first line in the diagram source.

@gh3gde
Copy link

gh3gde commented Dec 28, 2018

Hello Sir,

Currently, eclipse plugin can display multiple diagrams in pages when diagrams are separated using "newpage" keyword. Please refer to the below example.

@startuml
a->b: hello;
newpage newpagetitle
b->a : back on new page;
@enduml;

But when tried to export all the diagrams, only the first page would get displayed.

So, I modified these instructions as below to display multiple pages when exported.

@startuml
a->b: hello;
@enduml
@startuml
b->a : back on new page;
@enduml

But when opened in eclipse, plugin would display the diagram that has the cursor focus.

So having clickable list is better idea.
Do you have some plan to release eclipse plugin with these features integrated?

@hallvard
Copy link
Owner Author

hallvard commented Jan 1, 2019

No plans, yet.

In your comment you seemed to suggest the need for exporting all diagrams at once, instead of one at a time (be switching to each tab and exporting)?

@gh3gde
Copy link

gh3gde commented Jan 2, 2019

Yes, I mean to say, When using "newpage" for separating the diagrams, the diagrams gets exported to multiple tabs. But when using multiple @startuml and @endumls, only the first diagram would be exported.

It would be better idea to have either clickable list (as explained by you in few above comments) or multiple tabs. Number of tabs depend on the number of @startuml & @enduml loops in the plantUML source.

Please suggest if any other alternatives to export all the diagrams at once. (I am very much restricted in using "newpage" as it exports only one diagram.)

@hallvard
Copy link
Owner Author

hallvard commented Jan 2, 2019

OK, so "exported" in this case doesn't refer to the export (to png or svg) menu action.

My current thought about selecting in a list is to generate the list from the editor contents (@startuml-@enduml tags), but delay generation of the diagram till you select an item. Selecting an item corresponds to moving the cursor to a @startuml tag, which will trigger diagram generation.

@gh3gde
Copy link

gh3gde commented Jan 14, 2019

Hello Sir,

Thanks for supporting this feature in eclipse plugin. This feature really helps up.
May I know when we can expect the next release?

Thank you,

@hallvard
Copy link
Owner Author

hallvard commented Feb 5, 2019

I've just released a new version where the view menu lists the explicit diagrams in a file. When one is selected, the corresponding diagram is shown. Please try it out and give feedback!

@anb0s
Copy link

anb0s commented Mar 25, 2019

I've files with two @startuml - @enduml sections, but do not see any dropdown menu.

Versions:

PlantUML Feature 1.1.22
PlantUML Library Feature 1.2019.0
Eclipse IDE for C/C++ Developers
Version: 2018-12 (4.10.0)
Build id: 20181214-0600

example file e.g. "rle_test.puml":

@startuml
digraph component_graph {
"cpu1500::rle_test" [color=black,fillcolor=lightgrey,penwidth=1.00,style="filled"]
"cpu1500::rle_test" -> "base::googletest" [color=black,fillcolor=black,penwidth=1.00,style="filled"]
"base::googletest" [color=black,fillcolor=white,penwidth=1.50,style="filled,filled"]
}
@enduml

@startuml
digraph legende_graph {
  rankdir=LR
  subgraph cluster01 {
    label = "Legend"
    first [color=black,fillcolor=lightgrey,penwidth=1.00,style="filled"]
    pred [color=black,fillcolor=white,penwidth=1.50,style="filled"]
    "first node" [shape=plaintext]
    "direct predecessor" [shape=plaintext]
    first -> "first node" [style=invis]
    pred -> "direct predecessor" [style=invis]
    user -> used [color=black,fillcolor=black,penwidth=1.00,style="filled"]
    transitive -> used [color=black,fillcolor=black,penwidth=1.00,style="dashed"]
    friend -> used [color=black,fillcolor=black,penwidth=1.50,style="filled"]
    tester -> used [color=black,fillcolor=black,penwidth=2.50,style="filled"]
  }
}
@enduml

The view is refreshed if cursor is placed in editor in one of the diagram sections only:
image

image

@anb0s
Copy link

anb0s commented Mar 25, 2019

After Eclipse restart it shows the menu!

image

hm... strange...

@anb0s
Copy link

anb0s commented Apr 2, 2019

The issue is still there, so it does not work always...

@hallvard
Copy link
Owner Author

hallvard commented Apr 2, 2019

I think there's a problem with the menu's life-cycle. It is populated lazily, when it is opened, but sometimes it isn't shown at all, and then it will not be populated either, since it cannot be triggered by the end-user. I'm considering moving it to a button, to make the feature more visible and have more control.

@anb0s
Copy link

anb0s commented Apr 5, 2019

I've tried 1.1.23 today and it looks good now:
image

@hallvard
Copy link
Owner Author

hallvard commented Apr 5, 2019

Thanks for checking it out!

@hallvard hallvard closed this as completed Apr 5, 2019
@anb0s
Copy link

anb0s commented Apr 5, 2019

Keyboard shortcuts for jump to or cycle through diagrams woould be nice ;)

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