Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@antonio-goncalves/react-regional-data-display-test

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@antonio-goncalves/react-regional-data-display-test

React component based on [mapbox](https://www.mapbox.com/) providing an easy way to show regional data with support for different data sets, dates and geographical locations.

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7
Maintainers
1
Weekly downloads
 
Created
Source

React Regional Data Display

React component based on mapbox providing an easy way to show regional data with support for different data sets, dates and geographical locations.

Install

npm install @antonio-goncalves/react-regional-data-display

Components

ReactRegionalDataDisplay

Main component providing the map visualizer, data set and date selection.

Properties

NameTypeIs OptionalDefault ValueDescription
dataSetsDataSet[]noData sets containing values for each region.
regionsRegion[]noGeoJSON data of regions that should be included on the map
centerCenteryes{
   zoom:1,
    lng:0,
    lat:0
}
Map position and zoom
mapBoxTokenstringnoAccess token required to use mapbox
mapHeightstring or numberyes500Height of the map
mapBoxOptionsobjectyesExtra options passed to the mapbox constructor
onDataSetChange(dataSetId:string)=>voidyesFired when a new data set is selected
classNamestringyesCustom class for the container
sliderClassNamestringyesCustom class for the slider element
dropdownClassNamestringyesCustom class for the dropdown element
placeholderClassNamestringyesCustom class for the placeholder text
mapContainerClassNamestringyesCustom class for map container
styleobjectyesCustom style for the container
sliderStyleobjectyesCustom style for the slider element
dropdownStyleobjectyesCustom style for the dropdown element
placeholderStyleobjectyesCustom style for the placeholder text
mapContainerStyleobjectyesCustom style for map container

RegionsMap

Map component used on this project

Properties

NameTypeIs OptionalDefault ValueDescription
regionsDataRegionData[] or nullnoData value for each region
regionsRegion[]noGeoJSON data of regions that should be included on the map
centerCenteryes{
   zoom:1,
    lng:0,
    lat:0
}
Map position and zoom
mapBoxTokenstringnoAccess token required to use mapbox
mapHeightstring or numberyes500Height of the map
mapBoxOptionsobjectyesExtra options passed to the mapbox constructor
scaleScalenoScale used by the map
footnotesFootnote[]yesFootnotes texts used by data points
unitUnitnoUnit of the data showed on the map
dropdownClassNamestringyesCustom class for the dropdown element
mapContainerClassNamestringyesCustom class for the map container
mapContainerStyleobjectyesCustom style for the map container

Scale

Coloured scale used on the map

Properties

NameTypeIs OptionalDefault ValueDescription
valueDataScalenoNumeric intervals and colors
unitUnitnoUnit showed on the label
onMouseOver(value?: ScaleInterval)=>voidnoMouse over event for each scale area

Slider

Animated slider used for date selection

Properties

NameTypeIs OptionalDefault ValueDescription
valuenumbernoCurrent selection of the scale
valuesSliderValue[]noAvailable values
timeBetweenJumpsnumberyes1000Time in ms between between selection when in animated mode
onChange(value: number)=>voidnoCurrent selection of the scale
classNamestringyesCustom class for the slider
onMouseOverobjectyesCustom style for the slider

Structures

Data structures used on this project

DataSet

Object describing a data set

NameTypeIs OptionalDefault ValueDescription
idstringnoId of the data set
namestringnoName of the data set
descriptionstringnoDescription of the data set
centerCenternoPosition and zoom of the map (overrides "center" property of the map)
sourceDataSetSourcenoSource of the data
datesDataSetDatesnoDates of the data set
unitUnitnoUnit of the data set
scaleDataScalenoScale info for the data set
dataRegionData[] or nullnoData value for each region
footnotesFootnote[]yesFootnotes texts used by data points

Center

Object describing the position of the map

NameTypeIs OptionalDefault ValueDescription
latnumbernoLatitude value
lngnumbernoLongitude value
zoomnumbernoZoom level

DataSetSource

Object describing the source of the data

NameTypeIs OptionalDefault ValueDescription
namestringnoName of the source
urlstringnoUrl of the source

DataSetDates

Object describing the dates available on the data set

NameTypeIs OptionalDefault ValueDescription
formatstringnoFormat on how to display the dates
timestampsnumber[]noValues of the timestamps in ms

Unit

Object describing the unit

NameTypeIs OptionalDefault ValueDescription
namestringnoName of the unit
symbolstringnoSymbol of the unit

DataScale

Object describing the scale used on the map

NameTypeIs OptionalDefault ValueDescription
startValuenumbernoFirst value of the scale
stepsnumber[]noValues for each step
colorsstring[]noColor of each step

RegionData

Object describing the data for each region

NameTypeIs OptionalDefault ValueDescription
dateTimestampnumbernoDate of the data
idstringnoId of the region
valuenumbernoData point value
footnoteIdsstring[]yesIds of the footnotes

FootNote

Object describing footnotes available

NameTypeIs OptionalDefault ValueDescription
idstringnoId of the footnote
valuestringnoText value of the footnote

Region

Object containing the contours of a region

NameTypeIs OptionalDefault ValueDescription
idstringnoId of the region
namestringnoname of the region
geoJSONGeoJSONnoContours of the region

SliderValue

NameTypeIs OptionalDefault ValueDescription
labelstringnoLabel of the value
valuenumbernoNumeric value

ScaleInterval

NameTypeIs OptionalDefault ValueDescription
minValuenumbernoMinimum value
maxValuenumbernoMaximum value
colorstringnoColor of the area

FAQs

Package last updated on 11 Oct 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc