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 🙏

© 2026 – Pkg Stats / Ryan Hefner

viewer-toolkit

v1.6.0

Published

图形主要的工具类

Readme

图形主要的工具类

函数索引

  • gnd01-guid 获取一个随机guid
  • gnd02-mobile 获取用户的平台
  • gnd03-loadDocument 载入urn
  • gnd04-getViewableItems
  • gnd05-createButton ui-创建一个按钮
  • gnd06-createControlGroup 创建一个controlgroup
  • gnd07-getLeafNodes 获取叶子节点
  • gnd08-getFragIds 获取fragid
  • gnd09-getLeafFragIds 获取叶子fragid
  • gnd10-getWorldBoundingBox 获取世界范围的bounding
  • gnd11-getProperties 根据dbid获取属性
  • gnd12-getProperty 根据dbid获取属性
  • gnd13-getPropertieObj
  • gnd14-getPropertyList(viewer, dbIds, model = null) 根据dbid列表获取属性列表
  • gnd15-getBulkPropertiesAsync (model, dbIds, propFilter) 同步的方式获取属性
  • gnd16-mapComponentsByProp (model, propFilter, components, defaultProp) 属性和构件的mapping
  • gnd17-runTaskOnDataTree(root, taskFunc)
  • gnd18-drawBox (viewer, min, max, material, overlayId) 绘制box
  • gnd19-setMaterial(model, dbId, material) 设置材质
  • gnd20-setMaterialById(model, dbId, materialId) 设置材质同上
  • gnd21-buildModelTree (model, createNodeFunc = null) 构件模型树
  • gnd22-executeTaskOnModelTree (model, task)
  • gnd23-hide (viewer, dbIds = [], model = null) 隐藏构件
  • gnd24-show (viewer, dbIds = [], model = null) 显示构件
  • gnd25-isolateFull (viewer, dbIds = [], model = null) 根据dbid隔离
  • gnd26-rotateFragments (viewer, fragIds, axis, angle, center, model = null) 旋转
  • gnd27-restoreStateWithPivot (viewer, state, filter = null, immediate = false) 恢复state
  • gnd28-getComponentsByParentName (name, model) 获取components 根据 parentname
  • gnd29-buildComponentGeometry (viewer, model, dbId, faceFilter) Creates a standard THREE.Mesh out of a Viewer
  • gnd30-buildComponentMesh (viewer, model, dbId, faceFilter, material) Creates a standard THREE.Mesh out of a Viewer
  • gnd31-selectiveExplode (viewer, scale, excludedFragIds, model = null)
  • gnd32-transparentByDbId (dbIds, model, newMaterial) 通过dbid透明构件
  • gnd33-getAllModelDbId (viewer) 获取所有的dbid
  • gnd34-hideAll(viewer) 隐藏所有构件
  • gnd35-getExternalIdMapping (model) 获取guidmapping - 单模
  • gnd36-getGuidMappingForMul(viewer) 获取guidmapping - 多模 - 按照 modelid-dbid 字符串方式返回
  • gnd37-getGuidMappingForMul2(viewer) 获取guidmapping - 多模 - 按照 {model:dbidarry} 对象方式返回
  • gnd38-setThemingColor(viewer, guidArray, color, guidMapping) 为构件设置颜色
  • gnd39-clearThemingColors(viewer) 清除构件上的颜色
  • gnd40-clearThemingColorsByGuids(viewer, guidArray, guidMapping) 清除构件的颜色
  • gnd41-showParts(viewer, guidArray, guidMapping) 通过guid显示构件
  • gnd42-selectByGuids(viewer, guidArray, guidMapping) 通过guid选择构件
  • gnd43-hideByGuids(viewer, guidArray, guidMapping) 通过guid隐藏构件
  • gnd44-isolateByGuids(viewer, guidArray, guidMapping) 通过guid隔离
  • gnd45-fitViewByGUID(viewer, guid, guidMapping) 根据guid定位到模型
  • gnd46-getPropertiesByGUID(guid) 根据guid获取属性
  • gnd47-search (viewer, model, text, attributeNames) 搜索
  • gnd48-searchForMul(viewer, text, attributeNames) 多模搜索
  • gnd49-getTreeChildrenIds(model, nodeId) 获取所有子节点数据
  • gnd50-getPropertieList(model, dbId) 获取所有子节点数据//buildModelTree
  • gnd51-toArray(obj) key value 专程拜访数组
  • gnd52-updatemodelMaterial (model,guidArray,material) 更新模型材质
  • gnd53-getGuidMappingByGuidForSingle(viewer,guidArray) 获取相关guid和dbid信息
  • gnd54-setMaterialByColor(viewer, fragid, color, matid ) 改变构件的材质颜色
  • gnd55-queryProperty(model, attribute, value, isContain) 根据属性和值 精确查询构件
  • gnd56-resetPivot (viewer, ptCenter) 设置旋转点

修改

1.6.0

  • 更新 setThemingColor 说明文档

1.4.0

  • 更新 queryProperty 函数

1.2.0

  • 优化readme

1.1.0

  • 修复小bug