Repository navigation
v0.2.12
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: aChartofLayers, each aMark(bar, line, area, point or arc) overDataplaced by anEncodingofx,y,colorandthetaChannels, a subset of Vega-Lite named as Vega-Lite names it.Dataholds named columns, numbers asArc<[f64]>and text as codes into the distinct strings, and every change takes a newgeneration.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::planlays 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
Channelcarries atitle, aScale(zero, a fixeddomain,nice) and aSort(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::importreads Mermaidpieandxychart-betainto a chart, under themermaidfeature. 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::importreads a Vega-Lite spec with inlinedata.values, one mark or a top-levellayer, and the four channels, under thevega-litefeature. A spec using what it cannot draw as written, such as a transform, an aggregate or a log scale, answersNone.- A
```mermaidfence holding a pie or an xychart is drawn as a chart under markdown'smermaidfeature, instead of showing its source. blockshas avega-litefeature: a```vega-litefence 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
seedtable, aSeedof 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_oklabmixes two colours in OKLab.MultiSelect::with_widthsizes the picker to its widest row between a floor and a ceiling, instead of its fixed 280px.AppExt::set_menu_widthinstalls aMenuWidth: 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_zoominstalls amermaid::Zoom, the farthest out, closest in and per-press step a mermaid diagram's corner buttons zoom by.Theme::familynames the family a palette was built from.AppExt::set_link_hoverinstalls aLinkHover, 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_quoteandpeelput 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::quoteslists the quotes a block can be put in, forEditor::toggle_quoteand the slash menu'sSlashAction::Quoterows.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 reportsMultiSelectEvents and paints whatset_choiceshands it. The gallery has a Multi-select page.multi_select::tintcolours a name the same on every machine, andContent::chippaints a name on a wash of a colour.Theme::categoricalis 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::darkandlightare optional, so a family can ship one variant; one with neither fails to deserialize.ThemeFamily::variantandthemeanswerNonefor the missing one.- Quoting is
Block::quote, aQuotedwith the GFM alert, instead ofBlockKind::Quote, which is gone. Adjacent quoted blocks form one blockquote.Formatting::quoteis the quote the caret's block sits in;Formattingbuilt field by field needs it. blocks::rendertakes the fence's stated height,Option<u32>, after the code.markdown::LinkHandleris handed the document'sEditing::baseafter the URL, so an app can resolve a relative link the way the renderer resolves a relative image.uiturns on the icons'layoutcategory.- gpui is
bezel-gpui0.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.