question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

type: 'cat_values' seems excluded from treatment at calc_cat_cluster_breakdown

See original GitHub issue

Hi, 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: image

I am working on this bug on my forked version, but I’d rather have your advice.

Thanks, Richard

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
nrgirouxcommented, Feb 13, 2018

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

else if (params.viz.cat_info[inst_rc][cat_index].type === 'cat_values')

in calc_cat_cluster_breakdown.js (just my two cents). It depends on what you intended to do with ‘cat_values’ type.

0reactions
cornhundredcommented, Jul 17, 2019
Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found