Skip to content

Commit 13d555c

Browse files
committed
remove DEFAULT and make ALPHABETICAL the default
1 parent 2c82781 commit 13d555c

File tree

9 files changed

+15
-19
lines changed

9 files changed

+15
-19
lines changed

tensorboard/webapp/metrics/effects/metrics_effects_test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ describe('metrics effects', () => {
8888
store.overrideSelector(selectors.getMetricsScalarSmoothing, 0.3);
8989
store.overrideSelector(
9090
selectors.getMetricsTooltipSort,
91-
TooltipSort.DEFAULT
91+
TooltipSort.ALPHABETICAL
9292
);
9393
});
9494

tensorboard/webapp/metrics/internal_types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ export enum PluginType {
2727
// When editing a value of the enum, please write a backward compatible
2828
// deserializer in data_source/metrics_data_source.ts.
2929
export enum TooltipSort {
30-
DEFAULT = 'default',
3130
ASCENDING = 'ascending',
3231
DESCENDING = 'descending',
3332
NEAREST = 'nearest',

tensorboard/webapp/metrics/store/metrics_reducers.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -374,15 +374,15 @@ const reducer = createReducer(
374374
const metricsSettings: Partial<MetricsSettings> = {};
375375
if (partialSettings.tooltipSortString) {
376376
switch (partialSettings.tooltipSortString) {
377+
case TooltipSort.ALPHABETICAL:
378+
metricsSettings.tooltipSort = TooltipSort.ALPHABETICAL;
379+
break;
377380
case TooltipSort.ASCENDING:
378381
metricsSettings.tooltipSort = TooltipSort.ASCENDING;
379382
break;
380383
case TooltipSort.DESCENDING:
381384
metricsSettings.tooltipSort = TooltipSort.DESCENDING;
382385
break;
383-
case TooltipSort.DEFAULT:
384-
metricsSettings.tooltipSort = TooltipSort.DEFAULT;
385-
break;
386386
case TooltipSort.NEAREST:
387387
metricsSettings.tooltipSort = TooltipSort.NEAREST;
388388
break;

tensorboard/webapp/metrics/store/metrics_reducers_test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ describe('metrics reducers', () => {
602602
it('changes tooltipSort on metricsChangeTooltipSort', () => {
603603
const prevState = buildMetricsState({
604604
settings: buildMetricsSettingsState({
605-
tooltipSort: TooltipSort.DEFAULT,
605+
tooltipSort: TooltipSort.ALPHABETICAL,
606606
}),
607607
settingOverrides: buildMetricsSettingsState({
608608
tooltipSort: TooltipSort.ASCENDING,
@@ -612,7 +612,7 @@ describe('metrics reducers', () => {
612612
prevState,
613613
actions.metricsChangeTooltipSort({sort: TooltipSort.NEAREST})
614614
);
615-
expect(nextState.settings.tooltipSort).toBe(TooltipSort.DEFAULT);
615+
expect(nextState.settings.tooltipSort).toBe(TooltipSort.ALPHABETICAL);
616616
expect(nextState.settingOverrides.tooltipSort).toBe(TooltipSort.NEAREST);
617617
});
618618

@@ -1910,7 +1910,7 @@ describe('metrics reducers', () => {
19101910
});
19111911

19121912
describe('#globalSettingsLoaded', () => {
1913-
it('adds partial state from loading the settings to the (default) settings', () => {
1913+
it('adds partial state from loading the settings to the (alphabetical) settings', () => {
19141914
const beforeState = buildMetricsState({
19151915
settings: buildMetricsSettingsState({
19161916
scalarSmoothing: 0.3,
@@ -1919,7 +1919,7 @@ describe('metrics reducers', () => {
19191919
}),
19201920
settingOverrides: {
19211921
scalarSmoothing: 0.5,
1922-
tooltipSort: TooltipSort.DEFAULT,
1922+
tooltipSort: TooltipSort.ALPHABETICAL,
19231923
},
19241924
});
19251925

@@ -1937,7 +1937,7 @@ describe('metrics reducers', () => {
19371937
expect(nextState.settings.ignoreOutliers).toBe(true);
19381938
expect(nextState.settings.tooltipSort).toBe(TooltipSort.DESCENDING);
19391939
expect(nextState.settingOverrides.scalarSmoothing).toBe(0.5);
1940-
expect(nextState.settingOverrides.tooltipSort).toBe(TooltipSort.DEFAULT);
1940+
expect(nextState.settingOverrides.tooltipSort).toBe(TooltipSort.ALPHABETICAL);
19411941
});
19421942

19431943
it(

tensorboard/webapp/metrics/store/metrics_types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ export interface State {
223223

224224
export const METRICS_SETTINGS_DEFAULT: MetricsSettings = {
225225
cardMinWidth: null,
226-
tooltipSort: TooltipSort.DEFAULT,
226+
tooltipSort: TooltipSort.ALPHABETICAL,
227227
ignoreOutliers: true,
228228
xAxisType: XAxisType.STEP,
229229
scalarSmoothing: 0.6,

tensorboard/webapp/metrics/views/card_renderer/scalar_card_component.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,6 @@ export class ScalarCardComponent<Downloader> {
157157
}
158158

159159
switch (this.tooltipSort) {
160-
case TooltipSort.DEFAULT:
161-
return scalarTooltipData;
162160
case TooltipSort.ASCENDING:
163161
return scalarTooltipData.sort((a, b) => a.point.y - b.point.y);
164162
case TooltipSort.DESCENDING:

tensorboard/webapp/metrics/views/card_renderer/scalar_card_test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ describe('scalar card', () => {
291291
store.overrideSelector(selectors.getMetricsIgnoreOutliers, false);
292292
store.overrideSelector(
293293
selectors.getMetricsTooltipSort,
294-
TooltipSort.DEFAULT
294+
TooltipSort.ALPHABETICAL
295295
);
296296
store.overrideSelector(selectors.getRunColorMap, {});
297297
store.overrideSelector(selectors.getDarkModeEnabled, false);

tensorboard/webapp/metrics/views/right_pane/right_pane_test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ describe('metrics right_pane', () => {
7171
beforeEach(() => {
7272
store.overrideSelector(
7373
selectors.getMetricsTooltipSort,
74-
TooltipSort.DEFAULT
74+
TooltipSort.ALPHABETICAL
7575
);
7676
store.overrideSelector(selectors.getMetricsIgnoreOutliers, false);
7777
store.overrideSelector(selectors.getMetricsXAxisType, XAxisType.STEP);
@@ -119,7 +119,7 @@ describe('metrics right_pane', () => {
119119
it('renders', () => {
120120
store.overrideSelector(
121121
selectors.getMetricsTooltipSort,
122-
TooltipSort.DEFAULT
122+
TooltipSort.ALPHABETICAL
123123
);
124124
store.overrideSelector(selectors.getMetricsIgnoreOutliers, false);
125125
store.overrideSelector(selectors.getMetricsXAxisType, XAxisType.STEP);
@@ -139,7 +139,7 @@ describe('metrics right_pane', () => {
139139
// In the test setting, material component's DOM does not reflect the
140140
// value.
141141
expect(tooltipSortSelect.componentInstance.value).toBe(
142-
TooltipSort.DEFAULT
142+
TooltipSort.ALPHABETICAL
143143
);
144144

145145
expect(

tensorboard/webapp/metrics/views/right_pane/settings_view_component.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,10 @@ export class SettingsViewComponent {
8080
@Input() isImageSupportEnabled!: boolean;
8181

8282
readonly TooltipSortDropdownOptions: DropdownOption[] = [
83-
{value: TooltipSort.DEFAULT, displayText: 'Default'},
83+
{value: TooltipSort.ALPHABETICAL, displayText: 'Alphabetical'},
8484
{value: TooltipSort.ASCENDING, displayText: 'Ascending'},
8585
{value: TooltipSort.DESCENDING, displayText: 'Descending'},
8686
{value: TooltipSort.NEAREST, displayText: 'Nearest'},
87-
{value: TooltipSort.ALPHABETICAL, displayText: 'Alphabetical'},
8887
];
8988
@Input() tooltipSort!: TooltipSort;
9089
@Output() tooltipSortChanged = new EventEmitter<TooltipSort>();

0 commit comments

Comments
 (0)