@@ -216,7 +216,7 @@ export class PlotlyGraph extends HTMLElement {
216216 } ,
217217 } ,
218218 config . defaults ?. entity ,
219- entity ,
219+ entity
220220 ) ;
221221
222222 return merge (
@@ -227,19 +227,20 @@ export class PlotlyGraph extends HTMLElement {
227227 { lambda : entity . lambda ? window . eval ( entity . lambda ) : undefined }
228228 ) ;
229229 } ) ,
230-
231- layout : {
232- yaxis : config . defaults ?. yaxis ,
233- yaxis2 : config . defaults ?. yaxis ,
234- yaxis3 : config . defaults ?. yaxis ,
235- yaxis4 : config . defaults ?. yaxis ,
236- yaxis5 : config . defaults ?. yaxis ,
237- yaxis6 : config . defaults ?. yaxis ,
238- yaxis7 : config . defaults ?. yaxis ,
239- yaxis8 : config . defaults ?. yaxis ,
240- yaxis9 : config . defaults ?. yaxis ,
241- ...config . layout ,
242- } ,
230+ layout : merge (
231+ {
232+ yaxis : merge ( { } , config . defaults ?. yaxes ) ,
233+ yaxis2 : merge ( { } , config . defaults ?. yaxes ) ,
234+ yaxis3 : merge ( { } , config . defaults ?. yaxes ) ,
235+ yaxis4 : merge ( { } , config . defaults ?. yaxes ) ,
236+ yaxis5 : merge ( { } , config . defaults ?. yaxes ) ,
237+ yaxis6 : merge ( { } , config . defaults ?. yaxes ) ,
238+ yaxis7 : merge ( { } , config . defaults ?. yaxes ) ,
239+ yaxis8 : merge ( { } , config . defaults ?. yaxes ) ,
240+ yaxis9 : merge ( { } , config . defaults ?. yaxes ) ,
241+ } ,
242+ config . layout
243+ ) ,
243244 config : {
244245 ...config . config ,
245246 } ,
@@ -331,7 +332,7 @@ export class PlotlyGraph extends HTMLElement {
331332 console . error ( e ) ;
332333 }
333334 }
334- const customdatum = { unit_of_measurement : unit , name } ;
335+ const customdatum = { unit_of_measurement : unit , name, attributes } ;
335336 const customdata = xs . map ( ( ) => customdatum ) ;
336337 const mergedTrace = merge (
337338 {
@@ -471,4 +472,4 @@ window.customCards.push({
471472 description : "Plotly in HA" , // Optional
472473} ) ;
473474
474- customElements . define ( componentName , PlotlyGraph ) ;
475+ customElements . define ( componentName , PlotlyGraph ) ;
0 commit comments