Skip to content

v0.2.12

Choose a tag to compare

@clearloop clearloop released this 10 Oct 12:32
· 10 commits to main since this release
58c75fa

Charts: a Vega-Lite-shaped chart model over columnar data, drawn by one gpui element, from Mermaid pie and xychart fences and a vega-lite block. Also quoting as a property of the block, theme families with one variant, seeded variants, and brand tints that leave a family's palette alone.

New

  • bezel-chart, a new crate: a Chart of Layers, each a Mark (bar, line, area, point or arc) over Data placed by an Encoding of x, y, color and theta Channels, a subset of Vega-Lite named as Vega-Lite names it. Data holds named columns, numbers as Arc<[f64]> and text as codes into the distinct strings, and every change takes a new generation.
  • chart::view(id, chart) draws a chart as one element: axes, gridlines, a legend, stacked bars, lines, areas, points and pie slices in the theme's colours, and a tip that reads out every layer under the pointer. Its layout is kept until the data's generation, the size or the text style changes, and a line or area with more points than the plot has pixel columns is thinned by M4.
  • chart::plan lays a chart out at a size with no window: marks, axes, labels and a hover index in pixels, for a consumer that paints its own.
  • A Channel carries a title, a Scale (zero, a fixed domain, nice) and a Sort (data order, ascending, descending or an explicit list). Layers share their x and y scales, and a colour value is one colour across them.
  • chart::mermaid::import reads Mermaid pie and xychart-beta into a chart, under the mermaid feature. An xychart keeps its axis titles and y range, and its bars and lines become a bar layer under a line layer.
  • chart::vega_lite::import reads a Vega-Lite spec with inline data.values, one mark or a top-level layer, and the four channels, under the vega-lite feature. A spec using what it cannot draw as written, such as a transform, an aggregate or a log scale, answers None.
  • A ```mermaid fence holding a pie or an xychart is drawn as a chart under markdown's mermaid feature, instead of showing its source.
  • blocks has a vega-lite feature: a ```vega-lite fence drawn as a chart, at the fence's stated height.
  • The gallery has a Charts page: every mark, a layered chart, a 100,000-point line and a live series.
  • A theme family variant can carry a seed table, a Seed of surface, ink and accent with optional added, removed and highlight colours, that every opaque surface, text, accent and syntax token is grown from before the variant's own tokens apply.
  • mix_oklab mixes two colours in OKLab.
  • MultiSelect::with_width sizes the picker to its widest row between a floor and a ceiling, instead of its fixed 280px.
  • AppExt::set_menu_width installs a MenuWidth: the narrowest a menu panel sits, and whether one with a described row is a fixed width or fits its widest row up to a ceiling (Described::Fit).
  • AppExt::set_mermaid_zoom installs a mermaid::Zoom, the farthest out, closest in and per-press step a mermaid diagram's corner buttons zoom by.
  • Theme::family names the family a palette was built from.
  • AppExt::set_link_hover installs a LinkHover, the card an app paints over a link it owns while the pointer rests on it. A link without one keeps its bookmark.
  • Doc::set_quote, toggle_quote and peel put a block in a quote, switch a blockquote's alert, and take a block's syntax, quote and indent off one layer at a time. editor::quotes lists the quotes a block can be put in, for Editor::toggle_quote and the slash menu's SlashAction::Quote rows.
  • ui::multi_select::MultiSelect, Notion's multi-select as a popover body: the choices that are on as chips in the query line, a check or a dash per row, a Create row for a new name, and a ··· per row to rename or delete. It reports MultiSelectEvents and paints what set_choices hands it. The gallery has a Multi-select page.
  • multi_select::tint colours a name the same on every machine, and Content::chip paints a name on a wash of a colour.
  • Theme::categorical is the set of colours charts draw their series in, for anything else told apart by colour.

Changed

  • A mermaid diagram's zoom buttons step by 1.25 between 50% and 200%, instead of walking a fixed ladder.
  • ThemeFamily::dark and light are optional, so a family can ship one variant; one with neither fails to deserialize. ThemeFamily::variant and theme answer None for the missing one.
  • Quoting is Block::quote, a Quoted with the GFM alert, instead of BlockKind::Quote, which is gone. Adjacent quoted blocks form one blockquote. Formatting::quote is the quote the caret's block sits in; Formatting built field by field needs it.
  • blocks::render takes the fence's stated height, Option<u32>, after the code.
  • markdown::LinkHandler is handed the document's Editing::base after the URL, so an app can resolve a relative link the way the renderer resolves a relative image.
  • ui turns on the icons' layout category.
  • gpui is bezel-gpui 0.3.19, where a scroll container moves only on the axes it scrolls: a sideways swipe over a vertical list no longer scrolls it down, and a downward swipe over a wide table no longer pans it.

Fixed

  • A brand's tint rotates the shipped palette only, instead of also turning a theme family's own greys.
  • A list, task, code block or table inside a blockquote stays inside it, instead of breaking into an empty bullet and a separate quote per item.
  • Hovering a link the app owns, chip or plain, opens the app's hover card instead of no card at all.