-
Notifications
You must be signed in to change notification settings - Fork 47
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
Violin geometry #487
Violin geometry #487
Conversation
…scale='width' version of statistic computation is realized by default.
plot-base-portable/src/commonMain/kotlin/jetbrains/datalore/plot/base/GeomMeta.kt
Outdated
Show resolved
Hide resolved
plot-base-portable/src/commonMain/kotlin/jetbrains/datalore/plot/base/stat/ViolinStat.kt
Outdated
Show resolved
Hide resolved
plot-base-portable/src/commonMain/kotlin/jetbrains/datalore/plot/base/geom/ViolinGeom.kt
Outdated
Show resolved
Hide resolved
plot-base-portable/src/commonMain/kotlin/jetbrains/datalore/plot/base/geom/ViolinGeom.kt
Outdated
Show resolved
Hide resolved
bwMethod: DensityStat.BandWidthMethod, | ||
ad: Double, | ||
ker: DensityStat.Kernel, | ||
fullScalMax: Int |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copy-paste failure :) Pls. rename to fullScanMax
.
...ilder-portable/src/commonMain/kotlin/jetbrains/datalore/plot/builder/scale/DefaultNaValue.kt
Outdated
Show resolved
Hide resolved
plot-base-portable/src/commonMain/kotlin/jetbrains/datalore/plot/base/stat/ViolinStat.kt
Outdated
Show resolved
Hide resolved
plot-base-portable/src/commonMain/kotlin/jetbrains/datalore/plot/base/stat/ViolinStat.kt
Outdated
Show resolved
Hide resolved
plot-config-portable/src/commonMain/kotlin/jetbrains/datalore/plot/config/GeomProto.kt
Outdated
Show resolved
Hide resolved
plot-config-portable/src/commonMain/kotlin/jetbrains/datalore/plot/config/StatKind.kt
Outdated
Show resolved
Hide resolved
@@ -67,6 +68,7 @@ object AesInitValue { | |||
VALUE_MAP[SIZE] = 0.5 // Line thickness. Should be redefined for other shapes | |||
VALUE_MAP[WIDTH] = 1.0 | |||
VALUE_MAP[HEIGHT] = 1.0 | |||
VALUE_MAP[VIOLINWIDTH] = 1.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0.0 would make more sense, though violinwidth default is hardly eve used.
|
||
private fun toLocationBound(sign: Double, ctx: GeomContext): (p: DataPointAesthetics) -> DoubleVector? { | ||
return fun (p: DataPointAesthetics): DoubleVector? { | ||
val x = p.x()!! + ctx.getResolution(Aes.X) / 2 * DEF_WIDTH * sign * p.violinwidth()!! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"DEF_WIDTH" is not a good name. This is rather some scaling which makes violin plot look better.
xs | ||
val densityFunction = DensityStatUtil.densityFunction( | ||
xs, weights, | ||
bandWidth, bandWidthMethod, adjust, kernel, fullScalMax |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename: fullScalMax -> fullScanMax
|
||
override fun normalize(data: DataFrame): DataFrame { | ||
val statDensity = data.getNumeric(Stats.DENSITY).map { it!! } | ||
val densityMax = statDensity.maxOrNull()!! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NPE in case of an empty dataframe.
No description provided.