JoshuaJADaniel commented on code in PR #36201:
URL: https://github.com/apache/superset/pull/36201#discussion_r2600597865
##########
superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Geojson/Geojson.tsx:
##########
@@ -169,6 +279,38 @@ export const getLayer: GetLayerType<GeoJsonLayer> =
function ({
processedFeatures = jsFnMutator(features) as ProcessedFeature[];
}
+ let pointType = 'circle';
+ if (fd.enable_labels) {
+ pointType = `${pointType}+text`;
+ }
+ if (fd.enable_icons) {
+ pointType = `${pointType}+icon`;
+ }
+
+ let labelOpts: Partial<GeoJsonLayerProps> = {};
+ if (fd.enable_labels) {
+ if (fd.enable_label_javascript_mode) {
+ const generator = sandboxedEval(fd.label_javascript_config_generator);
+ if (typeof generator === 'function') {
Review Comment:
If the user-provided function throws, `generator()` will return an error
object. In other words, there is no need to wrap this in a try/catch block.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]