mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
* Add node graph panel suggestion * Update logic * Add comment * Check for correct fields * Simplify logic * Also check for viz type * Remove extra logic on boolean
46 lines
1.3 KiB
TypeScript
46 lines
1.3 KiB
TypeScript
import { PanelPlugin } from '@grafana/data';
|
|
|
|
import { NodeGraphPanel } from './NodeGraphPanel';
|
|
import { ArcOptionsEditor } from './editor/ArcOptionsEditor';
|
|
import { NodeGraphSuggestionsSupplier } from './suggestions';
|
|
import { NodeGraphOptions } from './types';
|
|
|
|
export const plugin = new PanelPlugin<NodeGraphOptions>(NodeGraphPanel)
|
|
.setPanelOptions((builder, context) => {
|
|
builder.addNestedOptions({
|
|
category: ['Nodes'],
|
|
path: 'nodes',
|
|
build: (builder) => {
|
|
builder.addUnitPicker({
|
|
name: 'Main stat unit',
|
|
path: 'mainStatUnit',
|
|
});
|
|
builder.addUnitPicker({
|
|
name: 'Secondary stat unit',
|
|
path: 'secondaryStatUnit',
|
|
});
|
|
builder.addCustomEditor({
|
|
name: 'Arc sections',
|
|
path: 'arcs',
|
|
id: 'arcs',
|
|
editor: ArcOptionsEditor,
|
|
});
|
|
},
|
|
});
|
|
builder.addNestedOptions({
|
|
category: ['Edges'],
|
|
path: 'edges',
|
|
build: (builder) => {
|
|
builder.addUnitPicker({
|
|
name: 'Main stat unit',
|
|
path: 'mainStatUnit',
|
|
});
|
|
builder.addUnitPicker({
|
|
name: 'Secondary stat unit',
|
|
path: 'secondaryStatUnit',
|
|
});
|
|
},
|
|
});
|
|
})
|
|
.setSuggestionsSupplier(new NodeGraphSuggestionsSupplier());
|