diff --git a/frontend/src/lib/instance-views/elements/ThreeD.svelte b/frontend/src/lib/instance-views/elements/ThreeD.svelte new file mode 100644 index 00000000..0689f668 --- /dev/null +++ b/frontend/src/lib/instance-views/elements/ThreeD.svelte @@ -0,0 +1,18 @@ + + + + + + + diff --git a/frontend/src/lib/instance-views/resolve.ts b/frontend/src/lib/instance-views/resolve.ts index 79280c86..2eee642f 100644 --- a/frontend/src/lib/instance-views/resolve.ts +++ b/frontend/src/lib/instance-views/resolve.ts @@ -9,6 +9,7 @@ import Markdown from './elements/Markdown.svelte'; import Message from './elements/Message.svelte'; import SeparatedValues from './elements/SeparatedValues.svelte'; import Text from './elements/Text.svelte'; +import ThreeD from './elements/ThreeD.svelte'; import VStack from './elements/VStack.svelte'; export const elementMap: Record = { @@ -20,7 +21,8 @@ export const elementMap: Record = { [ViewType.audio]: Audio, [ViewType.code]: Code, [ViewType.message]: Message, - [ViewType.separatedValues]: SeparatedValues + [ViewType.separatedValues]: SeparatedValues, + [ViewType['3D']]: ThreeD }; export function isComplexElement(type: string) { diff --git a/frontend/src/lib/instance-views/schema.json b/frontend/src/lib/instance-views/schema.json index 0d0f60aa..4de2915d 100644 --- a/frontend/src/lib/instance-views/schema.json +++ b/frontend/src/lib/instance-views/schema.json @@ -168,6 +168,7 @@ "audio", "code", "markdown", + "3D", "list", "vstack", "message", diff --git a/frontend/src/lib/instance-views/schema.ts b/frontend/src/lib/instance-views/schema.ts index 4e056f7d..6e5b2e99 100644 --- a/frontend/src/lib/instance-views/schema.ts +++ b/frontend/src/lib/instance-views/schema.ts @@ -5,6 +5,7 @@ export enum ViewType { 'audio' = 'audio', 'code' = 'code', 'markdown' = 'markdown', + '3D' = '3D', // data containers 'list' = 'list', 'vstack' = 'vstack', diff --git a/frontend/src/routes/playground/samples.ts b/frontend/src/routes/playground/samples.ts index e25196a8..d9c9489c 100644 --- a/frontend/src/routes/playground/samples.ts +++ b/frontend/src/routes/playground/samples.ts @@ -319,5 +319,25 @@ export const samples: Record = { null, 2 ) + }, + '3D-object-classification': { + spec: JSON.stringify( + { + data: { type: '3D' }, + label: { type: 'text' }, + output: { type: 'text' } + }, + null, + 2 + ), + data: JSON.stringify( + { + data: 'https://raw.githubusercontent.com/google/model-viewer/master/packages/shared-assets/models/NeilArmstrong.glb', + label: 'astronaut', + output: 'astronaut' + }, + null, + 2 + ) } };