mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-15 21:36:36 +00:00
Disable network graph emphasis on mobile
This commit is contained in:
parent
2e8203f666
commit
a06d51f093
@ -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`<ha-chart-base
|
||||
.hass=${this.hass}
|
||||
.data=${this._getSeries(
|
||||
this.data,
|
||||
this._physicsEnabled,
|
||||
this._reducedMotion,
|
||||
this._showLabels
|
||||
this._showLabels,
|
||||
isMobile
|
||||
)}
|
||||
.options=${this._createOptions(this.data?.categories)}
|
||||
height="100%"
|
||||
@ -176,7 +180,8 @@ export class HaNetworkGraph extends LitElement {
|
||||
data: NetworkData,
|
||||
physicsEnabled: boolean,
|
||||
reducedMotion: boolean,
|
||||
showLabels: boolean
|
||||
showLabels: boolean,
|
||||
isMobile: boolean
|
||||
) => {
|
||||
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],
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user