UNPKG

@expofp/floorplan

Version:

Interactive floor plan library for expos and events

2 lines (1 loc) 916 B
import{createCurrentCanvas as c}from"../../components/Map/drawing/config/canvases";import{HeatmapYah as h}from"../HeatmapStore";export function initHeatmap(e){if(window.__heatmapData)e.heatmapStore.heatmapData=window.__heatmapData;else if(window.__heatmapDataYah){e.heatmapStore.heatmapData.yah=window.__heatmapDataYah.yah.map(a=>{const t=new h;return t.id=a.id,t.name=a.name,t.viewCount=a.viewCount,t.x=a.x,t.y=a.y,t.z=a.z,t});const o=e.heatmapStore.heatmapData.yah.map(a=>{const t=e.heatmapStore.getColorByClicks(a.viewCount),r=e.uiState.devicePixelRatio,n=c(r,t,void 0,95,120,a.viewCount.toString()),p=n.toDataURL();return{name:a.id.toString(),scale:1,width:n.width,height:n.height,content:p}}),i=e.heatmapStore.heatmapData.yah.map(a=>({id:a.id.toString(),x:a.x,y:a.y,z:a.z,position:"lefttop",icon:a.id.toString(),selectedIcon:a.id.toString()}));e.routeStore.setMarkers({markers:i,icons:o}),e.selectSearch(" ")}}