silx-kit / h5web

React components for data visualization and exploration
https://h5web.panosc.eu/
MIT License
165 stars 17 forks source link

Export of NeXus Data visualization should contain all data #1619

Open Blackclaws opened 2 months ago

Blackclaws commented 2 months ago

Is your feature request related to a problem?

Right now when viewing an NXdata group that contains a line plot with auxiliary signals the export function only exports the main dataset which is usually not what you would want as you're interested in all the data.

Requested solution or feature

Customize the export to csv feature so that you can select which data should be included.

loichuder commented 2 months ago

Yea, I think it makes sense to export the auxiliary datasets as additional CSV columns.

We could provide two options:

Would that work for you ?

Blackclaws commented 2 months ago

That sounds good! I think we also need to include the X Axes in the export as the first column as that is usually also needed to plot the data in other programs meaningfully.

In general I would say if error datasets are also available those should get exported as well.

loichuder commented 2 months ago

In general I would say if error datasets are also available those should get exported as well.

Yeah, good point :+1:

axelboc commented 2 months ago

Merging the datasets into a single CSV is a very specific need, in my opinion. It doesn't work with some of the other export formats, with 2D visualizations, etc. It also opens the door to discussions about the order of the columns, whether the columns should be named or not, etc.

I do agree that the "Export" feature needs to be made available for NeXus visualizations, but perhaps the exact implementation can be left to the consumer app? That being said, we could provide a default ZIP export, at least with the h5grove provider, since this wouldn't require much change to the endpoint (it would just need to accept multiple dataset paths).

Maybe this issue is also a good opportunity to address the typing limitations of the current getExportURL API: https://github.com/silx-kit/h5web/issues/1063#issuecomment-1295095795.

Blackclaws commented 2 months ago

I do agree that the "Export" feature needs to be made available for NeXus visualizations, but perhaps the exact implementation can be left to the consumer app? That being said, we could provide a default ZIP export, at least with the h5grove provider, since this wouldn't require much change to the endpoint (it would just need to accept multiple dataset paths).

What would the consumer app be in the case of the VSCode extension? The VSCode host? In which case what would the export functionality look like there? I think a general feature where you could have a csv file that exports the signals in the same order as they appear within the signal / auxiliary signal field would be the most common as that is also an already established order, so:

XAxesValue, SignalValue, SignalError, Aux_1 Signal, Aux_1 Error, etc...