vscode-debug-visualizer icon indicating copy to clipboard operation
vscode-debug-visualizer copied to clipboard

Add a Matrice Visualizer

Open hediet opened this issue 5 years ago • 7 comments

Implement a visualizer for matrices, i.e. for two dimensional arrays.

hediet avatar Feb 11 '20 09:02 hediet

Im curious about where are the other visualizers. im interested in doing this but I dont know where to start

Clement-Jean avatar Aug 29 '20 10:08 Clement-Jean

Awesome ;) You can find them here. Reach out if you have questions!

hediet avatar Aug 29 '20 11:08 hediet

I just added some documentation here.

hediet avatar Aug 29 '20 11:08 hediet

Let me try for doing this feature.

xenirio avatar Oct 13 '20 15:10 xenirio

@hediet Is this still relevant since there is already the grid visualization?

hinogi avatar Oct 02 '21 22:10 hinogi

I think the grid visualization might suffer from performance for large matrices. But yeah, the grid visualizer might be a replacement for this.

hediet avatar Oct 04 '21 07:10 hediet

+1 for the open issue/the feature request of 'grid visualizer'.

Specifically my problem: While trying to visualize a 2d np array (shape 80x75). I run into error Could not parse evaluation result as JSON: Unexpected token ' in JSON,,,, ,,,,Used debug adapter: python. Taking a hint from https://github.com/hediet/vscode-debug-visualizer/issues/82, if I try visualize(str(variable_name)) though, it outputs a string like the following

[[0.00093501 0.00093501 0.00093501 ... 0.00170146 0.00170146 0.00170146]
[0.00093501 0.00093501 0.00093501 ... 0.00170146 0.00170146 0.00170146]
[0.00093501 0.00093501 0.00093501 ... 0.00170146 0.00170146 0.00170146]
...
[0.00451131 0.00451131 0.00451131 ... 0.02732074 0.02732074 0.02732074]
[0.00451131 0.00451131 0.00451131 ... 0.02732074 0.02732074 0.02732074]
[0.00451131 0.00451131 0.00451131 ... 0.02732074 0.02732074 0.02732074]]

which is good (a little better, that at least there is no error), but it has a number of '...'., as you can see above.

Is it not possible to visualize the matrix directly using some kind of a colour map? Running visualize(variable_name[:10]) works (no error) but results in 10 line plots overlayed on top of one another, not a color map grid visualization. Kindly advise.

A related perhaps a separate issue, taking a hint from https://github.com/hediet/vscode-debug-visualizer/issues/82 I ran visualize(str(variable_name)) above, but I cannot run np.array(str(variable_name)) the errior I see in the visualizer is NameError: name 'np' is not defined, nor can I pass to visualize() import numpy as np; np.array(str(variable_name)).

vedhasam avatar Aug 18 '22 11:08 vedhasam