plotly / plotly/react-plotly.js
How do I use Plotly.Fx.hover with react-plotly.js?
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- JavaScript
- Star
- 1.1k
- Fork
- 138
- Merge trung bình
- 3 ngày 2 giờ
- Pull request đã merge (30 ngày)
- 4
Mô tả
I am building something like this: https://plotly.com/javascript/hover-events/#coupled-hover-events, but I can't find a way to reproduce this behavior with react-plotly.js
Fx is not present in plotly.js anymore (isn't it?), and I can't find a way to find a Plotly's Plot instance (not the wrapper's instance) in order to try different methods.
Does anyone know how I could achieve a similar effect?
What I have so far looks something like:
import {FC, useEffect, useMemo, useRef} from "react";
import {BoxPlotData, Layout} from 'plotly.js'
import Plot from 'react-plotly.js';
export const MyPlot: FC = () => {
const boxplotRef = useRef<Plot>(null)
useEffect(() => {
if (boxplotRef.current) {
// What now?
// I would like to do something like
// boxplotRef.current.plot.hover([ { pointNumber: 1 }, { pointNumber: 2 }, { pointNumber: 3 } ])
}
}, []);
const myLayout = useMemo((): Layout => { ... }, [])
const myData = useMemo((): Partial<BoxPlotData> => { ... }, [])
return (
<Plot
ref={boxplotRef}
data={myData}
layout={myLayout}
/>
)
}
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu với ví dụ Plotly coupled-hover-events được liên kết và react-plotly.js ref được hiển thị trong issue. So sánh wrapper ref với hành vi Plotly.Fx.hover được yêu cầu; hoàn thành nghĩa là xác định được một cách được hỗ trợ để tái tạo tương tác hover liên kết bằng component được hiển thị.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- javascript, plotly, react, typescript
- Lĩnh vực
- data-visualization, frontend
- Loại issue
- Tính năng
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 25/100