@expofp/floorplan
Version:
Interactive floor plan library for expos and events
2 lines (1 loc) • 855 B
JavaScript
import{createCurrentCanvas as c,cssSizeOf as m}from"../../components/Map/drawing/config/canvases";import{HeatmapYah as d}from"../HeatmapStore";export function initHeatmap(t){if(window.__heatmapData)t.heatmapStore.heatmapData=window.__heatmapData;else if(window.__heatmapDataYah){t.heatmapStore.heatmapData.yah=window.__heatmapDataYah.yah.map(a=>new d(a.id,a.name,a.viewCount,a.x,a.y,a.z));const o=t.heatmapStore.heatmapData.yah.map(a=>{const i=t.heatmapStore.getColorByClicks(a.viewCount),p=t.uiState.devicePixelRatio,e=c(p,i,void 0,95,120,a.viewCount.toString()),r=e.toDataURL();return{name:a.id.toString(),scale:1,...m(e),content:r}}),n=t.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()}));t.routeStore.setMarkers({markers:n,icons:o}),t.selectSearch(" ")}}