Skip to content

Commit ccab51b

Browse files
committed
doc: align colour scheme information
1 parent 03f5053 commit ccab51b

File tree

5 files changed

+20
-20
lines changed

5 files changed

+20
-20
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ A YASGUI plugin for visualizing SPARQL CONSTRUCT query results as interactive gr
99

1010
- **🔷 Interactive Graph Visualization**: Automatic force-directed layout with smooth physics-based positioning
1111
- **🎨 Smart Color Coding**:
12-
- 🔵 Blue = URIs
13-
- 🟢 Green = rdf:type objects (classes)
14-
- 🔘 Grey = Literals
15-
- 🟡 Yellow = Blank nodes
12+
- 🔵 Light Blue (#97C2FC) = URIs
13+
- 🟢 Light Green (#a6c8a6ff) = rdf:type objects (classes)
14+
- ⚪ Light Grey (#c5c5c5ff) = Literals
15+
- 🟠 Orange (#e15b13ff) = Blank nodes
1616
- **🔍 Navigation**: Mouse wheel zoom, drag to pan, "Zoom to Fit" button
1717
- **✋ Drag & Drop**: Reorganize nodes by dragging them to new positions
1818
- **💬 Tooltips**: Hover for full URI/literal details (300ms delay)
@@ -99,10 +99,10 @@ After running the query, click the **"Graph"** tab to see the visualization.
9999

100100
| Color | Meaning | Example |
101101
|-------|---------|---------|
102-
| 🔵 Blue | URI nodes | `ex:Person`, `ex:Alice` |
103-
| 🟢 Green | rdf:type objects (classes) | `ex:Person` in `ex:Alice rdf:type ex:Person` |
104-
| 🔘 Grey | Literal values | `"Alice"`, `"30"^^xsd:integer` |
105-
| 🟡 Yellow | Blank nodes | `_:b1`, `_:addr1` |
102+
| 🔵 Light Blue (#97C2FC) | URI nodes | `ex:Person`, `ex:Alice` |
103+
| 🟢 Light Green (#a6c8a6ff) | rdf:type objects (classes) | `ex:Person` in `ex:Alice rdf:type ex:Person` |
104+
| ⚪ Light Grey (#c5c5c5ff) | Literal values | `"Alice"`, `"30"^^xsd:integer` |
105+
| 🟠 Orange (#e15b13ff) | Blank nodes | `_:b1`, `_:addr1` |
106106

107107
## ⚙️ Configuration
108108

specs/001-construct-graph-viz/data-model.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Represents a unique subject or object from RDF triples in the visualization.
1414
- `id` (Number): Unique numeric identifier for vis-network (auto-incremented)
1515
- `uri` (String | null): Full URI for URI nodes, null for literals
1616
- `label` (String): Display text (prefixed URI or literal value, truncated if needed)
17-
- `color` (String): Hex color code - `#808080` (grey, literals), `#00FF00` (green, rdf:type objects), `#0000FF` (blue, other URIs)
17+
- `color` (String): Hex color code - `#c5c5c5ff` (light grey, literals), `#a6c8a6ff` (light green, rdf:type objects), `#97C2FC` (light blue, other URIs), `#e15b13ff` (orange, blank nodes)
1818
- `type` (Enum): `'uri'` or `'literal'`
1919
- `fullValue` (String): Un-truncated value for tooltip display
2020

@@ -33,7 +33,7 @@ Represents a unique subject or object from RDF triples in the visualization.
3333
id: 1,
3434
uri: 'http://example.org/Person',
3535
label: 'ex:Person',
36-
color: '#00FF00', // Green if object of rdf:type
36+
color: '#a6c8a6ff', // Light green if object of rdf:type
3737
type: 'uri',
3838
fullValue: 'http://example.org/Person'
3939
}
@@ -42,7 +42,7 @@ Represents a unique subject or object from RDF triples in the visualization.
4242
id: 2,
4343
uri: null,
4444
label: 'John',
45-
color: '#808080', // Grey for literals
45+
color: '#c5c5c5ff', // Light grey for literals
4646
type: 'literal',
4747
fullValue: '"John"^^xsd:string'
4848
}

specs/001-construct-graph-viz/research.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ function triplesToGraph(triples, prefixes) {
240240
241241
### 4. Color Coding Logic
242242
243-
**Question**: How to implement the color scheme (grey for literals, green for rdf:type objects, blue for other URIs)?
243+
**Question**: How to implement the color scheme (light grey for literals, light green for rdf:type objects, light blue for other URIs, orange for blank nodes)?
244244
245245
**Implementation**:
246246
```javascript
@@ -272,7 +272,7 @@ nodes: {
272272
}
273273
```
274274
275-
**Decision**: Calculate color during node creation, pass to vis-network node data. Use hex codes: `#808080` (grey), `#00FF00` (green), `#0000FF` (blue).
275+
**Decision**: Calculate color during node creation, pass to vis-network node data. Use hex codes: `#c5c5c5ff` (light grey), `#a6c8a6ff` (light green), `#97C2FC` (light blue), `#e15b13ff` (orange).
276276
277277
### 5. Prefix Handling
278278

specs/001-construct-graph-viz/spec.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
- Q: What visual styling should be used for graph nodes to distinguish between different node types and content lengths? → A: All nodes use uniform shape (circle/ellipse) with fixed size, regardless of label length or type
1313
- Q: How should tooltips be triggered and displayed to balance information access with usability? → A: Hover only with 300ms delay before showing, auto-hide on mouse leave
14-
- Q: How should the plugin handle blank nodes (anonymous RDF nodes with no URI) that appear in CONSTRUCT results? → A: Display with generated label but use unique color (e.g., yellow) to distinguish from literals
14+
- Q: How should the plugin handle blank nodes (anonymous RDF nodes with no URI) that appear in CONSTRUCT results? → A: Display with generated label but use unique orange color (#e15b13ff) to distinguish from literals
1515
- Q: When the same subject and object are connected by multiple different predicates, how should these be displayed? → A: Draw separate parallel edges for each predicate (may overlap/curve to show multiple)
1616

1717
## User Scenarios & Testing *(mandatory)*
@@ -92,7 +92,7 @@ While exploring the graph, the user wants to see detailed information about node
9292
- **Very long literals**: How are literals with thousands of characters displayed? → Truncate label to ~50 characters, full value in tooltip
9393
- **Duplicate triples**: What happens when identical triples appear multiple times? → Display as single edge (no duplicate edges between same nodes with same predicate)
9494
- **Multiple predicates between same nodes**: What happens when `<A> <p1> <B>` and `<A> <p2> <B>` exist? → Draw separate parallel edges for each predicate (edges may curve/offset to avoid complete overlap)
95-
- **Blank nodes**: How are anonymous RDF nodes (e.g., `_:b1`) displayed? → Show with generated label ("_:b1") in unique yellow color to distinguish from literals and URIs
95+
- **Blank nodes**: How are anonymous RDF nodes (e.g., `_:b1`) displayed? → Show with generated label ("_:b1") in unique orange color (#e15b13ff) to distinguish from literals and URIs
9696
- **Self-referencing triples**: What happens when subject equals object (e.g., `<A> <related> <A>`)? → Display as loop edge from node to itself
9797
- **No prefixes defined**: What happens when SPARQL results don't include prefix definitions? → Only show the part of the URI after last `/` or `#` as label
9898
- **Large graphs (1000+ triples)**: How does the plugin handle performance with many nodes? → Initial layout completes within 2 seconds; warn user if exceeds rendering capacity
@@ -116,7 +116,7 @@ While exploring the graph, the user wants to see detailed information about node
116116

117117
- **FR-007**: Plugin MUST render graph using a force-directed or hierarchical layout algorithm that automatically spaces nodes to minimize edge crossings and overlaps
118118
- **FR-008**: Plugin MUST complete initial graph layout within 2 seconds for graphs up to 1,000 nodes (performance target per constitution)
119-
- **FR-009**: Plugin MUST apply color coding to nodes: grey (#808080) for literals, yellow (#FFFF00) for blank nodes, green (#00FF00) for nodes that are objects of `rdf:type` predicate, blue (#0000FF) for all other URI nodes
119+
- **FR-009**: Plugin MUST apply color coding to nodes: light grey (#c5c5c5ff) for literals, orange (#e15b13ff) for blank nodes, light green (#a6c8a6ff) for nodes that are objects of `rdf:type` predicate, light blue (#97C2FC) for all other URI nodes
120120
- **FR-010**: Plugin MUST label URI nodes with prefixed form (e.g., `ex:Person` instead of `http://example.org/Person`)
121121
- **FR-010a**: Plugin MUST label blank nodes with their generated identifier (e.g., `_:b1`, `_:b2`)
122122
- **FR-011**: Plugin MUST label literal nodes with the literal value only, excluding datatype suffix (e.g., `"John"` not `"John"^^xsd:string`)
@@ -150,7 +150,7 @@ While exploring the graph, the user wants to see detailed information about node
150150

151151
- **FR-028**: Plugin MUST display empty state message when CONSTRUCT query returns zero triples
152152
- **FR-029**: Plugin MUST handle self-referencing triples (subject equals object) by rendering loop edges
153-
- **FR-030**: Plugin MUST handle blank nodes by creating nodes with generated labels and yellow color
153+
- **FR-030**: Plugin MUST handle blank nodes by creating nodes with generated labels and orange color (#e15b13ff)
154154
- **FR-031**: Plugin MUST render multiple predicates between the same node pair as separate parallel edges with curved/offset paths
155155
- **FR-032**: Plugin MUST truncate very long URI labels with ellipsis while preserving full URI in tooltips
156156
- **FR-033**: Plugin MUST truncate literal labels exceeding ~50 characters while preserving full value in tooltips
@@ -159,7 +159,7 @@ While exploring the graph, the user wants to see detailed information about node
159159
### Key Entities
160160

161161
- **GraphNode**: Represents either a subject or object from RDF triples
162-
- Attributes: URI or literal value or blank node identifier, node type (URI/literal/blank), color (grey/yellow/green/blue), shape (uniform circle/ellipse), size (fixed), position (x, y coordinates), label (abbreviated form)
162+
- Attributes: URI or literal value or blank node identifier, node type (URI/literal/blank), color (light grey/orange/light green/light blue), shape (uniform circle/ellipse), size (fixed), position (x, y coordinates), label (abbreviated form)
163163
- Relationships: Connected to other nodes via edges (may have multiple edges with different predicates to same target)
164164

165165
- **GraphEdge**: Represents a predicate connecting two nodes
@@ -179,7 +179,7 @@ While exploring the graph, the user wants to see detailed information about node
179179
### Measurable Outcomes
180180

181181
- **SC-001**: Users can visualize CONSTRUCT query results as graphs within 2 seconds of receiving results (for graphs up to 1,000 nodes)
182-
- **SC-002**: Users can identify node types (literal vs. blank node vs. URI vs. type instance) through color coding without reading labels (grey/yellow/blue/green)
182+
- **SC-002**: Users can identify node types (literal vs. blank node vs. URI vs. type instance) through color coding without reading labels (light grey/orange/light blue/light green)
183183
- **SC-003**: Users can navigate graphs of any size by zooming and panning without performance degradation
184184
- **SC-004**: Users can reorganize graph layouts manually to improve understanding of relationships
185185
- **SC-005**: Users can access full URI details for any node or edge via hover tooltips

specs/001-construct-graph-viz/tasks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
- [X] T020 [US1] Implement GraphPlugin.draw() method: clear this.yasr.resultsEl, parse triples via parseConstructResults(), extract prefixes via extractPrefixes(), transform via triplesToGraph()
6363
- [X] T021 [US1] In GraphPlugin.draw(), create container div with 100% width/height, append to this.yasr.resultsEl
6464
- [X] T022 [US1] In GraphPlugin.draw(), create vis.DataSet for nodes and edges, instantiate vis.Network with container, data, and options from getDefaultNetworkOptions()
65-
- [X] T023 [US1] In GraphPlugin.draw(), handle stabilizationIterationsDone event to disable physics after layout completes (performance optimization per constitution)
65+
- [X] T023 [US1] In GraphPlugin.draw(), handle stabilizationIterationsDone event to keep physics enabled after layout completes (can be disabled later if user feedback indicates performance issues)
6666
- [X] T024 [US1] In GraphPlugin.draw(), add error handling to display empty state message if zero triples, or error message if parsing fails
6767
- [X] T025 [US1] Handle blank nodes in createNodeMap(): detect _:b* identifiers, assign yellow color #FFFF00, generate label "_:b1" etc.
6868
- [X] T026 [US1] Handle multiple predicates between same nodes in createEdgesArray(): create separate edge for each predicate, vis-network will curve them automatically

0 commit comments

Comments
 (0)