refactor(word-cloud): convert rotation and color controls to React components (POC) (#36275)

Co-authored-by: BrandanBurgess <brandanbb13@gmail.com>
This commit is contained in:
OrhanBC
2025-11-28 15:28:31 -05:00
committed by GitHub
parent c9a7a85159
commit d5c5dbb3bf
13 changed files with 863 additions and 22 deletions

View File

@@ -18,6 +18,7 @@
*/
import memoizeOne from 'memoize-one';
import React from 'react';
import { isControlPanelSectionConfig } from '@superset-ui/chart-controls';
import { getChartControlPanelRegistry, JsonObject } from '@superset-ui/core';
import type { ControlMap } from 'src/components/AlteredSliceTag/types';
@@ -56,6 +57,17 @@ const memoizedControls = memoizeOne(
config: JsonObject;
};
controlsMap[controlObj.name] = controlObj.config;
} else if (React.isValidElement(control)) {
const { name } = control.props as { name: string };
if (name) {
const ComponentType = control.type as React.ComponentType;
controlsMap[name] = {
type:
ComponentType.displayName ||
ComponentType.name ||
'CustomControl',
};
}
}
});
}