MCPcopy Index your code
hub / github.com/plotly/plotly.js / reactanceArc

Function reactanceArc

src/plots/smith/helpers.js:35–57  ·  view source on GitHub ↗
(subplot, X, R1, R2)

Source from the content-addressed store, hash-verified

33}
34
35function reactanceArc(subplot, X, R1, R2) {
36 var t1 = transform(subplot, smith([R1, X]));
37 var x1 = t1[0];
38 var y1 = t1[1];
39
40 var t2 = transform(subplot, smith([R2, X]));
41 var x2 = t2[0];
42 var y2 = t2[1];
43
44 if(X === 0) {
45 return [
46 'M' + x1 + ',' + y1,
47 'L' + x2 + ',' + y2
48 ].join(' ');
49 }
50
51 var r = scale(subplot, 1 / Math.abs(X));
52
53 return [
54 'M' + x1 + ',' + y1,
55 'A' + r + ',' + r + ' 0 0,' + (X < 0 ? 1 : 0) + ' ' + x2 + ',' + y2
56 ].join(' ');
57}
58
59function resistanceArc(subplot, R, X1, X2) {
60 var r = scale(subplot, 1 / (R + 1));

Callers 1

polar.jsFile · 0.85

Calls 3

transformFunction · 0.85
smithFunction · 0.85
scaleFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…