forked from JetBrains/lets-plot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AesScaling.kt
37 lines (29 loc) · 927 Bytes
/
AesScaling.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
* Copyright (c) 2019. JetBrains s.r.o.
* Use of this source code is governed by the MIT license that can be found in the LICENSE file.
*/
package jetbrains.datalore.plot.base.aes
import jetbrains.datalore.plot.base.DataPointAesthetics
object AesScaling {
private const val CIRCLE_DIAMETER_FACTOR = 2.2
fun strokeWidth(p: DataPointAesthetics): Double {
// aes Units -> px
return p.size()!! * 2.0
}
fun circleDiameter(p: DataPointAesthetics): Double {
// aes Units -> px
return p.size()!! * 2.2
}
fun circleDiameterSmaller(p: DataPointAesthetics): Double {
// aes Units -> px
return p.size()!! * 1.5
}
fun sizeFromCircleDiameter(diameter: Double): Double {
// px -> aes Units
return diameter / 2.2
}
fun textSize(p: DataPointAesthetics): Double {
// aes Units -> px
return p.size()!! * 2
}
}