npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@cpvrt/cp-record-player

v1.0.30

Published

the record player from cpvrt

Readme

CpvrtRecordPlayer

Install

使用npm installyarn install进行依赖包安装.
使用tsc进行打包, 生成文件位于./dist/下, 更多见./tsconfig.json.

Usage

在项目中使用npm或者yarn进行安装

npm install @cpvrt/cp-record-player

yarn add @cpvrt/cp-record-player

从包中引用, 例如:

import {Component, Prop, Ref, Vue} from "vue-property-decorator";
import {getCarTypeInfos, getMapTypeInfos, getTestRecordData} from "../../api/data";
import {
  RecordPlayerArgs,
  RecordPlayer,
  Map,
  Car,
  DataStruct,
  Progress
} from "@cpvrt/cp-record-player";

@Component({})
export default class CpvrtRecordPlayer extends Vue {
  private playerArgs: RecordPlayerArgs;
  private player: RecordPlayer;
  @Ref('canvas')
  private readonly canvas: HTMLCanvasElement;
  @Ref('canvas_parent')
  private readonly canvasParent: HTMLDivElement;

  @Prop({default: 12781537, type: Number, required: true})
  recordId: number;
  @Prop({default: 1, type: Number, required: false})
  defaultMultiple: number;

  mounted(): void {
    this.canvas.width = this.canvasParent.offsetWidth;
    this.canvas.height = this.canvasParent.offsetHeight;

    getMapTypeInfos().then(map_res => {
      getCarTypeInfos().then(car_res => {
        getTestRecordData().then(res => {
          // 配置静态地图以及车辆变量
          Map.SetMapTypeInfos(map_res.data.fn_data);
          Car.SetCarTypeInfos(car_res.data.fn_data);

          // 创建入参
          this.playerArgs = new RecordPlayerArgs(
            this.canvas,  // canvasNode  或 vue中的this.$refs.canvas
            'subject2',   // 地图名称
            [
              // 车辆信息
              new DataStruct.CarInfo(  
                // 行车记录
                new DataStruct.RecordData(
                  res.data.position_curves,
                  res.data.rotation_curves
                ),
                // 车辆名称
                'default',
                // 是否显示轨迹
                true
              )
            ]);
          this.playerArgs.uiModules = [
            new Progress(40)  // 进度条模块
          ];
          // 设置默认缩放倍数
          this.playerArgs.zoom.multiple = this.defaultMultiple;

          // 实例化播放器
          this.player = new RecordPlayer(this.playerArgs);
        });
      });
    });
  }
}

Develop && Todo list

  • 微信canvas相关适配
  • carInfo & mapInfo 的进一步提取以及完善
  • carTypeInfo & mapTypeInfo 的初始化加载方式优化
  • tip 组件完善
  • 其他 module
  • 轨迹点滤波
  • record 读取自动化
  • 外观相关适配和优化

Publish

注册npm账号并加入cpvrt, 之后再publish. publish之前注意升版本号, 版本号的管理规范暂时没有, 开发人员之间务必做好相互协同.