Giter VIP home page Giter VIP logo

covid_react's Introduction

COVID-19 집계 사이트

강의 영상

완성 페이지



강의 내용

파일생성 후 rafce 단축어를 입력하면 자동으로 react 기본 코드가 제공됨

  • $ npm install axios react-chartjs-2 (axios와 차트표현을 위한 react-chartjs-2를 install)
  • $ npm install chart.js

구조

  • 한페이지에 헤더와 그래프들이 들어간다
  • Header와 Contents(그래프들)로 component를 나눈다

코드

  • App.css

    • display: flex -> header와 body로 나뉠것 이므로
    • flex-direction: column -> 세로로 정렬되도록
    • justify-content: space-between -> COVID-19와 select가 양 옆으로 붙도록
  • useEffect : mount가 되었을 때 method를 실행하도록

    • 로딩전(차트가 표시되기 전)api에서 data를 받아오는 함수를 넣어둔다
    • data를 받아 필요한 정보만 처리하는 makeData함수도 실행되도록 한다(reduce 구문 사용)
  • useState : state를 관리하는

    • [Data명, setting_method(보통 setData명 으로 이름 설정)] = useState(초기값)
    • 현재 Contents.js의 confirmedData는 object 형태이다(labels과 datasets가 존재)

covid_react's People

Contributors

ujin2021 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.