-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
: standardise across DVC/Studio/VS Code
#9940
Comments
cc @iterative/studio-frontend @tapadipti @daavoo. |
I think the usage is too low to be worth the effort. |
I would love it if DVC takes only care of collecting data sources and definitions (what is basically today's internal I want to also give some background context on 2 parts:
We now have the VSCode extension and Studio UIs, both supporting live updates. I see the existence of the local HTML and |
Thanks @daavoo
This is where we are heading.
I'll see how difficult making updates there are going to be. I'm hopeful that we won't need to free or abandon rendering plots with the CLI. |
(just to start the discussion, probably a bit too early, fine to ignore for now) Can we list the implications of this decision (e.g. each product will have to implement an engine, each product will have its own set of definitions for plots, anything else?). How critical it is for us? Btw, for basic plots I think we don't even need templates as something users deal with - we expect them to work out of the box. So, it all comes back to customizations, I guess? |
If we separate the concerns in that way we can have a shared Typescript package which can be imported by both VS Code and Studio. It will be responsible for processing/combining the data and working out the appropriate groups (see next comment) before it can be fed into the different app's components. I am also hoping to reuse that package for creating the current
One reason for having default templates/making them visible is that (hopefully) users can find them and customise them to their own needs. I do however know that at this stage there is no evidence to support the idea that regular users will self-serve in this way. |
For the 4 template groups this is what we are aiming at: Linear:Note the updated tooltip. The plot can potentially contain different shapes when the data has multiple fields in multiple files. No change to the simple template. Bar:In the above example (and whenever there are different data sources i.e. filename::field combos) we will introduce the Potentially we could introduce a column instead of a row. Please let me know if you have any strong opinions on this. Scatter:Confusion Matrix:No change for now but I will be looking into migrating to Plotly Heatmap as data is aggregated prior to rendering. The main benefit would be that we will have to send much much less data over the wire (as JSON). We may also be able to unmerge revs as we can specify a custom/standardised color scale for different plots. This would potentially give us a discrepancy in zoom + pan behaviour but we can weigh up the tradeoffs when we get to them. |
+1 for it, shared codebase will help the standardization + allow us to not deviate from the shared logic as we go forward + implement it once instead of several times. It has its own set of problems, but IMO is worth it for the complex plots problem. |
There are also differences in how the products merge plot definitions when comparing different revisions. We previously discussed this in iterative/vscode-dvc#3676. I have found several edge cases/inconsistencies associated with updating y-axis values. When comparing different revisions we can either treat the y-axis values as mutable or immutable. Right now it feels that we are stuck between the two. Studio tries to bypass this issue by persisting entire files that appear in plot definitions. This falls down when the required field is in a different file that was also tracked by DVC (see #9898 (comment) for some more details).
Immutable:
Mutable:
@dberenbaum @daavoo which of the above situations is more likely? Should we care about either of these cases and if so which is more useful? |
Quick update. What I've learned:As an interim step, it seems to make sense to move logic out of the extension into Demo (of prototype)Screen.Recording.2023-09-20.at.3.03.36.pm.movHaving this logic in 1 less place has some benefits all by itself but it definitely keeps the door open to consolidating further. It would be good to discuss whether or not we can release |
This could be a little dangerous if need to make other updates to Studio, but let's see how it goes. Maybe we can keep a feature branch in each project so we don't block releases? I don't think there's any rush to get it released. |
Is it different than what we did before? |
Does it use the same order that the revisions are shown for all the other plots? What does VS Code do?
What drove adding it in VS Code? How hard is it to add in Studio? @tapadipti @shcheklein Do you recall any discussion around whether we should allow resizing in Studio? I seem to remember some early discussions around how dynamic the layout should be and whether making it too flexible would be a mess. |
I don't remember if we had specific feature requests or anything for this. I'm pretty sure it felt as a basic scenario, basic UX to have (exists in all other products).
We can skip the implementation part for now, but generalize across products - it makes sense. |
Right now VS Code shows the revisions for multi-view plots in a random order but adding |
I am closing in on the last piece of the puzzle (Studio) for "make it work": Screen.Recording.2023-10-11.at.4.00.38.pm.movShould be able to start "make it right" soon. Note: This demo is still very broken but I am happy that I have rendering plots. |
I have built a very messy (but working) prototype, that presents plots differently depending on whether or not they are currently focused (e.g. legends and zoom and pan are suppressed unless the plot is focused): ScreenshotHowever, I keep running into outdated comments/extra information (e.g. #10023 / https://github.com/iterative/studio/issues/4778 / https://github.com/iterative/studio/issues/6604). I'm taking time to get up to speed on these outstanding issues. If there are any issues that I can split out from the ongoing work I'll raise PRs. |
Does this mean iterative/vscode-dvc#3757 will be entirely resolved and therefore vega/vega-lite#6672 is no longer relevant for multi-view plots? I was going to look into the vega-lite PR, but if it's no longer needed I will focus elsewhere. |
Not really, it just means that we will have a more reliable way to patch the issue. It would be much better solved on the Vega side and fixing it there would help out more people. Note: If you're looking for something Vega/plots-related to contribute to there is also iterative/vscode-dvc#3837 👍🏻. |
Do we need to make a call on whether we are staying with vega lite before we have anyone spend more time on vega lite issues? |
From trying to fit top-level plots into Studio I've made the following decisions regarding multi-source horizontal bar plots:
DemoScreen.Recording.2023-11-14.at.12.42.08.pm.movIMO, these plots will not be getting much usage, let's get something that works into production and see if we get any feedback. I have also realised that we can drop the proposed |
I've marked all the associated PRs as ready for review. The only one missing will be for |
I've just released |
Will you need a dvc release as part of the rollout? |
Already bugged @efiop. I want to double-check everything is fine with the extension/Studio before making that release. It will be today. |
Here is the run list for today's activities:
I'll link to this in the #studio-eng slack channel to let the team know that this is going live. As I am bumping the min version of |
Only thing left to close this issue is iterative/dvc.org#4978 |
Summary / Background
Discussions regarding migrating the underlying plots' engine from
Vega
toPlotly
were recently re-started (see iterative/dvc-render#7) due to several plots-related issues appearing invscode-dvc
(e.g. iterative/vscode-dvc#4530, iterative/vscode-dvc#4532, iterative/vscode-dvc#3837 and there are more). Initial scoping of that issue (re-)highlighted the current difference between the three product's UI/data processing. These three images show the "same" plot across the 3 products:An initial step in scoping the migration effort was to implement zoom/pan functionality to Vega plots within the VS Code extension (iterative/vscode-dvc#4629). The immediate feedback provided was "But this needs to be available in Studio too!". Again (and unfortunately), that is no simple task because all three products take such different approaches. A simple template update can not simply be plugged in.
Another example of unified changes being difficult was plots per step being added in both Studio (https://github.com/iterative/studio/pull/7342) + VS Code (iterative/vscode-dvc#4372). It should also be noted that the slider is currently unavailable via the CLI output.
In order to make unified changes across the product easier we need to standardise.
Scope
As a first step to fixing the above problems, we are going to standardise the appearance of plots provided by built-in
dvc-render
templates across the three product's UIs.Forcing the UIs to converge will give insights into the code. Those insights will enable us to refactor and move towards a standardised approach for dealing with plots/their data. As we remove legacy code/processes we will be able to iterate quicker on plot changes and not get bogged down every time we want to do something as simple as change a template.
At a minimum, we should display the same legend for each plot and we should also have the same underlying data in each plot.
Assumptions
Open Questions
dvc-render
into JSON + Typescript + move into DVC? 👈🏻 This should become clearer as we get further into the process.Blockers / Dependencies
None yet.
General Approach
(after discussing with @dberenbaum)
<DVC_METRIC_COLOR>
/<DVC_METRIC_STROKE_DASH>
/<DVC_METRIC_SHAPE>
/<DVC_METRIC_GROUP_BY>
<DVC_METRIC_ROW>
for bar charts and only use<DVC_METRIC_SHAPE>
for scatter plots.Steps
plots
: standardise across DVC/Studio/VS Code dvc-render#142)dvc-render
changes to render new templates via CLI (plots
: standardise across DVC/Studio/VS Code dvc-render#142)plots
: standardise across DVC/Studio/VS Code #9931)plots
: standardise across DVC/Studio/VS Code #9931)plots
: standardise across DVC/Studio/VS Code dvc.org#4978)dvc-render
indvclive
(plots
: standardise across DVC/Studio/VS Code (update dependencies) dvclive#747)Note: Took a detour to add tests to Studio and do some refactoring before attempting to make the required changes. All the PRs are linked to this issue.
The text was updated successfully, but these errors were encountered: