vscode-debug-visualizer
vscode-debug-visualizer copied to clipboard
Add a Matrice Visualizer
Implement a visualizer for matrices, i.e. for two dimensional arrays.
Im curious about where are the other visualizers. im interested in doing this but I dont know where to start
Awesome ;) You can find them here. Reach out if you have questions!
I just added some documentation here.
Let me try for doing this feature.
@hediet Is this still relevant since there is already the grid visualization?
I think the grid visualization might suffer from performance for large matrices. But yeah, the grid visualizer might be a replacement for this.
+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)).