Skip to content

Commit

Permalink
[geo] add controls for minRadiusPixels and maxRadiusPixels in deck_sc…
Browse files Browse the repository at this point in the history
…atter (apache#4467)
  • Loading branch information
mistercrunch authored Feb 26, 2018
1 parent d57a37e commit 2932585
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
24 changes: 24 additions & 0 deletions superset/assets/javascripts/explore/stores/controls.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
1 change: 1 addition & 0 deletions superset/assets/javascripts/explore/stores/visTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,7 @@ export const visTypes = {
label: t('Point Size'),
controlSetRows: [
['point_radius_fixed', 'point_unit'],
['min_radius', 'max_radius'],
['multiplier', null],
],
},
Expand Down
2 changes: 2 additions & 0 deletions superset/assets/visualizations/deckgl/layers/scatter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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),
});
Expand Down

0 comments on commit 2932585

Please sign in to comment.