plotly / plotly/plotly.py

go.Table creates an unsightly and non-removable scroll bar when plotting on another figure.

オープン
#4,099 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

bug P3
主要言語
Python
スター
18.8k
フォーク
2.8k
平均マージ
16時間 26分
マージ済み PR(30日)
21

説明

When adding a small go.Table trace to a go.Figure object, the renderer creates a scrollbar which cannot be removed or hidden. This scrollbar is of low opacity, but is nonetheless noticable and ruins the professionalism of a graph upon which it is drawn. This is particularly apparent on dark backgrounds, and makes it impractical to place a go.Table in, for example, the upper left corner of a figure for displaying of additional information. Reproducible example and screenshot are provided.

import plotly.express as px
import plotly.graph_objects as go

# Load example dataset
df = px.data.iris()

# Create scatter plot
fig = px.scatter(df, x="sepal_width", y="sepal_length", color="species")

# Set plot background color
fig.update_layout(
    plot_bgcolor="rgb(40, 40, 40)",
    paper_bgcolor="rgb(40, 40, 40)",
)

# Create table trace
table_trace = go.Table(
    header=dict(
        values=["Species", "Sepal Width", "Sepal Length"],
        fill_color="rgba(0,0,0,0)",
        align="left",
    ),
    cells=dict(
        values=[
            df.species[:5],
            df.sepal_width[:5],
            df.sepal_length[:5],
        ],
        fill_color="rgba(0,0,0,0)",
        align="left",
    ),
)

# Add table trace to the top left third of the plot area
fig.add_trace(
    table_trace
)
fig.update_traces(
    selector=dict(type='table'),
    domain=dict(x=[0., 0.3], y=[0.8, 1])
)

# Show plot
fig.show()

Screenshot from 2023-03-13 19-43-19

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、plotly.py に用意されている Python の再現コードを実行し、別の figure 内に配置された go.Table trace を renderer がどのように処理するかを調べます。結果をスクリーンショットと比較し、そのうえで、テーブルが指定された domain を占有でき、目に見える不要なスクロールバーが表示されないことを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
data-visualization
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。