Editor widget in Supervisely allows users to input and edit code with syntax highlighting. It provides a customizable text input area with options such as language selection, input height, and some styles. Editor widget is used for editing code snippets, as the syntax highlighting makes it easier to read and edit code for languages such as python, json, html, and yaml.
Function signature
Editor(initial_text='{ "value": 10 }',height_px=100,height_lines=None,# overwrites height_px if specified.language_mode='json',readonly=False,show_line_numbers=True,highlight_active_line=True,restore_default_button=True,widget_id=None,)
Parameters
Parameters
Type
Description
initial_text
Optional[str]
Editor default value
height_px
Optional[int]
Specifies widget height in pixels
height_lines
Optional[int]
Specifies the visible number of lines in widget
language_mode
Optional[int]
Specifies language mode of editor
readonly
Optional[bool]
Specifies that a editor area should be read-only
show_line_numbers
Optional[bool]
Specifies displaying numbers of lines in editor
highlight_active_line
Optional[bool]
Specifies if visible highlighting active line in editor
restore_default_button
Optional[bool]
Display button for settting editor default value
widget_id
Optional[str]
ID of the widget
initial_text
Editor default value
type:Optional[str]
default value:""
height_px
Specifies widgets height in pixels.
type:Optional[int]
default value:100
height_lines
Specifies the visible number of lines in widget. If specified it overwrites height_px. If >= 1000, all lines will be displayed