-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Feature: Allow tooltip sorting by X, Y, and Pixel distance from cursor #6116
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
Changes from 2 commits
435d8d4
eb5123d
edf2125
7140374
e3ce6e7
6d27028
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2359,7 +2359,7 @@ describe('metrics reducers', () => { | |
globalSettingsLoaded({ | ||
partialSettings: { | ||
ignoreOutliers: true, | ||
tooltipSortString: 'descending', | ||
tooltipSortString: 'descending' as TooltipSort, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you just use TooltipSort.DESCENDING? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can but, because the test is testing deserialization from browser storage, I prefer testing the string literal. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The reasoning doesn't seem to apply here. At this point in the code you are several layers removed from the serialized form. The only serialized form of the string exists in LocalStorage. The type globalSettingsLoaded says it will include a TooltipSort object, so that is the ideal type to use for the test. |
||
}, | ||
}) | ||
); | ||
|
@@ -2387,7 +2387,7 @@ describe('metrics reducers', () => { | |
beforeState, | ||
globalSettingsLoaded({ | ||
partialSettings: { | ||
tooltipSortString: 'yo', | ||
tooltipSortString: 'yo' as TooltipSort, | ||
}, | ||
}) | ||
); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -119,7 +119,8 @@ | |
<ng-template | ||
#tooltip | ||
let-tooltipData="data" | ||
let-cursorLoc="cursorLocationInDataCoord" | ||
let-cursorLocationInDataCoord="cursorLocationInDataCoord" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Whatever names you choose line_chart_interactive_view.ts, please mirror here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These names all look the same to me? Am I missing something? (of note, they were not the same before and I renamed them to be the same). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was another comment I left about naming inconsistency, which does not seem to have been addressed. Do you mind taking a look at that one and then revisiting this one? I assume this comment doesn't make sense to you because you missed the other comment. |
||
let-cursorLocation="cursorLocation" | ||
> | ||
<table class="tooltip"> | ||
<thead> | ||
|
@@ -136,7 +137,7 @@ | |
<tbody> | ||
<ng-container | ||
*ngFor=" | ||
let datum of getCursorAwareTooltipData(tooltipData, cursorLoc); | ||
let datum of getCursorAwareTooltipData(tooltipData, cursorLocationInDataCoord, cursorLocation); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: Can this be line wrapped? |
||
trackBy: trackByTooltipDatum | ||
" | ||
> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,12 @@ import { | |
SettingsConverter, | ||
TEST_ONLY, | ||
} from './persistent_settings_data_source'; | ||
import {BackendSettings, PersistableSettings, ThemeValue} from './types'; | ||
import { | ||
BackendSettings, | ||
PersistableSettings, | ||
ThemeValue, | ||
TooltipSort, | ||
} from './types'; | ||
|
||
describe('persistent_settings data_source test', () => { | ||
let getItemSpy: jasmine.Spy; | ||
|
@@ -289,7 +294,7 @@ describe('persistent_settings data_source test', () => { | |
|
||
expect(actual).toEqual({ | ||
scalarSmoothing: 0.3, | ||
tooltipSortString: 'ascending', | ||
tooltipSortString: 'ascending' as TooltipSort, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use TooltipSort.ASCENDING? |
||
notificationLastReadTimeInMs: 3, | ||
}); | ||
}); | ||
|
@@ -311,7 +316,7 @@ describe('persistent_settings data_source test', () => { | |
|
||
expect(actual).toEqual({ | ||
scalarSmoothing: 0.5, | ||
tooltipSortString: 'default', | ||
tooltipSortString: 'default' as TooltipSort, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use TooltipSort.DEFAULT? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because the test is testing deserialization from browser storage, I prefer testing the string literal. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Very similar to my other response: The only serialized form of the string exists in LocalStorage. The contract of dataSource.getSettings() says it will return a TooltipSort object, so that seems to be the type you should use for the test. I think the reasoning you are using would apply to setSettings() tests but it doesn't really apply to getSettings() tests. |
||
notificationLastReadTimeInMs: 100, | ||
}); | ||
}); | ||
|
Uh oh!
There was an error while loading. Please reload this page.