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 🙏

© 2024 – Pkg Stats / Ryan Hefner

castiron

v2.3.2

Published

castiron sdk

Downloads

15

Readme

Castiron SDK

Socket

runtime 环境 websocket 连接

    import { Socket } from 'castiron'

    const options = {
        "wsUrl": "ws://10.168.1.233:8765", // websocket 地址
    };

    const socket = new Socket(options)

    socket.on('data', (data) => {
        // 分析结果数据
        console.log(data);
    });

    socket.on('error', (data) => {
        // 错误信息
    });

on(eventName: string, cb: Function)

注册监听事件

  • eventName
    1. open: socket 连接上
    2. close: socket 已关闭
    3. error: socket 错误
    4. data: 数据信息

off(eventName: string, cb: Function)

移除事件监听

disconnect()

关闭 socket

setWsUrl(wsUrl: string)

变更 socket 地址

VideoPlayer

播放器

    import { VideoPlayer } from 'castiron'

    const config = {
        "wsUrl": "ws://10.168.1.233:8765", // websocket 地址
        "el": "#player"
    }

    const player = new VideoPlayer(config)

    player.play();

    // 监听分析结果信息
    player.socket.on('data', (data) => {
        console.log(data);
    });

on(eventName: string, cb: Function)

注册监听事件

  • eventName:
    1. canvasAttr: cavnas 宽高变化

off(eventName: string, cb: Function)

移除事件监听

play()

开始播放

pause()

暂停播放

destroy()

销毁播放器

imageCanvas

视频播放的 canvas 的环境

poseCanvas

骨骼点绘画的 canvas 的环境

configCanvas

graph 配置信息绘画的 canvas 的环境

resultCanvas

分析结果绘画的 canvas 环境

canvasWidth

canvas 宽度

canvasHeight

canvas 高度

status

当前视频流的播放状态: pending, running, pauseing, closed

poseStatus: pending, running, pauseing, closed

当前骨骼点的播放状态

socket

socket 实例(如果传递了 wsUrl 参数就会有此属性)

API

API 接口

    import { API } from 'castiron'

    const config = {
        "bootstrapServer": "http://10.168.1.233:8000"
    }

    const api = new API(config)

    api.getSchedulerGraph().then(graph => {
        console.log(graph);
    });

getSchedulerGraph()

获取当前使用的 graph 配置新

setSchedulerGraph(params: GraphConfig)

设置新的 graph 配置信息

restartScheduler()

重启调度器