File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed
Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -260,15 +260,17 @@ export class SankeyChart extends SubscribeMixin(LitElement) {
260260 const grid = sources . find ( s => s . type === 'grid' ) ;
261261 if ( grid && grid ?. flow_to ?. length ) {
262262 // grid export
263- sections [ 1 ] . entities . unshift ( {
264- entity_id : grid . flow_to [ 0 ] . stat_energy_to ,
265- substract_entities : ( grid . flow_from || [ ] ) . map ( e => e . stat_energy_from ) ,
266- type : 'entity' ,
267- color : getEnergySourceColor ( grid . type ) ,
268- children : [ ] ,
269- } ) ;
270- sections [ 0 ] . entities . forEach ( entity => {
271- entity . children . unshift ( grid . stat_energy_to ! ) ;
263+ grid ?. flow_to . forEach ( ( { stat_energy_to} ) => {
264+ sections [ 1 ] . entities . unshift ( {
265+ entity_id : stat_energy_to ,
266+ substract_entities : ( grid . flow_from || [ ] ) . map ( e => e . stat_energy_from ) ,
267+ type : 'entity' ,
268+ color : getEnergySourceColor ( grid . type ) ,
269+ children : [ ] ,
270+ } ) ;
271+ sections [ 0 ] . entities . forEach ( entity => {
272+ entity . children . unshift ( stat_energy_to ) ;
273+ } ) ;
272274 } ) ;
273275 }
274276
You can’t perform that action at this time.
0 commit comments