Skip to content

Commit 14c33b1

Browse files
committed
feat: QOL features and alignment fixes for plots
1 parent b789197 commit 14c33b1

3 files changed

Lines changed: 41 additions & 12 deletions

File tree

assets/05-peakindex-viz.css

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -232,13 +232,23 @@
232232
.pi-viz-main {
233233
flex: 1;
234234
min-width: 0;
235+
min-height: 0;
235236
height: 100%;
236-
position: relative;
237+
display: flex;
238+
flex-direction: column;
237239
overflow: hidden;
238240
}
239241

240-
/* Pass height through dcc.Loading wrapper divs (but not .pi-viz-details) */
241-
.pi-viz-main > div:not(.pi-viz-details) { height: 100%; }
242+
/* Graph wrapper: the dcc.Loading wrapper around the dcc.Graph is the only
243+
non-details child of .pi-viz-main. It must flex to fill remaining space
244+
so the bottom .pi-viz-details panel never overlaps the plot. */
245+
.pi-viz-main > div:not(.pi-viz-details) {
246+
flex: 1 1 auto;
247+
min-height: 0;
248+
position: relative;
249+
}
250+
/* Pass height through dcc.Loading's nested wrapper divs so the Plotly
251+
figure can fill the flex item. */
242252
.pi-viz-main > div:not(.pi-viz-details) > div { height: 100%; }
243253
.pi-viz-main > div:not(.pi-viz-details) > div > div { height: 100%; }
244254

@@ -249,16 +259,12 @@
249259
color: var(--pi-blue);
250260
}
251261

252-
/* Details panel (absolute-positioned at bottom of graph) */
262+
/* Details panel (normal flow, bottom of the visualization column) */
253263
.pi-viz-details {
254-
position: absolute;
255-
bottom: 0;
256-
left: 0;
257-
right: 0;
258-
z-index: 10;
264+
flex: 0 0 auto;
259265
padding: .4rem .75rem;
260266
border-top: 1px solid #dce1e3;
261-
background: rgba(255, 255, 255, .92);
267+
background: var(--pi-white);
262268
max-height: 140px;
263269
overflow-y: auto;
264270
}

laue_portal/components/visualization/stereo_plot.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,30 @@ def make_pole_figure(
487487
)
488488
)
489489

490+
# Crosshair (+) at the global pole-figure center (origin), matching the
491+
# style/size of the selected-point crosshair below.
492+
_origin_arm = pole_figure_color_radius(0.0, 0.0, color_rad_deg) * 0.1
493+
fig.add_trace(
494+
go.Scattergl(
495+
x=[-_origin_arm, _origin_arm],
496+
y=[0.0, 0.0],
497+
mode="lines",
498+
line=dict(color="black", width=2),
499+
showlegend=False,
500+
hoverinfo="skip",
501+
)
502+
)
503+
fig.add_trace(
504+
go.Scattergl(
505+
x=[0.0, 0.0],
506+
y=[-_origin_arm, _origin_arm],
507+
mode="lines",
508+
line=dict(color="black", width=2),
509+
showlegend=False,
510+
hoverinfo="skip",
511+
)
512+
)
513+
490514
# Crosshair (+) on the selected reference point, scaled to color radius
491515
if center_xy is not None:
492516
cx, cy = float(center_xy[0]), float(center_xy[1])
@@ -536,7 +560,6 @@ def make_pole_figure(
536560
paper_bgcolor="white",
537561
margin=dict(l=40, r=40, t=40, b=40),
538562
autosize=True,
539-
title=f"Pole Figure: {{{_format_hkl(*hkl)}}}",
540563
showlegend=True,
541564
legend=dict(orientation="h", yanchor="bottom", y=1.02),
542565
dragmode="lasso", # enable lasso select for ROI picking (Stage 3)

laue_portal/pages/peakindexing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,7 @@ def show_point_details(click_data, xml_path):
949949
detail_card = dbc.Card(
950950
dbc.CardBody(
951951
[
952-
html.H6("Selected Point Details", className="card-title"),
952+
html.H6("Clicked Point Details", className="card-title"),
953953
html.P(
954954
[
955955
html.Strong(f"Step #{step_idx}"),

0 commit comments

Comments
 (0)