Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elevation plot improvements #4267

Merged
merged 2 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading