Yeri: Browser-Powered Time Series Graphing with Retro Terminal Flair
Share this article
In an era where developers increasingly push computation to the client, Yeri emerges as a compelling open-source solution for dynamic time series visualization. This JavaScript library generates detailed SVG graphs directly in the browser, eliminating server-side rendering dependencies. Its unique dual-output capability also crafts nostalgic terminal-compatible visualizations using xterm-256 colors and Unicode block characters—a nod to classic monitoring tools.
Why Yeri Stands Out
Yeri ingests time series data from ubiquitous formats like Graphite and Prometheus, plus RRD files used by legacy systems (MRTG, collectd). This flexibility enables web applications to fetch and visualize metrics dynamically without backend processing. As creator Robey Pointer notes, the library powers netgraph—a minimalist network latency monitor demonstrating its practicality.
Core Features & Customization
- SVG Graphs: Configurable axes, labels, grid lines, titles, and legends.
- Highlight Zones: Vertical color bands to emphasize critical time ranges (e.g., outages or peak hours).
- Terminal Output: Text-based graphs via
generateTextGraph(), ideal for CLI tools or debugging:
import { generateTextGraph } from 'yeri/text_graph'; const output = generateTextGraph(timeSeriesList, { width: 80, height: 24 });
While the text mode is acknowledged as a "cute party trick," it offers utility for low-bandwidth environments or terminal-centric workflows.
Integration Made Simple
Construct a TimeSeriesList from various sources:
import { TimeSeries, TimeSeriesList } from 'yeri/timeseries';
// From Prometheus data
const series = new TimeSeries('Requests', [[1620000000, 42], [1620003600, 87]]);
const list = new TimeSeriesList([series]);
// Generate SVG
const svgString = generateSvgGraph(list, { title: 'Traffic Spike' });
Embed results directly into DOM elements—perfect for dashboards requiring real-time updates.
The Client-Side Advantage
By shifting rendering to the browser, Yeri reduces server load and latency. Its Apache 2.0 license encourages broad adoption, though its niche lies in lightweight applications rather than complex analytics. As web assembly and client-side processing gain traction, tools like Yeri exemplify how specialized libraries can unlock new efficiencies—whether you’re building a monitoring UI or just want to stare ("iyeriwok" in Inuit) at elegantly rendered data.
_Source: Yeri GitHub Repository_