Submit
Path:
~
/
/
usr
/
share
/
grafana
/
public
/
app
/
features
/
transformers
/
calculateHeatmap
/
File Content:
HeatmapTransformerEditor.tsx
import React, { useEffect } from 'react'; import { PanelOptionsEditorBuilder, PluginState, StandardEditorContext, TransformerRegistryItem, TransformerUIProps, TransformerCategory, } from '@grafana/data'; import { getTransformationContent } from '../docs/getTransformationContent'; import { getDefaultOptions, getTransformerOptionPane } from '../spatial/optionsHelper'; import { addHeatmapCalculationOptions } from './editor/helper'; import { HeatmapTransformerOptions, heatmapTransformer } from './heatmap'; // Nothing defined in state const supplier = ( builder: PanelOptionsEditorBuilder<HeatmapTransformerOptions>, context: StandardEditorContext<HeatmapTransformerOptions> ) => { const options = context.options ?? {}; addHeatmapCalculationOptions('', builder, options); }; export const HeatmapTransformerEditor = (props: TransformerUIProps<HeatmapTransformerOptions>) => { useEffect(() => { if (!props.options.xBuckets?.mode) { const opts = getDefaultOptions(supplier); props.onChange({ ...opts, ...props.options }); } }); // Shared with spatial transformer const pane = getTransformerOptionPane<HeatmapTransformerOptions>(props, supplier); return ( <div> <div>{pane.items.map((v) => v.render())}</div> </div> ); }; export const heatmapTransformRegistryItem: TransformerRegistryItem<HeatmapTransformerOptions> = { id: heatmapTransformer.id, editor: HeatmapTransformerEditor, transformation: heatmapTransformer, name: heatmapTransformer.name, description: heatmapTransformer.description, state: PluginState.alpha, categories: new Set([TransformerCategory.CreateNewVisualization]), help: getTransformationContent(heatmapTransformer.id).helperDocs, };
Edit
Rename
Chmod
Delete
FILE
FOLDER
INFO
Name
Size
Permission
Action
editor
---
0755
HeatmapTransformerEditor.tsx
1743 bytes
0644
heatmap.test.ts
2886 bytes
0644
heatmap.ts
16012 bytes
0644
utils.ts
2116 bytes
0644
N4ST4R_ID | Naxtarrr