scripts: Added -t/--tiny to treemap.py
Even though I think this makes less sense for the ascii-rendering scripts, it's useful to have this flag around when jumping between treemap.py and treemapd3.py. And it might actually make sense sometimes now that -t/--tiny does not override --to-scale.
This commit is contained in:
@@ -717,6 +717,7 @@ def main(csv_paths, *,
|
||||
no_stats=False,
|
||||
to_scale=None,
|
||||
aspect_ratio=(1,1),
|
||||
tiny=False,
|
||||
title=None,
|
||||
padding=0,
|
||||
label=False,
|
||||
@@ -729,6 +730,12 @@ def main(csv_paths, *,
|
||||
else:
|
||||
color = False
|
||||
|
||||
# tiny mode?
|
||||
if tiny:
|
||||
if to_scale is None:
|
||||
to_scale = 1
|
||||
no_header = True
|
||||
|
||||
# what chars/colors/labels to use?
|
||||
chars_ = []
|
||||
for char in chars:
|
||||
@@ -1155,6 +1162,10 @@ if __name__ == "__main__":
|
||||
tuple(float(v) for v in x.split(':', 1))
|
||||
if ':' in x else (float(x), 1)),
|
||||
help="Aspect ratio to use with --to-scale. Defaults to 1:1.")
|
||||
parser.add_argument(
|
||||
'-t', '--tiny',
|
||||
action='store_true',
|
||||
help="Tiny mode, alias for --to-scale=1 and --no-header.")
|
||||
parser.add_argument(
|
||||
'--title',
|
||||
help="Add a title. Accepts %% modifiers.")
|
||||
|
||||
@@ -567,11 +567,11 @@ def main(csv_paths, output, *,
|
||||
no_stats=False,
|
||||
to_scale=None,
|
||||
aspect_ratio=(1,1),
|
||||
tiny=False,
|
||||
nested=False,
|
||||
title=None,
|
||||
padding=1,
|
||||
no_label=False,
|
||||
tiny=False,
|
||||
nested=False,
|
||||
dark=False,
|
||||
font=FONT,
|
||||
font_size=FONT_SIZE,
|
||||
|
||||
Reference in New Issue
Block a user