Skip to main content

components/AnimationCanvas

Interfaces

AbsoluteSizingProps

Defined in: react/src/components/AnimationCanvas/index.tsx:45

Properties

height?
optional height?: number;

Defined in: react/src/components/AnimationCanvas/index.tsx:47

width?
optional width?: number;

Defined in: react/src/components/AnimationCanvas/index.tsx:46


CommonProps

Defined in: react/src/components/AnimationCanvas/index.tsx:32

Properties

animate?
optional animate?: boolean;

Defined in: react/src/components/AnimationCanvas/index.tsx:35

draw
draw: DrawFunction;

Defined in: react/src/components/AnimationCanvas/index.tsx:33

init?
optional init?: InitFunction;

Defined in: react/src/components/AnimationCanvas/index.tsx:34

options?
optional options?: CanvasRenderingContext2DSettings;

Defined in: react/src/components/AnimationCanvas/index.tsx:42

Read once, when the 2D context is created, so changing it later has no effect. Passing a fresh object on every render is therefore harmless.

See

https://developer.mozilla.org/docs/Web/API/HTMLCanvasElement/getContext#contextattributes


RelativeSizingProps

Defined in: react/src/components/AnimationCanvas/index.tsx:50

Properties

reduceFlickering?
optional reduceFlickering?: boolean;

Defined in: react/src/components/AnimationCanvas/index.tsx:52

relativeSize?
optional relativeSize?: boolean;

Defined in: react/src/components/AnimationCanvas/index.tsx:51

Type Aliases

AnimationCanvasProps

type AnimationCanvasProps = CommonProps & AbsoluteSizingProps & RelativeSizingProps;

Defined in: react/src/components/AnimationCanvas/index.tsx:55


DrawFunction

type DrawFunction = (context, option) => void;

Defined in: react/src/components/AnimationCanvas/index.tsx:27

Parameters

ParameterType
contextCanvasRenderingContext2D
optionAnimationFrame

Returns

void


InitFunction

type InitFunction = (context, option) => void;

Defined in: react/src/components/AnimationCanvas/index.tsx:17

Parameters

ParameterTypeDescription
contextCanvasRenderingContext2D-
option{ height: number; width: number; }-
option.heightnumbercurrent canvas height
option.widthnumbercurrent canvas width

Returns

void

Functions

AnimationCanvas()

Call Signature

function AnimationCanvas(props): ReactElement;

Defined in: react/src/components/AnimationCanvas/index.tsx:62

A simple animatable canvas with requestAnimationFrame()

Parameters
ParameterType
propsCommonProps & AbsoluteSizingProps & Omit<Omit<DetailedHTMLProps<CanvasHTMLAttributes<HTMLCanvasElement>, HTMLCanvasElement>, "ref">, keyof CommonProps | keyof AbsoluteSizingProps | keyof RelativeSizingProps>
Returns

ReactElement

Call Signature

function AnimationCanvas(pros): ReactElement;

Defined in: react/src/components/AnimationCanvas/index.tsx:67

A simple animatable canvas with requestAnimationFrame()

Parameters
ParameterType
prosCommonProps & RelativeSizingProps & Omit<Omit<DetailedHTMLProps<CanvasHTMLAttributes<HTMLCanvasElement>, HTMLCanvasElement>, "ref">, keyof CommonProps | keyof AbsoluteSizingProps | keyof RelativeSizingProps>
Returns

ReactElement