Page MenuHomePhabricator

Create dynamic graph sandbox
Closed, ResolvedPublic

Description

To make graphs trully convinient to write and edit, we should create a Special:GraphSandbox, where editors can dynamically experiment with the graphs without saving/page previewing them. This could be a fairly easy student project.

Currently this code is partially implemented and works as part of the Graph: namespace, but the graph namespace is only available in mediawiki.org and a few other sites. I do not plan to add Graph: ns to other wikis, as it is much less convinient compared to template approach. To see it work, open any Graph: ns page on mediawiki.org, and page preview it - graph will update as you type.

Current implementation:

Needed features:

  • graph is updated on each keystroke
  • ability to enter graph template parameters
  • dynamic template parameter resolution
    • At this point, we can simply resolve parameters in the form of {{{1}}}, {{{name}}}, {{{1|default}}}, etc
    • Eventually, it would be awesome to use parser api to resolve everything, e.g. {{{#if ... }}}

Event Timeline

Yurik raised the priority of this task from to Medium.
Yurik updated the task description. (Show Details)
Yurik added subscribers: Krenair, Yair_rand, Nemo_bis and 3 others.
Yurik set Security to None.
Yurik added a subscriber: Qgil.

In live preview + CodeEditor, it will update within 300ms (+processing time)

[Graph updating as you edit after you click "Show Preview"] works as part of the Graph: namespace, but the graph namespace is only available in mediawiki.org and a few other sites. I do not plan to add Graph: ns to other wikis, as it is much less convenient compared to template approach.

This preview as you type does not work if you edit a page containing a <graph> tag and change the JSON within the tag; I assume that's because the Graph extension only knows to load special preview code when you're editing just the JSON in a dedicated graph namespace. Is there a way to use Extension:JsonConfig to indicate some JSON page is graph data?

[A dedicated namespace] is much less convenient compared to template approach

Do you mean a template that embeds a <graph> tag containing some JSON, or a <graph>` tag on the page that includes an arbitrary JSON data file that may use template parameters?