jvmMain.org.jetbrains.letsPlot.intern.PlotSpecUtil.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lets-plot-kotlin-kernel Show documentation
Show all versions of lets-plot-kotlin-kernel Show documentation
Lets-Plot Kotlin API without dependencies.
/*
* Copyright (c) 2021. JetBrains s.r.o.
* Use of this source code is governed by the MIT license that can be found in the LICENSE file.
*/
package org.jetbrains.letsPlot.intern
import org.jetbrains.letsPlot.Figure
import org.jetbrains.letsPlot.commons.intern.json.JsonSupport
/**
* Used in IDEA Plugin
*/
@Suppress("unused")
object PlotSpecUtil {
@JvmStatic
fun toSpecJson(fig: Figure): String {
val spec = fig.toSpec()
return JsonSupport.formatJson(spec)
}
@JvmStatic
fun fromSpecJson(specJson: String): MutableMap {
return JsonSupport.parseJson(specJson)
}
}