mirror of
https://github.com/apache/superset.git
synced 2026-06-07 16:49:17 +00:00
* Multi layers DECK.GL viz * Fix tests * rebasing * Fix error handling in chartActions * Addressing comments
20 lines
427 B
JavaScript
20 lines
427 B
JavaScript
import { PathLayer } from 'deck.gl';
|
|
|
|
export default function getLayer(formData, payload) {
|
|
const fd = formData;
|
|
const c = fd.color_picker;
|
|
const fixedColor = [c.r, c.g, c.b, 255 * c.a];
|
|
const data = payload.data.paths.map(path => ({
|
|
path,
|
|
width: fd.line_width,
|
|
color: fixedColor,
|
|
}));
|
|
|
|
return new PathLayer({
|
|
id: `path-layer-${fd.slice_id}`,
|
|
data,
|
|
rounded: true,
|
|
widthScale: 1,
|
|
});
|
|
}
|