write_chada_tables_whole_plantuml#
- mochada_kit.tables.write_chada_tables_whole_plantuml(data_path, out_path=None, load_path=None, out_name=None, title=None, theme_name='plasma', copy_theme_to_local=False, scale=None)#
Write a plantuml code file specifying a json diagram showing a “contents” element –> all other elements (Overview, User Case, Experiment, Raw Data and Data Processing).
By default, the puml code files will be saved in the same directory as the json/yaml file specified by data_path. If the argument out_path is not None, the puml code files will be saved to the path specified by out_path.
Highlights will be applied to all rows of the “contents” element and to the first (“title”) row of each other element, according to the bespoke MOCHADA theme specified by theme_name.
- Parameters:
- data_path
STR
orpathlib.Path
Absolute path or path relative to the current working directory pointing to a json or yaml file containing the CHADA data. If data_path points to a json file, the format of the file must be based on mochada_kit/templates/chada_tables_template.json. If data_path points to a yaml file, the format of the file must be based on mochada_kit/templates/chada_tables_template.yaml.
- out_path
STR
,pathlib.Path
orpython:None
,optional
Specifies the folder where the plantuml code file will be saved. This allows the puml code and json/yaml file to be located in different folders, if desired. If None, the puml code is saved in the same folder as the data_path. If not None, if it is a relative path, it is assumed to be relative to data_path. An absolute path can also be supplied. The default is None.
- load_path
STR
,pathlib.Path
orpython:None
,optional
If data_path points to a json file: if load_path = None, the json data will be directly written into the puml code rather than being loaded dynamically. If load_path is not None, load_path is the either the absolute path to the json file containing the data OR the relative path from out_path pointing to the data_path. In this case, the json data will be loaded dynamically and not written into the puml code. If data_path points to a yaml file: load_path has no effect, the data must always be written into the puml code. The default is None.
- out_name
STR
orpython:None
,optional
By default, the puml code output will have the same filename as the json input. To use a different filename for the output, please specify a string as out_name. The default is None.
- title
STR
,LIST
orpython:None
,optional
Either a string or list of strings defining a title for the plot, or None, in which case, no title will be shown. If a list of strings is supplied, each item in the list will appear in a new row of the title. You can apply CREOLE syntax to the title strings e.g. to change the colour, make a table, make a link etc. All options are here: https://plantuml.com/creole. The default is None.
- theme_name
STR
,optional
The name of one of the bespoke MOCHADA themes in the default folder given by __THEMES_DIR__. Only the part of the name after “MOCHADA-” is needed, i.e. to apply the theme ‘MOCHADA-plasma’, theme_name=’plasma’. The default is ‘plasma’.
- scale
STR
,INT
orFLOAT
,optional
A parameter which helps to scale the diagram for png output. NOT necessary to use this with svg output as these can be scaled to any size later. Docs are here: https://plantuml.com/commons#4252b72e6ebcd4d4.
Common values could be:
1.5 (to set the aspect ratio),
“1/3” (to set the aspect ratio)
“1024 width” (to set the width to 1024 pixels)
“100*200” (to set the output size to 100 by 200 pixels).
- data_path