Interactive Filters for Tables: Support columns with links
Description
There are some data sets which include links (e.g. to additional information or resources). These links should be elegantly rendered in the table with an icon or similar. The links would be available in the dataset/cube.
Example (Draft)
Potentially two paths for the end-user.
- With the proposed link button.
- Choosing one column, where the text becomes a link.
@l00mi an example of how the metadata is currently attached to dimension values: https://github.com/visualize-admin/visualization-tool/blob/c28f06960061738697322dcc38d3d30e9c4965a6/app/rdf/query-dimension-values.ts#L203-L215
I believe it would be much easier at least from our side to follow a similar pattern and possibly attach an object or an array of link nodes directly to a given dimension value. Let me know if that would work or if I missed something that annotations approach would solve better 👍
@bprusinowski After some further reflection we might solve our need with a simpler approach.
As we need to have links, with the main goal, to enable navigation between multiple CMS Sites, the links are specific on a specific visualisation and not necessary a generally valid link.
Therefore another approach would be to generate a link based on information we have already in the cube. E.g. with the Observation Subject, or another Subject which points to a Concept like Bern etc.
Concretely for the obervation: https://energy.ld.admin.ch/sfoe/bfe_ogd84_einmalverguetung_fuer_photovoltaikanlagen/10/observation/2015/AG
A link can be added by choosing:
- A base path: e.g. https://www.bfe.admin.ch/photo/page/
- The source, observation itself, or a dimension of it.
- How many "elements" separated with "/" shall be taken.
In the case:
- Base Path https://www.bfe.admin.ch/photo/page/
- Source https://energy.ld.admin.ch/sfoe/bfe_ogd84_einmalverguetung_fuer_photovoltaikanlagen/10/observation/2015/AG
- # Elements 2
The generated link would be https://www.bfe.admin.ch/photo/page/2015/AG
Finally this link could be applied, a) to a dimension. (To make a link with the provided text or value of the dimension.) b) add a Link Button as suggested above.
Overall this would be a rather proficient functionality for the end-user. But I think also only proficient users will have this need.
This approach would make the Link a Visualize concern, and there is no need to provide it in the data itself. But as the link is View Layer concern, this is the better architecture overall.
Hi @l00mi, thanks for sharing the idea 💯 My first thought is that probably we'd still need to somehow define the base URL (or add it to the cube metadata?) and then have some logic that would allow the users to "construct" the end URL?
I see a bit of risk in relying on the order to dimension values in observation IRIs (e.g. it's not clear to me if /2015/AG in your example is tied to the order of columns, and if it would stay the same in all cases?). If we allow to actually for example drag and drop the dimension parts, select what should go into URL, that would provide more flexibility, but also be quite complex overall 🤔
We'll discuss this internally and get back to you, I think that still it would be great to have some use cases that you'll want to achieve with this feature (e.g. if the above structure of links will always be the same and could actually be tied to dimension values, would there be a need to be able to have custom links, not depending on observation values, etc) 🙏
cc @adintegra
@bprusinowski the base URL would be use case dependent, though it makes sense to define it with the visualization, in contrast to add it to the cube.
The example is simply tied to this specific cube example, other cubes might have other URI schemas. (It would be up to the end user to assume that this works out.)
The use case would be to make a link from a datapoint to an overview page of a datapoint, e.g. inside a data story.