Methods
clear() → {void}
Clear the graph and return to dropzone
Returns:
- Type
- void
collapseNode(node) → {void}
Collapse node and hide its children recursively
Parameters:
| Name | Type | Description |
|---|---|---|
node |
Object | Node to collapse |
Returns:
- Type
- void
createForceGraph(data, filename) → {void}
Create D3.js force-directed graph visualization
Parameters:
| Name | Type | Description |
|---|---|---|
data |
Object | Graph data with nodes and edges |
filename |
string | Name of the DOT file |
Returns:
- Type
- void
createLegend(svg) → {void}
Create legend showing node type colors
Parameters:
| Name | Type | Description |
|---|---|---|
svg |
Object | D3.js SVG selection |
Returns:
- Type
- void
dragEnded(event, d, simulation) → {void}
Handle drag end event for node
Parameters:
| Name | Type | Description |
|---|---|---|
event |
Object | D3 drag event |
d |
Object | Node data |
simulation |
Object | D3 simulation |
Returns:
- Type
- void
dragStarted(event, d, simulation) → {void}
Handle drag start event for node
Parameters:
| Name | Type | Description |
|---|---|---|
event |
Object | D3 drag event |
d |
Object | Node data |
simulation |
Object | D3 simulation |
Returns:
- Type
- void
dragged(event, d) → {void}
Handle drag event for node
Parameters:
| Name | Type | Description |
|---|---|---|
event |
Object | D3 drag event |
d |
Object | Node data |
Returns:
- Type
- void
expandNode(node) → {void}
Expand node to show its children
Parameters:
| Name | Type | Description |
|---|---|---|
node |
Object | Node to expand |
Returns:
- Type
- void
getNodeColor(node) → {Object}
Get node color based on type
Parameters:
| Name | Type | Description |
|---|---|---|
node |
Object | Node data |
Returns:
Color object with fill and stroke
- Type
- Object
(async) handleFile(file) → {Promise.<void>}
Handle dropped or selected file
Parameters:
| Name | Type | Description |
|---|---|---|
file |
File | DOT file |
Returns:
- Type
- Promise.<void>
hasUnexpandedChildren(node) → {boolean}
Check if node has children that haven't been expanded
Parameters:
| Name | Type | Description |
|---|---|---|
node |
Object | Node to check |
Returns:
True if node has unexpanded children
- Type
- boolean
initializeElements()
Initialize DOM elements
parseDotContent(dotContent) → {Object}
Parse DOT content into graph data
Parameters:
| Name | Type | Description |
|---|---|---|
dotContent |
string | DOT file content |
Returns:
Parsed graph data
- Type
- Object
parseLabel(label) → {Object}
Parse node label text
Parameters:
| Name | Type | Description |
|---|---|---|
label |
string | Label text to parse |
Returns:
Parsed label with title and fields
- Type
- Object
parseRecordLabel(label) → {Object}
Parse record-style label into structured fields
Parameters:
| Name | Type | Description |
|---|---|---|
label |
string | Record label text |
Returns:
Object with title and fields array
- Type
- Object
readFile(file) → {Promise.<string>}
Read file content
Parameters:
| Name | Type | Description |
|---|---|---|
file |
File | File to read |
Returns:
File content
- Type
- Promise.<string>
(async) renderGraph(dotContent, filename)
Render interactive graph using D3.js
Parameters:
| Name | Type | Description |
|---|---|---|
dotContent |
string | DOT file content |
filename |
string | File name |
resetZoom() → {void}
Reset zoom to default level
Returns:
- Type
- void
setupEventListeners()
Setup event listeners
showError(message) → {void}
Display error message to user
Parameters:
| Name | Type | Description |
|---|---|---|
message |
string | Error message to display |
Returns:
- Type
- void
showNodeMetadata(node) → {void}
Display node metadata in the info panel
Parameters:
| Name | Type | Description |
|---|---|---|
node |
Object | Node whose metadata to display |
Returns:
- Type
- void
toggleNodeExpansion(node) → {void}
Toggle node expansion state (expand/collapse children)
Parameters:
| Name | Type | Description |
|---|---|---|
node |
Object | Node to toggle |
Returns:
- Type
- void
updateGraph() → {void}
Update graph visualization with current visible nodes and edges
Returns:
- Type
- void
zoomIn() → {void}
Zoom in on the graph
Returns:
- Type
- void
zoomOut() → {void}
Zoom out on the graph
Returns:
- Type
- void