figma-to-json icon indicating copy to clipboard operation
figma-to-json copied to clipboard

Hierarchical structures are supported.

Open whxcode opened this issue 3 years ago • 4 comments

whxcode avatar Oct 10 '22 03:10 whxcode

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)

vercel[bot] avatar Oct 10 '22 03:10 vercel[bot]

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 😁.

yagudaev avatar Oct 10 '22 21:10 yagudaev

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. https://github.com/yagudaev/figma-to-json/issues/9. Image information may be stored in "unzipped" objects. image image

Best regards, Wang.

whxcode avatar Oct 11 '22 01:10 whxcode

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

yagudaev avatar Feb 02 '24 07:02 yagudaev