Rotating icons

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

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

Rotating icons

Post by gadzet21 »

Hey,
Is it possible to rotate the icons?

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

Re: Rotating icons

Post by Howie »

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

Re: Rotating icons

Post by camerabob »

I believe the OP means taking a single icon and 'spinning' it x degrees.
Prod: Cacti 1.2.15 @ CentOS Linux release 7.9.2009 (Core) & PHP 5.4.16-48.el7
Maint @ 1.2
Monitor @ 2.3.6
Thold @ 1.2.4

Temp: Cacti 1.2.3 @ CentOS Linux release 7.9.2009 (Core) & PHP 5.4.16-48.el7
Flowview @ 2.1
Mactrack @ 4.2
Maint @ 1.2
Monitor @ 2.3.6
Router Configs @ 1.3.4
Syslog Monitoring @ 2.1
Thold @ 1.2.4
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Rotating icons

Post by Howie »

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.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!)
gadzet21
Posts: 4
Joined: Tue Apr 24, 2018 4:01 am

Re: Rotating icons

Post by gadzet21 »

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: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Rotating icons

Post by Howie »

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.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
camerabob
Cacti User
Posts: 386
Joined: Fri Feb 10, 2017 2:45 pm
Location: Long Island, New York, USA
Contact:

Re: Rotating icons

Post by camerabob »

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
Prod: Cacti 1.2.15 @ CentOS Linux release 7.9.2009 (Core) & PHP 5.4.16-48.el7
Maint @ 1.2
Monitor @ 2.3.6
Thold @ 1.2.4

Temp: Cacti 1.2.3 @ CentOS Linux release 7.9.2009 (Core) & PHP 5.4.16-48.el7
Flowview @ 2.1
Mactrack @ 4.2
Maint @ 1.2
Monitor @ 2.3.6
Router Configs @ 1.3.4
Syslog Monitoring @ 2.1
Thold @ 1.2.4
gadzet21
Posts: 4
Joined: Tue Apr 24, 2018 4:01 am

Re: Rotating icons

Post by gadzet21 »

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 2522 times
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Rotating icons

Post by Howie »

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 2514 times
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!)
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Rotating icons

Post by netniV »

I am so going to be tapping into your expertise once the 1.x version is ready ;-)
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
gadzet21
Posts: 4
Joined: Tue Apr 24, 2018 4:01 am

Re: Rotating icons

Post by gadzet21 »

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: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Rotating icons

Post by Howie »

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.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 5 guests