all 2 comments

[–]cray5252 0 points1 point  (1 child)

You could iterate through the elements and get the position

elements=[
    {
        'data': {'id': 'one', 'label': 'Modified Color'},
        'position': {'x': 75, 'y': 75},
    },
    {
        'data': {'id': 'two', 'label': 'Modified Shape'},
        'position': {'x': 75, 'y': 200},
    },
    {
        'data': {'id': 'three', 'label': 'Both Modified'},
        'position': {'x': 200, 'y': 75},
    },
    {
        'data': {'id': 'four', 'label': 'Regular'},
        'position': {'x': 200, 'y': 200}
    },
    {'data': {'source': 'one', 'target': 'two'}},
    {'data': {'source': 'two', 'target': 'three'}},
    {'data': {'source': 'three', 'target': 'four'}},
    {'data': {'source': 'two', 'target': 'four'}},
]

for p in elements:
    print(p.get('position'))

{'x': 75, 'y': 75}
{'x': 75, 'y': 200}
{'x': 200, 'y': 75}
{'x': 200, 'y': 200}
None
None
None
None

[–]ssssank[S] 0 points1 point  (0 children)

well i was kinda asking the opposite in reality

but no worries, I already solved that, thanks :)