use javascript to analyse an svg to extract paths to get from one room on the map to another