-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for categorical axis labels #1441
Comments
Hi @kdheepak, The H5Web viewer supports some aspects of the NeXus Data Format, including the ability to specify axis datasets. You can take a look at the In short, the following changes should give you a functionality equivalent to your
For a concrete example, inspect the
There's a catch with your example, however: H5Web currently supports only continuous, numeric axis datasets. We don't support "categorical" axis datasets like in your example. So this part of your feature request still stands, for sure. Could you please give us some more information about the content of your |
Thanks for the quick response and the detailed explanation! I’ll look through the format in more detail (and maybe get back to you if I have questions?) tomorrow. The quick answer is that our data is multidimensional energy system data. A large number of the datasets are time series data, for example energy demand in different areas, by fuel type, by technologies etc. And we want to make it easy for modelers to quickly explore the dataset. I personally found the line plot and heat map useful (especially with the hover tooltips) to get information about specific values. We have users that make tweaks to input data and run the model, and then would like to visualize the data to see if the model is doing what they expect it to. I think this tool would be great for that kind of exploratory interactive debugging. I’ll be able to attach a sample file and explain more on the details in a following comment. |
Is there a way for me to download the
Is this something you'd be open to adding? I'd be up to make a PR if this would be of interest. |
We'd need to define the feature in more details first (maybe with screenshots from other visualization solutions) and consider its impact on the codebase, but yes, I think it would be beneficial to have this in the H5Web viewer! Did you try zipping your HDF5 file? |
Here's a sample.zip file: This file has just one "data" dataset called The remaining datasets in this sample file are all categorical data used as axis values for the dimensions. Any name in the All the datasets in the file have some attributes: We use |
This is a early draft of our data format, and most of it is abstracted in our code for modelers, so I'm open to changing the schema of the attributes (perhaps even following the nexus format), if that would make visualization more easy. |
That won't be super helpful since we don't support categorical axis labels, but this is how you would structure your data in a NXData group: Just to give you a taste of the NeXus format |
Thanks for the detailed explanation and example! I have to be honest: showing categorical values on the axes and on the dimension sliders is gonna be very tricky — both in terms of UI (i.e. dealing with many values and long labels) and code (i.e. axis datasets used for slicing are not fetched currently). After discussing with @t20100, we think we might be able to improve on the current state by at least showing categorical values in the tooltip of the NX line and heatmap visualizations. The axes would still show indices, but the tooltip would display the real axis value. Does that sound useful to you @kdheepak? Of course, this requires you to adopt the NeXus data format. To expand on Loïc's example, note that NeXus can very well be used in addition to your existing data format: just create a separate
|
Yes, just having the tooltip hover would solve our modelers needs I think! |
After doing a bit more investigating in the code of Currently, the visualization components use custom axis values when provided (via In other words, adding Perhaps We could also give up on having those high-level visualization components in the lib and instead focus on making |
I seem to remember being able to download the |
Oh I wasn't sure what The mock demo does not use an HDF5 file per se. It's basically one big hard-coded JS object that mimics the shape of the metadata we might retrieve from a real provider like h5grove or h5wasm. The source code for this is located here: https://github.com/silx-kit/h5web/blob/main/packages/shared/src/mock/metadata.ts. The values of the datasets are generated in a separate module: https://github.com/silx-kit/h5web/blob/main/packages/shared/src/mock/values.ts |
Ah thanks for the clarification. I just wanted to download a .h5 file that had NeXusFormat attributes that I could examine locally that takes maximum advantage of the h5web features. Is there a file you recommend I look into? |
Hmm, this one is a good basic example: https://myhdf5.hdfgroup.org/view?url=https%3A%2F%2Fgithub.com%2Foasys-esrf-kit%2Fdabam2d%2Fblob%2Ff3aed913976d5772a51e6bac3bf3c4e4e4c8b4e1%2Fdata%2Fdabam2d-0001.h5 (you can download the file from the sidebar). It has an Do note that you can inspect the metadata in H5Web, though. The mock demo may not use a real HDF5 file, but it does demonstrate all of the NeXus features that we support, like |
Is your feature request related to a problem?
I have multiple datasets in the same HDF5 files. These datasets have a "dims" attribute that contain the path to different daatsets that contain string or integer values that then contain the domain of the dimension.
For example, here's some pseudo code that would pass tests in my application
Is it possible for the domain sliders to show the dimension information?
Is there a standard data schema for the attributes such that the visualization could be improved on?
Requested solution or feature
Add features to show custom labels and custom domains based on attributes of a dataset in a HDF5 file.
The text was updated successfully, but these errors were encountered: