Skip to content

Commit 8157b58

Browse files
authored
visited links color (#940)
fixes #935
1 parent b8eb6c1 commit 8157b58

File tree

5 files changed

+65
-25
lines changed

5 files changed

+65
-25
lines changed

src/style.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ function applyHref(selection, href, target) {
300300
const h = href(i);
301301
if (h != null) {
302302
const a = document.createElementNS(namespaces.svg, "a");
303+
a.setAttribute("fill", "inherit");
303304
a.setAttributeNS(namespaces.xlink, "href", h);
304305
if (target != null) a.setAttribute("target", target);
305306
this.parentNode.insertBefore(a, this).appendChild(this);

test/output/documentationLinks.svg

Lines changed: 25 additions & 25 deletions
Loading

test/output/hrefFill.svg

Lines changed: 27 additions & 0 deletions
Loading

test/plots/href-fill.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import * as Plot from "@observablehq/plot";
2+
3+
export default async function() {
4+
return Plot.text({length: 1}, {
5+
text: ["click me"],
6+
x: 0,
7+
y: 0,
8+
fill: "red",
9+
href: [`https://google.com/search?q=12345`]
10+
}).plot();
11+
}

test/plots/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ export {default as hexbinText} from "./hexbin-text.js";
9090
export {default as hexbinZ} from "./hexbin-z.js";
9191
export {default as hexbinZNull} from "./hexbin-z-null.js";
9292
export {default as highCardinalityOrdinal} from "./high-cardinality-ordinal.js";
93+
export {default as hrefFill} from "./href-fill.js";
9394
export {default as identityScale} from "./identity-scale.js";
9495
export {default as integerInterval} from "./integer-interval.js";
9596
export {default as ibmTrading} from "./ibm-trading.js";

0 commit comments

Comments
 (0)