Domiii / Domiii/dbux

[feature] Call graph: Subgraph hiding (`HoleNode`)

Open
#681 1 comment 0 reactions 2 assignees Claimed by @Domiii View on GitHub
a-lot-of-work call-graph enhancement
Dominant language
JavaScript
Stars
171
Forks
13
PR merge metrics
No merged PRs in 30d

Description

* [x] Add a configurable filter predicate that determine what kind of context gets hidden (aka filtered).
* [x] Add new `HoleNode` that serves as a group for "hidden" nodes. All filtered contexts that are directly connected (i.e. all siblings and parents/children, recursively) get grouped into one such node.
* → see new `CallGraphNodes.floodHole` algorithm
* [x] fix `getComponents('ContextNode')`
* [x] fix `floodHole` algo: non-root holes contain root contexts
* [x] fix: allow extending of existing root holes (rather than creating new ones that also contain the old ones)
* [x] Make the new `HoleNode` a bit prettier
* [x] Add button to toolbar to allow customizing the context filters
* [x] V3: add one button per filter option in a dropdown
* [x] each button renders as "activated" if it does not equal its default
* default is empty, except for `packageWhitelist` which is `.*`)
* [x] when clicked: 1. show quickpick of history (sorted by `lastUsed`), 2. plus one entry in the beginning which is ``
* [x] when (1) is selected, move it (don't duplicate it) in the history array
* [x] when (2) is selected, show `InputBox` to allow user producing a new filter

* [x] Store filter history in memento
* [x] Expose memento `get`/`set` in graph externals
* [ ] test w/ `react-tic-tac-toe` → it has almost only library nodes

# ACG subgraph hiding

* [ ] Also add subgraph hiding to `ACG`
* [ ] re-purpose the `floodHole` algorithm, but traverse `AsyncEdge`s instead of in-root contexts (can we generalize the original, without degrading performance?)
* [ ] When adding a node to a `HoleNode`, we need to re-determine FORK or CHAIN:
* ![image](https://user-images.githubusercontent.com/282899/158530759-720a6547-8f8f-4d34-a150-1dd6b9ef4a58.png)
* In the above example, we want to add 3 green nodes to the blue `HoleNode` (spanning the blue subgraph).
* → `1` is CHAINed while `2` and `3` are FORKed from the `HoleNode`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.