0

I used a graph from the Vega example and add it to my MediaWiki page and it works, I have replaced in the "data": section the "values": part with the

"data": [ { "name": "table", "url": "http://wiki.xxxxx.com/docs/ReleaseManagement/GraphTest.json" } ],

and the data is not presented. I took the " values" section from the example file and created a Json file, the file is reachable, I am reading the data using the #get_web_data:url=http....... and it works.

  • Do you have any idea why it isn't working?
  • Do I have to add another extension to the MediaWiki so it will work?

Thanks in advance for your help, Shalom

shalom
  • 11
  • 2
  • Are you refering to Extension:Graph? -I never get it to work properly... – IRA1777 May 03 '20 at 09:14
  • Yes, I am talking about this extension. If this doesn't work, do you have another way to present a graph in MediaWiki where the data arrive from an external file? – shalom May 03 '20 at 12:12
  • I generally use a combination of Extension:External Data and either Extension:pChart4mw or Extension:GraphViz. With Extension:Graph, only very basic bar chart has ever displayed me something... – IRA1777 May 04 '20 at 06:43
  • I added support to https to the server got the following error on the console : [Vega Err] Error: URL hostname is not whitelisted: https://...../GraphTest.json This is what i tried to add in the LocalSettings.php of the mediawiki : $wgGraphAllowedDomains = [ 'wikiraw' => [ 'wikitest' ], 'https' => [ 'wikitest' ] ]; wfLoadExtension( 'Graph' ); $wgGraphIsTrusted = true; i've tried to replace https with wikiraw in the page source instead of https, same issue: weird thing is, part of your data is showing in the graph that is rendered – shalom May 05 '20 at 11:50

1 Answers1

0

Using MediaWiki extension External Data, you can now embed Vega visualisations into wiki pages, with data defined either in the JSON itself or linked to by an URL. An example, providing both the wikitext and necessary configuration, can be found here.

Please note, that this embedding is simultaneously server-side, that is, the visualisation will be shown in JavaScript-less environments like PDF export, and client-side: the visualisation will be interactive, if so configured.

Alexander Mashin
  • 3,892
  • 1
  • 9
  • 15