badgeStack ( width ; height ; defaultArray ; badgeArray )
Generates overlapping circular badges with custom text and styles from JSON, rendered in SVG for display in a FileMaker Web Viewer.
Be the first to rate this function Log in to vote
Jonni™ - Show more from this author |
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
This function produces a visually stacked row of circular badges using SVG, styled and controlled entirely via JSON. Each badge supports individual text, background and font colour, and border styles, with layout dynamically handled based on Web Viewer dimensions. The leftmost badge appears on top, enabling a clean and readable stack that’s perfect for representing users, tags, roles or assignments in FileMaker layouts.
Default Array Example
JSONSetElement ( "" ;
[ "radius" ; 16 ; 2 ] ;
[ "font.size" ; 12 ; 2 ] ;
[ "font.weight" ; "bold" ; 1 ] ;
[ "font.name" ; "Helvetica Neue" ; 1 ] ;
[ "spacing.overlap" ; 6 ; 2 ] ;
[ "border.stroke" ; 2 ; 2 ] ;
[ "border.color" ; "#FFFFFF" ; 1 ] ;
[ "background.fill" ; "#FFFFFF" ; 1 ]
)
Badge Array Example
JSONSetElement ( "" ;
[ "badge[+]text" ; "MR" ; 1 ] ;
[ "badge[:]color.background" ; "#F4511E" ; 1 ] ;
[ "badge[:]color.text" ; "#FFFFFF" ; 1 ] ;
[ "badge[+]text" ; "J" ; 1 ] ;
[ "badge[:]color.background" ; "#4285F4" ; 1 ] ;
[ "badge[:]color.text" ; "#FFFFFF" ; 1 ]
)
Comments
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.