To be more exact, i've done some workaround. Here is my refresh function, that keeps nodes in their places in static layout:
function refresh() {
if(layout == 'static') {
chart.nodes().forEach(
function (e) {
e.data.x = e.x;
e.data.y = e.y;
}
);
}
chart.updateFilters();
if(layout == 'static') {
chart.paintNow();
chart.nodes().forEach(
function (e) {
//e.x = e.data.x;
//e.y = e.data.y;
chart.lockNode(e.id, e.data.x, e.data.y);
}
);
}
chart.updateStyle();
}
It works, but it add a small lag when nodes are disappearing.
Sorry for formatting.