mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-16 13:56:35 +00:00
Fix tracing graph (#9782)
This commit is contained in:
parent
d8929074b5
commit
44548fdc33
@ -21,8 +21,7 @@ export class HatGraphNode extends LitElement {
|
|||||||
|
|
||||||
@property({ reflect: true, type: Boolean }) graphStart?: boolean;
|
@property({ reflect: true, type: Boolean }) graphStart?: boolean;
|
||||||
|
|
||||||
@property({ reflect: true, type: Boolean, attribute: "nofocus" })
|
@property({ type: Boolean, attribute: "nofocus" }) noFocus = false;
|
||||||
noFocus = false;
|
|
||||||
|
|
||||||
@property({ reflect: true, type: Number }) badge?: number;
|
@property({ reflect: true, type: Number }) badge?: number;
|
||||||
|
|
||||||
@ -41,8 +40,6 @@ export class HatGraphNode extends LitElement {
|
|||||||
const width = SPACING + NODE_SIZE;
|
const width = SPACING + NODE_SIZE;
|
||||||
return html`
|
return html`
|
||||||
<svg
|
<svg
|
||||||
width="${width}px"
|
|
||||||
height="${height}px"
|
|
||||||
viewBox="-${Math.ceil(width / 2)} -${this.graphStart
|
viewBox="-${Math.ceil(width / 2)} -${this.graphStart
|
||||||
? Math.ceil(height / 2)
|
? Math.ceil(height / 2)
|
||||||
: Math.ceil((NODE_SIZE + SPACING * 2) / 2)} ${width} ${height}"
|
: Math.ceil((NODE_SIZE + SPACING * 2) / 2)} ${width} ${height}"
|
||||||
@ -92,6 +89,11 @@ export class HatGraphNode extends LitElement {
|
|||||||
:host {
|
:host {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
width: calc(var(--hat-graph-node-size) + var(--hat-graph-spacing));
|
||||||
|
height: calc(var(--hat-graph-node-size) + var(--hat-graph-spacing) + 1);
|
||||||
|
}
|
||||||
|
:host([graphStart]) {
|
||||||
|
height: calc(var(--hat-graph-node-size) + 2);
|
||||||
}
|
}
|
||||||
:host([track]) {
|
:host([track]) {
|
||||||
--stroke-clr: var(--track-clr);
|
--stroke-clr: var(--track-clr);
|
||||||
@ -111,13 +113,9 @@ export class HatGraphNode extends LitElement {
|
|||||||
:host([disabled]) circle {
|
:host([disabled]) circle {
|
||||||
stroke: var(--disabled-clr);
|
stroke: var(--disabled-clr);
|
||||||
}
|
}
|
||||||
:host-context([disabled]) {
|
svg {
|
||||||
--stroke-clr: var(--disabled-clr);
|
width: 100%;
|
||||||
}
|
height: 100%;
|
||||||
:host([nofocus]):host-context([active]),
|
|
||||||
:host([nofocus]):host-context(:focus) {
|
|
||||||
--circle-clr: var(--active-clr);
|
|
||||||
--icon-clr: var(--default-icon-clr);
|
|
||||||
}
|
}
|
||||||
circle,
|
circle,
|
||||||
path.connector {
|
path.connector {
|
||||||
|
@ -149,6 +149,7 @@ export class HatScriptGraph extends LitElement {
|
|||||||
.graphStart=${graphStart}
|
.graphStart=${graphStart}
|
||||||
.iconPath=${mdiCallSplit}
|
.iconPath=${mdiCallSplit}
|
||||||
?track=${trace !== undefined}
|
?track=${trace !== undefined}
|
||||||
|
?active=${this.selected === path}
|
||||||
slot="head"
|
slot="head"
|
||||||
nofocus
|
nofocus
|
||||||
></hat-graph-node>
|
></hat-graph-node>
|
||||||
@ -228,6 +229,7 @@ export class HatScriptGraph extends LitElement {
|
|||||||
.graphStart=${graphStart}
|
.graphStart=${graphStart}
|
||||||
slot="head"
|
slot="head"
|
||||||
?track=${track}
|
?track=${track}
|
||||||
|
?active=${this.selected === path}
|
||||||
.iconPath=${mdiAbTesting}
|
.iconPath=${mdiAbTesting}
|
||||||
nofocus
|
nofocus
|
||||||
></hat-graph-node>
|
></hat-graph-node>
|
||||||
@ -241,6 +243,7 @@ export class HatScriptGraph extends LitElement {
|
|||||||
.iconPath=${mdiClose}
|
.iconPath=${mdiClose}
|
||||||
nofocus
|
nofocus
|
||||||
?track=${trackFailed}
|
?track=${trackFailed}
|
||||||
|
?active=${this.selected === path}
|
||||||
></hat-graph-node>
|
></hat-graph-node>
|
||||||
</hat-graph-branch>
|
</hat-graph-branch>
|
||||||
`;
|
`;
|
||||||
@ -315,12 +318,14 @@ export class HatScriptGraph extends LitElement {
|
|||||||
.graphStart=${graphStart}
|
.graphStart=${graphStart}
|
||||||
.iconPath=${mdiRefresh}
|
.iconPath=${mdiRefresh}
|
||||||
?track=${path in this.trace.trace}
|
?track=${path in this.trace.trace}
|
||||||
|
?active=${this.selected === path}
|
||||||
slot="head"
|
slot="head"
|
||||||
nofocus
|
nofocus
|
||||||
></hat-graph-node>
|
></hat-graph-node>
|
||||||
<hat-graph-node
|
<hat-graph-node
|
||||||
.iconPath=${mdiArrowUp}
|
.iconPath=${mdiArrowUp}
|
||||||
?track=${repeats > 1}
|
?track=${repeats > 1}
|
||||||
|
?active=${this.selected === path}
|
||||||
nofocus
|
nofocus
|
||||||
.badge=${repeats > 1 ? repeats : undefined}
|
.badge=${repeats > 1 ? repeats : undefined}
|
||||||
></hat-graph-node>
|
></hat-graph-node>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user