electinth / election-live

Live Scoreboard for Thai General Election 2562 (2019)
https://elect.thematter.co/
MIT License
436 stars 145 forks source link

Implement filtering code for Landslide Winning zones #104

Open rapee opened 5 years ago

rapee commented 5 years ago

5. เขตที่ชนะขาด

เขตที่คะแนนของผู้สมัครอันดับ 1 ห่างจากอับดับ 2 เกิน 50%

This is a dynamic filter that filter zones depending on their performances.

image

unnawut commented 5 years ago

I'm trying out this issue. Will report back in 1-2 hours.

unnawut commented 5 years ago

Question: I looked at #22 and I suppose this filter should be derived the same way, so...

  1. The information should be derived from https://www.ect.go.th/ect_th/ewt_dl_link.php?nid=2236 ?
  2. The link above contains only the results separated by constituency seats and party list seats. Should I use either of them or combined?
  3. I guess there's already machine-readable data somewhere? 😅

Thanks!

unnawut commented 5 years ago

Looks like there's not enough information to derive this based on the available fixtures.

I'm backing down from this issue.

whs commented 5 years ago

I think this has to be implemented by filtering the live results?

Looking through src/models/ElectionDataSource.d.ts it seems that the only place where each candidate score is available is through PerProvinceJSON, which we can't use for filtering. There should be a server side filter to add this information to ZoneStats first

unnawut commented 5 years ago

You are right. I believe @phoneee is working on it.