Skip to content

Instantly share code, notes, and snippets.

View techzeero's full-sized avatar
🎯
Focusing

Techzeero techzeero

🎯
Focusing
View GitHub Profile
@techzeero
techzeero / Multi-Value Dropdown.py
Created March 3, 2022 14:13
Multi-Value Dropdown | Dash Plotly
from dash import Dash, dcc, html, Input, Output
app = Dash()
app.layout = html.Div([
dcc.Dropdown(
id='dropdown1' # Dropdown id
options=[{'label': 'India', 'value': 'India'},
{'label': 'Russia', 'value': 'Russia'},
{'label': 'USA', 'value': 'USA'}], # Data to be shown in dropdown options
from dash import Dash, dcc, html, Input, Output
app = Dash()
app.layout = html.Div([
dcc.Dropdown(
options=[{'label': 'India', 'value': 'India'},
{'label': 'Russia', 'value': 'Russia'},
{'label': 'USA', 'value': 'USA'}], # Data to be shown in dropdown options
value='India', # Dropdown Default Value
import dash
import dash_html_components as html
import dash_core_components as dcc
import plotly.express as px
from dash.dependencies import Input, Output
app = dash.Dash()
df = px.data.iris()
@app.callback(Output(component_id='graph', component_property= 'figure'),
[Input(component_id='dropdown', component_property= 'value')])
def graph_update(dropdown_value):
fig = px.scatter(df[df["species"]==dropdown_value], x="sepal_width", y="sepal_length")
fig.update_layout(title = 'Sapel Length and Width of Different Species',
xaxis_title = 'Sepal Width',
yaxis_title = 'Sepal Length')
return fig
app = dash.Dash()
df = px.data.iris()
app.layout = html.Div([
html.H1(
id = 'H1',
children = 'Styling using html components',
style = {'textAlign':'center', 'marginTop':40,'marginBottom':40}
),
import dash
from dash import html
from dash import dcc
import plotly.express as px
pip install dash
pip install dash-html-components
pip install dash-core-components
pip install plotly
/*
Home Automtion Using NodeMCU over a PHP Website
Visit: https://techzeero.com/iot-projects/home-automation-over-online-server-using-nodemcu-and-php-website
*/
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
const char* ssid = "CHANGE WITH YOUR WIFI NAME";
const char* password = "CHANGE WITH YOUR WIFI PASSWORD";
/*
Arduino Arithmetic Operators
For more details, visit: https://techzeero.com/arduino-tutorials/arduino-arithmetic-operators/
*/
void setup() {
int a = 2;
int b = 3;
int result;
float result_fl;
/*
Arduino String Manipulation by Functions
For more details, visit: https://techzeero.com/arduino-tutorials/arduino-string-functionality/
*/
void setup() {
char str[] = "This is my string"; // create a string
char out_str[40]; // output from string functions placed here
int num; // general purpose integer
Serial.begin(9600);