Rearrange code to support multiple graph types and added share urls