commonMain.jetbrains.datalore.plot.config.AnnotationConfig.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of plot-config-portable-js Show documentation
Show all versions of plot-config-portable-js Show documentation
The Let-Plot Kotlin API depends on this artifact.
/*
* Copyright (c) 2022. 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.config
import jetbrains.datalore.plot.base.Aes
import jetbrains.datalore.plot.builder.VarBinding
import jetbrains.datalore.plot.builder.annotation.AnnotationLine
import jetbrains.datalore.plot.builder.annotation.AnnotationSpecification
class AnnotationConfig(
opts: Map,
constantsMap: Map, Any>,
groupingVarName: String?,
varBindings: List
) : LineSpecConfigParser(opts, constantsMap, groupingVarName, varBindings) {
fun createAnnotations(): AnnotationSpecification {
return create().run {
AnnotationSpecification(
valueSources = valueSources,
linePatterns = linePatterns?.map(::AnnotationLine) ?: emptyList(),
textSize = getDouble(Option.Layer.ANNOTATION_SIZE)
)
}
}
}