plotly / plotly/plotly.js

Plots are initially displayed with a wrong margin in Chrome

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

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

bug P3
主要言語
JavaScript
スター
18.3k
フォーク
2k
平均マージ
2日 12時間
マージ済み PR(30日)
28

説明

I'm working on a web-app that should run in desktop and mobile. I've tested the app in Firefox and Chrome and noticed that the width (or right margin) of the plot is wrongly initialized.

The problem: The plot is too big when the page is initially loaded. After resizing the browser (responsive layout), the plot is updated and suddenly fits the screen properly.
I've added a restyle call to my script and that improves things a bit, but not completely.

  <div id="progress-plot"></div>
  <script>
    var graph = {{progress_plot | safe}};
    var config = {responsive: true, displayModeBar: false, showTips: true}
    Plotly.newPlot('progress-plot', graph.data, graph.layout, config);
    Plotly.restyle('progress-plot', graph.layout);
  </script>

The app is a Flask app (the snippet is from a jinja2 page) and I'm using Bootstrap for the front-end.

I've attached a file with the contents of graph.
graph.txt

Here are some screenshots:
image
After slightly resizing the page:
image

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

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

はじめの一歩

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

調査の方向性

まず、添付された graph.txt とレスポンシブな Bootstrap レイアウトを使用して、提示された Plotly.newPlot スニペットを Chrome で再現します。ブラウザーのリサイズの前後で初期サイズ設定の経路を調査します。リサイズや restyle を必要とせず、最初のレンダリングでプロットの幅と右マージンが正しくなれば完了です。

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

評価

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

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

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