Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support more than 10 indexes on $DefineCalloutSprite function #78

Closed
carloscrono opened this issue Aug 13, 2024 · 3 comments
Closed

Support more than 10 indexes on $DefineCalloutSprite function #78

carloscrono opened this issue Aug 13, 2024 · 3 comments
Assignees

Comments

@carloscrono
Copy link

carloscrono commented Aug 13, 2024

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

@carloscrono carloscrono changed the title Support more than 10 indexes on <$Callout_index> Support more than 10 indexes on $DefineCalloutSprite function Aug 13, 2024
@hakanson hakanson self-assigned this Aug 13, 2024
@hakanson
Copy link
Contributor

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

@carloscrono
Copy link
Author

Thanks, that would be great

@hakanson
Copy link
Contributor

Instead of increasing circle size, I'm going to decrease font size. When I tested larger size on sequence diagrams, the larger circle size overlapped the message line/arrow.

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

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

hakanson added a commit to hakanson/aws-icons-for-plantuml that referenced this issue Sep 17, 2024
hakanson added a commit that referenced this issue Jan 19, 2025
* upgrade scripts and Symbols table for v19.0
* update Callouts for issue #78
* generate icons for dist
* upgrade examples
* git mv filename case changes
* support icons for mermaid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants