Skip to content

Commit a976c68

Browse files
committed
Draw imaginary axis tick labels
1 parent 03ebbbc commit a976c68

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

src/plots/smith/smith.js

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -789,13 +789,24 @@ proto.updateAngularAxis = function(fullLayout, polarLayout) {
789789
crisp: false
790790
});
791791

792-
// Axes.drawLabels(gd, ax, {
793-
// vals: vals,
794-
// layer: layers['angular-axis'],
795-
// repositionOnUpdate: true,
796-
// transFn: transFn,
797-
// labelFns: labelFns
798-
// });
792+
Axes.drawLabels(gd, ax, {
793+
vals: [-5.0, -2.0, -1.0, -0.5, -0.2, 0.0, 0.2, 0.5, 1.0, 2.0, 5.0, Infinity].map(function (v) {
794+
var radius = _this.radius / v;
795+
var theta = 2.0 * Math.atan2(radius, _this.radius);
796+
797+
return {
798+
x: theta * 360.0 / (2 * Math.PI),
799+
text: v === Infinity ? '∞' : ((v === 0.0 ? '0 + 0' : v) + 'j'),
800+
font: '"Open Sans", verdana, arial, sans-serif',
801+
fontColor: '#444',
802+
fontSize: v === Infinity ? 16 : 12,
803+
};
804+
}),
805+
layer: layers['angular-axis'],
806+
repositionOnUpdate: true,
807+
transFn: transFn,
808+
labelFns: labelFns
809+
});
799810
}
800811

801812
// TODO maybe two arcs is better here?

0 commit comments

Comments
 (0)