Skip to content
Snippets Groups Projects
Commit 93c5dcb4 authored by Leonardo's avatar Leonardo
Browse files

fix: nl layout update on setting change

parent b3ce09fd
No related branches found
Tags v1.96.1
No related merge requests found
Pipeline #139014 passed
......@@ -88,7 +88,7 @@ export class GraphologyCircular extends GraphologyLayout {
super.layout(graph, boundingBox);
// To directly assign the positions to the nodes:
circular.assign(graph, {
scale: graph.order * graph.order,
scale: (graph.order * graph.order) / 10,
...this.defaultLayoutSettings,
});
}
......@@ -111,7 +111,7 @@ export class GraphologyRandom extends GraphologyLayout {
// To directly assign the positions to the nodes:
random.assign(graph, {
scale: graph.order * graph.order,
scale: (graph.order * graph.order) / 10,
...this.defaultLayoutSettings,
center: 0,
});
......
......@@ -932,7 +932,7 @@ export const NLPixi = forwardRef((props: Props, refExternal) => {
// force.simulation.on('tick', () => {});
app.ticker.add(tick);
layoutState.current = 'reset';
if (forceClear) setupLayout(forceClear);
if (forceClear || layoutAlgorithm.current.algorithm !== config.LAYOUT_ALGORITHM) setupLayout(forceClear);
}
};
......
......@@ -176,8 +176,6 @@ const NodelinkSettings = ({ settings, graphMetadata, updateSettings }: Visualiza
if (!settings.nodeList) return null;
settings = patchLegacySettings(settings);
return (
<SettingsContainer>
<div className="mb-4 text-xs">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment