Improvements to the polygon spatial viz (#6178)

* WIP

* WIP

* WIP

* WIP

* Fix color bucketing

* Fixed colors

* Fix no num categories selected

* Colors working

* Fix no metric selected

* Visual cues for selection

* Add unit tests

* Remove jest from deps

* Rename category to bucket

* Small fixes

* Fix lint

* Fix unit tests

* Remove duplicate hexToRGB

* Fix import

* Change order of arguments in getBuckets

* Refactor function signature
This commit is contained in:
Beto Dealmeida
2018-10-24 18:40:57 -07:00
committed by GitHub
parent ca5be1c1e2
commit f1089c40a4
17 changed files with 2372 additions and 42 deletions

View File

@@ -31,7 +31,7 @@ export function fitViewport(viewport, points, padding = 10) {
}
}
export function commonLayerProps(formData, onAddFilter, setTooltip) {
export function commonLayerProps(formData, setTooltip, onSelect) {
const fd = formData;
let onHover;
let tooltipContentGenerator;
@@ -64,8 +64,8 @@ export function commonLayerProps(formData, onAddFilter, setTooltip) {
const href = sandboxedEval(fd.js_onclick_href)(o);
window.open(href);
};
} else if (fd.table_filter && fd.line_type === 'geohash') {
onClick = o => onAddFilter(fd.line_column, [o.object[fd.line_column]], false);
} else if (fd.table_filter && onSelect !== undefined) {
onClick = o => onSelect(o.object[fd.line_column]);
}
return {
onClick,