@wework/floormap-utils
Advanced tools
Comparing version 0.4.2 to 0.4.3
@@ -20,2 +20,5 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
var wellness = 'https://cdn.spacemob.co/img/wellnessroom@2x.png'; | ||
var electrical = 'https://cdn.spacemob.co/img/electrical@2x.png'; | ||
var fire = 'https://cdn.spacemob.co/img/fire_extinguisher@2x.png'; | ||
var maintenance = 'https://cdn.spacemob.co/img/maintenance@2x.png'; | ||
@@ -167,2 +170,11 @@ /** | ||
break | ||
case 'ELEC': | ||
img = electrical; | ||
break | ||
case 'FIRE': | ||
img = fire; | ||
break | ||
case 'MOP': | ||
img = maintenance; | ||
break | ||
default: | ||
@@ -169,0 +181,0 @@ break |
@@ -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",getCenter=function(e){for(var t=1/0,r=1/0,a=-1/0,o=-1/0,c=0;c<e.length;c++)t=Math.min(t,e[c].x),r=Math.min(r,e[c].y),a=Math.max(a,e[c].x),o=Math.max(o,e[c].y);return{x:(a+t)/2,y:(o+r)/2}},createRenderObjects=function(e){var a=e.id,t=e.shapes,r=e.type,o=e.subType,c=e.programType,s=e.roomNumber,n=e.hasWindow,i=e.locationAngle,p=e.centroid,g=[],m="BACK",b="black",l=1,h=!1,u=null,E=getExtrude(c,6),y=getZed(c,6),x=getColor(c);if("object"===r)switch(o){case"CHAIR":x="rgb(206,206,206)",m="FRONT",y=-(6-(E=1))/2,b="black";break;case"TABLE":case"HOTDESK_TABLE":x="rgb(246,241,241)",m="FRONT",E=.5,y=-1.5,l=.7}else"space"===r||"room"===r||console.warn("invalid type:",r);var d={only:!1,color:b};switch(o){case"HALLWAY":case"ELEV LOBBY":d=null;break;case"PHONE BOOTH":b="#474747",u=phoneBooth;break;case"wt":case"NOOK":u=nook;break;case"LOUNGE":case"PANTRY":u=pantry;break;case"GAME RM":u=gameRoom;break;case"WOMEN WC":u=women;break;case"MEN WC":case"MALE 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":case"STORE":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;break;case"SERVICE LIFT":u=serviceLift;break;case"WELLNESS RM":u=wellness}switch(c){case"MEET":switch(b="#474747",h=!0,u||(u=meeting),o){case"NOOK":case"PHONE BOOTH":case"wt":h=!1}break;case"WORK":b="#EEB4B2",h=!0,n&&(x="rgb(228,243,247)");break;case"WASH":case"SERVE":b="#979797";break;case"OPERATE":case"WE":break;case"CIRCULATE":d=null;break;default:c&&console.log("invalid programType:",c)}d&&(d.color=b);var T=t,R={z:y},k=null;if(!T||0===T.length)switch(o){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 r=a;0!==t&&(r=a+"/"+t),g.push({id:r,type:"MESH",style:{color:x,side:m,outline:d,opacity:l},points:e,interactable:!0,extrude:E,position:R,rotation:k})}),h&&s){var A=getCenter(T[0]);u&&(A.y=A.y-2),g.push({id:s,type:"TEXT",text:s,position:A,scalar:1.7,style:{color:"black",fontWeight:"bold"},interactable:!1})}if(u){var O=getCenter(T[0]);h&&s&&(O.y=O.y+1),g.push({id:a+"_img",type:"SPRITE",position:O,scalar:1,style:{img:u,maxWidth:3},interactable:!1})}return g}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}};exports.createRenderObjects=createRenderObjects,exports.getCenter=getCenter,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,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,s=e.roomNumber,n=e.hasWindow,i=e.locationAngle,p=e.centroid,m=[],g="BACK",b="black",l=1,h=!1,E=null,u=getExtrude(o,6),y=getZed(o,6),x=getColor(o);if("object"===a)switch(c){case"CHAIR":x="rgb(206,206,206)",g="FRONT",y=-(6-(u=1))/2,b="black";break;case"TABLE":case"HOTDESK_TABLE":x="rgb(246,241,241)",g="FRONT",u=.5,y=-1.5,l=.7}else"space"===a||"room"===a||console.warn("invalid type:",a);var d={only:!1,color:b};switch(c){case"HALLWAY":case"ELEV LOBBY":d=null;break;case"PHONE BOOTH":b="#474747",E=phoneBooth;break;case"wt":case"NOOK":E=nook;break;case"LOUNGE":case"PANTRY":E=pantry;break;case"GAME RM":E=gameRoom;break;case"WOMEN WC":E=women;break;case"MEN WC":case"MALE WC":E=men;break;case"ADA WC":E=shower;break;case"IT":E=itRoom;break;case"PRINTER":b="#474747",E=printer;break;case"JC":case"MECH":E=mechanical;break;case"STOR":case"STORE":E=storage;break;case"TRASH":E=trash;break;case"MOTHER RM":E=motherRoom;break;case"F&B":E=pantry;break;case"MAIL":E=mail;break;case"SHOWER":E=shower;break;case"SERVICE LIFT":E=serviceLift;break;case"WELLNESS RM":E=wellness;break;case"ELEC":E=electrical;break;case"FIRE":E=fire;break;case"MOP":E=maintenance}switch(o){case"MEET":switch(b="#474747",h=!0,E||(E=meeting),c){case"NOOK":case"PHONE BOOTH":case"wt":h=!1}break;case"WORK":b="#EEB4B2",h=!0,n&&(x="rgb(228,243,247)");break;case"WASH":case"SERVE":b="#979797";break;case"OPERATE":case"WE":break;case"CIRCULATE":d=null;break;default:o&&console.log("invalid programType:",o)}d&&(d.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:x,side:g,outline:d,opacity:l},points:e,interactable:!0,extrude:u,position:R,rotation:k})}),h&&s){var f=getCenter(T[0]);E&&(f.y=f.y-2),m.push({id:s,type:"TEXT",text:s,position:f,scalar:1.7,style:{color:"black",fontWeight:"bold"},interactable:!1})}if(E){var O=getCenter(T[0]);h&&s&&(O.y=O.y+1),m.push({id:r+"_img",type:"SPRITE",position:O,scalar:1,style:{img:E,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)"}},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}};exports.createRenderObjects=createRenderObjects,exports.getCenter=getCenter,exports.stringArrayToPoints=stringArrayToPoints; | ||
//# sourceMappingURL=floormap-utils.cjs.min.js.map |
@@ -18,2 +18,5 @@ var nook = 'https://cdn.spacemob.co/img/nook@2x.png'; | ||
var wellness = 'https://cdn.spacemob.co/img/wellnessroom@2x.png'; | ||
var electrical = 'https://cdn.spacemob.co/img/electrical@2x.png'; | ||
var fire = 'https://cdn.spacemob.co/img/fire_extinguisher@2x.png'; | ||
var maintenance = 'https://cdn.spacemob.co/img/maintenance@2x.png'; | ||
@@ -165,2 +168,11 @@ /** | ||
break | ||
case 'ELEC': | ||
img = electrical; | ||
break | ||
case 'FIRE': | ||
img = fire; | ||
break | ||
case 'MOP': | ||
img = maintenance; | ||
break | ||
default: | ||
@@ -167,0 +179,0 @@ break |
@@ -24,2 +24,5 @@ (function (global, factory) { | ||
var wellness = 'https://cdn.spacemob.co/img/wellnessroom@2x.png'; | ||
var electrical = 'https://cdn.spacemob.co/img/electrical@2x.png'; | ||
var fire = 'https://cdn.spacemob.co/img/fire_extinguisher@2x.png'; | ||
var maintenance = 'https://cdn.spacemob.co/img/maintenance@2x.png'; | ||
@@ -171,2 +174,11 @@ /** | ||
break | ||
case 'ELEC': | ||
img = electrical; | ||
break | ||
case 'FIRE': | ||
img = fire; | ||
break | ||
case 'MOP': | ||
img = maintenance; | ||
break | ||
default: | ||
@@ -173,0 +185,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 R="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}]]},L=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}]]},H=function(e,a){switch(e){case"CIRCULATE":case"WE":return.1;default:return a}},S=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}},v=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=[],g="BACK",m="black",u=1,l=!1,E=null,h=H(s,6),d=S(s,6),y=v(s);if("object"===c)switch(r){case"CHAIR":y="rgb(206,206,206)",g="FRONT",d=-(6-(h=1))/2,m="black";break;case"TABLE":case"HOTDESK_TABLE":y="rgb(246,241,241)",g="FRONT",h=.5,d=-1.5,u=.7}else"space"===c||"room"===c||console.warn("invalid type:",c);var x={only:!1,color:m};switch(r){case"HALLWAY":case"ELEV LOBBY":x=null;break;case"PHONE BOOTH":m="#474747",E="https://cdn.spacemob.co/img/phone_booth@2x.png";break;case"wt":case"NOOK":E="https://cdn.spacemob.co/img/nook@2x.png";break;case"LOUNGE":case"PANTRY":E=W;break;case"GAME RM":E="https://cdn.spacemob.co/img/gameroom@2x.png";break;case"WOMEN WC":E="https://cdn.spacemob.co/img/wc_f@2x.png";break;case"MEN WC":case"MALE WC":E="https://cdn.spacemob.co/img/wc_m@2x.png";break;case"ADA WC":E=R;break;case"IT":E="https://cdn.spacemob.co/img/IT_room@2x.png";break;case"PRINTER":m="#474747",E="https://cdn.spacemob.co/img/printer@2x.png";break;case"JC":case"MECH":E="https://cdn.spacemob.co/img/mechanical@2x.png";break;case"STOR":case"STORE":E="https://cdn.spacemob.co/img/storage@2x.png";break;case"TRASH":E="https://cdn.spacemob.co/img/trash@2x.png";break;case"MOTHER RM":E="https://cdn.spacemob.co/img/motherroom@2x.png";break;case"F&B":E=W;break;case"MAIL":E="https://cdn.spacemob.co/img/mail_room@2x.png";break;case"SHOWER":E=R;break;case"SERVICE LIFT":E="https://cdn.spacemob.co/img/servicelift@2x.png";break;case"WELLNESS RM":E="https://cdn.spacemob.co/img/wellnessroom@2x.png"}switch(s){case"MEET":switch(m="#474747",l=!0,E||(E="https://cdn.spacemob.co/img/meeting_room@2x.png"),r){case"NOOK":case"PHONE BOOTH":case"wt":l=!1}break;case"WORK":m="#EEB4B2",l=!0,o&&(y="rgb(228,243,247)");break;case"WASH":case"SERVE":m="#979797";break;case"OPERATE":case"WE":break;case"CIRCULATE":x=null;break;default:s&&console.log("invalid programType:",s)}x&&(x.color=m);var f=a,T={z:d},k=null;if(!f||0===f.length)switch(r){case"CHAIR":f=M(),(T=p).z=d,k={z:i};break;case"TABLE":f=L(),(T=p).z=d,k={z:i};break;case"HOTDESK_TABLE":f=w(),(T=p).z=d,k={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:y,side:g,outline:x,opacity:u},points:e,interactable:!0,extrude:h,position:T,rotation:k})}),l&&n){var A=C(f[0]);E&&(A.y=A.y-2),b.push({id:n,type:"TEXT",text:n,position:A,scalar:1.7,style:{color:"black",fontWeight:"bold"},interactable:!1})}if(E){var O=C(f[0]);l&&n&&(O.y=O.y+1),b.push({id:t+"_img",type:"SPRITE",position:O,scalar:1,style:{img:E,maxWidth:3},interactable:!1})}return b}console.warn("Invalid shapes",JSON.stringify(e))},e.getCenter=C,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 R="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}]]},L=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}]]},H=function(e,a){switch(e){case"CIRCULATE":case"WE":return.1;default:return a}},S=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=[],g="BACK",m="black",l=1,u=!1,E=null,h=H(s,6),d=S(s,6),x=I(s);if("object"===c)switch(r){case"CHAIR":x="rgb(206,206,206)",g="FRONT",d=-(6-(h=1))/2,m="black";break;case"TABLE":case"HOTDESK_TABLE":x="rgb(246,241,241)",g="FRONT",h=.5,d=-1.5,l=.7}else"space"===c||"room"===c||console.warn("invalid type:",c);var y={only:!1,color:m};switch(r){case"HALLWAY":case"ELEV LOBBY":y=null;break;case"PHONE BOOTH":m="#474747",E="https://cdn.spacemob.co/img/phone_booth@2x.png";break;case"wt":case"NOOK":E="https://cdn.spacemob.co/img/nook@2x.png";break;case"LOUNGE":case"PANTRY":E=W;break;case"GAME RM":E="https://cdn.spacemob.co/img/gameroom@2x.png";break;case"WOMEN WC":E="https://cdn.spacemob.co/img/wc_f@2x.png";break;case"MEN WC":case"MALE WC":E="https://cdn.spacemob.co/img/wc_m@2x.png";break;case"ADA WC":E=R;break;case"IT":E="https://cdn.spacemob.co/img/IT_room@2x.png";break;case"PRINTER":m="#474747",E="https://cdn.spacemob.co/img/printer@2x.png";break;case"JC":case"MECH":E="https://cdn.spacemob.co/img/mechanical@2x.png";break;case"STOR":case"STORE":E="https://cdn.spacemob.co/img/storage@2x.png";break;case"TRASH":E="https://cdn.spacemob.co/img/trash@2x.png";break;case"MOTHER RM":E="https://cdn.spacemob.co/img/motherroom@2x.png";break;case"F&B":E=W;break;case"MAIL":E="https://cdn.spacemob.co/img/mail_room@2x.png";break;case"SHOWER":E=R;break;case"SERVICE LIFT":E="https://cdn.spacemob.co/img/servicelift@2x.png";break;case"WELLNESS RM":E="https://cdn.spacemob.co/img/wellnessroom@2x.png";break;case"ELEC":E="https://cdn.spacemob.co/img/electrical@2x.png";break;case"FIRE":E="https://cdn.spacemob.co/img/fire_extinguisher@2x.png";break;case"MOP":E="https://cdn.spacemob.co/img/maintenance@2x.png"}switch(s){case"MEET":switch(m="#474747",u=!0,E||(E="https://cdn.spacemob.co/img/meeting_room@2x.png"),r){case"NOOK":case"PHONE BOOTH":case"wt":u=!1}break;case"WORK":m="#EEB4B2",u=!0,o&&(x="rgb(228,243,247)");break;case"WASH":case"SERVE":m="#979797";break;case"OPERATE":case"WE":break;case"CIRCULATE":y=null;break;default:s&&console.log("invalid programType:",s)}y&&(y.color=m);var f=a,T={z:d},k=null;if(!f||0===f.length)switch(r){case"CHAIR":f=M(),(T=p).z=d,k={z:i};break;case"TABLE":f=L(),(T=p).z=d,k={z:i};break;case"HOTDESK_TABLE":f=w(),(T=p).z=d,k={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:g,outline:y,opacity:l},points:e,interactable:!0,extrude:h,position:T,rotation:k})}),u&&n){var O=C(f[0]);E&&(O.y=O.y-2),b.push({id:n,type:"TEXT",text:n,position:O,scalar:1.7,style:{color:"black",fontWeight:"bold"},interactable:!1})}if(E){var A=C(f[0]);u&&n&&(A.y=A.y+1),b.push({id:t+"_img",type:"SPRITE",position:A,scalar:1,style:{img:E,maxWidth:3},interactable:!1})}return b}console.warn("Invalid shapes",JSON.stringify(e))},e.getCenter=C,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.2", | ||
"version": "0.4.3", | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
74632
1380