Coder Social home page Coder Social logo

cmdenys / javascript-analysis Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1.4 MB

Created a functional table that displayed UFO sightings across the United States, which can be filtered by 5 different user inputs. Each sighting was added to the table using the forEach method to loop through each sighting, append a row, and use Object.entries to call the parameters for each value pair in the data (sightings) array.

CSS 9.81% JavaScript 80.97% HTML 9.22%
javascript css html object-oriented-programming

javascript-analysis's Introduction

Using a UFO dataset in the form of an array of JavaScript objects, the below code was written to create a table on a web page and then append new rows of data for each UFO sighting.

This was done by creating a function called "buildTable." Using d3, the table body was cleared and data composed of multiple arrays was taken in by iterating though each object and appending it's value inside a cell, which was nested inside the table data, nested inside of a table row.

Next, a function called handleClick was created to "listen" for a filter button and read the value entered into the respeective input field. This returned a search specific to the input or inputs the user entered and rebuilds the table based on the new filtered data.

Lastly, a function called clearClick was created to clear any data entered into the input fields and reset the table. Event listeners were added to handle the event functions and finally rebuild the table when clearClick is called.

javascript-analysis's People

Contributors

cmdenys avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.