IntegratedTransportPlanning / gcvt

Greener Connectivity Visualisation Tool
MIT License
2 stars 2 forks source link

Flow lines are not always drawn when selecting a zone #163

Open glipscombe opened 3 years ago

glipscombe commented 3 years ago

Some zones, when selected, don't display the flow lines when they should.

Example - when selecting zone 518 "Княжичі". Note that there are 49 trips coming from zone 252 and 736 coming from zone 124, but no lines are drawn.


Correct behaviour would look like this: image

But when you select a zone affected by this: image

Notice that on the zone that doesn't show lines, the red zone outline is drawn. In the version of the app this issue was found on, the red zone outline is hidden when flow lines are enabled, and it is only shown when the flow lines are disabled (see here for an illustration).

So could it be that the "toggle flow lines" feature is permanently disabled somehow for this zone (and the other zones affected by this)? Clicking the "toggle lines" button in the UI doesn't fix it, neither does manually changing the showClines=true in the URL manually.

Edit: just remembered that the scale bar always looks like this when you select a zone that's affected image

bovine3dom commented 3 years ago

We guess which flow lines to draw around here: https://github.com/IntegratedTransportPlanning/gcvt/blob/d0a02df90d88fd61f3f4039450fc0dc30c9ac384/src/frontend/js/index.js#L1212

If both bounds are zero we don't draw anything: https://github.com/IntegratedTransportPlanning/gcvt/blob/d0a02df90d88fd61f3f4039450fc0dc30c9ac384/src/frontend/js/index.js#L1213

The cut-off choosing code probably just needs some tweaking.

cmcaine commented 3 years ago

I think the top bound should just be the last element of sortedValues?

If that makes the display weird sometimes then we can clamp / scale the styles, not the original data.

cmcaine commented 3 years ago

We may also want to filter 0s out of sortedValues to start with so that we never show a line for zero flow.