-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Metric vis should display a ?
or 0 for empty sets
#5532
Merged
Merged
Changes from 16 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
7f7be3c
init commit. Added inline controller to the visualize directive to ex…
stormpython 39bc45f
Closes #3682. Adds ability for metric visualizations to return 0 or ?…
stormpython 2b0b9ff
adding comments, adding ability for std deviation metric to return , …
stormpython 576cb3f
adding comment
stormpython cc0981b
Merge branch 'master' into fix/3682
stormpython 99a2fa9
Fixing issue with NaN and blank values being displayed. It turns out …
stormpython f023e4b
switch from using isNaN to _.isNaN, and adding check for undefined va…
stormpython bb8f0ec
Merge branch 'master' into fix/3682
stormpython 348d2fc
updating pr based on @rashidkpc review
stormpython 55ebeb2
moving business logic out of the view and removing early returns
stormpython 7a0c4f2
adding parameter to vis that tells the visualize directive whether th…
stormpython 16f3dc3
cleaning up code and moving handleNoResults param to defaults in metr…
stormpython 6daa528
refactoring
stormpython 504c7c3
removing early return
stormpython 8c90fff
removing comments
stormpython 165cdf7
Merge branch 'master' into fix/3682
stormpython 3269b02
refactoring based on @jbudz review
stormpython 4e74cc2
reverting _.has back to _.get
stormpython File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<div ng-controller="KbnMetricVisController" class="metric-vis"> | ||
<div class="metric-container" ng-repeat="metric in metrics"> | ||
<div class="metric-value" ng-style="{'font-size': vis.params.fontSize+'pt'}">{{metric.value}}</div> | ||
<div>{{metric.label}}</div> | ||
</div> | ||
<div class="metric-container" ng-repeat="metric in metrics"> | ||
<div class="metric-value" ng-style="{'font-size': vis.params.fontSize+'pt'}">{{metric.value}}</div> | ||
<div>{{metric.label}}</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,6 +44,19 @@ define(function (require) { | |
var getVisEl = getter('.visualize-chart'); | ||
var getVisContainer = getter('.vis-container'); | ||
|
||
// Show no results message when hasZeroHits is true and it requires search | ||
$scope.showNoResultsMessage = function () { | ||
var requiresSearch = _.get($scope, 'vis.type.requiresSearch'); | ||
var isZeroHits = _.get($scope,'esResp.hits.total') === 0; | ||
var shouldNotShowMessage = _.get($scope, 'vis.params.handleNoResults'); | ||
|
||
if (requiresSearch && isZeroHits) { | ||
// if the vis type handles instances when there are no results, | ||
// do not show a no results message | ||
return shouldNotShowMessage ? false : true; | ||
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. this block might be a easier to read if we did this in the positive. maybe something like |
||
} | ||
}; | ||
|
||
$scope.fullScreenSpy = false; | ||
$scope.spy = {}; | ||
$scope.spy.mode = ($scope.uiState) ? $scope.uiState.get('spy.mode', {}) : {}; | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
can _.has be used for requireSearch and shouldNotShowMessage?
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.
my bad, I didn't notice these were both already booleans. it looks like the has check works fine but probably wasn't needed