GithubHelp home page GithubHelp logo

kashifshamaz21 / react-svg-timeline Goto Github PK

View Code? Open in Web Editor NEW

This project forked from netzwerg/react-svg-timeline

1.0 0.0 0.0 1.08 MB

React event timeline component based on SVG

License: Other

HTML 3.22% TypeScript 96.78%

react-svg-timeline's Introduction

react-svg-timeline Build Status GitHub license npm version Netlify Status

A React event timeline component based on SVG.

  • Event Points & Periods
  • Event Tooltips
  • Event Lanes
  • Semantic Zoom (10 Years, 1 Year, 1 Week, 1 Day, etc)
  • Custom "rubber band" Zoom
  • Panning

Interactive Demo

Installation

yarn install react-svg-timeline

or

npm install react-svg-timeline

Note that the following peer dependencies must already be installed:

  • react and react-dom in version >=16.3
  • @material-ui/core in version >=4.3

Usage

This is the simplest possible way to get started:

import * as React from 'react'
import { Timeline } from 'react-svg-timeline'

export const App = () => {
  const laneId = 'demo-lane'
  const lanes = [
    {
      laneId,
      label: 'Demo Lane',
    },
  ]
  const events = [
    {
      eventId: 'event-1',
      laneId: laneId,
      startTimeMillis: 1399845600000,
    },
    {
      eventId: 'event-2',
      laneId,
      startTimeMillis: 1167606000000,
      endTimeMillis: 1230698892000,
    },
  ]
  const dateFormat = (ms: number) => new Date(ms).toLocaleString()
  return <Timeline width={600} height={300} events={events} lanes={lanes} dateFormat={dateFormat} />
}

Please check the example folder for a full-fledged feature demonstration.

Acknowledgements

Thank you:

  • TSDX for making TS library development easier
  • GitHub Corners for the callout on the example site

License

Licensed under MIT License.

© Rahel Lüthy 2021

react-svg-timeline's People

Contributors

netzwerg avatar protyze avatar kashifshamaz21 avatar

Stargazers

 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.