2023-07-31 22:54:29 +08:00
|
|
|
<script>
|
|
|
|
import { Meta, Template, Story } from "@storybook/addon-svelte-csf";
|
2023-08-04 06:01:18 +08:00
|
|
|
import HighlightedText from "./static";
|
2023-08-24 04:48:10 +08:00
|
|
|
import { Gradio } from "../app/src/gradio_helper";
|
2023-07-31 22:54:29 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<Meta title="Components/HighlightedText" component={HighlightedText} />
|
|
|
|
|
|
|
|
<Template let:args>
|
|
|
|
<HighlightedText
|
|
|
|
value={[
|
|
|
|
["zebras", "+"],
|
|
|
|
["dogs", "-"],
|
2023-08-04 06:01:18 +08:00
|
|
|
["elephants", "+"]
|
2023-07-31 22:54:29 +08:00
|
|
|
]}
|
2023-08-24 04:48:10 +08:00
|
|
|
gradio={new Gradio(
|
|
|
|
0,
|
|
|
|
document.body,
|
|
|
|
"light",
|
|
|
|
"1.1.1",
|
|
|
|
"http://localhost:7860"
|
|
|
|
)}
|
2023-07-31 22:54:29 +08:00
|
|
|
{...args}
|
|
|
|
/>
|
|
|
|
</Template>
|
|
|
|
|
|
|
|
<Story name="Highlighted Text" />
|
|
|
|
<Story name="Highlighted Text with legend" args={{ show_legend: true }} />
|
|
|
|
<Story name="Highlighted Text with label" args={{ label: "animals" }} />
|
|
|
|
<Story
|
|
|
|
name="Highlighted Text with new lines"
|
|
|
|
args={{
|
2023-08-04 06:01:18 +08:00
|
|
|
value: [["zebras", "+"], ["\n"], ["dogs", "-"], ["\n"], ["elephants", "+"]]
|
2023-07-31 22:54:29 +08:00
|
|
|
}}
|
|
|
|
/>
|
|
|
|
<Story
|
|
|
|
name="Highlighted Text with color map"
|
|
|
|
args={{ color_map: { "+": "green", "-": "red" } }}
|
|
|
|
/>
|