Extension talk:Graph

From mediawiki.org

Embedded Graph shows completely white[edit]

Any idea why my graph - which renders fine on vega.github.io/editor - just renders completely white on my own mediawiki site, whilst the demo embedded graph here - Extension:Graph/Demo - embeds and renders fine on my site?

My vega json...

  "version": 2,
  "width": 200,
  "height": 100,

  "data": [
      "name": "table",
      "values": [
        {"C": -4,  "L": 0, "f":"Pre"}, {"C": 0,  "L": 3, "f":"Pre"}, 
        {"C": -4,  "L": 0, "f":"Post"}, {"C": 0,  "L": 4, "f":"Post"}

  "scales": [
      "name": "xscale",
      "type": "linear",
      "range": "width",
      "nice": true,
      "zero": true,
      "domain": {"data": "table", "field": "C"},
      "domainMax": 4,
      "domainMin": -4
      "name": "yscale",
      "type": "linear",
      "range": "height",
      "domain": {"data": "table", "field": "L"},
      "domainMax": 4,
      "domainMin": 0
      "name": "color",
      "type": "ordinal",
      "domain": {"data": "table", "field": "f"}

  "axes": [
    {"orient": "bottom", "scale": "xscale", "tickCount": 10 },
    {"orient": "left", "scale": "yscale", "tickCount": 5, "offset": { "signal": "-width / 2" } }

  "marks": [
      "type": "group",
      "from": {
        "facet": {
          "name": "series",
          "data": "table",
          "groupby": "f"
    "marks": [
      "type": "area",
      "from": {"data": "series"},
      "encode": {
        "enter": {
          "x": {"scale": "xscale", "field": "C" },
          "y": {"scale": "yscale", "field": "L"},
          "y2": {"scale": "yscale", "value": 0 }, 
          "fillOpacity": [{ "test": "indata('series', 'f', 'Pre')", "value": 0.3 }, {"value": 0}],
          "strokeWidth": [{ "test": "indata('series', 'f', 'Pre')", "value": 0 }, {"value": 2}],
          "fill": { "signal": "datum.C > 0 ? 'green': 'red'"},
          "stroke": { "signal": "datum.C > 0 ? 'green': 'red'"}

Doesn't seem to work here either? :s

But this one does:


No solution?[edit]

- It is blank for me as well, any jargon-free clear solution?

Block limitations[edit]

It seems that the block now is being spreaded to all width of content of the page. Thus in current page state it also covers the space above infobox and thus infobox's links to uncollapse hooks and the link to twn are unclicable. --Base (talk) 15:58, 29 September 2014 (UTC)Reply[reply]

Base, I am not sure what you mean. --Yurik (talk) 10:59, 18 May 2015 (UTC)Reply[reply]

Map distortion[edit]

Why is every continent except Africa & South America all squashed in the map tool? All this political correctness is going too far—Kelvinsong (talk) 21:23, 13 May 2015 (UTC)Reply[reply]

No idea what you mean - I am using a standard Mercator projection on top of a known file. If its incorrect, please find another topojson world map (size-optimized to 2nd floating digit), and upload. I don't think this has anything to do with PC :) --Yurik (talk) 10:49, 18 May 2015 (UTC)Reply[reply]
Kelvinsong: correction, the same map data can be used, you simply need to specify a different projection parameter. See example at de:template:Graph:Map. --Yurik (talk) 14:16, 20 January 2016 (UTC)Reply[reply]

2015-05-14 Tech talk notes[edit]

  • Word cloud is coming, needs to be deployed.
  • A separate Graph namespace turned out not be useful, because you can't put template stuff in a strict JSON file. It's better to make graphs as MediaWiki templates, where you can have headings and additional info outside the <graph> tag, and template expansion within it.
  • en:User:Milimetric/MinardNapoleon is a famous graph recreated using uwdata's lyra to generate the JSON for Vega graph description.
  • no standards for graph layout, we need lots of MediaWiki templates for standard graph types, Lua modules for typical transformations, etc.
  • All API calls return JSON. Problem is we don't let Graph extension/Vega run arbitrary JavaScript transforms on-wiki. Meanwhile Lua modules on-wiki can do data transforms, but are not able to make API call (yet).
  • Slides from the talk are here

-- SPage (WMF) (talk) 21:23, 14 May 2015 (UTC)Reply[reply]

Made a few minor corrections. --Yurik (talk) 10:51, 18 May 2015 (UTC)Reply[reply]


@SPage (WMF) and Yurik (WMF): : Hello, as this function was originally deployed it allowed a certain level of visually appealing interactivity when hovering over items. This is still the case for me when I go directly to Extension:Graph/SampleGraph. However, it is no longer true when I use a graph anywhere else on-wiki. Specifically, in this week's Signpost the hover trigger was working correctly when the story was being drafted, but broke sometime before publication. I have checked with some other editors and they report the same.

The interactivity is what makes the extension in the first place—static data can be represented only very slightly worse with images. Resident Mario (talk) 05:05, 17 May 2015 (UTC)Reply[reply]

The hover only works when the graph is rendered on the client. Sadly, this was very slow, since it required MediaWiki to download d3 and vega libraries, plus all the external data needed by the graph. This could be over 1MB uncompressed. Instead, now graphs are rendered on the server, which makes them significantly faster, but do not allow for the hover effect. The power of graphs is not in their hover effect, which is a sugar coating. The power is in the fact that now you can have data stored on wiki, and update that data at any point to update the graph. You never need to generate maps or graphs in a 3rd party program like Draw/Excel/OpenOffice/etc and upload the results - if you do that, no one else except the original author can easily modify the picture - they would have to recreate the whole source file. Now, anyone can change the source of data for the map/graph to reflect the change. --Yurik (talk) 10:58, 18 May 2015 (UTC)Reply[reply]
@Yurik (WMF): Sugar-coating? Yes; perhaps. But it's important sugar-coating because it introduced an entirely new element of interactivity, however surface, into Wikipedia software, and so I am very sad to see it gone. It felt like something fresh and new, but now that feeling is lost to me... Resident Mario (talk) 04:50, 21 May 2015 (UTC)Reply[reply]
@Resident Mario: "hover effect" is only sugar coating. BUT, fear not, something much bigger is in the pipeline - take a look at the interactive examples of Vega 2 in http://vega.github.io/ - I plan to bring them over fairly soon, most likely in the "click to play" mode - you see a static image, you click on it, and it turns into an interactive graph, which will also have hover effect ;) --Yurik (talk) 09:32, 21 May 2015 (UTC)Reply[reply]
Oooooh! That is really something! Resident Mario (talk) 01:44, 22 May 2015 (UTC)Reply[reply]
@Yurik: If the issue is speed, perhaps it would be possible to first load just the simple image, and then automatically replace it later with the full interactive graph after the full set of libraries and data load? And maybe that could also be used for real interactivity, instead of the "play" buttons currently shown in the demos? --Yair rand (talk) 06:13, 20 January 2016 (UTC)Reply[reply]
@Yair rand: the play button simply indicates that the graph is interactable - you can drag things around, hover over elements, etc. Play button is the closest to the "interactable" icon I could think of. And yes, show the image + load the data afterwards automatically has been considered - perhaps we could make it an option for the users for now, I just feel it is a bit wasteful bandwidth wise, especially on the mobile devices. Still on the fence on this one. Please consider filing a task in phab: - this way we can track and discuss it there. Thanks! --Yurik (talk) 14:12, 20 January 2016 (UTC)Reply[reply]
Done: Phab:T124254. --Yair rand (talk) 00:01, 21 January 2016 (UTC)Reply[reply]

Image marks only working in preview[edit]

Well, subj! Graphs with images work perfectly well in preview, but break the extension after saving. It seems to be entirely graphoid's fault.
E.g. en:User:Primaler/Graphs#Films based on comics:

  • preview mode uses canvas and shows the two graphs with images,
  • but in regular mode graphoid throws a 503.

Primaler (talk) 23:19, 21 May 2015 (UTC)Reply[reply]

@Primaler: , thanks for reporting! One thing to note - phabricator is a much better way to report bugs - more people will notice. I created phab:T99994 --Yurik (talk) 02:45, 22 May 2015 (UTC)Reply[reply]
@Primaler: the image issues have been fixed, please take a look, and also check vega2 on demo page. --Yurik (talk) 14:14, 20 January 2016 (UTC)Reply[reply]

Image paths[edit]

On a related note, Graph only works with static image urls. So, in the example above one of the urls looks like this: "http://upload.wikimedia.org/wikipedia/commons/thumb/8/8c/Det_Radikale_Venstre_logo.svg/200px-Det_Radikale_Venstre_logo.svg.png".
This is — how should I put it — not ideal %)
What is the intended work-around?
Oh! On pressing google a bit harder, I've just found the filepath keyword, substituting that awful url for "{{filepath:Det Radikale Venstre logo.svg|200}}". Magic words are scary, so enwiki also has a wrapper template: "{{thumbpath|Det Radikale Venstre logo.svg|200}}".
Still, this trick would not work e.g. for paths stored in a separate csv file. And with function transform understandably disabled, one would probably need to resort to some Lua magic (as if wikitext and json were not enough for one task).
On the other hand, the extension only works with local data anyway. May be you could enable automatic filepath extraction server-side, then? Semantics-wise, it would certainly be in keeping with how most other image-related features work here.
Primaler (talk) 01:28, 22 May 2015 (UTC)Reply[reply]

@Primaler: , not exactly sure of how to solve this best. I was contemplating custom protocols, e.g. article://Article_name, but haven't really thought about images yes. Please add a task to the phabricator - this way everyone interested in graphs can discuss it and come up with a good solution. Thx! --02:53, 22 May 2015 (UTC)

Please help with a grouped bar chart[edit]

Hi, I have looked at Lyra, but I don't know how to approach this kind of bar chart layout. Would someone please help? I am guessing it has to be done outside Lyra, but I can't see how from the tutorial or [1], either. EllenCT (talk) 16:43, 24 May 2015 (UTC)Reply[reply]

There is a very similar "grouped_bar" example here. Primaler (talk) 20:46, 24 May 2015 (UTC)Reply[reply]
Fixed link (a little trick there :). --Yurik (talk) 21:47, 24 May 2015 (UTC)Reply[reply]
Thank you both. I was having trouble earlier because I couldn't find http://trifacta.github.io/vega/data/groups.json (why is it in vega/data instead of vega/editor/data?) and I would still like to know how to make it horizontal. EllenCT (talk) 04:55, 27 May 2015 (UTC)Reply[reply]

Wikilink in graph[edit]

Is possible to insert wikilinks in graphs header or legend labels ?--Moroboshi (talk) 07:39, 21 July 2015 (UTC)Reply[reply]

Not at this point. I am still thinking of how to do it better, or if at all (you can already use html tricks to overlay the image with a clickable map or link). Once we have interactive graphs, there might be some clickability there, but again, it will need to be discussed. I wouldn't want the user to click the image just so that it loads all javascript and data required to render the graph client side, only so that the user can click the link and navigate away. Seems wasteful. --Yurik (talk) 15:40, 21 July 2015 (UTC)Reply[reply]
Update: I think this should be done via switching Graphoid to SVG. phab:T96309. --Yurik (talk) 14:06, 20 January 2016 (UTC)Reply[reply]
@Yurik: Hello! Is there any update on this — specifically, do you know of any way to have clickable links in graphs? Tol (talk) 15:16, 15 September 2021 (UTC)Reply[reply]

Seeking help moving away from Wikipedia template:Line chart[edit]

Last year I added several dozen line charts to Wikipedia based on US Department of Labor OLMS reports covering union membership and finances using Template:Line chart. However, the process of gathering the data (their database is awful) and reformatting it (the template has many limitations) was so exhausting I gave up for a year. I'm now looking to update and to continue this effort, and this new method might make the process much easier and result better, but converting it seems overwhelming.

I put the details of the project on my Wikipedia talk page.

It's a big project and I bit off more than I could chew. Any help would be appreciated and would benefit dozens of articles. Djr13 (talk) 08:48, 7 October 2015 (UTC)Reply[reply]

Djr13, have you seen the w:Template:GraphChart? It might be possible to convert parameters of your template to use that other one, and also put a big note saying that the template is obsolete and users should move to the new one? I will try to find some time to work on this, but it might be a bit tough - I am trying to get graph extension to the new interactive version of vega, see samples here --Yurik (WMF) (talk) 04:44, 13 November 2015 (UTC)Reply[reply]
@Yurik (WMF): Sorry I had not responded, I am rarely on this wiki and in general had not been editing much over the winter. I did see that template before, and I notice I mentioned it on my talk page, but honestly it has been such a long time since I created these graphs that I will need to relearn how to code them anyway. Really, I think a good starting point would be to have a sample of a graph that accomplishes what is needed for the usecase and looks relatively attractive for the large number of articles it will be in. I hoped I could somehow separate the graph formatting, and even the graph data, from the article space to make it more manageable. JSON seems to open a big opportunity there, but I wouldn't know where to start. One big problem for me is that the OLMS website is very inaccessible, so I am forced to collect and arrange data somewhere, which I wish could be online. Djr13 (talk) 15:44, 5 February 2016 (UTC)Reply[reply]

upgrade vega1 to vega2[edit]

I'm trying to install the master release on MW26 I've got the following error :

Call to undefined method XCacheBagOStuff::makeKey() 

Using the mediawiki-extensions-Graph-REL1_26 is working fine but only vega1 json format working. Any idea ? — Preceding unsigned comment added by PascalKT (talkcontribs)

@PascalKT: , XCacheBagOStuff is an implementation of the BagOStuff (memcached-like caching). I think your installation is somehow not set up correctly to use any kind of caching, and as a result you might be running much slower and/or with problems. I am not exactly sure how to set it up though. --Yurik (talk) 22:47, 22 March 2016 (UTC)Reply[reply]

@Yurik: ,Thanks for your reply. I've checked my php config opcache and apcu fine in phpinfo()

$wgMainCacheType = CACHE_ACCEL; setup in Localsetting and I can see file cached in my cache folder ...

still not working

PascalKT, could you add this as a bug to the phabricator? I suspect Dieudo is having similar issue. --Yurik (talk) 12:54, 11 April 2016 (UTC)Reply[reply]

@Yurik: ,I'm back.I've found a work around and it is working fine with my needs. In the Graph.body.php I've commented line 171 //self::saveDataToCache( $hash, $data )

Basic installation bug ?[edit]

I've done the basic installation, but it doesn't seem to work : (

  • MediaWiki : 1.26.0
  • PHP : 5.5.9-1ubuntu4.14 (apache2handler)
  • MySQL : 5.5.47-0ubuntu0.14.04.1
  • Lua : 5.1.5
  • JsonConfig : 0.1.0

The best I can get is an empty chart :

Thanks for any help : )

--Dieudo (talk) 14:13, 10 April 2016 (UTC)Reply[reply]

Dieudo, please check that you have the latest version of the graph extension, preferably directly from the GIT. For some reason, I don't even see the Special:GraphSandbox on your wiki. --Yurik (talk) 14:29, 10 April 2016 (UTC)Reply[reply]
Thx for your fast answer ! I installed Graph-master-1aeb084.tar.gz
I have now access to this special page, but now pages with graph give this message :
 Fatal error: Call to undefined method EmptyBagOStuff::makeKey() in /.../w/extensions/Graph/includes/Graph.body.php on line 243
--Dieudo (talk) 15:26, 10 April 2016 (UTC)Reply[reply]
Dieudo I will have to research the makeKey issue. It has also been reported above, so there must be some version compatibility issue - I don't have it with the core version directly from git. Btw, the graph extension you had initially was using obsolete and unsupported Vega 1.0, that's why vega 2.0 example didn't work. --Yurik (talk) 15:37, 10 April 2016 (UTC)Reply[reply]
Yurik Dieudo So I had similar problems as described by Dieudo. Found out that - for unknown reason - my installation of mediawiki - in BagoStuff.php - was missing all make key methods. If you look here: Bag O Stuff reference than it lacked last three methods. Not too mention the whole file is ~545 lines long which indicates that more stuff is missing. How did this happen? In my case I was lazy and clicked installation of mediawiki from my host so it was autoinstalled. So I can blame my hosting (zenbox.pl - for reference). As a proof of concept, when I manually added these methods it threw a lot of warnings at me BUT the graph was generated and looked almost OK! So I would say - extension is fine, check up your MediaWiki installation. I probably will make manual installation and do a migration because seriously WTF to gut an installation like that. Nimdil (talk) 15:45, 1 May 2016 (UTC)Reply[reply]
EDIT: these methods are in documentation but not in vanilla mediawiki install? Nimdil (talk) 17:36, 1 May 2016 (UTC)Reply[reply]
These methods were added only in MediaWiki 1.27 (Gerrit change 244825), soon to be released. Before that, extensions apparently used memcached directly. --FFS Talk 11:21, 14 June 2016 (UTC)Reply[reply]

Numeric separators[edit]

The graphs always use English decimal and thousand separators for numbers, instead of current wiki's separators. Is it possible to change this setting? --Bultro (talk) 13:01, 11 July 2016 (UTC)Reply[reply]

Bultro, see the tracked task. --Yurik (talk) 17:09, 11 July 2016 (UTC)Reply[reply]
A related effort is globalize. It's very hard to get the JavaScript folks to agree to a shared standard, so MediaWiki ends up pulling a dozen different things which invariably have worse i18n than MediaWiki. --Nemo 20:03, 11 June 2018 (UTC)Reply[reply]

Rotation of the x-axis labels[edit]


I would like to rotate the labels of the x-axis (fr:Utilisateur:Pyb/Brouillon13). I found this thread on Stackoverflow, but I don't know how to apply the solution. Pyb (talk) 05:48, 9 August 2016 (UTC)Reply[reply]

Yes Done It's "angle": {"value":-45}, Pyb (talk) 05:48, 9 August 2016 (UTC)Reply[reply]
Pyb, hi, sorry, i was on vacation :( Glad you figured it out! Let me know if you run into any other problems. --Yurik (talk) 11:54, 10 August 2016 (UTC)Reply[reply]

Preview in canvas not woking on retina monitor[edit]

Hi all, maybe this isn't a big issue, but I find it disturbing. On monitor displays, previews are pixelated. Is there a way to fix it? Thanks --Mikima (talk) 11:36, 25 November 2016 (UTC)Reply[reply]

Hi Mikima, thanks for the suggestion, I added phab:T151654. Might take us some time to get to it though :( --21:59, 25 November 2016 (UTC)Reply[reply]

Configuring graphoid[edit]

I'm struggling to get the graphoid service integrated. The graphoid service is running and listening (and responding) on port 6927. Here is my local settings config:

wfLoadExtension( 'Graph' );
$wgGraphImgServiceUrl = "http://fr-s-dtp-npsgl1.ncifcrf.gov:6927/api/rest_v1/page/graph/png/%2\$s/0/%4\$s.png";

(My hope is eventually to get restbase running, but one step at a time). But I get file not found error: Cannot GET /api/rest_v1/page/graph/png/C29481/0/bd001718d8dcc202a3854dbec188981493e00176.png when browsing to (or within the wiki page): http://fr-s-dtp-npsgl1.ncifcrf.gov:6927/api/rest_v1/page/graph/png/C29481/0/bd001718d8dcc202a3854dbec188981493e00176.png

Any help would be greatly appreciated. I'm sure I'm just missing something simple. Thanks! Evans.jr3 (talk) 13:03, 15 June 2017 (UTC)Reply[reply]

Evans.jr3, first off, you don't really need graphoid to use graphs - you can use Graph extension in a client-side mode only (it will load Vega libraries for all pages that use graphs). This is actually a much easier path for smaller sites. The imgserviceurl points to the local graphoid, but in WMF setup, graphoid is hidden behind restbase. It doesn't have to be, in which case the URL would be something like http://...:6927/en.wikipedia/v1/png/Page_name/0/0123456789abcdef...png. Note that you might want to hide it behind nginx or varnish proxy, or change its port to 80. --Yurik (talk) 08:29, 17 June 2017 (UTC)Reply[reply]
Yurik, Thanks for getting back. I'm trying to use the Collection Extension to produce pdfs and I'm not having much luck with it rendering canvas objects. The graphs look great, I just want to print them out. I thought the graphoid service would be the simplest route. I will recheck my settings. Evans.jr3 (talk) 12:07, 19 June 2017 (UTC)Reply[reply]

Is it possible to generate tree graph from Wikidata items?[edit]

Yes Resolved

Hello! I'm very impressed various beautiful graph examples. I'm now writing draft of help page about "how to generating tree graph" at Wikidata (d:User:Was a bee/Help:Tree). So I want to know whether it is possible or not, and if possible, I want to know example code to embed that at the help page. Thanks! --Was a bee (talk) 16:38, 23 December 2017 (UTC)Reply[reply]

I found some tree graph examples in Wikidata. So resolved. Thanks!--Was a bee (talk) 06:20, 1 January 2018 (UTC)Reply[reply]

Labels overlap on the x-axis[edit]


When I use many (date) labels on the same graph, they overlap and become unreadable (cf. graph below). Is there any way to solve this?

Regards, --Automatik (talk) 04:47, 5 September 2018 (UTC)Reply[reply]

Note: I found a way using the labels property: see wikt:fr:MediaWiki:Gadget-translation editor.js/Statistiques. --Automatik (talk) 22:38, 28 October 2018 (UTC)Reply[reply]

Compatibility with Visual Editor[edit]

When editing with Visual Editor, images, tables, templates, math, etc. are still visible, so that you can see them and double click on them to edit them. But anything using Template:Graph just becomes invisible, a plain white box on a plain white background. Is there a way to show the preview of what the graph will look like, or at least show a box placeholder for it, so we remember it's there while editing? Omegatron (talk) 21:26, 16 February 2019 (UTC)Reply[reply]

Support for relative widths?[edit]

For example, graphs are often embed in an mbox on talk pages, like so.

If you're zoomed out, all's (relatively) fine, but when you zoom in you can see that issues arise quickly. Support for something like


would be much appreciated. This isn't pageview specific. Headbomb (talk) 04:18, 12 April 2019 (UTC)Reply[reply]

General Help[edit]

i'm creating a wiki and really want to make use of the graph tool but am not a develop. i'm struggling with the documentation. does anyone know of any really great tutorials out there?

in particular:

- the graph:chart extension template - how do i install it for easy graph implementation?

- the vega specification seems to not always work.

- trying to create a group line chart from in page data - struggling to get this to work

- creating a visual graph template so that i can reuse for different data sets

if anyone can offer any help i'd really appreciate it! (not even sure if i'm asking in the right way sorry...)

How to create organigrams[edit]

I want to create a graph template serving organigrams like fosbos-sw.de/images/allgemein/schulorganisation/organigramm/organigramm.JPG.

Reflections on this extension[edit]

I just made a long winded rant about this extension in my userspace - User:Bawolff/Reflections on graphs. I'd love feedback from people involved with this extension if they agree with me or not. Bawolff (talk) 15:56, 29 March 2020 (UTC)Reply[reply]

  • @Bawolff: I am not involved with the extension, but your rant was super useful to me for understanding better the current status of interactive graphs. TiagoLubiana (talk) 13:50, 11 May 2020 (UTC)Reply[reply]

Can you help with improving the Coronavirus epidemic maps?[edit]

Hi all

The maps on the Coronavirus pandemic articles need some technical help which has been documented on phabricator, I think that some of the tasks relate to the graph extension, please take a look.

If you're not able to assist with any of the tasks please still subscribe to it and award a token, it will help people understand there is community support for fixing these issues.

Thanks very much

--John Cummings (talk) 15:24, 30 March 2020 (UTC)Reply[reply]

According to a Help:Tracking categories and to Extension:EasyTimeline itself, EasyTimeline should be replaced by Graph.

Is anyone able to replace the EasyTimeline occurrence inside the article in the subject with the Graph equivalent? Thanks for the support, --Andyrom75 (talk) 17:31, 26 May 2020 (UTC)Reply[reply]

I can't have Graph been rendered[edit]

Hello Guys Guy

I'm trying to get this samples Graph worked




This is the normal rendering

This is what I'm getting

Here is my LocalSettings.php


I've imported Templates and Modules from Wikipedia

I don't know where to enable theses Roles ;

  • graphs
  • scribunto
  • imagemap

Please any Help will be appreciated

Thank you

— Preceding unsigned comment added by Fr-ptchek (talkcontribs) 8 July 2020

Request to update links on Extension:Graph page[edit]

Hi all, After rereading and checking links on this page, I point out following lacks. Can somebody realign please ? Thanks.

1. labs is no longer accessible : Wikimedia Cloud Services Error

At https://www.mediawiki.org/wiki/Extension:Graph#Useful_links link in "....(also installed on labs)." leads to https://lyra.wmflabs.org/ => Wikimedia Cloud Services Error

2. link leads to a not existing example .png image

At => https://www.mediawiki.org/wiki/Extension:Graph#Internals link in "... which provides a static image of the graph" leads to not existing target :

https://www.mediawiki.org/api/rest_v1/page/graph/png/Extension%3AGraph%2FDemo/1686336/d243aa924db2f82926e0f317217fcce591fe8cd4.png Request : update with other image reference

3. Adapt snippet contents with new image path

when a suitable image is found for point 2) , the source text of the example above must be updated with the URL of this image it is related to please adapt => d243aa924db2f82926e0f317217fcce591fe8cd4.png

From : Topic:Vzss358mnygigpkz

Christian 🇫🇷 FR (talk) 11:41, 18 December 2020 (UTC)Reply[reply]

Change colors of bars when directly added as JSON in <graph>[edit]

Hey everyone, since Lua is not working on my shared server, I have to add the graph data directly as JSON. With the source code of this demo, it works very well. However, I would like to have custom colors for each bar. With "update": { "fill": {"value": "steelblue"} }, I can only change the color of all bars. Which JSON code do I have to add to get different colors? Help is greatly appreciated, thanks in advance!

Help in Troubleshooting recent global (user?) issues[edit]

FYI phabricator:T275833. Cheers :) --Valerio Bozzolan (talk) 11:20, 3 March 2021 (UTC)Reply[reply]

Don't show labels or only show certain ones[edit]

Hello, first of all, sorry if this is already somewhere in documentation and I didn't manage to find it. Is it possible to remove labels (e.g., X ones) or, even better, only show certain ones? Thanks! --Toniher (talk) 15:44, 12 April 2021 (UTC)Reply[reply]

how to view a data set?[edit]

I want to view the value of a data set in the javascript console. https://github.com/nyurik/vega/blob/master/docs/docs/api/debugging.md describes how to do this, but neither view nor VEGA_DEBUG are defined in my console. What am I missing? RoySmith (talk) 03:18, 26 December 2021 (UTC)Reply[reply]


Is there any collection of particularly interesting uses or techniques that have been used with Graphs? I'd be interested in seeing things people have figured out how to do with this. (It took me a while to figure out whether some of the stuff I was trying to do with this map were even possible.) --Yair rand (talk) 22:26, 7 February 2022 (UTC)Reply[reply]


i tried to use the content of vega's timeline example inside <graph> tag, but could not get it to show the graph i see on vega (or any).

any hint? is such thing possible?

peace. קיפודנחש (talk) 04:00, 26 March 2022 (UTC)Reply[reply]

Using math annotations on Graph axis and legends[edit]

It seems VEGA does not support or have plans to support Latex. However, since the Math extension does provide support for Latex (or MathML) in WikiMedia, it may be possible to use it, for example, by passing the URL of the rendered annotation, or MathML code, or something. The problem is that I'm not familiar with VEGA or WikiMedia technology/extensions... I would not know where to start, but I would greatly appreciate if someone could point the way - if any.

Cheers, AlexCastag (talk) 12:12, 11 November 2022 (UTC)Reply[reply]

Place to ask questions about Graph[edit]


Couldn't/Shouldn't there be a specific place to exchange and ask question about how to use Graph? something a bit like w:Wikipedia:Village pump (technical) or d:Wikidata:Request a query for SPARQL.

Meanwhile, here my question: how to add a regression ? for the first graph on d:https://www.wikidata.org/wiki/User:VIGNERON_en_résidence/test. I found the official documentation here https://vega.github.io/vega-lite/docs/regression.html but I can't make it work for my graph :/

Cdlt, VIGNERON en résidence (talk) 14:20, 24 March 2023 (UTC)Reply[reply]

Extension disabled on Wikimedia wikis[edit]

The graph extension was disabled on Wikimedia wikis today due to a security problem. See w:Wikipedia:Village pump (technical)#Graph extension disabled per immediate effect and phab:T334940. PrimeHunter (talk) 15:10, 18 April 2023 (UTC)Reply[reply]

Assistance in migrating Module:Graph on Beta Labs[edit]

@Mps, @Tom.Reding, @Pietrasagh, @MSG17

Hey all, as part of phab:T334940 we are having to do a forced and rapid migration to Vega5. We are attempting to build a rudimentary translation layer to support Vega2 graphs on Vega5. This aims to provide as much support as possible to the extension itself across all wiki's and for 3rd parties.

In case this doesn't work or doesn't provide the coverage the community needs, updating the lua modules themselves to Vega5 should probably be seriously considered.

You are all going to have more familiarity with the workings of the module and Vega definitions than most WMF engineers and your involvement in helping migrate the modules would be, simply put, invaluable. If any of you have any time or opportunity in the next few days I'd appreciate getting your assessment on the feasibility of migrating the lua module to Vega5 and if possible trialling out migrating the module over itself.

https://en.wikipedia.beta.wmflabs.org/wiki/Module:Graph and https://en.wikipedia.beta.wmflabs.org/wiki/Template:Graph:Chart are the best starting points to do any testing. (Some of what is broken there is due to issues with the Vega2 -> Vega5 translation but is being worked on).

https://vega.github.io/vega/docs/porting-guide/ describes a chunk of what would need doing for Vega2 -> Vega3+

Some comments:

  • Cross-domain loading of data via vega is currently disabled but some of this will be reenabled soon as part of phab:T335325.
  • Interactivity is currently disabled but pending a security review, we hope this can be reenabled.

There are a lot of moving pieces and I can imagine that there might be 100 questions you might have, I will do everything I can to relay them and try to get you any answers. Free to ask any questions on the phab ticket. You can also see some of the work we are hoping to complete over the coming weeks on the graph extension phab board (Vega Update phase 1, phase 2 & phase 3). Seddon (WMF) (talk) 22:29, 25 April 2023 (UTC)Reply[reply]

Hi @Seddon (WMF), sorry for beeing late to the party. I haven't checked wiki mailbox for a while ;-)
I'm happy to see there's quick progress in vega 5 upgrade for extension.
I will check it out and come back here soon.
Some time ago I made some preliminary notes for (re)new of module but haven't done much progress. Translation is here https://m.mediawiki.org/wiki/User:Pietrasagh/graphen#
Pietrasagh (talk) 20:50, 4 July 2023 (UTC)Reply[reply]
Does anyone else is working on update of modules for graphs to Vega 5? I'm doing my best here https://en.wikipedia.beta.wmflabs.org/wiki/Module:Graph/sandbox but progress is very slow (see here https://en.wikipedia.beta.wmflabs.org/wiki/Template:Graph:Chart/sandbox). Pietrasagh (talk) 14:24, 2 September 2023 (UTC)Reply[reply]