Increase size of rect using floorplan.set_style

currently trying to create a battery element for my floorplan to show the current percentage of my iPhone, i’m trying to re-create the moisture sensor used in the home example copied the code swapped out for my sensor but nothing happens, can somebody explain what i’m doing wrong, the element displays but the size doesn’t change, I can hover and click on the element but the height is unchanged

                - entity: sensor.mac_pro_battery_state
                    foo: bar
                  state: on
                    action: call-service
                    service: floorplan.style_set
                      element: mac_book_battery_level  
                      style:  |
                        var height = Math.ceil(elements['sensor.mac_pro_battery_state'].getBBox().height);
                        return `transform: translate(0, ${height - Math.floor(entity.attributes.state / (100 / height))}px)`;

Sorry I only just saw this. There are errors in your YAML by the looks of it. You shouldn’t have the attributes line or the state: on line. Neither of those are in the example.

Are you using the SVG from the example? If you have created your own it might the element type is wrong.