improved nodeResizer example

This commit is contained in:
peterkogo
2024-01-30 12:32:02 +01:00
parent 7fbb245ecc
commit d5e21b0001
@@ -119,24 +119,37 @@ const initialNodes: Node[] = [
{
id: '5',
type: 'defaultResizer',
data: { label: 'Parent' },
data: { label: 'Parent', keepAspectRatio: true },
position: { x: 700, y: 0 },
style: { ...nodeStyle, width: 300, height: 300 },
style: { ...nodeStyle, width: 300, height: 400 },
},
{
id: '5a',
type: 'defaultResizer',
data: { label: 'Child' },
data: {
label: 'Child with extent: parent',
},
position: { x: 50, y: 50 },
parentNode: '5',
style: { ...nodeStyle },
extent: 'parent',
style: { ...nodeStyle, width: 50, height: 100 },
},
{
id: '5b',
type: 'defaultResizer',
data: { label: 'Child' },
position: { x: 100, y: 100 },
data: { label: 'Child with expandParent' },
position: { x: 150, y: 100 },
parentNode: '5',
expandParent: true,
style: { ...nodeStyle },
},
{
id: '5c',
type: 'defaultResizer',
data: { label: 'Child with expandParent & keepAspectRatio', keepAspectRatio: true },
position: { x: 25, y: 200 },
parentNode: '5',
expandParent: true,
style: { ...nodeStyle },
},
];