Skip to content

Commit

Permalink
Merge pull request #4267 from gemini-hlsw/sc-3888-elevation-plot-impr…
Browse files Browse the repository at this point in the history
…ovements

Elevation plot improvements
  • Loading branch information
rpiaggio authored Oct 29, 2024
2 parents 61947ca + 9424c66 commit 0aa9555
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
8 changes: 7 additions & 1 deletion common/src/main/webapp/sass/charts.scss
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ See https://github.com/highcharts/highcharts/issues/13320 */
fill-opacity: 0.75;
}

.plot-elevation-minimum {
fill: hsl(0deg 87% 66%);
stroke: hsl(0deg 87% 66%);
opacity: 0.5;
}

.plot-sky-brightness-percentile {
stroke-dasharray: 3, 5;
}
Expand Down Expand Up @@ -112,7 +118,7 @@ See https://github.com/highcharts/highcharts/issues/13320 */

.highcharts-plot-band-label {
// Twilight labels
fill: hsl(0deg 0% 40%);
fill: hsl(0deg 0% 60%);
}

.highcharts-xaxis-grid .highcharts-grid-line {
Expand Down
18 changes: 14 additions & 4 deletions explore/src/main/scala/explore/targeteditor/plots/NightPlot.scala
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,14 @@ object NightPlot:
val seconds = "%02d".format(dms.arcseconds)
s"$degrees°$minutes$seconds"

private val SkyBrightnessPercentileLines =
def plotLine(id: String, value: Double) =
private val ElevationMinimumLine =
YAxisPlotLinesOptions()
.setValue(30)
.setClassName("plot-elevation-minimum")
.setZIndex(1)

private val SkyBrightnessPercentileLines: List[YAxisPlotLinesOptions] =
def plotLine(id: String, value: Double): YAxisPlotLinesOptions =
YAxisPlotLinesOptions()
.setId(s"sky-brightness-$id")
.setValue(value)
Expand All @@ -78,7 +84,7 @@ object NightPlot:
)

private val SkyBrightnessPercentileBands: List[YAxisPlotBandsOptions] =
def plotBand(id: String, label: String, from: Double, to: Double) =
def plotBand(id: String, label: String, from: Double, to: Double): YAxisPlotBandsOptions =
YAxisPlotBandsOptions()
.setId(s"sky-brightness-$id")
.setLabel(
Expand Down Expand Up @@ -340,7 +346,8 @@ object NightPlot:
.setTickInterval(10)
.setMinorTickInterval(5)
.setShowEmpty(false)
.setLabels(YAxisLabelsOptions().setFormat("{value}°")),
.setLabels(YAxisLabelsOptions().setFormat("{value}°"))
.setPlotLines(js.Array(ElevationMinimumLine)),
YAxisOptions()
.setOpposite(true)
.setTitle(YAxisTitleOptions().setText("Parallactic angle"))
Expand Down Expand Up @@ -424,6 +431,9 @@ object NightPlot:
.setVisible(series.visible)
.setFillOpacity(0)
.setZoneAxis("x")
.setThreshold: // Ensure that the zones are always painted towards the bottom
if (series.seriesType === SeriesType.SkyBrightness) Double.PositiveInfinity
else Double.NegativeInfinity

zones
.fold(baseSeries)(z => baseSeries.setZones(z))
Expand Down

0 comments on commit 0aa9555

Please sign in to comment.