plotly / plotly/plotly.js

make grid simplify subplots (mixed plots not working currently)

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

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

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

説明

Usecase:
User should be able to draw subplots with ease by using grid option.
User has 4 diff graphs and he wants to put them together, in grid by using following option without getting into much complexity

grid: {
    rows: 2,
    columns: 2,
    pattern: "independent"
  }
}

Ease of use:
It will be great to have similat functionality like provided in python plotly where user can define rows, columns, colspan and rowspan in data. Its plain and dead easy.

from plotly.subplots import make_subplots
import plotly.graph_objects as go

fig = make_subplots(
    rows=5, cols=2,
    specs=[[{}, {"rowspan": 2}],
           [{}, None],
           [{"rowspan": 2, "colspan": 2}, None],
           [None, None],
           [{}, {}]],
    print_grid=True)

Reference:
python plotly.subplots has given functionality with much ease of use. see HERE. Same is needed for js Please

Code Pen:
https://codepen.io/mafar/pen/YzZEdLR?editors=0010

JS CODE:

var trace1 = {
  type: "bar",
  y: [2, 3, 1]
};

var trace2 = {
  r: [2, 3, 1],
  theta: [0, 45, 90],
  type: "barpolar"
};

var trace3 = {
  type: "pie",
  values: [2, 3, 1]
};

var trace4 = {
  mode: "lines",
  type: "scatter3d",
  x: [2, 3, 1],
  y: [0, 0, 0],
  z: [0.5, 1, 2]
};

var data = [trace1, trace2, trace3, trace4];

var layout = {
  grid: {
    rows: 2,
    columns: 2,
    pattern: "independent"
  }
};

Plotly.newPlot("myDiv", data, layout);

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

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

はじめの一歩

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

調査の方向性

まず、Plotly.newPlot を使って bar、barpolar、pie、scatter3d の混在した例を再現し、リンク先の CodePen と比較します。既存のグリッドレイアウトの動作と Python Plotly のサブプロットリファレンスを読み、そのうえで rows、columns、独立した混在プロット、colspan、rowspan のサポートに何が必要かを定義します。手動でサブプロットを設定せずに例が動作すれば完了です。

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

評価

技術スタック
javascript
領域
data-visualization
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
25/100

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

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