MCPcopy Create free account
hub / github.com/breck7/scroll / point

Method point

external/.d3.js:11903–11930  ·  view source on GitHub ↗
(x, y)

Source from the content-addressed store, hash-verified

11901 this._point = NaN;
11902 }
11903 point(x, y) {
11904 switch (this._point) {
11905 case 0: {
11906 this._append`M${x},${y}`;
11907 this._point = 1;
11908 break;
11909 }
11910 case 1: {
11911 this._append`L${x},${y}`;
11912 break;
11913 }
11914 default: {
11915 this._append`M${x},${y}`;
11916 if (this._radius !== cacheRadius || this._append !== cacheAppend) {
11917 const r = this._radius;
11918 const s = this._;
11919 this._ = ""; // stash the old string so we can cache the circle path fragment
11920 this._append`m0,${r}a${r},${r} 0 1,1 0,${-2 * r}a${r},${r} 0 1,1 0,${2 * r}z`;
11921 cacheRadius = r;
11922 cacheAppend = this._append;
11923 cacheCircle = this._;
11924 this._ = s;
11925 }
11926 this._ += cacheCircle;
11927 break;
11928 }
11929 }
11930 }
11931 result() {
11932 const result = this._;
11933 this._ = "";

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected