v0.9.0
Added
-
An
svgextra, for your own SVG override artwork.pip install 'unifi-map[svg]'rasterises a supplied SVG to a cached PNG as it is read, so
it reaches every output format.Without it, Graphviz loads SVG artwork only for its own
svgdriver:png
andpdfgo through cairo, which has no SVG loader, so the icon is dropped
from both. It also insists on an XML declaration and reports a file that
plainly exists as missing when there is none. Rasterising sidesteps both, so
a file exported by a drawing tool works untouched.Optional on purpose, and converting the file to PNG yourself does the
same job with no dependency at all. Both routes are documented; the tool
warns and names the file when an SVG is about to go missing from a format.
Fetched artwork is unaffected: it is already PNG. -
A warning when an SVG override will not reach
pngorpdf, naming the
icons and the formats that will lack them. Graphviz's own message isNo loadimage plugin for "svg:cairo", which names neither the file nor a way
forward. -
A warning when
--theme darkis combined withdrawio. draw.io
re-themes on load and will render a dark-authored file light. See Known
limitations below. -
make build, producing a wheel and an sdist indist/. Installing the
wheel into a clean environment gives you a workingunifi-mapwithout a
checkout, which is useful for putting it on a machine that should not carry
the source.It needed almost no new machinery: the entry point and the build backend were
already inpyproject.toml. What was missing was a documented way to invoke
them, anddist/andbuild/in.gitignoreso the artifacts cannot be
swept into a commit.This is not a published package and does not promise one. There is no
pip install unifi-mapfrom PyPI, and whether there ever should be is
deliberately still an open question, recorded inTODO.md. Building an
artifact and publishing one are separate decisions, and only the second is a
commitment that cannot be withdrawn. -
UNIFI_CACHE_DIR,UNIFI_ASSET_CACHEandUNIFI_OUT_DIR, so the
directories can be set once instead of passed on every command. A flag still
wins over the variable, and the variable over the default. They can go in the
credential file as well as the environment, which is the natural place, since
that file is already the thing kept outside the project.The cache one is the point. A snapshot is a complete inventory of a network,
the default puts it in the working directory, and for anyone working on this
tool that directory is a git checkout. Acache.bakcopy made before a risky
fetch is not covered by a.gitignoreentry forcache/; one sat untracked
in this repository, onegit add -Afrom being published. The ignore rule was
widened in 0.8.0, and this removes the question rather than guarding it.
Removed
-
The
UDM_*environment variable names.UDM_HOST,UDM_API_KEY,
UDM_SITEandUDM_VERIFY_TLSare no longer read. They existed only because
that is what the author had called things before this tool did, and they have
warned since 0.7.0.If you still use them, rename them to the
UNIFI_*spellings. Nothing
subtle happens if you do not: the tool reports the missing variable by name
and exits, exactly as on a fresh install.UDM_USERandUDM_PASSwere
already dead, unread since password authentication was removed, and are worth
deleting from any credential file that still carries them.One deliberate asymmetry:
layout.pystill stripsUDM_API_KEYfrom the
environment Graphviz runs with. We stopped reading it, which does nothing
about somebody who still exports one, and an unread variable holding a real
key is exactly as worth withholding from a child process as a read one.
Changed
-
Graphviz's warnings are no longer discarded. Graphviz warns on stderr and
still exits 0, and that output was thrown away on every successful run, so
every warning it has ever emitted was invisible. That is how an icon could
vanish from a PNG in silence. Surfaced whole rather than filtered: deciding
which of its messages matter is how the last one stayed hidden. -
Artwork resolution and output writing moved out of
cli.py, into
artwork.pyandoutput.py. No behaviour changes. The reason is layering
rather than length: neither is a command-line concern, and the tell was a
rendering test having to import a private function fromunifi_map.clito
exercise the renderer.cli.pykeeps argument parsing, credential resolution,
logging setup and thecmd_*functions that sequence a run, and drops from
1367 lines to 1027.Only relevant to you if you import from
unifi_map.clidirectly, which is not
a supported interface and which nothing is known to do.
Fixed
-
A repeated
-fis refused instead of silently honouring the last one.
-ftakes several values, so-f svg -f pngoverwrote rather than appended
and wrote png only, with nothing said. That reads as a format that failed to
render. Pass them together:-f svg pdf png.Refused rather than made to append, because an error states what happened
whereas appending would quietly change what an existing invocation produces.
If you have a script using the repeated form, it will now stop with an
error naming the fix. -
draw.io connection lines no longer run through unrelated devices. The
edges carried only their two endpoints, so draw.io routed them with its own
router and drew a long run straight through whatever the layout had placed in
between. Graphviz had already computed a route and it was being discarded;
those waypoints are now written into the file. Safe to pass through unchanged
because both layouts useorthoorpolylinesplines, never a bezier, so the
reported points are corners rather than control points. -
draw.io node captions no longer land on the node below. The label was
positioned outside the cell, while Graphviz had sized that cell to hold the
artwork and the text. The box carried dead space and the caption fell onto
whatever was underneath, so on a dense column every icon wore its neighbour's
caption. The label now renders inside the box the layout was computed for. -
An SVG with only a
viewBoxis accepted. Explicitwidthandheight
were required, and most drawing tools export a viewBox instead. Graphviz
renders those perfectly well and preserves the ratio, checked by rendering
both throughdotrather than by reading a spec. Only the ratio is used
downstream. Explicit dimensions still win where a file has both. -
A refused icon says which rule it broke. "Could not read artwork at
<path>" on a file the reader can plainly open is a shrug rather than an
error, and SVG has requirements that are not guessable from the outside. -
The README implied you could run
unifi-mapbefore installing it. The
quick-look section ranmake demoand thenunifi-map all, as though the
first had prepared an environment for the second. It had not:make demo
calls the venv's copy by full path and puts nothing on yourPATH. -
Nothing anywhere told you to activate the virtual environment. Install
ended at.venv/bin/pip install -e ., which puts the command at
.venv/bin/unifi-mapand nowhere else, while the README and every page under
docs/invoked a bareunifi-map. Anyone following the instructions
literally gotcommand not foundon their first real command. Install now
ends withsource .venv/bin/activateand says why, which makes those examples
correct rather than editing each of them. -
allnow says what it means. It isfetchthenrender, both stages,
and reads to a newcomer as "all output formats". It writes the same default
two files anyrenderwould. The help text says so anddocs/usage.mdhas
the incantation for the other five. -
Documentation said Lucid's
.drawioimport had not been tried. It has, and
it does not work. Lucid reads one cell of the file and stops, a different
cell each time. Neither stripping the embedded artwork nor writing the payload
in draw.io's own compressed form changes it, so it is not a size or an
encoding problem.docs/output.mdnow says so and points at the workarounds,
which are to export from draw.io or to import thesvgorpdfoutput.
draw.io itself remains confirmed working. Nothing about the generated file is
being reshaped to suit a second tool's parser.
Known limitations
-
--theme darkdoes not survive into a.drawiofile. draw.io re-themes
a diagram on load, inverting it to contrast with its own appearance setting,
because its dark mode assumes diagrams are authored light. A file authored
dark is inverted a second time and displays light; a file authored light is
correct in both of draw.io's modes.Nothing is corrupted when this happens. The inversion is holistic, so cells,
text and artwork flip together and the file stays coherent; it simply reads as
the theme you did not ask for.For now the tool warns and renders what you asked for. Use
--theme light
for the.drawio, or set the appearance in draw.io explicitly rather than
leaving it on Automatic.docs/output.mdcovers both.When this is fixed, the behaviour will be:
- It will always warn when
drawiois among the requested formats and the
theme is dark, because the interaction is worth knowing about either way. - With other formats alongside, the
.drawiowill be authored light,
so it displays dark like everything else in the run. - With only
drawiorequested (--theme dark -f drawio), it will be
authored dark as asked, with a warning that draw.io may not display it
the way you expect and a pointer to the documentation. Asking for one format
and that format alone is a clear enough instruction to honour.
- It will always warn when