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

Hierarchical structures are supported. #10

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

whxcode
Copy link

@whxcode whxcode commented Oct 10, 2022

No description provided.

@vercel
Copy link

vercel bot commented Oct 10, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
figma-to-json ❌ Failed (Inspect) Oct 10, 2022 at 3:12AM (UTC)

@yagudaev
Copy link
Owner

Hi Wang, thanks for the PR 😁.

From what I can tell, you are trying to convert the Event-based model that the .fig file uses to the snapshot-based model that Figma Rest API and Figma Plugin API use.

The best way to do this is to do a redux-like reducer structure.

(state, action) => state, then run each event and compute the snapshot.

I wanted to leave the original read of the .fig file very raw without any modification. This conversion process is super valuable and I'll certainly look at your PR for inspiration 😁.

@whxcode
Copy link
Author

whxcode commented Oct 11, 2022

Hi Wang, thanks for the PR grin.

From what I can tell, you are trying to convert the Event-based model that the .fig file uses to the snapshot-based model that Figma Rest API and Figma Plugin API use.

The best way to do this is to do a redux-like reducer structure.

(state, action) => state, then run each event and compute the snapshot.

I wanted to leave the original read of the .fig file very raw without any modification. This conversion process is super valuable and I'll certainly look at your PR for inspiration grin.

Thanks for your advice.

The cover of the file can be obtained.
image

This way you can get information about the file.
image

As for my previous question, I didn't study it carefully. #9.
Image information may be stored in "unzipped" objects.
image
image

Best regards,
Wang.

@yagudaev
Copy link
Owner

yagudaev commented Feb 2, 2024

Brilliant work, @whxcode. Thanks so much for the info 🤩.

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.

None yet

2 participants