type: 'cat_values' seems excluded from treatment at calc_cat_cluster_breakdown
See original GitHub issueHi, I have this situation where my data contains numerical categories, giving this error:
Uncaught TypeError: Cannot read property ‘length’ of undefined at make_cat_breakdown_graph.js:132 at arrayEach (lodash.js:532) at Function.forEach (lodash.js:9357) at make_cat_breakdown_graph (make_cat_breakdown_graph.js:108) at still_hovering (make_dendro_triangles.js:54)
JSON.stringify(inst_cat_info,null,‘\t’)
{
"cat-0": {
"type": "cat_strings",
"max_abs_val": null,
"cat_scale": null,
"cat_hist": {
"None": 8,
"High": 2,
"Low": 2
}
},
"cat-1": {
**"type": "cat_values",**
"max_abs_val": 90,
"cat_hist": null
},
"cat-2": {
"type": "cat_strings",
"max_abs_val": null,
"cat_scale": null,
"cat_hist": {
"Female": 9,
"Male": 3
}
},
"cat-3": {
"type": "cat_strings",
"max_abs_val": null,
"cat_scale": null,
"cat_hist": {
"White": 12
}
}
}
JSON.stringify(cat_breakdown,null,‘\t’)
[
{
"type_name": "drug_efficacy",
"num_in_clust": 1,
"bar_data": [
[
"cat-0",
"drug_efficacy: None",
{
"num_nodes": 1
},
"#dbdb8d",
1,
null,
0.6666666666666666
]
]
},
{
"type_name": "race",
"num_in_clust": 1,
"bar_data": [
[
"cat-2",
"race: Female",
{
"num_nodes": 1
},
null,
1,
null,
0.75
]
]
},
{
"num_in_clust": 1,
"bar_data": [
[
"cat-3",
**"undefined: White",**
{
"num_nodes": 1
},
null,
1,
null,
1
]
]
}
]
I think it is related to another manifestation I am seeing in the demo page with similar data:
http://amp.pharm.mssm.edu/clustergrammer/viz_sim_mats/5a81ec1b3a82d369f2be253a/cat_matrix_test.txt
see how ‘age’ is skipped from the Cluster information categories and the titles shifted:

I am working on this bug on my forked version, but I’d rather have your advice.
Thanks, Richard
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)

Top Related StackOverflow Question
Hi, thanks for your super support ! I tried to put the numerical category as the last one: as you mentioned it doesn’t crash but it’s not treated, even if it’s within the ‘max_cats’ limit. So there’s no ‘Cluster information’ for numerical categories.
To me it’s like there’s a missing
in calc_cat_cluster_breakdown.js (just my two cents). It depends on what you intended to do with ‘cat_values’ type.
HI @nrgiroux, value-based category histograms will be implemented in Clustergrammer-GL https://github.com/ismms-himc/clustergrammer-gl/issues/new?assignees=&labels=&template=feature_request.md&title=.