z.bali
Posts: 7
Joined: Wed Dec 15, 2021 11:01 am

Proj4 keep tracking the mouse

Hi everyone,
I m facing an issue that proj4 keep tracking the mouse over event in the other charts (No map charts) and that generate the following error:
"""
core.mjs:6485 ERROR TypeError: coordinates must be finite numbers
at z (node_modules\proj4\dist\proj4.js:1:14093)
at ns (node_modules\proj4\dist\proj4.js:1:34974)
at D (node_modules\proj4\dist\proj4.js:1:14449)
at U (node_modules\proj4\dist\proj4.js:1:15120)
at W (node_modules\proj4\dist\proj4.js:1:15679)
at m.a.transformToLatLon (map.js:59:103)
at d.projectedUnitsToLonLat (map.js:90:267)
at d.pixelsToLonLat (map.js:93:349)
at a.normalize (map.js:40:40)
at a.onContainerMouseLeave (highcharts.js:313:215)
"""
and this erro prevent the other charts (no map charts) tooltip from showing up
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: Proj4 keep tracking the mouse

Hello z.bali!
We appreciate you reaching out to us with your inquiry.

It is hard to tell you what is not working and what could be done without taking look at your code. Could you try to reproduce your problem in the online editor that I could work with? If you are using angular you can start here: https://stackblitz.com/edit/highcharts- ... with-proj4

This error means the values of coordinates are incorrect. Can you check if you are passing the correct values?
I am looking for your response.
Regards!
Hubert Kozik
Highcharts Developer
z.bali
Posts: 7
Joined: Wed Dec 15, 2021 11:01 am

Re: Proj4 keep tracking the mouse

Hello hubert.k,
thanks for your replay, the error comes from "highcharts": "^10.1.0" version, when I tried to reproduce the error with the dependencies you sent in the above link everything works fine, but when I changed the highcharts version to "^10.1.0", the error shows up again.
error link :https://stackblitz.com/edit/highcharts- ... ckage.json
NB: try to hove on the map then on the word cloud and check the console
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: Proj4 keep tracking the mouse

z.bali,

It seems that it is some kind of bug. Here is a related ticket on GitHub: https://github.com/highcharts/highcharts/issues/17192 You can add some comments or track the progress of this issue.

As a workaround for that moment, I suggest you use the map as TopoJSON instead of GeoJSON like in the demo below. There won't be any errors in the console after that quick fix.

Demo: https://stackblitz.com/edit/highcharts- ... oj4-joqqju

Let me know if that helps you!
Regards!
Hubert Kozik
Highcharts Developer
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: Proj4 keep tracking the mouse

z.bali,
My colleague has found a new workaround and using this you can use also GeoJSON files. You have to use a custom wrapper like in the demo below.

Demo: https://stackblitz.com/edit/highcharts- ... oj4-djuxcv

Best regards!
Hubert Kozik
Highcharts Developer
z.bali
Posts: 7
Joined: Wed Dec 15, 2021 11:01 am

Re: Proj4 keep tracking the mouse

Thanks hubert.k,
I wish I can convert my GeoJson to topoJSon, I have an edited map as GeoJSON I tried All online solutions to convert it to topoJson but always the generated topology isn't working
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: Proj4 keep tracking the mouse

z.bali, you're welcome! I remember your topic about converting GeoJSON to TopoJSON. Using a workaround with a custom wrapper you can use both files. Feel free to contact us again!
Hubert Kozik
Highcharts Developer
peezy
Posts: 3
Joined: Thu Oct 05, 2023 4:07 pm

Re: Proj4 keep tracking the mouse

Hey,

Can't seem to fix the below error. Have tried implementing the fix mentioned a few replies above using the customWrapper. A location chart is being used on the same page as a data chart. When you move your hover over from one chart to the next this bug shows up, but only when the chart type changes from a location based one to a data based one like a bar chart vs a map of the United Stats chart.

This kills all hover over tooltips on all charts once the error occurs. The tool tips work the first time for each type. It seems to only break when you go from a data chart to a map chart more than once. If you only hover over the data chart types, the tool tip always appears and the error never occurs.

Cannot figure out how to check the coordinates on local side.

coordinates must be finite numbers
checkCoord@static/js/bundle.js:165405:11
__WEBPACK_DEFAULT_EXPORT__@/static/js/bundle.js:165397:13
transform@/static/js/bundle.js:172364:59
transformer@static/js/bundle.js:166615:65
proj4@static/js/bundle.js:166660:12
./node_modules/highcharts/modules/map.js/</</a.prototype.transformToLatLon@static/js/bundle.js:156277:13
projectedUnitsToLonLat@static/js/bundle.js:157020:20
pixelsToLonLat@static/js/bundle.js:157088:21
normalize@static/js/bundle.js:155838:42
onContainerMouseLeave@static/js/bundle.js:144030:18
setHoverChartIndex@static/js/bundle.js:144259:37

....

I can post the rest of the exception if it is needed.

Thank you
jakub.s
Posts: 1164
Joined: Fri Dec 16, 2022 11:45 am

Re: Proj4 keep tracking the mouse

Hi @peezy,

You're absolutely right, this issue has not been solved yet. I've forwarded it to our Highcharts Core team.

The good news is, however, that the workaround provided by my collegue (https://stackblitz.com/edit/highcharts- ... mponent.ts) still solves this problem. Did you try this out?

If it does not work for you, could you please reproduce your problem with this workaround in an online code editor like JSFiddle/CodeSandbox?

Best regards!
Jakub
Highcharts Developer
peezy
Posts: 3
Joined: Thu Oct 05, 2023 4:07 pm

Re: Proj4 keep tracking the mouse

jakub.s wrote: Fri Oct 06, 2023 10:58 am Hi @peezy,

You're absolutely right, this issue has not been solved yet. I've forwarded it to our Highcharts Core team.

The good news is, however, that the workaround provided by my collegue (https://stackblitz.com/edit/highcharts- ... mponent.ts) still solves this problem. Did you try this out?

If it does not work for you, could you please reproduce your problem with this workaround in an online code editor like JSFiddle/CodeSandbox?

Best regards!
Hi Jakub,

Yes I have tried that solution, but we still get the error on check coordinates. It seems to be a little different stack that the organically posted error. Something in the hover over.

Thanks for getting back to me.
jakub.s
Posts: 1164
Joined: Fri Dec 16, 2022 11:45 am

Re: Proj4 keep tracking the mouse

Hi @peezy,

I've forwarded this issue to our Highcharts development team and (the good news is) they've added it to their backlog so a fix should hopefully be available in the next minor release.

If the issue #17192 is not the one you're experiencing, please try to reproduce it in an online code editor like JSFiddle or CodeSandbox so we could investigate it.

Best regards!
Jakub
Highcharts Developer
peezy
Posts: 3
Joined: Thu Oct 05, 2023 4:07 pm

Re: Proj4 keep tracking the mouse

jakub.s wrote: Mon Oct 09, 2023 7:13 am Hi @peezy,

I've forwarded this issue to our Highcharts development team and (the good news is) they've added it to their backlog so a fix should hopefully be available in the next minor release.

If the issue #17192 is not the one you're experiencing, please try to reproduce it in an online code editor like JSFiddle or CodeSandbox so we could investigate it.

Best regards!
Thanks guys. I think its the same error, at least its happening in the same method, checkCoordinates. Though how we both got there is a little different in the stack, just thought it would help out the dev team. Take care.

Return to “Highcharts Maps”