Add info about Image dataclass

- Add Optional keyword and value alternatives as requested in review.
- Add a few extra comments about the attributes.
This commit is contained in:
KV 2020-08-16 16:22:56 +02:00
parent 204379a125
commit c23679dd7b

View File

@ -9,12 +9,16 @@ from wireviz import wv_colors
@dataclass @dataclass
class Image: class Image:
# Attributes of the image object <img>:
src: str src: str
scale: str = "false" scale: Optional[str] = "false" # false | true | width | height | both
# Attributes of the image cell <td> containing the image:
width: Optional[int] = None width: Optional[int] = None
height: Optional[int] = None height: Optional[int] = None
fixedsize: bool = False fixedsize: Optional[bool] = False
# Contents of the cell <td> just below the image cell:
caption: Optional[str] = None caption: Optional[str] = None
# See also HTML doc at https://graphviz.org/doc/info/shapes.html#html
@dataclass @dataclass