Skip to content

refactor(devtools): abstract and reuse the tree visualizer #62264

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hawkgs
Copy link
Member

@hawkgs hawkgs commented Jun 25, 2025

Abstract the injector tree visualizer so it can be used for both the Injector Tree and Router Tree tabs without having to rely on separate identical implementations.

Changes

In essence, there is now a single class called TreeVisualizer that works with TreeNodes. A TreeNode should have a label and TreeNode children. If the tree visualizer user items do not satisfy this format, they should be transformed. The TreeVisualizer exposes two additional config options – the node and link modifiers – that can be used for applying any instance-specific changes to the SVG elements (e.g. classes, data attributes, etc.). The implementation of the tree visualizer is almost unchanged.

Motivation

#62048 – such fixes and improvements require syncing the injector tree and router tree implementations.

Future improvements

Since we now have a single tree visualizer, it makes sense to integrate it in the tree-visualizer-host component via composition. The API will be exposed as part of the component and won't require manually tying the host and the visualizer.

@ngbot ngbot bot modified the milestone: Backlog Jun 25, 2025
@hawkgs hawkgs force-pushed the devtools/tree-visualizer branch 5 times, most recently from 1d7c4bb to 5c18f74 Compare June 27, 2025 10:32
@hawkgs hawkgs added the target: minor This PR is targeted for the next minor release label Jun 27, 2025
@hawkgs hawkgs force-pushed the devtools/tree-visualizer branch from 5c18f74 to 1c08a7b Compare June 27, 2025 11:10
Abstract the injector tree visualizer so it can be used for both the Injector Tree and Router Tree tabs without having to rely on separate identical implementations.
@hawkgs hawkgs force-pushed the devtools/tree-visualizer branch from 1c08a7b to fd365a8 Compare June 27, 2025 11:30
@hawkgs hawkgs added action: review The PR is still awaiting reviews from at least one requested reviewer and removed state: WIP labels Jun 27, 2025
@hawkgs hawkgs requested a review from dgp1130 June 27, 2025 11:30
@hawkgs hawkgs marked this pull request as ready for review June 27, 2025 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action: review The PR is still awaiting reviews from at least one requested reviewer area: devtools target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy