File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ console.info(
4646
4747const ENERGY_DATA_TIMEOUT = 10000 ;
4848
49- type DeviceNode = { id : string ; name ?: string ; parent ?: string } ;
49+ type DeviceNode = { id : string ; name ?: string ; parent ?: string ; color ?: string } ;
5050
5151@customElement ( 'sankey-chart' )
5252class SankeyChart extends SubscribeMixin ( LitElement ) {
@@ -245,6 +245,7 @@ class SankeyChart extends SubscribeMixin(LitElement) {
245245 id : device . stat_consumption ,
246246 name : device . name ,
247247 parent : device . included_in_stat ,
248+ color : `var(--color-${ ( idx % 54 ) + 1 } )` ,
248249 } ;
249250 if ( node . parent ) {
250251 parentLinks [ node . id ] = node . parent ;
@@ -433,6 +434,7 @@ class SankeyChart extends SubscribeMixin(LitElement) {
433434 section : currentSection ,
434435 type : 'entity' ,
435436 name : d . name || '' ,
437+ color : d . color ,
436438 } ) ;
437439 const children = deviceSections [ i + 1 ] ?. filter ( c => c . parent === d . id ) ;
438440 children ?. forEach ( c => {
You can’t perform that action at this time.
0 commit comments