Comments (3)
currently the colors in the legend only match the corresponding nodes for numeric attributes.
how does plot.network translate a non-numeric attribute into a color?
from statnetweb.
it uses network's (undocumented) as.color() function:
as.color
function (x)
{
if (is.numeric(x)) {
if (any(x != round(x), na.rm = TRUE)) {
return(gray((x - min(x))/(max(x) - min(x))))
}
else return(x)
}
if (is.factor(x)) {
return(match(levels(x)[x], levels(x)))
}
if (is.character(x)) {
if (all(is.color(x)))
return(x)
else {
return(match(x, sort(unique(x))))
}
}
}
which seems to be basically mapping each element (or factor level) to an integer value and then using the default palette
from statnetweb.
Thanks Skye!
The fill colors are fixed in commit cc4e503
from statnetweb.
Related Issues (20)
- Package structure revision needed to deploy HOT 5
- CRAN error HOT 6
- ecoli1 and 2 networks generate errors HOT 13
- deployApp error log HOT 1
- The click/hover for showing node info on the network plot is broken in the current version HOT 1
- ERGM not found in R studio HOT 14
- Error in writeImpl: Text to be written must be a length-one character vector HOT 3
- Nodal attributes do not display on network plot on hover HOT 5
- network plot crashes app on hover if there are no nodal attributes HOT 3
- Add interactive plot help pop-up HOT 1
- Link to commonly used terms no longer works
- ergm formula error on GOF plot when multiple models are saved HOT 3
- Error when installing ergm due to lpSolveAPI compilation error
- shiny 1.8.1 release breaks statnetWeb
- Term documentation not working properly HOT 1
- GOF plots mislabeled
- Release statnetWeb 0.6.0 HOT 1
- latex output in term descriptions not rendering properly HOT 1
- Remove "LazyData: true" from DESCRIPTION
- problems deploying update on shinyapps.io HOT 7
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 statnetweb.