Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dot-viewer in TUI #7

Merged
merged 273 commits into from
Feb 22, 2023
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
273 commits
Select commit Hold shift + click to select a range
1639a6c
fix: handle goto from empty adjacent node list
jaehyun1ee-furiosa Jan 17, 2023
68f647b
Create README.md
jaehyun1ee-furiosa Jan 17, 2023
b413422
feat: backtab to navigate blocks in reverse
jaehyun1ee-furiosa Jan 18, 2023
9229cd5
refactor: merge app field update functions
jaehyun1ee-furiosa Jan 18, 2023
bd7b4cc
feat: navigate blocks with right, left arrows
jaehyun1ee-furiosa Jan 18, 2023
8e0eb97
Update README.md
jaehyun1ee-furiosa Jan 18, 2023
1790601
feat: tab autocomplete gt node name
jaehyun1ee-furiosa Jan 18, 2023
5d5a780
fix: command mode to search mode
jaehyun1ee-furiosa Jan 18, 2023
e37d51f
refactor: merged graph related app fields into struct lists
jaehyun1ee-furiosa Jan 18, 2023
6573659
fix: search goto based on current list index
jaehyun1ee-furiosa Jan 18, 2023
f8d6e64
fix: show error message on search failure
jaehyun1ee-furiosa Jan 18, 2023
53c9e0d
feat: show matching nodes as user types in search keyword
jaehyun1ee-furiosa Jan 18, 2023
90568a1
feat: show filtered node lists on enter after search
jaehyun1ee-furiosa Jan 18, 2023
d1e7866
refactor: rename struct Lists to Ctxt
jaehyun1ee-furiosa Jan 18, 2023
811cda8
feat: render tabs in layout
jaehyun1ee-furiosa Jan 18, 2023
dd16ba8
feat: open new tab on search keyword enter
jaehyun1ee-furiosa Jan 18, 2023
c0f403c
feat: navigate tabs with tab and backtab
jaehyun1ee-furiosa Jan 18, 2023
b9aaec5
refactor: abstract tab in utils
jaehyun1ee-furiosa Jan 19, 2023
fddec68
feat: allow tab close
jaehyun1ee-furiosa Jan 19, 2023
a4aa701
feat: change search match layout
jaehyun1ee-furiosa Jan 19, 2023
4320aae
fix: re-enter nav mode on esc
jaehyun1ee-furiosa Jan 19, 2023
7bb88fe
feat: goto searched node on enter
jaehyun1ee-furiosa Jan 19, 2023
77c8658
feat: delete tabs from layout
jaehyun1ee-furiosa Jan 19, 2023
0868c1a
feat: fuzz match node ids
jaehyun1ee-furiosa Jan 19, 2023
d3633e0
feat: highlight fuzz matching characters
jaehyun1ee-furiosa Jan 19, 2023
2b61020
Update README.md
jaehyun1ee-furiosa Jan 19, 2023
9ab5fba
Update README.md
jaehyun1ee-furiosa Jan 19, 2023
d353a93
fix: update adjacent nodes when traversing node list
jaehyun1ee-furiosa Jan 19, 2023
55a67ef
feat: delete autocomplete feature
jaehyun1ee-furiosa Jan 19, 2023
1cb9504
feat: add tabs again to app
jaehyun1ee-furiosa Jan 19, 2023
d9a1309
feat: add filter to focus to allow filtering feature
jaehyun1ee-furiosa Jan 19, 2023
6f8569a
fix: faster filtered node list update
jaehyun1ee-furiosa Jan 19, 2023
eda6c44
refactor: unify mode and focus
jaehyun1ee-furiosa Jan 19, 2023
a5a1730
feat: create a subgraph on filter
jaehyun1ee-furiosa Jan 23, 2023
84f40f3
feat: show search progress
jaehyun1ee-furiosa Jan 23, 2023
359ec08
feat: help message for filter
jaehyun1ee-furiosa Jan 25, 2023
0d6bb54
Update README.md
jaehyun1ee-furiosa Jan 25, 2023
fd11195
Update README.md
jaehyun1ee-furiosa Jan 25, 2023
65e02cd
feat: parse subgraphs in dot-graph
jaehyun1ee-furiosa Jan 25, 2023
e0bdd44
feat: parse and print edge ports in dot-graph
jaehyun1ee-furiosa Jan 25, 2023
e5ae467
feat: define viewer error
jaehyun1ee-furiosa Jan 25, 2023
a142ff8
refactor: render viewer run result in layout
jaehyun1ee-furiosa Jan 25, 2023
8f900c9
refactor: relocate function
jaehyun1ee-furiosa Jan 25, 2023
3052cab
fix: prevent terminal crash by running viewer in thread
jaehyun1ee-furiosa Jan 26, 2023
cdc2ca0
feat: simple export with e keybinding
jaehyun1ee-furiosa Jan 26, 2023
ffc5470
fix: show edge attributes in dot-graph
jaehyun1ee-furiosa Jan 26, 2023
6f76cf9
feat: export neigbors of current node with digits keybindings
jaehyun1ee-furiosa Jan 26, 2023
87819e1
Update README.md
jaehyun1ee-furiosa Jan 26, 2023
76f1f1e
feat: keep current node centered after goto
jaehyun1ee-furiosa Jan 26, 2023
227966e
feat: keep current.dot to keep tracking neighbors
jaehyun1ee-furiosa Jan 26, 2023
5ca25b7
Update README.md
jaehyun1ee-furiosa Jan 26, 2023
a8a0065
rustfmt
jaehyun1ee-furiosa Jan 26, 2023
668ceb4
fix: subgraph filtering logic in dot-graph
jaehyun1ee-furiosa Jan 26, 2023
699a28e
fmt: dot-graph
jaehyun1ee-furiosa Jan 26, 2023
1718e87
fix: change submodule url
jaehyun1ee-furiosa Jan 26, 2023
c8abaf4
fix: change submodule branch
jaehyun1ee-furiosa Jan 27, 2023
f61f958
fix: faster filter application
jaehyun1ee-furiosa Jan 27, 2023
1ecedcb
feat: launch xdot with x keybinding
jaehyun1ee-furiosa Jan 27, 2023
1ce68ee
Update README.md
jaehyun1ee-furiosa Jan 27, 2023
5f0dc0b
fix: update help message
jaehyun1ee-furiosa Jan 27, 2023
bb30473
Merge pull request #2 from jaehyun1ee/dev-xdot
jaehyun1ee-furiosa Jan 27, 2023
dc42c7e
fix: layout change for smaller screen
jaehyun1ee-furiosa Jan 27, 2023
eba9d64
fmt
jaehyun1ee-furiosa Jan 27, 2023
6350c5c
Merge pull request #3 from jaehyun1ee/dev-layout
jaehyun1ee-furiosa Jan 27, 2023
32239e5
refactor: reorganize functions
jaehyun1ee-furiosa Jan 27, 2023
adfa0c6
Update README.md
jaehyun1ee-furiosa Jan 27, 2023
dabf4a8
feat: pretty print node metadata
jaehyun1ee-furiosa Jan 27, 2023
28be06a
refactor: refactor dot-graph
jaehyun1ee-furiosa Jan 30, 2023
d57611d
Merge pull request #4 from jaehyun1ee/dev-pretty-attr
jaehyun1ee-furiosa Jan 30, 2023
644928e
update: submodule dot-graph
jaehyun1ee-furiosa Jan 30, 2023
754b76b
refactor: reorganize structs
jaehyun1ee-furiosa Jan 30, 2023
0db6fbc
refactor: reorganize errors with thiserror
jaehyun1ee-furiosa Jan 30, 2023
e216232
Merge pull request #5 from jaehyun1ee/dev-error
jaehyun1ee-furiosa Jan 30, 2023
08418c9
feat: simple regex matcher on raw dot
jaehyun1ee-furiosa Jan 30, 2023
3f57f7c
refactor: categorize prefix and regex match into search
jaehyun1ee-furiosa Jan 30, 2023
4c4054c
fix: rename prefix to fuzzy
jaehyun1ee-furiosa Jan 30, 2023
5159ccd
refactor: merge filter and search list of struct viewer
jaehyun1ee-furiosa Jan 31, 2023
1711476
feat: show node metadata in input mode
jaehyun1ee-furiosa Jan 31, 2023
079151e
feat: utilize cache on filter and regex match
jaehyun1ee-furiosa Jan 31, 2023
171f012
fmt
jaehyun1ee-furiosa Jan 31, 2023
774950d
Update README.md
jaehyun1ee-furiosa Jan 31, 2023
a6ed878
Merge pull request #6 from jaehyun1ee/dev-regex
jaehyun1ee-furiosa Jan 31, 2023
50b7d14
feat: faster match with parallel rayon
jaehyun1ee-furiosa Jan 31, 2023
0397467
update: submodule dot-graph with rayon
jaehyun1ee-furiosa Jan 31, 2023
c8df475
fmt
jaehyun1ee-furiosa Jan 31, 2023
0ec4ece
Merge pull request #7 from jaehyun1ee/dev-rayon
jaehyun1ee-furiosa Jan 31, 2023
5ae54eb
feat: vim traversal keybindings
jaehyun1ee-furiosa Jan 31, 2023
0f82419
Update README.md
jaehyun1ee-furiosa Jan 31, 2023
af8d802
feat: autocomplete for filter mode
jaehyun1ee-furiosa Jan 31, 2023
b28d3f2
feat: autocomplete for fuzzy and regex search mode
jaehyun1ee-furiosa Jan 31, 2023
a7a6898
refactor: merge matching logic
jaehyun1ee-furiosa Jan 31, 2023
455f947
refactor: change function pointer signature
jaehyun1ee-furiosa Jan 31, 2023
9a88f90
fix: handle empty autocomplete key
jaehyun1ee-furiosa Jan 31, 2023
afbacd2
Update README.md
jaehyun1ee-furiosa Jan 31, 2023
79c2134
Merge pull request #8 from jaehyun1ee/dev-autocomplete
jaehyun1ee-furiosa Jan 31, 2023
0270702
Update README.md
jaehyun1ee-furiosa Feb 1, 2023
ad745c8
fix: remove match cache
jaehyun1ee-furiosa Feb 1, 2023
8e24d6b
refactor: abstract input into struct
jaehyun1ee-furiosa Feb 1, 2023
56a5cec
feat: allow moving cursor for input
jaehyun1ee-furiosa Feb 1, 2023
8a09a6c
feat: shorter dot-viewer launch command
jaehyun1ee-furiosa Feb 1, 2023
c4123ea
fmt
jaehyun1ee-furiosa Feb 1, 2023
0c58110
Update README.md
jaehyun1ee-furiosa Feb 1, 2023
555f99a
update: submodule dot-graph
jaehyun1ee-furiosa Feb 1, 2023
bb28baa
Merge pull request #9 from jaehyun1ee/dev-input
jaehyun1ee-furiosa Feb 1, 2023
212fd7f
Update README.md
jaehyun1ee-furiosa Feb 1, 2023
2e82d17
feat: allow autocomplete on empty string
jaehyun1ee-furiosa Feb 1, 2023
e7b6117
feat: show number of matching nodes
jaehyun1ee-furiosa Feb 2, 2023
ec91f1e
Update README.md
jaehyun1ee-furiosa Feb 2, 2023
c978ab1
fix: redirect stdout and stderr for xdot process
jaehyun1ee-furiosa Feb 2, 2023
88e4831
update: submodule dot-graph
jaehyun1ee-furiosa Feb 2, 2023
87e3fad
feat: add popup mode to modes
jaehyun1ee-furiosa Feb 2, 2023
ffcd8f0
feat: render interactive popup
jaehyun1ee-furiosa Feb 2, 2023
1c0a797
feat: show subgraph tree with s keybinding
jaehyun1ee-furiosa Feb 2, 2023
bffc593
feat: filter by subgraph
jaehyun1ee-furiosa Feb 3, 2023
d3d4d02
update: submodule dot-graph
jaehyun1ee-furiosa Feb 3, 2023
7e70882
fmt
jaehyun1ee-furiosa Feb 3, 2023
3ef8c33
Update README.md
jaehyun1ee-furiosa Feb 3, 2023
1d5b3a2
Merge pull request #10 from jaehyun1ee/dev-subgraph-tree
jaehyun1ee-furiosa Feb 3, 2023
74d030b
Update README.md
jaehyun1ee-furiosa Feb 3, 2023
a10fa75
feat: allow quit in popup
jaehyun1ee-furiosa Feb 3, 2023
ff367cf
fix: handle error when no subgraph is selected
jaehyun1ee-furiosa Feb 3, 2023
8237cfc
refactor: reorganize modes
jaehyun1ee-furiosa Feb 3, 2023
1a29844
refactor: handle errors from dot-graph
jaehyun1ee-furiosa Feb 7, 2023
07eea5a
fmt
jaehyun1ee-furiosa Feb 7, 2023
4c8949c
fix: remove cargo lock
jaehyun1ee-furiosa Feb 7, 2023
be930c1
fmt with updated formatter
jaehyun1ee-furiosa Feb 7, 2023
821d93d
refactor: use then_else for bool
jaehyun1ee-furiosa Feb 7, 2023
ae1f0e6
refactor: change in to_dot parameter in dot-graph
jaehyun1ee-furiosa Feb 8, 2023
cebf5ec
refactor: change in function name in dot-graph
jaehyun1ee-furiosa Feb 8, 2023
78198ce
refactor: static to module function
jaehyun1ee-furiosa Feb 8, 2023
7e8b894
refactor: rename functions with id postfix
jaehyun1ee-furiosa Feb 8, 2023
b149710
refactor: rename mode related variables
jaehyun1ee-furiosa Feb 8, 2023
c21d611
fix: initialize tab title with graph id
jaehyun1ee-furiosa Feb 9, 2023
5d73098
fix: print dot-graph error message
jaehyun1ee-furiosa Feb 9, 2023
34882e3
refactor: misc
jaehyun1ee-furiosa Feb 9, 2023
385e242
Merge pull request #11 from jaehyun1ee/dev-refactor
jaehyun1ee-furiosa Feb 9, 2023
8b8f8ad
refactor: rename viewer to view
jaehyun1ee-furiosa Feb 9, 2023
2e78c7f
doc: app
jaehyun1ee-furiosa Feb 9, 2023
69a1aad
doc: view
jaehyun1ee-furiosa Feb 9, 2023
406e692
doc: mode
jaehyun1ee-furiosa Feb 9, 2023
60184fb
Merge pull request #12 from jaehyun1ee/dev-doc
jaehyun1ee-furiosa Feb 9, 2023
5c61e93
refactor: misc
jaehyun1ee-furiosa Feb 9, 2023
9158323
refactor: change module names
jaehyun1ee-furiosa Feb 9, 2023
f9ed0fb
Merge pull request #13 from jaehyun1ee/dev-refactor
jaehyun1ee-furiosa Feb 9, 2023
d9f0321
add: simple state diagram
jaehyun1ee-furiosa Feb 9, 2023
3575aa7
fix: view title on subgraph
jaehyun1ee-furiosa Feb 9, 2023
54ca904
refactor: better use of dot-graph api in tree util
jaehyun1ee-furiosa Feb 9, 2023
922594d
fmt
jaehyun1ee-furiosa Feb 9, 2023
7a35a04
feat: show subgraph statistics in popup
jaehyun1ee-furiosa Feb 9, 2023
cc724d2
update: submodule dot-graph
jaehyun1ee-furiosa Feb 9, 2023
7c8f109
fix: simpler cleanup on dot-viewer panic
jaehyun1ee-furiosa Feb 9, 2023
ceae0ce
update: submodule dot-graph
jaehyun1ee-furiosa Feb 10, 2023
8c43fac
fix: subgraph ordering
jaehyun1ee-furiosa Feb 13, 2023
c44fe6c
fix: remove print
jaehyun1ee-furiosa Feb 13, 2023
b12c27c
feat: print panic backtrace to terminal
jaehyun1ee-furiosa Feb 13, 2023
5b2e634
feat: conditional panic hook in build or release
jaehyun1ee-furiosa Feb 13, 2023
63d2570
fix: handle error on app initialization
jaehyun1ee-furiosa Feb 13, 2023
fe6ac15
Merge pull request #14 from jaehyun1ee/dev-panic
jaehyun1ee-furiosa Feb 13, 2023
8493a5e
feat: sort subgraphs by id
jaehyun1ee-furiosa Feb 13, 2023
0015bc5
update: submodule dot-graph
jaehyun1ee-furiosa Feb 13, 2023
67f318a
refactor: no call to dot-graph api in ui
jaehyun1ee-furiosa Feb 14, 2023
792b969
refactor: shorten thiserror prints
jaehyun1ee-furiosa Feb 14, 2023
2fe7d79
refactor: rename node to item
jaehyun1ee-furiosa Feb 14, 2023
9a5dd8a
refactor: better use of dot-graph api
jaehyun1ee-furiosa Feb 14, 2023
34573fa
refactor: reorganize default for input
jaehyun1ee-furiosa Feb 14, 2023
8e96d4a
refactor: change visibility from public to crate public
jaehyun1ee-furiosa Feb 14, 2023
962a5a5
refactor: type alaias for dot-viewer result
jaehyun1ee-furiosa Feb 14, 2023
5b3122e
refactor: reorganize crate structure
jaehyun1ee-furiosa Feb 14, 2023
c4c86f0
fmt
jaehyun1ee-furiosa Feb 14, 2023
c57a43e
Merge pull request #15 from jaehyun1ee/dev-refactor
jaehyun1ee-furiosa Feb 14, 2023
3e8dcfb
fix: ignore logs
jaehyun1ee-furiosa Feb 14, 2023
a43d885
update: submodule dot-graph
jaehyun1ee-furiosa Feb 14, 2023
5f37437
feat: simple logger
jaehyun1ee-furiosa Feb 14, 2023
834b18d
refactor: separate subtree drawer into module
jaehyun1ee-furiosa Feb 14, 2023
b55afe3
feat: add help in popup mode
jaehyun1ee-furiosa Feb 14, 2023
72ce24f
feat: render keybinding table with ? keybinding
jaehyun1ee-furiosa Feb 14, 2023
75e6729
feat: simplify help message in input form
jaehyun1ee-furiosa Feb 14, 2023
720fc94
fmt
jaehyun1ee-furiosa Feb 14, 2023
66c0977
Update README.md
jaehyun1ee-furiosa Feb 14, 2023
dc78a03
Merge pull request #16 from jaehyun1ee/dev-help
jaehyun1ee-furiosa Feb 14, 2023
29031e8
refactor: rename alias to dotviewerresult
jaehyun1ee-furiosa Feb 20, 2023
2a26a29
refactor: remove redundant result
jaehyun1ee-furiosa Feb 20, 2023
595d1b8
refactor: remove unnecessary string in result
jaehyun1ee-furiosa Feb 20, 2023
bc14c5e
refactor: pub(crate) struct field visibility to pub
jaehyun1ee-furiosa Feb 20, 2023
e90d6f7
refactor: define custom success state type
jaehyun1ee-furiosa Feb 20, 2023
66a7ac3
refactor: change visibility of success state
jaehyun1ee-furiosa Feb 20, 2023
2b7dd13
refactor: better handling of dot-viewer panic
jaehyun1ee-furiosa Feb 20, 2023
20e1436
refactor: group imports
jaehyun1ee-furiosa Feb 20, 2023
86f31bb
refactor: implicit format args
jaehyun1ee-furiosa Feb 20, 2023
ce7bae6
refactor: change return type of current_id
jaehyun1ee-furiosa Feb 20, 2023
9bbcd6d
refactor: viewer utils
jaehyun1ee-furiosa Feb 20, 2023
98e3a24
refactor: integrate mode switch into goto, filter, and subgraph
jaehyun1ee-furiosa Feb 20, 2023
1c44fbd
refactor: break down lengthy map_or
jaehyun1ee-furiosa Feb 20, 2023
fa43a97
feat: graphviz linker for mac m1
jaehyun1ee-furiosa Feb 20, 2023
0878cbb
feat: render search matches in current nodes list
jaehyun1ee-furiosa Feb 15, 2023
adfb375
feat: show match progress
jaehyun1ee-furiosa Feb 15, 2023
1f18e78
feat: visualize match progress in footer
jaehyun1ee-furiosa Feb 16, 2023
e2abbc0
feat: temporarily disable filter mode
jaehyun1ee-furiosa Feb 16, 2023
42d1f21
feat: add command mode
jaehyun1ee-furiosa Feb 16, 2023
11a6e5f
feat: clap parser for dot-viewer command filter
jaehyun1ee-furiosa Feb 16, 2023
6feb76a
feat: aucompltete filter prefix on tab
jaehyun1ee-furiosa Feb 16, 2023
4cb4ef4
feat: define commands as enum
jaehyun1ee-furiosa Feb 16, 2023
2f2d2a9
refactor: integrate navigate mode into view
jaehyun1ee-furiosa Feb 16, 2023
22c8ffb
refactor: flatten mode
jaehyun1ee-furiosa Feb 16, 2023
45a3af5
feat: goto matched id while input
jaehyun1ee-furiosa Feb 16, 2023
b6e1183
feat: use matches for search only
jaehyun1ee-furiosa Feb 16, 2023
209f293
feat: integrate keybindings into command
jaehyun1ee-furiosa Feb 16, 2023
0772b4d
feat: autocomplete cmd
jaehyun1ee-furiosa Feb 17, 2023
1858ab7
feat: filter on search matches
jaehyun1ee-furiosa Feb 17, 2023
62abc0d
feat: show filter keyword in view title
jaehyun1ee-furiosa Feb 17, 2023
dd8f8ff
feat: update help popup contents
jaehyun1ee-furiosa Feb 17, 2023
610ad87
refactor: better help message
jaehyun1ee-furiosa Feb 17, 2023
f1dad60
fmt
jaehyun1ee-furiosa Feb 17, 2023
e95ca8d
feat: create a new view on neighbors command
jaehyun1ee-furiosa Feb 17, 2023
8891075
feat: optionally accept filename for export and xdot commands
jaehyun1ee-furiosa Feb 17, 2023
22512be
Update README.md
jaehyun1ee-furiosa Feb 17, 2023
27f16a1
fix: fallback and print all attrs on html parse failure
jaehyun1ee-furiosa Feb 17, 2023
a372127
feat: vim keybinding for goto first and last
jaehyun1ee-furiosa Feb 17, 2023
328c542
update: submodule dot-graph
jaehyun1ee-furiosa Feb 20, 2023
b4f9869
fix: export filename
jaehyun1ee-furiosa Feb 20, 2023
160a87d
fmt
jaehyun1ee-furiosa Feb 20, 2023
df08507
feat: traverse help popup
jaehyun1ee-furiosa Feb 20, 2023
0a6af95
refactor: misc
jaehyun1ee-furiosa Feb 20, 2023
5b61c04
refactor: rename successstate to success
jaehyun1ee-furiosa Feb 21, 2023
4f9c224
refactor: reorganize function orders
jaehyun1ee-furiosa Feb 21, 2023
468b71e
fix: ignore goto errors while updating search matches
jaehyun1ee-furiosa Feb 21, 2023
f4b4a5c
fix: go to normal mode after selecting a subgraph
jaehyun1ee-furiosa Feb 21, 2023
d7c8c48
refactor: merge tab error into viewer error
jaehyun1ee-furiosa Feb 21, 2023
fe1ef41
Update README.md
jaehyun1ee-furiosa Feb 21, 2023
1f42289
refactor: remove unnecessary param
jaehyun1ee-furiosa Feb 21, 2023
ff77711
fix: allow moving cursors with left, right
jaehyun1ee-furiosa Feb 21, 2023
e876fab
update: submodule dot-graph
jaehyun1ee-furiosa Feb 21, 2023
00c244d
Merge pull request #17 from jaehyun1ee-furiosa/dev-vim-rebased
jaehyun1ee-furiosa Feb 21, 2023
22a3634
refactor: remove unnecessary pub(crate)
jaehyun1ee-furiosa Feb 21, 2023
384a545
feat: enforce orderings in nexts, prevs list
jaehyun1ee-furiosa Feb 21, 2023
a886c92
Update README.md
jaehyun1ee-furiosa Feb 21, 2023
1fe4285
refactor: help messages into const
jaehyun1ee-furiosa Feb 21, 2023
3022aae
refactor: remove svg
jaehyun1ee-furiosa Feb 22, 2023
103a188
fix: different colors for success and error
jaehyun1ee-furiosa Feb 22, 2023
3a79dd0
fix: switch mode after export and xdot
jaehyun1ee-furiosa Feb 22, 2023
c608ccb
refactor: impl fromiterator for trie
jaehyun1ee-furiosa Feb 22, 2023
6a7841a
refactor: reuse openoptions
jaehyun1ee-furiosa Feb 22, 2023
c0f8c43
refactor: misc viewer utils
jaehyun1ee-furiosa Feb 22, 2023
b644832
refactor: misc ui utils
jaehyun1ee-furiosa Feb 22, 2023
cd3c7e7
refactor: parenthesis for better readability
jaehyun1ee-furiosa Feb 22, 2023
3555ecd
refactor: use self in impls
jaehyun1ee-furiosa Feb 22, 2023
b77bb46
update: submodule dot-graph branch from dev to main
jaehyun1ee-furiosa Feb 22, 2023
4578f30
Update README.md
jaehyun1ee-furiosa Feb 22, 2023
7676830
update: package description
jaehyun1ee-furiosa Feb 22, 2023
92faa12
fix: author
jaehyun1ee-furiosa Feb 22, 2023
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
2 changes: 2 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[target.aarch-apple-darwin]
rustflags = ["-C", "link-args=-L/opt/homebrew/lib"]
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Cargo.lock
/logs
/target
.DS_STORE
*.dot
*.log
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "dot-graph"]
path = dot-graph
url = https://github.com/furiosa-ai/dot-graph.git
branch = dev-graph
23 changes: 23 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[package]
name = "dot-viewer"
version = "0.1.0"
jaehyun1ee-furiosa marked this conversation as resolved.
Show resolved Hide resolved
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
dot-graph = { path = "dot-graph" }
Copy link

@maxstate maxstate Feb 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

일단 dot-graph 빌드시에는 graphviz를 찾을 수 없다고 떠서 이 부분은 따로 얘기하도록 하겠습니다.
dot-viewer는 설치를 한다고 하면 플렛폼마다 설치하는 환경이 달라서 각기 다른 방식으로 빌드를 해야 합니다.
이 부분을 관리를 하는 것이 .cargo/config.toml 입니다.
https://doc.rust-lang.org/cargo/reference/config.html
여기서 각 환경마다 어떤 인자를 줄껀지 설정을 할 수 있습니다.

제가 실행한 환경(apple m1)에서는 빌드가 되지 않았늗데 이는 homebrew로 설치된 library path를 linker한테 따로 지정하지 않아 생긴 문제였습니다.
그래서 linker한테 homebrew에 설치된 path도 찾을 수 있도록 인자를 전달해야 합니다.

[target.aarch64-apple-darwin]
rustflags=["-C", "link-args=-L/opt/homebrew/lib"]

위의 설정의 뜻은 apple arm으로 빌드 진행할 시 linker한테(여기서는 ld 기준) /opt/homebrew/lib 도 library search path 목록에 추가하라는 뜻입니다.
위와 같이 config.toml 파일을 추가해서 사용자가 환경 변수 설정하는 번거로움을 줄이는 게 좋을 것 같습니다.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fa43a97

dot-viewer, dot-graph 양쪽에 M1 mac에 대해 .cargo/config.toml 추가했습니다.

나머지 플랫폼에 대해서는 차후에 CI 구축과 함께 진행하겠습니다 :)

tui = "0.19.0"
tui-tree-widget = "0.11.0"
crossterm = "0.25"
clap = { version = "4.1.1", features = ["derive"] }
trie-rs = "0.1.1"
fuzzy-matcher = "0.3.7"
html_parser = "0.6.3"
thiserror = "1.0.38"
regex = "1.7.1"
rayon = "1.6.1"
better-panic = "0.3.0"
log = "0.4.17"
simplelog = "0.12.0"
chrono = "0.4.23"
155 changes: 155 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
# dot-viewer

`dot-viewer` is a dot-format graph debugger in TUI, inspired by Vim.

# 1. Getting Started

## a. Prerequisites

### i. Graphviz

`dot-viewer` parses a dot format file using C bindings to [Graphviz (v7.0.6)](https://gitlab.com/graphviz/graphviz/-/tree/7.0.6/lib).

The system environment should be able to find and include the following header files.

```C
#include <gvc.h>
#include <cgraph.h>
```

#### Option 1. Installing Graphviz from Package Manager

Coming from Linux,
```console
$ sudo apt install graphviz-dev
```

And coming from vanilla Ubuntu, you may want to install these too.
```console
$ sudo apt install build-essentials cmake
$ sudo apt install clang
```

Coming from Mac,
```console
$ brew install graphviz
```

And coming from Apple Silicon Mac, and [add an environment variable](https://apple.stackexchange.com/questions/414622/installing-a-c-c-library-with-homebrew-on-m1-macs),
```shell
export CPATH=/opt/homebrew/include
```

#### Option 2. Building Graphviz from Source

Or, try building from the source code following the [guide](https://graphviz.org/download/source/).

### ii. xdot.py

`dot-viewer` renders a subgraph with `xdot.py`, an interactive dot visualizer.

It is required that [xdot is executable in command-line](https://github.com/jrfonseca/xdot.py) beforehand such that the following works.
```console
$ xdot *.dot
```

## b. Installation

### i. Initialize

First initialize and update the submodule `dot-graph`.

```console
$ git submodule init
$ git submodule update
```

### ii. Run

Then run crate.

```console
$ cargo run --release [path-to-dot-file]
```

This will open a TUI screen on the terminal.

# 2. Features

With `dot-viewer`, users may

**traverse the graph in TUI** using,
- goto next/prev node of the currently selected node
- fuzzy search on node name
- regex search on node name and attributes


**make and export subgraphs** using,
- subgraph tree selection
- applying filter on search matches
- neighboring `n` nodes of the currently selected node

## Keybindings

### General

Key | Command | Actions
--- | --- | ---
`q` | | quit `dot-viewer`
. | `:help<CR>` | show help
`esc` | . | go back to the main screen

### Mode Switches

Key | From | To
--- | --- | ---
`esc` | All | Normal
`/` | Normal | Fuzzy Search
`r` | Normal | Regex Search
`:` | Normal | Command

### Normal

Key | Actions
--- | ---
`c` | close the current tab(view)
`h/l` | move focus between current, prevs, nexts list
`j/k` | traverse in focused list
`n/N` | move between matched nodes
`tab`/`backtab` | move between tabs

### Search
Key | Actions
--- | ---
`tab` | autocomplete search keyword
`enter` | apply search

e.g., in fuzzy search mode, `/g1_s14_t100` and in regex search mode, `r\(H: ., D: .\)`

### Command

Key | Command | Actions
--- | --- | ---
. | `filter` | apply filter on current matches, opening a new tab(view)
jaehyun1ee-furiosa marked this conversation as resolved.
Show resolved Hide resolved
. | `neighbors [depth]` | get up to `depth` neighbors of the current node in a new tab(view)
. | `export [(opt) filename]` | export the current tab(view) to dot
. | `xdot [(opt) filename]` | launch `xdot` with the filename or `exports/current.dot` by default
. | `subgraph` | open a popup showing subgraph tree
`enter` | . | execute command

All exported files are saved in `exports` directory in the project root.

Most recently exported file is copied in `exports/current.dot`.

### Subgraph Popup

Key | Actions
--- | ---
`h/j/k/l` | traverse the tree
`enter` | change root to the selected subgraph, opening a new tab(view)

### Help Popup

Key | Actions
--- | ---
`h/j/k/l` | traverse help messages
1 change: 1 addition & 0 deletions dot-graph
Submodule dot-graph added at 278850
Loading