Dash 世界中是否有任何東西可以為輸入日期時間/時間增量提供一個很好的界面(不管是什么型別,np、pd、dt 等)?我目前只能找到真正支持日期的代碼https://dash.plotly.com/dash-core-components/datepickersingle。我正在嘗試為實時傳感器資料創建一個繪圖工具,目前它以設定回溯的“流模式”運行,這只是每 2 秒更新一次影片圖并在螢屏上“滾動”。我還想查看歷史記錄,并能夠在呼叫資料庫時設定開始和結束日期時間。
uj5u.com熱心網友回復:
使用 html 輸入型別的最小示例
from dash import Dash, dcc
app = Dash(__name__)
app.layout = dcc.Input(type="datetime-local", step="1")
if __name__ == '__main__':
app.run_server()
這里step="1"給出秒,標準視圖似乎只給出分鐘(step="60"會給出分鐘,step="3600"小時,step="0.001"毫秒等)
注意:破折號https://dash.plotly.com/dash-core-components/input不正式支持此功能
ALLOWED_TYPES = (
"text", "number", "password", "email", "search",
"tel", "url", "range", "hidden",
)
這意味著要在除錯模式下運行,您需要關閉 dev_tools_props_check
app.run_server(debug=True, dev_tools_props_check=False)
主要問題似乎是瀏覽器支持 https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/datetime-local#handling_browser_support
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/412841.html
標籤:
上一篇:根據其他日期時間間隔對日期時間間隔進行分類并將值放在列上
下一篇:如何將字串時間轉換為日期時間
