diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 51ccd02868901..d70b75772dec2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1092,7 +1092,6 @@ Note the `y_axis_format` is defined under various section for some charts. | `autozoom` | _N/A_ | | | `bar_stacked` | _N/A_ | | | `cache_timeout` | _N/A_ | | -| `charge` | _N/A_ | | | `clustering_radius` | _N/A_ | | | `code` | _N/A_ | | | `collapsed_fieldsets` | _N/A_ | | diff --git a/superset-frontend/src/explore/controlPanels/DirectedForce.js b/superset-frontend/src/explore/controlPanels/DirectedForce.js index e0fa572df29c8..db9a3d2ec485a 100644 --- a/superset-frontend/src/explore/controlPanels/DirectedForce.js +++ b/superset-frontend/src/explore/controlPanels/DirectedForce.js @@ -17,6 +17,7 @@ * under the License. */ import { t } from '@superset-ui/translation'; +import { formatSelectOptions } from '../../modules/utils'; export default { controlPanelSections: [ @@ -32,7 +33,34 @@ export default { }, { label: t('Options'), - controlSetRows: [['link_length'], ['charge']], + controlSetRows: [ + ['link_length'], + [ + { + name: 'charge', + config: { + type: 'SelectControl', + renderTrigger: true, + freeForm: true, + label: t('Charge'), + default: '-500', + choices: formatSelectOptions([ + '-50', + '-75', + '-100', + '-150', + '-200', + '-250', + '-500', + '-1000', + '-2500', + '-5000', + ]), + description: t('Charge in the force layout'), + }, + }, + ], + ], }, ], controlOverrides: { diff --git a/superset-frontend/src/explore/controls.jsx b/superset-frontend/src/explore/controls.jsx index 3f229a1d22842..18a90cff373f2 100644 --- a/superset-frontend/src/explore/controls.jsx +++ b/superset-frontend/src/explore/controls.jsx @@ -845,27 +845,6 @@ export const controls = { description: t('Link length in the force layout'), }, - charge: { - type: 'SelectControl', - renderTrigger: true, - freeForm: true, - label: t('Charge'), - default: '-500', - choices: formatSelectOptions([ - '-50', - '-75', - '-100', - '-150', - '-200', - '-250', - '-500', - '-1000', - '-2500', - '-5000', - ]), - description: t('Charge in the force layout'), - }, - granularity_sqla: { type: 'SelectControl', label: TIME_FILTER_LABELS.granularity_sqla,