Skip to content

Commit

Permalink
linter changes
Browse files Browse the repository at this point in the history
  • Loading branch information
crutan committed Oct 17, 2024
1 parent 512562a commit 2b6eac1
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions seed/static/seed/js/controllers/inventory_reports_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -478,16 +478,14 @@ angular.module('SEED.controller.inventory_reports', []).controller('inventory_re
$scope.scatterChart.options.scales.x.type = 'linear';

// Set the min / max for the axis to be the min/max values -/+ 0.5 percent
$scope.scatterChart.options.scales.x.min = Math.min(...$scope.chartData.chartData.map(d => d.x));
$scope.scatterChart.options.scales.x.min = $scope.scatterChart.options.scales.x.min - Math.round(Math.abs($scope.scatterChart.options.scales.x.min * 0.005));
$scope.scatterChart.options.scales.x.min = Math.min(...$scope.chartData.chartData.map((d) => d.x));
$scope.scatterChart.options.scales.x.min -= Math.round(Math.abs($scope.scatterChart.options.scales.x.min * 0.005));

$scope.scatterChart.options.scales.x.max = Math.max(...$scope.chartData.chartData.map(d => d.x));
$scope.scatterChart.options.scales.x.max = $scope.scatterChart.options.scales.x.max + Math.round(Math.abs($scope.scatterChart.options.scales.x.max * 0.005));
$scope.scatterChart.options.scales.x.max = Math.max(...$scope.chartData.chartData.map((d) => d.x));
$scope.scatterChart.options.scales.x.max += Math.round(Math.abs($scope.scatterChart.options.scales.x.max * 0.005));

if ($scope.xAxisSelectedItem.varName === 'year_built') {
$scope.scatterChart.options.scales.x.ticks.callback = (value, index, ticks) => {
return String(value);
}
$scope.scatterChart.options.scales.x.ticks.callback = (value) => String(value);
}
} else {
$scope.scatterChart.options.scales.x = {
Expand All @@ -496,9 +494,7 @@ angular.module('SEED.controller.inventory_reports', []).controller('inventory_re
};
}
if ($scope.yAxisSelectedItem.varName === 'year_built') {
$scope.scatterChart.options.scales.y.ticks.callback = (value, index, ticks) => {
return String(value);
}
$scope.scatterChart.options.scales.y.ticks.callback = (value) => String(value);
}
$scope.scatterChart.data.datasets[0].data = $scope.chartData.chartData;
// add the colors to the datapoints, need to create a hash map first
Expand Down

0 comments on commit 2b6eac1

Please sign in to comment.