Extension:Chart/Project/ja

2015年から2023年にかけて、編集者はウィキメディアのプロジェクトのあちこちで、データの視覚化にグラフ拡張機能を利用してきました。文字ばかりが占めるウィキの内容に奥行きを持たせようと、これらのグラフは数万、数十万の記事で使われてきました。ところが、2023年に同拡張機能は、セキュリティ上の理由により、無効化されてしまいました。せっかく時間をかけて力を注いで作ったグラフが読者に閲覧してもらえないなんて、と編集者の不満は募るばかりでした。

ウィキメディア財団は、コミュニティのメンバーとグラフの今後について協議し、その成果として、このプロジェクトが始動しました。新たにセキュリティを確保したツールを開発中で、これをグラフ拡張機能の後継として、チャート(Chart)と呼んでいます。ウィキペディアの記事上でシンプルなデータを視覚化する大抵の場面には対応するだろうと見込んでいます。この新しいツールは、将来的に使用する場面が拡大してもサポートを追加しやすくなるように開発を進めようとしていますが、実際に対応するかどうかは、財団またはコミュニティの開発者の選択次第です。今後、編集者の皆さんが従来のグラフを新しいツールで書き換えるようなら、このプロジェクトは成功したといえるかもしれません。

2024–2025年次計画では、作図プロジェクトを Wiki 体験 3.3 の重要な成果と記載しています。

実装の日程

この拡張機能のウィキへの展開は段階的に実施します。 一部の先行ウィキではすでに利用可能になりました。 次に利用可能になる波及先は、未導入の各言語版ウィキペディアです。 展開はウィキペディアの大多数に続いて、グラフ重視のウィキペディアへ進み、最終段階で規模が最も大きいもので完了予定です。 これら日程は予定であり変更が発生するはずで、展開作業の間は問題の追及やシステムの稼働を監視して進めます。

フェーズ ウィキ 期間 状態
Pilot
  • ヘブライ語版ウィキペディア [he]
  • イタリア語版ウィキペディア [it]
  • スウェーデン語版ウィキペディア [sv]
  • MediaWiki
4 Dec 2024 Yes 完了
Phase 1 All Wikipedias except those listed in Phases 2 & 3 6–8 May 2025 Yes 完了
Phase 2
  • ロシア語版ウィキペディア [ru]
  • チェチェン語版ウィキペディア [ce]
  • タタール語版ウィキペディア [tt]
  • ウクライナ語版ウィキペディア [uk]
  • アルメニア語版ウィキペディア [hy]
  • バスク語版ウィキペディア [eu]
13–15 May 2025 Yes 完了
Phase 3
  • 英語版ウィキペディア [en]
  • フランス語版ウィキペディア [fr]
  • スペイン語版ウィキペディア [es]
  • ドイツ語版ウィキペディア [de]
20–22 May 2025 Yes 完了
Phase 4 All other non-Wikipedia wikis hosted by WMF 27–29 May 2025 Yes 完了

戦略

  • 読者の皆さん。ウィキペディアの読者のニーズに追従する形になります。ここで焦点を当てるのは、百科事典のコンテンツの強化に役立つデータ視覚化の最も一般的な用途です。つまり、たとえばPageViews(ページビュー数)のような記事以外での使用への対応は、現段階では優先事項ではありません。しかしながら、主な焦点はウィキペディアの記事での利用になるとしても、チャートの採用は標準名前空間内のページに限定されず、ウィキペディア以外のウィキでも利用可能になります。
  • 使い勝手の良さ。どんな編集者でも容易に直感的な操作でチャートを作れるようにしたいです。以前は、グラフを追加して編集するのは、かなり難しい操作でした。編集者は内部でグラフを動作させているVegaというソフトウェアを使いこなせる必要がありました。これが理由で、編集者は、あらかじめVegaのコードが定義されたテンプレートを利用して、ほとんどのグラフを作っていました。テンプレートはユーザーフレンドリーですが、ウィキをまたいで再利用することが容易ではありません。このたび、さまざまな種類のチャートが、新しいツールにより定義され、すべてのウィキで利用可能となる運びです。編集者は内部で動作するソフトウェアについての専門知識を必要とせず、慣れ親しんだウィキテキストの形式でチャートを追加することができるようになります。これらの変更により、テンプレートに頼る必要性が減少することに加え、既存のチャートを崩壊させることなく、内部のライブラリをアップグレードすることも可能となります。
  • Architecture. チャートは、ウィキメディア財団のサーバー上で、オープンソースのデータ視覚化ライブラリを利用して、定義されたソースから引っ張ってきたデータから生成され、(コードから視覚的な内容に変換されて)表示されます。より具体的には、
    • サーバ上でレンダリングするため、ページ読み込みが早くなるはずです。 またグラフ拡張機能に見られたセキュリティ問題も、回避できます。 さらにまたチャート類は記事をエクスポートしたりなどの再利用やオフラインでの利用方法などでも、モバイル版アプリでも表示できる予定です。
    • データの可視化において、チャート作成はオープンソースのライブラリを基準にします。このライブラリとは、多言語対応、ある程度の互換性、配色をカスタム化できることその他、要件を満たす必要があります。
    • まず最初に、作図用のデータソースは単一とします。ウィキメディア・コモンズにあるデータ名前空間に存在するページ群です。これにより図同士でデータの再利用が容易になり、データをいちいちウィキ文でインラインに埋め込む煩雑さを回避します。またシステム設計により、将来的にデータソースを増やすことにも対応できるようにします。
  • 編集者をサポート このプロジェクトの成功は、編集者の皆さんが既存のグラフのコードをチャートに変換してみて、新しいチャートが増えるかどうかにかかっています。 既存のグラフは、自動処理あるいは手動で変換する編集者へのサポート体制を探します。 チャートに変換は難しい既存のグラフ類は、保存する方法も探してみます。 これは言い換えるなら静的画像に置換する、もしくは使用例を別のツールに移行することになるかもしれません。

更新

メインのページ: Extension:Chart/Project/Updates

2025年6月: 全ウィキに導入を完了、Lua 形式への変換も利用可能

このグラフ(Chart)用の拡張機能は、ウィキメディアのすべてのウィキで運用中です。 テストに活発に参加され改良点を指摘された皆さんのおかげで実現できました。今後とも新しい発想あるいは問題点にぶつかったなど、トークページへの投稿もしくは phab:tag/chartsencounter 宛にご連絡をお待ちしています。

データのフィルタ/変換

testwiki ならびに testcommons では、Lua モジュールを使ってデータを絞り込んだり、表形式データをグラフ形式に変換できるようになりました。 応用例として表に対応するソースデータから特定の列もしくは行の部分だけ抽出したり、単位の変換、統計上の処理その他、データ加工に使えます。 変換の方法など詳細はExtension:Chart/Transformsを参照し、コモンズや他のウィキで使用できると告知が届いたら、そちらに従ってください。

次の段階

プロジェクト終了の月間に入りますので、グラフが広く利用できるようになった今、第一の優先課題はバグのうち緊急対応が必要なものをまとめることです。 このプロジェクトに取り組んできた臨時タスクフォースはその性格上、拡張機能の所有権を今後の管理を担当するチームに円滑に引き継ごうと注力していきます。次回の更新では、今後の開発の見通しと、皆さんにどう貢献してもらうか、情報をより詳しくお伝えする予定です。

担当者

よくある質問

What is the timeline of the project?

The Chart extension is now available on all Wikimedia wikis. This project is part of the FY24-25 annual plan and will conclude at the end of June 2025.

Which library will be used to render charts?

The Chart extension currently uses the Apache eCharts library. However, if there are unresolvable issues with eCharts, there is the possibility of switching to Vega (the library previously used for the Graphs extension). There is also the possibility of using eCharts for most chart types, but using a different library for certain specific chart types if it turns out to be much better than eCharts.

For details on why eCharts was chosen, and why Vega is considered the only reasonable alternative, see T368336#9971574.

What types of charts will be supported?

There will initially be a limited set of supported chart types: line, area, bar, and pie charts. The latest documentation is available on Extension:Chart page.

Where will chart definitions be stored? Where do I go if I want to edit a particular chart?

Chart definitions will live on their own .chart pages on Commons, under the Data: namespace. Charts will be treated as a standalone content type, rather than just as part of an article. It will be easy to reuse the same chart across wikis, and beyond Wikimedia platforms by making them available as links. Editors who want to embed charts in an article will be able to do so with a short piece of wikitext, similar to including an image from Commons, without needing to interact with complex templates.

One weakness of requiring that the data come from Commons tabular data is that data sourcing flows such as from MediaWiki APIs or Wikidata Query Service are not handled. While those sources are not the focus for this project, this project aims to design the extension in a way that they can be supported in the future.

How can volunteers add more chart types?

Once the initial infrastructure exists to create charts, technical volunteers will be welcome to contribute more chart types. In the meantime, you are encouraged to tell the developers what you think – which types of charts are most important to add next.

What will happen with the existing graphs?

For now, the existing graphs will remain in their current state. Some wikis have chosen to hide graphs entirely while others render a message explaining that graphs are disabled. Once it's possible to create charts that can replace graph uses, Chart extension developers will work with volunteers to start converting them so that readers can start to see them again.

It is unlikely that all graphs will be able to be converted to charts. For graphs that cannot be converted, it may be more beneficial to either: find an alternative tool to recreate the graph, convert the graph to a static image, or remove the graph altogether.

How to produce the charts efficiently?

There are several conceivable methods to semi-automatically produce and edit the charts and their tabular data:

  • The script graphDataImport can be used in the web browser to extract data from existing graph wikicode, and convert it to a .tab page, and a .chart definition page.
  • Generative AI can be prompted to extract data from existing graph wikicode and tables, and convert it to .tab and .chart pages and generate new wikicode, according to given specifications. It can also provide translation of titles, and be utilized to extend and update the .tab page with new data.
  • The gadget TabularImportExport can convert Excel and .csv files to and from the .tab pages. You can activate it via your Commons preferences.
  • The JSON "edit as table" user interface (part of the Jsonconfig extension) is available from the .tab edit page.
  • Some bots potentially can periodically import statistics from the web, or from existing Wikipedia graphs, to .tab or .chart pages, upon request. Such bots include GraphBot (which can import existing {{Graph:chart }} wikicode in English Wikipedia), DPLA bot and SLiuBot.

What templates and modules are available?

It should be possible to use extension:chart without a multitude of local templates and modules. However, here are some templates and modules that are related to this extension:

参加する

Category:WMF Projects/ja