Skip to contents

Common helpers used across the Artalytics platform.

Usage

is_demo()

format_brushes(x)

as_pretty_date(date)

Arguments

x

Numeric value to format.

date

Date to format (Date object or coercible string).

Value

Logical. TRUE if `ART_RUNAS_DEMO` environment variable is set to "TRUE".

Character string with formatted count (adds "K" suffix for thousands, "+" suffix for all).

Character string formatted as "Month DDth, YYYY" (e.g., "January 15th, 2024").

Functions

  • is_demo(): Check if running in demo mode (ART_RUNAS_DEMO=TRUE)

  • format_brushes(): Format brush counts for display (e.g., "1.5K+")

  • as_pretty_date(): Format dates for front-end presentation

See also

Other utilities: calc_percentile()

Examples

is_demo()
#> [1] FALSE
format_brushes(1500)
#> [1] "1.5K+"
as_pretty_date("12-12-12")
#> [1] "December 12th, 12"
as_pretty_date("2024-01-15")
#> [1] "January 15th, 2024"