Skip to main content
Public

Share visualization

Loading preview…

Interactive Color Legend with Menus

vizhub.com

Shared links may look like this on X, LinkedIn, Slack, and Discord.

Before sharing, review the publishing checklist.

Choose how to deliver this visualization

LinkedIn caption

LinkedIn may not keep text supplied by the share sheet. Copy the caption and paste it into the post if needed. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code
Download & exportPNG, HTML, source ZIP

Interactive Color Legend with Menus

1
AAlaouiadnane
Last edited Feb 20, 2020
Created on Feb 19, 2020

This interactive scatter plot explores the relationship between two user-selected attributes from the College Dataset, showing each institution as a circle colored by its public or private status. Two dropdown menus, built with ReactDropdown, control which numeric columns (such as Enroll, PhD, or Outstate) appear on the x and y axes. A custom color legend, implemented as an SVG component, highlights points of one category on hover while fading the others, using d3.scaleOrdinal for color mapping and d3.scaleLinear for axis scales. All marks and axes render as React components with d3 scales, with data loaded asynchronously via d3.csv.

AI-generated description

A scatter plot of The College Dataset.

Enroll: number of new students enrolled. Phd: Percent of faculty with Ph.D's Private: Public/Private indicator.

Comments

Sign in to join the discussion.

MIT Licensed