Comments (5)
Hi!
Can you give me an example to replicate in my pc and start to debugging?
Probably is an issue with the d3 version.
from d3wordcloud.
Sure,
For the app below, it only shows the simpleNetworkOutput graph but not the wordcloud. If i comment out that line, i can see the output for wordcloud.
app = shinyApp(
ui = bootstrapPage(
p("Word Cloud"),
d3wordcloudOutput("wordCloud"),
simpleNetworkOutput("networkGraph")
),
server = function(input,output,session){
library(tm)
data("acq")
corpus = acq
dtm = DocumentTermMatrix(corpus)
output$wordCloud = renderD3wordcloud({
dtm = as.matrix(dtm)
freq = colSums(dtm)
freq = sort(freq, decreasing=TRUE)
freqDF = data.frame(Word=rownames(data.frame(freq)),Frequency=freq)
freqDF = freqDF[freqDF$Frequency>=10,]
d3wordcloud(freqDF$Word, freqDF$Frequency)
})
networkGraphPreprocess = reactive({
dtm_mtx = t(as.matrix(dtm))
dtm_mtx[dtm_mtx>=1] = 1
termMatrix = dtm_mtx %*% t(dtm_mtx)
g = graph.adjacency(termMatrix, weighted=T, mode="undirected")
g = simplify(g, remove.multiple=TRUE, remove.loops=TRUE)
V(g)$label = V(g)$name
V(g)$degree = degree(g)
g2 = induced.subgraph(g, E(g)[neighbors(g,"withdrawal")])
g2
})
output$networkGraph = renderSimpleNetwork({
g2 = networkGraphPreprocess()
g2 = get.data.frame(g2)
colnames(g2) = c("Source","Target","Weight")
simpleNetwork(g2,
width=550,
height=550,
fontSize = 10,
textColour = "#4f372d",
linkColour = "#4f372d",
nodeColour = "#cc2a36",
nodeClickColour = "#00a0b0",
opacity=0.8)
})
}
)
runApp(app)
from d3wordcloud.
Hi @sherrylau,
Please, download again and tell me if now your example works.
Aps, the next time please provide all the requiriments ;)
library("shiny")
library("networkD3")
library("d3wordcloud")
library("igraph")
it is easier / faster to reproduce the examples.
from d3wordcloud.
It works perfectly! Thanks for your help!
Sherry
from d3wordcloud.
Thank you for notice this error!
from d3wordcloud.
Related Issues (20)
- add scale parameter just like jason davis' demo HOT 1
- Wordcloud to be redrawn on shiny app resize HOT 2
- OnClick functionality ? HOT 4
- arguments imply differing number of rows HOT 5
- Error with d3wordcloud an hiden {.tabset} HOT 18
- study the resize functionality
- How to use it in html with JS? HOT 1
- tooltip location with Shiny
- Style clobbering HOT 2
- Word Cloud not updating when using a subset of inputs HOT 6
- Save wordcloud as png
- Unexpected Behavior (overlap and not disappear) HOT 4
- d3wordcloud’ is not available (for R version 3.5.1) HOT 3
- Add other fonts from https://www.google.com/fonts HOT 2
- require explicit col names of "word" and "freq" in input data frame HOT 1
- is it possible to change word colors? HOT 3
- tooltip? HOT 3
- bug (?) missing words HOT 7
- Possible to add filter to the plot? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from d3wordcloud.