From 0061a3ebaf0e9470ec4892453e13874dacc9d7ff Mon Sep 17 00:00:00 2001 From: Evan Rusackas Date: Wed, 25 Mar 2020 19:20:52 -0700 Subject: [PATCH] Migrating unique DirectedForce controls (#9359) * migrating controls * Linting :sparkles: * oops... meant to pull this out in a conflict resolution. --- CONTRIBUTING.md | 1 - .../explore/controlPanels/DirectedForce.js | 30 ++++++++++++++++++- superset-frontend/src/explore/controls.jsx | 21 ------------- 3 files changed, 29 insertions(+), 23 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 51ccd0286..d70b75772 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 e0fa572df..db9a3d2ec 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 3f229a1d2..18a90cff3 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,