From a06d51f093c2c87ebac013216109e75da80cc171 Mon Sep 17 00:00:00 2001 From: Petar Petrov Date: Tue, 8 Jul 2025 08:33:16 +0300 Subject: [PATCH] Disable network graph emphasis on mobile --- src/components/chart/ha-network-graph.ts | 11 ++++++++--- .../zha/zha-network-visualization-page.ts | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/components/chart/ha-network-graph.ts b/src/components/chart/ha-network-graph.ts index c9693419dc..9dbb67830b 100644 --- a/src/components/chart/ha-network-graph.ts +++ b/src/components/chart/ha-network-graph.ts @@ -115,13 +115,17 @@ export class HaNetworkGraph extends LitElement { if (!GraphChart) { return nothing; } + const isMobile = window.matchMedia( + "all and (max-width: 450px), all and (max-height: 500px)" + ).matches; return html` { const containerWidth = this.clientWidth; const containerHeight = this.clientHeight; @@ -193,7 +198,7 @@ export class HaNetworkGraph extends LitElement { position: "right", }, emphasis: { - focus: "adjacency", + focus: isMobile ? "none" : "adjacency", }, force: { repulsion: [400, 600], diff --git a/src/panels/config/integrations/integration-panels/zha/zha-network-visualization-page.ts b/src/panels/config/integrations/integration-panels/zha/zha-network-visualization-page.ts index d6eefa08b9..dffe1d8c7f 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-network-visualization-page.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-network-visualization-page.ts @@ -226,6 +226,7 @@ export class ZHANetworkVisualizationPage extends LitElement { : offlineColor, }, polarDistance: category === 0 ? 0 : category === 1 ? 0.5 : 0.9, + fixed: isCoordinator, }); // Create links (edges)