How to load asynchronously a widget ?
Hey guys, I try to add a new widget to my dashboard using the
LineChart
, but the problem is about the time to perform the request... It take several seconds because we have a database with many millions of records.
Do you know if it exist a method to load that async?
Thanks28 Replies
It should be lazy loaded by default
As you can see on this video, the dashboard widgets are not loaded because the 3rd is a big query that take lot of time to load. @wyChoong
And btw, it's not async, because when I try to go back on "Organizations" page, it's just block the render until the request on Dashboard Widgets is not done.
Submit an issue on GitHub with repo
I UP this request for support.
You are the OP? 😅
What do you mean by "OP" ?
You opened this thread.
I'm just having a bug and it was automatically closed by the bot because of the inactivity of this thread. That's why I up.
Ah 😅
Yes I am the OP of this thread.
😄
I guess that's a limitation of wire:navigate?
hmm, i don't really know. to be honest it's a fresh filament project !
It's a Laravel Project where only filament is installed
I think they are loaded async, but are batched because of LW3
ahhh.. and do you know how can I avoid this limitation ?
Nope, sorry. Haven't really played with it yet
hmmm ok ok, what can be the "problem" ? Then I can probably try to search a solution on stackoverflow.. or if you can ping someone from the filament team that know this ? 😄
Because I don't really use Livewire, I'm more a pro-inertia
Was the an issue on GitHub with repo provided?
Maybe you can try make another 2 widgets not lazy
Could be related https://github.com/livewire/livewire/pull/7102
GitHub
add isolate parameter by eilerth · Pull Request #7102 · livewire/li...
Review the contribution guide first at: https://laravel-livewire.com/docs/2.x/contribution-guide
1️⃣ Is this something that is wanted/needed? Did you create a discussion about it first?
This is nee...
Caleb was working on an isolation feature that would allow you opt out of batching when needed. Not sure where he is on that feature though.
Ping him on the stream 😂
@awsqed @wyChoong Ok thanks you!
So you think that at this time there is no solution for that??
It's a problem that we cannot make graphs/charts on huge database, that's why charts are for :/
This doesn’t work for you?
If all 3 are slow, then there no solution for now
The best is to optimize your query or make a snapshot of result for your chart with queue job
It’s impossible to show live aggregated data with huge data anyways. Maybe redis can help but can’t advise
Here is the code of the ChartWidget, if you see something wrong??
Is there any indexes for those columns you used for order and group
Very unlikely as he’s using methods inside the query
@wyChoong which one ? created_at ? nop it's not indexed.