mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
Toggling spy panel no longer throws an error (#8906)
Backports PR #8877 **Commit 1:** Toggling spy panel no longer throws an error * Original sha:0de553d37b
* Authored by Thomas Neirynck <thomas@elastic.co> on 2016-10-28T18:06:05Z **Commit 2:** Complete existence check before using handler * Original sha:6fad2be793
* Authored by Thomas Neirynck <thomas@elastic.co> on 2016-10-31T14:11:40Z
This commit is contained in:
parent
405b541586
commit
c834ee74b1
3 changed files with 7 additions and 10 deletions
|
@ -1,7 +1,5 @@
|
|||
import _ from 'lodash';
|
||||
import template from 'ui/filter_bar/filter_bar.html';
|
||||
import moment from 'moment';
|
||||
import angular from 'angular';
|
||||
import 'ui/directives/json_input';
|
||||
import filterAppliedAndUnwrap from 'ui/filter_bar/lib/filter_applied_and_unwrap';
|
||||
import FilterBarLibMapAndFlattenFiltersProvider from 'ui/filter_bar/lib/map_and_flatten_filters';
|
||||
|
|
|
@ -20,7 +20,6 @@ export default function HandlerBaseClass(Private) {
|
|||
*/
|
||||
class Handler {
|
||||
constructor(vis, opts) {
|
||||
|
||||
this.data = opts.data || new Data(vis.data, vis._attr, vis.uiState);
|
||||
this.vis = vis;
|
||||
this.el = vis.el;
|
||||
|
@ -78,7 +77,6 @@ export default function HandlerBaseClass(Private) {
|
|||
*/
|
||||
this.disable = this.chartEventProxyToggle('off');
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates whether data is actually present in the data object
|
||||
* used to render the Vis. Throws a no results error if data is not
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
import _ from 'lodash';
|
||||
import html from 'ui/visualize/visualize_legend.html';
|
||||
import $ from 'jquery';
|
||||
import d3 from 'd3';
|
||||
import findByParam from 'ui/utils/find_by_param';
|
||||
import VislibLibDataProvider from 'ui/vislib/lib/data';
|
||||
import VislibComponentsColorColorProvider from 'ui/vislib/components/color/color';
|
||||
import FilterBarFilterBarClickHandlerProvider from 'ui/filter_bar/filter_bar_click_handler';
|
||||
|
@ -18,7 +15,7 @@ uiModules.get('kibana')
|
|||
return {
|
||||
restrict: 'E',
|
||||
template: html,
|
||||
link: function ($scope, $elem) {
|
||||
link: function ($scope) {
|
||||
let $state = getAppState();
|
||||
let clickHandler = filterBarClickHandler($state);
|
||||
$scope.open = $scope.uiState.get('vis.legendOpen', true);
|
||||
|
@ -32,7 +29,11 @@ uiModules.get('kibana')
|
|||
$scope.highlight = function (event) {
|
||||
let el = event.currentTarget;
|
||||
let handler = $scope.renderbot.vislibVis.handler;
|
||||
if (!handler) return;
|
||||
|
||||
//there is no guarantee that a Chart will set the highlight-function on its handler
|
||||
if (!handler || typeof handler.highlight !== 'function') {
|
||||
return;
|
||||
}
|
||||
handler.highlight.call(el, handler.el);
|
||||
};
|
||||
|
||||
|
@ -110,7 +111,7 @@ uiModules.get('kibana')
|
|||
data = data.columns || data.rows || [data];
|
||||
if (type === 'pie') return Data.prototype.pieNames(data);
|
||||
return getSeriesLabels(data);
|
||||
};
|
||||
}
|
||||
|
||||
function getSeriesLabels(data) {
|
||||
let values = data.map(function (chart) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue