Hello and Welcome to our forum!
The example you sent is a very complex custom project, so you have to take it into account.
Natively, the Highcharts library offers expanding and collapsing only in Gantt charts, but there xAxis is only of the time type so I don't really know if it would work in this case:
https://www.highcharts.com/demo/gantt/subtasks
Heatmap does not have this functionality by default. You can use drilldown for this axis:
https://jsfiddle.net/BlackLabel/56Lawxg7/
'm wondering is it possible to implement the idea of expandable/collapsable
But answering whether it is possible to implement the functionality of expanding and collapsing,
yes. However, this will require additional work to achieve this.
If you have any more questions, feel free to write.
Best regards!