Graph Filtering
Filter your relationship graph to show only nodes that match specific criteria. This helps you focus on relevant parts of your knowledge network by hiding nodes that don't match your filter expressions.
How Filtering Works
Filtering uses JavaScript expressions to evaluate each node's frontmatter. Only nodes where ALL expressions return true are shown.
Filter Logic
- Evaluate all expressions for each node
- AND logic - All expressions must be true
- Show matching nodes and their edges
- Hide non-matching nodes
- Source node always shown (never filtered out)
The source node (file you're currently viewing) is always visible, even if it doesn't match filters. This ensures context is never lost.
Using the Filter Bar
Showing the Filter Bar
Three ways to show/hide the filter bar:
- Command: "Toggle Graph Filter (Expression Input)"
- Default visible: Enable in settings
- Command: "Toggle Graph Filter (Preset Selector)" (shows presets dropdown)
Expression Input
The filter input accepts multiple expressions, one per line:
status === 'active'
type === 'project'
Both expressions must be true for a node to be shown.
Applying Filters
Filters are applied automatically when you:
- Blur the input (click outside)
- Press
Ctrl/Cmd+Enter
Clearing Filters
To clear all filters:
- Delete all text from the filter input
- Press
Ctrl/Cmd+Enteror click outside - All nodes are shown again
Filter Expressions
Accessing Properties
Inside expressions, access frontmatter properties directly by name:
// If frontmatter is:
// ---
// status: active
// priority: high
// tags: [project, work]
// ---
// You can write:
status === 'active'
priority === 'high'
tags.includes('project')
Expression Syntax
Equality:
status === 'active'
type === 'project'
priority !== 'low'
Comparison:
progress > 50
count <= 10
age >= 18
Logical AND:
status === 'active' && priority === 'high'
Logical OR (within one expression):
status === 'active' || status === 'pending'
Array checks:
Array.isArray(tags) && tags.includes('important')
Array.isArray(tags) && tags.length > 0
String methods:
title.includes('Project')
title.startsWith('DRAFT')
title.toLowerCase() === 'important'
Property existence:
typeof status !== 'undefined'
status !== null
Example Filters
Show Active Items
status === 'active'
Result: Only nodes with status: active
Show High Priority Projects
type === 'project'
priority === 'high'
Result: Only nodes that are BOTH projects AND high priority
Show Tagged Notes
Array.isArray(tags) && tags.includes('work')
Result: Only notes tagged with "work"
Show In-Progress or Review
status === 'in-progress' || status === 'review'
Result: Notes in either status
Show Notes with Attachments
Array.isArray(attachments) && attachments.length > 0
Result: Notes that have attachments
Show Incomplete High-Priority
status !== 'complete'
priority === 'high'
Result: High-priority items not yet completed
Show Recent Notes (with date property)
typeof date !== 'undefined' && new Date(date) > new Date('2024-01-01')
Result: Notes with dates after Jan 1, 2024
Filter Presets
Save frequently-used filters as named presets for quick access.
Creating Presets
- Open Settings → Nexus Properties → Graph filtering
- Scroll to "Filter presets"
- Click "Add Preset"
- Enter preset name (e.g., "Active Tasks")
- Enter filter expression (e.g.,
status === 'active')
Using Presets
- Use command: "Toggle Graph Filter (Preset Selector)"
- Click the preset dropdown that appears
- Select a preset from the list
- Filter expression input is filled automatically
- Filter is applied immediately
Pre-fill Preset on Startup
Configure a preset to automatically fill the filter input when the graph opens.
Setting up Pre-fill:
- Open Settings → Nexus Properties → Graph filtering
- Scroll to "Pre-fill filter preset"
- Select a preset from the dropdown (or "None" to disable)
- Next time the graph opens, the preset will be pre-filled
Key Differences:
- Filter Expressions (default) - Permanently applied, cannot be cleared by users
- Pre-fill Preset - Initial suggestion that users can modify or clear anytime
When to Use:
- Provide a helpful starting filter without forcing it
- Reduce repetitive filtering while maintaining flexibility
- Set up different defaults per vault or workflow
Preset Examples
| Name | Expression | Description |
|---|---|---|
| Active Tasks | status === 'active' | Show only active items |
| High Priority | priority === 'high' | Show high-priority notes |
| Projects Only | type === 'project' | Show only project notes |
| Work Notes | Array.isArray(tags) && tags.includes('work') | Work-related notes |
| Incomplete | status !== 'complete' | Not yet completed |
| Urgent | priority === 'urgent' | status === 'urgent' | Urgent items |
Managing Presets
Edit preset:
- Change name or expression in settings
- Press Enter or click outside to save
Delete preset:
- Click the × button next to the preset
Reorder presets:
- Presets appear in the order defined in settings
- No explicit reordering (yet)
Multi-Expression Filtering
Use multiple expressions (one per line) to create AND conditions.
Example: Active High-Priority Projects
type === 'project'
status === 'active'
priority === 'high'
Result: Nodes must match ALL three conditions
Equivalent to:
type === 'project' && status === 'active' && priority === 'high'
Example: Tagged Work Notes
Array.isArray(tags) && tags.includes('work')
status !== 'archived'
Result: Work-tagged notes that aren't archived
Filter Behavior
Source Node
The source node (currently viewed file) is always shown, even if it doesn't match the filter.
Why?
- Maintain context
- Show the file you're working with
- Always see the starting point
Connected Edges
When a node is hidden by filters:
- Edges to/from that node are also hidden
- Remaining nodes stay connected
- Graph re-layouts to accommodate visible nodes
Empty Results
If no nodes match the filter (except source):
- Only the source node is shown
- No edges are shown
- Clear filters or adjust expressions to see more nodes
Combining with Other Features
Filtering + Color Rules
Use both together for powerful visualization:
- Color by category (type, priority, status)
- Filter to focus (show only active projects)
- Result: Colored visualization of filtered subset
Example:
- Color rule:
type === 'project'→ Blue - Filter:
status === 'active' - Result: Only active notes shown, projects are blue
Filtering + View Modes
Filters work with all view modes:
- Hierarchical: Filter hides branches that don't match
- Related: Filter hides non-matching related nodes
- All Related: Filter affects entire constellation
Filtering + Search
Use together for precise navigation:
- Apply filter to reduce node count
- Use search to find specific nodes in filtered set
- Navigate to matching nodes
Use Cases
Project Management Dashboard
Show only active high-priority items:
status === 'active'
priority === 'high'
Result: Focus dashboard for critical tasks
Knowledge Review
Show notes needing review:
typeof lastReviewed === 'undefined' || new Date(lastReviewed) < new Date('2024-01-01')
Result: Notes not reviewed recently
Archival Cleanup
Show archived or old notes:
status === 'archived' || typeof lastModified !== 'undefined' && new Date(lastModified) < new Date('2023-01-01')
Result: Candidates for archiving
Content Audit
Show notes missing metadata:
typeof status === 'undefined' || typeof type === 'undefined'
Result: Notes that need metadata added
Topic Exploration
Show notes about a specific topic:
Array.isArray(tags) && (tags.includes('machine-learning') || tags.includes('ai'))
Result: All ML/AI related notes
Troubleshooting
Filter Not Working
Check expression syntax:
- Valid JavaScript required
- Property names case-sensitive
- Strings need quotes
- Use
===not=
Check property names:
- Match exactly what's in frontmatter
- Check for typos
- Use tooltips to verify property names
Check console for errors:
- Open developer console (
Ctrl/Cmd+Shift+I) - Look for evaluation errors
- Invalid expressions are logged
No Nodes Shown
Too restrictive:
- Expressions might not match any nodes
- Try each expression separately
- Broaden criteria
Property doesn't exist:
- Nodes might not have the property
- Check frontmatter of a few nodes
- Add existence check:
typeof prop !== 'undefined' && prop === 'value'
Source Node Doesn't Match Filter
This is intentional! Source node is always shown for context.
To match filter behavior:
- Navigate to a file that matches the filter
- Or adjust filter to include source node
Filter Applied But Nodes Still Show
Check expression logic:
- Maybe expression is too broad
- Use AND (
&&) to narrow down - Add multiple expressions (one per line)
Check for property variations:
- Status might be "Active" vs "active" (case matters)
- Extra spaces in values
- Different property names
Performance Tips
For Large Graphs
- Simple expressions are faster than complex ones
- Fewer expressions evaluate faster
- Specific filters reduce node count, improving performance
Optimization
Fast:
status === 'active'
type === 'project'
Slower (but still fine):
Array.isArray(tags) && tags.some(t => t.startsWith('prefix'))
title.toLowerCase().includes('search term')
Tips & Best Practices
- Start broad, then narrow - Apply general filter first, then add specifics
- Use presets for common filters to save time
- Test expressions in console first if unsure
- Combine with view modes for different perspectives
- Use with color rules for visual categories
- Clear filters when done to see full graph
- Check tooltips to verify property values before filtering
Next Steps
- Learn about Color Rules to combine with filtering
- Use Search for quick node finding
- Explore View Modes with filtering applied
- Customize settings