MCPcopy Create free account
hub / github.com/d3/d3-shape / withPath

Function withPath

src/path.js:3–19  ·  view source on GitHub ↗
(shape)

Source from the content-addressed store, hash-verified

1import {Path} from "d3-path";
2
3export function withPath(shape) {
4 let digits = 3;
5
6 shape.digits = function(_) {
7 if (!arguments.length) return digits;
8 if (_ == null) {
9 digits = null;
10 } else {
11 const d = Math.floor(_);
12 if (!(d >= 0)) throw new RangeError(`invalid digits: ${_}`);
13 digits = d;
14 }
15 return shape;
16 };
17
18 return () => new Path(digits);
19}

Callers 5

line.jsFile · 0.90
SymbolFunction · 0.90
linkFunction · 0.90
area.jsFile · 0.90
arc.jsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected