forked from apache/superset
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added DeckGL.Polygon Layer w/ JS controls (apache#4227)
* Working polygon layer for deckGL * add js controls * add thumbnail * better description * refactor to leverage line_column controls * templates: open code and documentation on a new tab (apache#4217) As they are external resources. * Fix tutorial doesn't match the current interface apache#4138 (apache#4215) * [bugfix] markup and iframe viz raise 'Empty query' (apache#4225) closes apache#4222 Related to: apache#4016 * [bugfix] time_pivot entry got missing in merge conflict (apache#4221) PR here apache#3518 missed a line of code while merging conflicts with time_pivot viz * Improve deck.gl GeoJSON visualization (apache#4220) * Improve geoJSON * Addressing comments * lint * refactor to leverage line_column controls * refactor to use DeckPathViz * oops
- Loading branch information
1 parent
7953df6
commit 1356943
Showing
9 changed files
with
124 additions
and
1 deletion.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { PolygonLayer } from 'deck.gl'; | ||
|
||
import * as common from './common'; | ||
import sandboxedEval from '../../../javascripts/modules/sandbox'; | ||
|
||
export default function polygonLayer(formData, payload, slice) { | ||
const fd = formData; | ||
const fc = fd.fill_color_picker; | ||
let data = payload.data.features.map(d => ({ | ||
...d, | ||
fillColor: [fc.r, fc.g, fc.b, 255 * fc.a], | ||
})); | ||
|
||
if (fd.js_datapoint_mutator) { | ||
// Applying user defined data mutator if defined | ||
const jsFnMutator = sandboxedEval(fd.js_datapoint_mutator); | ||
data = data.map(jsFnMutator); | ||
} | ||
|
||
return new PolygonLayer({ | ||
id: `path-layer-${fd.slice_id}`, | ||
data, | ||
filled: fd.filled, | ||
stroked: fd.stoked, | ||
extruded: fd.extruded, | ||
...common.commonLayerProps(fd, slice), | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters