-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add issue and pr related interaction #524
feat: add issue and pr related interaction #524
Conversation
Hi @andyhuang18, I think I have found the reason why the chart does not respond to click event, finally! Click events of However the points at the moment are set to |
Hi @tyn1998 ,Thanks for helping~ What a interesting difference between bar chart and line chart! Now that I am aware of this reason, I will continue working :) |
Enabling points will make the chart ugly in my view. Another way is to make the tooltip enterable and add code for interaction in the tooltip. However, it seems hard for users to enter the tooltip (they may try several times before succeeds entering it), like the video shows in below: 2022-11-17.13.38.03.movHi @frank-zsy, what do you think? Which way do you prefer, or just close the issue? |
Looks like it is hard for mouse to catch up the tooltip. |
Click tooltip is not a good idea. So there is no event trigger when clicking on the line without enabling the points? |
Yes. I think that is because a line does not represent a time point. |
That is so great! https://echarts.apache.org/zh/option.html#series-line.triggerLineEvent |
Hi @andyhuang18, could you push a commit to this branch so I can have a look into the codebase. |
Sure~ |
I can interact with the point of issue chart right now. |
The click event on line seems provide no detailed data, as you mentioned. However, the effect of your code is good. Though symbol is set, but with 2022-11-17.22.18.41.movYou can apply this method to another chart :) |
Copy that~ :) |
Now we can interact with both point and line~ Though my solution maybe is not the perfect one... |
@andyhuang18, you are sooooo smart! Nice workaround! The solution is very good while there is still room for functional improvments:
So the charts will be more flexible in interactions. As to the choice of filters, you may choose proper filters to replace the ones I mentioned above. |
…8/hypertrons-crx into feat/add_issue_pr_interaction # Conflicts: # src/views/RepoDetailIssueView/IssueChart.tsx # src/views/RepoDetailIssueView/RepoDetailIssueView.tsx
Great work, guys! Totally what I want. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job! @andyhuang18
Almost done, but with some suggestions here.
} | ||
}, []); | ||
|
||
return <div ref={divEL} style={{ width, height }}></div>; | ||
}; | ||
|
||
let issueclickparams: { data: number[]; marker: any; seriesName: any }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since only issueclickparams.data[0]
is read as ym, maybe we can use a variable called curMonth
to store the property and pass the string variable to onClick(curMonth, params) directly.
In my view this is more clear.
const tooltipFormatter = (params: any) => { | ||
issueclickparams = params[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this line will be curMonth = params[0].data[0];
Note: in JavaScript variables are conventionally named in lowerCamelCase.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you @andyhuang18!
/approve
Brief Information
This pull request is in the type of (more info about types):
Related issues (all available keywords):
Details
Checklist
Others