hrbrmstr/pewpew

China mode breaks

Opened this issue · 2 comments

Probably you are aware, but just in case... china_mode breaks after a while because slatlong and cnlatlong have different lengths.

Thank you for your work!

thx. prbly overhauling this to use WebGL this year.

Sorry, I'm not sure whether I explained it clearly before.
The problem I saw was simply because the arrays slatlong and cnlatlong, created from csv files, have different sizes.
You get a random src between 0 and slatlong length. Later, if china_mode is enabled, you try to access src index in cnlatlong.
Since samplatlong.csv has 2530 lines, while cnlatlong.csv only has 2519 lines, when src becomes greater than 2519 the indexation fails and the visualization hangs.
Obviously, you can avoid the problem simply making cnlatlong.csv's length greater than samplatlong.csv's one. Despite that, maybe src should be randomly obtained between 0 and cnlatlong's length when china_mode is enabled.
Not a big problem, but I thought I should note it.
If it was clear before, sorry for insisting.