Skip to content

Commit

Permalink
Move initialization of isYOrientation variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
RYangazov committed Apr 8, 2024
1 parent 67bb1fa commit 2b23c4e
Showing 1 changed file with 34 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,17 +90,6 @@ class LayerConfig(
}

val isYOrientation: Boolean
get() = when (hasOwn(ORIENTATION)) {
true -> getString(ORIENTATION)?.lowercase()?.let {
when (it) {
"y" -> true
"x" -> false
else -> throw IllegalArgumentException("$ORIENTATION expected x|y but was $it")
}
} ?: false

false -> false
}

// Marginal layers
val isMarginal: Boolean = getBoolean(MARGINAL, false)
Expand Down Expand Up @@ -157,27 +146,40 @@ class LayerConfig(
ownDiscreteAes = DataMetaUtil.getAsDiscreteAesSet(getMap(DATA_META))
)

if (!clientSide
&& !hasOwn(ORIENTATION)
&& isOrientationApplicable()
&& !DataConfigUtil.isAesDiscrete(
Aes.X,
plotData,
ownData,
plotMappings,
layerMappings,
combinedDiscreteMappings
)
&& DataConfigUtil.isAesDiscrete(
Aes.Y,
plotData,
ownData,
plotMappings,
layerMappings,
combinedDiscreteMappings
)
) {
setOrientationY()
isYOrientation = when (hasOwn(ORIENTATION)) {
true -> getString(ORIENTATION)?.lowercase()?.let {
when (it) {
"y" -> true
"x" -> false
else -> throw IllegalArgumentException("$ORIENTATION expected x|y but was $it")
}
} ?: false

false ->
if (!clientSide
&& isOrientationApplicable()
&& !DataConfigUtil.isAesDiscrete(
Aes.X,
plotData,
ownData,
plotMappings,
layerMappings,
combinedDiscreteMappings
)
&& DataConfigUtil.isAesDiscrete(
Aes.Y,
plotData,
ownData,
plotMappings,
layerMappings,
combinedDiscreteMappings
)
) {
setOrientationY()
true
} else {
false
}
}

val consumedAesSet: Set<Aes<*>> = renderedAes.toSet().let {
Expand Down

0 comments on commit 2b23c4e

Please sign in to comment.