VizGrimoire / VizGrimoireJS

Tools used to visualize VizGrimoireR output and other data formats
GNU General Public License v3.0
16 stars 7 forks source link

FilterItemsMiniCharts order changes when reloading the page #35

Closed sduenas closed 10 years ago

sduenas commented 10 years ago

When reloading a page that contains a list sorted elements (FilterItemsMiniCharts widget), the order of each entry can vary. For instance, one element on the position 3 after reloading can be in position 7.

I noticed this behavior in companies and domains pages.

ghost commented 10 years ago

For instance http://metrics.ceph.com/scm-companies.html 1

2

3

acs commented 10 years ago

Hi dachary,

I can't reproduce it. What browser are you using? You can reproduce it always, including the second reload when the JSON files are in web browser cache?

Thanks!

ghost commented 10 years ago

Using firefox 25 on ubuntu saucy. The problem does not show on the same machine using chromium. You need to have the .json URLs with a timestamp suffixed to prevent caching problems. http://metrics.ceph.com/data/json/newdream-scm-dom-evolutionary.json?1389917373 etc.

acs commented 10 years ago

I have firefox 26 ... testing it. If only fails the first time. All the next iterations, including removing all cache and closing firefox and starting it, work perfectly. I prefer to detect the problem and fix it, and not to use timestamps.

Great, with Opera browser I can reproduce the problem more easily. TIme to work in it!

ghost commented 10 years ago

I'm curious about how it was fixed ?

acs commented 10 years ago

I am sorry dachary, the details are in VizJS-lib. Take a look to:

https://github.com/VizGrimoire/VizGrimoireJS-lib/commit/2b3091e3a5af685c3f6dae44da4013f6e48d6ce5

The problem was the ordering in dictionaries ... dictionaries have no order, so the loop over a dictionary could change the order between executions. The fix is to use an array to loop and access later the data using the dictionary.

ghost commented 10 years ago

CooL thanks for the quick fix :-)

acs commented 10 years ago

Thank you guy for the report!!!