-
Notifications
You must be signed in to change notification settings - Fork 29
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
Bump min DVC version to 3.33.0 (standardise plots across products) #4734
Conversation
2ce1d9e
to
d2985d1
Compare
extension/src/cli/dvc/contract.ts
Outdated
@@ -1,5 +1,3 @@ | |||
import { Plot } from '../../plots/webview/contract' | |||
|
|||
export const MIN_CLI_VERSION = '2.58.1' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[I] Will need bumped
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget to remove the code that checks the CLI version when running exp rename
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these things that need to be done before merging?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep
> | ||
|
||
export const mergeFields = (fields: string[]): string => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[F] All of this logic has moved to dvc-render
and the templates.
d2985d1
to
a2b254f
Compare
db935bb
to
e1920fe
Compare
20879a5
to
05fbd09
Compare
05fbd09
to
4a6d460
Compare
@@ -2798,172 +2777,6 @@ describe('App', () => { | |||
expect(clickEvent.stopPropagation).toHaveBeenCalledTimes(1) | |||
}) | |||
|
|||
it('should have a tooltip on the plot if the title is cut', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[F] See this
@@ -84,7 +69,9 @@ export const ZoomedInPlot: React.FC<ZoomedInPlotProps> = ({ | |||
ThemeProperty.FONT | |||
]) | |||
|
|||
const fullThemedSvg = preventSvgTruncation(themedSvg) | |||
const fullThemedSvg = addExportBackgroundColor( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[F] This was broken
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR diff size of 462453 lines exceeds the maximum allowed for the inline comments feature.
extension/src/cli/dvc/contract.ts
Outdated
@@ -1,5 +1,3 @@ | |||
import { Plot } from '../../plots/webview/contract' | |||
|
|||
export const MIN_CLI_VERSION = '2.58.1' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these things that need to be done before merging?
extension/src/cli/dvc/contract.ts
Outdated
export const PLOT_ZOOM_AND_PAN_ANCHOR = '<DVC_METRIC_ZOOM_AND_PAN>' as const | ||
export const PLOT_PARAM_TYPE_ANCHOR = '<DVC_PARAM_TYPE>' as const | ||
export const PLOT_HEIGHT_ANCHOR = '<DVC_METRIC_PLOT_HEIGHT>' as const | ||
export const PLOT_WIDTH_ANCHOR = '<DVC_METRIC_PLOT_WIDTH>' as const |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we have these inside an enum / const? So we can have all tags while importing only one constant (autocompletion as well).
@@ -71,49 +47,45 @@ export const ZoomablePlot: React.FC<ZoomablePlotProps> = ({ | |||
} | |||
|
|||
return ( | |||
<ZoomablePlotWrapper spec={plotProps.spec as SpecWithTitles}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we getting rid of the tooltip?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got my answer a few files below (https://github.com/iterative/vscode-dvc/pull/4734/files#r1405504743)
|
||
table { | ||
table-layout: auto !important; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this needed after all? (table-layout
)
anchorDefinitions: AnchorDefinitions | ||
// eslint-disable-next-line sonarjs/cognitive-complexity | ||
): unknown => { | ||
if (!value) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to return early if value === 0
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it is also tested on line 38 and value is returned in the end as well, we should remove that check and let isAnchor
return false if there is no value.
const updatedAnchors: Record<string, unknown> = {} | ||
|
||
const titleWidth = getMaxHorizontalTitleCharacters(nbItemsPerRow) | ||
const titleHeight = getMaxVerticalTitleCharacters( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we are inside the webview, we can now calculate the available space and have it looking right all the time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! Should we create a todo list of what needs to be done before this pr gets merged to ensure nothing gets missed?
type === 'number' ? 'quantitative' : 'nominal' | ||
|
||
export const createSpec = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this function no longer takes arguments, should we turn it into an object instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR diff size of 462453 lines exceeds the maximum allowed for the inline comments feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR diff size of 462456 lines exceeds the maximum allowed for the inline comments feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR diff size of 462329 lines exceeds the maximum allowed for the inline comments feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR diff size of 462329 lines exceeds the maximum allowed for the inline comments feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR diff size of 462333 lines exceeds the maximum allowed for the inline comments feature.
Code Climate has analyzed commit 7bde398 and detected 3 issues on this pull request. Here's the issue category breakdown:
The test coverage on the diff in this pull request is 98.3% (85% is the threshold). This pull request will bring the total coverage in the repository to 95.2% (0.0% change). View more on Code Climate. |
plots
: standardise across DVC/Studio/VS Code
Part of iterative/dvc#9940
This PR makes the changes required to accept the new templates provided by
dvc-render
in iterative/dvc-render#142. Made available throughdvc
in iterative/dvc#9931.The main difference in the approach is that extra anchors have been added to the default templates. These anchors will all be filled in the webview so that the values can be manipulated depending on whether or not the plot is being shown in the zoom modal. We will no longer be overwriting information in templates that do not have the appropriate anchors.
I have consolidated our plot's test fixtures as part of the change. I have been able to drop a few files as the bulk of the complexity has been moved into
dvc-render
.Demo
Screen.Recording.2023-11-27.at.12.14.35.pm.mov