Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Wed Jun 19, 2019 6:45 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: Rotating icons
PostPosted: Tue Apr 24, 2018 4:18 am 
Offline

Joined: Tue Apr 24, 2018 4:01 am
Posts: 4
Hey,
Is it possible to rotate the icons?

Pozdrawiam
Gadzet21


Top
 Profile  
 
 Post subject: Re: Rotating icons
PostPosted: Tue Apr 24, 2018 5:11 am 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5318
Location: United Kingdom
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!)


Top
 Profile  
 
 Post subject: Re: Rotating icons
PostPosted: Tue Apr 24, 2018 7:03 am 
Offline
Cacti User
User avatar

Joined: Fri Feb 10, 2017 2:45 pm
Posts: 238
Location: Long Island, New York, USA
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.e17
Maint @ 1.2
Monitor @ 2.3.6
Thold @ 1.2.4

Test: Cacti 1.2.3 @ CentOS 7-6.1810.2.el7 & PHP 5.4.45-17.e17.remi
Maint @ 1.2
Monitor @ 2.3.4
Thold @ 1.0.4


Top
 Profile  
 
 Post subject: Re: Rotating icons
PostPosted: Tue Apr 24, 2018 7:19 am 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5318
Location: United Kingdom
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!)


Top
 Profile  
 
 Post subject: Re: Rotating icons
PostPosted: Tue Apr 24, 2018 7:43 am 
Offline

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


Top
 Profile  
 
 Post subject: Re: Rotating icons
PostPosted: Tue Apr 24, 2018 8:04 am 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5318
Location: United Kingdom
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!)


Top
 Profile  
 
 Post subject: Re: Rotating icons
PostPosted: Tue Apr 24, 2018 8:25 am 
Offline
Cacti User
User avatar

Joined: Fri Feb 10, 2017 2:45 pm
Posts: 238
Location: Long Island, New York, USA
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.e17
Maint @ 1.2
Monitor @ 2.3.6
Thold @ 1.2.4

Test: Cacti 1.2.3 @ CentOS 7-6.1810.2.el7 & PHP 5.4.45-17.e17.remi
Maint @ 1.2
Monitor @ 2.3.4
Thold @ 1.0.4


Top
 Profile  
 
 Post subject: Re: Rotating icons
PostPosted: Wed Apr 25, 2018 5:46 am 
Offline

Joined: Tue Apr 24, 2018 4:01 am
Posts: 4
Quote:
If you are literally talking about arrows, you can probably achieve it right now with oneway links

Goog idea.

I used:
Code:
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 638 times ]
Top
 Profile  
 
 Post subject: Re: Rotating icons
PostPosted: Wed Apr 25, 2018 2:30 pm 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5318
Location: United Kingdom
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:
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:
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 630 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!)
Top
 Profile  
 
 Post subject: Re: Rotating icons
PostPosted: Wed Apr 25, 2018 7:18 pm 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 2499
I am so going to be tapping into your expertise once the 1.x version is ready ;-)

_________________
Official Cacti Developer

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation

My resources:
How to submit Pull Requests
Development Wiki and How To's
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


Top
 Profile  
 
 Post subject: Re: Rotating icons
PostPosted: Thu Apr 26, 2018 1:01 am 
Offline

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


Top
 Profile  
 
 Post subject: Re: Rotating icons
PostPosted: Thu Apr 26, 2018 4:00 am 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5318
Location: United Kingdom
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!)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group