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

Autorotate discrete #1032

Merged
merged 4 commits into from
Apr 8, 2024
Merged
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
Move initialization of isYOrientation variable.
  • Loading branch information
RYangazov committed Apr 8, 2024
commit 2b23c4e9afc86cf63a0946ea36956526ab1fdadf
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