plotly / plotly/react-plotly.js
Range Slider - Slider handles gets overlapped by the plot lines.
還沒有人認領這個 Issue。
- 主要語言
- JavaScript
- 星號
- 1.1k
- 分支
- 138
- 平均合併
- 3 天 2 小時
- 30 天內合併 PR
- 4
描述
Overall this is a good library. This have been most useful to me and my team. Recently I found a bug where the range slider handles gets overlapped by the plot representation when a re-render has happened on a chart with multiple Y axis. This become a huge issue when the range slider is filled with multiple plot representations. Like 5 or more.
Code to reproduce.
const [chartData, setChartData] = useState<any[]>([]);
const [chartLayout, setChartLayout] = useState<any>({});
useEffect(() => {
setChartLayout({
...,
xaxis: {
rangeslider: {
autorange: true,
},
},
yaxis: { title: "One" },
yaxis2: {
title: "Two",
titlefont: { color: "rgb(148, 103, 189)" },
tickfont: { color: "rgb(148, 103, 189)" },
overlaying: "y",
side: "right",
},
});
}, []);
useEffect(() => {
setChartData([
{
x: [1, 2, 3],
y: [40, 50, 60],
name: "yaxis data",
type: "scatter",
},
]);
}, []);
const addSeries = () => {
const existingArr = [...chartData];
existingArr.push({
x: [2, 3, 4],
y: [4, 5, 6],
name: "yaxis2 data",
yaxis: "y2",
type: "scatter",
});
setChartData(existingArr);
};
return (
<Plot
data={chartData}
layout={chartLayout}
revision={revisionNumber}
/>
)
as above code describes its a pretty simple React component. This issue can only be reproduced to above scenario (or I only found this scenario). I have an initial data set for one plot in the state. Then I append another data set for another plot. So it should now draw two plots. It draws the two plots but as visible in the below video the range slider handles are getting overlapped. Also chart should have multiple Y axis.
I have tried to test this with having both plot data together for an initial render. Range slider works without the mentioned issue.
貢獻指南
這個儲存庫沒有索引到貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
從 React 元件的 Plot 進入點開始,重現所提供的步驟:算繪一個序列,追加第二個序列,使用多個 Y 軸,並啟用 xaxis.rangeslider。比較重新算繪前後 range-slider 控制柄的圖層順序;當存在多個繪圖表示時控制柄仍保持可見,即表示完成。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- javascript, plotly, react
- 領域
- data-visualization, frontend
- Issue 類型
- 缺陷
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100