Skip to content

Legend incorrectly captured #2007

@danton267

Description

@danton267
Member

library(plotly)
library(ggnet)
library(network)
library(sna)
library(ggplot2)

# random graph
net = rgraph(10, mode = "graph", tprob = 0.5)
net = network(net, directed = FALSE)

net %v% "phono" = ifelse(letters[1:10] %in% c("a", "e", "i"), "vowel", "consonant")


p <- ggnet2(net, color = "phono")

ggplotly(p)

Legend results in (1,contant,19,9) and (1,vowel,19,9) instead of contant and vowel

Activity

moutikabdessabour

moutikabdessabour commented on Oct 5, 2021

@moutikabdessabour
Contributor

This is caused by ggplotly taking in all the aesthetics even if they have only value. I don't know if this is the correct behavior or not? @cpsievert. I'll have a patch ready by tomorrow morning.

cpsievert

cpsievert commented on Nov 2, 2021

@cpsievert
Collaborator

@moutikabdessabour this seems like a tricky issue to fix without introducing other regressions, have you looked into it at all?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    Participants

    @cpsievert@jackparmer@moutikabdessabour@danton267

    Issue actions

      Legend incorrectly captured · Issue #2007 · plotly/plotly.R