Skip to content

Commit

Permalink
Fix formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
gsteckman committed Oct 8, 2022
1 parent 761733f commit 95cd1bf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ import androidx.compose.ui.unit.dp
import io.github.koalaplot.core.DiamondShape
import io.github.koalaplot.core.Symbol
import io.github.koalaplot.core.util.ExperimentalKoalaPlotApi
import io.github.koalaplot.core.util.max
import io.github.koalaplot.core.util.min
import io.github.koalaplot.core.xychart.AxisStyle
import io.github.koalaplot.core.xychart.LinearAxisModel
import io.github.koalaplot.core.xychart.autoScaleRange
Expand Down Expand Up @@ -368,9 +366,9 @@ public class AxisSettings {

private fun createLinearAxisModel(builtScope: BulletBuilderScope): LinearAxisModel {
val range = (
builtScope.rangesScope.ranges.map { it.value }
+ builtScope.featuredMeasure.value
+ builtScope.comparativeMeasures.map { it.value }
builtScope.rangesScope.ranges.map { it.value } +
builtScope.featuredMeasure.value +
builtScope.comparativeMeasures.map { it.value }
).autoScaleRange()

return LinearAxisModel(range, allowZooming = false, allowPanning = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import kotlin.math.log10
import kotlin.math.max
import kotlin.math.min
import kotlin.math.pow
import kotlin.math.round
import kotlin.math.sign

private val TickRatios = listOf(0.1f, 0.2f, 0.5f, 1f, 2f)
Expand Down Expand Up @@ -50,8 +49,9 @@ public class LinearAxisModel constructor(
private val allowPanning: Boolean = true,
) : AxisModel<Float> {
init {
require(range.endInclusive > range.start)
{ "Axis range end (${range.endInclusive}) must be greater than start (${range.start})" }
require(range.endInclusive > range.start) {
"Axis range end (${range.endInclusive}) must be greater than start (${range.start})"
}
require(minimumMajorTickSpacing > 0.dp) { "Minimum major tick spacing must be greater than 0 dp" }
require(zoomRangeLimit > 0f) {
"Zoom range limit must be greater than 0"
Expand All @@ -76,7 +76,7 @@ public class LinearAxisModel constructor(

return buildList {
if (tickSpacing > 0) {
var tickCount = floor(currentRange.start/tickSpacing)
var tickCount = floor(currentRange.start / tickSpacing)
do {
val lastTick = tickCount * tickSpacing
if (lastTick in currentRange) {
Expand Down

0 comments on commit 95cd1bf

Please sign in to comment.