Repository navigation
Releases
zuzu v0.9.0
zuzu v0.9.0 finishes phase 3, the runtime of Vega, and works through much of phase 7, the diagrams, with compatibility and visible differences first. It adds the expression functions that zuzu did not have, lays out a grid as Vega does, draws more of the guides of Vega, compiles more of Vega-Lite as vega-lite.js does, and draws more of DOT and Mermaid. The README now shows the code of its examples and the charts and diagrams that they draw. The output of many charts and diagrams changes, as the sections below say.
Conformance
- Vega: 538 of 540 specs match vega.js, up from 536. Only
density-heatmapsandflight-passengersdiffer. - Vega-Lite: 464 of 470 specs match, up from 461, and every one of the 1193 scales.
Vega
- The expression functions
gradient,copy,geoShape,treePath,treeAncestors,vlSelectionTest,vlSelectionIdTestandvlSelectionResolvework, andgeoArea,geoBoundsandgeoCentroidmeasure on the sphere with no projection. vega.js agrees on 377 oracle cases. - The grid layout of a facet and of a concatenation reads
align,bounds,center,columns,padding,offset,headerBand,footerBand,titleBandandtitleAnchor, as the documents of Vega say. - A domain that mixes strings and numbers sorts as V8 sorts it.
- An axis draws
tickBand,tickOffset,tickRoundandtickExtra, and readsbandPositionfromconfig.axisBand. - A legend draws the properties of its title, its frame, its labels, its symbols, its ticks and its gradient that it only reported before.
- A text of more lines puts its first line on its baseline and the other lines below it, as vega.js does.
- A spec that paints its own light background draws in the light mode, so its guides read on it. A group title follows the config of a title and of its style.
formatwrites an infinite number as ∞.- The diverging ramp of the theme runs through
muted, so a mark near its middle shows.
Vega-Lite
- The config of each kind of mark, and
config.mark, pass on as a style that wins over the look, sodx,dyand a color of the config draw. config.numberFormatformats each quantitative field, and the title of the config of the axes applies.customFormatTypesis an issue.- A condition on a property of an axis, such as the
gridDashof each tick, draws, with a test that is an expression or a predicate of a field. tooltipandhrefbecome encodings of Vega. An image and a sized rect center on their point. A datum ofy2and of a text, the valuewidthofx2, and the offsets of an arc compile as vega-lite.js compiles them.- A title that a layer gives wins over the titles of the other layers. A rect with an end keeps zero in its scale. A bar on a scale without zero starts at the bottom of its domain. A legend of a time unit draws symbols. A hollow point draws in its color. A legend of
strokeWidthdraws, with the range 1 to 4 of Vega-Lite.
Diagrams
- DOT: a group of a record lies the other way from the fields around it,
\land\ralign their lines, the ranks balance as dot balances them, an edge with a list of colors draws a line in each, and a table or a cell of an HTML label keeps its link. An unknownrankdiris an issue. - Mermaid:
- The shape
personand the shapes of BPMN draw their figures and put their labels under them. - A node lies in the first subgraph to end that names it, and properties can follow the brackets of a node and run over more lines.
- The box of a subgraph holds its title, and subgraphs side by side in LR keep a gap.
- The ends of the edges spread on a side of a node, and each kind cuts its comments by its own rule.
- The gantt draws its title, the marker of today and the tasks that end before they start as Mermaid does.
- The start and the end of a state diagram take the color of the one state next to them. A note and a box title of a sequence stay in their boxes. The label of a document and of a block arrow centers where a reader expects it.
- The shape
- Layouts: the engine of ELK takes the passes that Mermaid adds, the order of the states and the notes, the algorithm of a subgraph and the ports of an edge. The mean error of the places of the nodes against mmdc fell from 0.022 to 0.008 for ELK and from 0.016 to 0.010 for dagre.
API
zuzu.WithFunctioncan add a function under a new name.expr.Compiletakes the optionexpr.Knownfor it.Chart.Imagepasses the logger of the render, or else of the parse, to okage.- The packages
zuzu,themeandvegalitehave examples of their API.
Decisions
- D57: zuzu draws no look like xkcd, phases 0 and 3 are done, and vega.js copies the rows that a transform changes, which corrects D32 part 14.
Dependencies
- github.com/xo/okage v0.20.1
Full changes: v0.8.3...v0.9.0
zuzu v0.8.3
zuzu v0.8.3 fixes two places where the compiler of Vega-Lite wrote a spec that drew other than vega-lite.js, as in vegalite/bar_grouped_thin.vl.json and vegalite/bar_grouped_thin_minBandSize.vl.json. The output of some charts of Vega-Lite changes, as the sections below say.
A color with conditions alone
- A color with conditions alone, such as
"color": {"condition": {"test": ..., "value": "#aaa"}}, falls back to the color of the mark when no condition holds, as vega-lite.js writes it. Before, such a mark had no fill, so the bars ofbar_grouped_thin.vl.jsondid not draw. - The fallback is the color of the mark, then the color of the config of the mark, then the color of a mark of the theme. The color of the theme comes through a scale of one value,
zuzu_mark_color, which the render fills from its theme in each mode and scheme, because the compile does not know the theme.
Invalid values that a view keeps
- A view that keeps invalid values, with
"invalid": nullon the mark or in the config of the marks, puts an invalid position at zero of its scale, as vega-lite.js writes it. When the domain can leave out zero, the position goes to the bottom for y and to the left for x. Before, a bar of a mean of no values drew at the full height. - A line, an area and a trail break at an invalid value instead, as before.
Dependencies
- github.com/xo/okage v0.20.1
Full changes: v0.8.2...v0.8.3
zuzu v0.8.2
zuzu v0.8.2 puts the labels of some shapes of Mermaid where a reader expects them, and keeps the text of a note and of a box title of a sequence diagram in its box. The output of some diagrams changes, as the sections below say.
Labels of shapes
- The label of a document, a lined document and a tagged document centers on the sheet above the wave across its bottom, as in
diagrams/20-named-shapes.mmdanddiagrams/55-shapes-documents.mmd. The label of a lined document also moves off its strip, and the label of a stack of documents centers on its front sheet. - The label of a block arrow to one side centers on its shaft, which ends where its head starts, as in
block/04-arrows.mmd. An arrow to both sides, or on both axes, keeps its label in its middle. - A block diagram places the label of each shape as a flowchart does, so the label of a cylinder or a document in a block sits on its body.
Sequence diagrams
- A note of several lines draws its lines in the middle of its box, as in
sequence/09-config.mmd. Before, its first line drew above the box. A divider of ZenUML does the same. - The title of a box of participants of several lines draws in the box, and the diagram no longer leaves space above it.
Dependencies
- github.com/xo/okage v0.20.1
Full changes: v0.8.1...v0.8.2
zuzu v0.8.1
zuzu v0.8.1 gives a named node of Mermaid the color of the hash of its name (D56), and fixes the two failures of the tests of v0.8.0 on GitHub. The colors of class, ER, requirement, sequence, gitgraph and use case diagrams change, as the sections below say.
Colors by the hash of a name (D56)
- A class, an entity, a requirement and an element take the categorical color at the FNV-1a hash of their id, in the default theme and in a color theme of Mermaid. Before, they all took the first color.
- A participant of a sequence and of ZenUML, a branch of a gitgraph, and an actor and a use case with
colorScheme: rotatetake the color of the hash too, in place of the colors in turn. - A node whose color an earlier node took takes the next free color, so up to ten nodes take ten colors. So a name keeps its color across diagrams and edits, where Mermaid gives the colors in the order in which the names first appear.
- A subgraph, a lane, a composite state, a namespace, a subgraph of an ER diagram and a system boundary take the color of the hash among the second to the tenth colors, so a panel never takes the color of the nodes in it. A class does not take the color of its namespace.
- A node colored by its kind, in an agentflow, a C4 diagram or an event model, keeps the color of its kind. A chart of data, such as a pie, a sankey or the sections of a timeline, keeps its colors in turn.
- A fill or a stroke that the source gives wins over the color.
Fixes
- On arm64, the mix of two colors gave other bits than on amd64 and d3, so some named schemes of Vega were one off in a channel. Each product of the mix now rounds, so no architecture fuses it with the add.
- The test module requires zuzu v0.8.0, as the module elk does, so
go mod tidyleaves it as it is.
Dependencies
- github.com/xo/okage v0.20.1
Full changes: v0.8.0...v0.8.1
zuzu v0.8.0
zuzu v0.8.0 adds the look like Excalidraw, the layouts of dagre and ELK, and the projections of vega-projection-extended. It records the answers of the maintainers of 2026-11-22 (D38 to D55) and fixes many charts and diagrams that the review page found. The output of many charts and diagrams changes, as the sections below say.
The look like Excalidraw (D39 to D43, D47, D49, D50)
- The new options
WithLookandWithLookFontdraw a chart in a look.theme.LookExcalidrawdraws each mark as if by hand, with the sketch of rough.js, which zuzu copies in Go.theme.LookStandardis the default. - The package
text/excalifontholds Excalifont under the OFL. Callzuzu.WithLookFont(theme.LookExcalidraw, excalifont.Font()). - The key
zuzu.lookof the config of a spec, andlook: handDrawnof Mermaid, select the look.zuzu.lookSeedandhandDrawnSeedgive the seed. The same source, seed and fonts give the same bytes on one architecture. - The SVG of a look embeds its font.
svg.Writetakes options, andsvg.WithFontembeds a font. - A fill draws as a hachure over an underlay, so a mark hides what is under it. A gradient draws as a hachure over a tint of itself. A small shape wobbles less, and a shape shorter than 10 fills solid.
The layouts of dagre and ELK (D39, D44, D45)
- The transform
zuzu.dagrelays out a graph as the dagre of Mermaid 12.3 does. zuzu copies dagre in Go. - The new module
github.com/xo/zuzu/elkholds a copy of ELK in Go, with the engineelkand its layouts, such aselk.stress. Callzuzu.WithLayoutEngine(elk.Layout()). - The new options
WithLayoutEngineandWithLayoutmake an engine available and force a layout.layout: dagreandlayout: elkof Mermaid select the layout.
Projections (D52)
- zuzu draws the 18 projections of vega-projection-extended, such as
airy,armadillo,berghaus,gingery,healpix,peirceQuincuncialand the interrupted projections. A projection clips to its own outline. - A mark can clip to a path or to the sphere of a projection, in the SVG, in the PNG and in the look.
Colors of Mermaid (D53, D54, D55)
- A diagram whose source names no theme draws in the scheme of zuzu, with the blue of a chart and a graph of DOT, not the pink of
mermaid-redux-color. - A node, a note and a panel fill with a solid tint of their color, with no opacity, so a node over a panel keeps its tint. This holds for every graph and for the boxes that the charts of Mermaid color by kind.
- An agentflow diagram colors its nodes by kind and its flows in turn. Composite states draw a title band. The subgraphs and the lanes of a flowchart, and the composite states, take the colors in turn from the second.
- A note takes the yellow of the scheme.
- The start and the end of a state diagram, a fork bar and a junction point fill solid. A start or an end takes the color of the one state next to it.
Charts (D46, D48, D51)
- Axes, ticks and named schemes follow Vega more closely. An axis draws the grid of Vega and labels fewer ticks where the labels crowd.
- In the dark mode, a gray near black or white that a spec names flips its lightness.
- A line gets a name at its end, and an area a label of its high point, only where they fit. A ranged area draws as a flat tint.
- Many fixes to the compiler of Vega-Lite: legends of points and custom shapes, the corner radius of stacked bars, labels of normalized bars, trails, the parallel coordinates, quarters of a time axis, and the area under a layered line.
Diagrams
- DOT: the arrows of a loop sit on the loop, the cylinder takes the shape of Graphviz, and a long edge bends around the nodes of its ranks.
- Mermaid: the labels of shapes with a header or a side band sit where a reader expects them, markdown runs draw in bold and italic, and the state notes and composites draw as Mermaid draws them.
Dependencies
- github.com/xo/okage v0.20.1
Full changes: v0.7.5...v0.8.0
zuzu v0.7.5
zuzu v0.7.5 draws the math of KaTeX in the labels of Mermaid, records the answers of the maintainers of 2026-11-20 (D35, D36 and D37), and does the easy items of the backlog. The output of some charts and diagrams changes, as the sections below say.
Math in the labels of Mermaid (D36)
- A text between two
$$in a label draws as math. The math layout of okage lays it out in STIX Two Math. - The new Parse option
zuzu.WithMathgives the font. The packagegithub.com/xo/zuzu/text/mathholds STIX Two Math under the OFL. Callzuzu.WithMath(math.Font()). - A formula draws as a path with the role
math, in the color of its label. The SVG names its TeX inaria-label. - If the parse has no font of math, or okage cannot lay out a formula, the label draws its source. The report names the label and the command at fault.
Look and themes (D35, D37)
- A sequential ramp takes its form from the lightness of its background.
- A kind of Mermaid whose section has the theme
redux-colorby default draws in mermaid-redux-color when its source sets no theme. - The
bgcolorof a graph of DOT fills the page and is the background of the theme. The mode follows its lightness.WithBackgroundwins over it. colorScheme: rotateof a use case diagram gives each actor, use case and boundary a categorical color in turn.- A diverging scheme name of Vega takes the diverging ramp.
rainbowandsinebowtake a wheel of the categorical colors.
Fixes from the backlog
- Guides: an encode of a part of an axis applies as in vega.js, a legend wraps at the width of the plot, and a closed line gets no end label.
- Mermaid: the bit numbers of a packet draw at size 10, and a theme in the section of a kind applies. C4 accepts
c4ShapeInRowandc4BoundaryInRow.\nstarts a line in a label. - DOT: a record keeps its empty fields,
label=""draws no text, andweight=0does not pull its ends. A loop draws above its node in LR and RL. - Vega: a fill that is an object with no gradient is no gradient. The open and closed curves of basis, cardinal and catmull-rom draw.
Dependencies
- github.com/xo/okage v0.19.0
- zuzu reads its fonts with the copy of go-text in okage, so it no longer requires github.com/go-text/typesetting.
Full changes: v0.7.4...v0.7.5
zuzu v0.7.4
zuzu v0.7.4 updates okage. The output of zuzu does not change: the tests, the conformance and the TinyGo build give the same results as v0.7.3.
Dependencies
- github.com/xo/okage v0.18.1
Full changes: v0.7.3...v0.7.4
zuzu v0.7.3
zuzu v0.7.3 updates its dependencies. The output of zuzu does not change: the tests, the conformance and the TinyGo build give the same results as v0.7.2.
Dependencies
- github.com/xo/okage v0.12.0
- golang.org/x/image v0.48.0
Full changes: v0.7.2...v0.7.3
zuzu v0.7.2
zuzu v0.7.2 embeds IBM Plex Sans as one font file in WOFF2, which makes a program that imports zuzu 958 KB smaller. It also fixes the marks and the layout of Vega and Vega-Lite that a new review page showed, and adds a tool that draws each source beside its original.
Changed
- IBM Plex Sans in WOFF2. The six faces of IBM Plex Sans are now one TrueType collection, compressed in WOFF2: 277 KB in place of 1.2 MB of TTF files (D34).
text.Fontsdecodes it once, in about 8 ms, and givesfonts/IBMPlexSans.ttcbeside the license, in place of six.ttffiles. A program that reads a face by the name of its file must read the collection now. Noto Color Emoji stays in TrueType. - Fallbacks in a web format.
text.NewFallbackaccepts a font in TrueType, OpenType, WOFF, WOFF2 or EOT, andFallback.Datagives the TrueType or OpenType bytes.
Fixed
- Vega marks. The pointRadius of a geoshape runs on each object. An axis offset reads a value reference, and a field reference can name a field that is itself a reference. The root group keeps the x and the y of its encode. An area takes a width or a height in place of x2 or y2. A continuous scale spreads a scheme over a domain of any length.
- Labels of guides. A number format with no precision takes the precision that tells two ticks apart, as d3-scale does, and the format "s" writes each label with the prefix of the largest end. A log axis labels only the ticks that d3 labels. The encode of an axis applies to its labels, title, grid and domain.
- Colors. merge of a color keeps a color in the space of the last color, as vega.js does. An axis reads
config.axis.domain. - Vega-Lite marks. A bar on a continuous scale with no x2 gets a center and a width, so the bodies of a candlestick draw. The outliers of a boxplot sit at the middle of the band. A channel keeps every condition of a list. The offsets of a mark add to its position.
- Vega-Lite layout. A nominal or ordinal y with a fixed height puts its first category at the top. A mark that is not an arc reads theta and radius. A facet in a concatenation keeps its title, and the spacing of a facet and of a concatenation is read. A dashed line whose gaps are no longer than its width has flat caps. A mark that sets clip is clipped to its group in SVG and in an image.
Added
- Review page.
test/cmd/reviewdraws each spec and each diagram of the corpus with its original renderer and with zuzu, and writes a page that shows the two side by side. - Survey.
docs/survey/compare.htmldraws zuzu in its first column, beside 14 other chart and diagram libraries. - Logo. The README shows the logo of zuzu.
Dependencies
- github.com/xo/okage v0.8.0
Full changes: v0.7.1...v0.7.2
zuzu v0.7.1
zuzu v0.7.1 fixes the texts of a venn diagram that drew over each other.
Fixed
- Venn texts. Mermaid wraps each text of an area at the width of its cell, so a word wider than its cell runs into the text beside it. In the corpus, the union
Frontend, Backend["Fullstack"]drew "REST" and "GraphQL" as "REGraphQL", and so does mmdc. When a text of an area does not fit its cell, zuzu now stacks the texts of that area in one column, under the label. Areas whose texts fit keep Mermaid's grid.
Dependencies
- github.com/xo/okage v0.5.0
Full changes: v0.7.0...v0.7.1