File size: 1,613 Bytes
71ee9a6
cf1cc65
 
 
 
fdce4cf
71ee9a6
cf1cc65
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fdce4cf
cf1cc65
 
 
 
 
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
import streamlit as st
import matplotlib.pyplot as plt
from PIL import Image, ImageDraw
import plotly.graph_objects as go
import numpy as np
import gradio as gr

# --- Wireframe Design ---
st.title("My Design Prototype")

# Create a simple wireframe design for a UI mockup
fig, ax = plt.subplots()

# Drawing a simple mockup of a webpage (a box representing a webpage layout)
rect = plt.Rectangle((0.1, 0.1), 0.8, 0.8, linewidth=2, edgecolor='blue', facecolor='lightblue')
ax.add_patch(rect)

# Add title and buttons as placeholders
plt.text(0.5, 0.9, "My Webpage", horizontalalignment='center', fontsize=12, weight='bold')

# Adding a button
plt.text(0.5, 0.5, "Submit", horizontalalignment='center', fontsize=10, weight='bold', color='white', bbox=dict(facecolor='blue', alpha=0.5))

# Adjust axis and show the design
plt.xlim(0, 1)
plt.ylim(0, 1)
plt.axis('off')  # Hide axes
st.pyplot(fig)

# --- Image Generation ---
img = Image.new('RGB', (300, 150), color = (255, 255, 255))
d = ImageDraw.Draw(img)

# Add text or simple design elements
d.text((10,10), "Design Prototype", fill=(0, 0, 0))

# Show image
st.image(img, caption="Prototype Image")

# --- Plotly Chart ---
fig_plotly = go.Figure(data=go.Scatter(x=[1, 2, 3], y=[4, 5, 6], mode='lines'))

fig_plotly.update_layout(title='Data Prototype',
                         xaxis_title='X Axis',
                         yaxis_title='Y Axis')

# Display Plotly chart
st.plotly_chart(fig_plotly)

# --- Gradio Interface ---
def greet(name):
    return f"Hello {name}!"

iface = gr.Interface(fn=greet, inputs="text", outputs="text")
iface.launch(inline=True)