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 - npm Package Compare versions

Comparing version 0.4.7 to 0.5.0

1

dist/floormap-utils.cjs.js

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

case 'JC':
case 'JANITOR':
img = maintenance;

@@ -481,0 +482,0 @@ break

2

dist/floormap-utils.cjs.min.js

@@ -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",serviceLift="https://cdn.spacemob.co/img/servicelift@2x.png",wellness="https://cdn.spacemob.co/img/wellnessroom@2x.png",electrical="https://cdn.spacemob.co/img/electrical@2x.png",fire="https://cdn.spacemob.co/img/fire_extinguisher@2x.png",maintenance="https://cdn.spacemob.co/img/maintenance@2x.png",getCenter=function(e){for(var t=1/0,a=1/0,r=-1/0,c=-1/0,s=0;s<e.length;s++)t=Math.min(t,e[s].x),a=Math.min(a,e[s].y),r=Math.max(r,e[s].x),c=Math.max(c,e[s].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,s=e.programType,n=e.roomNumber,o=e.hasWindow,i=e.locationAngle,g=e.centroid,p=[],m="BACK",h="black",b=1,l=!1,E=getExtrude(s,6),u=getZed(s,6),x=getColor(s),y=getImage(s,c);if("object"===a)switch(c){case"CHAIR":x="rgb(206,206,206)",m="FRONT",u=-(6-(E=1))/2,h="black";break;case"TABLE":case"HOTDESK_TABLE":x="rgb(246,241,241)",m="FRONT",E=.5,u=-1.5,b=.7}else"space"===a||"room"===a||console.warn("invalid type:",a);var T={only:!1,color:h};switch(c){case"HALLWAY":case"ELEV LOBBY":T=null;break;case"PHONE BOOTH":case"PRINTER":h="#474747"}switch(s){case"MEET":switch(h="#474747",l=!0,c){case"NOOK":case"PHONE BOOTH":case"wt":l=!1}break;case"WORK":h="#EEB4B2",l=!0,o&&(x="rgb(228,243,247)");break;case"WASH":case"SERVE":h="#979797";break;case"OPERATE":case"WE":break;case"CIRCULATE":T=null;break;default:s&&console.log("invalid programType:",s)}T&&(T.color=h);var R=t,d={z:u},O=null;if(!R||0===R.length)switch(c){case"CHAIR":R=getChairGeometry(),(d=g).z=u,O={z:i};break;case"TABLE":R=getTableGeometry(),(d=g).z=u,O={z:i};break;case"HOTDESK_TABLE":R=getHotDeskTableGeometry(),(d=g).z=u,O={z:i}}if(R&&0!==R.length){if(R.forEach(function(e,t){var a=r;0!==t&&(a=r+"/"+t),p.push({id:a,type:"MESH",style:{color:x,side:m,outline:T,opacity:b},points:e,interactable:!0,extrude:E,position:d,rotation:O})}),l&&n){var f=getCenter(R[0]);y&&(f.y=f.y-2),p.push({id:n,type:"TEXT",text:n,position:f,scalar:1.7,style:{color:"black",fontWeight:"bold"},interactable:!1})}if(y){var k=getCenter(R[0]);l&&n&&(k.y=k.y+1);var A=3,M=getSize(R[0]);A>M.width?A=M.width-.1:A>M.height&&(A=M.height-.1),p.push({id:r+"_img",type:"SPRITE",position:k,scalar:1,style:{img:y,maxWidth:A},interactable:!1})}return p}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)"}},stringArrayToPoints=function(e){if(e&&e.constructor===Array){var t=[];return e.forEach(function(e){e&&e.constructor===Array&&3===e.length&&t.push({x:parseFloat(e[0]),y:parseFloat(e[1]),z:parseFloat(e[2])})}),t}},getImage=function(e,t){var a=null;switch(t){case"PHONE BOOTH":a=phoneBooth;break;case"wt":case"NOOK":case"BOOTH":a=nook;break;case"LOUNGE":case"PANTRY":a=pantry;break;case"GAME RM":a=gameRoom;break;case"WOMEN WC":case"W RESTROOM":case"RESTROOM":case"UNISEX RESTROOM":case"UNISEX":case"ADA RESTROOM":a=women;break;case"MEN WC":case"MALE WC":case"M RESTROOM":a=men;break;case"ADA WC":a=shower;break;case"IT":a=itRoom;break;case"PRINTER":a=printer;break;case"MECH":a=mechanical;break;case"STOR":case"STORE":a=storage;break;case"TRASH":a=trash;break;case"MOTHER RM":a=motherRoom;break;case"F&B":a=pantry;break;case"MAIL":a=mail;break;case"SHOWER":a=shower;break;case"SERVICE LIFT":a=serviceLift;break;case"WELLNESS RM":a=wellness;break;case"ELEC":a=electrical;break;case"FIRE":a=fire;break;case"MOP":case"JC":a=maintenance}if(!a)switch(e){case"MEET":a=meeting}return a},getSize=function(e){for(var t=1/0,a=1/0,r=-1/0,c=-1/0,s=0;s<e.length;s++)t=Math.min(t,e[s].x),a=Math.min(a,e[s].y),r=Math.max(r,e[s].x),c=Math.max(c,e[s].y);return{width:r-t,height:c-a}};exports.createRenderObjects=createRenderObjects,exports.getCenter=getCenter,exports.getSize=getSize,exports.stringArrayToPoints=stringArrayToPoints;
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",serviceLift="https://cdn.spacemob.co/img/servicelift@2x.png",wellness="https://cdn.spacemob.co/img/wellnessroom@2x.png",electrical="https://cdn.spacemob.co/img/electrical@2x.png",fire="https://cdn.spacemob.co/img/fire_extinguisher@2x.png",maintenance="https://cdn.spacemob.co/img/maintenance@2x.png",getCenter=function(e){for(var t=1/0,a=1/0,r=-1/0,c=-1/0,s=0;s<e.length;s++)t=Math.min(t,e[s].x),a=Math.min(a,e[s].y),r=Math.max(r,e[s].x),c=Math.max(c,e[s].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,s=e.programType,n=e.roomNumber,o=e.hasWindow,i=e.locationAngle,g=e.centroid,p=[],m="BACK",h="black",b=1,l=!1,E=getExtrude(s,6),u=getZed(s,6),x=getColor(s),y=getImage(s,c);if("object"===a)switch(c){case"CHAIR":x="rgb(206,206,206)",m="FRONT",u=-(6-(E=1))/2,h="black";break;case"TABLE":case"HOTDESK_TABLE":x="rgb(246,241,241)",m="FRONT",E=.5,u=-1.5,b=.7}else"space"===a||"room"===a||console.warn("invalid type:",a);var T={only:!1,color:h};switch(c){case"HALLWAY":case"ELEV LOBBY":T=null;break;case"PHONE BOOTH":case"PRINTER":h="#474747"}switch(s){case"MEET":switch(h="#474747",l=!0,c){case"NOOK":case"PHONE BOOTH":case"wt":l=!1}break;case"WORK":h="#EEB4B2",l=!0,o&&(x="rgb(228,243,247)");break;case"WASH":case"SERVE":h="#979797";break;case"OPERATE":case"WE":break;case"CIRCULATE":T=null;break;default:s&&console.log("invalid programType:",s)}T&&(T.color=h);var R=t,d={z:u},O=null;if(!R||0===R.length)switch(c){case"CHAIR":R=getChairGeometry(),(d=g).z=u,O={z:i};break;case"TABLE":R=getTableGeometry(),(d=g).z=u,O={z:i};break;case"HOTDESK_TABLE":R=getHotDeskTableGeometry(),(d=g).z=u,O={z:i}}if(R&&0!==R.length){if(R.forEach(function(e,t){var a=r;0!==t&&(a=r+"/"+t),p.push({id:a,type:"MESH",style:{color:x,side:m,outline:T,opacity:b},points:e,interactable:!0,extrude:E,position:d,rotation:O})}),l&&n){var f=getCenter(R[0]);y&&(f.y=f.y-2),p.push({id:n,type:"TEXT",text:n,position:f,scalar:1.7,style:{color:"black",fontWeight:"bold"},interactable:!1})}if(y){var k=getCenter(R[0]);l&&n&&(k.y=k.y+1);var A=3,M=getSize(R[0]);A>M.width?A=M.width-.1:A>M.height&&(A=M.height-.1),p.push({id:r+"_img",type:"SPRITE",position:k,scalar:1,style:{img:y,maxWidth:A},interactable:!1})}return p}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)"}},stringArrayToPoints=function(e){if(e&&e.constructor===Array){var t=[];return e.forEach(function(e){e&&e.constructor===Array&&3===e.length&&t.push({x:parseFloat(e[0]),y:parseFloat(e[1]),z:parseFloat(e[2])})}),t}},getImage=function(e,t){var a=null;switch(t){case"PHONE BOOTH":a=phoneBooth;break;case"wt":case"NOOK":case"BOOTH":a=nook;break;case"LOUNGE":case"PANTRY":a=pantry;break;case"GAME RM":a=gameRoom;break;case"WOMEN WC":case"W RESTROOM":case"RESTROOM":case"UNISEX RESTROOM":case"UNISEX":case"ADA RESTROOM":a=women;break;case"MEN WC":case"MALE WC":case"M RESTROOM":a=men;break;case"ADA WC":a=shower;break;case"IT":a=itRoom;break;case"PRINTER":a=printer;break;case"MECH":a=mechanical;break;case"STOR":case"STORE":a=storage;break;case"TRASH":a=trash;break;case"MOTHER RM":a=motherRoom;break;case"F&B":a=pantry;break;case"MAIL":a=mail;break;case"SHOWER":a=shower;break;case"SERVICE LIFT":a=serviceLift;break;case"WELLNESS RM":a=wellness;break;case"ELEC":a=electrical;break;case"FIRE":a=fire;break;case"MOP":case"JC":case"JANITOR":a=maintenance}if(!a)switch(e){case"MEET":a=meeting}return a},getSize=function(e){for(var t=1/0,a=1/0,r=-1/0,c=-1/0,s=0;s<e.length;s++)t=Math.min(t,e[s].x),a=Math.min(a,e[s].y),r=Math.max(r,e[s].x),c=Math.max(c,e[s].y);return{width:r-t,height:c-a}};exports.createRenderObjects=createRenderObjects,exports.getCenter=getCenter,exports.getSize=getSize,exports.stringArrayToPoints=stringArrayToPoints;
//# sourceMappingURL=floormap-utils.cjs.min.js.map

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

case 'JC':
case 'JANITOR':
img = maintenance;

@@ -479,0 +480,0 @@ break

@@ -483,2 +483,3 @@ (function (global, factory) {

case 'JC':
case 'JANITOR':
img = maintenance;

@@ -485,0 +486,0 @@ break

@@ -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 t="https://cdn.spacemob.co/img/shower@2x.png",r="https://cdn.spacemob.co/img/pantry@2x.png",S=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}},w=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}]]},C=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}]]},H=function(e,a){switch(e){case"CIRCULATE":case"WE":return.1;default:return a}},L=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)"}},N=function(e,a){var c=null;switch(a){case"PHONE BOOTH":c="https://cdn.spacemob.co/img/phone_booth@2x.png";break;case"wt":case"NOOK":case"BOOTH":c="https://cdn.spacemob.co/img/nook@2x.png";break;case"LOUNGE":case"PANTRY":c=r;break;case"GAME RM":c="https://cdn.spacemob.co/img/gameroom@2x.png";break;case"WOMEN WC":case"W RESTROOM":case"RESTROOM":case"UNISEX RESTROOM":case"UNISEX":case"ADA RESTROOM":c="https://cdn.spacemob.co/img/wc_f@2x.png";break;case"MEN WC":case"MALE WC":case"M RESTROOM":c="https://cdn.spacemob.co/img/wc_m@2x.png";break;case"ADA WC":c=t;break;case"IT":c="https://cdn.spacemob.co/img/IT_room@2x.png";break;case"PRINTER":c="https://cdn.spacemob.co/img/printer@2x.png";break;case"MECH":c="https://cdn.spacemob.co/img/mechanical@2x.png";break;case"STOR":case"STORE":c="https://cdn.spacemob.co/img/storage@2x.png";break;case"TRASH":c="https://cdn.spacemob.co/img/trash@2x.png";break;case"MOTHER RM":c="https://cdn.spacemob.co/img/motherroom@2x.png";break;case"F&B":c=r;break;case"MAIL":c="https://cdn.spacemob.co/img/mail_room@2x.png";break;case"SHOWER":c=t;break;case"SERVICE LIFT":c="https://cdn.spacemob.co/img/servicelift@2x.png";break;case"WELLNESS RM":c="https://cdn.spacemob.co/img/wellnessroom@2x.png";break;case"ELEC":c="https://cdn.spacemob.co/img/electrical@2x.png";break;case"FIRE":c="https://cdn.spacemob.co/img/fire_extinguisher@2x.png";break;case"MOP":case"JC":c="https://cdn.spacemob.co/img/maintenance@2x.png"}if(!c)switch(e){case"MEET":c="https://cdn.spacemob.co/img/meeting_room@2x.png"}return c},v=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{width:t-a,height:r-c}};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=[],g="BACK",m="black",h=1,E=!1,u=H(s,6),l=L(s,6),d=I(s),x=N(s,r);if("object"===c)switch(r){case"CHAIR":d="rgb(206,206,206)",g="FRONT",l=-(6-(u=1))/2,m="black";break;case"TABLE":case"HOTDESK_TABLE":d="rgb(246,241,241)",g="FRONT",u=.5,l=-1.5,h=.7}else"space"===c||"room"===c||console.warn("invalid type:",c);var O={only:!1,color:m};switch(r){case"HALLWAY":case"ELEV LOBBY":O=null;break;case"PHONE BOOTH":case"PRINTER":m="#474747"}switch(s){case"MEET":switch(m="#474747",E=!0,r){case"NOOK":case"PHONE BOOTH":case"wt":E=!1}break;case"WORK":m="#EEB4B2",E=!0,o&&(d="rgb(228,243,247)");break;case"WASH":case"SERVE":m="#979797";break;case"OPERATE":case"WE":break;case"CIRCULATE":O=null;break;default:s&&console.log("invalid programType:",s)}O&&(O.color=m);var T=a,f={z:l},y=null;if(!T||0===T.length)switch(r){case"CHAIR":T=w(),(f=p).z=l,y={z:i};break;case"TABLE":T=W(),(f=p).z=l,y={z:i};break;case"HOTDESK_TABLE":T=C(),(f=p).z=l,y={z:i}}if(T&&0!==T.length){if(T.forEach(function(e,a){var c=t;0!==a&&(c=t+"/"+a),b.push({id:c,type:"MESH",style:{color:d,side:g,outline:O,opacity:h},points:e,interactable:!0,extrude:u,position:f,rotation:y})}),E&&n){var R=S(T[0]);x&&(R.y=R.y-2),b.push({id:n,type:"TEXT",text:n,position:R,scalar:1.7,style:{color:"black",fontWeight:"bold"},interactable:!1})}if(x){var k=S(T[0]);E&&n&&(k.y=k.y+1);var A=3,M=v(T[0]);A>M.width?A=M.width-.1:A>M.height&&(A=M.height-.1),b.push({id:t+"_img",type:"SPRITE",position:k,scalar:1,style:{img:x,maxWidth:A},interactable:!1})}return b}console.warn("Invalid shapes",JSON.stringify(e))},e.getCenter=S,e.getSize=v,e.stringArrayToPoints=function(e){if(e&&e.constructor===Array){var a=[];return e.forEach(function(e){e&&e.constructor===Array&&3===e.length&&a.push({x:parseFloat(e[0]),y:parseFloat(e[1]),z:parseFloat(e[2])})}),a}},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 t="https://cdn.spacemob.co/img/shower@2x.png",s="https://cdn.spacemob.co/img/pantry@2x.png",S=function(e){for(var a=1/0,c=1/0,t=-1/0,s=-1/0,r=0;r<e.length;r++)a=Math.min(a,e[r].x),c=Math.min(c,e[r].y),t=Math.max(t,e[r].x),s=Math.max(s,e[r].y);return{x:(t+a)/2,y:(s+c)/2}},w=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}]]},C=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}]]},H=function(e,a){switch(e){case"CIRCULATE":case"WE":return.1;default:return a}},I=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}},L=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)"}},N=function(e,a){var c=null;switch(a){case"PHONE BOOTH":c="https://cdn.spacemob.co/img/phone_booth@2x.png";break;case"wt":case"NOOK":case"BOOTH":c="https://cdn.spacemob.co/img/nook@2x.png";break;case"LOUNGE":case"PANTRY":c=s;break;case"GAME RM":c="https://cdn.spacemob.co/img/gameroom@2x.png";break;case"WOMEN WC":case"W RESTROOM":case"RESTROOM":case"UNISEX RESTROOM":case"UNISEX":case"ADA RESTROOM":c="https://cdn.spacemob.co/img/wc_f@2x.png";break;case"MEN WC":case"MALE WC":case"M RESTROOM":c="https://cdn.spacemob.co/img/wc_m@2x.png";break;case"ADA WC":c=t;break;case"IT":c="https://cdn.spacemob.co/img/IT_room@2x.png";break;case"PRINTER":c="https://cdn.spacemob.co/img/printer@2x.png";break;case"MECH":c="https://cdn.spacemob.co/img/mechanical@2x.png";break;case"STOR":case"STORE":c="https://cdn.spacemob.co/img/storage@2x.png";break;case"TRASH":c="https://cdn.spacemob.co/img/trash@2x.png";break;case"MOTHER RM":c="https://cdn.spacemob.co/img/motherroom@2x.png";break;case"F&B":c=s;break;case"MAIL":c="https://cdn.spacemob.co/img/mail_room@2x.png";break;case"SHOWER":c=t;break;case"SERVICE LIFT":c="https://cdn.spacemob.co/img/servicelift@2x.png";break;case"WELLNESS RM":c="https://cdn.spacemob.co/img/wellnessroom@2x.png";break;case"ELEC":c="https://cdn.spacemob.co/img/electrical@2x.png";break;case"FIRE":c="https://cdn.spacemob.co/img/fire_extinguisher@2x.png";break;case"MOP":case"JC":case"JANITOR":c="https://cdn.spacemob.co/img/maintenance@2x.png"}if(!c)switch(e){case"MEET":c="https://cdn.spacemob.co/img/meeting_room@2x.png"}return c},v=function(e){for(var a=1/0,c=1/0,t=-1/0,s=-1/0,r=0;r<e.length;r++)a=Math.min(a,e[r].x),c=Math.min(c,e[r].y),t=Math.max(t,e[r].x),s=Math.max(s,e[r].y);return{width:t-a,height:s-c}};e.createRenderObjects=function(e){var t=e.id,a=e.shapes,c=e.type,s=e.subType,r=e.programType,n=e.roomNumber,o=e.hasWindow,i=e.locationAngle,p=e.centroid,b=[],g="BACK",m="black",h=1,E=!1,u=H(r,6),l=I(r,6),d=L(r),x=N(r,s);if("object"===c)switch(s){case"CHAIR":d="rgb(206,206,206)",g="FRONT",l=-(6-(u=1))/2,m="black";break;case"TABLE":case"HOTDESK_TABLE":d="rgb(246,241,241)",g="FRONT",u=.5,l=-1.5,h=.7}else"space"===c||"room"===c||console.warn("invalid type:",c);var O={only:!1,color:m};switch(s){case"HALLWAY":case"ELEV LOBBY":O=null;break;case"PHONE BOOTH":case"PRINTER":m="#474747"}switch(r){case"MEET":switch(m="#474747",E=!0,s){case"NOOK":case"PHONE BOOTH":case"wt":E=!1}break;case"WORK":m="#EEB4B2",E=!0,o&&(d="rgb(228,243,247)");break;case"WASH":case"SERVE":m="#979797";break;case"OPERATE":case"WE":break;case"CIRCULATE":O=null;break;default:r&&console.log("invalid programType:",r)}O&&(O.color=m);var T=a,f={z:l},y=null;if(!T||0===T.length)switch(s){case"CHAIR":T=w(),(f=p).z=l,y={z:i};break;case"TABLE":T=W(),(f=p).z=l,y={z:i};break;case"HOTDESK_TABLE":T=C(),(f=p).z=l,y={z:i}}if(T&&0!==T.length){if(T.forEach(function(e,a){var c=t;0!==a&&(c=t+"/"+a),b.push({id:c,type:"MESH",style:{color:d,side:g,outline:O,opacity:h},points:e,interactable:!0,extrude:u,position:f,rotation:y})}),E&&n){var R=S(T[0]);x&&(R.y=R.y-2),b.push({id:n,type:"TEXT",text:n,position:R,scalar:1.7,style:{color:"black",fontWeight:"bold"},interactable:!1})}if(x){var k=S(T[0]);E&&n&&(k.y=k.y+1);var A=3,M=v(T[0]);A>M.width?A=M.width-.1:A>M.height&&(A=M.height-.1),b.push({id:t+"_img",type:"SPRITE",position:k,scalar:1,style:{img:x,maxWidth:A},interactable:!1})}return b}console.warn("Invalid shapes",JSON.stringify(e))},e.getCenter=S,e.getSize=v,e.stringArrayToPoints=function(e){if(e&&e.constructor===Array){var a=[];return e.forEach(function(e){e&&e.constructor===Array&&3===e.length&&a.push({x:parseFloat(e[0]),y:parseFloat(e[1]),z:parseFloat(e[2])})}),a}},Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=floormap-utils.umd.min.js.map
{
"name": "@wework/floormap-utils",
"version": "0.4.7",
"version": "0.5.0",
"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