Extension talk:Graph

Block limitations
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)
 * Base, I am not sure what you mean. --Yurik (talk) 10:59, 18 May 2015 (UTC)

Map distortion
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)
 * 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)

2015-05-14 Tech talk notes
-- SPage (WMF) (talk) 21:23, 14 May 2015 (UTC)
 * 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  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
 * Made a few minor corrections. --Yurik (talk) 10:51, 18 May 2015 (UTC)

Bug?

 * 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  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&mdash;static data can be represented only very slightly worse with images. Resident Mario (talk) 05:05, 17 May 2015 (UTC)


 * 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)
 * 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)
 * "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)
 * Oooooh! That is really something! Resident Mario (talk) 01:44, 22 May 2015 (UTC)

Image marks only working in preview
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:
 * 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)
 * , thanks for reporting! One thing to note - phabricator is a much better way to report bugs - more people will notice. I created T99994 --Yurik (talk) 02:45, 22 May 2015 (UTC)

Image paths
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 " ". Magic words are scary, so enwiki also has a wrapper template: "".

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)
 * , 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
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, either. EllenCT (talk) 16:43, 24 May 2015 (UTC)
 * There is a very similar "grouped_bar" example here. Primaler (talk) 20:46, 24 May 2015 (UTC)
 * Fixed link (a little trick there :). --Yurik (talk) 21:47, 24 May 2015 (UTC)
 * 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)