angular/devtools/projects/ng-devtools/src/lib/devtools.component.scss
AleksanderBodurri f4b915b77b feat(devtools): implement zoom and pan in injector graph visualizer (#52489)
Previously only the trackpad could be used to navigate this view.

Now we can zoom and pan around using our mouse wheel and scroll.

Additionally, this commit fixes many issues related to the visualization of the injector graph visualization, allowing it to be more compact without impacting legibility and minimizing edge collisions in larger graphs.

PR Close #52489
2023-11-03 17:37:55 -07:00

217 lines
3.5 KiB
SCSS

@keyframes pulse {
0% {
box-shadow: 0 0 0 0px rgba(0, 0, 0, 0.2);
}
100% {
box-shadow: 0 0 0 35px rgba(0, 0, 0, 0);
}
}
@keyframes darkmode-pulse {
0% {
box-shadow: 0 0 0 0px rgb(126, 40, 40);
}
100% {
box-shadow: 0 0 0 35px rgba(0, 0, 0, 0);
}
}
:host {
width: 100%;
height: 100%;
display: block;
}
.devtools-wrapper {
width: 100%;
height: 100%;
display: block;
}
:host-context(.dark-theme) {
.devtools-wrapper {
background: #202124;
}
.initializing {
.loading {
animation: darkmode-pulse 1s infinite;
}
}
}
.noselect {
user-select: none;
}
.initializing {
margin: auto;
width: 125px;
height: 100%;
display: flex;
align-items: center;
.loading {
background: url('./images/angular.svg');
border-radius: 50%;
width: 125px;
height: 125px;
float: left;
text-align: center;
animation: pulse 1s infinite;
}
}
.text-message {
font-weight: 500;
font-size: 1.2em;
padding: 5px;
text-align: center;
cursor: help;
.info-icon {
display: inline-block;
font-size: 0.8em;
border-radius: 50%;
border: solid 2px rgb(17, 17, 17);
cursor: pointer;
width: 16px;
height: 16px;
font-weight: bold;
text-align: center;
}
}
:host-context(.dark-theme) {
.info-icon {
border: solid 2px #bcc5ce;
}
a {
color: #bcc5ce;
}
}
:host {
::ng-deep {
.node-hidden, .link-hidden {
display: none;
}
.link {
stroke: #9b9b9b;
stroke-width: 3px;
fill: none;
&.highlighted {
stroke: #4da1ff;
}
}
.injector-graph svg {
cursor: move;
}
.node {
cursor: pointer;
&.highlighted {
.node-container, .node-container:hover {
background: oklch(0.65 0.25 266 / 1);
border-color: white;
color: white;
font-weight: 400;
}
&.selected {
.node-container, .node-container:hover {
color: oklch(0.65 0.25 266 / 1);;
background: white;
border-width: 3px;
border-color: oklch(0.65 0.25 266 / 1);
font-weight: 800;
}
}
}
.node-container {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
color: #000;
font-size: 16px;
box-sizing: border-box;
border-radius: 2px;
border-style: solid;
border-width: 2px;
font-weight: 300;
}
.node-environment {
border: 1px solid #ff7a7e;
background: #f9c2c5;
&:hover {
background: #ff7a7e;
}
}
.node-imported-module {
border-color: #8838f7;
background: #c79eff;
&:hover {
background: #8838f7;
}
}
.node-element {
border-color: #28ab2c;
background: #a7d5a9;
&:hover {
background: #28ab2c;
}
}
.node-null {
border: 1px solid #8b8b8b;
background: white;
}
.node-label {
color: black;
font-weight: 300;
font-size: 18px;
text-align: center;
}
}
}
}
:host-context(.dark-theme) ::ng-deep {
.legend {
background: #2f2c2c;
}
.link {
stroke: #bcc5ce;
fill: none;
&.highlighted {
stroke: #4da1ff;
}
}
.arrow {
fill: white;
}
.node-label {
color: #000;
}
}