Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/282.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将工具提示参数与python破折号滑块一起使用时出错_Python_Slider_Tooltip_Plotly Dash - Fatal编程技术网

将工具提示参数与python破折号滑块一起使用时出错

将工具提示参数与python破折号滑块一起使用时出错,python,slider,tooltip,plotly-dash,Python,Slider,Tooltip,Plotly Dash,在python中创建短划线滑块时,使用tooltip={'always_visible':True}参数时出错 该错误仅在移动滑块时出现 当我删除tooltip参数时,代码运行良好(但我没有得到所需的工具提示) #下面是一个再现错误的最小示例 导入破折号 将dash_html_组件导入为html 将仪表板核心组件作为dcc导入 app=dash.dash(_名称__) app.layout=html.Div([ 滑块( id='my-slider', 最小值=0, 最大值=20, 阶跃=0.5

在python中创建短划线滑块时,使用tooltip={'always_visible':True}参数时出错

该错误仅在移动滑块时出现

当我删除tooltip参数时,代码运行良好(但我没有得到所需的工具提示)


#下面是一个再现错误的最小示例
导入破折号
将dash_html_组件导入为html
将仪表板核心组件作为dcc导入
app=dash.dash(_名称__)
app.layout=html.Div([
滑块(
id='my-slider',
最小值=0,
最大值=20,
阶跃=0.5,
值=5,
工具提示={'always_visible':True}
),
html.Div(id='output-container-slider')
])
@app.callback(
dash.dependencies.Output('Output-container-slider','children'),
[dash.dependentials.Input('my-slider','value'))
def更新_输出(值):
返回“您已选择“{}”。格式(值)
如果uuuu name uuuuuu='\uuuuuuu main\uuuuuuu':
app.run_服务器(debug=True)
我希望工具提示在滑块移动时显示滑块的当前值,并且即使我将鼠标移开,工具提示也会保持不变

相反,我得到了以下错误:

Failed component prop type: Invalid component prop `tooltip` key `visible` supplied to Slider.
Bad object: {
  "visible": true
}
Valid keys: [
  "always_visible",
  "placement"
]

(This error originated from the built-in JavaScript code that runs Dash apps. Click to see the full stack trace or open your browser's console.)
Error: Failed component prop type: Invalid component prop `tooltip` key `visible` supplied to Slider.

Bad object: {
  "visible": true
}

Valid keys: [
  "always_visible",
  "placement"
]

    at propTypeErrorHandler (http://127.0.0.1:8050/_dash-component-suites/dash_renderer/dash_renderer.dev.js?v=1.0.1&m=1568039086:44125:11)

    at CheckedComponent (http://127.0.0.1:8050/_dash-component-suites/dash_renderer/dash_renderer.dev.js?v=1.0.1&m=1568039086:40498:9)

    at renderWithHooks (http://127.0.0.1:8050/_dash-component-suites/dash_renderer/react-dom@16.8.6.js?v=1.0.1&m=1568039086:13073:18)

    at mountIndeterminateComponent (http://127.0.0.1:8050/_dash-component-suites/dash_renderer/react-dom@16.8.6.js?v=1.0.1&m=1568039086:15155:13)

    at beginWork (http://127.0.0.1:8050/_dash-component-suites/dash_renderer/react-dom@16.8.6.js?v=1.0.1&m=1568039086:15760:16)

    at performUnitOfWork (http://127.0.0.1:8050/_dash-component-suites/dash_renderer/react-dom@16.8.6.js?v=1.0.1&m=1568039086:19447:12)

    at workLoop (http://127.0.0.1:8050/_dash-component-suites/dash_renderer/react-dom@16.8.6.js?v=1.0.1&m=1568039086:19487:24)

    at renderRoot (http://127.0.0.1:8050/_dash-component-suites/dash_renderer/react-dom@16.8.6.js?v=1.0.1&m=1568039086:19570:7)

    at performWorkOnRoot (http://127.0.0.1:8050/_dash-component-suites/dash_renderer/react-dom@16.8.6.js?v=1.0.1&m=1568039086:20477:7)

    at performWork (http://127.0.0.1:8050/_dash-component-suites/dash_renderer/react-dom@16.8.6.js?v=1.0.1&m=1568039086:20389:7)

谢谢你的帮助

原来这是软件包中的一个bug,后来被修复了:

或者,作为该版本的解决方案,可以使用以下方式启动应用程序:

dev_tools_props_check=False:

app.run_server(debug=True, dev_tools_props_check=False )

原来这是软件包中的一个bug,后来被修复了:

或者,作为该版本的解决方案,可以使用以下方式启动应用程序:

dev_tools_props_check=False:

app.run_server(debug=True, dev_tools_props_check=False )