0

我正在创建一个圆形的假设工具,我想沿着 y 轴向上或向下移动它。我读到了关于移动卡片的 dracula.css,我应该实现相同的概念还是有其他方法可以做到这一点?

实际要求有散点图和移动数据点。因为我无法编辑散点图数据点,所以我创建了一个圆形图形并使图形可编辑。现在我想限制在图形周围移动的圆圈并且只在 y 轴上移动。

Dash 有没有可能。如果有人可以分享我可以用我的场景实现的任何示例。

import dash
import dash_core_components as dcc
import dash_html_components as html
import dash_bootstrap_components as dbc

import plotly.graph_objects as go

import plotly.graph_objects as go # or plotly.express as px
fig = go.Figure()

 
# Set axes properties
fig.update_xaxes(range=[0, 4.5], zeroline=False)
fig.update_yaxes(range=[0, 4.5])

# Add circles
fig.add_shape(type= 'circle',
    xref= 'x',
    yref= 'y',
    xsizemode= 'pixel',
    ysizemode= 'pixel',
    xanchor= '3',
    yanchor= '0',
    x0= 3,
    x1= 25,
    y0= 0,
    y1= 25,
    line_color="LightSeaGreen",
    
)

fig.update_layout(width=800, height=800)
#fig.update_yaxes(visible=False)

app = dash.Dash()
app.layout = html.Div([
    dcc.Graph(figure=fig,config={'editable': True,'edits': {
                                                    'shapePosition': True
                                                        } 
              })
])

if __name__ == "__main__":
   app.run_server( port = 8052, debug=True)

谢谢, 米拉斯

4

0 回答 0