plotly / plotly/react-plotly.js

[TypeScript] Missing property in `Partial<PlotData>`

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

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

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

説明

Hi, thanks very much for this handy component!

I tried to look at all examples and API docs available but can't figure out how to make use of connector among other properties (e.g. measure) for a Waterfall chart. I wonder whether there is a generic way to pass those parameters or it's just not possible at the moment?

This is the code I have:

<Plot
  data={[
    {
      type: 'waterfall', 
      x: ['Name 1', 'Name 2'], 
      y: [15, 20],
      connector: {line: {color: 'red'}} // Cause error: Object literal may only specify known properties, and 'connector' does not exist in type 'Partial<PlotData>'
    },
  ]}
  layout={{
    width: 300 
    height: 150
  }}
/>

The root of the problem seems that only limited number of properties are implemented on Partial<PlotData> - including for instance (as shown in example) the marker: {color: 'red'} property - which is NOT relevant to a waterfall chart at all.

Actually, due to my limited knowledge with React/TypeScript, I don't even know how to look at the definition of PlotData (it looks not available on this repo?) in order to inspect what properties are actually implemented there - would be helpful if anyone can provide some pointers.

This might be related to this: https://github.com/plotly/react-plotly.js/issues/247

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

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

はじめの一歩

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

調査の方向性

まず、Plot component とその data prop に使用されている Partial の定義を見つけます。この issue では、リポジトリのファイルもテストも指定されていません。宣言されている waterfall プロパティを、Plotly の例と API ドキュメントで説明されている connector および measure プロパティと比較します。これらのプロパティを使用する有効な waterfall データが、報告されたエラーなしで型チェックを通過すれば完了です。

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

評価

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

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

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