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

#101 stageRef promoted to Provider, export working #127

Merged
merged 8 commits into from
Aug 10, 2024

Conversation

oleojake
Copy link
Collaborator

@oleojake oleojake commented Aug 6, 2024

Closes #101

@oleojake oleojake requested a review from brauliodiez August 6, 2024 13:51
if (!stageRef.current) return;

hideTransformer();
const dataURL = stageRef.current.toDataURL({ mimeType: 'image/png' });
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can fine tune this:

  • On the one hand: does it import the whole canvas or just a the section that contains shapes? I guess this is something we would need to calculate, crop and export only one coords where there are shape (start from 0,0 maybe and find the furthest X,Y coord shape.x +width, shape.Y + height

  • Another thing to take into account Konva are vectorial charts, can we export to PNG with a better resolution? (right now is a bit pixelated)

@brauliodiez brauliodiez merged commit 79bf314 into main Aug 10, 2024
1 check passed
@brauliodiez brauliodiez deleted the feature/#101-export-to-png branch August 10, 2024 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Spike] Check how to export konva to PNG
2 participants