Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/ui/public/filter_bar/filter_bar.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 0 additions & 2 deletions src/ui/public/vislib/lib/handler/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down
13 changes: 7 additions & 6 deletions src/ui/public/visualize/visualize_legend.js
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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);
Expand All @@ -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);
};

Expand Down Expand Up @@ -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) {
Expand Down