Skip to content

Core|Concepts

swimmingkiim edited this page May 25, 2023 · 5 revisions

Introduction

This document explains the core concepts that you should know when using react-image-editor.

Since this project is planning to be turn into npm package, I'll use different terms. These terms will be used in package version.

Index

Data Structure

Canvas

Canvas is where every visual editing is in placed. Canvas is a top concept of all other concepts.

Data

Data is current data which is related to current view. While a Canvas can have multiple Tabs, Data refers to the very current data that user can see on the screen at the moment.

History

History is a set of Data logs. There are three section, previous, present, future. Each section is a simple array that has elements of Data. This domain is responsible for managing right work history sequences.

Tab

Tab is a concept which contains one History and one Data. Canvas can have a multiple Tabs. A user can jump between different tabs inside a react-image-editor project to do multiple works in one browser tab.

Editable Object

Editable Object is an abstract class for any object that can be drawn on the Canvas. Every object class in react-image-editor should extends this abstract class.

Frame

Frame is a box zone which is considered to be exported as an output image. User have to work on top of Frame in order to get an output image. Any Editable Object can be placed outside of a Frame, but only objects inside Frames can be exported.

Image

Image is an image object that can be drawn in react-image-editor. User can import custom image files and add it to a Canvas.

Shape

Shape is an object that can be drawn as a simple shape, such as triangle, rectangle circle etc.

Icon

Icon is a small image object, just like icon itself.

Text

Text is an object that can be drawn as a text. User can set a font family as well.

Brush

Brush is an object that represents user's custom line drawing.

Clone this wiki locally