Skip to content

chore: updating world map workshop prototype#1136

Open
danielfreire-dev wants to merge 8 commits intofreeCodeCamp:mainfrom
danielfreire-dev:d3-map-population-update
Open

chore: updating world map workshop prototype#1136
danielfreire-dev wants to merge 8 commits intofreeCodeCamp:mainfrom
danielfreire-dev:d3-map-population-update

Conversation

@danielfreire-dev
Copy link

@danielfreire-dev danielfreire-dev commented Jan 23, 2026

Checklist:

relates to #64629

@majestic-owl448
Copy link
Contributor

what issue is this change related to?

@jdwilkin4
Copy link
Contributor

@danielfreire-dev

Are you part of Naomi's sprints? If so, please provide details on what this PR is in relation to so we better understand the context for these changes. Are you working on a lab or workshop?

@danielfreire-dev
Copy link
Author

danielfreire-dev commented Jan 25, 2026

@jdwilkin4 @majestic-owl448

Yes, I am part of Naomi's Sprints.
This is an audit and update to the world map d3 project (freeCodeCamp/freeCodeCamp#64629).

  • I have updated to v7 (latest version).
  • Fixed any issues that I found.
  • Moved the tooltip closer to the user's mouse icon.
  • Did not see the need to update the JSON.
  • Updated the .csv file with 2025 data from the same source.

EDIT: added one more item

Copy link
Contributor

@majestic-owl448 majestic-owl448 left a comment

Choose a reason for hiding this comment

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

please mention the issue when you create a PR
please update the title so that it follows the docs https://contribute.freecodecamp.org/#/how-to-open-a-pull-request?id=prepare-a-good-pr-title

the csv data needs to go on the CDN repo (https://github.com/freeCodeCamp/cdn) and should be fetched (with d3 that is d3.json(url)

we are not able to have d3 as a minified version, this is the html for an other d3 project, you need to import `d3 in a similar way in your project

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Build a Scatterplot Graph</title>
    <link rel="stylesheet" href="styles.css" />
    <script src="https://cdnjs.cloudflare.com/ajax/libs/d3/7.9.0/d3.min.js"></script>
  </head>
  <body>
    <script src="script.js"></script>
  </body>
</html>

because of how the editor works in the freeCodeCamp environment, the JS file name should be script.js and the CSS file name should be styles.css

@danielfreire-dev danielfreire-dev changed the title tooltip fixed. added population data for 2025 from the same source (w… chore (D3 update): updating D3 to newest version (v7), including any necessary code updates #64629 Jan 26, 2026
@danielfreire-dev danielfreire-dev changed the title chore (D3 update): updating D3 to newest version (v7), including any necessary code updates #64629 chore (D3 update): updating D3 to newest version (v7), including any necessary code updates Jan 26, 2026
@danielfreire-dev danielfreire-dev changed the title chore (D3 update): updating D3 to newest version (v7), including any necessary code updates chore: (D3 update): updating D3 to newest version (v7), including any necessary code updates Jan 26, 2026
@danielfreire-dev danielfreire-dev changed the title chore: (D3 update): updating D3 to newest version (v7), including any necessary code updates chore: updating D3 to newest version (v7), including any necessary code updates Jan 26, 2026
…re and requests an online version of the csv file
@jdwilkin4 jdwilkin4 changed the title chore: updating D3 to newest version (v7), including any necessary code updates chore: updating world map workshop prototype Jan 28, 2026
Copy link
Contributor

@jdwilkin4 jdwilkin4 left a comment

Choose a reason for hiding this comment

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

Can you move this project over to the full stack folder? it will be easier to find all of these projects in one place later on.

https://github.com/freeCodeCamp/CurriculumExpansion/tree/main/fullstack-cert/d3-projects

Copy link
Contributor

@jdwilkin4 jdwilkin4 left a comment

Choose a reason for hiding this comment

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

It looks like you have a lot of extra files that don't need to be there.

You should only have three files.

An HTML file, CSS file and js file.

Once you resolve that, then we can review your project 👍🏾

@jdwilkin4
Copy link
Contributor

@danielfreire-dev

Did you need help resolve the extra files listed here?

@danielfreire-dev
Copy link
Author

danielfreire-dev commented Mar 4, 2026

@jdwilkin4

I created a new PR to add these files to the CDN. I am waiting for its approval.

EDIT: grammar

@jdwilkin4
Copy link
Contributor

@danielfreire-dev

I left comments on your PR for the CDN repo.
Also, this PR still has 143 files changed

Screenshot 2026-03-04 at 2 54 43 PM

That will also need to be resolved before another review can be done

@majestic-owl448
Copy link
Contributor

majestic-owl448 commented Mar 5, 2026

@jdwilkin4 most of those where already existing files that got moved when the project folder was moved. Do you think they should be deleted? or the Lesson subfolder left where it was?

@jdwilkin4
Copy link
Contributor

Yeah, lets delete all of those extra files. Like the lessons files and folder and extra stuff like that.
That was added years ago back when part of adding the prototype also meant adding in individual lesson files.
But we are no longer doing that.

This PR should only contain the html, css and JS files.

@jdwilkin4
Copy link
Contributor

jdwilkin4 commented Mar 5, 2026

You should only have 3 files (index.html, styles.css. and script.js) in this PR because that is what will be used on learn.

@majestic-owl448
Copy link
Contributor

majestic-owl448 commented Mar 5, 2026

This PR should only contain the html, css and JS files.

so there should be an other PR deleting the Lessons folder? if deleted in this PR they will appear in this PR

@jdwilkin4
Copy link
Contributor

jdwilkin4 commented Mar 5, 2026

I pushed up some commit to reduce the file size from 143 to 10.

This will make it easier to review 👍🏾

@danielfreire-dev

Please pull down those latest changes. Once the CDN PR is resolved and merged in, then you will need to update your script.js to use the cdn link.

Copy link
Contributor

@majestic-owl448 majestic-owl448 left a comment

Choose a reason for hiding this comment

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

Thanks for the updates! A few things to address:

test.html should be removed, it looks like a leftover file.

script.js has a bug with D3 v7: d3.event was removed in v7, so the zoom won't work. The zoomed function needs to accept the event as a parameter:

function zoomed(event) {
  g.attr("transform", event.transform);
}

And the .on("zoom", zoomed) call is fine as-is.

A few cleanup items in script.js:

  • The // TODO: replace with freeCodeCamp CDN link comment at the top is stale, the path already uses the CDN
  • Remove the console.log statements for min/max population
  • Remove the commented-out // const low and // const high lines

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

3 participants