Open waldoj opened 6 years ago
Here's SQL that gets us 95% of the way there
SELECT CONCAT_WS(',', t1.legislator_id, t2.legislator_id) AS pair,
COUNT(*) AS number
FROM bills_copatrons AS t1
LEFT JOIN bills_copatrons AS t2
ON t1.bill_id=t2.bill_id
WHERE t1.legislator_id != t2.legislator_id
GROUP BY pair
Here's some helpful sample code.
can that query return csv? is that in the repo where i can run it and get the results?
i think i see this happening in video/clip.php
Unfortunately, the data provided in the repo doesn't include bills, just because that's a lot of data. I'm working on this in #209 — trying to figure out what minimum subset could be included to permit local testing.
Right now, there's no relevant code for this anywhere on the site — this is a notion of an entirely new page.
Create a force-directed graph (aka a "node diagram") illustrating the strength of relationships between legislators, using their co-patroning relationships. This is both a useful page for the site, but also a good start toward a related method: the legislators with whom a legislator most often co-patrons bills. That would be useful to include on each legislator's page.