2022-04-19 03:26:30 +08:00
|
|
|
<script lang="ts">
|
2023-08-04 06:01:18 +08:00
|
|
|
import Plot from "./Plot.svelte";
|
2022-04-19 03:26:30 +08:00
|
|
|
|
2022-05-30 22:21:36 +08:00
|
|
|
import { Block, BlockLabel } from "@gradio/atoms";
|
|
|
|
import { Plot as PlotIcon } from "@gradio/icons";
|
|
|
|
|
2023-08-04 06:01:18 +08:00
|
|
|
import { StatusTracker } from "@gradio/statustracker";
|
|
|
|
import type { LoadingStatus } from "@gradio/statustracker/types";
|
2022-05-30 22:21:36 +08:00
|
|
|
import { _ } from "svelte-i18n";
|
2023-04-29 02:31:41 +08:00
|
|
|
import type { ThemeMode } from "js/app/src/components/types";
|
2022-05-30 22:21:36 +08:00
|
|
|
|
2022-04-19 03:26:30 +08:00
|
|
|
export let value: null | string = null;
|
2023-08-04 06:01:18 +08:00
|
|
|
export let elem_id = "";
|
|
|
|
export let elem_classes: string[] = [];
|
|
|
|
export let visible = true;
|
2022-05-06 03:05:05 +08:00
|
|
|
export let loading_status: LoadingStatus;
|
2022-05-30 22:21:36 +08:00
|
|
|
export let label: string;
|
|
|
|
export let show_label: boolean;
|
2022-10-24 23:13:41 +08:00
|
|
|
export let target: HTMLElement;
|
2023-08-04 06:01:18 +08:00
|
|
|
export let container = true;
|
2023-06-22 03:34:12 +08:00
|
|
|
export let scale: number | null = null;
|
2023-06-08 09:35:31 +08:00
|
|
|
export let min_width: number | undefined = undefined;
|
2023-04-29 02:31:41 +08:00
|
|
|
export let theme_mode: ThemeMode;
|
2022-12-09 23:14:07 +08:00
|
|
|
export let caption: string;
|
2023-02-18 05:47:06 +08:00
|
|
|
export let bokeh_version: string | null;
|
2022-04-19 03:26:30 +08:00
|
|
|
</script>
|
|
|
|
|
2022-12-09 23:14:07 +08:00
|
|
|
<Block
|
|
|
|
padding={false}
|
|
|
|
{elem_id}
|
2023-03-16 05:01:53 +08:00
|
|
|
{elem_classes}
|
2022-12-09 23:14:07 +08:00
|
|
|
{visible}
|
2023-06-08 09:35:31 +08:00
|
|
|
{container}
|
|
|
|
{scale}
|
|
|
|
{min_width}
|
2022-12-09 23:14:07 +08:00
|
|
|
>
|
2022-05-30 22:21:36 +08:00
|
|
|
<BlockLabel {show_label} label={label || "Plot"} Icon={PlotIcon} />
|
|
|
|
<StatusTracker {...loading_status} />
|
2023-04-29 02:31:41 +08:00
|
|
|
<Plot {value} {target} {theme_mode} {caption} {bokeh_version} on:change />
|
2022-05-30 22:21:36 +08:00
|
|
|
</Block>
|