-
Notifications
You must be signed in to change notification settings - Fork 651
Expand file tree
/
Copy pathembed_demo.html
More file actions
122 lines (111 loc) · 3.62 KB
/
embed_demo.html
File metadata and controls
122 lines (111 loc) · 3.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Preswald Component Embedding Demo</title>
<style>
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
line-height: 1.6;
max-width: 800px;
margin: 0 auto;
padding: 20px;
}
h1 {
border-bottom: 2px solid #3498db;
padding-bottom: 10px;
color: #2c3e50;
}
.example-container {
margin: 20px 0;
padding: 20px;
border: 1px solid #ddd;
border-radius: 5px;
}
.component-container {
margin-top: 20px;
border: 1px solid #eee;
padding: 10px;
background-color: #f9f9f9;
}
code {
background-color: #f5f5f5;
padding: 2px 4px;
border-radius: 3px;
font-family: monospace;
}
pre {
background-color: #f5f5f5;
padding: 10px;
border-radius: 5px;
overflow-x: auto;
}
</style>
</head>
<body>
<h1>Preswald Component Embedding Demo</h1>
<p>This page demonstrates how to embed Preswald components in external web pages.</p>
<div class="example-container">
<h2>Embedding a Specific Component</h2>
<p>Below is an embedded card component with ID <code>embeddable_card</code>:</p>
<div class="component-container">
<!-- Replace the URL with your actual server URL -->
<iframe
src="http://localhost:8000/embed?component_id=embeddable_card"
width="100%"
height="200"
frameborder="0">
</iframe>
</div>
<p>HTML code:</p>
<pre><code><iframe
src="http://localhost:8000/embed?component_id=embeddable_card"
width="100%"
height="200"
frameborder="0">
</iframe></code></pre>
</div>
<div class="example-container">
<h2>Embedding a Plot Component</h2>
<p>Below is an embedded plot component with ID <code>sample_plot</code>:</p>
<div class="component-container">
<!-- Replace the URL with your actual server URL -->
<iframe
src="http://localhost:8000/embed?component_id=sample_plot"
width="100%"
height="350"
frameborder="0">
</iframe>
</div>
<p>HTML code:</p>
<pre><code><iframe
src="http://localhost:8000/embed?component_id=sample_plot"
width="100%"
height="350"
frameborder="0">
</iframe></code></pre>
</div>
<div class="example-container">
<h2>Embedding the Entire App</h2>
<p>You can also embed the entire application:</p>
<div class="component-container">
<!-- Replace the URL with your actual server URL -->
<iframe
src="http://localhost:8000/embed"
width="100%"
height="500"
frameborder="0">
</iframe>
</div>
<p>HTML code:</p>
<pre><code><iframe
src="http://localhost:8000/embed"
width="100%"
height="500"
frameborder="0">
</iframe></code></pre>
</div>
<p><strong>Note:</strong> Make sure the Preswald server is running with the <code>embed_example.py</code> script before viewing this page.</p>
</body>
</html>