mirror of
https://github.com/apache/superset.git
synced 2026-04-22 17:45:21 +00:00
[SIP-5] Remove references to slice from all deck.gl components. (#6039)
* start removing slice. * migrate arc * refactor arc * refactor path * refactor deck polygon * remove commented code * refactor factory function * refactor grid * refactor hex * refactor polygon * refactor scatter * refactor geojson * refactor screengrid * remove unnecessary nesting * add proptypes * add proptypes * refactor deck.gl Multi * fix lint * Use export syntax instead of module.exports
This commit is contained in:
committed by
Chris Williams
parent
5282f39026
commit
2a7b64fef5
@@ -1,7 +1,6 @@
|
||||
import React from 'react';
|
||||
import { fitBounds } from 'viewport-mercator-project';
|
||||
import d3 from 'd3';
|
||||
|
||||
import sandboxedEval from '../../../modules/sandbox';
|
||||
|
||||
export function getBounds(points) {
|
||||
@@ -32,7 +31,7 @@ export function fitViewport(viewport, points, padding = 10) {
|
||||
}
|
||||
}
|
||||
|
||||
export function commonLayerProps(formData, slice) {
|
||||
export function commonLayerProps(formData, onAddFilter, onTooltip) {
|
||||
const fd = formData;
|
||||
let onHover;
|
||||
let tooltipContentGenerator;
|
||||
@@ -49,13 +48,13 @@ export function commonLayerProps(formData, slice) {
|
||||
if (tooltipContentGenerator) {
|
||||
onHover = (o) => {
|
||||
if (o.picked) {
|
||||
slice.setTooltip({
|
||||
onTooltip({
|
||||
content: tooltipContentGenerator(o),
|
||||
x: o.x,
|
||||
y: o.y,
|
||||
});
|
||||
} else {
|
||||
slice.setTooltip(null);
|
||||
onTooltip(null);
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -66,7 +65,7 @@ export function commonLayerProps(formData, slice) {
|
||||
window.open(href);
|
||||
};
|
||||
} else if (fd.table_filter && fd.line_type === 'geohash') {
|
||||
onClick = o => slice.addFilter(fd.line_column, [o.object[fd.line_column]], false);
|
||||
onClick = o => onAddFilter(fd.line_column, [o.object[fd.line_column]], false);
|
||||
}
|
||||
return {
|
||||
onClick,
|
||||
|
||||
Reference in New Issue
Block a user