From 04e0a9f9b04a92fa1a48fa73742383ea5de84690 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Mon, 23 Jan 2017 21:53:19 -0500 Subject: [PATCH] Add endpoint class for endpoint vertices --- API.md | 12 +++++++----- modules/svg/vertices.js | 1 + 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/API.md b/API.md index 0ed7f2705..9a9bc28f4 100644 --- a/API.md +++ b/API.md @@ -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 diff --git a/modules/svg/vertices.js b/modules/svg/vertices.js index 04c007271..751ee9ad7 100644 --- a/modules/svg/vertices.js +++ b/modules/svg/vertices.js @@ -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); }