azuwis / zigbee2mqtt-networkmap

Home Assistant Custom Card to show Zigbee2mqtt network map
251 stars 18 forks source link

Link label text position and node text background (+hover arrow size) #53

Closed Arkkimaagi closed 7 months ago

Arkkimaagi commented 7 months ago

Describe the bug

This can be fixed with pure CSS changes. Temporarily I fixed this with card-mod extension and following settings:

type: custom:zigbee2mqtt-networkmap
entity: sensor.zigbee2mqtt_networkmap
card_mod:
  style: |
    .node-label{
      stroke: var(--ha-card-background, var(--card-background-color, #fff));
      stroke-width: 0.5em;
      paint-order: stroke;
      stroke-opacity: 0.7;
      stroke-linejoin: round;
    }
    .link-label {
      -webkit-transform: none;
      transform: none;
      dominant-baseline: text-after-edge;
      dominant-baseline: ideographic;
    }
    .link:hover{
      stroke-width: 2;
    }

Screenshots Current implementation: image With fix: image

Home Assistant version

Core 2024.2.0 Supervisor 2024.01.1 Operating System 11.4 Frontend 20240207.0

Zigbee2mqtt version 1.35.3

OS and browser version Macos Chrome Version 121.0.6167.160 (Official Build) (x86_64)

Arkkimaagi commented 7 months ago

I added a PR that should fix these problems, but I was unable to test my code. 😬

azuwis commented 7 months ago

You can just use css: to override, should work:

type: custom:zigbee2mqtt-networkmap
entity: sensor.zigbee2mqtt_networkmap
css: |
  .node-label{
    stroke: var(--ha-card-background, var(--card-background-color, #fff));
    stroke-width: 0.5em;
    paint-order: stroke;
    stroke-opacity: 0.7;
    stroke-linejoin: round;
  }
  .link-label {
    -webkit-transform: none;
    transform: none;
    dominant-baseline: text-after-edge;
    dominant-baseline: ideographic;
  }
  .link:hover{
    stroke-width: 2;
  }