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

Violin geometry #487

Merged
merged 78 commits into from
Dec 22, 2021
Merged

Conversation

ASmirnov-HORIS
Copy link
Collaborator

No description provided.

ASmirnov-HORIS and others added 30 commits August 20, 2021 11:12
bwMethod: DensityStat.BandWidthMethod,
ad: Double,
ker: DensityStat.Kernel,
fullScalMax: Int
Copy link
Collaborator

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.

@ASmirnov-HORIS ASmirnov-HORIS marked this pull request as draft December 15, 2021 12:06
@@ -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
Copy link
Collaborator

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()!!
Copy link
Collaborator

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
Copy link
Collaborator

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()!!
Copy link
Collaborator

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.

@ASmirnov-HORIS ASmirnov-HORIS marked this pull request as ready for review December 22, 2021 14:44
@IKupriyanov-HORIS IKupriyanov-HORIS merged commit 5950943 into JetBrains:master Dec 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants