diff --git a/superset/assets/javascripts/explore/stores/controls.jsx b/superset/assets/javascripts/explore/stores/controls.jsx index 22b8b3236..11b572a90 100644 --- a/superset/assets/javascripts/explore/stores/controls.jsx +++ b/superset/assets/javascripts/explore/stores/controls.jsx @@ -1848,6 +1848,30 @@ export const controls = { 'lower values are pruned first'), }, + min_radius: { + type: 'TextControl', + label: t('Minimum Radius'), + isFloat: true, + validators: [v.nonEmpty], + renderTrigger: true, + default: 2, + description: + t('Minimum radius size of the circle, in pixels. As the zoom level changes, this ' + + 'insures that the circle respects this minimum radius.'), + }, + + max_radius: { + type: 'TextControl', + label: t('Maximum Radius'), + isFloat: true, + validators: [v.nonEmpty], + renderTrigger: true, + default: 250, + description: + t('Maxium radius size of the circle, in pixels. As the zoom level changes, this ' + + 'insures that the circle respects this maximum radius.'), + }, + partition_threshold: { type: 'TextControl', label: t('Partition Threshold'), diff --git a/superset/assets/javascripts/explore/stores/visTypes.js b/superset/assets/javascripts/explore/stores/visTypes.js index 3135b2613..e81e7b815 100644 --- a/superset/assets/javascripts/explore/stores/visTypes.js +++ b/superset/assets/javascripts/explore/stores/visTypes.js @@ -648,6 +648,7 @@ export const visTypes = { label: t('Point Size'), controlSetRows: [ ['point_radius_fixed', 'point_unit'], + ['min_radius', 'max_radius'], ['multiplier', null], ], }, diff --git a/superset/assets/visualizations/deckgl/layers/scatter.jsx b/superset/assets/visualizations/deckgl/layers/scatter.jsx index 5022fbccd..087df3d7e 100644 --- a/superset/assets/visualizations/deckgl/layers/scatter.jsx +++ b/superset/assets/visualizations/deckgl/layers/scatter.jsx @@ -76,6 +76,8 @@ function getLayer(formData, payload, slice, inFrame) { id: `scatter-layer-${fd.slice_id}`, data, fp64: true, + radiusMinPixels: fd.min_radius || null, + radiusMaxPixels: fd.max_radius || null, outline: false, ...common.commonLayerProps(fd, slice), });