You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
If a chart requires heavy to calculate data, the whole page will be empty unless data calculate. This is how response of available cards looks like (for dashboard, UEL example /nova-api/dashboards/users):
Describe the solution you'd like
What Nova does with their default charts is to serialise meta data about the Metric and then associated vue component produces a request to fetch data for the Metric.
I tried to use LineChart is the same fashion:
finalclassMembershipLifetimeLIneChartextendsMetric/** This method is called by {@see \Laravel\Nova\Metrics\Metric::resolve} */
public function calculate(Request$request): \JsonSerializable
{
return LineChart::make()
->title($this->name())
->series([
[...
but it also requires to update vue components to support such behaviour: existing components can't parse metric metadata and then produce an API request.
Nova bug makes it even more important
For every request to a Metric, added to a dashboard, Nova calls public static function allAvailableDashboardCards(NovaRequest $request) that initialises all cards and metrics. In case of this package that means if you have 20 charts on a dashboard, Nova will initialise them 20*20 times. Of course, that means a lot of DB queries if you fetch info for charts from DB. Implementation of this feature will solve this problem: chart instantiation and calculation will be different processes
The text was updated successfully, but these errors were encountered:
I'm glad I saw this, thank you, I'll have to hold off on this package for now. I was wondering if this was the case given how the docs didn't suggest to build an object for each metric, but put it directly in the dashboard object itself...
Is your feature request related to a problem? Please describe.
If a chart requires heavy to calculate data, the whole page will be empty unless data calculate. This is how response of available cards looks like (for dashboard, UEL example
/nova-api/dashboards/users
):Describe the solution you'd like
What Nova does with their default charts is to serialise meta data about the Metric and then associated vue component produces a request to fetch data for the Metric.
I tried to use LineChart is the same fashion:
but it also requires to update vue components to support such behaviour: existing components can't parse metric metadata and then produce an API request.
Nova bug makes it even more important
For every request to a Metric, added to a dashboard, Nova calls
public static function allAvailableDashboardCards(NovaRequest $request)
that initialises all cards and metrics. In case of this package that means if you have 20 charts on a dashboard, Nova will initialise them 20*20 times. Of course, that means a lot of DB queries if you fetch info for charts from DB. Implementation of this feature will solve this problem: chart instantiation and calculation will be different processesThe text was updated successfully, but these errors were encountered: