plantuml / plantuml

Generate diagrams from textual description
https://plantuml.com
Other
9.73k stars 881 forks source link

shape "activity" ist hardly missing #1631

Closed boessu closed 3 months ago

boessu commented 5 months ago

Problem At the moment (and as far as I knoiw), Plantuml doesn't provide any form of an "activity" shape for elements (see https://plantuml.com/de/deployment-diagram). This is a common shape used to visualize Activities, Processes, Value Streams and so on. In Edgy, it is used to display activities (Journeys, Processes, Stories) edgy-activity In archimate, it is used to visualize value streams: archimate_valuestream

Solution I know these are two forms. I'm quite sure one form would help alot. My concrete proposition:

Alternatives Alternatives would be the following ones, but at the end the results are all very "baa" workarounds for the missing shape:

boessu commented 4 months ago

I've had a deeper look at the rendering of the actual "rectangle" svek. I've noted "diagonalCorner" is basically a "UPath" and not a "URectangle". It also seems ot be rather hard to implement a completey new shape as it would mean to re-implement all devices (beside of Graphics2D: EPS, HTML5, SVG, Tikz...). Maybe it would make more sense to add it as a skinparam of a rectangle?

something like;

skinparam rectangle {
   LeftPointing 20
}

It could be a new method in URectangle. Although I'm not sure how hard it is to integrate that:

    public Shadowable leftPointing(double pointing) {
        if (ignoreForCompressionOnX || ignoreForCompressionOnY)
            throw new IllegalStateException();

        if (pointing == 0)
            return this;

        final UPath result = UPath.none();
        result.moveTo(0, 0);
        result.lineTo(width - pointing, 0);
        result.lineTo(width, height / 2.0);
        result.lineTo(width - pointing, height);
        result.lineTo(0, height);
        result.lineTo(0, 0);
        return result;
    }

The disadvantage of that is that the existing "RoundCorner" and "DiagonalCorner" skinparams do compete with that new parameter. Quite frankly, that's already the case with the two exiting skinparams.

arnaudroques commented 4 months ago

In last commit, we added process and action keywords. Not sure that these are the best keyword, we can still change them. We are reluctant to use activity as keyword.

Any though?

boessu commented 4 months ago

Thanks. I've tested a bit, and it seems to work fine. The new element shapes are a very good thing.

I think these keywords are fine. I also already thought "activity" as a keyword would be a rather bad idea. As a 1st thing, it is a "UML Word" in the uml perspective where these will live on now, and 2nd it's already used in the skins (activityDiagram.activity). Quite frankly, even if it would be a keyword, the according Java files shouldn't have the word "activity" in it as it has already a plethora of classes with the word "activity" in it (as far as I see that all depending on the UML activity diagram area). That's not very helpful for contributors either if that would result in a mess...

Actually, these are only usable as element shapes. Is it possible to use it "like" the rectangle shape, which can be used either as element shape or as grouping shape? The reason why I'm asking are pictures from the area of E2E Processes like this: Screenshot 2024-01-06 155448 or this (like in edgy) EDGY-Process-Map_Process-Model_Process-Chart Would that be possible?

arnaudroques commented 4 months ago

Sure, with last snapshot, you can try:

@startuml
action action {
action action1
action action2
}
process process {
process process1
process process2
}
@enduml

Is this what you are looking for?

The-Lum commented 4 months ago

Hi @arnaudroques, and all,

Regards, Th.

arnaudroques commented 4 months ago
  • Is it plan to have specific style for action or process?

Yes, you are right, probably we should create action and process style. Is this useful?

The-Lum commented 4 months ago

Is this useful?

More consistent! 😏

arnaudroques commented 4 months ago

Sorry, we are lazy sometimes :-) This should be fixed in last snapshot and on the online server.

The-Lum commented 4 months ago

Hi @arnaudroques, and all,

During a test with smetana we observe a minor overlapping (at the top start of the arrow). Here is a minimal example:

@startuml
!pragma layout smetana
process process {
process process1
}
@enduml

Regards, Th.

boessu commented 4 months ago

Hello @The-Lum (and all)

I think the problem you've found is the same as this issue here: https://github.com/plantuml/plantuml/issues/1638 So not specific to this new shapes, but they're affected too (in a very similar manner).

Cheers B.

boessu commented 4 months ago

@arnaudroques: I've added the new "action" keyword to the edgy library in https://github.com/plantuml/plantuml-stdlib. That was some sort of a test case. ;-) It seems as everything works fine. image image