Extension:Chart/Project/zh

2015年至2023年間,編輯者可以使用Graph擴充功能來視覺化整個維基媒體專案的資料。數十萬篇維基百科條目含有這些Graph圖表,以此來豐富文字為主的維基內容。2023年,Graph圖表出於安全原因遭停用。這讓編輯者們感到沮喪,因為讀者無法查看他們投入時間和精力創建的圖表。

維基媒體基金會與社群成員討論了Graph的未來,本專案就是這些討論的成果。我們正在建立一個新的、安全的工具,我們稱之為Chart,作為Graph擴充功能的後繼者。Chart將處理維基百科條目上的大多數簡單資料視覺化應用。如果基金會或社群開發者打算在未來使Chart能支援更多用例,Chart的建構方式將使其更容易實現。當編輯者開始使用新工具替換舊Graph圖表時,就表示我們成功了。

在2024–2025年度計畫中,Chart專案被列為維基經驗3.3關鍵結果

部署時間表

The extension will be rolled out to wikis incrementally. It is already available on a select list of pilot wikis. The focus for the next wave of availability will be on the remaining Wikipedias. The rollout will start with most Wikipedias, moving then to ones that were heavy Graph users, and ending with some of the largest ones. These dates are subject to change as we track issues and monitor system performance during the rollout.

階段 維基站點 日期 狀態
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)現在不再是優先事項。然而,儘管主要焦點將放在維基百科條目上,但Chart圖表將不限於主命名空間的頁面,並也將部署至維基百科以外的維基。
  • 易於使用:我們希望讓任何編輯者都能輕鬆直觀地創建Chart圖表。以前,新增和編輯Graph圖表相當困難。編輯者必須熟悉與Vega——支援Graph圖表的底層軟體——互動。因此,編輯者大多使用包含預先定義Vega代碼的模板來創建Graph圖表。雖然模板更方便使用者使用,但無法在不同維基重複使用。這次,不同類型的Chart圖表將由工具定義,並可在所有維基中使用。編輯者將能使用熟悉的wikitext格式新增Chart圖表,而不需要有關底層軟體的技術知識。這些變更將減少對模板的依賴,還能在不影響既有Chart圖表的情況下升級底層庫。
  • 架構:Chart圖表將在維基媒體基金會伺服器上使用開源資料視覺化庫進行渲染——將代碼轉換為視覺內容,該程式庫是從定義的來源提取的資料生成的。具體來說:
    • 在我們的伺服器渲染Chart圖表將加快頁面載入速度。 這還能避免我們在Graph擴充功能面臨的安全性問題。 這還將使Chart圖表能夠出現在行動應用程式、匯出和其他重複使用/離線情景中。
    • 在資料視覺化方面,將使用一個開源庫產生Chart圖表。該函式庫必須滿足我們的需求,例如支援不同語言、一定程度的互動性、能自訂顏色等。
    • 起初,Chart圖表只會有一個資料來源:維基共享資源Data命名空間頁面。這將使Chart圖表之間的資料重複使用變得容易,避免將資料內嵌在wikitext中造成的混亂。我們還將設計系統以支援將來新增更多資料來源。
  • 編者支援: 只有當編輯者將既有Graph代碼轉換為Chart並開始創建新圖表,專案才會成功。 我們將想方設法支援編輯者透過自動和手動流程轉換既有Graph圖表。 我們也將設法保留不太可能轉換為Chart的既有Graph圖表。 這可能意味著將其替換為靜態圖像,或將其用例轉至其他工具。

最新進展

2025年6月: Deployment to all wikis complete and Lua transforms now available

The Chart extension is now available on all Wikimedia wikis! Thanks to everyone who has been actively testing it out and suggesting further improvements. We encourage you to continue reporting any ideas you have or issues you encounter on the talk page or at phab:tag/charts.

Data filtering/transformations

It is now possible to use Lua modules to filter and transform tabular data for use in charts on testwiki and testcommons. This can be used for things like selecting a subset of rows or columns from the source data, converting between units, statistical processing, and many other useful transformations. More information on how to use transforms is available at Extension:Chart/Transforms , with an announcement to follow once it's available for use on Commons and other wikis.

What's next

As we enter the final month of the project, our top priority will be addressing any high priority bugs discovered now that charts are widely available. Since the task force working on the project is temporary, we’ll also be transitioning our focus to ensuring a smooth ownership handoff of the extension to the team who will be responsible for maintaining it going forward. In the next update, we’ll provide more details on what to expect for future development and how you can contribute.

人員

常見問題

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:圖表 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/zh