funcnodes-span 0.3.2__tar.gz → 0.3.3__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.3}/PKG-INFO +2 -2
- {funcnodes_span-0.3.2 → funcnodes_span-0.3.3}/funcnodes_span/__init__.py +1 -1
- {funcnodes_span-0.3.2 → funcnodes_span-0.3.3}/funcnodes_span/peak_analysis.py +24 -9
- {funcnodes_span-0.3.2 → funcnodes_span-0.3.3}/pyproject.toml +1 -1
- {funcnodes_span-0.3.2 → funcnodes_span-0.3.3}/LICENSE +0 -0
- {funcnodes_span-0.3.2 → funcnodes_span-0.3.3}/README.md +0 -0
- {funcnodes_span-0.3.2 → funcnodes_span-0.3.3}/funcnodes_span/_baseline.py +0 -0
- {funcnodes_span-0.3.2 → funcnodes_span-0.3.3}/funcnodes_span/_curves.py +0 -0
- {funcnodes_span-0.3.2 → funcnodes_span-0.3.3}/funcnodes_span/_smoothing.py +0 -0
- {funcnodes_span-0.3.2 → funcnodes_span-0.3.3}/funcnodes_span/baseline.py +0 -0
- {funcnodes_span-0.3.2 → funcnodes_span-0.3.3}/funcnodes_span/curves.py +0 -0
- {funcnodes_span-0.3.2 → funcnodes_span-0.3.3}/funcnodes_span/fitting.py +0 -0
- {funcnodes_span-0.3.2 → funcnodes_span-0.3.3}/funcnodes_span/normalization.py +0 -0
- {funcnodes_span-0.3.2 → funcnodes_span-0.3.3}/funcnodes_span/peaks.py +0 -0
- {funcnodes_span-0.3.2 → funcnodes_span-0.3.3}/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
|
|
@@ -355,14 +364,16 @@ def plot_peaks(x: np.array, y: np.array, peaks: List[PeakProperties]) -> go.Figu
|
|
|
355
364
|
peak.x_at_i_index,
|
|
356
365
|
],
|
|
357
366
|
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
|
+
fill="toself" if fill_rectangles else None,
|
|
368
|
+
fillcolor=peaks_colors[index % len(peaks_colors)]
|
|
369
|
+
if fill_rectangles
|
|
370
|
+
else None,
|
|
371
|
+
opacity=0.3 if fill_rectangles else 1,
|
|
372
|
+
line=dict(width=0 if fill_rectangles else 2),
|
|
362
373
|
mode="lines",
|
|
363
374
|
name=f"Peak {peak.id}",
|
|
364
375
|
legendgroup=f"Peak {peak.id}", # Group by Peak id
|
|
365
|
-
showlegend=
|
|
376
|
+
showlegend=show_legend,
|
|
366
377
|
)
|
|
367
378
|
)
|
|
368
379
|
# Add an X marker at the exact peak position
|
|
@@ -390,14 +401,18 @@ def plot_peaks(x: np.array, y: np.array, peaks: List[PeakProperties]) -> go.Figu
|
|
|
390
401
|
dash="dash", color=peaks_colors[index % len(peaks_colors)]
|
|
391
402
|
),
|
|
392
403
|
legendgroup=f"Peak {peak.id}",
|
|
404
|
+
showlegend=show_legend,
|
|
393
405
|
),
|
|
394
406
|
)
|
|
395
407
|
|
|
396
408
|
# Customize layout (axes labels and title can be added here if needed)
|
|
397
409
|
fig.update_layout(
|
|
398
|
-
xaxis_title=
|
|
399
|
-
yaxis_title=
|
|
400
|
-
|
|
410
|
+
xaxis_title=xaxis_title,
|
|
411
|
+
yaxis_title=yaxis_title,
|
|
412
|
+
title=title,
|
|
413
|
+
plot_bgcolor="white",
|
|
414
|
+
paper_bgcolor="white",
|
|
415
|
+
showlegend=show_legend,
|
|
401
416
|
)
|
|
402
417
|
|
|
403
418
|
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
|