Horizontal legend entrywidth does not adjust to font size on initial render

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

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
38/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
javascript, react

調査の方向性

コンポーネントの初期レンダリングパスと、例で説明されている凡例の水平方向のサイズ設定の挙動から始めます。orientation "h" と凡例フォント 24px でチャートを再現し、その後フォントサイズを変更した場合の結果と比較します。初期レンダリング時のエントリ幅が設定されたフォントと一致すれば完了です。

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

説明

When initially rendering the component, when set to orientation "h", the legend entries do not adjust their size correctly based on the font size set in the layout.

Example:

`
export const Test = (): ReactElement => {

  const data : Data[] =[
      {
          x: [1, 2, 3],
          y: [2, 6, 3],
          name: "my example scatter chart",
          type: 'scatter',
          mode: 'lines+markers',
          marker: {color: 'red'},
      },
      {type: 'bar', name:"my example bar chart", x: [1, 2, 3], y: [2, 5, 3]},
  ]

  const layout = {
      width: 1350,
      height: 950,
      hoverlabel: {
          bgcolor: "#555555",
          font: {
              family: "Open Sans",
              size: 14
          }
      },
      legend: {
          x: 0.25,
          y: -0.35,
          orientation: "h" as any,
          font: {
              family: 'Open Sans',
              size: 24,
              color: '#555555'
          },
          entrywidth:0,
      },
      xaxis: {
          showline: false,
          zeroline: false,
          title: {
              text: 'x',
              font: {
                  family: 'Open Sans',
                  size: 14,
                  color: '#555555'
              }
          },
      },
      yaxis: {
          showline: false,
          zeroline: false,
          title: {
              text: 'y',
              font: {
                  family: 'Open Sans',
                  size: 14,
                  color: '#555555'
              }
          }
      }
  }


  return (<Plot
      layout={layout}
      data={data}
  />)

}
`
image

If I adjust the font size property of the layout object after the initial render, it corrects itself.

image

Any guidance or help would be greatly appreciated.

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

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

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

はじめの一歩

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

plotly/react-plotly.js のほかの issue

plotly/react-plotly.js の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

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

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