Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dylan Blake Assignment 6 #53

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

blakedylan16
Copy link
Collaborator

Did some interactions and transitions for module 6.

@blakedylan16 blakedylan16 marked this pull request as draft July 24, 2024 13:04
@blakedylan16 blakedylan16 marked this pull request as ready for review July 24, 2024 13:05
@@ -3,6 +3,9 @@
"version": "1.0.0",
"description": "This repo is used for the design and d3 data visualization training.",
"main": "index.js",
"scripts": {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to change it to "start": "node node_modules/http-server/bin/http-server" in order to get it to run using npm start because it wasn't working with what you had here. Not sure why this worked for you and not for me? Dunno

@@ -3,7 +3,22 @@
<title>US Air Quality</title>
</head>
<body>
<br><br><br>
<div>
<input type="radio" id="sort-state" name="sort" checked>
Copy link
Collaborator

@juliaWoelmer juliaWoelmer Jul 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice use of labels with the input here and the "for" specifications. Really makes it clear to read and is great from an accessibility standpoint. Not sure you need all of the breaks above. If you want to include some sort of top margin that can be done using styling which is much cleaner

@@ -1,4 +1,5 @@
function createChart(elementId) {

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary newline here


// read in air quality data
d3.csv('air_quality.csv').then(function (data) {
d3.csv('air_quality.csv').then( function(data) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can get rid of the "function(data)" here and replace it with "(data) =>."

.attr('y', (_, i) => i * (legendBlockSize+legendSpacing))
.attr('fill', d => scaleOrdinal(d));

legend.selectAll('text')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The legend text is being slightly cut off. For example, it says "Northea" and "Midwes"

const t = svg.transition()
.duration(1500);
const delay = +document.getElementById("delay-input").value;
if (isNaN(delay)) alert("Can not accept input");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be a good idea to give the user an idea of why the input cannot be accepted. Something like "Delay input must be a number"

<br>
<div id="class-checkbox-container">
<label for="class-1">Class: 1</label>
<input type="checkbox" id="1" name="class-checkbox" checked><br>
Copy link
Collaborator

@juliaWoelmer juliaWoelmer Jul 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of uses of br here that I think could be replaced with styling changes

.attr('stroke', '#999999')
.attr('stroke-width', '.5');

const stationDots = map.selectAll('circle')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another unnecessary variable

.style('font-size', legendBlockSize)
.style('fill', 'black')
.attr('x', legendBlockSize + 4)
.attr('y', (_, i) => i * (legendBlockSize+legendSpacing))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really a reason for the extra whitespace here?

.filter(station =>
checkedBoxes.includes(station.class)
)
.filter(station =>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should be able to combine these filter statements

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants