IN/OUTCOMMENT feature request

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

Post Reply
User avatar
wwwdrich
Cacti User
Posts: 91
Joined: Thu Feb 03, 2005 5:53 pm
Location: San Jose, CA
Contact:

IN/OUTCOMMENT feature request

Post by wwwdrich »

I love the new feature of interface comments in 0.9, however I have a slight problem with it. I really need more control over where the comments are placed. As you can see in the attached images, the logic for where to put them makes them a little unreadable for devices with a lot of connections.

Even some of my less-complicated devices are having issues with the comments slipping under the icons. This problem isn't the same for all devices either, as you can see from the 2nd attachment. I'm assuming it is because the links have different lengths, and the comments are being placed at a specific percentage of the link length?

I would really like to be able to do two things that I think would address my issues:
  • Specify the minimum offset from the end of the link -- ex. INCOMMENTMINOFFSET 25 would place the comment a minimum of 25 pixels from the start of the link, thereby preventing them from disappearing under the icons.
    • Allow an option for comments to sit on the link instead of next to it. I always try and make sure my links don't overlap too much to make for easier reading, if the comment was on the link it would always be visible.
    Thoughts?
Attachments
weathermap-device-1.png
weathermap-device-1.png (48.03 KiB) Viewed 4333 times
weathermap-device-2.png
weathermap-device-2.png (26.13 KiB) Viewed 4333 times
- Dan
[i] "Step up to red alert!" "Are you sure, sir?[/i]
[i] It means changing the bulb in the sign..." - Red Dwarf[/i]
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

Since 0.92 you can adjust the position along the link with COMMENTPOS.

There's isn't a proper command for positioning distance perpendicular to the link, but I just noticed there *are* a couple of 'secret' SET commands, one of which is comment_nudgeout, which looks to be an offset in pixels, per-link. So something like:

Code: Select all

LINK blah
  WIDTH 4
  SET comment_nudgeout -8
should do it. It takes the width+4 as the standard position for the comment away from the centre-line of the link. That should (untested) pull it back into the middle.

Bear in mind that if you put it over the link, then you're likely to run into readability issues as the link changes colour.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
User avatar
wwwdrich
Cacti User
Posts: 91
Joined: Thu Feb 03, 2005 5:53 pm
Location: San Jose, CA
Contact:

Post by wwwdrich »

I find that white text is visible on most of the link colors -- at least with our current network that has way too much capacity at the moment so I rarely see links that aren't black or blue (using the gradient rainbow scale from one of the examples on our site).

One thing I did notice, the angle calculations for the comments don't always quite match the angle of the link. They are close, but sometimes slightly off. I'm working from home today, but I'll add a comment with some example images tomorrow. It's really noticible on links using VIA. And I'm sure I am going to be making lots of use of COMMENTPOS once .96 comes out.
- Dan
[i] "Step up to red alert!" "Are you sure, sir?[/i]
[i] It means changing the bulb in the sign..." - Red Dwarf[/i]
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

wwwdrich wrote:I find that white text is visible on most of the link colors -- at least with our current network that has way too much capacity at the moment so I rarely see links that aren't black or blue (using the gradient rainbow scale from one of the examples on our site).

One thing I did notice, the angle calculations for the comments don't always quite match the angle of the link. They are close, but sometimes slightly off. I'm working from home today, but I'll add a comment with some example images tomorrow. It's really noticible on links using VIA. And I'm sure I am going to be making lots of use of COMMENTPOS once .96 comes out.
It doesn't actually follow the curve - it picks the point at the start of the text, and finds the angle there. So if your curve is, well, curving at that point, the text will drift. Positioning each letter to match the curve is a lot more pain. I might try it at some stage, just for kicks, but after I revamp the link-drawing to include angled VIAs (should be in 0.96).

I don't follow what you are waiting for in 0.96 though. COMMENTPOS is in 0.92 onwards...
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
User avatar
wwwdrich
Cacti User
Posts: 91
Joined: Thu Feb 03, 2005 5:53 pm
Location: San Jose, CA
Contact:

Post by wwwdrich »

Ah, I misread your 0.92 up above as 0.96 -- it's been one of those days. I thought it wasn't there because I tried to use COMMENTOFFSET instead of COMMENTPOS and got an error. :)
- Dan
[i] "Step up to red alert!" "Are you sure, sir?[/i]
[i] It means changing the bulb in the sign..." - Red Dwarf[/i]
runlikeanantelope
Cacti User
Posts: 63
Joined: Thu Feb 15, 2007 12:08 pm

Post by runlikeanantelope »

I tried to search for a topic relevant to my question, and this one is close. See my attached photo. I'm using this as my COMMENT config:

BANDWIDTH 45M
COMMENTPOS 50 50
INCOMMENT {link:this:max_bandwidth_in:%k}
COMMENTFONT 5
COMMENTFONTCOLOR 150 150 150

It properly positions them on the more Horizontal Link Lines, but it places the comment directly over the more Vertical Link Line.

Wondering what the best way around this is, change the link style to a VIA ANGLED or add another NODE to display the BANDWIDTH with the POSITION command, or maybe something else I"m missing?
Attachments
comment.jpg
comment.jpg (23.83 KiB) Viewed 3335 times
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

runlikeanantelope wrote:I tried to search for a topic relevant to my question, and this one is close. See my attached photo. I'm using this as my COMMENT config:

BANDWIDTH 45M
COMMENTPOS 50 50
INCOMMENT {link:this:max_bandwidth_in:%k}
COMMENTFONT 5
COMMENTFONTCOLOR 150 150 150

It properly positions them on the more Horizontal Link Lines, but it places the comment directly over the more Vertical Link Line.

Wondering what the best way around this is, change the link style to a VIA ANGLED or add another NODE to display the BANDWIDTH with the POSITION command, or maybe something else I"m missing?
You need to use freetype fonts to get angled text. Your cacti.log should be full of warnings like this:
"Angled text doesn't work with non-FreeType fonts [WMWARN02]"
and it's mentioned in the INCOMMENT/OUTCOMMENT manual section, from memory.

I suspect COMMENTPOS 50 50 might do something unusual too.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
runlikeanantelope
Cacti User
Posts: 63
Joined: Thu Feb 15, 2007 12:08 pm

Post by runlikeanantelope »

Much Better - Thank You.

Solution:

FONTDEFINE 411 /usr/local/apache2/htdocs/statistics/weathermap/images/TahomaBold.ttf 11

COMMENTFONT 5
Attachments
comment.jpg
comment.jpg (22.67 KiB) Viewed 3323 times
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

runlikeanantelope wrote:Much Better - Thank You.

Solution:

FONTDEFINE 411 /usr/local/apache2/htdocs/statistics/weathermap/images/TahomaBold.ttf 11

COMMENTFONT 5
Umm, I think you mean

Code: Select all

FONTDEFINE 411 /usr/local/apache2/htdocs/statistics/weathermap/images/TahomaBold.ttf 11

COMMENTFONT 411
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests