-
Notifications
You must be signed in to change notification settings - Fork 0
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
Slow chrome issue #15
base: main
Are you sure you want to change the base?
Conversation
Reported on the Tech list; solution provided by David Newman. Thought it was worth recording here for future inclusion.
update javascript calls
Update javascript calls.. Update to UTF-8.
According to https://developers.google.com/chart/interactive/docs/basic_load_libs#update-library-loader-code the loader code in cfg.d/z_irstats2.pl should be changed as well. I'm just testing now on our repo and will report back. |
@mpbraendle - should the 'protocol' test should also be removed, and https always used for loading google charts loader? irstats2/cfg/cfg.d/z_irstats2.pl Lines 147 to 153 in 13c43a4
|
http://www.gstatic.com/charts/loader.js seems to work, too. So you could leave it in. I've tested so far on our repo and that works fine. |
Yes, @mpbraendle , the loader needs to be changed, along with the load calls. I made this fix on our repository and I haven't seen the failed loading of visualizations since. The failed loading isn't just slow, from my experience, they also fail sometimes, so they are not reliable as is. They worked sometimes. True, they worked more often in Firefox than Chrome, but it's not just a browser issue. I proposed my fix in a separate branch a few weeks ago: bbb8653 |
@photomedia - sorry, I didn't spot that branch! Is it worth submitting it as a pull request to replace this one? |
Hi everyone! I used a branch because I wanted my proposed changes to be reviewed. I submitted my fix (bbb8653) in June 2020 for review as a branch, and posted a message on the list about it. It is the first time that I make a submission of code to IRStats2, so I felt like it should be reviewed. @jesusbagpuss , I'm not sure how and if I should submit it as a pull request, given that there are concurrent fixes proposed (that may be the same or not). The important thing, I believe, is to update the loader code to the currently supported way of doing it, see: https://developers.google.com/chart/interactive/docs/basic_load_libs#update-library-loader-code |
Hi @jesusbagpuss and @photomedia , Are either of you around to comment on what you think will be the best path forward? This feels like a large enough fix we should look at doing a release to bazaar after, but lets cross that bridge once this problem is dealt with. |
I've just had a quick look at the differences between A 4-way diff made my head hurt. First questions - which is more correct (I'll try and find an answer to this - but if someone knows, please tell!):
|
Hi @jesusbagpuss, thanks for looking into this...
It looks like |
@jesusbagpuss, I agree with @wfyson, these are more correct:
In addition, I would add the following as important:
|
Hi all, I've been having another look at this and have been trying to work out all of the most pertinent bits of the various commits. Because this pull request and the different branches have got a bit complicated, my thinking is we just grab all the most pertinent bits from the various commits, add these to master in the and close the pull request without merging. With that in mind I've just made a new commit at 26ae544 which removes the protocol line (as suggested by @jesusbagpuss above) and I've updated the load statement a little as per @photomedia's suggestion. I've not included all of your changes @photomedia (i.e. those found in bbb8653) - when I tried implementing them they didn't seem to work nicely with all the different ways that graphs can be called by IRStats2. For example when rendering a graph on a summary page via a plugin, it didn't like the fact that google.charts.load wasn't called before google.charts.setOnLoadCallback. Maybe there was something I was missing, but I also can't see the harm in the current approach so hopefully that'll be ok? With the two commits (c1cd42d and 26ae544) I think all the main points are covered for this issue, but if anyone has a moment to review them that would be much appreciated! I've now increased the version to 1.1.3 too. |
@wfyson, sounds good to me, as long as it works, I have no issue :) There could be something slightly different in how I bring in the visualizations on summary pages; I remember that this wasn't enabled by default in the plugin when I installed it. Speaking of testing different use cases, did you check that it works for when there are multiple graphs on the screen at the same time? There are some screens like that, which display a small visualization and a larger one on the same page. |
NB definitely need to merge #17 and also resolve base_url issue before new release is packaged! |
@photomedia With regards to multiple graphs on the screen it should work but this depends on how you render them on screen, with the important thing being that each is passed a unique container_id that matches the id of a div on the page. I think there are two main approaches, you can either add the HTML and Javascript straight on the page, e.g. as part of the summary page citation. In which case you end up with something like this:
And then when you wanted to add another you just make sure your container_id for the next one matches a new div. The other main approach I think is to call it programmatically. In this case it'll depend on what parameters are passed on with $c->{irstats2}->{report} in z_irstats2.pl providing an example of this. Looking at how the reports are defined here, and then used in the context of View/KeyFigures.pm the ID seems to be taken from the metric parameter. (Apologies if you're already familiar with all this!) It seems to me the easiest approach is just to include the JS straight in the summary page! |
Hi @jesusbagpuss - oh yeah I quite agree that needs sorting before any sort of release. I wasn't planning on pushing to the Bazaar just yet! I'm just trying to get into the habit of making sure the epm/epmi stays up to date all the time! |
Based on post to EPTech (IRStats2: Slow in Chrome?) and proposed solution by David Newman.
Changes to Perl code have been tested.
Not all changes in the phrase files have been fully tested, although a cursory test appears OK.