mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
removing unused variables/imports
This commit is contained in:
parent
0b63b830f2
commit
93295012fc
27 changed files with 46 additions and 92 deletions
|
@ -121,7 +121,6 @@ describe('Vislib Dispatch Class Test Suite', function () {
|
|||
it('should attach whatever gets passed on vis.on() to chart.events', function (done) {
|
||||
let vis;
|
||||
let persistedState;
|
||||
let chart;
|
||||
ngMock.module('kibana');
|
||||
ngMock.inject(function (Private) {
|
||||
vis = Private(FixturesVislibVisFixtureProvider)();
|
||||
|
@ -141,7 +140,6 @@ describe('Vislib Dispatch Class Test Suite', function () {
|
|||
it('can be added after rendering', function () {
|
||||
let vis;
|
||||
let persistedState;
|
||||
let chart;
|
||||
ngMock.module('kibana');
|
||||
ngMock.inject(function (Private) {
|
||||
vis = Private(FixturesVislibVisFixtureProvider)();
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
import angular from 'angular';
|
||||
import ngMock from 'ng_mock';
|
||||
import expect from 'expect.js';
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import _ from 'lodash';
|
||||
import d3 from 'd3';
|
||||
import expect from 'expect.js';
|
||||
import ngMock from 'ng_mock';
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import d3 from 'd3';
|
||||
import angular from 'angular';
|
||||
import expect from 'expect.js';
|
||||
import ngMock from 'ng_mock';
|
||||
import _ from 'lodash';
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
import angular from 'angular';
|
||||
import expect from 'expect.js';
|
||||
import ngMock from 'ng_mock';
|
||||
import _ from 'lodash';
|
||||
|
|
|
@ -123,15 +123,13 @@ Tooltip.prototype.render = function () {
|
|||
const id = self.id;
|
||||
const order = self.order;
|
||||
|
||||
const tooltipSelection = d3.select($tooltip.get(0));
|
||||
|
||||
if (self.container === undefined || self.container !== d3.select(self.el).select('.' + self.containerClass)) {
|
||||
self.container = d3.select(self.el).select('.' + self.containerClass);
|
||||
}
|
||||
|
||||
const $chart = self.$getChart();
|
||||
if ($chart) {
|
||||
self.binder.jqOn($chart, 'mouseleave', function (event) {
|
||||
self.binder.jqOn($chart, 'mouseleave', function () {
|
||||
// only clear when we leave the chart, so that
|
||||
// moving between points doesn't make it reposition
|
||||
$chart.removeData('previousPlacement');
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import d3 from 'd3';
|
||||
import $ from 'jquery';
|
||||
import _ from 'lodash';
|
||||
import VislibLibErrorHandlerProvider from 'ui/vislib/lib/_error_handler';
|
||||
export default function AxisTitleFactory(Private) {
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import d3 from 'd3';
|
||||
import $ from 'jquery';
|
||||
import _ from 'lodash';
|
||||
import VislibLibErrorHandlerProvider from 'ui/vislib/lib/_error_handler';
|
||||
import VislibComponentsTooltipProvider from 'ui/vislib/components/tooltip';
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import d3 from 'd3';
|
||||
import _ from 'lodash';
|
||||
import errors from 'ui/errors';
|
||||
import VislibComponentsZeroInjectionInjectZerosProvider from 'ui/vislib/components/zero_injection/inject_zeros';
|
||||
import VislibComponentsZeroInjectionOrderedXKeysProvider from 'ui/vislib/components/zero_injection/ordered_x_keys';
|
||||
import VislibComponentsLabelsLabelsProvider from 'ui/vislib/components/labels/labels';
|
||||
|
@ -387,7 +386,6 @@ export default function DataFactory(Private) {
|
|||
*/
|
||||
getYMin(getValue) {
|
||||
const self = this;
|
||||
const arr = [];
|
||||
|
||||
if (this._attr.mode === 'percentage' || this._attr.mode === 'wiggle' ||
|
||||
this._attr.mode === 'silhouette') {
|
||||
|
@ -427,7 +425,6 @@ export default function DataFactory(Private) {
|
|||
*/
|
||||
getYMax(getValue) {
|
||||
const self = this;
|
||||
const arr = [];
|
||||
|
||||
if (self._attr.mode === 'percentage') {
|
||||
return 1;
|
||||
|
@ -704,8 +701,7 @@ export default function DataFactory(Private) {
|
|||
values = _.map(series.rows, function (row) {
|
||||
return row[row.length - 1];
|
||||
});
|
||||
const extents = [_.min(values), _.max(values)];
|
||||
return extents;
|
||||
return [_.min(values), _.max(values)];
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -4,8 +4,6 @@ import $ from 'jquery';
|
|||
import SimpleEmitter from 'ui/utils/simple_emitter';
|
||||
import VislibComponentsTooltipProvider from 'ui/vislib/components/tooltip';
|
||||
export default function DispatchClass(Private) {
|
||||
const Tooltip = Private(VislibComponentsTooltipProvider);
|
||||
|
||||
/**
|
||||
* Handles event responses
|
||||
*
|
||||
|
@ -188,7 +186,6 @@ export default function DispatchClass(Private) {
|
|||
if (!this.isBrushable()) return;
|
||||
|
||||
const xScale = this.handler.xAxis.xScale;
|
||||
const yScale = this.handler.xAxis.yScale;
|
||||
const brush = this.createBrush(xScale, svg);
|
||||
|
||||
function brushEnd() {
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
import VislibLibHandlerHandlerProvider from 'ui/vislib/lib/handler/handler';
|
||||
import VislibLibDataProvider from 'ui/vislib/lib/data';
|
||||
import VislibLibChartTitleProvider from 'ui/vislib/lib/chart_title';
|
||||
|
||||
export default function PieHandler(Private) {
|
||||
const Handler = Private(VislibLibHandlerHandlerProvider);
|
||||
const Data = Private(VislibLibDataProvider);
|
||||
const ChartTitle = Private(VislibLibChartTitleProvider);
|
||||
|
||||
/*
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import _ from 'lodash';
|
||||
import VislibLibHandlerHandlerProvider from 'ui/vislib/lib/handler/handler';
|
||||
import VislibLibDataProvider from 'ui/vislib/lib/data';
|
||||
export default function MapHandlerProvider(Private) {
|
||||
|
|
|
@ -17,7 +17,7 @@ define(function () {
|
|||
const parent = $(this).parents('.vis-wrapper');
|
||||
|
||||
if (!data.series) {
|
||||
const splits = div.selectAll('.chart-title')
|
||||
div.selectAll('.chart-title')
|
||||
.data(function (d) {
|
||||
return d.rows ? d.rows : d.columns;
|
||||
})
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import d3 from 'd3';
|
||||
import VislibLibLayoutSplitsColumnChartChartSplitProvider from 'ui/vislib/lib/layout/splits/column_chart/chart_split';
|
||||
import VislibLibLayoutSplitsColumnChartYAxisSplitProvider from 'ui/vislib/lib/layout/splits/column_chart/y_axis_split';
|
||||
import VislibLibLayoutSplitsColumnChartXAxisSplitProvider from 'ui/vislib/lib/layout/splits/column_chart/x_axis_split';
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import d3 from 'd3';
|
||||
import VislibLibLayoutSplitsTileMapMapSplitProvider from 'ui/vislib/lib/layout/splits/tile_map/map_split';
|
||||
export default function ColumnLayoutFactory(Private) {
|
||||
const mapSplit = Private(VislibLibLayoutSplitsTileMapMapSplitProvider);
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import d3 from 'd3';
|
||||
import VislibLibLayoutSplitsPieChartChartSplitProvider from 'ui/vislib/lib/layout/splits/pie_chart/chart_split';
|
||||
import VislibLibLayoutSplitsPieChartChartTitleSplitProvider from 'ui/vislib/lib/layout/splits/pie_chart/chart_title_split';
|
||||
export default function ColumnLayoutFactory(Private) {
|
||||
|
|
|
@ -3,7 +3,7 @@ import _ from 'lodash';
|
|||
import sequencer from 'ui/utils/sequencer';
|
||||
import EventsProvider from 'ui/events';
|
||||
import ReflowWatcherProvider from 'ui/reflow_watcher';
|
||||
export default function ResizeCheckerFactory(Private, Notifier, $rootScope) {
|
||||
export default function ResizeCheckerFactory(Private, Notifier) {
|
||||
|
||||
const EventEmitter = Private(EventsProvider);
|
||||
const reflowWatcher = Private(ReflowWatcherProvider);
|
||||
|
@ -176,8 +176,6 @@ export default function ResizeCheckerFactory(Private, Notifier, $rootScope) {
|
|||
}
|
||||
|
||||
const check = this.check; // already bound
|
||||
const tick = this._tick;
|
||||
const notify = this.notify;
|
||||
const ms = this._currentSchedule[this._tick];
|
||||
return (this._timerId = setTimeout(function () {
|
||||
check();
|
||||
|
|
|
@ -280,7 +280,6 @@ export default function XAxisFactory(Private) {
|
|||
return function (selection) {
|
||||
selection.each(function () {
|
||||
const axis = d3.select(this);
|
||||
const labels = axis.selectAll('.tick text');
|
||||
if (ordered && ordered.date) {
|
||||
axis.call(self.filterAxisLabels());
|
||||
} else {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import d3 from 'd3';
|
||||
import _ from 'lodash';
|
||||
import errors from 'ui/errors';
|
||||
import dataLabel from 'ui/vislib/lib/_data_label';
|
||||
import VislibLibDispatchProvider from 'ui/vislib/lib/dispatch';
|
||||
import VislibComponentsTooltipProvider from 'ui/vislib/components/tooltip';
|
||||
|
|
|
@ -102,7 +102,7 @@ export default function MapFactory(Private, tilemap, $sanitize) {
|
|||
options: {
|
||||
position: 'topleft'
|
||||
},
|
||||
onAdd: function (map) {
|
||||
onAdd: function () {
|
||||
$(fitContainer).html('<a class="fa fa-crop" href="#" title="Fit Data Bounds"></a>')
|
||||
.on('click', function (e) {
|
||||
e.preventDefault();
|
||||
|
@ -111,7 +111,7 @@ export default function MapFactory(Private, tilemap, $sanitize) {
|
|||
|
||||
return fitContainer;
|
||||
},
|
||||
onRemove: function (map) {
|
||||
onRemove: function () {
|
||||
$(fitContainer).off('click');
|
||||
}
|
||||
});
|
||||
|
@ -215,7 +215,7 @@ export default function MapFactory(Private, tilemap, $sanitize) {
|
|||
self._tileLayer.off('tileload', saturateTiles);
|
||||
});
|
||||
|
||||
this.map.on('moveend', function setZoomCenter(ev) {
|
||||
this.map.on('moveend', function setZoomCenter() {
|
||||
if (!self.map) return;
|
||||
// update internal center and zoom references
|
||||
const uglyCenter = self.map.getCenter();
|
||||
|
|
|
@ -99,14 +99,11 @@ export default function PointSeriesChartProvider(Private) {
|
|||
const height = attr.height;
|
||||
const width = attr.width;
|
||||
const margin = attr.margin;
|
||||
const color = '#004c99';
|
||||
|
||||
// we don't want to draw endzones over our min and max values, they
|
||||
// are still a part of the dataset. We want to start the endzones just
|
||||
// outside of them so we will use these values rather than ordered.min/max
|
||||
const oneUnit = (ordered.units || _.identity)(1);
|
||||
const beyondMin = ordered.min - oneUnit;
|
||||
const beyondMax = ordered.max + oneUnit;
|
||||
|
||||
// points on this axis represent the amount of time they cover,
|
||||
// so draw the endzones at the actual time bounds
|
||||
|
|
|
@ -72,7 +72,6 @@ export default function AreaChartFactory(Private) {
|
|||
* @returns {D3.UpdateSelection} SVG with path added
|
||||
*/
|
||||
addPath(svg, layers) {
|
||||
const self = this;
|
||||
const ordered = this.handler.data.get('ordered');
|
||||
const isTimeSeries = (ordered && ordered.date);
|
||||
const isOverlapping = this.isOverlapping;
|
||||
|
@ -81,49 +80,49 @@ export default function AreaChartFactory(Private) {
|
|||
const yScale = this.handler.yAxis.yScale;
|
||||
const interpolate = (this._attr.smoothLines) ? 'cardinal' : this._attr.interpolate;
|
||||
const area = d3.svg.area()
|
||||
.x(function (d) {
|
||||
if (isTimeSeries) {
|
||||
return xScale(d.x);
|
||||
}
|
||||
return xScale(d.x) + xScale.rangeBand() / 2;
|
||||
})
|
||||
.y0(function (d) {
|
||||
if (isOverlapping) {
|
||||
return yScale(0);
|
||||
}
|
||||
.x(function (d) {
|
||||
if (isTimeSeries) {
|
||||
return xScale(d.x);
|
||||
}
|
||||
return xScale(d.x) + xScale.rangeBand() / 2;
|
||||
})
|
||||
.y0(function (d) {
|
||||
if (isOverlapping) {
|
||||
return yScale(0);
|
||||
}
|
||||
|
||||
return yScale(d.y0);
|
||||
})
|
||||
.y1(function (d) {
|
||||
if (isOverlapping) {
|
||||
return yScale(d.y);
|
||||
}
|
||||
return yScale(d.y0);
|
||||
})
|
||||
.y1(function (d) {
|
||||
if (isOverlapping) {
|
||||
return yScale(d.y);
|
||||
}
|
||||
|
||||
return yScale(d.y0 + d.y);
|
||||
})
|
||||
.defined(function (d) {
|
||||
return !_.isNull(d.y);
|
||||
})
|
||||
.interpolate(interpolate);
|
||||
return yScale(d.y0 + d.y);
|
||||
})
|
||||
.defined(function (d) {
|
||||
return !_.isNull(d.y);
|
||||
})
|
||||
.interpolate(interpolate);
|
||||
|
||||
// Data layers
|
||||
const layer = svg.selectAll('.layer')
|
||||
.data(layers)
|
||||
.enter()
|
||||
.append('g')
|
||||
.attr('class', function (d, i) {
|
||||
return 'pathgroup ' + i;
|
||||
});
|
||||
.data(layers)
|
||||
.enter()
|
||||
.append('g')
|
||||
.attr('class', function (d, i) {
|
||||
return 'pathgroup ' + i;
|
||||
});
|
||||
|
||||
// Append path
|
||||
const path = layer.append('path')
|
||||
.call(this._addIdentifier)
|
||||
.style('fill', function (d) {
|
||||
return color(d[0].label);
|
||||
})
|
||||
.classed('overlap_area', function () {
|
||||
return isOverlapping;
|
||||
});
|
||||
.call(this._addIdentifier)
|
||||
.style('fill', function (d) {
|
||||
return color(d[0].label);
|
||||
})
|
||||
.classed('overlap_area', function () {
|
||||
return isOverlapping;
|
||||
});
|
||||
|
||||
// update
|
||||
path.attr('d', function (d) {
|
||||
|
@ -165,7 +164,6 @@ export default function AreaChartFactory(Private) {
|
|||
* @returns {D3.UpdateSelection} SVG with circles added
|
||||
*/
|
||||
addCircles(svg, data) {
|
||||
const self = this;
|
||||
const color = this.handler.data.getColorFunc();
|
||||
const xScale = this.handler.xAxis.xScale;
|
||||
const yScale = this.handler.yAxis.yScale;
|
||||
|
|
|
@ -186,7 +186,6 @@ export default function LineChartFactory(Private) {
|
|||
* @returns {D3.UpdateSelection} SVG with paths added
|
||||
*/
|
||||
addLines(svg, data) {
|
||||
const self = this;
|
||||
const xScale = this.handler.xAxis.xScale;
|
||||
const yScale = this.handler.yAxis.yScale;
|
||||
const xAxisFormatter = this.handler.data.get('xAxisFormatter');
|
||||
|
@ -270,7 +269,6 @@ export default function LineChartFactory(Private) {
|
|||
const elWidth = this._attr.width = $elem.width();
|
||||
const elHeight = this._attr.height = $elem.height();
|
||||
const scaleType = this.handler.yAxis.getScaleType();
|
||||
const yMin = this.handler.yAxis.yMin;
|
||||
const yScale = this.handler.yAxis.yScale;
|
||||
const xScale = this.handler.xAxis.xScale;
|
||||
const minWidth = 20;
|
||||
|
|
|
@ -108,7 +108,7 @@ export default function MarkerFactory() {
|
|||
}
|
||||
self._showTooltip(feature);
|
||||
},
|
||||
mouseout: function (e) {
|
||||
mouseout: function () {
|
||||
self._hidePopup();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import _ from 'lodash';
|
||||
import L from 'leaflet';
|
||||
import VislibVisualizationsMarkerTypesBaseMarkerProvider from 'ui/vislib/visualizations/marker_types/base_marker';
|
||||
export default function GeohashGridMarkerFactory(Private) {
|
||||
|
@ -16,10 +15,6 @@ export default function GeohashGridMarkerFactory(Private) {
|
|||
constructor(map, geoJson, params) {
|
||||
super(map, geoJson, params);
|
||||
|
||||
// super min and max from all chart data
|
||||
const min = this.geoJson.properties.allmin;
|
||||
const max = this.geoJson.properties.allmax;
|
||||
|
||||
this._createMarkerGroup({
|
||||
pointToLayer: function (feature, latlng) {
|
||||
const geohashRect = feature.properties.rectangle;
|
||||
|
|
|
@ -155,9 +155,9 @@ export default function HeatmapMarkerFactory(Private) {
|
|||
showTip = true;
|
||||
}
|
||||
|
||||
const testScale = d3.scale.pow().exponent(0.2)
|
||||
.domain([1, 18])
|
||||
.range([1500000, 50]);
|
||||
d3.scale.pow().exponent(0.2)
|
||||
.domain([1, 18])
|
||||
.range([1500000, 50]);
|
||||
return showTip;
|
||||
};
|
||||
|
||||
|
@ -173,7 +173,6 @@ export default function HeatmapMarkerFactory(Private) {
|
|||
*/
|
||||
_dataToHeatArray(max) {
|
||||
const self = this;
|
||||
const mapData = this.geoJson;
|
||||
|
||||
return this.geoJson.features.map(function (feature) {
|
||||
const lat = feature.properties.center[0];
|
||||
|
|
|
@ -16,10 +16,6 @@ export default function ShadedCircleMarkerFactory(Private) {
|
|||
constructor(map, geoJson, params) {
|
||||
super(map, geoJson, params);
|
||||
|
||||
// super min and max from all chart data
|
||||
const min = this.geoJson.properties.allmin;
|
||||
const max = this.geoJson.properties.allmax;
|
||||
|
||||
// multiplier to reduce size of all circles
|
||||
const scaleFactor = 0.8;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue