mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
Fix condition in tracing graph (#24075)
This commit is contained in:
parent
553bb61db7
commit
7cbdb1dcfd
@ -1,4 +1,4 @@
|
||||
import { css, html, LitElement, svg } from "lit";
|
||||
import { css, html, LitElement, nothing, svg } from "lit";
|
||||
import { customElement, property, state } from "lit/decorators";
|
||||
import { classMap } from "lit/directives/class-map";
|
||||
import { BRANCH_HEIGHT, SPACING } from "./hat-graph-const";
|
||||
@ -41,8 +41,8 @@ export class HatGraphBranch extends LitElement {
|
||||
branches.push({
|
||||
x: width / 2 + total_width,
|
||||
height,
|
||||
start: c.hasAttribute("graphStart"),
|
||||
end: c.hasAttribute("graphEnd"),
|
||||
start: c.hasAttribute("graph-start"),
|
||||
end: c.hasAttribute("graph-end"),
|
||||
track: c.hasAttribute("track"),
|
||||
});
|
||||
total_width += width;
|
||||
@ -65,11 +65,8 @@ export class HatGraphBranch extends LitElement {
|
||||
return html`
|
||||
<slot name="head"></slot>
|
||||
${!this.start
|
||||
? svg`
|
||||
<svg
|
||||
id="top"
|
||||
width="${this._totalWidth}"
|
||||
>
|
||||
? html`
|
||||
<svg id="top" width=${this._totalWidth}>
|
||||
${this._branches.map((branch) =>
|
||||
branch.start
|
||||
? ""
|
||||
@ -86,7 +83,7 @@ export class HatGraphBranch extends LitElement {
|
||||
)}
|
||||
</svg>
|
||||
`
|
||||
: ""}
|
||||
: nothing}
|
||||
<div id="branches">
|
||||
<svg id="lines" width=${this._totalWidth} height=${this._maxHeight}>
|
||||
${this._branches.map((branch) => {
|
||||
@ -107,11 +104,8 @@ export class HatGraphBranch extends LitElement {
|
||||
</div>
|
||||
|
||||
${!this.short
|
||||
? svg`
|
||||
<svg
|
||||
id="bottom"
|
||||
width="${this._totalWidth}"
|
||||
>
|
||||
? html`
|
||||
<svg id="bottom" width=${this._totalWidth}>
|
||||
${this._branches.map((branch) => {
|
||||
if (branch.end) return "";
|
||||
return svg`
|
||||
@ -128,7 +122,7 @@ export class HatGraphBranch extends LitElement {
|
||||
})}
|
||||
</svg>
|
||||
`
|
||||
: ""}
|
||||
: nothing}
|
||||
`;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user