Repository navigation
Releases
zuzu v0.12.0
zuzu v0.12.0 lets a caller give zuzu fonts from a file system, including the fonts of the system, and lets a color scheme name a font, as D62 records. A title of HTML now turns in a swimlane diagram from the left to the right.
Fonts
WithFonts(fs.FS)gives a set of font files. A text whose font names a family of the set draws in that family, in the layout, in the SVG and in the PNG. The set reads the names of its fonts once, on first use, and reads a whole file only when a text draws in it.- The fonts of
WithFontsalso draw a character that IBM Plex Sans, the font ofWithFontand the font ofWithEmojido not have. Such a character draws, and the report no longer names it. - The new package
text/systemreturns the font folders of Linux, macOS and Windows as anfs.FS, such aszuzu.WithFonts(system.Fonts()). zuzu reads no file of its own, and only a caller that calls it reads the fonts of the system. - By default, the SVG names a font that draws only a missing character and does not embed it.
WithEmbedCoverFonts(true)embeds it. - A scheme can name the monospace, the humanist sans, the serif or the rounded sans that zuzu bundles, with
theme.FontandScheme.WithFont. A text then draws in that font when the caller gives it, and in IBM Plex Sans when the caller does not. The font ofWithFontwins over it. - A kind of Mermaid that lays out when it parses, such as a sequence diagram, lays out again at a render whose font differs from the font of the parse, so that its labels fit. This also holds for a render in the look drawn by hand with its own font.
- The warning
ErrNoLookFontnames the font that a text draws in.
Mermaid
- In a swimlane diagram from the left to the right, a title of a lane that holds HTML turns by -90 degrees, as a plain title and a title of math do.
Conformance
- Vega: 540 of 540 specs match vega.js, and every dataset, scale and mark.
- Vega-Lite: 464 of 470 specs match, and every one of the 1193 scales.
Decisions
- D62: a scheme names a font, and WithFonts gives fonts from a file system. It amends D16, D32, D35 and D58.
Full changes: v0.11.1...v0.12.0
zuzu v0.11.1
zuzu v0.11.1 fixes two items of the backlog. A Vega tooltip whose value is the item shows the fields of the item as vega.js shows them, as D61 records. A title of math turns in a swimlane diagram from the left to the right.
Vega
- A tooltip whose value is the item itself, such as
"tooltip": {"signal": "item"}, shows the fields of the item in the order that vega.js sets them. The defaults of the config show the theme of zuzu. It no longer goes in the report. A tooltip of the item of a guide or of the root group, or of another part of the scene such asitem.mark, still goes in the report. - A tooltip of an object keeps the order of its keys where zuzu knows it, as for an object literal of an expression or an object of JSON in the spec. zuzu sorts the keys of any other object.
- In a tooltip, a null or an undefined in an array shows as nothing, as
[1, ]. - A date in a tooltip, and the function
toStringof an expression, write a date astoString()of JavaScript does, in the time zone of the call, with the name of the zone.
Mermaid
- In a swimlane diagram from the left to the right, a title of a lane that holds math turns by -90 degrees, as a plain title does.
Conformance
- Vega: 540 of 540 specs match vega.js, and every dataset, scale and mark.
- Vega-Lite: 464 of 470 specs match, and every one of the 1193 scales.
Decisions
- D61: a tooltip shows its value as vega.js shows it.
Full changes: v0.11.0...v0.11.1
zuzu v0.11.0
zuzu v0.11.0 finishes the work of phase 7 that zuzu can do alone, as D59 records. Every spec of the Vega corpus now matches vega.js. An encode reads item in the order of the spec, a legend applies an encode that places its parts, a swimlane diagram orders its lanes and hops its lines as Mermaid does, and a text on a color takes the text color with the most contrast.
Conformance
- Vega: 540 of 540 specs match vega.js, up from 538, and every dataset, scale and mark.
- Vega-Lite: 464 of 470 specs match, and every one of the 1193 scales.
- The oracle installs the npm package
canvas3.2.3, so vega.js draws the specs that need a canvas, such asdensity-heatmapsandcontour-plot. The comparison reads an image by its pixels, and leaves out what only the width of text moves (D17).
Vega
- A rounded linear scale interpolates as d3 does, so a value halfway between two pixels rounds as vega.js rounds it.
- An expression of an encoding reads
item.xand each other property that an earlier property of the encode set, as vega.js gives them.item.mark.items, the items of a group item, anditem.markin a guide and in the root group are there too.item.boundsgoes in the report. - An encode of the place of a symbol, a label or a gradient of a legend applies. Each entry is a group, placed from its bounds as vega.js places it. A legend with no such encode draws as before.
Mermaid
- A cell of the attributes of an ER entity draws its bold and italic parts.
- In the mode
compact, a gantt whose axis runs backward places the name of each task as Mermaid does. - A swimlane diagram reads
automaticLaneOrderingandlineHops, and no two of its routes share a line. In a layout LR the title of a lane turns.optimizeRanksByCrossingschanges nothing, as in Mermaid 12.3.
The look
- A text on a colored fill, such as the name of a leaf of a treemap, takes the text of the light or the dark mode, whichever has the higher contrast, with no box. The style
zuzu.textOnColorgives a text this rule. - The hachure of the look drawn by hand fills a path by the rule nonzero of SVG.
- The SVG writer measures the limit of a text with the font of
WithEmoji, so it cuts the text where the layout cuts it.
API
svg.WithFallbacksgives the SVG writer the fonts that measure a limit.- The transform
zuzu.layeredtakeslaneOrderandlaneHops, and a row of a cluster takestitleAngle. Open question 37 asks the maintainers to accept them.
Decisions
- D59: the answers of 2026-11-26. It amends D17, D35 and D55.
Full changes: v0.10.0...v0.11.0
zuzu v0.10.0
zuzu v0.10.0 bundles four more fonts, adds 176 color schemes from the styles of transit, and records the answers of the maintainers of 2026-11-25 in D58. The top-level fontFamily of Mermaid applies to every kind, a caller can set the seed of the look drawn by hand, and the labels of a discrete x axis draw flat when they fit. Three details of the projections now draw as d3-geo-projection draws them.
Conformance
- Vega: 538 of 540 specs match vega.js, as before.
- Vega-Lite: 464 of 470 specs match, and every one of the 1193 scales.
Fonts
- The packages
text/mono,text/humanist,text/serifandtext/roundedbundle IBM Plex Mono, Inter, IBM Plex Serif and Nunito, each as one collection in WOFF2 of the weights 400, 500 and 600, upright and italic, under the Open Font License. Only a program that imports a package holds its font. zuzu.WithFont(mono.Font())draws a chart in one of the fonts. The layout measures in it, the SVG embeds it, andChart.Imagedraws with it. IBM Plex Sans draws each character that the font does not have.- The package
textmeasures each weight and style of a collection in its own face. - A look drawn by hand with no font of its own draws in the font of
WithFont.
Color schemes
- The command
test/cmd/schemesconverts the styles ofgithub.com/xo/transit/stylesv0.7.8 into 176 schemes: 146 styles and 30 families, such ascatppuccin,solarized,github,gruvbox,rose-pineandtokyonight, that pair a light and a dark style.docs/SCHEMES.mdlists them, andtheme/licensesholds the license of each source. - A scheme takes the background and the text of its style, and its categorical colors are the colors of the style.
docs/STYLE.mdgives the rules. The root module does not import transit.
The look
zuzu.WithLookSeedsets the seed of the look drawn by hand. The seed of a render wins over the seed ofParse, which wins overzuzu.lookSeedandhandDrawnSeed.- A label of a discrete x axis draws flat when each label fits the step of its band, and turns by 270 degrees when one does not. A
labelAngleof the spec wins. The compiler reads the label angle ofaxisDiscrete,axisPoint,axisXDiscrete,axisXBandandaxisXPoint.
Mermaid
- The weight and the style of the top-level
fontFamilyapply to the text of every kind, and every kind measures its text in them. The setting is no issue in any kind. - A KaTeX formula narrower than in the browser,
minNodeWidthmeasured in another font, and a comment on the first line of a kind are known differences, whichdocs/DIAGRAMS.mdrecords.
Vega
- An interrupted or a polyhedral projection draws the meridian at 180 degrees along the edge of its first or last lobe, as d3-geo-projection does.
- The parameter
lobesreads the latitudes of its points. clipAngleonarmadilloandberghauscuts the torus or the star, which stays the sphere.
Decisions
- D58: the answers of 2026-11-25. It amends D15, D16, D32, D35, D40 and D52.
elk-go
- zuzu offered fixed seeds to d2lang/elk-go in pull request 10, and reported three differences from ELK.js in issues 11, 12 and 13.
Dependencies
- github.com/xo/okage v0.22.0
Full changes: v0.9.0...v0.10.0
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