Skip to content
Snippets Groups Projects

ENH: to_graphics now has `no_shadow` option.

Merged Daniel Hornung requested to merge f-plantuml-without-shadow into dev
1 unresolved thread
2 files
+ 28
5
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -88,6 +88,7 @@ def recordtypes_to_plantuml_string(iterable,
@@ -88,6 +88,7 @@ def recordtypes_to_plantuml_string(iterable,
add_properties: bool = True,
add_properties: bool = True,
add_recordtypes: bool = True,
add_recordtypes: bool = True,
add_legend: bool = True,
add_legend: bool = True,
 
no_shadow: bool = False,
style: str = "default"):
style: str = "default"):
"""Converts RecordTypes into a string for PlantUML.
"""Converts RecordTypes into a string for PlantUML.
@@ -109,6 +110,20 @@ def recordtypes_to_plantuml_string(iterable,
@@ -109,6 +110,20 @@ def recordtypes_to_plantuml_string(iterable,
either the "type" attribute is None or
either the "type" attribute is None or
type(element) == RecordType.
type(element) == RecordType.
- Inheritance of Properties is not rendered nicely at the moment.
- Inheritance of Properties is not rendered nicely at the moment.
 
 
Parameters
 
----------
 
iterable: iterable of caosdb.Entity
 
The objects to be rendered with plantuml.
 
 
no_shadow : bool, optional
 
If true, tell plantuml to use a skin without blurred shadows.
 
 
 
Returns
 
-------
 
out : str
 
The plantuml string for the given container.
"""
"""
# TODO: This function needs a review of python type hints.
# TODO: This function needs a review of python type hints.
@@ -158,6 +173,9 @@ def recordtypes_to_plantuml_string(iterable,
@@ -158,6 +173,9 @@ def recordtypes_to_plantuml_string(iterable,
result = "@startuml\n\n"
result = "@startuml\n\n"
 
if no_shadow:
 
result += "skinparam shadowing false\n"
 
if style == "default":
if style == "default":
result += "skinparam classAttributeIconSize 0\n"
result += "skinparam classAttributeIconSize 0\n"
elif style == "salexan":
elif style == "salexan":
@@ -330,6 +348,7 @@ def to_graphics(recordtypes: list[db.Entity], filename: str,
@@ -330,6 +348,7 @@ def to_graphics(recordtypes: list[db.Entity], filename: str,
add_properties: bool = True,
add_properties: bool = True,
add_recordtypes: bool = True,
add_recordtypes: bool = True,
add_legend: bool = True,
add_legend: bool = True,
 
no_shadow: bool = False,
style: str = "default"):
style: str = "default"):
"""Calls recordtypes_to_plantuml_string(), saves result to file and
"""Calls recordtypes_to_plantuml_string(), saves result to file and
creates an svg image
creates an svg image
@@ -352,12 +371,15 @@ def to_graphics(recordtypes: list[db.Entity], filename: str,
@@ -352,12 +371,15 @@ def to_graphics(recordtypes: list[db.Entity], filename: str,
list of target formats as defined by the -t"..." options by plantuml, e.g. "tsvg"
list of target formats as defined by the -t"..." options by plantuml, e.g. "tsvg"
silent : bool
silent : bool
Don't output messages.
Don't output messages.
 
no_shadow : bool, optional
 
If true, tell plantuml to use a skin without blurred shadows.
"""
"""
pu = recordtypes_to_plantuml_string(recordtypes,
pu = recordtypes_to_plantuml_string(iterable=recordtypes,
add_properties,
add_properties=add_properties,
add_recordtypes,
add_recordtypes=add_recordtypes,
add_legend,
add_legend=add_legend,
style)
no_shadow=no_shadow,
 
style=style)
if output_dirname is None:
if output_dirname is None:
output_dirname = os.getcwd()
output_dirname = os.getcwd()
Loading