npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-seda-scatterplot

v1.3.8

Published

react-seda-scatterplot React component

Downloads

38

Readme

React SEDA Scatterplot Component

Travis npm package

React component for displaying a scatterplot loaded from CSV data.

Usage

Pass x, y, and optional z variable for sizing dots. Provide a prefix to specify the region (counties, districts, or schools)

<SedaScatterplot
  endpoint='https://d2fypeb6f974r1.cloudfront.net/dev/scatterplot/'
  xVar='all_ses'
  yVar='all_avg'
  zVar='all_sz'
  prefix='counties'
/>

Props

The following props can be passed to the scatterplot component:

  • endpoint string required URL to the endpoint with CSV data
  • xVar: string variable name to use for x axis
  • yVar: string variable name to use for y axis
  • zVar: string variable name to use for z axis (circle size)
  • prefix: string prefix for fetching files (corresponds to region)
  • baseVars: object a map of { [prefix]: ['var1', 'var2', 'var3', ... ]} to indicate which variables are available in the {prefix}-base.csv file.
  • options: object option overrides
  • hovered: string identifier for item to highlight
  • highlighted: array list of highlighted dot identifiers
  • selected: array list of selected dot identifiers
  • selectedColors: array list of colors to use for selected dots
  • data: object data to pass to the scatterplot, if no data is passed it will load from the endpoint
  • theme: object|string theme object or string for echart
  • classes: object allows passing of classes to child elements (e.g. { 'error': 'scatterplot-errror' })
  • onHover: func event handler for when dot is hovered
  • onClick: func event handler for when dot is clicked
  • onReady: func event handler for when chart is ready
  • onMouseMove: func event handler for when mouse moves on dot
  • onDataLoaded: func event handler for when new scatterplot data loads
  • onError: func event handler for errors
  • onLoading: func event handler for loading status

Component Ref

The following attributes and methods are available if you get a ref or the component.

Attributes

Methods

  • getData(): gets the scatterplot data in the component state
  • getDataSeries(id): gets a data series in the echarts options with the corresponding id
  • getOption(): alias for echarts getOption
  • setOption(options): alias for echart setOption

SEDA Scatterplot Variables

The SEDA scatterplot data is available at this endpoint:

https://d2fypeb6f974r1.cloudfront.net/dev/scatterplot/

The following variables can be passed as xVar, yVar, or zVar and will be fetched from the endpoint. Most variable names are strings formatted as {demographic}_{metric}. For example, to get average test scores for black students the variable name would be b_avg

Metrics

  • avg: average test scores
  • grd: growth over years
  • coh: trend over years
  • ses: socioeconomic status (counties and districts only)
  • seg: segregation measure (counties and districts only)
  • pct: percent of paired demographic (e.g. w_pct = percent of white students)

Demographics

  • all: all students
  • w: white students
  • b: black students
  • h: hispanic students
  • a: asian students
  • p: poor students
  • m: male students
  • f: female students
  • p: poor students
  • np: non-poor students
  • frl: students qualifying for free or reduced lunch program (schools only)
  • wb: white/black gap
  • wh: white/hispanic gap
  • wa: white/asian gap
  • pn: poor/non-poor gap
  • mf: male/female gap

General Variables

In addition to the metric/demographic variables, the following variables exist and apply to all demographics:

  • all_sz: number of students for the region (county, districts, schools)

Custom Endpoints

This component can be used with any data by creating your own endpoint. The endpoint is a URL that contains CSV files for individual variables. CSV files should follow the naming format:

{prefix}-{varName}.csv

Note: You can leave out the prefix if you are only showing one category of data. ({varName}.csv)

CSV files should have the following data format:

{identifier},{varName}