Last time we took a brief look at fabric.js, this time we’ll take a look at the fabric.js code structure

Fabric.js directory anatomy

The general directory of fabric.js is as follows: some files are omittedFabric. Lot of js

One of the things we care about is how is fabric rendered? Let me give you a brief talk

Fabric. Js rendering

As we all know, fabric renders object data, so how does that data actually get rendered? Let’s assume we have a data object object

Once you get the Objects, the next step of the data will go tocanvas.class.jsIn therenderAllmethods

In the next step, we will go to the JS that draws Objects, i.eobject.class.jsIn this case, it will go to different types according to different types_renderfunction

For example, text and circle types:As you can see,textwithcircleThe canvas API is used for rendering.

Ok, that’s it for this episode, and next we’ll talk about how to make changes in fabric.js rendering