class documentation

Represents a JSON object.

Parameters
root_viewthe View used to display the object
Method __init__ Undocumented
Method add_property Adds a property to the object.
Method arrow_nav 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_group Defines a button group object.
Method clone Clones the definition of the object.
Method dashboard Defines a dashboard view as a View.
Method define_property 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_property Gets a property by name.
Method grid Defines a grid view as a View.
Method h_stack 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_player 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_json 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_file Defines a property on the object that is an uploaded file.
Method v_stack Defines a vertical stack object.
Method view Defines a view-only property.
Method view_target Defines a view target property.
Instance Variable properties Undocumented
Instance Variable root_view Undocumented
def __init__(self, root_view=None): (source)
def add_property(self, name, property): (source)

Adds a property to the object.

Parameters
namethe name of the property
propertythe property to add
Returns
the Property that was added
def arrow_nav(self, name, forward=None, backward=None, position=None, **kwargs): (source)

Defines a floating navigation arrows as a ArrowNavView.

Parameters
nameUndocumented
forward:TrueWhether to display the forward arrow
backward:TrueWhether to display the backward arrow
position:"center"The position of the arrows. Can be either "top", center, "bottom", "left", middle` (center horizontally), or ``"right"
on_forward:NoneThe operator to execute when the forward arrow is clicked
on_backward:NoneThe operator to execute when the backward arrow is clicked
**kwargsUndocumented
Returns
a Property
def bool(self, name, **kwargs): (source)

Defines a property on the object that is a boolean.

Parameters
namethe name of the property
label:Nonethe label of the property
description:Nonethe description of the property
view:Nonethe View of the property
**kwargsUndocumented
Returns
a Property
def btn(self, name, label, icon=None, variant=None, disabled=False, on_click=None, prompt=False, params=None, space=None, href=None, icon_position='left', **kwargs): (source)

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
namethe name of the property
labelthe label of the button
icon:Nonethe name of the icon to display
variant:Nonethe variant of the button. Can be "contained", "outlined", "round" or "square"
disabled:Falsewhether the button is disabled
on_click:Nonethe name of the operator to execute when the button is clicked
prompt:Falsewhether to prompt the user before executing the operator
params:Nonethe parameters to pass to the operator
space:NoneAn int specifying how much vertical/horizontal space to allocate out of 12 depending on the orientation of the parent container
href:Nonethe URL to navigate to when the button is clicked
icon_position:"left"the position of the icon. Can be "left" or "right"
**kwargsUndocumented
def btn_group(self, name, **kwargs): (source)

Defines a button group object.

Parameters
namethe name of the property
**kwargsUndocumented
Returns
a Object
def clone(self): (source)

Clones the definition of the object.

Parameters
namethe name of the property
Returns
an Object
def dashboard(self, name, **kwargs): (source)

Defines a dashboard view as a View.

See DashboardView for more information.

See DashboardView for more information.

Parameters
namethe name of the property
**kwargsUndocumented
Returns
an Object
def define_property(self, name, type, **kwargs): (source)

Defines a property on the object.

Parameters
namethe name of the property
typethe type of the property
label:Nonethe label of the property
description:Nonethe description of the property
view:Nonethe View of the property
**kwargsUndocumented
Returns
the Property that was added
def enum(self, name, values, **kwargs): (source)

Defines a property on the object that is an enum.

Parameters
namethe name of the property
valuesa list of values that define the enum
label:Nonethe label of the property
description:Nonethe description of the property
view:Nonethe View of the property, which must be a Choices or a subclass of it
**kwargsUndocumented
Returns
a Property
def file(self, name, **kwargs): (source)

Defines a property on the object that is a file.

Parameters
namethe name of the property
view:Nonethe View of the property
**kwargsUndocumented
def float(self, name, min=None, max=None, **kwargs): (source)

Defines a property on the object that is a float.

Parameters
namethe name of the property
minminimum value of the property
maxmaximum value of the property
label:Nonethe label of the property
description:Nonethe description of the property
view:Nonethe View of the property
**kwargsUndocumented
Returns
a Property
def get_property(self, name): (source)

Gets a property by name.

Parameters
namethe name of the property
Returns
the Property, or None
def grid(self, name, **kwargs): (source)

Defines a grid view as a View.

def h_stack(self, name, **kwargs): (source)

Defines a horizontal stack object.

Parameters
namethe name of the property
**kwargsUndocumented
Returns
a Object
def img(self, name, href=None, on_click=None, prompt=False, params=None, point_on_hover=True, height=None, width=None, alt_text=None, **kwargs): (source)

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
namethe name of the state variable to use as the image source
href:Nonethe url to navigate to when the image is clicked
on_click:Nonethe name of the operator to execute when the button is clicked
prompt:Falsewhether to prompt the user before executing the operator
params:Nonethe parameters to pass to the operator
point_on_hover:Truewhether to show a pointer when hovering over the image
height:Nonethe height of the image
width:Nonethe width of the image
alt_text:Nonethe alt text of the image
**kwargsUndocumented
def int(self, name, min=None, max=None, **kwargs): (source)

Defines a property on the object that is an integer.

Parameters
namethe name of the property
minminimum value of the property
maxmaximum value of the property
label:Nonethe label of the property
description:Nonethe description of the property
view:Nonethe View of the property
**kwargsUndocumented
Returns
a Property
def list(self, name, element_type, min_items=None, max_items=None, **kwargs): (source)

Defines a property on the object that is a list.

Parameters
namethe name of the property
element_typethe type of the elements in the list
min_itemsUndocumented
max_itemsUndocumented
label:Nonethe label of the property
description:Nonethe description of the property
view:Nonethe View of the property
**kwargsUndocumented
Returns
a Property
def map(self, name, key_type, value_type, **kwargs): (source)

Defines a map property on the object.

Parameters
namethe name of the property
key_typethe type of the keys in the map
value_typethe type of the values in the map
**kwargsUndocumented
Returns
a Map
def md(self, markdown, name='markdown', **kwargs): (source)

Defines a markdown object.

Parameters
markdownthe markdown to display
namethe name of the property
**kwargsUndocumented
def media_player(self, name, url, **kwargs): (source)

Defines a media player object.

Parameters
namethe name of the property
urlthe URL of the media to display
on_start:Nonethe operator to execute when the media starts
on_play:Nonethe operator to execute when the media is played
on_pause:Nonethe operator to execute when the media is paused
on_buffer:Nonethe operator to execute when the media is buffering
on_buffer_end:Nonethe operator to execute when the media stops buffering
on_ended:Nonethe operator to execute when the media ends
on_error:Nonethe operator to execute when the media errors
on_duration:Nonethe operator to execute when the media duration is loaded
on_seek:Nonethe operator to execute when the media is seeked
on_progress:Nonethe operator to execute when the media progresses
**kwargsUndocumented
Returns
a Object
def menu(self, name, **kwargs): (source)

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
namethe name of the property
variant:Nonethe variant for the items of the menu. Can be "contained", "outlined", "round" or "square"
color:Nonethe color for the items of the menu.
overlay:Nonewhether to display the menu as an overlay. Can be "top-left",
another content:for example, menu for full-panel-width plot
icon:Nonewhen 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". Overlay is useful when you want to display a floating menu on top of
Can be "SettingsIcon"
"MoreVertIcon".
**kwargsUndocumented
Returns
a Object
def message(self, name, label, **kwargs): (source)

Defines a message to display to the user as a Notice.

Parameters
namethe name of the property
labelthe label of the notice
description:Nonethe description of the notice
view:Nonethe View of the notice
**kwargsUndocumented
Returns
a Property
def obj(self, name, **kwargs): (source)

Defines a property on the object that is an object.

Parameters
namethe name of the property
label:Nonethe label of the property
description:Nonethe description of the property
view:Nonethe View of the property
**kwargsUndocumented
Returns
a Property
def oneof(self, name, types, **kwargs): (source)

Defines a one-of property on the object.

Parameters
namethe name of the property
typeslist of types that are instances of BaseType
**kwargsUndocumented
Returns
a OneOf
def plot(self, name, **kwargs): (source)

Defines an object property displayed as a plot.

See PlotlyView for more information.

Parameters
namethe name of the property
config:Nonethe chart config
layout:Nonethe chart layout
**kwargsUndocumented
def str(self, name, allow_empty=False, **kwargs): (source)

Defines a property on the object that is a string.

Parameters
namethe name of the property
allow_emptyUndocumented
label:Nonethe label of the property
description:Nonethe description of the property
view:Nonethe View of the property
**kwargsUndocumented
Returns
a Property
def to_json(self): (source)

Converts the object definition to JSON.

Returns
a JSON dict
def tree(self, name, **kwargs): (source)

Defines a tree property on the object.

Parameters
namethe name of the property
**kwargsUndocumented
Returns
a Tree
def tuple(self, name, *items, **kwargs): (source)

Defines a tuple property on the object.

Parameters
namethe name of the property
*itemsthe types of the items in the tuple
**kwargsUndocumented
Returns
a Tuple
def uploaded_file(self, name, **kwargs): (source)

Defines a property on the object that is an uploaded file.

Parameters
namethe name of the property
view:Nonethe View of the property
**kwargsUndocumented
def v_stack(self, name, **kwargs): (source)

Defines a vertical stack object.

Parameters
namethe name of the property
**kwargsUndocumented
Returns
a Object
def view(self, name, view, **kwargs): (source)

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
namethe name of the property
viewthe View to define
**kwargsUndocumented
Returns
a Property
def view_target(self, ctx, name='view_target', view_type=None, **kwargs): (source)

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
ctxthe fiftyone.operators.ExecutionContext
namethe name of the property
view_type:RadioGroupthe view type to use (RadioGroup, Dropdown, etc.)
**kwargsUndocumented
Returns
a ViewTargetProperty
properties: dict = (source)

Undocumented

root_view: None = (source)

Undocumented