Skip to content

Commit

Permalink
add component property to view
Browse files Browse the repository at this point in the history
  • Loading branch information
imanjra authored and ritch committed May 10, 2023
1 parent 86032dd commit 97c5685
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/packages/core/src/plugins/OperatorIO/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function getOutputComponent(property, options) {

function getComponentByView(property) {
const view = getViewSchema(property) || {};
const viewComponentName = view.name;
const viewComponentName = view.component || view.name;
if (viewComponentName && !baseViews.includes(viewComponentName)) {
return viewAliases[viewComponentName] || viewComponentName;
}
Expand Down
3 changes: 3 additions & 0 deletions fiftyone/operators/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,7 @@ class View:
space (12): An ``int`` specifying how much vertical space to allocate out of ``12``.
placeholder (None): string to display placeholder text
read_only (False): whether the :class:`View` is read-only
component (None): specifying custom component to use as the view
"""

def __init__(self, **kwargs):
Expand All @@ -454,6 +455,7 @@ def __init__(self, **kwargs):
self.space = kwargs.get("space", None)
self.placeholder = kwargs.get("placeholder", None)
self.read_only = kwargs.get("read_only", None)
self.component = kwargs.get("component", None)
self._kwargs = kwargs

def clone(self):
Expand All @@ -468,6 +470,7 @@ def to_json(self):
"space": self.space,
"placeholder": self.placeholder,
"read_only": self.read_only,
"component": self.component,
**self._kwargs,
}

Expand Down

0 comments on commit 97c5685

Please sign in to comment.