Skip to content

Commit c4bd493

Browse files
authored
Fix typo (#3426)
1 parent 1dda52a commit c4bd493

File tree

13 files changed

+41
-44
lines changed

13 files changed

+41
-44
lines changed

extension/src/plots/model/index.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { PlotsModel } from '.'
22
import {
3-
DEFAULT_NB_ITEMS_PER_REOW,
3+
DEFAULT_NB_ITEMS_PER_ROW,
44
DEFAULT_SECTION_COLLAPSED,
55
DEFAULT_SECTION_NB_ITEMS_PER_ROW,
66
Section
@@ -69,7 +69,7 @@ describe('plotsModel', () => {
6969

7070
it('should change the plotSize when calling setPlotSize', () => {
7171
expect(model.getNbItemsPerRow(Section.CHECKPOINT_PLOTS)).toStrictEqual(
72-
DEFAULT_NB_ITEMS_PER_REOW
72+
DEFAULT_NB_ITEMS_PER_ROW
7373
)
7474

7575
model.setNbItemsPerRow(Section.CHECKPOINT_PLOTS, 1)

extension/src/plots/model/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import {
2828
SectionCollapsed,
2929
CustomPlotData,
3030
DEFAULT_HEIGHT,
31-
DEFAULT_NB_ITEMS_PER_REOW
31+
DEFAULT_NB_ITEMS_PER_ROW
3232
} from '../webview/contract'
3333
import {
3434
ExperimentsOutput,
@@ -411,7 +411,7 @@ export class PlotsModel extends ModelWithPersistence {
411411
if (this.nbItemsPerRow[section]) {
412412
return this.nbItemsPerRow[section]
413413
}
414-
return DEFAULT_NB_ITEMS_PER_REOW
414+
return DEFAULT_NB_ITEMS_PER_ROW
415415
}
416416

417417
public setHeight(section: Section, height: number | undefined) {

extension/src/plots/vega/util.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import smoothTemplate from '../../test/fixtures/plotsDiff/templates/smooth'
1919
import multiSourceTemplate from '../../test/fixtures/plotsDiff/templates/multiSource'
2020
import { copyOriginalColors } from '../../experiments/model/status/colors'
2121
import { EXPERIMENT_WORKSPACE_ID } from '../../cli/dvc/contract'
22-
import { DEFAULT_NB_ITEMS_PER_REOW } from '../webview/contract'
22+
import { DEFAULT_NB_ITEMS_PER_ROW } from '../webview/contract'
2323

2424
describe('isMultiViewPlot', () => {
2525
it('should recognize the confusion matrix template as a multi view plot', () => {
@@ -86,7 +86,7 @@ describe('extendVegaSpec', () => {
8686
it('should not add encoding if no color scale is provided', () => {
8787
const extendedSpec = extendVegaSpec(
8888
linearTemplate,
89-
DEFAULT_NB_ITEMS_PER_REOW
89+
DEFAULT_NB_ITEMS_PER_ROW
9090
)
9191
expect(extendedSpec.encoding).toBeUndefined()
9292
})
@@ -98,7 +98,7 @@ describe('extendVegaSpec', () => {
9898
}
9999
const extendedSpec = extendVegaSpec(
100100
linearTemplate,
101-
DEFAULT_NB_ITEMS_PER_REOW,
101+
DEFAULT_NB_ITEMS_PER_ROW,
102102
{
103103
color: colorScale
104104
}
@@ -169,7 +169,7 @@ describe('extendVegaSpec', () => {
169169

170170
it('should truncate all titles from the left to 50 characters for regular plots', () => {
171171
const spec = withLongTemplatePlotTitle()
172-
const updatedSpec = extendVegaSpec(spec, DEFAULT_NB_ITEMS_PER_REOW)
172+
const updatedSpec = extendVegaSpec(spec, DEFAULT_NB_ITEMS_PER_ROW)
173173

174174
const truncatedTitle = '…-many-many-characters-at-least-seventy-characters'
175175
const truncatedHorizontalTitle =

extension/src/plots/vega/util.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import {
2626
} from 'vega-lite/build/src/spec/repeat'
2727
import { TopLevelUnitSpec } from 'vega-lite/build/src/spec/unit'
2828
import isEqual from 'lodash.isequal'
29-
import { ColorScale, DEFAULT_NB_ITEMS_PER_REOW } from '../webview/contract'
29+
import { ColorScale, DEFAULT_NB_ITEMS_PER_ROW } from '../webview/contract'
3030
import { ShapeEncoding, StrokeDashEncoding } from '../multiSource/constants'
3131
import { Color } from '../../experiments/model/status/colors'
3232

@@ -282,7 +282,7 @@ export const truncateTitles = (
282282
const title = value as unknown as Title
283283
specCopy[key] = vertical
284284
? truncateVerticalTitle(title, size)
285-
: truncateTitle(title, size > DEFAULT_NB_ITEMS_PER_REOW ? 30 : 50)
285+
: truncateTitle(title, size > DEFAULT_NB_ITEMS_PER_ROW ? 30 : 50)
286286
} else if (isEndValue(valueType)) {
287287
specCopy[key] = value
288288
} else if (Array.isArray(value)) {

extension/src/plots/webview/contract.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { VisualizationSpec } from 'react-vega'
22
import { Color } from '../../experiments/model/status/colors'
33

4-
export const DEFAULT_NB_ITEMS_PER_REOW = 2
4+
export const DEFAULT_NB_ITEMS_PER_ROW = 2
55

66
export enum Section {
77
CHECKPOINT_PLOTS = 'checkpoint-plots',
@@ -11,10 +11,10 @@ export enum Section {
1111
}
1212

1313
export const DEFAULT_SECTION_NB_ITEMS_PER_ROW = {
14-
[Section.CHECKPOINT_PLOTS]: DEFAULT_NB_ITEMS_PER_REOW,
15-
[Section.TEMPLATE_PLOTS]: DEFAULT_NB_ITEMS_PER_REOW,
16-
[Section.COMPARISON_TABLE]: DEFAULT_NB_ITEMS_PER_REOW,
17-
[Section.CUSTOM_PLOTS]: DEFAULT_NB_ITEMS_PER_REOW
14+
[Section.CHECKPOINT_PLOTS]: DEFAULT_NB_ITEMS_PER_ROW,
15+
[Section.TEMPLATE_PLOTS]: DEFAULT_NB_ITEMS_PER_ROW,
16+
[Section.COMPARISON_TABLE]: DEFAULT_NB_ITEMS_PER_ROW,
17+
[Section.CUSTOM_PLOTS]: DEFAULT_NB_ITEMS_PER_ROW
1818
}
1919

2020
// Height is undefined by default because it is calculated by ratio of the width it'll fill (calculated by the webview)

extension/src/test/fixtures/expShow/base/checkpointPlots.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { copyOriginalColors } from '../../../../experiments/model/status/colors'
22
import {
33
CheckpointPlotsData,
4-
DEFAULT_NB_ITEMS_PER_REOW
4+
DEFAULT_NB_ITEMS_PER_ROW
55
} from '../../../../plots/webview/contract'
66

77
const colors = copyOriginalColors()
@@ -91,7 +91,7 @@ const data: CheckpointPlotsData = {
9191
'summary.json:val_loss',
9292
'summary.json:val_accuracy'
9393
],
94-
nbItemsPerRow: DEFAULT_NB_ITEMS_PER_REOW,
94+
nbItemsPerRow: DEFAULT_NB_ITEMS_PER_ROW,
9595
height: undefined
9696
}
9797

extension/src/test/fixtures/expShow/base/customPlots.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {
22
CustomPlotsData,
3-
DEFAULT_NB_ITEMS_PER_REOW
3+
DEFAULT_NB_ITEMS_PER_ROW
44
} from '../../../../plots/webview/contract'
55

66
const data: CustomPlotsData = {
@@ -50,7 +50,7 @@ const data: CustomPlotsData = {
5050
]
5151
}
5252
],
53-
nbItemsPerRow: DEFAULT_NB_ITEMS_PER_REOW,
53+
nbItemsPerRow: DEFAULT_NB_ITEMS_PER_ROW,
5454
height: undefined
5555
}
5656

extension/src/test/fixtures/plotsDiff/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
TemplatePlots,
1414
Revision,
1515
PlotsComparisonData,
16-
DEFAULT_NB_ITEMS_PER_REOW
16+
DEFAULT_NB_ITEMS_PER_ROW
1717
} from '../../../plots/webview/contract'
1818
import { join } from '../../util/path'
1919
import { copyOriginalColors } from '../../../experiments/model/status/colors'
@@ -499,7 +499,7 @@ const extendedSpecs = (plotsOutput: TemplatePlots): TemplatePlotSection[] => {
499499
) || []
500500
}
501501
} as TopLevelSpec,
502-
DEFAULT_NB_ITEMS_PER_REOW,
502+
DEFAULT_NB_ITEMS_PER_ROW,
503503
{
504504
color: {
505505
domain: expectedRevisions,
@@ -659,14 +659,14 @@ export const getRevisions = (): Revision[] => {
659659

660660
export const getMinimalWebviewMessage = () => ({
661661
plots: extendedSpecs(basicVega),
662-
nbItemsPerRow: DEFAULT_NB_ITEMS_PER_REOW,
662+
nbItemsPerRow: DEFAULT_NB_ITEMS_PER_ROW,
663663
height: undefined,
664664
revisions: getRevisions()
665665
})
666666

667667
export const getTemplateWebviewMessage = (): TemplatePlotsData => ({
668668
plots: extendedSpecs({ ...basicVega, ...require('./vega').default }),
669-
nbItemsPerRow: DEFAULT_NB_ITEMS_PER_REOW,
669+
nbItemsPerRow: DEFAULT_NB_ITEMS_PER_ROW,
670670
height: undefined
671671
})
672672

@@ -676,7 +676,7 @@ export const getManyTemplatePlotsWebviewMessage = (
676676
plots: extendedSpecs({
677677
...multipleVega(length)
678678
}),
679-
nbItemsPerRow: DEFAULT_NB_ITEMS_PER_REOW,
679+
nbItemsPerRow: DEFAULT_NB_ITEMS_PER_ROW,
680680
height: undefined
681681
})
682682

@@ -703,7 +703,7 @@ export const getComparisonWebviewMessage = (
703703
return {
704704
revisions: getRevisions(),
705705
plots: plotAcc,
706-
nbItemsPerRow: DEFAULT_NB_ITEMS_PER_REOW,
706+
nbItemsPerRow: DEFAULT_NB_ITEMS_PER_ROW,
707707
height: undefined
708708
}
709709
}

extension/src/test/suite/experiments/index.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ import * as ProcessExecution from '../../../process/execution'
8181
import { DvcReader } from '../../../cli/dvc/reader'
8282
import { Connect } from '../../../connect'
8383
import { DvcViewer } from '../../../cli/dvc/viewer'
84-
import { DEFAULT_NB_ITEMS_PER_REOW } from '../../../plots/webview/contract'
84+
import { DEFAULT_NB_ITEMS_PER_ROW } from '../../../plots/webview/contract'
8585

8686
const { openFileInEditor } = FileSystem
8787

@@ -339,7 +339,7 @@ suite('Experiments Test Suite', () => {
339339
).returns(undefined)
340340

341341
const mockColumnId = 'params:params.yaml:lr'
342-
const mockWidth = DEFAULT_NB_ITEMS_PER_REOW
342+
const mockWidth = DEFAULT_NB_ITEMS_PER_ROW
343343

344344
mockMessageReceived.fire({
345345
payload: { id: mockColumnId, width: mockWidth },

webview/src/plots/components/App.test.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import {
2828
Section,
2929
TemplatePlotGroup,
3030
TemplatePlotsData,
31-
DEFAULT_NB_ITEMS_PER_REOW
31+
DEFAULT_NB_ITEMS_PER_ROW
3232
} from 'dvc/src/plots/webview/contract'
3333
import {
3434
MessageFromWebviewType,
@@ -263,7 +263,7 @@ describe('App', () => {
263263
checkpoint: null,
264264
comparison: {
265265
height: undefined,
266-
nbItemsPerRow: DEFAULT_NB_ITEMS_PER_REOW,
266+
nbItemsPerRow: DEFAULT_NB_ITEMS_PER_ROW,
267267
plots: [
268268
{
269269
path: 'training/plots/images/misclassified.jpg',
@@ -1673,7 +1673,7 @@ describe('App', () => {
16731673
it('should wrap the checkpoint plots in a big grid (virtualize them) when there are more than fourteen regular plots', async () => {
16741674
await renderAppAndChangeSize(
16751675
{ checkpoint: createCheckpointPlots(15) },
1676-
DEFAULT_NB_ITEMS_PER_REOW,
1676+
DEFAULT_NB_ITEMS_PER_ROW,
16771677
Section.CHECKPOINT_PLOTS
16781678
)
16791679

@@ -1683,7 +1683,7 @@ describe('App', () => {
16831683
it('should not wrap the checkpoint plots in a big grid (virtualize them) when there are fourteen regular plots', async () => {
16841684
await renderAppAndChangeSize(
16851685
{ checkpoint: createCheckpointPlots(14) },
1686-
DEFAULT_NB_ITEMS_PER_REOW,
1686+
DEFAULT_NB_ITEMS_PER_ROW,
16871687
Section.CHECKPOINT_PLOTS
16881688
)
16891689

@@ -1693,7 +1693,7 @@ describe('App', () => {
16931693
it('should wrap the template plots in a big grid (virtualize them) when there are more than fourteen regular plots', async () => {
16941694
await renderAppAndChangeSize(
16951695
{ template: manyTemplatePlots(15) },
1696-
DEFAULT_NB_ITEMS_PER_REOW,
1696+
DEFAULT_NB_ITEMS_PER_ROW,
16971697
Section.TEMPLATE_PLOTS
16981698
)
16991699

@@ -1703,7 +1703,7 @@ describe('App', () => {
17031703
it('should not wrap the template plots in a big grid (virtualize them) when there are fourteen or fewer regular plots', async () => {
17041704
await renderAppAndChangeSize(
17051705
{ template: manyTemplatePlots(14) },
1706-
DEFAULT_NB_ITEMS_PER_REOW,
1706+
DEFAULT_NB_ITEMS_PER_ROW,
17071707
Section.TEMPLATE_PLOTS
17081708
)
17091709

@@ -1717,7 +1717,7 @@ describe('App', () => {
17171717
beforeEach(async () => {
17181718
store = await renderAppAndChangeSize(
17191719
{ checkpoint },
1720-
DEFAULT_NB_ITEMS_PER_REOW,
1720+
DEFAULT_NB_ITEMS_PER_ROW,
17211721
Section.CHECKPOINT_PLOTS
17221722
)
17231723
})

0 commit comments

Comments
 (0)