百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
E

egjs-axes

> 编程语言
开源

一个模块,用于将通过触摸屏或鼠标等各种输入设备输入的用户操作信息转换为逻辑虚拟坐标。

188 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

一个模块,用于将通过触摸屏或鼠标等各种输入设备输入的用户操作信息转换为逻辑虚拟坐标。

@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 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScriptaxiscartesiancoordinateegjs

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

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