scripts: Added treemapd3.py

Like treemap.py, but outputting an svg file, which is quite a bit more
useful.

Things svg is _not_:

- A simple vector graphics format

Things svg _is_:

- A surprisingly powerful high-level graphics language.

I might have to use svgs as an output format more often. It's
surprisingly easy to generate graphics without worrying about low-level
rendering details.

---

Aside from the extra flags for svg details like font, padding,
background colors, etc, the main difference between treemap.py and
treemapd3.py is the addition of the --nested mode, which renders a
containing tile for each recursive group (each -b/--by field).

There's no way --nested would've worked in treemap.py. The main benefit
is the extra labels per subgroup, which are already hard enough to read
in treemap.py.

Other than that, treemapd3.py is mostly the same as treemap.py, but with
a resolution that's actually readable.
This commit is contained in:
Christopher Haster
2025-02-16 04:26:46 -06:00
parent d6c909e724
commit 2135c6a003
4 changed files with 1030 additions and 144 deletions

View File

@@ -1599,7 +1599,7 @@ if __name__ == "__main__":
help="Comma separated yticklabels. Accepts %, and other "
"%-escaped codes.")
parser.add_argument(
'-t', '--title',
'--title',
help="Add a title. Accepts %-escaped codes.")
parser.add_argument(
'-l', '--legend', '--legend-right',