Show HN: Visualize Data Structures in VS Code
github.com
github.com
A main difference seems to be you have to tell vscode-debug-visualizer how/what to show in the code, whereas with ddd you either point-and-click or else run gdb/ddd commands like `graph display _variablename_`. I guess you could probably script the latter, but I like how vscode-debug-visualizer reifies what you're visualizing into the code itself instead of into a debugging session.
[0] https://www.gnu.org/software/ddd/ [1] https://en.wikipedia.org/wiki/ThoughtTreasure
EDIT: I see comments from the author below, where there's some version of this tool online, but it goes for other authors, too, and the ability to run it from a truly standalone, single-file viewer.
https://hediet.github.io/visualization/ https://github.com/hediet/visualization
Anyways, in case of this application, all visualizations together are like 20MB (the monaco editor is a significant part of it). Having them split up and only loading things one demand significantly increases startup time.
Also, base64-encoding all the binary resources is a little bit inefficient.
We use http://Nx.dev to split up example apps and libs into separate packages. I have a “visualizer” package, a “devtools” (for use in browser), will potentially add an electron app etc later
Not trying to be snarky or anything but... the source code is available. If there's something that you really need, please consider contributing. That goes for any open-source project.
I feel like software development could be significantly more efficient if all developers would work together and not against each other, or just with much more foresight. We have so many programs/code/libraries that do almost the same stuff. But then, we are already super efficient compared to what we could do 50 years ago.
So intentional snarkiness or not, there's something in your comment that just doesn't comport with mine and the message in it. If I were directly addressing the author of this tool and, say, asking that it be changed or repackaged to solve some problem for me, then your reply would be on-target. But I'm not even using this extension, and that's not what my comment was. It was not a support request. Besides what I wrote, there was no subtext to be found, but if a person insisted on trying to root out some latent meaning from the words, then let it have been an observation about current approaches to modularity or the principle of least authority or the principle of least power.
I apologize for having jumped the gun here. I guess your reply was appropriate for a 'Show HN' thread, since these threads are feedback requests.
However, I am 100% for sure going to break this out when it comes time to do Advent of Code this year. Always spend tons of times debugging code where this will be awesome.
Anyways, I think the table, the plain text and the planned text-diff visualizer might be handy for day-to-day debugging, as they fix some issues with the watch window in VS Code (mainly displaying multiline-strings and lists of homogeneous objects or just being able to update the watched expression with a shortcut).
Automatic visualization of data is such a powerful and underutilized tool in many disciplines, especially ours. A picture is worth 1000 words, and the same could be said for many styles of graphics.
I often find myself writing adhoc/bespoke visualizations for complex data, and the change in perspective can make an intractable problem almost easy, especially for more visual thinkers (so much so that I often wonder why I needed a graphic in the first place?!). To have this right in the debugger is an order of magnitude improvement and I'm excited about this tool, and I hope I find some time soon to learn it.
I know tools with aspects of this exist (ddd, etc..), but since vscode is my current editor of choice, I'm quite excited about this. Great job!
If you're fast stepping through code trying to confirm it working or finding a bug, you're going to be annoyed by the time it takes the visualization to finish on each step.
Using it feels very different from a traditional debugger where you need to control every step: it's often sufficient to just observe passively and note when incorrect patterns surface.
As an example, http://db48x.net/reposurgeon/pathmap-diagrams/generated-path... is one of the graphs I generated.
Have you published the server and the protocol anywhere? I'd use it even though I would have to write the client side myself. For my project it would even be desirable to write the client side twice; I'm porting a program from one language to another, and it would be amazing to be able to compare the implementations visually.
The reason this one feels distracting to me is the animation, and the use of force-directed graph layout. Graph layout is hard but I hope they can implement Sugiyama or something instead.
Instead of animation, they could do something like showing deleted nodes in red and new nodes in green, a bit like online chess.
Maybe I'll send a PR their way..
Implementing custom visualizations is super easy! See [3] for a very simple example. If you implement a visualization there, it will be available for all people that use the visualization framework (e.g. extensions for other IDEs), not only this extension.
[1] https://hediet.github.io/visualization/?darkTheme=1&state=XQ...
[2] https://hediet.github.io/visualization/?darkTheme=1&state=XQ...
[3] https://github.com/hediet/visualization/blob/33de54d69624e1d...
yarn run package
and then codium --install-extension $PWD/whatever.vsix
so long as you have https://github.com/microsoft/vscode-vsce in your PATHAlso see Glamorous Toolkit [0] where visualization is a core part of the development process.
Then this pops up on front page!
Underneath dataframes are a collection of Numpy arrays with ton of extra methods on top.
This guy gives a good overview. https://github.com/mobileink/data.frame/wiki/What-is-a-Data-...
"debugVisualizer.debugAdapterConfigurations": {
"Ruby": {
"expressionTemplate": "DataExtractor.to_table(${expr})",
}
},
..and something simple in the debugee like this.. table_example =
{"id"=> "1", "label"=> "One"},
{"id"=> "2", "label"=> "Two"},
{"id"=> "3", "label"=> "Three"}
# Quick hash to visual table helper
class DataExtractor
def self.to_table(hash)
meta_hash = {
"kind" => {"table"=> true},
"rows"=> hash
}
meta_hash.to_json
end
end
..and we get a decent hash or ActiveRecord visualizer. Thanks for the hint.The `expressionTemplate` does not allow to do that yet.
If somebody is interested in implementing data extractors for Ruby, I can offer help!
[1] https://github.com/hediet/vscode-debug-visualizer/blob/c420f... [2] https://github.com/hediet/vscode-debug-visualizer/blob/maste...
Also, there is https://marketplace.visualstudio.com/items?itemName=WallabyJ....
I myself want to explore further ideas in that direction. I think more interactive debugging/development with smaller feedback loops really increases productivity.