Files
superset2/superset/assets/visualizations/deckgl/layers/path.jsx
Maxime Beauchemin 45686a1af6 Multi layers DECK.GL visualization (#4096)
* Multi layers DECK.GL viz

* Fix tests

* rebasing

* Fix error handling in chartActions

* Addressing comments
2017-12-26 10:47:29 -08:00

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,
});
}