Skip to content

1.1 release - #173

Merged
Chenglong Wang (Chenglong-MS) merged 34 commits into
mainfrom
dev
Nov 16, 2026
Merged

Chenglong Wang (Chenglong-MS) merged 34 commits into
mainfrom
dev

Conversation

@Chenglong-MS

Copy link
Copy Markdown
Contributor

Flint 1.1: Layouts and Maps

Maps

  • Boundaries: maps draw customizable boundaries (chartProperties.boundaries): a named set, or a file of your own.
  • Framing: a map frames the country, region or continent its rows cover (fit), in a projection centred on it.
  • Globes: projection: "orthographic" turns to face the data and hides the far side; drag to turn it.
  • Choropleth classes: five quantile classes by default; classes takes equal, jenks or continuous.
  • Map styles: mapStyle names a ground (atlas, dark, muted, …) or restates its colours ({ sea, land, coast, border }).
  • US counties: level: "auto" draws states, then counties as you zoom in.
  • Routes: order joins points into routes, each leg bowed with an arrowhead whose tip sits on its stop; strokeWidth sets each leg's width. A route draws a dot at its start; every stop takes a dot where size, shape, text or a quantity's color asks for one, laid beneath the lines.
  • Route density: arrowheads are sized to their lines, and a map crowded with long legs draws them thinner. Short legs keep a small head; where many legs arrive at one stop, their heads fan round it and only the widest twelve keep one.
  • Labels: text names a map's points beside them and a choropleth's regions at their middles. A crowded map names its most salient points first (the largest, or the ends of the colour scale), leaving the rest to their tooltips.
  • Updates on maps: overlays and region notes are placed by longitude and latitude, and follow a pan, a zoom or a turning globe.

Layout

  • A Vega-Lite chart given a canvasSize is drawn within it: the house's chrome, the headline, keys and labels are measured first, and the plot takes the room left.
  • ECharts, Chart.js and Plotly lay out their frame by the same rules: headlines broken to full lines, long names wrapped, keys and axis titles measured. Plotly draws the house's header and source line.
  • A distribution's value axis (boxplot, violin, density, ridgeline, ECDF) fits its data instead of reaching to zero.
  • A bar split only by detail reads as one bar: no seams between its segments, and its label shows the bar's total.

Annotations

  • A note (annotate-text) is a caption beside what it names, with a leader only where it stands off. The bordered card is gone; draw a callout box with set-overlay.
  • A spec carries its own updates (notes, overlays, emphasis, viewport), so a copied spec keeps them.
  • set-annotation is deprecated: write annotate-text.

MCP

  • Chart guides: list_chart_types with chartType returns that type in full: what it is for, its guidance, its chartProperties and interaction presets.
  • App skill: get_flint_skill serves app (flint-app-author) for code that uses flint-chart in an app, a notebook or a script.
  • Board colours: a board's colors binds colours to values per field, so a value keeps one colour on every chart and across turns.
  • Clearer reports: show lists what must be fixed before a chart draws apart from what it draws with.

Performance

Faster compiles on large data, from Shayne Boyer (Shayne Boyer (@spboyer), #160). Each change keeps its output identical and ships with the script that measured it.

Fixes

Reading data

  • ISO timestamps are read as dates. Dates that arrive as timestamps ("2005-05-01T00:00:00.000", "…Z", "2005-05-01 00:00:00", as a database DATE column often serialises) are read as dates under Year, YearMonth, Date and the other calendar types. A midnight timestamp becomes its date, so the axis prints short labels (Jun · Jul · Aug) instead of full timestamps. Marks sit on their date in every time zone (a Pacific machine used to draw them 7 hours late), and a time of day without a zone is labelled at the hour it says.
  • Percentages stored as fractions print as percentages. A Percentage field holding 0.164 prints 16.4%, not 0.164, without needing an intrinsicDomain.
  • Number is not added up. A field typed Number has unknown additivity, so it is no longer summed or stacked by default: a bar's label or share takes the encoding's aggregate, else the mean. Type totals as Count, Amount, Quantity or Profit; an untyped numeric field still sums.
  • One-letter units keep their case. A unit of M is millions, not metres.
  • A percentage's scale can be stated. The new percentScale annotation ("fraction" or "percent") settles how a percentage is stored instead of guessing from the values. Before, a growth rate stored as 2.4 (for 240%) printed as "2.4%", and the same column could be formatted two ways depending on which rows a query returned. Axes, tooltips, domains and KPI cards all follow it (Percentage representation is guessed from the data even when intrinsicDomain is set #154).

Layout and sizing

  • A chart stays inside its canvasSize. A Vega-Lite chart that read well only when drawn larger than its box (a key beside a full-width plot, a title over a full-height one) used to overflow and get cut off by hosts that draw the SVG at its own size. It is now laid out again for the smaller room: the plot gives up space so keys, labels and title fit. The plot keeps at least half of each side, and no value is cut or label turned to make room. canvasFit: 'off' keeps the old drawing.
  • No more few-pixel overrun. The canvas fit reserved 8 px of padding where Vega-Lite pads by 5, so a chart sized to its box ran slightly over it.
  • Value labels past horizontal bars extend the axis. The room kept for labels at bar ends now runs the axis, ticks and gridlines on to the plot's edge, instead of leaving an empty stretch with no scale. Bars keep their lengths.
  • Stepped colour keys fit beside short plots. A binned colour key next to the plot no longer runs past it: Vega-Lite drew the ramp at its 200 px default, twice the height of a short heatmap.
  • Bars sorted by value stay sorted under every house. With sortBy: "x", the NYT, Economist, Power BI, Pop and De Stijl houses drew bars in name order, because their value labels and row names sit on the same band and Vega-Lite drops a sort the layers don't share. Datawrapper's names-above-bars layout failed to compile in 1.0.1. Every layer now states the same order.
  • A chart with no theme draws on the host's background. options.background and the background taken by the React view, the interactive renderer and renderSvg now reach the chart, where Vega-Lite's default white used to win. A theme with its own canvas keeps it.

Keys and labels

  • Compact numbers roll over. A value that rounds up to the next unit prints in it: 999,600 is 1M, not 1000k (Compact number labels print "1000k" and "1000M" when a value rounds up to the next unit #172).
  • Size keys print the values they list. A size key for 0.5, 1 and 2.5 used to read "1, 1, 3". Each key now carries a format precise enough for its values, and its width is measured from those labels. Plotly and ECharts size keys no longer round small values to 0.
  • Colour keys beside short plots keep round labels. A continuous colour key shortened to fit a short plot printed only its two raw ends (−53,901, 43,635); it now prints round values.

Heatmaps

  • Cells along a time axis tile. Each date covers the period it repeats at, read from the values (dates, timestamps or epoch milliseconds): its month, quarter or year whatever day it falls on (month ends, the 5th, quarter ends); a day, week or hour where the step is exact; or until the next date where the dates are about one step apart (13 or 14 days). Dates 13 or 14 days apart, or at month ends, used to draw as one-day slivers. A missing period stays an empty gap.
  • A whole run of months is a time scale too, with time-axis labels, instead of one band per month.
  • No internal field in the axis title. A heatmap on a time axis titled it Date, __cell_x_end.
  • Dates on a bar chart about 45 days apart now read as a run of time and stand on a time scale; eight or fewer dates are still one band each.

Interactions and updates

  • Filters work on aggregated charts. filterControls on a chart with an aggregate encoding (average, count, sum) or several y fields used to empty the plot, because filtered rows were swapped in raw. They are now shaped the way the chart's own rows were.
  • No internal sort index in tooltips. A tooltip on a filtered stacked chart no longer lists Vega-Lite's _<field>_sort_index.
  • Updates that validated now draw. Four kinds of update that validateChart accepted were silently dropped when drawn: a numeric key on a field drawn as categories ({ Year: 2016 } on a banded year), a single-row series on a line chart (now drawn as a point a note can point at), a region caption asked to sit where it doesn't fit (now placed where it fits), and overlays with strokeDash: 'dash' or 'dot'. An overlay the renderer can't read no longer stops the chart's other updates.
  • Line dots are drawn once. In the live view, a line chart under a house with its own vertex dots (cartoon, pop) drew a second, full-size set beneath them.
  • Live legends keep their order and colours. An unsorted colour (sort: null) kept the static chart's order but turned alphabetical when drawn live, recolouring every series; a faint ink's darker edge also landed on the wrong series.
  • Tooltips and hover read in the house's type. A tooltip is set in the house's label face (11–13 px); a hovered line vertex shows as a dot a little wider than the line.
  • Notes attach to points on a line. A note keyed to an interior point of a line drawn with points matched both the point and the segment starting there, and reported "matched nothing".

Annotations

  • Captions keep off the chart's furniture. A note's, region's or enclosure's caption no longer lands on the source line, a map's credit, or a house's header and rules; and on a map it no longer treats land and water as marks to avoid.
  • Enclosures at the plot's edge are drawn whole. Where an enclosed dot sits within 12 px of a continuous axis's end, the axis is padded so the outline isn't cut.
  • Enclosures take the cluster's colour. An outline round a cluster of dots uses the dots' fill, not the outline a house draws round every dot (every cluster came out black under pop).

Themes

  • An area's edge takes its ink. A single series inked on the mark drew Vega-Lite's default blue edge.
  • Extended houses keep readable type. A theme that extends a house and recolours its text or page takes the house's typography with it, and colours that would no longer read on the new page are adjusted. A dark page extending nyt no longer sets its title in near-black.

Installing

xavier (xavier-shaw) and others added 30 commits October 22, 2026 00:27
A title or deck that ends in a widow is broken again over the same number
of lines, as full as they can be: a DP charges every line but the last its
squared room left on the block, and the last must reach a third of it.
Replaces evening the last two lines, which left one full line over two
half lines. Playground page #/playground/title-wrap compares the rules.
The report no longer repeats the spec (chart type, theme, encodings,
interactions, "User interactions: none."). Each chart lists its errors,
warnings and update ops that will not apply; a finding several charts
share is listed once; the layout takes one line. Link notes on linked
charts sit apart and do not count as something to fix; the shared colour
order note is gone. A clean spec reads "Nothing to fix: call show with
this spec." validate_chart returns the text report alone for vegalite,
so each warning appears once. The skills describe the new report.
…re, and a source says its lead-in once

FlintTable keeps the title, subtitle and notes in place and scrolls the
rows under sticky column headings. A chart's table carries the plan's
header pieces, closing rules and source line, and FlintTable draws them,
so a table under the Economist or BBC theme gets its tab, rules, source
and house credit. A source that already starts with the theme's lead-in
("Source: Gapminder") prints it once. The card's table PNG draws the
rules, the tab and the source line.
ChartView locks overflow on html and body for its own iframe; the site embeds
it in the page itself, so the playground gallery could not scroll. Call
useHostPage above the card in the three embeds that lacked it.
The canvas-fit pass judged a chart by how far the host would scale it, and left
one that read well drawn up to ~30% larger than its box: keys beside a plot that
filled the width, a title over one that filled the height. Hosts that draw the
SVG at its own size (Data Formulator) cut them off.

After the fit, planLayout now runs containInCanvas: where an explicit
canvasSize is given and the measured drawing runs past it, the chart is laid
out again for a smaller room (CanvasTreatment.contain) - the fit's edits kept,
keys held at their edge - found by a few rounds of bisection per side. A round
is kept only if the plot keeps >= 50% of each side, no more values are cut by
overflow truncation and no label is turned that stood flat; a result that is
nearer but not within must gain at least min(3 points, half the gap) of scale.
Reported as 'canvas-contain'; skipped for canvasFit 'off', composites, pinned
sessions replays (replayed via the treatment), and unmeasured furniture.

The drawing estimate used by this step also counts a deck printed without a
headline (furniture-reserve deckAlone), a row of keys from its anchor along the
plot, the half of a top y label that stands above the plot, and leaves out
series-end names that are drawn inside the plot. These are scoped to the new
step: charts without canvasSize lay out byte-identically (5441 corpus cases).

Tests: canvas-contain.test.ts renders the issue's charts (stacked, line, donut,
bar) under none / keys-on-top / nyt / datawrapper at 600x300, 290x300, 290x240
and asserts the SVG stays within the box. row-names-above: the note now names
the room laid out for. live-values: the pushed-vs-fresh comparison tolerates
<=1px at the root frame only - a pre-existing Vega incremental-layout quirk
(8/76 transitions at baseline) that the new sizes happen to hit.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: dcd3da51-67ac-4e66-b402-bfab78750c39
…ouse

Data Formulator hit "Cannot destructure property 'aggregate' of
'fieldDefToSortBy'" in flint-chart 1.0.1: datawrapper sets row names above the
bars only in narrow, tall boxes (240x420, 320x420 for 14 long names), and the
channel sort "-x" on that layer, which has no x, threw inside Vega-Lite. The
fix is already on dev (bandOrder / alignBandOrders, ff18201 + aad6b2d); the
existing test covered one size.

The new grid compiles 5 sorted-bar variants (sortBy x desc/asc, columns sorted
by y, field sort, stacked) at 6 widths x 4 heights under no theme and every
THEME_PRESETS house with vega-lite compile, asserting no throw and no dropped
sort ("conflicting sort properties"), and checks the grid reaches the
row-names-above layer at 240x420 and 320x420. It fails under 16 houses with
alignBandOrders disabled.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: dcd3da51-67ac-4e66-b402-bfab78750c39
filterControls swaps the rows a filter leaves into the compiled inline
source through prepareDataRows, which only converted temporal values. The
compiled data of a chart with an aggregate encoding (or several y fields)
holds rows Flint folded and aggregated at build time, so the raw rows had
no price_average-style column and the chart emptied. prepareDataRows now
uses the session's shapeRows, the same analysis step that built the data
and that replan already uses for filtered rows.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: dcd3da51-67ac-4e66-b402-bfab78750c39
…#172)

999,600 printed as 1000k (or 1,000k under one unit per set) because the
unit was chosen from the unrounded magnitude. The unit now moves up where
the value rounds to 1000 at the precision it prints with, in the JS
formatter, the Vega expression, the shared-unit path, the KPI tile and the
label-width estimate.

Fixes #172

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* [deploy] fix plotly issue and mcp (#152)

* local

* updates

* fixes

* perf(js): lazily discover fields for encoding sort repair

---------

Co-authored-by: xavier <75410443+xavier-shaw@users.noreply.github.com>
Co-authored-by: Chenglong Wang <chenglong.wang@microsoft.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
* [deploy] fix plotly issue and mcp (#152)

* local

* updates

* fixes

* Reduce temporal conversion column allocations

---------

Co-authored-by: xavier <75410443+xavier-shaw@users.noreply.github.com>
Co-authored-by: Chenglong Wang <chenglong.wang@microsoft.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
* [deploy] fix plotly issue and mcp (#152)

* local

* updates

* fixes

* Avoid preliminary full Python semantics pass

* Preserve Python type pass benchmark evidence

---------

Co-authored-by: xavier <75410443+xavier-shaw@users.noreply.github.com>
Co-authored-by: Chenglong Wang <chenglong.wang@microsoft.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
* [deploy] fix plotly issue and mcp (#152)

* local

* updates

* fixes

* Add reproducible compiler and render baselines

* Bound render benchmark workers and guarantee cleanup

* Record bounded local render baseline

---------

Co-authored-by: xavier <75410443+xavier-shaw@users.noreply.github.com>
Co-authored-by: Chenglong Wang <chenglong.wang@microsoft.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
* [deploy] fix plotly issue and mcp (#152)

* local

* updates

* fixes

* perf: index explicit overflow order membership

Replace per-entry linear membership scans in the default overflow
explicit-value order (JS defaultOverflowOrder, Python
_default_overflow_strategy) with an invocation-local Set.

JS Set.has uses the same SameValueZero equality as Array.includes.
Python set membership matches list membership for the hashable
unique values (incl. True == 1); unhashable JSON entries fall back
to list membership so they are still skipped rather than raising.

Adds scripts/bench-overflow-order (harness + recorded 3-round results).

Refs #161

---------

Co-authored-by: xavier <75410443+xavier-shaw@users.noreply.github.com>
Co-authored-by: Chenglong Wang <chenglong.wang@microsoft.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Chenglong-MS
Chenglong Wang (Chenglong-MS) merged commit 381af83 into main Nov 16, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants