Skip to content

Feature: Add metric card output #48

Description

@dgkf

Purpose

Both the dashboard and report will want to use embed more graphical representations of metric information. In a dashboard, it's common to show a metric card and in a report we can aim to communicate information similarly.

If feasible, it would be nice if these shared common code from val.meter.

Ideally, the metrics could be rendered out and embedded either in a (1) shiny app, (2) pdf rendered using typst, (3) html report or (4) on a website, rendered using javascript.

Design

output format

There are a few tradeoffs here which may inform the output format.

htmlwidget

An htmlwidget could be embedded in a shiny app and html report easily. I'm unsure about a quarto typst document - it may need to be rendered out to an image and then embedded. Rendering using pure javascript on a static webpage would be a non-starter, but we might need to swallow that pill and allow for some redundancy.

templated svg

A bit more barebones than an htmlwidget, if we emit only an SVG file from a template, then this should be easy to embed in shiny and quarto. We could use the same template file to feed a static webpage's rendering. If we go this route we should be mindful about text selection and scaling.

visualization

At a minimum, the card should include the metric title, description and value.

It would be nice if we could add contextual information, such as a percentile showing how the metric compares against a cohort of evaluated packages - perhaps with a distribution curve for the cohort. This would require that we pass cohort information to the renderer.

Deliverable

To start - a VERY simple "card" (it could even just be an empty <div></div> or <svg></svg>) so we can explore how the card could be consumed by each of the downstream projects. This would help us answer some questions about use in a pdf report and static webpage before committing to an approach.

Then, fleshing out the visualization assuming we only care about a single package.

Then, adding more contextual information when provided with a cohort.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    Planning

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions