question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

IMPORTANT: Autorun: run the algorithm and update the plots automatically without clicking on Run button

See original GitHub issue

This may include:

  • debounce run() calls
  • hide feature behind the checkbox, disabled by default

Issues:

  • formik does not allow to subscribe to the form state changes. It requires submit to be called
  • formik does not expose the form state. We currently grab the state in validation callback, which arguably, is a hack
  • formik seem to be re-rendering the entire form on changing any field. This is a performance problem - In automatic mode editing fields is very uncomfortable. There are ways to workaround it, but I don’t want to introduce any more workarounds.

Solutions:

  • Replace formik with redux-form? It will require quite substantial changes, for example reimplementing the validation.

I posted a cry for help in the Formik’s chat: https://spectrum.chat/palmer/formik/retrieve-values-without-submit-re-rendering-covid-19-scientists-need-help~d595a68c-2090-4a16-8a21-6f0772ff48e7

The following gif shows how on changing one value the entire form including mitigation plot is being re-rendered:

Peek 2020-03-16 20-55 mp4

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:16 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
gj262commented, Mar 24, 2020

Once the graphs are drawn interactivity with the form is impaired. And this is regardless of manual Run click or auto Run. Just focusing different form inputs is sluggish. Stepping the counters is v. sluggish.

I’d be interested if this is seen by others with the current production site.

0reactions
dkozarcommented, Apr 6, 2020

I’m playing with possible fix in this PR: https://github.com/neherlab/covid19_scenarios/pull/432/

(this is WIP, not polished yet)

The general idea is to keep latest params in memory (Singleton) during the debouncing period, and to allow components to fetch them when needed. Because sending them through the store causes re-rendering of everything.

Demo (test for comparison): https://covid19-scenarios-97ywlzg4y.now.sh/

Read more comments on GitHub >

github_iconTop Results From Across the Web

Autoruns for Windows - Sysinternals - Microsoft Learn
This utility, which has the most comprehensive knowledge of auto-starting locations of any startup monitor, shows you what programs are ...
Read more >
How to trigger form submit on change · Issue #1218 - GitHub
IMPORTANT : Autorun: run the algorithm and update the plots automatically without clicking on Run button neherlab/covid19_scenarios#17.
Read more >
Autorun a Python script on windows startup - GeeksforGeeks
Autorun a Python script on windows startup · Step #1: Adding script to windows Startup folder. After the windows boots up it runs...
Read more >
BioVinci User guide - BioTuring
Step 3: BioVinci has many examples that cover many common plots. Select the example of your interest, then click on the “Create” button....
Read more >
Cluster data using k-means algorithm in the Live Editor
To have the task run automatically after any change, select the autorun button at the top-right of the task.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found