-
-
Notifications
You must be signed in to change notification settings - Fork 404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add hover_tooltips, hover_mode, hover_formatters opts to easily modify hover #6180
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6180 +/- ##
==========================================
- Coverage 88.70% 88.28% -0.42%
==========================================
Files 316 318 +2
Lines 66121 66416 +295
==========================================
- Hits 58650 58636 -14
- Misses 7471 7780 +309
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Hey @ahuang11 , no problem for this time, but in the future would you mind pasting in your test code utilized in video demos? |
Yeah I forgot to do so this time and I've already lost the code for that, but the edited notebook should have everything you need to try out all the functionality |
Looks great with Codeimport numpy as np
import holoviews as hv; hv.extension('bokeh')
n_channels = 4
n_seconds = 300
fs = 256
init_freq = .01 # Initial sine wave frequency in Hz
freq_inc = 2/n_channels # Frequency increment
total_samples = n_seconds * fs
time = np.linspace(0, n_seconds, total_samples)
channels = [f'CH {i}' for i in range(n_channels)]
data = np.array([np.sin(2 * np.pi * (init_freq + i * freq_inc) * time)
for i in range(n_channels)])
# print(f'shape: {data.shape} (n_channels, samples) ')
time_dim = hv.Dimension('Time', unit='s')
amplitude_dim = hv.Dimension('Amplitude', unit='µV')
curves = []
for channel, channel_data in zip(channels, data):
ds = Dataset((time, channel_data), [time_dim, amplitude_dim])
curve = hv.Curve(ds, time_dim, amplitude_dim, group='EEG', label=f'{channel}')
curve.opts(
subcoordinate_y=True,
subcoordinate_scale=.75,
color="black",
line_width=1,
tools=['hover'],
hover_tooltips=[
("Group", "$group"),
("Channel", "$label"),
"Time",
("Amplitude", "@Amplitude{0.2f}")],
# hover_mode = 'vline',
)
curves.append(curve)
curves_overlay = hv.Overlay(curves, kdims="Channel")
curves_overlay = curves_overlay.opts(
ylabel="Channel",
show_legend=False,
aspect=3.5,
responsive=True,
shared_axes=False,
xlim=(50,150),
title='Multi-Channel Timeseries',
)
curves_overlay and some fun with Screen.Recording.2024-04-11.at.1.19.59.PM.mov |
Ah, right as you commented, I just finished all the unit tests, and I think I fixed it in the newest push. Let me also try... |
Oh I guess it's not yet supported. I can add a if unit, then add it as |
Should be ready for re-review if needed. The UI tests passes in my local machine, but I noticed it failed here. I added flaky markers. |
For the flaky tests, try using |
Eh the test just refuses to pass... |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
See discussion at #1816 (comment)
Screen.Recording.2024-04-09.at.3.29.35.PM.mov
resolves #1816