Retrieves comprehensive career-wide statistics for an artist including totals, averages, engagement metrics, and recognition indicators. This function provides the quantitative foundation for storytelling components.
Migration-Ready: This function is designed to be moved to artutils in the future. It is a pure data function with no Shiny dependencies.
get_artist_career_stats(artist_uuid, cn)A named list with the following elements:
List with: artworks, collections, total_views, total_likes, total_favorites, total_shares
List with: views_per_artwork, likes_per_artwork, favorites_per_artwork, artworks_per_collection
List with: engagement_rate, favorite_rate, share_rate
List with: most_viewed_artwork, most_liked_artwork, most_favorited_artwork
List with: artworks_last_30_days, artworks_last_90_days, artworks_last_year, growth_trend
Numeric. Composite quality indicator (0-100) based on engagement metrics
The function aggregates statistics from multiple tables:
Artwork and collection counts from indexes
Engagement metrics from app.artwork_stats
Temporal progression from app.artwork_index
Quality Score Calculation: Composite score (0-100) based on:
Average views per artwork (30%)
Engagement rate (40%)
Favorite rate (20%)
Recent activity (10%)
Engagement Rate: (likes + favorites * 2 + shares * 3) / total_views * 100
app.artist_index
app.artwork_index (artist_uuid, created_utc, deleted_utc)
app.collection_index (artist_uuid, collection_uuid)
app.artwork_stats (artwork_uuid, views, likes, favorites, shares)
get_artist_timeline for temporal data,
get_artist_evolution for creative evolution analysis
if (FALSE) { # \dontrun{
cn <- artcore::dbc()
artist_uuid <- "123e4567-e89b-12d3-a456-426614174000"
stats <- get_artist_career_stats(artist_uuid, cn)
# Access career statistics
stats$totals$artworks # Total artworks created
stats$totals$total_views # Cumulative views across all artworks
stats$averages$views_per_artwork # Average views per piece
stats$engagement$engagement_rate # Overall engagement percentage
stats$quality_score # Composite quality indicator
artcore::dbd(cn)
} # }