Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@losting/timeline

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@losting/timeline

canvas timeline

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
42
decreased by-43.24%
Maintainers
1
Weekly downloads
 
Created
Source

timeline

canvas 时间轴

使用

npm install @moe/timeline
<canvas id="timeline" width="1000px" height="70px" style="background-color: rgba(0, 0, 0, .5);"></canvas>
import MoeTimeline from '@losting/timeline';

const timeline = new MoeTimeline('timeline');
timeline.create({
  startTime: 1651823833000,
  endTime: 1651910233000,
  currentTime: 1651829532000,
  area: [{
    startTime: 1651827433000,
    endTime: 1651829413000,
    bgColor: '#00AEEC55'
  },{
    startTime: 1651829533000,
    endTime: 1651832533000,
    bgColor: '#00AEEC55'
  }],
});

timeline.on('change', (time) => {
  console.log('selected time:', time);
})

方法

属性说明
create创建timeline
on事件监听,change: 当前选择时间改变触发,返回值当前选择时间
create方法参数 Object
参数类型是否必填说明
startTimenumber时间轴起始时间
endTimenumber时间轴终止时间
currentTimenumber当前所在时间
areasarray阴影区域。参数:startTime(阴影区域开始时间点), endTime(阴影区域结束时间点),bgColor(背景颜色,需要透明背景色)

Keywords

FAQs

Package last updated on 09 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc