File tree Expand file tree Collapse file tree 3 files changed +23
-2
lines changed
commonMain/kotlin/org/jetbrains/letsPlot/skia/compose
desktopMain/kotlin/org/jetbrains/letsPlot/skia/compose Expand file tree Collapse file tree 3 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,10 @@ androidx.compose.bom=2025.08.00
2323androidx.activity.compose =1.10.1
2424
2525# Versions
26+
27+ # Beware of the versions in IDEA platform
28+ # The list of 3rd party libraries used in the IDEA platform: https://www.jetbrains.com/legal/third-party-software/?product=IIU
29+
2630# KMP is not compatible with AGP 8.3 yet.
2731compose.version =1.8.2
2832skiko.version =0.9.4.2
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright (c) 2025 JetBrains s.r.o.
3+ * Use of this source code is governed by the MIT license that can be found in the LICENSE file.
4+ */
5+
6+ package org.jetbrains.letsPlot.skia.compose
7+
8+
9+ interface WithRawSpec {
10+ val rawSpec: MutableMap <String , Any >
11+ }
Original file line number Diff line number Diff line change @@ -41,8 +41,14 @@ actual fun PlotPanel(
4141 // Update density on each recomposition to handle monitor DPI changes (e.g., drag between HIDPI/regular monitor)
4242 val density = LocalDensity .current.density.toDouble()
4343
44- // Cache processed plot spec to avoid reprocessing the same figure on every recomposition.
45- val processedPlotSpec by remember(figure) { mutableStateOf(processRawSpecs(figure.toSpec(), frontendOnly = false )) }
44+ // Cache plot processed spec to avoid reprocessing the same figure on every recomposition.
45+ val processedPlotSpec by remember(figure) {
46+ val rawSpec = when (figure) {
47+ is WithRawSpec -> figure.rawSpec
48+ else -> figure.toSpec()
49+ }
50+ mutableStateOf(processRawSpecs(rawSpec, frontendOnly = false ))
51+ }
4652 var panelSize by remember { mutableStateOf(DoubleVector .ZERO ) }
4753 var dispatchComputationMessages by remember { mutableStateOf(true ) }
4854 var specOverrideList by remember { mutableStateOf(emptyList<Map <String , Any >>()) }
You can’t perform that action at this time.
0 commit comments