Page MenuHomePhabricator

Re-displaying chart breaks grouping of results
Open, Needs TriagePublic

Description

If you have a query that groups results in some way (not in the SPARQL GROUP BY sense, but in the graph view sense of having multiple results on the same x-axis spot), displaying any of the new chart views for a second time will break. Example query:

sparql
#defaultView:BarChart
SELECT ?x ?xLabel ?y ?group ?groupLabel WHERE {
  VALUES (?x ?xLabel ?y ?group ?groupLabel) {
    (wd:Q1 "universe"@en 1 wd:Q42 "Douglas Adams"@en)
    (wd:Q1 "universe"@en 2 wd:Q2013 "Wikidata"@en)
    (wd:Q2 "earth"@en 2 wd:Q666 "number of the beast"@en)
  }
}

Query link

This will display the query in Bar Chart view by default, and the results look fine. If you then open the Display menu and select Bar Chart again, the display will change to one where only one bar is shown at a time. (It seems to be animated, but I don’t understand the logic behind that animation anyways, so I can’t tell if it makes sense here.)

With the example data above, it’s a bit hard to see the results in the other chart views (few dots scattered across a wide area, hard to spot), but it’s easier to see in this query (source).