gradio/js/model3D/static/StaticModel3d.svelte

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

56 lines
1.5 KiB
Svelte
Raw Normal View History

<script lang="ts">
import type { FileData } from "@gradio/upload";
import { normalise_file } from "@gradio/upload";
import Model3D from "./Model3D.svelte";
import { BlockLabel, Block, Empty } from "@gradio/atoms";
import { File } from "@gradio/icons";
import { StatusTracker } from "@gradio/statustracker";
import type { LoadingStatus } from "@gradio/statustracker";
import { _ } from "svelte-i18n";
export let elem_id = "";
export let elem_classes: string[] = [];
export let visible = true;
export let value: null | FileData = null;
export let root: string;
export let root_url: null | string;
export let clearColor: [number, number, number, number];
export let loading_status: LoadingStatus;
export let label: string;
export let show_label: boolean;
export let container = true;
export let scale: number | null = null;
export let min_width: number | undefined = undefined;
let _value: null | FileData;
$: _value = normalise_file(value, root, root_url);
let dragging = false;
</script>
<Block
{visible}
variant={value === null ? "dashed" : "solid"}
Python backend to theming (#2931) * add theme + theme atoms * audio * buttons * chatbot * forms * start file * complete file * fixup workbench * gallery * highlighted text * label * json * upload * 3d model * atoms * chart * md + html * image * plot + build * table * tabs * tooltip * upload * tweaks * tweaks + more tooling * tweaks to padding/ lineheight * app components _ start api docs * format, more api docs * finish api docs * interpretation * todos * tweaks + cleanup * tweaks + cleanup * revert range tweaks * fix notebooks * fix test * remove tw * cleanup + login * fix gitignore * fix types * run css script * fix progress + tweaks * update demos * add css build to static check workflow * tweak ci * fix tests * tweak markdown * tweak chatbot + file * fix tabs * tweak tabs * cleanup * fix api docs * fix example gallery * add gradient to toast * fix min height for interfaces * revert tab changes * update notebooks * changes * changes * change * changes * changes * changes * changes * changes * changes * changes * changes * change * changes * changes * changes * changes * changes * changes * changes * fix * changes * changes * changes * changes * changes * changes * undo radius * undo radius * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * change * undo * Add absolute imports * mock theme in tests * clean * changes * changes --------- Co-authored-by: pngwn <hello@pngwn.io> Co-authored-by: freddyaboulton <alfonsoboulton@gmail.com> Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-03-07 04:52:31 +08:00
border_mode={dragging ? "focus" : "base"}
padding={false}
{elem_id}
{elem_classes}
{container}
{scale}
{min_width}
>
<StatusTracker {...loading_status} />
{#if value}
<Model3D value={_value} {clearColor} {label} {show_label} />
{:else}
<!-- Not ideal but some bugs to work out before we can
make this consistent with other components -->
<BlockLabel {show_label} Icon={File} label={label || "3D Model"} />
<Empty unpadded_box={true} size="large"><File /></Empty>
{/if}
</Block>