diff options
| author | Yasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com> | 2026-10-10 00:12:55 +0900 |
|---|---|---|
| committer | Yasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com> | 2026-10-10 00:12:55 +0900 |
| commit | 6851e84ab4ec749b2ffa9ee4546c4d9f639deaf1 (patch) | |
| tree | ab3bcc1513e2e2b21b547d20ab4101cea6182071 /src | |
| parent | 37da1bdd034f25f1ca792132116ffe420ceb61ca (diff) | |
sanpi: グラフを反対率の降順に並べ替え
Diffstat (limited to 'src')
| -rw-r--r-- | src/components/SanpiTable.astro | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/components/SanpiTable.astro b/src/components/SanpiTable.astro index 675d5a0..b6b4f26 100644 --- a/src/components/SanpiTable.astro +++ b/src/components/SanpiTable.astro @@ -117,11 +117,8 @@ return { group, yes: s.yes, no: s.no, total, rate: total ? s.yes / total : 0 }; }) .filter((row) => row.total > 0) - .sort((a, b) => { - if (a.group === ME_NAME) return -1; - if (b.group === ME_NAME) return 1; - return b.rate - a.rate || b.total - a.total || a.group.localeCompare(b.group, "ja"); - }); + // 反対の割合が高い順(=賛成率の低い順)。 + .sort((a, b) => a.rate - b.rate || b.total - a.total || a.group.localeCompare(b.group, "ja")); if (!rows.length) { host.hidden = true; @@ -131,7 +128,7 @@ const caption = document.createElement("p"); caption.className = "sanpi-chart-caption"; caption.textContent = - "市が提出した議案(請願・意見書・決議・条例制定・動議などの議員提出議案を除く)に対する、会派ごとの議員の賛成・反対の割合です。賛成の割合が高いほど与党寄り、低いほど野党寄りです。会派が分かれた場合は表の各列の票を1件として数えています。会派に合流している期間(中江美和議員のフォーラム、石津はるか議員の政和会)は、会派の票を個人に充当しています。件数が少ない会派は参考程度にご覧ください。"; + "市が提出した議案(請願・意見書・決議・条例制定・動議などの議員提出議案を除く)に対する、会派ごとの議員の賛成・反対の割合です。反対の割合が高い順に並べています。会派が分かれた場合は表の各列の票を1件として数えています。会派に合流している期間(中江美和議員のフォーラム、石津はるか議員の政和会)は、会派の票を個人に充当しています。件数が少ない会派は参考程度にご覧ください。"; const list = document.createElement("ul"); list.className = "sanpi-chart-list"; |
