This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Dexie.js Table Delete Demo</title> | |
<meta name="description" content="Add and delete storage tables in IndexedDB thru Dexie.js"> | |
<meta name="author" content="helgasoft.com"> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<script src="https://unpkg.com/dexie/dist/dexie.min.js" type="text/javascript"></script> | |
<!-- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# dygraph workaround: how to avoid time gaps in financial data display | |
# Please add your voice for a permanent fix in the following thread: | |
# https://github.com/rstudio/dygraphs/issues/70 | |
# TODO: date+time "2017-01-25 09:00:00" - looks like the JS environment can't deal with this format !? | |
library(shiny) | |
library(dygraphs) | |
ui <- fluidPage( | |
titlePanel("Dygraph stock data"), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Demo - using Leaflet JS plugins in R and Shiny | |
# directions from https://gist.github.com/jcheng5/c084a59717f18e947a17955007dc5f92 | |
# implementing an Opacity plugin that works for tile-layers only: | |
# https://github.com/dayjournal/Leaflet.Control.Opacity | |
# download js/css files first, see note (2) below | |
library(shiny) | |
library(leaflet) | |
library(htmlwidgets) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://gist.github.com/helgasoft/a766acbd3c0af07b9faf6e62a94f9246 | |
library(shiny) | |
library(quantmod) | |
ui <- fluidPage( | |
titlePanel("Volume inside chart_Series"), | |
mainPanel( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
indiv <- c('NA'=1,'STOCH'=2,'SMI'=3,'MACD'=4,'ROC'=5,'MFI'=6,'RSI'=7,'CCI'=8) | |
ui <- fluidPage( | |
titlePanel("Customize dropdown label thru Javascript"), | |
mainPanel( | |
fluidRow( selectInput(inputId="indik", label="Indicator", choices=indiv), | |
"click checkbox to reset the dropdown" | |
), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Example github pages</title> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<link | |
rel="stylesheet" | |
href="https://unpkg.com/leaflet@1.5.1/dist/leaflet.css" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# simple echart with one symbol and line,area,point | |
library(quantmod); library(echarts4r); library(dplyr) | |
getSymbols("IBM", from='2019-01-01') | |
IBM <- as.data.frame(IBM) | |
names(IBM) <- c("open", "high", "low", "close", "volume", "adjusted") | |
df <- round(IBM, 2) %>% mutate(sym="IBM", date=row.names(IBM)) | |
ivl <- c("2019-10-03", "2020-04-03") # mark area interval | |
sset <- df %>% filter(between(as.Date(date), as.Date(ivl[1]),as.Date(ivl[2]))) | |
fit <- lm(Cl(sset) ~ c(1:nrow(sset))) # linear regression btw two dates |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' Demo - using Leaflet JS plugins in R and Shiny | |
#' directions from https://gist.github.com/jcheng5/c084a59717f18e947a17955007dc5f92 | |
#' implementing groupings to overlay layers : | |
#' https://github.com/ismyrnow/leaflet-groupedlayercontrol | |
#' todo: would be nice to addMarkers to group layers from R, not only from JS | |
library(shiny) | |
library(leaflet) | |
library(htmlwidgets) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ------ 1) prepare data | |
library(tibble) | |
dim <- 12500 # sample data half-quantity | |
slip <- if (dim %% 2) 0.1 else -0.1 | |
setData <- function(offset) { | |
t <- tibble(x = runif(dim, max=10), | |
y = offset + sin(x) - x * slip * runif(dim)) | |
round(t,3) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
library(stringr) | |
library(echarty) | |
library(rclipboard) # for clipboard Copy button | |
library(formatR) | |
if (FALSE) { # notes | |
#' problem plot with Chinese chars: | |
#' text='<U+6F0F><U+6597><U+56FE>' > Sys.getlocale() |
OlderNewer