@fiftyone/plugins#

State#

pluginsLoaderAtom#

Name

Type

Description

pluginsLoaderAtom

Union< 'loading' , 'error' , 'ready' >

const [pluginsLoaderAtom, setPluginsLoaderAtom] = useRecoilState(fos.pluginsLoaderAtom);

Hooks#

useActivePlugins#

@fiftyone/plugins.useActivePlugins(type, ctx)#
Arguments:
  • type (PluginComponentType())

  • ctx (any())

Return type:

Array< plugins.fiftyone.plugins.PluginComponentRegistration() < Any > >

A react hook that returns a list of active plugins.

Returns

A list of active plugins

usePlugin#

@fiftyone/plugins.usePlugin(type)#
Arguments:
  • type (PluginComponentType())

Return type:

Array< plugins.fiftyone.plugins.PluginComponentRegistration() >

usePluginComponent#

@fiftyone/plugins.usePluginComponent(name, ctx)#
Arguments:
  • name (string())

  • ctx (unknown())

Return type:

plugins.fiftyone.plugins.PluginComponentRegistration() < Any >

A react hook that returns a component plugin by name if exist.

Returns

The plugin component or

`undefined`

usePluginDefinition#

@fiftyone/plugins.usePluginDefinition(name)#
Arguments:
  • name (string())

Return type:

plugins.fiftyone.plugins.PluginDefinition()

Get a plugin definition by name.

Returns

The plugin definition

usePluginSettings#

@fiftyone/plugins.usePluginSettings(pluginName, defaults)#
Arguments:
  • pluginName (string())

  • defaults (Partial)

Return type:

plugins.fiftyone.plugins.T()

usePlugins#

@fiftyone/plugins.usePlugins()#
Return type:

Object

A react hook for loading the plugin system.

Functions#

getAbsolutePluginPath#

@fiftyone/plugins.getAbsolutePluginPath(name, path)#
Arguments:
  • name (string())

  • path (string())

Return type:

string

Get the absolute path to a file within a plugin directory.

Returns

An absolute path to the file

getByType#

@fiftyone/plugins.getByType(type)#
Arguments:
  • type (PluginComponentType())

Return type:

Array< any >

Get a list of plugins match the given type.

Returns

A list of plugins

getCategoryForPanel#

@fiftyone/plugins.getCategoryForPanel(panel)#
Arguments:
  • panel (PluginComponentRegistration)

Return type:

plugins.fiftyone.plugins.CategoryID()

getCategoryLabel#

@fiftyone/plugins.getCategoryLabel(category)#
Arguments:
  • category (CategoryID())

Return type:

string

getPluginDefinition#

@fiftyone/plugins.getPluginDefinition(name)#
Arguments:
  • name (string())

Return type:

plugins.fiftyone.plugins.PluginDefinition()

Get a plugin definition by name.

Returns

The plugin definition

loadPlugins#

@fiftyone/plugins.loadPlugins()#
Return type:

Promise < void > < void >

registerComponent#

@fiftyone/plugins.registerComponent(registration)#
Arguments:
  • registration (PluginComponentRegistration)

Return type:

void

Adds a plugin to the registry. This is called by the plugin itself.

safePluginActivator#

@fiftyone/plugins.safePluginActivator(plugin, ctx)#
Arguments:
  • plugin (PluginComponentRegistration)

  • ctx (any())

Return type:

boolean

a utility for safely calling plugin defined activator functions

subscribeToRegistry#

@fiftyone/plugins.subscribeToRegistry(handler)#
Arguments:
  • handler (RegistryEventHandler())

Subscribe to plugin registry’s “subscribe” and “unsubscribe” event.

Returns

A function to unsubscribe

@fiftyone/plugins.subscribeToRegistry(handler)#
Return type:

void

unregisterComponent#

@fiftyone/plugins.unregisterComponent(name)#
Arguments:
  • name (string())

Return type:

void

Remove a plugin from the registry.

Types#

PluginComponentRegistration#

class @fiftyone/plugins.PluginComponentRegistration()#

A plugin registration.

Properties#

Name

Type

Description

Icon

ComponentType <  > < Any >

Primary icon for the plugin, also used in panel title bar

activator

plugins.fiftyone.plugins.PluginActivator()

A function that returns true if the plugin should be active

component

FunctionComponent < PluginComponentProps > < plugins.fiftyone.plugins.PluginComponentProps() >

The React component to render for the plugin

label

string

The optional label of the plugin to display to the user

name

string

The name of the plugin

panelOptions

plugins.fiftyone.plugins.PanelOptions()

Options for the panel

type

plugins.fiftyone.plugins.PluginComponentType()

The plugin type

Enums#

Categories#

Name

Value

Analyze

Curate

Custom

Import

PluginComponentType#

The type of plugin component.

  • Panel - A panel that can be added to @fiftyone/spaces

  • Plot - deprecated - A plot that can be added as a panel

Name

Value

Component

Panel

Plot