Repository navigation
A chart drawn as a Table shows every column of its results - #506
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
A
ldh:ResultSetChartorldh:GraphChartdrawn as a Table showed only its category and series columns.ac:sparql-results-data-tablealways passedvar-names = $category, $seriesto the converter, andac:rdf-data-tablepassedproperties = $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 theSELECT(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, categorykind, seriesitems— 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 inresource-ids, and become oneldh:ChartDataTabletemplates inclient/block/chart.xslpass none for a Table, and the category and series for any other chart, as before (resource-idsstays "no category")$chart-typestays: the URI cell template inclient/functions.xslreads it to link a Table's URIs.Tests
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.mjsread 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 (columnLabelsinlib/chart.mjs).client.xslcompiles to SEF withxslt3-he. The UI suite has not been run against a stack with this change yet.🤖 Generated with Claude Code