Coder Social home page Coder Social logo

fgreve / covid19-animation-generator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from juancri/covid19-animation-generator

0.0 1.0 0.0 6.19 MB

Generates an animation of COVID-19 data

License: MIT License

JavaScript 1.28% TypeScript 98.72%

covid19-animation-generator's Introduction

COVID-19 Animation Generator

Node.js CI

Generates an animation based on COVID-19 daily data.

Sample

About

Requirements

  • Node 12.x
  • Gulp: npm install -g gulp

Initialize

  • Run: npm install

Build

  • Clean: gulp clean
  • Build: gulp build

Running

node dist/main

The data is downloaded automatically

Parameters

All parameters are optional.

  • --help: Displays a help message and exits.
  • --source: Sets the data source. Default: global. Possible values:
    • global: Compare countries (including Chile, US and others)
    • southamerica: Compare main countries in South America
    • us: Compare states (US)
    • washington: Compare Washington State counties (US)
    • chile: Compare regions (Chile)
    • chile-comunas: Compare communes (Chile)
  • --filter: Filters the series configurations from the datasource using its code. Multiple codes can be included, separated by comma.
  • --schema: Sets the color schema. Default: dark. Possible values:
    • dark: Dark theme
  • --days: Number of days for which the animation will be generated. Default: 30. Use 0 to plot all days.
  • --frames: Number of frames per day. Default: 30.
  • --extraFrames: Number of extra frames for the last image. Default: 300.
  • --horizontalAxisLabel: Horizontal axis label. Default: "total confirmed cases (log)".
  • --verticalAxisLabel: Vertical axis label. Default: "new confirmed cases (log, last week)".
  • --zoomEasing: Easing function for the zoom effect. Default: easeInOutCubic.
  • --timebarEasing: Easing function for the timebar. Default: linear.
  • --dateFormat: Sets the date format based on the Luxon tokens. Default: yyyy-MM-dd.
  • --drawMarkers: Draws series markers over the scale. Disabled by default.
  • --skipZoom: Skips the zoom effect. Enabled by default.
  • --hideWatermark: Hides the watermark. Enabled by default.
  • --seriesLineWidth: Series line width. Default: 3.
  • --horizontalMin: Horizontal scale minimum. Default: dynamic.
  • --horizontalMax: Horizontal scale maximum. Default: dynamic.
  • --verticalMin: Vertical scale minimum. Default: dynamic.
  • --verticalMax: Vertical scale maximum. Default: dynamic.
  • --scale: Scale. Default: log. Possible values:
    • log: Logaritmic (log10)
    • linear: Linear scale
    • linear-avg7: Liner scale with 7 days change average
  • --scaleDateFormat: Date format for the scale labels. Applies only for linear scale. Default: MM/dd.
  • --scaleNumberFormat: Number format for the scale labels. Applies only for linear scale. Default: suffix. Possible values:
    • suffix: 1K for 1,000, 2K for 2,000, etc
    • plain: Plain number
    • spanish: Number in Spanish format (#.###)
  • --stackedAreaNumberFormat: Number format for the stacked area number label. Default: plain. Possible values:
    • plain: Plain number
    • english: Number in English format (#,###)
    • spanish: Number in Spanish format (#.###)
  • --horizontalJump: Distance between scale labels (horizontal axis).
  • --verticalJump: Distance between scale labels (vertical axis).
  • --horizontalLines: Horizontal lines with format numericvalue:label (example: 10:mylabel, multiple lines separated by comma)
  • --verticalLines: Vertical lines with format numericvalue:label (example: 10:mylabel, multiple lines separated by comma)
  • --singleDynamicScale: Use single axis to calculate the dynamic scale.
  • --type: Chart type. Default: line. Possible values:
    • line: Line chart
    • stacked-area: Stacked area

Examples

  • node dist/main
  • node dist/main --source global
  • node dist/main --layout square
  • node dist/main --source us --layout vertical
  • node dist/main --source us --layout vertical --frames 20

Output

The generated images will be in the output directory

Generate animation

You can generate an animation (60 fps). Requires ffmpeg. Run:

npm run video

The video will be here: output/animation.mp4

covid19-animation-generator's People

Contributors

juancri avatar

Watchers

James Cloos 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.