Skip to content

Commit

Permalink
Fix readme formatting (#527)
Browse files Browse the repository at this point in the history
  • Loading branch information
dcbr authored Jan 21, 2025
1 parent eafceb2 commit c958dfa
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -1072,24 +1072,31 @@ Below is an example YAML configuration that is split into several corresponding
<table>
<tr>
<th>YAML configuration</th>
<th>Preset configurations</th>
</tr>
<tr style="vertical-align:top">
<tr>
<td>

```yaml
hours_to_show: current_day
time_offset: -24h
defaults:
entity:
hovertemplate: "$fn ({ get }) => `%{y:,.1f} ${get('.unit_of_measurement')}<extra>${get('.name')}</extra>`"
hovertemplate: |
$fn ({ get }) => (
`%{y:,.1f} ${get('.unit_of_measurement')}<extra>${get('.name')}</extra>`
)
xaxes:
showspikes: true
spikemode: across
spikethickness: -2
```
</td>
</tr>
<tr>
<th>Preset configurations</th>
</tr>
<tr>
<td>
```js
Expand All @@ -1101,7 +1108,9 @@ window.PlotlyGraphCardPresets = {
simpleHover: { // Start of preset with name 'simpleHover'
defaults: {
entity: {
hovertemplate: ({get}) => `%{y:,.1f} ${get(".unit_of_measurement")}<extra>${get(".name")}</extra>`,
hovertemplate: ({get}) => (
`%{y:,.1f} ${get('.unit_of_measurement')}<extra>${get('.name')}</extra>`
),
},
},
},
Expand Down

0 comments on commit c958dfa

Please sign in to comment.