funcnodes-span 0.3.2__tar.gz → 0.3.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {funcnodes_span-0.3.2 → funcnodes_span-0.3.4}/PKG-INFO +2 -2
- {funcnodes_span-0.3.2 → funcnodes_span-0.3.4}/funcnodes_span/__init__.py +1 -1
- {funcnodes_span-0.3.2 → funcnodes_span-0.3.4}/funcnodes_span/peak_analysis.py +29 -10
- {funcnodes_span-0.3.2 → funcnodes_span-0.3.4}/pyproject.toml +1 -1
- {funcnodes_span-0.3.2 → funcnodes_span-0.3.4}/LICENSE +0 -0
- {funcnodes_span-0.3.2 → funcnodes_span-0.3.4}/README.md +0 -0
- {funcnodes_span-0.3.2 → funcnodes_span-0.3.4}/funcnodes_span/_baseline.py +0 -0
- {funcnodes_span-0.3.2 → funcnodes_span-0.3.4}/funcnodes_span/_curves.py +0 -0
- {funcnodes_span-0.3.2 → funcnodes_span-0.3.4}/funcnodes_span/_smoothing.py +0 -0
- {funcnodes_span-0.3.2 → funcnodes_span-0.3.4}/funcnodes_span/baseline.py +0 -0
- {funcnodes_span-0.3.2 → funcnodes_span-0.3.4}/funcnodes_span/curves.py +0 -0
- {funcnodes_span-0.3.2 → funcnodes_span-0.3.4}/funcnodes_span/fitting.py +0 -0
- {funcnodes_span-0.3.2 → funcnodes_span-0.3.4}/funcnodes_span/normalization.py +0 -0
- {funcnodes_span-0.3.2 → funcnodes_span-0.3.4}/funcnodes_span/peaks.py +0 -0
- {funcnodes_span-0.3.2 → funcnodes_span-0.3.4}/funcnodes_span/smoothing.py +0 -0
|
@@ -329,7 +329,16 @@ def force_peak_finder(
|
|
|
329
329
|
default_render_options={"data": {"src": "figure"}},
|
|
330
330
|
outputs=[{"name": "figure"}],
|
|
331
331
|
)
|
|
332
|
-
def plot_peaks(
|
|
332
|
+
def plot_peaks(
|
|
333
|
+
x: np.array,
|
|
334
|
+
y: np.array,
|
|
335
|
+
peaks: List[PeakProperties],
|
|
336
|
+
fill_rectangles: bool = True,
|
|
337
|
+
xaxis_title: str = "x",
|
|
338
|
+
yaxis_title: str = "y",
|
|
339
|
+
title: str = "",
|
|
340
|
+
show_legend: bool = True,
|
|
341
|
+
) -> go.Figure:
|
|
333
342
|
fig = go.Figure()
|
|
334
343
|
|
|
335
344
|
# Set up line plot
|
|
@@ -353,16 +362,19 @@ def plot_peaks(x: np.array, y: np.array, peaks: List[PeakProperties]) -> go.Figu
|
|
|
353
362
|
peak.x_at_f_index,
|
|
354
363
|
peak.x_at_f_index,
|
|
355
364
|
peak.x_at_i_index,
|
|
365
|
+
peak.x_at_i_index,
|
|
356
366
|
],
|
|
357
|
-
y=[plot_y_min, plot_y_min, peak_height, peak_height],
|
|
358
|
-
fill="toself",
|
|
359
|
-
fillcolor=peaks_colors[index % len(peaks_colors)]
|
|
360
|
-
|
|
361
|
-
|
|
367
|
+
y=[plot_y_min, plot_y_min, peak_height, peak_height, plot_y_min],
|
|
368
|
+
fill="toself" if fill_rectangles else None,
|
|
369
|
+
fillcolor=peaks_colors[index % len(peaks_colors)]
|
|
370
|
+
if fill_rectangles
|
|
371
|
+
else None,
|
|
372
|
+
opacity=0.3 if fill_rectangles else 1,
|
|
373
|
+
line=dict(width=0 if fill_rectangles else 2),
|
|
362
374
|
mode="lines",
|
|
363
375
|
name=f"Peak {peak.id}",
|
|
364
376
|
legendgroup=f"Peak {peak.id}", # Group by Peak id
|
|
365
|
-
showlegend=
|
|
377
|
+
showlegend=show_legend,
|
|
366
378
|
)
|
|
367
379
|
)
|
|
368
380
|
# Add an X marker at the exact peak position
|
|
@@ -390,14 +402,21 @@ def plot_peaks(x: np.array, y: np.array, peaks: List[PeakProperties]) -> go.Figu
|
|
|
390
402
|
dash="dash", color=peaks_colors[index % len(peaks_colors)]
|
|
391
403
|
),
|
|
392
404
|
legendgroup=f"Peak {peak.id}",
|
|
405
|
+
showlegend=show_legend,
|
|
393
406
|
),
|
|
394
407
|
)
|
|
395
408
|
|
|
396
409
|
# Customize layout (axes labels and title can be added here if needed)
|
|
397
410
|
fig.update_layout(
|
|
398
|
-
xaxis_title=
|
|
399
|
-
yaxis_title=
|
|
400
|
-
|
|
411
|
+
xaxis_title=xaxis_title,
|
|
412
|
+
yaxis_title=yaxis_title,
|
|
413
|
+
title=title,
|
|
414
|
+
plot_bgcolor="white",
|
|
415
|
+
paper_bgcolor="white",
|
|
416
|
+
showlegend=show_legend,
|
|
417
|
+
font=dict(family="Arial", size=14),
|
|
418
|
+
xaxis=dict(title_font=dict(size=16), tickfont=dict(size=14)),
|
|
419
|
+
# yaxis=dict(title_font=dict(size=16), tickfont=dict(size=14), tickformat=".2e"),
|
|
401
420
|
)
|
|
402
421
|
|
|
403
422
|
return fig
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|