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

turbotouchpredictor

v0.0.2

Published

Algorithm to compensate latency by extrapolating trajectories.

Downloads

15

Readme

NPM Version npm downloads

TurboTouch predictor typescript version

Provides a typescript implementation for the TurboTouch predictor.

Install

npm install turbotouchpredictor

Minimal example

import { TurboTouchPredictor } from 'TurboTouchPredictor'

let ttpPredictor = new TurboTouchPredictor();

// Amount of prediction in ms. Allowed values: 0, 16, 32, 48, 64
ttpPredictor.setAmountOfCompensation(32);

let predictedPoint = ttpPredictor.predict({x: 0, y: 0, t: 0, state: "Interacting"});

Doc

constructor

new TurboTouchPredictor()

predict

predict(e): any

Predicts a point from the current lagging one

Parameters

| Name | Type | Description | | :------ | :------ | :------ | | e | Object | Lagging event | | e.state | string | "Interacting" or "NotInteracting" | | e.t | number | timestamp in nanoseconds | | e.x | number | x coordinate in pixels | | e.y | number | y coordinate in pixels |

Returns

any

  • predicted point p, p.x: x corrdinate, p.y: t corrdinate, p.t: timestamp in nanoseconds

reset

reset(): void

setAmountOfCompensation

setAmountOfCompensation(comp): void

Sets the parameters of the predictor for the given amount of compensation

Parameters

| Name | Type | Description | | :------ | :------ | :------ | | comp | number | Compensation amount in ms. Allowed values: 0, 16, 32, 48, 64 |

Related publication

DOI

@inproceedings{10.1145/3242587.3242646,
    author = {Nancel, Mathieu and Aranovskiy, Stanislav and Ushirobira, Rosane and Efimov, Denis and Poulmane, Sebastien and Roussel, Nicolas and Casiez, G\'{e}ry},
    title = {Next-Point Prediction for Direct Touch Using Finite-Time Derivative Estimation},
    year = {2018},
    isbn = {9781450359481},
    publisher = {Association for Computing Machinery},
    address = {New York, NY, USA},
    url = {https://doi.org/10.1145/3242587.3242646},
    doi = {10.1145/3242587.3242646},
    abstract = {End-to-end latency in interactive systems is detrimental to performance and usability, and comes from a combination of hardware and software delays. While these delays are steadily addressed by hardware and software improvements, it is at a decelerating pace. In parallel, short-term input prediction has shown promising results in recent years, in both research and industry, as an addition to these efforts. We describe a new prediction algorithm for direct touch devices based on (i) a state-of-the-art finite-time derivative estimator, (ii) a smoothing mechanism based on input speed, and (iii) a post-filtering of the prediction in two steps. Using both a pre-existing dataset of touch input as benchmark, and subjective data from a new user study, we show that this new predictor outperforms the predictors currently available in the literature and industry, based on metrics that model user-defined negative side-effects caused by input prediction. In particular, we show that our predictor can predict up to 2 or 3 times further than existing techniques with minimal negative side-effects.},
    booktitle = {Proceedings of the 31st Annual ACM Symposium on User Interface Software and Technology},
    pages = {793–807},
    numpages = {15},
    keywords = {touch input, latency, lag, prediction technique},
    location = {Berlin, Germany},
    series = {UIST '18}
}