[d3-selection] .attr() accepts arrays (#57502)

This commit is contained in:
Jack Bates
2021-12-02 15:53:48 -07:00
committed by GitHub
parent ef1526a354
commit 4eff3c3eed
2 changed files with 2 additions and 2 deletions

View File

@@ -49,9 +49,9 @@ const dom = new JSDOM();
const svg = select(dom.window.document.body)
.append("svg")
.attr("id", "gh-dark-mode-only")
// @ts-expect-error
.attr("viewBox", [0, 0, width, height])
.attr("font-family", "sans-serif");
// White axes in dark mode.
svg.append("style").text(`
#gh-dark-mode-only:target {
color: #ffffff;

View File

@@ -390,7 +390,7 @@ export interface Selection<GElement extends BaseType, Datum, PElement extends Ba
* The functions return value is then used to set each elements attribute.
* A null value will remove the specified attribute.
*/
attr(name: string, value: null | string | number | boolean | ValueFn<GElement, Datum, string | number | boolean | null>): this;
attr(name: string, value: null | string | number | boolean | ReadonlyArray<string | number> | ValueFn<GElement, Datum, null | string | number | boolean | ReadonlyArray<string | number>>): this;
/**
* Returns true if and only if the first (non-null) selected element has the specified classes.