Giter Site home page Giter Site logo

qulle / activity-timeline Goto Github PK

View Code? Open in Web Editor NEW
7.0 1.0 0.0 543 KB

Portable Activity Timeline that draws the Timeline based on data given in JSON or CSV format. By clicking on any activity a detailed modal window is displayed. Initially developed for post incident investigations to get a overview of the situation in an it-environment.

License: BSD 2-Clause "Simplified" License

HTML 1.77% SCSS 7.88% TypeScript 90.35%
javascript portable-tool timeline post-error-investigation html-canvas activity-timeline canvas-timeline

activity-timeline's Introduction

Activity Timeline

Portable Activity Timeline that draws the Timeline based on data given in JSON or CSV format. By clicking on any activity a detailed modal window is displayed. Initially developed for post incident investigations to get a overview of the situation in an it-environment.

Latest build - Demo

All version can be found in the examples directory. Read about new features in the Change log.

Screenshots

The application is not limited to a light and dark theme. Any colors can be used to create custom themes.

Light

Screenshot Light Theme

Dark

Screenshot Dark Theme

Usage

The application is portable, launch the HTML-file in the browser and drop a JSON/CSV-file in the application. The application renders a Timeline of all activities and provides an easy-to-understand sequence of events.

Shortcut keys

  • G Show GitHub window
  • S Pans to the start of the Timeline
  • E Pans to the end of the Timeline
  • C Pans to the center of the Timeline
  • Z Resets to the default zoom level
  • I Show information about current Timeline
  • H Load Landing Page
  • O Open file to render
  • P Export PNG
  • D Export Timeline data
  • N Show notifications from the developer
  • + Zoom in
  • - Zoom out
  • M Toggles Menu state
  • ctrl + wheel Zooms the Timeline
  • click + drag Pans the Timeline

Data

There are two ways of providing data, either via JSON or CSV. In both cases the data is sorted in the application to always be shown in the correct order according to the date and timestamp. The description is displayed in a modal window when an activity is clicked in the Timeline.

JSON

The data is provided in an array of days.

{
    "days": [
        {
            "date": "2022-07-08",
            "activities": [
                {
                    "timestamp": "12:23",
                    "title": "Patched webserver",
                    "description": "Some additional information about the activity",
                    "fillColor": "#D0CEE2",
                    "strokeColor": "#56517E"
                },
                {
                    "timestamp": "18:36",
                    "title": "Restarted application pool",
                    "description": "Some additional information about the activity",
                    "fillColor": "#FAD7AC",
                    "strokeColor": "#C27B25"
                }
            ]
        },
        {
            "date": "2022-07-10",
            "activities": [
                {
                    "timestamp": "12:05",
                    "title": "New release application A",
                    "description": "Some additional information about the activity",
                    "fillColor": "#B1DDF0",
                    "strokeColor": "#10739E"
                }
            ]
        }
    ]
}

CSV

The data is given in CSV format using ; (semicolon) as delimiter. It is important that the columns follow the same order as example below. The names can be anything you want.

Timestamp Title Description Fill Color Stroke Color
2022-07-08 12:23 Patched webserver Some additional information about the activity #D0CEE2 #56517E
2022-07-08 18:36 Restarted application pool Some additional information about the activity #FAD7AC #C27B25
2022-07-10 12:05 New release application A Some additional information about the activity #B1DDF0 #10739E

Note: Excel encodes the CSV-file using ISO-8859-1 (on Windows) if the file contains non-ASCII characters. Therefore the file is always opened using that encoding.

Tip: Use some HTML tags to highlight important information in the Description field.

Theme

The theme can be controlled through parameters in in both the JSON and CSV format. Colors cab be provided in the formats Hex, RGB(A) and Names.

JSON

The style is provided in a style-node. If properties are left out or no style-node is provided the internal default light theme will be used.

{
    "style": {
        "textColor": "#D3D9E6",
        "timelineStrokeColor": "#D3D9E6",
        "strokeColor": "#353D4B",
        "fillColor": "#BAC8D3",
        "backgroundColor": "#3B4352"
    },
    "days": []
}

CSV

There is no optimal way of provide additional data in a CSV-file in addition to the data itself. The style is provided in a JSON-formated string as a last header.

Timestamp Title Description Fill Color Stroke Color {"style":{"textColor":"#D3D9E6","timelineStrokeColor":"#D3D9E6","strokeColor":"#353C4B","backgroundColor":"#3B4352"}}
2022-07-08 12:23 Patched webserver Some additional information about the activity #D0CEE2 #56517E
2022-07-08 18:36 Restarted application pool Some additional information about the activity #FAD7AC #C27B25
2022-07-10 12:05 New release application A Some additional information about the activity #B1DDF0 #10739E

Style JSON-string.

{"style":{"textColor":"#D3D9E6","timelineStrokeColor":"#D3D9E6","strokeColor":"#353C4B","backgroundColor":"#3B4352"}}

Meta information

The meta data can be controlled through parameters in in both the JSON and CSV format.

JSON

The meta data is provided in a meta-node. If properties are left out or no meta-node is provided the internal default meta data will be used. The internal uses the current version of the application along with en-us locale.

{
    "meta": {
        "version": "1.3.0",
        "locale": "sv-se"
    },
    "style": {},
    "days": []
}

CSV

There is no optimal way of provide additional data in a CSV-file in addition to the data itself. The meta data is provided in a JSON-formated string as a last header.

Timestamp Title Description Fill Color Stroke Color {"meta":{"version":"1.3.0","locale":"en-us"}}
2022-07-08 12:23 Patched webserver Some additional information about the activity #D0CEE2 #56517E
2022-07-08 18:36 Restarted application pool Some additional information about the activity #FAD7AC #C27B25
2022-07-10 12:05 New release application A Some additional information about the activity #B1DDF0 #10739E

Meta JSON-string.

{"meta":{"version":"1.3.0","locale":"en-us"}}

To have both style and meta data in the CSV file, use this JSON-string.

{"meta":{"version":"1.3.0","locale":"en-us"},"style":{"textColor":"#D3D9E6","timelineStrokeColor":"#D3D9E6","strokeColor":"#353C4B","backgroundColor":"#3B4352"}}

Get started

The dev-environment uses NPM so you need to have Node.js installed. I use Node version 16.16.0 and NPM version 8.16.0.

Clone the repo.

$ git clone https://github.com/qulle/activity-timeline.git

Install all dependencies from package.json.

$ npm install

Start the Parcel server.

$ npm start

Make build for distribution.

$ npm run build

Use the following command to remove dist directory. Uses rm -rf dist/ .parcel-cache/

$ npm run clean

Creds To

License

BSD-2-Clause License

Author

Qulle

activity-timeline's People

Contributors

qulle avatar

Stargazers

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