Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CT-794] Export Lineage Graph as SVG or PDF #283

Open
nelsoncardenas opened this issue Jun 30, 2022 · 7 comments
Open

[CT-794] Export Lineage Graph as SVG or PDF #283

nelsoncardenas opened this issue Jun 30, 2022 · 7 comments
Labels
enhancement New feature or request good_first_issue Good for newcomers triage

Comments

@nelsoncardenas
Copy link

Describe the feature

Problem: if we want to generate an image for our Lineage Graph, there is the option to export the graph as PNG, but this image has no quality options.
Example:
image

image

To add more flexibility, dbt can allow generating not just the PNG, but an SVG or PDF file with vectorized images. Reference: Scalable Vector Graphics

Describe alternatives you've considered

You can try to add PNG configurations as ppi and dimensions, but a scalable image format is a more general solution.

Who will this benefit?

  • Users who want to use Lineage Graphs in slides or documentations.
  • Users who want to edit Lineage Graphs using graphic design programs as Illustrator.

Are you interested in contributing this feature?

Maybe, but I'm not so familiar with the dbt repo.

@nelsoncardenas nelsoncardenas added enhancement New feature or request triage labels Jun 30, 2022
@github-actions github-actions bot changed the title Export Lineage Graph as SVG or PDF [CT-794] Export Lineage Graph as SVG or PDF Jun 30, 2022
@jtcohen6
Copy link
Contributor

jtcohen6 commented Aug 9, 2022

@nelsoncardenas Sorry for the delay getting back to you!

The logic for the graph export is neatly self-contained in just a few lines of code. We use the cytoscape library's built-in .png() function to create a PNG here:

var png64 = cy.png(options);
var link = document.createElement('a');
link.download = 'dbt-dag.png'; // sets the filename for the download
link.href = png64;
link.click();

It looks like the cytoscape library has built-in support for PNG, JPG, and JSON as export options (no SVG): https://js.cytoscape.org/#core/export

But it also looks like someone has developed an extension to the cytoscape library, for SVG exports: https://github.com/kinimesi/cytoscape-svg

Is that something you'd be interested in experimenting with?

@jtcohen6 jtcohen6 added good_first_issue Good for newcomers and removed triage labels Aug 9, 2022
@nelsoncardenas
Copy link
Author

Thanks, @jtcohen6, I'll need to study how to contribute to the project. Also, my JavaScript skills are basic, I'm a python developer (machine learning engineer). But I'd like to work on this issue and I can ask for help from some friends maybe.

@abhijithp05
Copy link

@nelsoncardenas @jtcohen6 Is this still open?

@nelsoncardenas
Copy link
Author

nelsoncardenas commented Jan 26, 2023

@abhijithp05 sorry, I have been busy, and I don't think I'll have any time soon to work on this issue.

@abhijithp05
Copy link

@nelsoncardenas Created a PR for the issue. Please review. and merge

Copy link
Contributor

This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please comment on the issue or else it will be closed in 7 days.

@github-actions github-actions bot added the Stale label Jan 23, 2024
@nelsoncardenas
Copy link
Author

nelsoncardenas commented Jan 23, 2024

@nelsoncardenas Created a PR for the issue. Please review. and merge

I cannot approve that PR (#365), maybe drewbanin can give us some help here.

@github-actions github-actions bot added triage and removed Stale labels Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good_first_issue Good for newcomers triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants