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

indoor-3d

v1.0.1

Published

This is a javascript lib based on three.js to show an indoor map.

Downloads

3

Readme

indoor-3D

This is a javascript lib based on three.js to show an indoor map.

User Reference

There are Three main classes:
-IndoorMap
-IndoorMap2d
-IndoorMap3d

IndoorMap2d

methods:

.load(fileName, callback)

loads a file. When it finishes loading, the callback functon is called. Since the ui can only be constructed after the data is fully loaded, so the getUI() function must be called in the callback.

if the file is already loaded by other modules, you should use the .parse(jsonData) method instead

.parse(jsonData)

parse the json Data. if the jsonData is loaded by other modules, you can just use this function to pass it to the indoor map

.setDefaultView()

reset the camera to default view (Default perspective view for a 3d map and default top view for a 2d map)

.setTopView()

set the camera to the top view. this function is only valid in the 3d map.

.zoomIn(zoomScale)

zoom in. zoom Scale is not necessary. so you can just call .zoomIn()

.zoomOut(zoomScale)

zoom out. Same as the zoomIn() function, zoom Scale is not necessary.

.adjustCamera

Resets the camera to its default settings. This function is called when switching floors

.setSelectable(selectable)

selectable- a boolean parameter to specify whether the rooms are selectable

.showLabels(showLabels)

showLabels- a boolean parameter to specify whether to show the labels. The labels are the icons and texts in the map.

.getUI()

returns a <ul> tag with all the floor id. The user can switch the floor by clicking the <li> You can insert the <ul> to anywhere in the html. Make sure to call this method only after the map is loaded.

.setSelectionListener(callback)

set the call back function when a shop is selected.

the shop id is passed as the parameter of callback. and -1 for nothing is selected.

.getSelectedId()

get the selected shop's id

.selectById(id)

select the shop by its id

.showFloor(id)

id-the floor id shows the floor by id. Notice this does not handle the labels.

.showAllFloors()

shows all the floors together. Notice this does not handle the labels.

Mall:

Properties

.floors

This is an array with all the floors of [THREE.Object3D](http://threejs.org/docs/#Reference/Core/Object3D) type.

Methods:

.getCurFloorId()

gets the id of the current floor. Notice: the id is a signed integers. -1 means Floor B1, and 1 means Floor F1. 0 is preserved for showing all the floors.

.getFloor(id)

id-the floor id gets the floor of [THREE.Object3D](http://threejs.org/docs/#Reference/Core/Object3D) type by its id.

.getCurFloor()

gets the current floor of [THREE.Object3D](http://threejs.org/docs/#Reference/Core/Object3D) type.