renamed buttons, labled the axes

This commit is contained in:
Markus Rosenstihl 2025-03-31 22:41:05 +02:00
parent b7a7edfa7b
commit 33bf3d6833
2 changed files with 7 additions and 8 deletions

View File

@ -42,7 +42,7 @@
{% endfor %} {% endfor %}
</select></div> </select></div>
<div class="col"> <div class="col">
<button type="submit" name="transform" class="btn btn-primary btn-sm">Search</button> <button type="submit" name="transform" class="btn btn-primary btn-sm">Calculate</button>
</div> </div>
</div> </div>
<div class="row row-cols-6"> <div class="row row-cols-6">
@ -50,7 +50,7 @@
<div class="col"><input type="number" name="freq_range" class="form-control" step="any" <div class="col"><input type="number" name="freq_range" class="form-control" step="any"
placeholder="Range in MHz"></div> placeholder="Range in MHz"></div>
<div class="col"> <div class="col">
<button type="submit" name="range_search" class="btn btn-primary btn-sm ">Search</button> <button type="submit" name="range_search" class="btn btn-primary btn-sm ">Get nuclei in range</button>
</div> </div>
</div> </div>
<div class="row row-cols-6"> <div class="row row-cols-6">
@ -58,7 +58,7 @@
<div class="col"><input type="number" name="gradient" class="form-control" step="any" <div class="col"><input type="number" name="gradient" class="form-control" step="any"
placeholder="Gradient in T/m"></div> placeholder="Gradient in T/m"></div>
<div class="col"> <div class="col">
<button type="submit" name="gradient_search" class="btn btn-primary btn-sm">Search</button> <button type="submit" name="gradient_search" class="btn btn-primary btn-sm">Get nearby nuclei</button>
</div> </div>
</div> </div>
</form> </form>

View File

@ -84,11 +84,12 @@ def result(request):
gradient = float(request.GET.get('gradient')) gradient = float(request.GET.get('gradient'))
# create a plot (bokeh) # create a plot (bokeh)
plot = figure(outer_width=400, outer_height=400, match_aspect=True) plot = figure(outer_width=500, outer_height=500, match_aspect=True)
plot.ellipse(x=[0], y=[0], width=5, height=5, color="#D5D9FF", alpha=0.8, line_width=1, line_color="black") plot.ellipse(x=[0], y=[0], width=5, height=5, color="#D5D9FF", alpha=0.8, line_width=1, line_color="black")
plot.ellipse(x=[0], y= [2.5], width=5, height=5, color="#D5D9FF", alpha=0.4, line_width=1, line_color="black") plot.ellipse(x=[0], y= [2.5], width=5, height=5, color="#D5D9FF", alpha=0.4, line_width=1, line_color="black")
plot.ellipse(x=[0], y=[-2.5], width=5, height=5, color="#D5D9FF", alpha=0.4, line_width=1, line_color="black") plot.ellipse(x=[0], y=[-2.5], width=5, height=5, color="#D5D9FF", alpha=0.4, line_width=1, line_color="black")
plot.xaxis[0].axis_label = 'x / mm'
plot.yaxis[0].axis_label = 'z / mm'
close_isotopes = [] close_isotopes = []
for isotope in Isotope.objects.all(): for isotope in Isotope.objects.all():
@ -109,12 +110,10 @@ def result(request):
x=frame_left, x=frame_left,
y=frame_bottom, y=frame_bottom,
anchor="bottom_left", anchor="bottom_left",
#text=MathML(text=f"<math><sup>{isotope1.n_nucleons}</msup>{isotope1.symbol}: {freq:.1f} MHz\ng={gradient:.1f} T/m\n5 mm sample dia.</math>"),
text=f"{isotope1.n_nucleons}{isotope1.symbol}: {freq:.1f} MHz\ng={gradient:.1f} T/m\n5 mm sample dia.", text=f"{isotope1.n_nucleons}{isotope1.symbol}: {freq:.1f} MHz\ng={gradient:.1f} T/m\n5 mm sample dia.",
#text=MathML("<math>tewt</math>"),
padding=5, padding=5,
border_radius=5, border_radius=5,
border_line_color="black", background_fill_color="white", border_line_color="#D5D9FF", background_fill_color="white",
) )
plot.add_layout(citation) plot.add_layout(citation)