adf0d17497
publish / version_or_publish (push) Has been cancelled
storybook-build / changes (push) Has been cancelled
storybook-build / :storybook-build (push) Has been cancelled
Sync Gradio Skills to Hugging Face / sync-skills (push) Has been cancelled
functional / changes (push) Has been cancelled
functional / build-frontend (push) Has been cancelled
functional / functional-test-SSR=false (push) Has been cancelled
functional / functional-reload (push) Has been cancelled
js / changes (push) Has been cancelled
js / js-test (push) Has been cancelled
docs-build / changes (push) Has been cancelled
docs-build / docs-build (push) Has been cancelled
docs-build / website-build (push) Has been cancelled
functional / functional-test-SSR=true (push) Has been cancelled
hygiene / hygiene-test (push) Has been cancelled
python / changes (push) Has been cancelled
python / build (push) Has been cancelled
python / test-ubuntu-latest-flaky (push) Has been cancelled
python / test-ubuntu-latest-not-flaky (push) Has been cancelled
python / test-windows-latest-flaky (push) Has been cancelled
python / test-windows-latest-not-flaky (push) Has been cancelled
80 lines
2.1 KiB
Svelte
80 lines
2.1 KiB
Svelte
<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.buttons && gradio.props.buttons.length > 0) || gradio.props.show_fullscreen_button}
|
|
<IconButtonWrapper
|
|
buttons={gradio.props.buttons ?? []}
|
|
on_custom_button_click={(id) => {
|
|
gradio.dispatch("custom_button_click", { id });
|
|
}}
|
|
>
|
|
{#if gradio.props.show_fullscreen_button}
|
|
<FullscreenButton
|
|
{fullscreen}
|
|
onclick={(value) => {
|
|
fullscreen = value;
|
|
}}
|
|
/>
|
|
{/if}
|
|
</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
|
|
value={gradio.props.value}
|
|
theme_mode={gradio.props.theme_mode}
|
|
show_label={gradio.shared.show_label}
|
|
caption={gradio.props.caption}
|
|
bokeh_version={gradio.props.bokeh_version}
|
|
show_actions_button={gradio.props.show_actions_button}
|
|
_selectable={gradio.props._selectable}
|
|
x_lim={gradio.props.x_lim}
|
|
show_fullscreen_button={gradio.props.show_fullscreen_button}
|
|
on_change={() => gradio.dispatch("change")}
|
|
onselect={(data) => gradio.dispatch("select", data)}
|
|
/>
|
|
</Block>
|