Add endpoint class for endpoint vertices

This commit is contained in:
Bryan Housel
2017-01-23 21:53:19 -05:00
parent e9edfe0cd5
commit 04e0a9f9b0
2 changed files with 8 additions and 5 deletions

12
API.md
View File

@@ -124,18 +124,20 @@ indicating a bumpy surface.
### Special classes
A node that is a member of two or more ways shall have the `.shared` class.
- A node that is a member of two or more ways shall have the `.shared` class.
Two or more nodes at identical coordinates shall each have an `.overlapped` class. (TODO)
- A node that is an endpoint of a linear way shall have the `.endpoint` class.
Elements comprising the entity currently under the cursor shall have the `.hover` class.
- Two or more nodes at identical coordinates shall each have an `.overlapped` class. (TODO)
- Elements comprising the entity currently under the cursor shall have the `.hover` class.
(The `:hover` psuedo-class is insufficient when an entity's visual representation consists
of several elements, only one of which can be `:hover`ed.)
Elements that are currently active (being clicked or dragged) shall have the `.active`
- Elements that are currently active (being clicked or dragged) shall have the `.active`
class.
Elements that are currently selected shall have the `.selected` class.
- Elements that are currently selected shall have the `.selected` class.
## Customized Deployments

View File

@@ -135,6 +135,7 @@ export function svgVertices(projection, context) {
.merge(enter)
.attr('transform', svgPointTransform(projection))
.classed('shared', function(entity) { return graph.isShared(entity); })
.classed('endpoint', function(entity) { return entity.isEndpoint(graph); })
.call(setAttributes);
}