Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

visited links color #940

Merged
merged 1 commit into from
Jun 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ function applyHref(selection, href, target) {
const h = href(i);
if (h != null) {
const a = document.createElementNS(namespaces.svg, "a");
a.setAttribute("fill", "inherit");
a.setAttributeNS(namespaces.xlink, "href", h);
if (target != null) a.setAttribute("target", target);
this.parentNode.insertBefore(a, this).appendChild(this);
Expand Down
50 changes: 25 additions & 25 deletions test/output/documentationLinks.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions test/output/hrefFill.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions test/plots/href-fill.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import * as Plot from "@observablehq/plot";

export default async function() {
return Plot.text({length: 1}, {
text: ["click me"],
x: 0,
y: 0,
fill: "red",
href: [`https://google.com/search?q=12345`]
}).plot();
}
1 change: 1 addition & 0 deletions test/plots/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export {default as hexbinText} from "./hexbin-text.js";
export {default as hexbinZ} from "./hexbin-z.js";
export {default as hexbinZNull} from "./hexbin-z-null.js";
export {default as highCardinalityOrdinal} from "./high-cardinality-ordinal.js";
export {default as hrefFill} from "./href-fill.js";
export {default as identityScale} from "./identity-scale.js";
export {default as integerInterval} from "./integer-interval.js";
export {default as ibmTrading} from "./ibm-trading.js";
Expand Down