EVG showcase

EVG is the layout engine behind Ranger's PDF and image writers: a print-safe CSS subset — flex, grid, a stylesheet layer and real TrueType metrics — with no browser anywhere in the pipeline.

Every page below is the same tree rendered under two themes and three targets. The .tsx files carry no colours, sizes or spacing: they say what is on the page, and one stylesheet says how it looks.

Built from lib/evg/showcase. PDF is the print target; PNG is the raster preview; HTML is the debug view.

The chart API, running. Every page below is a rendered file. Charts, called — live is not: it loads the compiled VlChart API into the browser and dispatches the lines you type to it, method by method, drawing the answer as you edit.
Responsive layout, live. One page, laid out on every frame at the width of your window. The @media blocks, vw lengths and the card grid are resolved by the compiled engine in the browser, and the browser is handed finished pixels — drag the window edge and watch the whole pipeline run again. The same page as retained DOM: one node per element, kept across frames and patched from the engine's own diff (EVGHostTree) — open the dev tools and the picture is a tree you can read.
Bitmap tracer, live. Upload a JPEG/PNG, tweak Potrace-style parameters (turdsize, alphamax, color posterize) and vectorize in the browser with the compiled EvgBitmapTracer. Nothing is uploaded — the image stays on the page.
Erazer, live. A screenshot of a UI is read as nested widgets — buttons, fields, tabs, menus, checkboxes, labels, icons — and written out as an EVG tree. The tracer follows photographic ink; this one looks for rectangles and text. Same rule: the image never leaves the tab.

Album spread open the page ›

grid-template-areas draws the spread as a picture of names, so a theme can rearrange it without touching the tree.

  • grid-template-areas
  • spans
  • object-fit: cover
  • gap

album.tsx — no visual attributes; every rule is in showcase.css

Album spread — Editorial
Editorial warm paper, serif display PDF HTML WebGL
Album spread — Studio
Studio dark, geometric sans PDF HTML WebGL

Cards on shared rows open the page ›

Three cards, three caption lengths, one baseline. Each card spans the deck's rows and declares grid-template-rows: subgrid, so the photo band and the caption band are shared.

  • subgrid (rows)
  • grid spans
  • text wrapping

cards.tsx — no visual attributes; every rule is in showcase.css

Cards on shared rows — Editorial
Editorial warm paper, serif display PDF HTML WebGL
Cards on shared rows — Studio
Studio dark, geometric sans PDF HTML WebGL

Type specimens open the page ›

Measured from the same TTF the page is painted with, kerned from the font's own GPOS pairs, and encoded so ä, — and “ ” survive the trip to PDF.

  • real TTF metrics
  • GPOS kerning
  • align-items: baseline
  • UTF-8 + WinAnsi

typography.tsx — no visual attributes; every rule is in showcase.css

Type specimens — Editorial
Editorial warm paper, serif display PDF HTML WebGL
Type specimens — Studio
Studio dark, geometric sans PDF HTML WebGL

Length units open the page ›

Five bars declared in five units, all the same length, because CSS pins them to the reference pixel. em follows the local font-size; rem stays with the root.

  • px % em rem
  • pt pc in mm cm

units.tsx — no visual attributes; every rule is in showcase.css

Length units — Editorial
Editorial warm paper, serif display PDF HTML WebGL
Length units — Studio
Studio dark, geometric sans PDF HTML WebGL

Vector paths open the page ›

One path parser, one viewBox transform, three targets: real vector operators in the PDF, an inline <svg> in the HTML, and the same anti-aliased scanline fill that paints this page's glyphs in the PNG.

  • viewBox scaling
  • fill-rule holes
  • cubic + quadratic
  • smooth S/T
  • elliptical arcs

vector.tsx — no visual attributes; every rule is in showcase.css

Vector paths — Editorial
Editorial warm paper, serif display PDF HTML WebGL
Vector paths — Studio
Studio dark, geometric sans PDF HTML WebGL

Imported SVG open the page ›

Two SVG files read into the same vector layer the rest of the gallery draws with: groups resolved, transforms baked into the geometry, <use> expanded where it is referenced. The browser is handed the resolved shapes rather than the original markup, so the preview cannot draw anything the printer will not.

  • <use> and <defs>
  • baked transforms
  • inherited paint
  • themed from CSS

svg.tsx — no visual attributes; every rule is in showcase.css

Imported SVG — Editorial
Editorial warm paper, serif display PDF HTML WebGL
Imported SVG — Studio
Studio dark, geometric sans PDF HTML WebGL

Charts open the page ›

Unmodified Vega specifications, compiled from Vega-Lite examples and run by the Vela runtime in this repository: every gridline, bar, wedge, key and label is geometry Ranger computed and the EVG vector layer drew. The page is generated, and its colours are not in it — the series are numbered and the stylesheet paints them, so the same charts come out in three palettes, legends included.

  • generated path data
  • series colours from CSS
  • one path per paint
  • arcs, symbols and legends

charts.tsx — no visual attributes; every rule is in showcase.css

Charts — Editorial
Editorial warm paper, serif display PDF HTML WebGL
Charts — Studio
Studio dark, geometric sans PDF HTML WebGL
Charts — Autumn
Autumn muted ochre, rust and olive PDF HTML WebGL

Charts, called open the page ›

The only page here whose charts came from a program rather than from a specification: each one was built by calling Vela's chart API (gallery/vela/src/VlChart.rgr), and the lines printed above it are the calls that built it — read out of the generating tool's own source, so the code on the page and the code that drew it cannot drift apart. A view's encoding is inherited by its marks, and no channel says what it is: a column of ISO dates is an instant, a column of numbers is a quantity, read off the data.

  • marks and channels, called
  • inherited view encoding
  • types read off the data
  • the calls that drew it

chart_api.tsx — no visual attributes; every rule is in showcase.css

Charts, called — Editorial
Editorial warm paper, serif display PDF HTML WebGL
Charts, called — Studio
Studio dark, geometric sans PDF HTML WebGL
Charts, called — Autumn
Autumn muted ochre, rust and olive PDF HTML WebGL

Chart types open the page ›

The rest of the runtime's chart types, and the features only some charts have: a size legend whose rows are all different heights, a stroke legend, a log axis that labels only some of the ticks it draws, two marks sharing one plot, and text as a mark. Generated from the same specifications the parity harness compares against official Vega.

  • size and colour legends
  • log scale
  • layered marks
  • text marks
  • grouped bands

plots.tsx — no visual attributes; every rule is in showcase.css

Chart types — Editorial
Editorial warm paper, serif display PDF HTML WebGL
Chart types — Studio
Studio dark, geometric sans PDF HTML WebGL
Chart types — Autumn
Autumn muted ochre, rust and olive PDF HTML WebGL

More chart types open the page ›

The chart types the runtime learned most recently, which are also the ones that exercise the most of it: a continuous colour ramp with the gradient key it earns, a series that is a faceted group of its own, a stack centred on a common line, a calendar on an axis, and a box plot whose quartiles are computed rather than approximated.

  • colour ramps
  • gradient legends
  • faceted series
  • time scales
  • computed quartiles

more.tsx — no visual attributes; every rule is in showcase.css

More chart types — Editorial
Editorial warm paper, serif display PDF HTML WebGL
More chart types — Studio
Studio dark, geometric sans PDF HTML WebGL
More chart types — Autumn
Autumn muted ochre, rust and olive PDF HTML WebGL

Variants open the page ›

The same marks a chart already on this showcase uses, drawn a different way — bars that go down as well as up, bars that lie on their side, a bar between two values rather than from a baseline, a line that steps instead of sloping, a line that shows its own vertices, a single row of ticks, a shape legend, a mean drawn across the plot, and a pie whose wedges differ in length as well as angle. It is the variants that break a runtime rather than the types.

  • negative bars
  • horizontal bars
  • step interpolation
  • shape scales
  • rules across a plot
  • radial scales

variants.tsx — no visual attributes; every rule is in showcase.css

Variants — Editorial
Editorial warm paper, serif display PDF HTML WebGL
Variants — Studio
Studio dark, geometric sans PDF HTML WebGL
Variants — Autumn
Autumn muted ochre, rust and olive PDF HTML WebGL

Tables open the page ›

The plots where the cell is the datum: both axes are categories, or both are bins, and the value is carried by the cell's colour, its area, or the number printed in it. The two-dimensional histogram is the one that exercises the most — it bins on both axes, counts what lands in each cell, and ticks its axes on the bin edges rather than wherever a tick algorithm would have put them.

  • binning on both axes
  • counts as colour
  • point scales
  • layered labels

tables.tsx — no visual attributes; every rule is in showcase.css

Tables — Editorial
Editorial warm paper, serif display PDF HTML WebGL
Tables — Studio
Studio dark, geometric sans PDF HTML WebGL
Tables — Autumn
Autumn muted ochre, rust and olive PDF HTML WebGL

What a renderer has to get right open the page ›

Four specifications that exist to be drawn rather than to say anything: every symbol shape the grammar offers, every interpolation that joins a line's points, the paint channels that change the ink without moving it — a dash pattern, a rounded corner, a square cap, a fill more translucent than its own outline — and a label against each alignment, baseline, nudge and angle. A scenegraph says "diamond" and stops; these are the specs that make a renderer say what a diamond looks like, and each of them is compared against the picture official Vega's own renderer produces.

  • twelve symbol shapes
  • nine interpolations
  • dashes and corner radii
  • separate fill and stroke opacity
  • text anchoring

drawing.tsx — no visual attributes; every rule is in showcase.css

What a renderer has to get right — Editorial
Editorial warm paper, serif display PDF HTML WebGL
What a renderer has to get right — Studio
Studio dark, geometric sans PDF HTML WebGL
What a renderer has to get right — Autumn
Autumn muted ochre, rust and olive PDF HTML WebGL

More than one chart open the page ›

The four ways a chart can be more than one chart, all of them laid out by their own bounds rather than by a size anyone declared: a trellis by column, by row, and wrapped onto a grid whose shape is computed from the data, plus two plots concatenated with only the dimension across the join in common. The grid axes stay inside each panel; the labelled axes are drawn once, in the footer and the row header.

  • column and row facets
  • wrapped grids
  • concatenation
  • bounds-based layout
  • shared axes

views.tsx — no visual attributes; every rule is in showcase.css

More than one chart — Editorial
Editorial warm paper, serif display PDF HTML WebGL
More than one chart — Studio
Studio dark, geometric sans PDF HTML WebGL
More than one chart — Autumn
Autumn muted ochre, rust and olive PDF HTML WebGL

Flex open the page ›

Grow, shrink and basis; wrapping; and what a row does with what is left over. Every arrangement is a class.

  • flex shorthand
  • flex-shrink: 0
  • justify-content
  • flex-wrap

flex.tsx — no visual attributes; every rule is in showcase.css

Flex — Editorial
Editorial warm paper, serif display PDF HTML WebGL
Flex — Studio
Studio dark, geometric sans PDF HTML WebGL

Emoji open the page ›

Each specimen is several codepoints and one glyph, and only becomes that glyph if the whole cluster reaches the shaper together. The tinted rows use emoji-color, which exists because there are no inline spans to hang a second colour on.

  • grapheme clusters
  • GSUB ligatures
  • Type0 / Identity-H
  • emoji-color

emoji.tsx — no visual attributes; every rule is in showcase.css

Emoji — Editorial
Editorial warm paper, serif display PDF HTML WebGL
Emoji — Studio
Studio dark, geometric sans PDF HTML WebGL

Box model open the page ›

Padding, per-side padding, borders, nesting and margins — the same geometry the browser-parity gate checks against Chromium.

  • padding
  • border
  • margins
  • nesting

boxmodel.tsx — no visual attributes; every rule is in showcase.css

Box model — Editorial
Editorial warm paper, serif display PDF HTML WebGL
Box model — Studio
Studio dark, geometric sans PDF HTML WebGL

Engine warnings from this build

None. Every declaration on every page was honoured.

Known limits, visible here. The raster target decodes JPEGs with the repository's own decoder, which shows block artefacts — the PDF path embeds the original file untouched, so print output is unaffected.