Code Monkey home page Code Monkey logo

khmccurdy / plotly_bacteria Goto Github PK

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

Full-stack data-driven web application for visualizing datasets about bacterial samples. Data was collected and filtered from a SQLite database using Flask and Python, then used to drive visualizations using Plotly.

Home Page: https://plotly-homework.herokuapp.com/

Python 18.72% JavaScript 64.90% HTML 16.38%
gauge-chart bacterial-samples flask-application sqlalchemy sqlite sqlite-database python heroku javascript d3 plotly plotlyjs bootstrap data-visualization data-filtering

plotly_bacteria's Introduction

Bacterial Sample Dashboard

This project is a full-stack data-driven web application for visualizing datasets about bacterial samples. Data was collected and filtered from a SQLite database using Flask and Python, then used to drive visualizations using Plotly. The gauge plot is a version of Plotly's custom Gauge Chart, modified to automate the tier count and associated color gradient. The app is deployed using Heroku.

Code Snippets of Note

Procedural coloration of gauge chart sectors based on a 3-color gradient

function threeColorLerp(value){
    var color1 = [132,181,137];
    var color2 = [213,229,153];
    var color3 = [248,243,236];

    value = value < 0 ? 0: value;
    value = value > 1 ? 0: value;

    var ca = value < 0.5 ? color1: color2;
    var cb = value < 0.5 ? color2: color3;
    var v = value < 0.5 ? value*2 : value*2-1;

    var newColor = ca.map((x,i)=>x+(cb[i]-x)*v);

    return `rgb(${newColor[0]},${newColor[1]},${newColor[2]})`
}
// Inside the trace for the gauge's donut-chart...
        marker: { 
            colors: [...Plotly.d3.range(numLevels)
                        .map(x=>threeColorLerp(x/numLevels)),
                    "rgba(0,0,0,0)"],
        },

plotly_bacteria's People

Contributors

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