Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion graphistry/layout/ring/categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,20 @@ def unique() -> List[Any]:

#print('axis', axis)

if play_ms != 0:
play_value = play_ms
elif 'play' in g._url_params:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks wrong - if 0 is set, we should respect it

I can imagine changing the type signature to : Optional[int] = 0, and having None mean "honor url param if already set, otherwise default to 0", but that feels unnecessarily complicated

play_value = g._url_params['play']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we parse the play value or make sure it has a valid format?

else:
play_value = 0

g2 = (
g
.nodes(lambda g: g._nodes.assign(x=x, y=y, r=r))
.encode_axis(axis_out)
.bind(point_x='x', point_y='y')
.settings(url_params={
'play': play_ms,
'play': play_value,
'lockedR': True,
'bg': '%23E2E2E2' # Light grey due to labels being fixed to dark
})
Expand Down
9 changes: 8 additions & 1 deletion graphistry/layout/ring/continuous.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,13 +248,20 @@ def ring_continuous(

#print('axis', axis)

if play_ms != 0:
play_value = play_ms
elif 'play' in g._url_params:
play_value = g._url_params['play']
else:
play_value = 0

g2 = (
g
.nodes(lambda g: g._nodes.assign(x=x, y=y, r=r))
.encode_axis(axis_out)
.bind(point_x='x', point_y='y')
.settings(url_params={
'play': play_ms,
'play': play_value,
'lockedR': True,
'bg': '%23E2E2E2' # Light grey due to labels being fixed to dark
})
Expand Down
Loading