Group metrics dropdown by category in rankings and comparison views
Added optgroup elements to organize metrics into logical categories: - Expected Standard - Higher Standard - Progress Scores - Average Scores - Gender Performance - Equity (Disadvantaged) - School Context - 3-Year Trends Also added CSS styling for optgroup labels to match the design system. Note: School names in rankings are already clickable links to school details. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -92,6 +92,19 @@
|
|||||||
box-shadow: 0 0 0 3px rgba(224, 114, 86, 0.15);
|
box-shadow: 0 0 0 3px rgba(224, 114, 86, 0.15);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.metricSelect optgroup {
|
||||||
|
font-weight: 700;
|
||||||
|
color: var(--text-primary, #1a1612);
|
||||||
|
background: var(--bg-secondary, #f3ede4);
|
||||||
|
padding: 0.5rem 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.metricSelect option {
|
||||||
|
font-weight: 400;
|
||||||
|
color: var(--text-secondary, #5c564d);
|
||||||
|
padding: 0.375rem 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
/* Schools Section */
|
/* Schools Section */
|
||||||
.schoolsSection {
|
.schoolsSection {
|
||||||
margin-bottom: 2rem;
|
margin-bottom: 2rem;
|
||||||
|
|||||||
@@ -140,11 +140,46 @@ export function ComparisonView({
|
|||||||
onChange={(e) => handleMetricChange(e.target.value)}
|
onChange={(e) => handleMetricChange(e.target.value)}
|
||||||
className={styles.metricSelect}
|
className={styles.metricSelect}
|
||||||
>
|
>
|
||||||
{metrics.map((metric) => (
|
<optgroup label="Expected Standard">
|
||||||
<option key={metric.key} value={metric.key}>
|
{metrics.filter(m => m.category === 'expected').map((metric) => (
|
||||||
{metric.label}
|
<option key={metric.key} value={metric.key}>{metric.label}</option>
|
||||||
</option>
|
))}
|
||||||
))}
|
</optgroup>
|
||||||
|
<optgroup label="Higher Standard">
|
||||||
|
{metrics.filter(m => m.category === 'higher').map((metric) => (
|
||||||
|
<option key={metric.key} value={metric.key}>{metric.label}</option>
|
||||||
|
))}
|
||||||
|
</optgroup>
|
||||||
|
<optgroup label="Progress Scores">
|
||||||
|
{metrics.filter(m => m.category === 'progress').map((metric) => (
|
||||||
|
<option key={metric.key} value={metric.key}>{metric.label}</option>
|
||||||
|
))}
|
||||||
|
</optgroup>
|
||||||
|
<optgroup label="Average Scores">
|
||||||
|
{metrics.filter(m => m.category === 'average').map((metric) => (
|
||||||
|
<option key={metric.key} value={metric.key}>{metric.label}</option>
|
||||||
|
))}
|
||||||
|
</optgroup>
|
||||||
|
<optgroup label="Gender Performance">
|
||||||
|
{metrics.filter(m => m.category === 'gender').map((metric) => (
|
||||||
|
<option key={metric.key} value={metric.key}>{metric.label}</option>
|
||||||
|
))}
|
||||||
|
</optgroup>
|
||||||
|
<optgroup label="Equity (Disadvantaged)">
|
||||||
|
{metrics.filter(m => m.category === 'equity').map((metric) => (
|
||||||
|
<option key={metric.key} value={metric.key}>{metric.label}</option>
|
||||||
|
))}
|
||||||
|
</optgroup>
|
||||||
|
<optgroup label="School Context">
|
||||||
|
{metrics.filter(m => m.category === 'context').map((metric) => (
|
||||||
|
<option key={metric.key} value={metric.key}>{metric.label}</option>
|
||||||
|
))}
|
||||||
|
</optgroup>
|
||||||
|
<optgroup label="3-Year Trends">
|
||||||
|
{metrics.filter(m => m.category === 'trends').map((metric) => (
|
||||||
|
<option key={metric.key} value={metric.key}>{metric.label}</option>
|
||||||
|
))}
|
||||||
|
</optgroup>
|
||||||
</select>
|
</select>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|||||||
@@ -72,6 +72,19 @@
|
|||||||
box-shadow: 0 0 0 3px rgba(224, 114, 86, 0.15);
|
box-shadow: 0 0 0 3px rgba(224, 114, 86, 0.15);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.filterSelect optgroup {
|
||||||
|
font-weight: 700;
|
||||||
|
color: var(--text-primary, #1a1612);
|
||||||
|
background: var(--bg-secondary, #f3ede4);
|
||||||
|
padding: 0.5rem 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.filterSelect option {
|
||||||
|
font-weight: 400;
|
||||||
|
color: var(--text-secondary, #5c564d);
|
||||||
|
padding: 0.375rem 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
/* Rankings Section */
|
/* Rankings Section */
|
||||||
.rankingsSection {
|
.rankingsSection {
|
||||||
background: var(--bg-card, white);
|
background: var(--bg-card, white);
|
||||||
|
|||||||
@@ -98,11 +98,46 @@ export function RankingsView({
|
|||||||
onChange={(e) => handleMetricChange(e.target.value)}
|
onChange={(e) => handleMetricChange(e.target.value)}
|
||||||
className={styles.filterSelect}
|
className={styles.filterSelect}
|
||||||
>
|
>
|
||||||
{metrics.map((metric) => (
|
<optgroup label="Expected Standard">
|
||||||
<option key={metric.key} value={metric.key}>
|
{metrics.filter(m => m.category === 'expected').map((metric) => (
|
||||||
{metric.label}
|
<option key={metric.key} value={metric.key}>{metric.label}</option>
|
||||||
</option>
|
))}
|
||||||
))}
|
</optgroup>
|
||||||
|
<optgroup label="Higher Standard">
|
||||||
|
{metrics.filter(m => m.category === 'higher').map((metric) => (
|
||||||
|
<option key={metric.key} value={metric.key}>{metric.label}</option>
|
||||||
|
))}
|
||||||
|
</optgroup>
|
||||||
|
<optgroup label="Progress Scores">
|
||||||
|
{metrics.filter(m => m.category === 'progress').map((metric) => (
|
||||||
|
<option key={metric.key} value={metric.key}>{metric.label}</option>
|
||||||
|
))}
|
||||||
|
</optgroup>
|
||||||
|
<optgroup label="Average Scores">
|
||||||
|
{metrics.filter(m => m.category === 'average').map((metric) => (
|
||||||
|
<option key={metric.key} value={metric.key}>{metric.label}</option>
|
||||||
|
))}
|
||||||
|
</optgroup>
|
||||||
|
<optgroup label="Gender Performance">
|
||||||
|
{metrics.filter(m => m.category === 'gender').map((metric) => (
|
||||||
|
<option key={metric.key} value={metric.key}>{metric.label}</option>
|
||||||
|
))}
|
||||||
|
</optgroup>
|
||||||
|
<optgroup label="Equity (Disadvantaged)">
|
||||||
|
{metrics.filter(m => m.category === 'equity').map((metric) => (
|
||||||
|
<option key={metric.key} value={metric.key}>{metric.label}</option>
|
||||||
|
))}
|
||||||
|
</optgroup>
|
||||||
|
<optgroup label="School Context">
|
||||||
|
{metrics.filter(m => m.category === 'context').map((metric) => (
|
||||||
|
<option key={metric.key} value={metric.key}>{metric.label}</option>
|
||||||
|
))}
|
||||||
|
</optgroup>
|
||||||
|
<optgroup label="3-Year Trends">
|
||||||
|
{metrics.filter(m => m.category === 'trends').map((metric) => (
|
||||||
|
<option key={metric.key} value={metric.key}>{metric.label}</option>
|
||||||
|
))}
|
||||||
|
</optgroup>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user