File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -95,17 +95,17 @@ def forceatlas2_layout(
9595 pos , default = [np .nan ] * 2 , dtype = np .dtype (np .float32 , dim )
9696 )
9797
98+ # find, if there exists, the missing position values
9899 missing_vals = cp .isnan (start_pos_arr ).all (axis = 1 )
99100 num_missing = int (cp .count_nonzero (missing_vals ))
100101
102+ # fill in with valid random range
101103 if num_missing :
102- # get the min & max for X and Y
103104 xy_min = cp .nanmin (start_pos_arr , axis = 0 )
104105 xy_max = cp .nanmax (start_pos_arr , axis = 0 )
105-
106- # fill in missing default values with random initial positions
107106 seed = create_random_state (seed )
108107
108+ # fill missing gaps with valid random coords
109109 start_pos_arr [missing_vals ] = xy_min + cp .asarray (
110110 seed .rand (num_missing , 2 ), dtype = np .float32
111111 ) * (xy_max - xy_min )
You can’t perform that action at this time.
0 commit comments