ffnord / ffmap-backend

THIS PROJECT DOESN'T HAVE A MAINTAINER!
Other
20 stars 59 forks source link

make ids svg friendly #1

Closed johnyb closed 11 years ago

johnyb commented 11 years ago

This attribute is used as an id for an svg element. W3C states, these ids must not start with a number (hence a prefix is added) and must not contain colons.

The advantage of this is, that nodes in a document containing elements with these ids can be selected using their id with CSS selectors. This is not possible within the current map.

I didn’t add this change for the other ids, because I didn’t know how to test this. May be you can give me a hint on this or do it yourself?

johnyb commented 11 years ago

PS: what I need for a feature, I’m planning for ffmap-d3 is to be able to select nodes … so it would be fine for now to only add this change. But IMHO it’s more clean, to have consistent ids in the json file.

johnyb commented 11 years ago

Okay, I just saw, this isn’t as easy. Seems, I need to write a id_from_mac helper method or something. Will update the pull-request, soon.

johnyb commented 11 years ago

Another thing, I could do is to "fix" the id as late as possible. So I could "cleanup" the ids in class D3MapBuilder. @tcatm: What do you think?

johnyb commented 11 years ago

I opened another pull-request as an alternative … IMHO the second one will do and is less work on the backend. (See #2)

johnyb commented 11 years ago

obsolete since https://github.com/tcatm/ffmap-d3/commit/153b94bb02d827f916d89378dd1b1bf704b7439c