This repository was archived by the owner on Feb 10, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathDashCanvas.py
52 lines (46 loc) · 3.09 KB
/
DashCanvas.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# AUTO GENERATED FILE - DO NOT EDIT
from dash.development.base_component import Component, _explicitize_args
class DashCanvas(Component):
"""A DashCanvas component.
Canvas component for drawing on a background image and selecting
regions.
Keyword arguments:
- id (string; optional): The ID used to identify this component in Dash callbacks
- image_content (string; default ''): Image data string, formatted as png or jpg data string. Can be
generated by utils.io_utils.array_to_data_string.
- zoom (number; default 1): Zoom factor
- width (number; default 500): Width of the canvas
- height (number; default 500): Height of the canvas
- scale (number; default 1): Scaling ratio between canvas width and image width
- tool (string; default "pencil"): Selection of drawing tool, among ["pencil", "pan", "circle",
"rectangle", "select", "line"].
- lineWidth (number; default 10): Width of drawing line (in pencil mode)
- lineColor (string; default 'red'): Color of drawing line (in pencil mode). Can be a text string,
like 'yellow', 'red', or a color triplet like 'rgb(255, 0, 0)'.
Alpha is possible with 'rgba(255, 0, 0, 0.5)'.
- goButtonTitle (string; default 'Save'): Title of button
- filename (string; default ''): Name of image file to load (URL string)
- trigger (number; default 0): Counter of how many times the save button was pressed
(to be used mostly as input)
- json_data (string; default ''): Sketch content as JSON string, containing background image and
annotations. Use utils.parse_json.parse_jsonstring to parse
this string.
- hide_buttons (list of strings; optional): Names of buttons to hide. Names are "zoom", "pan", "line", "pencil",
"rectangle", "undo", "select"."""
@_explicitize_args
def __init__(self, id=Component.UNDEFINED, image_content=Component.UNDEFINED, zoom=Component.UNDEFINED, width=Component.UNDEFINED, height=Component.UNDEFINED, scale=Component.UNDEFINED, tool=Component.UNDEFINED, lineWidth=Component.UNDEFINED, lineColor=Component.UNDEFINED, goButtonTitle=Component.UNDEFINED, filename=Component.UNDEFINED, trigger=Component.UNDEFINED, json_data=Component.UNDEFINED, hide_buttons=Component.UNDEFINED, **kwargs):
self._prop_names = ['id', 'image_content', 'zoom', 'width', 'height', 'scale', 'tool', 'lineWidth', 'lineColor', 'goButtonTitle', 'filename', 'trigger', 'json_data', 'hide_buttons']
self._type = 'DashCanvas'
self._namespace = 'dash_canvas'
self._valid_wildcard_attributes = []
self.available_properties = ['id', 'image_content', 'zoom', 'width', 'height', 'scale', 'tool', 'lineWidth', 'lineColor', 'goButtonTitle', 'filename', 'trigger', 'json_data', 'hide_buttons']
self.available_wildcard_properties = []
_explicit_args = kwargs.pop('_explicit_args')
_locals = locals()
_locals.update(kwargs) # For wildcard attrs
args = {k: _locals[k] for k in _explicit_args if k != 'children'}
for k in []:
if k not in args:
raise TypeError(
'Required argument `' + k + '` was not specified.')
super(DashCanvas, self).__init__(**args)