Regressions in rack elevations SVG rendering #3186

Closed
opened 2025-12-29 18:26:25 +01:00 by adam · 12 comments
Owner

Originally created by @candlerb on GitHub (Jan 19, 2020).

The new SVG rendering of rack elevations has lost some useful features of the old HTML rendering.

Environment

  • Python version: 3.5.2
  • NetBox version: 2.7.1

Steps to Reproduce

View rack elevations

Expected vs Observed Behavior

  1. Devices with no name are now rendered as "None". Previously it showed the device model instead (#2634)

  2. When you hover over a device name, you used to get some basic device information as a tooltip. This no longer happens.

  3. When you view the front face of a rack, but there is a device in the corresponding rear position, you used to get some shading to indicate this. This no longer appears - it looks like the rack U is completely unoccupied.

  4. For devices which are butted together and have the same role/colour, there is no longer any line separating them - see example below. This comprises two 2U boxes and a 4U box, but is now very hard to see.

    image

    (here viewed in Chrome 79, but same in Firefox 72 - both macOS)

Originally created by @candlerb on GitHub (Jan 19, 2020). The new SVG rendering of rack elevations has lost some useful features of the old HTML rendering. ### Environment * Python version: 3.5.2 * NetBox version: 2.7.1 ### Steps to Reproduce View rack elevations ### Expected vs Observed Behavior 1. Devices with no name are now rendered as "None". Previously it showed the device model instead (#2634) 2. When you hover over a device name, you used to get some basic device information as a [tooltip](https://stackoverflow.com/questions/19637443/how-to-show-tooltip-for-text-in-svg). This no longer happens. 3. When you view the front face of a rack, but there is a device in the corresponding rear position, you used to get some shading to indicate this. This no longer appears - it looks like the rack U is completely unoccupied. 4. For devices which are butted together and have the same role/colour, there is no longer any line separating them - see example below. This comprises two 2U boxes and a 4U box, but is now very hard to see. ![image](https://user-images.githubusercontent.com/44789/72678862-bc35a780-3aa1-11ea-8c35-8db1f0d7209d.png) (here viewed in Chrome 79, but same in Firefox 72 - both macOS)
adam closed this issue 2025-12-29 18:26:26 +01:00
Author
Owner

@candlerb commented on GitHub (Jan 19, 2020):

I can confirm that in Chrome at least, if you add a <title> element which is the first child of <a>, then it gets rendered as a tooltip.

<a xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="black" target="_top" xlink:href="/dcim/devices/576/">
  <title>Here is some info</title>
  <rect fill="#ff9800" height="40" width="230" x="0" y="740"/>
  <text fill="#ffffff" x="115.0" y="760.0">dar14</text>
</a>
@candlerb commented on GitHub (Jan 19, 2020): I can confirm that in Chrome at least, if you add a `<title>` element which is the first child of `<a>`, then it gets rendered as a tooltip. ``` <a xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="black" target="_top" xlink:href="/dcim/devices/576/"> <title>Here is some info</title> <rect fill="#ff9800" height="40" width="230" x="0" y="740"/> <text fill="#ffffff" x="115.0" y="760.0">dar14</text> </a> ```
Author
Owner

@xonacs commented on GitHub (Jan 20, 2020):

Seconded - All of these are causing a serious headache for our teams which used these views for allocating equipment and general planning. It's also complicated to Audit a rack as now we have to click each device as opposed to hovering about it.

@xonacs commented on GitHub (Jan 20, 2020): Seconded - All of these are causing a serious headache for our teams which used these views for allocating equipment and general planning. It's also complicated to Audit a rack as now we have to click each device as opposed to hovering about it.
Author
Owner

@MelanieTanaka commented on GitHub (Jan 20, 2020):

We noticed this when testing 2.7 this weekend, major stopper for us. Hopefully this is not the intended direction of the project going forward or we will have to find another solution.

@MelanieTanaka commented on GitHub (Jan 20, 2020): We noticed this when testing 2.7 this weekend, major stopper for us. Hopefully this is not the intended direction of the project going forward or we will have to find another solution.
Author
Owner

@jeremystretch commented on GitHub (Jan 20, 2020):

It's a shame we didn't get this feedback during the beta period, as it could have been addressed before the final release. Please bear in mind that despite the many, many hours I and the other maintainers put into the project, the strength of new releases depends largely on the quality of contributions from the community and feedback from early testing, as with any open source project.

I'm sure we can work on addressing this, though I have not personally had much involvement with the SVG functionality so it may take some time to devise a solution. Hopefully @hellerve can offer some insight here.

@MelanieTanaka The change to SVG rendering is permanent. If this does not suit your needs, NetBox may no longer be the right choice for you.

@jeremystretch commented on GitHub (Jan 20, 2020): It's a shame we didn't get this feedback during the beta period, as it could have been addressed before the final release. Please bear in mind that despite the many, many hours I and the other maintainers put into the project, the strength of new releases depends largely on the quality of contributions from the community and feedback from early testing, as with any open source project. I'm sure we can work on addressing this, though I have not personally had much involvement with the SVG functionality so it may take some time to devise a solution. Hopefully @hellerve can offer some insight here. @MelanieTanaka The change to SVG rendering is permanent. If this does not suit your needs, NetBox may no longer be the right choice for you.
Author
Owner

@hellerve commented on GitHub (Jan 20, 2020):

Hey! I’m sorry this is problematic for you. The good news is that a lot of this is fixable.

  1. This should not be a problem. I can make a PR for this this week.
  2. If @candlerb’s insight is correct, this shouldn’t be a problem either, and we can fix that without a lot of trouble.
  3. This seems like a bug to me; when I last looked at this code, I’m pretty sure this worked. We should look into it.
  4. This should just be a gray (or whatever color) border around the SVG element. I’m pretty sure this is an easy fix as well.

I can look into this later this week and fix some of the code. I think @lampwins did some work here as well, but I’m not sure how much.

@hellerve commented on GitHub (Jan 20, 2020): Hey! I’m sorry this is problematic for you. The good news is that a lot of this is fixable. 1. This should not be a problem. I can make a PR for this this week. 2. If @candlerb’s insight is correct, this shouldn’t be a problem either, and we can fix that without a lot of trouble. 3. This seems like a bug to me; when I last looked at this code, I’m pretty sure this worked. We should look into it. 4. This should just be a gray (or whatever color) border around the SVG element. I’m pretty sure this is an easy fix as well. I can look into this later this week and fix some of the code. I think @lampwins did some work here as well, but I’m not sure how much.
Author
Owner

@MelanieTanaka commented on GitHub (Jan 20, 2020):

@MelanieTanaka The change to SVG rendering is permanent. If this does not suit your needs, NetBox may no longer be the right choice for you.

For us it isn't the SVG itself but the 4 points highlighted by candlerb. If those changes are permanent and not considered something that requires a fix then yes we will find something else.
Thanks,

@MelanieTanaka commented on GitHub (Jan 20, 2020): > @MelanieTanaka The change to SVG rendering is permanent. If this does not suit your needs, NetBox may no longer be the right choice for you. For us it isn't the SVG itself but the 4 points highlighted by candlerb. If those changes are permanent and not considered something that requires a fix then yes we will find something else. Thanks,
Author
Owner

@jeremystretch commented on GitHub (Jan 20, 2020):

@MelanieTanaka are you interested in volunteering to take on any of these changes?

@jeremystretch commented on GitHub (Jan 20, 2020): @MelanieTanaka are you interested in volunteering to take on any of these changes?
Author
Owner

@jeremystretch commented on GitHub (Jan 20, 2020):

@candlerb or @hellerve would one of you mind breaking these into four separate issues so that we can track them separately?

@jeremystretch commented on GitHub (Jan 20, 2020): @candlerb or @hellerve would one of you mind breaking these into four separate issues so that we can track them separately?
Author
Owner

@MelanieTanaka commented on GitHub (Jan 20, 2020):

Unfortunately none of our team are developers so we can't contribute any of those changes. Maybe one day management will allow me to hire a developer but until then we're at the mercy of whatever others make.

@MelanieTanaka commented on GitHub (Jan 20, 2020): Unfortunately none of our team are developers so we can't contribute any of those changes. Maybe one day management will allow me to hire a developer but until then we're at the mercy of whatever others make.
Author
Owner

@hellerve commented on GitHub (Jan 20, 2020):

I’ve split it up very quickly. Feel free to edit any and all of them if the wording seems off.

@hellerve commented on GitHub (Jan 20, 2020): I’ve split it up very quickly. Feel free to edit any and all of them if the wording seems off.
Author
Owner

@jeremystretch commented on GitHub (Jan 21, 2020):

Thanks @hellerve. Closing this out as it is superseded by the individual issues.

@jeremystretch commented on GitHub (Jan 21, 2020): Thanks @hellerve. Closing this out as it is superseded by the individual issues.
Author
Owner

@hellerve commented on GitHub (Jan 21, 2020):

I’ve pushed potential fixes for all 4 of the regressions. I’d encourage everyone to test this if possible, especially if it is vital for your adoption of Netbox (pinging @MelanieTanaka, @xonacs)!

@hellerve commented on GitHub (Jan 21, 2020): I’ve pushed potential fixes for all 4 of the regressions. I’d encourage everyone to test this if possible, especially if it is vital for your adoption of Netbox (pinging @MelanieTanaka, @xonacs)!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3186