@gradio/model3d 0.14.25 → 0.14.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/dist/Example.svelte.d.ts +3 -1
- package/dist/Index.svelte +1 -2
- package/dist/Index.svelte.d.ts +12 -10
- package/dist/shared/Canvas3D.svelte +2 -4
- package/dist/shared/Canvas3D.svelte.d.ts +4 -2
- package/dist/shared/Canvas3DGS.svelte +5 -8
- package/dist/shared/Canvas3DGS.svelte.d.ts +2 -0
- package/dist/shared/Model3D.svelte +11 -12
- package/dist/shared/Model3D.svelte.d.ts +9 -7
- package/dist/shared/Model3DUpload.svelte +12 -14
- package/dist/shared/Model3DUpload.svelte.d.ts +10 -8
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @gradio/model3d
|
|
2
2
|
|
|
3
|
+
## 0.14.26
|
|
4
|
+
|
|
5
|
+
### Dependency updates
|
|
6
|
+
|
|
7
|
+
- @gradio/client@1.18.0
|
|
8
|
+
- @gradio/icons@0.14.0
|
|
9
|
+
- @gradio/atoms@0.17.0
|
|
10
|
+
- @gradio/statustracker@0.11.0
|
|
11
|
+
- @gradio/upload@0.16.17
|
|
12
|
+
|
|
13
|
+
## 0.14.25
|
|
14
|
+
|
|
15
|
+
### Dependency updates
|
|
16
|
+
|
|
17
|
+
- @gradio/statustracker@0.10.18
|
|
18
|
+
|
|
19
|
+
## 0.14.25
|
|
20
|
+
|
|
21
|
+
### Dependency updates
|
|
22
|
+
|
|
23
|
+
- @gradio/icons@0.13.1
|
|
24
|
+
- @gradio/upload@0.16.16
|
|
25
|
+
|
|
3
26
|
## 0.14.25
|
|
4
27
|
|
|
5
28
|
### Dependency updates
|
package/dist/Example.svelte.d.ts
CHANGED
|
@@ -3,12 +3,14 @@ declare const __propDef: {
|
|
|
3
3
|
props: {
|
|
4
4
|
value: string | null;
|
|
5
5
|
type: "gallery" | "table";
|
|
6
|
-
selected?: boolean
|
|
6
|
+
selected?: boolean;
|
|
7
7
|
};
|
|
8
8
|
events: {
|
|
9
9
|
[evt: string]: CustomEvent<any>;
|
|
10
10
|
};
|
|
11
11
|
slots: {};
|
|
12
|
+
exports?: {} | undefined;
|
|
13
|
+
bindings?: string | undefined;
|
|
12
14
|
};
|
|
13
15
|
export type ExampleProps = typeof __propDef.props;
|
|
14
16
|
export type ExampleEvents = typeof __propDef.events;
|
package/dist/Index.svelte
CHANGED
|
@@ -26,8 +26,7 @@ export let height = void 0;
|
|
|
26
26
|
export let zoom_speed = 1;
|
|
27
27
|
export let input_ready;
|
|
28
28
|
let uploading = false;
|
|
29
|
-
$:
|
|
30
|
-
input_ready = !uploading;
|
|
29
|
+
$: input_ready = !uploading;
|
|
31
30
|
export let has_change_history = false;
|
|
32
31
|
export let camera_position = [
|
|
33
32
|
null,
|
package/dist/Index.svelte.d.ts
CHANGED
|
@@ -7,31 +7,33 @@ import type { LoadingStatus } from "@gradio/statustracker";
|
|
|
7
7
|
import type { Gradio } from "@gradio/utils";
|
|
8
8
|
declare const __propDef: {
|
|
9
9
|
props: {
|
|
10
|
-
elem_id?: string
|
|
11
|
-
elem_classes?: string[]
|
|
12
|
-
visible?: boolean
|
|
13
|
-
value?:
|
|
10
|
+
elem_id?: string;
|
|
11
|
+
elem_classes?: string[];
|
|
12
|
+
visible?: boolean;
|
|
13
|
+
value?: null | FileData;
|
|
14
14
|
root: string;
|
|
15
|
-
display_mode?:
|
|
15
|
+
display_mode?: "solid" | "point_cloud" | "wireframe";
|
|
16
16
|
clear_color: [number, number, number, number];
|
|
17
17
|
loading_status: LoadingStatus;
|
|
18
18
|
label: string;
|
|
19
19
|
show_label: boolean;
|
|
20
|
-
container?: boolean
|
|
21
|
-
scale?:
|
|
20
|
+
container?: boolean;
|
|
21
|
+
scale?: number | null;
|
|
22
22
|
min_width?: number | undefined;
|
|
23
23
|
gradio: Gradio;
|
|
24
24
|
height?: number | undefined;
|
|
25
|
-
zoom_speed?: number
|
|
25
|
+
zoom_speed?: number;
|
|
26
26
|
input_ready: boolean;
|
|
27
|
-
has_change_history?: boolean
|
|
28
|
-
camera_position?: [number | null, number | null, number | null]
|
|
27
|
+
has_change_history?: boolean;
|
|
28
|
+
camera_position?: [number | null, number | null, number | null];
|
|
29
29
|
interactive: boolean;
|
|
30
30
|
};
|
|
31
31
|
events: {
|
|
32
32
|
[evt: string]: CustomEvent<any>;
|
|
33
33
|
};
|
|
34
34
|
slots: {};
|
|
35
|
+
exports?: {} | undefined;
|
|
36
|
+
bindings?: string | undefined;
|
|
35
37
|
};
|
|
36
38
|
export type IndexProps = typeof __propDef.props;
|
|
37
39
|
export type IndexEvents = typeof __propDef.events;
|
|
@@ -7,8 +7,7 @@ export let clear_color;
|
|
|
7
7
|
export let camera_position;
|
|
8
8
|
export let zoom_speed;
|
|
9
9
|
export let pan_speed;
|
|
10
|
-
$:
|
|
11
|
-
url = value.url;
|
|
10
|
+
$: url = value.url;
|
|
12
11
|
export let resolved_url = void 0;
|
|
13
12
|
let latest_url;
|
|
14
13
|
$: {
|
|
@@ -50,8 +49,7 @@ onMount(() => {
|
|
|
50
49
|
viewer?.dispose();
|
|
51
50
|
};
|
|
52
51
|
});
|
|
53
|
-
$:
|
|
54
|
-
mounted && load_model(resolved_url);
|
|
52
|
+
$: mounted && load_model(resolved_url);
|
|
55
53
|
function setRenderingMode(pointsCloud, wireframe) {
|
|
56
54
|
viewerDetails.scene.forcePointsCloud = pointsCloud;
|
|
57
55
|
viewerDetails.scene.forceWireframe = wireframe;
|
|
@@ -9,13 +9,15 @@ declare const __propDef: {
|
|
|
9
9
|
zoom_speed: number;
|
|
10
10
|
pan_speed: number;
|
|
11
11
|
resolved_url?: string | undefined;
|
|
12
|
-
update_camera?: (
|
|
13
|
-
reset_camera_position?: (
|
|
12
|
+
update_camera?: (camera_position: [number | null, number | null, number | null], zoom_speed: number, pan_speed: number) => void;
|
|
13
|
+
reset_camera_position?: () => void;
|
|
14
14
|
};
|
|
15
15
|
events: {
|
|
16
16
|
[evt: string]: CustomEvent<any>;
|
|
17
17
|
};
|
|
18
18
|
slots: {};
|
|
19
|
+
exports?: {} | undefined;
|
|
20
|
+
bindings?: string | undefined;
|
|
19
21
|
};
|
|
20
22
|
export type Canvas3DProps = typeof __propDef.props;
|
|
21
23
|
export type Canvas3DEvents = typeof __propDef.events;
|
|
@@ -4,8 +4,7 @@ import { resolve_wasm_src } from "@gradio/wasm/svelte";
|
|
|
4
4
|
export let value;
|
|
5
5
|
export let zoom_speed;
|
|
6
6
|
export let pan_speed;
|
|
7
|
-
$:
|
|
8
|
-
url = value.url;
|
|
7
|
+
$: url = value.url;
|
|
9
8
|
export let resolved_url = void 0;
|
|
10
9
|
let latest_url;
|
|
11
10
|
$: {
|
|
@@ -92,12 +91,10 @@ onMount(() => {
|
|
|
92
91
|
}
|
|
93
92
|
};
|
|
94
93
|
});
|
|
95
|
-
$:
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
$:
|
|
100
|
-
canvas && mounted && path && reset_scene();
|
|
94
|
+
$: ({ path } = value || {
|
|
95
|
+
path: void 0
|
|
96
|
+
});
|
|
97
|
+
$: canvas && mounted && path && reset_scene();
|
|
101
98
|
</script>
|
|
102
99
|
|
|
103
100
|
<canvas bind:this={canvas}></canvas>
|
|
@@ -11,6 +11,8 @@ declare const __propDef: {
|
|
|
11
11
|
[evt: string]: CustomEvent<any>;
|
|
12
12
|
};
|
|
13
13
|
slots: {};
|
|
14
|
+
exports?: {} | undefined;
|
|
15
|
+
bindings?: string | undefined;
|
|
14
16
|
};
|
|
15
17
|
export type Canvas3DgsProps = typeof __propDef.props;
|
|
16
18
|
export type Canvas3DgsEvents = typeof __propDef.events;
|
|
@@ -27,19 +27,18 @@ async function loadCanvas3DGS() {
|
|
|
27
27
|
const module = await import("./Canvas3DGS.svelte");
|
|
28
28
|
return module.default;
|
|
29
29
|
}
|
|
30
|
-
$:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
});
|
|
41
|
-
}
|
|
30
|
+
$: if (value) {
|
|
31
|
+
use_3dgs = value.path.endsWith(".splat") || value.path.endsWith(".ply");
|
|
32
|
+
if (use_3dgs) {
|
|
33
|
+
loadCanvas3DGS().then((component) => {
|
|
34
|
+
Canvas3DGSComponent = component;
|
|
35
|
+
});
|
|
36
|
+
} else {
|
|
37
|
+
loadCanvas3D().then((component) => {
|
|
38
|
+
Canvas3DComponent = component;
|
|
39
|
+
});
|
|
42
40
|
}
|
|
41
|
+
}
|
|
43
42
|
let canvas3d;
|
|
44
43
|
function handle_undo() {
|
|
45
44
|
canvas3d?.reset_camera_position();
|
|
@@ -4,20 +4,22 @@ import type { I18nFormatter } from "@gradio/utils";
|
|
|
4
4
|
declare const __propDef: {
|
|
5
5
|
props: {
|
|
6
6
|
value: FileData | null;
|
|
7
|
-
display_mode?:
|
|
8
|
-
clear_color?: [number, number, number, number]
|
|
9
|
-
label?: string
|
|
7
|
+
display_mode?: "solid" | "point_cloud" | "wireframe";
|
|
8
|
+
clear_color?: [number, number, number, number];
|
|
9
|
+
label?: string;
|
|
10
10
|
show_label: boolean;
|
|
11
11
|
i18n: I18nFormatter;
|
|
12
|
-
zoom_speed?: number
|
|
13
|
-
pan_speed?: number
|
|
14
|
-
camera_position?: [number | null, number | null, number | null]
|
|
15
|
-
has_change_history?: boolean
|
|
12
|
+
zoom_speed?: number;
|
|
13
|
+
pan_speed?: number;
|
|
14
|
+
camera_position?: [number | null, number | null, number | null];
|
|
15
|
+
has_change_history?: boolean;
|
|
16
16
|
};
|
|
17
17
|
events: {
|
|
18
18
|
[evt: string]: CustomEvent<any>;
|
|
19
19
|
};
|
|
20
20
|
slots: {};
|
|
21
|
+
exports?: {} | undefined;
|
|
22
|
+
bindings?: string | undefined;
|
|
21
23
|
};
|
|
22
24
|
export type Model3DProps = typeof __propDef.props;
|
|
23
25
|
export type Model3DEvents = typeof __propDef.events;
|
|
@@ -45,27 +45,25 @@ async function loadCanvas3DGS() {
|
|
|
45
45
|
const module = await import("./Canvas3DGS.svelte");
|
|
46
46
|
return module.default;
|
|
47
47
|
}
|
|
48
|
-
$:
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
});
|
|
59
|
-
}
|
|
48
|
+
$: if (value) {
|
|
49
|
+
use_3dgs = value.path.endsWith(".splat") || value.path.endsWith(".ply");
|
|
50
|
+
if (use_3dgs) {
|
|
51
|
+
loadCanvas3DGS().then((component) => {
|
|
52
|
+
Canvas3DGSComponent = component;
|
|
53
|
+
});
|
|
54
|
+
} else {
|
|
55
|
+
loadCanvas3D().then((component) => {
|
|
56
|
+
Canvas3DComponent = component;
|
|
57
|
+
});
|
|
60
58
|
}
|
|
59
|
+
}
|
|
61
60
|
let canvas3d;
|
|
62
61
|
async function handle_undo() {
|
|
63
62
|
canvas3d?.reset_camera_position();
|
|
64
63
|
}
|
|
65
64
|
const dispatch = createEventDispatcher();
|
|
66
65
|
let dragging = false;
|
|
67
|
-
$:
|
|
68
|
-
dispatch("drag", dragging);
|
|
66
|
+
$: dispatch("drag", dragging);
|
|
69
67
|
</script>
|
|
70
68
|
|
|
71
69
|
<BlockLabel {show_label} Icon={File} label={label || "3D Model"} />
|
|
@@ -4,17 +4,17 @@ import type { I18nFormatter } from "@gradio/utils";
|
|
|
4
4
|
declare const __propDef: {
|
|
5
5
|
props: {
|
|
6
6
|
value: null | FileData;
|
|
7
|
-
display_mode?:
|
|
8
|
-
clear_color?: [number, number, number, number]
|
|
9
|
-
label?: string
|
|
7
|
+
display_mode?: "solid" | "point_cloud" | "wireframe";
|
|
8
|
+
clear_color?: [number, number, number, number];
|
|
9
|
+
label?: string;
|
|
10
10
|
show_label: boolean;
|
|
11
11
|
root: string;
|
|
12
12
|
i18n: I18nFormatter;
|
|
13
|
-
zoom_speed?: number
|
|
14
|
-
pan_speed?: number
|
|
15
|
-
max_file_size?:
|
|
16
|
-
uploading?: boolean
|
|
17
|
-
camera_position?: [number | null, number | null, number | null]
|
|
13
|
+
zoom_speed?: number;
|
|
14
|
+
pan_speed?: number;
|
|
15
|
+
max_file_size?: number | null;
|
|
16
|
+
uploading?: boolean;
|
|
17
|
+
camera_position?: [number | null, number | null, number | null];
|
|
18
18
|
upload: Client["upload"];
|
|
19
19
|
stream_handler: Client["stream"];
|
|
20
20
|
};
|
|
@@ -30,6 +30,8 @@ declare const __propDef: {
|
|
|
30
30
|
slots: {
|
|
31
31
|
default: {};
|
|
32
32
|
};
|
|
33
|
+
exports?: {} | undefined;
|
|
34
|
+
bindings?: string | undefined;
|
|
33
35
|
};
|
|
34
36
|
export type Model3DUploadProps = typeof __propDef.props;
|
|
35
37
|
export type Model3DUploadEvents = typeof __propDef.events;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gradio/model3d",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.26",
|
|
4
4
|
"description": "Gradio UI packages",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "",
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
"@babylonjs/loaders": "^8.2.0",
|
|
14
14
|
"dequal": "^2.0.2",
|
|
15
15
|
"gsplat": "^1.2.9",
|
|
16
|
-
"@gradio/atoms": "^0.
|
|
17
|
-
"@gradio/client": "^1.
|
|
18
|
-
"@gradio/
|
|
19
|
-
"@gradio/
|
|
20
|
-
"@gradio/
|
|
16
|
+
"@gradio/atoms": "^0.17.0",
|
|
17
|
+
"@gradio/client": "^1.18.0",
|
|
18
|
+
"@gradio/icons": "^0.14.0",
|
|
19
|
+
"@gradio/upload": "^0.16.17",
|
|
20
|
+
"@gradio/statustracker": "^0.11.0",
|
|
21
21
|
"@gradio/utils": "^0.10.2",
|
|
22
22
|
"@gradio/wasm": "^0.18.1"
|
|
23
23
|
},
|