Repository navigation
Releases
Releases · BenBotsch/FigureKit
v0.5.1
uv add "figurekit==0.5.1"Changed
- The package is published on PyPI as
figurekit, sincefigkitbelongs to another project
there. Install it withuv add figurekit; the module and the command stayfigkit. A project
that installed the Git tag replacesfigkit @ git+...withfigurekitin its dependencies. - The release workflow uploads the wheel and the source archive to PyPI with trusted publishing.
Changes: v0.5.0...v0.5.1
v0.5.0
uv add "figkit @ git+https://github.com/BenBotsch/FigureKit@v0.5.0"Added
figkit initcopies the bundled tokens and their schema into a project and appends
[tool.figkit]to itspyproject.toml. An existing tokens file is kept and checked; an
existing table stops the command.figkit style previewrenders a specimen of every series, ramp and status colour in each
theme of the project style or of--style.- Chart helpers:
bandshades an interval such as a confidence band in the colour of its
series,error_barsdraws thin bars without caps,calloutpoints at a value with an arrow,
small_multipleslays out panels on the canvas width with shared axes andramp_cmapturns
the ramp of a theme into a colormap. - The gallery shows small multiples with bands and a callout.
figkit check --a11ychecks the colours of the style: text contrast after WCAG, the
separation of neighbouring series with protanopia, deuteranopia and normal vision, and the
steps of the ramp. It runs without a directory as well.
Changed
- The dark ramp of the bundled style is stepped evenly in lightness. Three middle steps were
less than 0.06 apart; dark heatmaps and the tiles of the dark card change their blues. - The example style in
docs/examples/styleorders its series teal, blue, amber, magenta, so
that neighbours stay apart with deuteranopia.
Changes: v0.4.0...v0.5.0
v0.4.0
uv add "figkit @ git+https://github.com/BenBotsch/FigureKit@v0.4.0"Added
- A style of your own.
load_stylereads a tokens file in the new version 2 with any number of
themes, adefaulttheme whose files carry no suffix, themepairs, project font files in
font.filesand acssmapping for the stylesheet check.StyleErrorlists every problem of
the file with its place and catches unknown keys;tokens.schema.jsonhelps editors. render,page,page_entry,path_for,check,check_tokensandink_ontake an
optionalstyle.figkit checkpairs only themes that name a pair, and the manifest lists the
files under the names of all themes.- Each
Themecarries its fonts and sizes asTypographyintheme.type; the helpers,rcand
the minimum text size take them from the theme they draw with. [tool.figkit]inpyproject.tomlnamestokensandcssof a project.figkit.project()
andfigkit.project_style()read it, andfigkit checkuses it unless--styleor--css
override it.
Changed
figkit check --tokensis now--css;--tokensstays as an alias.- The bundled
tokens.jsonuses version 2. Files withoutversionstill load as version 1 and
give the same style. A version 2 file withoutcssnames no properties forcheck --css. mono()andmono_ticks()accept a theme and use its mono family.
Fixed
- A tokens file of version 1 defaults to
lighteven whendarkcomes first in it. - A
cssindex beyond a list token and an absolute pattern infont.filesare aStyleError
instead of a crash incheck_tokensorload_style. figkit check --cssreports a stylesheet it cannot read instead of failing with a traceback.
Changes: v0.3.1...v0.4.0
v0.3.1
uv add "figkit @ git+https://github.com/BenBotsch/FigureKit@v0.3.1"Added
- Each release attaches the wheel and the source archive. CI builds both and checks that the
installed wheel renders figures with the bundled fonts.
Fixed
register_fontsaccepts the bundled fonts when Windows gives the package a short 8.3 path,
such as a virtual environment underC:\Users\RUNNER~1\.... Before, every figure failed with
"not to the bundled file".
Changes: v0.3.0...v0.3.1
v0.3.0
uv add "figkit @ git+https://github.com/BenBotsch/FigureKit@v0.3.0"Breaking changes
- Importing figkit leaves the matplotlib backend alone. It no longer switches to
Agg, so
plt.show()and notebooks keep their backend. A batch job that only writes files can set
MPLBACKEND=Agg. - Custom themes get their own file names. A theme other than
lightanddarkwrites
<name>[.<language>]-<theme>.<format>instead of overwriting the light files. - German figures can change on the next render. Bar values, numbers at the end of a
sentence and category names with numbers are written differently, see below.
Fixes
localizeconverts a number followed by a full stop:F1 is 0.95.becomesF1 is 0,95..
Versions such asv0.1.2stay as they are.bar_labelswrites the values it formats in the language of the figure,0,93in German.
Texts passed aslabelsstay as given.- German tick labels leave category names unchanged when the categories are plotted as strings,
such asax.bar(["1.5 mm", ...]). - SVGs with embedded images, such as heatmaps drawn with
imshow, are byte-identical on Linux
and Windows. Before, Pillow builds compressed the same pixels to different bytes. Themeis hashable and itsstatuscolours are read-only.figkit checkreports a malformedfigures.json(invalid JSON, wrong types, missing files)
instead of failing with a traceback.figkit check --opaque cardalso covers the language filescard.de.pngandcard.en.png.page_entryreads the size of raster files from the dpi or pixel width of their output
instead of assuming 250 dpi.
CI
- Tests run on Ubuntu and Windows. CI regenerates the example gallery and fails if an SVG
changes. - pre-commit runs ruff from
uv.lock, so the hook and CI use the same version.
Full changelog: v0.2.1...v0.3.0