Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different styled lines for different link types on maps #18

Open
spinza opened this issue Jan 21, 2016 · 23 comments
Open

Different styled lines for different link types on maps #18

spinza opened this issue Jan 21, 2016 · 23 comments

Comments

@spinza
Copy link
Contributor

spinza commented Jan 21, 2016

Our members loved this about our old wind. We had different styled lines for our map based on the link type. Better links being more prominent.

Ideally the style should be configurable in the config/config.php.
@MDE186 is going to look at this for us.

@jammin84
Copy link
Contributor

The current mapping shows it as per the node "status", but I can see the proposed method being of value also.

I also agree to these being configurable.

FYI @MDE186. its currently found in
/templates/basic//scripts/javascripts/map.js

            // Color mapping for nodes
            var colors_per_type = {
                'p2p' : '#f5c70c',
                'p2p-ap' : '#f5c70c',
                'ap' : '#61d961',
                'client' : '#5858ff',
                'unlinked' : '#ff3f4f',
            };

and a bit further down the link colours.

            properties['color'] = (link['status'] == 'active')
                ?'#0099FF' //blue line link color
                :'#FF8C95'; //red

Note: WAFN use a modified red as above rather than the #ff0000 in the original code, which was chosen for its readability.

@jammin84
Copy link
Contributor

@spinza can you expand on what "Better links" are classified as?

I presume its not a measurement of signal quality.

@spinza
Copy link
Contributor Author

spinza commented Jan 27, 2016

Our colours were/will be based on the link protocol:

IEEE 802.11b
IEEE 802.11g
IEEE 802.11a
IEEE 802.11n
IEEE 802.11n Dual chain
IEEE 802.11ac
IEEE 802.3i (Ethernet)
IEEE 802.3u (Fast Ethernet)
IEEE 802.3ab (Gigabit Ethernet)

They will have different colours/thickness. Obviously most of these are wireless though we have some nodes connected via ethernet (that are very close to each other).

@jammin84
Copy link
Contributor

ahh. nice one!

JSON data for the query is /wind/index.php/map/json?node=0&filter=p2p,ap,client

you'll need to add in the link info. in the following file.
includes/pages/map/map_json.php

@jammin84
Copy link
Contributor

hrmm .. one question. where do you record that information in WiND?

The closest I can see is "link type"

@spinza
Copy link
Contributor Author

spinza commented Jan 27, 2016

Under edit link:
You have link-type, peer node, access point and protocol. It's the protocol field.
Not sure if the options have been bastardised on our install?

@jammin84
Copy link
Contributor

ahh yes. I'd looked at a client link yesterday, whereas it only shows as an option on the AP side.

@MDE186
Copy link
Contributor

MDE186 commented Feb 24, 2016

Made lots of progress. Question @spinza does the current ctwug database have a 'protocol' column under nodes?

@spinza
Copy link
Contributor Author

spinza commented Feb 24, 2016

@MDE186 you should design based on the database here. Specifically this:
https://github.com/southern-wind/wind/blob/master/install/schema.sql#L157

Our live database is probably not 100% match to this though. But we need to fix [our live] database if you make the changes. I can't look now but our live database should have protocol on the links table.

I think we may need to fix the names to be as per the current scheme.sql though.

@MDE186
Copy link
Contributor

MDE186 commented Feb 24, 2016

Its all good...found what I was looking for.

@MDE186
Copy link
Contributor

MDE186 commented Feb 24, 2016

Howzit. So..I have completed the link colours. Just wanting to know if you want different link thickness's as well.

link_colours

@spinza
Copy link
Contributor Author

spinza commented Feb 24, 2016

Cool. How is that implemented? Is it a config setting?

I think a config setting based on the link protocols with thickness, colour
and visibility (active/inactive) would be absolutely awesome.

On Wed, 24 Feb 2016 at 18:40 MDE186 [email protected] wrote:

Howzit. So..I have completed the link colours. Just wanting to know if you
want different link thickness's as well.

[image: link_colours]
https://cloud.githubusercontent.com/assets/8092312/13292849/1030deb6-db26-11e5-8074-25bce55f3558.png


Reply to this email directly or view it on GitHub
#18 (comment).

@jammin84
Copy link
Contributor

looking great.
I agree about a config setting .. either stored in db or the config.php file.

@MDE186
Copy link
Contributor

MDE186 commented Feb 25, 2016

At the moment its just hard coded. I'll look at implementing it into the db and also changeable via the admin panel.

@MDE186
Copy link
Contributor

MDE186 commented Mar 1, 2016

Sorry its taking so long...can only really work once the pregnant wife and 2yr old have gone to bed :)

@jammin84
Copy link
Contributor

jammin84 commented Mar 1, 2016

Seriously. No stress dude.

Family first always.

@spinza
Copy link
Contributor Author

spinza commented Mar 2, 2016

👍

@spinza
Copy link
Contributor Author

spinza commented May 26, 2016

@MDE186 have you had a chance to look at this while awake at odd hours? 🍼

@MDE186
Copy link
Contributor

MDE186 commented May 26, 2016

Hey,

Unfortunately not. Not sure when I'll have some extra time. I can send
through the basics of what's been done?
On 26 May 2016 14:16, "spin" [email protected] wrote:

@MDE186 https://github.com/MDE186 have you had a chance to look at this
while awake at odd hours?


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#18 (comment)

@spinza
Copy link
Contributor Author

spinza commented Jun 25, 2016

Got @MDE186 's code.

I can implement it but it's dependent on having a set protocol list in the protocols table. He has a if else if else hard coded.

I think I will change his way of doing things by adding a colour field to the protocol table so we can simply edit the colour in the database. If no colour is set it will default to the blue it uses currently.

Happy with that approach @jammin84 ?

@jammin84
Copy link
Contributor

Hi @spinza

Looking at the schema.sql file. It appears that there is no "protocol table", it is just a "enum" list within the table "links", so while i like the "adding a row" idea, the current db design doesn't allow for it.

There is also no admin interface in WiND for changing these either. So even changing the enum list is purely db.

I think it best if its stored in either:

  • a new "options" table (which could also hold other future data)
id option_type data value
1 link_colours IEEE 802.11b #333
2 link_colours IEEE 802.11b #666
  • or within the "$config" array.
    $config[link_colours][IEEE 802.11b] = #333;
    $config[link_colours][IEEE 802.11b ] = #666;

Then whichever option you just compare the link type if it is in the array or default back to blue as you've mentioned

$link_protocol_color = (isset ($config['link_colours'][ $protocol_type ]) 
    ? $config['link_colours'][ $protocol_type ] 
    : $default_link_color );

@spinza
Copy link
Contributor Author

spinza commented Jun 27, 2016

Doh thought it was a table.

On Mon, 27 Jun 2016, 04:30 jammin84 [email protected] wrote:

Hi @spinza https://github.com/spinza

Looking at the schema.sql file. It appears that there is no "protocol
table", it is just a "enum" list within the table "links", so while i like
the "adding a row" idea, the current db design doesn't allow for it.

There is also no admin interface in WiND for changing these either. So
even changing the enum list is purely db.

I think it best if its stored in either:

  • a new "options" table (which could also hold other future data)

id option_type data value
1 link_colours IEEE 802.11b #333
2 link_colours IEEE 802.11b #666

  • or within the "$config" array.

    $config[link_colours][IEEE 802.11b] = #333;
    $config[link_colours][IEEE 802.11b ] = #666;

Then whichever option you just compare the link type if it is in the array
or default back to blue as you've mentioned

$link_protocol_color = (isset ($config['link_colours'][ $protocol_type ])
? $config['link_colours'][ $protocol_type ]
: $default_link_color );


You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
#18 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/ADVuHg_vLrJ921nSRR6MSH58wJv6xwMaks5qPzWvgaJpZM4HJi4U
.

@MDE186
Copy link
Contributor

MDE186 commented Jun 27, 2016

All sounds good. @spinza I just pulled the code from the old WIND and made it work with the new.
Sorry didnt get further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants