plotly / plotly/react-plotly.js

`useResizeHandler` does not respond to container layout changes

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

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

enhancement P3 size: 1
主要言語
JavaScript
スター
1.1k
フォーク
138
平均マージ
3日 2時間
マージ済み PR(30日)
4

説明

Currently, useResizeHandler only responds to window.resize events.

This works when the browser viewport changes, but it does not cover layout changes that resize the plot without resizing the window.

For example, if a page contains a collapsible sidebar and a responsive plot in the same page, toggling the sidebar changes the space available to the plot, but no window.resize event is fired. The plot therefore keeps its previous size until Plotly.Plots.resize() is called manually.

Would it make sense for useResizeHandler to react to changes in the rendered plot element's size instead of only listening to window.resize?

One possible approach would be to use ResizeObserver when available, while keeping the existing window.resize listener as a fallback.

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

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

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

調査の方向性

useResizeHandler の実装から始め、現在どのように window.resize を購読しているかを追跡してください。リサイズ処理に関する既存のテストを確認し、そのうえで、レンダリングされた plot 要素への変更によってリサイズが発生することを検証してください。同時に、window.resize のフォールバックが引き続き機能することも確認してください。collapsible-layout の変更によって、Plotly.Plots.resize() を手動で呼び出さなくても plot のサイズが変更されれば完了です。

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

評価

技術スタック
javascript, react
領域
data-visualization, frontend
issue の種類
機能追加
難易度
3/5
見積もり時間
1〜2日
活発さ
活発
明瞭さ
おおむね明確
初心者へのやさしさ
65/100

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

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