Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix missing imageview type #2989

Merged
merged 4 commits into from
May 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions app/packages/core/src/plugins/OperatorIO/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,12 @@ function getSchema(property, options?) {

if (typeName === "List") {
schema.items = getSchema({ type: property.type.elementType }, options);
if (schema?.view?.items) {
schema.view.items.component = getComponent(
{ type: property.type.elementType, view: schema?.view?.items },
options
);
}
}

if (typeName === "OneOf") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ import HeaderView from "./HeaderView";

export default function ImageView(props) {
const { schema, data } = props;
const { view = {} } = schema;
const imageURI = data ?? schema?.default;
const { image = {} } = view;

return (
<Box>
<HeaderView {...props} />
<img src={imageURI} />
<img src={imageURI} {...image} />
</Box>
);
}
5 changes: 5 additions & 0 deletions fiftyone/operators/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -1062,3 +1062,8 @@ def __init__(self, **kwargs):

def to_json(self):
return {**super().to_json(), "variant": self.variant}


class ImageView(View):
def __init__(self, **kwargs):
super().__init__(**kwargs)