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.

Add persistence to components

See original GitHub issue

Thanks for this great library. I enjoy the beautiful-styled controls and often use them in my projects. Lately I found out that Dash supports a convenient way to make user-data persistent by adding a persistence attribute. So a slider that keeps its data persistant now basically comes down to one line of code:

slider = dcc.Slider(id="slider_1", persistence=True, persistence_type="local")

This dramatically simplifies the cases where before one had to pass all user-values to a Store component. I would love to see this feature implemented in dash-daq components and also would be willing to contribute. What are your thoughts?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
stlehmanncommented, Apr 18, 2020

Is there a recommended build-system? I always get errors when using yarn start like described in the Readme. I tried it on Ubuntu and Mac OS with yarn 1.22.4 and npm 6.14.4.

$ copyfiles -u 1 lib/* dash_daq
Error with path src/components/ColorPicker.react.jsError: did not recognize object of type "ImportExpression"
Error: did not recognize object of type "ImportExpression"
    at Object.getFieldNames (/Users/stefan/Documents/070_Python/050_Forks/dash-daq/node_modules/ast-types/lib/types.js:701:19)
    at getSortedChildNodes (/Users/stefan/Documents/070_Python/050_Forks/dash-daq/node_modules/recast/lib/comments.js:50:23)
    at getSortedChildNodes (/Users/stefan/Documents/070_Python/050_Forks/dash-daq/node_modules/recast/lib/comments.js:63:9)
    at decorateComment (/Users/stefan/Documents/070_Python/050_Forks/dash-daq/node_modules/recast/lib/comments.js:73:22)
    at decorateComment (/Users/stefan/Documents/070_Python/050_Forks/dash-daq/node_modules/recast/lib/comments.js:84:13)
    at decorateComment (/Users/stefan/Documents/070_Python/050_Forks/dash-daq/node_modules/recast/lib/comments.js:84:13)
    at decorateComment (/Users/stefan/Documents/070_Python/050_Forks/dash-daq/node_modules/recast/lib/comments.js:84:13)
    at decorateComment (/Users/stefan/Documents/070_Python/050_Forks/dash-daq/node_modules/recast/lib/comments.js:84:13)
    at /Users/stefan/Documents/070_Python/050_Forks/dash-daq/node_modules/recast/lib/comments.js:129:9
    at Array.forEach (<anonymous>)
Error with path src/components/Slider.react.jsError: did not recognize object of type "ImportExpression"
Error: did not recognize object of type "ImportExpression"
    at Object.getFieldNames (/Users/stefan/Documents/070_Python/050_Forks/dash-daq/node_modules/ast-types/lib/types.js:701:19)
    at getSortedChildNodes (/Users/stefan/Documents/070_Python/050_Forks/dash-daq/node_modules/recast/lib/comments.js:50:23)
    at getSortedChildNodes (/Users/stefan/Documents/070_Python/050_Forks/dash-daq/node_modules/recast/lib/comments.js:63:9)
    at decorateComment (/Users/stefan/Documents/070_Python/050_Forks/dash-daq/node_modules/recast/lib/comments.js:73:22)
    at decorateComment (/Users/stefan/Documents/070_Python/050_Forks/dash-daq/node_modules/recast/lib/comments.js:84:13)
    at decorateComment (/Users/stefan/Documents/070_Python/050_Forks/dash-daq/node_modules/recast/lib/comments.js:84:13)
    at decorateComment (/Users/stefan/Documents/070_Python/050_Forks/dash-daq/node_modules/recast/lib/comments.js:84:13)
    at decorateComment (/Users/stefan/Documents/070_Python/050_Forks/dash-daq/node_modules/recast/lib/comments.js:84:13)
    at /Users/stefan/Documents/070_Python/050_Forks/dash-daq/node_modules/recast/lib/comments.js:129:9
    at Array.forEach (<anonymous>)

0reactions
stlehmanncommented, Aug 28, 2021

Hey, how did you resolve this issue? I am trying to build the library and these two files generate the same error for me. I was able to run the yarn dash-demo command or demo.py as I changed the Slider to Slider.Slider and ColorPicker to ColorPicker.ColorPicker but is there something I am missing that will generate these two files as well?

Actually I think I wasn’t able to build it on my own computer so I had to rely on CI to do building for me. 🤔

Read more comments on GitHub >

github_iconTop Results From Across the Web

Persisting State of Components | IntelliJ Platform Plugin SDK
The IntelliJ Platform provides an API that allows components or services to persist their state between restarts of the IDE.
Read more >
Persisting User Preferences & Control Values - Dash Plotly
Persistence is supported by dash-table and all the form-like components in dash-core-components . If you are a component author, it's easy to add...
Read more >
Persistent Components | Utilities Tools - Unity Asset Store
Use the Persistent Components from Broken Vector on your next project. Find this utility tool & more on the Unity Asset Store.
Read more >
Persistence for entity components
Component managed In this technique, you implement the code that reads and writes persistent data and maps the relational column values to fields...
Read more >
Persistence component settings | Adobe Customer Journey ...
Persistence is the ability for a given dimension value to relate to a metric beyond the event it is set on. It uses...
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