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.
[Geo] Added DeckGL Arc Layer and Refactor on BaseDeckGL class (apache…
…#4134) * Added DeckGL.arc layer * added color controls * added stroke_width control * added process spatial key methods * change exception to ValueError * put location into tuple * reference global spatial keys array * linting * refactor on process_spatial_data_obj * rm whitespace * refactor arc.get_data * Revert "refactor arc.get_data" This reverts commit 8d01b2a. * add spatial controls array * refactor on spatial keys again :) * return altered df * Working refactor with deckGL Arcs * working arcs refactor :) * refactored all other deckGL viz types
- Loading branch information
1 parent
1f56dd1
commit 889b94f
Showing
7 changed files
with
163 additions
and
37 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { ArcLayer } from 'deck.gl'; | ||
|
||
export default function arcLayer(formData, payload) { | ||
const fd = formData; | ||
const fc = fd.color_picker; | ||
const data = payload.data.arcs.map(d => ({ | ||
...d, | ||
color: [fc.r, fc.g, fc.b, 255 * fc.a], | ||
})); | ||
|
||
return new ArcLayer({ | ||
id: `path-layer-${fd.slice_id}`, | ||
data, | ||
strokeWidth: (fd.stroke_width) ? fd.stroke_width : 3, | ||
}); | ||
} |
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