Rotating icons

Support questions about the Network Weather Map plugin

Moderators: Moderators, Developers

Post Reply
Author
Message
gadzet21
Posts: 4
Joined: Tue Apr 24, 2018 4:01 am

Rotating icons

#1 Post by gadzet21 » Tue Apr 24, 2018 4:18 am

Hey,
Is it possible to rotate the icons?

Pozdrawiam
Gadzet21

User avatar
Howie
Cacti Guru User
Posts: 5333
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Rotating icons

#2 Post by Howie » Tue Apr 24, 2018 5:11 am

Not currently. What's your use-case? And do you mean by a few degrees or 90/180?
Weathermap 0.98 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
camerabob
Cacti User
Posts: 291
Joined: Fri Feb 10, 2017 2:45 pm
Location: Long Island, New York, USA
Contact:

Re: Rotating icons

#3 Post by camerabob » Tue Apr 24, 2018 7:03 am

I believe the OP means taking a single icon and 'spinning' it x degrees.
See the Cacti 1.x templates I use at: http://www.camerabob.com/cacti

Live: Cacti 1.2.3 @ CentOS 7-6.1810.2.el7 & PHP 5.4.16-46.el7
Flowview @ 2.1
Mactrack @ 4.2
Maint @ 1.2
Monitor @ 2.3.6
Thold @ 1.2.4

Test: Cacti 1.2.6-1.el7 @ CentOS 7-7.1908.0.el7 & PHP 5.4.16-46.el7
Maint @ 1.2
Monitor @ 2.3.6
Thold @ 1.2.4

User avatar
Howie
Cacti Guru User
Posts: 5333
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Rotating icons

#4 Post by Howie » Tue Apr 24, 2018 7:19 am

camerabob wrote:I believe the OP means taking a single icon and 'spinning' it x degrees.
I understood the word 'rotate' :-)

But 90 degree increments look nicer, and are potentially easier. Rotating a bitmap by 3 degrees usually looks pretty crappy, especially without antialiasing.

And I'm still curious why - are they expecting it to rotate based on a value? or something else (e.g. just saving on having an up and down arrow)?
Weathermap 0.98 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!)

gadzet21
Posts: 4
Joined: Tue Apr 24, 2018 4:01 am

Re: Rotating icons

#5 Post by gadzet21 » Tue Apr 24, 2018 7:43 am

Yes - exactly :)
Due to the increase in "links", I would like it to be more readable and apply arrows (in different colors) in the right direction.

User avatar
Howie
Cacti Guru User
Posts: 5333
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Rotating icons

#6 Post by Howie » Tue Apr 24, 2018 8:04 am

gadzet21 wrote:Yes - exactly :)
Due to the increase in "links", I would like it to be more readable and apply arrows (in different colors) in the right direction.
But the questions:

1) At any angle? (sounds like yes)

2) Varying based on current data?

If you are literally talking about arrows, you can probably achieve it right now with oneway links.
Weathermap 0.98 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
camerabob
Cacti User
Posts: 291
Joined: Fri Feb 10, 2017 2:45 pm
Location: Long Island, New York, USA
Contact:

Re: Rotating icons

#7 Post by camerabob » Tue Apr 24, 2018 8:25 am

Howie wrote:
camerabob wrote:I believe the OP means taking a single icon and 'spinning' it x degrees.
I understood the word 'rotate' :-)
Sorry, but it may have been ambiguous with rotating between a number of images.
Howie wrote:But 90 degree increments look nicer, and are potentially easier. Rotating a bitmap by 3 degrees usually looks pretty crappy, especially without antialiasing.
Crappy is an understatement
See the Cacti 1.x templates I use at: http://www.camerabob.com/cacti

Live: Cacti 1.2.3 @ CentOS 7-6.1810.2.el7 & PHP 5.4.16-46.el7
Flowview @ 2.1
Mactrack @ 4.2
Maint @ 1.2
Monitor @ 2.3.6
Thold @ 1.2.4

Test: Cacti 1.2.6-1.el7 @ CentOS 7-7.1908.0.el7 & PHP 5.4.16-46.el7
Maint @ 1.2
Monitor @ 2.3.6
Thold @ 1.2.4

gadzet21
Posts: 4
Joined: Tue Apr 24, 2018 4:01 am

Re: Rotating icons

#8 Post by gadzet21 » Wed Apr 25, 2018 5:46 am

If you are literally talking about arrows, you can probably achieve it right now with oneway links
Goog idea.

I used:

Code: Select all

NODE ...
	LABELOUTLINECOLOR none
	ICON 10 10 images/ball-green.png
	LABELOFFSET -5 -5
LINK ...
	ARROWSTYLE classic
	LINKSTYLE oneway
And it does not look bad.
This solution is OK - thank you for the hint.
Attachments
cacti-weathermap.jpg
cacti-weathermap.jpg (271.91 KiB) Viewed 854 times

User avatar
Howie
Cacti Guru User
Posts: 5333
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Rotating icons

#9 Post by Howie » Wed Apr 25, 2018 2:30 pm

So two other things that you may not know:

1) You can use angled links instead of curved ones, so that they turn sharply (at 90 degrees if you place the VIA well)

2) You can adjust where the ends of the link start, relative to the node:

Code: Select all

LINK link1
    NODES bignode:10:10 smallnode
    VIASTYLE angled
    LINKSTYLE oneway
    VIA 300 4000
So that the end at the bigger node starts 10 pixels to the left, and 10 down from the centre of the node. With a bit of basic maths, you can make a series of parallel links coming from the side of the node this way.

Here's a quick demo of that:

Code: Select all

WIDTH 300
HEIGHT 300


LINK DEFAULT
   WIDTH 3
   VIASTYLE angled
   LINKSTYLE oneway
   BWFONT 1

NODE big
   POSITION 100 200
   ICON images/WorkgroupSwitch.png

NODE small1
   POSITION 200 100
   ICON 16 16 images/green-ball-64.png


NODE small2
   POSITION 220 100
   ICON 16 16 images/green-ball-64.png


NODE small3
   POSITION 240 100
   ICON 16 16 images/green-ball-64.png


NODE small4
   POSITION 260 100
   ICON 16 16 images/green-ball-64.png

LINK l1
   NODES big:40:-20 small1
   VIA 200 180
   # via X matches small1's X
   # via Y matches big's X + the Y offset of -20

LINK l2
   NODES big:40:-10 small2
   VIA 220 190

LINK l3
   NODES big:40:10 small3
   VIA 240 210

LINK l4
   NODES big:40:20 small4
   VIA 260 220
Attachments
weathermap.png
weathermap.png (5.01 KiB) Viewed 846 times
Weathermap 0.98 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!)

netniV
Cacti Guru User
Posts: 2885
Joined: Sun Aug 27, 2017 12:05 am

Re: Rotating icons

#10 Post by netniV » Wed Apr 25, 2018 7:18 pm

I am so going to be tapping into your expertise once the 1.x version is ready ;-)

gadzet21
Posts: 4
Joined: Tue Apr 24, 2018 4:01 am

Re: Rotating icons

#11 Post by gadzet21 » Thu Apr 26, 2018 1:01 am

Thanks Howie.
Through the last dynamic changes on the map, there was no time to do it. I will try to use your tips soon.

It is a pity that these functions are not available in the editor itself (but manually entered) - it would speed up the work.

User avatar
Howie
Cacti Guru User
Posts: 5333
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Rotating icons

#12 Post by Howie » Thu Apr 26, 2018 4:00 am

gadzet21 wrote:Thanks Howie.
Through the last dynamic changes on the map, there was no time to do it. I will try to use your tips soon.

It is a pity that these functions are not available in the editor itself (but manually entered) - it would speed up the work.
They are. Just click on a link, and then the Edit button.

It wouldn't be very hard to make a "make this a right-angled VIA" button actually, a bit like the existing Tidy option.
Weathermap 0.98 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