Skip to content

Commit 64adc3c

Browse files
committed
[layout] fix slow down and gravity definition on FA2
When guessing the parameters, it's value is usually a long float number. With a step of 1, it breaks the html validation of the number (waiting an integer and not a float). By using 'any' as step it fixes the issue. Same for gravity, which had a step of 0.01 to follow the guesssing, but manually you want increase it by one.
1 parent 0420b5a commit 64adc3c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/gephi-lite/src/core/layouts/collection/forceAtlas2.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export const ForceAtlas2Layout = {
5757
description: true,
5858
defaultValue: FA2_DEFAULT_SETTINGS.gravity,
5959
min: 0,
60-
step: 0.01,
60+
step: "any",
6161
required: true,
6262
},
6363
{ id: "linLogMode", type: "boolean", description: true, defaultValue: FA2_DEFAULT_SETTINGS.linLogMode },
@@ -74,7 +74,7 @@ export const ForceAtlas2Layout = {
7474
step: 1,
7575
required: true,
7676
},
77-
{ id: "slowDown", type: "number", defaultValue: FA2_DEFAULT_SETTINGS.slowDown, min: 1, step: 1 },
77+
{ id: "slowDown", type: "number", defaultValue: FA2_DEFAULT_SETTINGS.slowDown, min: 1, step:"any"},
7878
{ id: "strongGravityMode", type: "boolean", defaultValue: FA2_DEFAULT_SETTINGS.strongGravityMode },
7979
],
8080
} as WorkerLayout<ForceAtlas2LayoutParameters>;

0 commit comments

Comments
 (0)