gradio-pr-bot commited on
Commit
0637df4
·
verified ·
1 Parent(s): fb6dc25

Upload folder using huggingface_hub

Browse files
6.2.1/nativeplot/Index.svelte CHANGED
@@ -792,11 +792,16 @@
792
  />
793
  {/if}
794
  {#if gradio.props.buttons?.length}
795
- <IconButtonWrapper>
796
- {#if gradio.props.buttons?.includes("export")}
 
 
 
 
 
797
  <IconButton Icon={Download} label="Export" on:click={export_chart} />
798
  {/if}
799
- {#if gradio.props.buttons?.includes("fullscreen")}
800
  <FullscreenButton
801
  {fullscreen}
802
  on:fullscreen={({ detail }) => {
 
792
  />
793
  {/if}
794
  {#if gradio.props.buttons?.length}
795
+ <IconButtonWrapper
796
+ buttons={gradio.props.buttons}
797
+ on_custom_button_click={(id) => {
798
+ gradio.dispatch("custom_button_click", { id });
799
+ }}
800
+ >
801
+ {#if gradio.props.buttons?.some((btn) => typeof btn === "string" && btn === "export")}
802
  <IconButton Icon={Download} label="Export" on:click={export_chart} />
803
  {/if}
804
+ {#if gradio.props.buttons?.some((btn) => typeof btn === "string" && btn === "fullscreen")}
805
  <FullscreenButton
806
  {fullscreen}
807
  on:fullscreen={({ detail }) => {
6.2.1/nativeplot/package.json CHANGED
@@ -1,6 +1,6 @@
1
  {
2
  "name": "@gradio/nativeplot",
3
- "version": "0.9.2",
4
  "description": "Gradio UI packages",
5
  "type": "module",
6
  "author": "",
 
1
  {
2
  "name": "@gradio/nativeplot",
3
+ "version": "0.9.3",
4
  "description": "Gradio UI packages",
5
  "type": "module",
6
  "author": "",
6.2.1/nativeplot/types.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Gradio, SelectData } from "@gradio/utils";
2
  import type { LoadingStatus } from "@gradio/statustracker";
3
 
4
  export interface PlotData {
@@ -29,7 +29,7 @@ export interface NativePlotProps {
29
  caption: string | null;
30
  sort: "x" | "y" | "-x" | "-y" | string[] | null;
31
  tooltip: "axis" | "none" | "all" | string[];
32
- buttons: string[] | null;
33
  _selectable: boolean;
34
  label: string;
35
  elem_id: string;
@@ -46,4 +46,5 @@ export interface NativePlotEvents {
46
  select: SelectData;
47
  double_click: undefined;
48
  clear_status: LoadingStatus;
 
49
  }
 
1
+ import type { Gradio, SelectData, CustomButton } from "@gradio/utils";
2
  import type { LoadingStatus } from "@gradio/statustracker";
3
 
4
  export interface PlotData {
 
29
  caption: string | null;
30
  sort: "x" | "y" | "-x" | "-y" | string[] | null;
31
  tooltip: "axis" | "none" | "all" | string[];
32
+ buttons: (string | CustomButton)[] | null;
33
  _selectable: boolean;
34
  label: string;
35
  elem_id: string;
 
46
  select: SelectData;
47
  double_click: undefined;
48
  clear_status: LoadingStatus;
49
+ custom_button_click: { id: number };
50
  }