Support for SVGs #7051

Closed
opened 2025-12-29 19:48:22 +01:00 by adam · 4 comments
Owner

Originally created by @wolfspyre on GitHub (Sep 29, 2022).

NetBox version

3.3.4

Feature type

Change to existing functionality

Proposed functionality

IF an SVG were created such that it had layered graphical elements which corresponded with a device's interfaces/connections/modules/etc... then netbox could use that information to represent connections, truer to life.

for image types which don't have layers / don't have native metadata structures which might inform such relationships, a coordinate map could be used to reference where on an image a particular thing/connection resides.

IE: This could allow one to convey that 'interface 0' represents the section of pixels contained within the coordinates (10,0 and 30,20) of the device's image... 'module Y' is represented within the coordinates ( 125,0 and 250,125 ) enabling any number of interactions to be more rich/true-to-life...

Use case

SVGs have a lot of interesting properties... animations, layers, etc. I could see them being one path to have device models more realistically represent the current population and disposition of modules/interfaces/etc.

Database changes

No response

External dependencies

one path to minimal support seems to involve python-pillow svg changes. This issue points out that there's prototypical code Here in this fork to bring SVG support to Pillow.

I don't know about other paths.

Originally created by @wolfspyre on GitHub (Sep 29, 2022). ### NetBox version 3.3.4 ### Feature type Change to existing functionality ### Proposed functionality **IF** an SVG were created such that it had layered graphical elements which corresponded with a device's interfaces/connections/modules/etc... then netbox could use that information to represent connections, truer to life. for image types which don't have layers / don't have native metadata structures which might inform such relationships, a coordinate map could be used to reference where on an image a particular thing/connection resides. IE: This could allow one to convey that 'interface 0' represents the section of pixels contained within the coordinates (10,0 and 30,20) of the device's image... 'module Y' is represented within the coordinates ( 125,0 and 250,125 ) enabling any number of interactions to be more rich/true-to-life... ### Use case SVGs have a lot of interesting properties... animations, layers, etc. I could see them being one path to have device models more realistically represent the current population and disposition of modules/interfaces/etc. ### Database changes _No response_ ### External dependencies one path to minimal support seems to involve python-pillow svg changes. [This issue](https://github.com/python-pillow/Pillow/issues/3509) points out that there's prototypical code [Here in this fork](https://github.com/loune/Pillow/tree/svg) to bring SVG support to Pillow. I don't know about other paths.
adam added the type: featurestatus: duplicate labels 2025-12-29 19:48:22 +01:00
adam closed this issue 2025-12-29 19:48:22 +01:00
Author
Owner

@kkthxbye-code commented on GitHub (Sep 30, 2022):

I'm having a hard time understanding exactly what you want to do. It almost seems like you are suggesting that part of the UI is to be replaced by SVG's generated by netbox.

Could you please specify exactly what you are proposing to implement and how.

@kkthxbye-code commented on GitHub (Sep 30, 2022): I'm having a hard time understanding exactly what you want to do. It almost seems like you are suggesting that part of the UI is to be replaced by SVG's generated by netbox. Could you please specify exactly what you are proposing to implement and how.
Author
Owner

@wolfspyre commented on GitHub (Sep 30, 2022):

First and foremost, I want to be able to use SVGs as device template images...

I thought a secondary potential upside involved an option to be able to, for example
take an svg of a line card....
say it has 8 10g sfp ports...

if each port were in its own layer, named sfp0 sfp1 sfp2 sfp3 sfp4 sfp5 sfp6 sfp7 ... netbox could potentially more accurately portray real-world connections by having the ability to relate sub-elements to corresponding image elements...

This isn't an immediate goal... or even one I'd expect manifest... Rather, it's an option that could be explored once svg support exists.
or a far reaching example of benefits from the effort...

@wolfspyre commented on GitHub (Sep 30, 2022): First and foremost, I want to be able to use SVGs as device template images... I thought a secondary potential upside involved an option to be able to, for example take an svg of a line card.... say it has 8 10g sfp ports... if each port were in its own layer, named `sfp0` `sfp1` `sfp2` `sfp3` `sfp4` `sfp5` `sfp6` `sfp7` ... netbox could potentially more accurately portray real-world connections by having the ability to relate sub-elements to corresponding image elements... This isn't an immediate goal... or even one I'd expect manifest... Rather, it's an option that could be explored once svg support exists. or a far reaching example of benefits from the effort...
Author
Owner

@jeremystretch commented on GitHub (Sep 30, 2022):

First and foremost, I want to be able to use SVGs as device template images...

This has already been proposed under #10295 and its feasibility is under review. Going to close out this issue as a duplicate.

This isn't an immediate goal... or even one I'd expect manifest... Rather, it's an option that could be explored once svg support exists.

Something like this, while interesting, is likely not going to be worth the effort required at this point in time. However if you'd like to explore it, you're welcome to open a separate, detailed FR with a proposed implementation.

@jeremystretch commented on GitHub (Sep 30, 2022): > First and foremost, I want to be able to use SVGs as device template images... This has already been proposed under #10295 and its feasibility is under review. Going to close out this issue as a duplicate. > This isn't an immediate goal... or even one I'd expect manifest... Rather, it's an option that could be explored once svg support exists. Something like this, while interesting, is likely not going to be worth the effort required at this point in time. However if you'd like to explore it, you're welcome to open a separate, detailed FR with a proposed implementation.
Author
Owner

@wolfspyre commented on GitHub (Sep 30, 2022):

Thanks for linking #10295. I'd searched for 'SVG' in open issues which returned 0 issues at the time??? ¯\_(ツ)_/¯

regardless, the basic support is really all I'm after.... Sorry for the extra noise.

@wolfspyre commented on GitHub (Sep 30, 2022): Thanks for linking [#10295](https://github.com/netbox-community/netbox/issues/10295). I'd searched for 'SVG' in open issues which returned 0 issues at the time??? ¯\\\_(ツ)\_/¯ regardless, the basic support is really all I'm after.... Sorry for the extra noise.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#7051