Skip to content

Instantly share code, notes, and snippets.

View rpkyle's full-sized avatar
🤹‍♀️

Ryan Patrick Kyle rpkyle

🤹‍♀️
View GitHub Profile
@rpkyle
rpkyle / dash_cytoscape_demo.py
Created August 25, 2020 18:54
dash-cytoscape Demo for Python
import dash
import dash_cytoscape as cyto
import dash_html_components as html
app = dash.Dash(__name__)
app.layout = html.Div([
cyto.Cytoscape(
id='cytoscape-elements-boolean',
layout={'name': 'preset'},
@rpkyle
rpkyle / app.R
Created July 2, 2020 16:11
dashCytoscape Demo for R
library(dash)
library(dashCytoscape)
library(dashHtmlComponents)
app <- Dash$new()
app$layout(
cytoCytoscape(
id='cytoscape-elements-boolean',
layout = list(name = 'preset'),
@rpkyle
rpkyle / app.jl
Created July 2, 2020 16:08
DashCytoscape.jl Demo
using Dash, DashCytoscape, DashHtmlComponents
app = dash();
app.layout = html_div() do
cyto_cytoscape(
id="cytoscape-elements-boolean",
layout=(name="preset",),
style=(width="100%",
height="400px"),
@rpkyle
rpkyle / app.R
Last active August 5, 2021 19:31
Dash for R Stock Ticker Sample App
library(dash)
library(dashHtmlComponents)
library(dashCoreComponents)
library(quantmod)
getSymbols(c("Coke" = "COKE", "Tesla" = "TSLA", "Apple" = "AAPL"))
app <- Dash$new()
app$layout(
@rpkyle
rpkyle / app.py
Created June 27, 2020 14:47
Dash for Python Stock Ticker Sample App
import dash
from dash.dependencies import Input, Output
import dash_core_components as dcc
import dash_html_components as html
from pandas_datareader import data as web
from datetime import datetime as dt
app = dash.Dash('Hello World',
external_stylesheets=['https://codepen.io/chriddyp/pen/bWLwgP.css'])
@rpkyle
rpkyle / app.jl
Last active October 31, 2021 04:05
Dash for Julia Stock Ticker Sample App
using Dash, DashHtmlComponents, DashCoreComponents, HTTP, CSV, Dates, Printf
r = HTTP.request("GET", "https://finance.yahoo.com/quote/AMZN/history?p=AMZN");
crumb = match(r"(?:CrumbStore\"\:\{\"crumb\":\")(.*?)(?:\")", String(r.body)).captures;
session_cookie = match(r"(?:B=)(.*?)(?:;)", HTTP.header(r, "Set-Cookie")).captures;
app = dash();
app.layout = html_div(style=Dict("width"=>"500")) do
dcc_dropdown(
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
https://raw.githubusercontent.com/plotly/dash-docs/master/datasets/indicators.csv
We can't make this file beautiful and searchable because it's too large.
,ID,MONTH,SOLAR_INTENSITY,AREA
0,39,JAN,3.2481635877,0.010000000000000994
1,40,JAN,2.9908137082,0.009999999999999573
2,41,JAN,2.5826388806,0.009999999999999573
3,331,JAN,2.9603057123,0.010000000000000285
4,332,JAN,3.0632240666,0.009999999999998864
5,333,JAN,3.2605953749,0.009999999999998864
6,334,JAN,1.6881705015,0.010000000000000285
7,624,JAN,2.2027102024,0.010000000000000994
8,625,JAN,1.6610258483,0.009999999999999573
@rpkyle
rpkyle / _reserved_words.py
Last active November 8, 2018 16:12
List of R reserved words
# This is a set of R reserved words that cannot be used as function argument names.
#
# Reserved words can be obtained from R's help pages by executing the statement below:
# > ?reserved
reserved_words = set([
'if',
'else',
'repeat',
'while',
@rpkyle
rpkyle / yul_df.csv
Created October 16, 2018 17:28
Wx Data for Montreal (2016-2017)
We can't make this file beautiful and searchable because it's too large.
"stationID","parsedDate","Date/Time","Year","Month","Day","Data Quality","param","value","flags","City"
51157,2016-01-01,"2016-01-01",2016,1,1,NA,"Max Temp (°C)",0,NA,"Montreal"
51157,2016-01-02,"2016-01-02",2016,1,2,NA,"Max Temp (°C)",0.4,NA,"Montreal"
51157,2016-01-03,"2016-01-03",2016,1,3,NA,"Max Temp (°C)",0.2,NA,"Montreal"
51157,2016-01-04,"2016-01-04",2016,1,4,NA,"Max Temp (°C)",-12.9,NA,"Montreal"
51157,2016-01-05,"2016-01-05",2016,1,5,NA,"Max Temp (°C)",-6.3,NA,"Montreal"
51157,2016-01-06,"2016-01-06",2016,1,6,NA,"Max Temp (°C)",-0.3,NA,"Montreal"
51157,2016-01-07,"2016-01-07",2016,1,7,NA,"Max Temp (°C)",-0.4,NA,"Montreal"
51157,2016-01-08,"2016-01-08",2016,1,8,NA,"Max Temp (°C)",2.7,NA,"Montreal"
51157,2016-01-09,"2016-01-09",2016,1,9,NA,"Max Temp (°C)",4.3,NA,"Montreal"