-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Better polar setConvert + a few misc polar touch ups #2895
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
Changes from 1 commit
e9c3ef8
80717d5
3d8eef2
87a3920
91064ca
3787bfa
4f881fa
449dc43
dae3ccd
d3b3615
ec57a42
f5bceda
0c517d1
4c11c84
b4700ca
c3044e0
b81885d
75786e4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -554,7 +554,7 @@ axes.calcTicks = function calcTicks(ax) { | |
|
||
// If same angle over a full circle, the last tick vals is a duplicate. | ||
// TODO must do something similar for angular date axes. | ||
if(ax._id === 'angular' && Math.abs(rng[1] - rng[0]) === 360) { | ||
if(ax._id === 'angularaxis' && Math.abs(rng[1] - rng[0]) === 360) { | ||
vals.pop(); | ||
} | ||
|
||
|
@@ -722,7 +722,7 @@ axes.autoTicks = function(ax, roughDTick) { | |
ax.tick0 = 0; | ||
ax.dtick = Math.ceil(Math.max(roughDTick, 1)); | ||
} | ||
else if(ax._id === 'angular') { | ||
else if(ax._id === 'angularaxis') { | ||
ax.tick0 = 0; | ||
base = 1; | ||
ax.dtick = roundDTick(roughDTick, base, roundAngles); | ||
|
@@ -958,7 +958,7 @@ axes.tickText = function(ax, x, hover) { | |
if(ax.type === 'date') formatDate(ax, out, hover, extraPrecision); | ||
else if(ax.type === 'log') formatLog(ax, out, hover, extraPrecision, hideexp); | ||
else if(ax.type === 'category') formatCategory(ax, out); | ||
else if(ax._id === 'angular') formatAngle(ax, out, hover, extraPrecision, hideexp); | ||
else if(ax._id === 'angularaxis') formatAngle(ax, out, hover, extraPrecision, hideexp); | ||
else formatLinear(ax, out, hover, extraPrecision, hideexp); | ||
|
||
// add prefix and suffix | ||
|
@@ -1646,7 +1646,7 @@ axes.doTicksSingle = function(gd, arg, skipTitle) { | |
else return 'M' + shift + ',0h' + len; | ||
}; | ||
} | ||
else if(axid === 'angular') { | ||
else if(axid === 'angularaxis') { | ||
sides = ['left', 'right']; | ||
transfn = ax._transfn; | ||
tickpathfn = function(shift, len) { | ||
|
@@ -1682,7 +1682,7 @@ axes.doTicksSingle = function(gd, arg, skipTitle) { | |
var valsClipped = vals.filter(clipEnds); | ||
|
||
// don't clip angular values | ||
if(ax._id === 'angular') { | ||
if(ax._id === 'angularaxis') { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not new in this PR, but I think you have an There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. went one step further in 0c517d1 |
||
valsClipped = vals; | ||
} | ||
|
||
|
@@ -1751,7 +1751,7 @@ axes.doTicksSingle = function(gd, arg, skipTitle) { | |
return axside === 'right' ? 'start' : 'end'; | ||
}; | ||
} | ||
else if(axid === 'angular') { | ||
else if(axid === 'angularaxis') { | ||
ax._labelShift = labelShift; | ||
ax._labelStandoff = labelStandoff; | ||
ax._pad = pad; | ||
|
@@ -1798,7 +1798,7 @@ axes.doTicksSingle = function(gd, arg, skipTitle) { | |
maxFontSize = Math.max(maxFontSize, d.fontSize); | ||
}); | ||
|
||
if(axid === 'angular') { | ||
if(axid === 'angularaxis') { | ||
tickLabels.each(function(d) { | ||
d3.select(this).select('text') | ||
.call(svgTextUtils.positionText, labelx(d), labely(d)); | ||
|
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -142,7 +142,7 @@ proto.updateLayers = function(fullLayout, polarLayout) { | |||
break; | ||||
case 'angular-grid': | ||||
sel.style('fill', 'none'); | ||||
sel.append('g').classed('angular', 1); | ||||
sel.append('g').classed('angularaxis', 1); | ||||
break; | ||||
case 'radial-line': | ||||
sel.append('line').style('fill', 'none'); | ||||
|
@@ -257,8 +257,6 @@ proto.updateLayout = function(fullLayout, polarLayout) { | |||
_this.angularAxis = _this.mockAxis(fullLayout, polarLayout, angularLayout, { | ||||
_axislayer: layers['angular-axis'], | ||||
_gridlayer: layers['angular-grid'], | ||||
// angular axes need *special* logic | ||||
_id: 'angular', | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for reference, here's where
|
||||
side: 'right', | ||||
// to get auto nticks right | ||||
domain: [0, Math.PI], | ||||
|
@@ -547,7 +545,7 @@ proto.updateAngularAxis = function(fullLayout, polarLayout) { | |||
|
||||
var newTickLayout = strTickLayout(angularLayout); | ||||
if(_this.angularTickLayout !== newTickLayout) { | ||||
layers['angular-axis'].selectAll('.angulartick').remove(); | ||||
layers['angular-axis'].selectAll('.' + ax._id + 'tick').remove(); | ||||
_this.angularTickLayout = newTickLayout; | ||||
} | ||||
|
||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This gets a lot of reuse... perhaps
function isAngular(axid) { return axid === 'angularaxis'; }
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good call -> 0c517d1