New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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 - npm Package Compare versions

Comparing version 0.3.1 to 0.4.1

80

dist/floormap-utils.cjs.js

@@ -53,6 +53,3 @@ Object.defineProperty(exports, '__esModule', { value: true });

var wallHeight = 6;
var color = 'rgb(253,235,236)';
var side = 'BACK';
var extrude = wallHeight;
var zed = 0;
var outlineOnly = false;

@@ -64,2 +61,5 @@ var outlineColor = 'black';

var img = null;
var extrude = getExtrude(programType, wallHeight);
var zed = getZed(programType, wallHeight);
var color = getColor(programType);

@@ -83,3 +83,2 @@ if (type === 'object') {

default:
color = 'rgb(253,235,236)';
break

@@ -100,9 +99,7 @@ }

case 'ELEV LOBBY':
color = 'rgb(255,247,224)';
// color = 'rgb(255,247,224)'
outline = null;
extrude = 0.1;
zed = -(wallHeight / 2);
break
case 'PHONE BOOTH':
color = '#D8D8D8';
// color = '#D8D8D8'
outlineColor = '#474747';

@@ -117,3 +114,3 @@ img = phoneBooth;

img = pantry;
color = 'rgb(255,211,106)';
// color = 'rgb(255,211,106)'
break

@@ -136,3 +133,3 @@ case 'GAME RM':

case 'PRINTER':
color = '#D8D8D8';
// color = '#D8D8D8'
outlineColor = '#474747';

@@ -168,3 +165,3 @@ img = printer;

case 'MEET':
color = 'rgb(184,240,218)';
// color = 'rgb(184,240,218)'
outlineColor = '#474747';

@@ -186,7 +183,6 @@ showRoomNumber = true;

case 'WORK':
color = 'rgb(228,243,247)';
outlineColor = '#EEB4B2';
showRoomNumber = true;
if (!hasWindow) {
color = 'rgb(172,222,232)';
if (hasWindow) {
color = 'rgb(228,243,247)';
}

@@ -196,3 +192,3 @@ break

case 'SERVE':
color = '#D8D8D8';
// color = '#D8D8D8'
outlineColor = '#979797';

@@ -254,3 +250,3 @@ break

if (!_shapes || _shapes.length === 0) {
console.warn('Invalid shapes');
console.warn('Invalid shapes', JSON.stringify(params));
return

@@ -282,3 +278,3 @@ }

if (showRoomNumber && roomNumber) {
var pos = getCenter(shapes[0]);
var pos = getCenter(_shapes[0]);
if (img) {

@@ -302,3 +298,3 @@ pos.y = pos.y - 2;

if (img) {
var pos$1 = getCenter(shapes[0]);
var pos$1 = getCenter(_shapes[0]);
if (showRoomNumber && roomNumber) {

@@ -360,3 +356,51 @@ pos$1.y = pos$1.y + 1;

var getExtrude = function (programType, wallHeight) {
switch (programType) {
case 'CIRCULATE':
case 'WE':
return 0.1
default:
return wallHeight
}
};
var getZed = function (programType, wallHeight) {
switch (programType) {
case 'WORK':
return 0
case 'MEET':
return -0.01
case 'WASH':
return -0.02
case 'OPERATE':
return -0.03
case 'WE':
return -(((wallHeight / 2) + 0.01))
case 'CIRCULATE':
return -(((wallHeight / 2) + 0.02))
default:
return 0
}
};
var getColor = function (programType) {
switch (programType) {
case 'WORK':
return 'rgb(171,221,231)'
case 'CIRCULATE':
return 'rgb(255,247,223)'
case 'MEET':
return 'rgb(183,240,217)'
case 'WE':
return 'rgb(255,210,106)'
case 'OPERATE':
return 'rgb(226,226,226)'
case 'WASH':
return 'rgb(195,195,195)'
default:
return 'rgb(253,235,236)'
}
};
exports.createRenderObjects = createRenderObjects;
exports.getCenter = getCenter;

@@ -1,2 +0,2 @@

Object.defineProperty(exports,"__esModule",{value:!0});var nook="https://cdn.spacemob.co/img/nook@2x.png",meeting="https://cdn.spacemob.co/img/meeting_room@2x.png",gameRoom="https://cdn.spacemob.co/img/gameroom@2x.png",women="https://cdn.spacemob.co/img/wc_f@2x.png",men="https://cdn.spacemob.co/img/wc_m@2x.png",shower="https://cdn.spacemob.co/img/shower@2x.png",itRoom="https://cdn.spacemob.co/img/IT_room@2x.png",printer="https://cdn.spacemob.co/img/printer@2x.png",phoneBooth="https://cdn.spacemob.co/img/phone_booth@2x.png",mechanical="https://cdn.spacemob.co/img/mechanical@2x.png",storage="https://cdn.spacemob.co/img/storage@2x.png",trash="https://cdn.spacemob.co/img/trash@2x.png",pantry="https://cdn.spacemob.co/img/pantry@2x.png",motherRoom="https://cdn.spacemob.co/img/motherroom@2x.png",mail="https://cdn.spacemob.co/img/mail_room@2x.png",getCenter=function(e){for(var a=1/0,t=1/0,o=-1/0,c=-1/0,r=0;r<e.length;r++)a=Math.min(a,e[r].x),t=Math.min(t,e[r].y),o=Math.max(o,e[r].x),c=Math.max(c,e[r].y);return{x:(o+a)/2,y:(c+t)/2}},createRenderObjects=function(e){var o=e.id,a=e.shapes,t=e.type,c=e.subType,r=e.programType,s=e.roomNumber,n=e.hasWindow,i=e.locationAngle,p=e.centroid,m=[],g="rgb(253,235,236)",b="BACK",h=6,l=0,y="black",x=1,d=!1,k=null;if("object"===t)switch(c){case"CHAIR":g="rgb(206,206,206)",b="FRONT",l=-(6-(h=1))/2,y="black";break;case"TABLE":g="rgb(246,241,241)",b="FRONT",h=.5,l=-1.5,x=.7;break;default:g="rgb(253,235,236)"}else"space"===t||"room"===t||console.warn("invalid type:",t);var E={only:!1,color:y};switch(c){case"HALLWAY":case"ELEV LOBBY":g="rgb(255,247,224)",E=null,h=.1,l=-3;break;case"PHONE BOOTH":g="#D8D8D8",y="#474747",k=phoneBooth;break;case"wt":case"NOOK":k=nook;break;case"LOUNGE":k=pantry,g="rgb(255,211,106)";break;case"GAME RM":k=gameRoom;break;case"WOMEN WC":k=women;break;case"MEN WC":k=men;break;case"ADA WC":k=shower;break;case"IT":k=itRoom;break;case"PRINTER":g="#D8D8D8",y="#474747",k=printer;break;case"JC":case"MECH":k=mechanical;break;case"STOR":k=storage;break;case"TRASH":k=trash;break;case"MOTHER RM":k=motherRoom;break;case"F&B":k=pantry;break;case"MAIL":k=mail;break;case"SHOWER":k=shower}switch(r){case"MEET":switch(g="rgb(184,240,218)",y="#474747",d=!0,k||(k=meeting),c){case"NOOK":case"PHONE BOOTH":case"wt":d=!1}break;case"WORK":g="rgb(228,243,247)",y="#EEB4B2",d=!0,n||(g="rgb(172,222,232)");break;case"WASH":case"SERVE":g="#D8D8D8",y="#979797";break;case"OPERATE":case"WE":case"CIRCULATE":break;default:r&&console.log("invalid programType:",r)}E&&(E.color=y);var T=a,R={z:l},u=null;if(!T||0===T.length)switch(c){case"CHAIR":T=getChairGeometry(),(R=p).z=l,u={z:i};break;case"TABLE":T=getTableGeometry(),(R=p).z=l,u={z:i};break;case"HOTDESK_TABLE":T=getHotDeskTableGeometry(),(R=p).z=l,u={z:i}}if(T&&0!==T.length){if(T.forEach(function(e,a){var t=o;0!==a&&(t=o+"/"+a),m.push({id:t,type:"MESH",style:{color:g,side:b,outline:E,opacity:x},points:e,interactable:!0,extrude:h,position:R,rotation:u})}),d&&s){var O=getCenter(a[0]);k&&(O.y=O.y-2),m.push({id:s,type:"TEXT",text:s,position:O,scalar:1.7,style:{color:"black",fontWeight:"bold"},interactable:!1})}if(k){var f=getCenter(a[0]);d&&s&&(f.y=f.y+1),m.push({id:o+"_img",type:"SPRITE",position:f,scalar:1,style:{img:k,maxWidth:3},interactable:!1})}return m}console.warn("Invalid shapes")},getChairGeometry=function(){return[[{x:1,y:1.45},{x:-1,y:1.45},{x:-1,y:-.55},{x:1,y:-.55}]]},getTableGeometry=function(){return[[{x:2,y:2.3},{x:-2,y:2.3},{x:-2,y:.3},{x:2,y:.3}]]},getHotDeskTableGeometry=function(){return[[{x:1.97,y:1.97},{x:-1.97,y:1.97},{x:-1.97,y:-1.97},{x:1.97,y:-1.97}]]};exports.createRenderObjects=createRenderObjects,exports.getCenter=getCenter;
Object.defineProperty(exports,"__esModule",{value:!0});var nook="https://cdn.spacemob.co/img/nook@2x.png",meeting="https://cdn.spacemob.co/img/meeting_room@2x.png",gameRoom="https://cdn.spacemob.co/img/gameroom@2x.png",women="https://cdn.spacemob.co/img/wc_f@2x.png",men="https://cdn.spacemob.co/img/wc_m@2x.png",shower="https://cdn.spacemob.co/img/shower@2x.png",itRoom="https://cdn.spacemob.co/img/IT_room@2x.png",printer="https://cdn.spacemob.co/img/printer@2x.png",phoneBooth="https://cdn.spacemob.co/img/phone_booth@2x.png",mechanical="https://cdn.spacemob.co/img/mechanical@2x.png",storage="https://cdn.spacemob.co/img/storage@2x.png",trash="https://cdn.spacemob.co/img/trash@2x.png",pantry="https://cdn.spacemob.co/img/pantry@2x.png",motherRoom="https://cdn.spacemob.co/img/motherroom@2x.png",mail="https://cdn.spacemob.co/img/mail_room@2x.png",getCenter=function(e){for(var t=1/0,a=1/0,r=-1/0,c=-1/0,o=0;o<e.length;o++)t=Math.min(t,e[o].x),a=Math.min(a,e[o].y),r=Math.max(r,e[o].x),c=Math.max(c,e[o].y);return{x:(r+t)/2,y:(c+a)/2}},createRenderObjects=function(e){var r=e.id,t=e.shapes,a=e.type,c=e.subType,o=e.programType,n=e.roomNumber,s=e.hasWindow,i=e.locationAngle,p=e.centroid,m=[],g="BACK",b="black",h=1,l=!1,u=null,E=getExtrude(o,6),y=getZed(o,6),d=getColor(o);if("object"===a)switch(c){case"CHAIR":d="rgb(206,206,206)",g="FRONT",y=-(6-(E=1))/2,b="black";break;case"TABLE":d="rgb(246,241,241)",g="FRONT",E=.5,y=-1.5,h=.7}else"space"===a||"room"===a||console.warn("invalid type:",a);var x={only:!1,color:b};switch(c){case"HALLWAY":case"ELEV LOBBY":x=null;break;case"PHONE BOOTH":b="#474747",u=phoneBooth;break;case"wt":case"NOOK":u=nook;break;case"LOUNGE":u=pantry;break;case"GAME RM":u=gameRoom;break;case"WOMEN WC":u=women;break;case"MEN WC":u=men;break;case"ADA WC":u=shower;break;case"IT":u=itRoom;break;case"PRINTER":b="#474747",u=printer;break;case"JC":case"MECH":u=mechanical;break;case"STOR":u=storage;break;case"TRASH":u=trash;break;case"MOTHER RM":u=motherRoom;break;case"F&B":u=pantry;break;case"MAIL":u=mail;break;case"SHOWER":u=shower}switch(o){case"MEET":switch(b="#474747",l=!0,u||(u=meeting),c){case"NOOK":case"PHONE BOOTH":case"wt":l=!1}break;case"WORK":b="#EEB4B2",l=!0,s&&(d="rgb(228,243,247)");break;case"WASH":case"SERVE":b="#979797";break;case"OPERATE":case"WE":case"CIRCULATE":break;default:o&&console.log("invalid programType:",o)}x&&(x.color=b);var T=t,R={z:y},k=null;if(!T||0===T.length)switch(c){case"CHAIR":T=getChairGeometry(),(R=p).z=y,k={z:i};break;case"TABLE":T=getTableGeometry(),(R=p).z=y,k={z:i};break;case"HOTDESK_TABLE":T=getHotDeskTableGeometry(),(R=p).z=y,k={z:i}}if(T&&0!==T.length){if(T.forEach(function(e,t){var a=r;0!==t&&(a=r+"/"+t),m.push({id:a,type:"MESH",style:{color:d,side:g,outline:x,opacity:h},points:e,interactable:!0,extrude:E,position:R,rotation:k})}),l&&n){var O=getCenter(T[0]);u&&(O.y=O.y-2),m.push({id:n,type:"TEXT",text:n,position:O,scalar:1.7,style:{color:"black",fontWeight:"bold"},interactable:!1})}if(u){var C=getCenter(T[0]);l&&n&&(C.y=C.y+1),m.push({id:r+"_img",type:"SPRITE",position:C,scalar:1,style:{img:u,maxWidth:3},interactable:!1})}return m}console.warn("Invalid shapes",JSON.stringify(e))},getChairGeometry=function(){return[[{x:1,y:1.45},{x:-1,y:1.45},{x:-1,y:-.55},{x:1,y:-.55}]]},getTableGeometry=function(){return[[{x:2,y:2.3},{x:-2,y:2.3},{x:-2,y:.3},{x:2,y:.3}]]},getHotDeskTableGeometry=function(){return[[{x:1.97,y:1.97},{x:-1.97,y:1.97},{x:-1.97,y:-1.97},{x:1.97,y:-1.97}]]},getExtrude=function(e,t){switch(e){case"CIRCULATE":case"WE":return.1;default:return t}},getZed=function(e,t){switch(e){case"WORK":return 0;case"MEET":return-.01;case"WASH":return-.02;case"OPERATE":return-.03;case"WE":return-(t/2+.01);case"CIRCULATE":return-(t/2+.02);default:return 0}},getColor=function(e){switch(e){case"WORK":return"rgb(171,221,231)";case"CIRCULATE":return"rgb(255,247,223)";case"MEET":return"rgb(183,240,217)";case"WE":return"rgb(255,210,106)";case"OPERATE":return"rgb(226,226,226)";case"WASH":return"rgb(195,195,195)";default:return"rgb(253,235,236)"}};exports.createRenderObjects=createRenderObjects,exports.getCenter=getCenter;
//# sourceMappingURL=floormap-utils.cjs.min.js.map

@@ -51,6 +51,3 @@ var nook = 'https://cdn.spacemob.co/img/nook@2x.png';

var wallHeight = 6;
var color = 'rgb(253,235,236)';
var side = 'BACK';
var extrude = wallHeight;
var zed = 0;
var outlineOnly = false;

@@ -62,2 +59,5 @@ var outlineColor = 'black';

var img = null;
var extrude = getExtrude(programType, wallHeight);
var zed = getZed(programType, wallHeight);
var color = getColor(programType);

@@ -81,3 +81,2 @@ if (type === 'object') {

default:
color = 'rgb(253,235,236)';
break

@@ -98,9 +97,7 @@ }

case 'ELEV LOBBY':
color = 'rgb(255,247,224)';
// color = 'rgb(255,247,224)'
outline = null;
extrude = 0.1;
zed = -(wallHeight / 2);
break
case 'PHONE BOOTH':
color = '#D8D8D8';
// color = '#D8D8D8'
outlineColor = '#474747';

@@ -115,3 +112,3 @@ img = phoneBooth;

img = pantry;
color = 'rgb(255,211,106)';
// color = 'rgb(255,211,106)'
break

@@ -134,3 +131,3 @@ case 'GAME RM':

case 'PRINTER':
color = '#D8D8D8';
// color = '#D8D8D8'
outlineColor = '#474747';

@@ -166,3 +163,3 @@ img = printer;

case 'MEET':
color = 'rgb(184,240,218)';
// color = 'rgb(184,240,218)'
outlineColor = '#474747';

@@ -184,7 +181,6 @@ showRoomNumber = true;

case 'WORK':
color = 'rgb(228,243,247)';
outlineColor = '#EEB4B2';
showRoomNumber = true;
if (!hasWindow) {
color = 'rgb(172,222,232)';
if (hasWindow) {
color = 'rgb(228,243,247)';
}

@@ -194,3 +190,3 @@ break

case 'SERVE':
color = '#D8D8D8';
// color = '#D8D8D8'
outlineColor = '#979797';

@@ -252,3 +248,3 @@ break

if (!_shapes || _shapes.length === 0) {
console.warn('Invalid shapes');
console.warn('Invalid shapes', JSON.stringify(params));
return

@@ -280,3 +276,3 @@ }

if (showRoomNumber && roomNumber) {
var pos = getCenter(shapes[0]);
var pos = getCenter(_shapes[0]);
if (img) {

@@ -300,3 +296,3 @@ pos.y = pos.y - 2;

if (img) {
var pos$1 = getCenter(shapes[0]);
var pos$1 = getCenter(_shapes[0]);
if (showRoomNumber && roomNumber) {

@@ -358,2 +354,50 @@ pos$1.y = pos$1.y + 1;

var getExtrude = function (programType, wallHeight) {
switch (programType) {
case 'CIRCULATE':
case 'WE':
return 0.1
default:
return wallHeight
}
};
var getZed = function (programType, wallHeight) {
switch (programType) {
case 'WORK':
return 0
case 'MEET':
return -0.01
case 'WASH':
return -0.02
case 'OPERATE':
return -0.03
case 'WE':
return -(((wallHeight / 2) + 0.01))
case 'CIRCULATE':
return -(((wallHeight / 2) + 0.02))
default:
return 0
}
};
var getColor = function (programType) {
switch (programType) {
case 'WORK':
return 'rgb(171,221,231)'
case 'CIRCULATE':
return 'rgb(255,247,223)'
case 'MEET':
return 'rgb(183,240,217)'
case 'WE':
return 'rgb(255,210,106)'
case 'OPERATE':
return 'rgb(226,226,226)'
case 'WASH':
return 'rgb(195,195,195)'
default:
return 'rgb(253,235,236)'
}
};
export { createRenderObjects, getCenter };

@@ -57,6 +57,3 @@ (function (global, factory) {

var wallHeight = 6;
var color = 'rgb(253,235,236)';
var side = 'BACK';
var extrude = wallHeight;
var zed = 0;
var outlineOnly = false;

@@ -68,2 +65,5 @@ var outlineColor = 'black';

var img = null;
var extrude = getExtrude(programType, wallHeight);
var zed = getZed(programType, wallHeight);
var color = getColor(programType);

@@ -87,3 +87,2 @@ if (type === 'object') {

default:
color = 'rgb(253,235,236)';
break

@@ -104,9 +103,7 @@ }

case 'ELEV LOBBY':
color = 'rgb(255,247,224)';
// color = 'rgb(255,247,224)'
outline = null;
extrude = 0.1;
zed = -(wallHeight / 2);
break
case 'PHONE BOOTH':
color = '#D8D8D8';
// color = '#D8D8D8'
outlineColor = '#474747';

@@ -121,3 +118,3 @@ img = phoneBooth;

img = pantry;
color = 'rgb(255,211,106)';
// color = 'rgb(255,211,106)'
break

@@ -140,3 +137,3 @@ case 'GAME RM':

case 'PRINTER':
color = '#D8D8D8';
// color = '#D8D8D8'
outlineColor = '#474747';

@@ -172,3 +169,3 @@ img = printer;

case 'MEET':
color = 'rgb(184,240,218)';
// color = 'rgb(184,240,218)'
outlineColor = '#474747';

@@ -190,7 +187,6 @@ showRoomNumber = true;

case 'WORK':
color = 'rgb(228,243,247)';
outlineColor = '#EEB4B2';
showRoomNumber = true;
if (!hasWindow) {
color = 'rgb(172,222,232)';
if (hasWindow) {
color = 'rgb(228,243,247)';
}

@@ -200,3 +196,3 @@ break

case 'SERVE':
color = '#D8D8D8';
// color = '#D8D8D8'
outlineColor = '#979797';

@@ -258,3 +254,3 @@ break

if (!_shapes || _shapes.length === 0) {
console.warn('Invalid shapes');
console.warn('Invalid shapes', JSON.stringify(params));
return

@@ -286,3 +282,3 @@ }

if (showRoomNumber && roomNumber) {
var pos = getCenter(shapes[0]);
var pos = getCenter(_shapes[0]);
if (img) {

@@ -306,3 +302,3 @@ pos.y = pos.y - 2;

if (img) {
var pos$1 = getCenter(shapes[0]);
var pos$1 = getCenter(_shapes[0]);
if (showRoomNumber && roomNumber) {

@@ -364,2 +360,50 @@ pos$1.y = pos$1.y + 1;

var getExtrude = function (programType, wallHeight) {
switch (programType) {
case 'CIRCULATE':
case 'WE':
return 0.1
default:
return wallHeight
}
};
var getZed = function (programType, wallHeight) {
switch (programType) {
case 'WORK':
return 0
case 'MEET':
return -0.01
case 'WASH':
return -0.02
case 'OPERATE':
return -0.03
case 'WE':
return -(((wallHeight / 2) + 0.01))
case 'CIRCULATE':
return -(((wallHeight / 2) + 0.02))
default:
return 0
}
};
var getColor = function (programType) {
switch (programType) {
case 'WORK':
return 'rgb(171,221,231)'
case 'CIRCULATE':
return 'rgb(255,247,223)'
case 'MEET':
return 'rgb(183,240,217)'
case 'WE':
return 'rgb(255,210,106)'
case 'OPERATE':
return 'rgb(226,226,226)'
case 'WASH':
return 'rgb(195,195,195)'
default:
return 'rgb(253,235,236)'
}
};
exports.createRenderObjects = createRenderObjects;

@@ -366,0 +410,0 @@ exports.getCenter = getCenter;

@@ -1,2 +0,2 @@

!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?a(exports):"function"==typeof define&&define.amd?define(["exports"],a):a(e.FloormapUtils={})}(this,function(e){var A="https://cdn.spacemob.co/img/shower@2x.png",M="https://cdn.spacemob.co/img/pantry@2x.png",H=function(e){for(var a=1/0,c=1/0,t=-1/0,o=-1/0,s=0;s<e.length;s++)a=Math.min(a,e[s].x),c=Math.min(c,e[s].y),t=Math.max(t,e[s].x),o=Math.max(o,e[s].y);return{x:(t+a)/2,y:(o+c)/2}},w=function(){return[[{x:1,y:1.45},{x:-1,y:1.45},{x:-1,y:-.55},{x:1,y:-.55}]]},v=function(){return[[{x:2,y:2.3},{x:-2,y:2.3},{x:-2,y:.3},{x:2,y:.3}]]},W=function(){return[[{x:1.97,y:1.97},{x:-1.97,y:1.97},{x:-1.97,y:-1.97},{x:1.97,y:-1.97}]]};e.createRenderObjects=function(e){var t=e.id,a=e.shapes,c=e.type,o=e.subType,s=e.programType,n=e.roomNumber,r=e.hasWindow,i=e.locationAngle,p=e.centroid,b=[],m="rgb(253,235,236)",g="BACK",l=6,h=0,d="black",x=1,y=!1,u=null;if("object"===c)switch(o){case"CHAIR":m="rgb(206,206,206)",g="FRONT",h=-(6-(l=1))/2,d="black";break;case"TABLE":m="rgb(246,241,241)",g="FRONT",l=.5,h=-1.5,x=.7;break;default:m="rgb(253,235,236)"}else"space"===c||"room"===c||console.warn("invalid type:",c);var E={only:!1,color:d};switch(o){case"HALLWAY":case"ELEV LOBBY":m="rgb(255,247,224)",E=null,l=.1,h=-3;break;case"PHONE BOOTH":m="#D8D8D8",d="#474747",u="https://cdn.spacemob.co/img/phone_booth@2x.png";break;case"wt":case"NOOK":u="https://cdn.spacemob.co/img/nook@2x.png";break;case"LOUNGE":u=M,m="rgb(255,211,106)";break;case"GAME RM":u="https://cdn.spacemob.co/img/gameroom@2x.png";break;case"WOMEN WC":u="https://cdn.spacemob.co/img/wc_f@2x.png";break;case"MEN WC":u="https://cdn.spacemob.co/img/wc_m@2x.png";break;case"ADA WC":u=A;break;case"IT":u="https://cdn.spacemob.co/img/IT_room@2x.png";break;case"PRINTER":m="#D8D8D8",d="#474747",u="https://cdn.spacemob.co/img/printer@2x.png";break;case"JC":case"MECH":u="https://cdn.spacemob.co/img/mechanical@2x.png";break;case"STOR":u="https://cdn.spacemob.co/img/storage@2x.png";break;case"TRASH":u="https://cdn.spacemob.co/img/trash@2x.png";break;case"MOTHER RM":u="https://cdn.spacemob.co/img/motherroom@2x.png";break;case"F&B":u=M;break;case"MAIL":u="https://cdn.spacemob.co/img/mail_room@2x.png";break;case"SHOWER":u=A}switch(s){case"MEET":switch(m="rgb(184,240,218)",d="#474747",y=!0,u||(u="https://cdn.spacemob.co/img/meeting_room@2x.png"),o){case"NOOK":case"PHONE BOOTH":case"wt":y=!1}break;case"WORK":m="rgb(228,243,247)",d="#EEB4B2",y=!0,r||(m="rgb(172,222,232)");break;case"WASH":case"SERVE":m="#D8D8D8",d="#979797";break;case"OPERATE":case"WE":case"CIRCULATE":break;default:s&&console.log("invalid programType:",s)}E&&(E.color=d);var f=a,k={z:h},O=null;if(!f||0===f.length)switch(o){case"CHAIR":f=w(),(k=p).z=h,O={z:i};break;case"TABLE":f=v(),(k=p).z=h,O={z:i};break;case"HOTDESK_TABLE":f=W(),(k=p).z=h,O={z:i}}if(f&&0!==f.length){if(f.forEach(function(e,a){var c=t;0!==a&&(c=t+"/"+a),b.push({id:c,type:"MESH",style:{color:m,side:g,outline:E,opacity:x},points:e,interactable:!0,extrude:l,position:k,rotation:O})}),y&&n){var T=H(a[0]);u&&(T.y=T.y-2),b.push({id:n,type:"TEXT",text:n,position:T,scalar:1.7,style:{color:"black",fontWeight:"bold"},interactable:!1})}if(u){var R=H(a[0]);y&&n&&(R.y=R.y+1),b.push({id:t+"_img",type:"SPRITE",position:R,scalar:1,style:{img:u,maxWidth:3},interactable:!1})}return b}console.warn("Invalid shapes")},e.getCenter=H,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?a(exports):"function"==typeof define&&define.amd?define(["exports"],a):a(e.FloormapUtils={})}(this,function(e){var A="https://cdn.spacemob.co/img/shower@2x.png",W="https://cdn.spacemob.co/img/pantry@2x.png",C=function(e){for(var a=1/0,c=1/0,t=-1/0,r=-1/0,s=0;s<e.length;s++)a=Math.min(a,e[s].x),c=Math.min(c,e[s].y),t=Math.max(t,e[s].x),r=Math.max(r,e[s].y);return{x:(t+a)/2,y:(r+c)/2}},M=function(){return[[{x:1,y:1.45},{x:-1,y:1.45},{x:-1,y:-.55},{x:1,y:-.55}]]},w=function(){return[[{x:2,y:2.3},{x:-2,y:2.3},{x:-2,y:.3},{x:2,y:.3}]]},H=function(){return[[{x:1.97,y:1.97},{x:-1.97,y:1.97},{x:-1.97,y:-1.97},{x:1.97,y:-1.97}]]},L=function(e,a){switch(e){case"CIRCULATE":case"WE":return.1;default:return a}},v=function(e,a){switch(e){case"WORK":return 0;case"MEET":return-.01;case"WASH":return-.02;case"OPERATE":return-.03;case"WE":return-(a/2+.01);case"CIRCULATE":return-(a/2+.02);default:return 0}},I=function(e){switch(e){case"WORK":return"rgb(171,221,231)";case"CIRCULATE":return"rgb(255,247,223)";case"MEET":return"rgb(183,240,217)";case"WE":return"rgb(255,210,106)";case"OPERATE":return"rgb(226,226,226)";case"WASH":return"rgb(195,195,195)";default:return"rgb(253,235,236)"}};e.createRenderObjects=function(e){var t=e.id,a=e.shapes,c=e.type,r=e.subType,s=e.programType,n=e.roomNumber,o=e.hasWindow,i=e.locationAngle,p=e.centroid,b=[],m="BACK",g="black",u=1,l=!1,h=null,E=L(s,6),d=v(s,6),x=I(s);if("object"===c)switch(r){case"CHAIR":x="rgb(206,206,206)",m="FRONT",d=-(6-(E=1))/2,g="black";break;case"TABLE":x="rgb(246,241,241)",m="FRONT",E=.5,d=-1.5,u=.7}else"space"===c||"room"===c||console.warn("invalid type:",c);var y={only:!1,color:g};switch(r){case"HALLWAY":case"ELEV LOBBY":y=null;break;case"PHONE BOOTH":g="#474747",h="https://cdn.spacemob.co/img/phone_booth@2x.png";break;case"wt":case"NOOK":h="https://cdn.spacemob.co/img/nook@2x.png";break;case"LOUNGE":h=W;break;case"GAME RM":h="https://cdn.spacemob.co/img/gameroom@2x.png";break;case"WOMEN WC":h="https://cdn.spacemob.co/img/wc_f@2x.png";break;case"MEN WC":h="https://cdn.spacemob.co/img/wc_m@2x.png";break;case"ADA WC":h=A;break;case"IT":h="https://cdn.spacemob.co/img/IT_room@2x.png";break;case"PRINTER":g="#474747",h="https://cdn.spacemob.co/img/printer@2x.png";break;case"JC":case"MECH":h="https://cdn.spacemob.co/img/mechanical@2x.png";break;case"STOR":h="https://cdn.spacemob.co/img/storage@2x.png";break;case"TRASH":h="https://cdn.spacemob.co/img/trash@2x.png";break;case"MOTHER RM":h="https://cdn.spacemob.co/img/motherroom@2x.png";break;case"F&B":h=W;break;case"MAIL":h="https://cdn.spacemob.co/img/mail_room@2x.png";break;case"SHOWER":h=A}switch(s){case"MEET":switch(g="#474747",l=!0,h||(h="https://cdn.spacemob.co/img/meeting_room@2x.png"),r){case"NOOK":case"PHONE BOOTH":case"wt":l=!1}break;case"WORK":g="#EEB4B2",l=!0,o&&(x="rgb(228,243,247)");break;case"WASH":case"SERVE":g="#979797";break;case"OPERATE":case"WE":case"CIRCULATE":break;default:s&&console.log("invalid programType:",s)}y&&(y.color=g);var f=a,T={z:d},O=null;if(!f||0===f.length)switch(r){case"CHAIR":f=M(),(T=p).z=d,O={z:i};break;case"TABLE":f=w(),(T=p).z=d,O={z:i};break;case"HOTDESK_TABLE":f=H(),(T=p).z=d,O={z:i}}if(f&&0!==f.length){if(f.forEach(function(e,a){var c=t;0!==a&&(c=t+"/"+a),b.push({id:c,type:"MESH",style:{color:x,side:m,outline:y,opacity:u},points:e,interactable:!0,extrude:E,position:T,rotation:O})}),l&&n){var k=C(f[0]);h&&(k.y=k.y-2),b.push({id:n,type:"TEXT",text:n,position:k,scalar:1.7,style:{color:"black",fontWeight:"bold"},interactable:!1})}if(h){var R=C(f[0]);l&&n&&(R.y=R.y+1),b.push({id:t+"_img",type:"SPRITE",position:R,scalar:1,style:{img:h,maxWidth:3},interactable:!1})}return b}console.warn("Invalid shapes",JSON.stringify(e))},e.getCenter=C,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=floormap-utils.umd.min.js.map

@@ -1,1 +0,4 @@

export { createRenderObjects, getCenter } from './src/spatial-service.js'
export {
createRenderObjects,
getCenter
} from './src/spatial-service.js'
{
"name": "@wework/floormap-utils",
"version": "0.3.1",
"version": "0.4.1",
"browser": "dist/floormap-utils.min.js",

@@ -5,0 +5,0 @@ "jsnext:main": "dist/floormap-utils.es.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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