Skip to content

Commit 944866b

Browse files
RenzoMinelliclaude
andcommitted
feat: add interactive graph UI with prerequisite highlighting
Stimulus controller renders subject dependency graphs using Cytoscape.js with semester-grouped columns (desktop) or 2-column grid (mobile). Interactions: - Click a subject to highlight its prerequisite chain (amber) and dependents (violet), dimming unrelated nodes - Click again to navigate to the subject detail page - Hover (desktop) shows subtle border and connected edges - Click background to deselect - Tooltip with "Ver detalles" link appears on selection - Debounced resize handler rebuilds layout on breakpoint change Visual: - Three-state nodes: unavailable (gray), available (blue), completed (green) - Animated transitions on node/edge state changes - Semester headers that reposition on pan/zoom - Legend with state colors and highlight indicators Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 10a648e commit 944866b

5 files changed

Lines changed: 582 additions & 0 deletions

File tree

app/assets/tailwind/application.css

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,48 @@
77
}
88

99
@custom-variant with-error (.field_with_errors &);
10+
11+
/* Subject graph tooltip and headers */
12+
.graph-semester-header {
13+
position: absolute;
14+
pointer-events: none;
15+
font-weight: 600;
16+
white-space: nowrap;
17+
z-index: 10;
18+
}
19+
20+
.graph-tooltip {
21+
position: fixed;
22+
transform: translateX(-50%);
23+
z-index: 50;
24+
background: white;
25+
border: 1px solid #e2e8f0;
26+
border-radius: 0.5rem;
27+
padding: 0.5rem 0.75rem;
28+
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
29+
pointer-events: auto;
30+
display: flex;
31+
flex-direction: column;
32+
gap: 0.25rem;
33+
max-width: 220px;
34+
white-space: nowrap;
35+
}
36+
37+
.graph-tooltip-text {
38+
font-size: 0.75rem;
39+
font-weight: 500;
40+
color: #374151;
41+
overflow: hidden;
42+
text-overflow: ellipsis;
43+
}
44+
45+
.graph-tooltip-link {
46+
font-size: 0.75rem;
47+
color: var(--color-primary);
48+
text-decoration: none;
49+
font-weight: 500;
50+
}
51+
52+
.graph-tooltip-link:hover {
53+
text-decoration: underline;
54+
}

0 commit comments

Comments
 (0)