-
-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bringing Minicharts to dash-leaflet #116
Conversation
Really cool addition! Could you add a small example (in code) demonstrating the usage? |
I just tried it out. It works great! Here is the example i put together,
My only concern so far is that the addition of minicharts increases the bundle size a lot. Hence I think it would need to be loaded async before it can make in into a final release. |
Hey, yep good example 🙂 |
I haven't started on async loading in Dash leaflet yet, but it is on my TODO list. I'll give it a try and post an example when I get it working. |
I have implemented the async loading logic now. With my current setup, you would need to split the component into two files. One in the https://github.com/thedirtyfew/dash-leaflet/blob/master/src/lib/components/LocateControl.react.js and one in the https://github.com/thedirtyfew/dash-leaflet/blob/master/src/lib/fragments/LocateControl.react.js Next, add the chunk in And finally, add the chunks in https://github.com/thedirtyfew/dash-leaflet/blob/master/MANIFEST.in |
Should be working with lazy loading now 🙂 EDIT: I merged master into my branch to get the chunks structure but it looks like something's not right in the diff. Could be because I used rebase? EDIT2: Should be good now. |
It works perfectly! Thanks for a great PR. I have published a new release (0.1.21) that includes the |
Woohoo! Thanks :) FYI, I'm having issues with both versions 0.1.20 and 0.1.21 when I install them with pip. Something about dash-leaflet.dev.js missing? |
That's weird. have installed 0.1.21 my Ubuntu laptop, on Ubuntu via WSL, and on Heroku (for the interactive docs) all without problems.
What system are you on? Could you post the error you see? Is it a "clean" install or an upgrade of an existing environment? EDIT: I did change a lot during the async refactor, so it might be an introduced bug. I just haven't noticed it on my system(s). EDIT2: I might have found the bug. I am testing out a possible fix. |
Please try the 0.1.22 release. I believe it might fix your issue. |
Yep it works now! |
Hi, is this component still available? Thank you! |
No, it is not available in recent versions of dash-leaflet. |
Thanks for your answer. Is its implementation planned? |
I gave it a shot some time ago, when dash-leaflet was migrated to a recent version of Leaflet. However, it turned out that the minichart package is unmantained, and the latest version is not compatible with newer version of Leaflet. Hence, I would either have to fix the minichart component itself - or drop it from dash-leaflet; and I chose the latter. If someone else fixes the minichart component, I'll be happy to include it again :) |
Just adding a Minichart component which I believe would be a nice addition to dash_leaflet