Skip to content

Introduce smith subplot and scattersmith trace type #5956

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 140 commits into from
Oct 19, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
140 commits
Select commit Hold shift + click to select a range
9492c99
Add a dummy scattersmith trace
waxlamp Apr 5, 2021
2ac5084
Modify scattersmith trace to use `re` and `im` data series
waxlamp Apr 20, 2021
9366507
Perform gamma transform (with fixed z0 of unity)
waxlamp Apr 21, 2021
e45b7b8
Force smith chart to use radial range [0, 1]
waxlamp Apr 21, 2021
6425813
Add a WIP function to draw circular "real" lines
waxlamp Apr 28, 2021
f7cd0b0
WIP
waxlamp Jun 9, 2021
3914dc0
Display real ticks at 0.2, 0.5, 1.0, 2.0, 5.0
waxlamp Jun 9, 2021
97a2224
Draw grid lines for imaginary axis
waxlamp Jun 9, 2021
e2f6abd
Draw imaginary axis line properly
waxlamp Jun 9, 2021
7cbf9bc
Clip imaginary axis grid lines to correct angular bounds
waxlamp Jun 9, 2021
7a6f86c
Draw imaginary axis tick labels
waxlamp Jun 16, 2021
edee054
Draw tick labels for real axis
waxlamp Jun 16, 2021
eeba96d
Adjust placement of real axis tick labels
waxlamp Jun 16, 2021
be8a250
Automatic lint fixes
waxlamp Jun 18, 2021
17e60c0
Restrict points to within the smith chart area
waxlamp Jun 18, 2021
c821377
Fix non-automatic lint errors
waxlamp Jun 18, 2021
7ee57e6
Add mock and baseline for smith chart
waxlamp Jun 30, 2021
dc43dd1
Add "smith_lines" baseline
waxlamp Jul 7, 2021
2d6b6bf
Update smith_basic baseline
waxlamp Jul 7, 2021
bb444af
Add "smith_axes" mock and baseline
waxlamp Jul 7, 2021
0fcb0fe
Merge remote-tracking branch 'origin/master' into smith
waxlamp Jul 7, 2021
2abb96c
Update plot-schema.json
waxlamp Jul 7, 2021
166199a
Fix mock validation errors
waxlamp Jul 8, 2021
7346245
Add smith chart to list of subplots
waxlamp Jul 8, 2021
7e67229
Force smith mocks to run at the end
waxlamp Jul 8, 2021
1eb2d51
Rename "radialaxis" to "realaxis"
waxlamp Jul 16, 2021
202d4a5
Rename angularaxis to imaginaryaxis
waxlamp Jul 16, 2021
ce8f742
Merge remote-tracking branch 'origin/master' into smith
waxlamp Jul 19, 2021
7e3e69c
Disable unnecessary tick options
waxlamp Jul 28, 2021
71148d2
Remove options for axis types
waxlamp Jul 28, 2021
61ed436
Remove range options
waxlamp Jul 28, 2021
b822f04
Remove axis processing code for imaginary axis
waxlamp Jul 28, 2021
de9770d
Remove category options
waxlamp Jul 28, 2021
ed8c75a
Remove thetaunit option
waxlamp Jul 28, 2021
afd67e6
Remove period option
waxlamp Jul 28, 2021
06e0c59
Add a scattersmith test
waxlamp Aug 3, 2021
1dc00c7
Add a smith plot react test
waxlamp Aug 3, 2021
135a6e5
Merge remote-tracking branch 'origin/master' into smith
waxlamp Aug 3, 2021
eb94f46
Fix lint errors
waxlamp Aug 3, 2021
dee7fc9
Update schema diff
waxlamp Aug 3, 2021
7dc4ac8
Remove invalid options from mock
waxlamp Aug 3, 2021
6258e63
Remove "polar" category from smith trace
waxlamp Aug 4, 2021
752226b
Remove unnecessary function
waxlamp Aug 4, 2021
03c78eb
Update plot description
waxlamp Aug 4, 2021
df36ae3
Remove `angle` and `side` options from realaxis
waxlamp Aug 4, 2021
83189cf
Change "polar" to "smith"
waxlamp Aug 4, 2021
090251f
Remove deprecated attributes
waxlamp Aug 4, 2021
eddfcde
Rename "polar" to "smith" where definitely possible
waxlamp Aug 4, 2021
66ff9c1
Fix lint errors
waxlamp Aug 4, 2021
7246742
Update plot-schema diff
waxlamp Aug 4, 2021
5d6b528
Update baselines
waxlamp Aug 4, 2021
8676ed2
Merge remote-tracking branch 'origin/master' into smith
waxlamp Aug 4, 2021
316be5c
Rename polar to smith
waxlamp Aug 6, 2021
43a3be8
Remove references to GL versions of smith plot
waxlamp Aug 6, 2021
fdf7776
Remove commented-out lines
waxlamp Aug 6, 2021
8d97671
Remove commented-out code
waxlamp Aug 10, 2021
cb07c28
Refactor constant value lists into variables
waxlamp Aug 10, 2021
2ca14f9
Remove 'backplot' layer and unused drag logic
waxlamp Aug 10, 2021
5c83a18
Reuse polar/helpers.js
waxlamp Aug 10, 2021
8f67a6b
Remove GL logic
waxlamp Aug 10, 2021
e7b47da
Use Lib.bigFont()
waxlamp Aug 10, 2021
3853720
Remove logic to handle category type
waxlamp Aug 10, 2021
e17fcef
Remove category type logic
waxlamp Aug 10, 2021
9c9806e
Remove `hoverinfo` attribute
waxlamp Aug 10, 2021
bb59e34
Remove `texttemplate` attributes
waxlamp Aug 10, 2021
3a9648d
Add hover test for smith plot
waxlamp Aug 11, 2021
736cf2c
Add smith plot test
waxlamp Aug 11, 2021
33edd05
Use option fonts to control tick label rendering
waxlamp Aug 11, 2021
5605f78
Change "name" attr to "smith"
waxlamp Aug 11, 2021
9861349
Rename polarsublayer to smithsublayer
waxlamp Aug 11, 2021
23c1aed
Add and use a `_smithlayer`
waxlamp Aug 11, 2021
f6c748c
Rename axis attr variables
waxlamp Aug 13, 2021
b26f21c
Remove `hole` attribute
waxlamp Aug 13, 2021
8ace040
Remove `sector` attribute
waxlamp Aug 13, 2021
021d708
Remove `gridshape` attribute
waxlamp Aug 13, 2021
80de25d
Remove conditions on 'linear' type
waxlamp Aug 13, 2021
6aabf51
Remove unnecessary type check
waxlamp Aug 13, 2021
8351bfa
Remove unused zoom functions
waxlamp Aug 13, 2021
71eedaa
Remove other drag infrastructure
waxlamp Aug 13, 2021
6b0f08f
Remove the rest of the zoom infrastructure
waxlamp Aug 13, 2021
0063041
Restore texttemplate feature
waxlamp Aug 14, 2021
52f53ce
Merge remote-tracking branch 'origin/master' into smith
waxlamp Aug 16, 2021
d5ad834
Autofix lint errors
waxlamp Aug 16, 2021
994bd49
Remove category axis type processing
waxlamp Aug 16, 2021
d25ea5a
Update schema
waxlamp Aug 16, 2021
e18c8e8
Enable default fonts if spec doesn't specify any
waxlamp Aug 16, 2021
25c75e4
Regenerate baselines
waxlamp Aug 16, 2021
600eee1
Remove unnecessary constants
waxlamp Aug 16, 2021
0128452
Restore selection behavior
waxlamp Aug 16, 2021
c2b84ec
Fix lint errors
waxlamp Aug 16, 2021
d9f8b24
Add select test for scattersmith
waxlamp Aug 16, 2021
14a64c6
Use light blue bgcolor for zzz_smith_line
waxlamp Aug 18, 2021
6fdabfc
Use dark blue bgcolor in zzz_smith_line baseline
waxlamp Aug 18, 2021
08e4e63
Use gray paper bgcolor for smith axes baseline
waxlamp Aug 18, 2021
7f8cb5d
Update baselines
waxlamp Aug 18, 2021
5a329da
Add text labels to baselines
waxlamp Aug 18, 2021
aa13b91
Add baseline for connectgaps
waxlamp Aug 18, 2021
ffd19e7
Add a scattersmith mock to the mock list
waxlamp Aug 18, 2021
383b6f1
Add fill baseline
waxlamp Aug 18, 2021
7da2e28
Add a single plot baseline
waxlamp Sep 1, 2021
fd0f370
Coerce `hoverformat`
waxlamp Sep 1, 2021
c1613b2
Add tests modeled after tests in polar
waxlamp Sep 1, 2021
56e0a97
Merge pull request #5615 from arclamp/smith
archmoj Sep 27, 2021
60c30f4
revise smith
archmoj Sep 29, 2021
6eae41c
Merge remote-tracking branch 'origin/master' into smith-prototype
archmoj Sep 30, 2021
5c720db
add smith chart to plot_api_react test
archmoj Sep 30, 2021
065c4ea
remove unsupported Infinity from smith mock
archmoj Sep 30, 2021
3e53615
no need to add smith axes to axList
archmoj Sep 30, 2021
54d2ca2
refactor - avoid long _hasClipOnAxisFalse key twice
archmoj Sep 30, 2021
8796e76
delete range from smith axis at the end of plot
archmoj Sep 30, 2021
bc8863c
no real axis title
archmoj Sep 30, 2021
3fe6fd2
default cliponaxis to false similar to polar - adjust mocks
archmoj Sep 30, 2021
873d5ea
Merge remote-tracking branch 'origin/master' into smith-prototype
archmoj Oct 1, 2021
d8b9ba2
Merge remote-tracking branch 'origin/master' into smith-prototype
archmoj Oct 1, 2021
e367b07
fix and add hover test for prefix and tickformat
archmoj Oct 1, 2021
b9ed688
limit smith interactions to hover, select and click
archmoj Oct 1, 2021
ef90f13
improve smith test for prefix, suffix and tickangle
archmoj Oct 1, 2021
743d06c
drop unused attributes from smith
archmoj Oct 1, 2021
f2390d3
no showexponent for smith
archmoj Oct 1, 2021
8ec732f
clear ax._m and copied comments from polar
archmoj Oct 1, 2021
4f5f227
remove smith setConvert - reuse cartesian
archmoj Oct 1, 2021
2a4a8a3
clear copied TODO comment from polar
archmoj Oct 1, 2021
3c5df3e
rename mocks from zzz_smith to smith
archmoj Oct 5, 2021
76c4871
improve smith chart tests - use gradient options
archmoj Oct 8, 2021
e485e86
improve smith chart tests - colorscale and dash
archmoj Oct 8, 2021
87a9f46
update baseline
archmoj Oct 8, 2021
ea16526
Merge remote-tracking branch 'origin/master' into smith-prototype
archmoj Oct 8, 2021
06ea178
Merge remote-tracking branch 'origin/master' into smith-prototype
archmoj Oct 18, 2021
73d37a6
cleanup unused logic
archmoj Oct 18, 2021
b5c2ec6
remove comment
archmoj Oct 18, 2021
6c8ab02
remove unused smith invert function until spikes needed
archmoj Oct 18, 2021
f4245d0
simplify smith helpers
archmoj Oct 18, 2021
475a6f1
use isFinite to test for infinities
archmoj Oct 18, 2021
cdba977
update smith_gaps baseline
archmoj Oct 18, 2021
edf124e
refactor smith layout_attributes
archmoj Oct 18, 2021
32fde3b
Update src/plots/polar/polar.js
archmoj Oct 18, 2021
cb1b4b4
update baselines
archmoj Oct 19, 2021
cacf161
increase the size of infinity
archmoj Oct 19, 2021
d30416d
improve description for real and imaginary components
archmoj Oct 19, 2021
cfa96e5
inherit imaginary tickvals default from real axis
archmoj Oct 19, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rename "polar" to "smith" where definitely possible
Some of the other instances of the word "polar" may not be able to be
replaced automatically and we will need to move more carefully on those.
But, for example, references to local variables and within comments can
be unilaterally translated.
  • Loading branch information
waxlamp committed Aug 4, 2021
commit eddfcde022b667bf69b123ad4258bb1ebfba53d3
2 changes: 1 addition & 1 deletion src/plots/smith/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ attributes[attr] = {
description: [
'Sets a reference between this trace\'s data coordinates and',
'a smith subplot.',
'If *smith* (the default value), the data refer to `layout.polar`.',
'If *smith* (the default value), the data refer to `layout.smith`.',
'If *smith2*, the data refer to `layout.smith2`, and so on.'
].join(' ')
};
Expand Down
14 changes: 7 additions & 7 deletions src/plots/smith/layout_attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ var radialAxisAttrs = {
description: [
'Controls persistence of user-driven changes in axis `range`,',
'`autorange`, `angle`, and `title` if in `editable: true` configuration.',
'Defaults to `polar<N>.uirevision`.'
'Defaults to `smith<N>.uirevision`.'
].join(' ')
},

Expand Down Expand Up @@ -98,10 +98,10 @@ var angularAxisAttrs = {
editType: 'calc',
description: [
'Sets that start position (in degrees) of the angular axis',
'By default, polar subplots with `direction` set to *counterclockwise*',
'By default, smith subplots with `direction` set to *counterclockwise*',
'get a `rotation` of *0*',
'which corresponds to due East (like what mathematicians prefer).',
'In turn, polar with `direction` set to *clockwise* get a rotation of *90*',
'In turn, smith with `direction` set to *clockwise* get a rotation of *90*',
'which corresponds to due North (like on a compass),'
].join(' ')
},
Expand All @@ -124,7 +124,7 @@ extendFlat(
angularAxisAttrs,

// N.B. angular grid lines are straight lines from circle center to outer bound
// the angular line is circular bounding the polar plot area.
// the angular line is circular bounding the smith plot area.
axisLineGridAttr,

// N.B. ticksuffix defaults to '°' for angular axes with `thetaunit: 'degrees'`
Expand All @@ -148,9 +148,9 @@ module.exports = {
dflt: [0, 360],
editType: 'plot',
description: [
'Sets angular span of this polar subplot with two angles (in degrees).',
'Sets angular span of this smith subplot with two angles (in degrees).',
'Sector are assumed to be spanned in the counterclockwise direction',
'with *0* corresponding to rightmost limit of the polar subplot.'
'with *0* corresponding to rightmost limit of the smith subplot.'
].join(' ')
},
hole: {
Expand All @@ -160,7 +160,7 @@ module.exports = {
dflt: 0,
editType: 'plot',
description: [
'Sets the fraction of the radius to cut out of the polar subplot.'
'Sets the fraction of the radius to cut out of the smith subplot.'
].join(' ')
},

Expand Down
2 changes: 1 addition & 1 deletion src/plots/smith/layout_defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function handleDefaults(contIn, contOut, coerce, opts) {
// as both radial and angular axes don't have a set domain.
// Furthermore, angular axes don't have a set range.
//
// Mocked domains and ranges are set by the polar subplot instances,
// Mocked domains and ranges are set by the smith subplot instances,
// but Axes.findExtremes uses the sign of _m to determine which padding value
// to use.
//
Expand Down
28 changes: 14 additions & 14 deletions src/plots/smith/set_convert.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ var deg2rad = Lib.deg2rad;
var rad2deg = Lib.rad2deg;

/**
* setConvert for polar axes!
* setConvert for smith axes!
*
* @param {object} ax
* axis in question (works for both radial and angular axes)
* @param {object} polarLayout
* full polar layout of the subplot associated with 'ax'
* @param {object} smithLayout
* full smith layout of the subplot associated with 'ax'
* @param {object} fullLayout
* full layout
*
Expand All @@ -26,7 +26,7 @@ var rad2deg = Lib.rad2deg;
*
* Radial axis coordinate systems:
* - d, c and l: same as for cartesian axes
* - g: like calcdata but translated about `realaxis.range[0]` & `polar.hole`
* - g: like calcdata but translated about `realaxis.range[0]` & `smith.hole`
*
* Angular axis coordinate systems:
* - d: data, in whatever form it's provided
Expand All @@ -38,25 +38,25 @@ var rad2deg = Lib.rad2deg;
*
* Then, 'g'eometric data is ready to be converted to (x,y).
*/
module.exports = function setConvert(ax, polarLayout, fullLayout) {
module.exports = function setConvert(ax, smithLayout, fullLayout) {
setConvertCartesian(ax, fullLayout);

switch(ax._id) {
case 'x':
case 'realaxis':
setConvertRadial(ax, polarLayout);
setConvertRadial(ax, smithLayout);
break;
case 'imaginaryaxis':
setConvertAngular(ax, polarLayout);
setConvertAngular(ax, smithLayout);
break;
case 'realaxis2':
setConvertReal(ax, polarLayout);
setConvertReal(ax, smithLayout);
break;
}
};

function setConvertReal(ax, polarLayout) {
var subplot = polarLayout._subplot;
function setConvertReal(ax, smithLayout) {
var subplot = smithLayout._subplot;
var radius = subplot.radius;

ax.setGeometry = function() {
Expand Down Expand Up @@ -84,8 +84,8 @@ function setConvertReal(ax, polarLayout) {
};
}

function setConvertRadial(ax, polarLayout) {
var subplot = polarLayout._subplot;
function setConvertRadial(ax, smithLayout) {
var subplot = smithLayout._subplot;

ax.setGeometry = function() {
var rl0 = ax._rl[0];
Expand Down Expand Up @@ -121,7 +121,7 @@ function fromRadians(v, unit) {
return unit === 'degrees' ? rad2deg(v) : v;
}

function setConvertAngular(ax, polarLayout) {
function setConvertAngular(ax, smithLayout) {
var axType = ax.type;

if(axType === 'linear') {
Expand Down Expand Up @@ -170,7 +170,7 @@ function setConvertAngular(ax, polarLayout) {

// N.B. we mock the axis 'range' here
ax.setGeometry = function() {
var sector = polarLayout.sector;
var sector = smithLayout.sector;
var sectorInRad = sector.map(deg2rad);
var dir = {clockwise: -1, counterclockwise: 1}[ax.direction];
var rot = deg2rad(ax.rotation);
Expand Down
Loading