kompassi
kompassi copied to clipboard
Hierarchical dimensions: Group together related values of a dimension
Consider, for example, dimension room
in event ropecon2024
, that has values like
{
"slug": "halli-3-perhealue",
"title": "Halli 3 Perhealue"
},
{
"slug": "halli-3-tanssiharjoitussali",
"title": "Halli 3 Tanssiharjoitussali"
},
{
"slug": "halli-3-turnaussali",
"title": "Halli 3 Turnaussali"
},
{
"slug": "halli-3-vapaa-pelialue",
"title": "Halli 3 Vapaa pelialue"
},
There's a lot of values in the dimension, and some of them have a hierarchy.
We would like to group together related values of the dimension, so that for example sub-areas of Hall 3 would be somehow visually together. Perhaps also hide sub-areas until their parent is selected?
In the GraphQL API this could be done eg.
{
"slug": "halli-3",
"title": "Halli 3"
"children": [
{
"slug": "halli-3.tanssiharjoitussali",
"title": "Halli 3 Tanssiharjoitussali"
},
{
"slug": "halli-3.turnaussali",
"title": "Halli 3 Turnaussali"
},
{
"slug": "halli-3.vapaa-pelialue",
"title": "Halli 3 Vapaa pelialue"
},
]
},
and the hierarchy also shown in the slug using a dotted path.