Brian Dunning's FileMaker Custom Functions

pillCloud ( width ; height ; defaultArray ; pillArray )

Generates a responsive SVG-based group of pill-shaped chips from a JSON configuration, suitable for use in a Web Viewer.

  Be the first to rate this function Log in to vote

Jonni™   Jonni™ - Show more from this author

  Sample input:
progressBarSingle ( 400 ; 400 ; $defaultArray ; $pillArray )
  Sample output:
SVG-based group of pill-shaped chips

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

This function builds a dynamic, multi-line set of pill-shaped chips using SVG, based on a
structured JSON payload. Each chip can display custom text and support individual background
colours, borders, and font styles, while inheriting defaults for easy styling. Chips are
automatically laid out horizontally and wrapped onto multiple lines based on the specified
Web Viewer width and height, making this ideal for flexible tag or category displays inside
FileMaker solutions.

Default Array Example

JSONSetElement ( "" ;

[ "default.border.stroke" ; 1 ; 2 ] ;
[ "default.color.background" ; "#FFFFFF" ; 1 ] ;
[ "default.color.fill" ; "#FFFFFF" ; 1 ] ;
[ "default.color.border" ; "#000000" ; 1 ] ;
[ "default.font.name" ; "Helvetica Neue" ; 1 ] ;
[ "default.font.size" ; 12 ; 2 ] ;
[ "default.font.weight" ; "Regular" ; 1 ] ;
[ "default.margin.horizontal" ; 15 ; 2 ] ;
[ "default.margin.vertical" ; 10 ; 2 ] ;
[ "default.spacing.horizontal" ; 7 ; 2 ] ;
[ "default.spacing.vertical" ; 7 ; 2 ] ;
[ "default.padding.horizontal" ; 5 ; 2 ] ;
[ "default.padding.vertical" ; 5 ; 2 ] ;
[ "default.radius" ; 5 ; 2 ]

)

Pill Array Example

JSONSetElement ( "" ;

[ "pill[+]border.stroke" ; 1 ; 2 ] ;
[ "pill[:]color.border" ; "#000000" ; 1 ] ;
[ "pill[:]color.background" ; "#FFC0CB" ; 1 ] ;
[ "pill[:]text" ; "Strawberry" ; 1 ] ;
[ "pill[:]font.name" ; "Comic Sans" ; 1 ] ;

[ "pill[+]border.stroke" ; 0 ; 2 ] ;
[ "pill[:]color.background" ; "#F5DEB3" ; 1 ] ;
[ "pill[:]text" ; "Vanilla" ; 1 ] ;
[ "pill[:]font.size" ; 14 ; 2 ] ;
[ "pill[:]font.weight" ; "Bold" ; 1 ] ;

[ "pill[+]border.stroke" ; 0 ; 2 ] ;
[ "pill[:]color.background" ; "#3E2C23" ; 1 ] ;
[ "pill[:]text" ; "Chocolate" ; 1 ] ;
[ "pill[:]ont.color" ; "white" ; 1 ]

)

 

Comments

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 21 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: