Skip to content

Commit

Permalink
Increase default plot size: 500X333 -> 600X400
Browse files Browse the repository at this point in the history
  • Loading branch information
alshan committed Oct 21, 2021
1 parent ea50aed commit 422d308
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import jetbrains.datalore.plot.builder.interact.PlotInteractor
import jetbrains.datalore.plot.builder.interact.PlotTooltipBounds
import jetbrains.datalore.plot.builder.layout.*
import jetbrains.datalore.plot.builder.layout.PlotLayoutUtil.liveMapBounds
import jetbrains.datalore.plot.builder.presentation.Defaults.DEF_PLOT_SIZE
import jetbrains.datalore.plot.builder.presentation.Style
import jetbrains.datalore.plot.builder.theme.AxisTheme
import jetbrains.datalore.plot.builder.theme.Theme
Expand Down Expand Up @@ -438,8 +439,6 @@ class PlotSvgComponent constructor(

companion object {
private val LOG = PortableLogging.logger(PlotSvgComponent::class)

private val DEF_PLOT_SIZE = DoubleVector(600.0, 400.0)
private const val DEBUG_DRAWING = PLOT_DEBUG_DRAWING
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,23 @@

package jetbrains.datalore.plot.builder.presentation

import jetbrains.datalore.base.geometry.DoubleVector
import jetbrains.datalore.base.values.Color
import jetbrains.datalore.plot.builder.presentation.Defaults.Plot.Axis

object Defaults {
// Plot size
const val ASPECT_RATIO = 3.0 / 2.0
const val MIN_PLOT_WIDTH = 50.0

@Suppress("MemberVisibilityCanBePrivate")
const val DEF_PLOT_WIDTH = 600.0

@Suppress("MemberVisibilityCanBePrivate")
const val DEF_LIVE_MAP_WIDTH = 800.0
val DEF_PLOT_SIZE = DoubleVector(DEF_PLOT_WIDTH, DEF_PLOT_WIDTH / ASPECT_RATIO)
val DEF_LIVE_MAP_SIZE = DoubleVector(DEF_LIVE_MAP_WIDTH, DEF_LIVE_MAP_WIDTH / ASPECT_RATIO)

// HEX colors only (because of using of parseHex())
const val DARK_GRAY = "#3d3d3d"
val GRAY = Color.GRAY.toHexColor()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,17 @@ package jetbrains.datalore.plot
import jetbrains.datalore.base.geometry.DoubleRectangle
import jetbrains.datalore.base.geometry.DoubleVector
import jetbrains.datalore.plot.builder.assemble.PlotFacets
import jetbrains.datalore.plot.builder.presentation.Defaults.ASPECT_RATIO
import jetbrains.datalore.plot.builder.presentation.Defaults.DEF_LIVE_MAP_SIZE
import jetbrains.datalore.plot.builder.presentation.Defaults.DEF_PLOT_SIZE
import jetbrains.datalore.plot.builder.presentation.Defaults.MIN_PLOT_WIDTH
import jetbrains.datalore.plot.config.BunchConfig
import jetbrains.datalore.plot.config.Option
import jetbrains.datalore.plot.config.OptionsAccessor
import jetbrains.datalore.plot.config.PlotConfig
import kotlin.math.max

object PlotSizeHelper {
private const val ASPECT_RATIO = 3.0 / 2.0 // TODO: theme
private const val MIN_PLOT_WIDTH = 50.0 // Used somethere else?
private const val DEF_PLOT_WIDTH = 500.0
private const val DEF_LIVE_MAP_WIDTH = 800.0
private val DEF_PLOT_SIZE = DoubleVector(DEF_PLOT_WIDTH, DEF_PLOT_WIDTH / ASPECT_RATIO)
private val DEF_LIVE_MAP_SIZE = DoubleVector(DEF_LIVE_MAP_WIDTH, DEF_LIVE_MAP_WIDTH / ASPECT_RATIO)


/**
* Plot spec can be either raw or processed
*/
Expand Down

0 comments on commit 422d308

Please sign in to comment.