We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0b7498e commit 7a6dc7cCopy full SHA for 7a6dc7c
1 file changed
_includes/livemap.html
@@ -14,6 +14,12 @@
14
const width = 640;
15
const height = 400;
16
17
+ const prettyJoin = (strings) => {
18
+ if (strings.length < 1) return strings;
19
+ const last = strings.pop();
20
+ return `${strings.join(", ")} and ${last}`;
21
+ };
22
+
23
// create a new svg for d3.js to draw on
24
const svg = d3.create("svg").attr("width", width).attr("height", height);
25
container.append(svg.node());
@@ -41,7 +47,7 @@
41
47
.filter((name) => name !== null);
42
48
43
49
// update map text
44
- text.innerText = `${pointData.features.length} hackers online!`;
50
+ text.innerText = `${pointData.features.length} hackers online: ${prettyJoin(nameList)}`;
45
51
46
52
// get the bounds of locations (min & max coordinates)
53
const bounds = d3.geoBounds(pointData);
0 commit comments