Cloud Function to generate SVG Sparklines

Zach Leat recently created a cloud function that dynamically generates sparklines. Under the hood sits the the sparkline-svg package to generate the SVG. The datapoints themselves can be passed in via the URL.

Image URLs have the formats:

  • /[height]x[width]/[values]/
  • /[height]x[width]/[values]/[color]/

The code is meant to be deployed as a Netlify Serverless Function.

Every Fire needs a Sparkline →
Sparkline API (GitHub) →

Spark: A Typeface for Creating Sparklines in Text Without Code

Spark is a typeface for creating sparklines in text. It uses OpenType’s contextual alternates and requires no Javascript, though it does require a modern-ish browser that can make use of OpenType features in text.

Spark data needs to be formatted as comma-separated values, with curly brackets at both ends of the set, e.g., {30,60,90}. You can also have numbers at the beginning and end of the set, which are useful for providing the start and end points, e.g., 123{30,60,90}456 – Spark has numerals built in.

Really neat!

Spark: A typeface for creating sparklines in text without code (GitHub) →
AtF Spark →