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

three.signal-line

v1.1.8

Published

library for three.js which using for creating-lines, sending signals (particles) on lines, adding labels on lines, ability to interact with lines (hovering, selecting), adding Controller for using many lines and for easy working with that lines.

Downloads

22

Readme


NPM version Codecov CircleCI GitHub stars

Three.Signal-Line

three.signal-line is a JavaScript package that provides a signal line component for the popular 3D rendering library, Three.js. It allows you to create animated signal lines in your Three.js scenes with customizable colors, speeds, sizes, and more.

Features

  • Animated Signal Lines: Create visually appealing animated signal lines in your Three.js scenes.
  • Customizable Options: Control the appearance and behavior of signal lines with customizable options such as color, speed, size, opacity, and texture.
  • Backward Movement: Choose whether the signal lines move forward or backward along their paths.
  • Texture Support: Apply textures to signal lines for enhanced visual effects.
  • Smooth Animation: Signal lines smoothly transition between points, creating fluid animations.
  • Easy Integration: The package integrates seamlessly with Three.js, making it easy to incorporate signal lines into your existing Three.js projects.

The package also have nice some things:

  • Backwards compatibility for Node.js-style (CommonJS) imports
  • Both strict and flexible typescript configurations available
  • Collocated, atomic, concurrent unit tests with AVA
  • Source-mapped code coverage reports with nyc
  • Configurable code coverage testing (for continuous integration)
  • Automatic linting and formatting using TSLint and Prettier
  • Automatically check for known vulnerabilities in your dependencies with nsp

Installation

You can install Three.Signal-Line via npm or yarn:

npm install three.signal-line

or

yarn add three.signal-line

Usage

To use Three.Signal-Line, you need to have Three.js already set up in your project. Once you have imported the required dependencies, you can create a signal line by providing the necessary options and a line geometry:

import { SignalLine } from 'three.signal-line';

// Create a Three.js scene
const scene = new THREE.Scene();

// Create options for the SignalLine
const options = {
  linePath: [
    new THREE.Vector3(0, 0, 0),
    new THREE.Vector3(1, 1, 1),
    new THREE.Vector3(2, 2, 2),
  ],
  lineType: LINE_TYPE.NORMAL,
  materialOptions: {
    color: 0xff0000,
    opacity: 1.0,
    blending: THREE.NormalBlending,
    transparent: true,
    depthWrite: true,
    lineWidth: 2,
  },
  isDebug: false,
};

// Create a new SignalLine instance
const signalLine = new SignalLine(options, scene);

Sending Signals:

To sending signals you should pass signal options by using send method:

// Define the options for the signal
const options = {
  color: '#ff0000',
  speed: 200,
  size: 30,
  backwardMoving: false,
  opacity: 0.5,
  particleTexture: 'path/to/texture.png', // not required
}

signalLine.send(options);

Working with Labels:

You can add label by using public addLabel method:

// Define the options for the signal
const options = {
  textOptions: {
    color: "#ff0000",
    size: 2
  },
  position: "start",
  lookAtCamera: false
};

signalLine.addLabel(options);

Documentation

You can find the full documentation on the website.

Examples

You can see full example in this demo.

Example

or you can try to send it by yourself in another simple demo.

Conclusion

With Three.Signal-Line, you can easily create animated signal lines to enhance the visual experience of your Three.js scenes. Whether you need to visualize data flows, create special effects, or add dynamic elements to your 3D environments, Three.Signal-Line provides a flexible and customizable solution. Explore the package documentation and examples to unleash your creativity and bring your Three.js projects to life with stunning signal lines.