class documentation

Represents a set of choices in a View.

Use this view to define a set of choices for a Property that can be selected by the user and require labels and optional descriptions.

Examples:

import fiftyone.operators.types as types

choices = types.Choices()
choices.add_choice("cat", label="Cat", description="A cat")
choices.add_choice("dog", label="Dog", description="A dog")

inputs = types.Object()
inputs.enum("animal", choices.values(), view=choices)
Parameters
choicesa list of Choice instances
Method __init__ Undocumented
Method add_choice Adds a choice value to this instance.
Method append Appends a Choice to the list of choices.
Method clone Undocumented
Method to_json Undocumented
Method values Returns the choice values for this instance.
Property choices Undocumented
Instance Variable _choices Undocumented

Inherited from View:

Method kwargs_to_json Undocumented
Instance Variable caption Undocumented
Instance Variable component Undocumented
Instance Variable componentsProps Undocumented
Instance Variable container Undocumented
Instance Variable description Undocumented
Instance Variable label Undocumented
Instance Variable placeholder Undocumented
Instance Variable read_only Undocumented
Instance Variable space Undocumented
Instance Variable _kwargs Undocumented
def add_choice(self, value, **kwargs): (source)

Adds a choice value to this instance.

Parameters
valuea choice value
**kwargsUndocumented
Returns
the Choice that was added
def append(self, choice): (source)

Appends a Choice to the list of choices.

Parameters
choicea Choice instance
def clone(self): (source)

Undocumented

def values(self): (source)

Returns the choice values for this instance.

Returns
a list of values
_choices = (source)

Undocumented