JetBrains / lets-plot-kotlin

Grammar of Graphics for Kotlin
https://lets-plot.org/kotlin/
MIT License
419 stars 36 forks source link

Bug with Tooltips in Swing/Batik #225

Closed AndreiKingsley closed 3 months ago

AndreiKingsley commented 7 months ago
image
 val plot = letsPlot(dataset) + geomLine {
        x = "stage"
        y = "value"
        color = asDiscrete("id")
    }

    val processedSpec = MonolithicCommon.processRawSpecs(plot.toSpec(), frontendOnly = false)

    val panel =  DefaultPlotPanelBatik(
        processedSpec = processedSpec,
        preserveAspectRatio = true,
        preferredSizeFromPlot = false,
        repaintDelay = 10,
    ) { messages ->
        for (message in messages) {
            println("[Example App] $message")
        }
    }

    val window = JFrame("Example App (Swing-Batik)")
    window.defaultCloseOperation = EXIT_ON_CLOSE
    window.contentPane.layout = BoxLayout(window.contentPane, BoxLayout.Y_AXIS)

    window.contentPane.add(panel)

    SwingUtilities.invokeLater {
        window.pack()
        window.size = Dimension(850, 400)
        window.setLocationRelativeTo(null)
        window.isVisible = true
    }

dataset.csv

OLarionova-HORIS commented 3 months ago

The problem was fixed by https://github.com/JetBrains/lets-plot/commit/d47dd4aa9f7d4ef76c800098af983cbb3cb2bbde = LPK v4.6.0