Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
129 commits
Select commit Hold shift + click to select a range
5481e8f
initialized and transferred the code
ddroid Jul 12, 2025
a6e720e
changed structure for graph-explorer
ddroid Jul 13, 2025
980f9fc
fixed upscroll bug
ddroid Jul 13, 2025
179cdaf
fixed the 2hubs bug
ddroid Jul 15, 2025
f80d9fd
Added Static Position of list on expanding
ddroid Jul 15, 2025
5dc7c95
Added basic docs
ddroid Jul 15, 2025
bca5a53
fixed mistake
ddroid Jul 15, 2025
306f4e4
added reset to wand
ddroid Jul 18, 2025
e43f792
quick fixes according to feedback
ddroid Jul 18, 2025
896e4c6
added instance selection
ddroid Jul 18, 2025
eb9588b
drive runtime vars
ddroid Jul 18, 2025
9e6bb82
drive runtime vars part 2
ddroid Jul 22, 2025
dc974a9
multiple selection while holding ctrl
ddroid Jul 22, 2025
64f450d
added confirmed and uncofirmed instances
ddroid Jul 22, 2025
9a681c7
fixed scroll persistance and removed all of static entry code
ddroid Jul 24, 2025
7e5d0d4
static entry position while expanding or collapsing
ddroid Jul 24, 2025
de4a9f8
added commented sections
ddroid Jul 24, 2025
9e47479
reversed the onclicks for toggle hubs and subs
ddroid Jul 24, 2025
eaf7f4f
tweaked styles and bundled
ddroid Jul 24, 2025
50d538c
Delete instructions.md
ddroid Jul 24, 2025
247e800
tweaked box drawing logic and styles
ddroid Jul 26, 2025
901f900
moved prefix to CSS
ddroid Jul 26, 2025
7c903ce
fixed fast scroll issue
ddroid Jul 26, 2025
38ed6a8
bundled
ddroid Jul 26, 2025
4e67aae
added error throwing inside console for debugging
ddroid Jul 27, 2025
6c9e52d
object based prams
ddroid Jul 27, 2025
3592567
added static entry functionality when container not full
ddroid Jul 27, 2025
2470b53
upgraded the static entry logic
ddroid Jul 27, 2025
29aab86
bundled
ddroid Jul 27, 2025
577446e
added node_height in drive
ddroid Jul 28, 2025
2b5dd05
added logic to remove spacer when scrollup
ddroid Jul 28, 2025
51d1410
added more comments to sections and in involved stuff
ddroid Jul 28, 2025
038b26f
bundled
ddroid Jul 28, 2025
ae76c15
Added Search Feature
ddroid Jul 30, 2025
dffecec
Fixed the previous search effecting new view issue
ddroid Jul 30, 2025
4d07f05
Added new different variable for search states
ddroid Jul 30, 2025
7e40a5a
disable toggle expand nodes during search mode
ddroid Jul 30, 2025
61e33ef
bundled
ddroid Jul 30, 2025
d5d9603
Debug the event listners on first click
ddroid Jul 31, 2025
b19f37f
Add automatic switch between modes once an entry is selected
ddroid Jul 31, 2025
54fc97a
Fix prefix bugs
ddroid Jul 31, 2025
c628beb
Add Drive Persistance across search
ddroid Jul 31, 2025
36c5341
bundled
ddroid Jul 31, 2025
1494e04
formatting using prettier standard
ddroid Aug 15, 2025
0c074ac
simplyfied code according to feedback and replaced repeating code wit…
ddroid Aug 19, 2025
55c0e73
replaced more repeating code with functions and simplified some of th…
ddroid Aug 19, 2025
67692df
bold matching letters in search mode
ddroid Aug 19, 2025
6e727e2
changed color and moved bar under explorer
ddroid Aug 20, 2025
71cb990
bundled
ddroid Aug 20, 2025
bdc94c9
removed some of the anomlies
ddroid Aug 20, 2025
558ff96
fixed the spacer element bug
ddroid Aug 21, 2025
f4525a9
Added manipulation in search mode
ddroid Aug 23, 2025
d910986
Fixed Prefix bugs & Created pipe_calculate func
ddroid Aug 27, 2025
26a2340
split `calculate_prefix()` to improve performance and simplicity
ddroid Aug 27, 2025
e060bbe
Some more pipe related fixes
ddroid Aug 27, 2025
3889ee4
bundled
ddroid Aug 27, 2025
e2455ca
Fixed the pipes bug
ddroid Aug 28, 2025
f49ce07
Added Reset for Search mode & did some tweaks
ddroid Aug 29, 2025
0a3249c
Added Selection to search mode
ddroid Aug 29, 2025
2df0367
Added Multiselect
ddroid Aug 29, 2025
5299c7a
Add ui-tweaks for mobile devices
ddroid Aug 29, 2025
5f828b0
Added Standardx
ddroid Aug 29, 2025
f5a4576
Implemented `on[type](params)`
ddroid Aug 29, 2025
506f936
Jump to already opened hubs of entries
ddroid Aug 29, 2025
7dc1d74
bundled
ddroid Aug 29, 2025
c4716b1
Increase the expand subs trigger to include prefix and pipes before e…
ddroid Aug 31, 2025
0dae901
Add drive based bold styling
ddroid Aug 31, 2025
246dd36
move the searchbar to a new div above menubar
ddroid Aug 31, 2025
c2fa80c
Add ^ button to all the repeating entries and relocate position next …
ddroid Aug 31, 2025
21d206e
Added Cycling through entries with jump to already opened
ddroid Aug 31, 2025
cd3d2ed
Replace current implementation with container queries instead
ddroid Aug 31, 2025
1bf182c
Make the last clicked node look different
ddroid Aug 31, 2025
bfd0154
Add Select Between for bulk toggle selecting
ddroid Aug 31, 2025
35d313a
lint & bundled
ddroid Aug 31, 2025
73dbe0a
Fixed the mapping & admin errors
ddroid Sep 14, 2025
e73bd4d
Added color for matching entries and changed logic for appearance of …
ddroid Sep 14, 2025
d5295f9
change the position of ^ button to wand column
ddroid Sep 14, 2025
d37c2a0
disable prevent duplicate in search mode & bar styling
ddroid Sep 14, 2025
5f31823
Added flag for hubs
ddroid Sep 14, 2025
e41fb79
use {type, message} inside update_drive_state
ddroid Sep 14, 2025
4e687b1
bundled
ddroid Sep 14, 2025
c3a43ab
Removed `query` in js & !important in CSS
ddroid Sep 20, 2025
0e4335d
Move the Jump Button to next match on clicking
ddroid Sep 20, 2025
160334a
maintain the same vertical position on screen during jump
ddroid Sep 20, 2025
4d4333d
Finished the functionality for Last Clicked
ddroid Sep 20, 2025
c7459c9
Replace wand with jump button
ddroid Sep 20, 2025
ad1a3c6
First Instance of duplicates is intractive
ddroid Sep 20, 2025
5ebdefc
bundled
ddroid Sep 20, 2025
f1637b8
applied container queries
ddroid Sep 21, 2025
d1f4ef9
Replaced Anonymous Functions
ddroid Sep 21, 2025
e5c8412
Added true Intraction based order for duplicate_map
ddroid Sep 21, 2025
aaccad1
Add view_order_tracking to drive
ddroid Sep 21, 2025
6a8c1c7
bundled
ddroid Sep 21, 2025
e444892
Fixed Last-Clicked inside search mode
ddroid Sep 23, 2025
8f220cc
temp fix for prefix in search mode
ddroid Sep 23, 2025
60bdb4f
bundled
ddroid Sep 23, 2025
06a181c
Fixed multi-select in search mode
ddroid Sep 26, 2025
3a537fa
Fixed Select Between in search mode
ddroid Sep 26, 2025
f5655e6
Added contrast to last-clicked in search mode
ddroid Sep 26, 2025
4cfca78
Defined all the anonymous functions for foreach loops
ddroid Sep 26, 2025
6d482d6
bundled
ddroid Sep 26, 2025
9fcdcbe
Added flag to disable selected entries
ddroid Sep 27, 2025
8e294cb
Fixed toggle subs/hubs glitch when there is no query
ddroid Sep 27, 2025
4b4d84b
Added flag to either collapse entries subs & hubs on parent level or …
ddroid Sep 27, 2025
a808d8f
Added Duplicate detection inside search mode
ddroid Sep 27, 2025
51a0cab
bundled
ddroid Sep 27, 2025
e205d86
fixed the jump bug in search mode
ddroid Sep 28, 2025
2363441
Added all flags to menubar
ddroid Sep 28, 2025
f31b28a
Added Basic Keyboard Navigation for Graph Explorer
ddroid Sep 28, 2025
32b4f62
Bundled
ddroid Sep 28, 2025
2e55887
Updated according to feedback
ddroid Sep 29, 2025
5405c9a
Bundled
ddroid Sep 29, 2025
9029511
Added Base Protocol and Messages
ddroid Sep 30, 2025
f975200
Added Docs for Protocol
ddroid Sep 30, 2025
905c64a
Replaced all_entries with DB
ddroid Sep 30, 2025
a1e6ba2
Add Jump button to last clicked if duplicate
ddroid Sep 30, 2025
fc38ba5
Updated Docs
ddroid Sep 30, 2025
cd88159
Bundled
ddroid Sep 30, 2025
176ff3a
a mistake
ddroid Sep 30, 2025
5a76827
bundled
ddroid Sep 30, 2025
fa4b818
Added Undo Feature
ddroid Oct 11, 2025
e1d6378
small tweaks
ddroid Oct 11, 2025
e9ab987
bundled
ddroid Oct 20, 2025
c970abf
Added graphdb via protocol
ddroid Oct 28, 2025
1492433
Bundled
ddroid Oct 28, 2025
6226f83
Change message structure to standard
ddroid Oct 29, 2025
29131b9
upgrade datashell
serapath Nov 24, 2025
1120f7f
update bundle
serapath Nov 24, 2025
8c9c023
Merge pull request #1 from serapath/main
ddroid Nov 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/node_modules/*
/package-lock.json
/npm-debug.log
/package-lock.json
/.idea
285 changes: 285 additions & 0 deletions PROTOCOL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,285 @@
# Graph Explorer Protocol System

The `graph_explorer` module implements a bidirectional message-based communication protocol that allows parent modules to control the graph explorer and receive notifications after the requested message was processed.

## Usage

When initializing the graph explorer, pass a protocol function as the second parameter:

```javascript
const _ = {} // Store the send function to communicate with graph_explorer
const graph_explorer = require('./lib/graph_explorer.js')

const element = await graph_explorer(opts, protocol)

function protocol (send) {
// Store the send function to communicate with graph_explorer
_.graph_send = send

// Return a message handler function
return onmessage

function onmessage ({ type, data }) {
// Handle messages from graph_explorer
switch (type) {
case 'node_clicked':
console.log('Node clicked:', data.instance_path)
break
case 'selection_changed':
console.log('Selection changed:', data.selected)
break
// ... handle other message types
}
}
}
```

## Incoming Messages (Parent → Graph Explorer)

These messages can be sent to the graph explorer to control its behavior:

### `set_mode`
Change the current display mode.

**Data:**
- `mode` (String): One of `'default'`, `'menubar'`, or `'search'`

**Example:**
```javascript
graph_send({ type: 'set_mode', data: { mode: 'search' }})
```

### `set_search_query`
Set the search query (automatically switches to search mode if not already).

**Data:**
- `query` (String): The search query string

**Example:**
```javascript
graph_send({ type: 'set_search_query', data: { query: 'my search' }})
```

### `select_nodes`
Programmatically select specific nodes.

**Data:**
- `instance_paths` (Array<String>): Array of instance paths to select - More about Instance paths will be defined at the end of this file

**Example:**
```javascript
graph_send({ type: 'select_nodes', data: { instance_paths: ['|/', '|/src'] }})
```

### `expand_node`
Expand a specific node's children and/or hubs.

**Data:**
- `instance_path` (String): The instance path of the node to expand
- `expand_subs` (Boolean, optional): Whether to expand children (default: true)
- `expand_hubs` (Boolean, optional): Whether to expand hubs (default: false)

**Example:**
```javascript
graph_send({ type: 'expand_node', data: { instance_path: '|/', expand_subs: true, expand_hubs: true }})
```

### `collapse_node`
Collapse a specific node's children and hubs.

**Data:**
- `instance_path` (String): The instance path of the node to collapse

**Example:**
```javascript
graph_send({ type: 'collapse_node', data: { instance_path: '|/src' }})
```

### `toggle_node`
Toggle expansion state of a node.

**Data:**
- `instance_path` (String): The instance path of the node to toggle
- `toggle_type` (String, optional): Either `'subs'` or `'hubs'` (default: `'subs'`)

**Example:**
```javascript
graph_send({ type: 'toggle_node', data: { instance_path: '|/src', toggle_type: 'subs' }})
```

### `get_selected`
Request the current selection state.

**Data:** None (empty object)

**Response:** Triggers a `selected_nodes` message

**Example:**
```javascript
graph_send({ type: 'get_selected', data: {}})
```

### `get_confirmed`
Request the current confirmed selection state.

**Data:** None (empty object)

**Response:** Triggers a `confirmed_nodes` message

**Example:**
```javascript
graph_send({ type: 'get_confirmed', data: {}})
```

### `clear_selection`
Clear all selected and confirmed nodes.

**Data:** None (empty object)

**Example:**
```javascript
graph_send({ type: 'clear_selection', data: {}})
```

### `set_flag`
Set a configuration flag.

**Data:**
- `flag_type` (String): One of `'hubs'`, `'selection'`, or `'recursive_collapse'`
- `value` (String|Boolean): The flag value
- For `'hubs'`: `'default'`, `'true'`, or `'false'`
- For `'selection'`: Boolean
- For `'recursive_collapse'`: Boolean

**Example:**
```javascript
graph_send({ type: 'set_flag', data: { flag_type: 'hubs', value: 'true' }})
```

### `scroll_to_node`
Scroll to a specific node in the view.

**Data:**
- `instance_path` (String): The instance path of the node to scroll to

**Example:**
```javascript
graph_send({ type: 'scroll_to_node', data: { instance_path: '|/src/index.js' }})
```

## Outgoing Messages (Graph Explorer → Parent)

These messages are sent by the graph explorer to notify the parent module of events:

### `node_clicked`
Fired when a node is clicked.

**Data:**
- `instance_path` (String): The instance path of the clicked node

### `selection_changed`
Fired when the selection state changes.

**Data:**
- `selected` (Array<String>): Array of currently selected instance paths

### `subs_toggled`
Fired when a node's children are expanded or collapsed.

**Data:**
- `instance_path` (String): The instance path of the toggled node
- `expanded` (Boolean): Whether the children are now expanded

### `hubs_toggled`
Fired when a node's hubs are expanded or collapsed.

**Data:**
- `instance_path` (String): The instance path of the toggled node
- `expanded` (Boolean): Whether the hubs are now expanded

### `mode_toggling`
Fired when the mode is about to change.

**Data:**
- `from` (String): The current mode
- `to` (String): The target mode

### `mode_changed`
Fired when the mode has changed.

**Data:**
- `mode` (String): The new mode

### `search_query_changed`
Fired when the search query changes.

**Data:**
- `query` (String): The new search query

### `node_expanded`
Fired in response to an `expand_node` command.

**Data:**
- `instance_path` (String): The expanded node's instance path
- `expand_subs` (Boolean): Whether children were expanded
- `expand_hubs` (Boolean): Whether hubs were expanded

### `node_collapsed`
Fired in response to a `collapse_node` command.

**Data:**
- `instance_path` (String): The collapsed node's instance path

### `node_toggled`
Fired in response to a `toggle_node` command.

**Data:**
- `instance_path` (String): The toggled node's instance path
- `toggle_type` (String): Either `'subs'` or `'hubs'`

### `selected_nodes`
Fired in response to a `get_selected` command.

**Data:**
- `selected` (Array<String>): Array of currently selected instance paths

### `confirmed_nodes`
Fired in response to a `get_confirmed` command.

**Data:**
- `confirmed` (Array<String>): Array of currently confirmed instance paths

### `selection_cleared`
Fired in response to a `clear_selection` command.

**Data:** Empty object

### `flag_changed`
Fired in response to a `set_flag` command.

**Data:**
- `flag_type` (String): The flag that was changed
- `value` (String|Boolean): The new flag value

### `scrolled_to_node`
Fired in response to a `scroll_to_node` command.

**Data:**
- `instance_path` (String): The node that was scrolled to
- `scroll_position` (Number): The scroll position in pixels

## Instance Paths

Instance paths uniquely identify a node in the graph, including its position in the hierarchy. They follow the format:

```
|/path/to/node
```

For example:
- Root: `|/`
- First-level child: `|/src`
- Nested child: `|/src|/src/index.js`

The pipe character (`|`) separates hierarchy levels, allowing the same base path to appear multiple times in different contexts (e.g., when a node is referenced as both a child and a hub).

Loading