Coder Social home page Coder Social logo

ramsailopal / yotta-sparkline Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 143 KB

A demo of react-sparkline alongside YottaDB with a vital signs dashboard the use case

Shell 11.31% Lua 21.63% JavaScript 29.17% HTML 30.58% Go 1.70% Python 5.61%
react-sparkline sparkline yottadb vital-signs mumps

yotta-sparkline's Introduction

Yotta-Sparkline

A demo of react-sparkline extracting data from YottaDB with a vital signs dashboard as the use case

Alt text

Gitpod

Open in Gitpod

Execution

Install Docker and docker-compose and then:

  git clone https://github.com/RamSailopal/Yotta-Sparkline
  cd Yotta-Sparkline/Docker
  export apiadd='http://dockerserveraddress:9090'
  docker-compose up

Viewing the chart

Due to blocked cross origin requests, A CORS browser add-on also needs to be added and enabled https://addons.mozilla.org/en-GB/firefox/addon/cors-everywhere/

https://chrome.google.com/webstore/detail/cors-unblock/lfhmikememgdcahcdlaciloancbhjino?hl=en

With the firefox addon, ensure that the plugin is enabled in the browser header as in the image below:

Alt text

This contrasts to when CORS is disabled as in the image below:

Alt text

Once the addons are installed, navigate your browser to http://dockerserveraddress:8080

YottaDB data

The data for the sparkline chart is stored in the global VITALS i.e:

  ^VITALS("pulse","26082022135910")=92
  ^VITALS("pulse","26082022135915")=81
  ^VITALS("pulse","26082022135920")=118
  ^VITALS("resp","26082022135910")=20
  ^VITALS("resp","26082022135915")=19
  ^VITALS("resp","26082022135920")=16
  ^VITALS("temp","26082022135910")=36.8
  ^VITALS("temp","26082022135915")=37.2
  ^VITALS("temp","26082022135920")=36.8

The first subscript represents the category of reading and the second a date/time stamp in the format (daymonthyearhourminutesseconds)

This is then exposed as an array for each reading using Lua and Pegasus - https://evandrolg.github.io/pegasus.lua/

The ^VITALS global is populated with random figures within excepted ranges for each reading, using a Python script that adds new readings every 5 seconds. This is achieved through the gen.py script in the Docker/sparkline directory

The data can be view by navigating to:

http://dockerserveraddress:9090/temp for temperature readings

http://dockerserveraddress:9090/pulse for heart rate readings

http://dockerserveraddress:9090/resp for respiratory readings

References

react-sparkline - https://github.com/borisyankov/react-sparklines

YottaDB - https://yottadb.com

yotta-sparkline's People

Contributors

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