Skip to content

Commit afbc113

Browse files
authored
Fix some props in defaults.yaxes being ignored (#208)
1 parent 57796fb commit afbc113

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

src/parse-config/defaults.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -145,17 +145,8 @@ export function addPreParsingDefaults(
145145
yaml_in: InputConfig,
146146
css_vars: HATheme
147147
): InputConfig {
148-
let yaml = merge({}, yaml_in, defaultYamlRequired, yaml_in);
149148
// merging in two steps to ensure ha_theme and raw_plotly_config took its default value
150-
yaml = merge(
151-
{},
152-
yaml,
153-
{
154-
layout: yaml.ha_theme ? getThemedLayout(css_vars) : {},
155-
},
156-
yaml.raw_plotly_config ? {} : defaultYamlOptional,
157-
yaml_in
158-
);
149+
let yaml = merge({}, yaml_in, defaultYamlRequired, yaml_in);
159150
for (let i = 1; i < 31; i++) {
160151
const yaxis = "yaxis" + (i == 1 ? "" : i);
161152
yaml.layout[yaxis] = merge(
@@ -165,6 +156,17 @@ export function addPreParsingDefaults(
165156
yaml.layout[yaxis]
166157
);
167158
}
159+
160+
yaml = merge(
161+
{},
162+
yaml,
163+
{
164+
layout: yaml.ha_theme ? getThemedLayout(css_vars) : {},
165+
},
166+
yaml.raw_plotly_config ? {} : defaultYamlOptional,
167+
yaml
168+
);
169+
168170
yaml.entities = yaml.entities.map((entity) => {
169171
if (typeof entity === "string") entity = { entity };
170172
entity.entity ??= "";

0 commit comments

Comments
 (0)