Skip to content

Commit

Permalink
removing unused variables/imports
Browse files Browse the repository at this point in the history
  • Loading branch information
ppisljar committed Sep 8, 2016
1 parent 0b63b83 commit 9329501
Show file tree
Hide file tree
Showing 27 changed files with 46 additions and 92 deletions.
2 changes: 0 additions & 2 deletions src/ui/public/vislib/__tests__/lib/dispatch.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)();
Expand All @@ -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)();
Expand Down
2 changes: 0 additions & 2 deletions src/ui/public/vislib/__tests__/lib/handler/handler.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@

import angular from 'angular';
import ngMock from 'ng_mock';
import expect from 'expect.js';

Expand Down
1 change: 0 additions & 1 deletion src/ui/public/vislib/__tests__/vis.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import _ from 'lodash';
import d3 from 'd3';
import expect from 'expect.js';
import ngMock from 'ng_mock';

Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 0 additions & 2 deletions src/ui/public/vislib/__tests__/visualizations/column_chart.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@

import angular from 'angular';
import expect from 'expect.js';
import ngMock from 'ng_mock';
import _ from 'lodash';
Expand Down
4 changes: 1 addition & 3 deletions src/ui/public/vislib/components/tooltip/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
1 change: 0 additions & 1 deletion src/ui/public/vislib/lib/axis_title.js
Original file line number Diff line number Diff line change
@@ -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) {

Expand Down
1 change: 0 additions & 1 deletion src/ui/public/vislib/lib/chart_title.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
6 changes: 1 addition & 5 deletions src/ui/public/vislib/lib/data.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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') {
Expand Down Expand Up @@ -427,7 +425,6 @@ export default function DataFactory(Private) {
*/
getYMax(getValue) {
const self = this;
const arr = [];

if (self._attr.mode === 'percentage') {
return 1;
Expand Down Expand Up @@ -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)];
};

/**
Expand Down
3 changes: 0 additions & 3 deletions src/ui/public/vislib/lib/dispatch.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down Expand Up @@ -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() {
Expand Down
2 changes: 0 additions & 2 deletions src/ui/public/vislib/lib/handler/types/pie.js
Original file line number Diff line number Diff line change
@@ -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);

/*
Expand Down
1 change: 0 additions & 1 deletion src/ui/public/vislib/lib/handler/types/tile_map.js
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
})
Expand Down
1 change: 0 additions & 1 deletion src/ui/public/vislib/lib/layout/types/column_layout.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
1 change: 0 additions & 1 deletion src/ui/public/vislib/lib/layout/types/map_layout.js
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
1 change: 0 additions & 1 deletion src/ui/public/vislib/lib/layout/types/pie_layout.js
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
4 changes: 1 addition & 3 deletions src/ui/public/vislib/lib/resize_checker.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand Down
1 change: 0 additions & 1 deletion src/ui/public/vislib/lib/x_axis.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 0 additions & 1 deletion src/ui/public/vislib/visualizations/_chart.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
6 changes: 3 additions & 3 deletions src/ui/public/vislib/visualizations/_map.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -111,7 +111,7 @@ export default function MapFactory(Private, tilemap, $sanitize) {

return fitContainer;
},
onRemove: function (map) {
onRemove: function () {
$(fitContainer).off('click');
}
});
Expand Down Expand Up @@ -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();
Expand Down
3 changes: 0 additions & 3 deletions src/ui/public/vislib/visualizations/_point_series_chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
72 changes: 35 additions & 37 deletions src/ui/public/vislib/visualizations/area_chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions src/ui/public/vislib/visualizations/line_chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export default function MarkerFactory() {
}
self._showTooltip(feature);
},
mouseout: function (e) {
mouseout: function () {
self._hidePopup();
}
});
Expand Down
Original file line number Diff line number Diff line change
@@ -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) {
Expand All @@ -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;
Expand Down
7 changes: 3 additions & 4 deletions src/ui/public/vislib/visualizations/marker_types/heatmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand All @@ -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];
Expand Down
Loading

0 comments on commit 9329501

Please sign in to comment.