Skip to content

Commit

Permalink
[ML] Fix Limit Dropdown, simplify state management of Anomaly Explore…
Browse files Browse the repository at this point in the history
…r. (elastic#23388)

- This fixes the limit dropdown behavior. The fix for that is actually just the $scope.appState.fetch(); statements in explorer_controller.js, they avoid to run the information stored in appState across modules out of sync.
- Additionally, the aim of this PR is to simplify the state management of Anomaly Explorer in the context of selecting cells in the swimlanes and updating the influencers list, charts and table accordingly.
  • Loading branch information
walterra authored and cqliu1 committed Sep 25, 2018
1 parent 775ae1b commit a25fc75
Show file tree
Hide file tree
Showing 9 changed files with 358 additions and 350 deletions.
18 changes: 2 additions & 16 deletions x-pack/plugins/ml/public/explorer/explorer.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,7 @@
ng-mouseenter="setSwimlaneSelectActive(true)"
ng-mouseleave="setSwimlaneSelectActive(false)"
>
<ml-explorer-swimlane
swimlane-type="overall"
swimlane-data="overallSwimlaneData"
selected-job-ids="selectedJobIds"
chart-width="swimlaneWidth"
app-state="appState"
style="width: 100%; height: 250px;">
</ml-explorer-swimlane>
<ml-explorer-swimlane swimlane-type="overall" />
</div>

<div ng-if="viewBySwimlaneOptions.length > 0">
Expand Down Expand Up @@ -95,14 +88,7 @@
ng-mouseenter="setSwimlaneSelectActive(true)"
ng-mouseleave="setSwimlaneSelectActive(false)"
>
<ml-explorer-swimlane
swimlane-type="viewBy"
swimlane-data="viewBySwimlaneData"
selected-job-ids="selectedJobIds"
chart-width="swimlaneWidth"
app-state="appState"
style="width: 100%; height: 250px;">
</ml-explorer-swimlane>
<ml-explorer-swimlane swimlane-type="viewBy" />
</div>

<div ng-if="!showViewBySwimlane()" class="text-center visualize-error euiText">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ module.directive('mlExplorerChartsContainer', function (
element[0]
);
}

mlExplorerDashboardService.chartsInitDone.changed();
}

return {
Expand Down
7 changes: 7 additions & 0 deletions x-pack/plugins/ml/public/explorer/explorer_constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,10 @@ export const DRAG_SELECT_ACTION = {
ELEMENT_SELECT: 'elementSelect',
DRAG_START: 'dragStart'
};

export const SWIMLANE_DEFAULT_LIMIT = 10;

export const SWIMLANE_TYPE = {
OVERALL: 'overall',
VIEW_BY: 'viewBy'
};
Loading

0 comments on commit a25fc75

Please sign in to comment.