Skip to content

Commit 1bccccd

Browse files
committed
Minor styling fixes
1 parent 5d1b529 commit 1bccccd

File tree

6 files changed

+51
-10
lines changed

6 files changed

+51
-10
lines changed

CHANGELOG.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
Changelog for the ``swiftpipeline`` repository.
22

3+
Version 0.1.7
4+
-------------
5+
6+
Styling bug-fixes:
7+
8+
+ Ensured that the navigation bar always appears above the MathJax rendered
9+
text on all browsers by setting it's z-order explicitly.
10+
+ Allowed for mixing between `auto_plotter` and those generated by scripts
11+
within a single section.
12+
313
Version 0.1.6
414
-------------
515

example/config/auto_plotter/mass_function.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,22 @@ adaptive_stellar_mass_function_100:
6868
metadata:
6969
title: Stellar Mass Function (100 kpc aperture, adaptive)
7070
caption: 100 kpc aperture GSMF, showing all galaxies with an adaptive bin-width.
71-
section: Stellar Mass Function
71+
section: Stellar Mass Function
72+
73+
stellar_mass_function_in_density_temp:
74+
type: "adaptivemassfunction"
75+
legend_loc: "lower left"
76+
number_of_bins: 25
77+
x:
78+
quantity: "apertures.mass_star_100_kpc"
79+
units: Solar_Mass
80+
start: 1e7
81+
end: 1e12
82+
y:
83+
units: 1/Mpc**3
84+
start: 1e-6
85+
end: 0.316 # (1e-0.5)
86+
metadata:
87+
title: Stellar Mass Function (100 kpc aperture, adaptive)
88+
caption: 100 kpc aperture GSMF, showing all galaxies with an adaptive bin-width. Desinged to appear in the Density-Temperature section to show how auto_plotter and scripts can be mixed.
89+
section: Density-Temperature

swiftpipeline/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.1.6"
1+
__version__ = "0.1.7"

swiftpipeline/html.py

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def __init__(self):
111111
pipeline_version=pipeline_version,
112112
velociraptor_version=velociraptor_version,
113113
creation_date=strftime(r"%Y-%m-%d"),
114-
sections=[],
114+
sections={},
115115
runs=[],
116116
)
117117

@@ -183,8 +183,14 @@ def add_auto_plotter_metadata(self, auto_plotter_metadata: AutoPlotterMetadata):
183183
if plot.section == section and plot.show_on_webpage
184184
]
185185

186-
self.variables["sections"].append(
187-
dict(title=section, plots=plots, id=abs(hash(section)))
186+
current_section_plots = (
187+
self.variables["sections"].get(section, {"plots": []}).get("plots", [])
188+
)
189+
190+
self.variables["sections"][section] = dict(
191+
title=section,
192+
plots=plots + current_section_plots,
193+
id=abs(hash(section)),
188194
)
189195

190196
return
@@ -217,8 +223,14 @@ def add_config_metadata(self, config: Config):
217223
if script.section == section and script.show_on_webpage
218224
]
219225

220-
self.variables["sections"].append(
221-
dict(title=section, plots=plots, id=abs(hash(section)))
226+
current_section_plots = (
227+
self.variables["sections"].get(section, {"plots": []}).get("plots", [])
228+
)
229+
230+
self.variables["sections"][section] = dict(
231+
title=section,
232+
plots=plots + current_section_plots,
233+
id=abs(hash(section)),
222234
)
223235

224236
return

swiftpipeline/templates/plot_viewer.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{% block navigation %}
66
{# Purely internal navigation links to take you up/down the page #}
77
<ul class="nav">
8-
{% for section in sections | sort(attribute="title") %}
8+
{% for section in sections.values() | sort(attribute="title") %}
99
<li><a href="#{{ section.id }}">{{ section.title }}</a></li>
1010
{% endfor %}
1111
</ul>
@@ -25,7 +25,7 @@ <h1>Included Runs</h1>
2525
</div>
2626

2727
{# Show off our figures! #}
28-
{% for section in sections | sort(attribute="title") %}
28+
{% for section in sections.values() | sort(attribute="title") %}
2929
<div class="section" id="{{ section.id }}">
3030
<h1>{{ section.title }}</h1>
3131
<div class="plot-container">
@@ -47,4 +47,4 @@ <h3>{{ plot.title }}</h3>
4747
with version {{ velociraptor_version }} of the velociraptor
4848
python library on {{ creation_date }}.
4949
</p>
50-
{% endblock %}
50+
{% endblock %}

swiftpipeline/templates/style.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ h1 {
2828
position: sticky;
2929
top: 0;
3030
width: 100%;
31+
z-index: 100;
3132
}
3233

3334
.nav {

0 commit comments

Comments
 (0)