Skip to content

Commit 60c30f4

Browse files
committed
revise smith
1 parent 56e0a97 commit 60c30f4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+1561
-1880
lines changed

src/components/modebar/manage.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ function getButtonGroups(gd) {
110110
var hasTernary = fullLayout._has('ternary');
111111
var hasMapbox = fullLayout._has('mapbox');
112112
var hasPolar = fullLayout._has('polar');
113+
var hasSmith = fullLayout._has('smith');
113114
var hasSankey = fullLayout._has('sankey');
114115
var allAxesFixed = areAllAxesFixed(fullLayout);
115116
var hasUnifiedHoverLabel = isUnifiedHover(fullLayout.hovermode);
@@ -152,7 +153,7 @@ function getButtonGroups(gd) {
152153
var resetGroup = [];
153154
var dragModeGroup = [];
154155

155-
if((hasCartesian || hasGL2D || hasPie || hasFunnelarea || hasTernary) + hasGeo + hasGL3D + hasMapbox + hasPolar > 1) {
156+
if((hasCartesian || hasGL2D || hasPie || hasFunnelarea || hasTernary) + hasGeo + hasGL3D + hasMapbox + hasPolar + hasSmith > 1) {
156157
// graphs with more than one plot types get 'union buttons'
157158
// which reset the view or toggle hover labels across all subplots.
158159
hoverGroup = ['toggleHover'];
@@ -175,7 +176,7 @@ function getButtonGroups(gd) {
175176
} else if(hasSankey) {
176177
hoverGroup = ['hoverClosestCartesian', 'hoverCompareCartesian'];
177178
resetGroup = ['resetViewSankey'];
178-
} else { // hasPolar, hasTernary
179+
} else { // hasPolar, hasSmith, hasTernary
179180
// always show at least one hover icon.
180181
hoverGroup = ['toggleHover'];
181182
}

src/plot_api/helpers.js

+6
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ exports.cleanLayout = function(layout) {
4646

4747
var axisAttrRegex = (Plots.subplotsRegistry.cartesian || {}).attrRegex;
4848
var polarAttrRegex = (Plots.subplotsRegistry.polar || {}).attrRegex;
49+
var smithAttrRegex = (Plots.subplotsRegistry.smith || {}).attrRegex;
4950
var ternaryAttrRegex = (Plots.subplotsRegistry.ternary || {}).attrRegex;
5051
var sceneAttrRegex = (Plots.subplotsRegistry.gl3d || {}).attrRegex;
5152

@@ -93,6 +94,11 @@ exports.cleanLayout = function(layout) {
9394

9495
var polar = layout[key];
9596
cleanTitle(polar.radialaxis);
97+
} else if(smithAttrRegex && smithAttrRegex.test(key)) {
98+
// modifications for smith
99+
100+
var smith = layout[key];
101+
cleanTitle(smith.realaxis);
96102
} else if(ternaryAttrRegex && ternaryAttrRegex.test(key)) {
97103
// modifications for ternary
98104

src/plots/cartesian/axes.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1462,7 +1462,7 @@ function formatDate(ax, out, hover, extraPrecision) {
14621462
dateStr += '<br>' + headStr;
14631463
} else {
14641464
var isInside = insideTicklabelposition(ax);
1465-
var side = ax._realSide || ax.side; // polar mocks the side of the radial axis
1465+
var side = ax._trueSide || ax.side; // polar mocks the side of the radial axis
14661466
if(
14671467
(!isInside && side === 'top') ||
14681468
(isInside && side === 'bottom')
@@ -3269,7 +3269,7 @@ axes.drawLabels = function(gd, ax, opts) {
32693269
var pad = !isAligned ? 0 :
32703270
(ax.tickwidth || 0) + 2 * TEXTPAD;
32713271

3272-
var rotate90 = (tickSpacing < maxFontSize * 2.5) || ax.type === 'multicategory';
3272+
var rotate90 = (tickSpacing < maxFontSize * 2.5) || ax.type === 'multicategory' || ax._name === 'realaxis';
32733273

32743274
// any overlap at all - set 30 degrees or 90 degrees
32753275
for(i = 0; i < lbbArray.length - 1; i++) {

src/plots/cartesian/set_convert.js

+1
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,7 @@ module.exports = function setConvert(ax, fullLayout) {
449449

450450
if(ax.type === 'date') dflt = Lib.dfltRange(ax.calendar);
451451
else if(axLetter === 'y') dflt = constants.DFLTRANGEY;
452+
else if(ax._name === 'realaxis') dflt = [0, 1];
452453
else dflt = opts.dfltRange || constants.DFLTRANGEX;
453454

454455
// make sure we don't later mutate the defaults

src/plots/cartesian/tick_mark_defaults.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ var layoutAttributes = require('./layout_attributes');
88
/**
99
* options: inherits outerTicks from axes.handleAxisDefaults
1010
*/
11-
module.exports = function handleTickDefaults(containerIn, containerOut, coerce, options) {
11+
module.exports = function handleTickMarkDefaults(containerIn, containerOut, coerce, options) {
1212
var tickLen = Lib.coerce2(containerIn, containerOut, layoutAttributes, 'ticklen');
1313
var tickWidth = Lib.coerce2(containerIn, containerOut, layoutAttributes, 'tickwidth');
1414
var tickColor = Lib.coerce2(containerIn, containerOut, layoutAttributes, 'tickcolor', containerOut.color);

src/plots/plots.js

+9
Original file line numberDiff line numberDiff line change
@@ -2981,6 +2981,15 @@ plots.doCalcdata = function(gd, traces) {
29812981
);
29822982
}
29832983

2984+
// add smith axes to axis list
2985+
var smithIds = fullLayout._subplots.smith || [];
2986+
for(i = 0; i < smithIds.length; i++) {
2987+
axList.push(
2988+
fullLayout[smithIds[i]].realaxis,
2989+
fullLayout[smithIds[i]].imaginaryaxis
2990+
);
2991+
}
2992+
29842993
// clear relinked cmin/cmax values in shared axes to start aggregation from scratch
29852994
for(var k in fullLayout._colorAxes) {
29862995
var cOpts = fullLayout[k];

0 commit comments

Comments
 (0)