Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename base sankey chart tag so it doesn't conflict with the custom card #23600

Merged
merged 1 commit into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ const NODE_WIDTH = 15;
const FONT_SIZE = 12;
const MIN_DISTANCE = FONT_SIZE / 2;

@customElement("sankey-chart")
export class SankeyChart extends LitElement {
@customElement("ha-sankey-chart")
export class HaSankeyChart extends LitElement {
@property({ attribute: false }) public hass!: HomeAssistant;

@property({ attribute: false }) public data: SankeyChartData = {
Expand Down Expand Up @@ -539,6 +539,6 @@ export class SankeyChart extends LitElement {

declare global {
interface HTMLElementTagNameMap {
"sankey-chart": SankeyChart;
"ha-sankey-chart": HaSankeyChart;
}
}
8 changes: 4 additions & 4 deletions src/panels/lovelace/cards/energy/hui-energy-sankey-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import { SubscribeMixin } from "../../../../mixins/subscribe-mixin";
import type { HomeAssistant } from "../../../../types";
import type { LovelaceCard, LovelaceGridOptions } from "../../types";
import type { EnergySankeyCardConfig } from "../types";
import "../../../../components/chart/sankey-chart";
import type { Link, Node } from "../../../../components/chart/sankey-chart";
import "../../../../components/chart/ha-sankey-chart";
import type { Link, Node } from "../../../../components/chart/ha-sankey-chart";
import { getGraphColorByIndex } from "../../../../common/color/colors";
import { formatNumber } from "../../../../common/number/format_number";

Expand Down Expand Up @@ -399,13 +399,13 @@ class HuiEnergySankeyCard
<ha-card .header=${this._config.title}>
<div class="card-content">
${hasData
? html`<sankey-chart
? html`<ha-sankey-chart
.data=${{ nodes, links }}
.vertical=${this._config.layout === "vertical"}
.loadingText=${this.hass.localize(
"ui.panel.lovelace.cards.energy.loading"
)}
></sankey-chart>`
></ha-sankey-chart>`
: html`${this.hass.localize(
"ui.panel.lovelace.cards.energy.no_data_period"
)}`}
Expand Down
Loading