rkrug / plantuml

R package to build UML graphs using plantuml
https://rkrug.github.io/plantuml/index.html
GNU General Public License v3.0
76 stars 8 forks source link

Diagram unreadable #20

Closed piiskop closed 1 year ago

piiskop commented 2 years ago

Please run this:

library(plantuml)
dataForDiagramForExtrema = '
(*) --> "Arvutan tuletise"

if "Kas tuletis on null või esineb katkevusi?" then
  -->[jah] if "Kas tahan teha väärtuste tabeli?" then
    --> "Teen tuletise väärtuste tabeli."
    --> "Leian miinimumi, maksimumi või horisontaalse käänupunkti."
    --> (*)
  -->[ei] "Arvutan teise tuletise konkaavsuse väljaselgitamiseks."
  if "Kas teine tuletis on null?" then
    -->[jah] "Koostan teise tuletise väärtuste tabeli."
    if "Kas märk muutub?" then
      -->[jah] "horisontaalne käänupunkt"
    else
      -->[ei] "Teen tuletise väärtuste tabeli."
    end if
  else
    -->[ei] "maksimum või miinimum"
  end if
  -left-> (*)
else
  -->[ei] "Statsionaarsed punktid puuduvad."
endif

--> (*)
'

diagramForExtrema = plantuml(dataForDiagramForExtrema)
plot(x = diagramForExtrema, vector = FALSE)

You see that the created diagram is so small that it's unreadable.

rkrug commented 1 year ago

Sorry for replying so late. Confirmed and I will look at it.

rkrug commented 1 year ago

Could you confirm, that you are running the example in RStudio?

The reason why it is unreadable in RStudio, is because the width and height are used from the device it is plotting in. The whole graph has to fit in the window. As the plot device is wider than heigh, and the graph is heigher then wide, it will be scaled down to fit in the window. Scaling can not be done, as the arrangement of the nodes is done automatically without knowledge of the size of the output device.

When you run the example from the R console, the graph is readable.

By the way: the argument vector is not used anymore, as the intermediate format (i.e. the format returned from plantuml) is always svg as it is a. vector format and can be scaled to all sizes.

piiskop commented 1 year ago

i am running this example in RStudio Server. The issue still persists. The diagram is so small that it is not readable unless i magnify the site / Portable Document Format file essentially.

It creates a Scalable-Vector-Graphics file in tmp, so i went there, copied the file, and included that SVG file directly and it looks readable.

Do you mean i have to manually copy and paste SVG files in order to include them in a final document? Should it not be working just like running the code where ever i want to include the graph? Otherwise, it would not make any sense to me to use plantuml as i could create nice graphs with inkscape or other software. i just hoped that plantuml would make it possible to have graphs directly in final documents as other plots created in R.

Therefore, i do not understand why you closed the issue without my confirmation. you waited more than a year with your reply and then you just closed it obviously without testing by yourself within an hour.

rkrug commented 1 year ago

Dear Peacock

i am running this example in RStudio Server. The issue still persists. The diagram is so small that it is not readable unless i magnify the site / Portable Document Format file essentially.

I can confirm this in RSTudio, but when you are running the example from the R console, you see a better readable plot because studio scales it proportionally to the existing size of the plot window (everything has to fit in) while the RConsole creates a window which fits to the plot size.

It creates a Scalable-Vector-Graphics file in tmp, so i went there, copied the file, and included that SVG file directly and it looks readable.

Exactly. You can specify the location with the file = ... argument in the plot function, so that you can save it for example in the current directory.

Do you mean i have to manually copy and paste SVG files in order to include them in a final document?

No - but you can specify the location using the above mentioned file argument and then include it from there.

Should it not be working just like running the code where ever i want to include the graph?

it does. See above explanation why it is so small in RStudio and not in the RConsole.

Otherwise, it would not make any sense to me to use plantuml as i could create nice graphs with inkscape or other software. i just hoped that plantuml would make it possible to have graphs directly in final documents as other plots created in R.

Therefore, i do not understand why you closed the issue without my confirmation. you waited more than a year with your reply and then you just closed it obviously without testing by yourself within an hour.

Please do not be rude - I am trying to help, and if you read my post above again, you will see that I clarified the issue RStudio versus RConsole.

Also, this is free software, and I am not working not full-time on it. It is as-is. I am happy for any feedback, bug reports, etc as they improve the package, but I am not getting paid for this - I am doing this because I like plantuml, use this package myself, and see a value in it.

Hope this helps,

Rainer

piiskop commented 1 year ago

i am not sure whether your reply is to me as its content seems to be an answer to my answer however the name you are using for me is not acceptable.

i am not going to try your software from just a console as it would not make any sense to me. i use RStudio Server for producing high-quality documents and using just a console does not fit that purpose. Or does it? So if your software does not work as intended in RStudio Server then it is unusable to me.

you are suggesting that i can let your software set the target for the SVG file and include that file from that location. This is acceptable however would my final document show two versions of the graph in that case? Is it possible to turn off the direct output then? i do not have to do it with tikz and its derivates. i do not have to do it for ggplot. And yet, i seem to have to do it for your software.

i am not getting paid for using your software either, so we are sitting in the same hole. Maybe i could help you open your eyes to an issue that you have not considered yet. you are welcome to call my behavior rude however let us call them rude helping! Letting a bug report unhandled for more than a year seems rude to me. Once you make something public you are responsible for that until the end of your life.

rkrug commented 1 year ago

Fine with me. Cheers.