Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-pylib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-pylib
Commits
ab10b554
Verified
Commit
ab10b554
authored
3 years ago
by
Daniel Hornung
Browse files
Options
Downloads
Patches
Plain Diff
ENH: to_graphics now has `no_shadow` option.
parent
d355c12a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!57
RELEASE 0.7.3
,
!56
ENH: to_graphics now has `no_shadow` option.
Pipeline
#22117
passed
3 years ago
Stage: code_style
Stage: linting
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/caosdb/utils/plantuml.py
+27
-5
27 additions, 5 deletions
src/caosdb/utils/plantuml.py
with
27 additions
and
5 deletions
src/caosdb/utils/plantuml.py
+
27
−
5
View file @
ab10b554
...
...
@@ -88,6 +88,7 @@ def recordtypes_to_plantuml_string(iterable,
add_properties
:
bool
=
True
,
add_recordtypes
:
bool
=
True
,
add_legend
:
bool
=
True
,
no_shadow
:
bool
=
False
,
style
:
str
=
"
default
"
):
"""
Converts RecordTypes into a string for PlantUML.
...
...
@@ -109,6 +110,20 @@ def recordtypes_to_plantuml_string(iterable,
either the
"
type
"
attribute is None or
type(element) == RecordType.
- 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.
...
...
@@ -158,6 +173,9 @@ def recordtypes_to_plantuml_string(iterable,
result
=
"
@startuml
\n\n
"
if
no_shadow
:
result
+=
"
skinparam shadowing false
\n
"
if
style
==
"
default
"
:
result
+=
"
skinparam classAttributeIconSize 0
\n
"
elif
style
==
"
salexan
"
:
...
...
@@ -330,6 +348,7 @@ def to_graphics(recordtypes: list[db.Entity], filename: str,
add_properties
:
bool
=
True
,
add_recordtypes
:
bool
=
True
,
add_legend
:
bool
=
True
,
no_shadow
:
bool
=
False
,
style
:
str
=
"
default
"
):
"""
Calls recordtypes_to_plantuml_string(), saves result to file and
creates an svg image
...
...
@@ -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
"
silent : bool
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
,
add_properties
,
add_recordtypes
,
add_legend
,
style
)
pu
=
recordtypes_to_plantuml_string
(
iterable
=
recordtypes
,
add_properties
=
add_properties
,
add_recordtypes
=
add_recordtypes
,
add_legend
=
add_legend
,
no_shadow
=
no_shadow
,
style
=
style
)
if
output_dirname
is
None
:
output_dirname
=
os
.
getcwd
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment