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

@jusfoun-vis/threejs-chart

v0.1.10

Published

Three.js chart library for general data visualzaition.

Downloads

20

Readme

Three.js 图表库

基于 Three.js 提供常规可视化图表。

基础环境

General3DEnv

通用3D环境,此类构造了一个基础的3D运行环境,使用如下。

import {
  General3DEnv
} from '@jusfoun-vis/threejs-chart';

// 自定义一个3D应用。
class Custom3DApp extends General3DEnv {
  
  constructor(option) {
    super(option);
    // 可以选择是自动在构造中初始化,或是new出实例后外部手动调用初始化,
    // 注意仅可初始化一次,当前示例是自动在构造中初始化。
    this.initialize();
  }
  
  // 自定义引擎的Scene、Camera、Renderer实现,一般情况下无需重写。
  _initEngine() {
    super._initEngine();
    
    // Stage3D参见
    const stage3d = this.stage3d;
    const camera = this.camera; // read-only, it is equals to stage3d.camera and this._camera
    const scene = this.scene; // read-only, it is equals to stage3d.scene and this._scene
    const renderer = this.renderer; // read-only, it is equals to stage3d.renderer and this._renderer
  }
  
  // 自定义控制器Controls实现,默认使用OrbitControls控制器(threejs-ext库),一般情况下无需重写。
  _initControls() {
    super._initControls();
    
    const controls = this.controls; // read-only, it is equals to this._controls
    controls.update();
  }
  
  // 自定义3D场景中的光源。
  _initLights() {
    // General3DEnv自带addPointLight(color, intensity, x, y, z)方法可快速创建点光源。
    this.addPointLight(0xFFFFFF, 1.0, 0, 0, 1000);
    
    // 自定义光源
    const directionalLight = new THREE.DirectionalLight( 0xFFFFFF );
    this.scene.add(directionalLight); // or using this.addObject(directionalLight), this.stage3d.addObject(directionalLight)
  }
  
  // 自定义纹理、材质。
  _initMaterials() {
  }
  
  // 自定义物件。
  _initObjects() {
    const mesh = new THREE.Mesh(new THREE.BoxBufferGeometry(1, 1, 1));
    this.addObject(mesh);
  }
  
  // 自定义物件。
  _initObjects() {
  }
  
  // 自定义事件监听,默认添加了Canvas画布上的双击事件,按住Shift键,双击可打印当前Camera的坐标以及Controls中Target的坐标,
  // 可在旋转、调整场景至合适角度后,获得数值然后固化在初始化的设置中。
  _initEventListeners() {
    super._initControls();
    
    const domElement = this.domElement; // it is equals to stage3d.domElement, both read-only
    domElement.addEventListener('xxx', e => {
      // TODO...
    });
  }
  
  // 自定初始化最后阶段应执行的代码。
  _initFinally() {
  }
  
}

const app = new Custom3DApp();
document.body.appendChild(app.domElement);
app.resize(512, 512);
app.startRender();

板块地图

相关性矩阵图

装饰物件