ecomfe / echarts-gl

Extension pack for Apache ECharts, providing globe visualization and 3D plots.
BSD 3-Clause "New" or "Revised" License
2.59k stars 844 forks source link

Hovering doesn't work on the edge of the graph #324

Open goulashify opened 4 years ago

goulashify commented 4 years ago

Hey,

First of all, thanks for publishing this lib, it helps a lot, I have a slightly larger graph where the WebGL based force atlas implementation matters a lot, thanks for staying performant.

I ran into a small issue where hovering on the nodes at the edge of the graph seems broken, here is a video of it. The source code is here (data).

I'm not sure if I'm just missing something from the docs or if this is a legit bug, could somebody take a look please?

pissang commented 4 years ago

Hi @danigulyas I think it's a bug. Thanks for the detailed feedback.

goulashify commented 4 years ago

I tried to debug this the other day, it seems like it has to do something with this method, the hovering doesn't work because the element (even if there is one rendered at the coordinate) is for some reason not picked up.

When I was debugging, I felt like the picking stops working if the picked position is out of the circumference of some radius calculated from the center of the graph, like this:

Screenshot 2020-02-14 at 08 49 53

Here is a video of it, I don't get the math yet, do you think something like this might be possible @pissang?

goulashify commented 4 years ago

Worked a bit on this today, this is what seems to be happening:

When the mouse hits a node

  1. echarts detect the mousemove, dispatches an event
  2. LayerGL.onmousemove(e)
    1. uses LayerGL.pickObject(x, y) to select a node
    2. dispatches the event
  3. LayerGL._dispatchEvent(eveName, originalEvent, newEvent)
    1. iterates through the view hierarchy from the picked to the root object, the picked object itself has two event handlers (in order) for mousemove:
      1. PointsBuilder._updateHandler
      2. GraphGLView._mousemoveHandler
    2. passes the event to the view(s)
  4. ClayGL's notifier mixin calls the handlers in the objects and views

Inside LayerGL.pickObject(x, y)

  1. RayPicking.pickAll(x, y, output)
  2. RayPicking._intersectNode(node, out)
    1. checks for custom picking implementations, PointsMesh has one
  3. RayPicking._intersectRenderable(renderable, out)
    1. intersectRenderable checks that the positions are inside the scene, return if they aren't
    2. PointsMesh._pick(x, y, renderer, camera, renderable, out) is called

Now, what seems to be happening is the bounding box check in RayPicking._intersectRenderable(renderable, out) returns before the flow could get to PointsMesh._pick(x, y, renderer, camera, renderable, out), this gives this "out of circle" behavior, see video here.

In the end, there's either something with the bounding box that's passed or with Ray.intersectBoundingBox(bbox, out).

goulashify commented 4 years ago

Here's some data, coming from a breakpoint on this line from me moving my mouse around below:

// intersectBoundingBox(ray(direction, origin), bbox(min, max)) -> result
intersectBoundingBox(ray([0,0,-1], [1115.3480872361913, 879.9872823400933,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [1103.781973697213,  804.8075443367334,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [1103.781973697213,  764.3261469503082,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [1097.998916927724,  718.0616927943943,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [1097.998916927724,  683.3633521774591,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [1092.2158601582344, 642.8819547910339,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [1092.2158601582344, 619.7497277130772,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [1086.4328033887452, 602.4005574046093,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [1086.4328033887452, 585.0513870961415,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [1086.4328033887452, 573.485273557163,   0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [1086.4328033887452, 550.3530464792059,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [1080.6497466192561, 538.7869329402276,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [1080.6497466192561, 527.2208194012492,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [1080.6497466192561, 521.4377626317598,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [1080.6497466192561, 515.6547058622705,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [1080.6497466192561, 509.87164909278135, 0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> [1080.6497466192561, 509.87164909278135, -10]
intersectBoundingBox(ray([0,0,-1], [1092.2158601582344, 504.08859232329223, 0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> [1092.2158601582344, 504.08859232329223, -10]
intersectBoundingBox(ray([0,0,-1], [1115.3480872361913, 504.08859232329223, 0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> [1115.3480872361913, 504.08859232329223, -10]
intersectBoundingBox(ray([0,0,-1], [1306.1889606293373, 504.08859232329223, 0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> [1306.1889606293373, 504.08859232329223, -10]
intersectBoundingBox(ray([0,0,-1], [1751.4843318800101, 475.1733084758455,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> [1751.4843318800101, 475.1733084758455,  -10]
intersectBoundingBox(ray([0,0,-1], [2104.250794818854,  463.60719493686724, 0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [2370.27140621536,   463.60719493686724, 0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [2433.885030679742,  463.60719493686724, 0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [2468.583371296678,  463.60719493686724, 0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [2497.4986551441243, 463.60719493686724, 0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [2526.413938991571,  463.60719493686724, 0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [2549.5461660695273, 463.60719493686724, 0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [2601.5936769949312, 463.60719493686724, 0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [2630.5089608423777, 463.60719493686724, 0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [2653.6411879203342, 463.60719493686724, 0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [2705.688698845738,  463.60719493686724, 0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [2717.2548123847164, 457.8241381673779,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [2746.170096232162,  457.8241381673779,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [2769.3023233101194, 457.8241381673779,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [2792.434550388076,  457.8241381673779,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [2815.5667774660333, 457.8241381673779,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [2856.048174852458,  457.8241381673779,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [2879.1804019304154, 457.8241381673779,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [2896.529572238883,  457.8241381673779,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [2919.6617993168393, 457.8241381673779,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [2942.7940263947967, 457.8241381673779,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [2954.360139933775,  457.8241381673779,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [3000.624594089689,  457.8241381673779,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [3023.756821167647,  457.8241381673779,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [3041.1059914761136, 457.8241381673779,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [3064.23821855407,   457.8241381673779,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [3087.3704456320283, 457.8241381673779,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [3104.7196159404957, 463.60719493686724, 0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [3116.285729479474,  463.60719493686724, 0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [3145.2010133269205, 463.60719493686724, 0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [3156.7671268658987, 463.60719493686724, 0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [3168.333240404878,  463.60719493686724, 0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [3179.899353943855,  463.60719493686724, 0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [3191.4654674828353, 463.60719493686724, 0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [3203.0315810218135, 463.60719493686724, 0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [3191.4654674828353, 457.8241381673779,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [3179.899353943855,  457.8241381673779,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [3174.116297174367,  457.8241381673779,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [3168.333240404878,  457.8241381673779,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [3162.5501836353887, 457.8241381673779,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [3145.2010133269205, 457.8241381673779,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [3139.4179565574323, 457.8241381673779,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [3127.851843018452,  457.8241381673779,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [3122.068786248963,  452.0410813978888,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [3110.5026727099857, 452.0410813978888,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [3093.1535024015166, 452.0410813978888,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [3081.5873888625392, 452.0410813978888,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [3070.02127532356,   452.0410813978888,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [3046.8890482456036, 452.0410813978888,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [3041.1059914761136, 452.0410813978888,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [3017.973764398157,  452.0410813978888,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [3000.624594089689,  452.0410813978888,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [2965.926253472754,  452.0410813978888,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [2937.0109696253076, 446.2580246283994,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [2913.87874254735,   446.2580246283994,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [2884.9634586999045, 446.2580246283994,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [2856.048174852458,  446.2580246283994,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [2821.3498342355224, 446.2580246283994,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [2705.688698845738,  446.2580246283994,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [2682.55647176778,   446.2580246283994,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [2636.292017611866,  446.2580246283994,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [2595.810620225441,  446.2580246283994,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [2549.5461660695273, 446.2580246283994,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [2468.583371296678,  446.2580246283994,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [2428.101973910253,  446.2580246283994,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [2387.6205765238283, 452.0410813978888,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [2352.9222359068926, 452.0410813978888,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [2324.006952059447,  457.8241381673779,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [2295.0916682120005, 457.8241381673779,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [2266.176384364554,  457.8241381673779,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [2208.345816669661,  463.60719493686724, 0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [2173.6474760527253, 463.60719493686724, 0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [2144.732192205279,  463.60719493686724, 0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [2115.816908357833,  463.60719493686724, 0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [2057.98634066294,   463.60719493686724, 0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [2029.0710568154943, 463.60719493686724, 0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> [2029.0710568154943, 463.60719493686724, -10]
intersectBoundingBox(ray([0,0,-1], [2011.7218865070265, 469.39025170635637, 0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> [2011.7218865070265, 469.39025170635637, -10]
intersectBoundingBox(ray([0,0,-1], [1988.5896594290696, 469.39025170635637, 0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> [1988.5896594290696, 469.39025170635637, -10]
intersectBoundingBox(ray([0,0,-1], [1965.4574323511122, 469.39025170635637, 0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> [1965.4574323511122, 469.39025170635637, -10]
intersectBoundingBox(ray([0,0,-1], [1930.759091734177,  475.1733084758455,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> [1930.759091734177,  475.1733084758455,  -10]
intersectBoundingBox(ray([0,0,-1], [1913.4099214257092, 475.1733084758455,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> [1913.4099214257092, 475.1733084758455,  -10]
intersectBoundingBox(ray([0,0,-1], [1896.0607511172414, 475.1733084758455,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> [1896.0607511172414, 475.1733084758455,  -10]
intersectBoundingBox(ray([0,0,-1], [1872.9285240392844, 475.1733084758455,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> [1872.9285240392844, 475.1733084758455,  -10]
intersectBoundingBox(ray([0,0,-1], [1855.5793537308166, 480.95636524533506, 0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> [1855.5793537308166, 480.95636524533506, -10]
intersectBoundingBox(ray([0,0,-1], [1844.013240191838,  480.95636524533506, 0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> [1844.013240191838,  480.95636524533506, -10]
intersectBoundingBox(ray([0,0,-1], [1832.4471266528597, 480.95636524533506, 0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> [1832.4471266528597, 480.95636524533506, -10]
intersectBoundingBox(ray([0,0,-1], [1826.6640698833705, 480.95636524533506, 0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> [1826.6640698833705, 480.95636524533506, -10]
intersectBoundingBox(ray([0,0,-1], [1815.0979563443918, 480.95636524533506, 0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> [1815.0979563443918, 480.95636524533506, -10]
intersectBoundingBox(ray([0,0,-1], [1809.3148995749027, 480.95636524533506, 0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> [1809.3148995749027, 480.95636524533506, -10]
intersectBoundingBox(ray([0,0,-1], [1797.7487860359245, 486.7394220148242,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> [1797.7487860359245, 486.7394220148242,  -10]
intersectBoundingBox(ray([0,0,-1], [1791.9657292664344, 486.7394220148242,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> [1791.9657292664344, 486.7394220148242,  -10]
intersectBoundingBox(ray([0,0,-1], [1780.3996157274562, 486.7394220148242,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> [1780.3996157274562, 486.7394220148242,  -10]
intersectBoundingBox(ray([0,0,-1], [1774.616558957967,  486.7394220148242,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> [1774.616558957967,  486.7394220148242,  -10]
intersectBoundingBox(ray([0,0,-1], [1768.833502188478,  486.7394220148242,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> [1768.833502188478,  486.7394220148242,  -10]
intersectBoundingBox(ray([0,0,-1], [1763.0504454189884, 492.52247878431353, 0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> [1763.0504454189884, 492.52247878431353, -10]
intersectBoundingBox(ray([0,0,-1], [1728.3521048020527, 492.52247878431353, 0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> [1728.3521048020527, 492.52247878431353, -10]
intersectBoundingBox(ray([0,0,-1], [1676.3045938766497, 498.30553555380266, 0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> [1676.3045938766497, 498.30553555380266, -10]
intersectBoundingBox(ray([0,0,-1], [1647.3893100292032, 498.30553555380266, 0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> [1647.3893100292032, 498.30553555380266, -10]
intersectBoundingBox(ray([0,0,-1], [1630.0401397207359, 498.30553555380266, 0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> [1630.0401397207359, 498.30553555380266, -10]
intersectBoundingBox(ray([0,0,-1], [1601.1248558732893, 498.30553555380266, 0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> [1601.1248558732893, 498.30553555380266, -10]
intersectBoundingBox(ray([0,0,-1], [1595.3417991038002, 498.30553555380266, 0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> [1595.3417991038002, 498.30553555380266, -10]
intersectBoundingBox(ray([0,0,-1], [1583.7756855648215, 498.30553555380266, 0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> [1583.7756855648215, 498.30553555380266, -10]
intersectBoundingBox(ray([0,0,-1], [1583.7756855648215, 579.2683303266522,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [1583.7756855648215, 648.6650115605235,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null
intersectBoundingBox(ray([0,0,-1], [1583.7756855648215, 799.0244875672443,  0]), bbox([0.7593651413917542,0.021218599751591682,-10],[2047.2681884765625,513.910888671875,-10])) -> null

It looks like the coordinate of the ray is somehow outside the bounding box, maybe it's not corrected for the camera's transforms?

Pardon for the height.

goulashify commented 2 years ago

@pissang I figured out what this is, I was spot on above, it seems like the ray's location is outside graphGL's bounding box, this results in dropped picks. Either GraphGL's bounding box (right now seems to map window size) or the ray's location is incorrect (vastly outside the window's bounds in terms of pixels).

When I comment out the following three lines, picking works as expected:

if (bbox && !ray.intersectBoundingBox(bbox)) {
    return;
}
pissang commented 2 years ago

I think it's very possible the bounding box is incorrect

Gykonik commented 1 year ago

Did anyone find a solution? I'm still struggling with it, and it's pretty annoying :D

goulashify commented 1 year ago

@Gykonik: yeah, this sucks. I fixed this for myself, using echarts@5.2.2 and echarts-gl@2.0.8, see farnam.jazzware.io for a demo.

Diff between echarts-gl@2.0.8 and my version:

dani@skynet ~/d/p/i/f/s/s/assets (main)> diff echarts-gl-2.0.8-orig.js echarts-gl-2.0.8.js --ignore-all-space --ignore-blank-lines                                                               (base) 
13714,13716c13714,13718
<                                 if (bbox && !ray.intersectBoundingBox(bbox)) {
<                                     return;
<                                 }
---
>             // TODO(danigu): nasty fix, this may result in performance problems / etc.
>             // if (bbox && !ray.intersectBoundingBox(bbox)) {
>             //     return;
>             // }
> 

Hope I spared you some time. :)

Gykonik commented 1 year ago

Oh wow, that's so frustrating that this simple and stupid "fix" works :D

So you copied the .js and adapted it yourself? Because I use Angular and installed it with npm. So I'm not really sure how to adapt an angular package the easiest way. :)