class Object(BaseType): (source)
Known subclasses: fiftyone.operators.types.File
, fiftyone.operators.types.UploadedFile
Constructor: Object(root_view)
Represents a JSON object.
Parameters | |
root | the View used to display the object |
Method | __init__ |
Undocumented |
Method | add |
Adds a property to the object. |
Method | arrow |
Defines a floating navigation arrows as a ArrowNavView . |
Method | bool |
Defines a property on the object that is a boolean. |
Method | btn |
Defines a button or icon button to display to the user as a Button . |
Method | btn |
Defines a button group object. |
Method | clone |
Clones the definition of the object. |
Method | dashboard |
Defines a dashboard view as a View . |
Method | define |
Defines a property on the object. |
Method | enum |
Defines a property on the object that is an enum. |
Method | file |
Defines a property on the object that is a file. |
Method | float |
Defines a property on the object that is a float. |
Method | get |
Gets a property by name. |
Method | grid |
Defines a grid view as a View . |
Method | h |
Defines a horizontal stack object. |
Method | img |
Defines an image to display to the user as a ImageView . |
Method | int |
Defines a property on the object that is an integer. |
Method | list |
Defines a property on the object that is a list. |
Method | map |
Defines a map property on the object. |
Method | md |
Defines a markdown object. |
Method | media |
Defines a media player object. |
Method | menu |
Defined an Object property that is displayed as a menu. |
Method | message |
Defines a message to display to the user as a Notice . |
Method | obj |
Defines a property on the object that is an object. |
Method | oneof |
Defines a one-of property on the object. |
Method | plot |
Defines an object property displayed as a plot. |
Method | str |
Defines a property on the object that is a string. |
Method | to |
Converts the object definition to JSON. |
Method | tree |
Defines a tree property on the object. |
Method | tuple |
Defines a tuple property on the object. |
Method | uploaded |
Defines a property on the object that is an uploaded file. |
Method | v |
Defines a vertical stack object. |
Method | view |
Defines a view-only property. |
Method | view |
Defines a view target property. |
Instance Variable | properties |
Undocumented |
Instance Variable | root |
Undocumented |
Adds a property to the object.
Parameters | |
name | the name of the property |
property | the property to add |
Returns | |
the Property that was added |
Defines a floating navigation arrows as a ArrowNavView
.
Parameters | |
name | Undocumented |
forward:True | Whether to display the forward arrow |
backward:True | Whether to display the backward arrow |
position:"center" | The position of the arrows. Can be either "top", center, "bottom", "left", middle` (center horizontally), or ``"right" |
onNone | The operator to execute when the forward arrow is clicked |
onNone | The operator to execute when the backward arrow is clicked |
**kwargs | Undocumented |
Returns | |
a Property |
Defines a button or icon button to display to the user as a Button
.
Examples:
import fiftyone.operators.types as types inputs = types.Object() inputs.btn( "greet", label="Say Hi!", icon="waving_hand", variant="round", on_click="print_stdout", params={"msg": "Hi!"}, )
Parameters | |
name | the name of the property |
label | the label of the button |
icon:None | the name of the icon to display |
variant:None | the variant of the button. Can be "contained", "outlined", "round" or "square" |
disabled:False | whether the button is disabled |
onNone | the name of the operator to execute when the button is clicked |
prompt:False | whether to prompt the user before executing the operator |
params:None | the parameters to pass to the operator |
space:None | An int specifying how much vertical/horizontal space to allocate out of 12 depending on the orientation of the parent container |
href:None | the URL to navigate to when the button is clicked |
icon | the position of the icon. Can be "left" or "right" |
**kwargs | Undocumented |
Defines a button group object.
Parameters | |
name | the name of the property |
**kwargs | Undocumented |
Returns | |
a Object |
Defines a dashboard view as a View
.
See DashboardView
for more information.
See DashboardView
for more information.
Parameters | |
name | the name of the property |
**kwargs | Undocumented |
Returns | |
an Object |
Defines a property on the object that is an enum.
Parameters | |
name | the name of the property |
values | a list of values that define the enum |
label:None | the label of the property |
description:None | the description of the property |
view:None | the View of the property, which must be a
Choices or a subclass of it |
**kwargs | Undocumented |
Returns | |
a Property |
Defines a property on the object that is a float.
Parameters | |
name | the name of the property |
min | minimum value of the property |
max | maximum value of the property |
label:None | the label of the property |
description:None | the description of the property |
view:None | the View of the property |
**kwargs | Undocumented |
Returns | |
a Property |
Defines a horizontal stack object.
Parameters | |
name | the name of the property |
**kwargs | Undocumented |
Returns | |
a Object |
Defines an image to display to the user as a ImageView
.
Examples:
import fiftyone.operators.types as types ctx.panel.state.my_img = "/path/to/my/image.jpg" panel = types.Object() panel.img( "my_img", # uses the value in ctx.panel.state.my_img href="https://path/to/navigate/to", on_click=self.do_something, prompt=False, params={"foo": "bar"}, point_on_hover=True, height="100px", width="100px", alt_text="My image alt text" )
Parameters | |
name | the name of the state variable to use as the image source |
href:None | the url to navigate to when the image is clicked |
onNone | the name of the operator to execute when the button is clicked |
prompt:False | whether to prompt the user before executing the operator |
params:None | the parameters to pass to the operator |
pointTrue | whether to show a pointer when hovering over the image |
height:None | the height of the image |
width:None | the width of the image |
altNone | the alt text of the image |
**kwargs | Undocumented |
Defines a property on the object that is an integer.
Parameters | |
name | the name of the property |
min | minimum value of the property |
max | maximum value of the property |
label:None | the label of the property |
description:None | the description of the property |
view:None | the View of the property |
**kwargs | Undocumented |
Returns | |
a Property |
Defines a property on the object that is a list.
Parameters | |
name | the name of the property |
element | the type of the elements in the list |
min | Undocumented |
max | Undocumented |
label:None | the label of the property |
description:None | the description of the property |
view:None | the View of the property |
**kwargs | Undocumented |
Returns | |
a Property |
Defines a map property on the object.
Parameters | |
name | the name of the property |
key | the type of the keys in the map |
value | the type of the values in the map |
**kwargs | Undocumented |
Returns | |
a Map |
Defines a markdown object.
Parameters | |
markdown | the markdown to display |
name | the name of the property |
**kwargs | Undocumented |
Defines a media player object.
Parameters | |
name | the name of the property |
url | the URL of the media to display |
onNone | the operator to execute when the media starts |
onNone | the operator to execute when the media is played |
onNone | the operator to execute when the media is paused |
onNone | the operator to execute when the media is buffering |
onNone | the operator to execute when the media stops buffering |
onNone | the operator to execute when the media ends |
onNone | the operator to execute when the media errors |
onNone | the operator to execute when the media duration is loaded |
onNone | the operator to execute when the media is seeked |
onNone | the operator to execute when the media progresses |
**kwargs | Undocumented |
Returns | |
a Object |
Defined an Object
property that is displayed as a menu.
Note
Can be used for an Button
type with properties whose views are one of
Button
, Dropdown
, DropdownView
, and :class;`Choices`. The variant
and color of the items can be set using the variant
and color
parameters.
Parameters | |
name | the name of the property |
variant:None | the variant for the items of the menu. Can be "contained", "outlined", "round" or "square" |
color:None | the color for the items of the menu. |
overlay:None | whether to display the menu as an overlay. Can be "top-left", |
another content:for example, menu for full-panel-width plot | |
icon:None | when set, the icon will be displayed as the menu button instead of the label. |
"top-center" | |
"top-right" | |
"bottom-left" | |
"bottom-center"` | |
or | |
"bottom-right" | |
" | |
**kwargs | Undocumented |
Returns | |
a Object |
Defines an object property displayed as a plot.
See PlotlyView
for more information.
Parameters | |
name | the name of the property |
config:None | the chart config |
layout:None | the chart layout |
**kwargs | Undocumented |
Defines a tree property on the object.
Parameters | |
name | the name of the property |
**kwargs | Undocumented |
Returns | |
a Tree |
Defines a tuple property on the object.
Parameters | |
name | the name of the property |
*items | the types of the items in the tuple |
**kwargs | Undocumented |
Returns | |
a Tuple |
Defines a vertical stack object.
Parameters | |
name | the name of the property |
**kwargs | Undocumented |
Returns | |
a Object |
Defines a view-only property.
Examples:
import fiftyone.operators.types as types notice = types.Notice(label="a label", description="a description") inputs = types.Object() inputs.view("notice", notice)
Parameters | |
name | the name of the property |
view | the View to define |
**kwargs | Undocumented |
Returns | |
a Property |
Defines a view target property.
Examples:
import fiftyone.operators.types as types # # in resolve_input() # inputs = types.Object() vt = inputs.view_target(ctx) # or add the property directly # vt = types.ViewTargetProperty(ctx) # inputs.add_property("view_target", vt) return types.Property(inputs) # # in execute() # target_view = ctx.target_view()
Parameters | |
ctx | the fiftyone.operators.ExecutionContext |
name | the name of the property |
viewRadioGroup | the view type to use (RadioGroup, Dropdown, etc.) |
**kwargs | Undocumented |
Returns | |
a ViewTargetProperty |