ashish10alex / vscode-dataform-tools

Dataform tools - a vscode extension
https://marketplace.visualstudio.com/items?itemName=ashishalex.dataform-lsp-vscode
MIT License
20 stars 4 forks source link

feat: dependancy graph #8

Closed ashish10alex closed 3 months ago

ashish10alex commented 4 months ago

CleanShot 2024-08-02 at 20 50 41@2x

Aims to create an interactive dependancy tree which shows how various nodes of Dataform dependancy tree are connected. At a high level it supports:

  1. Creating dependancy graph with table/view created from current file as root when Load dependancy graph button is clicked on the side panel
  2. Creating dependancy graph by right clicking my_source in $ref{("my_source")} to create dependancy graph with my_source as root

External dependencies

For dependancy tree, I have used my fork of square/dependtree which add colouring functionality to easily identify external data source declarations in the Dataform pipeline. The legends of the graph are drawn uses d3.js library which is a data visualisation library used by dependtree. Searchable drop-downs have been facilitated by select2. All of these libraries have been imported as minified js files where possible ( maybe old fashioned, but works for now ! ).

Limitations

  1. Assumes that names of the table are unique across Dataform project as using table_name.dataset_name could potentially cause clutter in the resulting graph
  2. If user changes the theme to a light / dark them while web panel is open, the text will be hard to read. Will be fixed if the user switches tab and comes back / re-opens to web panel

TODO