mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Geomap: configure size and color with different fields (#36825)
This commit is contained in:
@@ -64,7 +64,7 @@ function getBooleanScaleCalculator(field: Field, theme: GrafanaTheme2): ScaleCal
|
||||
};
|
||||
}
|
||||
|
||||
function getMinMaxAndDelta(field: Field): NumericRange {
|
||||
export function getMinMaxAndDelta(field: Field): NumericRange {
|
||||
if (field.type !== FieldType.number) {
|
||||
return { min: 0, max: 100, delta: 100 };
|
||||
}
|
||||
|
||||
@@ -66,11 +66,15 @@ export function useFieldDisplayNames(data: DataFrame[], filter?: (field: Field)
|
||||
*/
|
||||
export function useSelectOptions(
|
||||
displayNames: FrameFieldsDisplayNames,
|
||||
currentName?: string
|
||||
currentName?: string,
|
||||
firstItem?: SelectableValue<string>
|
||||
): Array<SelectableValue<string>> {
|
||||
return useMemo(() => {
|
||||
let found = false;
|
||||
const options: Array<SelectableValue<string>> = [];
|
||||
if (firstItem) {
|
||||
options.push(firstItem);
|
||||
}
|
||||
for (const name of displayNames.display) {
|
||||
if (!found && name === currentName) {
|
||||
found = true;
|
||||
|
||||
Reference in New Issue
Block a user