Skip to content

Commit 3ff7cd2

Browse files
committed
Add buildMetricsSettingsOverrides for testing
1 parent abb477b commit 3ff7cd2

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tensorboard/webapp/metrics/testing.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,27 @@ export function buildMetricsSettingsState(
6464
};
6565
}
6666

67+
// Since Settings proto has missing fields, we need to build a partial of
68+
// Settings to be used in tests.
69+
export function buildMetricsSettingsOverrides(
70+
overrides?: Partial<MetricsSettings>
71+
): Partial<MetricsSettings> {
72+
return {
73+
cardMinWidth: null,
74+
tooltipSort: TooltipSort.NEAREST,
75+
ignoreOutliers: false,
76+
xAxisType: XAxisType.WALL_TIME,
77+
scalarSmoothing: 0.3,
78+
hideEmptyCards: true,
79+
scalarPartitionNonMonotonicX: false,
80+
imageBrightnessInMilli: 123,
81+
imageContrastInMilli: 123,
82+
imageShowActualSize: true,
83+
histogramMode: HistogramMode.OFFSET,
84+
...overrides,
85+
};
86+
}
87+
6788
function buildBlankState(): MetricsState {
6889
return {
6990
tagMetadataLoadState: {

0 commit comments

Comments
 (0)