This commit is contained in:
aiolishi 2024-03-13 09:03:58 +08:00
parent c9969f62fb
commit 115c18cd20
4 changed files with 83 additions and 2 deletions

61
fastapi_plotly/plotly-latest.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<title>Title</title>
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<script src="./plotly-latest.min.js"></script>
<style>
/* 设置html和body的高度和宽度为100%,并移除边距和填充 */
html, body {

View File

@ -0,0 +1,20 @@
from nicegui import ui
# 设置正确的用户名和密码,仅用于演示目的
CORRECT_USERNAME = 'user'
CORRECT_PASSWORD = 'password'
# 定义登录函数
def add():
# 检查用户名和密码是否正确
login_status.text = int(x.value)+int(y.value)
# 创建UI元素
ui.label('计算器')
x = ui.input(label='x:')
y = ui.input(label='y:') # 使用 type='password' 使密码输入不可见
ui.button('+', on_click=add)
login_status = ui.label('add()') # 初始提示文本
# 启动应用
ui.run()

View File

@ -14,7 +14,7 @@
import pandas as pd
#将数据集存入一个名为chipo的数据框内
chipo = pd.read_csv('data/chipotle.tsv',sep='\t')
chipo = pd.read_csv('./data/chipotle.tsv',sep='\t')
print(chipo.head(10))
#数据集中有多少个列(columns)