Allow for as many segments as needed #1
Merged
vuillaut merged 11 commits intoEVERSE-ResearchSoftware:v5from Jun 26, 2025
vuillaut:v5
Merged
Allow for as many segments as needed #1vuillaut merged 11 commits intoEVERSE-ResearchSoftware:v5from vuillaut:v5
vuillaut merged 11 commits intoEVERSE-ResearchSoftware:v5from
vuillaut:v5
Conversation
change label positions
This allows for more flexibility when adding new segments and keep a nice looking dashboard
Dynamic number of segments without limits
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the radar component to support a dynamic number of segments, renders segment titles around the circle, and relocates segment details into a responsive grid layout.
- Added
midAnglemetadata and augment segment data in the build script - Introduced SVG-based segment labels via
renderSegmentLabels - Refactored CSS to use grid layout for labels and updated configuration for up to 18 segments
Reviewed Changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/lib/types.ts | Added optional midAngle property to Segment type |
| src/components/Tags/Tags.module.css | Adjusted margins for tag container |
| src/components/Radar/Radar.tsx | Inserted labels container below the chart |
| src/components/Radar/Radar.module.css | Expanded padding and defined .labels grid |
| src/components/Radar/Label.module.css | Removed absolute positioning for label elements |
| src/components/Radar/Chart.tsx | Implemented renderSegmentLabels to draw titles |
| scripts/buildData.ts | Extended segment limit, computed angles, and output |
| data/config.json | Populated a full list of up to 18 segments |
Comments suppressed due to low confidence (3)
src/components/Radar/Chart.tsx:172
- There are no unit tests covering
renderSegmentLabels; consider adding tests to verify correct angle calculations and SVG anchor assignments.
const renderSegmentLabels = () => {
src/lib/types.ts:47
- Add a brief comment explaining how
midAngleis used (e.g., for label positioning) to aid future maintainers.
midAngle?: number;
scripts/buildData.ts:23
- The
namefield duplicatestitleand isn’t used downstream; removing it would simplify the mapping.
name: s.title,
| // check segment length between 1 and 6 | ||
| if (!segments.length || segments.length > 6) { | ||
| // check segment length between 1 and 18 | ||
| if (!segments.length || segments.length > 18) { |
There was a problem hiding this comment.
Consider removing or making the hard-coded maximum (18) configurable so new segment counts don’t require code changes.
Author
|
Note to myself: the flags have disappeared,
EDIT: it disappeared from the official v5. I'll come back to it once it's fixed. |
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.
This PR allows as many segments as desired in the radar.
The number of segments in determined in the
config.json. Then the angles and display is automatically calculated to fit these segments in the radar.The segment descriptions have been moved to a regular grid below the radar. This allows for more flexibility in their number while keeping a nice-looking radar and avoiding display nightmares.
The segment titles have been added around the circle for clarity.
The demo here is tested with 18 segments:
Fixes #2