Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
RYangazov committed Sep 28, 2023
2 parents 9c3dec4 + 0150081 commit f81b141
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ open class AxisComponentDemo : SimpleDemoBase(DEMO_BOX_SIZE) {
val themeOptions = baselineValues + mapOf(
ThemeOption.PANEL_GRID to mapOf(ThemeOption.Elem.COLOR to Color.RED)
)
val theme = DefaultTheme(themeOptions)
val theme = DefaultTheme.withBaseFlavor(themeOptions)

val axis = AxisComponent(
length = axisLength,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ open class ScatterDemo : SimpleDemoBase() {
// Render
val groupComponent = GroupComponent()

val theme = DefaultTheme(ThemeValuesRClassic().values)
val theme = DefaultTheme.withBaseFlavor(ThemeValuesRClassic().values)

run {
// X axis
Expand Down Expand Up @@ -281,7 +281,7 @@ open class ScatterDemo : SimpleDemoBase() {
// coord system
val coord = Coords.DemoAndTest.create(domainX, domainY, demoInnerSize)

val theme = DefaultTheme(ThemeValuesRClassic().values)
val theme = DefaultTheme.withBaseFlavor(ThemeValuesRClassic().values)

run {
// X axis
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ package org.jetbrains.letsPlot.core.plot.builder.defaultTheme
import org.jetbrains.letsPlot.core.plot.base.GeomKind
import org.jetbrains.letsPlot.core.plot.base.aes.GeomTheme
import org.jetbrains.letsPlot.core.plot.base.theme.*
import org.jetbrains.letsPlot.core.plot.builder.defaultTheme.values.ThemeOption.Flavor
import org.jetbrains.letsPlot.core.plot.builder.defaultTheme.values.ThemeValuesLPMinimal2
import org.jetbrains.letsPlot.core.plot.builder.presentation.DefaultFontFamilyRegistry
import org.jetbrains.letsPlot.core.plot.builder.presentation.FontFamilyRegistry
Expand Down Expand Up @@ -48,7 +49,10 @@ class DefaultTheme(

companion object {
// For demo and tests
fun minimal2() =
DefaultTheme(ThemeValuesLPMinimal2().values)
fun minimal2() = withBaseFlavor(ThemeValuesLPMinimal2().values)

fun withBaseFlavor(themeValues: Map<String, Any>) = DefaultTheme(
ThemeFlavorUtil.applyFlavor(themeValues, Flavor.BASE)
)
}
}

0 comments on commit f81b141

Please sign in to comment.