...

Source file src/oss.terrastruct.com/d2/d2layouts/d2sequence/constants.go

Documentation: oss.terrastruct.com/d2/d2layouts/d2sequence

     1  package d2sequence
     2  
     3  // units of space on the left/right when computing the space required between actors
     4  const HORIZONTAL_PAD = 40.
     5  
     6  // units of space on the top/bottom when computing the space required between messages
     7  // TODO lower
     8  const VERTICAL_PAD = 40.
     9  
    10  const MIN_ACTOR_DISTANCE = 150.
    11  
    12  const MIN_ACTOR_WIDTH = 100.
    13  
    14  const SELF_MESSAGE_HORIZONTAL_TRAVEL = 80.
    15  
    16  const GROUP_CONTAINER_PADDING = 12.
    17  
    18  const EDGE_GROUP_LABEL_PADDING = 20.
    19  
    20  // min vertical distance between messages
    21  const MIN_MESSAGE_DISTANCE = 30.
    22  
    23  // default size
    24  const SPAN_BASE_WIDTH = 12.
    25  
    26  // as the spans start getting nested, their size grows
    27  const SPAN_DEPTH_GROWTH_FACTOR = 8.
    28  
    29  // when a span has a single messages
    30  const MIN_SPAN_HEIGHT = 30.
    31  
    32  const SPAN_MESSAGE_PAD = 10.
    33  
    34  const LIFELINE_STROKE_WIDTH int = 2
    35  
    36  const LIFELINE_STROKE_DASH int = 6
    37  
    38  // pad when the actor has the label placed OutsideMiddleBottom so that the lifeline is not so close to the text
    39  const LIFELINE_LABEL_PAD = 5.
    40  
    41  const (
    42  	LIFELINE_Z_INDEX = 1
    43  	SPAN_Z_INDEX     = 2
    44  	GROUP_Z_INDEX    = 3
    45  	MESSAGE_Z_INDEX  = 4
    46  	NOTE_Z_INDEX     = 5
    47  )
    48  

View as plain text