@losting/timeline
Advanced tools
Comparing version 2.0.5 to 2.1.0-0
{ | ||
"name": "@losting/timeline", | ||
"version": "2.0.5", | ||
"version": "2.1.0-0", | ||
"description": "canvas timeline", | ||
"main": "lib/timeline.cjs.js", | ||
"module": "lib/timeline.esm.js", | ||
"types": "lib/timeline.d.ts", | ||
"exports": { | ||
"import": "./lib/timeline.esm.js", | ||
"require": "./lib/timeline.cjs.js", | ||
"default": "./lib/timeline.esm.js" | ||
}, | ||
"type": "module", | ||
"main": "./dist/timeline.iife.js", | ||
"module": "./dist/timeline.es.js", | ||
"types": "./types/timeline.d.ts", | ||
"scripts": { | ||
"dev": "rollup -c -w", | ||
"demo-server": "http-server -p 8080 -o example -c-1", | ||
"build": "rollup -c", | ||
"test": "jest --no-cache" | ||
"dev": "vite", | ||
"build": "tsc && vite build", | ||
"preview": "vite preview", | ||
"release": "release-it", | ||
"prepublishOnly": "pnpm run build" | ||
}, | ||
"files": [ | ||
"LICENSE", | ||
"dist", | ||
"types", | ||
"example/demo.png", | ||
"README.md" | ||
], | ||
"keywords": [ | ||
@@ -38,19 +42,10 @@ "timeline", | ||
"devDependencies": { | ||
"@rollup/plugin-commonjs": "^21.1.0", | ||
"@rollup/plugin-node-resolve": "^13.2.1", | ||
"@rollup/plugin-typescript": "^8.3.2", | ||
"@types/jest": "^27.4.1", | ||
"dayjs": "^1.11.2", | ||
"http-server": "^14.1.0", | ||
"jest": "^27.5.1", | ||
"@types/lodash.throttle": "^4.1.7", | ||
"dayjs": "^1.11.6", | ||
"lodash.throttle": "^4.1.1", | ||
"mitt": "^3.0.0", | ||
"rollup": "^2.70.2", | ||
"rollup-plugin-dts": "^4.2.2", | ||
"rollup-plugin-sourcemaps": "^0.6.3", | ||
"rollup-plugin-terser": "^7.0.2", | ||
"ts-jest": "^27.1.4", | ||
"tslib": "^2.3.1", | ||
"typescript": "^4.6.3" | ||
"release-it": "^15.5.0", | ||
"typescript": "^4.8.4", | ||
"vite": "^3.2.3" | ||
} | ||
} |
<!-- | ||
* @Author: losting | ||
* @Date: 2022-05-07 15:31:25 | ||
* @LastEditTime: 2022-05-18 14:26:46 | ||
* @LastEditors: losting | ||
* @LastEditTime: 2022-11-14 17:51:32 | ||
* @LastEditors: thelostword | ||
* @Description: | ||
@@ -13,3 +13,3 @@ * @FilePath: \timeline\README.md | ||
### 使用 | ||
### 使用 es module | ||
``` shell | ||
@@ -50,2 +50,27 @@ npm install @losting/timeline | ||
### 直接使用 | ||
``` html | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Document</title> | ||
<script src="./dist/timeline.iife.js"></script> | ||
</head> | ||
<body> | ||
<div id="root" style="width: 100%;height: 70px;"> | ||
<canvas id="timeline"></canvas> | ||
</div> | ||
<script> | ||
const timeline = new window['$timeline']('timeline', { | ||
fill: true, | ||
}); | ||
// .... | ||
</script> | ||
</body> | ||
</html> | ||
``` | ||
### TimeLine options | ||
@@ -64,4 +89,4 @@ | 属性 | 类型 | 默认值 | 说明 | | ||
| pointWidth | number | 3 | 当前时间指针宽度 | | ||
| fps | number | 60 | 绘制帧率。数字越大越流畅 | | ||
| zoom | number | 2 | 缩放比,1~9之间的正整数 | | ||
| fps | number | 60 | 帧数 | | ||
| zoom | number | 2 | 初始缩放值,`minZoom` ~ `maxZoom` 之间(包含)的正整数 | | ||
| maxZoom | number | 9 | 最大缩放限制,1~9之间的正整数 | | ||
@@ -75,4 +100,4 @@ | minZoom | number | 1 | 最小缩放限制,1~9之间的正整数 | | ||
| --- | --- | | ||
| draw | 生成时间轴,参数:object,返回值:无 | | ||
| on | 事件监听。参数:timeUpdate, 返回值:当前指向时间 | | ||
| draw | 生成时间轴,返回值:无 | | ||
| on | 事件监听。 | | ||
@@ -85,2 +110,13 @@ #### draw方法 | ||
#### on 方法 | ||
``` js | ||
timeline.on(eventName, (value) => { | ||
// ... | ||
}); | ||
``` | ||
| eventName | value | | ||
| --- | --- | | ||
| timeUpdate | currentTime | | ||
#### areas | ||
@@ -87,0 +123,0 @@ | 参数 | 类型 | 是否必填 | 说明 | |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
7
872
124
Yes
70834
8
1