Skip to content

A chart drawn as a Table shows every column of its results - #506

Merged
namedgraph merged 1 commit into
developfrom
fix/table-chart-columns
Oct 29, 2026
Merged

namedgraph merged 1 commit into
developfrom
fix/table-chart-columns

Conversation

@namedgraph

Copy link
Copy Markdown
Member

The bug

A ldh:ResultSetChart or ldh:GraphChart drawn as a Table showed only its category and series columns. ac:sparql-results-data-table always passed var-names = $category, $series to the converter, and ac:rdf-data-table passed properties = $category, $series, whatever the chart type. A table plots nothing, so it has no use for a category or series, but every other variable of the SELECT (or property of the graph) was dropped, and nothing on the page said so.

Repro: a ResultSetChart, chart type Table, over SELECT ?kind ?items ?longest, category kind, series items — the table has two columns.

The fix

Both converters already take the whole projection, or every property, when they are given no columns. So the functions now take the columns rather than a category and series, and the callers choose them:

  • ac:sparql-results-data-table($results, $var-names, $chart-type)
  • ac:rdf-data-table($results, $properties, $resource-ids, $chart-type, $object-metadata) — its two branches differed only in resource-ids, and become one
  • the two ldh:ChartDataTable templates in client/block/chart.xsl pass none for a Table, and the category and series for any other chart, as before (resource-ids stays "no category")

$chart-type stays: the URI cell template in client/functions.xsl reads it to link a Table's URIs.

Tests

  • New specs/document/blocks/chart/table-columns.spec.mjs: a result-set Table shows all three projected variables in projection order; a graph Table shows all three properties.
  • series-order.spec.mjs read the series order off a Table's header, which now shows the projection whatever the series are, so it would pass without the reordering. Its fixture is a bar chart now, and the spec reads the column order off the data table the chart keeps on its block's cache (columnLabels in lib/chart.mjs).

client.xsl compiles to SEF with xslt3-he. The UI suite has not been run against a stack with this change yet.

🤖 Generated with Claude Code

ac:sparql-results-data-table and ac:rdf-data-table cut the data table
down to the chart's category and series whatever the chart type, so a
Table, which plots nothing, showed two columns of a query that selected
five, and nothing said the rest existed. The converters already take the
whole projection, or every property, when they are given no columns.

Both functions now take the columns instead of a category and series:
$var-names, and $properties with $resource-ids. The callers, the two
ldh:ChartDataTable templates, choose them: none for a Table, the category
and series for any other chart. ac:rdf-data-table's two branches differed
only in $resource-ids and become one.

The series-order spec read its order off a Table's header, which now
shows the projection whatever the series are, so its fixture is a bar
chart and the spec reads the order off the data table the chart keeps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@namedgraph
namedgraph merged commit f3429e8 into develop Oct 29, 2026
5 checks passed
@namedgraph
namedgraph deleted the fix/table-chart-columns branch October 29, 2026 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant