Page MenuHomePhabricator

Migrate graphs from Vega 2 to Vega 5 syntax on edit with VE
Open, LowPublic8 Estimated Story Points

Description

If the aim of having ext.graph support Vega 5 is met, we should have the VisualEditor module exclusively produce Vega 5 graphs. Existing Vega 2 graphs should be able to be converted to Vega 5 syntax seamlessly upon an edit.

Guide: https://vega.github.io/vega/docs/porting-guide/

What do we need?

  • Creating new graphs with Vega 5 syntax only
  • When editing old Vega 2 graphs, migrate them to Vega 5 syntax

Event Timeline

ferdbold raised the priority of this task from to Needs Triage.
ferdbold updated the task description. (Show Details)
ferdbold moved this task to VisualEditor on the MediaWiki-extensions-Graph board.
ferdbold subscribed.

Existing Vega 1 graphs should be able to be converted to Vega 2 syntax seamlessly upon an edit.

So anyone editing a page will cause unrelated syntax to be updated? We specifically *don't* want VE doing that.

@Krenair I was talking about a graph edit specifically. If the user opens the graph dialog of a graph made with Vega 1, the tool should automagically convert it to Vega 2.

Of course that's an ideal scenario, and I'll have to investigate on whether this is possible without too much pain

@Krenair I was talking about a graph edit specifically. If the user opens the graph dialog of a graph made with Vega 1, the tool should automagically convert it to Vega 2.

Of course that's an ideal scenario, and I'll have to investigate on whether this is possible without too much pain

It's pretty much a drop-dead requirement.

Jdforrester-WMF renamed this task from Migrate ext.graph.VisualEditor to Vega 2 to Migrate graphs from Vega 1 to Vega 2 syntax on edit with VE.Dec 4 2015, 9:36 PM
Jdforrester-WMF set Security to None.
Jdforrester-WMF edited a custom field.
Jdforrester-WMF moved this task from To Triage to Blocked on the VisualEditor board.

For the current, non-aggregated graphs, the migration is very simple -- place "version":2 at the top, and remove all data. from the fields.

For the future capabilities, if you use facets and other fun features, you will need to use the Vega2 ones, as described in https://github.com/vega/vega/wiki/Upgrading-to-2.0 , or better yet, just read the new transformation docs.

Deskana lowered the priority of this task from Low to Lowest.Aug 16 2018, 3:07 PM
Deskana moved this task from Blocked to Freezer on the VisualEditor board.
Jseddon raised the priority of this task from Lowest to Low.

I'm inclined to change this task to scrubbing all instances of vega 1 graphs out right. Any disagreement?

Go ahead. Isn't Vega already in version 3? I belief current priority is providing (template) support for interactive worldmaps on the corona pandemic page.

I'm inclined to change this task to scrubbing all instances of vega 1 graphs out right. Any disagreement?

By "scrubbing", do you mean converting, or deleting, or something else?

Seddon subscribed.

The number of Vega 1 charts used in projects tends to 0. The conversion does not require development efforts and can be done manually.

The basic task of supporting Vega 2.0 with a visual editor was completed a long time ago.

@Seddon am i right? Can we close this task?

At this point we probably could but this problem opens up again once we start looking migrating away from 2 -> 5

At this point we probably could but this problem opens up again once we start looking migrating away from 2 -> 5

I agree, but I think it will be necessary to make a separate task when we come to this. So this task declined or resolved?

This task is clearly not about migrating away from 2

Seddon renamed this task from Migrate graphs from Vega 1 to Vega 2 syntax on edit with VE to Migrate graphs from Vega 2 to Vega 5 syntax on edit with VE.Apr 9 2023, 1:12 PM
Seddon updated the task description. (Show Details)

I wrote some code (with tests) that automatically maps graphs from the version 2 spec to 5: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Graph/+/909761/6/modules/ext.graph.lite/mapSchema.js so hopefully this makes this moot (and we could at some later date add this to VE for run a script to make this migration happen)

Iniquity updated the task description. (Show Details)
Iniquity moved this task from Freezer to To Triage on the VisualEditor board.