h5web icon indicating copy to clipboard operation
h5web copied to clipboard

Data mapping not fully reflected in exports

Open axelboc opened this issue 1 year ago • 0 comments

Describe the bug

The export feature (to CSV, TIFF, etc.) does not take into account potential transposition of datasets (or dataset slices). See https://github.com/silx-kit/vscode-h5web/pull/23#discussion_r1257530624

The getExportURL method that data providers may implement does not receive sufficient information to determine whether users have transposed the dataset/slice they want to export. The current signature of the method is:

public getExportURL?<D extends Dataset<ArrayShape>>(
    format: ExportFormat,
    dataset: D,
    selection: string | undefined,
    value: Value<D>
  ): ExportURL;

To Reproduce

  1. Go to https://h5web.panosc.eu/h5grove
  2. Select dataset /entry_0000/1_integration/results/I
  3. Select Matrix visualization
  4. Export to CSV => 10 rows x 1000 columns
  5. Use dimension mapper sidebar to transpose dataset
  6. Export to CSV again => still 10 rows x 1000 columns (expected 1000 rows x 10 columns)

Can also be reproduced with the Heatmap visualization and the TIFF export, for instance.

Expected behaviour

Exports should reflect potential transposition of the datasets (or dataset slices).

axelboc avatar Jul 19 '23 09:07 axelboc