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

Updates in lollipops #768

Merged
merged 12 commits into from
Apr 28, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Increase multiplicative expand for the continuous scale when geometry…
… is lollipop.
  • Loading branch information
ASmirnov-HORIS committed Apr 25, 2023
commit 47294a8988e368fb319f0378d8c561061085c246
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,12 @@ object PlotUtil {
internal fun rangeWithExpand(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you instead keep the size related stuff in lollipop geom widthSpan / heightSpan ?

range: DoubleSpan?,
scale: Scale,
includeZero: Boolean
includeZero: Boolean,
mulExpCoeff: Double
): DoubleSpan? {
if (range == null) return null

val mulExp = scale.multiplicativeExpand
val mulExp = mulExpCoeff * scale.multiplicativeExpand
val addExp = scale.additiveExpand

// Compute expands in terms of the original data.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,9 @@ internal object PositionalScalesUtil {
true -> updateRange(DoubleSpan.singleton(0.0), range)
false -> range
}
val mulExpCoeff = 1.0.takeUnless { layers.any { it.geomKind == GeomKind.LOLLIPOP } } ?: 2.0

return PlotUtil.rangeWithExpand(range, scale, includeZero)
return PlotUtil.rangeWithExpand(range, scale, includeZero, mulExpCoeff)
}

private fun updateRange(values: Iterable<Double>, wasRange: DoubleSpan?): DoubleSpan {
Expand Down