日記2024-12-26
patcon_ Hey @nishio this is so great! Mind if I get the link to the codebase? Trying to keep track of forks in https://patcon.github.io/polis-awesome and sharing on the Polis User Group discord, so that people can share more code and experience :)
@nishio これはとても素晴らしいです!コードベースへのリンクを取得してもよろしいですか?polis-awesomeでPolisのフォークを追跡し、ポリスユーザーグループのDiscordで共有して、人々がより多くのコードと経験を共有できるようにしています:)
patcon_ And FYI the folks at @codefornl are working on a fork of the API that cleans up the REST interface, but still talks to the old DB. The idea is to detach from the old frontend, and make front ends generally more pluggable:
Creating (a) new frontend(s) for Polis | sunweaver's NET
Awesome Polis
#civictech
参考までに、 @codefornl の人々は、RESTインターフェイスをクリーンアップするAPIのフォークに取り組んでいますが、まだ古いDBと通信しています。その考え方は、古いフロントエンドから切り離し、フロントエンドを一般的によりプラグ可能にすることです
nishio Thank you for information! Here is my report and open data for this project:
mielka/yoronchizu2024-data: Open Data: YoronChizu 2024
情報ありがとうございます!このプロジェクトの私のレポートとオープンデータは次のとおりです。
Detaching the frontend from DB and math server is very helpful!
フロントエンドをDBと数学サーバーから切り離すことは非常に役立ちます!
patcon_ Ah thank you so much! but I was also wondering about the fork of the http://pol.is codebase :) i saw that you at one point were pointing a script at a now hidden Polis API endpoint, so thought maybe you were involved in that with
ああ、どうもありがとう!しかし、pol.is コードベースのフォークについても疑問に思っていました:) ある時点で、今は隠されているPolis APIエンドポイントにスクリプトを指しているのを見たので、もしかしたらあなたが@Mielka_japanとともにそれに関与している?
nishio Our project was a demonstration during the election period, developed within a few weeks, so we didn’t have time to fork and rewrite the Polis code. The frontend was built using Next.js and D3.js, utilizing the Polis server’s API for data retrieval and voting.
私たちのプロジェクトは選挙期間中のデモであり、数週間で開発されたため、Polisコードをフォークして書き直す時間はありませんでした。フロントエンドはNext.jsとD3.jsを使用して構築され、データの取得と投票にはPolisサーバーのAPIを利用しています。
nishio The main objectives are to provide a user-friendly view for smartphone users and to make clusters more impactful by displaying party icons.
主な目的は、スマートフォン ユーザーにユーザーフレンドリーなビューを提供することと、政党 アイコンを表示することでクラスターのインパクトを高めることです。
patcon_ Ah gotcha! So to make sure I understand: you guys just scraped the /api/v3/participationInit endpoint of your self-hosted vanilla polis instance (using your record_api repo scripts), then built that data into your nextjs app that runs http://japanchoice.jp...
ああ、ガチャ! 私が理解したことを確認する:
あなたたちはあなたの自己ホストバニラポリスインスタンスの/api/v3/participationInitエンドポイントを(あなたのrecord_apiリポジトリスクリプトを使用して)スクレイピングし、そのデータを japanchoice.jp を実行するnextjsアプリに組み込みました?
nishio Yes, your understanding is correct that we used the participationInit endpoint of a self-hosted vanilla instance. The record_api was used to log data hourly for post-analysis purposes and wasn’t directly involved in the main functionality of the web service, but the mechanism is
はい、セルフホステッドバニラインスタンスのparticipationInitエンドポイントを使用したという理解は正しいです。このrecord_apiは、事後分析の目的でデータを時間ごとに記録するために使用され、Webサービスの主な機能には直接関与していませんでしたが、メカニズムは同じです。
patcon_ And that app borrows & customises some react components from the polis repo's client-participation viz, but that codebase is private at this time? Truly no pressure, but do you think your d3 customizations might be open sourced? (I am def not implying you need to, to be clear!)
また、そのアプリは polis リポジトリのクライアント参加型 Viz から一部の react コンポーネントを借用してカスタマイズしていますが、現時点ではそのコードベースは非公開です。本当にプレッシャーはありませんが、d3のカスタマイズはオープンソースになると思いますか?(明確にするために、私はあなたがそうする必要があるという意味ではありません!
patcon_ (And lastly, I assume the "party accounts" are just ones you operated yourselves in polis, and puppeted based on what your team agreed would likely be each party's responses? And I assume you ran tttc pieces periodically to generate group summaries? Sorry for all the Qs!)
(最後に、「政党アカウント」とは、ポリスで自分で操作したもので、チームが各パーティーの回答に同意したものに基づいて操られたものだと思いますか?そして、グループサマリーを生成するために定期的にtttcのピースを実行したと思いますか?すべてのQでごめんなさい!
nishio Thank you for your interest in our project! We welcome your questions and may update the README of the open data repository later on.
私たちのプロジェクトに興味を持っていただきありがとうございます!ご質問をお待ちしておりますので、オープンデータリポジトリのREADMEを後日更新するかも。
We didn't use the Polis client-side codebase at all. Our goal was to replace it with a mobile-friendly interface, and starting from scratch was easier than reusing the existing components. Since we already had a Next.js build process and components for other JAPAN CHOICE services, we leveraged those. This makes it challenging to decouple and share the code. We'll discuss with the team to see if there's anything we can share.
Polis のクライアント側のコードベースはまったく使用しませんでした。私たちの目標は、モバイルフレンドリーなインターフェースに置き換えることであり、既存のコンポーネントを再利用するよりもゼロから始める方が簡単でした。すでにJAPAN CHOICEの他のサービスにもNext.jsビルドプロセスやコンポーネントがあったので、それらを活用しました。これにより、コードを分離して共有するのが難しくなりました。チームと話し合って、何か共有できるものがないか確認します。
Regarding the "party accounts," those were opinion data we created based on each party's manifesto. Good point! We organized the data in a Google Spreadsheet, reviewed it collaboratively, and then used Microsoft Playwright for browser automation to input those into the Polis instance.
「政党アカウント」については、各政党のマニフェストに基づいて作成した意見データです。良い点です!Google スプレッドシートでデータを整理し、共同でレビューした後、Microsoft Playwright を使用してブラウザーを自動化し、Polis インスタンスにデータを入力しました。
As for generating group summaries, we took inspiration from TTTC but didn’t use it directly. Instead, we used ChatGPT to draft explanations. This process wasn't automated—humans used ChatGPT, reviewed the results by other people, and, once approved, updated the JSON data embedded in the service and deployed it.
グループサマリーの生成については、TTTCからインスピレーションを得ましたが、直接は使用していません。その代わり、ChatGPTを使って説明文を作成しました。このプロセスは自動化されておらず、人間がChatGPTを使用し、他の人が結果を確認し、承認されると、サービスに埋め込まれたJSONデータを更新してデプロイしました。
nishio Here was my memo on the development phase, using D3.js to create scatter plot and convex hull was quite easy!
これは開発フェーズのメモですが、D3.jsを使用して散布図と凸包を作成するのは非常に簡単でした。
d3.polygonHull
----
pPolis2024-10-29
日記2024-12-25←日記2024-12-26→日記2024-12-27
100日前 日記2024-09-17
1年前 日記2023-12-26