plot-api/src/jvmTest/kotlin/org/jetbrains/letsPlot/GGBunchThemeTest.kt [141:167]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - LetsPlot.theme = themeGrey() + flavorDarcula() try { val p = ggbunch( listOf(ggplot()), regions = emptyList() ) + themeLight() // Override global theme assertThemeSpec( p, featureCount = 2, expected = mapOf( "name" to "light", "flavor" to "darcula", ) ) // Global theme should be stripped from the figure spec in grid val fig = (p.toSpec()["figures"] as List)[0] as Map<*, *> assertEquals("plot", fig["kind"]) // Make sure it's a plot assertFalse(fig.containsKey("theme")) } finally { // Clear global setting LetsPlot.theme = null } } @Test - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - plot-api/src/jvmTest/kotlin/org/jetbrains/letsPlot/GGBunchThemeTest.kt [239:266]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - LetsPlot.theme = themeGrey() + flavorDarcula() // + theme().legendPositionBottom() try { val p = ggbunch( listOf(ggplot()), regions = emptyList() ) + themeLight() // Override global named theme assertThemeSpec( p, featureCount = 2, expected = mapOf( "name" to "light", "flavor" to "darcula", // Keep flavor // "legend_position" to "bottom" // and theme option ) ) // Global theme should be stripped from the figure spec in grid val fig = (p.toSpec()["figures"] as List)[0] as Map<*, *> assertEquals("plot", fig["kind"]) // Make sure it's a plot assertFalse(fig.containsKey("theme")) } finally { // Clear global setting LetsPlot.theme = null } } @Test - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -