d3-geo-scale-bar
Advanced tools
Comparing version 1.2.3 to 1.2.4
{ | ||
"name": "d3-geo-scale-bar", | ||
"version": "1.2.3", | ||
"version": "1.2.4", | ||
"description": "Displays automatic scale bars for projected geospatial data.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -10,3 +10,3 @@ # d3-geo-scale-bar | ||
```html | ||
<script src="https://unpkg.com/d3-geo-scale-bar@1.2.3/build/d3-geo-scale-bar.min.js"></script> | ||
<script src="https://unpkg.com/d3-geo-scale-bar@1.2.4/build/d3-geo-scale-bar.min.js"></script> | ||
<script> | ||
@@ -13,0 +13,0 @@ |
@@ -151,2 +151,17 @@ import { default as geoDistance } from "./geo/distance"; | ||
else { | ||
if (context !== selection){ | ||
label.transition(context) | ||
.attr("x", labelAnchor === "start" ? 0 : labelAnchor === "middle" ? scale(max / 2) : scale(max)) | ||
.attr("y", orient === 1 ? 0 : "1.3em") | ||
.attr("text-anchor", labelAnchor) | ||
.text(d => d); | ||
} | ||
else { | ||
label | ||
.attr("x", labelAnchor === "start" ? 0 : labelAnchor === "middle" ? scale(max / 2) : scale(max)) | ||
.attr("y", orient === 1 ? 0 : "1.3em") | ||
.attr("text-anchor", labelAnchor) | ||
.text(d => d); | ||
} | ||
label.enter().append("text") | ||
@@ -157,3 +172,2 @@ .attr("class", "label") | ||
.attr("dy", "-0.32em") | ||
.merge(label) | ||
.attr("x", labelAnchor === "start" ? 0 : labelAnchor === "middle" ? scale(max / 2) : scale(max)) | ||
@@ -160,0 +174,0 @@ .attr("y", orient === 1 ? 0 : "1.3em") |
54838
781