UNPKG

@expofp/floorplan

Version:

Interactive floor plan library for expos and events

2 lines (1 loc) • 866 B
import d from"color";export const POI_MARKER_PIN_SHAPE={frame:{width:82,height:96},bodyWidth:70,outline:"M41 86.13C41.68 85.63 76 61.93 76 36.1A35 35 0 0 0 6 36.1C6 61.93 40.32 85.63 41 86.13Z",strokeWidth:0,tipApexY:86.13,head:{x:41,y:36.1,innerRadius:29.3},shadow:{offsetY:2,blur:4}},POI_SELECTED_PIN_SHAPE={frame:{width:102,height:137},bodyWidth:90,outline:"M51 125.88C56.54 123.07 94.5 77 94.5 47A43.5 43.5 0 0 0 7.5 47C7.5 77 45.46 123.07 51 125.88Z",strokeWidth:3,tipApexY:125.88,head:{x:51,y:47,innerRadius:19},shadow:{offsetY:2.5,blur:5}};export function getPoiPinLayout(t,r,i){const e=r/t.bodyWidth*i,o=Math.ceil(t.frame.height*e),n=(t.tipApexY+t.strokeWidth/2)*e;return{scale:e,canvasWidth:Math.ceil(t.frame.width*e),canvasHeight:o,tipOffset:(o-n)/i}}export function getPoiPinShadeColor(t){try{return d(t).darken(.41).desaturate(.4).hex()}catch{return t}}