Skip to content
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

Plots: Ability to zoom and maybe pan #4530

Closed
aschuh-hf opened this issue Aug 18, 2023 · 12 comments · Fixed by #4629
Closed

Plots: Ability to zoom and maybe pan #4530

aschuh-hf opened this issue Aug 18, 2023 · 12 comments · Fixed by #4629
Assignees
Labels
A: plots Area: plots webview, side panel and everything related enhancement New feature or request

Comments

@aschuh-hf
Copy link

Is it possible to zoom the metrics plots within a selected local rectangular window as in TensorBoard? I couldn't figure out how if. Selecting a rectangular zoom window and zooming out again fully via a simple interaction (e.g., double click as in TensorBoard) would be quite useful. Also being able to then pan that window would be nice (SHIFT + left click drag in TensorBoard).

@julieg18 julieg18 added A: plots Area: plots webview, side panel and everything related enhancement New feature or request labels Aug 18, 2023
@mattseddon
Copy link
Member

This is not currently possible.

@daavoo @dberenbaum is this behaviour something that Plotly will be able to provide?

@dberenbaum
Copy link
Contributor

It looks to be possible: https://plotly.com/chart-studio-help/zoom-pan-hover-controls/

@shcheklein
Copy link
Member

@dberenbaum do we have an epic / story for the Plotly migration? so that we can put the requirements like this into that story.

@dberenbaum
Copy link
Contributor

Added a tasklist in iterative/dvc-render#7 to keep track, although I think the first step will be just trying to reach parity with the current vega-lite implementation.

@mattseddon
Copy link
Member

mattseddon commented Sep 6, 2023

We can do this with a simple update to the Vega template. The plot can be zoomed in with the mouse wheel. For the extension, I would suppress the behaviour unless the plot is focused/zoomed:

Screen.Recording.2023-09-07.at.9.47.19.am.mov

WDYT?

cc @daavoo

Note: I cannot currently get the zooming behaviour to work for the smooth template but I will spend a little bit of time trying to make it work before raising a PR. - see demo in the below PR.

@mattseddon
Copy link
Member

Further demos available at #4629

@mattseddon mattseddon self-assigned this Sep 7, 2023
@aschuh-hf
Copy link
Author

aschuh-hf commented Sep 8, 2023

Great, thanks for adding this!

Unfortunately it isn't yet working for me with v1.0.52 of the Extension when using a custom template based on #4532 (comment). Even after I commented the stages.<stage>.plots[*].template line in the dvc.yaml in the workspace, it is still using the previously used template. I guess it's cached somewhere as part of an experiment run?

PS: I also tried again after updating to DVC 3.19.0.

@mattseddon
Copy link
Member

If you can share your template with some dummy data in a Vega editor then I should be able to get it working for you.

@aschuh-hf
Copy link
Author

If you can share your template with some dummy data in a Vega editor then I should be able to get it working for you.

I believe I figured out the tooltip related issue (cf. #4532 (comment)). Will need to wait until I run another experiment it seems before I can get DVC CLI to use the updated template and test out the zoom and pan feature within the extension. Unless there is another way I can tell DVC which template to use? It ignores the template specified in the dvc.yaml of the workspace, even after committing it with Git.

@shcheklein
Copy link
Member

It ignores the template specified in the dvc.yaml of the workspace, even after committing it with Git.

It it the same in the DVC - dvc plots show?

@shcheklein shcheklein reopened this Sep 8, 2023
@aschuh-hf
Copy link
Author

It it the same in the DVC - dvc plots show?

Yes, this was also the case when using the CLI.

@aschuh-hf
Copy link
Author

aschuh-hf commented Oct 3, 2023

FYI With the template provided by @mattseddon at #4532 (comment) zoom and pan works like a charm!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A: plots Area: plots webview, side panel and everything related enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants