freddyaboulton HF Staff commited on
Commit
fcc7dc4
·
verified ·
1 Parent(s): 0241017

Upload folder using huggingface_hub

Browse files
Files changed (3) hide show
  1. README.md +1 -1
  2. run.ipynb +1 -1
  3. run.py +0 -8
README.md CHANGED
@@ -5,7 +5,7 @@ emoji: 🔥
5
  colorFrom: indigo
6
  colorTo: indigo
7
  sdk: gradio
8
- sdk_version: 5.49.1
9
  app_file: run.py
10
  pinned: false
11
  hf_oauth: true
 
5
  colorFrom: indigo
6
  colorTo: indigo
7
  sdk: gradio
8
+ sdk_version: 6.0.0
9
  app_file: run.py
10
  pinned: false
11
  hf_oauth: true
run.ipynb CHANGED
@@ -1 +1 @@
1
- {"cells": [{"cell_type": "markdown", "id": "302934307671667531413257853548643485645", "metadata": {}, "source": ["# Gradio Demo: draggable_dashboard"]}, {"cell_type": "code", "execution_count": null, "id": "272996653310673477252411125948039410165", "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": "288918539441861185822528903084949547379", "metadata": {}, "outputs": [], "source": ["import gradio as gr\n", "import numpy as np\n", "import pandas as pd\n", "\n", "with gr.Blocks() as demo:\n", " gr.Markdown(\"# Draggable Dashboard Demo\")\n", " gr.Markdown(\"Drag the charts around to reorder them!\")\n", " \n", " x = np.linspace(0, 10, 100)\n", " data = pd.DataFrame({\n", " 'x': x,\n", " 'y1': np.random.normal(100, 20, 100) + 10 * np.sin(x),\n", " 'y2': np.random.normal(500, 100, 100) + 50 * np.cos(x),\n", " 'y3': np.random.normal(1000, 200, 100) + 100 * np.sin(x/2),\n", " 'y4': np.random.normal(0.15, 0.05, 100) + 0.05 * np.cos(x/3)\n", " })\n", " \n", " with gr.Row():\n", " with gr.Column(scale=1):\n", " gr.Markdown(\"### Horizontal Layout (orientation='row')\")\n", " with gr.Draggable(orientation=\"row\"):\n", " gr.LinePlot(\n", " data,\n", " x=\"x\",\n", " y=\"y1\",\n", " title=\"Chart 1\",\n", " height=200,\n", " width=300\n", " )\n", " gr.LinePlot(\n", " data,\n", " x=\"x\",\n", " y=\"y2\",\n", " title=\"Chart 2\",\n", " height=200,\n", " width=300\n", " )\n", " gr.LinePlot(\n", " data,\n", " x=\"x\",\n", " y=\"y3\",\n", " title=\"Chart 3\",\n", " height=200,\n", " width=300\n", " )\n", " gr.LinePlot(\n", " data,\n", " x=\"x\",\n", " y=\"y4\",\n", " title=\"Chart 4\",\n", " height=200,\n", " width=300\n", " )\n", " \n", " with gr.Column(scale=1):\n", " gr.Markdown(\"### Vertical Layout (orientation='column')\")\n", " with gr.Draggable(orientation=\"column\"):\n", " gr.LinePlot(\n", " data,\n", " x=\"x\",\n", " y=\"y1\",\n", " title=\"Chart 1\",\n", " height=200,\n", " width=300\n", " )\n", " gr.LinePlot(\n", " data,\n", " x=\"x\",\n", " y=\"y2\",\n", " title=\"Chart 2\",\n", " height=200,\n", " width=300\n", " )\n", " gr.LinePlot(\n", " data,\n", " x=\"x\",\n", " y=\"y3\",\n", " title=\"Chart 3\",\n", " height=200,\n", " width=300\n", " )\n", " gr.LinePlot(\n", " data,\n", " x=\"x\",\n", " y=\"y4\",\n", " title=\"Chart 4\",\n", " height=200,\n", " width=300\n", " )\n", "\n", "if __name__ == \"__main__\":\n", " demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5}
 
1
+ {"cells": [{"cell_type": "markdown", "id": "302934307671667531413257853548643485645", "metadata": {}, "source": ["# Gradio Demo: draggable_dashboard"]}, {"cell_type": "code", "execution_count": null, "id": "272996653310673477252411125948039410165", "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": "288918539441861185822528903084949547379", "metadata": {}, "outputs": [], "source": ["import gradio as gr\n", "import numpy as np\n", "import pandas as pd\n", "\n", "with gr.Blocks() as demo:\n", " gr.Markdown(\"# Draggable Dashboard Demo\")\n", " gr.Markdown(\"Drag the charts around to reorder them!\")\n", " \n", " x = np.linspace(0, 10, 100)\n", " data = pd.DataFrame({\n", " 'x': x,\n", " 'y1': np.random.normal(100, 20, 100) + 10 * np.sin(x),\n", " 'y2': np.random.normal(500, 100, 100) + 50 * np.cos(x),\n", " 'y3': np.random.normal(1000, 200, 100) + 100 * np.sin(x/2),\n", " 'y4': np.random.normal(0.15, 0.05, 100) + 0.05 * np.cos(x/3)\n", " })\n", " \n", " with gr.Row():\n", " with gr.Column(scale=1):\n", " gr.Markdown(\"### Horizontal Layout (orientation='row')\")\n", " with gr.Draggable(orientation=\"row\"):\n", " gr.LinePlot(\n", " data,\n", " x=\"x\",\n", " y=\"y1\",\n", " title=\"Chart 1\",\n", " height=200,\n", " )\n", " gr.LinePlot(\n", " data,\n", " x=\"x\",\n", " y=\"y2\",\n", " title=\"Chart 2\",\n", " height=200,\n", " )\n", " gr.LinePlot(\n", " data,\n", " x=\"x\",\n", " y=\"y3\",\n", " title=\"Chart 3\",\n", " height=200,\n", " )\n", " gr.LinePlot(\n", " data,\n", " x=\"x\",\n", " y=\"y4\",\n", " title=\"Chart 4\",\n", " height=200,\n", " )\n", " \n", " with gr.Column(scale=1):\n", " gr.Markdown(\"### Vertical Layout (orientation='column')\")\n", " with gr.Draggable(orientation=\"column\"):\n", " gr.LinePlot(\n", " data,\n", " x=\"x\",\n", " y=\"y1\",\n", " title=\"Chart 1\",\n", " height=200,\n", " )\n", " gr.LinePlot(\n", " data,\n", " x=\"x\",\n", " y=\"y2\",\n", " title=\"Chart 2\",\n", " height=200,\n", " )\n", " gr.LinePlot(\n", " data,\n", " x=\"x\",\n", " y=\"y3\",\n", " title=\"Chart 3\",\n", " height=200,\n", " )\n", " gr.LinePlot(\n", " data,\n", " x=\"x\",\n", " y=\"y4\",\n", " title=\"Chart 4\",\n", " height=200,\n", " )\n", "\n", "if __name__ == \"__main__\":\n", " demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5}
run.py CHANGED
@@ -25,7 +25,6 @@ with gr.Blocks() as demo:
25
  y="y1",
26
  title="Chart 1",
27
  height=200,
28
- width=300
29
  )
30
  gr.LinePlot(
31
  data,
@@ -33,7 +32,6 @@ with gr.Blocks() as demo:
33
  y="y2",
34
  title="Chart 2",
35
  height=200,
36
- width=300
37
  )
38
  gr.LinePlot(
39
  data,
@@ -41,7 +39,6 @@ with gr.Blocks() as demo:
41
  y="y3",
42
  title="Chart 3",
43
  height=200,
44
- width=300
45
  )
46
  gr.LinePlot(
47
  data,
@@ -49,7 +46,6 @@ with gr.Blocks() as demo:
49
  y="y4",
50
  title="Chart 4",
51
  height=200,
52
- width=300
53
  )
54
 
55
  with gr.Column(scale=1):
@@ -61,7 +57,6 @@ with gr.Blocks() as demo:
61
  y="y1",
62
  title="Chart 1",
63
  height=200,
64
- width=300
65
  )
66
  gr.LinePlot(
67
  data,
@@ -69,7 +64,6 @@ with gr.Blocks() as demo:
69
  y="y2",
70
  title="Chart 2",
71
  height=200,
72
- width=300
73
  )
74
  gr.LinePlot(
75
  data,
@@ -77,7 +71,6 @@ with gr.Blocks() as demo:
77
  y="y3",
78
  title="Chart 3",
79
  height=200,
80
- width=300
81
  )
82
  gr.LinePlot(
83
  data,
@@ -85,7 +78,6 @@ with gr.Blocks() as demo:
85
  y="y4",
86
  title="Chart 4",
87
  height=200,
88
- width=300
89
  )
90
 
91
  if __name__ == "__main__":
 
25
  y="y1",
26
  title="Chart 1",
27
  height=200,
 
28
  )
29
  gr.LinePlot(
30
  data,
 
32
  y="y2",
33
  title="Chart 2",
34
  height=200,
 
35
  )
36
  gr.LinePlot(
37
  data,
 
39
  y="y3",
40
  title="Chart 3",
41
  height=200,
 
42
  )
43
  gr.LinePlot(
44
  data,
 
46
  y="y4",
47
  title="Chart 4",
48
  height=200,
 
49
  )
50
 
51
  with gr.Column(scale=1):
 
57
  y="y1",
58
  title="Chart 1",
59
  height=200,
 
60
  )
61
  gr.LinePlot(
62
  data,
 
64
  y="y2",
65
  title="Chart 2",
66
  height=200,
 
67
  )
68
  gr.LinePlot(
69
  data,
 
71
  y="y3",
72
  title="Chart 3",
73
  height=200,
 
74
  )
75
  gr.LinePlot(
76
  data,
 
78
  y="y4",
79
  title="Chart 4",
80
  height=200,
 
81
  )
82
 
83
  if __name__ == "__main__":