File size: 1,459 Bytes
efbf3ed
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<script context="module" lang="ts">
	export { default as BasePlot } from "./shared/Plot.svelte";
</script>

<script lang="ts">
	import { Gradio } from "@gradio/utils";
	import Plot from "./shared/Plot.svelte";

	import {
		Block,
		BlockLabel,
		FullscreenButton,
		IconButtonWrapper
	} from "@gradio/atoms";
	import { Plot as PlotIcon } from "@gradio/icons";

	import { StatusTracker } from "@gradio/statustracker";
	import type { PlotProps, PlotEvents } from "./types.ts";

	let props = $props();
	const gradio = new Gradio<PlotEvents, PlotProps>(props);

	let fullscreen = $state(false);
</script>

<Block
	padding={false}
	elem_id={gradio.shared.elem_id}
	elem_classes={gradio.shared.elem_classes}
	visible={gradio.shared.visible}
	container={gradio.shared.container}
	scale={gradio.shared.scale}
	min_width={gradio.shared.min_width}
	allow_overflow={false}
	bind:fullscreen
>
	<BlockLabel
		show_label={gradio.shared.show_label}
		label={gradio.shared.label || gradio.i18n("plot.plot")}
		Icon={PlotIcon}
	/>
	{#if gradio.props.show_fullscreen_button}
		<IconButtonWrapper>
			<FullscreenButton
				{fullscreen}
				on:fullscreen={({ detail }) => {
					fullscreen = detail;
				}}
			/>
		</IconButtonWrapper>
	{/if}
	<StatusTracker
		autoscroll={gradio.shared.autoscroll}
		i18n={gradio.i18n}
		{...gradio.shared.loading_status}
		on_clear_status={() =>
			gradio.dispatch("clear_status", gradio.shared.loading_status)}
	/>
	<Plot {gradio} />
</Block>