mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Scenes: Panel repeater change (#61302)
* Update scene panel repeater by change in scenes package * Use latest scenes package * Fix package.json * lock update * Fix lock Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
This commit is contained in:
@@ -2,11 +2,12 @@ import {
|
||||
SceneFlexLayout,
|
||||
SceneTimeRange,
|
||||
SceneTimePicker,
|
||||
ScenePanelRepeater,
|
||||
SceneByFrameRepeater,
|
||||
VizPanel,
|
||||
SceneCanvasText,
|
||||
SceneToolbarInput,
|
||||
EmbeddedScene,
|
||||
SceneDataNode,
|
||||
} from '@grafana/scenes';
|
||||
|
||||
import { panelBuilders } from '../builders/panelBuilders';
|
||||
@@ -76,33 +77,41 @@ export function getScenePanelRepeaterTest(standalone: boolean): Scene | Embedded
|
||||
|
||||
const state = {
|
||||
title: 'Panel repeater test',
|
||||
body: new ScenePanelRepeater({
|
||||
layout: new SceneFlexLayout({
|
||||
body: new SceneByFrameRepeater({
|
||||
body: new SceneFlexLayout({
|
||||
direction: 'column',
|
||||
children: [
|
||||
new SceneFlexLayout({
|
||||
direction: 'row',
|
||||
placement: { minHeight: 200 },
|
||||
children: [
|
||||
new VizPanel({
|
||||
pluginId: 'timeseries',
|
||||
title: 'Title',
|
||||
options: {
|
||||
legend: { displayMode: 'hidden' },
|
||||
},
|
||||
}),
|
||||
new VizPanel({
|
||||
placement: { width: 300 },
|
||||
pluginId: 'stat',
|
||||
fieldConfig: { defaults: { displayName: 'Last' }, overrides: [] },
|
||||
options: {
|
||||
graphMode: 'none',
|
||||
},
|
||||
}),
|
||||
],
|
||||
}),
|
||||
],
|
||||
children: [],
|
||||
}),
|
||||
getLayoutChild: (data, frame, frameIndex) => {
|
||||
return new SceneFlexLayout({
|
||||
key: `panel-${frameIndex}`,
|
||||
$data: new SceneDataNode({
|
||||
data: {
|
||||
...data,
|
||||
series: [frame],
|
||||
},
|
||||
}),
|
||||
direction: 'row',
|
||||
placement: { minHeight: 200 },
|
||||
children: [
|
||||
new VizPanel({
|
||||
pluginId: 'timeseries',
|
||||
title: 'Title',
|
||||
options: {
|
||||
legend: { displayMode: 'hidden' },
|
||||
},
|
||||
}),
|
||||
new VizPanel({
|
||||
placement: { width: 300 },
|
||||
pluginId: 'stat',
|
||||
fieldConfig: { defaults: { displayName: 'Last' }, overrides: [] },
|
||||
options: {
|
||||
graphMode: 'none',
|
||||
},
|
||||
}),
|
||||
],
|
||||
});
|
||||
},
|
||||
}),
|
||||
$editor: new SceneEditManager({}),
|
||||
$timeRange: new SceneTimeRange(),
|
||||
|
||||
Reference in New Issue
Block a user