Skip to content
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

coord_polar: axis, ticks, labels, xlim/ylim #979

Merged
merged 18 commits into from
Jan 10, 2024
Merged
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
c574810
Make expand additive
IKupriyanov-HORIS Dec 20, 2023
2467a22
coord_polar: reduce number of ticks for v axis
IKupriyanov-HORIS Dec 20, 2023
4fc32be
coord_polar: replace absolute expand with relative
IKupriyanov-HORIS Dec 20, 2023
4be95a0
coord_polar: v axis ticks alignment
IKupriyanov-HORIS Dec 20, 2023
e3d7535
coord_polar: hardcoded anchor for ticks
IKupriyanov-HORIS Dec 20, 2023
a9705f1
coord_polar: more ticks for circle axis
IKupriyanov-HORIS Dec 21, 2023
52151a7
coord_polar: fix horizontal axis ticks order, fix axis circle positio…
IKupriyanov-HORIS Dec 21, 2023
7af0732
coord_polar: fix horizontal axis first and last ticks overlapping
IKupriyanov-HORIS Dec 21, 2023
f6fd891
coord_polar: update notebook
IKupriyanov-HORIS Dec 22, 2023
0900649
coord_polar: replace thetaFromX with flipped
IKupriyanov-HORIS Dec 25, 2023
f54d197
coord_polar: temp fix for axis, need proper fix for the domain flip
IKupriyanov-HORIS Dec 26, 2023
62f8d02
coord_polar: properly handle theta=y in PolarCoordinateSystem
IKupriyanov-HORIS Dec 27, 2023
dc71ebc
coord_polar: handle theta=y mostly in PolarCoordinateSystem. Investig…
IKupriyanov-HORIS Dec 27, 2023
9c94803
coord_polar: fixed breaks and ticks. The only not working case is a Y…
IKupriyanov-HORIS Dec 28, 2023
a550e39
coord_polar: fixed breaks and ticks with start parameter
IKupriyanov-HORIS Dec 28, 2023
b99f9ea
coord_polar: minor code cleanup
IKupriyanov-HORIS Dec 29, 2023
09921c8
coord_polar: fix domain for discrete angle scale
IKupriyanov-HORIS Jan 1, 2024
0e4782f
coord_polar: add xlim/ylim for radar plot / lollipop
IKupriyanov-HORIS Jan 5, 2024
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
coord_polar: handle theta=y mostly in PolarCoordinateSystem. Investig…
…ate bug with stack bars with theta=y not rendered properly
  • Loading branch information
IKupriyanov-HORIS committed Jan 5, 2024
commit dc71ebcafd144edf500391506b3e6b3fc2e40a55
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@ internal class PolarCoordProvider(
// Keep lower end as is to avoid hole in the center and to keep correct start angle.
// Extend upper end of the radius domain by 0.15 to make room for labels and axis line.

val thetaDomain = domain.xRange()
val rDomain = domain.yRange()
val realDomain = domain.flipIf(flipped)
val thetaDomain = realDomain.xRange()
val rDomain = realDomain.yRange()
val adjustedRDomain = DoubleSpan(rDomain.lowerEnd, rDomain.upperEnd + rDomain.length * 0.15)

return DoubleRectangle(thetaDomain, adjustedRDomain).flipIf(flipped)
return DoubleRectangle(thetaDomain, adjustedRDomain)
}

override fun adjustGeomSize(hDomain: DoubleSpan, vDomain: DoubleSpan, geomSize: DoubleVector): DoubleVector {
Expand All @@ -51,16 +52,15 @@ internal class PolarCoordProvider(

override fun createCoordinateMapper(adjustedDomain: DoubleRectangle, clientSize: DoubleVector): CoordinatesMapper {
val polarProjection = object : Projection {
val domain = adjustedDomain.flipIf(flipped)

val thetaDomain = domain.xRange()
val rDomain = domain.yRange()
val valDomain = adjustedDomain//.flipIf(flipped)

val rDomain = valDomain.yRange()
val rNorm = 0.0 - rDomain.lowerEnd
val rDomainNorm = DoubleSpan(0.0, rDomain.upperEnd + rNorm)

val thetaDomain = valDomain.xRange()
val thetaNorm = 0.0 - thetaDomain.lowerEnd
val norm = DoubleVector(thetaNorm, rNorm)

val rDomainNorm = DoubleSpan(0.0, rDomain.upperEnd + rNorm)
val thetaDomainNorm = DoubleSpan(0.0, thetaDomain.upperEnd + thetaNorm)

val rScaleMapper = Mappers.mul(rDomainNorm, min(clientSize.x, clientSize.y) / 2.0)
Expand All @@ -74,7 +74,7 @@ internal class PolarCoordProvider(
override val nonlinear: Boolean = true

override fun project(v: DoubleVector): DoubleVector {
val normalized = v.add(norm)
val normalized = v.add(norm).flipIf(flipped)
val theta = thetaScaleMapper(normalized.x)
val r = rScaleMapper(normalized.y)

Expand Down