mfussenegger / nvim-dap-python

An extension for nvim-dap, providing default configurations for python and methods to debug individual test methods or classes.
GNU General Public License v3.0
492 stars 46 forks source link

Custom visualization of dataframes #116

Closed sotte closed 11 months ago

sotte commented 11 months ago

This is more a question than an issue. I'm wondering how one would go about implementing a custom widget/view for pandas dataframes. The default debug views don't really give you a nicely readable view of the the DF. For displaying one could use e.g. https://github.com/MunifTanjim/nui.nvim/tree/main/lua/nui/table, but I'm not sure how this would fit into the DAP ecosystem. Do you have any pointers/ideas?

mfussenegger commented 11 months ago

You could create some custom functions that use the session to retrieve the variables and then render them in whatever way you want.

I played around a while ago with graphviz to visualize variables, maybe that gives you an idea how to use the API:

https://github.com/mfussenegger/dotfiles/blob/b4762410a523ca19bd08102e0ac4f2a592a1fe8c/vim/.config/nvim/lua/me/dap.lua#L7-L106

Some more pointers:

sotte commented 11 months ago

This is super helpful and way more than I was hoping for, thank @mfussenegger! This should be enough to build something.