Skip to content

ambbber/US-Travel-Map

 
 

Repository files navigation

US-Travel-Map

D3 Generated Travel Map

Generated through D3js.

Functions

initialize()

Read in the JSON/CSV data, Render the SVG

renderProgressRing()

Note: Not currently used. Meant to render a percentage of the states traveled to

getCityVisitedColor(city)

Get the fill color of the pinhead based on the reason for visiting it.

stateType(type)

Represents the states in the U.S. and whether I've lived there, travelled, or nada

parkType(type)

Read in the park data and return a properly formatted object.

addTooltipToElement(tooltipElData, isPath)

Pass in the dataset you want to display a tooltip over. If the dataset is a park then we'll approach it a bit differently.

initialize()

Read in the JSON/CSV data, Render the SVG

Kind: global function
Access: public

renderProgressRing()

Deprecated

Note: Not currently used. Meant to render a percentage of the states traveled to

Kind: global function

getCityVisitedColor(city) ⇒

Get the fill color of the pinhead based on the reason for visiting it.

Kind: global function
Returns: string - The color of the pinhead

Param Type Description
city Object The city object with all of its parameters
city.City string The name of the city visited
city.State string The state it resides in
city.Latitude number The latitudal location on earth
city.Longitude number The longitudinal location on earth
city.Reason string Reason for visiting (can be Work, Fun)
city.Desc string Details about the trip
city.Link string A link to additional information about the trip
city.Date DateTime The date the city was visited

stateType(type) ⇒

Represents the states in the U.S. and whether I've lived there, travelled, or nada

Kind: global function
Returns: Object - State object

Param Type Description
type Object The dataset object

parkType(type) ⇒

Read in the park data and return a properly formatted object.

Kind: global function
Returns: Object, park object with the properties seen in the code.

Param Type Description
type Object The park object with its default properties from D3.tsv

addTooltipToElement(tooltipElData, isPath)

Pass in the dataset you want to display a tooltip over. If the dataset is a parkapproach it a bit differently.

Kind: global function

Param Type Description
tooltipElData any
isPath boolean Is this a geoJSON object or a normal JSON?

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 91.2%
  • CSS 6.6%
  • HTML 2.2%