mermaid icon indicating copy to clipboard operation
mermaid copied to clipboard

State diagram duplicate states

Open luizfbicalho opened this issue 2 years ago • 1 comments

Description

I created an diagram with this code

stateDiagram-v2

state s4 : Filling
{
p29 : Upload 
}

state s5 : Integration

state s6 : Process
{
p31 : Process internal
}


[*] --> s4 : Inicial
s4 --> s5 : Upload
s5 --> s4 :Not OK
s5--> [*] : End

Steps to reproduce

  1. create a state diagram
  2. add my code
  3. see that there are two drawings for the same state

Screenshots

this is the result

image

Code Sample

stateDiagram-v2

state s4 : Filling
{
p29 : Upload 
}

state s5 : Integration

state s6 : Process
{
p31 : Process internal
}


[*] --> s4 : Inicial
s4 --> s5 : Upload
s5 --> s4 :Not OK
s5--> [*] : End

Setup

Desktop

  • OS and Version: [Windows, Linux, Mac, ...]
  • Browser and Version: [Chrome, Edge, Firefox]

Smartphone

  • Device: [Samsung, iPhone, ...]
  • OS and Version: [Android, iOS, ...]
  • Browser and Version: [Chrome, Safari, ...]

Additional Context

No response

luizfbicalho avatar Feb 07 '23 00:02 luizfbicalho

This looks to be directly related to #4053

Same symptom (overlapping boxes), but in one case it is duplicated(?) boxes, and in the other boxes are being hidden

jgreywolf avatar Feb 09 '23 19:02 jgreywolf

Im not entirely sure this is what you are trying to accomplish @luizfbicalho, but check out the following code:

stateDiagram-v2

s4 : Filling
state s4  {
    p29 : Upload
}
s5 : Integration
s6 : Process
state s6 {
    p31 : Process internal
}

[*] --> s4 : Inicial
s4 --> s5 : Upload
s5 --> s4 : Not OK
s5--> [*] : End

image

With this sintax you need to first declare the state and name and then extend the inner states with the state keyword.

Pr0dt0s avatar Mar 06 '23 23:03 Pr0dt0s

Thanks @Pr0dt0s

Is this the correct state definition or is this a workaround?

luizfbicalho avatar Mar 07 '23 00:03 luizfbicalho

I´m not really sure, I have just recently started contributing to this project. But based on the examples, I would say the correct state definition for when you have a label and an Inner State should be like this:

state "Filling" as s4 {
    p29 : Upload
}

Pr0dt0s avatar Mar 07 '23 00:03 Pr0dt0s

I did this also and got it worse, I'll try your way and see how it goes, thanks again

luizfbicalho avatar Mar 07 '23 01:03 luizfbicalho

@luizfbicalho Any update?

jgreywolf avatar Oct 16 '23 15:10 jgreywolf