Skip to main content

A general purpose realtime visualization

Project description

Real time visualization

This program enables users to conveniently visualize their data in a real-time manner using the power of Dash and Plotly. The program reads the data from CSV files and generates graphs on a web browser. The graphs will be updated automatically upon changes to the files.

Installation

This package can be installed using pip:

pip install RTvisualize

or download the package and command:

python install setup.py

Quick start

The library requires a setting variable for execution, where the user can specify as many plots as desired for simultaneous visualization. A generic template looks like this,

from realtime import monitor
settings = {
    'name1': {...}, # specifications for the 1st graph
    'name2':{...} # specifications for the 2nd graph
monitor.watch(settings).run(IP='0.0.0.0`) # runs the server and maps the graphs on the specified IP:8050 address

The specifications of each plot contains a few important entries from the user. Generally, two types of approaches can be taken in using the library; first, using build-in plots; and second, using custom plots.

Build-in plots

The library provides the following build-in plots:

See the example.

Line plots

Line plots intends to monitor the progression of variables during time (see Plotly line plots). The required specifications entry for the line plots looks like,

    'plot1':{
            'graph_dir' = 'path/to/CSV/file1.csv', # directory to csv file containing the data
            'graph_type' = 'lines', # specifies the graph type
    }

Additional settings available for line plots are,

            'col': 'col s5', # specifies grid size for the html page
            'x-axis-moves' = True, # whether to move the x-axis by holding the x-length fixed
            'x-axis-length' = 50 # if the above flag is True, specify the x-axis length

For the html grid specification see here. The csv file needs to be formated in a vertical shape with the name of the variable as column title. User can use as many variables as intended to be plotted on the same graph. See example.

Scatter plots 2D

The required specifications entry for the line plots looks like,

    'plot2':{
            'graph_dir' = 'path/to/CSV/file2.csv', # directory to csv file containing the data
            'graph_type' = 'scatter2', # specifies the graph type
    }

Additional settings available,

            'col': 'col s5', # specifies grid size for the html page

For scatter plots, the information x,y,type,size needs to be provided for each scatter point (see example).

Scatter plots 3D

The specifications entry for scatter plot 3D is similar to scatter 2D with the exeptions of:

        'graph_type' = 'scatter3'

and the csv formatting is similar to the scatter 2D with the exception of having an additional zitem, i.e. x,y,z,type,size.

Map plot

Map plot intends to visualize a heteregenous variable accross a domain. It uses similar method as scatter 2D but the range of colors is contineous. The specifications entry for the map plot is similar to scatter 2D with the exeptions of:

        'graph_type' = 'map',
        'color_range' = [0,100] #optional. To fix the color range 

The CSV formatting is similar to scatter 2D .

Custom plots

This approach enables the user to construct the plot in a desired way and pass it to the program together with CSV file,

from realtime import monitor
def figure1(data):
    fig = px.scatter(
        data,
        x=data["x"],
        y=data["y"],
        size=data["size"]
    )
    return fig
settings = {
    "plot1": {
            "graph_dir" : "path/to/CSV/file1.csv",
            "graph_type" : 'custom', # this is different than build-in plots
            "figure" : figure1, # this provides the plotting function
            "col" : 'col s5'
           }
}

An example of this type can be found here.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Authors

  • Jalil Nourisa

Acknowledgments

Inspired by sentdex

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

RTvisualize-1.1.19.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

RTvisualize-1.1.19-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file RTvisualize-1.1.19.tar.gz.

File metadata

  • Download URL: RTvisualize-1.1.19.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.7.9

File hashes

Hashes for RTvisualize-1.1.19.tar.gz
Algorithm Hash digest
SHA256 df32bca59cd377e528abbb6a25c9c195fe94b6cd19db982f69a72ccd1de2c53a
MD5 7ce5f90ffa37fb752bd0f2bc5763a068
BLAKE2b-256 257064e7d03b180badbe1bb25ba2ddc28b90169e03c2bd4d36e2d58951fe1349

See more details on using hashes here.

File details

Details for the file RTvisualize-1.1.19-py3-none-any.whl.

File metadata

  • Download URL: RTvisualize-1.1.19-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.7.9

File hashes

Hashes for RTvisualize-1.1.19-py3-none-any.whl
Algorithm Hash digest
SHA256 a552260756e9c70646c8d662ce9a27a20ad139f7544b9eb856999eac6c663268
MD5 ebda25825e35d1ff798da6a5018a26ac
BLAKE2b-256 dee7cd87660243d9a59c79ec6c134d15182e3209fb7a8c88952212c66de8cf4c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page