plotly / plotly/react-plotly.js
Ability to add div element next to chart
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 would like to add a div element next to the bar chart I have implemented using react-plotly.js.
The div element would appear next to the chart when onClick event is fired on the chart. I haven't seen any such example or any documentation related to add external div element to the chart. Is it possible to link chart to the external div element ?
I did attempt to implement it by doing the following:
<Plot
data={this.prepData(timelineData)}
onClick={(data) => {
this.renderCustomPanel(data);
}
onHover={(hover) => this.getHoverInfo(hover)}
type={'bar'}
layout={layout}
style={{ width: '95%' }}
/>
renderCustomPanel(e) {
const panelInfo = timelineData.map(i => `<span className="panel-info">
<span className="tooltip-value" style='font-size:15px;display:block'>${i.duration} days <br> Start time: ${moment.unix(i.startTime).format('MMM-DD-YYYY h:mm:ss')} <br> End time:${moment.unix(i.endTime).format('MMM-DD-YYYY h:mm:ss')}</span></span>`);
return panelInfo;
}
The onClick function does call the function but doesn't display the div element. I did try applying css styles to the element but nothing works.
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
Issue chỉ xác định một component của react-plotly.js với các handler onClick và onHover; không có file nào trong repository hoặc test nào được nêu tên. Trước tiên, hãy xác định xem component có hỗ trợ các phần tử React bên ngoài hay không, sau đó kiểm tra tài liệu về xử lý sự kiện hoặc các entry point của nó. Công việc được xem là hoàn tất khi có một cách được tài liệu hóa hoặc triển khai rõ ràng để hiển thị phần tử được yêu cầu sau khi nhấp vào biểu đồ.
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, react
- Lĩnh vực
- data-visualization, frontend
- Loại issue
- Tính năng
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 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