threshold make - #24
Open
toki36 wants to merge 3 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enhances the radar chart component by adding a visual threshold indicator at the 0.5 level and replacing console.log debugging with a modal dialog for displaying disease information.
- Added a highlighted threshold line at 0.5 level on the radar chart with distinctive red coloring (#fcc7c7ff) and thicker stroke
- Implemented modal dialog to display disease tips when labels are pressed, replacing the previous console.log approach
- Introduced state management for modal visibility and selected disease information
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+167
to
+174
| {selectedDisease && ( | ||
| <Modal | ||
| open={isOpen} | ||
| onOpenChange={setIsOpen} | ||
| tipsTitle={selectedDisease.name} | ||
| tipsContent={selectedDisease.tips} | ||
| /> | ||
| )} |
There was a problem hiding this comment.
The conditional rendering could be improved for better state management. Currently, selectedDisease is not cleared when the modal closes, causing the Modal component to remain mounted (though not visible) after closing. Consider either:
- Clearing
selectedDiseasewhen the modal closes:
<Modal
open={isOpen}
onOpenChange={(open) => {
setIsOpen(open);
if (!open) setSelectedDisease(null);
}}
tipsTitle={selectedDisease.name}
tipsContent={selectedDisease.tips}
/>- Or simplify by conditionally rendering based on
isOpenalone:
{isOpen && selectedDisease && (
<Modal ... />
)}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
radar-chart.tsxにモーダルの追加、しきい値をレーダーチャート上に線として表示