vsview-graph 0.1.0__tar.gz → 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/PKG-INFO +2 -2
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/pyproject.toml +1 -1
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/src/python/vsview_graph/bridge.py +1 -0
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/src/python/vsview_graph/plugin.py +9 -4
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/src/python/vsview_graph/settings.py +13 -1
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/src/ts/canvas/cytoscape.test.ts +2 -0
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/src/ts/canvas/cytoscape.ts +37 -0
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/src/ts/index.html +3 -2
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/src/ts/styles/base.css +8 -4
- vsview_graph-0.2.0/src/ts/styles/overlay.css +96 -0
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/src/ts/types.ts +1 -0
- vsview_graph-0.2.0/src/ts/ui/disclosure.css +84 -0
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/src/ts/ui/hud.css +10 -6
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/src/ts/ui/hud.test.ts +11 -0
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/src/ts/ui/hud.ts +42 -13
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/src/ts/ui/inspector.css +13 -35
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/src/ts/ui/inspector.test.ts +19 -19
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/src/ts/ui/inspector.ts +24 -24
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/src/ts/ui/overview.css +12 -34
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/src/ts/ui/overview.test.ts +5 -3
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/src/ts/ui/overview.ts +36 -22
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/src/ts/utils/theme.test.ts +11 -0
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/src/ts/utils/theme.ts +1 -0
- vsview_graph-0.1.0/src/ts/styles/overlay.css +0 -66
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/.env.example +0 -0
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/.gitignore +0 -0
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/LICENSE +0 -0
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/README.md +0 -0
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/package.json +0 -0
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/src/python/vsview_graph/__init__.py +0 -0
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/src/python/vsview_graph/analysis.py +0 -0
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/src/python/vsview_graph/call.py +0 -0
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/src/python/vsview_graph/constants.py +0 -0
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/src/python/vsview_graph/py.typed +0 -0
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/src/python/vsview_graph/theme.py +0 -0
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/src/python/vsview_graph/web.py +0 -0
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/src/ts/bridge/python.test.ts +0 -0
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/src/ts/bridge/python.ts +0 -0
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/src/ts/canvas/heatmap.test.ts +0 -0
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/src/ts/canvas/heatmap.ts +0 -0
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/src/ts/canvas/visual-state.test.ts +0 -0
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/src/ts/canvas/visual-state.ts +0 -0
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/src/ts/main.test.ts +0 -0
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/src/ts/main.ts +0 -0
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/src/ts/manager.test.ts +0 -0
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/src/ts/manager.ts +0 -0
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/src/ts/ui/keybindings.test.ts +0 -0
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/src/ts/ui/keybindings.ts +0 -0
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/src/ts/utils/analysis.test.ts +0 -0
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/src/ts/utils/analysis.ts +0 -0
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/src/ts/utils/format.test.ts +0 -0
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/src/ts/utils/format.ts +0 -0
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/src/ts/utils/search.test.ts +0 -0
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/src/ts/utils/search.ts +0 -0
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/src/ts/utils/test-helpers.ts +0 -0
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/src/ts/utils/traversal.test.ts +0 -0
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/src/ts/utils/traversal.ts +0 -0
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/tsconfig.json +0 -0
- {vsview_graph-0.1.0 → vsview_graph-0.2.0}/vite.config.ts +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: vsview-graph
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: Interactive dependency graph visualizer for vsview using Cytoscape.js and vsgraph
|
|
5
5
|
Project-URL: Documentation, https://jaded-encoding-thaumaturgy.github.io/vs-view/plugins/second-party/#dependency-graph
|
|
6
6
|
Project-URL: Source Code, https://github.com/Jaded-Encoding-Thaumaturgy/vs-view/tree/main/src/plugins/graph/
|
|
@@ -21,7 +21,7 @@ Classifier: Topic :: Multimedia :: Video
|
|
|
21
21
|
Classifier: Typing :: Typed
|
|
22
22
|
Requires-Python: >=3.12
|
|
23
23
|
Requires-Dist: vapoursynth-graph>=1.0.2
|
|
24
|
-
Requires-Dist: vsview>=0.
|
|
24
|
+
Requires-Dist: vsview>=0.16.0
|
|
25
25
|
Description-Content-Type: text/markdown
|
|
26
26
|
|
|
27
27
|
# VSView Graph
|
|
@@ -25,7 +25,7 @@ classifiers = [
|
|
|
25
25
|
"Topic :: Multimedia :: Video",
|
|
26
26
|
"Typing :: Typed",
|
|
27
27
|
]
|
|
28
|
-
dependencies = ["vapoursynth-graph>=1.0.2", "vsview>=0.
|
|
28
|
+
dependencies = ["vapoursynth-graph>=1.0.2", "vsview>=0.16.0"]
|
|
29
29
|
dynamic = ["version"]
|
|
30
30
|
|
|
31
31
|
[project.entry-points.vsview]
|
|
@@ -13,6 +13,7 @@ from jetpytools import fallback
|
|
|
13
13
|
from PySide6.QtCore import QUrl, QUrlQuery, Slot
|
|
14
14
|
from PySide6.QtGui import QCursor, QImage, QShowEvent
|
|
15
15
|
from PySide6.QtWidgets import QApplication, QFileDialog, QMenu, QVBoxLayout, QWidget
|
|
16
|
+
from vsengine.futures import UnifiedFuture
|
|
16
17
|
|
|
17
18
|
from vsview.api import PluginAPI, VideoOutputProxy, WidgetPluginBase, run_in_background, run_in_loop
|
|
18
19
|
from vsview.env import getenv_bool
|
|
@@ -194,11 +195,14 @@ class GraphPlugin(WidgetPluginBase[GraphSettings, None]):
|
|
|
194
195
|
{"outputs": outputs, "following": self._selected_idx is None},
|
|
195
196
|
)
|
|
196
197
|
|
|
197
|
-
|
|
198
|
-
def update_graph(self, *, force_layout: bool = False, refresh: bool = False) -> None:
|
|
198
|
+
def update_graph(self, *, force_layout: bool = False, refresh: bool = False) -> UnifiedFuture[None]:
|
|
199
199
|
if not self.view.bridge.is_ready:
|
|
200
|
-
return
|
|
200
|
+
return UnifiedFuture.resolve(None)
|
|
201
201
|
|
|
202
|
+
return self._update_graph(force_layout=force_layout, refresh=refresh)
|
|
203
|
+
|
|
204
|
+
@run_in_background(name="UpdateGraph")
|
|
205
|
+
def _update_graph(self, *, force_layout: bool, refresh: bool) -> None:
|
|
202
206
|
if self.api.is_playing or (not force_layout and not vsengine.from_thread(self.isVisible).result()):
|
|
203
207
|
self._is_dirty = True
|
|
204
208
|
return
|
|
@@ -350,6 +354,7 @@ class GraphPlugin(WidgetPluginBase[GraphSettings, None]):
|
|
|
350
354
|
"showTimings": settings.show_timings,
|
|
351
355
|
"timingUnit": settings.timing_unit,
|
|
352
356
|
"autoFitOnReload": settings.auto_fit_on_reload,
|
|
357
|
+
"wheelSensitivity": settings.wheel_zoom_speed,
|
|
353
358
|
}
|
|
354
359
|
|
|
355
360
|
# globalSettingsChanged fires for every global save, including other plugins' settings.
|
|
@@ -479,7 +484,7 @@ class GraphPlugin(WidgetPluginBase[GraphSettings, None]):
|
|
|
479
484
|
|
|
480
485
|
with self.api.vs_context():
|
|
481
486
|
try:
|
|
482
|
-
graph = vsgraph.get_graph(voutput.
|
|
487
|
+
graph = vsgraph.get_graph(voutput.source_clip)
|
|
483
488
|
cached = CachedGraph(graph=graph, payload=enrich_cytoscape_payload(graph, graph.to_cytoscape()))
|
|
484
489
|
except Exception as e:
|
|
485
490
|
logger.error("Failed to extract graph from output %d: %s", key, e)
|
|
@@ -7,7 +7,7 @@ from pydantic import BaseModel
|
|
|
7
7
|
from PySide6.QtCore import QKeyCombination, Qt
|
|
8
8
|
from PySide6.QtGui import QKeySequence
|
|
9
9
|
|
|
10
|
-
from vsview.api import ActionDefinition, Checkbox, Dropdown, Spin
|
|
10
|
+
from vsview.api import ActionDefinition, Checkbox, DoubleSpin, Dropdown, Spin
|
|
11
11
|
|
|
12
12
|
from .bridge import KeybindingRule
|
|
13
13
|
from .constants import PLUGIN_IDENTIFIER
|
|
@@ -80,6 +80,18 @@ class GraphSettings(BaseModel):
|
|
|
80
80
|
),
|
|
81
81
|
] = True
|
|
82
82
|
|
|
83
|
+
wheel_zoom_speed: Annotated[
|
|
84
|
+
float,
|
|
85
|
+
DoubleSpin(
|
|
86
|
+
label="Wheel Zoom Speed",
|
|
87
|
+
min=0.5,
|
|
88
|
+
max=10.0,
|
|
89
|
+
suffix="x",
|
|
90
|
+
decimals=1,
|
|
91
|
+
tooltip="How much each mouse wheel step zooms the graph.\nHigher values zoom faster.",
|
|
92
|
+
),
|
|
93
|
+
] = 3.0
|
|
94
|
+
|
|
83
95
|
show_timings: Annotated[
|
|
84
96
|
bool,
|
|
85
97
|
Checkbox(
|
|
@@ -171,8 +171,10 @@ describe('CytoscapeCanvas', () => {
|
|
|
171
171
|
nodeSep: 50,
|
|
172
172
|
showTimings: false,
|
|
173
173
|
autoFitOnReload: false,
|
|
174
|
+
wheelSensitivity: 5,
|
|
174
175
|
});
|
|
175
176
|
expect(layoutSpy).toHaveBeenCalledTimes(1);
|
|
177
|
+
expect(canvas.wheelSensitivity).toBe(5);
|
|
176
178
|
expect(canvas.direction).toBe('LR');
|
|
177
179
|
expect(canvas.layout).toBe('breadthfirst');
|
|
178
180
|
expect(canvas.rankSep).toBe(80);
|
|
@@ -26,11 +26,18 @@ const LABEL_FONT = 'normal bold 14px system-ui, -apple-system, sans-serif';
|
|
|
26
26
|
const LABEL_FONT_SIZE = 14;
|
|
27
27
|
const FALLBACK_CHAR_WIDTH = 8;
|
|
28
28
|
|
|
29
|
+
// Runtime Core methods that Cytoscape's typings don't cover.
|
|
30
|
+
interface CoreInternals {
|
|
31
|
+
headless(): boolean;
|
|
32
|
+
renderer(): { wheelSensitivity?: number };
|
|
33
|
+
}
|
|
34
|
+
|
|
29
35
|
export class CytoscapeCanvas implements IDisposable {
|
|
30
36
|
private cy: cytoscape.Core | null = null;
|
|
31
37
|
private currentDirection: LayoutDirection = 'TB';
|
|
32
38
|
private _heatmapActive = false;
|
|
33
39
|
private _autoFitOnReload = true;
|
|
40
|
+
private _wheelSensitivity = 1;
|
|
34
41
|
private showTimings = true;
|
|
35
42
|
private timingUnit: TimingUnit = 'auto';
|
|
36
43
|
private selectedNodeId: string | null = null;
|
|
@@ -103,6 +110,16 @@ export class CytoscapeCanvas implements IDisposable {
|
|
|
103
110
|
this._autoFitOnReload = enabled;
|
|
104
111
|
}
|
|
105
112
|
|
|
113
|
+
public get wheelSensitivity(): number {
|
|
114
|
+
return this._wheelSensitivity;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
public set wheelSensitivity(value: number) {
|
|
118
|
+
if (this._wheelSensitivity === value) return;
|
|
119
|
+
this._wheelSensitivity = value;
|
|
120
|
+
this.applyWheelSensitivity();
|
|
121
|
+
}
|
|
122
|
+
|
|
106
123
|
public get heatmapActive(): boolean {
|
|
107
124
|
return this._heatmapActive;
|
|
108
125
|
}
|
|
@@ -137,6 +154,7 @@ export class CytoscapeCanvas implements IDisposable {
|
|
|
137
154
|
style: [],
|
|
138
155
|
});
|
|
139
156
|
|
|
157
|
+
this.applyWheelSensitivity();
|
|
140
158
|
this.setupEventHandlers();
|
|
141
159
|
}
|
|
142
160
|
|
|
@@ -234,6 +252,9 @@ export class CytoscapeCanvas implements IDisposable {
|
|
|
234
252
|
if (options.autoFitOnReload !== undefined) {
|
|
235
253
|
this._autoFitOnReload = options.autoFitOnReload;
|
|
236
254
|
}
|
|
255
|
+
if (options.wheelSensitivity !== undefined) {
|
|
256
|
+
this.wheelSensitivity = options.wheelSensitivity;
|
|
257
|
+
}
|
|
237
258
|
|
|
238
259
|
const resized = this.applyTimingDisplay(
|
|
239
260
|
options.showTimings ?? this.showTimings,
|
|
@@ -676,6 +697,22 @@ export class CytoscapeCanvas implements IDisposable {
|
|
|
676
697
|
});
|
|
677
698
|
}
|
|
678
699
|
|
|
700
|
+
private applyWheelSensitivity(): void {
|
|
701
|
+
const cy = this.cy as (cytoscape.Core & CoreInternals) | null;
|
|
702
|
+
if (!cy || cy.headless()) return;
|
|
703
|
+
|
|
704
|
+
// The wheelSensitivity option is only read at init.
|
|
705
|
+
// Its wheel handler reads this renderer field on every event, so writing it applies the change live.
|
|
706
|
+
const renderer = cy.renderer();
|
|
707
|
+
if (!('wheelSensitivity' in renderer)) {
|
|
708
|
+
console.warn(
|
|
709
|
+
'Cytoscape renderer has no wheelSensitivity field; the wheel zoom speed setting is ignored.',
|
|
710
|
+
);
|
|
711
|
+
return;
|
|
712
|
+
}
|
|
713
|
+
renderer.wheelSensitivity = this._wheelSensitivity;
|
|
714
|
+
}
|
|
715
|
+
|
|
679
716
|
private notifyNodeSelected(node: CanvasNodeData): void {
|
|
680
717
|
for (const cb of this.onNodeSelectedCallbacks) {
|
|
681
718
|
void Result.fromThrowable(() => cb(node)).mapErr((err) => {
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<meta name="color-scheme" content="light dark" />
|
|
6
7
|
<title>vsview Dependency Graph</title>
|
|
7
8
|
<script>
|
|
8
9
|
(function () {
|
|
@@ -26,10 +27,10 @@
|
|
|
26
27
|
<div id="hud" class="hud-container"></div>
|
|
27
28
|
<div id="inspector-drawer" class="inspector-drawer"></div>
|
|
28
29
|
<div id="overview" class="overview-container"></div>
|
|
29
|
-
<div id="error-banner" class="error-banner"></div>
|
|
30
|
+
<div id="error-banner" class="error-banner" role="alert"></div>
|
|
30
31
|
|
|
31
32
|
<div id="loading-overlay">
|
|
32
|
-
<
|
|
33
|
+
<progress class="loading-spinner" aria-label="Loading"></progress>
|
|
33
34
|
<div class="loading-text">Loading Dependency Graph...</div>
|
|
34
35
|
</div>
|
|
35
36
|
</div>
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
--font-family:
|
|
3
3
|
-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
|
4
4
|
--font-mono: ui-monospace, SFMono-Regular, 'Cascadia Mono', Menlo, Consolas, monospace;
|
|
5
|
+
|
|
6
|
+
color-scheme: light dark;
|
|
5
7
|
}
|
|
6
8
|
|
|
7
9
|
* {
|
|
@@ -22,6 +24,11 @@ body {
|
|
|
22
24
|
user-select: none;
|
|
23
25
|
}
|
|
24
26
|
|
|
27
|
+
:focus-visible {
|
|
28
|
+
outline: 2px solid var(--accent, var(--initial-accent));
|
|
29
|
+
outline-offset: 2px;
|
|
30
|
+
}
|
|
31
|
+
|
|
25
32
|
#app {
|
|
26
33
|
width: 100%;
|
|
27
34
|
height: 100%;
|
|
@@ -30,10 +37,7 @@ body {
|
|
|
30
37
|
}
|
|
31
38
|
|
|
32
39
|
#cy {
|
|
33
|
-
width: 100%;
|
|
34
|
-
height: 100%;
|
|
35
40
|
position: absolute;
|
|
36
|
-
|
|
37
|
-
left: 0;
|
|
41
|
+
inset: 0;
|
|
38
42
|
background-color: var(--bg-color, var(--initial-bg));
|
|
39
43
|
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/* Loading Overlay */
|
|
2
|
+
#loading-overlay {
|
|
3
|
+
position: absolute;
|
|
4
|
+
inset: 0;
|
|
5
|
+
background: var(--bg-color, var(--initial-bg));
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
align-items: center;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
gap: 12px;
|
|
11
|
+
z-index: 500;
|
|
12
|
+
transition: opacity 0.25s ease;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
#loading-overlay.fade-out {
|
|
16
|
+
opacity: 0;
|
|
17
|
+
pointer-events: none;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.loading-spinner {
|
|
21
|
+
--size: 32px;
|
|
22
|
+
--thickness: 3px;
|
|
23
|
+
--spinner-color: var(--accent, var(--initial-accent));
|
|
24
|
+
--track-color: color-mix(in srgb, var(--text-primary, var(--initial-fg)) 20%, transparent);
|
|
25
|
+
--spinner-duration: 0.8s;
|
|
26
|
+
|
|
27
|
+
appearance: none;
|
|
28
|
+
inline-size: var(--size);
|
|
29
|
+
block-size: var(--size);
|
|
30
|
+
border: 0;
|
|
31
|
+
border-radius: 50%;
|
|
32
|
+
background: conic-gradient(var(--spinner-color) 0 25%, var(--track-color) 0);
|
|
33
|
+
/* `background-clip: border-area` would be simpler but Chromium 140 does not support it. */
|
|
34
|
+
mask-image: radial-gradient(
|
|
35
|
+
farthest-side,
|
|
36
|
+
transparent calc(100% - var(--thickness)),
|
|
37
|
+
#000 calc(100% - var(--thickness))
|
|
38
|
+
);
|
|
39
|
+
animation: spin var(--spinner-duration) linear infinite;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.loading-spinner:indeterminate::-webkit-progress-bar,
|
|
43
|
+
.loading-spinner:indeterminate::-webkit-progress-value {
|
|
44
|
+
display: none;
|
|
45
|
+
background: none;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@media (forced-colors: active) {
|
|
49
|
+
.loading-spinner {
|
|
50
|
+
forced-color-adjust: none;
|
|
51
|
+
--spinner-color: CanvasText;
|
|
52
|
+
--track-color: GrayText;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
@media (prefers-reduced-motion: reduce) {
|
|
57
|
+
.loading-spinner {
|
|
58
|
+
--spinner-duration: 6s;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@keyframes spin {
|
|
63
|
+
to {
|
|
64
|
+
rotate: 1turn;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.loading-text {
|
|
69
|
+
color: var(--text-secondary, var(--initial-fg));
|
|
70
|
+
font-size: 13px;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/* Error Banner */
|
|
74
|
+
.error-banner {
|
|
75
|
+
position: absolute;
|
|
76
|
+
top: 60px;
|
|
77
|
+
left: 50%;
|
|
78
|
+
transform: translateX(-50%);
|
|
79
|
+
background: var(--danger);
|
|
80
|
+
/* Alerts keep fixed white text: any themed foreground would under-contrast one polarity. */
|
|
81
|
+
color: #ffffff;
|
|
82
|
+
padding: 8px 16px;
|
|
83
|
+
border-radius: 6px;
|
|
84
|
+
font-size: 12px;
|
|
85
|
+
font-weight: 500;
|
|
86
|
+
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
|
|
87
|
+
z-index: 150;
|
|
88
|
+
display: none;
|
|
89
|
+
max-width: 80%;
|
|
90
|
+
text-align: center;
|
|
91
|
+
word-break: break-word;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.error-banner.visible {
|
|
95
|
+
display: block;
|
|
96
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
.disclosure {
|
|
2
|
+
--disclosure-row-height: 28px;
|
|
3
|
+
--disclosure-action-height: 20px;
|
|
4
|
+
|
|
5
|
+
display: grid;
|
|
6
|
+
grid-template-columns: 1fr auto;
|
|
7
|
+
align-items: center;
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.disclosure > details {
|
|
12
|
+
grid-area: 1 / 1 / 2 / -1;
|
|
13
|
+
min-inline-size: 0;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.disclosure > .disclosure-action {
|
|
17
|
+
grid-area: 1 / 2;
|
|
18
|
+
align-self: start;
|
|
19
|
+
display: inline-flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
block-size: var(--disclosure-action-height);
|
|
22
|
+
margin-block-start: calc((var(--disclosure-row-height) - var(--disclosure-action-height)) / 2);
|
|
23
|
+
margin-inline-end: 8px;
|
|
24
|
+
z-index: 1;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.disclosure-summary {
|
|
28
|
+
display: flex;
|
|
29
|
+
align-items: center;
|
|
30
|
+
gap: 6px;
|
|
31
|
+
list-style: none;
|
|
32
|
+
cursor: pointer;
|
|
33
|
+
min-block-size: var(--disclosure-row-height);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.disclosure > details > .disclosure-summary {
|
|
37
|
+
padding-inline-end: var(--disclosure-action-space, 0px);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.disclosure-summary:focus-visible {
|
|
41
|
+
outline-offset: -2px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.disclosure-summary::before {
|
|
45
|
+
content: '';
|
|
46
|
+
flex-shrink: 0;
|
|
47
|
+
inline-size: 0.45em;
|
|
48
|
+
block-size: 0.45em;
|
|
49
|
+
margin-inline: 0.2em;
|
|
50
|
+
border-inline-end: 1.5px solid currentColor;
|
|
51
|
+
border-block-end: 1.5px solid currentColor;
|
|
52
|
+
rotate: -45deg;
|
|
53
|
+
color: var(--text-secondary);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.disclosure-summary:dir(rtl)::before {
|
|
57
|
+
rotate: 135deg;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.disclosure > details[open] > .disclosure-summary::before {
|
|
61
|
+
rotate: 45deg;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.disclosure > details::details-content {
|
|
65
|
+
interpolate-size: allow-keywords;
|
|
66
|
+
overflow: clip;
|
|
67
|
+
contain: layout;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.disclosure > details:not([open])::details-content {
|
|
71
|
+
block-size: 0;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
75
|
+
.disclosure-summary::before {
|
|
76
|
+
transition: rotate 0.15s ease;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.disclosure > details::details-content {
|
|
80
|
+
transition:
|
|
81
|
+
block-size 0.2s ease,
|
|
82
|
+
content-visibility 0.2s allow-discrete;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
gap: 6px;
|
|
14
14
|
background: color-mix(in srgb, var(--surface-color) 88%, transparent);
|
|
15
15
|
backdrop-filter: blur(12px);
|
|
16
|
-
-webkit-backdrop-filter: blur(12px);
|
|
17
16
|
border: 1px solid var(--border-color);
|
|
18
17
|
border-radius: 8px;
|
|
19
18
|
padding: 5px 8px;
|
|
@@ -42,7 +41,6 @@
|
|
|
42
41
|
font-size: 12px;
|
|
43
42
|
font-family: var(--font-family);
|
|
44
43
|
cursor: pointer;
|
|
45
|
-
outline: none;
|
|
46
44
|
}
|
|
47
45
|
|
|
48
46
|
.hud-select:hover {
|
|
@@ -59,8 +57,10 @@
|
|
|
59
57
|
font-size: 12px;
|
|
60
58
|
font-weight: 500;
|
|
61
59
|
cursor: pointer;
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
transition:
|
|
61
|
+
background-color 0.15s ease,
|
|
62
|
+
border-color 0.15s ease,
|
|
63
|
+
transform 0.15s ease;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
.hud-btn:hover {
|
|
@@ -68,8 +68,10 @@
|
|
|
68
68
|
border-color: var(--accent);
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
72
|
+
.hud-btn:active {
|
|
73
|
+
transform: translateY(1px);
|
|
74
|
+
}
|
|
73
75
|
}
|
|
74
76
|
|
|
75
77
|
.hud-btn.active {
|
|
@@ -90,6 +92,8 @@
|
|
|
90
92
|
|
|
91
93
|
.hud-search-group:focus-within {
|
|
92
94
|
border-color: var(--accent);
|
|
95
|
+
outline: 2px solid var(--accent);
|
|
96
|
+
outline-offset: 1px;
|
|
93
97
|
}
|
|
94
98
|
|
|
95
99
|
.hud-search-icon {
|
|
@@ -162,6 +162,17 @@ describe('HudController', () => {
|
|
|
162
162
|
expect(patternsBtn.classList.contains('active')).toBe(false);
|
|
163
163
|
});
|
|
164
164
|
|
|
165
|
+
it('exposes toggle state and an accessible name on every button', () => {
|
|
166
|
+
const heatmapBtn = container.querySelector<HTMLButtonElement>('#hud-heatmap')!;
|
|
167
|
+
expect(heatmapBtn.getAttribute('aria-pressed')).toBe('false');
|
|
168
|
+
heatmapBtn.click();
|
|
169
|
+
expect(heatmapBtn.getAttribute('aria-pressed')).toBe('true');
|
|
170
|
+
|
|
171
|
+
for (const btn of container.querySelectorAll<HTMLButtonElement>('.hud-btn')) {
|
|
172
|
+
expect(btn.getAttribute('aria-label') ?? btn.textContent.trim()).not.toBe('');
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
|
|
165
176
|
it('performs live search, cycles through matches via buttons/keys, and clears on Escape', () => {
|
|
166
177
|
const input = container.querySelector<HTMLInputElement>('#hud-search-input')!;
|
|
167
178
|
const countEl = container.querySelector<HTMLElement>('#hud-search-count')!;
|
|
@@ -191,13 +191,9 @@ export class HudController extends Disposable {
|
|
|
191
191
|
|
|
192
192
|
render(
|
|
193
193
|
html`
|
|
194
|
-
<div class="hud-bar">
|
|
195
|
-
${this.renderOutputSelect()}
|
|
196
|
-
|
|
197
|
-
${this.renderCanvasControls()}
|
|
198
|
-
<div class="hud-separator"></div>
|
|
199
|
-
${this.renderToolActions()}
|
|
200
|
-
<div class="hud-separator"></div>
|
|
194
|
+
<div class="hud-bar" role="group" aria-label="Graph controls">
|
|
195
|
+
${this.renderOutputSelect()} ${this.renderSeparator()} ${this.renderCanvasControls()}
|
|
196
|
+
${this.renderSeparator()} ${this.renderToolActions()} ${this.renderSeparator()}
|
|
201
197
|
${this.renderSearchBar(hasMatches)}
|
|
202
198
|
</div>
|
|
203
199
|
`,
|
|
@@ -214,6 +210,10 @@ export class HudController extends Disposable {
|
|
|
214
210
|
select.value = this.following || !active ? '-1' : String(active.index);
|
|
215
211
|
}
|
|
216
212
|
|
|
213
|
+
private renderSeparator(): TemplateResult {
|
|
214
|
+
return html`<div class="hud-separator" role="separator" aria-orientation="vertical"></div>`;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
217
|
private renderOutputSelect(): TemplateResult {
|
|
218
218
|
function renderOutputOption(out: OutputItem): TemplateResult {
|
|
219
219
|
return html`<option value=${String(out.index)}>
|
|
@@ -222,10 +222,11 @@ export class HudController extends Disposable {
|
|
|
222
222
|
}
|
|
223
223
|
|
|
224
224
|
return html`
|
|
225
|
-
<div class="hud-group">
|
|
225
|
+
<div class="hud-group" role="group" aria-label="Output">
|
|
226
226
|
<select
|
|
227
227
|
id="hud-output-select"
|
|
228
228
|
class="hud-select"
|
|
229
|
+
aria-label="Output to inspect"
|
|
229
230
|
title="Select workspace output to inspect"
|
|
230
231
|
?disabled=${this.outputs.length === 0}
|
|
231
232
|
@change=${(e: Event) => this.handleOutputChange(e)}
|
|
@@ -249,24 +250,29 @@ export class HudController extends Disposable {
|
|
|
249
250
|
|
|
250
251
|
private renderCanvasControls(): TemplateResult {
|
|
251
252
|
return html`
|
|
252
|
-
<div class="hud-group">
|
|
253
|
+
<div class="hud-group" role="group" aria-label="View">
|
|
253
254
|
<button
|
|
255
|
+
type="button"
|
|
254
256
|
id="hud-zoom-in"
|
|
255
257
|
class="hud-btn"
|
|
258
|
+
aria-label="Zoom in"
|
|
256
259
|
title="Zoom In"
|
|
257
260
|
@click=${() => this.opts.canvas.zoomIn()}
|
|
258
261
|
>
|
|
259
262
|
+
|
|
260
263
|
</button>
|
|
261
264
|
<button
|
|
265
|
+
type="button"
|
|
262
266
|
id="hud-zoom-out"
|
|
263
267
|
class="hud-btn"
|
|
268
|
+
aria-label="Zoom out"
|
|
264
269
|
title="Zoom Out"
|
|
265
270
|
@click=${() => this.opts.canvas.zoomOut()}
|
|
266
271
|
>
|
|
267
272
|
−
|
|
268
273
|
</button>
|
|
269
274
|
<button
|
|
275
|
+
type="button"
|
|
270
276
|
id="hud-fit"
|
|
271
277
|
class="hud-btn"
|
|
272
278
|
title="Fit Entire Graph"
|
|
@@ -275,16 +281,24 @@ export class HudController extends Disposable {
|
|
|
275
281
|
Fit
|
|
276
282
|
</button>
|
|
277
283
|
<button
|
|
284
|
+
type="button"
|
|
278
285
|
id="hud-reset"
|
|
279
286
|
class="hud-btn"
|
|
287
|
+
aria-label="Reset view to 1:1"
|
|
280
288
|
title="Reset View (1:1)"
|
|
281
289
|
@click=${() => this.opts.canvas.reset()}
|
|
282
290
|
>
|
|
283
291
|
1:1
|
|
284
292
|
</button>
|
|
285
293
|
<button
|
|
294
|
+
type="button"
|
|
286
295
|
id="hud-direction"
|
|
287
296
|
class="hud-btn"
|
|
297
|
+
aria-label=${
|
|
298
|
+
this.direction === 'TB'
|
|
299
|
+
? 'Layout direction TB (vertical)'
|
|
300
|
+
: 'Layout direction LR (horizontal)'
|
|
301
|
+
}
|
|
288
302
|
title="Toggle Layout Direction (Vertical / Horizontal)"
|
|
289
303
|
@click=${() => this.toggleDirection()}
|
|
290
304
|
>
|
|
@@ -296,24 +310,29 @@ export class HudController extends Disposable {
|
|
|
296
310
|
|
|
297
311
|
private renderToolActions(): TemplateResult {
|
|
298
312
|
return html`
|
|
299
|
-
<div class="hud-group">
|
|
313
|
+
<div class="hud-group" role="group" aria-label="Tools">
|
|
300
314
|
<button
|
|
315
|
+
type="button"
|
|
301
316
|
id="hud-heatmap"
|
|
302
317
|
class=${classMap({ 'hud-btn': true, active: this.heatmap })}
|
|
318
|
+
aria-pressed=${this.heatmap}
|
|
303
319
|
title="Toggle profiling heatmap (Teal: fast → Amber: moderate → Red: bottleneck)"
|
|
304
320
|
@click=${() => this.toggleHeatmap()}
|
|
305
321
|
>
|
|
306
322
|
Heatmap
|
|
307
323
|
</button>
|
|
308
324
|
<button
|
|
325
|
+
type="button"
|
|
309
326
|
id="hud-patterns"
|
|
310
327
|
class=${classMap({ 'hud-btn': true, active: this.patterns })}
|
|
328
|
+
aria-pressed=${this.patterns}
|
|
311
329
|
title="Show request pattern labels on edges"
|
|
312
330
|
@click=${() => this.togglePatterns()}
|
|
313
331
|
>
|
|
314
332
|
Patterns
|
|
315
333
|
</button>
|
|
316
334
|
<button
|
|
335
|
+
type="button"
|
|
317
336
|
id="hud-overview"
|
|
318
337
|
class="hud-btn"
|
|
319
338
|
title="Graph overview, warnings and exports"
|
|
@@ -322,8 +341,10 @@ export class HudController extends Disposable {
|
|
|
322
341
|
Overview
|
|
323
342
|
</button>
|
|
324
343
|
<button
|
|
344
|
+
type="button"
|
|
325
345
|
id="hud-refresh"
|
|
326
346
|
class="hud-btn"
|
|
347
|
+
aria-label="Refresh graph"
|
|
327
348
|
title="Re-inspect the graph and refresh timings"
|
|
328
349
|
@click=${() => this.opts.onReloadRequested()}
|
|
329
350
|
>
|
|
@@ -335,22 +356,28 @@ export class HudController extends Disposable {
|
|
|
335
356
|
|
|
336
357
|
private renderSearchBar(hasMatches: boolean): TemplateResult {
|
|
337
358
|
return html`
|
|
338
|
-
<div class="hud-group hud-search-group">
|
|
339
|
-
<span class="hud-search-icon" title=${DEFAULT_SEARCH_TOOLTIP}>🔍</span>
|
|
359
|
+
<div class="hud-group hud-search-group" role="search">
|
|
360
|
+
<span class="hud-search-icon" title=${DEFAULT_SEARCH_TOOLTIP} aria-hidden="true">🔍</span>
|
|
340
361
|
<input
|
|
341
362
|
id="hud-search-input"
|
|
342
363
|
class=${classMap({ 'hud-search-input': true, invalid: this.searchError !== null })}
|
|
343
364
|
type="text"
|
|
344
365
|
placeholder="Search filter..."
|
|
366
|
+
aria-label="Search filter"
|
|
367
|
+
aria-invalid=${this.searchError !== null}
|
|
345
368
|
title=${this.searchError ?? DEFAULT_SEARCH_TOOLTIP}
|
|
346
369
|
.value=${live(this.searchQuery)}
|
|
347
370
|
@input=${(e: Event) => this.handleSearchInput(e)}
|
|
348
371
|
@keydown=${(e: KeyboardEvent) => this.handleSearchKeyDown(e)}
|
|
349
372
|
/>
|
|
350
|
-
<span id="hud-search-count" class="hud-search-count"
|
|
373
|
+
<span id="hud-search-count" class="hud-search-count" role="status">
|
|
374
|
+
${this.getSearchCountLabel()}
|
|
375
|
+
</span>
|
|
351
376
|
<button
|
|
377
|
+
type="button"
|
|
352
378
|
id="hud-search-prev"
|
|
353
379
|
class="hud-search-btn"
|
|
380
|
+
aria-label="Previous match"
|
|
354
381
|
title="Previous match"
|
|
355
382
|
?disabled=${!hasMatches}
|
|
356
383
|
@click=${() => this.cycleMatch(-1)}
|
|
@@ -358,8 +385,10 @@ export class HudController extends Disposable {
|
|
|
358
385
|
▲
|
|
359
386
|
</button>
|
|
360
387
|
<button
|
|
388
|
+
type="button"
|
|
361
389
|
id="hud-search-next"
|
|
362
390
|
class="hud-search-btn"
|
|
391
|
+
aria-label="Next match"
|
|
363
392
|
title="Next match"
|
|
364
393
|
?disabled=${!hasMatches}
|
|
365
394
|
@click=${() => this.cycleMatch(1)}
|