1 line
6.6 KiB
JSON
1 line
6.6 KiB
JSON
{"ast":null,"code":"import pointRadial from \"../pointRadial.js\";\nclass Bump {\n constructor(context, x) {\n this._context = context;\n this._x = x;\n }\n areaStart() {\n this._line = 0;\n }\n areaEnd() {\n this._line = NaN;\n }\n lineStart() {\n this._point = 0;\n }\n lineEnd() {\n if (this._line || this._line !== 0 && this._point === 1) this._context.closePath();\n this._line = 1 - this._line;\n }\n point(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0:\n {\n this._point = 1;\n if (this._line) this._context.lineTo(x, y);else this._context.moveTo(x, y);\n break;\n }\n case 1:\n this._point = 2;\n // falls through\n default:\n {\n if (this._x) this._context.bezierCurveTo(this._x0 = (this._x0 + x) / 2, this._y0, this._x0, y, x, y);else this._context.bezierCurveTo(this._x0, this._y0 = (this._y0 + y) / 2, x, this._y0, x, y);\n break;\n }\n }\n this._x0 = x, this._y0 = y;\n }\n}\nclass BumpRadial {\n constructor(context) {\n this._context = context;\n }\n lineStart() {\n this._point = 0;\n }\n lineEnd() {}\n point(x, y) {\n x = +x, y = +y;\n if (this._point === 0) {\n this._point = 1;\n } else {\n const p0 = pointRadial(this._x0, this._y0);\n const p1 = pointRadial(this._x0, this._y0 = (this._y0 + y) / 2);\n const p2 = pointRadial(x, this._y0);\n const p3 = pointRadial(x, y);\n this._context.moveTo(...p0);\n this._context.bezierCurveTo(...p1, ...p2, ...p3);\n }\n this._x0 = x, this._y0 = y;\n }\n}\nexport function bumpX(context) {\n return new Bump(context, true);\n}\nexport function bumpY(context) {\n return new Bump(context, false);\n}\nexport function bumpRadial(context) {\n return new BumpRadial(context);\n}","map":{"version":3,"names":["pointRadial","Bump","constructor","context","x","_context","_x","areaStart","_line","areaEnd","NaN","lineStart","_point","lineEnd","closePath","point","y","lineTo","moveTo","bezierCurveTo","_x0","_y0","BumpRadial","p0","p1","p2","p3","bumpX","bumpY","bumpRadial"],"sources":["/home/gnx/Desktop/ETB/ETB-FrontEnd/node_modules/d3-shape/src/curve/bump.js"],"sourcesContent":["import pointRadial from \"../pointRadial.js\";\n\nclass Bump {\n constructor(context, x) {\n this._context = context;\n this._x = x;\n }\n areaStart() {\n this._line = 0;\n }\n areaEnd() {\n this._line = NaN;\n }\n lineStart() {\n this._point = 0;\n }\n lineEnd() {\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n }\n point(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: {\n this._point = 1;\n if (this._line) this._context.lineTo(x, y);\n else this._context.moveTo(x, y);\n break;\n }\n case 1: this._point = 2; // falls through\n default: {\n if (this._x) this._context.bezierCurveTo(this._x0 = (this._x0 + x) / 2, this._y0, this._x0, y, x, y);\n else this._context.bezierCurveTo(this._x0, this._y0 = (this._y0 + y) / 2, x, this._y0, x, y);\n break;\n }\n }\n this._x0 = x, this._y0 = y;\n }\n}\n\nclass BumpRadial {\n constructor(context) {\n this._context = context;\n }\n lineStart() {\n this._point = 0;\n }\n lineEnd() {}\n point(x, y) {\n x = +x, y = +y;\n if (this._point === 0) {\n this._point = 1;\n } else {\n const p0 = pointRadial(this._x0, this._y0);\n const p1 = pointRadial(this._x0, this._y0 = (this._y0 + y) / 2);\n const p2 = pointRadial(x, this._y0);\n const p3 = pointRadial(x, y);\n this._context.moveTo(...p0);\n this._context.bezierCurveTo(...p1, ...p2, ...p3);\n }\n this._x0 = x, this._y0 = y;\n }\n}\n\nexport function bumpX(context) {\n return new Bump(context, true);\n}\n\nexport function bumpY(context) {\n return new Bump(context, false);\n}\n\nexport function bumpRadial(context) {\n return new BumpRadial(context);\n}\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,mBAAmB;AAE3C,MAAMC,IAAI,CAAC;EACTC,WAAWA,CAACC,OAAO,EAAEC,CAAC,EAAE;IACtB,IAAI,CAACC,QAAQ,GAAGF,OAAO;IACvB,IAAI,CAACG,EAAE,GAAGF,CAAC;EACb;EACAG,SAASA,CAAA,EAAG;IACV,IAAI,CAACC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