@fiftyone/plugins¶
State¶
pluginsLoaderAtom¶
Name |
Type |
Description |
---|---|---|
pluginsLoaderAtom |
|
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
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
getPluginDefinition¶
-
@fiftyone/plugins.
getPluginDefinition
(name)¶ - Arguments
name (string) –
- Return type
plugins.fiftyone.plugins.PluginDefinition()
Get a plugin definition by name.
Returns
The plugin definition
registerComponent¶
-
@fiftyone/plugins.
registerComponent
(registration)¶ - Arguments
registration (PluginComponentRegistration < T >) –
- Return type
void
Adds a plugin to the registry. This is called by the plugin itself.
Types¶
PluginComponentRegistration¶
-
class
@fiftyone/plugins.
PluginComponentRegistration
()¶
A plugin registration.
Properties¶
Name |
Type |
Description |
---|---|---|
Icon |
|
Primary icon for the plugin, also used in panel title bar |
activator |
|
A function that returns true if the plugin should be active |
component |
|
The React component to render for the plugin |
label |
|
The optional label of the plugin to display to the user |
name |
|
The name of the plugin |
panelOptions |
|
Options for the panel |
type |
|
The plugin type |