awslabs / aws-icons-for-plantuml

PlantUML sprites, macros, and other includes for Amazon Web Services services and resources
Other
904 stars 153 forks source link

Support more than 10 indexes on $DefineCalloutSprite function #78

Open carloscrono opened 1 month ago

carloscrono commented 1 month ago

I recently created a Sequence Diagram where I needed to track the number of sequences. In one of my blocks I had more than 10 indexes, so, I had to integrate your DefineCallOut function inline with the following code.

!function $DefineCalloutSprite($number, $textcolor, $fillcolor, $xtext) 
!$header = 'sprite Callout_' + $number + ' <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18">'
!$circle = '<circle cx="11" cy="11" r="11" fill="' + $fillcolor + '" />'
!$textnumber = '<text x="' + $xtext + '" y="15" fill="' + $textcolor + '" font-size="12">' + $number + '</text></svg>'
!return $header + $circle + $textnumber
!endfunction

!$CalloutIndex = 1
!while $CalloutIndex < 100
  !if $CalloutIndex < 10
    $DefineCalloutSprite($CalloutIndex, $AWS_BG_COLOR, $AWS_FG_COLOR, 7)
  !else
    $DefineCalloutSprite($CalloutIndex, $AWS_BG_COLOR, $AWS_FG_COLOR, 3)
  !endif
  !$CalloutIndex = $CalloutIndex + 1
!endwhile

I would like to integrate this small change so we can support more indexes, unless until 99.

Thanks

hakanson commented 1 month ago

I'm working on an update now and will take a look at this, likely next week based on my schedule.

carloscrono commented 3 weeks ago

Thanks, that would be great