Skip to main content

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

Release files for RTvisualize 1.1.19

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for RTvisualize 1.1.19
File Size Uploaded
RTvisualize-1.1.19.tar.gz 8.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for RTvisualize 1.1.19
File Interpreter ABI Platform
RTvisualize-1.1.19-py3-none-any.whl Python 3 none any Details

Total release size: 18.6 kB

Release files / RTvisualize-1.1.19.tar.gz

Download URL RTvisualize-1.1.19.tar.gz
Size 8.7 kB
Tags Source
SHA-256 checksum
How to use checksums
df32bca59cd377e528abbb6a25c9c195fe94b6cd19db982f69a72ccd1de2c53a
BLAKE2b-256 checksum
How to use checksums
257064e7d03b180badbe1bb25ba2ddc28b90169e03c2bd4d36e2d58951fe1349
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / RTvisualize-1.1.19-py3-none-any.whl

Download URL RTvisualize-1.1.19-py3-none-any.whl
Size 9.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a552260756e9c70646c8d662ce9a27a20ad139f7544b9eb856999eac6c663268
BLAKE2b-256 checksum
How to use checksums
dee7cd87660243d9a59c79ec6c134d15182e3209fb7a8c88952212c66de8cf4c
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

1.1.19 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page