
npm
React Moveable
A React Component that create Moveable, Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable, Groupable, Snappable.
Demo / Storybook / API / Main Project
Features
- Draggable refers to the ability to drag and move targets.
- Resizable indicates whether the target's width and height can be increased or decreased.
- Scalable indicates whether the target's x and y can be scale of transform.
- Rotatable indicates whether the target can be rotated.
- Warpable indicates whether the target can be warped(distorted, bented).
- Pinchable indicates whether the target can be pinched with draggable, resizable, scalable, rotatable.
- Groupable indicates Whether the targets can be moved in group with draggable, resizable, scalable, rotatable.
- Snappable indicates whether to snap to the guideline.
- OriginDraggable* indicates Whether to drag origin.
- Clippable indicates Whether to clip the target.
- Roundable indicates Whether to show and drag or double click border-radius.
- Support SVG Elements (svg, path, line, ellipse, g, rect, ...etc)
- Support Major Browsers
- Support 3d Transform
Installation
Documents
How to use
Developments
The main project was made with and I used to make it lighter with umd.
For development and testing, check in packages/react-moveable.
Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits.
You will also see any lint errors in the console.
Files related to major features.
Show Your Support
Please give a if this project helped you!
Contributing
If you have any questions or requests or want to contribute to or other packages, please write the issue or give me a Pull Request freely.
Bug Report
If you find a bug, please report to us opening a new Issue on GitHub.
License
This project is MIT licensed.
🔥 Features
- Draggable refers to the ability to drag and move targets.
- Resizable indicates whether the target's width and height can be increased or decreased.
- Scalable indicates whether the target's x and y can be scale of transform.
- Rotatable indicates whether the target can be rotated.
- Warpable indicates whether the target can be warped(distorted, bented).
- Pinchable indicates whether the target can be pinched with draggable, resizable, scalable, rotatable.
- Groupable indicates Whether the targets can be moved in group with draggable, resizable, scalable, rotatable.
- Snappable indicates whether to snap to the guideline.
- OriginDraggable* indicates Whether to drag origin.
- Clippable indicates Whether to clip the target.
- Roundable indicates Whether to show and drag or double click border-radius.
- Support SVG Elements (svg, path, line, ellipse, g, rect, ...etc)
- Support Major Browsers
- Support 3d Transform
⚙️ Installation
📄 Documents
🚀 How to use
⚙️ Developments
The main project was made with and I used to make it lighter with umd.
For development and testing, check in packages/react-moveable.
Runs the app in the development mode. Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits. You will also see any lint errors in the console.
Files related to major features.
⭐️ Show Your Support
Please give a ⭐️ if this project helped you!
👏 Contributing
If you have any questions or requests or want to contribute to or other packages, please write the issue or give me a Pull Request freely.
🐞 Bug Report
If you find a bug, please report to us opening a new Issue on GitHub.
📝 License
This project is MIT licensed.
- Mount carmel urology
- Sporting game score
- Interlocking wire shelves
- Bape pop funko
- Mathnasium los angeles
A React Component that create Moveable, Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable, Groupable, Snappable.
The main project was made with and I used to make it lighter with umd.
Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits.
You will also see any lint errors in the console.
If you have any questions or requests or want to contribute to or other packages, please write the issue or give me a Pull Request freely.
Bug Report
If you find a bug, please report to us opening a new Issue on GitHub.
License
This project is MIT licensed.
Sours: https://github.com/daybrush/moveable/tree/master/packages/react-moveableMoveable
Moveable
Moveable is Draggable! Resizable! Scalable! Rotatable!
Constructor
new Moveable(parentElement, optionsopt)
- Source:
Name | Type | Default | Description |
---|---|---|---|
HTMLElement | SVGElement | |||
? | MoveableOptions |
Extends
Namespaces
- Clippable
- Draggable
- Group
- OriginDraggable
- Pinchable
- Resizable
- Rotatable
- Roundable
- Scalable
- Scrollable
- Snappable
- Warpable
Members
className
- Source:
You can specify the className of the moveable controlbox. (default: "")
Example
dragArea
- Source:
Add an event to the moveable area instead of the target for stopPropagation. (default: false, true in group)
Example
dragTarget
- Source:
The target(s) to drag Moveable target(s) (default: target)
Example
edge
- Source:
Resize, Scale Events at edges
Example
origin
- Source:
Whether or not the origin controlbox will be visible or not (default: true)
Example
padding
- Source:
Add padding around the target to increase the drag area. (default: null)
Example
passDragArea
- Source:
Set `pointerEvents: none;` css to pass events in dragArea. (default: false)
Example
target
- Source:
The target to indicate Moveable Control Box.
Example
zoom
- Source:
Zooms in the elements of a moveable. (default: 1)
Example
Methods
destroy() → {void}
- Source:
Remove the Moveable object and the events.
Example
Returns:
- Type
- void
dragStart(e)
- Source:
You can drag start the Moveable through the external `MouseEvent`or `TouchEvent`. (Angular: ngDragStart)
Name | Type | Description |
---|---|---|
MouseEvent | TouchEvent | external `MouseEvent`or `TouchEvent` |
Example
emit(eventName, paramopt) → {boolean}
- Source:
- Overrides:
Fires an event to call listeners.
Name | Type | Default | Description |
---|---|---|---|
string | ... | Event name | ||
? | TargetParam<any> | ... | Event parameter |
emit<Name extends keyof Events, Param = Events[Name]>(eventName) → {boolean}
Name | Type | Description |
---|---|---|
extends Param ? Name : never |
emit<Name extends keyof Events, Param = Events[Name]>(eventName, param) → {boolean}
Name | Type | Description |
---|---|---|
Name | ||
TargetParam<Param> |
Example
Returns:
If false, stop the event.
- Type
- boolean
getManager() → {MoveableManagerInterface<any, any>}
- Source:
Get a manager that manages the moveable's state and props.
Example
Returns:
- The Rect Info
- Type
- MoveableManagerInterface<any, any>
getRect() → {RectInfo}
- Source:
You can get the vertex information, position and offset size information of the target based on the container.
Example
Returns:
- The Rect Info
- Type
- RectInfo
hitTest(el) → {number}
- Source:
Hit test an element or rect on a moveable target.
Name | Type | Description |
---|---|---|
Element | HitRect | element or rect to test |
Example
Returns:
- Get hit test rate (rate > 0 is hitted)
- Type
- number
isDragging()
- Source:
Check if the moveable state is being dragged.
Example
- Source:
Whether the coordinates are inside Moveable
Name | Type | Description |
---|---|---|
number | x coordinate | |
number | y coordinate |
Example
Returns:
- True if the coordinate is in moveable or false
isMoveableElement(target)
- Source:
Check if the target is an element included in the moveable.
Name | Type | Description |
---|---|---|
Element | the target |
Example
off(eventNameopt, listeneropt) → {this}
- Source:
- Overrides:
Remove listeners registered in the event target.
Name | Type | Description |
---|---|---|
? | string | object | ... | Name of the event to be removed |
? | EventListener<Events[any], this> | ... | listener function of the event to be removed |
off<Name extends keyof Events, Param = Events[Name]>(eventName, listener) → {this}
Name | Type | Description |
---|---|---|
? | Name | |
? | EventListener<Param, this> |
off(events) → {this}
Name | Type | Description |
---|---|---|
EventHash<Events, this> |
Example
Returns:
- Type
- this
on(eventName, listeneropt) → {this}
- Source:
- Overrides:
Add a listener to the registered event.
Name | Type | Description |
---|---|---|
string | object | ... | Name of the event to be added | |
? | EventListener<Events[any], this> | ... | listener function of the event to be added |
on<Name extends keyof Events, Param = Events[Name]>(eventName, listener) → {this}
Name | Type | Description |
---|---|---|
Name | ||
EventListener<Param, this> |
on(events) → {this}
Name | Type | Description |
---|---|---|
EventHash<Events, this> |
Example
Returns:
- Type
- this
once<Name extends keyof Events & string, Param = Events[Name]>(eventName, listeneropt) → {Promise<OnEvent<Param, this>>}
- Source:
- Overrides:
Add a disposable listener and Use promise to the registered event.
Name | Type | Description |
---|---|---|
Name | Name of the event to be added | |
? | EventListener<Param, this> | disposable listener function of the event to be added |
Example
Returns:
- Type
- Promise<OnEvent<Param, this>>
request(ableName, paramopt, isInstantopt) → {Requester}
- Source:
- See:
Request able through a method rather than an event. At the moment of execution, requestStart is executed, and then request and requestEnd can be executed through Requester.
Name | Type | Default | Description |
---|---|---|---|
string | ableName | ||
? | IObject<any> | request to be able params. | |
? | boolean | If isInstant is true, request and requestEnd are executed immediately. |
Example
Returns:
- Able Requester. If there is no request in able, nothing will work.
- Type
- Requester
trigger<Name extends keyof Events>(eventName, paramopt) → {boolean}
- Source:
- Overrides:
Fires an event to call listeners.
Name | Type | Default | Description |
---|---|---|---|
Name | ... | Event name | ||
? | TargetParam<any> | ... | Event parameter |
trigger<Name extends keyof Events, Param = Events[Name]>(eventName) → {boolean}
Name | Type | Description |
---|---|---|
extends Param ? Name : never |
trigger<Name extends keyof Events, Param = Events[Name]>(eventName, param) → {boolean}
Name | Type | Description |
---|---|---|
Name | ||
TargetParam<Param> |
Example
Returns:
If false, stop the event.
- Type
- boolean
updateRect(typeopt, isTargetopt, isSetStateopt)
- Source:
If the width, height, left, and top of all elements change, update the shape of the moveable.
Name | Type | Default | Description |
---|---|---|---|
? | "Start" | "" | "End" | ||
? | boolean | ||
? | boolean |
Example
updateTarget(typeopt)
- Source:
If the width, height, left, and top of the only target change, update the shape of the moveable.
Name | Type | Description |
---|---|---|
? | "Start" | "" | "End" |
Example
Type Definitions
Able<Props extends IObject<any> = IObject<any>, Events extends IObject<any> = IObject<any>>
- Source:
Properties:
Name | Type | Description |
---|---|---|
string | ||
? | [key extends keyof Props]: any | |
? | [key extends keyof Events]: string | |
? | boolean | |
? | string | |
? | boolean | |
? | boolean | |
? | string[] | |
? | (moveable: any) => any | |
? | (moveable: any, renderer: Renderer) => any | |
? | (moveable: any, e: GestoTypes.OnDragStart) => any | |
? | (moveable: any, e: GestoTypes.OnDrag) => any | |
? | (moveable: any, e: GestoTypes.OnDragEnd) => any | |
? | (moveable: any, e: GestoTypes.OnPinchStart) => any | |
? | (moveable: any, e: GestoTypes.OnPinch) => any | |
? | (moveable: any, e: GestoTypes.OnPinchEnd) => any | |
? | (moveable: any, e: any) => boolean | |
? | (moveable: any, e: GestoTypes.OnDragStart) => any | |
? | (moveable: any, e: GestoTypes.OnDrag) => any | |
? | (moveable: any, e: GestoTypes.OnDragEnd) => any | |
? | (moveable: any, e: any) => boolean | |
? | (moveable: any, e: GestoTypes.OnDragStart) => any | |
? | (moveable: any, e: GestoTypes.OnDrag) => any | |
? | (moveable: any, e: GestoTypes.OnDragEnd) => any | |
? | (moveable: any, e: GestoTypes.OnPinchStart) => any | |
? | (moveable: any, e: GestoTypes.OnPinch) => any | |
? | (moveable: any, e: GestoTypes.OnPinchEnd) => any | |
? | (moveable: any, e: any) => boolean | |
? | (moveable: any, e: GestoTypes.OnDragStart) => any | |
? | (moveable: any, e: GestoTypes.OnDragStart) => any | |
? | (moveable: any, e: GestoTypes.OnDragEnd) => any | |
? | (moveable: any, e: any) => any | |
? | (moveable: any, e: any) => any | |
? | (moveable: any, e: any) => any | |
? | (moveable: any, e: any) => any | |
? | (moveable: any) => AbleRequester |
Type:
AbleRequestParam
- Source:
Properties:
Name | Type | Description |
---|---|---|
? | boolean | Run the request instantly. (requestStart, request, requestEnd happen at the same time) |
any |
Type:
DefaultOptions
- Source:
Properties:
Name | Type | Description |
---|---|---|
? | SVGElement | HTMLElement | null | The target(s) to indicate Moveable Control Box. (default: null) |
? | SVGElement | HTMLElement | null | The target(s) to drag Moveable target(s) (default: target) |
? | SVGElement | HTMLElement | null | Moveable Container. Don't set it. (default: parentElement) |
? | HTMLElement | null | Moveable Portal Container to support other frameworks. Don't set it. (default: container) |
? | HTMLElement | null | Moveable Root Container (No Transformed Container). (default: container) |
? | number | Zooms in the elements of a moveable. (default: 1) |
? | Array<string | number> | string | "" | The default transformOrigin of the target can be set in advance. (default: "") |
? | boolean | Whether to scale and resize through edge lines. (default: false) |
? | Able[] | You can add your custom able. (default: []) |
? | string | You can specify the className of the moveable controlbox. (default: "") |
? | number | Minimum distance to pinch. (default: 20) |
? | boolean | Whether the container containing the target becomes a pinch. (default: true) |
? | boolean | Lets generate events of ables at the same time. (like Resizable, Scalable) (default: false) |
? | boolean | Checks whether this is an element to input text or contentEditable, and prevents dragging. (default: false) |
? | string | add nonce property to style for CSP (default: "") |
? | number | string | You can set the translateZ value of moveable (default: 50) |
? | Record<string, any> | You can use props in object format or custom props. (default: object) |
Type:
DragAreaOptions
- Source:
Properties:
Name | Type | Description |
---|---|---|
? | boolean | Instead of firing an event on the target, we add it to the moveable control element. You can use click and clickGroup events. (default: if group, true, else false) |
? | boolean | Set `pointerEvents: none;` css to pass events in dragArea. |
Type:
HitRect
- Source:
Properties:
Name | Type | Description |
---|---|---|
number | top position | |
number | left position | |
? | number | target's width |
? | number | target's height |
Type:
MoveableDefaultProps
- Source:
Properties:
Name | Type | Description |
---|---|---|
? | MoveableRefType | ArrayFormat<MoveableRefType> |
Type:
MoveableOptions
- Source:
Properties:
Name | Type | Description |
---|---|---|
? | boolean | Whether to show and drag border-radius |
? | boolean | % Can be used instead of the absolute px |
? | number[] | Minimum number of round controls. It moves in proportion by control. [horizontal, vertical] (default: [0, 0]) |
? | number[] | Maximum number of round controls. It moves in proportion by control. [horizontal, vertical] (default: [4, 4]) |
? | boolean | Whether you can add/delete round controls by double-clicking a line or control. (default: true) |
? | boolean | * Whether to drag origin (default: false) |
? | boolean | % Can be used instead of the absolute px (default: true) |
? | boolean | Whether to clip the target. |
? | string | You can force the custom clipPath. (defaultClipPath < style < customClipPath < dragging clipPath) |
? | string | If clippath is not set, the default value can be set. (defaultClipPath < style < customClipPath < dragging clipPath) |
? | boolean | % Can be used instead of the absolute px (`rect` not possible) (default: false) |
? | boolean | When dragging the target, the clip also moves. (default: true) |
? | boolean | You can drag the clip by setting clipArea. (default: false) |
? | boolean | Whether the clip is bound to the target. (default: false) |
? | Array<string | number> | Add clip guidelines in the vertical direction. (default: []) |
? | Array<string | number> | Add clip guidelines in the horizontal direction. (default: []) |
? | number | Distance value that can snap to clip guidelines. (default: 5) |
? | number | Sets the initial rotation of the group. (default 0) |
? | string | Sets the initial transform origin of the group. (default "50% 50%") |
? | boolean | |
? | boolean | Whether or not target can be scrolled to the scroll container (default: false) |
? | MoveableRefType<HTMLElement> | The container to which scroll is applied (default: container) |
? | number | Expand the range of the scroll check area. (default: 0) |
? | (e: {scrollContainer: HTMLElement, direction: number[]}) => number[] | Sets a function to get the scroll position. (default: Function) |
? | boolean | Array<"rotatable" | "resizable" | "scalable"> | Whether or not target can be pinched with draggable, resizable, scalable, rotatable. (default: false) |
? | boolean | Whether or not target can be warped. (default: false) |
? | boolean | string[] | Set directions to show the control box. (default: ["n", "nw", "ne", "s", "se", "sw", "e", "w"]) |
? | boolean | string[] | Set directions to show the control box. (default: false if rotatable, ["n", "nw", "ne", "s", "se", "sw", "e", "w"] otherwise) |
? | boolean | Whether or not target can be rotated. (default: false) |
? | "top" | "bottom" | "left" | "right" | "top-right" | "top-left" | "bottom-right" | "bottom-left" | "left-top" | "left-bottom" | "right-top" | "right-bottom" | "none" | You can specify the position of the rotation. (default: "top") |
? | number | throttle of angle(degree) when rotate. (default: 0) |
? | MoveableRefType | ArrayFormat<MoveableRefType> | false | Set additional rotationTargets. |
? | boolean | string[] | Set directions to show the control box. (default: false if rotatable, ["n", "nw", "ne", "s", "se", "sw", "e", "w"] otherwise) |
? | boolean | Whether or not target can be scaled. (default: false) |
? | number | throttle of scaleX, scaleY when scale. (default: 0) |
? | boolean | When resize or scale, keeps a ratio of the width, height. (default: false) |
? | boolean | string[] | Set directions to show the control box. (default: false if rotatable, ["n", "nw", "ne", "s", "se", "sw", "e", "w"] otherwise) |
? | boolean | Whether or not target can be resized. (default: false) |
? | number | throttle of width, height when resize. (default: 0) |
? | boolean | When resize or scale, keeps a ratio of the width, height. (default: false) |
? | boolean | Whether or not target can be dragged. (default: false) |
? | number | throttle of x, y when drag. (default: 0) |
? | number | throttle of angle(degree) of x,y when drag. (default: 0) |
? | number | start angle(degree) of x,y for throttleDragRotate when drag. (default: 0) |
? | boolean | Whether to move by dragging the edge line |
? | MoveableRefType | ArrayFormat<MoveableRefType> |
Type:
OnBeforeRender
- Source:
Properties:
Name | Type | Description |
---|---|---|
MoveableManagerInterface<any, any> | The Moveable instance | |
MoveableManagerInterface<any, any> | The Moveable instance | |
HTMLElement | SVGElement | The Moveable target | |
number | The horizontal coordinate within the application's client area at which the event occurred. | |
number | The vertical coordinate within the application's client area at which the event occurred. | |
IObject<any> | Objects that can send information to the following events. | |
any | The mouse or touch input event that is invoking the moveable event | |
boolean | Whether or not it is being pinched. |
Type:
OnBeforeRenderEnd
- Source:
Properties:
Name | Type | Description |
---|---|---|
MoveableManagerInterface<any, any> | The Moveable instance | |
MoveableManagerInterface<any, any> | The Moveable instance | |
HTMLElement | SVGElement | The Moveable target | |
number | The horizontal coordinate within the application's client area at which the event occurred. | |
number | The vertical coordinate within the application's client area at which the event occurred. | |
IObject<any> | Objects that can send information to the following events. | |
any | The mouse or touch input event that is invoking the moveable event | |
boolean | Whether or not it is being dragged. | |
boolean | Whether or not it is being pinched. |
Type:
OnBeforeRenderGroup
- Source:
Properties:
Name | Type | Description |
---|---|---|
MoveableManagerInterface<any, any> | The Moveable instance | |
MoveableManagerInterface<any, any> | The Moveable instance | |
HTMLElement | SVGElement | The Moveable target | |
number | The horizontal coordinate within the application's client area at which the event occurred. | |
number | The vertical coordinate within the application's client area at which the event occurred. | |
IObject<any> | Objects that can send information to the following events. | |
any | The mouse or touch input event that is invoking the moveable event | |
boolean | Whether or not it is being pinched. | |
Array<HTMLElement | SVGElement> | targets set to group. | |
OnBeforeRender[] | children's `beforeRender` events |
Type:
OnBeforeRenderGroupEnd
- Source:
Properties:
Name | Type | Description |
---|---|---|
MoveableManagerInterface<any, any> | The Moveable instance | |
MoveableManagerInterface<any, any> | The Moveable instance | |
HTMLElement | SVGElement | The Moveable target | |
number | The horizontal coordinate within the application's client area at which the event occurred. | |
number | The vertical coordinate within the application's client area at which the event occurred. | |
IObject<any> | Objects that can send information to the following events. | |
any | The mouse or touch input event that is invoking the moveable event | |
boolean | Whether or not it is being dragged. | |
boolean | Whether or not it is being pinched. | |
Array<HTMLElement | SVGElement> | targets set to group. |
Type:
OnBeforeRenderGroupStart
- Source:
Properties:
Name | Type | Description |
---|---|---|
MoveableManagerInterface<any, any> | The Moveable instance | |
MoveableManagerInterface<any, any> | The Moveable instance | |
HTMLElement | SVGElement | The Moveable target | |
number | The horizontal coordinate within the application's client area at which the event occurred. | |
number | The vertical coordinate within the application's client area at which the event occurred. | |
IObject<any> | Objects that can send information to the following events. | |
any | The mouse or touch input event that is invoking the moveable event | |
boolean | Whether or not it is being pinched. | |
(transform: string | string[]) => any | Set your original transform. | |
Array<HTMLElement | SVGElement> | targets set to group. | |
OnBeforeRenderStart[] | children's `beforeRenderStart` events |
Type:
OnBeforeRenderStart
- Source:
Properties:
Name | Type | Description |
---|---|---|
MoveableManagerInterface<any, any> | The Moveable instance | |
MoveableManagerInterface<any, any> | The Moveable instance | |
HTMLElement | SVGElement | The Moveable target | |
number | The horizontal coordinate within the application's client area at which the event occurred. | |
number | The vertical coordinate within the application's client area at which the event occurred. | |
IObject<any> | Objects that can send information to the following events. | |
any | The mouse or touch input event that is invoking the moveable event | |
boolean | Whether or not it is being pinched. | |
(transform: string | string[]) => any | Set your original transform. |
Type:
OnClick
- Source:
Properties:
Name | Type | Description |
---|---|---|
MoveableManagerInterface<any, any> | The Moveable instance | |
MoveableManagerInterface<any, any> | The Moveable instance | |
HTMLElement | SVGElement | The Moveable target | |
number | The horizontal coordinate within the application's client area at which the event occurred. | |
number | The vertical coordinate within the application's client area at which the event occurred. | |
IObject<any> | Objects that can send information to the following events. | |
any | The mouse or touch input event that is invoking the moveable event | |
Element | Clicked target. | |
boolean | Whether the clicked target is moveable target. | |
boolean | Whether the clicked target is a child of moveable target. | |
boolean | Whether it is double-click |
Type:
OnClickGroup
- Source:
Properties:
Name | Type | Description |
---|---|---|
MoveableManagerInterface<any, any> | The Moveable instance | |
MoveableManagerInterface<any, any> | The Moveable instance | |
HTMLElement | SVGElement | The Moveable target | |
number | The horizontal coordinate within the application's client area at which the event occurred. | |
number | The vertical coordinate within the application's client area at which the event occurred. | |
IObject<any> | Objects that can send information to the following events. | |
any | The mouse or touch input event that is invoking the moveable event | |
Element[] | targets set to group. | |
Element | Clicked target. | |
boolean | Whether the clicked target is on the targets set in the group. | |
boolean | Whether the clicked target is a child of the targets set in the group. | |
number | The corresponding index among the targets set as a group. | |
boolean | Whether it is double-click |
Type:
OnEndEvent
- Source:
Properties:
Name | Type | Description |
---|---|---|
MoveableManagerInterface<any, any> | The Moveable instance | |
MoveableManagerInterface<any, any> | The Moveable instance | |
HTMLElement | SVGElement | The Moveable target | |
number | The horizontal coordinate within the application's client area at which the event occurred. | |
number | The vertical coordinate within the application's client area at which the event occurred. | |
IObject<any> | Objects that can send information to the following events. | |
any | The mouse or touch input event that is invoking the moveable event | |
any | undefined | This is the last dragged event. No, if you haven't dragged. | |
boolean | Whether this moved | |
boolean | Whether it is double-click |
Type:
OnEvent
- Source:
Properties:
Name | Type | Description |
---|---|---|
MoveableManagerInterface<any, any> | The Moveable instance | |
MoveableManagerInterface<any, any> | The Moveable instance | |
HTMLElement | SVGElement | The Moveable target | |
number | The horizontal coordinate within the application's client area at which the event occurred. | |
number | The vertical coordinate within the application's client area at which the event occurred. | |
IObject<any> | Objects that can send information to the following events. | |
any | The mouse or touch input event that is invoking the moveable event |
Type:
OnRender
- Source:
Properties:
Name | Type | Description |
---|---|---|
MoveableManagerInterface<any, any> | The Moveable instance | |
MoveableManagerInterface<any, any> | The Moveable instance | |
HTMLElement | SVGElement | The Moveable target | |
number | The horizontal coordinate within the application's client area at which the event occurred. | |
number | The vertical coordinate within the application's client area at which the event occurred. | |
IObject<any> | Objects that can send information to the following events. | |
any | The mouse or touch input event that is invoking the moveable event | |
boolean | Whether or not it is being pinched. |
Type:
OnRenderEnd
- Source:
Properties:
Name | Type | Description |
---|---|---|
MoveableManagerInterface<any, any> | The Moveable instance | |
MoveableManagerInterface<any, any> | The Moveable instance | |
HTMLElement | SVGElement | The Moveable target | |
number | The horizontal coordinate within the application's client area at which the event occurred. | |
number | The vertical coordinate within the application's client area at which the event occurred. | |
IObject<any> | Objects that can send information to the following events. | |
any | The mouse or touch input event that is invoking the moveable event | |
boolean | Whether or not it is being dragged. | |
boolean | Whether or not it is being pinched. |
Type:
OnRenderGroup
- Source:
Properties:
Name | Type | Description |
---|---|---|
MoveableManagerInterface<any, any> | The Moveable instance | |
MoveableManagerInterface<any, any> |
Moveable react
Moveable is Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable, Groupable, Snappable
The main project was made with and I used to make it lighter with umd.
Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits.
You will also see any lint errors in the console.
Files related to major features.
Sours: https://github.com/daybrush/moveableimport React from "react";
import ReactDOM from "react-dom";
import Moveable from "react-moveable";
import { ref } from "framework-utils";
import { Frame } from "scenejs";
import "./styles.css";
class App extends React.Component {
frame = new Frame({
width: "250px",
height: "200px",
left: "0px",
top: "0px",
transform: {
rotate: "0deg",
scaleX: 1,
scaleY: 1,
matrix3d: [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]
Similar news:
- Hand contracture carrot
- Gigi the planner
- Sdsu tuition cost
- Plover wi campgrounds
- Dio brando stickers
- Dvd romance movies
- 6mm potentiometer knobs
- Ebay radio control
- Tfs design gallery
He was a handsome dude with a photogenic face, dark blond hair and a trendy, fashionable hairstyle. He was wearing black skinny jeans and a black T-shirt with a bright yellow "Rock" lettering all over his chest. In Sergei's manners, in his voice and intonations, there was a kind of peculiar charm and charm.
As soon as Sergey went on stage and took the microphone from the presenter, he went up to the DJ and whispered.