Aggregate hover data for internal nodes in hierarchical plots
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 18.8k
- フォーク
- 2.8k
- 平均マージ
- 16時間 26分
- マージ済み PR(30日)
- 21
説明
Hierarchical plots constructed with px.treemap, px.icicle, and px.sunburst, aggregate data at internal nodes as follows:
values: sum of children,color:values-weighted sum of children ifdf[color]is numeric, else "discrete aggregation",hover_data: only supports "discrete aggregation",
where for "discrete aggregation", the value of an internal node is mapped to that of its children if all its children have the same value, otherwise the aggregated value is set to"(?)".
Below is an example of a treemap with 2 quantities in hover data, one of which is numeric and could be aggregated at internal nodes, but instead all non-leaf nodes get a "(?)":
df = px.data.gapminder().query("year == 2007")
df["quantity_to_aggregate"] = np.random.random(df.shape[0])
fig = px.treemap(
df,
path=[px.Constant("world"), "continent", "country"],
values="pop",
color="lifeExp",
hover_data=["iso_alpha", "quantity_to_aggregate"],
color_continuous_scale="RdBu",
color_continuous_midpoint=np.average(df["lifeExp"], weights=df["pop"]),
)
fig.update_layout(margin=dict(t=50, l=25, r=25, b=25))
fig.show()
Is it possible to aggregate numeric hover_data in hierarchical plots, perhaps as a sum initially, but potentially also giving the option to apply a different function?
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
px.treemap、px.icicle、px.sunburst について説明されている階層プロットの動作から始め、数値の hover_data を使用した提供済みの Gapminder の例を使います。内部ノードの hover_data が現在どのように集計されているか、また集計関数をどのように公開できるかを確認してください。数値の hover フィールドが内部ノードで集計され、離散フィールドは既存の動作を維持し、要求されたオプションがサポートされれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- data-visualization
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 25/100