Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
E

egjs-axes

> 编程语言
Open source

A module used to change the information of user action entered by various input devices such as touch screen or mouse into the logical virtual coordinates.

188 stars0 likes2 views
WebsiteGitHub

About

A module used to change the information of user action entered by various input devices such as touch screen or mouse into the logical virtual coordinates.

@egjs/axes

Demo / Documentation / Other components

You can easily create a UI that responds to user actions.


✨ Features

  • Axes translate user action entered by various input devices into the virtual coordinate system.
  • You can create an UI that responds to user actions.
  • Provides five input types. These can be associated with a user interface.
    • PanInput
    • RotatePanInput
    • PinchInput
    • WheelInput
    • MoveKeyInput
  • Provides six types of events generated by InputTypes.
    • hold
    • change
    • release
    • animationStart
    • animationEnd
    • finish
  • Moreover, you can create your own custom InputTypes!

⚙️ Installation

npm

bash
$ npm install @egjs/axes

CDN

  • jsDelivr: https://cdn.jsdelivr.net/npm/@egjs/axes/dist/
  • unpkg: https://unpkg.com/@egjs/axes@latest/dist/
  • cdnjs: https://cdnjs.com/libraries/egjs-axes

Quick Start

1. Set up your HTML

xml

2. Load files or import library

ES5
xml
javascript
var Axes = eg.Axes;
var PanInput = Axes.PanInput;
var PinchInput = Axes.PinchInput;
var WheelInput = Axes.WheelInput;
var MoveKeyInput = Axes.MoveKeyInput;
ES6+
javascript
import Axes, {PanInput, PinchInput, WheelInput, MoveKeyInput} from "@egjs/axes";

3. Initialize Axes

javascript
// create eg.Axes with option
const axes = new Axes({
  something1: { range: [0, 100] },
  something2: { range: [0, 100] },
  somethingN: { range: [-200, 200] }
});

4. Attach event handlers

javascript
axes.on({
 "change": evt => /* ... */
});

5. Initialize InputTypes to use

javascript
const panInput = new PanInput("#area");
const wheelInput = new WheelInput("#wArea");
const pinchInput = new PinchInput("#pArea");
const movekeyInput = new MoveKeyInput("#mArea");

6. Connect eg.Axes and InputTypes

javascript
axes.connect(["something2", "somethingN"], panInput);
axes.connect(["something1"], wheelInput);
axes.connect(["something2"], pinchInput);
axes.connect(["something1", "something2"], movekeyInput);

7. Enjoy!

You can change the value of the axis through touch screen, mouse or anything else.

Supported Browsers

10+ Latest Latest Latest 7+ 2.3+(except 3.x)

Dependency

egjs-axes has the dependencies for the following libraries:

eg.Component eg.Agent
3.0.1+ 2.2.1+

Demos

Check our Demos.

Documentation

See Documentation page.

Contributing

See CONTRIBUTING.md.

Feedback & Bug Report

Please file an Issue.

License

@egjs/axes is released under the MIT license.

…

      

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

TypeScriptaxiscartesiancoordinateegjs

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言