plotly / plotly/react-plotly.js

Coordinates of a shape don't work

未關閉
#132 1 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

主要語言
JavaScript
星號
1.1k
分支
138
平均合併
3 天 2 小時
30 天內合併 PR
4

描述

Probably it is something very stupid, but it is driving me crazy. I hope someone can help me.
I have been trying using shapes following the instructions... whichever X0, Y0, X1, Y1, I set, the shapes don't change position.
Here following I put a very simple component showing the problem. I would expect an horizontal line at Y = 14, but this is not the case. Whichever are the values in X0, Y0, X1, Y1 and the xref/yref settings the the output is always the same as shown in the attached image
plotout
.

import React, { Component } from 'react';
import Plot from 'react-plotly.js';

class App extends Component {
render() {
const data = [{
x: [0,1,2,3,4,5,6,7,8],
y: [10,11,12,13,14,15,16,17,18],
type: 'scatter',
mode: 'lines+points',
marker: { color: 'blue'}
}];

  const layout = {
    width: 600,
    height: 300,
    showlegend: false,
    shapes: [
      {
        type: 'line',
        line: {
          color: 'red',
          width: 3,
          dash: 'dot',
        },
        X0: 0,
        Y0: 14,
        X1: 8,
        Y1: 14
      }
    ]
  };

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

}

export default App;

貢獻指南

這個儲存庫沒有索引到貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

從提供的 App 元件開始,檢查 layout.shapes 設定,尤其是線條所使用的座標屬性名稱。確認在座標欄位被識別時,該範例會在 Y = 14 處渲染一條水平紅線。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
javascript, react
領域
data-visualization, frontend
Issue 類型
缺陷
難度
1/5
預估耗時
1 小時以內
活躍度
停滯
描述清晰度
描述清楚
新手友好度
50/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。