All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.jetbrains.datalore.plot.config.AnnotationConfig.kt Maven / Gradle / Ivy

There is a newer version: 3.2.0
Show newest version
/*
 * 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)
            )
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy