MCPcopy Create free account
hub / github.com/idank/explainshell / linePoint

Function linePoint

explainshell/web/static/js/d3.v3.js:2727–2756  ·  view source on GitHub ↗
(x, y)

Source from the content-addressed store, hash-verified

2725 if (v_) listener.lineEnd();
2726 }
2727 function linePoint(x, y) {
2728 x = Math.max(-d3_geo_clipViewMAX, Math.min(d3_geo_clipViewMAX, x));
2729 y = Math.max(-d3_geo_clipViewMAX, Math.min(d3_geo_clipViewMAX, y));
2730 var v = visible(x, y);
2731 if (polygon) ring.push([ x, y ]);
2732 if (first) {
2733 x__ = x, y__ = y, v__ = v;
2734 first = false;
2735 if (v) {
2736 listener.lineStart();
2737 listener.point(x, y);
2738 }
2739 } else {
2740 if (v && v_) listener.point(x, y); else {
2741 var a = [ x_, y_ ], b = [ x, y ];
2742 if (clipLine(a, b)) {
2743 if (!v_) {
2744 listener.lineStart();
2745 listener.point(a[0], a[1]);
2746 }
2747 listener.point(b[0], b[1]);
2748 if (!v) listener.lineEnd();
2749 } else {
2750 listener.lineStart();
2751 listener.point(x, y);
2752 }
2753 }
2754 }
2755 x_ = x, y_ = y, v_ = v;
2756 }
2757 return clip;
2758 };
2759 function corner(p, direction) {

Callers 3

d3_geo_centroidRingStartFunction · 0.85
lineEndFunction · 0.85
polygonLineStartFunction · 0.85

Calls 4

visibleFunction · 0.85
clipLineFunction · 0.85
d3_geo_cartesianFunction · 0.85
resampleLineToFunction · 0.85

Tested by

no test coverage detected