feat: add Obsidian-style graph visualization
Implement force-directed graph view for visualizing note connections:
- Add graph data model parsing [[wiki-style links]]
- Implement Fruchterman-Reingold layout algorithm
- Create character-based canvas renderer with highlights
- Add interactive filtering by tag/folder
- Support navigation (h/j/k/l), zoom (+/-), and node selection
- New commands: :IdeaGraph, :IdeaGraphFilter
New files:
- lua/ideaDrop/ui/graph/{init,types,data,layout,renderer}.lua
Updated documentation in README.md, CHANGELOG.md, and llms.txt
This commit is contained in:
@@ -4,21 +4,34 @@
|
||||
---@field options IdeaDropOptions
|
||||
---@field setup fun(user_opts: IdeaDropOptions|nil): nil
|
||||
|
||||
---@class GraphOptions
|
||||
---@field animate boolean Whether to animate layout (default: false)
|
||||
---@field show_orphans boolean Whether to show orphan nodes (default: true)
|
||||
---@field show_labels boolean Whether to show node labels by default (default: true)
|
||||
---@field node_colors table<string, string>|nil Custom colors for folders/tags
|
||||
|
||||
---@class IdeaDropOptions
|
||||
---@field idea_dir string Directory where idea files will be stored
|
||||
---@field graph GraphOptions|nil Graph visualization options
|
||||
|
||||
local M = {}
|
||||
|
||||
---Default configuration options
|
||||
M.options = {
|
||||
idea_dir = vim.fn.stdpath("data") .. "/ideaDrop" -- default path
|
||||
idea_dir = vim.fn.stdpath("data") .. "/ideaDrop", -- default path
|
||||
graph = {
|
||||
animate = false, -- Set to true for animated layout
|
||||
show_orphans = true, -- Show nodes with no connections
|
||||
show_labels = true, -- Show node labels by default
|
||||
node_colors = nil, -- Custom node colors by folder/tag
|
||||
},
|
||||
}
|
||||
|
||||
---Setup function to merge user options with defaults
|
||||
---@param user_opts IdeaDropOptions|nil User configuration options
|
||||
---@return nil
|
||||
function M.setup(user_opts)
|
||||
M.options = vim.tbl_deep_extend("force", M.options, user_opts or {})
|
||||
M.options = vim.tbl_deep_extend("force", M.options, user_opts or {})
|
||||
end
|
||||
|
||||
return M
|
||||
|
||||
Reference in New Issue
Block a user