mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-18 06:46:35 +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) {
|
if (!GraphChart) {
|
||||||
return nothing;
|
return nothing;
|
||||||
}
|
}
|
||||||
|
const isMobile = window.matchMedia(
|
||||||
|
"all and (max-width: 450px), all and (max-height: 500px)"
|
||||||
|
).matches;
|
||||||
return html`<ha-chart-base
|
return html`<ha-chart-base
|
||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
.data=${this._getSeries(
|
.data=${this._getSeries(
|
||||||
this.data,
|
this.data,
|
||||||
this._physicsEnabled,
|
this._physicsEnabled,
|
||||||
this._reducedMotion,
|
this._reducedMotion,
|
||||||
this._showLabels
|
this._showLabels,
|
||||||
|
isMobile
|
||||||
)}
|
)}
|
||||||
.options=${this._createOptions(this.data?.categories)}
|
.options=${this._createOptions(this.data?.categories)}
|
||||||
height="100%"
|
height="100%"
|
||||||
@ -176,7 +180,8 @@ export class HaNetworkGraph extends LitElement {
|
|||||||
data: NetworkData,
|
data: NetworkData,
|
||||||
physicsEnabled: boolean,
|
physicsEnabled: boolean,
|
||||||
reducedMotion: boolean,
|
reducedMotion: boolean,
|
||||||
showLabels: boolean
|
showLabels: boolean,
|
||||||
|
isMobile: boolean
|
||||||
) => {
|
) => {
|
||||||
const containerWidth = this.clientWidth;
|
const containerWidth = this.clientWidth;
|
||||||
const containerHeight = this.clientHeight;
|
const containerHeight = this.clientHeight;
|
||||||
@ -193,7 +198,7 @@ export class HaNetworkGraph extends LitElement {
|
|||||||
position: "right",
|
position: "right",
|
||||||
},
|
},
|
||||||
emphasis: {
|
emphasis: {
|
||||||
focus: "adjacency",
|
focus: isMobile ? "none" : "adjacency",
|
||||||
},
|
},
|
||||||
force: {
|
force: {
|
||||||
repulsion: [400, 600],
|
repulsion: [400, 600],
|
||||||
|
@ -226,6 +226,7 @@ export class ZHANetworkVisualizationPage extends LitElement {
|
|||||||
: offlineColor,
|
: offlineColor,
|
||||||
},
|
},
|
||||||
polarDistance: category === 0 ? 0 : category === 1 ? 0.5 : 0.9,
|
polarDistance: category === 0 ? 0 : category === 1 ? 0.5 : 0.9,
|
||||||
|
fixed: isCoordinator,
|
||||||
});
|
});
|
||||||
|
|
||||||
// Create links (edges)
|
// Create links (edges)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user