UNPKG

@expofp/floorplan

Version:

Interactive floor plan library for expos and events

2 lines (1 loc) 260 B
export function parseNodeId(e){const t=e.lastIndexOf("_"),s=e.lastIndexOf("_",t-1);if(s===-1)throw new Error(`WF: invalid node ID format "${e}", expected "{layer}_{x}_{y}"`);return[e.substring(0,s),parseFloat(e.substring(s+1,t)),parseFloat(e.substring(t+1))]}