Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@wework/floormap-utils

Package Overview
Dependencies
Maintainers
18
Versions
131
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wework/floormap-utils

These are utility functions to be used for rendering floor map using FloormapGL

  • 0.3.0
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-57.14%
Maintainers
18
Weekly downloads
 
Created
Source

Floormap Utils

These are utility functions to be used for rendering floor map using FloormapGL

createRenderObjects(params)

Returns an array of renderer objects to be used for FloormapGL render() function

Example usage
import FloormapGL from '@wework/floormap.gl';
import { createRenderObjects } from '@wework/floormap-utils';

let objs = createRenderObjects({
  id: '83719599-420f-11e8-9d13-0642b0acf810',
  shapes: [
    [
      { x: 74.5, y: 31.00 },
      { x: 71.8, y: 30.29 },
      { x: 57.4, y: 30.5 },
      ...
    ],
    [
      { x: 86.2, y: 31.0 },
      { x: 74.4, y: 31.0 },
      { x: 56.4, y: 30.5 },
      ...
    ]
  ],
  type: 'space',
  subType: 'PRIVATE OFFICE',
  programType: 'WORK',
  roomNumber: '04-104',
  hasWindow: true
});

let renderer = new FloormapGL({
  target: document.getElementById('my-map'),
  size: {
    width: 1024,
    height: 768
  },
  antialias: true,
  pixelRatio: 2,
  backgroundColor: 'rgb(248,248,248)'
});

renderer.render(objs);

getCenter(points)

Returns the { x, y } center of the geometry. Sample use case is, if you want to place an image or a text on the center of the room.

FAQs

Package last updated on 08 Dec 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc