绘图 - 表直到列移动 / rerender之前,表不正确显示
我正在使用Plotly在简单的表中显示数据。我在下面的一些虚拟数据中填充了。
import plotly.graph_objects as go
data = [go.Table(
columnorder = [1,2],
header = dict(
values = ['<b>'+'TENOR'+'</b>'] + list(['a','b','c','d','e']),
line_color = 'darkslategray',
fill_color = 'royalblue',
align = 'center',
font = dict(color = 'white', size = 12),
height = 20
),
cells = dict(
values = [['row1','row2','row3'],[1,1,1],[2,2,2],[3,3,3],[4,4,4],[5,5,5]],
line_color = 'darkslategray',
fill = dict(color=['paleturquoise', 'white']),
align = ['right', 'center'],
font_size = 12,
height = 20)
)]
fig = go.Figure(data = data)
fig.show()
当我运行此操作时(Jupyter,但同样的结果也会在其他几个IDE中发生),最初显示为:
< img src =“ https://i.sstatic.net/jrtwf.png” alt =“在此处输入图像说明”>
然后,一旦我以任何方式移动列/操作,然后重新播放它,然后重新播放(正确,除了我移动的列)AS:
任何想法首先没有正确渲染它?我基本上是从的一个示例 ... ... ... ...
I am using Plotly to display data in a simple table. I've populated in some dummy data below.
import plotly.graph_objects as go
data = [go.Table(
columnorder = [1,2],
header = dict(
values = ['<b>'+'TENOR'+'</b>'] + list(['a','b','c','d','e']),
line_color = 'darkslategray',
fill_color = 'royalblue',
align = 'center',
font = dict(color = 'white', size = 12),
height = 20
),
cells = dict(
values = [['row1','row2','row3'],[1,1,1],[2,2,2],[3,3,3],[4,4,4],[5,5,5]],
line_color = 'darkslategray',
fill = dict(color=['paleturquoise', 'white']),
align = ['right', 'center'],
font_size = 12,
height = 20)
)]
fig = go.Figure(data = data)
fig.show()
When I run this (Jupyter, but same result happens in a couple other IDEs too) it initially displays as:
Then, as soon as I move a column / manipulate it in any way, it then redisplays (properly, except the column that I've moved) as:
Any idea why it's not rendering correctly in the first place? I basically took this right from one of their table examples...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
评论您的行
columnorder = [1,2,3,4,5],
。指定您只想显示这些列出的列。
或者,,将该行更改为
columnorder = [0,1,2,3,4,5],
。Comment out your line
columnorder = [1,2,3,4,5],
.Specifying that is saying you only want to show those listed columns.
Alternatively, change that line to
columnorder = [0,1,2,3,4,5],
.