Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
breandan committed Sep 13, 2023
2 parents f510921 + 9a1bbaf commit 065daa2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ kotlin {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3")

implementation("org.jetbrains.kotlinx:kotlinx-html-jvm:$kotlinxVersion") // TODO: why is this necessary?
implementation("org.jetbrains.lets-plot:lets-plot-kotlin-jvm:4.4.1")

implementation("org.jetbrains.lets-plot:platf-awt-jvm:4.0.0")
implementation("org.jetbrains.lets-plot:lets-plot-kotlin-jvm:4.4.2")

// https://arxiv.org/pdf/1908.10693.pdf
// implementation("com.datadoghq:sketches-java:0.7.0")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package ai.hypergraph.markovian.experiments
//import jetbrains.datalore.base.geometry.DoubleVector
//import jetbrains.datalore.plot.PlotSvgExport
//import jetbrains.letsPlot.geom.*
//import jetbrains.letsPlot.ggplot
//import jetbrains.letsPlot.ggsize
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,21 @@ package ai.hypergraph.markovian.experiments

import ai.hypergraph.kaliningraph.visualization.browserCmd
import ai.hypergraph.markovian.pmap
import jetbrains.datalore.base.geometry.DoubleVector
import jetbrains.datalore.plot.PlotSvgExportPortable
import org.jetbrains.letsPlot.commons.geometry.DoubleVector
import org.jetbrains.letsPlot.geom.geomDensity
import org.jetbrains.letsPlot.ggsize
import org.jetbrains.letsPlot.intern.Plot
import org.jetbrains.letsPlot.intern.toSpec

import org.jetbrains.letsPlot.awt.plot.PlotSvgExport
import org.jetbrains.letsPlot.letsPlot
import java.io.File
import kotlin.random.Random

fun Plot.display() =
File.createTempFile("test", ".svg").also {
val plotSize = DoubleVector(1000.0, 500.0)
val plot = PlotSvgExportPortable.buildSvgImageFromRawSpecs( this@display.toSpec(), plotSize)
val plot = PlotSvgExport.buildSvgImageFromRawSpecs( this@display.toSpec(), plotSize)
it.writeText(plot)
}.also { ProcessBuilder(browserCmd, it.path).start() }

Expand Down

0 comments on commit 065daa2

Please sign in to comment.