nova-chartjs icon indicating copy to clipboard operation
nova-chartjs copied to clipboard

Hide from index

Open seoanalyze opened this issue 7 years ago • 11 comments

Hey, is it possible to hide the chart from the index of a resource? I have over thousand items in my resource model and the performance is very slow now

Thank you!

seoanalyze avatar Aug 14 '19 10:08 seoanalyze

Hi,

That's a nice suggestion. You can hide it from Index by adding ->hideFromIndex() if you are using NovaChartjs::make syntax, but right now there is no easy way to achieve this with InlinePanel. I will try to add this option to our next update.

Once again thanks a lot for pointing that out.

navneetrai avatar Aug 14 '19 11:08 navneetrai

Thank you, that works! But the loading time doesn't improve from hiding the chart from index. It seems that the process for generating the charts is runnig even though it's hidden

seoanalyze avatar Aug 19 '19 14:08 seoanalyze

@seoanalyze That is somewhat odd.. I tried the same thing at my end and it is not calling the Field's resolve method if it is hidden from Index. Infact even with adding it to Index the loadtimes are quite fast at my end.

Can you please check you dev tools to ascertain that whether removing NovaChartjs from resource is decreasing the load time?

BTW, our update with 'hideFromIndex' for Panel in almost ready. I will update this ticket once it is added to main branch

navneetrai avatar Aug 20 '19 12:08 navneetrai

Thank you for your quick answer and I'm really looking forward to the new release :)

When I remove the NovaChartjs my loading time is much faster. I uploaded some screenshots:

With NovaChartjs: https://www.wordpress-cologne.de/with.png

Without: https://www.wordpress-cologne.de/without.png

And my fields function inside my resource: https://www.wordpress-cologne.de/fields.png

seoanalyze avatar Aug 20 '19 13:08 seoanalyze

Hi, I have the same problem. Without NovaChartjs the loading time is 14 seconds and with it is 1,3 minutes. There are 4000 records in nova_chartjs_metric_values table.

mariuscirstea avatar Aug 20 '19 15:08 mariuscirstea

@mariuscirstea Even with 4000 records it should not take so long. I can understand a couple of seconds delay like @seoanalyze is facing, but this seems odd. I have tested with around 500 records without such issues. I will try to test with more records as well.

Can you please send me a screenshot like the ones send by seoanalyze (Specifically if there is any particular request which is taking a lot of time)

navneetrai avatar Aug 21 '19 13:08 navneetrai

@mariuscirstea Is this delay with or without removing Metric Values from Index? Also, are you facing a similar delay or detail page?

If you are displaying a lot of records together on Index, one possibility can be that Chartjs might be using a lot of resources to create charts for each record.

Typically for many records are there is each row?

navneetrai avatar Aug 21 '19 13:08 navneetrai

This is my nova fields method: Screen Shot 2019-08-21 at 16 46 44

When I removed NovaChartjs::make() Screen Shot 2019-08-21 at 16 49 02

This is with NovaChartjs::make() Screen Shot 2019-08-21 at 16 51 05

mariuscirstea avatar Aug 21 '19 14:08 mariuscirstea

The new version works like a charm. The speed is awesome and everything is like expected. Thank you so much! :)

seoanalyze avatar Sep 05 '19 12:09 seoanalyze

@seoanalyze Thanks for your valuable feedback. I have one for update in works which will further reduce query counts to absolute minimum I can achieve.

BTW, Yesterday we have the public release of our new package https://github.com/kirschbaum-development/nova-inline-relationship

If you are interested in Nova this might be really useful for you.

Regards.

navneetrai avatar Sep 05 '19 19:09 navneetrai

I've already saw the inline-relationship package. Absolutely awesome. Keep up your great work to make Nova much better :)

seoanalyze avatar Sep 05 '19 19:09 seoanalyze