Skip to content
Snippets Groups Projects
Commit 77cd3661 authored by Tom Robinson's avatar Tom Robinson
Browse files

Change lat/lon drill down to always just divide binWidth by 10

parent 85bf5619
Branches
Tags
No related merge requests found
......@@ -15,9 +15,10 @@ import { getIn } from "icepick";
// Helpers for defining drill-down progressions
const CategoryDrillDown = type => [field => isa(field.special_type, type)];
const DateTimeDrillDown = unit => [["datetime-field", isDate, unit]];
const LatLonDrillDown = binWidth => [
["binning-strategy", isLatitude, "bin-width", binWidth],
["binning-strategy", isLongitude, "bin-width", binWidth],
const LatLonDrillDown = (...args) => [
["binning-strategy", isLatitude, ...args],
["binning-strategy", isLongitude, ...args],
];
/**
......@@ -41,23 +42,26 @@ const DEFAULT_DRILL_DOWN_PROGRESSIONS = [
// CategoryDrillDown(TYPE.City)
],
// Country, State, or City => LatLon
[CategoryDrillDown(TYPE.Country), LatLonDrillDown(10)],
[CategoryDrillDown(TYPE.State), LatLonDrillDown(1)],
[CategoryDrillDown(TYPE.City), LatLonDrillDown(0.1)],
[
CategoryDrillDown(TYPE.Country), //
LatLonDrillDown("bin-width", 10),
],
[
CategoryDrillDown(TYPE.State), //
LatLonDrillDown("bin-width", 1),
],
[
CategoryDrillDown(TYPE.City), //
LatLonDrillDown("bin-width", 0.1),
],
// LatLon drill downs
[
LatLonDrillDown(binWidth => binWidth >= 20),
LatLonDrillDown(10),
LatLonDrillDown(1),
LatLonDrillDown(0.1),
LatLonDrillDown(0.01),
LatLonDrillDown("bin-width", binWidth => binWidth >= 20), //
LatLonDrillDown("bin-width", 10),
],
[
[
["binning-strategy", isLatitude, "num-bins", () => true],
["binning-strategy", isLongitude, "num-bins", () => true],
],
LatLonDrillDown(1),
LatLonDrillDown("bin-width", () => true), //
LatLonDrillDown("bin-width", previous => previous / 10),
],
// generic num-bins drill down
[
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment